| Current File : /home/bwalansa/www/wp-content/plugins/event-organiser/js/dist/license-field.js |
/******/ (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 = "./js/settings/licenses.jsx");
/******/ })
/************************************************************************/
/******/ ({
/***/ "./js/settings/license-field.jsx":
/*!***************************************!*\
!*** ./js/settings/license-field.jsx ***!
\***************************************/
/*! 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 LicenseField; });
/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/components */ "./node_modules/@wordpress/components/build-module/index.js");
class LicenseField extends React.Component {
constructor(props) {
super(props);
this.mask = 'XXXX-XXXX-XXXX-XXXX';
this.state = {
validating: false,
removing: false,
value: this.applyMask(this.props.license),
valid: this.props.status == 'valid',
status: this.props.status,
expires: this.props.expires
};
this.onChange = this.onChange.bind(this);
this.onClickValidate = this.onClickValidate.bind(this);
this.onClickDissociate = this.onClickDissociate.bind(this);
this.validateOnEnter = this.validateOnEnter.bind(this);
}
onChange(event) {
this.setState({
value: this.applyMask(event.target.value.replace(/[^A-z0-9]/g, '').toUpperCase())
});
}
validateOnEnter(event) {
if (event.key === 'Enter') {
this.onClickValidate(event);
}
}
onClickValidate(event) {
event.preventDefault();
this.setState({
validating: true
});
var that = this;
jQuery.post({
url: 'http://localhost:8080/wp-json/eventorg/v1/license',
contentType: 'application/json',
//headers: {"X-WP-Nonce": eventorganiserpro.auth_nonce},
dataType: 'json',
contentType: 'application/json',
data: JSON.stringify({
'key': this.state.value,
'id': this.props.id,
'item': this.props.slug
}),
success: function (resp) {
console.log(resp);
that.setState({
validating: false,
valid: resp.status === 'valid',
status: resp.status,
expires: resp.expires
});
}
});
}
onClickDissociate(event) {
event.preventDefault();
this.setState({
removing: true
});
var that = this;
jQuery.post({
url: 'http://localhost:8080/wp-json/eventorg/v1/remove-license',
contentType: 'application/json',
//headers: {"X-WP-Nonce": eventorganiserpro.auth_nonce},
dataType: 'json',
contentType: 'application/json',
data: JSON.stringify({
'key': this.state.value,
'id': this.props.id,
'item': this.props.slug
}),
success: function (resp) {
that.setState({
removing: false,
value: '',
valid: false,
status: null,
expires: null
});
}
});
}
applyMask(string) {
var formattedString = "";
var numberPos = 0;
for (var j = 0; j < this.mask.length; j++) {
var currentMaskChar = this.mask[j];
if (currentMaskChar == "X") {
var char = string.charAt(numberPos);
if (!char) {
break;
}
formattedString += char;
numberPos++;
} else {
formattedString += currentMaskChar;
}
}
return formattedString;
}
daysUntilExpires() {
var expires = this.state.expires ? new Date(this.state.expires) : null;
if (!expires) {
return false;
}
var diffTime = expires - new Date();
console.log(diffTime);
var diffDays = Math.ceil(diffTime / (1000 * 60 * 60 * 24));
console.log(diffDays);
return diffDays;
}
expiresSoon() {
var expires = this.state.expires ? new Date(this.state.expires) : null;
var daysUntilExpires = this.daysUntilExpires();
return expires - new Date() >= 0 && daysUntilExpires < 21;
}
expired() {
var expires = this.state.expires ? new Date(this.state.expires) : null;
return expires - new Date() < 0;
}
status() {
var status = this.state.status;
if (status == 'valid' && this.expiresSoon()) {
status = 'expires-soon';
} else if (status == 'valid' && this.expired()) {
status = 'license-expired';
}
return status;
}
renderMessage() {
switch (this.status()) {
case 'no-key-given':
return 'Please enter a key';
case 'invalid-license-format':
return 'Your license key should be a 16 characters long and contain only numbers and letters';
case 'invalid-response':
return 'There was an error in authenticating the license key status';
case 'key-not-found':
case 'license-not-found':
return 'Invalid license key';
case 'license-suspended':
return 'License key is no longer valid';
case 'expires-soon':
var daysUntilExpires = this.daysUntilExpires();
let text = daysUntilExpires > 1 ? daysUntilExpires + ' days' : daysUntilExpires + ' day';
return React.createElement("span", null, "Your license key will expire in ", text, ". To continue to recieve updates and support you will need to ", React.createElement("a", {
href: "https://wp-event-organiser.com/account/"
}, "renew your license"));
case 'license-expired':
return React.createElement("span", null, "Your license key has expired. To continue to recieve updates and support you will need to ", React.createElement("a", {
href: "https://wp-event-organiser.com/extensions/"
}, "purchase a new license"));
case 'incorrect-product':
return React.createElement("span", null, "License key is not valid for this product. Check that you are using the correct license key for this extension.");
case 'site-limit-reached':
return React.createElement("span", null, "Your license key has reached its site limit. You can view the sites using the key, and remove it from sites that no longer require it by ", React.createElement("a", {
href: "https://wp-event-organiser.com/account"
}, "logging into your account"), ".");
}
}
render() {
return React.createElement("div", null, React.createElement("input", {
type: "text",
className: this.status() === 'valid' ? 'valid' : this.status() === 'expires-soon' ? 'expires-soon' : 'invalid',
style: styles,
placeholder: this.mask,
onChange: this.onChange,
value: this.state.value,
onKeyDown: this.validateOnEnter
}), React.createElement(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__["Button"], {
onClick: this.onClickValidate,
isPrimary: true,
isBusy: this.state.validating,
disabled: this.state.validating
}, this.state.validating ? "Validating..." : "Apply"), React.createElement(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__["Button"], {
onClick: this.onClickDissociate,
isTertiary: true //isBusy={this.state.removing}
,
disabled: this.state.removing
}, this.state.removing ? "Remove key..." : "Dissociate"), React.createElement("p", {
className: "description"
}, this.renderMessage()), this.state.expires, this.daysUntilExpires(), this.state.status, this.status());
}
}
var styles = {
fontFamily: 'monospace',
lineHeight: '1.5em',
marginRight: '15px',
backgroundRepeat: 'no-repeat',
backgroundPositionX: '100%',
paddingRight: '25px'
};
/***/ }),
/***/ "./js/settings/licenses.jsx":
/*!**********************************!*\
!*** ./js/settings/licenses.jsx ***!
\**********************************/
/*! no exports provided */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _license_field__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./license-field */ "./js/settings/license-field.jsx");
class Licenses extends React.Component {
constructor(props) {
super(props);
console.log(props);
console.log(this.props.extensions);
}
render() {
return React.createElement("table", {
className: "form-table"
}, React.createElement("tbody", null, this.props.extensions.map(extension => {
return React.createElement("tr", {
key: extension.id
}, React.createElement("th", {
scope: "row"
}, React.createElement("label", {
htmlFor: extension.id
}, extension.label)), React.createElement("td", null, React.createElement(_license_field__WEBPACK_IMPORTED_MODULE_0__["default"], {
id: extension.id,
slug: extension.slug,
license: extension.key,
status: extension.status,
expires: extension.expires
})));
})));
}
}
const domContainer = document.querySelector('#eo-licenses');
console.log(eoLicenses);
ReactDOM.render(wp.element.createElement(Licenses, {
extensions: eoLicenses.extensions
}), domContainer);
/***/ }),
/***/ "./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/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/asyncToGenerator.js":
/*!*********************************************************************!*\
!*** ./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.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 _asyncToGenerator; });
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
try {
var info = gen[key](arg);
var value = info.value;
} catch (error) {
reject(error);
return;
}
if (info.done) {
resolve(value);
} else {
Promise.resolve(value).then(_next, _throw);
}
}
function _asyncToGenerator(fn) {
return function () {
var self = this,
args = arguments;
return new Promise(function (resolve, reject) {
var gen = fn.apply(self, args);
function _next(value) {
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
}
function _throw(err) {
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
}
_next(undefined);
});
};
}
/***/ }),
/***/ "./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) {
if (!(Symbol.iterator in Object(arr) || Object.prototype.toString.call(arr) === "[object Arguments]")) {
return;
}
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/@babel/runtime/regenerator/index.js":
/*!**********************************************************!*\
!*** ./node_modules/@babel/runtime/regenerator/index.js ***!
\**********************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
module.exports = __webpack_require__(/*! regenerator-runtime */ "./node_modules/regenerator-runtime/runtime.js");
/***/ }),
/***/ "./node_modules/@tannin/compile/index.js":
/*!***********************************************!*\
!*** ./node_modules/@tannin/compile/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 compile; });
/* harmony import */ var _tannin_postfix__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tannin/postfix */ "./node_modules/@tannin/postfix/index.js");
/* harmony import */ var _tannin_evaluate__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @tannin/evaluate */ "./node_modules/@tannin/evaluate/index.js");
/**
* Given a C expression, returns a function which can be called to evaluate its
* result.
*
* @example
*
* ```js
* import compile from '@tannin/compile';
*
* const evaluate = compile( 'n > 1' );
*
* evaluate( { n: 2 } );
* // ⇒ true
* ```
*
* @param {string} expression C expression.
*
* @return {Function} Compiled evaluator.
*/
function compile(expression) {
var terms = Object(_tannin_postfix__WEBPACK_IMPORTED_MODULE_0__["default"])(expression);
return function (variables) {
return Object(_tannin_evaluate__WEBPACK_IMPORTED_MODULE_1__["default"])(terms, variables);
};
}
/***/ }),
/***/ "./node_modules/@tannin/evaluate/index.js":
/*!************************************************!*\
!*** ./node_modules/@tannin/evaluate/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 evaluate; });
/**
* Operator callback functions.
*
* @type {Object}
*/
var OPERATORS = {
'!': function (a) {
return !a;
},
'*': function (a, b) {
return a * b;
},
'/': function (a, b) {
return a / b;
},
'%': function (a, b) {
return a % b;
},
'+': function (a, b) {
return a + b;
},
'-': function (a, b) {
return a - b;
},
'<': function (a, b) {
return a < b;
},
'<=': function (a, b) {
return a <= b;
},
'>': function (a, b) {
return a > b;
},
'>=': function (a, b) {
return a >= b;
},
'==': function (a, b) {
return a === b;
},
'!=': function (a, b) {
return a !== b;
},
'&&': function (a, b) {
return a && b;
},
'||': function (a, b) {
return a || b;
},
'?:': function (a, b, c) {
if (a) {
throw b;
}
return c;
}
};
/**
* Given an array of postfix terms and operand variables, returns the result of
* the postfix evaluation.
*
* @example
*
* ```js
* import evaluate from '@tannin/evaluate';
*
* // 3 + 4 * 5 / 6 ⇒ '3 4 5 * 6 / +'
* const terms = [ '3', '4', '5', '*', '6', '/', '+' ];
*
* evaluate( terms, {} );
* // ⇒ 6.333333333333334
* ```
*
* @param {string[]} postfix Postfix terms.
* @param {Object} variables Operand variables.
*
* @return {*} Result of evaluation.
*/
function evaluate(postfix, variables) {
var stack = [],
i,
j,
args,
getOperatorResult,
term,
value;
for (i = 0; i < postfix.length; i++) {
term = postfix[i];
getOperatorResult = OPERATORS[term];
if (getOperatorResult) {
// Pop from stack by number of function arguments.
j = getOperatorResult.length;
args = Array(j);
while (j--) {
args[j] = stack.pop();
}
try {
value = getOperatorResult.apply(null, args);
} catch (earlyReturn) {
return earlyReturn;
}
} else if (variables.hasOwnProperty(term)) {
value = variables[term];
} else {
value = +term;
}
stack.push(value);
}
return stack[0];
}
/***/ }),
/***/ "./node_modules/@tannin/plural-forms/index.js":
/*!****************************************************!*\
!*** ./node_modules/@tannin/plural-forms/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 pluralForms; });
/* harmony import */ var _tannin_compile__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tannin/compile */ "./node_modules/@tannin/compile/index.js");
/**
* Given a C expression, returns a function which, when called with a value,
* evaluates the result with the value assumed to be the "n" variable of the
* expression. The result will be coerced to its numeric equivalent.
*
* @param {string} expression C expression.
*
* @return {Function} Evaluator function.
*/
function pluralForms(expression) {
var evaluate = Object(_tannin_compile__WEBPACK_IMPORTED_MODULE_0__["default"])(expression);
return function (n) {
return +evaluate({
n: n
});
};
}
/***/ }),
/***/ "./node_modules/@tannin/postfix/index.js":
/*!***********************************************!*\
!*** ./node_modules/@tannin/postfix/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 postfix; });
var PRECEDENCE, OPENERS, TERMINATORS, PATTERN;
/**
* Operator precedence mapping.
*
* @type {Object}
*/
PRECEDENCE = {
'(': 9,
'!': 8,
'*': 7,
'/': 7,
'%': 7,
'+': 6,
'-': 6,
'<': 5,
'<=': 5,
'>': 5,
'>=': 5,
'==': 4,
'!=': 4,
'&&': 3,
'||': 2,
'?': 1,
'?:': 1
};
/**
* Characters which signal pair opening, to be terminated by terminators.
*
* @type {string[]}
*/
OPENERS = ['(', '?'];
/**
* Characters which signal pair termination, the value an array with the
* opener as its first member. The second member is an optional operator
* replacement to push to the stack.
*
* @type {string[]}
*/
TERMINATORS = {
')': ['('],
':': ['?', '?:']
};
/**
* Pattern matching operators and openers.
*
* @type {RegExp}
*/
PATTERN = /<=|>=|==|!=|&&|\|\||\?:|\(|!|\*|\/|%|\+|-|<|>|\?|\)|:/;
/**
* Given a C expression, returns the equivalent postfix (Reverse Polish)
* notation terms as an array.
*
* If a postfix string is desired, simply `.join( ' ' )` the result.
*
* @example
*
* ```js
* import postfix from '@tannin/postfix';
*
* postfix( 'n > 1' );
* // ⇒ [ 'n', '1', '>' ]
* ```
*
* @param {string} expression C expression.
*
* @return {string[]} Postfix terms.
*/
function postfix(expression) {
var terms = [],
stack = [],
match,
operator,
term,
element;
while (match = expression.match(PATTERN)) {
operator = match[0]; // Term is the string preceding the operator match. It may contain
// whitespace, and may be empty (if operator is at beginning).
term = expression.substr(0, match.index).trim();
if (term) {
terms.push(term);
}
while (element = stack.pop()) {
if (TERMINATORS[operator]) {
if (TERMINATORS[operator][0] === element) {
// Substitution works here under assumption that because
// the assigned operator will no longer be a terminator, it
// will be pushed to the stack during the condition below.
operator = TERMINATORS[operator][1] || operator;
break;
}
} else if (OPENERS.indexOf(element) >= 0 || PRECEDENCE[element] < PRECEDENCE[operator]) {
// Push to stack if either an opener or when pop reveals an
// element of lower precedence.
stack.push(element);
break;
} // For each popped from stack, push to terms.
terms.push(element);
}
if (!TERMINATORS[operator]) {
stack.push(operator);
} // Slice matched fragment from expression to continue match.
expression = expression.substr(match.index + operator.length);
} // Push remainder of operand, if exists, to terms.
expression = expression.trim();
if (expression) {
terms.push(expression);
} // Pop remaining items from stack into terms.
return terms.concat(stack.reverse());
}
/***/ }),
/***/ "./node_modules/@wordpress/a11y/build-module/addContainer.js":
/*!*******************************************************************!*\
!*** ./node_modules/@wordpress/a11y/build-module/addContainer.js ***!
\*******************************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/**
* Build the live regions markup.
*
* @param {string} ariaLive Optional. Value for the 'aria-live' attribute, default 'polite'.
*
* @return {Object} $container The ARIA live region jQuery object.
*/
var addContainer = function addContainer(ariaLive) {
ariaLive = ariaLive || 'polite';
var container = document.createElement('div');
container.id = 'a11y-speak-' + ariaLive;
container.className = 'a11y-speak-region';
container.setAttribute('style', 'position: absolute;' + 'margin: -1px;' + 'padding: 0;' + 'height: 1px;' + 'width: 1px;' + 'overflow: hidden;' + 'clip: rect(1px, 1px, 1px, 1px);' + '-webkit-clip-path: inset(50%);' + 'clip-path: inset(50%);' + 'border: 0;' + 'word-wrap: normal !important;');
container.setAttribute('aria-live', ariaLive);
container.setAttribute('aria-relevant', 'additions text');
container.setAttribute('aria-atomic', 'true');
document.querySelector('body').appendChild(container);
return container;
};
/* harmony default export */ __webpack_exports__["default"] = (addContainer);
/***/ }),
/***/ "./node_modules/@wordpress/a11y/build-module/clear.js":
/*!************************************************************!*\
!*** ./node_modules/@wordpress/a11y/build-module/clear.js ***!
\************************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/**
* Clear the a11y-speak-region elements.
*/
var clear = function clear() {
var regions = document.querySelectorAll('.a11y-speak-region');
for (var i = 0; i < regions.length; i++) {
regions[i].textContent = '';
}
};
/* harmony default export */ __webpack_exports__["default"] = (clear);
/***/ }),
/***/ "./node_modules/@wordpress/a11y/build-module/filterMessage.js":
/*!********************************************************************!*\
!*** ./node_modules/@wordpress/a11y/build-module/filterMessage.js ***!
\********************************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
var previousMessage = '';
/**
* Filter the message to be announced to the screenreader.
*
* @param {string} message The message to be announced.
*
* @return {string} The filtered message.
*/
var filterMessage = function filterMessage(message) {
/*
* Strip HTML tags (if any) from the message string. Ideally, messages should
* be simple strings, carefully crafted for specific use with A11ySpeak.
* When re-using already existing strings this will ensure simple HTML to be
* stripped out and replaced with a space. Browsers will collapse multiple
* spaces natively.
*/
message = message.replace(/<[^<>]+>/g, ' ');
if (previousMessage === message) {
message += "\xA0";
}
previousMessage = message;
return message;
};
/* harmony default export */ __webpack_exports__["default"] = (filterMessage);
/***/ }),
/***/ "./node_modules/@wordpress/a11y/build-module/index.js":
/*!************************************************************!*\
!*** ./node_modules/@wordpress/a11y/build-module/index.js ***!
\************************************************************/
/*! exports provided: setup, speak */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setup", function() { return setup; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "speak", function() { return speak; });
/* harmony import */ var _wordpress_dom_ready__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/dom-ready */ "./node_modules/@wordpress/dom-ready/build-module/index.js");
/* harmony import */ var _addContainer__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./addContainer */ "./node_modules/@wordpress/a11y/build-module/addContainer.js");
/* harmony import */ var _clear__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./clear */ "./node_modules/@wordpress/a11y/build-module/clear.js");
/* harmony import */ var _filterMessage__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./filterMessage */ "./node_modules/@wordpress/a11y/build-module/filterMessage.js");
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
/**
* Create the live regions.
*/
var setup = function setup() {
var containerPolite = document.getElementById('a11y-speak-polite');
var containerAssertive = document.getElementById('a11y-speak-assertive');
if (containerPolite === null) {
containerPolite = Object(_addContainer__WEBPACK_IMPORTED_MODULE_1__["default"])('polite');
}
if (containerAssertive === null) {
containerAssertive = Object(_addContainer__WEBPACK_IMPORTED_MODULE_1__["default"])('assertive');
}
};
/**
* Run setup on domReady.
*/
Object(_wordpress_dom_ready__WEBPACK_IMPORTED_MODULE_0__["default"])(setup);
/**
* Allows you to easily announce dynamic interface updates to screen readers using ARIA live regions.
* This module is inspired by the `speak` function in wp-a11y.js
*
* @param {string} message The message to be announced by Assistive Technologies.
* @param {string} ariaLive Optional. The politeness level for aria-live. Possible values:
* polite or assertive. Default polite.
*
* @example
* ```js
* import { speak } from '@wordpress/a11y';
*
* // For polite messages that shouldn't interrupt what screen readers are currently announcing.
* speak( 'The message you want to send to the ARIA live region' );
*
* // For assertive messages that should interrupt what screen readers are currently announcing.
* speak( 'The message you want to send to the ARIA live region', 'assertive' );
* ```
*/
var speak = function speak(message, ariaLive) {
// Clear previous messages to allow repeated strings being read out.
Object(_clear__WEBPACK_IMPORTED_MODULE_2__["default"])();
message = Object(_filterMessage__WEBPACK_IMPORTED_MODULE_3__["default"])(message);
var containerPolite = document.getElementById('a11y-speak-polite');
var containerAssertive = document.getElementById('a11y-speak-assertive');
if (containerAssertive && 'assertive' === ariaLive) {
containerAssertive.textContent = message;
} else if (containerPolite) {
containerPolite.textContent = message;
}
};
/***/ }),
/***/ "./node_modules/@wordpress/components/build-module/animate/index.js":
/*!**************************************************************************!*\
!*** ./node_modules/@wordpress/components/build-module/animate/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_slicedToArray__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/slicedToArray */ "./node_modules/@babel/runtime/helpers/esm/slicedToArray.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__);
/**
* External dependencies
*/
function Animate(_ref) {
var type = _ref.type,
_ref$options = _ref.options,
options = _ref$options === void 0 ? {} : _ref$options,
children = _ref.children;
if (type === 'appear') {
var _classnames;
var _options$origin = options.origin,
origin = _options$origin === void 0 ? 'top' : _options$origin;
var _origin$split = origin.split(' '),
_origin$split2 = Object(_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_1__["default"])(_origin$split, 2),
yAxis = _origin$split2[0],
_origin$split2$ = _origin$split2[1],
xAxis = _origin$split2$ === void 0 ? 'center' : _origin$split2$;
return children({
className: classnames__WEBPACK_IMPORTED_MODULE_2___default()('components-animate__appear', (_classnames = {}, Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__["default"])(_classnames, 'is-from-' + xAxis, xAxis !== 'center'), Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__["default"])(_classnames, 'is-from-' + yAxis, yAxis !== 'middle'), _classnames))
});
}
if (type === 'slide-in') {
var _options$origin2 = options.origin,
_origin = _options$origin2 === void 0 ? 'left' : _options$origin2;
return children({
className: classnames__WEBPACK_IMPORTED_MODULE_2___default()('components-animate__slide-in', 'is-from-' + _origin)
});
}
return children({});
}
/* harmony default export */ __webpack_exports__["default"] = (Animate);
/***/ }),
/***/ "./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_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_createClass__WEBPACK_IMPORTED_MODULE_6__ = __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_7__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inherits */ "./node_modules/@babel/runtime/helpers/esm/inherits.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 */ "./node_modules/@wordpress/element/build-module/index.js");
/* 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 */ "./node_modules/@wordpress/keycodes/build-module/index.js");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @wordpress/i18n */ "./node_modules/@wordpress/i18n/build-module/index.js");
/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! @wordpress/compose */ "./node_modules/@wordpress/compose/build-module/index.js");
/* harmony import */ var _wordpress_rich_text__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! @wordpress/rich-text */ "./node_modules/@wordpress/rich-text/build-module/index.js");
/* harmony import */ var _wordpress_dom__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! @wordpress/dom */ "./node_modules/@wordpress/dom/build-module/index.js");
/* 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
*
* @return {(CompleterOption[]|Promise.<CompleterOption[]>)} The completer options or a promise for them.
*/
/**
* @callback FnGetOptionKeywords
* @param {CompleterOption} option a completer option.
*
* @return {string[]} list of key words to search.
*/
/**
* @callback FnIsOptionDisabled
* @param {CompleterOption} option a completer option.
*
* @return {string[]} whether or not the given option is disabled.
*/
/**
* @callback FnGetOptionLabel
* @param {CompleterOption} option a completer option.
*
* @return {(string|Array.<(string|Component)>)} list of react components to render.
*/
/**
* @callback FnAllowContext
* @param {string} before the string before the auto complete trigger and query.
* @param {string} after the string after the autocomplete trigger and query.
*
* @return {boolean} true if the completer can handle.
*/
/**
* @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 {string} query the text value of the autocomplete query.
*
* @return {(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 {?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 = [].concat(Object(_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_8__["default"])(keywords), [option.label]);
}
var isMatch = keywords.some(function (keyword) {
return search.test(Object(lodash__WEBPACK_IMPORTED_MODULE_11__["deburr"])(keyword));
});
if (!isMatch) {
continue;
}
filtered.push(option); // Abort early if max reached
if (filtered.length === maxResults) {
break;
}
}
return filtered;
}
function getCaretRect() {
var selection = window.getSelection();
var range = selection.rangeCount ? selection.getRangeAt(0) : null;
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_7__["default"])(Autocomplete, _Component);
Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_6__["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_5__["default"])(_this));
_this.select = _this.select.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(_this));
_this.reset = _this.reset.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(_this));
_this.resetWhenSuppressed = _this.resetWhenSuppressed.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(_this));
_this.handleKeyDown = _this.handleKeyDown.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["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_6__["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(lodash__WEBPACK_IMPORTED_MODULE_11__["deburr"])(Object(_wordpress_rich_text__WEBPACK_IMPORTED_MODULE_15__["getTextContent"])(Object(_wordpress_rich_text__WEBPACK_IMPORTED_MODULE_15__["slice"])(record, 0)));
var prevText = Object(lodash__WEBPACK_IMPORTED_MODULE_11__["deburr"])(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 /^\S*$/.test(text.slice(index + triggerPrefix.length));
});
if (!open) {
this.reset();
return;
}
var safeTrigger = Object(lodash__WEBPACK_IMPORTED_MODULE_11__["escapeRegExp"])(open.triggerPrefix);
var match = text.match(new RegExp("".concat(safeTrigger, "(\\S*)$")));
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/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/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 */ "./node_modules/@wordpress/element/build-module/index.js");
/* 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,
hideLabelFromVision = _ref.hideLabelFromVision,
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: classnames__WEBPACK_IMPORTED_MODULE_1___default()('components-base-control__label', {
'screen-reader-text': hideLabelFromVision
}),
htmlFor: id
}, label), label && !id && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(BaseControl.VisualLabel, null, label), children), !!help && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("p", {
id: id + '__help',
className: "components-base-control__help"
}, help));
}
BaseControl.VisualLabel = function (_ref2) {
var className = _ref2.className,
children = _ref2.children;
className = classnames__WEBPACK_IMPORTED_MODULE_1___default()('components-base-control__label', className);
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("span", {
className: className
}, children);
};
/* 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 */ "./node_modules/@wordpress/element/build-module/index.js");
/* 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 */ "./node_modules/@wordpress/element/build-module/index.js");
/**
* External dependencies
*/
/**
* WordPress dependencies
*/
function Button(props, ref) {
var href = props.href,
target = props.target,
isPrimary = props.isPrimary,
isLarge = props.isLarge,
isSmall = props.isSmall,
isTertiary = props.isTertiary,
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", "isTertiary", "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 || !isPrimary && (isLarge || isSmall),
'is-primary': isPrimary,
'is-large': isLarge,
'is-small': isSmall,
'is-tertiary': isTertiary,
'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 */ "./node_modules/@wordpress/element/build-module/index.js");
/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/compose */ "./node_modules/@wordpress/compose/build-module/index.js");
/* harmony import */ var _base_control__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../base-control */ "./node_modules/@wordpress/components/build-module/base-control/index.js");
/* harmony import */ var _dashicon__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../dashicon */ "./node_modules/@wordpress/components/build-module/dashicon/index.js");
/**
* WordPress 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"])("span", {
className: "components-checkbox-control__input-container"
}, 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)), checked ? Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["createElement"])(_dashicon__WEBPACK_IMPORTED_MODULE_5__["default"], {
icon: "yes",
className: "components-checkbox-control__checked",
role: "presentation"
}) : null), 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_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @babel/runtime/helpers/esm/assertThisInitialized */ "./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.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 _wordpress_element__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @wordpress/element */ "./node_modules/@wordpress/element/build-module/index.js");
/* harmony import */ var clipboard__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! clipboard */ "./node_modules/clipboard/dist/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_7__["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_6__["default"])(_this));
_this.onCopy = _this.onCopy.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__["default"])(_this));
_this.getText = _this.getText.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__["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 */ "./node_modules/@wordpress/element/build-module/index.js");
/* 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 */ "./node_modules/@wordpress/element/build-module/index.js");
/* 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_i18n__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/i18n */ "./node_modules/@wordpress/i18n/build-module/index.js");
/* harmony import */ var _button__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../button */ "./node_modules/@wordpress/components/build-module/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 _tooltip__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../tooltip */ "./node_modules/@wordpress/components/build-module/tooltip/index.js");
/* harmony import */ var _color_picker__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../color-picker */ "./node_modules/@wordpress/components/build-module/color-picker/index.js");
/* harmony import */ var _dashicon__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../dashicon */ "./node_modules/@wordpress/components/build-module/dashicon/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,
_ref$clearable = _ref.clearable,
clearable = _ref$clearable === void 0 ? true : _ref$clearable;
function applyOrUnset(color) {
return function () {
return onChange(value === color ? undefined : color);
};
}
var customColorPickerLabel = Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__["__"])('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_2__["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_6__["default"], {
text: name || // translators: %s: color hex code e.g: "#f00".
Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__["sprintf"])(Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__["__"])('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_3__["sprintf"])(Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__["__"])('Color: %s'), name) : // translators: %s: color hex code e.g: "#f00".
Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__["sprintf"])(Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__["__"])('Color code: %s'), color),
"aria-pressed": value === color
})), value === color && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_dashicon__WEBPACK_IMPORTED_MODULE_8__["default"], {
icon: "saved"
}));
}), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("div", {
className: "components-color-palette__custom-clear-wrapper"
}, !disableCustomColors && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_dropdown__WEBPACK_IMPORTED_MODULE_5__["default"], {
className: "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"])(_button__WEBPACK_IMPORTED_MODULE_4__["default"], {
"aria-expanded": isOpen,
onClick: onToggle,
"aria-label": customColorPickerLabel,
isLink: true
}, Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__["__"])('Custom Color'));
},
renderContent: function renderContent() {
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_color_picker__WEBPACK_IMPORTED_MODULE_7__["default"], {
color: value,
onChangeComplete: function onChangeComplete(color) {
return onChange(color.hex);
},
disableAlpha: true
});
}
}), !!clearable && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_button__WEBPACK_IMPORTED_MODULE_4__["default"], {
className: "components-color-palette__clear",
type: "button",
onClick: function onClick() {
return onChange(undefined);
},
isSmall: true,
isDefault: true
}, Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__["__"])('Clear'))));
}
/***/ }),
/***/ "./node_modules/@wordpress/components/build-module/color-picker/alpha.js":
/*!*******************************************************************************!*\
!*** ./node_modules/@wordpress/components/build-module/color-picker/alpha.js ***!
\*******************************************************************************/
/*! exports provided: Alpha, default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Alpha", function() { return Alpha; });
/* 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_assertThisInitialized__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/esm/assertThisInitialized */ "./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.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 _wordpress_element__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @wordpress/element */ "./node_modules/@wordpress/element/build-module/index.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_i18n__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @wordpress/i18n */ "./node_modules/@wordpress/i18n/build-module/index.js");
/* harmony import */ var _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @wordpress/keycodes */ "./node_modules/@wordpress/keycodes/build-module/index.js");
/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @wordpress/compose */ "./node_modules/@wordpress/compose/build-module/index.js");
/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./utils */ "./node_modules/@wordpress/components/build-module/color-picker/utils.js");
/* harmony import */ var _keyboard_shortcuts__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../keyboard-shortcuts */ "./node_modules/@wordpress/components/build-module/keyboard-shortcuts/index.js");
/**
* Parts of this source were derived and modified from react-color,
* released under the MIT license.
*
* https://github.com/casesandberg/react-color/
*
* Copyright (c) 2015 Case Sandberg
*
* 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.
*/
/**
* External dependencies
*/
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
var Alpha =
/*#__PURE__*/
function (_Component) {
Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_5__["default"])(Alpha, _Component);
function Alpha() {
var _this;
Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__["default"])(this, Alpha);
_this = Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__["default"])(this, Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__["default"])(Alpha).apply(this, arguments));
_this.container = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createRef"])();
_this.increase = _this.increase.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_4__["default"])(_this));
_this.decrease = _this.decrease.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_4__["default"])(_this));
_this.handleChange = _this.handleChange.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_4__["default"])(_this));
_this.handleMouseDown = _this.handleMouseDown.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_4__["default"])(_this));
_this.handleMouseUp = _this.handleMouseUp.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_4__["default"])(_this));
return _this;
}
Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__["default"])(Alpha, [{
key: "componentWillUnmount",
value: function componentWillUnmount() {
this.unbindEventListeners();
}
}, {
key: "increase",
value: function increase() {
var amount = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0.01;
var _this$props = this.props,
hsl = _this$props.hsl,
_this$props$onChange = _this$props.onChange,
onChange = _this$props$onChange === void 0 ? lodash__WEBPACK_IMPORTED_MODULE_7__["noop"] : _this$props$onChange;
amount = parseInt(amount * 100, 10);
var change = {
h: hsl.h,
s: hsl.s,
l: hsl.l,
a: (parseInt(hsl.a * 100, 10) + amount) / 100,
source: 'rgb'
};
onChange(change);
}
}, {
key: "decrease",
value: function decrease() {
var amount = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0.01;
var _this$props2 = this.props,
hsl = _this$props2.hsl,
_this$props2$onChange = _this$props2.onChange,
onChange = _this$props2$onChange === void 0 ? lodash__WEBPACK_IMPORTED_MODULE_7__["noop"] : _this$props2$onChange;
var intValue = parseInt(hsl.a * 100, 10) - parseInt(amount * 100, 10);
var change = {
h: hsl.h,
s: hsl.s,
l: hsl.l,
a: hsl.a <= amount ? 0 : intValue / 100,
source: 'rgb'
};
onChange(change);
}
}, {
key: "handleChange",
value: function handleChange(e) {
var _this$props$onChange2 = this.props.onChange,
onChange = _this$props$onChange2 === void 0 ? lodash__WEBPACK_IMPORTED_MODULE_7__["noop"] : _this$props$onChange2;
var change = Object(_utils__WEBPACK_IMPORTED_MODULE_11__["calculateAlphaChange"])(e, this.props, this.container.current);
if (change) {
onChange(change, e);
}
}
}, {
key: "handleMouseDown",
value: function handleMouseDown(e) {
this.handleChange(e);
window.addEventListener('mousemove', this.handleChange);
window.addEventListener('mouseup', this.handleMouseUp);
}
}, {
key: "handleMouseUp",
value: function handleMouseUp() {
this.unbindEventListeners();
}
}, {
key: "preventKeyEvents",
value: function preventKeyEvents(event) {
if (event.keyCode === _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_9__["TAB"]) {
return;
}
event.preventDefault();
}
}, {
key: "unbindEventListeners",
value: function unbindEventListeners() {
window.removeEventListener('mousemove', this.handleChange);
window.removeEventListener('mouseup', this.handleMouseUp);
}
}, {
key: "render",
value: function render() {
var _this2 = this;
var rgb = this.props.rgb;
var rgbString = "".concat(rgb.r, ",").concat(rgb.g, ",").concat(rgb.b);
var gradient = {
background: "linear-gradient(to right, rgba(".concat(rgbString, ", 0) 0%, rgba(").concat(rgbString, ", 1) 100%)")
};
var pointerLocation = {
left: "".concat(rgb.a * 100, "%")
};
var shortcuts = {
up: function up() {
return _this2.increase();
},
right: function right() {
return _this2.increase();
},
'shift+up': function shiftUp() {
return _this2.increase(0.1);
},
'shift+right': function shiftRight() {
return _this2.increase(0.1);
},
pageup: function pageup() {
return _this2.increase(0.1);
},
end: function end() {
return _this2.increase(1);
},
down: function down() {
return _this2.decrease();
},
left: function left() {
return _this2.decrease();
},
'shift+down': function shiftDown() {
return _this2.decrease(0.1);
},
'shift+left': function shiftLeft() {
return _this2.decrease(0.1);
},
pagedown: function pagedown() {
return _this2.decrease(0.1);
},
home: function home() {
return _this2.decrease(1);
}
};
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(_keyboard_shortcuts__WEBPACK_IMPORTED_MODULE_12__["default"], {
shortcuts: shortcuts
}, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("div", {
className: "components-color-picker__alpha"
}, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("div", {
className: "components-color-picker__alpha-gradient",
style: gradient
}), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("div", {
className: "components-color-picker__alpha-bar",
ref: this.container,
onMouseDown: this.handleMouseDown,
onTouchMove: this.handleChange,
onTouchStart: this.handleChange
}, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("div", {
tabIndex: "0",
role: "slider",
"aria-valuemax": "1",
"aria-valuemin": "0",
"aria-valuenow": rgb.a,
"aria-orientation": "horizontal",
"aria-label": Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_8__["__"])('Alpha value, from 0 (transparent) to 1 (fully opaque).'),
className: "components-color-picker__alpha-pointer",
style: pointerLocation,
onKeyDown: this.preventKeyEvents
}))));
}
}]);
return Alpha;
}(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["Component"]);
/* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_10__["pure"])(Alpha));
/***/ }),
/***/ "./node_modules/@wordpress/components/build-module/color-picker/hue.js":
/*!*****************************************************************************!*\
!*** ./node_modules/@wordpress/components/build-module/color-picker/hue.js ***!
\*****************************************************************************/
/*! exports provided: Hue, default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Hue", function() { return Hue; });
/* 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_assertThisInitialized__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/esm/assertThisInitialized */ "./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.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 _wordpress_element__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @wordpress/element */ "./node_modules/@wordpress/element/build-module/index.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_compose__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @wordpress/compose */ "./node_modules/@wordpress/compose/build-module/index.js");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @wordpress/i18n */ "./node_modules/@wordpress/i18n/build-module/index.js");
/* harmony import */ var _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @wordpress/keycodes */ "./node_modules/@wordpress/keycodes/build-module/index.js");
/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./utils */ "./node_modules/@wordpress/components/build-module/color-picker/utils.js");
/* harmony import */ var _keyboard_shortcuts__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../keyboard-shortcuts */ "./node_modules/@wordpress/components/build-module/keyboard-shortcuts/index.js");
/**
* Parts of this source were derived and modified from react-color,
* released under the MIT license.
*
* https://github.com/casesandberg/react-color/
*
* Copyright (c) 2015 Case Sandberg
*
* 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.
*/
/**
* External dependencies
*/
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
var Hue =
/*#__PURE__*/
function (_Component) {
Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_5__["default"])(Hue, _Component);
function Hue() {
var _this;
Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__["default"])(this, Hue);
_this = Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__["default"])(this, Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__["default"])(Hue).apply(this, arguments));
_this.container = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createRef"])();
_this.increase = _this.increase.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_4__["default"])(_this));
_this.decrease = _this.decrease.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_4__["default"])(_this));
_this.handleChange = _this.handleChange.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_4__["default"])(_this));
_this.handleMouseDown = _this.handleMouseDown.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_4__["default"])(_this));
_this.handleMouseUp = _this.handleMouseUp.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_4__["default"])(_this));
return _this;
}
Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__["default"])(Hue, [{
key: "componentWillUnmount",
value: function componentWillUnmount() {
this.unbindEventListeners();
}
}, {
key: "increase",
value: function increase() {
var amount = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1;
var _this$props = this.props,
hsl = _this$props.hsl,
_this$props$onChange = _this$props.onChange,
onChange = _this$props$onChange === void 0 ? lodash__WEBPACK_IMPORTED_MODULE_7__["noop"] : _this$props$onChange;
var change = {
h: hsl.h + amount >= 359 ? 359 : hsl.h + amount,
s: hsl.s,
l: hsl.l,
a: hsl.a,
source: 'rgb'
};
onChange(change);
}
}, {
key: "decrease",
value: function decrease() {
var amount = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1;
var _this$props2 = this.props,
hsl = _this$props2.hsl,
_this$props2$onChange = _this$props2.onChange,
onChange = _this$props2$onChange === void 0 ? lodash__WEBPACK_IMPORTED_MODULE_7__["noop"] : _this$props2$onChange;
var change = {
h: hsl.h <= amount ? 0 : hsl.h - amount,
s: hsl.s,
l: hsl.l,
a: hsl.a,
source: 'rgb'
};
onChange(change);
}
}, {
key: "handleChange",
value: function handleChange(e) {
var _this$props$onChange2 = this.props.onChange,
onChange = _this$props$onChange2 === void 0 ? lodash__WEBPACK_IMPORTED_MODULE_7__["noop"] : _this$props$onChange2;
var change = Object(_utils__WEBPACK_IMPORTED_MODULE_11__["calculateHueChange"])(e, this.props, this.container.current);
if (change) {
onChange(change, e);
}
}
}, {
key: "handleMouseDown",
value: function handleMouseDown(e) {
this.handleChange(e);
window.addEventListener('mousemove', this.handleChange);
window.addEventListener('mouseup', this.handleMouseUp);
}
}, {
key: "handleMouseUp",
value: function handleMouseUp() {
this.unbindEventListeners();
}
}, {
key: "preventKeyEvents",
value: function preventKeyEvents(event) {
if (event.keyCode === _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_10__["TAB"]) {
return;
}
event.preventDefault();
}
}, {
key: "unbindEventListeners",
value: function unbindEventListeners() {
window.removeEventListener('mousemove', this.handleChange);
window.removeEventListener('mouseup', this.handleMouseUp);
}
}, {
key: "render",
value: function render() {
var _this2 = this;
var _this$props3 = this.props,
_this$props3$hsl = _this$props3.hsl,
hsl = _this$props3$hsl === void 0 ? {} : _this$props3$hsl,
instanceId = _this$props3.instanceId;
var pointerLocation = {
left: "".concat(hsl.h * 100 / 360, "%")
};
var shortcuts = {
up: function up() {
return _this2.increase();
},
right: function right() {
return _this2.increase();
},
'shift+up': function shiftUp() {
return _this2.increase(10);
},
'shift+right': function shiftRight() {
return _this2.increase(10);
},
pageup: function pageup() {
return _this2.increase(10);
},
end: function end() {
return _this2.increase(359);
},
down: function down() {
return _this2.decrease();
},
left: function left() {
return _this2.decrease();
},
'shift+down': function shiftDown() {
return _this2.decrease(10);
},
'shift+left': function shiftLeft() {
return _this2.decrease(10);
},
pagedown: function pagedown() {
return _this2.decrease(10);
},
home: function home() {
return _this2.decrease(359);
}
};
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(_keyboard_shortcuts__WEBPACK_IMPORTED_MODULE_12__["default"], {
shortcuts: shortcuts
}, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("div", {
className: "components-color-picker__hue"
}, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("div", {
className: "components-color-picker__hue-gradient"
}), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("div", {
className: "components-color-picker__hue-bar",
ref: this.container,
onMouseDown: this.handleMouseDown,
onTouchMove: this.handleChange,
onTouchStart: this.handleChange
}, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("div", {
tabIndex: "0",
role: "slider",
"aria-valuemax": "1",
"aria-valuemin": "359",
"aria-valuenow": hsl.h,
"aria-orientation": "horizontal",
"aria-label": Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_9__["__"])('Hue value in degrees, from 0 to 359.'),
"aria-describedby": "components-color-picker__hue-description-".concat(instanceId),
className: "components-color-picker__hue-pointer",
style: pointerLocation,
onKeyDown: this.preventKeyEvents
}), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("p", {
className: "components-color-picker__hue-description screen-reader-text",
id: "components-color-picker__hue-description-".concat(instanceId)
}, Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_9__["__"])('Move the arrow left or right to change hue.')))));
}
}]);
return Hue;
}(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["Component"]);
/* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_8__["compose"])(_wordpress_compose__WEBPACK_IMPORTED_MODULE_8__["pure"], _wordpress_compose__WEBPACK_IMPORTED_MODULE_8__["withInstanceId"])(Hue));
/***/ }),
/***/ "./node_modules/@wordpress/components/build-module/color-picker/index.js":
/*!*******************************************************************************!*\
!*** ./node_modules/@wordpress/components/build-module/color-picker/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 ColorPicker; });
/* 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_assertThisInitialized__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/esm/assertThisInitialized */ "./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.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_objectSpread__WEBPACK_IMPORTED_MODULE_6__ = __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_7__ = __webpack_require__(/*! @babel/runtime/helpers/esm/defineProperty */ "./node_modules/@babel/runtime/helpers/esm/defineProperty.js");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @wordpress/element */ "./node_modules/@wordpress/element/build-module/index.js");
/* 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 _alpha__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./alpha */ "./node_modules/@wordpress/components/build-module/color-picker/alpha.js");
/* harmony import */ var _hue__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./hue */ "./node_modules/@wordpress/components/build-module/color-picker/hue.js");
/* harmony import */ var _inputs__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./inputs */ "./node_modules/@wordpress/components/build-module/color-picker/inputs.js");
/* harmony import */ var _saturation__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./saturation */ "./node_modules/@wordpress/components/build-module/color-picker/saturation.js");
/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./utils */ "./node_modules/@wordpress/components/build-module/color-picker/utils.js");
/**
* Parts of this source were derived and modified from react-color,
* released under the MIT license.
*
* https://github.com/casesandberg/react-color/
*
* Copyright (c) 2015 Case Sandberg
*
* 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.
*/
/**
* External dependencies
*/
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
var toLowerCase = function toLowerCase(value) {
return String(value).toLowerCase();
};
var isValueEmpty = function isValueEmpty(data) {
if (data.source === 'hex' && !data.hex) {
return true;
} else if (data.source === 'hsl' && (!data.h || !data.s || !data.l)) {
return true;
} else if (data.source === 'rgb' && (!data.r || !data.g || !data.b) && (!data.h || !data.s || !data.v || !data.a) && (!data.h || !data.s || !data.l || !data.a)) {
return true;
}
return false;
};
var isValidColor = function isValidColor(colors) {
return colors.hex ? Object(_utils__WEBPACK_IMPORTED_MODULE_15__["isValidHex"])(colors.hex) : Object(_utils__WEBPACK_IMPORTED_MODULE_15__["simpleCheckForValidColor"])(colors);
};
/**
* Function that creates the new color object
* from old data and the new value.
*
* @param {Object} oldColors The old color object.
* @param {string} oldColors.hex
* @param {Object} oldColors.rgb
* @param {number} oldColors.rgb.r
* @param {number} oldColors.rgb.g
* @param {number} oldColors.rgb.b
* @param {number} oldColors.rgb.a
* @param {Object} oldColors.hsl
* @param {number} oldColors.hsl.h
* @param {number} oldColors.hsl.s
* @param {number} oldColors.hsl.l
* @param {number} oldColors.hsl.a
* @param {string} oldColors.draftHex Same format as oldColors.hex
* @param {Object} oldColors.draftRgb Same format as oldColors.rgb
* @param {Object} oldColors.draftHsl Same format as oldColors.hsl
* @param {Object} data Data containing the new value to update.
* @param {Object} data.source One of `hex`, `rgb`, `hsl`.
* @param {string|number} data.value Value to update.
* @param {string} data.valueKey Depends on `data.source` values:
* - when source = `rgb`, valuKey can be `r`, `g`, `b`, or `a`.
* - when source = `hsl`, valuKey can be `h`, `s`, `l`, or `a`.
* @return {Object} A new color object for a specific source. For example:
* { source: 'rgb', r: 1, g: 2, b:3, a:0 }
*/
var dataToColors = function dataToColors(oldColors, _ref) {
var source = _ref.source,
valueKey = _ref.valueKey,
value = _ref.value;
if (source === 'hex') {
return Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_7__["default"])({
source: source
}, source, value);
}
return Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_6__["default"])({
source: source
}, Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_6__["default"])({}, oldColors[source], Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_7__["default"])({}, valueKey, value)));
};
var ColorPicker =
/*#__PURE__*/
function (_Component) {
Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_5__["default"])(ColorPicker, _Component);
function ColorPicker(_ref3) {
var _this;
var _ref3$color = _ref3.color,
color = _ref3$color === void 0 ? '0071a1' : _ref3$color;
Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__["default"])(this, ColorPicker);
_this = Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__["default"])(this, Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__["default"])(ColorPicker).apply(this, arguments));
var colors = Object(_utils__WEBPACK_IMPORTED_MODULE_15__["colorToState"])(color);
_this.state = Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_6__["default"])({}, colors, {
draftHex: toLowerCase(colors.hex),
draftRgb: colors.rgb,
draftHsl: colors.hsl
});
_this.commitValues = _this.commitValues.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_4__["default"])(_this));
_this.setDraftValues = _this.setDraftValues.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_4__["default"])(_this));
_this.resetDraftValues = _this.resetDraftValues.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_4__["default"])(_this));
_this.handleInputChange = _this.handleInputChange.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_4__["default"])(_this));
return _this;
}
Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__["default"])(ColorPicker, [{
key: "commitValues",
value: function commitValues(data) {
var _this$props = this.props,
oldHue = _this$props.oldHue,
_this$props$onChangeC = _this$props.onChangeComplete,
onChangeComplete = _this$props$onChangeC === void 0 ? lodash__WEBPACK_IMPORTED_MODULE_10__["noop"] : _this$props$onChangeC;
if (isValidColor(data)) {
var colors = Object(_utils__WEBPACK_IMPORTED_MODULE_15__["colorToState"])(data, data.h || oldHue);
this.setState(Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_6__["default"])({}, colors, {
draftHex: toLowerCase(colors.hex),
draftHsl: colors.hsl,
draftRgb: colors.rgb
}), Object(lodash__WEBPACK_IMPORTED_MODULE_10__["debounce"])(Object(lodash__WEBPACK_IMPORTED_MODULE_10__["partial"])(onChangeComplete, colors), 100));
}
}
}, {
key: "resetDraftValues",
value: function resetDraftValues() {
this.setState({
draftHex: this.state.hex,
draftHsl: this.state.hsl,
draftRgb: this.state.rgb
});
}
}, {
key: "setDraftValues",
value: function setDraftValues(data) {
switch (data.source) {
case 'hex':
this.setState({
draftHex: toLowerCase(data.hex)
});
break;
case 'rgb':
this.setState({
draftRgb: data
});
break;
case 'hsl':
this.setState({
draftHsl: data
});
break;
}
}
}, {
key: "handleInputChange",
value: function handleInputChange(data) {
switch (data.state) {
case 'reset':
this.resetDraftValues();
break;
case 'commit':
var colors = dataToColors(this.state, data);
if (!isValueEmpty(colors)) {
this.commitValues(colors);
}
break;
case 'draft':
this.setDraftValues(dataToColors(this.state, data));
break;
}
}
}, {
key: "render",
value: function render() {
var _this$props2 = this.props,
className = _this$props2.className,
disableAlpha = _this$props2.disableAlpha;
var _this$state = this.state,
color = _this$state.color,
hsl = _this$state.hsl,
hsv = _this$state.hsv,
rgb = _this$state.rgb,
draftHex = _this$state.draftHex,
draftHsl = _this$state.draftHsl,
draftRgb = _this$state.draftRgb;
var classes = classnames__WEBPACK_IMPORTED_MODULE_9___default()(className, {
'components-color-picker': true,
'is-alpha-disabled': disableAlpha,
'is-alpha-enabled': !disableAlpha
});
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["createElement"])("div", {
className: classes
}, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["createElement"])("div", {
className: "components-color-picker__saturation"
}, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["createElement"])(_saturation__WEBPACK_IMPORTED_MODULE_14__["default"], {
hsl: hsl,
hsv: hsv,
onChange: this.commitValues
})), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["createElement"])("div", {
className: "components-color-picker__body"
}, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["createElement"])("div", {
className: "components-color-picker__controls"
}, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["createElement"])("div", {
className: "components-color-picker__swatch"
}, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["createElement"])("div", {
className: "components-color-picker__active",
style: {
backgroundColor: color && color.toRgbString()
}
})), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["createElement"])("div", {
className: "components-color-picker__toggles"
}, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["createElement"])(_hue__WEBPACK_IMPORTED_MODULE_12__["default"], {
hsl: hsl,
onChange: this.commitValues
}), disableAlpha ? null : Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["createElement"])(_alpha__WEBPACK_IMPORTED_MODULE_11__["default"], {
rgb: rgb,
hsl: hsl,
onChange: this.commitValues
}))), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["createElement"])(_inputs__WEBPACK_IMPORTED_MODULE_13__["default"], {
rgb: draftRgb,
hsl: draftHsl,
hex: draftHex,
onChange: this.handleInputChange,
disableAlpha: disableAlpha
})));
}
}]);
return ColorPicker;
}(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["Component"]);
/***/ }),
/***/ "./node_modules/@wordpress/components/build-module/color-picker/inputs.js":
/*!********************************************************************************!*\
!*** ./node_modules/@wordpress/components/build-module/color-picker/inputs.js ***!
\********************************************************************************/
/*! exports provided: Input, Inputs, default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Input", function() { return Input; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Inputs", function() { return Inputs; });
/* 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_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @babel/runtime/helpers/esm/assertThisInitialized */ "./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.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 _wordpress_element__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @wordpress/element */ "./node_modules/@wordpress/element/build-module/index.js");
/* 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_a11y__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @wordpress/a11y */ "./node_modules/@wordpress/a11y/build-module/index.js");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @wordpress/i18n */ "./node_modules/@wordpress/i18n/build-module/index.js");
/* harmony import */ var _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @wordpress/keycodes */ "./node_modules/@wordpress/keycodes/build-module/index.js");
/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @wordpress/compose */ "./node_modules/@wordpress/compose/build-module/index.js");
/* harmony import */ var _icon_button__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../icon-button */ "./node_modules/@wordpress/components/build-module/icon-button/index.js");
/* harmony import */ var _text_control__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../text-control */ "./node_modules/@wordpress/components/build-module/text-control/index.js");
/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./utils */ "./node_modules/@wordpress/components/build-module/color-picker/utils.js");
/**
* External dependencies
*/
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
/* Wrapper for TextControl, only used to handle intermediate state while typing. */
var Input =
/*#__PURE__*/
function (_Component) {
Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_7__["default"])(Input, _Component);
function Input() {
var _this;
Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_2__["default"])(this, Input);
_this = Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_4__["default"])(this, Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_5__["default"])(Input).apply(this, arguments));
_this.handleBlur = _this.handleBlur.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__["default"])(_this));
_this.handleChange = _this.handleChange.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__["default"])(_this));
_this.handleKeyDown = _this.handleKeyDown.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__["default"])(_this));
return _this;
}
Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_3__["default"])(Input, [{
key: "handleBlur",
value: function handleBlur() {
var _this$props = this.props,
value = _this$props.value,
valueKey = _this$props.valueKey,
onChange = _this$props.onChange,
source = _this$props.source;
onChange({
source: source,
state: 'commit',
value: value,
valueKey: valueKey
});
}
}, {
key: "handleChange",
value: function handleChange(value) {
var _this$props2 = this.props,
valueKey = _this$props2.valueKey,
onChange = _this$props2.onChange,
source = _this$props2.source;
if (value.length > 4 && Object(_utils__WEBPACK_IMPORTED_MODULE_16__["isValidHex"])(value)) {
onChange({
source: source,
state: 'commit',
value: value,
valueKey: valueKey
});
} else {
onChange({
source: source,
state: 'draft',
value: value,
valueKey: valueKey
});
}
}
}, {
key: "handleKeyDown",
value: function handleKeyDown(_ref) {
var keyCode = _ref.keyCode;
if (keyCode !== _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_12__["ENTER"] && keyCode !== _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_12__["UP"] && keyCode !== _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_12__["DOWN"]) {
return;
}
var _this$props3 = this.props,
value = _this$props3.value,
valueKey = _this$props3.valueKey,
onChange = _this$props3.onChange,
source = _this$props3.source;
onChange({
source: source,
state: 'commit',
value: value,
valueKey: valueKey
});
}
}, {
key: "render",
value: function render() {
var _this2 = this;
var _this$props4 = this.props,
label = _this$props4.label,
value = _this$props4.value,
props = Object(_babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__["default"])(_this$props4, ["label", "value"]);
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["createElement"])(_text_control__WEBPACK_IMPORTED_MODULE_15__["default"], Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({
className: "components-color-picker__inputs-field",
label: label,
value: value,
onChange: function onChange(newValue) {
return _this2.handleChange(newValue);
},
onBlur: this.handleBlur,
onKeyDown: this.handleKeyDown
}, Object(lodash__WEBPACK_IMPORTED_MODULE_9__["omit"])(props, ['onChange', 'valueKey', 'source'])));
}
}]);
return Input;
}(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["Component"]);
var PureIconButton = Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_13__["pure"])(_icon_button__WEBPACK_IMPORTED_MODULE_14__["default"]);
var Inputs =
/*#__PURE__*/
function (_Component2) {
Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_7__["default"])(Inputs, _Component2);
function Inputs(_ref2) {
var _this3;
var hsl = _ref2.hsl;
Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_2__["default"])(this, Inputs);
_this3 = Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_4__["default"])(this, Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_5__["default"])(Inputs).apply(this, arguments));
var view = hsl.a === 1 ? 'hex' : 'rgb';
_this3.state = {
view: view
};
_this3.toggleViews = _this3.toggleViews.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__["default"])(_this3));
_this3.resetDraftValues = _this3.resetDraftValues.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__["default"])(_this3));
_this3.handleChange = _this3.handleChange.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__["default"])(_this3));
_this3.normalizeValue = _this3.normalizeValue.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__["default"])(_this3));
return _this3;
}
Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_3__["default"])(Inputs, [{
key: "toggleViews",
value: function toggleViews() {
if (this.state.view === 'hex') {
this.setState({
view: 'rgb'
}, this.resetDraftValues);
Object(_wordpress_a11y__WEBPACK_IMPORTED_MODULE_10__["speak"])(Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_11__["__"])('RGB mode active'));
} else if (this.state.view === 'rgb') {
this.setState({
view: 'hsl'
}, this.resetDraftValues);
Object(_wordpress_a11y__WEBPACK_IMPORTED_MODULE_10__["speak"])(Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_11__["__"])('Hue/saturation/lightness mode active'));
} else if (this.state.view === 'hsl') {
if (this.props.hsl.a === 1) {
this.setState({
view: 'hex'
}, this.resetDraftValues);
Object(_wordpress_a11y__WEBPACK_IMPORTED_MODULE_10__["speak"])(Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_11__["__"])('Hex color mode active'));
} else {
this.setState({
view: 'rgb'
}, this.resetDraftValues);
Object(_wordpress_a11y__WEBPACK_IMPORTED_MODULE_10__["speak"])(Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_11__["__"])('RGB mode active'));
}
}
}
}, {
key: "resetDraftValues",
value: function resetDraftValues() {
return this.props.onChange({
state: 'reset'
});
}
}, {
key: "normalizeValue",
value: function normalizeValue(valueKey, value) {
if (valueKey !== 'a') {
return value;
}
if (value > 0) {
return 0;
} else if (value > 1) {
return 1;
}
return Math.round(value * 100) / 100;
}
}, {
key: "handleChange",
value: function handleChange(_ref3) {
var source = _ref3.source,
state = _ref3.state,
value = _ref3.value,
valueKey = _ref3.valueKey;
this.props.onChange({
source: source,
state: state,
valueKey: valueKey,
value: this.normalizeValue(valueKey, value)
});
}
}, {
key: "renderFields",
value: function renderFields() {
var _this$props$disableAl = this.props.disableAlpha,
disableAlpha = _this$props$disableAl === void 0 ? false : _this$props$disableAl;
if (this.state.view === 'hex') {
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["createElement"])("div", {
className: "components-color-picker__inputs-fields"
}, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["createElement"])(Input, {
source: this.state.view,
label: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_11__["__"])('Color value in hexadecimal'),
valueKey: "hex",
value: this.props.hex,
onChange: this.handleChange
}));
} else if (this.state.view === 'rgb') {
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["createElement"])("fieldset", null, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["createElement"])("legend", {
className: "screen-reader-text"
}, Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_11__["__"])('Color value in RGB')), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["createElement"])("div", {
className: "components-color-picker__inputs-fields"
}, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["createElement"])(Input, {
source: this.state.view,
label: "r",
valueKey: "r",
value: this.props.rgb.r,
onChange: this.handleChange,
type: "number",
min: "0",
max: "255"
}), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["createElement"])(Input, {
source: this.state.view,
label: "g",
valueKey: "g",
value: this.props.rgb.g,
onChange: this.handleChange,
type: "number",
min: "0",
max: "255"
}), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["createElement"])(Input, {
source: this.state.view,
label: "b",
valueKey: "b",
value: this.props.rgb.b,
onChange: this.handleChange,
type: "number",
min: "0",
max: "255"
}), disableAlpha ? null : Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["createElement"])(Input, {
source: this.state.view,
label: "a",
valueKey: "a",
value: this.props.rgb.a,
onChange: this.handleChange,
type: "number",
min: "0",
max: "1",
step: "0.05"
})));
} else if (this.state.view === 'hsl') {
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["createElement"])("fieldset", null, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["createElement"])("legend", {
className: "screen-reader-text"
}, Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_11__["__"])('Color value in HSL')), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["createElement"])("div", {
className: "components-color-picker__inputs-fields"
}, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["createElement"])(Input, {
source: this.state.view,
label: "h",
valueKey: "h",
value: this.props.hsl.h,
onChange: this.handleChange,
type: "number",
min: "0",
max: "359"
}), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["createElement"])(Input, {
source: this.state.view,
label: "s",
valueKey: "s",
value: this.props.hsl.s,
onChange: this.handleChange,
type: "number",
min: "0",
max: "100"
}), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["createElement"])(Input, {
source: this.state.view,
label: "l",
valueKey: "l",
value: this.props.hsl.l,
onChange: this.handleChange,
type: "number",
min: "0",
max: "100"
}), disableAlpha ? null : Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["createElement"])(Input, {
source: this.state.view,
label: "a",
valueKey: "a",
value: this.props.hsl.a,
onChange: this.handleChange,
type: "number",
min: "0",
max: "1",
step: "0.05"
})));
}
}
}, {
key: "render",
value: function render() {
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["createElement"])("div", {
className: "components-color-picker__inputs-wrapper"
}, this.renderFields(), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["createElement"])("div", {
className: "components-color-picker__inputs-toggle"
}, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["createElement"])(PureIconButton, {
icon: "arrow-down-alt2",
label: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_11__["__"])('Change color format'),
onClick: this.toggleViews
})));
}
}], [{
key: "getDerivedStateFromProps",
value: function getDerivedStateFromProps(props, state) {
if (props.hsl.a !== 1 && state.view === 'hex') {
return {
view: 'rgb'
};
}
return null;
}
}]);
return Inputs;
}(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["Component"]);
/* harmony default export */ __webpack_exports__["default"] = (Inputs);
/***/ }),
/***/ "./node_modules/@wordpress/components/build-module/color-picker/saturation.js":
/*!************************************************************************************!*\
!*** ./node_modules/@wordpress/components/build-module/color-picker/saturation.js ***!
\************************************************************************************/
/*! exports provided: Saturation, default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Saturation", function() { return Saturation; });
/* 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_assertThisInitialized__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/esm/assertThisInitialized */ "./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.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 _wordpress_element__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @wordpress/element */ "./node_modules/@wordpress/element/build-module/index.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_i18n__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @wordpress/i18n */ "./node_modules/@wordpress/i18n/build-module/index.js");
/* harmony import */ var _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @wordpress/keycodes */ "./node_modules/@wordpress/keycodes/build-module/index.js");
/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @wordpress/compose */ "./node_modules/@wordpress/compose/build-module/index.js");
/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./utils */ "./node_modules/@wordpress/components/build-module/color-picker/utils.js");
/* harmony import */ var _keyboard_shortcuts__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../keyboard-shortcuts */ "./node_modules/@wordpress/components/build-module/keyboard-shortcuts/index.js");
/**
* Parts of this source were derived and modified from react-color,
* released under the MIT license.
*
* https://github.com/casesandberg/react-color/
*
* Copyright (c) 2015 Case Sandberg
*
* 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.
*/
/**
* External dependencies
*/
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
var Saturation =
/*#__PURE__*/
function (_Component) {
Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_5__["default"])(Saturation, _Component);
function Saturation(props) {
var _this;
Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__["default"])(this, Saturation);
_this = Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__["default"])(this, Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__["default"])(Saturation).call(this, props));
_this.throttle = Object(lodash__WEBPACK_IMPORTED_MODULE_7__["throttle"])(function (fn, data, e) {
fn(data, e);
}, 50);
_this.container = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createRef"])();
_this.saturate = _this.saturate.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_4__["default"])(_this));
_this.brighten = _this.brighten.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_4__["default"])(_this));
_this.handleChange = _this.handleChange.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_4__["default"])(_this));
_this.handleMouseDown = _this.handleMouseDown.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_4__["default"])(_this));
_this.handleMouseUp = _this.handleMouseUp.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_4__["default"])(_this));
return _this;
}
Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__["default"])(Saturation, [{
key: "componentWillUnmount",
value: function componentWillUnmount() {
this.throttle.cancel();
this.unbindEventListeners();
}
}, {
key: "saturate",
value: function saturate() {
var amount = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0.01;
var _this$props = this.props,
hsv = _this$props.hsv,
_this$props$onChange = _this$props.onChange,
onChange = _this$props$onChange === void 0 ? lodash__WEBPACK_IMPORTED_MODULE_7__["noop"] : _this$props$onChange;
var intSaturation = Object(lodash__WEBPACK_IMPORTED_MODULE_7__["clamp"])(hsv.s + Math.round(amount * 100), 0, 100);
var change = {
h: hsv.h,
s: intSaturation,
v: hsv.v,
a: hsv.a,
source: 'rgb'
};
onChange(change);
}
}, {
key: "brighten",
value: function brighten() {
var amount = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0.01;
var _this$props2 = this.props,
hsv = _this$props2.hsv,
_this$props2$onChange = _this$props2.onChange,
onChange = _this$props2$onChange === void 0 ? lodash__WEBPACK_IMPORTED_MODULE_7__["noop"] : _this$props2$onChange;
var intValue = Object(lodash__WEBPACK_IMPORTED_MODULE_7__["clamp"])(hsv.v + Math.round(amount * 100), 0, 100);
var change = {
h: hsv.h,
s: hsv.s,
v: intValue,
a: hsv.a,
source: 'rgb'
};
onChange(change);
}
}, {
key: "handleChange",
value: function handleChange(e) {
var _this$props$onChange2 = this.props.onChange,
onChange = _this$props$onChange2 === void 0 ? lodash__WEBPACK_IMPORTED_MODULE_7__["noop"] : _this$props$onChange2;
var change = Object(_utils__WEBPACK_IMPORTED_MODULE_11__["calculateSaturationChange"])(e, this.props, this.container.current);
this.throttle(onChange, change, e);
}
}, {
key: "handleMouseDown",
value: function handleMouseDown(e) {
this.handleChange(e);
window.addEventListener('mousemove', this.handleChange);
window.addEventListener('mouseup', this.handleMouseUp);
}
}, {
key: "handleMouseUp",
value: function handleMouseUp() {
this.unbindEventListeners();
}
}, {
key: "preventKeyEvents",
value: function preventKeyEvents(event) {
if (event.keyCode === _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_9__["TAB"]) {
return;
}
event.preventDefault();
}
}, {
key: "unbindEventListeners",
value: function unbindEventListeners() {
window.removeEventListener('mousemove', this.handleChange);
window.removeEventListener('mouseup', this.handleMouseUp);
}
}, {
key: "render",
value: function render() {
var _this2 = this;
var _this$props3 = this.props,
hsv = _this$props3.hsv,
hsl = _this$props3.hsl,
instanceId = _this$props3.instanceId;
var pointerLocation = {
top: "".concat(-hsv.v + 100, "%"),
left: "".concat(hsv.s, "%")
};
var shortcuts = {
up: function up() {
return _this2.brighten();
},
'shift+up': function shiftUp() {
return _this2.brighten(0.1);
},
pageup: function pageup() {
return _this2.brighten(1);
},
down: function down() {
return _this2.brighten(-0.01);
},
'shift+down': function shiftDown() {
return _this2.brighten(-0.1);
},
pagedown: function pagedown() {
return _this2.brighten(-1);
},
right: function right() {
return _this2.saturate();
},
'shift+right': function shiftRight() {
return _this2.saturate(0.1);
},
end: function end() {
return _this2.saturate(1);
},
left: function left() {
return _this2.saturate(-0.01);
},
'shift+left': function shiftLeft() {
return _this2.saturate(-0.1);
},
home: function home() {
return _this2.saturate(-1);
}
};
/* eslint-disable jsx-a11y/no-noninteractive-element-interactions */
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(_keyboard_shortcuts__WEBPACK_IMPORTED_MODULE_12__["default"], {
shortcuts: shortcuts
}, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("div", {
style: {
background: "hsl(".concat(hsl.h, ",100%, 50%)")
},
className: "components-color-picker__saturation-color",
ref: this.container,
onMouseDown: this.handleMouseDown,
onTouchMove: this.handleChange,
onTouchStart: this.handleChange,
role: "application"
}, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("div", {
className: "components-color-picker__saturation-white"
}), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("div", {
className: "components-color-picker__saturation-black"
}), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("button", {
"aria-label": Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_8__["__"])('Choose a shade'),
"aria-describedby": "color-picker-saturation-".concat(instanceId),
className: "components-color-picker__saturation-pointer",
style: pointerLocation,
onKeyDown: this.preventKeyEvents
}), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("div", {
className: "screen-reader-text",
id: "color-picker-saturation-".concat(instanceId)
}, Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_8__["__"])('Use your arrow keys to change the base color. Move up to lighten the color, down to darken, left to decrease saturation, and right to increase saturation.'))));
/* eslint-enable jsx-a11y/no-noninteractive-element-interactions */
}
}]);
return Saturation;
}(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["Component"]);
/* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_10__["compose"])(_wordpress_compose__WEBPACK_IMPORTED_MODULE_10__["pure"], _wordpress_compose__WEBPACK_IMPORTED_MODULE_10__["withInstanceId"])(Saturation));
/***/ }),
/***/ "./node_modules/@wordpress/components/build-module/color-picker/utils.js":
/*!*******************************************************************************!*\
!*** ./node_modules/@wordpress/components/build-module/color-picker/utils.js ***!
\*******************************************************************************/
/*! exports provided: colorToState, isValidHex, simpleCheckForValidColor, calculateAlphaChange, calculateHueChange, calculateSaturationChange */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "colorToState", function() { return colorToState; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isValidHex", function() { return isValidHex; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "simpleCheckForValidColor", function() { return simpleCheckForValidColor; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "calculateAlphaChange", function() { return calculateAlphaChange; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "calculateHueChange", function() { return calculateHueChange; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "calculateSaturationChange", function() { return calculateSaturationChange; });
/* 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__);
/* harmony import */ var tinycolor2__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! tinycolor2 */ "./node_modules/tinycolor2/tinycolor.js");
/* harmony import */ var tinycolor2__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(tinycolor2__WEBPACK_IMPORTED_MODULE_1__);
/**
* Parts of this source were derived and modified from react-color,
* released under the MIT license.
*
* https://github.com/casesandberg/react-color/
*
* Copyright (c) 2015 Case Sandberg
*
* 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.
*/
/**
* External dependencies
*/
/**
* Given a hex color, get all other color properties (rgb, alpha, etc).
*
* @param {Object|string} data A hex color string or an object with a hex property
* @param {string} oldHue A reference to the hue of the previous color, otherwise dragging the saturation to zero will reset the current hue to zero as well. See https://github.com/casesandberg/react-color/issues/29#issuecomment-132686909.
* @return {Object} An object of different color representations.
*/
function colorToState() {
var data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
var oldHue = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
var color = data.hex ? tinycolor2__WEBPACK_IMPORTED_MODULE_1___default()(data.hex) : tinycolor2__WEBPACK_IMPORTED_MODULE_1___default()(data);
var hsl = color.toHsl();
hsl.h = Math.round(hsl.h);
hsl.s = Math.round(hsl.s * 100);
hsl.l = Math.round(hsl.l * 100);
var hsv = color.toHsv();
hsv.h = Math.round(hsv.h);
hsv.s = Math.round(hsv.s * 100);
hsv.v = Math.round(hsv.v * 100);
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 {
color: color,
hex: transparent ? 'transparent' : "#".concat(hex),
hsl: hsl,
hsv: hsv,
oldHue: data.h || oldHue || hsl.h,
rgb: rgb,
source: data.source
};
}
/**
* Get the top/left offsets of a point in a container, also returns the container width/height.
*
* @param {Event} e Mouse or touch event with a location coordinate.
* @param {HTMLElement} container The container div, returned point is relative to this container.
* @return {Object} An object of the offset positions & container size.
*/
function getPointOffset(e, container) {
e.preventDefault();
var _container$getBoundin = container.getBoundingClientRect(),
containerLeft = _container$getBoundin.left,
containerTop = _container$getBoundin.top,
width = _container$getBoundin.width,
height = _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 - (containerLeft + window.pageXOffset);
var top = y - (containerTop + window.pageYOffset);
if (left < 0) {
left = 0;
} else if (left > width) {
left = width;
} else if (top < 0) {
top = 0;
} else if (top > height) {
top = height;
}
return {
top: top,
left: left,
width: width,
height: height
};
}
/**
* Check if a string is a valid hex color code.
*
* @param {string} hex A possible hex color.
* @return {boolean} True if the color is a valid hex color.
*/
function isValidHex(hex) {
// disable hex4 and hex8
var lh = String(hex).charAt(0) === '#' ? 1 : 0;
return hex.length !== 4 + lh && hex.length < 7 + lh && tinycolor2__WEBPACK_IMPORTED_MODULE_1___default()(hex).isValid();
}
/**
* Check an object for any valid color properties.
*
* @param {Object} data A possible object representing a color.
* @return {Object|boolean} If a valid representation of color, returns the data object. Otherwise returns false.
*/
function simpleCheckForValidColor(data) {
var keysToCheck = ['r', 'g', 'b', 'a', 'h', 's', 'l', 'v'];
var checked = 0;
var passed = 0;
Object(lodash__WEBPACK_IMPORTED_MODULE_0__["each"])(keysToCheck, function (letter) {
if (data[letter]) {
checked += 1;
if (!isNaN(data[letter])) {
passed += 1;
}
}
});
return checked === passed ? data : false;
}
/**
* Calculate the current alpha based on a mouse or touch event
*
* @param {Event} e A mouse or touch event on the alpha bar.
* @param {Object} props The current component props
* @param {HTMLElement} container The container div for the alpha bar graph.
* @return {Object|null} If the alpha value has changed, returns a new color object.
*/
function calculateAlphaChange(e, props, container) {
var _getPointOffset = getPointOffset(e, container),
left = _getPointOffset.left,
width = _getPointOffset.width;
var a = left < 0 ? 0 : Math.round(left * 100 / width) / 100;
if (props.hsl.a !== a) {
return {
h: props.hsl.h,
s: props.hsl.s,
l: props.hsl.l,
a: a,
source: 'rgb'
};
}
return null;
}
/**
* Calculate the current hue based on a mouse or touch event
*
* @param {Event} e A mouse or touch event on the hue bar.
* @param {Object} props The current component props
* @param {HTMLElement} container The container div for the hue bar graph.
* @return {Object|null} If the hue value has changed, returns a new color object.
*/
function calculateHueChange(e, props, container) {
var _getPointOffset2 = getPointOffset(e, container),
left = _getPointOffset2.left,
width = _getPointOffset2.width;
var percent = left * 100 / width;
var h = left >= width ? 359 : 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;
}
/**
* Calculate the current saturation & brightness based on a mouse or touch event
*
* @param {Event} e A mouse or touch event on the saturation graph.
* @param {Object} props The current component props
* @param {HTMLElement} container The container div for the 2D saturation graph.
* @return {Object} Returns a new color object.
*/
function calculateSaturationChange(e, props, container) {
var _getPointOffset3 = getPointOffset(e, container),
top = _getPointOffset3.top,
left = _getPointOffset3.left,
width = _getPointOffset3.width,
height = _getPointOffset3.height;
var saturation = left < 0 ? 0 : left * 100 / width;
var bright = top >= height ? 0 : -(top * 100 / height) + 100; // `v` values less than 1 are considered in the [0,1] range, causing unexpected behavior at the bottom
// of the chart. To fix this, we assume any value less than 1 should be 0 brightness.
if (bright < 1) {
bright = 0;
}
return {
h: props.hsl.h,
s: saturation,
v: bright,
a: props.hsl.a,
source: 'rgb'
};
}
/***/ }),
/***/ "./node_modules/@wordpress/components/build-module/dashicon/icon-class.js":
/*!********************************************************************************!*\
!*** ./node_modules/@wordpress/components/build-module/dashicon/icon-class.js ***!
\********************************************************************************/
/*! exports provided: getIconClassName */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getIconClassName", function() { return getIconClassName; });
var getIconClassName = function getIconClassName(icon, className) {
return ['dashicon', 'dashicons-' + icon, className].filter(Boolean).join(' ');
};
/***/ }),
/***/ "./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_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 */ "./node_modules/@wordpress/element/build-module/index.js");
/* harmony import */ var _primitives__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../primitives */ "./node_modules/@wordpress/components/build-module/primitives/index.js");
/* harmony import */ var _icon_class__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./icon-class */ "./node_modules/@wordpress/components/build-module/dashicon/icon-class.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_6__["default"])(Dashicon, _Component);
function Dashicon() {
Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_2__["default"])(this, Dashicon);
return Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_4__["default"])(this, Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_5__["default"])(Dashicon).apply(this, arguments));
}
Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_3__["default"])(Dashicon, [{
key: "render",
value: function render() {
var _this$props = this.props,
icon = _this$props.icon,
_this$props$size = _this$props.size,
size = _this$props$size === void 0 ? 20 : _this$props$size,
className = _this$props.className,
ariaPressed = _this$props.ariaPressed,
extraProps = Object(_babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__["default"])(_this$props, ["icon", "size", "className", "ariaPressed"]);
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 'keyboard-hide':
path = 'M18,0 L2,0 C0.9,0 0.01,0.9 0.01,2 L0,12 C0,13.1 0.9,14 2,14 L18,14 C19.1,14 20,13.1 20,12 L20,2 C20,0.9 19.1,0 18,0 Z M18,12 L2,12 L2,2 L18,2 L18,12 Z M9,3 L11,3 L11,5 L9,5 L9,3 Z M9,6 L11,6 L11,8 L9,8 L9,6 Z M6,3 L8,3 L8,5 L6,5 L6,3 Z M6,6 L8,6 L8,8 L6,8 L6,6 Z M3,6 L5,6 L5,8 L3,8 L3,6 Z M3,3 L5,3 L5,5 L3,5 L3,3 Z M6,9 L14,9 L14,11 L6,11 L6,9 Z M12,6 L14,6 L14,8 L12,8 L12,6 Z M12,3 L14,3 L14,5 L12,5 L12,3 Z M15,6 L17,6 L17,8 L15,8 L15,6 Z M15,3 L17,3 L17,5 L15,5 L15,3 Z M10,20 L14,16 L6,16 L10,20 Z';
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 = Object(_icon_class__WEBPACK_IMPORTED_MODULE_9__["getIconClassName"])(icon, className, ariaPressed);
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["createElement"])(_primitives__WEBPACK_IMPORTED_MODULE_8__["SVG"], Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({
"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"
}, extraProps), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["createElement"])(_primitives__WEBPACK_IMPORTED_MODULE_8__["Path"], {
d: path
}));
}
}]);
return Dashicon;
}(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["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_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_assertThisInitialized__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/esm/assertThisInitialized */ "./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.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 _wordpress_element__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @wordpress/element */ "./node_modules/@wordpress/element/build-module/index.js");
/* harmony import */ var moment__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! moment */ "./node_modules/moment/moment.js");
/* harmony import */ var moment__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(moment__WEBPACK_IMPORTED_MODULE_7__);
/* harmony import */ var react_dates__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! react-dates */ "./node_modules/react-dates/index.js");
/* harmony import */ var react_dates__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(react_dates__WEBPACK_IMPORTED_MODULE_8__);
/**
* External dependencies
*/
/**
* WordPress dependencies
*/
/**
* Module Constants
*/
var TIMEZONELESS_FORMAT = 'YYYY-MM-DDTHH:mm:ss';
var isRTL = function isRTL() {
return document.documentElement.dir === 'rtl';
};
var DatePicker =
/*#__PURE__*/
function (_Component) {
Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_5__["default"])(DatePicker, _Component);
function DatePicker() {
var _this;
Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__["default"])(this, DatePicker);
_this = Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__["default"])(this, Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__["default"])(DatePicker).apply(this, arguments));
_this.onChangeMoment = _this.onChangeMoment.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_4__["default"])(_this));
_this.nodeRef = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createRef"])();
_this.keepFocusInside = _this.keepFocusInside.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_4__["default"])(_this));
return _this;
}
/*
* Todo: We should remove this function ASAP.
* It is kept because focus is lost when we click on the previous and next month buttons.
* This focus loss closes the date picker popover.
* Ideally we should add an upstream commit on react-dates to fix this issue.
*/
Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__["default"])(DatePicker, [{
key: "keepFocusInside",
value: function keepFocusInside() {
if (!this.nodeRef.current) {
return;
} // If focus was lost.
if (!document.activeElement || !this.nodeRef.current.contains(document.activeElement)) {
// Retrieve the focus region div.
var focusRegion = this.nodeRef.current.querySelector('.DayPicker_focusRegion');
if (!focusRegion) {
return;
} // Keep the focus on focus region.
focusRegion.focus();
}
}
}, {
key: "onChangeMoment",
value: function onChangeMoment(newDate) {
var _this$props = this.props,
currentDate = _this$props.currentDate,
onChange = _this$props.onChange; // If currentDate is null, use now as momentTime to designate hours, minutes, seconds.
var momentDate = currentDate ? moment__WEBPACK_IMPORTED_MODULE_7___default()(currentDate) : moment__WEBPACK_IMPORTED_MODULE_7___default()();
var momentTime = {
hours: momentDate.hours(),
minutes: momentDate.minutes(),
seconds: 0
};
onChange(newDate.set(momentTime).format(TIMEZONELESS_FORMAT));
}
/**
* Create a Moment object from a date string. With no currentDate supplied, default to a Moment
* object representing now. If a null value is passed, return a null value.
*
* @param {?string} currentDate Date representing the currently selected date or null to signify no selection.
* @return {?Moment} Moment object for selected date or null.
*/
}, {
key: "getMomentDate",
value: function getMomentDate(currentDate) {
if (null === currentDate) {
return null;
}
return currentDate ? moment__WEBPACK_IMPORTED_MODULE_7___default()(currentDate) : moment__WEBPACK_IMPORTED_MODULE_7___default()();
}
}, {
key: "render",
value: function render() {
var _this$props2 = this.props,
currentDate = _this$props2.currentDate,
isInvalidDate = _this$props2.isInvalidDate;
var momentDate = this.getMomentDate(currentDate);
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("div", {
className: "components-datetime__date",
ref: this.nodeRef
}, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(react_dates__WEBPACK_IMPORTED_MODULE_8__["DayPickerSingleDateController"], {
date: momentDate,
daySize: 30,
focused: true,
hideKeyboardShortcutsPanel: true // This is a hack to force the calendar to update on month or year change
// https://github.com/airbnb/react-dates/issues/240#issuecomment-361776665
,
key: "datepicker-controller-".concat(momentDate ? momentDate.format('MM-YYYY') : 'null'),
noBorder: true,
numberOfMonths: 1,
onDateChange: this.onChangeMoment,
transitionDuration: 0,
weekDayFormat: "ddd",
isRTL: isRTL(),
isOutsideRange: function isOutsideRange(date) {
return isInvalidDate && isInvalidDate(date.toDate());
},
onPrevMonthClick: this.keepFocusInside,
onNextMonthClick: this.keepFocusInside
}));
}
}]);
return DatePicker;
}(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["Component"]);
/* 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_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_assertThisInitialized__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/esm/assertThisInitialized */ "./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.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 _wordpress_element__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @wordpress/element */ "./node_modules/@wordpress/element/build-module/index.js");
/* harmony import */ var react_dates_initialize__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! react-dates/initialize */ "./node_modules/react-dates/initialize.js");
/* harmony import */ var react_dates_initialize__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(react_dates_initialize__WEBPACK_IMPORTED_MODULE_7__);
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @wordpress/i18n */ "./node_modules/@wordpress/i18n/build-module/index.js");
/* harmony import */ var _button__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../button */ "./node_modules/@wordpress/components/build-module/button/index.js");
/* harmony import */ var _date__WEBPACK_IMPORTED_MODULE_10__ = __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_10__["default"]; });
/* harmony import */ var _time__WEBPACK_IMPORTED_MODULE_11__ = __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_11__["default"]; });
/**
* External dependencies
*/
// Needed to initialise the default datepicker styles.
// See: https://github.com/airbnb/react-dates#initialize
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
var DateTimePicker =
/*#__PURE__*/
function (_Component) {
Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_5__["default"])(DateTimePicker, _Component);
function DateTimePicker() {
var _this;
Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__["default"])(this, DateTimePicker);
_this = Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__["default"])(this, Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__["default"])(DateTimePicker).apply(this, arguments));
_this.state = {
calendarHelpIsVisible: false
};
_this.onClickDescriptionToggle = _this.onClickDescriptionToggle.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_4__["default"])(_this));
return _this;
}
Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__["default"])(DateTimePicker, [{
key: "onClickDescriptionToggle",
value: function onClickDescriptionToggle() {
this.setState({
calendarHelpIsVisible: !this.state.calendarHelpIsVisible
});
}
}, {
key: "render",
value: function render() {
var _this$props = this.props,
currentDate = _this$props.currentDate,
is12Hour = _this$props.is12Hour,
onChange = _this$props.onChange;
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("div", {
className: "components-datetime"
}, !this.state.calendarHelpIsVisible && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["Fragment"], null, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(_time__WEBPACK_IMPORTED_MODULE_11__["default"], {
currentTime: currentDate,
onChange: onChange,
is12Hour: is12Hour
}), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(_date__WEBPACK_IMPORTED_MODULE_10__["default"], {
currentDate: currentDate,
onChange: onChange
})), this.state.calendarHelpIsVisible && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["Fragment"], null, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("div", {
className: "components-datetime__calendar-help"
}, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("h4", null, Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_8__["__"])('Click to Select')), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("ul", null, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("li", null, Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_8__["__"])('Click the right or left arrows to select other months in the past or the future.')), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("li", null, Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_8__["__"])('Click the desired day to select it.'))), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("h4", null, Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_8__["__"])('Navigating with a keyboard')), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("ul", null, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("li", null, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("abbr", {
"aria-label": Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_8__["_x"])('Enter', 'keyboard button')
}, "\u21B5"), ' '
/* JSX removes whitespace, but a space is required for screen readers. */
, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("span", null, Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_8__["__"])('Select the date in focus.'))), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("li", null, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("abbr", {
"aria-label": Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_8__["__"])('Left and Right Arrows')
}, "\u2190/\u2192"), ' '
/* JSX removes whitespace, but a space is required for screen readers. */
, Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_8__["__"])('Move backward (left) or forward (right) by one day.')), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("li", null, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("abbr", {
"aria-label": Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_8__["__"])('Up and Down Arrows')
}, "\u2191/\u2193"), ' '
/* JSX removes whitespace, but a space is required for screen readers. */
, Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_8__["__"])('Move backward (up) or forward (down) by one week.')), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("li", null, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("abbr", {
"aria-label": Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_8__["__"])('Page Up and Page Down')
}, Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_8__["__"])('PgUp/PgDn')), ' '
/* JSX removes whitespace, but a space is required for screen readers. */
, Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_8__["__"])('Move backward (PgUp) or forward (PgDn) by one month.')), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("li", null, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("abbr", {
"aria-label": Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_8__["__"])('Home and End')
}, Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_8__["__"])('Home/End')), ' '
/* JSX removes whitespace, but a space is required for screen readers. */
, Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_8__["__"])('Go to the first (home) or last (end) day of a week.'))), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(_button__WEBPACK_IMPORTED_MODULE_9__["default"], {
isSmall: true,
onClick: this.onClickDescriptionToggle
}, Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_8__["__"])('Close')))), !this.state.calendarHelpIsVisible && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(_button__WEBPACK_IMPORTED_MODULE_9__["default"], {
className: "components-datetime__date-help-button",
isLink: true,
onClick: this.onClickDescriptionToggle
}, Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_8__["__"])('Calendar Help')));
}
}]);
return DateTimePicker;
}(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["Component"]);
/***/ }),
/***/ "./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_assertThisInitialized__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/esm/assertThisInitialized */ "./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.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 _wordpress_element__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @wordpress/element */ "./node_modules/@wordpress/element/build-module/index.js");
/* 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 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 moment__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! moment */ "./node_modules/moment/moment.js");
/* harmony import */ var moment__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(moment__WEBPACK_IMPORTED_MODULE_9__);
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @wordpress/i18n */ "./node_modules/@wordpress/i18n/build-module/index.js");
/* harmony import */ var _button__WEBPACK_IMPORTED_MODULE_11__ = __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_5__["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 = {
day: '',
month: '',
year: '',
hours: '',
minutes: '',
am: true,
date: null
};
_this.changeDate = _this.changeDate.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_4__["default"])(_this));
_this.updateMonth = _this.updateMonth.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_4__["default"])(_this));
_this.onChangeMonth = _this.onChangeMonth.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_4__["default"])(_this));
_this.updateDay = _this.updateDay.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_4__["default"])(_this));
_this.onChangeDay = _this.onChangeDay.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_4__["default"])(_this));
_this.updateYear = _this.updateYear.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_4__["default"])(_this));
_this.onChangeYear = _this.onChangeYear.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_4__["default"])(_this));
_this.updateHours = _this.updateHours.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_4__["default"])(_this));
_this.updateMinutes = _this.updateMinutes.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_4__["default"])(_this));
_this.onChangeHours = _this.onChangeHours.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_4__["default"])(_this));
_this.onChangeMinutes = _this.onChangeMinutes.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_4__["default"])(_this));
_this.renderMonth = _this.renderMonth.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_4__["default"])(_this));
_this.renderDay = _this.renderDay.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_4__["default"])(_this));
_this.renderDayMonthFormat = _this.renderDayMonthFormat.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_4__["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);
}
}
/**
* Function that sets the date state and calls the onChange with a new date.
* The date is truncated at the minutes.
*
* @param {Object} newDate The date object.
*/
}, {
key: "changeDate",
value: function changeDate(newDate) {
var dateWithStartOfMinutes = newDate.clone().startOf('minute');
this.setState({
date: dateWithStartOfMinutes
});
this.props.onChange(newDate.format(TIMEZONELESS_FORMAT));
}
}, {
key: "getMaxHours",
value: function getMaxHours() {
return this.props.is12Hour ? 12 : 23;
}
}, {
key: "getMinHours",
value: function getMinHours() {
return this.props.is12Hour ? 1 : 0;
}
}, {
key: "syncState",
value: function syncState(_ref) {
var currentTime = _ref.currentTime,
is12Hour = _ref.is12Hour;
var selected = currentTime ? moment__WEBPACK_IMPORTED_MODULE_9___default()(currentTime) : moment__WEBPACK_IMPORTED_MODULE_9___default()();
var day = selected.format('DD');
var month = selected.format('MM');
var year = selected.format('YYYY');
var minutes = selected.format('mm');
var am = selected.format('A');
var hours = selected.format(is12Hour ? 'hh' : 'HH');
var date = currentTime ? moment__WEBPACK_IMPORTED_MODULE_9___default()(currentTime) : moment__WEBPACK_IMPORTED_MODULE_9___default()();
this.setState({
day: day,
month: month,
year: year,
minutes: minutes,
hours: hours,
am: am,
date: date
});
}
}, {
key: "updateHours",
value: function updateHours() {
var is12Hour = this.props.is12Hour;
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_8__["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.changeDate(newDate);
}
}, {
key: "updateMinutes",
value: function updateMinutes() {
var _this$state2 = this.state,
minutes = _this$state2.minutes,
date = _this$state2.date;
var value = parseInt(minutes, 10);
if (!Object(lodash__WEBPACK_IMPORTED_MODULE_8__["isInteger"])(value) || value < 0 || value > 59) {
this.syncState(this.props);
return;
}
var newDate = date.clone().minutes(value);
this.changeDate(newDate);
}
}, {
key: "updateDay",
value: function updateDay() {
var _this$state3 = this.state,
day = _this$state3.day,
date = _this$state3.date;
var value = parseInt(day, 10);
if (!Object(lodash__WEBPACK_IMPORTED_MODULE_8__["isInteger"])(value) || value < 1 || value > 31) {
this.syncState(this.props);
return;
}
var newDate = date.clone().date(value);
this.changeDate(newDate);
}
}, {
key: "updateMonth",
value: function updateMonth() {
var _this$state4 = this.state,
month = _this$state4.month,
date = _this$state4.date;
var value = parseInt(month, 10);
if (!Object(lodash__WEBPACK_IMPORTED_MODULE_8__["isInteger"])(value) || value < 1 || value > 12) {
this.syncState(this.props);
return;
}
var newDate = date.clone().month(value - 1);
this.changeDate(newDate);
}
}, {
key: "updateYear",
value: function updateYear() {
var _this$state5 = this.state,
year = _this$state5.year,
date = _this$state5.date;
var value = parseInt(year, 10);
if (!Object(lodash__WEBPACK_IMPORTED_MODULE_8__["isInteger"])(value) || value < 0 || value > 9999) {
this.syncState(this.props);
return;
}
var newDate = date.clone().year(value);
this.changeDate(newDate);
}
}, {
key: "updateAmPm",
value: function updateAmPm(value) {
var _this2 = this;
return function () {
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.changeDate(newDate);
};
}
}, {
key: "onChangeDay",
value: function onChangeDay(event) {
this.setState({
day: event.target.value
});
}
}, {
key: "onChangeMonth",
value: function onChangeMonth(event) {
this.setState({
month: event.target.value
});
}
}, {
key: "onChangeYear",
value: function onChangeYear(event) {
this.setState({
year: event.target.value
});
}
}, {
key: "onChangeHours",
value: function onChangeHours(event) {
this.setState({
hours: event.target.value
});
}
}, {
key: "onChangeMinutes",
value: function onChangeMinutes(event) {
var minutes = event.target.value;
this.setState({
minutes: minutes === '' ? '' : ('0' + minutes).slice(-2)
});
}
}, {
key: "renderMonth",
value: function renderMonth(month) {
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("div", {
key: "render-month",
className: "components-datetime__time-field components-datetime__time-field-month"
}, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("select", {
"aria-label": Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_10__["__"])('Month'),
className: "components-datetime__time-field-month-select",
value: month,
onChange: this.onChangeMonth,
onBlur: this.updateMonth
}, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("option", {
value: "01"
}, Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_10__["__"])('January')), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("option", {
value: "02"
}, Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_10__["__"])('February')), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("option", {
value: "03"
}, Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_10__["__"])('March')), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("option", {
value: "04"
}, Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_10__["__"])('April')), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("option", {
value: "05"
}, Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_10__["__"])('May')), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("option", {
value: "06"
}, Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_10__["__"])('June')), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("option", {
value: "07"
}, Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_10__["__"])('July')), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("option", {
value: "08"
}, Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_10__["__"])('August')), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("option", {
value: "09"
}, Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_10__["__"])('September')), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("option", {
value: "10"
}, Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_10__["__"])('October')), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("option", {
value: "11"
}, Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_10__["__"])('November')), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("option", {
value: "12"
}, Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_10__["__"])('December'))));
}
}, {
key: "renderDay",
value: function renderDay(day) {
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("div", {
key: "render-day",
className: "components-datetime__time-field components-datetime__time-field-day"
}, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("input", {
"aria-label": Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_10__["__"])('Day'),
className: "components-datetime__time-field-day-input",
type: "number",
value: day,
step: 1,
min: 1,
onChange: this.onChangeDay,
onBlur: this.updateDay
}));
}
}, {
key: "renderDayMonthFormat",
value: function renderDayMonthFormat(is12Hour) {
var _this$state6 = this.state,
day = _this$state6.day,
month = _this$state6.month;
var layout = [this.renderDay(day), this.renderMonth(month)];
return is12Hour ? layout : layout.reverse();
}
}, {
key: "render",
value: function render() {
var is12Hour = this.props.is12Hour;
var _this$state7 = this.state,
year = _this$state7.year,
minutes = _this$state7.minutes,
hours = _this$state7.hours,
am = _this$state7.am;
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("div", {
className: classnames__WEBPACK_IMPORTED_MODULE_7___default()('components-datetime__time')
}, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("fieldset", null, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("legend", {
className: "components-datetime__time-legend invisible"
}, Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_10__["__"])('Date')), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("div", {
className: "components-datetime__time-wrapper"
}, this.renderDayMonthFormat(is12Hour), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("div", {
className: "components-datetime__time-field components-datetime__time-field-year"
}, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("input", {
"aria-label": Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_10__["__"])('Year'),
className: "components-datetime__time-field-year-input",
type: "number",
step: 1,
value: year,
onChange: this.onChangeYear,
onBlur: this.updateYear
})))), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("fieldset", null, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("legend", {
className: "components-datetime__time-legend invisible"
}, Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_10__["__"])('Time')), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("div", {
className: "components-datetime__time-wrapper"
}, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("div", {
className: "components-datetime__time-field components-datetime__time-field-time"
}, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("input", {
"aria-label": Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_10__["__"])('Hours'),
className: "components-datetime__time-field-hours-input",
type: "number",
step: 1,
min: this.getMinHours(),
max: this.getMaxHours(),
value: hours,
onChange: this.onChangeHours,
onBlur: this.updateHours
}), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("span", {
className: "components-datetime__time-separator",
"aria-hidden": "true"
}, ":"), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("input", {
"aria-label": Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_10__["__"])('Minutes'),
className: "components-datetime__time-field-minutes-input",
type: "number",
min: 0,
max: 59,
value: minutes,
onChange: this.onChangeMinutes,
onBlur: this.updateMinutes
})), is12Hour && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("div", {
className: "components-datetime__time-field components-datetime__time-field-am-pm"
}, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(_button__WEBPACK_IMPORTED_MODULE_11__["default"], {
"aria-pressed": am === 'AM',
isDefault: true,
className: "components-datetime__time-am-button",
isToggled: am === 'AM',
onClick: this.updateAmPm('AM')
}, Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_10__["__"])('AM')), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(_button__WEBPACK_IMPORTED_MODULE_11__["default"], {
"aria-pressed": am === 'PM',
isDefault: true,
className: "components-datetime__time-pm-button",
isToggled: am === 'PM',
onClick: this.updateAmPm('PM')
}, Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_10__["__"])('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_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @babel/runtime/helpers/esm/assertThisInitialized */ "./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.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 _wordpress_element__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @wordpress/element */ "./node_modules/@wordpress/element/build-module/index.js");
/* 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 */ "./node_modules/@wordpress/dom/build-module/index.js");
/**
* 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".
*
* @see 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_7__["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_6__["default"])(_this));
_this.disable = _this.disable.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__["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_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_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_inherits__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inherits */ "./node_modules/@babel/runtime/helpers/esm/inherits.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 */ "./node_modules/@wordpress/element/build-module/index.js");
/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @wordpress/compose */ "./node_modules/@wordpress/compose/build-module/index.js");
/**
* External dependencies
*/
/**
* WordPress dependencies
*/
var dragImageClass = 'components-draggable__invisible-drag-image';
var cloneWrapperClass = 'components-draggable__clone';
var cloneHeightTransformationBreakpoint = 700;
var clonePadding = 20;
var Draggable =
/*#__PURE__*/
function (_Component) {
Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_6__["default"])(Draggable, _Component);
function Draggable() {
var _this;
Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_1__["default"])(this, Draggable);
_this = Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__["default"])(this, Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__["default"])(Draggable).apply(this, arguments));
_this.onDragStart = _this.onDragStart.bind(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"])(_this));
_this.onDragEnd = _this.onDragEnd.bind(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"])(_this));
return _this;
}
Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_2__["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;
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;
}
/**
* This method does a couple of things:
*
* - 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.
*/
}, {
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_0__["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);
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;
} // 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_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_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_extends__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @wordpress/element */ "./node_modules/@wordpress/element/build-module/index.js");
/* 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 _wordpress_i18n__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @wordpress/i18n */ "./node_modules/@wordpress/i18n/build-module/index.js");
/* harmony import */ var _dashicon__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../dashicon */ "./node_modules/@wordpress/components/build-module/dashicon/index.js");
/* harmony import */ var _provider__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./provider */ "./node_modules/@wordpress/components/build-module/drop-zone/provider.js");
/**
* External dependencies
*/
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
var DropZone = function DropZone(props) {
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["createElement"])(_provider__WEBPACK_IMPORTED_MODULE_12__["DropZoneConsumer"], null, function (_ref) {
var addDropZone = _ref.addDropZone,
removeDropZone = _ref.removeDropZone;
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["createElement"])(DropZoneComponent, Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_7__["default"])({
addDropZone: addDropZone,
removeDropZone: removeDropZone
}, props));
});
};
var DropZoneComponent =
/*#__PURE__*/
function (_Component) {
Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_6__["default"])(DropZoneComponent, _Component);
function DropZoneComponent() {
var _this;
Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_1__["default"])(this, DropZoneComponent);
_this = Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__["default"])(this, Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__["default"])(DropZoneComponent).apply(this, arguments));
_this.dropZoneElement = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["createRef"])();
_this.dropZone = {
element: null,
onDrop: _this.props.onDrop,
onFilesDrop: _this.props.onFilesDrop,
onHTMLDrop: _this.props.onHTMLDrop,
setState: _this.setState.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["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"])(DropZoneComponent, [{
key: "componentDidMount",
value: function componentDidMount() {
// Set element after the component has a node assigned in the DOM
this.dropZone.element = this.dropZoneElement.current;
this.props.addDropZone(this.dropZone);
}
}, {
key: "componentWillUnmount",
value: function componentWillUnmount() {
this.props.removeDropZone(this.dropZone);
}
}, {
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_9___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));
var children;
if (isDraggingOverElement) {
children = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["createElement"])("div", {
className: "components-drop-zone__content"
}, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["createElement"])(_dashicon__WEBPACK_IMPORTED_MODULE_11__["default"], {
icon: "upload",
size: "40",
className: "components-drop-zone__content-icon"
}), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["createElement"])("span", {
className: "components-drop-zone__content-text"
}, label ? label : Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_10__["__"])('Drop files to upload')));
}
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["createElement"])("div", {
ref: this.dropZoneElement,
className: classes
}, children);
}
}]);
return DropZoneComponent;
}(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["Component"]);
/* 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, DropZoneConsumer */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DropZoneConsumer", function() { return Consumer; });
/* 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_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_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 */ "./node_modules/@wordpress/element/build-module/index.js");
/* 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_is_shallow_equal__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @wordpress/is-shallow-equal */ "./node_modules/@wordpress/is-shallow-equal/index.js");
/* 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 _createContext = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["createContext"])({
addDropZone: function addDropZone() {},
removeDropZone: function removeDropZone() {}
}),
Provider = _createContext.Provider,
Consumer = _createContext.Consumer;
var getDragEventType = function getDragEventType(_ref) {
var dataTransfer = _ref.dataTransfer;
if (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_8__["includes"])(dataTransfer.types, 'Files')) {
return 'file';
}
if (Object(lodash__WEBPACK_IMPORTED_MODULE_8__["includes"])(dataTransfer.types, 'text/html')) {
return 'html';
}
}
return 'default';
};
var isTypeSupportedByDropZone = function isTypeSupportedByDropZone(type, dropZone) {
return type === 'file' && dropZone.onFilesDrop || type === 'html' && dropZone.onHTMLDrop || type === 'default' && dropZone.onDrop;
};
var isWithinElementBounds = function isWithinElementBounds(element, x, y) {
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;
};
var DropZoneProvider =
/*#__PURE__*/
function (_Component) {
Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_6__["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)); // Event listeners
_this.onDragOver = _this.onDragOver.bind(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"])(_this)); // Context methods so this component can receive data from consumers
_this.addDropZone = _this.addDropZone.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(_this));
_this.removeDropZone = _this.removeDropZone.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(_this)); // Utility methods
_this.resetDragState = _this.resetDragState.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(_this));
_this.toggleDraggingOverDocument = Object(lodash__WEBPACK_IMPORTED_MODULE_8__["throttle"])(_this.toggleDraggingOverDocument.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(_this)), 200);
_this.dropZones = [];
_this.dropZoneCallbacks = {
addDropZone: _this.addDropZone,
removeDropZone: _this.removeDropZone
};
_this.state = {
hoveredDropZone: -1,
isDraggingOverDocument: false,
position: null
};
return _this;
}
Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_2__["default"])(DropZoneProvider, [{
key: "componentDidMount",
value: function componentDidMount() {
window.addEventListener('dragover', this.onDragOver);
window.addEventListener('mouseup', this.resetDragState);
}
}, {
key: "componentWillUnmount",
value: function componentWillUnmount() {
window.removeEventListener('dragover', this.onDragOver);
window.removeEventListener('mouseup', this.resetDragState);
}
}, {
key: "addDropZone",
value: function addDropZone(dropZone) {
this.dropZones.push(dropZone);
}
}, {
key: "removeDropZone",
value: function removeDropZone(dropZone) {
this.dropZones = Object(lodash__WEBPACK_IMPORTED_MODULE_8__["filter"])(this.dropZones, function (dz) {
return dz !== dropZone;
});
}
}, {
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({
hoveredDropZone: -1,
isDraggingOverDocument: false,
position: null
});
this.dropZones.forEach(function (dropZone) {
return dropZone.setState({
isDraggingOverDocument: false,
isDraggingOverElement: false,
position: null,
type: null
});
});
}
}, {
key: "toggleDraggingOverDocument",
value: function toggleDraggingOverDocument(event, dragEventType) {
var _this2 = 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_8__["filter"])(this.dropZones, function (dropZone) {
return isTypeSupportedByDropZone(dragEventType, dropZone) && isWithinElementBounds(dropZone.element, detail.clientX, detail.clientY);
}); // Find the leaf dropzone not containing another dropzone
var hoveredDropZone = Object(lodash__WEBPACK_IMPORTED_MODULE_8__["find"])(hoveredDropZones, function (zone) {
return !Object(lodash__WEBPACK_IMPORTED_MODULE_8__["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 toUpdate = [];
if (!this.state.isDraggingOverDocument) {
toUpdate = this.dropZones;
} else if (hoveredDropZoneIndex !== this.state.hoveredDropZone) {
if (this.state.hoveredDropZone !== -1) {
toUpdate.push(this.dropZones[this.state.hoveredDropZone]);
}
if (hoveredDropZone) {
toUpdate.push(hoveredDropZone);
}
} else if (hoveredDropZone && hoveredDropZoneIndex === this.state.hoveredDropZone && !Object(lodash__WEBPACK_IMPORTED_MODULE_8__["isEqual"])(position, this.state.position)) {
toUpdate.push(hoveredDropZone);
} // Notifying the dropzones
toUpdate.forEach(function (dropZone) {
var index = _this2.dropZones.indexOf(dropZone);
var isDraggingOverDropZone = index === hoveredDropZoneIndex;
dropZone.setState({
isDraggingOverDocument: isTypeSupportedByDropZone(dragEventType, dropZone),
isDraggingOverElement: isDraggingOverDropZone,
position: isDraggingOverDropZone ? position : null,
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: "onDragOver",
value: function onDragOver(event) {
this.toggleDraggingOverDocument(event, getDragEventType(event));
event.preventDefault();
}
}, {
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 = getDragEventType(event);
var dropZone = this.dropZones[hoveredDropZone];
this.resetDragState();
if (dropZone) {
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() {
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["createElement"])("div", {
onDrop: this.onDrop,
className: "components-drop-zone__provider"
}, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["createElement"])(Provider, {
value: this.dropZoneCallbacks
}, this.props.children));
}
}]);
return DropZoneProvider;
}(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["Component"]);
/* 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 _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_objectSpread__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectSpread */ "./node_modules/@babel/runtime/helpers/esm/objectSpread.js");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/element */ "./node_modules/@wordpress/element/build-module/index.js");
/* 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 _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/keycodes */ "./node_modules/@wordpress/keycodes/build-module/index.js");
/* harmony import */ var _wordpress_deprecated__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @wordpress/deprecated */ "./node_modules/@wordpress/deprecated/build-module/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");
/* harmony import */ var _dropdown__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../dropdown */ "./node_modules/@wordpress/components/build-module/dropdown/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 mergeProps() {
var defaultProps = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
var props = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
var mergedProps = Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_1__["default"])({}, defaultProps, props);
if (props.className && defaultProps.className) {
mergedProps.className = classnames__WEBPACK_IMPORTED_MODULE_3___default()(props.className, defaultProps.className);
}
return mergedProps;
}
function DropdownMenu(_ref) {
var children = _ref.children,
className = _ref.className,
controls = _ref.controls,
_ref$hasArrowIndicato = _ref.hasArrowIndicator,
hasArrowIndicator = _ref$hasArrowIndicato === void 0 ? false : _ref$hasArrowIndicato,
_ref$icon = _ref.icon,
icon = _ref$icon === void 0 ? 'menu' : _ref$icon,
label = _ref.label,
popoverProps = _ref.popoverProps,
toggleProps = _ref.toggleProps,
menuProps = _ref.menuProps,
menuLabel = _ref.menuLabel,
position = _ref.position;
if (menuLabel) {
Object(_wordpress_deprecated__WEBPACK_IMPORTED_MODULE_6__["default"])('`menuLabel` prop in `DropdownComponent`', {
alternative: '`menuProps` object and its `aria-label` property',
plugin: 'Gutenberg'
});
}
if (position) {
Object(_wordpress_deprecated__WEBPACK_IMPORTED_MODULE_6__["default"])('`position` prop in `DropdownComponent`', {
alternative: '`popoverProps` object and its `position` property',
plugin: 'Gutenberg'
});
}
if (Object(lodash__WEBPACK_IMPORTED_MODULE_4__["isEmpty"])(controls) && !Object(lodash__WEBPACK_IMPORTED_MODULE_4__["isFunction"])(children)) {
return null;
} // Normalize controls to nested array of objects (sets of controls)
var controlSets;
if (!Object(lodash__WEBPACK_IMPORTED_MODULE_4__["isEmpty"])(controls)) {
controlSets = controls;
if (!Array.isArray(controlSets[0])) {
controlSets = [controlSets];
}
}
var mergedPopoverProps = mergeProps({
className: 'components-dropdown-menu__popover',
position: position
}, popoverProps);
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["createElement"])(_dropdown__WEBPACK_IMPORTED_MODULE_8__["default"], {
className: classnames__WEBPACK_IMPORTED_MODULE_3___default()('components-dropdown-menu', className),
popoverProps: mergedPopoverProps,
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_5__["DOWN"]) {
event.preventDefault();
event.stopPropagation();
onToggle();
}
};
var mergedToggleProps = mergeProps({
className: classnames__WEBPACK_IMPORTED_MODULE_3___default()('components-dropdown-menu__toggle', {
'is-opened': isOpen
}),
tooltip: label
}, toggleProps);
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"])({}, mergedToggleProps, {
icon: icon,
onClick: onToggle,
onKeyDown: openOnArrowDown,
"aria-haspopup": "true",
"aria-expanded": isOpen,
label: label
}), (!icon || hasArrowIndicator) && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["createElement"])("span", {
className: "components-dropdown-menu__indicator"
}));
},
renderContent: function renderContent(props) {
var mergedMenuProps = mergeProps({
'aria-label': menuLabel || label,
className: 'components-dropdown-menu__menu'
}, menuProps);
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["createElement"])(_navigable_container__WEBPACK_IMPORTED_MODULE_9__["NavigableMenu"], Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, mergedMenuProps, {
role: "menu"
}), Object(lodash__WEBPACK_IMPORTED_MODULE_4__["isFunction"])(children) ? children(props) : null, Object(lodash__WEBPACK_IMPORTED_MODULE_4__["flatMap"])(controlSets, function (controlSet, indexOfSet) {
return controlSet.map(function (control, indexOfControl) {
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["createElement"])(_icon_button__WEBPACK_IMPORTED_MODULE_7__["default"], {
key: [indexOfSet, indexOfControl].join(),
onClick: function onClick(event) {
event.stopPropagation();
props.onClose();
if (control.onClick) {
control.onClick();
}
},
className: classnames__WEBPACK_IMPORTED_MODULE_3___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_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_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_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 */ "./node_modules/@wordpress/element/build-module/index.js");
/* harmony import */ var _popover__WEBPACK_IMPORTED_MODULE_8__ = __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_6__["default"])(Dropdown, _Component);
function Dropdown() {
var _this;
Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_1__["default"])(this, Dropdown);
_this = Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__["default"])(this, Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__["default"])(Dropdown).apply(this, arguments));
_this.toggle = _this.toggle.bind(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"])(_this));
_this.closeIfFocusOutside = _this.closeIfFocusOutside.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(_this));
_this.containerRef = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["createRef"])();
_this.state = {
isOpen: false
};
return _this;
}
Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_2__["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: "toggle",
value: function toggle() {
this.setState(function (state) {
return {
isOpen: !state.isOpen
};
});
}
/**
* Closes the dropdown if a focus leaves the dropdown wrapper. This is
* intentionally distinct from `onClose` since focus loss from the popover
* is expected to occur when using the Dropdown's toggle button, in which
* case the correct behavior is to keep the dropdown closed.
*/
}, {
key: "closeIfFocusOutside",
value: function closeIfFocusOutside() {
if (!this.containerRef.current.contains(document.activeElement)) {
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,
focusOnMount = _this$props.focusOnMount,
popoverProps = _this$props.popoverProps;
var args = {
isOpen: isOpen,
onToggle: this.toggle,
onClose: this.close
};
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["createElement"])("div", {
className: className,
ref: this.containerRef
}, renderToggle(args), isOpen && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["createElement"])(_popover__WEBPACK_IMPORTED_MODULE_8__["default"], Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({
className: contentClassName,
position: position,
onClose: this.close,
onFocusOutside: this.closeIfFocusOutside,
expandOnMobile: expandOnMobile,
headerTitle: headerTitle,
focusOnMount: focusOnMount
}, popoverProps), renderContent(args)));
}
}]);
return Dropdown;
}(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["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 */ "./node_modules/@wordpress/element/build-module/index.js");
/* 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 */ "./node_modules/@wordpress/i18n/build-module/index.js");
/* 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"])([].concat(Object(_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_1__["default"])(rel.split(' ')), ['external', 'noreferrer', 'noopener']))).join(' ');
var classes = classnames__WEBPACK_IMPORTED_MODULE_4___default()('components-external-link', className);
return (// eslint-disable-next-line react/jsx-no-target-blank
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 tab)')), 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/focal-point-picker/index.js":
/*!*************************************************************************************!*\
!*** ./node_modules/@wordpress/components/build-module/focal-point-picker/index.js ***!
\*************************************************************************************/
/*! exports provided: FocalPointPicker, default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FocalPointPicker", function() { return FocalPointPicker; });
/* 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_assertThisInitialized__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/esm/assertThisInitialized */ "./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.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 _wordpress_element__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @wordpress/element */ "./node_modules/@wordpress/element/build-module/index.js");
/* 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 _wordpress_i18n__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @wordpress/i18n */ "./node_modules/@wordpress/i18n/build-module/index.js");
/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @wordpress/compose */ "./node_modules/@wordpress/compose/build-module/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");
/* harmony import */ var _higher_order_with_focus_outside__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../higher-order/with-focus-outside */ "./node_modules/@wordpress/components/build-module/higher-order/with-focus-outside/index.js");
/* harmony import */ var _primitives__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../primitives */ "./node_modules/@wordpress/components/build-module/primitives/index.js");
/**
* External dependencies
*/
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
var TEXTCONTROL_MIN = 0;
var TEXTCONTROL_MAX = 100;
var FocalPointPicker =
/*#__PURE__*/
function (_Component) {
Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_5__["default"])(FocalPointPicker, _Component);
function FocalPointPicker(props) {
var _this;
Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__["default"])(this, FocalPointPicker);
_this = Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__["default"])(this, Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__["default"])(FocalPointPicker).call(this, props));
_this.onMouseMove = _this.onMouseMove.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_4__["default"])(_this));
_this.state = {
isDragging: false,
bounds: {},
percentages: props.value
};
_this.containerRef = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createRef"])();
_this.imageRef = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createRef"])();
_this.horizontalPositionChanged = _this.horizontalPositionChanged.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_4__["default"])(_this));
_this.verticalPositionChanged = _this.verticalPositionChanged.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_4__["default"])(_this));
_this.onLoad = _this.onLoad.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_4__["default"])(_this));
return _this;
}
Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__["default"])(FocalPointPicker, [{
key: "componentDidUpdate",
value: function componentDidUpdate(prevProps) {
if (prevProps.url !== this.props.url) {
this.setState({
isDragging: false
});
}
}
}, {
key: "calculateBounds",
value: function calculateBounds() {
var bounds = {
top: 0,
left: 0,
bottom: 0,
right: 0,
width: 0,
height: 0
};
if (!this.imageRef.current) {
return bounds;
}
var dimensions = {
width: this.imageRef.current.clientWidth,
height: this.imageRef.current.clientHeight
};
var pickerDimensions = this.pickerDimensions();
var widthRatio = pickerDimensions.width / dimensions.width;
var heightRatio = pickerDimensions.height / dimensions.height;
if (heightRatio >= widthRatio) {
bounds.width = bounds.right = pickerDimensions.width;
bounds.height = dimensions.height * widthRatio;
bounds.top = (pickerDimensions.height - bounds.height) / 2;
bounds.bottom = bounds.top + bounds.height;
} else {
bounds.height = bounds.bottom = pickerDimensions.height;
bounds.width = dimensions.width * heightRatio;
bounds.left = (pickerDimensions.width - bounds.width) / 2;
bounds.right = bounds.left + bounds.width;
}
return bounds;
}
}, {
key: "onLoad",
value: function onLoad() {
this.setState({
bounds: this.calculateBounds()
});
}
}, {
key: "onMouseMove",
value: function onMouseMove(event) {
var _this$state = this.state,
isDragging = _this$state.isDragging,
bounds = _this$state.bounds;
var onChange = this.props.onChange;
if (isDragging) {
var pickerDimensions = this.pickerDimensions();
var cursorPosition = {
left: event.pageX - pickerDimensions.left,
top: event.pageY - pickerDimensions.top
};
var left = Math.max(bounds.left, Math.min(cursorPosition.left, bounds.right));
var top = Math.max(bounds.top, Math.min(cursorPosition.top, bounds.bottom));
var percentages = {
x: (left - bounds.left) / (pickerDimensions.width - bounds.left * 2),
y: (top - bounds.top) / (pickerDimensions.height - bounds.top * 2)
};
this.setState({
percentages: percentages
}, function () {
onChange({
x: this.state.percentages.x,
y: this.state.percentages.y
});
});
}
}
}, {
key: "fractionToPercentage",
value: function fractionToPercentage(fraction) {
return Math.round(fraction * 100);
}
}, {
key: "horizontalPositionChanged",
value: function horizontalPositionChanged(event) {
this.positionChangeFromTextControl('x', event.target.value);
}
}, {
key: "verticalPositionChanged",
value: function verticalPositionChanged(event) {
this.positionChangeFromTextControl('y', event.target.value);
}
}, {
key: "positionChangeFromTextControl",
value: function positionChangeFromTextControl(axis, value) {
var onChange = this.props.onChange;
var percentages = this.state.percentages;
var cleanValue = Math.max(Math.min(parseInt(value), 100), 0);
percentages[axis] = cleanValue ? cleanValue / 100 : 0;
this.setState({
percentages: percentages
}, function () {
onChange({
x: this.state.percentages.x,
y: this.state.percentages.y
});
});
}
}, {
key: "pickerDimensions",
value: function pickerDimensions() {
if (this.containerRef.current) {
return {
width: this.containerRef.current.clientWidth,
height: this.containerRef.current.clientHeight,
top: this.containerRef.current.getBoundingClientRect().top + document.body.scrollTop,
left: this.containerRef.current.getBoundingClientRect().left
};
}
return {
width: 0,
height: 0,
left: 0,
top: 0
};
}
}, {
key: "handleFocusOutside",
value: function handleFocusOutside() {
this.setState({
isDragging: false
});
}
}, {
key: "render",
value: function render() {
var _this2 = this;
var _this$props = this.props,
instanceId = _this$props.instanceId,
url = _this$props.url,
value = _this$props.value,
label = _this$props.label,
help = _this$props.help,
className = _this$props.className;
var _this$state2 = this.state,
bounds = _this$state2.bounds,
isDragging = _this$state2.isDragging,
percentages = _this$state2.percentages;
var pickerDimensions = this.pickerDimensions();
var iconCoordinates = {
left: value.x * (pickerDimensions.width - bounds.left * 2) + bounds.left,
top: value.y * (pickerDimensions.height - bounds.top * 2) + bounds.top
};
var iconContainerStyle = {
left: "".concat(iconCoordinates.left, "px"),
top: "".concat(iconCoordinates.top, "px")
};
var iconContainerClasses = classnames__WEBPACK_IMPORTED_MODULE_7___default()('components-focal-point-picker__icon_container', isDragging ? 'is-dragging' : null);
var id = "inspector-focal-point-picker-control-".concat(instanceId);
var horizontalPositionId = "inspector-focal-point-picker-control-horizontal-position-".concat(instanceId);
var verticalPositionId = "inspector-focal-point-picker-control-vertical-position-".concat(instanceId);
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(_base_control__WEBPACK_IMPORTED_MODULE_10__["default"], {
label: label,
id: id,
help: help,
className: className
}, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("div", {
className: "components-focal-point-picker-wrapper"
}, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("div", {
className: "components-focal-point-picker",
onMouseDown: function onMouseDown() {
return _this2.setState({
isDragging: true
});
},
onDragStart: function onDragStart() {
return _this2.setState({
isDragging: true
});
},
onMouseUp: function onMouseUp() {
return _this2.setState({
isDragging: false
});
},
onDrop: function onDrop() {
return _this2.setState({
isDragging: false
});
},
onMouseMove: this.onMouseMove,
ref: this.containerRef,
role: "button",
tabIndex: "-1"
}, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("img", {
alt: "Dimensions helper",
onLoad: this.onLoad,
ref: this.imageRef,
src: url,
draggable: "false"
}), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("div", {
className: iconContainerClasses,
style: iconContainerStyle
}, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(_primitives__WEBPACK_IMPORTED_MODULE_12__["SVG"], {
className: "components-focal-point-picker__icon",
xmlns: "http://www.w3.org/2000/svg",
viewBox: "0 0 30 30"
}, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(_primitives__WEBPACK_IMPORTED_MODULE_12__["Path"], {
className: "components-focal-point-picker__icon-outline",
d: "M15 1C7.3 1 1 7.3 1 15s6.3 14 14 14 14-6.3 14-14S22.7 1 15 1zm0 22c-4.4 0-8-3.6-8-8s3.6-8 8-8 8 3.6 8 8-3.6 8-8 8z"
}), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(_primitives__WEBPACK_IMPORTED_MODULE_12__["Path"], {
className: "components-focal-point-picker__icon-fill",
d: "M15 3C8.4 3 3 8.4 3 15s5.4 12 12 12 12-5.4 12-12S21.6 3 15 3zm0 22C9.5 25 5 20.5 5 15S9.5 5 15 5s10 4.5 10 10-4.5 10-10 10z"
}))))), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("div", {
className: "components-focal-point-picker_position-display-container"
}, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(_base_control__WEBPACK_IMPORTED_MODULE_10__["default"], {
label: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_8__["__"])('Horizontal Pos.'),
id: horizontalPositionId
}, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("input", {
className: "components-text-control__input",
id: horizontalPositionId,
max: TEXTCONTROL_MAX,
min: TEXTCONTROL_MIN,
onChange: this.horizontalPositionChanged,
type: "number",
value: this.fractionToPercentage(percentages.x)
}), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("span", null, "%")), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(_base_control__WEBPACK_IMPORTED_MODULE_10__["default"], {
label: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_8__["__"])('Vertical Pos.'),
id: verticalPositionId
}, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("input", {
className: "components-text-control__input",
id: verticalPositionId,
max: TEXTCONTROL_MAX,
min: TEXTCONTROL_MIN,
onChange: this.verticalPositionChanged,
type: "number",
value: this.fractionToPercentage(percentages.y)
}), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("span", null, "%"))));
}
}]);
return FocalPointPicker;
}(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["Component"]);
FocalPointPicker.defaultProps = {
url: null,
value: {
x: 0.5,
y: 0.5
},
onChange: function onChange() {}
};
/* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_9__["compose"])([_wordpress_compose__WEBPACK_IMPORTED_MODULE_9__["withInstanceId"], _higher_order_with_focus_outside__WEBPACK_IMPORTED_MODULE_11__["default"]])(FocalPointPicker));
/***/ }),
/***/ "./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_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_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 */ "./node_modules/@wordpress/element/build-module/index.js");
/* 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 */ "./node_modules/@wordpress/compose/build-module/index.js");
/**
* 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_6__["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_5__["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 _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_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 */ "./node_modules/@wordpress/element/build-module/index.js");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/i18n */ "./node_modules/@wordpress/i18n/build-module/index.js");
/* harmony import */ var _button__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../button */ "./node_modules/@wordpress/components/build-module/button/index.js");
/* harmony import */ var _range_control__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../range-control */ "./node_modules/@wordpress/components/build-module/range-control/index.js");
/* harmony import */ var _select_control__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../select-control */ "./node_modules/@wordpress/components/build-module/select-control/index.js");
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
function getSelectValueFromFontSize(fontSizes, value) {
if (value) {
var fontSizeValue = fontSizes.find(function (font) {
return font.size === value;
});
return fontSizeValue ? fontSizeValue.slug : 'custom';
}
return 'normal';
}
function getSelectOptions(optionsArray) {
return [].concat(Object(_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_1__["default"])(optionsArray.map(function (option) {
return {
value: option.slug,
label: option.name
};
})), [{
value: 'custom',
label: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__["__"])('Custom')
}]);
}
function FontSizePicker(_ref) {
var fallbackFontSize = _ref.fallbackFontSize,
_ref$fontSizes = _ref.fontSizes,
fontSizes = _ref$fontSizes === void 0 ? [] : _ref$fontSizes,
_ref$disableCustomFon = _ref.disableCustomFontSizes,
disableCustomFontSizes = _ref$disableCustomFon === void 0 ? false : _ref$disableCustomFon,
onChange = _ref.onChange,
value = _ref.value,
_ref$withSlider = _ref.withSlider,
withSlider = _ref$withSlider === void 0 ? false : _ref$withSlider;
var _useState = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["useState"])(getSelectValueFromFontSize(fontSizes, value)),
_useState2 = Object(_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_0__["default"])(_useState, 2),
currentSelectValue = _useState2[0],
setCurrentSelectValue = _useState2[1];
if (disableCustomFontSizes && !fontSizes.length) {
return null;
}
var onChangeValue = function onChangeValue(event) {
var newValue = event.target.value;
setCurrentSelectValue(getSelectValueFromFontSize(fontSizes, Number(newValue)));
if (newValue === '') {
onChange(undefined);
return;
}
onChange(Number(newValue));
};
var onSelectChangeValue = function onSelectChangeValue(eventValue) {
setCurrentSelectValue(eventValue);
var selectedFont = fontSizes.find(function (font) {
return font.slug === eventValue;
});
if (selectedFont) {
onChange(selectedFont.size);
}
};
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["createElement"])("fieldset", null, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["createElement"])("legend", null, Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__["__"])('Font Size')), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["createElement"])("div", {
className: "components-font-size-picker__controls"
}, fontSizes.length > 0 && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["createElement"])(_select_control__WEBPACK_IMPORTED_MODULE_6__["default"], {
className: 'components-font-size-picker__select',
label: 'Choose preset',
hideLabelFromVision: true,
value: currentSelectValue,
onChange: onSelectChangeValue,
options: getSelectOptions(fontSizes)
}), !withSlider && !disableCustomFontSizes && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["createElement"])("input", {
className: "components-range-control__number",
type: "number",
onChange: onChangeValue,
"aria-label": Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__["__"])('Custom'),
value: value || ''
}), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["createElement"])(_button__WEBPACK_IMPORTED_MODULE_4__["default"], {
className: "components-color-palette__clear",
type: "button",
disabled: value === undefined,
onClick: function onClick() {
onChange(undefined);
setCurrentSelectValue(getSelectValueFromFontSize(fontSizes, undefined));
},
isSmall: true,
isDefault: true
}, Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__["__"])('Reset'))), withSlider && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["createElement"])(_range_control__WEBPACK_IMPORTED_MODULE_5__["default"], {
className: "components-font-size-picker__custom-input",
label: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__["__"])('Custom Size'),
value: value || '',
initialPosition: fallbackFontSize,
onChange: onChange,
min: 12,
max: 100,
beforeIcon: "editor-textcolor",
afterIcon: "editor-textcolor"
}));
}
/* harmony default export */ __webpack_exports__["default"] = (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_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @babel/runtime/helpers/esm/assertThisInitialized */ "./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.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 _wordpress_element__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @wordpress/element */ "./node_modules/@wordpress/element/build-module/index.js");
/* 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_7__["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_6__["default"])(_this));
_this.bindInput = _this.bindInput.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__["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,
accept = _this$props.accept,
children = _this$props.children,
_this$props$icon = _this$props.icon,
icon = _this$props$icon === void 0 ? 'upload' : _this$props$icon,
_this$props$multiple = _this$props.multiple,
multiple = _this$props$multiple === void 0 ? false : _this$props$multiple,
onChange = _this$props.onChange,
render = _this$props.render,
props = Object(_babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__["default"])(_this$props, ["accept", "children", "icon", "multiple", "onChange", "render"]);
var ui = render ? render({
openFileDialog: this.openFileDialog
}) : 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);
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["createElement"])("div", {
className: "components-form-file-upload"
}, ui, 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 */ "./node_modules/@wordpress/element/build-module/index.js");
/* 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_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @babel/runtime/helpers/esm/assertThisInitialized */ "./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.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 _wordpress_element__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @wordpress/element */ "./node_modules/@wordpress/element/build-module/index.js");
/* 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 */ "./node_modules/@wordpress/i18n/build-module/index.js");
/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @wordpress/compose */ "./node_modules/@wordpress/compose/build-module/index.js");
/* harmony import */ var _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @wordpress/keycodes */ "./node_modules/@wordpress/keycodes/build-module/index.js");
/* harmony import */ var _wordpress_is_shallow_equal__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! @wordpress/is-shallow-equal */ "./node_modules/@wordpress/is-shallow-equal/index.js");
/* harmony import */ var _wordpress_is_shallow_equal__WEBPACK_IMPORTED_MODULE_14___default = /*#__PURE__*/__webpack_require__.n(_wordpress_is_shallow_equal__WEBPACK_IMPORTED_MODULE_14__);
/* harmony import */ var _token__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./token */ "./node_modules/@wordpress/components/build-module/form-token-field/token.js");
/* harmony import */ var _token_input__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./token-input */ "./node_modules/@wordpress/components/build-module/form-token-field/token-input.js");
/* harmony import */ var _suggestions_list__WEBPACK_IMPORTED_MODULE_17__ = __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_18__ = __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_7__["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_6__["default"])(_this));
_this.onKeyPress = _this.onKeyPress.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__["default"])(_this));
_this.onFocus = _this.onFocus.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__["default"])(_this));
_this.onBlur = _this.onBlur.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__["default"])(_this));
_this.deleteTokenBeforeInput = _this.deleteTokenBeforeInput.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__["default"])(_this));
_this.deleteTokenAfterInput = _this.deleteTokenAfterInput.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__["default"])(_this));
_this.addCurrentToken = _this.addCurrentToken.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__["default"])(_this));
_this.onContainerTouched = _this.onContainerTouched.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__["default"])(_this));
_this.renderToken = _this.renderToken.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__["default"])(_this));
_this.onTokenClickRemove = _this.onTokenClickRemove.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__["default"])(_this));
_this.onSuggestionHovered = _this.onSuggestionHovered.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__["default"])(_this));
_this.onSuggestionSelected = _this.onSuggestionSelected.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__["default"])(_this));
_this.onInputChange = _this.onInputChange.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__["default"])(_this));
_this.bindInput = _this.bindInput.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__["default"])(_this));
_this.bindTokensAndInput = _this.bindTokensAndInput.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__["default"])(_this));
_this.updateSuggestions = _this.updateSuggestions.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__["default"])(_this));
return _this;
}
Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_3__["default"])(FormTokenField, [{
key: "componentDidUpdate",
value: function componentDidUpdate(prevProps) {
// Make sure to focus the input when the isActive state is true.
if (this.state.isActive && !this.input.hasFocus()) {
this.input.focus();
}
var _this$props = this.props,
suggestions = _this$props.suggestions,
value = _this$props.value;
var suggestionsDidUpdate = !_wordpress_is_shallow_equal__WEBPACK_IMPORTED_MODULE_14___default()(suggestions, prevProps.suggestions);
if (suggestionsDidUpdate || value !== prevProps.value) {
this.updateSuggestions(suggestionsDidUpdate);
}
}
}, {
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) || '';
if (items.length > 1) {
this.addNewTokens(items.slice(0, -1));
}
this.setState({
incompleteTokenValue: tokenValue
}, this.updateSuggestions);
this.props.onInputChange(tokenValue);
}
}, {
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: "updateSuggestions",
value: function updateSuggestions() {
var resetSelectedSuggestion = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
var incompleteTokenValue = this.state.incompleteTokenValue;
var inputHasMinimumChars = incompleteTokenValue.trim().length > 1;
var matchingSuggestions = this.getMatchingSuggestions(incompleteTokenValue);
var hasMatchingSuggestions = matchingSuggestions.length > 0;
var newState = {
isExpanded: inputHasMinimumChars && hasMatchingSuggestions
};
if (resetSelectedSuggestion) {
newState.selectedSuggestionIndex = -1;
newState.selectedSuggestionScroll = false;
}
this.setState(newState);
if (inputHasMinimumChars) {
var debouncedSpeak = this.props.debouncedSpeak;
var message = hasMatchingSuggestions ? 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) : Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_11__["__"])('No results.');
debouncedSpeak(message, 'assertive');
}
}
}, {
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_15__["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$props2 = this.props,
autoCapitalize = _this$props2.autoCapitalize,
autoComplete = _this$props2.autoComplete,
maxLength = _this$props2.maxLength,
value = _this$props2.value,
instanceId = _this$props2.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 (!(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_16__["default"], props);
}
}, {
key: "render",
value: function render() {
var _this$props3 = this.props,
disabled = _this$props3.disabled,
_this$props3$label = _this$props3.label,
label = _this$props3$label === void 0 ? Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_11__["__"])('Add item') : _this$props3$label,
instanceId = _this$props3.instanceId,
className = _this$props3.className;
var isExpanded = this.state.isExpanded;
var classes = classnames__WEBPACK_IMPORTED_MODULE_10___default()(className, 'components-form-token-field__input-container', {
'is-active': this.state.isActive,
'is-disabled': disabled
});
var tokenFieldProps = {
className: 'components-form-token-field',
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: "components-form-token-field__label"
}, label), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["createElement"])("div", {
ref: this.bindTokensAndInput,
className: classes,
tabIndex: "-1",
onMouseDown: this.onContainerTouched,
onTouchStart: this.onContainerTouched
}, this.renderTokensAndInput(), isExpanded && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["createElement"])(_suggestions_list__WEBPACK_IMPORTED_MODULE_17__["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"])("p", {
id: "components-form-token-suggestions-howto-".concat(instanceId),
className: "components-form-token-field__help"
}, this.props.tokenizeOnSpace ? Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_11__["__"])('Separate with commas, spaces, or the Enter key.') : Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_11__["__"])('Separate with commas or the Enter key.')));
/* 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([]),
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_18__["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_assertThisInitialized__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/esm/assertThisInitialized */ "./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.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 _wordpress_element__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @wordpress/element */ "./node_modules/@wordpress/element/build-module/index.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 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__);
/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @wordpress/compose */ "./node_modules/@wordpress/compose/build-module/index.js");
/**
* External dependencies
*/
/**
* WordPress dependencies
*/
var SuggestionsList =
/*#__PURE__*/
function (_Component) {
Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_5__["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_4__["default"])(_this));
_this.bindList = _this.bindList.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_4__["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
});
this.props.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/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/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"] = (Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_10__["withSafeTimeout"])(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_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @babel/runtime/helpers/esm/assertThisInitialized */ "./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.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 _wordpress_element__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @wordpress/element */ "./node_modules/@wordpress/element/build-module/index.js");
/**
* WordPress dependencies
*/
var TokenInput =
/*#__PURE__*/
function (_Component) {
Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_7__["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_6__["default"])(_this));
_this.bindInput = _this.bindInput.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__["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,
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", "isExpanded", "instanceId", "selectedSuggestionIndex"]);
var size = 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,
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 */ "./node_modules/@wordpress/element/build-module/index.js");
/* 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 */ "./node_modules/@wordpress/compose/build-module/index.js");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/i18n */ "./node_modules/@wordpress/i18n/build-module/index.js");
/* 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_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_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_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_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @babel/runtime/helpers/esm/assertThisInitialized */ "./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.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 _wordpress_element__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @wordpress/element */ "./node_modules/@wordpress/element/build-module/index.js");
/* 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 _wordpress_compose__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @wordpress/compose */ "./node_modules/@wordpress/compose/build-module/index.js");
/* harmony import */ var _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @wordpress/keycodes */ "./node_modules/@wordpress/keycodes/build-module/index.js");
/* harmony import */ var _keyboard_shortcuts__WEBPACK_IMPORTED_MODULE_12__ = __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_10__["createHigherOrderComponent"])(function (WrappedComponent) {
return (
/*#__PURE__*/
function (_Component) {
Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_7__["default"])(_class, _Component);
function _class() {
var _this;
Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_2__["default"])(this, _class);
_this = Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_4__["default"])(this, Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_5__["default"])(_class).apply(this, arguments));
_this.bindContainer = _this.bindContainer.bind(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"])(_this), 1);
_this.focusPreviousRegion = _this.focusRegion.bind(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"])(_this));
_this.state = {
isFocusingRegions: false
};
return _this;
}
Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_3__["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_1__["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 _ref;
var className = classnames__WEBPACK_IMPORTED_MODULE_9___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/click-events-have-key-events */
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["createElement"])("div", {
ref: this.bindContainer,
className: className,
onClick: this.onClick
}, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["createElement"])(_keyboard_shortcuts__WEBPACK_IMPORTED_MODULE_12__["default"], {
bindGlobal: true,
shortcuts: (_ref = {
'ctrl+`': this.focusNextRegion
}, Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__["default"])(_ref, _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_11__["rawShortcut"].access('n'), this.focusNextRegion), Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__["default"])(_ref, 'ctrl+shift+`', this.focusPreviousRegion), Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__["default"])(_ref, _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_11__["rawShortcut"].access('p'), this.focusPreviousRegion), _ref)
}), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["createElement"])(WrappedComponent, this.props));
/* eslint-enable jsx-a11y/no-static-element-interactions, jsx-a11y/click-events-have-key-events */
}
}]);
return _class;
}(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["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_assertThisInitialized__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/esm/assertThisInitialized */ "./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.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 _wordpress_element__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @wordpress/element */ "./node_modules/@wordpress/element/build-module/index.js");
/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @wordpress/compose */ "./node_modules/@wordpress/compose/build-module/index.js");
/* harmony import */ var _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @wordpress/keycodes */ "./node_modules/@wordpress/keycodes/build-module/index.js");
/* harmony import */ var _wordpress_dom__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @wordpress/dom */ "./node_modules/@wordpress/dom/build-module/index.js");
/**
* 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_5__["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_4__["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_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_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 */ "./node_modules/@wordpress/element/build-module/index.js");
/* 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 */ "./node_modules/@wordpress/compose/build-module/index.js");
/**
* 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_6__["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_5__["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 _wordpress_element__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/element */ "./node_modules/@wordpress/element/build-module/index.js");
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! lodash */ "lodash");
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_6__);
/* harmony import */ var _wordpress_hooks__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @wordpress/hooks */ "./node_modules/@wordpress/hooks/build-module/index.js");
/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @wordpress/compose */ "./node_modules/@wordpress/compose/build-module/index.js");
/**
* 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_8__["createHigherOrderComponent"])(function (OriginalComponent) {
var namespace = 'core/with-filters/' + hookName;
/**
* The component definition with current filters applied. Each instance
* reuse this shared reference as an optimization to avoid excessive
* calls to `applyFilters` when many instances exist.
*
* @type {?Component}
*/
var FilteredComponent;
/**
* Initializes the FilteredComponent variable once, if not already
* assigned. Subsequent calls are effectively a noop.
*/
function ensureFilteredComponent() {
if (FilteredComponent === undefined) {
FilteredComponent = Object(_wordpress_hooks__WEBPACK_IMPORTED_MODULE_7__["applyFilters"])(hookName, OriginalComponent);
}
}
var FilteredComponentRenderer =
/*#__PURE__*/
function (_Component) {
Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__["default"])(FilteredComponentRenderer, _Component);
function FilteredComponentRenderer() {
var _this;
Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__["default"])(this, FilteredComponentRenderer);
_this = Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__["default"])(this, Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__["default"])(FilteredComponentRenderer).apply(this, arguments));
ensureFilteredComponent();
return _this;
}
Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__["default"])(FilteredComponentRenderer, [{
key: "componentDidMount",
value: function componentDidMount() {
FilteredComponentRenderer.instances.push(this); // If there were previously no mounted instances for components
// filtered on this hook, add the hook handler.
if (FilteredComponentRenderer.instances.length === 1) {
Object(_wordpress_hooks__WEBPACK_IMPORTED_MODULE_7__["addAction"])('hookRemoved', namespace, onHooksUpdated);
Object(_wordpress_hooks__WEBPACK_IMPORTED_MODULE_7__["addAction"])('hookAdded', namespace, onHooksUpdated);
}
}
}, {
key: "componentWillUnmount",
value: function componentWillUnmount() {
FilteredComponentRenderer.instances = Object(lodash__WEBPACK_IMPORTED_MODULE_6__["without"])(FilteredComponentRenderer.instances, this); // If this was the last of the mounted components filtered on
// this hook, remove the hook handler.
if (FilteredComponentRenderer.instances.length === 0) {
Object(_wordpress_hooks__WEBPACK_IMPORTED_MODULE_7__["removeAction"])('hookRemoved', namespace);
Object(_wordpress_hooks__WEBPACK_IMPORTED_MODULE_7__["removeAction"])('hookAdded', namespace);
}
}
}, {
key: "render",
value: function render() {
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_5__["createElement"])(FilteredComponent, this.props);
}
}]);
return FilteredComponentRenderer;
}(_wordpress_element__WEBPACK_IMPORTED_MODULE_5__["Component"]);
FilteredComponentRenderer.instances = [];
/**
* Updates the FilteredComponent definition, forcing a render for each
* mounted instance. This occurs a maximum of once per animation frame.
*/
var throttledForceUpdate = Object(lodash__WEBPACK_IMPORTED_MODULE_6__["debounce"])(function () {
// Recreate the filtered component, only after delay so that it's
// computed once, even if many filters added.
FilteredComponent = Object(_wordpress_hooks__WEBPACK_IMPORTED_MODULE_7__["applyFilters"])(hookName, OriginalComponent); // Force each instance to render.
FilteredComponentRenderer.instances.forEach(function (instance) {
instance.forceUpdate();
});
}, ANIMATION_FRAME_PERIOD);
/**
* When a filter is added or removed for the matching hook name, each
* mounted instance should re-render with the new filters having been
* applied to the original component.
*
* @param {string} updatedHookName Name of the hook that was updated.
*/
function onHooksUpdated(updatedHookName) {
if (updatedHookName === hookName) {
throttledForceUpdate();
}
}
return FilteredComponentRenderer;
}, '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_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_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 */ "./node_modules/@wordpress/element/build-module/index.js");
/* 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 */ "./node_modules/@wordpress/compose/build-module/index.js");
/**
* 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_6__["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_5__["default"])(_this));
_this.cancelBlurCheck = _this.cancelBlurCheck.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(_this));
_this.queueBlurCheck = _this.queueBlurCheck.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(_this));
_this.normalizeButtonFocus = _this.normalizeButtonFocus.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["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 document is not focused then focus should remain
// inside the wrapped component and therefore we cancel
// this blur event thereby leaving focus in place.
// https://developer.mozilla.org/en-US/docs/Web/API/Document/hasFocus.
if (!document.hasFocus()) {
event.preventDefault();
return;
}
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/context.js":
/*!***************************************************************************************************!*\
!*** ./node_modules/@wordpress/components/build-module/higher-order/with-focus-return/context.js ***!
\***************************************************************************************************/
/*! exports provided: default, Consumer */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Consumer", function() { return Consumer; });
/* 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_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_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 */ "./node_modules/@wordpress/element/build-module/index.js");
/* 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__);
/**
* External dependencies
*/
/**
* WordPress dependencies
*/
var _createContext = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["createContext"])({
focusHistory: []
}),
Provider = _createContext.Provider,
Consumer = _createContext.Consumer;
Provider.displayName = 'FocusReturnProvider';
Consumer.displayName = 'FocusReturnConsumer';
/**
* The maximum history length to capture for the focus stack. When exceeded,
* items should be shifted from the stack for each consecutive push.
*
* @type {number}
*/
var MAX_STACK_LENGTH = 100;
var FocusReturnProvider =
/*#__PURE__*/
function (_Component) {
Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_6__["default"])(FocusReturnProvider, _Component);
function FocusReturnProvider() {
var _this;
Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_1__["default"])(this, FocusReturnProvider);
_this = Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__["default"])(this, Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__["default"])(FocusReturnProvider).apply(this, arguments));
_this.onFocus = _this.onFocus.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(_this));
_this.state = {
focusHistory: []
};
return _this;
}
Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_2__["default"])(FocusReturnProvider, [{
key: "onFocus",
value: function onFocus(event) {
var focusHistory = this.state.focusHistory; // Push the focused element to the history stack, keeping only unique
// members but preferring the _last_ occurrence of any duplicates.
// Lodash's `uniq` behavior favors the first occurrence, so the array
// is temporarily reversed prior to it being called upon. Uniqueness
// helps avoid situations where, such as in a constrained tabbing area,
// the user changes focus enough within a transient element that the
// stack may otherwise only consist of members pending destruction, at
// which point focus might have been lost.
var nextFocusHistory = Object(lodash__WEBPACK_IMPORTED_MODULE_8__["uniq"])([].concat(Object(_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_0__["default"])(focusHistory), [event.target]).slice(-1 * MAX_STACK_LENGTH).reverse()).reverse();
this.setState({
focusHistory: nextFocusHistory
});
}
}, {
key: "render",
value: function render() {
var _this$props = this.props,
children = _this$props.children,
className = _this$props.className;
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["createElement"])(Provider, {
value: this.state
}, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["createElement"])("div", {
onFocus: this.onFocus,
className: className
}, children));
}
}]);
return FocusReturnProvider;
}(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["Component"]);
/* harmony default export */ __webpack_exports__["default"] = (FocusReturnProvider);
/***/ }),
/***/ "./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, Provider */
/***/ (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_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 */ "./node_modules/@wordpress/element/build-module/index.js");
/* 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 */ "./node_modules/@wordpress/compose/build-module/index.js");
/* harmony import */ var _context__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./context */ "./node_modules/@wordpress/components/build-module/higher-order/with-focus-return/context.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Provider", function() { return _context__WEBPACK_IMPORTED_MODULE_10__["default"]; });
/**
* External dependencies
*/
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
/**
* Returns true if the given object is component-like. An object is component-
* like if it is an instance of wp.element.Component, or is a function.
*
* @param {*} object Object to test.
*
* @return {boolean} Whether object is component-like.
*/
function isComponentLike(object) {
return object instanceof _wordpress_element__WEBPACK_IMPORTED_MODULE_7__["Component"] || typeof object === 'function';
}
/**
* 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 {(WPComponent|Object)} options The component to be enhanced with
* focus return behavior, or an object
* describing the component and the
* focus return characteristics.
*
* @return {Component} Component with the focus restauration behaviour.
*/
function withFocusReturn(options) {
// Normalize as overloaded form `withFocusReturn( options )( Component )`
// or as `withFocusReturn( Component )`.
if (isComponentLike(options)) {
var WrappedComponent = options;
return withFocusReturn({})(WrappedComponent);
}
var _options$onFocusRetur = options.onFocusReturn,
onFocusReturn = _options$onFocusRetur === void 0 ? lodash__WEBPACK_IMPORTED_MODULE_8__["stubTrue"] : _options$onFocusRetur;
return function (WrappedComponent) {
var FocusReturn =
/*#__PURE__*/
function (_Component) {
Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_6__["default"])(FocusReturn, _Component);
function FocusReturn() {
var _this;
Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_2__["default"])(this, FocusReturn);
_this = Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_4__["default"])(this, Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_5__["default"])(FocusReturn).apply(this, arguments));
_this.ownFocusedElements = new Set();
_this.activeElementOnMount = document.activeElement;
_this.setIsFocusedFalse = function () {
return _this.isFocused = false;
};
_this.setIsFocusedTrue = function (event) {
_this.ownFocusedElements.add(event.target);
_this.isFocused = true;
};
return _this;
}
Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_3__["default"])(FocusReturn, [{
key: "componentWillUnmount",
value: function componentWillUnmount() {
var activeElementOnMount = this.activeElementOnMount,
isFocused = this.isFocused,
ownFocusedElements = this.ownFocusedElements;
if (!isFocused) {
return;
} // Defer to the component's own explicit focus return behavior,
// if specified. The function should return `false` to prevent
// the default behavior otherwise occurring here. This allows
// for support that the `onFocusReturn` decides to allow the
// default behavior to occur under some conditions.
if (onFocusReturn() === false) {
return;
}
var stack = [].concat(Object(_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_1__["default"])(lodash__WEBPACK_IMPORTED_MODULE_8__["without"].apply(void 0, [this.props.focusHistory].concat(Object(_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_1__["default"])(ownFocusedElements)))), [activeElementOnMount]);
var candidate;
while (candidate = stack.pop()) {
if (document.body.contains(candidate)) {
candidate.focus();
return;
}
}
}
}, {
key: "render",
value: function render() {
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["createElement"])("div", {
onFocus: this.setIsFocusedTrue,
onBlur: this.setIsFocusedFalse
}, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["createElement"])(WrappedComponent, this.props));
}
}]);
return FocusReturn;
}(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["Component"]);
return function (props) {
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["createElement"])(_context__WEBPACK_IMPORTED_MODULE_10__["Consumer"], null, function (context) {
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["createElement"])(FocusReturn, Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, props, context));
});
};
};
}
/* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_9__["createHigherOrderComponent"])(withFocusReturn, '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_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_inherits__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inherits */ "./node_modules/@babel/runtime/helpers/esm/inherits.js");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @wordpress/element */ "./node_modules/@wordpress/element/build-module/index.js");
/* 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 */ "./node_modules/@wordpress/compose/build-module/index.js");
/* 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_8__["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_7__["default"])(_this));
_this.createErrorNotice = _this.createErrorNotice.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(_this));
_this.removeNotice = _this.removeNotice.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(_this));
_this.removeAllNotices = _this.removeAllNotices.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["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: [].concat(Object(_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_1__["default"])(state.noticeList), [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_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_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 */ "./node_modules/@wordpress/element/build-module/index.js");
/* 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 */ "./node_modules/@wordpress/a11y/build-module/index.js");
/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @wordpress/compose */ "./node_modules/@wordpress/compose/build-module/index.js");
/**
* 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_6__["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_5__["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 _wordpress_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/element */ "./node_modules/@wordpress/element/build-module/index.js");
/* 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 _tooltip__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../tooltip */ "./node_modules/@wordpress/components/build-module/tooltip/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 _dashicon__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../dashicon */ "./node_modules/@wordpress/components/build-module/dashicon/index.js");
/**
* External dependencies
*/
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
function IconButton(props, ref) {
var icon = props.icon,
children = props.children,
label = props.label,
className = props.className,
tooltip = props.tooltip,
shortcut = props.shortcut,
labelPosition = props.labelPosition,
additionalProps = Object(_babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__["default"])(props, ["icon", "children", "label", "className", "tooltip", "shortcut", "labelPosition"]);
var ariaPressed = additionalProps['aria-pressed'];
var classes = classnames__WEBPACK_IMPORTED_MODULE_3___default()('components-icon-button', className, {
'has-text': children
});
var tooltipText = tooltip || label; // Should show the tooltip if...
var showTooltip = !additionalProps.disabled && ( // 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_4__["isArray"])(children) && !children.length) && // the tooltip is not explicitly disabled.
false !== tooltip);
var element = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["createElement"])(_button__WEBPACK_IMPORTED_MODULE_6__["default"], Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({
"aria-label": label
}, additionalProps, {
className: classes,
ref: ref
}), Object(lodash__WEBPACK_IMPORTED_MODULE_4__["isString"])(icon) ? Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["createElement"])(_dashicon__WEBPACK_IMPORTED_MODULE_7__["default"], {
icon: icon,
ariaPressed: ariaPressed
}) : icon, children);
if (showTooltip) {
element = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["createElement"])(_tooltip__WEBPACK_IMPORTED_MODULE_5__["default"], {
text: tooltipText,
shortcut: shortcut,
position: labelPosition
}, element);
}
return element;
}
/* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["forwardRef"])(IconButton));
/***/ }),
/***/ "./node_modules/@wordpress/components/build-module/icon/index.js":
/*!***********************************************************************!*\
!*** ./node_modules/@wordpress/components/build-module/icon/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_extends__WEBPACK_IMPORTED_MODULE_1__ = __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_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 */ "./node_modules/@wordpress/element/build-module/index.js");
/* harmony import */ var ___WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../ */ "./node_modules/@wordpress/components/build-module/index.js");
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
function Icon(_ref) {
var _ref$icon = _ref.icon,
icon = _ref$icon === void 0 ? null : _ref$icon,
size = _ref.size,
additionalProps = Object(_babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_2__["default"])(_ref, ["icon", "size"]);
var iconSize;
if ('string' === typeof icon) {
// Dashicons should be 20x20 by default
iconSize = size || 20;
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__["createElement"])(___WEBPACK_IMPORTED_MODULE_4__["Dashicon"], Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_1__["default"])({
icon: icon,
size: iconSize
}, additionalProps));
} // Any other icons should be 24x24 by default
iconSize = size || 24;
if ('function' === typeof icon) {
if (icon.prototype instanceof _wordpress_element__WEBPACK_IMPORTED_MODULE_3__["Component"]) {
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__["createElement"])(icon, Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_0__["default"])({
size: iconSize
}, additionalProps));
}
return icon(Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_0__["default"])({
size: iconSize
}, additionalProps));
}
if (icon && (icon.type === 'svg' || icon.type === ___WEBPACK_IMPORTED_MODULE_4__["SVG"])) {
var appliedProps = Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_0__["default"])({
width: iconSize,
height: iconSize
}, icon.props, additionalProps);
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__["createElement"])(___WEBPACK_IMPORTED_MODULE_4__["SVG"], appliedProps);
}
if (Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__["isValidElement"])(icon)) {
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__["cloneElement"])(icon, Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_0__["default"])({
size: iconSize
}, additionalProps));
}
return icon;
}
/* harmony default export */ __webpack_exports__["default"] = (Icon);
/***/ }),
/***/ "./node_modules/@wordpress/components/build-module/index.js":
/*!******************************************************************!*\
!*** ./node_modules/@wordpress/components/build-module/index.js ***!
\******************************************************************/
/*! exports provided: Animate, Autocomplete, BaseControl, Button, ButtonGroup, CheckboxControl, ClipboardButton, ColorIndicator, ColorPalette, ColorPicker, Dashicon, DateTimePicker, DatePicker, TimePicker, Disabled, Draggable, DropZone, DropZoneProvider, Dropdown, DropdownMenu, ExternalLink, FocalPointPicker, FocusableIframe, FontSizePicker, FormFileUpload, FormToggle, FormTokenField, Icon, IconButton, KeyboardShortcuts, MenuGroup, MenuItem, MenuItemsChoice, Modal, ScrollLock, NavigableMenu, TabbableContainer, Notice, NoticeList, Panel, PanelBody, PanelHeader, PanelRow, Placeholder, Popover, QueryControls, RadioControl, RangeControl, ResizableBox, ResponsiveWrapper, SandBox, SelectControl, Snackbar, SnackbarList, Spinner, TabPanel, TextControl, TextareaControl, Tip, ToggleControl, Toolbar, ToolbarButton, Tooltip, TreeSelect, IsolatedEventContainer, createSlotFill, Slot, Fill, SlotFillProvider, navigateRegions, withConstrainedTabbing, withFallbackStyles, withFilters, withFocusOutside, withFocusReturn, FocusReturnProvider, withNotices, withSpokenMessages, Circle, G, Path, Polygon, Rect, SVG, HorizontalRule, BlockQuotation */
/***/ (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__, "Circle", function() { return _primitives__WEBPACK_IMPORTED_MODULE_0__["Circle"]; });
/* 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__, "Rect", function() { return _primitives__WEBPACK_IMPORTED_MODULE_0__["Rect"]; });
/* 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__, "HorizontalRule", function() { return _primitives__WEBPACK_IMPORTED_MODULE_0__["HorizontalRule"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "BlockQuotation", function() { return _primitives__WEBPACK_IMPORTED_MODULE_0__["BlockQuotation"]; });
/* harmony import */ var _animate__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./animate */ "./node_modules/@wordpress/components/build-module/animate/index.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Animate", function() { return _animate__WEBPACK_IMPORTED_MODULE_1__["default"]; });
/* harmony import */ var _autocomplete__WEBPACK_IMPORTED_MODULE_2__ = __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_2__["default"]; });
/* harmony import */ var _base_control__WEBPACK_IMPORTED_MODULE_3__ = __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_3__["default"]; });
/* harmony import */ var _button__WEBPACK_IMPORTED_MODULE_4__ = __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_4__["default"]; });
/* harmony import */ var _button_group__WEBPACK_IMPORTED_MODULE_5__ = __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_5__["default"]; });
/* harmony import */ var _checkbox_control__WEBPACK_IMPORTED_MODULE_6__ = __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_6__["default"]; });
/* harmony import */ var _clipboard_button__WEBPACK_IMPORTED_MODULE_7__ = __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_7__["default"]; });
/* harmony import */ var _color_indicator__WEBPACK_IMPORTED_MODULE_8__ = __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_8__["default"]; });
/* harmony import */ var _color_palette__WEBPACK_IMPORTED_MODULE_9__ = __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_9__["default"]; });
/* harmony import */ var _color_picker__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./color-picker */ "./node_modules/@wordpress/components/build-module/color-picker/index.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ColorPicker", function() { return _color_picker__WEBPACK_IMPORTED_MODULE_10__["default"]; });
/* harmony import */ var _dashicon__WEBPACK_IMPORTED_MODULE_11__ = __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_11__["default"]; });
/* harmony import */ var _date_time__WEBPACK_IMPORTED_MODULE_12__ = __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_12__["DateTimePicker"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "DatePicker", function() { return _date_time__WEBPACK_IMPORTED_MODULE_12__["DatePicker"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TimePicker", function() { return _date_time__WEBPACK_IMPORTED_MODULE_12__["TimePicker"]; });
/* harmony import */ var _disabled__WEBPACK_IMPORTED_MODULE_13__ = __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_13__["default"]; });
/* harmony import */ var _draggable__WEBPACK_IMPORTED_MODULE_14__ = __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_14__["default"]; });
/* harmony import */ var _drop_zone__WEBPACK_IMPORTED_MODULE_15__ = __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_15__["default"]; });
/* harmony import */ var _drop_zone_provider__WEBPACK_IMPORTED_MODULE_16__ = __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_16__["default"]; });
/* harmony import */ var _dropdown__WEBPACK_IMPORTED_MODULE_17__ = __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_17__["default"]; });
/* harmony import */ var _dropdown_menu__WEBPACK_IMPORTED_MODULE_18__ = __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_18__["default"]; });
/* harmony import */ var _external_link__WEBPACK_IMPORTED_MODULE_19__ = __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_19__["default"]; });
/* harmony import */ var _focal_point_picker__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./focal-point-picker */ "./node_modules/@wordpress/components/build-module/focal-point-picker/index.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "FocalPointPicker", function() { return _focal_point_picker__WEBPACK_IMPORTED_MODULE_20__["default"]; });
/* harmony import */ var _focusable_iframe__WEBPACK_IMPORTED_MODULE_21__ = __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_21__["default"]; });
/* harmony import */ var _font_size_picker__WEBPACK_IMPORTED_MODULE_22__ = __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_22__["default"]; });
/* harmony import */ var _form_file_upload__WEBPACK_IMPORTED_MODULE_23__ = __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_23__["default"]; });
/* harmony import */ var _form_toggle__WEBPACK_IMPORTED_MODULE_24__ = __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_24__["default"]; });
/* harmony import */ var _form_token_field__WEBPACK_IMPORTED_MODULE_25__ = __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_25__["default"]; });
/* harmony import */ var _icon__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ./icon */ "./node_modules/@wordpress/components/build-module/icon/index.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Icon", function() { return _icon__WEBPACK_IMPORTED_MODULE_26__["default"]; });
/* harmony import */ var _icon_button__WEBPACK_IMPORTED_MODULE_27__ = __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_27__["default"]; });
/* harmony import */ var _keyboard_shortcuts__WEBPACK_IMPORTED_MODULE_28__ = __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_28__["default"]; });
/* harmony import */ var _menu_group__WEBPACK_IMPORTED_MODULE_29__ = __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_29__["default"]; });
/* harmony import */ var _menu_item__WEBPACK_IMPORTED_MODULE_30__ = __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_30__["default"]; });
/* harmony import */ var _menu_items_choice__WEBPACK_IMPORTED_MODULE_31__ = __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_31__["default"]; });
/* harmony import */ var _modal__WEBPACK_IMPORTED_MODULE_32__ = __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_32__["default"]; });
/* harmony import */ var _scroll_lock__WEBPACK_IMPORTED_MODULE_33__ = __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_33__["default"]; });
/* harmony import */ var _navigable_container__WEBPACK_IMPORTED_MODULE_34__ = __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_34__["NavigableMenu"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TabbableContainer", function() { return _navigable_container__WEBPACK_IMPORTED_MODULE_34__["TabbableContainer"]; });
/* harmony import */ var _notice__WEBPACK_IMPORTED_MODULE_35__ = __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_35__["default"]; });
/* harmony import */ var _notice_list__WEBPACK_IMPORTED_MODULE_36__ = __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_36__["default"]; });
/* harmony import */ var _panel__WEBPACK_IMPORTED_MODULE_37__ = __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_37__["default"]; });
/* harmony import */ var _panel_body__WEBPACK_IMPORTED_MODULE_38__ = __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_38__["default"]; });
/* harmony import */ var _panel_header__WEBPACK_IMPORTED_MODULE_39__ = __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_39__["default"]; });
/* harmony import */ var _panel_row__WEBPACK_IMPORTED_MODULE_40__ = __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_40__["default"]; });
/* harmony import */ var _placeholder__WEBPACK_IMPORTED_MODULE_41__ = __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_41__["default"]; });
/* harmony import */ var _popover__WEBPACK_IMPORTED_MODULE_42__ = __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_42__["default"]; });
/* harmony import */ var _query_controls__WEBPACK_IMPORTED_MODULE_43__ = __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_43__["default"]; });
/* harmony import */ var _radio_control__WEBPACK_IMPORTED_MODULE_44__ = __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_44__["default"]; });
/* harmony import */ var _range_control__WEBPACK_IMPORTED_MODULE_45__ = __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_45__["default"]; });
/* harmony import */ var _resizable_box__WEBPACK_IMPORTED_MODULE_46__ = __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_46__["default"]; });
/* harmony import */ var _responsive_wrapper__WEBPACK_IMPORTED_MODULE_47__ = __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_47__["default"]; });
/* harmony import */ var _sandbox__WEBPACK_IMPORTED_MODULE_48__ = __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_48__["default"]; });
/* harmony import */ var _select_control__WEBPACK_IMPORTED_MODULE_49__ = __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_49__["default"]; });
/* harmony import */ var _snackbar__WEBPACK_IMPORTED_MODULE_50__ = __webpack_require__(/*! ./snackbar */ "./node_modules/@wordpress/components/build-module/snackbar/index.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Snackbar", function() { return _snackbar__WEBPACK_IMPORTED_MODULE_50__["default"]; });
/* harmony import */ var _snackbar_list__WEBPACK_IMPORTED_MODULE_51__ = __webpack_require__(/*! ./snackbar/list */ "./node_modules/@wordpress/components/build-module/snackbar/list.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "SnackbarList", function() { return _snackbar_list__WEBPACK_IMPORTED_MODULE_51__["default"]; });
/* harmony import */ var _spinner__WEBPACK_IMPORTED_MODULE_52__ = __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_52__["default"]; });
/* harmony import */ var _tab_panel__WEBPACK_IMPORTED_MODULE_53__ = __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_53__["default"]; });
/* harmony import */ var _text_control__WEBPACK_IMPORTED_MODULE_54__ = __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_54__["default"]; });
/* harmony import */ var _textarea_control__WEBPACK_IMPORTED_MODULE_55__ = __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_55__["default"]; });
/* harmony import */ var _tip__WEBPACK_IMPORTED_MODULE_56__ = __webpack_require__(/*! ./tip */ "./node_modules/@wordpress/components/build-module/tip/index.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Tip", function() { return _tip__WEBPACK_IMPORTED_MODULE_56__["default"]; });
/* harmony import */ var _toggle_control__WEBPACK_IMPORTED_MODULE_57__ = __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_57__["default"]; });
/* harmony import */ var _toolbar__WEBPACK_IMPORTED_MODULE_58__ = __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_58__["default"]; });
/* harmony import */ var _toolbar_button__WEBPACK_IMPORTED_MODULE_59__ = __webpack_require__(/*! ./toolbar-button */ "./node_modules/@wordpress/components/build-module/toolbar-button/index.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ToolbarButton", function() { return _toolbar_button__WEBPACK_IMPORTED_MODULE_59__["default"]; });
/* harmony import */ var _tooltip__WEBPACK_IMPORTED_MODULE_60__ = __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_60__["default"]; });
/* harmony import */ var _tree_select__WEBPACK_IMPORTED_MODULE_61__ = __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_61__["default"]; });
/* harmony import */ var _isolated_event_container__WEBPACK_IMPORTED_MODULE_62__ = __webpack_require__(/*! ./isolated-event-container */ "./node_modules/@wordpress/components/build-module/isolated-event-container/index.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "IsolatedEventContainer", function() { return _isolated_event_container__WEBPACK_IMPORTED_MODULE_62__["default"]; });
/* harmony import */ var _slot_fill__WEBPACK_IMPORTED_MODULE_63__ = __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_63__["createSlotFill"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Slot", function() { return _slot_fill__WEBPACK_IMPORTED_MODULE_63__["Slot"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Fill", function() { return _slot_fill__WEBPACK_IMPORTED_MODULE_63__["Fill"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "SlotFillProvider", function() { return _slot_fill__WEBPACK_IMPORTED_MODULE_63__["Provider"]; });
/* harmony import */ var _higher_order_navigate_regions__WEBPACK_IMPORTED_MODULE_64__ = __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_64__["default"]; });
/* harmony import */ var _higher_order_with_constrained_tabbing__WEBPACK_IMPORTED_MODULE_65__ = __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_65__["default"]; });
/* harmony import */ var _higher_order_with_fallback_styles__WEBPACK_IMPORTED_MODULE_66__ = __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_66__["default"]; });
/* harmony import */ var _higher_order_with_filters__WEBPACK_IMPORTED_MODULE_67__ = __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_67__["default"]; });
/* harmony import */ var _higher_order_with_focus_outside__WEBPACK_IMPORTED_MODULE_68__ = __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_68__["default"]; });
/* harmony import */ var _higher_order_with_focus_return__WEBPACK_IMPORTED_MODULE_69__ = __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_69__["default"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "FocusReturnProvider", function() { return _higher_order_with_focus_return__WEBPACK_IMPORTED_MODULE_69__["Provider"]; });
/* harmony import */ var _higher_order_with_notices__WEBPACK_IMPORTED_MODULE_70__ = __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_70__["default"]; });
/* harmony import */ var _higher_order_with_spoken_messages__WEBPACK_IMPORTED_MODULE_71__ = __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_71__["default"]; });
// Components
// Higher-Order Components
/***/ }),
/***/ "./node_modules/@wordpress/components/build-module/isolated-event-container/index.js":
/*!*******************************************************************************************!*\
!*** ./node_modules/@wordpress/components/build-module/isolated-event-container/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_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @babel/runtime/helpers/esm/assertThisInitialized */ "./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.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 _wordpress_element__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @wordpress/element */ "./node_modules/@wordpress/element/build-module/index.js");
/**
* WordPress dependencies
*/
var IsolatedEventContainer =
/*#__PURE__*/
function (_Component) {
Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_7__["default"])(IsolatedEventContainer, _Component);
function IsolatedEventContainer(props) {
var _this;
Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_2__["default"])(this, IsolatedEventContainer);
_this = Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_4__["default"])(this, Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_5__["default"])(IsolatedEventContainer).call(this, props));
_this.stopEventPropagationOutsideContainer = _this.stopEventPropagationOutsideContainer.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__["default"])(_this));
return _this;
}
Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_3__["default"])(IsolatedEventContainer, [{
key: "stopEventPropagationOutsideContainer",
value: function stopEventPropagationOutsideContainer(event) {
event.stopPropagation();
}
}, {
key: "render",
value: function render() {
var _this$props = this.props,
children = _this$props.children,
props = Object(_babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__["default"])(_this$props, ["children"]); // Disable reason: this stops certain events from propagating outside of the component.
// - onMouseDown is disabled as this can cause interactions with other DOM elements
/* 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"])({}, props, {
onMouseDown: this.stopEventPropagationOutsideContainer
}), children);
/* eslint-enable jsx-a11y/no-static-element-interactions */
}
}]);
return IsolatedEventContainer;
}(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["Component"]);
/* harmony default export */ __webpack_exports__["default"] = (IsolatedEventContainer);
/***/ }),
/***/ "./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_assertThisInitialized__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/esm/assertThisInitialized */ "./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.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 _wordpress_element__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @wordpress/element */ "./node_modules/@wordpress/element/build-module/index.js");
/* 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__);
/* harmony import */ var _platform__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./platform */ "./node_modules/@wordpress/components/build-module/keyboard-shortcuts/platform.js");
/**
* External dependencies
*/
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
var KeyboardShortcuts =
/*#__PURE__*/
function (_Component) {
Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_5__["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_4__["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) {
if (true) {
var keys = key.split('+');
var modifiers = new Set(keys.filter(function (value) {
return value.length > 1;
}));
var hasAlt = modifiers.has('alt');
var hasShift = modifiers.has('shift');
if (Object(_platform__WEBPACK_IMPORTED_MODULE_10__["isAppleOS"])() && (modifiers.size === 1 && hasAlt || modifiers.size === 2 && hasAlt && hasShift)) {
throw new Error("Cannot bind ".concat(key, ". Alt and Shift+Alt modifiers are reserved for character input."));
}
}
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/keyboard-shortcuts/platform.js":
/*!****************************************************************************************!*\
!*** ./node_modules/@wordpress/components/build-module/keyboard-shortcuts/platform.js ***!
\****************************************************************************************/
/*! exports provided: isAppleOS */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isAppleOS", function() { return isAppleOS; });
/* 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
*/
/**
* Return true if platform is MacOS.
*
* @param {Object} _window window object by default; used for DI testing.
*
* @return {boolean} True if MacOS; false otherwise.
*/
function isAppleOS() {
var _window = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : window;
var platform = _window.navigator.platform;
return platform.indexOf('Mac') !== -1 || Object(lodash__WEBPACK_IMPORTED_MODULE_0__["includes"])(['iPad', 'iPhone'], platform);
}
/***/ }),
/***/ "./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 */ "./node_modules/@wordpress/element/build-module/index.js");
/* 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 */ "./node_modules/@wordpress/compose/build-module/index.js");
/**
* External dependencies
*/
/**
* WordPress 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,
"aria-hidden": "true"
}, label), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("div", {
role: "group",
"aria-labelledby": label ? labelId : null
}, 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: MenuItem, default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MenuItem", function() { return MenuItem; });
/* 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 */ "./node_modules/@wordpress/element/build-module/index.js");
/* 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 _shortcut__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../shortcut */ "./node_modules/@wordpress/components/build-module/shortcut/index.js");
/* harmony import */ var _icon_button__WEBPACK_IMPORTED_MODULE_6__ = __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,
info = _ref.info,
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", "info", "className", "icon", "shortcut", "isSelected", "role"]);
className = classnames__WEBPACK_IMPORTED_MODULE_3___default()('components-menu-item__button', className, {
'has-icon': icon
});
if (info) {
children = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["createElement"])("span", {
className: "components-menu-item__info-wrapper"
}, children, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["createElement"])("span", {
className: "components-menu-item__info"
}, info));
}
if (icon && !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_6__["default"], Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({
icon: icon // Make sure aria-checked matches spec https://www.w3.org/TR/wai-aria-1.1/#aria-checked
,
"aria-checked": role === 'menuitemcheckbox' || role === 'menuitemradio' ? isSelected : undefined,
role: role,
className: className
}, props), children, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["createElement"])(_shortcut__WEBPACK_IMPORTED_MODULE_5__["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 */ "./node_modules/@wordpress/element/build-module/index.js");
/* 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_assertThisInitialized__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/esm/assertThisInitialized */ "./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.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 _wordpress_element__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @wordpress/element */ "./node_modules/@wordpress/element/build-module/index.js");
/* harmony import */ var _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @wordpress/keycodes */ "./node_modules/@wordpress/keycodes/build-module/index.js");
/* harmony import */ var _wordpress_dom__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @wordpress/dom */ "./node_modules/@wordpress/dom/build-module/index.js");
/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @wordpress/compose */ "./node_modules/@wordpress/compose/build-module/index.js");
/* harmony import */ var _higher_order_with_focus_outside__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../higher-order/with-focus-outside */ "./node_modules/@wordpress/components/build-module/higher-order/with-focus-outside/index.js");
/* 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
*/
/**
* Internal dependencies
*/
var ModalFrame =
/*#__PURE__*/
function (_Component) {
Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_5__["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_4__["default"])(_this));
_this.handleFocusOutside = _this.handleFocusOutside.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_4__["default"])(_this));
_this.focusFirstTabbable = _this.focusFirstTabbable.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_4__["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: "handleFocusOutside",
value: function handleFocusOutside(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"], _higher_order_with_focus_outside__WEBPACK_IMPORTED_MODULE_10__["default"], 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 */ "./node_modules/@wordpress/element/build-module/index.js");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "./node_modules/@wordpress/i18n/build-module/index.js");
/* 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 _wordpress_element__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @wordpress/element */ "./node_modules/@wordpress/element/build-module/index.js");
/* 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 */ "./node_modules/@wordpress/compose/build-module/index.js");
/* harmony import */ var _frame__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./frame */ "./node_modules/@wordpress/components/build-module/modal/frame.js");
/* harmony import */ var _header__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./header */ "./node_modules/@wordpress/components/build-module/modal/header.js");
/* harmony import */ var _aria_helper__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./aria-helper */ "./node_modules/@wordpress/components/build-module/modal/aria-helper.js");
/* harmony import */ var _isolated_event_container__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../isolated-event-container */ "./node_modules/@wordpress/components/build-module/isolated-event-container/index.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();
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_12__["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_12__["showApp"]();
}
/**
* 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.
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["createPortal"])(Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["createElement"])(_isolated_event_container__WEBPACK_IMPORTED_MODULE_13__["default"], {
className: classnames__WEBPACK_IMPORTED_MODULE_8___default()('components-modal__screen-overlay', overlayClassName)
}, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["createElement"])(_frame__WEBPACK_IMPORTED_MODULE_10__["default"], Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({
className: classnames__WEBPACK_IMPORTED_MODULE_8___default()('components-modal__frame', className),
onRequestClose: onRequestClose,
aria: {
labelledby: title ? headingId : null,
describedby: aria.describedby
}
}, otherProps), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["createElement"])("div", {
className: 'components-modal__content',
tabIndex: "0"
}, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["createElement"])(_header__WEBPACK_IMPORTED_MODULE_11__["default"], {
closeLabel: closeButtonLabel,
headingId: headingId,
icon: icon,
isDismissable: isDismissable,
onClose: onRequestClose,
title: title
}), children))), this.node);
}
}]);
return Modal;
}(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["Component"]);
Modal.defaultProps = {
bodyOpenClassName: 'modal-open',
role: 'dialog',
title: null,
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_9__["withInstanceId"])(Modal));
/***/ }),
/***/ "./node_modules/@wordpress/components/build-module/navigable-container/container.js":
/*!******************************************************************************************!*\
!*** ./node_modules/@wordpress/components/build-module/navigable-container/container.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_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @babel/runtime/helpers/esm/assertThisInitialized */ "./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.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 _wordpress_element__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @wordpress/element */ "./node_modules/@wordpress/element/build-module/index.js");
/* 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 */ "./node_modules/@wordpress/dom/build-module/index.js");
/**
* 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_7__["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.onKeyDown = _this.onKeyDown.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__["default"])(_this));
_this.bindContainer = _this.bindContainer.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__["default"])(_this));
_this.getFocusableContext = _this.getFocusableContext.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__["default"])(_this));
_this.getFocusableIndex = _this.getFocusableIndex.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__["default"])(_this));
return _this;
}
Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_3__["default"])(NavigableContainer, [{
key: "componentDidMount",
value: function componentDidMount() {
// We use DOM event listeners instead of React event listeners
// because we want to catch events from the underlying DOM tree
// The React Tree can be different from the DOM tree when using
// portals. Block Toolbars for instance are rendered in a separate
// React Trees.
this.container.addEventListener('keydown', this.onKeyDown);
this.container.addEventListener('focus', this.onFocus);
}
}, {
key: "componentWillUnmount",
value: function componentWillUnmount() {
this.container.removeEventListener('keydown', this.onKeyDown);
this.container.removeEventListener('focus', this.onFocus);
}
}, {
key: "bindContainer",
value: function bindContainer(ref) {
var forwardedRef = this.props.forwardedRef;
this.container = ref;
if (Object(lodash__WEBPACK_IMPORTED_MODULE_9__["isFunction"])(forwardedRef)) {
forwardedRef(ref);
} else if (forwardedRef && 'current' in forwardedRef) {
forwardedRef.current = 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.stopImmediatePropagation(); // When navigating a collection of items, prevent scroll containers
// from scrolling.
if (event.target.getAttribute('role') === 'menuitem') {
event.preventDefault();
}
}
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"]);
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', 'forwardedRef'])), children);
}
}]);
return NavigableContainer;
}(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["Component"]);
var forwardedNavigableContainer = function forwardedNavigableContainer(props, ref) {
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["createElement"])(NavigableContainer, Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, props, {
forwardedRef: ref
}));
};
forwardedNavigableContainer.displayName = 'NavigableContainer';
/* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["forwardRef"])(forwardedNavigableContainer));
/***/ }),
/***/ "./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 import */ var _menu__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./menu */ "./node_modules/@wordpress/components/build-module/navigable-container/menu.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "NavigableMenu", function() { return _menu__WEBPACK_IMPORTED_MODULE_0__["default"]; });
/* harmony import */ var _tabbable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./tabbable */ "./node_modules/@wordpress/components/build-module/navigable-container/tabbable.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TabbableContainer", function() { return _tabbable__WEBPACK_IMPORTED_MODULE_1__["default"]; });
/**
* Internal Dependencies
*/
/***/ }),
/***/ "./node_modules/@wordpress/components/build-module/navigable-container/menu.js":
/*!*************************************************************************************!*\
!*** ./node_modules/@wordpress/components/build-module/navigable-container/menu.js ***!
\*************************************************************************************/
/*! exports provided: NavigableMenu, default */
/***/ (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 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 */ "./node_modules/@wordpress/element/build-module/index.js");
/* 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_keycodes__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/keycodes */ "./node_modules/@wordpress/keycodes/build-module/index.js");
/* harmony import */ var _container__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./container */ "./node_modules/@wordpress/components/build-module/navigable-container/container.js");
/**
* External dependencies
*/
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
function NavigableMenu(_ref, ref) {
var _ref$role = _ref.role,
role = _ref$role === void 0 ? 'menu' : _ref$role,
_ref$orientation = _ref.orientation,
orientation = _ref$orientation === void 0 ? 'vertical' : _ref$orientation,
rest = Object(_babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__["default"])(_ref, ["role", "orientation"]);
var eventToOffset = function eventToOffset(evt) {
var keyCode = evt.keyCode;
var next = [_wordpress_keycodes__WEBPACK_IMPORTED_MODULE_4__["DOWN"]];
var previous = [_wordpress_keycodes__WEBPACK_IMPORTED_MODULE_4__["UP"]];
if (orientation === 'horizontal') {
next = [_wordpress_keycodes__WEBPACK_IMPORTED_MODULE_4__["RIGHT"]];
previous = [_wordpress_keycodes__WEBPACK_IMPORTED_MODULE_4__["LEFT"]];
}
if (orientation === 'both') {
next = [_wordpress_keycodes__WEBPACK_IMPORTED_MODULE_4__["RIGHT"], _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_4__["DOWN"]];
previous = [_wordpress_keycodes__WEBPACK_IMPORTED_MODULE_4__["LEFT"], _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_4__["UP"]];
}
if (Object(lodash__WEBPACK_IMPORTED_MODULE_3__["includes"])(next, keyCode)) {
return 1;
} else if (Object(lodash__WEBPACK_IMPORTED_MODULE_3__["includes"])(previous, keyCode)) {
return -1;
}
};
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["createElement"])(_container__WEBPACK_IMPORTED_MODULE_5__["default"], Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({
ref: ref,
stopNavigationEvents: true,
onlyBrowserTabstops: false,
role: role,
"aria-orientation": role === 'presentation' ? null : orientation,
eventToOffset: eventToOffset
}, rest));
}
/* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["forwardRef"])(NavigableMenu));
/***/ }),
/***/ "./node_modules/@wordpress/components/build-module/navigable-container/tabbable.js":
/*!*****************************************************************************************!*\
!*** ./node_modules/@wordpress/components/build-module/navigable-container/tabbable.js ***!
\*****************************************************************************************/
/*! exports provided: TabbableContainer, default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* 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 _wordpress_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/element */ "./node_modules/@wordpress/element/build-module/index.js");
/* harmony import */ var _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/keycodes */ "./node_modules/@wordpress/keycodes/build-module/index.js");
/* harmony import */ var _container__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./container */ "./node_modules/@wordpress/components/build-module/navigable-container/container.js");
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
function TabbableContainer(_ref, ref) {
var eventToOffset = _ref.eventToOffset,
props = Object(_babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__["default"])(_ref, ["eventToOffset"]);
var innerEventToOffset = function innerEventToOffset(evt) {
var keyCode = evt.keyCode,
shiftKey = evt.shiftKey;
if (_wordpress_keycodes__WEBPACK_IMPORTED_MODULE_3__["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 `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 (eventToOffset) {
return eventToOffset(evt);
}
};
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["createElement"])(_container__WEBPACK_IMPORTED_MODULE_4__["default"], Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({
ref: ref,
stopNavigationEvents: true,
onlyBrowserTabstops: true,
eventToOffset: innerEventToOffset
}, props));
}
/* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["forwardRef"])(TabbableContainer));
/***/ }),
/***/ "./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 _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "./node_modules/@wordpress/element/build-module/index.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__);
/* 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_i18n__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/i18n */ "./node_modules/@wordpress/i18n/build-module/index.js");
/* harmony import */ var ___WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../ */ "./node_modules/@wordpress/components/build-module/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_1__["noop"] : _ref$onRemove,
_ref$isDismissible = _ref.isDismissible,
isDismissible = _ref$isDismissible === void 0 ? true : _ref$isDismissible,
_ref$actions = _ref.actions,
actions = _ref$actions === void 0 ? [] : _ref$actions,
__unstableHTML = _ref.__unstableHTML;
var classes = classnames__WEBPACK_IMPORTED_MODULE_2___default()(className, 'components-notice', 'is-' + status, {
'is-dismissible': isDismissible
});
if (__unstableHTML) {
children = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["RawHTML"], null, children);
}
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("div", {
className: classes
}, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("div", {
className: "components-notice__content"
}, children, actions.map(function (_ref2, index) {
var buttonCustomClasses = _ref2.className,
label = _ref2.label,
_ref2$noDefaultClasse = _ref2.noDefaultClasses,
noDefaultClasses = _ref2$noDefaultClasse === void 0 ? false : _ref2$noDefaultClasse,
onClick = _ref2.onClick,
url = _ref2.url;
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(___WEBPACK_IMPORTED_MODULE_4__["Button"], {
key: index,
href: url,
isDefault: !noDefaultClasses && !url,
isLink: !noDefaultClasses && !!url,
onClick: url ? undefined : onClick,
className: classnames__WEBPACK_IMPORTED_MODULE_2___default()('components-notice__action', buttonCustomClasses)
}, label);
})), isDismissible && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(___WEBPACK_IMPORTED_MODULE_4__["IconButton"], {
className: "components-notice__dismiss",
icon: "no-alt",
label: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__["__"])('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 */ "./node_modules/@wordpress/element/build-module/index.js");
/* 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 ___WEBPACK_IMPORTED_MODULE_5__ = __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_4__["noop"] : _ref$onRemove,
className = _ref.className,
children = _ref.children;
var removeNotice = function removeNotice(id) {
return function () {
return onRemove(id);
};
};
className = classnames__WEBPACK_IMPORTED_MODULE_3___default()('components-notice-list', className);
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_5__["default"], Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, Object(lodash__WEBPACK_IMPORTED_MODULE_4__["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: PanelBody, default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PanelBody", function() { return PanelBody; });
/* 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_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_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 */ "./node_modules/@wordpress/element/build-module/index.js");
/* 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 _button__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../button */ "./node_modules/@wordpress/components/build-module/button/index.js");
/* harmony import */ var _icon__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../icon */ "./node_modules/@wordpress/components/build-module/icon/index.js");
/* harmony import */ var _primitives__WEBPACK_IMPORTED_MODULE_11__ = __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_6__["default"])(PanelBody, _Component);
function PanelBody(props) {
var _this;
Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_1__["default"])(this, PanelBody);
_this = Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__["default"])(this, Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__["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"])(_this));
return _this;
}
Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_2__["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,
forwardedRef = _this$props.forwardedRef;
var isOpened = opened === undefined ? this.state.opened : opened;
var classes = classnames__WEBPACK_IMPORTED_MODULE_8___default()('components-panel__body', className, {
'is-opened': isOpened
});
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["createElement"])("div", {
className: classes,
ref: forwardedRef
}, !!title && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["createElement"])("h2", {
className: "components-panel__body-title"
}, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["createElement"])(_button__WEBPACK_IMPORTED_MODULE_9__["default"], {
className: "components-panel__body-toggle",
onClick: this.toggle,
"aria-expanded": isOpened
}, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["createElement"])("span", {
"aria-hidden": "true"
}, isOpened ? Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["createElement"])(_primitives__WEBPACK_IMPORTED_MODULE_11__["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_7__["createElement"])(_primitives__WEBPACK_IMPORTED_MODULE_11__["G"], null, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["createElement"])(_primitives__WEBPACK_IMPORTED_MODULE_11__["Path"], {
fill: "none",
d: "M0,0h24v24H0V0z"
})), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["createElement"])(_primitives__WEBPACK_IMPORTED_MODULE_11__["G"], null, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["createElement"])(_primitives__WEBPACK_IMPORTED_MODULE_11__["Path"], {
d: "M12,8l-6,6l1.41,1.41L12,10.83l4.59,4.58L18,14L12,8z"
}))) : Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["createElement"])(_primitives__WEBPACK_IMPORTED_MODULE_11__["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_7__["createElement"])(_primitives__WEBPACK_IMPORTED_MODULE_11__["G"], null, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["createElement"])(_primitives__WEBPACK_IMPORTED_MODULE_11__["Path"], {
fill: "none",
d: "M0,0h24v24H0V0z"
})), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["createElement"])(_primitives__WEBPACK_IMPORTED_MODULE_11__["G"], null, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["createElement"])(_primitives__WEBPACK_IMPORTED_MODULE_11__["Path"], {
d: "M7.41,8.59L12,13.17l4.59-4.58L18,10l-6,6l-6-6L7.41,8.59z"
})))), title, icon && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["createElement"])(_icon__WEBPACK_IMPORTED_MODULE_10__["default"], {
icon: icon,
className: "components-panel__icon",
size: 20
}))), isOpened && children);
}
}]);
return PanelBody;
}(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["Component"]);
var forwardedPanelBody = function forwardedPanelBody(props, ref) {
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["createElement"])(PanelBody, Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, props, {
forwardedRef: ref
}));
};
forwardedPanelBody.displayName = 'PanelBody';
/* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["forwardRef"])(forwardedPanelBody));
/***/ }),
/***/ "./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 */ "./node_modules/@wordpress/element/build-module/index.js");
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 */ "./node_modules/@wordpress/element/build-module/index.js");
/* 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 */ "./node_modules/@wordpress/element/build-module/index.js");
/* 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 */ "./node_modules/@wordpress/element/build-module/index.js");
/* 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,
preview = _ref.preview,
isColumnLayout = _ref.isColumnLayout,
additionalProps = Object(_babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__["default"])(_ref, ["icon", "children", "label", "instructions", "className", "notices", "preview", "isColumnLayout"]);
var classes = classnames__WEBPACK_IMPORTED_MODULE_3___default()('components-placeholder', className);
var fieldsetClasses = classnames__WEBPACK_IMPORTED_MODULE_3___default()('components-placeholder__fieldset', {
'is-column-layout': isColumnLayout
});
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, preview && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["createElement"])("div", {
className: "components-placeholder__preview"
}, preview), 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: fieldsetClasses
}, 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 _wordpress_element__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/element */ "./node_modules/@wordpress/element/build-module/index.js");
/* harmony import */ var _higher_order_with_focus_outside__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../higher-order/with-focus-outside */ "./node_modules/@wordpress/components/build-module/higher-order/with-focus-outside/index.js");
/**
* WordPress dependencies
*/
/**
* Internal 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: "handleFocusOutside",
value: function handleFocusOutside(event) {
this.props.onFocusOutside(event);
}
}, {
key: "render",
value: function render() {
return this.props.children;
}
}]);
return PopoverDetectOutside;
}(_wordpress_element__WEBPACK_IMPORTED_MODULE_5__["Component"]);
/* harmony default export */ __webpack_exports__["default"] = (Object(_higher_order_with_focus_outside__WEBPACK_IMPORTED_MODULE_6__["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_slicedToArray__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/slicedToArray */ "./node_modules/@babel/runtime/helpers/esm/slicedToArray.js");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/element */ "./node_modules/@wordpress/element/build-module/index.js");
/* 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_dom__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/dom */ "./node_modules/@wordpress/dom/build-module/index.js");
/* harmony import */ var _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @wordpress/keycodes */ "./node_modules/@wordpress/keycodes/build-module/index.js");
/* harmony import */ var _wordpress_is_shallow_equal__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @wordpress/is-shallow-equal */ "./node_modules/@wordpress/is-shallow-equal/index.js");
/* harmony import */ var _wordpress_is_shallow_equal__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_wordpress_is_shallow_equal__WEBPACK_IMPORTED_MODULE_7__);
/* harmony import */ var _wordpress_deprecated__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @wordpress/deprecated */ "./node_modules/@wordpress/deprecated/build-module/index.js");
/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./utils */ "./node_modules/@wordpress/components/build-module/popover/utils.js");
/* harmony import */ var _higher_order_with_focus_return__WEBPACK_IMPORTED_MODULE_10__ = __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_11__ = __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_12__ = __webpack_require__(/*! ./detect-outside */ "./node_modules/@wordpress/components/build-module/popover/detect-outside.js");
/* harmony import */ var _icon_button__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../icon-button */ "./node_modules/@wordpress/components/build-module/icon-button/index.js");
/* harmony import */ var _scroll_lock__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../scroll-lock */ "./node_modules/@wordpress/components/build-module/scroll-lock/index.js");
/* harmony import */ var _isolated_event_container__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../isolated-event-container */ "./node_modules/@wordpress/components/build-module/isolated-event-container/index.js");
/* harmony import */ var _slot_fill__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ../slot-fill */ "./node_modules/@wordpress/components/build-module/slot-fill/index.js");
/* harmony import */ var _animate__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ../animate */ "./node_modules/@wordpress/components/build-module/animate/index.js");
/**
* External dependencies
*/
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
var FocusManaged = Object(_higher_order_with_constrained_tabbing__WEBPACK_IMPORTED_MODULE_11__["default"])(Object(_higher_order_with_focus_return__WEBPACK_IMPORTED_MODULE_10__["default"])(function (_ref) {
var children = _ref.children;
return children;
}));
/**
* Name of slot in which popover should fill.
*
* @type {string}
*/
var SLOT_NAME = 'Popover';
/**
* Hook used trigger an event handler once the window is resized or scrolled.
*
* @param {Function} handler Event handler.
* @param {Object} ignoredScrollalbeRef scroll events inside this element are ignored.
*/
function useThrottledWindowScrollOrResize(handler, ignoredScrollalbeRef) {
// Refresh anchor rect on resize
Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__["useEffect"])(function () {
var refreshHandle;
var throttledRefresh = function throttledRefresh(event) {
window.cancelAnimationFrame(refreshHandle);
if (ignoredScrollalbeRef && event && event.type === 'scroll' && ignoredScrollalbeRef.current.contains(event.target)) {
return;
}
refreshHandle = window.requestAnimationFrame(handler);
};
window.addEventListener('resize', throttledRefresh);
window.addEventListener('scroll', throttledRefresh);
return function () {
window.removeEventListener('resize', throttledRefresh);
window.removeEventListener('scroll', throttledRefresh);
};
}, []);
}
/**
* Hook used to compute and update the anchor position properly.
*
* @param {Object} anchorRef reference to the popover anchor element.
* @param {Object} contentRef reference to the popover content element.
* @param {Object} anchorRect anchor Rect prop used to override the computed value.
* @param {Function} getAnchorRect function used to override the anchor value computation algorithm.
*
* @return {Object} Anchor position.
*/
function useAnchor(anchorRef, contentRef, anchorRect, getAnchorRect) {
var _useState = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__["useState"])(null),
_useState2 = Object(_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_2__["default"])(_useState, 2),
anchor = _useState2[0],
setAnchor = _useState2[1];
var refreshAnchorRect = function refreshAnchorRect() {
if (!anchorRef.current) {
return;
}
var newAnchor;
if (anchorRect) {
newAnchor = anchorRect;
} else if (getAnchorRect) {
newAnchor = getAnchorRect(anchorRef.current);
} else {
var rect = anchorRef.current.parentNode.getBoundingClientRect(); // subtract padding
var _window$getComputedSt = window.getComputedStyle(anchorRef.current.parentNode),
paddingTop = _window$getComputedSt.paddingTop,
paddingBottom = _window$getComputedSt.paddingBottom;
var topPad = parseInt(paddingTop, 10);
var bottomPad = parseInt(paddingBottom, 10);
newAnchor = {
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
};
}
var didAnchorRectChange = !_wordpress_is_shallow_equal__WEBPACK_IMPORTED_MODULE_7___default()(newAnchor, anchor);
if (didAnchorRectChange) {
setAnchor(newAnchor);
}
};
Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__["useEffect"])(refreshAnchorRect, [anchorRect, getAnchorRect]);
Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__["useEffect"])(function () {
if (!anchorRect) {
/*
* There are sometimes we need to reposition or resize the popover that are not
* handled by the resize/scroll window events (i.e. CSS changes in the layout
* that changes the position of the anchor).
*
* For these situations, we refresh the popover every 0.5s
*/
var intervalHandle = setInterval(refreshAnchorRect, 500);
return function () {
return clearInterval(intervalHandle);
};
}
}, [anchorRect]);
useThrottledWindowScrollOrResize(refreshAnchorRect, contentRef);
return anchor;
}
/**
* Hook used to compute the initial size of an element.
* The popover applies styling to limit the height of the element,
* we only care about the initial size.
*
* @param {Object} ref Reference to the popover content element.
*
* @return {Object} Content size.
*/
function useInitialContentSize(ref) {
var _useState3 = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__["useState"])(null),
_useState4 = Object(_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_2__["default"])(_useState3, 2),
contentSize = _useState4[0],
setContentSize = _useState4[1];
Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__["useEffect"])(function () {
var contentRect = ref.current.getBoundingClientRect();
setContentSize({
width: contentRect.width,
height: contentRect.height
});
}, []);
return contentSize;
}
/**
* Hook used to compute and update the position of the popover
* based on the anchor position and the content size.
*
* @param {Object} anchor Anchor Position.
* @param {Object} contentSize Content Size.
* @param {string} position Position prop.
* @param {boolean} expandOnMobile Whether to show the popover full width on mobile.
* @param {Object} contentRef Reference to the popover content element.
*
* @return {Object} Popover position.
*/
function usePopoverPosition(anchor, contentSize, position, expandOnMobile, contentRef) {
var _useState5 = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__["useState"])({
popoverLeft: null,
popoverTop: null,
yAxis: 'top',
xAxis: 'center',
contentHeight: null,
contentWidth: null,
isMobile: false
}),
_useState6 = Object(_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_2__["default"])(_useState5, 2),
popoverPosition = _useState6[0],
setPopoverPosition = _useState6[1];
var refreshPopoverPosition = function refreshPopoverPosition() {
if (!anchor || !contentSize) {
return;
}
var newPopoverPosition = Object(_utils__WEBPACK_IMPORTED_MODULE_9__["computePopoverPosition"])(anchor, contentSize, position, expandOnMobile);
if (popoverPosition.yAxis !== newPopoverPosition.yAxis || popoverPosition.xAxis !== newPopoverPosition.xAxis || popoverPosition.popoverLeft !== newPopoverPosition.popoverLeft || popoverPosition.popoverTop !== newPopoverPosition.popoverTop || popoverPosition.contentHeight !== newPopoverPosition.contentHeight || popoverPosition.contentWidth !== newPopoverPosition.contentWidth || popoverPosition.isMobile !== newPopoverPosition.isMobile) {
setPopoverPosition(newPopoverPosition);
}
};
Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__["useEffect"])(refreshPopoverPosition, [anchor, contentSize]);
useThrottledWindowScrollOrResize(refreshPopoverPosition, contentRef);
return popoverPosition;
}
/**
* Hook used to focus the first tabbable element on mount.
*
* @param {boolean|string} focusOnMount Focus on mount mode.
* @param {Object} contentRef Reference to the popover content element.
*/
function useFocusContentOnMount(focusOnMount, contentRef) {
// Focus handling
Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__["useEffect"])(function () {
/*
* 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.
*/
var focusTimeout = setTimeout(function () {
if (!focusOnMount || !contentRef.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_5__["focus"].tabbable.find(contentRef.current)[0];
if (firstTabbable) {
firstTabbable.focus();
} else {
contentRef.current.focus();
}
return;
}
if (focusOnMount === 'container') {
// Focus the popover panel itself so items in the popover are easily
// accessed via keyboard navigation.
contentRef.current.focus();
}
}, 0);
return function () {
return clearTimeout(focusTimeout);
};
}, []);
}
var Popover = function Popover(_ref2) {
var headerTitle = _ref2.headerTitle,
onClose = _ref2.onClose,
onKeyDown = _ref2.onKeyDown,
children = _ref2.children,
className = _ref2.className,
_ref2$noArrow = _ref2.noArrow,
noArrow = _ref2$noArrow === void 0 ? false : _ref2$noArrow,
_ref2$position = _ref2.position,
position = _ref2$position === void 0 ? 'top' : _ref2$position,
range = _ref2.range,
_ref2$focusOnMount = _ref2.focusOnMount,
focusOnMount = _ref2$focusOnMount === void 0 ? 'firstElement' : _ref2$focusOnMount,
anchorRect = _ref2.anchorRect,
getAnchorRect = _ref2.getAnchorRect,
expandOnMobile = _ref2.expandOnMobile,
_ref2$animate = _ref2.animate,
animate = _ref2$animate === void 0 ? true : _ref2$animate,
onClickOutside = _ref2.onClickOutside,
onFocusOutside = _ref2.onFocusOutside,
contentProps = Object(_babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__["default"])(_ref2, ["headerTitle", "onClose", "onKeyDown", "children", "className", "noArrow", "position", "range", "focusOnMount", "anchorRect", "getAnchorRect", "expandOnMobile", "animate", "onClickOutside", "onFocusOutside"]);
var anchorRef = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__["useRef"])(null);
var contentRef = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__["useRef"])(null); // Animation
var _useState7 = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__["useState"])(false),
_useState8 = Object(_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_2__["default"])(_useState7, 2),
isReadyToAnimate = _useState8[0],
setIsReadyToAnimate = _useState8[1]; // Anchor position
var anchor = useAnchor(anchorRef, contentRef, anchorRect, getAnchorRect); // Content size
var contentSize = useInitialContentSize(contentRef);
Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__["useEffect"])(function () {
if (contentSize) {
setIsReadyToAnimate(true);
}
}, [contentSize]); // Compute the position
var popoverPosition = usePopoverPosition(anchor, contentSize, position, expandOnMobile, contentRef);
useFocusContentOnMount(focusOnMount, contentRef); // Event handlers
var maybeClose = function maybeClose(event) {
// Close on escape
if (event.keyCode === _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_6__["ESCAPE"] && onClose) {
event.stopPropagation();
onClose();
} // Preserve original content prop behavior
if (onKeyDown) {
onKeyDown(event);
}
};
/**
* Shims an onFocusOutside callback to be compatible with a deprecated
* onClickOutside prop function, if provided.
*
* @param {FocusEvent} event Focus event from onFocusOutside.
*/
function handleOnFocusOutside(event) {
// Defer to given `onFocusOutside` if specified. Call `onClose` only if
// both `onFocusOutside` and `onClickOutside` are unspecified. Doing so
// assures backwards-compatibility for prior `onClickOutside` default.
if (onFocusOutside) {
onFocusOutside(event);
return;
} else if (!onClickOutside) {
if (onClose) {
onClose();
}
return;
} // Simulate MouseEvent using FocusEvent#relatedTarget as emulated click
// target. MouseEvent constructor is unsupported in Internet Explorer.
var clickEvent;
try {
clickEvent = new window.MouseEvent('click');
} catch (error) {
clickEvent = document.createEvent('MouseEvent');
clickEvent.initMouseEvent('click', true, true, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);
}
Object.defineProperty(clickEvent, 'target', {
get: function get() {
return event.relatedTarget;
}
});
Object(_wordpress_deprecated__WEBPACK_IMPORTED_MODULE_8__["default"])('Popover onClickOutside prop', {
alternative: 'onFocusOutside'
});
onClickOutside(clickEvent);
} // Compute the animation position
var yAxisMapping = {
top: 'bottom',
bottom: 'top'
};
var xAxisMapping = {
left: 'right',
right: 'left'
};
var animateYAxis = yAxisMapping[popoverPosition.yAxis] || 'middle';
var animateXAxis = xAxisMapping[popoverPosition.xAxis] || 'center';
var classes = classnames__WEBPACK_IMPORTED_MODULE_4___default()('components-popover', className, 'is-' + popoverPosition.yAxis, 'is-' + popoverPosition.xAxis, {
'is-mobile': popoverPosition.isMobile,
'is-without-arrow': noArrow || popoverPosition.xAxis === 'center' && popoverPosition.yAxis === 'middle'
}); // Disable reason: We care to capture the _bubbled_ events from inputs
// within popover as inferring close intent.
var content = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__["createElement"])(_detect_outside__WEBPACK_IMPORTED_MODULE_12__["default"], {
onFocusOutside: handleOnFocusOutside
}, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__["createElement"])(_animate__WEBPACK_IMPORTED_MODULE_17__["default"], {
type: animate && isReadyToAnimate ? 'appear' : null,
options: {
origin: animateYAxis + ' ' + animateXAxis
}
}, function (_ref3) {
var animateClassName = _ref3.className;
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__["createElement"])(_isolated_event_container__WEBPACK_IMPORTED_MODULE_15__["default"], Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({
className: classnames__WEBPACK_IMPORTED_MODULE_4___default()(classes, animateClassName),
style: {
top: !popoverPosition.isMobile && popoverPosition.popoverTop ? popoverPosition.popoverTop + 'px' : undefined,
left: !popoverPosition.isMobile && popoverPosition.popoverLeft ? popoverPosition.popoverLeft + 'px' : undefined,
visibility: contentSize ? undefined : 'hidden'
}
}, contentProps, {
onKeyDown: maybeClose
}), popoverPosition.isMobile && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__["createElement"])("div", {
className: "components-popover__header"
}, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__["createElement"])("span", {
className: "components-popover__header-title"
}, headerTitle), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__["createElement"])(_icon_button__WEBPACK_IMPORTED_MODULE_13__["default"], {
className: "components-popover__close",
icon: "no-alt",
onClick: onClose
})), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__["createElement"])("div", {
ref: contentRef,
className: "components-popover__content",
style: {
maxHeight: !popoverPosition.isMobile && popoverPosition.contentHeight ? popoverPosition.contentHeight + 'px' : undefined,
maxWidth: !popoverPosition.isMobile && popoverPosition.contentWidth ? popoverPosition.contentWidth + 'px' : undefined
},
tabIndex: "-1"
}, children));
})); // 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_3__["createElement"])(FocusManaged, null, content);
}
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__["createElement"])(_slot_fill__WEBPACK_IMPORTED_MODULE_16__["Consumer"], null, function (_ref4) {
var getSlot = _ref4.getSlot; // In case there is no slot context in which to render,
// default to an in-place rendering.
if (getSlot && getSlot(SLOT_NAME)) {
content = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__["createElement"])(_slot_fill__WEBPACK_IMPORTED_MODULE_16__["Fill"], {
name: SLOT_NAME
}, content);
}
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__["createElement"])("span", {
ref: anchorRef
}, content, popoverPosition.isMobile && expandOnMobile && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__["createElement"])(_scroll_lock__WEBPACK_IMPORTED_MODULE_14__["default"], null));
});
};
var PopoverContainer = Popover;
PopoverContainer.Slot = function () {
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__["createElement"])(_slot_fill__WEBPACK_IMPORTED_MODULE_16__["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;
};
var isRTL = function isRTL() {
return document.documentElement.dir === 'rtl';
};
/**
* 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.
*
* @return {Object} Popover xAxis position and constraints.
*/
function computePopoverXAxisPosition(anchorRect, contentSize, xAxis, chosenYAxis) {
var width = contentSize.width; // Correct xAxis for RTL support
if (xAxis === 'left' && isRTL()) {
xAxis = 'right';
} else if (xAxis === 'right' && isRTL()) {
xAxis = 'left';
} // 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.
*
* @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/block-quotation/index.js":
/*!*********************************************************************************************!*\
!*** ./node_modules/@wordpress/components/build-module/primitives/block-quotation/index.js ***!
\*********************************************************************************************/
/*! exports provided: BlockQuotation */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BlockQuotation", function() { return BlockQuotation; });
var BlockQuotation = 'blockquote';
/***/ }),
/***/ "./node_modules/@wordpress/components/build-module/primitives/horizontal-rule/index.js":
/*!*********************************************************************************************!*\
!*** ./node_modules/@wordpress/components/build-module/primitives/horizontal-rule/index.js ***!
\*********************************************************************************************/
/*! exports provided: HorizontalRule */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "HorizontalRule", function() { return HorizontalRule; });
var HorizontalRule = 'hr';
/***/ }),
/***/ "./node_modules/@wordpress/components/build-module/primitives/index.js":
/*!*****************************************************************************!*\
!*** ./node_modules/@wordpress/components/build-module/primitives/index.js ***!
\*****************************************************************************/
/*! exports provided: Circle, G, Path, Polygon, Rect, SVG, HorizontalRule, BlockQuotation */
/***/ (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__, "Circle", function() { return _svg__WEBPACK_IMPORTED_MODULE_0__["Circle"]; });
/* 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__, "Rect", function() { return _svg__WEBPACK_IMPORTED_MODULE_0__["Rect"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "SVG", function() { return _svg__WEBPACK_IMPORTED_MODULE_0__["SVG"]; });
/* harmony import */ var _horizontal_rule__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./horizontal-rule */ "./node_modules/@wordpress/components/build-module/primitives/horizontal-rule/index.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "HorizontalRule", function() { return _horizontal_rule__WEBPACK_IMPORTED_MODULE_1__["HorizontalRule"]; });
/* harmony import */ var _block_quotation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./block-quotation */ "./node_modules/@wordpress/components/build-module/primitives/block-quotation/index.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "BlockQuotation", function() { return _block_quotation__WEBPACK_IMPORTED_MODULE_2__["BlockQuotation"]; });
/***/ }),
/***/ "./node_modules/@wordpress/components/build-module/primitives/svg/index.js":
/*!*********************************************************************************!*\
!*** ./node_modules/@wordpress/components/build-module/primitives/svg/index.js ***!
\*********************************************************************************/
/*! exports provided: Circle, G, Path, Polygon, Rect, SVG */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Circle", function() { return Circle; });
/* 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__, "Rect", function() { return Rect; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SVG", function() { return SVG; });
/* 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 */ "./node_modules/@wordpress/element/build-module/index.js");
/**
* WordPress dependencies
*/
var Circle = function Circle(props) {
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])('circle', props);
};
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 Rect = function Rect(props) {
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])('rect', 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'
}); // Disable reason: We need to have a way to render HTML tag for web.
// eslint-disable-next-line react/forbid-elements
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])("svg", appliedProps);
};
/***/ }),
/***/ "./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 */ "./node_modules/@wordpress/element/build-module/index.js");
/* 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 */ "./node_modules/@wordpress/element/build-module/index.js");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/i18n */ "./node_modules/@wordpress/i18n/build-module/index.js");
/* 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,
required: true
})];
}
/***/ }),
/***/ "./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 flatTermsWithParentAndChildren = flatTerms.map(function (term) {
return Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_0__["default"])({
children: [],
parent: null
}, term);
});
var termsByParent = Object(lodash__WEBPACK_IMPORTED_MODULE_1__["groupBy"])(flatTermsWithParentAndChildren, 'parent');
if (termsByParent.null && termsByParent.null.length) {
return flatTermsWithParentAndChildren;
}
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 */ "./node_modules/@wordpress/element/build-module/index.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__);
/* 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 */ "./node_modules/@wordpress/compose/build-module/index.js");
/* 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 */ "./node_modules/@wordpress/element/build-module/index.js");
/* 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 */ "./node_modules/@wordpress/i18n/build-module/index.js");
/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @wordpress/compose */ "./node_modules/@wordpress/compose/build-module/index.js");
/* 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,
currentInput = _ref.currentInput,
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,
min = _ref.min,
max = _ref.max,
setState = _ref.setState,
props = Object(_babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__["default"])(_ref, ["className", "currentInput", "label", "value", "instanceId", "onChange", "beforeIcon", "afterIcon", "help", "allowReset", "initialPosition", "min", "max", "setState"]);
var id = "inspector-range-control-".concat(instanceId);
var currentInputValue = currentInput === null ? value : currentInput;
var resetValue = function resetValue() {
resetCurrentInput();
onChange();
};
var resetCurrentInput = function resetCurrentInput() {
if (currentInput !== null) {
setState({
currentInput: null
});
}
};
var onChangeValue = function onChangeValue(event) {
var newValue = event.target.value; // If the input value is invalid temporarily save it to the state,
// without calling on change.
if (!event.target.checkValidity()) {
setState({
currentInput: newValue
});
return;
} // The input is valid, reset the local state property used to temporaly save the value,
// and call onChange with the new value as a number.
resetCurrentInput();
onChange(newValue === '' ? undefined : parseFloat(newValue));
};
var initialSliderValue = Object(lodash__WEBPACK_IMPORTED_MODULE_3__["isFinite"])(currentInputValue) ? currentInputValue : 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,
min: min,
max: max
}, 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: currentInputValue,
min: min,
max: max,
onBlur: resetCurrentInput
}, props)), allowReset && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["createElement"])(___WEBPACK_IMPORTED_MODULE_7__["Button"], {
onClick: resetValue,
disabled: value === undefined,
isSmall: true,
isDefault: true,
className: "components-range-control__reset"
}, Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_5__["__"])('Reset')));
}
/* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_6__["compose"])([_wordpress_compose__WEBPACK_IMPORTED_MODULE_6__["withInstanceId"], Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_6__["withState"])({
currentInput: null
})])(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 */ "./node_modules/@wordpress/element/build-module/index.js");
/* 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");
/* harmony import */ var re_resizable__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(re_resizable__WEBPACK_IMPORTED_MODULE_4__);
/**
* 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';
var sideHandleClassName = 'components-resizable-box__side-handle';
var cornerHandleClassName = 'components-resizable-box__corner-handle';
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["createElement"])(re_resizable__WEBPACK_IMPORTED_MODULE_4__["Resizable"], 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, sideHandleClassName, 'components-resizable-box__handle-top'),
right: classnames__WEBPACK_IMPORTED_MODULE_3___default()(handleClassName, sideHandleClassName, 'components-resizable-box__handle-right'),
bottom: classnames__WEBPACK_IMPORTED_MODULE_3___default()(handleClassName, sideHandleClassName, 'components-resizable-box__handle-bottom'),
left: classnames__WEBPACK_IMPORTED_MODULE_3___default()(handleClassName, sideHandleClassName, 'components-resizable-box__handle-left'),
topLeft: classnames__WEBPACK_IMPORTED_MODULE_3___default()(handleClassName, cornerHandleClassName, 'components-resizable-box__handle-top', 'components-resizable-box__handle-left'),
topRight: classnames__WEBPACK_IMPORTED_MODULE_3___default()(handleClassName, cornerHandleClassName, 'components-resizable-box__handle-top', 'components-resizable-box__handle-right'),
bottomRight: classnames__WEBPACK_IMPORTED_MODULE_3___default()(handleClassName, cornerHandleClassName, 'components-resizable-box__handle-bottom', 'components-resizable-box__handle-right'),
bottomLeft: classnames__WEBPACK_IMPORTED_MODULE_3___default()(handleClassName, cornerHandleClassName, 'components-resizable-box__handle-bottom', 'components-resizable-box__handle-left')
},
handleStyles: {
top: handleStylesOverrides,
right: handleStylesOverrides,
bottom: handleStylesOverrides,
left: handleStylesOverrides,
topLeft: handleStylesOverrides,
topRight: handleStylesOverrides,
bottomRight: handleStylesOverrides,
bottomLeft: 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 */ "./node_modules/@wordpress/element/build-module/index.js");
/* 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_assertThisInitialized__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/esm/assertThisInitialized */ "./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.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 _wordpress_element__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @wordpress/element */ "./node_modules/@wordpress/element/build-module/index.js");
/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @wordpress/compose */ "./node_modules/@wordpress/compose/build-module/index.js");
/* 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_5__["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_4__["default"])(_this));
_this.checkMessageForResize = _this.checkMessageForResize.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_4__["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) {}
} // 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\tif( ruleOrNode.style ) {\n\t\t\t\t\t\t[ 'width', 'height', 'minHeight', 'maxHeight' ].forEach( function( style ) {\n\t\t\t\t\t\t\tif ( /^\\d+(vmin|vmax|vh|vw)$/.test( ruleOrNode.style[ style ] ) ) {\n\t\t\t\t\t\t\t\truleOrNode.style[ style ] = '';\n\t\t\t\t\t\t\t}\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
}
}), this.props.styles && this.props.styles.map(function (rules, i) {
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("style", {
key: i,
dangerouslySetInnerHTML: {
__html: rules
}
});
})), 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 _this$props = this.props,
title = _this$props.title,
onFocus = _this$props.onFocus;
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,
onFocus: onFocus,
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 */ "./node_modules/@wordpress/element/build-module/index.js");
/**
* 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 */ "./node_modules/@wordpress/element/build-module/index.js");
/* 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 */ "./node_modules/@wordpress/compose/build-module/index.js");
/* 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,
hideLabelFromVision = _ref.hideLabelFromVision,
props = Object(_babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_2__["default"])(_ref, ["help", "instanceId", "label", "multiple", "onChange", "options", "className", "hideLabelFromVision"]);
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,
hideLabelFromVision: hideLabelFromVision,
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,
disabled: option.disabled
}, 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/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 */ "./node_modules/@wordpress/element/build-module/index.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
*/
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/context.js":
/*!******************************************************************************!*\
!*** ./node_modules/@wordpress/components/build-module/slot-fill/context.js ***!
\******************************************************************************/
/*! exports provided: useSlot, default, Consumer */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "useSlot", function() { return useSlot; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Consumer", function() { return Consumer; });
/* 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_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_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_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @babel/runtime/helpers/esm/assertThisInitialized */ "./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.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 _wordpress_element__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @wordpress/element */ "./node_modules/@wordpress/element/build-module/index.js");
/* 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 SlotFillContext = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["createContext"])({
registerSlot: function registerSlot() {},
unregisterSlot: function unregisterSlot() {},
registerFill: function registerFill() {},
unregisterFill: function unregisterFill() {},
getSlot: function getSlot() {},
getFills: function getFills() {},
subscribe: function subscribe() {}
});
var Provider = SlotFillContext.Provider,
Consumer = SlotFillContext.Consumer;
var SlotFillProvider =
/*#__PURE__*/
function (_Component) {
Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_7__["default"])(SlotFillProvider, _Component);
function SlotFillProvider() {
var _this;
Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_2__["default"])(this, SlotFillProvider);
_this = Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_4__["default"])(this, Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_5__["default"])(SlotFillProvider).apply(this, arguments));
_this.registerSlot = _this.registerSlot.bind(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"])(_this));
_this.unregisterSlot = _this.unregisterSlot.bind(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"])(_this));
_this.getSlot = _this.getSlot.bind(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"])(_this));
_this.subscribe = _this.subscribe.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__["default"])(_this));
_this.slots = {};
_this.fills = {};
_this.listeners = [];
_this.contextValue = {
registerSlot: _this.registerSlot,
unregisterSlot: _this.unregisterSlot,
registerFill: _this.registerFill,
unregisterFill: _this.unregisterFill,
getSlot: _this.getSlot,
getFills: _this.getFills,
subscribe: _this.subscribe
};
return _this;
}
Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_3__["default"])(SlotFillProvider, [{
key: "registerSlot",
value: function registerSlot(name, slot) {
var previousSlot = this.slots[name];
this.slots[name] = slot;
this.triggerListeners(); // 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); // If a new instance of a slot is being mounted while another with the
// same name exists, force its update _after_ the new slot has been
// assigned into the instance, such that its own rendering of children
// will be empty (the new Slot will subsume all fills for this name).
if (previousSlot) {
previousSlot.forceUpdate();
}
}
}, {
key: "registerFill",
value: function registerFill(name, instance) {
this.fills[name] = [].concat(Object(_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_1__["default"])(this.fills[name] || []), [instance]);
this.forceUpdateSlot(name);
}
}, {
key: "unregisterSlot",
value: function unregisterSlot(name, instance) {
// If a previous instance of a Slot by this name unmounts, do nothing,
// as the slot and its fills should only be removed for the current
// known instance.
if (this.slots[name] !== instance) {
return;
}
delete this.slots[name];
this.triggerListeners();
}
}, {
key: "unregisterFill",
value: function unregisterFill(name, instance) {
this.fills[name] = Object(lodash__WEBPACK_IMPORTED_MODULE_9__["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, slotInstance) {
// Fills should only be returned for the current instance of the slot
// in which they occupy.
if (this.slots[name] !== slotInstance) {
return [];
}
return Object(lodash__WEBPACK_IMPORTED_MODULE_9__["sortBy"])(this.fills[name], 'occurrence');
}
}, {
key: "resetFillOccurrence",
value: function resetFillOccurrence(name) {
Object(lodash__WEBPACK_IMPORTED_MODULE_9__["forEach"])(this.fills[name], function (instance) {
instance.occurrence = undefined;
});
}
}, {
key: "forceUpdateSlot",
value: function forceUpdateSlot(name) {
var slot = this.getSlot(name);
if (slot) {
slot.forceUpdate();
}
}
}, {
key: "triggerListeners",
value: function triggerListeners() {
this.listeners.forEach(function (listener) {
return listener();
});
}
}, {
key: "subscribe",
value: function subscribe(listener) {
var _this2 = this;
this.listeners.push(listener);
return function () {
_this2.listeners = Object(lodash__WEBPACK_IMPORTED_MODULE_9__["without"])(_this2.listeners, listener);
};
}
}, {
key: "render",
value: function render() {
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["createElement"])(Provider, {
value: this.contextValue
}, this.props.children);
}
}]);
return SlotFillProvider;
}(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["Component"]);
/**
* React hook returning the active slot given a name.
*
* @param {string} name Slot name.
* @return {Object} Slot object.
*/
var useSlot = function useSlot(name) {
var _useContext = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["useContext"])(SlotFillContext),
getSlot = _useContext.getSlot,
subscribe = _useContext.subscribe;
var _useState = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["useState"])(getSlot(name)),
_useState2 = Object(_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_0__["default"])(_useState, 2),
slot = _useState2[0],
setSlot = _useState2[1];
Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["useEffect"])(function () {
setSlot(getSlot(name));
var unsubscribe = subscribe(function () {
setSlot(getSlot(name));
});
return unsubscribe;
}, [name]);
return slot;
};
/* harmony default export */ __webpack_exports__["default"] = (SlotFillProvider);
/***/ }),
/***/ "./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_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 */ "./node_modules/@wordpress/element/build-module/index.js");
/* 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 _context__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./context */ "./node_modules/@wordpress/components/build-module/slot-fill/context.js");
/**
* External dependencies
*/
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
var occurrences = 0;
function FillComponent(_ref) {
var name = _ref.name,
children = _ref.children,
registerFill = _ref.registerFill,
unregisterFill = _ref.unregisterFill;
var slot = Object(_context__WEBPACK_IMPORTED_MODULE_3__["useSlot"])(name);
var ref = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["useRef"])({
name: name,
children: children
});
if (!ref.current.occurrence) {
ref.current.occurrence = ++occurrences;
}
Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["useLayoutEffect"])(function () {
registerFill(name, ref.current);
return function () {
return unregisterFill(name, ref.current);
};
}, []);
Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["useLayoutEffect"])(function () {
ref.current.children = children;
if (slot && !slot.props.bubblesVirtually) {
slot.forceUpdate();
}
}, [children]);
Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["useLayoutEffect"])(function () {
if (name === ref.current.name) {
// ignore initial effect
return;
}
unregisterFill(ref.current.name, ref.current);
ref.current.name = name;
registerFill(name, ref.current);
}, [name]);
if (!slot || !slot.node || !slot.props.bubblesVirtually) {
return null;
} // If a function is passed as a child, provide it with the fillProps.
if (Object(lodash__WEBPACK_IMPORTED_MODULE_2__["isFunction"])(children)) {
children = children(slot.props.fillProps);
}
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createPortal"])(children, slot.node);
}
var Fill = function Fill(props) {
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])(_context__WEBPACK_IMPORTED_MODULE_3__["Consumer"], null, function (_ref2) {
var registerFill = _ref2.registerFill,
unregisterFill = _ref2.unregisterFill;
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])(FillComponent, Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, props, {
registerFill: registerFill,
unregisterFill: unregisterFill
}));
});
};
/* 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, Consumer, 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 _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/element */ "./node_modules/@wordpress/element/build-module/index.js");
/* harmony import */ var _slot__WEBPACK_IMPORTED_MODULE_2__ = __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_2__["default"]; });
/* harmony import */ var _fill__WEBPACK_IMPORTED_MODULE_3__ = __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_3__["default"]; });
/* harmony import */ var _context__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./context */ "./node_modules/@wordpress/components/build-module/slot-fill/context.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Provider", function() { return _context__WEBPACK_IMPORTED_MODULE_4__["default"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Consumer", function() { return _context__WEBPACK_IMPORTED_MODULE_4__["Consumer"]; });
/**
* Internal dependencies
*/
function createSlotFill(name) {
var FillComponent = function FillComponent(props) {
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])(_fill__WEBPACK_IMPORTED_MODULE_3__["default"], Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({
name: name
}, props));
};
FillComponent.displayName = name + 'Fill';
var SlotComponent = function SlotComponent(props) {
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])(_slot__WEBPACK_IMPORTED_MODULE_2__["default"], Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({
name: name
}, props));
};
SlotComponent.displayName = name + 'Slot';
return {
Fill: FillComponent,
Slot: SlotComponent
};
}
/***/ }),
/***/ "./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_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_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_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 */ "./node_modules/@wordpress/element/build-module/index.js");
/* 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 _context__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./context */ "./node_modules/@wordpress/components/build-module/slot-fill/context.js");
/**
* External dependencies
*/
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
var SlotComponent =
/*#__PURE__*/
function (_Component) {
Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_6__["default"])(SlotComponent, _Component);
function SlotComponent() {
var _this;
Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_1__["default"])(this, SlotComponent);
_this = Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__["default"])(this, Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__["default"])(SlotComponent).apply(this, arguments));
_this.bindNode = _this.bindNode.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(_this));
return _this;
}
Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_2__["default"])(SlotComponent, [{
key: "componentDidMount",
value: function componentDidMount() {
var registerSlot = this.props.registerSlot;
registerSlot(this.props.name, this);
}
}, {
key: "componentWillUnmount",
value: function componentWillUnmount() {
var unregisterSlot = this.props.unregisterSlot;
unregisterSlot(this.props.name, this);
}
}, {
key: "componentDidUpdate",
value: function componentDidUpdate(prevProps) {
var _this$props = this.props,
name = _this$props.name,
unregisterSlot = _this$props.unregisterSlot,
registerSlot = _this$props.registerSlot;
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$props2 = this.props,
children = _this$props2.children,
name = _this$props2.name,
_this$props2$bubblesV = _this$props2.bubblesVirtually,
bubblesVirtually = _this$props2$bubblesV === void 0 ? false : _this$props2$bubblesV,
_this$props2$fillProp = _this$props2.fillProps,
fillProps = _this$props2$fillProp === void 0 ? {} : _this$props2$fillProp,
getFills = _this$props2.getFills,
className = _this$props2.className;
if (bubblesVirtually) {
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["createElement"])("div", {
ref: this.bindNode,
className: className
});
}
var fills = Object(lodash__WEBPACK_IMPORTED_MODULE_8__["map"])(getFills(name, this), function (fill) {
var fillKey = fill.occurrence;
var fillChildren = Object(lodash__WEBPACK_IMPORTED_MODULE_8__["isFunction"])(fill.children) ? fill.children(fillProps) : fill.children;
return _wordpress_element__WEBPACK_IMPORTED_MODULE_7__["Children"].map(fillChildren, function (child, childIndex) {
if (!child || Object(lodash__WEBPACK_IMPORTED_MODULE_8__["isString"])(child)) {
return child;
}
var childKey = "".concat(fillKey, "---").concat(child.key || childIndex);
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["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_8__["negate"])(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["isEmptyElement"]));
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["createElement"])(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["Fragment"], null, Object(lodash__WEBPACK_IMPORTED_MODULE_8__["isFunction"])(children) ? children(fills) : fills);
}
}]);
return SlotComponent;
}(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["Component"]);
var Slot = function Slot(props) {
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["createElement"])(_context__WEBPACK_IMPORTED_MODULE_9__["Consumer"], null, function (_ref) {
var registerSlot = _ref.registerSlot,
unregisterSlot = _ref.unregisterSlot,
getFills = _ref.getFills;
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["createElement"])(SlotComponent, Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, props, {
registerSlot: registerSlot,
unregisterSlot: unregisterSlot,
getFills: getFills
}));
});
};
/* harmony default export */ __webpack_exports__["default"] = (Slot);
/***/ }),
/***/ "./node_modules/@wordpress/components/build-module/snackbar/index.js":
/*!***************************************************************************!*\
!*** ./node_modules/@wordpress/components/build-module/snackbar/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 */ "./node_modules/@wordpress/element/build-module/index.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__);
/* 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_i18n__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/i18n */ "./node_modules/@wordpress/i18n/build-module/index.js");
/* harmony import */ var ___WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../ */ "./node_modules/@wordpress/components/build-module/index.js");
/**
* External dependencies
*/
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
var NOTICE_TIMEOUT = 10000;
function Snackbar(_ref, ref) {
var className = _ref.className,
children = _ref.children,
_ref$actions = _ref.actions,
actions = _ref$actions === void 0 ? [] : _ref$actions,
_ref$onRemove = _ref.onRemove,
onRemove = _ref$onRemove === void 0 ? lodash__WEBPACK_IMPORTED_MODULE_1__["noop"] : _ref$onRemove;
Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["useEffect"])(function () {
var timeoutHandle = setTimeout(function () {
onRemove();
}, NOTICE_TIMEOUT);
return function () {
return clearTimeout(timeoutHandle);
};
}, []);
var classes = classnames__WEBPACK_IMPORTED_MODULE_2___default()(className, 'components-snackbar');
if (actions && actions.length > 1) {
// we need to inform developers that snackbar only accepts 1 action
// eslint-disable-next-line no-console
console.warn('Snackbar can only have 1 action, use Notice if your message require many messages'); // return first element only while keeping it inside an array
actions = [actions[0]];
}
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("div", {
ref: ref,
className: classes,
onClick: onRemove,
tabIndex: "0",
role: "button",
onKeyPress: onRemove,
label: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__["__"])('Dismiss this notice')
}, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("div", {
className: "components-snackbar__content"
}, children, actions.map(function (_ref2, index) {
var label = _ref2.label,
_onClick = _ref2.onClick,
url = _ref2.url;
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(___WEBPACK_IMPORTED_MODULE_4__["Button"], {
key: index,
href: url,
isTertiary: true,
onClick: function onClick(event) {
event.stopPropagation();
if (_onClick) {
_onClick(event);
}
},
className: "components-snackbar__action"
}, label);
})));
}
/* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["forwardRef"])(Snackbar));
/***/ }),
/***/ "./node_modules/@wordpress/components/build-module/snackbar/list.js":
/*!**************************************************************************!*\
!*** ./node_modules/@wordpress/components/build-module/snackbar/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_regenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/regenerator */ "./node_modules/@babel/runtime/regenerator/index.js");
/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _babel_runtime_helpers_esm_asyncToGenerator__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/asyncToGenerator */ "./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js");
/* harmony import */ var _babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/esm/slicedToArray */ "./node_modules/@babel/runtime/helpers/esm/slicedToArray.js");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/element */ "./node_modules/@wordpress/element/build-module/index.js");
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! lodash */ "lodash");
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_6__);
/* harmony import */ var react_spring_web_cjs__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! react-spring/web.cjs */ "./node_modules/react-spring/web.cjs.js");
/* harmony import */ var react_spring_web_cjs__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(react_spring_web_cjs__WEBPACK_IMPORTED_MODULE_7__);
/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @wordpress/compose */ "./node_modules/@wordpress/compose/build-module/index.js");
/* harmony import */ var ___WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./ */ "./node_modules/@wordpress/components/build-module/snackbar/index.js");
/**
* External dependencies
*/
/**
* WordPress 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 SnackbarList(_ref) {
var notices = _ref.notices,
className = _ref.className,
children = _ref.children,
_ref$onRemove = _ref.onRemove,
onRemove = _ref$onRemove === void 0 ? lodash__WEBPACK_IMPORTED_MODULE_6__["noop"] : _ref$onRemove;
var isReducedMotion = Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_8__["useReducedMotion"])();
var _useState = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_4__["useState"])(function () {
return new WeakMap();
}),
_useState2 = Object(_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_3__["default"])(_useState, 1),
refMap = _useState2[0];
var transitions = Object(react_spring_web_cjs__WEBPACK_IMPORTED_MODULE_7__["useTransition"])(notices, function (notice) {
return notice.id;
}, {
from: {
opacity: 0,
height: 0
},
enter: function enter(item) {
return (
/*#__PURE__*/
function () {
var _ref2 = Object(_babel_runtime_helpers_esm_asyncToGenerator__WEBPACK_IMPORTED_MODULE_2__["default"])(
/*#__PURE__*/
_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.mark(function _callee(next) {
return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee$(_context) {
while (1) {
switch (_context.prev = _context.next) {
case 0:
_context.next = 2;
return next({
opacity: 1,
height: refMap.get(item).offsetHeight
});
case 2:
return _context.abrupt("return", _context.sent);
case 3:
case "end":
return _context.stop();
}
}
}, _callee);
}));
return function (_x) {
return _ref2.apply(this, arguments);
};
}()
);
},
leave: function leave() {
return (
/*#__PURE__*/
function () {
var _ref3 = Object(_babel_runtime_helpers_esm_asyncToGenerator__WEBPACK_IMPORTED_MODULE_2__["default"])(
/*#__PURE__*/
_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.mark(function _callee2(next) {
return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee2$(_context2) {
while (1) {
switch (_context2.prev = _context2.next) {
case 0:
_context2.next = 2;
return next({
opacity: 0
});
case 2:
_context2.next = 4;
return next({
height: 0
});
case 4:
case "end":
return _context2.stop();
}
}
}, _callee2);
}));
return function (_x2) {
return _ref3.apply(this, arguments);
};
}()
);
},
immediate: isReducedMotion
});
className = classnames__WEBPACK_IMPORTED_MODULE_5___default()('components-snackbar-list', className);
var removeNotice = function removeNotice(notice) {
return function () {
return onRemove(notice.id);
};
};
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_4__["createElement"])("div", {
className: className
}, children, transitions.map(function (_ref4) {
var notice = _ref4.item,
key = _ref4.key,
style = _ref4.props;
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_4__["createElement"])(react_spring_web_cjs__WEBPACK_IMPORTED_MODULE_7__["animated"].div, {
key: key,
style: style
}, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_4__["createElement"])("div", {
className: "components-snackbar-list__notice-container",
ref: function ref(_ref5) {
return _ref5 && refMap.set(notice, _ref5);
}
}, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_4__["createElement"])(___WEBPACK_IMPORTED_MODULE_9__["default"], Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, Object(lodash__WEBPACK_IMPORTED_MODULE_6__["omit"])(notice, ['content']), {
onRemove: removeNotice(notice)
}), notice.content)));
}));
}
/* harmony default export */ __webpack_exports__["default"] = (SnackbarList);
/***/ }),
/***/ "./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 export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Spinner; });
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "./node_modules/@wordpress/element/build-module/index.js");
function Spinner() {
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_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_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_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_extends__WEBPACK_IMPORTED_MODULE_7__ = __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_8__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutProperties */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @wordpress/element */ "./node_modules/@wordpress/element/build-module/index.js");
/* 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_compose__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @wordpress/compose */ "./node_modules/@wordpress/compose/build-module/index.js");
/* harmony import */ var _navigable_container__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../navigable-container */ "./node_modules/@wordpress/components/build-module/navigable-container/index.js");
/* harmony import */ var _button__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../button */ "./node_modules/@wordpress/components/build-module/button/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_8__["default"])(_ref, ["tabId", "onClick", "children", "selected"]);
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_9__["createElement"])(_button__WEBPACK_IMPORTED_MODULE_14__["default"], Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_7__["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_6__["default"])(TabPanel, _Component);
function TabPanel() {
var _this;
Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_1__["default"])(this, TabPanel);
_this = Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__["default"])(this, Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__["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"])(_this));
_this.onNavigate = _this.onNavigate.bind(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_2__["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_11__["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_11__["find"])(tabs, {
name: selected
});
var selectedId = instanceId + '-' + selectedTab.name;
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_9__["createElement"])("div", {
className: className
}, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_9__["createElement"])(_navigable_container__WEBPACK_IMPORTED_MODULE_13__["NavigableMenu"], {
role: "tablist",
orientation: orientation,
onNavigate: this.onNavigate,
className: "components-tab-panel__tabs"
}, tabs.map(function (tab) {
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_9__["createElement"])(TabButton, {
className: classnames__WEBPACK_IMPORTED_MODULE_10___default()(tab.className, Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__["default"])({}, activeClass, tab.name === selected)),
tabId: instanceId + '-' + tab.name,
"aria-controls": instanceId + '-' + tab.name + '-view',
selected: tab.name === selected,
key: tab.name,
onClick: Object(lodash__WEBPACK_IMPORTED_MODULE_11__["partial"])(_this2.handleClick, tab.name)
}, tab.title);
})), selectedTab && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_9__["createElement"])("div", {
"aria-labelledby": selectedId,
role: "tabpanel",
id: selectedId + '-view',
className: "components-tab-panel__tab-content",
tabIndex: "0"
}, this.props.children(selectedTab)));
}
}]);
return TabPanel;
}(_wordpress_element__WEBPACK_IMPORTED_MODULE_9__["Component"]);
/* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_12__["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 */ "./node_modules/@wordpress/element/build-module/index.js");
/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/compose */ "./node_modules/@wordpress/compose/build-module/index.js");
/* 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,
hideLabelFromVision = _ref.hideLabelFromVision,
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", "hideLabelFromVision", "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,
hideLabelFromVision: hideLabelFromVision,
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 */ "./node_modules/@wordpress/element/build-module/index.js");
/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/compose */ "./node_modules/@wordpress/compose/build-module/index.js");
/* 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,
hideLabelFromVision = _ref.hideLabelFromVision,
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", "hideLabelFromVision", "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,
hideLabelFromVision: hideLabelFromVision,
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/tip/index.js":
/*!**********************************************************************!*\
!*** ./node_modules/@wordpress/components/build-module/tip/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 */ "./node_modules/@wordpress/element/build-module/index.js");
/* harmony import */ var ___WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../ */ "./node_modules/@wordpress/components/build-module/index.js");
/**
* Internal dependencies
*/
function Tip(props) {
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("div", {
className: "components-tip"
}, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(___WEBPACK_IMPORTED_MODULE_1__["SVG"], {
width: "24",
height: "24",
viewBox: "0 0 24 24"
}, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(___WEBPACK_IMPORTED_MODULE_1__["Path"], {
d: "M20.45 4.91L19.04 3.5l-1.79 1.8 1.41 1.41 1.79-1.8zM13 4h-2V1h2v3zm10 9h-3v-2h3v2zm-12 6.95v-3.96l-1-.58c-1.24-.72-2-2.04-2-3.46 0-2.21 1.79-4 4-4s4 1.79 4 4c0 1.42-.77 2.74-2 3.46l-1 .58v3.96h-2zm-2 2h6v-4.81c1.79-1.04 3-2.97 3-5.19 0-3.31-2.69-6-6-6s-6 2.69-6 6c0 2.22 1.21 4.15 3 5.19v4.81zM4 13H1v-2h3v2zm2.76-7.71l-1.79-1.8L3.56 4.9l1.8 1.79 1.4-1.4z"
})), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("p", null, props.children));
}
/* harmony default export */ __webpack_exports__["default"] = (Tip);
/***/ }),
/***/ "./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_assertThisInitialized__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/esm/assertThisInitialized */ "./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.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 _wordpress_element__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @wordpress/element */ "./node_modules/@wordpress/element/build-module/index.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 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 */ "./node_modules/@wordpress/compose/build-module/index.js");
/* harmony import */ var _form_toggle__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../form-toggle */ "./node_modules/@wordpress/components/build-module/form-toggle/index.js");
/* harmony import */ var _base_control__WEBPACK_IMPORTED_MODULE_11__ = __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_5__["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_4__["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,
className = _this$props.className;
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_11__["default"], {
id: id,
help: helpLabel,
className: classnames__WEBPACK_IMPORTED_MODULE_8___default()('components-toggle-control', className)
}, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(_form_toggle__WEBPACK_IMPORTED_MODULE_10__["default"], {
id: id,
checked: checked,
onChange: this.onChange,
"aria-describedby": describedBy
}), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("label", {
htmlFor: id,
className: "components-toggle-control__label"
}, label));
}
}]);
return ToggleControl;
}(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["Component"]);
/* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_9__["withInstanceId"])(ToggleControl));
/***/ }),
/***/ "./node_modules/@wordpress/components/build-module/toolbar-button/index.js":
/*!*********************************************************************************!*\
!*** ./node_modules/@wordpress/components/build-module/toolbar-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 _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/element */ "./node_modules/@wordpress/element/build-module/index.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 _icon_button__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../icon-button */ "./node_modules/@wordpress/components/build-module/icon-button/index.js");
/* harmony import */ var _toolbar_button_container__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./toolbar-button-container */ "./node_modules/@wordpress/components/build-module/toolbar-button/toolbar-button-container.js");
/**
* External dependencies
*/
/**
* Internal dependencies
*/
function ToolbarButton(_ref) {
var containerClassName = _ref.containerClassName,
icon = _ref.icon,
title = _ref.title,
shortcut = _ref.shortcut,
subscript = _ref.subscript,
_onClick = _ref.onClick,
className = _ref.className,
isActive = _ref.isActive,
isDisabled = _ref.isDisabled,
extraProps = _ref.extraProps,
children = _ref.children;
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])(_toolbar_button_container__WEBPACK_IMPORTED_MODULE_4__["default"], {
className: containerClassName
}, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])(_icon_button__WEBPACK_IMPORTED_MODULE_3__["default"], Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({
icon: icon,
label: title,
shortcut: shortcut,
"data-subscript": subscript,
onClick: function onClick(event) {
event.stopPropagation();
_onClick();
},
className: classnames__WEBPACK_IMPORTED_MODULE_2___default()('components-toolbar__control', className, {
'is-active': isActive
}),
"aria-pressed": isActive,
disabled: isDisabled
}, extraProps)), children);
}
/* harmony default export */ __webpack_exports__["default"] = (ToolbarButton);
/***/ }),
/***/ "./node_modules/@wordpress/components/build-module/toolbar-button/toolbar-button-container.js":
/*!****************************************************************************************************!*\
!*** ./node_modules/@wordpress/components/build-module/toolbar-button/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 */ "./node_modules/@wordpress/element/build-module/index.js");
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/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 _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 */ "./node_modules/@wordpress/element/build-module/index.js");
/* 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 _toolbar_button__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../toolbar-button */ "./node_modules/@wordpress/components/build-module/toolbar-button/index.js");
/* harmony import */ var _dropdown_menu__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../dropdown-menu */ "./node_modules/@wordpress/components/build-module/dropdown-menu/index.js");
/* harmony import */ var _toolbar_container__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./toolbar-container */ "./node_modules/@wordpress/components/build-module/toolbar/toolbar-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 {Object} props
* @param {Array} [props.controls] The controls to render in this toolbar.
* @param {ReactElement} [props.children] Any other things to render inside the
* toolbar besides the controls.
* @param {string} [props.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,
otherProps = Object(_babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__["default"])(_ref, ["controls", "children", "className", "isCollapsed", "icon", "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_2__["createElement"])(_dropdown_menu__WEBPACK_IMPORTED_MODULE_6__["default"], {
hasArrowIndicator: true,
icon: icon,
label: label,
controls: controlSets,
className: classnames__WEBPACK_IMPORTED_MODULE_3___default()('components-toolbar', className)
});
}
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["createElement"])(_toolbar_container__WEBPACK_IMPORTED_MODULE_7__["default"], Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({
className: classnames__WEBPACK_IMPORTED_MODULE_3___default()('components-toolbar', className)
}, otherProps), Object(lodash__WEBPACK_IMPORTED_MODULE_4__["flatMap"])(controlSets, function (controlSet, indexOfSet) {
return controlSet.map(function (control, indexOfControl) {
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["createElement"])(_toolbar_button__WEBPACK_IMPORTED_MODULE_5__["default"], Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({
key: [indexOfSet, indexOfControl].join(),
containerClassName: indexOfSet > 0 && indexOfControl === 0 ? 'has-left-divider' : null
}, control));
});
}), children);
}
/* harmony default export */ __webpack_exports__["default"] = (Toolbar);
/***/ }),
/***/ "./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 */ "./node_modules/@wordpress/element/build-module/index.js");
var ToolbarContainer = function ToolbarContainer(props) {
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("div", {
className: 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_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 */ "./node_modules/@wordpress/element/build-module/index.js");
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! lodash */ "lodash");
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_6__);
/* harmony import */ var _popover__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../popover */ "./node_modules/@wordpress/components/build-module/popover/index.js");
/* harmony import */ var _shortcut__WEBPACK_IMPORTED_MODULE_8__ = __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_4__["default"])(Tooltip, _Component);
function Tooltip() {
var _this;
Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__["default"])(this, Tooltip);
_this = Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__["default"])(this, Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__["default"])(Tooltip).apply(this, arguments));
_this.delayedSetIsOver = Object(lodash__WEBPACK_IMPORTED_MODULE_6__["debounce"])(function (isOver) {
return _this.setState({
isOver: isOver
});
}, TOOLTIP_DELAY);
/**
* Prebound `isInMouseDown` handler, created as a constant reference to
* assure ability to remove in component unmount.
*
* @type {Function}
*/
_this.cancelIsMouseDown = _this.createSetIsMouseDown(false);
/**
* Whether a the mouse is currently pressed, used in determining whether
* to handle a focus event as displaying the tooltip immediately.
*
* @type {boolean}
*/
_this.isInMouseDown = false;
_this.state = {
isOver: false
};
return _this;
}
Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__["default"])(Tooltip, [{
key: "componentWillUnmount",
value: function componentWillUnmount() {
this.delayedSetIsOver.cancel();
document.removeEventListener('mouseup', this.cancelIsMouseDown);
}
}, {
key: "emitToChild",
value: function emitToChild(eventName, event) {
var children = this.props.children;
if (_wordpress_element__WEBPACK_IMPORTED_MODULE_5__["Children"].count(children) !== 1) {
return;
}
var child = _wordpress_element__WEBPACK_IMPORTED_MODULE_5__["Children"].only(children);
if (typeof child.props[eventName] === 'function') {
child.props[eventName](event);
}
}
}, {
key: "createToggleIsOver",
value: function createToggleIsOver(eventName, isDelayed) {
var _this2 = this;
return function (event) {
// Preserve original child callback behavior
_this2.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;
} // A focus event will occur as a result of a mouse click, but it
// should be disambiguated between interacting with the button and
// using an explicit focus shift as a cue to display the tooltip.
if ('focus' === event.type && _this2.isInMouseDown) {
return;
} // Needed in case unsetting is over while delayed set pending, i.e.
// quickly blur/mouseleave before delayedSetIsOver is called
_this2.delayedSetIsOver.cancel();
var isOver = Object(lodash__WEBPACK_IMPORTED_MODULE_6__["includes"])(['focus', 'mouseenter'], event.type);
if (isOver === _this2.state.isOver) {
return;
}
if (isDelayed) {
_this2.delayedSetIsOver(isOver);
} else {
_this2.setState({
isOver: isOver
});
}
};
}
/**
* Creates an event callback to handle assignment of the `isInMouseDown`
* instance property in response to a `mousedown` or `mouseup` event.
*
* @param {boolean} isMouseDown Whether handler is to be created for the
* `mousedown` event, as opposed to `mouseup`.
*
* @return {Function} Event callback handler.
*/
}, {
key: "createSetIsMouseDown",
value: function createSetIsMouseDown(isMouseDown) {
var _this3 = this;
return function (event) {
// Preserve original child callback behavior
_this3.emitToChild(isMouseDown ? 'onMouseDown' : 'onMouseUp', event); // On mouse down, the next `mouseup` should revert the value of the
// instance property and remove its own event handler. The bind is
// made on the document since the `mouseup` might not occur within
// the bounds of the element.
document[isMouseDown ? 'addEventListener' : 'removeEventListener']('mouseup', _this3.cancelIsMouseDown);
_this3.isInMouseDown = isMouseDown;
};
}
}, {
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_5__["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_5__["Children"].only(children);
var isOver = this.state.isOver;
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_5__["cloneElement"])(child, {
onMouseEnter: this.createToggleIsOver('onMouseEnter', true),
onMouseLeave: this.createToggleIsOver('onMouseLeave'),
onClick: this.createToggleIsOver('onClick'),
onFocus: this.createToggleIsOver('onFocus'),
onBlur: this.createToggleIsOver('onBlur'),
onMouseDown: this.createSetIsMouseDown(true),
children: Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_5__["concatChildren"])(child.props.children, isOver && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_5__["createElement"])(_popover__WEBPACK_IMPORTED_MODULE_7__["default"], {
focusOnMount: false,
position: position,
className: "components-tooltip",
"aria-hidden": "true",
animate: false
}, text, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_5__["createElement"])(_shortcut__WEBPACK_IMPORTED_MODULE_8__["default"], {
className: "components-tooltip__shortcut",
shortcut: shortcut
})))
});
}
}]);
return Tooltip;
}(_wordpress_element__WEBPACK_IMPORTED_MODULE_5__["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 */ "./node_modules/@wordpress/element/build-module/index.js");
/* 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/@wordpress/compose/build-module/higher-order/if-condition/index.js":
/*!*****************************************************************************************!*\
!*** ./node_modules/@wordpress/compose/build-module/higher-order/if-condition/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 */ "./node_modules/@wordpress/element/build-module/index.js");
/* harmony import */ var _utils_create_higher_order_component__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../utils/create-higher-order-component */ "./node_modules/@wordpress/compose/build-module/utils/create-higher-order-component/index.js");
/**
* Internal dependencies
*/
/**
* Higher-order component creator, creating a new component which renders if
* the given condition is satisfied or with the given optional prop name.
*
* @param {Function} predicate Function to test condition.
*
* @return {Function} Higher-order component.
*/
var ifCondition = function ifCondition(predicate) {
return Object(_utils_create_higher_order_component__WEBPACK_IMPORTED_MODULE_1__["default"])(function (WrappedComponent) {
return function (props) {
if (!predicate(props)) {
return null;
}
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(WrappedComponent, props);
};
}, 'ifCondition');
};
/* harmony default export */ __webpack_exports__["default"] = (ifCondition);
/***/ }),
/***/ "./node_modules/@wordpress/compose/build-module/higher-order/pure/index.js":
/*!*********************************************************************************!*\
!*** ./node_modules/@wordpress/compose/build-module/higher-order/pure/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 */ "./node_modules/@wordpress/element/build-module/index.js");
/* harmony import */ var _wordpress_is_shallow_equal__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @wordpress/is-shallow-equal */ "./node_modules/@wordpress/is-shallow-equal/index.js");
/* harmony import */ var _wordpress_is_shallow_equal__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_wordpress_is_shallow_equal__WEBPACK_IMPORTED_MODULE_6__);
/* harmony import */ var _utils_create_higher_order_component__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../utils/create-higher-order-component */ "./node_modules/@wordpress/compose/build-module/utils/create-higher-order-component/index.js");
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
/**
* Given a component returns the enhanced component augmented with a component
* only rerendering when its props/state change
*
* @param {Function} mapComponentToEnhancedComponent Function mapping component
* to enhanced component.
* @param {string} modifierName Seed name from which to
* generated display name.
*
* @return {WPComponent} Component class with generated display name assigned.
*/
var pure = Object(_utils_create_higher_order_component__WEBPACK_IMPORTED_MODULE_7__["default"])(function (Wrapped) {
if (Wrapped.prototype instanceof _wordpress_element__WEBPACK_IMPORTED_MODULE_5__["Component"]) {
return (
/*#__PURE__*/
function (_Wrapped) {
Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__["default"])(_class, _Wrapped);
function _class() {
Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__["default"])(this, _class);
return 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));
}
Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__["default"])(_class, [{
key: "shouldComponentUpdate",
value: function shouldComponentUpdate(nextProps, nextState) {
return !_wordpress_is_shallow_equal__WEBPACK_IMPORTED_MODULE_6___default()(nextProps, this.props) || !_wordpress_is_shallow_equal__WEBPACK_IMPORTED_MODULE_6___default()(nextState, this.state);
}
}]);
return _class;
}(Wrapped)
);
}
return (
/*#__PURE__*/
function (_Component) {
Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__["default"])(_class2, _Component);
function _class2() {
Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__["default"])(this, _class2);
return Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__["default"])(this, Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__["default"])(_class2).apply(this, arguments));
}
Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__["default"])(_class2, [{
key: "shouldComponentUpdate",
value: function shouldComponentUpdate(nextProps) {
return !_wordpress_is_shallow_equal__WEBPACK_IMPORTED_MODULE_6___default()(nextProps, this.props);
}
}, {
key: "render",
value: function render() {
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_5__["createElement"])(Wrapped, this.props);
}
}]);
return _class2;
}(_wordpress_element__WEBPACK_IMPORTED_MODULE_5__["Component"])
);
}, 'pure');
/* harmony default export */ __webpack_exports__["default"] = (pure);
/***/ }),
/***/ "./node_modules/@wordpress/compose/build-module/higher-order/with-global-events/index.js":
/*!***********************************************************************************************!*\
!*** ./node_modules/@wordpress/compose/build-module/higher-order/with-global-events/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_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_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 */ "./node_modules/@wordpress/element/build-module/index.js");
/* 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 _utils_create_higher_order_component__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../utils/create-higher-order-component */ "./node_modules/@wordpress/compose/build-module/utils/create-higher-order-component/index.js");
/* harmony import */ var _listener__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./listener */ "./node_modules/@wordpress/compose/build-module/higher-order/with-global-events/listener.js");
/**
* External dependencies
*/
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
/**
* Listener instance responsible for managing document event handling.
*
* @type {Listener}
*/
var listener = new _listener__WEBPACK_IMPORTED_MODULE_10__["default"]();
/**
* Higher-order component creator which, given an object of DOM event types and
* values corresponding to a callback function name on the component, will
* create or update a window event handler to invoke the callback when an event
* occurs. On behalf of the consuming developer, the higher-order component
* manages unbinding when the component unmounts, and binding at most a single
* event handler for the entire application.
*
* @param {Object<string,string>} eventTypesToHandlers Object with keys of DOM
* event type, the value a
* name of the function on
* the original component's
* instance which handles
* the event.
*
* @return {Function} Higher-order component.
*/
function withGlobalEvents(eventTypesToHandlers) {
return Object(_utils_create_higher_order_component__WEBPACK_IMPORTED_MODULE_9__["default"])(function (WrappedComponent) {
var Wrapper =
/*#__PURE__*/
function (_Component) {
Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_6__["default"])(Wrapper, _Component);
function Wrapper() {
var _this;
Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_1__["default"])(this, Wrapper);
_this = Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__["default"])(this, Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__["default"])(Wrapper).apply(this, arguments));
_this.handleEvent = _this.handleEvent.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(_this));
_this.handleRef = _this.handleRef.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(_this));
return _this;
}
Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_2__["default"])(Wrapper, [{
key: "componentDidMount",
value: function componentDidMount() {
var _this2 = this;
Object(lodash__WEBPACK_IMPORTED_MODULE_8__["forEach"])(eventTypesToHandlers, function (handler, eventType) {
listener.add(eventType, _this2);
});
}
}, {
key: "componentWillUnmount",
value: function componentWillUnmount() {
var _this3 = this;
Object(lodash__WEBPACK_IMPORTED_MODULE_8__["forEach"])(eventTypesToHandlers, function (handler, eventType) {
listener.remove(eventType, _this3);
});
}
}, {
key: "handleEvent",
value: function handleEvent(event) {
var handler = eventTypesToHandlers[event.type];
if (typeof this.wrappedRef[handler] === 'function') {
this.wrappedRef[handler](event);
}
}
}, {
key: "handleRef",
value: function handleRef(el) {
this.wrappedRef = el; // Any component using `withGlobalEvents` that is not setting a `ref`
// will cause `this.props.forwardedRef` to be `null`, so we need this
// check.
if (this.props.forwardedRef) {
this.props.forwardedRef(el);
}
}
}, {
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.ownProps, {
ref: this.handleRef
}));
}
}]);
return Wrapper;
}(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["Component"]);
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["forwardRef"])(function (props, ref) {
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["createElement"])(Wrapper, {
ownProps: props,
forwardedRef: ref
});
});
}, 'withGlobalEvents');
}
/* harmony default export */ __webpack_exports__["default"] = (withGlobalEvents);
/***/ }),
/***/ "./node_modules/@wordpress/compose/build-module/higher-order/with-global-events/listener.js":
/*!**************************************************************************************************!*\
!*** ./node_modules/@wordpress/compose/build-module/higher-order/with-global-events/listener.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 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__);
/**
* External dependencies
*/
/**
* Class responsible for orchestrating event handling on the global window,
* binding a single event to be shared across all handling instances, and
* removing the handler when no instances are listening for the event.
*/
var Listener =
/*#__PURE__*/
function () {
function Listener() {
Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__["default"])(this, Listener);
this.listeners = {};
this.handleEvent = this.handleEvent.bind(this);
}
Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__["default"])(Listener, [{
key: "add",
value: function add(eventType, instance) {
if (!this.listeners[eventType]) {
// Adding first listener for this type, so bind event.
window.addEventListener(eventType, this.handleEvent);
this.listeners[eventType] = [];
}
this.listeners[eventType].push(instance);
}
}, {
key: "remove",
value: function remove(eventType, instance) {
this.listeners[eventType] = Object(lodash__WEBPACK_IMPORTED_MODULE_2__["without"])(this.listeners[eventType], instance);
if (!this.listeners[eventType].length) {
// Removing last listener for this type, so unbind event.
window.removeEventListener(eventType, this.handleEvent);
delete this.listeners[eventType];
}
}
}, {
key: "handleEvent",
value: function handleEvent(event) {
Object(lodash__WEBPACK_IMPORTED_MODULE_2__["forEach"])(this.listeners[event.type], function (instance) {
instance.handleEvent(event);
});
}
}]);
return Listener;
}();
/* harmony default export */ __webpack_exports__["default"] = (Listener);
/***/ }),
/***/ "./node_modules/@wordpress/compose/build-module/higher-order/with-instance-id/index.js":
/*!*********************************************************************************************!*\
!*** ./node_modules/@wordpress/compose/build-module/higher-order/with-instance-id/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 _wordpress_element__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @wordpress/element */ "./node_modules/@wordpress/element/build-module/index.js");
/* harmony import */ var _utils_create_higher_order_component__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../utils/create-higher-order-component */ "./node_modules/@wordpress/compose/build-module/utils/create-higher-order-component/index.js");
/**
* WordPress dependencies
*/
/**
* Internal 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(_utils_create_higher_order_component__WEBPACK_IMPORTED_MODULE_7__["default"])(function (WrappedComponent) {
var instances = 0;
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.instanceId = instances++;
return _this;
}
Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_2__["default"])(_class, [{
key: "render",
value: function render() {
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(WrappedComponent, Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, this.props, {
instanceId: this.instanceId
}));
}
}]);
return _class;
}(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["Component"])
);
}, 'withInstanceId'));
/***/ }),
/***/ "./node_modules/@wordpress/compose/build-module/higher-order/with-safe-timeout/index.js":
/*!**********************************************************************************************!*\
!*** ./node_modules/@wordpress/compose/build-module/higher-order/with-safe-timeout/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_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_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 */ "./node_modules/@wordpress/element/build-module/index.js");
/* 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 _utils_create_higher_order_component__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../utils/create-higher-order-component */ "./node_modules/@wordpress/compose/build-module/utils/create-higher-order-component/index.js");
/**
* External dependencies
*/
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
/**
* A higher-order component used to provide and manage delayed function calls
* that ought to be bound to a component's lifecycle.
*
* @param {Component} OriginalComponent Component requiring setTimeout
*
* @return {Component} Wrapped component.
*/
var withSafeTimeout = Object(_utils_create_higher_order_component__WEBPACK_IMPORTED_MODULE_9__["default"])(function (OriginalComponent) {
return (
/*#__PURE__*/
function (_Component) {
Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_6__["default"])(WrappedComponent, _Component);
function WrappedComponent() {
var _this;
Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_1__["default"])(this, WrappedComponent);
_this = Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__["default"])(this, Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__["default"])(WrappedComponent).apply(this, arguments));
_this.timeouts = [];
_this.setTimeout = _this.setTimeout.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(_this));
_this.clearTimeout = _this.clearTimeout.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(_this));
return _this;
}
Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_2__["default"])(WrappedComponent, [{
key: "componentWillUnmount",
value: function componentWillUnmount() {
this.timeouts.forEach(clearTimeout);
}
}, {
key: "setTimeout",
value: function (_setTimeout) {
function setTimeout(_x, _x2) {
return _setTimeout.apply(this, arguments);
}
setTimeout.toString = function () {
return _setTimeout.toString();
};
return setTimeout;
}(function (fn, delay) {
var _this2 = this;
var id = setTimeout(function () {
fn();
_this2.clearTimeout(id);
}, delay);
this.timeouts.push(id);
return id;
})
}, {
key: "clearTimeout",
value: function (_clearTimeout) {
function clearTimeout(_x3) {
return _clearTimeout.apply(this, arguments);
}
clearTimeout.toString = function () {
return _clearTimeout.toString();
};
return clearTimeout;
}(function (id) {
clearTimeout(id);
this.timeouts = Object(lodash__WEBPACK_IMPORTED_MODULE_8__["without"])(this.timeouts, id);
})
}, {
key: "render",
value: function render() {
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["createElement"])(OriginalComponent, Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, this.props, {
setTimeout: this.setTimeout,
clearTimeout: this.clearTimeout
}));
}
}]);
return WrappedComponent;
}(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["Component"])
);
}, 'withSafeTimeout');
/* harmony default export */ __webpack_exports__["default"] = (withSafeTimeout);
/***/ }),
/***/ "./node_modules/@wordpress/compose/build-module/higher-order/with-state/index.js":
/*!***************************************************************************************!*\
!*** ./node_modules/@wordpress/compose/build-module/higher-order/with-state/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 withState; });
/* 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_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_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 */ "./node_modules/@wordpress/element/build-module/index.js");
/* harmony import */ var _utils_create_higher_order_component__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../utils/create-higher-order-component */ "./node_modules/@wordpress/compose/build-module/utils/create-higher-order-component/index.js");
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
/**
* A Higher Order Component used to provide and manage internal component state
* via props.
*
* @param {?Object} initialState Optional initial state of the component.
*
* @return {Component} Wrapped component.
*/
function withState() {
var initialState = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
return Object(_utils_create_higher_order_component__WEBPACK_IMPORTED_MODULE_8__["default"])(function (OriginalComponent) {
return (
/*#__PURE__*/
function (_Component) {
Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_6__["default"])(WrappedComponent, _Component);
function WrappedComponent() {
var _this;
Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_1__["default"])(this, WrappedComponent);
_this = Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__["default"])(this, Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__["default"])(WrappedComponent).apply(this, arguments));
_this.setState = _this.setState.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(_this));
_this.state = initialState;
return _this;
}
Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_2__["default"])(WrappedComponent, [{
key: "render",
value: function render() {
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["createElement"])(OriginalComponent, Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, this.props, this.state, {
setState: this.setState
}));
}
}]);
return WrappedComponent;
}(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["Component"])
);
}, 'withState');
}
/***/ }),
/***/ "./node_modules/@wordpress/compose/build-module/hooks/use-media-query/index.js":
/*!*************************************************************************************!*\
!*** ./node_modules/@wordpress/compose/build-module/hooks/use-media-query/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 useMediaQuery; });
/* 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 */ "./node_modules/@wordpress/element/build-module/index.js");
/**
* WordPress dependencies
*/
/**
* Runs a media query and returns its value when it changes.
*
* @param {string} query Media Query.
* @return {boolean} return value of the media query.
*/
function useMediaQuery(query) {
var _useState = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["useState"])(false),
_useState2 = Object(_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_0__["default"])(_useState, 2),
match = _useState2[0],
setMatch = _useState2[1];
Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["useEffect"])(function () {
var updateMatch = function updateMatch() {
return setMatch(window.matchMedia(query).matches);
};
updateMatch();
var list = window.matchMedia(query);
list.addListener(updateMatch);
return function () {
list.removeListener(updateMatch);
};
}, [query]);
return match;
}
/***/ }),
/***/ "./node_modules/@wordpress/compose/build-module/hooks/use-reduced-motion/index.js":
/*!****************************************************************************************!*\
!*** ./node_modules/@wordpress/compose/build-module/hooks/use-reduced-motion/index.js ***!
\****************************************************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* WEBPACK VAR INJECTION */(function(process) {/* harmony import */ var _use_media_query__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../use-media-query */ "./node_modules/@wordpress/compose/build-module/hooks/use-media-query/index.js");
/**
* Internal dependencies
*/
/**
* Whether or not the user agent is Internet Explorer.
*
* @type {boolean}
*/
var IS_IE = window.navigator.userAgent.indexOf('Trident') >= 0;
/**
* Hook returning whether the user has a preference for reduced motion.
*
* @return {boolean} Reduced motion preference value.
*/
var useReducedMotion = process.env.FORCE_REDUCED_MOTION || IS_IE ? function () {
return true;
} : function () {
return Object(_use_media_query__WEBPACK_IMPORTED_MODULE_0__["default"])('(prefers-reduced-motion: reduce)');
};
/* harmony default export */ __webpack_exports__["default"] = (useReducedMotion);
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../process/browser.js */ "./node_modules/process/browser.js")))
/***/ }),
/***/ "./node_modules/@wordpress/compose/build-module/index.js":
/*!***************************************************************!*\
!*** ./node_modules/@wordpress/compose/build-module/index.js ***!
\***************************************************************/
/*! exports provided: createHigherOrderComponent, compose, ifCondition, pure, withGlobalEvents, withInstanceId, withSafeTimeout, withState, useMediaQuery, useReducedMotion */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* 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__);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "compose", function() { return lodash__WEBPACK_IMPORTED_MODULE_0__["flowRight"]; });
/* harmony import */ var _utils_create_higher_order_component__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./utils/create-higher-order-component */ "./node_modules/@wordpress/compose/build-module/utils/create-higher-order-component/index.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "createHigherOrderComponent", function() { return _utils_create_higher_order_component__WEBPACK_IMPORTED_MODULE_1__["default"]; });
/* harmony import */ var _higher_order_if_condition__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./higher-order/if-condition */ "./node_modules/@wordpress/compose/build-module/higher-order/if-condition/index.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ifCondition", function() { return _higher_order_if_condition__WEBPACK_IMPORTED_MODULE_2__["default"]; });
/* harmony import */ var _higher_order_pure__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./higher-order/pure */ "./node_modules/@wordpress/compose/build-module/higher-order/pure/index.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "pure", function() { return _higher_order_pure__WEBPACK_IMPORTED_MODULE_3__["default"]; });
/* harmony import */ var _higher_order_with_global_events__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./higher-order/with-global-events */ "./node_modules/@wordpress/compose/build-module/higher-order/with-global-events/index.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "withGlobalEvents", function() { return _higher_order_with_global_events__WEBPACK_IMPORTED_MODULE_4__["default"]; });
/* harmony import */ var _higher_order_with_instance_id__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./higher-order/with-instance-id */ "./node_modules/@wordpress/compose/build-module/higher-order/with-instance-id/index.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "withInstanceId", function() { return _higher_order_with_instance_id__WEBPACK_IMPORTED_MODULE_5__["default"]; });
/* harmony import */ var _higher_order_with_safe_timeout__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./higher-order/with-safe-timeout */ "./node_modules/@wordpress/compose/build-module/higher-order/with-safe-timeout/index.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "withSafeTimeout", function() { return _higher_order_with_safe_timeout__WEBPACK_IMPORTED_MODULE_6__["default"]; });
/* harmony import */ var _higher_order_with_state__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./higher-order/with-state */ "./node_modules/@wordpress/compose/build-module/higher-order/with-state/index.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "withState", function() { return _higher_order_with_state__WEBPACK_IMPORTED_MODULE_7__["default"]; });
/* harmony import */ var _hooks_use_media_query__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./hooks/use-media-query */ "./node_modules/@wordpress/compose/build-module/hooks/use-media-query/index.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "useMediaQuery", function() { return _hooks_use_media_query__WEBPACK_IMPORTED_MODULE_8__["default"]; });
/* harmony import */ var _hooks_use_reduced_motion__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./hooks/use-reduced-motion */ "./node_modules/@wordpress/compose/build-module/hooks/use-reduced-motion/index.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "useReducedMotion", function() { return _hooks_use_reduced_motion__WEBPACK_IMPORTED_MODULE_9__["default"]; });
/**
* External dependencies
*/
// Utils
/**
* Composes multiple higher-order components into a single higher-order component. Performs right-to-left function
* composition, where each successive invocation is supplied the return value of the previous.
*
* @param {...Function} hocs The HOC functions to invoke.
*
* @return {Function} Returns the new composite function.
*/
// Higher-order components
// Hooks
/***/ }),
/***/ "./node_modules/@wordpress/compose/build-module/utils/create-higher-order-component/index.js":
/*!***************************************************************************************************!*\
!*** ./node_modules/@wordpress/compose/build-module/utils/create-higher-order-component/index.js ***!
\***************************************************************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* 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
*/
/**
* Given a function mapping a component to an enhanced component and modifier
* name, returns the enhanced component augmented with a generated displayName.
*
* @param {Function} mapComponentToEnhancedComponent Function mapping component
* to enhanced component.
* @param {string} modifierName Seed name from which to
* generated display name.
*
* @return {WPComponent} Component class with generated display name assigned.
*/
function createHigherOrderComponent(mapComponentToEnhancedComponent, modifierName) {
return function (OriginalComponent) {
var EnhancedComponent = mapComponentToEnhancedComponent(OriginalComponent);
var _OriginalComponent$di = OriginalComponent.displayName,
displayName = _OriginalComponent$di === void 0 ? OriginalComponent.name || 'Component' : _OriginalComponent$di;
EnhancedComponent.displayName = "".concat(Object(lodash__WEBPACK_IMPORTED_MODULE_0__["upperFirst"])(Object(lodash__WEBPACK_IMPORTED_MODULE_0__["camelCase"])(modifierName)), "(").concat(displayName, ")");
return EnhancedComponent;
};
}
/* harmony default export */ __webpack_exports__["default"] = (createHigherOrderComponent);
/***/ }),
/***/ "./node_modules/@wordpress/data/build-module/components/async-mode-provider/context.js":
/*!*********************************************************************************************!*\
!*** ./node_modules/@wordpress/data/build-module/components/async-mode-provider/context.js ***!
\*********************************************************************************************/
/*! exports provided: Context, AsyncModeConsumer, default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Context", function() { return Context; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AsyncModeConsumer", function() { return AsyncModeConsumer; });
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "./node_modules/@wordpress/element/build-module/index.js");
/**
* WordPress dependencies
*/
var Context = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createContext"])(false);
var Consumer = Context.Consumer,
Provider = Context.Provider;
var AsyncModeConsumer = Consumer;
/* harmony default export */ __webpack_exports__["default"] = (Provider);
/***/ }),
/***/ "./node_modules/@wordpress/data/build-module/components/async-mode-provider/index.js":
/*!*******************************************************************************************!*\
!*** ./node_modules/@wordpress/data/build-module/components/async-mode-provider/index.js ***!
\*******************************************************************************************/
/*! exports provided: useAsyncMode, AsyncModeProvider, AsyncModeConsumer */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _use_async_mode__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./use-async-mode */ "./node_modules/@wordpress/data/build-module/components/async-mode-provider/use-async-mode.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "useAsyncMode", function() { return _use_async_mode__WEBPACK_IMPORTED_MODULE_0__["default"]; });
/* harmony import */ var _context__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./context */ "./node_modules/@wordpress/data/build-module/components/async-mode-provider/context.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "AsyncModeProvider", function() { return _context__WEBPACK_IMPORTED_MODULE_1__["default"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "AsyncModeConsumer", function() { return _context__WEBPACK_IMPORTED_MODULE_1__["AsyncModeConsumer"]; });
/***/ }),
/***/ "./node_modules/@wordpress/data/build-module/components/async-mode-provider/use-async-mode.js":
/*!****************************************************************************************************!*\
!*** ./node_modules/@wordpress/data/build-module/components/async-mode-provider/use-async-mode.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 useAsyncMode; });
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "./node_modules/@wordpress/element/build-module/index.js");
/* harmony import */ var _context__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./context */ "./node_modules/@wordpress/data/build-module/components/async-mode-provider/context.js");
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
function useAsyncMode() {
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["useContext"])(_context__WEBPACK_IMPORTED_MODULE_1__["Context"]);
}
/***/ }),
/***/ "./node_modules/@wordpress/data/build-module/components/registry-provider/context.js":
/*!*******************************************************************************************!*\
!*** ./node_modules/@wordpress/data/build-module/components/registry-provider/context.js ***!
\*******************************************************************************************/
/*! exports provided: Context, RegistryConsumer, default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Context", function() { return Context; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RegistryConsumer", function() { return RegistryConsumer; });
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "./node_modules/@wordpress/element/build-module/index.js");
/* harmony import */ var _default_registry__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../default-registry */ "./node_modules/@wordpress/data/build-module/default-registry.js");
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
var Context = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createContext"])(_default_registry__WEBPACK_IMPORTED_MODULE_1__["default"]);
var Consumer = Context.Consumer,
Provider = Context.Provider;
/**
* A custom react Context consumer exposing the provided `registry` to
* children components. Used along with the RegistryProvider.
*
* You can read more about the react context api here:
* https://reactjs.org/docs/context.html#contextprovider
*
* @example
* ```js
* const {
* RegistryProvider,
* RegistryConsumer,
* createRegistry
* } = wp.data;
*
* const registry = createRegistry( {} );
*
* const App = ( { props } ) => {
* return <RegistryProvider value={ registry }>
* <div>Hello There</div>
* <RegistryConsumer>
* { ( registry ) => (
* <ComponentUsingRegistry
* { ...props }
* registry={ registry }
* ) }
* </RegistryConsumer>
* </RegistryProvider>
* }
* ```
*/
var RegistryConsumer = Consumer;
/**
* A custom Context provider for exposing the provided `registry` to children
* components via a consumer.
*
* See <a name="#RegistryConsumer">RegistryConsumer</a> documentation for
* example.
*/
/* harmony default export */ __webpack_exports__["default"] = (Provider);
/***/ }),
/***/ "./node_modules/@wordpress/data/build-module/components/registry-provider/index.js":
/*!*****************************************************************************************!*\
!*** ./node_modules/@wordpress/data/build-module/components/registry-provider/index.js ***!
\*****************************************************************************************/
/*! exports provided: RegistryProvider, RegistryConsumer, useRegistry */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _context__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./context */ "./node_modules/@wordpress/data/build-module/components/registry-provider/context.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "RegistryProvider", function() { return _context__WEBPACK_IMPORTED_MODULE_0__["default"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "RegistryConsumer", function() { return _context__WEBPACK_IMPORTED_MODULE_0__["RegistryConsumer"]; });
/* harmony import */ var _use_registry__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./use-registry */ "./node_modules/@wordpress/data/build-module/components/registry-provider/use-registry.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "useRegistry", function() { return _use_registry__WEBPACK_IMPORTED_MODULE_1__["default"]; });
/***/ }),
/***/ "./node_modules/@wordpress/data/build-module/components/registry-provider/use-registry.js":
/*!************************************************************************************************!*\
!*** ./node_modules/@wordpress/data/build-module/components/registry-provider/use-registry.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 useRegistry; });
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "./node_modules/@wordpress/element/build-module/index.js");
/* harmony import */ var _context__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./context */ "./node_modules/@wordpress/data/build-module/components/registry-provider/context.js");
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
/**
* A custom react hook exposing the registry context for use.
*
* This exposes the `registry` value provided via the
* <a href="#RegistryProvider">Registry Provider</a> to a component implementing
* this hook.
*
* It acts similarly to the `useContext` react hook.
*
* Note: Generally speaking, `useRegistry` is a low level hook that in most cases
* won't be needed for implementation. Most interactions with the wp.data api
* can be performed via the `useSelect` hook, or the `withSelect` and
* `withDispatch` higher order components.
*
* @example
* ```js
* const {
* RegistryProvider,
* createRegistry,
* useRegistry,
* } = wp.data
*
* const registry = createRegistry( {} );
*
* const SomeChildUsingRegistry = ( props ) => {
* const registry = useRegistry( registry );
* // ...logic implementing the registry in other react hooks.
* };
*
*
* const ParentProvidingRegistry = ( props ) => {
* return <RegistryProvider value={ registry }>
* <SomeChildUsingRegistry { ...props } />
* </RegistryProvider>
* };
* ```
*
* @return {Function} A custom react hook exposing the registry context value.
*/
function useRegistry() {
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["useContext"])(_context__WEBPACK_IMPORTED_MODULE_1__["Context"]);
}
/***/ }),
/***/ "./node_modules/@wordpress/data/build-module/components/use-dispatch/index.js":
/*!************************************************************************************!*\
!*** ./node_modules/@wordpress/data/build-module/components/use-dispatch/index.js ***!
\************************************************************************************/
/*! exports provided: useDispatch, useDispatchWithMap */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _use_dispatch__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./use-dispatch */ "./node_modules/@wordpress/data/build-module/components/use-dispatch/use-dispatch.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "useDispatch", function() { return _use_dispatch__WEBPACK_IMPORTED_MODULE_0__["default"]; });
/* harmony import */ var _use_dispatch_with_map__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./use-dispatch-with-map */ "./node_modules/@wordpress/data/build-module/components/use-dispatch/use-dispatch-with-map.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "useDispatchWithMap", function() { return _use_dispatch_with_map__WEBPACK_IMPORTED_MODULE_1__["default"]; });
/***/ }),
/***/ "./node_modules/@wordpress/data/build-module/components/use-dispatch/use-dispatch-with-map.js":
/*!****************************************************************************************************!*\
!*** ./node_modules/@wordpress/data/build-module/components/use-dispatch/use-dispatch-with-map.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 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_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/element */ "./node_modules/@wordpress/element/build-module/index.js");
/* harmony import */ var _registry_provider_use_registry__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../registry-provider/use-registry */ "./node_modules/@wordpress/data/build-module/components/registry-provider/use-registry.js");
/**
* External dependencies
*/
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
/**
* Favor useLayoutEffect to ensure the store subscription callback always has
* the dispatchMap from the latest render. If a store update happens between
* render and the effect, this could cause missed/stale updates or
* inconsistent state.
*
* Fallback to useEffect for server rendered components because currently React
* throws a warning when using useLayoutEffect in that environment.
*/
var useIsomorphicLayoutEffect = typeof window !== 'undefined' ? _wordpress_element__WEBPACK_IMPORTED_MODULE_2__["useLayoutEffect"] : _wordpress_element__WEBPACK_IMPORTED_MODULE_2__["useEffect"];
/**
* Custom react hook for returning aggregate dispatch actions using the provided
* dispatchMap.
*
* Currently this is an internal api only and is implemented by `withDispatch`
*
* @param {Function} dispatchMap Receives the `registry.dispatch` function as
* the first argument and the `registry` object
* as the second argument. Should return an
* object mapping props to functions.
* @param {Array} deps An array of dependencies for the hook.
* @return {Object} An object mapping props to functions created by the passed
* in dispatchMap.
*/
var useDispatchWithMap = function useDispatchWithMap(dispatchMap, deps) {
var registry = Object(_registry_provider_use_registry__WEBPACK_IMPORTED_MODULE_3__["default"])();
var currentDispatchMap = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["useRef"])(dispatchMap);
useIsomorphicLayoutEffect(function () {
currentDispatchMap.current = dispatchMap;
});
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["useMemo"])(function () {
var currentDispatchProps = currentDispatchMap.current(registry.dispatch, registry);
return Object(lodash__WEBPACK_IMPORTED_MODULE_1__["mapValues"])(currentDispatchProps, function (dispatcher, propName) {
if (typeof dispatcher !== 'function') {
// eslint-disable-next-line no-console
console.warn("Property ".concat(propName, " returned from dispatchMap in useDispatchWithMap must be a function."));
}
return function () {
var _currentDispatchMap$c;
return (_currentDispatchMap$c = currentDispatchMap.current(registry.dispatch, registry))[propName].apply(_currentDispatchMap$c, arguments);
};
});
}, [registry].concat(Object(_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_0__["default"])(deps)));
};
/* harmony default export */ __webpack_exports__["default"] = (useDispatchWithMap);
/***/ }),
/***/ "./node_modules/@wordpress/data/build-module/components/use-dispatch/use-dispatch.js":
/*!*******************************************************************************************!*\
!*** ./node_modules/@wordpress/data/build-module/components/use-dispatch/use-dispatch.js ***!
\*******************************************************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _registry_provider_use_registry__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../registry-provider/use-registry */ "./node_modules/@wordpress/data/build-module/components/registry-provider/use-registry.js");
/**
* Internal dependencies
*/
/**
* A custom react hook returning the current registry dispatch actions creators.
*
* Note: The component using this hook must be within the context of a
* RegistryProvider.
*
* @param {string} [storeName] Optionally provide the name of the store from
* which to retrieve action creators. If not
* provided, the registry.dispatch function is
* returned instead.
*
* @example
* This illustrates a pattern where you may need to retrieve dynamic data from
* the server via the `useSelect` hook to use in combination with the dispatch
* action.
*
* ```jsx
* const { useDispatch, useSelect } = wp.data;
* const { useCallback } = wp.element;
*
* function Button( { onClick, children } ) {
* return <button type="button" onClick={ onClick }>{ children }</button>
* }
*
* const SaleButton = ( { children } ) => {
* const { stockNumber } = useSelect(
* ( select ) => select( 'my-shop' ).getStockNumber()
* );
* const { startSale } = useDispatch( 'my-shop' );
* const onClick = useCallback( () => {
* const discountPercent = stockNumber > 50 ? 10: 20;
* startSale( discountPercent );
* }, [ stockNumber ] );
* return <Button onClick={ onClick }>{ children }</Button>
* }
*
* // Rendered somewhere in the application:
* //
* // <SaleButton>Start Sale!</SaleButton>
* ```
* @return {Function} A custom react hook.
*/
var useDispatch = function useDispatch(storeName) {
var _useRegistry = Object(_registry_provider_use_registry__WEBPACK_IMPORTED_MODULE_0__["default"])(),
dispatch = _useRegistry.dispatch;
return storeName === void 0 ? dispatch : dispatch(storeName);
};
/* harmony default export */ __webpack_exports__["default"] = (useDispatch);
/***/ }),
/***/ "./node_modules/@wordpress/data/build-module/components/use-select/index.js":
/*!**********************************************************************************!*\
!*** ./node_modules/@wordpress/data/build-module/components/use-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 useSelect; });
/* 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_priority_queue__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/priority-queue */ "./node_modules/@wordpress/priority-queue/build-module/index.js");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/element */ "./node_modules/@wordpress/element/build-module/index.js");
/* harmony import */ var _wordpress_is_shallow_equal__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/is-shallow-equal */ "./node_modules/@wordpress/is-shallow-equal/index.js");
/* harmony import */ var _wordpress_is_shallow_equal__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_is_shallow_equal__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _registry_provider_use_registry__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../registry-provider/use-registry */ "./node_modules/@wordpress/data/build-module/components/registry-provider/use-registry.js");
/* harmony import */ var _async_mode_provider_use_async_mode__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../async-mode-provider/use-async-mode */ "./node_modules/@wordpress/data/build-module/components/async-mode-provider/use-async-mode.js");
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
/**
* Favor useLayoutEffect to ensure the store subscription callback always has
* the selector from the latest render. If a store update happens between render
* and the effect, this could cause missed/stale updates or inconsistent state.
*
* Fallback to useEffect for server rendered components because currently React
* throws a warning when using useLayoutEffect in that environment.
*/
var useIsomorphicLayoutEffect = typeof window !== 'undefined' ? _wordpress_element__WEBPACK_IMPORTED_MODULE_2__["useLayoutEffect"] : _wordpress_element__WEBPACK_IMPORTED_MODULE_2__["useEffect"];
var renderQueue = Object(_wordpress_priority_queue__WEBPACK_IMPORTED_MODULE_1__["createQueue"])();
/**
* Custom react hook for retrieving props from registered selectors.
*
* In general, this custom React hook follows the
* [rules of hooks](https://reactjs.org/docs/hooks-rules.html).
*
* @param {Function} _mapSelect Function called on every state change. The
* returned value is exposed to the component
* implementing this hook. The function receives
* the `registry.select` method on the first
* argument and the `registry` on the second
* argument.
* @param {Array} deps If provided, this memoizes the mapSelect so the
* same `mapSelect` is invoked on every state
* change unless the dependencies change.
*
* @example
* ```js
* const { useSelect } = wp.data;
*
* function HammerPriceDisplay( { currency } ) {
* const price = useSelect( ( select ) => {
* return select( 'my-shop' ).getPrice( 'hammer', currency )
* }, [ currency ] );
* return new Intl.NumberFormat( 'en-US', {
* style: 'currency',
* currency,
* } ).format( price );
* }
*
* // Rendered in the application:
* // <HammerPriceDisplay currency="USD" />
* ```
*
* In the above example, when `HammerPriceDisplay` is rendered into an
* application, the price will be retrieved from the store state using the
* `mapSelect` callback on `useSelect`. If the currency prop changes then
* any price in the state for that currency is retrieved. If the currency prop
* doesn't change and other props are passed in that do change, the price will
* not change because the dependency is just the currency.
*
* @return {Function} A custom react hook.
*/
function useSelect(_mapSelect, deps) {
var mapSelect = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["useCallback"])(_mapSelect, deps);
var registry = Object(_registry_provider_use_registry__WEBPACK_IMPORTED_MODULE_4__["default"])();
var isAsync = Object(_async_mode_provider_use_async_mode__WEBPACK_IMPORTED_MODULE_5__["default"])();
var queueContext = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["useMemo"])(function () {
return {
queue: true
};
}, [registry]);
var _useReducer = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["useReducer"])(function (s) {
return s + 1;
}, 0),
_useReducer2 = Object(_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_0__["default"])(_useReducer, 2),
forceRender = _useReducer2[1];
var latestMapSelect = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["useRef"])();
var latestIsAsync = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["useRef"])(isAsync);
var latestMapOutput = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["useRef"])();
var latestMapOutputError = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["useRef"])();
var isMounted = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["useRef"])();
var mapOutput;
try {
if (latestMapSelect.current !== mapSelect || latestMapOutputError.current) {
mapOutput = mapSelect(registry.select, registry);
} else {
mapOutput = latestMapOutput.current;
}
} catch (error) {
var errorMessage = "An error occurred while running 'mapSelect': ".concat(error.message);
if (latestMapOutputError.current) {
errorMessage += "\nThe error may be correlated with this previous error:\n";
errorMessage += "".concat(latestMapOutputError.current.stack, "\n\n");
errorMessage += 'Original stack trace:';
throw new Error(errorMessage);
}
}
useIsomorphicLayoutEffect(function () {
latestMapSelect.current = mapSelect;
if (latestIsAsync.current !== isAsync) {
latestIsAsync.current = isAsync;
renderQueue.flush(queueContext);
}
latestMapOutput.current = mapOutput;
latestMapOutputError.current = undefined;
isMounted.current = true;
});
useIsomorphicLayoutEffect(function () {
var onStoreChange = function onStoreChange() {
if (isMounted.current) {
try {
var newMapOutput = latestMapSelect.current(registry.select, registry);
if (_wordpress_is_shallow_equal__WEBPACK_IMPORTED_MODULE_3___default()(latestMapOutput.current, newMapOutput)) {
return;
}
latestMapOutput.current = newMapOutput;
} catch (error) {
latestMapOutputError.current = error;
}
forceRender({});
}
}; // catch any possible state changes during mount before the subscription
// could be set.
if (latestIsAsync.current) {
renderQueue.add(queueContext, onStoreChange);
} else {
onStoreChange();
}
var unsubscribe = registry.subscribe(function () {
if (latestIsAsync.current) {
renderQueue.add(queueContext, onStoreChange);
} else {
onStoreChange();
}
});
return function () {
isMounted.current = false;
unsubscribe();
renderQueue.flush(queueContext);
};
}, [registry]);
return mapOutput;
}
/***/ }),
/***/ "./node_modules/@wordpress/data/build-module/components/with-dispatch/index.js":
/*!*************************************************************************************!*\
!*** ./node_modules/@wordpress/data/build-module/components/with-dispatch/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 */ "./node_modules/@wordpress/element/build-module/index.js");
/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/compose */ "./node_modules/@wordpress/compose/build-module/index.js");
/* harmony import */ var _use_dispatch__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../use-dispatch */ "./node_modules/@wordpress/data/build-module/components/use-dispatch/index.js");
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
/**
* Higher-order component used to add dispatch props using registered action
* creators.
*
* @param {Function} mapDispatchToProps A function of returning an object of
* prop names where value is a
* dispatch-bound action creator, or a
* function to be called with the
* component's props and returning an
* action creator.
*
* @example
* ```jsx
* function Button( { onClick, children } ) {
* return <button type="button" onClick={ onClick }>{ children }</button>;
* }
*
* const { withDispatch } = wp.data;
*
* const SaleButton = withDispatch( ( dispatch, ownProps ) => {
* const { startSale } = dispatch( 'my-shop' );
* const { discountPercent } = ownProps;
*
* return {
* onClick() {
* startSale( discountPercent );
* },
* };
* } )( Button );
*
* // Rendered in the application:
* //
* // <SaleButton discountPercent="20">Start Sale!</SaleButton>
* ```
*
* @example
* In the majority of cases, it will be sufficient to use only two first params
* passed to `mapDispatchToProps` as illustrated in the previous example.
* However, there might be some very advanced use cases where using the
* `registry` object might be used as a tool to optimize the performance of
* your component. Using `select` function from the registry might be useful
* when you need to fetch some dynamic data from the store at the time when the
* event is fired, but at the same time, you never use it to render your
* component. In such scenario, you can avoid using the `withSelect` higher
* order component to compute such prop, which might lead to unnecessary
* re-renders of your component caused by its frequent value change.
* Keep in mind, that `mapDispatchToProps` must return an object with functions
* only.
*
* ```jsx
* function Button( { onClick, children } ) {
* return <button type="button" onClick={ onClick }>{ children }</button>;
* }
*
* const { withDispatch } = wp.data;
*
* const SaleButton = withDispatch( ( dispatch, ownProps, { select } ) => {
* // Stock number changes frequently.
* const { getStockNumber } = select( 'my-shop' );
* const { startSale } = dispatch( 'my-shop' );
* return {
* onClick() {
* const discountPercent = getStockNumber() > 50 ? 10 : 20;
* startSale( discountPercent );
* },
* };
* } )( Button );
*
* // Rendered in the application:
* //
* // <SaleButton>Start Sale!</SaleButton>
* ```
*
* _Note:_ It is important that the `mapDispatchToProps` function always
* returns an object with the same keys. For example, it should not contain
* conditions under which a different value would be returned.
*
* @return {Component} Enhanced component with merged dispatcher props.
*/
var withDispatch = function withDispatch(mapDispatchToProps) {
return Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_2__["createHigherOrderComponent"])(function (WrappedComponent) {
return function (ownProps) {
var mapDispatch = function mapDispatch(dispatch, registry) {
return mapDispatchToProps(dispatch, ownProps, registry);
};
var dispatchProps = Object(_use_dispatch__WEBPACK_IMPORTED_MODULE_3__["useDispatchWithMap"])(mapDispatch, []);
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])(WrappedComponent, Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, ownProps, dispatchProps));
};
}, 'withDispatch');
};
/* harmony default export */ __webpack_exports__["default"] = (withDispatch);
/***/ }),
/***/ "./node_modules/@wordpress/data/build-module/components/with-registry/index.js":
/*!*************************************************************************************!*\
!*** ./node_modules/@wordpress/data/build-module/components/with-registry/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 */ "./node_modules/@wordpress/element/build-module/index.js");
/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/compose */ "./node_modules/@wordpress/compose/build-module/index.js");
/* harmony import */ var _registry_provider__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../registry-provider */ "./node_modules/@wordpress/data/build-module/components/registry-provider/index.js");
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
/**
* Higher-order component which renders the original component with the current
* registry context passed as its `registry` prop.
*
* @param {WPComponent} OriginalComponent Original component.
*
* @return {WPComponent} Enhanced component.
*/
var withRegistry = Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_2__["createHigherOrderComponent"])(function (OriginalComponent) {
return function (props) {
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])(_registry_provider__WEBPACK_IMPORTED_MODULE_3__["RegistryConsumer"], null, function (registry) {
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])(OriginalComponent, Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, props, {
registry: registry
}));
});
};
}, 'withRegistry');
/* harmony default export */ __webpack_exports__["default"] = (withRegistry);
/***/ }),
/***/ "./node_modules/@wordpress/data/build-module/components/with-select/index.js":
/*!***********************************************************************************!*\
!*** ./node_modules/@wordpress/data/build-module/components/with-select/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 */ "./node_modules/@wordpress/element/build-module/index.js");
/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/compose */ "./node_modules/@wordpress/compose/build-module/index.js");
/* harmony import */ var _use_select__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../use-select */ "./node_modules/@wordpress/data/build-module/components/use-select/index.js");
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
/**
* Higher-order component used to inject state-derived props using registered
* selectors.
*
* @param {Function} mapSelectToProps Function called on every state change,
* expected to return object of props to
* merge with the component's own props.
*
* @example
* ```js
* function PriceDisplay( { price, currency } ) {
* return new Intl.NumberFormat( 'en-US', {
* style: 'currency',
* currency,
* } ).format( price );
* }
*
* const { withSelect } = wp.data;
*
* const HammerPriceDisplay = withSelect( ( select, ownProps ) => {
* const { getPrice } = select( 'my-shop' );
* const { currency } = ownProps;
*
* return {
* price: getPrice( 'hammer', currency ),
* };
* } )( PriceDisplay );
*
* // Rendered in the application:
* //
* // <HammerPriceDisplay currency="USD" />
* ```
* In the above example, when `HammerPriceDisplay` is rendered into an
* application, it will pass the price into the underlying `PriceDisplay`
* component and update automatically if the price of a hammer ever changes in
* the store.
*
* @return {Component} Enhanced component with merged state data props.
*/
var withSelect = function withSelect(mapSelectToProps) {
return Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_2__["createHigherOrderComponent"])(function (WrappedComponent) {
return Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_2__["pure"])(function (ownProps) {
var mapSelect = function mapSelect(select, registry) {
return mapSelectToProps(select, ownProps, registry);
};
var mergeProps = Object(_use_select__WEBPACK_IMPORTED_MODULE_3__["default"])(mapSelect);
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])(WrappedComponent, Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, ownProps, mergeProps));
});
}, 'withSelect');
};
/* harmony default export */ __webpack_exports__["default"] = (withSelect);
/***/ }),
/***/ "./node_modules/@wordpress/data/build-module/default-registry.js":
/*!***********************************************************************!*\
!*** ./node_modules/@wordpress/data/build-module/default-registry.js ***!
\***********************************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _registry__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./registry */ "./node_modules/@wordpress/data/build-module/registry.js");
/**
* Internal dependencies
*/
/* harmony default export */ __webpack_exports__["default"] = (Object(_registry__WEBPACK_IMPORTED_MODULE_0__["createRegistry"])());
/***/ }),
/***/ "./node_modules/@wordpress/data/build-module/factory.js":
/*!**************************************************************!*\
!*** ./node_modules/@wordpress/data/build-module/factory.js ***!
\**************************************************************/
/*! exports provided: createRegistrySelector, createRegistryControl */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createRegistrySelector", function() { return createRegistrySelector; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createRegistryControl", function() { return createRegistryControl; });
/* harmony import */ var _default_registry__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./default-registry */ "./node_modules/@wordpress/data/build-module/default-registry.js");
/**
* Internal dependencies
*/
/**
* @typedef {import('./registry').WPDataRegistry} WPDataRegistry
*/
/**
* Mark a selector as a registry selector.
*
* @param {Function} registrySelector Function receiving a registry object and returning a state selector.
*
* @return {Function} marked registry selector.
*/
function createRegistrySelector(registrySelector) {
var selector = function selector() {
return registrySelector(selector.registry.select).apply(void 0, arguments);
};
/**
* Flag indicating to selector registration mapping that the selector should
* be mapped as a registry selector.
*
* @type {boolean}
*/
selector.isRegistrySelector = true;
/**
* Registry on which to call `select`, stubbed for non-standard usage to
* use the default registry.
*
* @type {WPDataRegistry}
*/
selector.registry = _default_registry__WEBPACK_IMPORTED_MODULE_0__["default"];
return selector;
}
/**
* Mark a control as a registry control.
*
* @param {Function} registryControl Function receiving a registry object and returning a control.
*
* @return {Function} marked registry control.
*/
function createRegistryControl(registryControl) {
registryControl.isRegistryControl = true;
return registryControl;
}
/***/ }),
/***/ "./node_modules/@wordpress/data/build-module/index.js":
/*!************************************************************!*\
!*** ./node_modules/@wordpress/data/build-module/index.js ***!
\************************************************************/
/*! exports provided: withSelect, withDispatch, withRegistry, RegistryProvider, RegistryConsumer, useRegistry, useSelect, useDispatch, __experimentalAsyncModeProvider, createRegistry, createRegistrySelector, createRegistryControl, plugins, combineReducers, select, dispatch, subscribe, registerGenericStore, registerStore, use */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "select", function() { return select; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "dispatch", function() { return dispatch; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "subscribe", function() { return subscribe; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "registerGenericStore", function() { return registerGenericStore; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "registerStore", function() { return registerStore; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "use", function() { return use; });
/* harmony import */ var turbo_combine_reducers__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! turbo-combine-reducers */ "./node_modules/turbo-combine-reducers/index.js");
/* harmony import */ var turbo_combine_reducers__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(turbo_combine_reducers__WEBPACK_IMPORTED_MODULE_0__);
/* harmony reexport (default from non-harmony) */ __webpack_require__.d(__webpack_exports__, "combineReducers", function() { return turbo_combine_reducers__WEBPACK_IMPORTED_MODULE_0___default.a; });
/* harmony import */ var _default_registry__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./default-registry */ "./node_modules/@wordpress/data/build-module/default-registry.js");
/* harmony import */ var _plugins__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./plugins */ "./node_modules/@wordpress/data/build-module/plugins/index.js");
/* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "plugins", function() { return _plugins__WEBPACK_IMPORTED_MODULE_2__; });
/* harmony import */ var _components_with_select__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./components/with-select */ "./node_modules/@wordpress/data/build-module/components/with-select/index.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "withSelect", function() { return _components_with_select__WEBPACK_IMPORTED_MODULE_3__["default"]; });
/* harmony import */ var _components_with_dispatch__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./components/with-dispatch */ "./node_modules/@wordpress/data/build-module/components/with-dispatch/index.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "withDispatch", function() { return _components_with_dispatch__WEBPACK_IMPORTED_MODULE_4__["default"]; });
/* harmony import */ var _components_with_registry__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./components/with-registry */ "./node_modules/@wordpress/data/build-module/components/with-registry/index.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "withRegistry", function() { return _components_with_registry__WEBPACK_IMPORTED_MODULE_5__["default"]; });
/* harmony import */ var _components_registry_provider__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./components/registry-provider */ "./node_modules/@wordpress/data/build-module/components/registry-provider/index.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "RegistryProvider", function() { return _components_registry_provider__WEBPACK_IMPORTED_MODULE_6__["RegistryProvider"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "RegistryConsumer", function() { return _components_registry_provider__WEBPACK_IMPORTED_MODULE_6__["RegistryConsumer"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "useRegistry", function() { return _components_registry_provider__WEBPACK_IMPORTED_MODULE_6__["useRegistry"]; });
/* harmony import */ var _components_use_select__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./components/use-select */ "./node_modules/@wordpress/data/build-module/components/use-select/index.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "useSelect", function() { return _components_use_select__WEBPACK_IMPORTED_MODULE_7__["default"]; });
/* harmony import */ var _components_use_dispatch__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./components/use-dispatch */ "./node_modules/@wordpress/data/build-module/components/use-dispatch/index.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "useDispatch", function() { return _components_use_dispatch__WEBPACK_IMPORTED_MODULE_8__["useDispatch"]; });
/* harmony import */ var _components_async_mode_provider__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./components/async-mode-provider */ "./node_modules/@wordpress/data/build-module/components/async-mode-provider/index.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "__experimentalAsyncModeProvider", function() { return _components_async_mode_provider__WEBPACK_IMPORTED_MODULE_9__["AsyncModeProvider"]; });
/* harmony import */ var _registry__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./registry */ "./node_modules/@wordpress/data/build-module/registry.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "createRegistry", function() { return _registry__WEBPACK_IMPORTED_MODULE_10__["createRegistry"]; });
/* harmony import */ var _factory__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./factory */ "./node_modules/@wordpress/data/build-module/factory.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "createRegistrySelector", function() { return _factory__WEBPACK_IMPORTED_MODULE_11__["createRegistrySelector"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "createRegistryControl", function() { return _factory__WEBPACK_IMPORTED_MODULE_11__["createRegistryControl"]; });
/**
* External dependencies
*/
/**
* Internal dependencies
*/
/**
* Object of available plugins to use with a registry.
*
* @see [use](#use)
*
* @type {Object}
*/
/**
* The combineReducers helper function turns an object whose values are different
* reducing functions into a single reducing function you can pass to registerReducer.
*
* @param {Object} reducers An object whose values correspond to different reducing
* functions that need to be combined into one.
*
* @example
* ```js
* const { combineReducers, registerStore } = wp.data;
*
* const prices = ( state = {}, action ) => {
* return action.type === 'SET_PRICE' ?
* {
* ...state,
* [ action.item ]: action.price,
* } :
* state;
* };
*
* const discountPercent = ( state = 0, action ) => {
* return action.type === 'START_SALE' ?
* action.discountPercent :
* state;
* };
*
* registerStore( 'my-shop', {
* reducer: combineReducers( {
* prices,
* discountPercent,
* } ),
* } );
* ```
*
* @return {Function} A reducer that invokes every reducer inside the reducers
* object, and constructs a state object with the same shape.
*/
/**
* Given the name of a registered store, returns an object of the store's selectors.
* The selector functions are been pre-bound to pass the current state automatically.
* As a consumer, you need only pass arguments of the selector, if applicable.
*
* @param {string} name Store name
*
* @example
* ```js
* const { select } = wp.data;
*
* select( 'my-shop' ).getPrice( 'hammer' );
* ```
*
* @return {Object} Object containing the store's selectors.
*/
var select = _default_registry__WEBPACK_IMPORTED_MODULE_1__["default"].select;
/**
* Given the name of a registered store, returns an object of the store's action creators.
* Calling an action creator will cause it to be dispatched, updating the state value accordingly.
*
* Note: Action creators returned by the dispatch will return a promise when
* they are called.
*
* @param {string} name Store name
*
* @example
* ```js
* const { dispatch } = wp.data;
*
* dispatch( 'my-shop' ).setPrice( 'hammer', 9.75 );
* ```
* @return {Object} Object containing the action creators.
*/
var dispatch = _default_registry__WEBPACK_IMPORTED_MODULE_1__["default"].dispatch;
/**
* Given a listener function, the function will be called any time the state value
* of one of the registered stores has changed. This function returns a `unsubscribe`
* function used to stop the subscription.
*
* @param {Function} listener Callback function.
*
* @example
* ```js
* const { subscribe } = wp.data;
*
* const unsubscribe = subscribe( () => {
* // You could use this opportunity to test whether the derived result of a
* // selector has subsequently changed as the result of a state update.
* } );
*
* // Later, if necessary...
* unsubscribe();
* ```
*/
var subscribe = _default_registry__WEBPACK_IMPORTED_MODULE_1__["default"].subscribe;
/**
* Registers a generic store.
*
* @param {string} key Store registry key.
* @param {Object} config Configuration (getSelectors, getActions, subscribe).
*/
var registerGenericStore = _default_registry__WEBPACK_IMPORTED_MODULE_1__["default"].registerGenericStore;
/**
* Registers a standard `@wordpress/data` store.
*
* @param {string} reducerKey Reducer key.
* @param {Object} options Store description (reducer, actions, selectors, resolvers).
*
* @return {Object} Registered store object.
*/
var registerStore = _default_registry__WEBPACK_IMPORTED_MODULE_1__["default"].registerStore;
/**
* Extends a registry to inherit functionality provided by a given plugin. A
* plugin is an object with properties aligning to that of a registry, merged
* to extend the default registry behavior.
*
* @param {Object} plugin Plugin object.
*/
var use = _default_registry__WEBPACK_IMPORTED_MODULE_1__["default"].use;
/***/ }),
/***/ "./node_modules/@wordpress/data/build-module/namespace-store/index.js":
/*!****************************************************************************!*\
!*** ./node_modules/@wordpress/data/build-module/namespace-store/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 createNamespace; });
/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/regenerator */ "./node_modules/@babel/runtime/regenerator/index.js");
/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _babel_runtime_helpers_esm_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/asyncToGenerator */ "./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.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 redux__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! redux */ "./node_modules/redux/es/redux.js");
/* 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 turbo_combine_reducers__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! turbo-combine-reducers */ "./node_modules/turbo-combine-reducers/index.js");
/* harmony import */ var turbo_combine_reducers__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(turbo_combine_reducers__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var _wordpress_redux_routine__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @wordpress/redux-routine */ "./node_modules/@wordpress/redux-routine/build-module/index.js");
/* harmony import */ var _promise_middleware__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../promise-middleware */ "./node_modules/@wordpress/data/build-module/promise-middleware.js");
/* harmony import */ var _resolvers_cache_middleware__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../resolvers-cache-middleware */ "./node_modules/@wordpress/data/build-module/resolvers-cache-middleware.js");
/* harmony import */ var _metadata_reducer__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./metadata/reducer */ "./node_modules/@wordpress/data/build-module/namespace-store/metadata/reducer.js");
/* harmony import */ var _metadata_selectors__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./metadata/selectors */ "./node_modules/@wordpress/data/build-module/namespace-store/metadata/selectors.js");
/* harmony import */ var _metadata_actions__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./metadata/actions */ "./node_modules/@wordpress/data/build-module/namespace-store/metadata/actions.js");
/**
* External dependencies
*/
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
/**
* @typedef {import('../registry').WPDataRegistry} WPDataRegistry
*/
/**
* Creates a namespace object with a store derived from the reducer given.
*
* @param {string} key Unique namespace identifier.
* @param {Object} options Registered store options, with properties
* describing reducer, actions, selectors, and
* resolvers.
* @param {WPDataRegistry} registry Registry reference.
*
* @return {Object} Store Object.
*/
function createNamespace(key, options, registry) {
var reducer = options.reducer;
var store = createReduxStore(key, options, registry);
var resolvers;
var actions = mapActions(Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_2__["default"])({}, _metadata_actions__WEBPACK_IMPORTED_MODULE_11__, options.actions), store);
var selectors = mapSelectors(Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_2__["default"])({}, Object(lodash__WEBPACK_IMPORTED_MODULE_4__["mapValues"])(_metadata_selectors__WEBPACK_IMPORTED_MODULE_10__, function (selector) {
return function (state) {
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
args[_key - 1] = arguments[_key];
}
return selector.apply(void 0, [state.metadata].concat(args));
};
}), Object(lodash__WEBPACK_IMPORTED_MODULE_4__["mapValues"])(options.selectors, function (selector) {
if (selector.isRegistrySelector) {
selector.registry = registry;
}
return function (state) {
for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
args[_key2 - 1] = arguments[_key2];
}
return selector.apply(void 0, [state.root].concat(args));
};
})), store);
if (options.resolvers) {
var result = mapResolvers(options.resolvers, selectors, store);
resolvers = result.resolvers;
selectors = result.selectors;
}
var getSelectors = function getSelectors() {
return selectors;
};
var getActions = function getActions() {
return actions;
}; // We have some modules monkey-patching the store object
// It's wrong to do so but until we refactor all of our effects to controls
// We need to keep the same "store" instance here.
store.__unstableOriginalGetState = store.getState;
store.getState = function () {
return store.__unstableOriginalGetState().root;
}; // Customize subscribe behavior to call listeners only on effective change,
// not on every dispatch.
var subscribe = store && function (listener) {
var lastState = store.__unstableOriginalGetState();
store.subscribe(function () {
var state = store.__unstableOriginalGetState();
var hasChanged = state !== lastState;
lastState = state;
if (hasChanged) {
listener();
}
});
}; // This can be simplified to just { subscribe, getSelectors, getActions }
// Once we remove the use function.
return {
reducer: reducer,
store: store,
actions: actions,
selectors: selectors,
resolvers: resolvers,
getSelectors: getSelectors,
getActions: getActions,
subscribe: subscribe
};
}
/**
* Creates a redux store for a namespace.
*
* @param {string} key Unique namespace identifier.
* @param {Object} options Registered store options, with properties
* describing reducer, actions, selectors, and
* resolvers.
* @param {WPDataRegistry} registry Registry reference.
*
* @return {Object} Newly created redux store.
*/
function createReduxStore(key, options, registry) {
var middlewares = [Object(_resolvers_cache_middleware__WEBPACK_IMPORTED_MODULE_8__["default"])(registry, key), _promise_middleware__WEBPACK_IMPORTED_MODULE_7__["default"]];
if (options.controls) {
var normalizedControls = Object(lodash__WEBPACK_IMPORTED_MODULE_4__["mapValues"])(options.controls, function (control) {
return control.isRegistryControl ? control(registry) : control;
});
middlewares.push(Object(_wordpress_redux_routine__WEBPACK_IMPORTED_MODULE_6__["default"])(normalizedControls));
}
var enhancers = [redux__WEBPACK_IMPORTED_MODULE_3__["applyMiddleware"].apply(void 0, middlewares)];
if (typeof window !== 'undefined' && window.__REDUX_DEVTOOLS_EXTENSION__) {
enhancers.push(window.__REDUX_DEVTOOLS_EXTENSION__({
name: key,
instanceId: key
}));
}
var reducer = options.reducer,
initialState = options.initialState;
var enhancedReducer = turbo_combine_reducers__WEBPACK_IMPORTED_MODULE_5___default()({
metadata: _metadata_reducer__WEBPACK_IMPORTED_MODULE_9__["default"],
root: reducer
});
return Object(redux__WEBPACK_IMPORTED_MODULE_3__["createStore"])(enhancedReducer, {
root: initialState
}, Object(lodash__WEBPACK_IMPORTED_MODULE_4__["flowRight"])(enhancers));
}
/**
* Maps selectors to a store.
*
* @param {Object} selectors Selectors to register. Keys will be used as the
* public facing API. Selectors will get passed the
* state as first argument.
* @param {Object} store The store to which the selectors should be mapped.
*
* @return {Object} Selectors mapped to the provided store.
*/
function mapSelectors(selectors, store) {
var createStateSelector = function createStateSelector(registrySelector) {
var selector = function runSelector() {
// This function is an optimized implementation of:
//
// selector( store.getState(), ...arguments )
//
// Where the above would incur an `Array#concat` in its application,
// the logic here instead efficiently constructs an arguments array via
// direct assignment.
var argsLength = arguments.length;
var args = new Array(argsLength + 1);
args[0] = store.__unstableOriginalGetState();
for (var i = 0; i < argsLength; i++) {
args[i + 1] = arguments[i];
}
return registrySelector.apply(void 0, args);
};
selector.hasResolver = false;
return selector;
};
return Object(lodash__WEBPACK_IMPORTED_MODULE_4__["mapValues"])(selectors, createStateSelector);
}
/**
* Maps actions to dispatch from a given store.
*
* @param {Object} actions Actions to register.
* @param {Object} store The redux store to which the actions should be mapped.
* @return {Object} Actions mapped to the redux store provided.
*/
function mapActions(actions, store) {
var createBoundAction = function createBoundAction(action) {
return function () {
return Promise.resolve(store.dispatch(action.apply(void 0, arguments)));
};
};
return Object(lodash__WEBPACK_IMPORTED_MODULE_4__["mapValues"])(actions, createBoundAction);
}
/**
* Returns resolvers with matched selectors for a given namespace.
* Resolvers are side effects invoked once per argument set of a given selector call,
* used in ensuring that the data needs for the selector are satisfied.
*
* @param {Object} resolvers Resolvers to register.
* @param {Object} selectors The current selectors to be modified.
* @param {Object} store The redux store to which the resolvers should be mapped.
* @return {Object} An object containing updated selectors and resolvers.
*/
function mapResolvers(resolvers, selectors, store) {
var mappedResolvers = Object(lodash__WEBPACK_IMPORTED_MODULE_4__["mapValues"])(resolvers, function (resolver) {
var _resolver$fulfill = resolver.fulfill,
resolverFulfill = _resolver$fulfill === void 0 ? resolver : _resolver$fulfill;
return Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_2__["default"])({}, resolver, {
fulfill: resolverFulfill
});
});
var mapSelector = function mapSelector(selector, selectorName) {
var resolver = resolvers[selectorName];
if (!resolver) {
selector.hasResolver = false;
return selector;
}
var selectorResolver = function selectorResolver() {
for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
args[_key3] = arguments[_key3];
}
function fulfillSelector() {
return _fulfillSelector.apply(this, arguments);
}
function _fulfillSelector() {
_fulfillSelector = Object(_babel_runtime_helpers_esm_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__["default"])(
/*#__PURE__*/
_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.mark(function _callee() {
var state, _store$__unstableOrig, metadata;
return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.wrap(function _callee$(_context) {
while (1) {
switch (_context.prev = _context.next) {
case 0:
state = store.getState();
if (!(typeof resolver.isFulfilled === 'function' && resolver.isFulfilled.apply(resolver, [state].concat(args)))) {
_context.next = 3;
break;
}
return _context.abrupt("return");
case 3:
_store$__unstableOrig = store.__unstableOriginalGetState(), metadata = _store$__unstableOrig.metadata;
if (!_metadata_selectors__WEBPACK_IMPORTED_MODULE_10__["hasStartedResolution"](metadata, selectorName, args)) {
_context.next = 6;
break;
}
return _context.abrupt("return");
case 6:
store.dispatch(_metadata_actions__WEBPACK_IMPORTED_MODULE_11__["startResolution"](selectorName, args));
_context.next = 9;
return fulfillResolver.apply(void 0, [store, mappedResolvers, selectorName].concat(args));
case 9:
store.dispatch(_metadata_actions__WEBPACK_IMPORTED_MODULE_11__["finishResolution"](selectorName, args));
case 10:
case "end":
return _context.stop();
}
}
}, _callee);
}));
return _fulfillSelector.apply(this, arguments);
}
fulfillSelector.apply(void 0, args);
return selector.apply(void 0, args);
};
selectorResolver.hasResolver = true;
return selectorResolver;
};
return {
resolvers: mappedResolvers,
selectors: Object(lodash__WEBPACK_IMPORTED_MODULE_4__["mapValues"])(selectors, mapSelector)
};
}
/**
* Calls a resolver given arguments
*
* @param {Object} store Store reference, for fulfilling via resolvers
* @param {Object} resolvers Store Resolvers
* @param {string} selectorName Selector name to fulfill.
* @param {Array} args Selector Arguments.
*/
function fulfillResolver(_x, _x2, _x3) {
return _fulfillResolver.apply(this, arguments);
}
function _fulfillResolver() {
_fulfillResolver = Object(_babel_runtime_helpers_esm_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__["default"])(
/*#__PURE__*/
_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.mark(function _callee2(store, resolvers, selectorName) {
var resolver,
_len4,
args,
_key4,
action,
_args2 = arguments;
return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.wrap(function _callee2$(_context2) {
while (1) {
switch (_context2.prev = _context2.next) {
case 0:
resolver = Object(lodash__WEBPACK_IMPORTED_MODULE_4__["get"])(resolvers, [selectorName]);
if (resolver) {
_context2.next = 3;
break;
}
return _context2.abrupt("return");
case 3:
for (_len4 = _args2.length, args = new Array(_len4 > 3 ? _len4 - 3 : 0), _key4 = 3; _key4 < _len4; _key4++) {
args[_key4 - 3] = _args2[_key4];
}
action = resolver.fulfill.apply(resolver, args);
if (!action) {
_context2.next = 8;
break;
}
_context2.next = 8;
return store.dispatch(action);
case 8:
case "end":
return _context2.stop();
}
}
}, _callee2);
}));
return _fulfillResolver.apply(this, arguments);
}
/***/ }),
/***/ "./node_modules/@wordpress/data/build-module/namespace-store/metadata/actions.js":
/*!***************************************************************************************!*\
!*** ./node_modules/@wordpress/data/build-module/namespace-store/metadata/actions.js ***!
\***************************************************************************************/
/*! exports provided: startResolution, finishResolution, invalidateResolution, invalidateResolutionForStore, invalidateResolutionForStoreSelector */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "startResolution", function() { return startResolution; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "finishResolution", function() { return finishResolution; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "invalidateResolution", function() { return invalidateResolution; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "invalidateResolutionForStore", function() { return invalidateResolutionForStore; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "invalidateResolutionForStoreSelector", function() { return invalidateResolutionForStoreSelector; });
/**
* Returns an action object used in signalling that selector resolution has
* started.
*
* @param {string} selectorName Name of selector for which resolver triggered.
* @param {...*} args Arguments to associate for uniqueness.
*
* @return {Object} Action object.
*/
function startResolution(selectorName, args) {
return {
type: 'START_RESOLUTION',
selectorName: selectorName,
args: args
};
}
/**
* Returns an action object used in signalling that selector resolution has
* completed.
*
* @param {string} selectorName Name of selector for which resolver triggered.
* @param {...*} args Arguments to associate for uniqueness.
*
* @return {Object} Action object.
*/
function finishResolution(selectorName, args) {
return {
type: 'FINISH_RESOLUTION',
selectorName: selectorName,
args: args
};
}
/**
* Returns an action object used in signalling that we should invalidate the resolution cache.
*
* @param {string} selectorName Name of selector for which resolver should be invalidated.
* @param {Array} args Arguments to associate for uniqueness.
*
* @return {Object} Action object.
*/
function invalidateResolution(selectorName, args) {
return {
type: 'INVALIDATE_RESOLUTION',
selectorName: selectorName,
args: args
};
}
/**
* Returns an action object used in signalling that the resolution
* should be invalidated.
*
* @return {Object} Action object.
*/
function invalidateResolutionForStore() {
return {
type: 'INVALIDATE_RESOLUTION_FOR_STORE'
};
}
/**
* Returns an action object used in signalling that the resolution cache for a
* given selectorName should be invalidated.
*
* @param {string} selectorName Name of selector for which all resolvers should
* be invalidated.
*
* @return {Object} Action object.
*/
function invalidateResolutionForStoreSelector(selectorName) {
return {
type: 'INVALIDATE_RESOLUTION_FOR_STORE_SELECTOR',
selectorName: selectorName
};
}
/***/ }),
/***/ "./node_modules/@wordpress/data/build-module/namespace-store/metadata/reducer.js":
/*!***************************************************************************************!*\
!*** ./node_modules/@wordpress/data/build-module/namespace-store/metadata/reducer.js ***!
\***************************************************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* 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__);
/* harmony import */ var equivalent_key_map__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! equivalent-key-map */ "./node_modules/equivalent-key-map/equivalent-key-map.js");
/* harmony import */ var equivalent_key_map__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(equivalent_key_map__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./utils */ "./node_modules/@wordpress/data/build-module/namespace-store/metadata/utils.js");
/**
* External dependencies
*/
/**
* Internal dependencies
*/
/**
* Reducer function returning next state for selector resolution of
* subkeys, object form:
*
* selectorName -> EquivalentKeyMap<Array,boolean>
*
* @param {Object} state Current state.
* @param {Object} action Dispatched action.
*
* @return {Object} Next state.
*/
var subKeysIsResolved = Object(lodash__WEBPACK_IMPORTED_MODULE_0__["flowRight"])([Object(_utils__WEBPACK_IMPORTED_MODULE_2__["onSubKey"])('selectorName')])(function () {
var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : new equivalent_key_map__WEBPACK_IMPORTED_MODULE_1___default.a();
var action = arguments.length > 1 ? arguments[1] : undefined;
switch (action.type) {
case 'START_RESOLUTION':
case 'FINISH_RESOLUTION':
{
var isStarting = action.type === 'START_RESOLUTION';
var nextState = new equivalent_key_map__WEBPACK_IMPORTED_MODULE_1___default.a(state);
nextState.set(action.args, isStarting);
return nextState;
}
case 'INVALIDATE_RESOLUTION':
{
var _nextState = new equivalent_key_map__WEBPACK_IMPORTED_MODULE_1___default.a(state);
_nextState.delete(action.args);
return _nextState;
}
}
return state;
});
/**
* Reducer function returning next state for selector resolution, object form:
*
* selectorName -> EquivalentKeyMap<Array, boolean>
*
* @param {Object} state Current state.
* @param {Object} action Dispatched action.
*
* @return {Object} Next state.
*/
var isResolved = function isResolved() {
var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
var action = arguments.length > 1 ? arguments[1] : undefined;
switch (action.type) {
case 'INVALIDATE_RESOLUTION_FOR_STORE':
return {};
case 'INVALIDATE_RESOLUTION_FOR_STORE_SELECTOR':
return Object(lodash__WEBPACK_IMPORTED_MODULE_0__["has"])(state, [action.selectorName]) ? Object(lodash__WEBPACK_IMPORTED_MODULE_0__["omit"])(state, [action.selectorName]) : state;
case 'START_RESOLUTION':
case 'FINISH_RESOLUTION':
case 'INVALIDATE_RESOLUTION':
return subKeysIsResolved(state, action);
}
return state;
};
/* harmony default export */ __webpack_exports__["default"] = (isResolved);
/***/ }),
/***/ "./node_modules/@wordpress/data/build-module/namespace-store/metadata/selectors.js":
/*!*****************************************************************************************!*\
!*** ./node_modules/@wordpress/data/build-module/namespace-store/metadata/selectors.js ***!
\*****************************************************************************************/
/*! exports provided: getIsResolving, hasStartedResolution, hasFinishedResolution, isResolving, getCachedResolvers */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getIsResolving", function() { return getIsResolving; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "hasStartedResolution", function() { return hasStartedResolution; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "hasFinishedResolution", function() { return hasFinishedResolution; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isResolving", function() { return isResolving; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getCachedResolvers", function() { return getCachedResolvers; });
/* 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
*/
/**
* Returns the raw `isResolving` value for a given selector name,
* and arguments set. May be undefined if the selector has never been resolved
* or not resolved for the given set of arguments, otherwise true or false for
* resolution started and completed respectively.
*
* @param {Object} state Data state.
* @param {string} selectorName Selector name.
* @param {Array} args Arguments passed to selector.
*
* @return {?boolean} isResolving value.
*/
function getIsResolving(state, selectorName, args) {
var map = Object(lodash__WEBPACK_IMPORTED_MODULE_0__["get"])(state, [selectorName]);
if (!map) {
return;
}
return map.get(args);
}
/**
* Returns true if resolution has already been triggered for a given
* selector name, and arguments set.
*
* @param {Object} state Data state.
* @param {string} selectorName Selector name.
* @param {?Array} args Arguments passed to selector (default `[]`).
*
* @return {boolean} Whether resolution has been triggered.
*/
function hasStartedResolution(state, selectorName) {
var args = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
return getIsResolving(state, selectorName, args) !== undefined;
}
/**
* Returns true if resolution has completed for a given selector
* name, and arguments set.
*
* @param {Object} state Data state.
* @param {string} selectorName Selector name.
* @param {?Array} args Arguments passed to selector.
*
* @return {boolean} Whether resolution has completed.
*/
function hasFinishedResolution(state, selectorName) {
var args = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
return getIsResolving(state, selectorName, args) === false;
}
/**
* Returns true if resolution has been triggered but has not yet completed for
* a given selector name, and arguments set.
*
* @param {Object} state Data state.
* @param {string} selectorName Selector name.
* @param {?Array} args Arguments passed to selector.
*
* @return {boolean} Whether resolution is in progress.
*/
function isResolving(state, selectorName) {
var args = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
return getIsResolving(state, selectorName, args) === true;
}
/**
* Returns the list of the cached resolvers.
*
* @param {Object} state Data state.
*
* @return {Object} Resolvers mapped by args and selectorName.
*/
function getCachedResolvers(state) {
return state;
}
/***/ }),
/***/ "./node_modules/@wordpress/data/build-module/namespace-store/metadata/utils.js":
/*!*************************************************************************************!*\
!*** ./node_modules/@wordpress/data/build-module/namespace-store/metadata/utils.js ***!
\*************************************************************************************/
/*! exports provided: onSubKey */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "onSubKey", function() { return onSubKey; });
/* 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_objectSpread__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectSpread */ "./node_modules/@babel/runtime/helpers/esm/objectSpread.js");
/**
* Higher-order reducer creator which creates a combined reducer object, keyed
* by a property on the action object.
*
* @param {string} actionProperty Action property by which to key object.
*
* @return {Function} Higher-order reducer.
*/
var onSubKey = function onSubKey(actionProperty) {
return function (reducer) {
return function () {
var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
var action = arguments.length > 1 ? arguments[1] : undefined; // Retrieve subkey from action. Do not track if undefined; useful for cases
// where reducer is scoped by action shape.
var key = action[actionProperty];
if (key === undefined) {
return state;
} // Avoid updating state if unchanged. Note that this also accounts for a
// reducer which returns undefined on a key which is not yet tracked.
var nextKeyState = reducer(state[key], action);
if (nextKeyState === state[key]) {
return state;
}
return Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_1__["default"])({}, state, Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__["default"])({}, key, nextKeyState));
};
};
};
/***/ }),
/***/ "./node_modules/@wordpress/data/build-module/plugins/controls/index.js":
/*!*****************************************************************************!*\
!*** ./node_modules/@wordpress/data/build-module/plugins/controls/index.js ***!
\*****************************************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _wordpress_deprecated__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/deprecated */ "./node_modules/@wordpress/deprecated/build-module/index.js");
/**
* WordPress dependencies
*/
/* harmony default export */ __webpack_exports__["default"] = (function (registry) {
Object(_wordpress_deprecated__WEBPACK_IMPORTED_MODULE_0__["default"])('wp.data.plugins.controls', {
hint: 'The controls plugins is now baked-in.'
});
return registry;
});
/***/ }),
/***/ "./node_modules/@wordpress/data/build-module/plugins/index.js":
/*!********************************************************************!*\
!*** ./node_modules/@wordpress/data/build-module/plugins/index.js ***!
\********************************************************************/
/*! exports provided: controls, persistence */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _controls__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./controls */ "./node_modules/@wordpress/data/build-module/plugins/controls/index.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "controls", function() { return _controls__WEBPACK_IMPORTED_MODULE_0__["default"]; });
/* harmony import */ var _persistence__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./persistence */ "./node_modules/@wordpress/data/build-module/plugins/persistence/index.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "persistence", function() { return _persistence__WEBPACK_IMPORTED_MODULE_1__["default"]; });
/***/ }),
/***/ "./node_modules/@wordpress/data/build-module/plugins/persistence/index.js":
/*!********************************************************************************!*\
!*** ./node_modules/@wordpress/data/build-module/plugins/persistence/index.js ***!
\********************************************************************************/
/*! exports provided: withLazySameState, createPersistenceInterface, default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "withLazySameState", function() { return withLazySameState; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createPersistenceInterface", function() { return createPersistenceInterface; });
/* 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_objectSpread__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectSpread */ "./node_modules/@babel/runtime/helpers/esm/objectSpread.js");
/* 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 _storage_default__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./storage/default */ "./node_modules/@wordpress/data/build-module/plugins/persistence/storage/default.js");
/* harmony import */ var ___WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../ */ "./node_modules/@wordpress/data/build-module/index.js");
/**
* External dependencies
*/
/**
* Internal dependencies
*/
/**
* @typedef {Object} WPDataPersistencePluginOptions Persistence plugin options.
*
* @property {Storage} storage Persistent storage implementation. This must
* at least implement `getItem` and `setItem` of
* the Web Storage API.
* @property {string} storageKey Key on which to set in persistent storage.
*
*/
/**
* Default plugin storage.
*
* @type {Storage}
*/
var DEFAULT_STORAGE = _storage_default__WEBPACK_IMPORTED_MODULE_3__["default"];
/**
* Default plugin storage key.
*
* @type {string}
*/
var DEFAULT_STORAGE_KEY = 'WP_DATA';
/**
* Higher-order reducer which invokes the original reducer only if state is
* inequal from that of the action's `nextState` property, otherwise returning
* the original state reference.
*
* @param {Function} reducer Original reducer.
*
* @return {Function} Enhanced reducer.
*/
var withLazySameState = function withLazySameState(reducer) {
return function (state, action) {
if (action.nextState === state) {
return state;
}
return reducer(state, action);
};
};
/**
* Creates a persistence interface, exposing getter and setter methods (`get`
* and `set` respectively).
*
* @param {WPDataPersistencePluginOptions} options Plugin options.
*
* @return {Object} Persistence interface.
*/
function createPersistenceInterface(options) {
var _options$storage = options.storage,
storage = _options$storage === void 0 ? DEFAULT_STORAGE : _options$storage,
_options$storageKey = options.storageKey,
storageKey = _options$storageKey === void 0 ? DEFAULT_STORAGE_KEY : _options$storageKey;
var data;
/**
* Returns the persisted data as an object, defaulting to an empty object.
*
* @return {Object} Persisted data.
*/
function getData() {
if (data === undefined) {
// If unset, getItem is expected to return null. Fall back to
// empty object.
var persisted = storage.getItem(storageKey);
if (persisted === null) {
data = {};
} else {
try {
data = JSON.parse(persisted);
} catch (error) {
// Similarly, should any error be thrown during parse of
// the string (malformed JSON), fall back to empty object.
data = {};
}
}
}
return data;
}
/**
* Merges an updated reducer state into the persisted data.
*
* @param {string} key Key to update.
* @param {*} value Updated value.
*/
function setData(key, value) {
data = Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_1__["default"])({}, data, Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__["default"])({}, key, value));
storage.setItem(storageKey, JSON.stringify(data));
}
return {
get: getData,
set: setData
};
}
/**
* Data plugin to persist store state into a single storage key.
*
* @param {WPDataRegistry} registry Data registry.
* @param {?WPDataPersistencePluginOptions} pluginOptions Plugin options.
*
* @return {WPDataPlugin} Data plugin.
*/
var persistencePlugin = function persistencePlugin(registry, pluginOptions) {
var persistence = createPersistenceInterface(pluginOptions);
/**
* Creates an enhanced store dispatch function, triggering the state of the
* given reducer key to be persisted when changed.
*
* @param {Function} getState Function which returns current state.
* @param {string} reducerKey Reducer key.
* @param {?Array<string>} keys Optional subset of keys to save.
*
* @return {Function} Enhanced dispatch function.
*/
function createPersistOnChange(getState, reducerKey, keys) {
var getPersistedState;
if (Array.isArray(keys)) {
// Given keys, the persisted state should by produced as an object
// of the subset of keys. This implementation uses combineReducers
// to leverage its behavior of returning the same object when none
// of the property values changes. This allows a strict reference
// equality to bypass a persistence set on an unchanging state.
var reducers = keys.reduce(function (result, key) {
return Object.assign(result, Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__["default"])({}, key, function (state, action) {
return action.nextState[key];
}));
}, {});
getPersistedState = withLazySameState(Object(___WEBPACK_IMPORTED_MODULE_4__["combineReducers"])(reducers));
} else {
getPersistedState = function getPersistedState(state, action) {
return action.nextState;
};
}
var lastState = getPersistedState(undefined, {
nextState: getState()
});
return function () {
var state = getPersistedState(lastState, {
nextState: getState()
});
if (state !== lastState) {
persistence.set(reducerKey, state);
lastState = state;
}
};
}
return {
registerStore: function registerStore(reducerKey, options) {
if (!options.persist) {
return registry.registerStore(reducerKey, options);
} // Load from persistence to use as initial state.
var persistedState = persistence.get()[reducerKey];
if (persistedState !== undefined) {
var initialState = options.reducer(undefined, {
type: '@@WP/PERSISTENCE_RESTORE'
});
if (Object(lodash__WEBPACK_IMPORTED_MODULE_2__["isPlainObject"])(initialState) && Object(lodash__WEBPACK_IMPORTED_MODULE_2__["isPlainObject"])(persistedState)) {
// If state is an object, ensure that:
// - Other keys are left intact when persisting only a
// subset of keys.
// - New keys in what would otherwise be used as initial
// state are deeply merged as base for persisted value.
initialState = Object(lodash__WEBPACK_IMPORTED_MODULE_2__["merge"])({}, initialState, persistedState);
} else {
// If there is a mismatch in object-likeness of default
// initial or persisted state, defer to persisted value.
initialState = persistedState;
}
options = Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_1__["default"])({}, options, {
initialState: initialState
});
}
var store = registry.registerStore(reducerKey, options);
store.subscribe(createPersistOnChange(store.getState, reducerKey, options.persist));
return store;
}
};
};
/**
* Deprecated: Remove this function once WordPress 5.3 is released.
*/
persistencePlugin.__unstableMigrate = function (pluginOptions) {
var persistence = createPersistenceInterface(pluginOptions); // Preferences migration to introduce the block editor module
var insertUsage = Object(lodash__WEBPACK_IMPORTED_MODULE_2__["get"])(persistence.get(), ['core/editor', 'preferences', 'insertUsage']);
if (insertUsage) {
persistence.set('core/block-editor', {
preferences: {
insertUsage: insertUsage
}
});
}
};
/* harmony default export */ __webpack_exports__["default"] = (persistencePlugin);
/***/ }),
/***/ "./node_modules/@wordpress/data/build-module/plugins/persistence/storage/default.js":
/*!******************************************************************************************!*\
!*** ./node_modules/@wordpress/data/build-module/plugins/persistence/storage/default.js ***!
\******************************************************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _object__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./object */ "./node_modules/@wordpress/data/build-module/plugins/persistence/storage/object.js");
/**
* Internal dependencies
*/
var storage;
try {
// Private Browsing in Safari 10 and earlier will throw an error when
// attempting to set into localStorage. The test here is intentional in
// causing a thrown error as condition for using fallback object storage.
storage = window.localStorage;
storage.setItem('__wpDataTestLocalStorage', '');
storage.removeItem('__wpDataTestLocalStorage');
} catch (error) {
storage = _object__WEBPACK_IMPORTED_MODULE_0__["default"];
}
/* harmony default export */ __webpack_exports__["default"] = (storage);
/***/ }),
/***/ "./node_modules/@wordpress/data/build-module/plugins/persistence/storage/object.js":
/*!*****************************************************************************************!*\
!*** ./node_modules/@wordpress/data/build-module/plugins/persistence/storage/object.js ***!
\*****************************************************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
var objectStorage;
var storage = {
getItem: function getItem(key) {
if (!objectStorage || !objectStorage[key]) {
return null;
}
return objectStorage[key];
},
setItem: function setItem(key, value) {
if (!objectStorage) {
storage.clear();
}
objectStorage[key] = String(value);
},
clear: function clear() {
objectStorage = Object.create(null);
}
};
/* harmony default export */ __webpack_exports__["default"] = (storage);
/***/ }),
/***/ "./node_modules/@wordpress/data/build-module/promise-middleware.js":
/*!*************************************************************************!*\
!*** ./node_modules/@wordpress/data/build-module/promise-middleware.js ***!
\*************************************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var is_promise__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! is-promise */ "./node_modules/is-promise/index.js");
/* harmony import */ var is_promise__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(is_promise__WEBPACK_IMPORTED_MODULE_0__);
/**
* External dependencies
*/
/**
* Simplest possible promise redux middleware.
*
* @return {Function} middleware.
*/
var promiseMiddleware = function promiseMiddleware() {
return function (next) {
return function (action) {
if (is_promise__WEBPACK_IMPORTED_MODULE_0___default()(action)) {
return action.then(function (resolvedAction) {
if (resolvedAction) {
return next(resolvedAction);
}
});
}
return next(action);
};
};
};
/* harmony default export */ __webpack_exports__["default"] = (promiseMiddleware);
/***/ }),
/***/ "./node_modules/@wordpress/data/build-module/registry.js":
/*!***************************************************************!*\
!*** ./node_modules/@wordpress/data/build-module/registry.js ***!
\***************************************************************/
/*! exports provided: createRegistry */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createRegistry", function() { return createRegistry; });
/* 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_objectSpread__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectSpread */ "./node_modules/@babel/runtime/helpers/esm/objectSpread.js");
/* 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 _namespace_store__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./namespace-store */ "./node_modules/@wordpress/data/build-module/namespace-store/index.js");
/* harmony import */ var _store__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./store */ "./node_modules/@wordpress/data/build-module/store/index.js");
/**
* External dependencies
*/
/**
* Internal dependencies
*/
/**
* @typedef {Object} WPDataRegistry An isolated orchestrator of store registrations.
*
* @property {Function} registerGenericStore Given a namespace key and settings
* object, registers a new generic
* store.
* @property {Function} registerStore Given a namespace key and settings
* object, registers a new namespace
* store.
* @property {Function} subscribe Given a function callback, invokes
* the callback on any change to state
* within any registered store.
* @property {Function} select Given a namespace key, returns an
* object of the store's registered
* selectors.
* @property {Function} dispatch Given a namespace key, returns an
* object of the store's registered
* action dispatchers.
*/
/**
* @typedef {Object} WPDataPlugin An object of registry function overrides.
*/
/**
* Creates a new store registry, given an optional object of initial store
* configurations.
*
* @param {Object} storeConfigs Initial store configurations.
* @param {Object?} parent Parent registry.
*
* @return {WPDataRegistry} Data registry.
*/
function createRegistry() {
var storeConfigs = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
var parent = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
var stores = {};
var listeners = [];
/**
* Global listener called for each store's update.
*/
function globalListener() {
listeners.forEach(function (listener) {
return listener();
});
}
/**
* Subscribe to changes to any data.
*
* @param {Function} listener Listener function.
*
* @return {Function} Unsubscribe function.
*/
var subscribe = function subscribe(listener) {
listeners.push(listener);
return function () {
listeners = Object(lodash__WEBPACK_IMPORTED_MODULE_2__["without"])(listeners, listener);
};
};
/**
* Calls a selector given the current state and extra arguments.
*
* @param {string} reducerKey Part of the state shape to register the
* selectors for.
*
* @return {*} The selector's returned value.
*/
function select(reducerKey) {
var store = stores[reducerKey];
if (store) {
return store.getSelectors();
}
return parent && parent.select(reducerKey);
}
/**
* Returns the available actions for a part of the state.
*
* @param {string} reducerKey Part of the state shape to dispatch the
* action for.
*
* @return {*} The action's returned value.
*/
function dispatch(reducerKey) {
var store = stores[reducerKey];
if (store) {
return store.getActions();
}
return parent && parent.dispatch(reducerKey);
} //
// Deprecated
// TODO: Remove this after `use()` is removed.
//
function withPlugins(attributes) {
return Object(lodash__WEBPACK_IMPORTED_MODULE_2__["mapValues"])(attributes, function (attribute, key) {
if (typeof attribute !== 'function') {
return attribute;
}
return function () {
return registry[key].apply(null, arguments);
};
});
}
/**
* Registers a generic store.
*
* @param {string} key Store registry key.
* @param {Object} config Configuration (getSelectors, getActions, subscribe).
*/
function registerGenericStore(key, config) {
if (typeof config.getSelectors !== 'function') {
throw new TypeError('config.getSelectors must be a function');
}
if (typeof config.getActions !== 'function') {
throw new TypeError('config.getActions must be a function');
}
if (typeof config.subscribe !== 'function') {
throw new TypeError('config.subscribe must be a function');
}
stores[key] = config;
config.subscribe(globalListener);
}
var registry = {
registerGenericStore: registerGenericStore,
stores: stores,
namespaces: stores,
// TODO: Deprecate/remove this.
subscribe: subscribe,
select: select,
dispatch: dispatch,
use: use
};
/**
* Registers a standard `@wordpress/data` store.
*
* @param {string} reducerKey Reducer key.
* @param {Object} options Store description (reducer, actions, selectors, resolvers).
*
* @return {Object} Registered store object.
*/
registry.registerStore = function (reducerKey, options) {
if (!options.reducer) {
throw new TypeError('Must specify store reducer');
}
var namespace = Object(_namespace_store__WEBPACK_IMPORTED_MODULE_3__["default"])(reducerKey, options, registry);
registerGenericStore(reducerKey, namespace);
return namespace.store;
}; //
// TODO:
// This function will be deprecated as soon as it is no longer internally referenced.
//
function use(plugin, options) {
registry = Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_1__["default"])({}, registry, plugin(registry, options));
return registry;
}
registerGenericStore('core/data', Object(_store__WEBPACK_IMPORTED_MODULE_4__["default"])(registry));
Object.entries(storeConfigs).forEach(function (_ref) {
var _ref2 = Object(_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_0__["default"])(_ref, 2),
name = _ref2[0],
config = _ref2[1];
return registry.registerStore(name, config);
});
if (parent) {
parent.subscribe(globalListener);
}
return withPlugins(registry);
}
/***/ }),
/***/ "./node_modules/@wordpress/data/build-module/resolvers-cache-middleware.js":
/*!*********************************************************************************!*\
!*** ./node_modules/@wordpress/data/build-module/resolvers-cache-middleware.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_slicedToArray__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/slicedToArray */ "./node_modules/@babel/runtime/helpers/esm/slicedToArray.js");
/* 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__);
/**
* External dependencies
*/
/**
* Creates a middleware handling resolvers cache invalidation.
*
* @param {WPDataRegistry} registry The registry reference for which to create
* the middleware.
* @param {string} reducerKey The namespace for which to create the
* middleware.
*
* @return {Function} Middleware function.
*/
var createResolversCacheMiddleware = function createResolversCacheMiddleware(registry, reducerKey) {
return function () {
return function (next) {
return function (action) {
var resolvers = registry.select('core/data').getCachedResolvers(reducerKey);
Object.entries(resolvers).forEach(function (_ref) {
var _ref2 = Object(_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_1__["default"])(_ref, 2),
selectorName = _ref2[0],
resolversByArgs = _ref2[1];
var resolver = Object(lodash__WEBPACK_IMPORTED_MODULE_2__["get"])(registry.stores, [reducerKey, 'resolvers', selectorName]);
if (!resolver || !resolver.shouldInvalidate) {
return;
}
resolversByArgs.forEach(function (value, args) {
// resolversByArgs is the map Map([ args ] => boolean) storing the cache resolution status for a given selector.
// If the value is false it means this resolver has finished its resolution which means we need to invalidate it,
// if it's true it means it's inflight and the invalidation is not necessary.
if (value !== false || !resolver.shouldInvalidate.apply(resolver, [action].concat(Object(_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_0__["default"])(args)))) {
return;
} // Trigger cache invalidation
registry.dispatch('core/data').invalidateResolution(reducerKey, selectorName, args);
});
});
return next(action);
};
};
};
};
/* harmony default export */ __webpack_exports__["default"] = (createResolversCacheMiddleware);
/***/ }),
/***/ "./node_modules/@wordpress/data/build-module/store/index.js":
/*!******************************************************************!*\
!*** ./node_modules/@wordpress/data/build-module/store/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_objectSpread__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectSpread */ "./node_modules/@babel/runtime/helpers/esm/objectSpread.js");
function createCoreDataStore(registry) {
var getCoreDataSelector = function getCoreDataSelector(selectorName) {
return function (reducerKey) {
var _registry$select;
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
args[_key - 1] = arguments[_key];
}
return (_registry$select = registry.select(reducerKey))[selectorName].apply(_registry$select, args);
};
};
var getCoreDataAction = function getCoreDataAction(actionName) {
return function (reducerKey) {
var _registry$dispatch;
for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
args[_key2 - 1] = arguments[_key2];
}
return (_registry$dispatch = registry.dispatch(reducerKey))[actionName].apply(_registry$dispatch, args);
};
};
return {
getSelectors: function getSelectors() {
return ['getIsResolving', 'hasStartedResolution', 'hasFinishedResolution', 'isResolving', 'getCachedResolvers'].reduce(function (memo, selectorName) {
return Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_1__["default"])({}, memo, Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__["default"])({}, selectorName, getCoreDataSelector(selectorName)));
}, {});
},
getActions: function getActions() {
return ['startResolution', 'finishResolution', 'invalidateResolution', 'invalidateResolutionForStore', 'invalidateResolutionForStoreSelector'].reduce(function (memo, actionName) {
return Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_1__["default"])({}, memo, Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__["default"])({}, actionName, getCoreDataAction(actionName)));
}, {});
},
subscribe: function subscribe() {
// There's no reasons to trigger any listener when we subscribe to this store
// because there's no state stored in this store that need to retrigger selectors
// if a change happens, the corresponding store where the tracking stated live
// would have already triggered a "subscribe" call.
return function () {};
}
};
}
/* harmony default export */ __webpack_exports__["default"] = (createCoreDataStore);
/***/ }),
/***/ "./node_modules/@wordpress/deprecated/build-module/index.js":
/*!******************************************************************!*\
!*** ./node_modules/@wordpress/deprecated/build-module/index.js ***!
\******************************************************************/
/*! exports provided: logged, default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "logged", function() { return logged; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return deprecated; });
/* harmony import */ var _wordpress_hooks__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/hooks */ "./node_modules/@wordpress/hooks/build-module/index.js");
/**
* WordPress dependencies
*/
/**
* Object map tracking messages which have been logged, for use in ensuring a
* message is only logged once.
*
* @type {Object}
*/
var logged = Object.create(null);
/**
* Logs a message to notify developers about a deprecated feature.
*
* @param {string} feature Name of the deprecated feature.
* @param {?Object} options Personalisation options
* @param {?string} options.version Version in which the feature will be removed.
* @param {?string} options.alternative Feature to use instead
* @param {?string} options.plugin Plugin name if it's a plugin feature
* @param {?string} options.link Link to documentation
* @param {?string} options.hint Additional message to help transition away from the deprecated feature.
*
* @example
* ```js
* import deprecated from '@wordpress/deprecated';
*
* deprecated( 'Eating meat', {
* version: 'the future',
* alternative: 'vegetables',
* plugin: 'the earth',
* hint: 'You may find it beneficial to transition gradually.',
* } );
*
* // Logs: 'Eating meat is deprecated and will be removed from the earth in the future. Please use vegetables instead. Note: You may find it beneficial to transition gradually.'
* ```
*/
function deprecated(feature) {
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
var version = options.version,
alternative = options.alternative,
plugin = options.plugin,
link = options.link,
hint = options.hint;
var pluginMessage = plugin ? " from ".concat(plugin) : '';
var versionMessage = version ? " and will be removed".concat(pluginMessage, " in version ").concat(version) : '';
var useInsteadMessage = alternative ? " Please use ".concat(alternative, " instead.") : '';
var linkMessage = link ? " See: ".concat(link) : '';
var hintMessage = hint ? " Note: ".concat(hint) : '';
var message = "".concat(feature, " is deprecated").concat(versionMessage, ".").concat(useInsteadMessage).concat(linkMessage).concat(hintMessage); // Skip if already logged.
if (message in logged) {
return;
}
/**
* Fires whenever a deprecated feature is encountered
*
* @param {string} feature Name of the deprecated feature.
* @param {?Object} options Personalisation options
* @param {?string} options.version Version in which the feature will be removed.
* @param {?string} options.alternative Feature to use instead
* @param {?string} options.plugin Plugin name if it's a plugin feature
* @param {?string} options.link Link to documentation
* @param {?string} options.hint Additional message to help transition away from the deprecated feature.
* @param {?string} message Message sent to console.warn
*/
Object(_wordpress_hooks__WEBPACK_IMPORTED_MODULE_0__["doAction"])('deprecated', feature, options, message); // eslint-disable-next-line no-console
console.warn(message);
logged[message] = true;
}
/***/ }),
/***/ "./node_modules/@wordpress/dom-ready/build-module/index.js":
/*!*****************************************************************!*\
!*** ./node_modules/@wordpress/dom-ready/build-module/index.js ***!
\*****************************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/**
* Specify a function to execute when the DOM is fully loaded.
*
* @param {Function} callback A function to execute after the DOM is ready.
*
* @example
* ```js
* import domReady from '@wordpress/dom-ready';
*
* domReady( function() {
* //do something after DOM loads.
* } );
* ```
*
* @return {void}
*/
var domReady = function domReady(callback) {
if (document.readyState === 'complete' || // DOMContentLoaded + Images/Styles/etc loaded, so we call directly.
document.readyState === 'interactive' // DOMContentLoaded fires at this point, so we call directly.
) {
return callback();
} // DOMContentLoaded has not fired yet, delay callback until then.
document.addEventListener('DOMContentLoaded', callback);
};
/* harmony default export */ __webpack_exports__["default"] = (domReady);
/***/ }),
/***/ "./node_modules/@wordpress/dom/build-module/dom.js":
/*!*********************************************************!*\
!*** ./node_modules/@wordpress/dom/build-module/dom.js ***!
\*********************************************************/
/*! exports provided: isHorizontalEdge, isVerticalEdge, getRectangleFromRange, computeCaretRect, placeCaretAtHorizontalEdge, placeCaretAtVerticalEdge, isTextField, documentHasSelection, isEntirelySelected, getScrollContainer, getOffsetParent, replace, remove, insertAfter, unwrap, replaceTag, wrap */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isHorizontalEdge", function() { return isHorizontalEdge; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isVerticalEdge", function() { return isVerticalEdge; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getRectangleFromRange", function() { return getRectangleFromRange; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "computeCaretRect", function() { return computeCaretRect; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "placeCaretAtHorizontalEdge", function() { return placeCaretAtHorizontalEdge; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "placeCaretAtVerticalEdge", function() { return placeCaretAtVerticalEdge; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isTextField", function() { return isTextField; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "documentHasSelection", function() { return documentHasSelection; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isEntirelySelected", function() { return isEntirelySelected; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getScrollContainer", function() { return getScrollContainer; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getOffsetParent", function() { return getOffsetParent; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "replace", function() { return replace; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "remove", function() { return remove; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "insertAfter", function() { return insertAfter; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "unwrap", function() { return unwrap; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "replaceTag", function() { return replaceTag; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "wrap", function() { return wrap; });
/* 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
*/
/**
* Browser dependencies
*/
var _window = window,
getComputedStyle = _window.getComputedStyle;
var _window$Node = window.Node,
TEXT_NODE = _window$Node.TEXT_NODE,
ELEMENT_NODE = _window$Node.ELEMENT_NODE,
DOCUMENT_POSITION_PRECEDING = _window$Node.DOCUMENT_POSITION_PRECEDING,
DOCUMENT_POSITION_FOLLOWING = _window$Node.DOCUMENT_POSITION_FOLLOWING;
/**
* Returns true if the given selection object is in the forward direction, or
* false otherwise.
*
* @see https://developer.mozilla.org/en-US/docs/Web/API/Node/compareDocumentPosition
*
* @param {Selection} selection Selection object to check.
*
* @return {boolean} Whether the selection is forward.
*/
function isSelectionForward(selection) {
var anchorNode = selection.anchorNode,
focusNode = selection.focusNode,
anchorOffset = selection.anchorOffset,
focusOffset = selection.focusOffset;
var position = anchorNode.compareDocumentPosition(focusNode); // Disable reason: `Node#compareDocumentPosition` returns a bitmask value,
// so bitwise operators are intended.
/* eslint-disable no-bitwise */
// Compare whether anchor node precedes focus node. If focus node (where
// end of selection occurs) is after the anchor node, it is forward.
if (position & DOCUMENT_POSITION_PRECEDING) {
return false;
}
if (position & DOCUMENT_POSITION_FOLLOWING) {
return true;
}
/* eslint-enable no-bitwise */
// `compareDocumentPosition` returns 0 when passed the same node, in which
// case compare offsets.
if (position === 0) {
return anchorOffset <= focusOffset;
} // This should never be reached, but return true as default case.
return true;
}
/**
* Check whether the selection is at the edge of the container. Checks for
* horizontal position by default. Set `onlyVertical` to true to check only
* vertically.
*
* @param {Element} container Focusable element.
* @param {boolean} isReverse Set to true to check left, false to check right.
* @param {boolean} onlyVertical Set to true to check only vertical position.
*
* @return {boolean} True if at the edge, false if not.
*/
function isEdge(container, isReverse, onlyVertical) {
if (Object(lodash__WEBPACK_IMPORTED_MODULE_0__["includes"])(['INPUT', 'TEXTAREA'], container.tagName)) {
if (container.selectionStart !== container.selectionEnd) {
return false;
}
if (isReverse) {
return container.selectionStart === 0;
}
return container.value.length === container.selectionStart;
}
if (!container.isContentEditable) {
return true;
}
var selection = window.getSelection();
if (!selection.rangeCount) {
return false;
}
var range = selection.getRangeAt(0).cloneRange();
var isForward = isSelectionForward(selection);
var isCollapsed = selection.isCollapsed; // Collapse in direction of selection.
if (!isCollapsed) {
range.collapse(!isForward);
}
var rangeRect = getRectangleFromRange(range);
if (!rangeRect) {
return false;
}
var computedStyle = window.getComputedStyle(container);
var lineHeight = parseInt(computedStyle.lineHeight, 10) || 0; // Only consider the multiline selection at the edge if the direction is
// towards the edge.
if (!isCollapsed && rangeRect.height > lineHeight && isForward === isReverse) {
return false;
}
var padding = parseInt(computedStyle["padding".concat(isReverse ? 'Top' : 'Bottom')], 10) || 0; // Calculate a buffer that is half the line height. In some browsers, the
// selection rectangle may not fill the entire height of the line, so we add
// 3/4 the line height to the selection rectangle to ensure that it is well
// over its line boundary.
var buffer = 3 * parseInt(lineHeight, 10) / 4;
var containerRect = container.getBoundingClientRect();
var verticalEdge = isReverse ? containerRect.top + padding > rangeRect.top - buffer : containerRect.bottom - padding < rangeRect.bottom + buffer;
if (!verticalEdge) {
return false;
}
if (onlyVertical) {
return true;
} // In the case of RTL scripts, the horizontal edge is at the opposite side.
var direction = computedStyle.direction;
var isReverseDir = direction === 'rtl' ? !isReverse : isReverse; // To calculate the horizontal position, we insert a test range and see if
// this test range has the same horizontal position. This method proves to
// be better than a DOM-based calculation, because it ignores empty text
// nodes and a trailing line break element. In other words, we need to check
// visual positioning, not DOM positioning.
var x = isReverseDir ? containerRect.left + 1 : containerRect.right - 1;
var y = isReverse ? containerRect.top + buffer : containerRect.bottom - buffer;
var testRange = hiddenCaretRangeFromPoint(document, x, y, container);
if (!testRange) {
return false;
}
var side = isReverseDir ? 'left' : 'right';
var testRect = getRectangleFromRange(testRange); // Allow the position to be 1px off.
return Math.abs(testRect[side] - rangeRect[side]) <= 1;
}
/**
* Check whether the selection is horizontally at the edge of the container.
*
* @param {Element} container Focusable element.
* @param {boolean} isReverse Set to true to check left, false for right.
*
* @return {boolean} True if at the horizontal edge, false if not.
*/
function isHorizontalEdge(container, isReverse) {
return isEdge(container, isReverse);
}
/**
* Check whether the selection is vertically at the edge of the container.
*
* @param {Element} container Focusable element.
* @param {boolean} isReverse Set to true to check top, false for bottom.
*
* @return {boolean} True if at the vertical edge, false if not.
*/
function isVerticalEdge(container, isReverse) {
return isEdge(container, isReverse, true);
}
/**
* Get the rectangle of a given Range.
*
* @param {Range} range The range.
*
* @return {DOMRect} The rectangle.
*/
function getRectangleFromRange(range) {
// For uncollapsed ranges, get the rectangle that bounds the contents of the
// range; this a rectangle enclosing the union of the bounding rectangles
// for all the elements in the range.
if (!range.collapsed) {
return range.getBoundingClientRect();
}
var _range = range,
startContainer = _range.startContainer; // Correct invalid "BR" ranges. The cannot contain any children.
if (startContainer.nodeName === 'BR') {
var parentNode = startContainer.parentNode;
var index = Array.from(parentNode.childNodes).indexOf(startContainer);
range = document.createRange();
range.setStart(parentNode, index);
range.setEnd(parentNode, index);
}
var rect = range.getClientRects()[0]; // If the collapsed range starts (and therefore ends) at an element node,
// `getClientRects` can be empty in some browsers. This can be resolved
// by adding a temporary text node with zero-width space to the range.
//
// See: https://stackoverflow.com/a/6847328/995445
if (!rect) {
var padNode = document.createTextNode("\u200B"); // Do not modify the live range.
range = range.cloneRange();
range.insertNode(padNode);
rect = range.getClientRects()[0];
padNode.parentNode.removeChild(padNode);
}
return rect;
}
/**
* Get the rectangle for the selection in a container.
*
* @return {?DOMRect} The rectangle.
*/
function computeCaretRect() {
var selection = window.getSelection();
var range = selection.rangeCount ? selection.getRangeAt(0) : null;
if (!range) {
return;
}
return getRectangleFromRange(range);
}
/**
* Places the caret at start or end of a given element.
*
* @param {Element} container Focusable element.
* @param {boolean} isReverse True for end, false for start.
*/
function placeCaretAtHorizontalEdge(container, isReverse) {
if (!container) {
return;
}
if (Object(lodash__WEBPACK_IMPORTED_MODULE_0__["includes"])(['INPUT', 'TEXTAREA'], container.tagName)) {
container.focus();
if (isReverse) {
container.selectionStart = container.value.length;
container.selectionEnd = container.value.length;
} else {
container.selectionStart = 0;
container.selectionEnd = 0;
}
return;
}
container.focus();
if (!container.isContentEditable) {
return;
} // Select on extent child of the container, not the container itself. This
// avoids the selection always being `endOffset` of 1 when placed at end,
// where `startContainer`, `endContainer` would always be container itself.
var rangeTarget = container[isReverse ? 'lastChild' : 'firstChild']; // If no range target, it implies that the container is empty. Focusing is
// sufficient for caret to be placed correctly.
if (!rangeTarget) {
return;
}
var selection = window.getSelection();
var range = document.createRange();
range.selectNodeContents(rangeTarget);
range.collapse(!isReverse);
selection.removeAllRanges();
selection.addRange(range);
}
/**
* Polyfill.
* Get a collapsed range for a given point.
*
* @see https://developer.mozilla.org/en-US/docs/Web/API/Document/caretRangeFromPoint
*
* @param {Document} doc The document of the range.
* @param {number} x Horizontal position within the current viewport.
* @param {number} y Vertical position within the current viewport.
*
* @return {?Range} The best range for the given point.
*/
function caretRangeFromPoint(doc, x, y) {
if (doc.caretRangeFromPoint) {
return doc.caretRangeFromPoint(x, y);
}
if (!doc.caretPositionFromPoint) {
return null;
}
var point = doc.caretPositionFromPoint(x, y); // If x or y are negative, outside viewport, or there is no text entry node.
// https://developer.mozilla.org/en-US/docs/Web/API/Document/caretRangeFromPoint
if (!point) {
return null;
}
var range = doc.createRange();
range.setStart(point.offsetNode, point.offset);
range.collapse(true);
return range;
}
/**
* Get a collapsed range for a given point.
* Gives the container a temporary high z-index (above any UI).
* This is preferred over getting the UI nodes and set styles there.
*
* @param {Document} doc The document of the range.
* @param {number} x Horizontal position within the current viewport.
* @param {number} y Vertical position within the current viewport.
* @param {Element} container Container in which the range is expected to be found.
*
* @return {?Range} The best range for the given point.
*/
function hiddenCaretRangeFromPoint(doc, x, y, container) {
var originalZIndex = container.style.zIndex;
var originalPosition = container.style.position; // A z-index only works if the element position is not static.
container.style.zIndex = '10000';
container.style.position = 'relative';
var range = caretRangeFromPoint(doc, x, y);
container.style.zIndex = originalZIndex;
container.style.position = originalPosition;
return range;
}
/**
* Places the caret at the top or bottom of a given element.
*
* @param {Element} container Focusable element.
* @param {boolean} isReverse True for bottom, false for top.
* @param {DOMRect} [rect] The rectangle to position the caret with.
* @param {boolean} [mayUseScroll=true] True to allow scrolling, false to disallow.
*/
function placeCaretAtVerticalEdge(container, isReverse, rect) {
var mayUseScroll = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true;
if (!container) {
return;
}
if (!rect || !container.isContentEditable) {
placeCaretAtHorizontalEdge(container, isReverse);
return;
} // Offset by a buffer half the height of the caret rect. This is needed
// because caretRangeFromPoint may default to the end of the selection if
// offset is too close to the edge. It's unclear how to precisely calculate
// this threshold; it may be the padded area of some combination of line
// height, caret height, and font size. The buffer offset is effectively
// equivalent to a point at half the height of a line of text.
var buffer = rect.height / 2;
var editableRect = container.getBoundingClientRect();
var x = rect.left;
var y = isReverse ? editableRect.bottom - buffer : editableRect.top + buffer;
var range = hiddenCaretRangeFromPoint(document, x, y, container);
if (!range || !container.contains(range.startContainer)) {
if (mayUseScroll && (!range || !range.startContainer || !range.startContainer.contains(container))) {
// Might be out of view.
// Easier than attempting to calculate manually.
container.scrollIntoView(isReverse);
placeCaretAtVerticalEdge(container, isReverse, rect, false);
return;
}
placeCaretAtHorizontalEdge(container, isReverse);
return;
}
var selection = window.getSelection();
selection.removeAllRanges();
selection.addRange(range);
container.focus(); // Editable was already focussed, it goes back to old range...
// This fixes it.
selection.removeAllRanges();
selection.addRange(range);
}
/**
* Check whether the given element is a text field, where text field is defined
* by the ability to select within the input, or that it is contenteditable.
*
* See: https://html.spec.whatwg.org/#textFieldSelection
*
* @param {HTMLElement} element The HTML element.
*
* @return {boolean} True if the element is an text field, false if not.
*/
function isTextField(element) {
try {
var nodeName = element.nodeName,
selectionStart = element.selectionStart,
contentEditable = element.contentEditable;
return nodeName === 'INPUT' && selectionStart !== null || nodeName === 'TEXTAREA' || contentEditable === 'true';
} catch (error) {
// Safari throws an exception when trying to get `selectionStart`
// on non-text <input> elements (which, understandably, don't
// have the text selection API). We catch this via a try/catch
// block, as opposed to a more explicit check of the element's
// input types, because of Safari's non-standard behavior. This
// also means we don't have to worry about the list of input
// types that support `selectionStart` changing as the HTML spec
// evolves over time.
return false;
}
}
/**
* Check wether the current document has a selection.
* This checks both for focus in an input field and general text selection.
*
* @return {boolean} True if there is selection, false if not.
*/
function documentHasSelection() {
if (isTextField(document.activeElement)) {
return true;
}
var selection = window.getSelection();
var range = selection.rangeCount ? selection.getRangeAt(0) : null;
return range && !range.collapsed;
}
/**
* Check whether the contents of the element have been entirely selected.
* Returns true if there is no possibility of selection.
*
* @param {Element} element The element to check.
*
* @return {boolean} True if entirely selected, false if not.
*/
function isEntirelySelected(element) {
if (Object(lodash__WEBPACK_IMPORTED_MODULE_0__["includes"])(['INPUT', 'TEXTAREA'], element.nodeName)) {
return element.selectionStart === 0 && element.value.length === element.selectionEnd;
}
if (!element.isContentEditable) {
return true;
}
var selection = window.getSelection();
var range = selection.rangeCount ? selection.getRangeAt(0) : null;
if (!range) {
return true;
}
var startContainer = range.startContainer,
endContainer = range.endContainer,
startOffset = range.startOffset,
endOffset = range.endOffset;
if (startContainer === element && endContainer === element && startOffset === 0 && endOffset === element.childNodes.length) {
return true;
}
var lastChild = element.lastChild;
var lastChildContentLength = lastChild.nodeType === TEXT_NODE ? lastChild.data.length : lastChild.childNodes.length;
return startContainer === element.firstChild && endContainer === element.lastChild && startOffset === 0 && endOffset === lastChildContentLength;
}
/**
* Given a DOM node, finds the closest scrollable container node.
*
* @param {Element} node Node from which to start.
*
* @return {?Element} Scrollable container node, if found.
*/
function getScrollContainer(node) {
if (!node) {
return;
} // Scrollable if scrollable height exceeds displayed...
if (node.scrollHeight > node.clientHeight) {
// ...except when overflow is defined to be hidden or visible
var _window$getComputedSt = window.getComputedStyle(node),
overflowY = _window$getComputedSt.overflowY;
if (/(auto|scroll)/.test(overflowY)) {
return node;
}
} // Continue traversing
return getScrollContainer(node.parentNode);
}
/**
* Returns the closest positioned element, or null under any of the conditions
* of the offsetParent specification. Unlike offsetParent, this function is not
* limited to HTMLElement and accepts any Node (e.g. Node.TEXT_NODE).
*
* @see https://drafts.csswg.org/cssom-view/#dom-htmlelement-offsetparent
*
* @param {Node} node Node from which to find offset parent.
*
* @return {?Node} Offset parent.
*/
function getOffsetParent(node) {
// Cannot retrieve computed style or offset parent only anything other than
// an element node, so find the closest element node.
var closestElement;
while (closestElement = node.parentNode) {
if (closestElement.nodeType === ELEMENT_NODE) {
break;
}
}
if (!closestElement) {
return null;
} // If the closest element is already positioned, return it, as offsetParent
// does not otherwise consider the node itself.
if (getComputedStyle(closestElement).position !== 'static') {
return closestElement;
}
return closestElement.offsetParent;
}
/**
* Given two DOM nodes, replaces the former with the latter in the DOM.
*
* @param {Element} processedNode Node to be removed.
* @param {Element} newNode Node to be inserted in its place.
* @return {void}
*/
function replace(processedNode, newNode) {
insertAfter(newNode, processedNode.parentNode);
remove(processedNode);
}
/**
* Given a DOM node, removes it from the DOM.
*
* @param {Element} node Node to be removed.
* @return {void}
*/
function remove(node) {
node.parentNode.removeChild(node);
}
/**
* Given two DOM nodes, inserts the former in the DOM as the next sibling of
* the latter.
*
* @param {Element} newNode Node to be inserted.
* @param {Element} referenceNode Node after which to perform the insertion.
* @return {void}
*/
function insertAfter(newNode, referenceNode) {
referenceNode.parentNode.insertBefore(newNode, referenceNode.nextSibling);
}
/**
* Unwrap the given node. This means any child nodes are moved to the parent.
*
* @param {Node} node The node to unwrap.
*
* @return {void}
*/
function unwrap(node) {
var parent = node.parentNode;
while (node.firstChild) {
parent.insertBefore(node.firstChild, node);
}
parent.removeChild(node);
}
/**
* Replaces the given node with a new node with the given tag name.
*
* @param {Element} node The node to replace
* @param {string} tagName The new tag name.
*
* @return {Element} The new node.
*/
function replaceTag(node, tagName) {
var newNode = node.ownerDocument.createElement(tagName);
while (node.firstChild) {
newNode.appendChild(node.firstChild);
}
node.parentNode.replaceChild(newNode, node);
return newNode;
}
/**
* Wraps the given node with a new node with the given tag name.
*
* @param {Element} newNode The node to insert.
* @param {Element} referenceNode The node to wrap.
*/
function wrap(newNode, referenceNode) {
referenceNode.parentNode.insertBefore(newNode, referenceNode);
newNode.appendChild(referenceNode);
}
/***/ }),
/***/ "./node_modules/@wordpress/dom/build-module/focusable.js":
/*!***************************************************************!*\
!*** ./node_modules/@wordpress/dom/build-module/focusable.js ***!
\***************************************************************/
/*! exports provided: find */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "find", function() { return find; });
/* 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");
/**
* References:
*
* Focusable:
* - https://www.w3.org/TR/html5/editing.html#focus-management
*
* Sequential focus navigation:
* - https://www.w3.org/TR/html5/editing.html#sequential-focus-navigation-and-the-tabindex-attribute
*
* Disabled elements:
* - https://www.w3.org/TR/html5/disabled-elements.html#disabled-elements
*
* getClientRects algorithm (requiring layout box):
* - https://www.w3.org/TR/cssom-view-1/#extension-to-the-element-interface
*
* AREA elements associated with an IMG:
* - https://w3c.github.io/html/editing.html#data-model
*/
var SELECTOR = ['[tabindex]', 'a[href]', 'button:not([disabled])', 'input:not([type="hidden"]):not([disabled])', 'select:not([disabled])', 'textarea:not([disabled])', 'iframe', 'object', 'embed', 'area[href]', '[contenteditable]:not([contenteditable=false])'].join(',');
/**
* Returns true if the specified element is visible (i.e. neither display: none
* nor visibility: hidden).
*
* @param {Element} element DOM element to test.
*
* @return {boolean} Whether element is visible.
*/
function isVisible(element) {
return element.offsetWidth > 0 || element.offsetHeight > 0 || element.getClientRects().length > 0;
}
/**
* Returns true if the specified area element is a valid focusable element, or
* false otherwise. Area is only focusable if within a map where a named map
* referenced by an image somewhere in the document.
*
* @param {Element} element DOM area element to test.
*
* @return {boolean} Whether area element is valid for focus.
*/
function isValidFocusableArea(element) {
var map = element.closest('map[name]');
if (!map) {
return false;
}
var img = document.querySelector('img[usemap="#' + map.name + '"]');
return !!img && isVisible(img);
}
/**
* Returns all focusable elements within a given context.
*
* @param {Element} context Element in which to search.
*
* @return {Element[]} Focusable elements.
*/
function find(context) {
var elements = context.querySelectorAll(SELECTOR);
return Object(_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_0__["default"])(elements).filter(function (element) {
if (!isVisible(element)) {
return false;
}
var nodeName = element.nodeName;
if ('AREA' === nodeName) {
return isValidFocusableArea(element);
}
return true;
});
}
/***/ }),
/***/ "./node_modules/@wordpress/dom/build-module/index.js":
/*!***********************************************************!*\
!*** ./node_modules/@wordpress/dom/build-module/index.js ***!
\***********************************************************/
/*! exports provided: focus, isHorizontalEdge, isVerticalEdge, getRectangleFromRange, computeCaretRect, placeCaretAtHorizontalEdge, placeCaretAtVerticalEdge, isTextField, documentHasSelection, isEntirelySelected, getScrollContainer, getOffsetParent, replace, remove, insertAfter, unwrap, replaceTag, wrap */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "focus", function() { return focus; });
/* harmony import */ var _focusable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./focusable */ "./node_modules/@wordpress/dom/build-module/focusable.js");
/* harmony import */ var _tabbable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./tabbable */ "./node_modules/@wordpress/dom/build-module/tabbable.js");
/* harmony import */ var _dom__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./dom */ "./node_modules/@wordpress/dom/build-module/dom.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isHorizontalEdge", function() { return _dom__WEBPACK_IMPORTED_MODULE_2__["isHorizontalEdge"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isVerticalEdge", function() { return _dom__WEBPACK_IMPORTED_MODULE_2__["isVerticalEdge"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getRectangleFromRange", function() { return _dom__WEBPACK_IMPORTED_MODULE_2__["getRectangleFromRange"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "computeCaretRect", function() { return _dom__WEBPACK_IMPORTED_MODULE_2__["computeCaretRect"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "placeCaretAtHorizontalEdge", function() { return _dom__WEBPACK_IMPORTED_MODULE_2__["placeCaretAtHorizontalEdge"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "placeCaretAtVerticalEdge", function() { return _dom__WEBPACK_IMPORTED_MODULE_2__["placeCaretAtVerticalEdge"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isTextField", function() { return _dom__WEBPACK_IMPORTED_MODULE_2__["isTextField"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "documentHasSelection", function() { return _dom__WEBPACK_IMPORTED_MODULE_2__["documentHasSelection"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isEntirelySelected", function() { return _dom__WEBPACK_IMPORTED_MODULE_2__["isEntirelySelected"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getScrollContainer", function() { return _dom__WEBPACK_IMPORTED_MODULE_2__["getScrollContainer"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getOffsetParent", function() { return _dom__WEBPACK_IMPORTED_MODULE_2__["getOffsetParent"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "replace", function() { return _dom__WEBPACK_IMPORTED_MODULE_2__["replace"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "remove", function() { return _dom__WEBPACK_IMPORTED_MODULE_2__["remove"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "insertAfter", function() { return _dom__WEBPACK_IMPORTED_MODULE_2__["insertAfter"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "unwrap", function() { return _dom__WEBPACK_IMPORTED_MODULE_2__["unwrap"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "replaceTag", function() { return _dom__WEBPACK_IMPORTED_MODULE_2__["replaceTag"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "wrap", function() { return _dom__WEBPACK_IMPORTED_MODULE_2__["wrap"]; });
/**
* Internal dependencies
*/
/**
* Object grouping `focusable` and `tabbable` utils
* under the keys with the same name.
*/
var focus = {
focusable: _focusable__WEBPACK_IMPORTED_MODULE_0__,
tabbable: _tabbable__WEBPACK_IMPORTED_MODULE_1__
};
/***/ }),
/***/ "./node_modules/@wordpress/dom/build-module/tabbable.js":
/*!**************************************************************!*\
!*** ./node_modules/@wordpress/dom/build-module/tabbable.js ***!
\**************************************************************/
/*! exports provided: isTabbableIndex, find */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isTabbableIndex", function() { return isTabbableIndex; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "find", function() { return find; });
/* 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__);
/* harmony import */ var _focusable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./focusable */ "./node_modules/@wordpress/dom/build-module/focusable.js");
/**
* External dependencies
*/
/**
* Internal dependencies
*/
/**
* Returns the tab index of the given element. In contrast with the tabIndex
* property, this normalizes the default (0) to avoid browser inconsistencies,
* operating under the assumption that this function is only ever called with a
* focusable node.
*
* @see https://bugzilla.mozilla.org/show_bug.cgi?id=1190261
*
* @param {Element} element Element from which to retrieve.
*
* @return {?number} Tab index of element (default 0).
*/
function getTabIndex(element) {
var tabIndex = element.getAttribute('tabindex');
return tabIndex === null ? 0 : parseInt(tabIndex, 10);
}
/**
* Returns true if the specified element is tabbable, or false otherwise.
*
* @param {Element} element Element to test.
*
* @return {boolean} Whether element is tabbable.
*/
function isTabbableIndex(element) {
return getTabIndex(element) !== -1;
}
/**
* Returns a stateful reducer function which constructs a filtered array of
* tabbable elements, where at most one radio input is selected for a given
* name, giving priority to checked input, falling back to the first
* encountered.
*
* @return {Function} Radio group collapse reducer.
*/
function createStatefulCollapseRadioGroup() {
var CHOSEN_RADIO_BY_NAME = {};
return function collapseRadioGroup(result, element) {
var nodeName = element.nodeName,
type = element.type,
checked = element.checked,
name = element.name; // For all non-radio tabbables, construct to array by concatenating.
if (nodeName !== 'INPUT' || type !== 'radio' || !name) {
return result.concat(element);
}
var hasChosen = CHOSEN_RADIO_BY_NAME.hasOwnProperty(name); // Omit by skipping concatenation if the radio element is not chosen.
var isChosen = checked || !hasChosen;
if (!isChosen) {
return result;
} // At this point, if there had been a chosen element, the current
// element is checked and should take priority. Retroactively remove
// the element which had previously been considered the chosen one.
if (hasChosen) {
var hadChosenElement = CHOSEN_RADIO_BY_NAME[name];
result = Object(lodash__WEBPACK_IMPORTED_MODULE_0__["without"])(result, hadChosenElement);
}
CHOSEN_RADIO_BY_NAME[name] = element;
return result.concat(element);
};
}
/**
* An array map callback, returning an object with the element value and its
* array index location as properties. This is used to emulate a proper stable
* sort where equal tabIndex should be left in order of their occurrence in the
* document.
*
* @param {Element} element Element.
* @param {number} index Array index of element.
*
* @return {Object} Mapped object with element, index.
*/
function mapElementToObjectTabbable(element, index) {
return {
element: element,
index: index
};
}
/**
* An array map callback, returning an element of the given mapped object's
* element value.
*
* @param {Object} object Mapped object with index.
*
* @return {Element} Mapped object element.
*/
function mapObjectTabbableToElement(object) {
return object.element;
}
/**
* A sort comparator function used in comparing two objects of mapped elements.
*
* @see mapElementToObjectTabbable
*
* @param {Object} a First object to compare.
* @param {Object} b Second object to compare.
*
* @return {number} Comparator result.
*/
function compareObjectTabbables(a, b) {
var aTabIndex = getTabIndex(a.element);
var bTabIndex = getTabIndex(b.element);
if (aTabIndex === bTabIndex) {
return a.index - b.index;
}
return aTabIndex - bTabIndex;
}
function find(context) {
return Object(_focusable__WEBPACK_IMPORTED_MODULE_1__["find"])(context).filter(isTabbableIndex).map(mapElementToObjectTabbable).sort(compareObjectTabbables).map(mapObjectTabbableToElement).reduce(createStatefulCollapseRadioGroup(), []);
}
/***/ }),
/***/ "./node_modules/@wordpress/element/build-module/index.js":
/*!***************************************************************!*\
!*** ./node_modules/@wordpress/element/build-module/index.js ***!
\***************************************************************/
/*! exports provided: renderToString, RawHTML, Children, cloneElement, Component, createContext, createElement, createRef, forwardRef, Fragment, isValidElement, memo, StrictMode, useCallback, useContext, useDebugValue, useEffect, useImperativeHandle, useLayoutEffect, useMemo, useReducer, useRef, useState, lazy, Suspense, concatChildren, switchChildrenNodeName, createPortal, findDOMNode, render, unmountComponentAtNode, isEmptyElement */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./react */ "./node_modules/@wordpress/element/build-module/react.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Children", function() { return _react__WEBPACK_IMPORTED_MODULE_0__["Children"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "cloneElement", function() { return _react__WEBPACK_IMPORTED_MODULE_0__["cloneElement"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Component", function() { return _react__WEBPACK_IMPORTED_MODULE_0__["Component"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "createContext", function() { return _react__WEBPACK_IMPORTED_MODULE_0__["createContext"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "createElement", function() { return _react__WEBPACK_IMPORTED_MODULE_0__["createElement"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "createRef", function() { return _react__WEBPACK_IMPORTED_MODULE_0__["createRef"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "forwardRef", function() { return _react__WEBPACK_IMPORTED_MODULE_0__["forwardRef"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Fragment", function() { return _react__WEBPACK_IMPORTED_MODULE_0__["Fragment"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isValidElement", function() { return _react__WEBPACK_IMPORTED_MODULE_0__["isValidElement"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "memo", function() { return _react__WEBPACK_IMPORTED_MODULE_0__["memo"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "StrictMode", function() { return _react__WEBPACK_IMPORTED_MODULE_0__["StrictMode"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "useCallback", function() { return _react__WEBPACK_IMPORTED_MODULE_0__["useCallback"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "useContext", function() { return _react__WEBPACK_IMPORTED_MODULE_0__["useContext"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "useDebugValue", function() { return _react__WEBPACK_IMPORTED_MODULE_0__["useDebugValue"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "useEffect", function() { return _react__WEBPACK_IMPORTED_MODULE_0__["useEffect"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "useImperativeHandle", function() { return _react__WEBPACK_IMPORTED_MODULE_0__["useImperativeHandle"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "useLayoutEffect", function() { return _react__WEBPACK_IMPORTED_MODULE_0__["useLayoutEffect"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "useMemo", function() { return _react__WEBPACK_IMPORTED_MODULE_0__["useMemo"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "useReducer", function() { return _react__WEBPACK_IMPORTED_MODULE_0__["useReducer"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "useRef", function() { return _react__WEBPACK_IMPORTED_MODULE_0__["useRef"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "useState", function() { return _react__WEBPACK_IMPORTED_MODULE_0__["useState"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "lazy", function() { return _react__WEBPACK_IMPORTED_MODULE_0__["lazy"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Suspense", function() { return _react__WEBPACK_IMPORTED_MODULE_0__["Suspense"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "concatChildren", function() { return _react__WEBPACK_IMPORTED_MODULE_0__["concatChildren"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "switchChildrenNodeName", function() { return _react__WEBPACK_IMPORTED_MODULE_0__["switchChildrenNodeName"]; });
/* harmony import */ var _react_platform__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./react-platform */ "./node_modules/@wordpress/element/build-module/react-platform.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "createPortal", function() { return _react_platform__WEBPACK_IMPORTED_MODULE_1__["createPortal"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "findDOMNode", function() { return _react_platform__WEBPACK_IMPORTED_MODULE_1__["findDOMNode"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "render", function() { return _react_platform__WEBPACK_IMPORTED_MODULE_1__["render"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "unmountComponentAtNode", function() { return _react_platform__WEBPACK_IMPORTED_MODULE_1__["unmountComponentAtNode"]; });
/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./utils */ "./node_modules/@wordpress/element/build-module/utils.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isEmptyElement", function() { return _utils__WEBPACK_IMPORTED_MODULE_2__["isEmptyElement"]; });
/* harmony import */ var _serialize__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./serialize */ "./node_modules/@wordpress/element/build-module/serialize.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "renderToString", function() { return _serialize__WEBPACK_IMPORTED_MODULE_3__["default"]; });
/* harmony import */ var _raw_html__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./raw-html */ "./node_modules/@wordpress/element/build-module/raw-html.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "RawHTML", function() { return _raw_html__WEBPACK_IMPORTED_MODULE_4__["default"]; });
/***/ }),
/***/ "./node_modules/@wordpress/element/build-module/raw-html.js":
/*!******************************************************************!*\
!*** ./node_modules/@wordpress/element/build-module/raw-html.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 RawHTML; });
/* 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 _react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./react */ "./node_modules/@wordpress/element/build-module/react.js");
/**
* Internal dependencies
*/
/**
* Component used as equivalent of Fragment with unescaped HTML, in cases where
* it is desirable to render dangerous HTML without needing a wrapper element.
* To preserve additional props, a `div` wrapper _will_ be created if any props
* aside from `children` are passed.
*
* @param {Object} props
* @param {string} props.children HTML to render.
* @param {Object} props.props Any additonal props to be set on the containing div.
*
* @return {WPElement} Dangerously-rendering element.
*/
function RawHTML(_ref) {
var children = _ref.children,
props = Object(_babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__["default"])(_ref, ["children"]); // The DIV wrapper will be stripped by serializer, unless there are
// non-children props present.
return Object(_react__WEBPACK_IMPORTED_MODULE_2__["createElement"])('div', Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_0__["default"])({
dangerouslySetInnerHTML: {
__html: children
}
}, props));
}
/***/ }),
/***/ "./node_modules/@wordpress/element/build-module/react-platform.js":
/*!************************************************************************!*\
!*** ./node_modules/@wordpress/element/build-module/react-platform.js ***!
\************************************************************************/
/*! exports provided: createPortal, findDOMNode, render, unmountComponentAtNode */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react-dom */ "react-dom");
/* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_dom__WEBPACK_IMPORTED_MODULE_0__);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "createPortal", function() { return react_dom__WEBPACK_IMPORTED_MODULE_0__["createPortal"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "findDOMNode", function() { return react_dom__WEBPACK_IMPORTED_MODULE_0__["findDOMNode"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "render", function() { return react_dom__WEBPACK_IMPORTED_MODULE_0__["render"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "unmountComponentAtNode", function() { return react_dom__WEBPACK_IMPORTED_MODULE_0__["unmountComponentAtNode"]; });
/**
* External dependencies
*/
/**
* Creates a portal into which a component can be rendered.
*
* @see https://github.com/facebook/react/issues/10309#issuecomment-318433235
*
* @param {Component} component Component
* @param {Element} target DOM node into which element should be rendered
*/
/**
* Finds the dom node of a React component
*
* @param {Component} component component's instance
* @param {Element} target DOM node into which element should be rendered
*/
/**
* Renders a given element into the target DOM node.
*
* @param {WPElement} element Element to render
* @param {Element} target DOM node into which element should be rendered
*/
/**
* Removes any mounted element from the target DOM node.
*
* @param {Element} target DOM node in which element is to be removed
*/
/***/ }),
/***/ "./node_modules/@wordpress/element/build-module/react.js":
/*!***************************************************************!*\
!*** ./node_modules/@wordpress/element/build-module/react.js ***!
\***************************************************************/
/*! exports provided: Children, cloneElement, Component, createContext, createElement, createRef, forwardRef, Fragment, isValidElement, memo, StrictMode, useCallback, useContext, useDebugValue, useEffect, useImperativeHandle, useLayoutEffect, useMemo, useReducer, useRef, useState, lazy, Suspense, concatChildren, switchChildrenNodeName */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "concatChildren", function() { return concatChildren; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "switchChildrenNodeName", function() { return switchChildrenNodeName; });
/* 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 react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ "react");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Children", function() { return react__WEBPACK_IMPORTED_MODULE_2__["Children"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "cloneElement", function() { return react__WEBPACK_IMPORTED_MODULE_2__["cloneElement"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Component", function() { return react__WEBPACK_IMPORTED_MODULE_2__["Component"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "createContext", function() { return react__WEBPACK_IMPORTED_MODULE_2__["createContext"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "createElement", function() { return react__WEBPACK_IMPORTED_MODULE_2__["createElement"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "createRef", function() { return react__WEBPACK_IMPORTED_MODULE_2__["createRef"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "forwardRef", function() { return react__WEBPACK_IMPORTED_MODULE_2__["forwardRef"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Fragment", function() { return react__WEBPACK_IMPORTED_MODULE_2__["Fragment"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isValidElement", function() { return react__WEBPACK_IMPORTED_MODULE_2__["isValidElement"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "memo", function() { return react__WEBPACK_IMPORTED_MODULE_2__["memo"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "StrictMode", function() { return react__WEBPACK_IMPORTED_MODULE_2__["StrictMode"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "useCallback", function() { return react__WEBPACK_IMPORTED_MODULE_2__["useCallback"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "useContext", function() { return react__WEBPACK_IMPORTED_MODULE_2__["useContext"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "useDebugValue", function() { return react__WEBPACK_IMPORTED_MODULE_2__["useDebugValue"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "useEffect", function() { return react__WEBPACK_IMPORTED_MODULE_2__["useEffect"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "useImperativeHandle", function() { return react__WEBPACK_IMPORTED_MODULE_2__["useImperativeHandle"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "useLayoutEffect", function() { return react__WEBPACK_IMPORTED_MODULE_2__["useLayoutEffect"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "useMemo", function() { return react__WEBPACK_IMPORTED_MODULE_2__["useMemo"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "useReducer", function() { return react__WEBPACK_IMPORTED_MODULE_2__["useReducer"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "useRef", function() { return react__WEBPACK_IMPORTED_MODULE_2__["useRef"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "useState", function() { return react__WEBPACK_IMPORTED_MODULE_2__["useState"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "lazy", function() { return react__WEBPACK_IMPORTED_MODULE_2__["lazy"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Suspense", function() { return react__WEBPACK_IMPORTED_MODULE_2__["Suspense"]; });
/* 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__);
/**
* External dependencies
*/
/**
* Object that provides utilities for dealing with React children.
*/
/**
* Creates a copy of an element with extended props.
*
* @param {WPElement} element Element
* @param {?Object} props Props to apply to cloned element
*
* @return {WPElement} Cloned element.
*/
/**
* A base class to create WordPress Components (Refs, state and lifecycle hooks)
*/
/**
* Creates a context object containing two components: a provider and consumer.
*
* @param {Object} defaultValue A default data stored in the context.
*
* @return {Object} Context object.
*/
/**
* Returns a new element of given type. Type can be either a string tag name or
* another function which itself returns an element.
*
* @param {?(string|Function)} type Tag name or element creator
* @param {Object} props Element properties, either attribute
* set to apply to DOM node or values to
* pass through to element creator
* @param {...WPElement} children Descendant elements
*
* @return {WPElement} Element.
*/
/**
* Returns an object tracking a reference to a rendered element via its
* `current` property as either a DOMElement or Element, dependent upon the
* type of element rendered with the ref attribute.
*
* @return {Object} Ref object.
*/
/**
* Component enhancer used to enable passing a ref to its wrapped component.
* Pass a function argument which receives `props` and `ref` as its arguments,
* returning an element using the forwarded ref. The return value is a new
* component which forwards its ref.
*
* @param {Function} forwarder Function passed `props` and `ref`, expected to
* return an element.
*
* @return {WPComponent} Enhanced component.
*/
/**
* A component which renders its children without any wrapping element.
*/
/**
* Checks if an object is a valid WPElement
*
* @param {Object} objectToCheck The object to be checked.
*
* @return {boolean} true if objectToTest is a valid WPElement and false otherwise.
*/
/**
* @see https://reactjs.org/docs/react-api.html#reactmemo
*/
/**
* Component that activates additional checks and warnings for its descendants.
*/
/**
* @see https://reactjs.org/docs/hooks-reference.html#usecallback
*/
/**
* @see https://reactjs.org/docs/hooks-reference.html#usecontext
*/
/**
* @see https://reactjs.org/docs/hooks-reference.html#usedebugvalue
*/
/**
* @see https://reactjs.org/docs/hooks-reference.html#useeffect
*/
/**
* @see https://reactjs.org/docs/hooks-reference.html#useimperativehandle
*/
/**
* @see https://reactjs.org/docs/hooks-reference.html#uselayouteffect
*/
/**
* @see https://reactjs.org/docs/hooks-reference.html#usememo
*/
/**
* @see https://reactjs.org/docs/hooks-reference.html#usereducer
*/
/**
* @see https://reactjs.org/docs/hooks-reference.html#useref
*/
/**
* @see https://reactjs.org/docs/hooks-reference.html#usestate
*/
/**
* @see https://reactjs.org/docs/react-api.html#reactlazy
*/
/**
* @see https://reactjs.org/docs/react-api.html#reactsuspense
*/
/**
* Concatenate two or more React children objects.
*
* @param {...?Object} childrenArguments Array of children arguments (array of arrays/strings/objects) to concatenate.
*
* @return {Array} The concatenated value.
*/
function concatChildren() {
for (var _len = arguments.length, childrenArguments = new Array(_len), _key = 0; _key < _len; _key++) {
childrenArguments[_key] = arguments[_key];
}
return childrenArguments.reduce(function (result, children, i) {
react__WEBPACK_IMPORTED_MODULE_2__["Children"].forEach(children, function (child, j) {
if (child && 'string' !== typeof child) {
child = Object(react__WEBPACK_IMPORTED_MODULE_2__["cloneElement"])(child, {
key: [i, j].join()
});
}
result.push(child);
});
return result;
}, []);
}
/**
* Switches the nodeName of all the elements in the children object.
*
* @param {?Object} children Children object.
* @param {string} nodeName Node name.
*
* @return {?Object} The updated children object.
*/
function switchChildrenNodeName(children, nodeName) {
return children && react__WEBPACK_IMPORTED_MODULE_2__["Children"].map(children, function (elt, index) {
if (Object(lodash__WEBPACK_IMPORTED_MODULE_3__["isString"])(elt)) {
return Object(react__WEBPACK_IMPORTED_MODULE_2__["createElement"])(nodeName, {
key: index
}, elt);
}
var _elt$props = elt.props,
childrenProp = _elt$props.children,
props = Object(_babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__["default"])(_elt$props, ["children"]);
return Object(react__WEBPACK_IMPORTED_MODULE_2__["createElement"])(nodeName, Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_0__["default"])({
key: index
}, props), childrenProp);
});
}
/***/ }),
/***/ "./node_modules/@wordpress/element/build-module/serialize.js":
/*!*******************************************************************!*\
!*** ./node_modules/@wordpress/element/build-module/serialize.js ***!
\*******************************************************************/
/*! exports provided: hasPrefix, renderElement, renderNativeComponent, renderComponent, renderAttributes, renderStyle, default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "hasPrefix", function() { return hasPrefix; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderElement", function() { return renderElement; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderNativeComponent", function() { return renderNativeComponent; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderComponent", function() { return renderComponent; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderAttributes", function() { return renderAttributes; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderStyle", function() { return renderStyle; });
/* 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 _babel_runtime_helpers_esm_typeof__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/typeof */ "./node_modules/@babel/runtime/helpers/esm/typeof.js");
/* 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_escape_html__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/escape-html */ "./node_modules/@wordpress/escape-html/build-module/index.js");
/* harmony import */ var _react__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./react */ "./node_modules/@wordpress/element/build-module/react.js");
/* harmony import */ var _raw_html__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./raw-html */ "./node_modules/@wordpress/element/build-module/raw-html.js");
/**
* Parts of this source were derived and modified from fast-react-render,
* released under the MIT license.
*
* https://github.com/alt-j/fast-react-render
*
* Copyright (c) 2016 Andrey Morozov
*
* 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.
*/
/**
* External dependencies
*/
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
var _createContext = Object(_react__WEBPACK_IMPORTED_MODULE_5__["createContext"])(),
Provider = _createContext.Provider,
Consumer = _createContext.Consumer;
var ForwardRef = Object(_react__WEBPACK_IMPORTED_MODULE_5__["forwardRef"])(function () {
return null;
});
/**
* Valid attribute types.
*
* @type {Set}
*/
var ATTRIBUTES_TYPES = new Set(['string', 'boolean', 'number']);
/**
* Element tags which can be self-closing.
*
* @type {Set}
*/
var SELF_CLOSING_TAGS = new Set(['area', 'base', 'br', 'col', 'command', 'embed', 'hr', 'img', 'input', 'keygen', 'link', 'meta', 'param', 'source', 'track', 'wbr']);
/**
* Boolean attributes are attributes whose presence as being assigned is
* meaningful, even if only empty.
*
* See: https://html.spec.whatwg.org/multipage/common-microsyntaxes.html#boolean-attributes
* Extracted from: https://html.spec.whatwg.org/multipage/indices.html#attributes-3
*
* Object.keys( [ ...document.querySelectorAll( '#attributes-1 > tbody > tr' ) ]
* .filter( ( tr ) => tr.lastChild.textContent.indexOf( 'Boolean attribute' ) !== -1 )
* .reduce( ( result, tr ) => Object.assign( result, {
* [ tr.firstChild.textContent.trim() ]: true
* } ), {} ) ).sort();
*
* @type {Set}
*/
var BOOLEAN_ATTRIBUTES = new Set(['allowfullscreen', 'allowpaymentrequest', 'allowusermedia', 'async', 'autofocus', 'autoplay', 'checked', 'controls', 'default', 'defer', 'disabled', 'download', 'formnovalidate', 'hidden', 'ismap', 'itemscope', 'loop', 'multiple', 'muted', 'nomodule', 'novalidate', 'open', 'playsinline', 'readonly', 'required', 'reversed', 'selected', 'typemustmatch']);
/**
* Enumerated attributes are attributes which must be of a specific value form.
* Like boolean attributes, these are meaningful if specified, even if not of a
* valid enumerated value.
*
* See: https://html.spec.whatwg.org/multipage/common-microsyntaxes.html#enumerated-attribute
* Extracted from: https://html.spec.whatwg.org/multipage/indices.html#attributes-3
*
* Object.keys( [ ...document.querySelectorAll( '#attributes-1 > tbody > tr' ) ]
* .filter( ( tr ) => /^("(.+?)";?\s*)+/.test( tr.lastChild.textContent.trim() ) )
* .reduce( ( result, tr ) => Object.assign( result, {
* [ tr.firstChild.textContent.trim() ]: true
* } ), {} ) ).sort();
*
* Some notable omissions:
*
* - `alt`: https://blog.whatwg.org/omit-alt
*
* @type {Set}
*/
var ENUMERATED_ATTRIBUTES = new Set(['autocapitalize', 'autocomplete', 'charset', 'contenteditable', 'crossorigin', 'decoding', 'dir', 'draggable', 'enctype', 'formenctype', 'formmethod', 'http-equiv', 'inputmode', 'kind', 'method', 'preload', 'scope', 'shape', 'spellcheck', 'translate', 'type', 'wrap']);
/**
* Set of CSS style properties which support assignment of unitless numbers.
* Used in rendering of style properties, where `px` unit is assumed unless
* property is included in this set or value is zero.
*
* Generated via:
*
* Object.entries( document.createElement( 'div' ).style )
* .filter( ( [ key ] ) => (
* ! /^(webkit|ms|moz)/.test( key ) &&
* ( e.style[ key ] = 10 ) &&
* e.style[ key ] === '10'
* ) )
* .map( ( [ key ] ) => key )
* .sort();
*
* @type {Set}
*/
var CSS_PROPERTIES_SUPPORTS_UNITLESS = new Set(['animation', 'animationIterationCount', 'baselineShift', 'borderImageOutset', 'borderImageSlice', 'borderImageWidth', 'columnCount', 'cx', 'cy', 'fillOpacity', 'flexGrow', 'flexShrink', 'floodOpacity', 'fontWeight', 'gridColumnEnd', 'gridColumnStart', 'gridRowEnd', 'gridRowStart', 'lineHeight', 'opacity', 'order', 'orphans', 'r', 'rx', 'ry', 'shapeImageThreshold', 'stopOpacity', 'strokeDasharray', 'strokeDashoffset', 'strokeMiterlimit', 'strokeOpacity', 'strokeWidth', 'tabSize', 'widows', 'x', 'y', 'zIndex', 'zoom']);
/**
* Returns true if the specified string is prefixed by one of an array of
* possible prefixes.
*
* @param {string} string String to check.
* @param {string[]} prefixes Possible prefixes.
*
* @return {boolean} Whether string has prefix.
*/
function hasPrefix(string, prefixes) {
return prefixes.some(function (prefix) {
return string.indexOf(prefix) === 0;
});
}
/**
* Returns true if the given prop name should be ignored in attributes
* serialization, or false otherwise.
*
* @param {string} attribute Attribute to check.
*
* @return {boolean} Whether attribute should be ignored.
*/
function isInternalAttribute(attribute) {
return 'key' === attribute || 'children' === attribute;
}
/**
* Returns the normal form of the element's attribute value for HTML.
*
* @param {string} attribute Attribute name.
* @param {*} value Non-normalized attribute value.
*
* @return {string} Normalized attribute value.
*/
function getNormalAttributeValue(attribute, value) {
switch (attribute) {
case 'style':
return renderStyle(value);
}
return value;
}
/**
* Returns the normal form of the element's attribute name for HTML.
*
* @param {string} attribute Non-normalized attribute name.
*
* @return {string} Normalized attribute name.
*/
function getNormalAttributeName(attribute) {
switch (attribute) {
case 'htmlFor':
return 'for';
case 'className':
return 'class';
}
return attribute.toLowerCase();
}
/**
* Returns the normal form of the style property name for HTML.
*
* - Converts property names to kebab-case, e.g. 'backgroundColor' → 'background-color'
* - Leaves custom attributes alone, e.g. '--myBackgroundColor' → '--myBackgroundColor'
* - Converts vendor-prefixed property names to -kebab-case, e.g. 'MozTransform' → '-moz-transform'
*
* @param {string} property Property name.
*
* @return {string} Normalized property name.
*/
function getNormalStylePropertyName(property) {
if (Object(lodash__WEBPACK_IMPORTED_MODULE_3__["startsWith"])(property, '--')) {
return property;
}
if (hasPrefix(property, ['ms', 'O', 'Moz', 'Webkit'])) {
return '-' + Object(lodash__WEBPACK_IMPORTED_MODULE_3__["kebabCase"])(property);
}
return Object(lodash__WEBPACK_IMPORTED_MODULE_3__["kebabCase"])(property);
}
/**
* Returns the normal form of the style property value for HTML. Appends a
* default pixel unit if numeric, not a unitless property, and not zero.
*
* @param {string} property Property name.
* @param {*} value Non-normalized property value.
*
* @return {*} Normalized property value.
*/
function getNormalStylePropertyValue(property, value) {
if (typeof value === 'number' && 0 !== value && !CSS_PROPERTIES_SUPPORTS_UNITLESS.has(property)) {
return value + 'px';
}
return value;
}
/**
* Serializes a React element to string.
*
* @param {WPElement} element Element to serialize.
* @param {?Object} context Context object.
* @param {?Object} legacyContext Legacy context object.
*
* @return {string} Serialized element.
*/
function renderElement(element, context) {
var legacyContext = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
if (null === element || undefined === element || false === element) {
return '';
}
if (Array.isArray(element)) {
return renderChildren(element, context, legacyContext);
}
switch (Object(_babel_runtime_helpers_esm_typeof__WEBPACK_IMPORTED_MODULE_2__["default"])(element)) {
case 'string':
return Object(_wordpress_escape_html__WEBPACK_IMPORTED_MODULE_4__["escapeHTML"])(element);
case 'number':
return element.toString();
}
var type = element.type,
props = element.props;
switch (type) {
case _react__WEBPACK_IMPORTED_MODULE_5__["StrictMode"]:
case _react__WEBPACK_IMPORTED_MODULE_5__["Fragment"]:
return renderChildren(props.children, context, legacyContext);
case _raw_html__WEBPACK_IMPORTED_MODULE_6__["default"]:
var children = props.children,
wrapperProps = Object(_babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__["default"])(props, ["children"]);
return renderNativeComponent(Object(lodash__WEBPACK_IMPORTED_MODULE_3__["isEmpty"])(wrapperProps) ? null : 'div', Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_0__["default"])({}, wrapperProps, {
dangerouslySetInnerHTML: {
__html: children
}
}), context, legacyContext);
}
switch (Object(_babel_runtime_helpers_esm_typeof__WEBPACK_IMPORTED_MODULE_2__["default"])(type)) {
case 'string':
return renderNativeComponent(type, props, context, legacyContext);
case 'function':
if (type.prototype && typeof type.prototype.render === 'function') {
return renderComponent(type, props, context, legacyContext);
}
return renderElement(type(props, legacyContext), context, legacyContext);
}
switch (type && type.$$typeof) {
case Provider.$$typeof:
return renderChildren(props.children, props.value, legacyContext);
case Consumer.$$typeof:
return renderElement(props.children(context || type._currentValue), context, legacyContext);
case ForwardRef.$$typeof:
return renderElement(type.render(props), context, legacyContext);
}
return '';
}
/**
* Serializes a native component type to string.
*
* @param {?string} type Native component type to serialize, or null if
* rendering as fragment of children content.
* @param {Object} props Props object.
* @param {?Object} context Context object.
* @param {?Object} legacyContext Legacy context object.
*
* @return {string} Serialized element.
*/
function renderNativeComponent(type, props, context) {
var legacyContext = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
var content = '';
if (type === 'textarea' && props.hasOwnProperty('value')) {
// Textarea children can be assigned as value prop. If it is, render in
// place of children. Ensure to omit so it is not assigned as attribute
// as well.
content = renderChildren(props.value, context, legacyContext);
props = Object(lodash__WEBPACK_IMPORTED_MODULE_3__["omit"])(props, 'value');
} else if (props.dangerouslySetInnerHTML && typeof props.dangerouslySetInnerHTML.__html === 'string') {
// Dangerous content is left unescaped.
content = props.dangerouslySetInnerHTML.__html;
} else if (typeof props.children !== 'undefined') {
content = renderChildren(props.children, context, legacyContext);
}
if (!type) {
return content;
}
var attributes = renderAttributes(props);
if (SELF_CLOSING_TAGS.has(type)) {
return '<' + type + attributes + '/>';
}
return '<' + type + attributes + '>' + content + '</' + type + '>';
}
/**
* Serializes a non-native component type to string.
*
* @param {Function} Component Component type to serialize.
* @param {Object} props Props object.
* @param {?Object} context Context object.
* @param {?Object} legacyContext Legacy context object.
*
* @return {string} Serialized element
*/
function renderComponent(Component, props, context) {
var legacyContext = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
var instance = new Component(props, legacyContext);
if (typeof instance.getChildContext === 'function') {
Object.assign(legacyContext, instance.getChildContext());
}
var html = renderElement(instance.render(), context, legacyContext);
return html;
}
/**
* Serializes an array of children to string.
*
* @param {Array} children Children to serialize.
* @param {?Object} context Context object.
* @param {?Object} legacyContext Legacy context object.
*
* @return {string} Serialized children.
*/
function renderChildren(children, context) {
var legacyContext = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
var result = '';
children = Object(lodash__WEBPACK_IMPORTED_MODULE_3__["castArray"])(children);
for (var i = 0; i < children.length; i++) {
var child = children[i];
result += renderElement(child, context, legacyContext);
}
return result;
}
/**
* Renders a props object as a string of HTML attributes.
*
* @param {Object} props Props object.
*
* @return {string} Attributes string.
*/
function renderAttributes(props) {
var result = '';
for (var key in props) {
var attribute = getNormalAttributeName(key);
if (!Object(_wordpress_escape_html__WEBPACK_IMPORTED_MODULE_4__["isValidAttributeName"])(attribute)) {
continue;
}
var value = getNormalAttributeValue(key, props[key]); // If value is not of serializeable type, skip.
if (!ATTRIBUTES_TYPES.has(Object(_babel_runtime_helpers_esm_typeof__WEBPACK_IMPORTED_MODULE_2__["default"])(value))) {
continue;
} // Don't render internal attribute names.
if (isInternalAttribute(key)) {
continue;
}
var isBooleanAttribute = BOOLEAN_ATTRIBUTES.has(attribute); // Boolean attribute should be omitted outright if its value is false.
if (isBooleanAttribute && value === false) {
continue;
}
var isMeaningfulAttribute = isBooleanAttribute || hasPrefix(key, ['data-', 'aria-']) || ENUMERATED_ATTRIBUTES.has(attribute); // Only write boolean value as attribute if meaningful.
if (typeof value === 'boolean' && !isMeaningfulAttribute) {
continue;
}
result += ' ' + attribute; // Boolean attributes should write attribute name, but without value.
// Mere presence of attribute name is effective truthiness.
if (isBooleanAttribute) {
continue;
}
if (typeof value === 'string') {
value = Object(_wordpress_escape_html__WEBPACK_IMPORTED_MODULE_4__["escapeAttribute"])(value);
}
result += '="' + value + '"';
}
return result;
}
/**
* Renders a style object as a string attribute value.
*
* @param {Object} style Style object.
*
* @return {string} Style attribute value.
*/
function renderStyle(style) {
// Only generate from object, e.g. tolerate string value.
if (!Object(lodash__WEBPACK_IMPORTED_MODULE_3__["isPlainObject"])(style)) {
return style;
}
var result;
for (var property in style) {
var value = style[property];
if (null === value || undefined === value) {
continue;
}
if (result) {
result += ';';
} else {
result = '';
}
var normalName = getNormalStylePropertyName(property);
var normalValue = getNormalStylePropertyValue(property, value);
result += normalName + ':' + normalValue;
}
return result;
}
/* harmony default export */ __webpack_exports__["default"] = (renderElement);
/***/ }),
/***/ "./node_modules/@wordpress/element/build-module/utils.js":
/*!***************************************************************!*\
!*** ./node_modules/@wordpress/element/build-module/utils.js ***!
\***************************************************************/
/*! exports provided: isEmptyElement */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isEmptyElement", function() { return isEmptyElement; });
/* 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
*/
/**
* Checks if the provided WP element is empty.
*
* @param {*} element WP element to check.
* @return {boolean} True when an element is considered empty.
*/
var isEmptyElement = function isEmptyElement(element) {
if (Object(lodash__WEBPACK_IMPORTED_MODULE_0__["isNumber"])(element)) {
return false;
}
if (Object(lodash__WEBPACK_IMPORTED_MODULE_0__["isString"])(element) || Object(lodash__WEBPACK_IMPORTED_MODULE_0__["isArray"])(element)) {
return !element.length;
}
return !element;
};
/***/ }),
/***/ "./node_modules/@wordpress/escape-html/build-module/escape-greater.js":
/*!****************************************************************************!*\
!*** ./node_modules/@wordpress/escape-html/build-module/escape-greater.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 __unstableEscapeGreaterThan; });
/**
* Returns a string with greater-than sign replaced.
*
* Note that if a resolution for Trac#45387 comes to fruition, it is no longer
* necessary for `__unstableEscapeGreaterThan` to exist.
*
* See: https://core.trac.wordpress.org/ticket/45387
*
* @param {string} value Original string.
*
* @return {string} Escaped string.
*/
function __unstableEscapeGreaterThan(value) {
return value.replace(/>/g, '>');
}
/***/ }),
/***/ "./node_modules/@wordpress/escape-html/build-module/index.js":
/*!*******************************************************************!*\
!*** ./node_modules/@wordpress/escape-html/build-module/index.js ***!
\*******************************************************************/
/*! exports provided: escapeAmpersand, escapeQuotationMark, escapeLessThan, escapeAttribute, escapeHTML, isValidAttributeName */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "escapeAmpersand", function() { return escapeAmpersand; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "escapeQuotationMark", function() { return escapeQuotationMark; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "escapeLessThan", function() { return escapeLessThan; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "escapeAttribute", function() { return escapeAttribute; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "escapeHTML", function() { return escapeHTML; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isValidAttributeName", function() { return isValidAttributeName; });
/* harmony import */ var _escape_greater__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./escape-greater */ "./node_modules/@wordpress/escape-html/build-module/escape-greater.js");
/**
* Internal dependencies
*/
/**
* Regular expression matching invalid attribute names.
*
* "Attribute names must consist of one or more characters other than controls,
* U+0020 SPACE, U+0022 ("), U+0027 ('), U+003E (>), U+002F (/), U+003D (=),
* and noncharacters."
*
* @see https://html.spec.whatwg.org/multipage/syntax.html#attributes-2
*
* @type {RegExp}
*/
var REGEXP_INVALID_ATTRIBUTE_NAME = /[\u007F-\u009F "'>/="\uFDD0-\uFDEF]/;
/**
* Returns a string with ampersands escaped. Note that this is an imperfect
* implementation, where only ampersands which do not appear as a pattern of
* named, decimal, or hexadecimal character references are escaped. Invalid
* named references (i.e. ambiguous ampersand) are are still permitted.
*
* @see https://w3c.github.io/html/syntax.html#character-references
* @see https://w3c.github.io/html/syntax.html#ambiguous-ampersand
* @see https://w3c.github.io/html/syntax.html#named-character-references
*
* @param {string} value Original string.
*
* @return {string} Escaped string.
*/
function escapeAmpersand(value) {
return value.replace(/&(?!([a-z0-9]+|#[0-9]+|#x[a-f0-9]+);)/gi, '&');
}
/**
* Returns a string with quotation marks replaced.
*
* @param {string} value Original string.
*
* @return {string} Escaped string.
*/
function escapeQuotationMark(value) {
return value.replace(/"/g, '"');
}
/**
* Returns a string with less-than sign replaced.
*
* @param {string} value Original string.
*
* @return {string} Escaped string.
*/
function escapeLessThan(value) {
return value.replace(/</g, '<');
}
/**
* Returns an escaped attribute value.
*
* @see https://w3c.github.io/html/syntax.html#elements-attributes
*
* "[...] the text cannot contain an ambiguous ampersand [...] must not contain
* any literal U+0022 QUOTATION MARK characters (")"
*
* Note we also escape the greater than symbol, as this is used by wptexturize to
* split HTML strings. This is a WordPress specific fix
*
* Note that if a resolution for Trac#45387 comes to fruition, it is no longer
* necessary for `__unstableEscapeGreaterThan` to be used.
*
* See: https://core.trac.wordpress.org/ticket/45387
*
* @param {string} value Attribute value.
*
* @return {string} Escaped attribute value.
*/
function escapeAttribute(value) {
return Object(_escape_greater__WEBPACK_IMPORTED_MODULE_0__["default"])(escapeQuotationMark(escapeAmpersand(value)));
}
/**
* Returns an escaped HTML element value.
*
* @see https://w3c.github.io/html/syntax.html#writing-html-documents-elements
*
* "the text must not contain the character U+003C LESS-THAN SIGN (<) or an
* ambiguous ampersand."
*
* @param {string} value Element value.
*
* @return {string} Escaped HTML element value.
*/
function escapeHTML(value) {
return escapeLessThan(escapeAmpersand(value));
}
/**
* Returns true if the given attribute name is valid, or false otherwise.
*
* @param {string} name Attribute name to test.
*
* @return {boolean} Whether attribute is valid.
*/
function isValidAttributeName(name) {
return !REGEXP_INVALID_ATTRIBUTE_NAME.test(name);
}
/***/ }),
/***/ "./node_modules/@wordpress/hooks/build-module/createAddHook.js":
/*!*********************************************************************!*\
!*** ./node_modules/@wordpress/hooks/build-module/createAddHook.js ***!
\*********************************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _validateNamespace_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./validateNamespace.js */ "./node_modules/@wordpress/hooks/build-module/validateNamespace.js");
/* harmony import */ var _validateHookName_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./validateHookName.js */ "./node_modules/@wordpress/hooks/build-module/validateHookName.js");
/* harmony import */ var ___WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./ */ "./node_modules/@wordpress/hooks/build-module/index.js");
/**
* Internal dependencies
*/
/**
* Returns a function which, when invoked, will add a hook.
*
* @param {Object} hooks Stored hooks, keyed by hook name.
*
* @return {Function} Function that adds a new hook.
*/
function createAddHook(hooks) {
/**
* Adds the hook to the appropriate hooks container.
*
* @param {string} hookName Name of hook to add
* @param {string} namespace The unique namespace identifying the callback in the form `vendor/plugin/function`.
* @param {Function} callback Function to call when the hook is run
* @param {?number} priority Priority of this hook (default=10)
*/
return function addHook(hookName, namespace, callback) {
var priority = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 10;
if (!Object(_validateHookName_js__WEBPACK_IMPORTED_MODULE_1__["default"])(hookName)) {
return;
}
if (!Object(_validateNamespace_js__WEBPACK_IMPORTED_MODULE_0__["default"])(namespace)) {
return;
}
if ('function' !== typeof callback) {
// eslint-disable-next-line no-console
console.error('The hook callback must be a function.');
return;
} // Validate numeric priority
if ('number' !== typeof priority) {
// eslint-disable-next-line no-console
console.error('If specified, the hook priority must be a number.');
return;
}
var handler = {
callback: callback,
priority: priority,
namespace: namespace
};
if (hooks[hookName]) {
// Find the correct insert index of the new hook.
var handlers = hooks[hookName].handlers;
var i;
for (i = handlers.length; i > 0; i--) {
if (priority >= handlers[i - 1].priority) {
break;
}
}
if (i === handlers.length) {
// If append, operate via direct assignment.
handlers[i] = handler;
} else {
// Otherwise, insert before index via splice.
handlers.splice(i, 0, handler);
} // We may also be currently executing this hook. If the callback
// we're adding would come after the current callback, there's no
// problem; otherwise we need to increase the execution index of
// any other runs by 1 to account for the added element.
(hooks.__current || []).forEach(function (hookInfo) {
if (hookInfo.name === hookName && hookInfo.currentIndex >= i) {
hookInfo.currentIndex++;
}
});
} else {
// This is the first hook of its type.
hooks[hookName] = {
handlers: [handler],
runs: 0
};
}
if (hookName !== 'hookAdded') {
Object(___WEBPACK_IMPORTED_MODULE_2__["doAction"])('hookAdded', hookName, namespace, callback, priority);
}
};
}
/* harmony default export */ __webpack_exports__["default"] = (createAddHook);
/***/ }),
/***/ "./node_modules/@wordpress/hooks/build-module/createCurrentHook.js":
/*!*************************************************************************!*\
!*** ./node_modules/@wordpress/hooks/build-module/createCurrentHook.js ***!
\*************************************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/**
* Returns a function which, when invoked, will return the name of the
* currently running hook, or `null` if no hook of the given type is currently
* running.
*
* @param {Object} hooks Stored hooks, keyed by hook name.
*
* @return {Function} Function that returns the current hook.
*/
function createCurrentHook(hooks) {
/**
* Returns the name of the currently running hook, or `null` if no hook of
* the given type is currently running.
*
* @return {?string} The name of the currently running hook, or
* `null` if no hook is currently running.
*/
return function currentHook() {
if (!hooks.__current || !hooks.__current.length) {
return null;
}
return hooks.__current[hooks.__current.length - 1].name;
};
}
/* harmony default export */ __webpack_exports__["default"] = (createCurrentHook);
/***/ }),
/***/ "./node_modules/@wordpress/hooks/build-module/createDidHook.js":
/*!*********************************************************************!*\
!*** ./node_modules/@wordpress/hooks/build-module/createDidHook.js ***!
\*********************************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _validateHookName_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./validateHookName.js */ "./node_modules/@wordpress/hooks/build-module/validateHookName.js");
/**
* Internal dependencies
*/
/**
* Returns a function which, when invoked, will return the number of times a
* hook has been called.
*
* @param {Object} hooks Stored hooks, keyed by hook name.
*
* @return {Function} Function that returns a hook's call count.
*/
function createDidHook(hooks) {
/**
* Returns the number of times an action has been fired.
*
* @param {string} hookName The hook name to check.
*
* @return {number} The number of times the hook has run.
*/
return function didHook(hookName) {
if (!Object(_validateHookName_js__WEBPACK_IMPORTED_MODULE_0__["default"])(hookName)) {
return;
}
return hooks[hookName] && hooks[hookName].runs ? hooks[hookName].runs : 0;
};
}
/* harmony default export */ __webpack_exports__["default"] = (createDidHook);
/***/ }),
/***/ "./node_modules/@wordpress/hooks/build-module/createDoingHook.js":
/*!***********************************************************************!*\
!*** ./node_modules/@wordpress/hooks/build-module/createDoingHook.js ***!
\***********************************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/**
* Returns a function which, when invoked, will return whether a hook is
* currently being executed.
*
* @param {Object} hooks Stored hooks, keyed by hook name.
*
* @return {Function} Function that returns whether a hook is currently
* being executed.
*/
function createDoingHook(hooks) {
/**
* Returns whether a hook is currently being executed.
*
* @param {?string} hookName The name of the hook to check for. If
* omitted, will check for any hook being executed.
*
* @return {boolean} Whether the hook is being executed.
*/
return function doingHook(hookName) {
// If the hookName was not passed, check for any current hook.
if ('undefined' === typeof hookName) {
return 'undefined' !== typeof hooks.__current[0];
} // Return the __current hook.
return hooks.__current[0] ? hookName === hooks.__current[0].name : false;
};
}
/* harmony default export */ __webpack_exports__["default"] = (createDoingHook);
/***/ }),
/***/ "./node_modules/@wordpress/hooks/build-module/createHasHook.js":
/*!*********************************************************************!*\
!*** ./node_modules/@wordpress/hooks/build-module/createHasHook.js ***!
\*********************************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/**
* Returns a function which, when invoked, will return whether any handlers are
* attached to a particular hook.
*
* @param {Object} hooks Stored hooks, keyed by hook name.
*
* @return {Function} Function that returns whether any handlers are
* attached to a particular hook and optional namespace.
*/
function createHasHook(hooks) {
/**
* Returns whether any handlers are attached for the given hookName and optional namespace.
*
* @param {string} hookName The name of the hook to check for.
* @param {?string} namespace Optional. The unique namespace identifying the callback
* in the form `vendor/plugin/function`.
*
* @return {boolean} Whether there are handlers that are attached to the given hook.
*/
return function hasHook(hookName, namespace) {
// Use the namespace if provided.
if ('undefined' !== typeof namespace) {
return hookName in hooks && hooks[hookName].handlers.some(function (hook) {
return hook.namespace === namespace;
});
}
return hookName in hooks;
};
}
/* harmony default export */ __webpack_exports__["default"] = (createHasHook);
/***/ }),
/***/ "./node_modules/@wordpress/hooks/build-module/createHooks.js":
/*!*******************************************************************!*\
!*** ./node_modules/@wordpress/hooks/build-module/createHooks.js ***!
\*******************************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _createAddHook__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./createAddHook */ "./node_modules/@wordpress/hooks/build-module/createAddHook.js");
/* harmony import */ var _createRemoveHook__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./createRemoveHook */ "./node_modules/@wordpress/hooks/build-module/createRemoveHook.js");
/* harmony import */ var _createHasHook__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./createHasHook */ "./node_modules/@wordpress/hooks/build-module/createHasHook.js");
/* harmony import */ var _createRunHook__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./createRunHook */ "./node_modules/@wordpress/hooks/build-module/createRunHook.js");
/* harmony import */ var _createCurrentHook__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./createCurrentHook */ "./node_modules/@wordpress/hooks/build-module/createCurrentHook.js");
/* harmony import */ var _createDoingHook__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./createDoingHook */ "./node_modules/@wordpress/hooks/build-module/createDoingHook.js");
/* harmony import */ var _createDidHook__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./createDidHook */ "./node_modules/@wordpress/hooks/build-module/createDidHook.js");
/**
* Internal dependencies
*/
/**
* Returns an instance of the hooks object.
*
* @return {Object} Object that contains all hooks.
*/
function createHooks() {
var actions = Object.create(null);
var filters = Object.create(null);
actions.__current = [];
filters.__current = [];
return {
addAction: Object(_createAddHook__WEBPACK_IMPORTED_MODULE_0__["default"])(actions),
addFilter: Object(_createAddHook__WEBPACK_IMPORTED_MODULE_0__["default"])(filters),
removeAction: Object(_createRemoveHook__WEBPACK_IMPORTED_MODULE_1__["default"])(actions),
removeFilter: Object(_createRemoveHook__WEBPACK_IMPORTED_MODULE_1__["default"])(filters),
hasAction: Object(_createHasHook__WEBPACK_IMPORTED_MODULE_2__["default"])(actions),
hasFilter: Object(_createHasHook__WEBPACK_IMPORTED_MODULE_2__["default"])(filters),
removeAllActions: Object(_createRemoveHook__WEBPACK_IMPORTED_MODULE_1__["default"])(actions, true),
removeAllFilters: Object(_createRemoveHook__WEBPACK_IMPORTED_MODULE_1__["default"])(filters, true),
doAction: Object(_createRunHook__WEBPACK_IMPORTED_MODULE_3__["default"])(actions),
applyFilters: Object(_createRunHook__WEBPACK_IMPORTED_MODULE_3__["default"])(filters, true),
currentAction: Object(_createCurrentHook__WEBPACK_IMPORTED_MODULE_4__["default"])(actions),
currentFilter: Object(_createCurrentHook__WEBPACK_IMPORTED_MODULE_4__["default"])(filters),
doingAction: Object(_createDoingHook__WEBPACK_IMPORTED_MODULE_5__["default"])(actions),
doingFilter: Object(_createDoingHook__WEBPACK_IMPORTED_MODULE_5__["default"])(filters),
didAction: Object(_createDidHook__WEBPACK_IMPORTED_MODULE_6__["default"])(actions),
didFilter: Object(_createDidHook__WEBPACK_IMPORTED_MODULE_6__["default"])(filters),
actions: actions,
filters: filters
};
}
/* harmony default export */ __webpack_exports__["default"] = (createHooks);
/***/ }),
/***/ "./node_modules/@wordpress/hooks/build-module/createRemoveHook.js":
/*!************************************************************************!*\
!*** ./node_modules/@wordpress/hooks/build-module/createRemoveHook.js ***!
\************************************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _validateNamespace_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./validateNamespace.js */ "./node_modules/@wordpress/hooks/build-module/validateNamespace.js");
/* harmony import */ var _validateHookName_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./validateHookName.js */ "./node_modules/@wordpress/hooks/build-module/validateHookName.js");
/* harmony import */ var ___WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./ */ "./node_modules/@wordpress/hooks/build-module/index.js");
/**
* Internal dependencies
*/
/**
* Returns a function which, when invoked, will remove a specified hook or all
* hooks by the given name.
*
* @param {Object} hooks Stored hooks, keyed by hook name.
* @param {boolean} removeAll Whether to remove all callbacks for a hookName, without regard to namespace. Used to create `removeAll*` functions.
*
* @return {Function} Function that removes hooks.
*/
function createRemoveHook(hooks, removeAll) {
/**
* Removes the specified callback (or all callbacks) from the hook with a
* given hookName and namespace.
*
* @param {string} hookName The name of the hook to modify.
* @param {string} namespace The unique namespace identifying the callback in the form `vendor/plugin/function`.
*
* @return {number} The number of callbacks removed.
*/
return function removeHook(hookName, namespace) {
if (!Object(_validateHookName_js__WEBPACK_IMPORTED_MODULE_1__["default"])(hookName)) {
return;
}
if (!removeAll && !Object(_validateNamespace_js__WEBPACK_IMPORTED_MODULE_0__["default"])(namespace)) {
return;
} // Bail if no hooks exist by this name
if (!hooks[hookName]) {
return 0;
}
var handlersRemoved = 0;
if (removeAll) {
handlersRemoved = hooks[hookName].handlers.length;
hooks[hookName] = {
runs: hooks[hookName].runs,
handlers: []
};
} else {
// Try to find the specified callback to remove.
var handlers = hooks[hookName].handlers;
var _loop = function _loop(i) {
if (handlers[i].namespace === namespace) {
handlers.splice(i, 1);
handlersRemoved++; // This callback may also be part of a hook that is
// currently executing. If the callback we're removing
// comes after the current callback, there's no problem;
// otherwise we need to decrease the execution index of any
// other runs by 1 to account for the removed element.
(hooks.__current || []).forEach(function (hookInfo) {
if (hookInfo.name === hookName && hookInfo.currentIndex >= i) {
hookInfo.currentIndex--;
}
});
}
};
for (var i = handlers.length - 1; i >= 0; i--) {
_loop(i);
}
}
if (hookName !== 'hookRemoved') {
Object(___WEBPACK_IMPORTED_MODULE_2__["doAction"])('hookRemoved', hookName, namespace);
}
return handlersRemoved;
};
}
/* harmony default export */ __webpack_exports__["default"] = (createRemoveHook);
/***/ }),
/***/ "./node_modules/@wordpress/hooks/build-module/createRunHook.js":
/*!*********************************************************************!*\
!*** ./node_modules/@wordpress/hooks/build-module/createRunHook.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");
/**
* Returns a function which, when invoked, will execute all callbacks
* registered to a hook of the specified type, optionally returning the final
* value of the call chain.
*
* @param {Object} hooks Stored hooks, keyed by hook name.
* @param {?boolean} returnFirstArg Whether each hook callback is expected to
* return its first argument.
*
* @return {Function} Function that runs hook callbacks.
*/
function createRunHook(hooks, returnFirstArg) {
/**
* Runs all callbacks for the specified hook.
*
* @param {string} hookName The name of the hook to run.
* @param {...*} args Arguments to pass to the hook callbacks.
*
* @return {*} Return value of runner, if applicable.
*/
return function runHooks(hookName) {
if (!hooks[hookName]) {
hooks[hookName] = {
handlers: [],
runs: 0
};
}
hooks[hookName].runs++;
var handlers = hooks[hookName].handlers; // The following code is stripped from production builds.
if (true) {
// Handle any 'all' hooks registered.
if ('hookAdded' !== hookName && hooks.all) {
handlers.push.apply(handlers, Object(_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_0__["default"])(hooks.all.handlers));
}
}
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
args[_key - 1] = arguments[_key];
}
if (!handlers || !handlers.length) {
return returnFirstArg ? args[0] : undefined;
}
var hookInfo = {
name: hookName,
currentIndex: 0
};
hooks.__current.push(hookInfo);
while (hookInfo.currentIndex < handlers.length) {
var handler = handlers[hookInfo.currentIndex];
var result = handler.callback.apply(null, args);
if (returnFirstArg) {
args[0] = result;
}
hookInfo.currentIndex++;
}
hooks.__current.pop();
if (returnFirstArg) {
return args[0];
}
};
}
/* harmony default export */ __webpack_exports__["default"] = (createRunHook);
/***/ }),
/***/ "./node_modules/@wordpress/hooks/build-module/index.js":
/*!*************************************************************!*\
!*** ./node_modules/@wordpress/hooks/build-module/index.js ***!
\*************************************************************/
/*! exports provided: createHooks, addAction, addFilter, removeAction, removeFilter, hasAction, hasFilter, removeAllActions, removeAllFilters, doAction, applyFilters, currentAction, currentFilter, doingAction, doingFilter, didAction, didFilter, actions, filters */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addAction", function() { return addAction; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addFilter", function() { return addFilter; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "removeAction", function() { return removeAction; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "removeFilter", function() { return removeFilter; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "hasAction", function() { return hasAction; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "hasFilter", function() { return hasFilter; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "removeAllActions", function() { return removeAllActions; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "removeAllFilters", function() { return removeAllFilters; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "doAction", function() { return doAction; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "applyFilters", function() { return applyFilters; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "currentAction", function() { return currentAction; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "currentFilter", function() { return currentFilter; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "doingAction", function() { return doingAction; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "doingFilter", function() { return doingFilter; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "didAction", function() { return didAction; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "didFilter", function() { return didFilter; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "actions", function() { return actions; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "filters", function() { return filters; });
/* harmony import */ var _createHooks__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./createHooks */ "./node_modules/@wordpress/hooks/build-module/createHooks.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "createHooks", function() { return _createHooks__WEBPACK_IMPORTED_MODULE_0__["default"]; });
/**
* Internal dependencies
*/
var _createHooks = Object(_createHooks__WEBPACK_IMPORTED_MODULE_0__["default"])(),
addAction = _createHooks.addAction,
addFilter = _createHooks.addFilter,
removeAction = _createHooks.removeAction,
removeFilter = _createHooks.removeFilter,
hasAction = _createHooks.hasAction,
hasFilter = _createHooks.hasFilter,
removeAllActions = _createHooks.removeAllActions,
removeAllFilters = _createHooks.removeAllFilters,
doAction = _createHooks.doAction,
applyFilters = _createHooks.applyFilters,
currentAction = _createHooks.currentAction,
currentFilter = _createHooks.currentFilter,
doingAction = _createHooks.doingAction,
doingFilter = _createHooks.doingFilter,
didAction = _createHooks.didAction,
didFilter = _createHooks.didFilter,
actions = _createHooks.actions,
filters = _createHooks.filters;
/***/ }),
/***/ "./node_modules/@wordpress/hooks/build-module/validateHookName.js":
/*!************************************************************************!*\
!*** ./node_modules/@wordpress/hooks/build-module/validateHookName.js ***!
\************************************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/**
* Validate a hookName string.
*
* @param {string} hookName The hook name to validate. Should be a non empty string containing
* only numbers, letters, dashes, periods and underscores. Also,
* the hook name cannot begin with `__`.
*
* @return {boolean} Whether the hook name is valid.
*/
function validateHookName(hookName) {
if ('string' !== typeof hookName || '' === hookName) {
// eslint-disable-next-line no-console
console.error('The hook name must be a non-empty string.');
return false;
}
if (/^__/.test(hookName)) {
// eslint-disable-next-line no-console
console.error('The hook name cannot begin with `__`.');
return false;
}
if (!/^[a-zA-Z][a-zA-Z0-9_.-]*$/.test(hookName)) {
// eslint-disable-next-line no-console
console.error('The hook name can only contain numbers, letters, dashes, periods and underscores.');
return false;
}
return true;
}
/* harmony default export */ __webpack_exports__["default"] = (validateHookName);
/***/ }),
/***/ "./node_modules/@wordpress/hooks/build-module/validateNamespace.js":
/*!*************************************************************************!*\
!*** ./node_modules/@wordpress/hooks/build-module/validateNamespace.js ***!
\*************************************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/**
* Validate a namespace string.
*
* @param {string} namespace The namespace to validate - should take the form
* `vendor/plugin/function`.
*
* @return {boolean} Whether the namespace is valid.
*/
function validateNamespace(namespace) {
if ('string' !== typeof namespace || '' === namespace) {
// eslint-disable-next-line no-console
console.error('The namespace must be a non-empty string.');
return false;
}
if (!/^[a-zA-Z][a-zA-Z0-9_.\-\/]*$/.test(namespace)) {
// eslint-disable-next-line no-console
console.error('The namespace can only contain numbers, letters, dashes, periods, underscores and slashes.');
return false;
}
return true;
}
/* harmony default export */ __webpack_exports__["default"] = (validateNamespace);
/***/ }),
/***/ "./node_modules/@wordpress/i18n/build-module/index.js":
/*!************************************************************!*\
!*** ./node_modules/@wordpress/i18n/build-module/index.js ***!
\************************************************************/
/*! exports provided: setLocaleData, __, _x, _n, _nx, sprintf */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setLocaleData", function() { return setLocaleData; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__", function() { return __; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_x", function() { return _x; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_n", function() { return _n; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_nx", function() { return _nx; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "sprintf", function() { return sprintf; });
/* 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 tannin__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! tannin */ "./node_modules/tannin/index.js");
/* harmony import */ var memize__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! memize */ "./node_modules/memize/index.js");
/* harmony import */ var memize__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(memize__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var sprintf_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! sprintf-js */ "./node_modules/sprintf-js/src/sprintf.js");
/* harmony import */ var sprintf_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(sprintf_js__WEBPACK_IMPORTED_MODULE_3__);
/**
* External dependencies
*/
/**
* Default locale data to use for Tannin domain when not otherwise provided.
* Assumes an English plural forms expression.
*
* @type {Object}
*/
var DEFAULT_LOCALE_DATA = {
'': {
plural_forms: function plural_forms(n) {
return n === 1 ? 0 : 1;
}
}
};
/**
* Log to console, once per message; or more precisely, per referentially equal
* argument set. Because Jed throws errors, we log these to the console instead
* to avoid crashing the application.
*
* @param {...*} args Arguments to pass to `console.error`
*/
var logErrorOnce = memize__WEBPACK_IMPORTED_MODULE_2___default()(console.error); // eslint-disable-line no-console
/**
* The underlying instance of Tannin to which exported functions interface.
*
* @type {Tannin}
*/
var i18n = new tannin__WEBPACK_IMPORTED_MODULE_1__["default"]({});
/**
* Merges locale data into the Tannin instance by domain. Accepts data in a
* Jed-formatted JSON object shape.
*
* @see http://messageformat.github.io/Jed/
*
* @param {?Object} data Locale data configuration.
* @param {?string} domain Domain for which configuration applies.
*/
function setLocaleData(data) {
var domain = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'default';
i18n.data[domain] = Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_0__["default"])({}, DEFAULT_LOCALE_DATA, i18n.data[domain], data); // Populate default domain configuration (supported locale date which omits
// a plural forms expression).
i18n.data[domain][''] = Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_0__["default"])({}, DEFAULT_LOCALE_DATA[''], i18n.data[domain]['']);
}
/**
* Wrapper for Tannin's `dcnpgettext`. Populates default locale data if not
* otherwise previously assigned.
*
* @param {?string} domain Domain to retrieve the translated text.
* @param {?string} context Context information for the translators.
* @param {string} single Text to translate if non-plural. Used as fallback
* return value on a caught error.
* @param {?string} plural The text to be used if the number is plural.
* @param {?number} number The number to compare against to use either the
* singular or plural form.
*
* @return {string} The translated string.
*/
function dcnpgettext() {
var domain = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'default';
var context = arguments.length > 1 ? arguments[1] : undefined;
var single = arguments.length > 2 ? arguments[2] : undefined;
var plural = arguments.length > 3 ? arguments[3] : undefined;
var number = arguments.length > 4 ? arguments[4] : undefined;
if (!i18n.data[domain]) {
setLocaleData(undefined, domain);
}
return i18n.dcnpgettext(domain, context, single, plural, number);
}
/**
* Retrieve the translation of text.
*
* @see https://developer.wordpress.org/reference/functions/__/
*
* @param {string} text Text to translate.
* @param {?string} domain Domain to retrieve the translated text.
*
* @return {string} Translated text.
*/
function __(text, domain) {
return dcnpgettext(domain, undefined, text);
}
/**
* Retrieve translated string with gettext context.
*
* @see https://developer.wordpress.org/reference/functions/_x/
*
* @param {string} text Text to translate.
* @param {string} context Context information for the translators.
* @param {?string} domain Domain to retrieve the translated text.
*
* @return {string} Translated context string without pipe.
*/
function _x(text, context, domain) {
return dcnpgettext(domain, context, text);
}
/**
* Translates and retrieves the singular or plural form based on the supplied
* number.
*
* @see https://developer.wordpress.org/reference/functions/_n/
*
* @param {string} single The text to be used if the number is singular.
* @param {string} plural The text to be used if the number is plural.
* @param {number} number The number to compare against to use either the
* singular or plural form.
* @param {?string} domain Domain to retrieve the translated text.
*
* @return {string} The translated singular or plural form.
*/
function _n(single, plural, number, domain) {
return dcnpgettext(domain, undefined, single, plural, number);
}
/**
* Translates and retrieves the singular or plural form based on the supplied
* number, with gettext context.
*
* @see https://developer.wordpress.org/reference/functions/_nx/
*
* @param {string} single The text to be used if the number is singular.
* @param {string} plural The text to be used if the number is plural.
* @param {number} number The number to compare against to use either the
* singular or plural form.
* @param {string} context Context information for the translators.
* @param {?string} domain Domain to retrieve the translated text.
*
* @return {string} The translated singular or plural form.
*/
function _nx(single, plural, number, context, domain) {
return dcnpgettext(domain, context, single, plural, number);
}
/**
* Returns a formatted string. If an error occurs in applying the format, the
* original format string is returned.
*
* @param {string} format The format of the string to generate.
* @param {...string} args Arguments to apply to the format.
*
* @see http://www.diveintojavascript.com/projects/javascript-sprintf
*
* @return {string} The formatted string.
*/
function sprintf(format) {
try {
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
args[_key - 1] = arguments[_key];
}
return sprintf_js__WEBPACK_IMPORTED_MODULE_3___default.a.sprintf.apply(sprintf_js__WEBPACK_IMPORTED_MODULE_3___default.a, [format].concat(args));
} catch (error) {
logErrorOnce('sprintf error: \n\n' + error.toString());
return format;
}
}
/***/ }),
/***/ "./node_modules/@wordpress/is-shallow-equal/arrays.js":
/*!************************************************************!*\
!*** ./node_modules/@wordpress/is-shallow-equal/arrays.js ***!
\************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* Returns true if the two arrays are shallow equal, or false otherwise.
*
* @param {Array} a First array to compare.
* @param {Array} b Second array to compare.
*
* @return {boolean} Whether the two arrays are shallow equal.
*/
function isShallowEqualArrays(a, b) {
var i;
if (a === b) {
return true;
}
if (a.length !== b.length) {
return false;
}
for (i = 0; i < a.length; i++) {
if (a[i] !== b[i]) {
return false;
}
}
return true;
}
module.exports = isShallowEqualArrays;
/***/ }),
/***/ "./node_modules/@wordpress/is-shallow-equal/index.js":
/*!***********************************************************!*\
!*** ./node_modules/@wordpress/is-shallow-equal/index.js ***!
\***********************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* Internal dependencies;
*/
var isShallowEqualObjects = __webpack_require__(/*! ./objects */ "./node_modules/@wordpress/is-shallow-equal/objects.js");
var isShallowEqualArrays = __webpack_require__(/*! ./arrays */ "./node_modules/@wordpress/is-shallow-equal/arrays.js");
var isArray = Array.isArray;
/**
* Returns true if the two arrays or objects are shallow equal, or false
* otherwise.
*
* @param {(Array|Object)} a First object or array to compare.
* @param {(Array|Object)} b Second object or array to compare.
*
* @return {boolean} Whether the two values are shallow equal.
*/
function isShallowEqual(a, b) {
if (a && b) {
if (a.constructor === Object && b.constructor === Object) {
return isShallowEqualObjects(a, b);
} else if (isArray(a) && isArray(b)) {
return isShallowEqualArrays(a, b);
}
}
return a === b;
}
module.exports = isShallowEqual;
module.exports.isShallowEqualObjects = isShallowEqualObjects;
module.exports.isShallowEqualArrays = isShallowEqualArrays;
/***/ }),
/***/ "./node_modules/@wordpress/is-shallow-equal/objects.js":
/*!*************************************************************!*\
!*** ./node_modules/@wordpress/is-shallow-equal/objects.js ***!
\*************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var keys = Object.keys;
/**
* Returns true if the two objects are shallow equal, or false otherwise.
*
* @param {Object} a First object to compare.
* @param {Object} b Second object to compare.
*
* @return {boolean} Whether the two objects are shallow equal.
*/
function isShallowEqualObjects(a, b) {
var aKeys, bKeys, i, key, aValue;
if (a === b) {
return true;
}
aKeys = keys(a);
bKeys = keys(b);
if (aKeys.length !== bKeys.length) {
return false;
}
i = 0;
while (i < aKeys.length) {
key = aKeys[i];
aValue = a[key];
if ( // In iterating only the keys of the first object after verifying
// equal lengths, account for the case that an explicit `undefined`
// value in the first is implicitly undefined in the second.
//
// Example: isShallowEqualObjects( { a: undefined }, { b: 5 } )
aValue === undefined && !b.hasOwnProperty(key) || aValue !== b[key]) {
return false;
}
i++;
}
return true;
}
module.exports = isShallowEqualObjects;
/***/ }),
/***/ "./node_modules/@wordpress/keycodes/build-module/index.js":
/*!****************************************************************!*\
!*** ./node_modules/@wordpress/keycodes/build-module/index.js ***!
\****************************************************************/
/*! exports provided: BACKSPACE, TAB, ENTER, ESCAPE, SPACE, LEFT, UP, RIGHT, DOWN, DELETE, F10, ALT, CTRL, COMMAND, SHIFT, modifiers, rawShortcut, displayShortcutList, displayShortcut, shortcutAriaLabel, isKeyboardEvent */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BACKSPACE", function() { return BACKSPACE; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TAB", function() { return TAB; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ENTER", function() { return ENTER; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ESCAPE", function() { return ESCAPE; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SPACE", function() { return SPACE; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LEFT", function() { return LEFT; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "UP", function() { return UP; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RIGHT", function() { return RIGHT; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DOWN", function() { return DOWN; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DELETE", function() { return DELETE; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "F10", function() { return F10; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ALT", function() { return ALT; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CTRL", function() { return CTRL; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "COMMAND", function() { return COMMAND; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SHIFT", function() { return SHIFT; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "modifiers", function() { return modifiers; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "rawShortcut", function() { return rawShortcut; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "displayShortcutList", function() { return displayShortcutList; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "displayShortcut", function() { return displayShortcut; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "shortcutAriaLabel", function() { return shortcutAriaLabel; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isKeyboardEvent", function() { return isKeyboardEvent; });
/* 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_toConsumableArray__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/toConsumableArray */ "./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js");
/* 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_i18n__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/i18n */ "./node_modules/@wordpress/i18n/build-module/index.js");
/* harmony import */ var _platform__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./platform */ "./node_modules/@wordpress/keycodes/build-module/platform.js");
/**
* Note: The order of the modifier keys in many of the [foo]Shortcut()
* functions in this file are intentional and should not be changed. They're
* designed to fit with the standard menu keyboard shortcuts shown in the
* user's platform.
*
* For example, on MacOS menu shortcuts will place Shift before Command, but
* on Windows Control will usually come first. So don't provide your own
* shortcut combos directly to keyboardShortcut().
*/
/**
* External dependencies
*/
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
/**
* Keycode for BACKSPACE key.
*/
var BACKSPACE = 8;
/**
* Keycode for TAB key.
*/
var TAB = 9;
/**
* Keycode for ENTER key.
*/
var ENTER = 13;
/**
* Keycode for ESCAPE key.
*/
var ESCAPE = 27;
/**
* Keycode for SPACE key.
*/
var SPACE = 32;
/**
* Keycode for LEFT key.
*/
var LEFT = 37;
/**
* Keycode for UP key.
*/
var UP = 38;
/**
* Keycode for RIGHT key.
*/
var RIGHT = 39;
/**
* Keycode for DOWN key.
*/
var DOWN = 40;
/**
* Keycode for DELETE key.
*/
var DELETE = 46;
/**
* Keycode for F10 key.
*/
var F10 = 121;
/**
* Keycode for ALT key.
*/
var ALT = 'alt';
/**
* Keycode for CTRL key.
*/
var CTRL = 'ctrl';
/**
* Keycode for COMMAND/META key.
*/
var COMMAND = 'meta';
/**
* Keycode for SHIFT key.
*/
var SHIFT = 'shift';
/**
* Object that contains functions that return the available modifier
* depending on platform.
*
* - `primary`: takes a isApple function as a parameter.
* - `primaryShift`: takes a isApple function as a parameter.
* - `primaryAlt`: takes a isApple function as a parameter.
* - `secondary`: takes a isApple function as a parameter.
* - `access`: takes a isApple function as a parameter.
* - `ctrl`
* - `alt`
* - `ctrlShift`
* - `shift`
* - `shiftAlt`
*/
var modifiers = {
primary: function primary(_isApple) {
return _isApple() ? [COMMAND] : [CTRL];
},
primaryShift: function primaryShift(_isApple) {
return _isApple() ? [SHIFT, COMMAND] : [CTRL, SHIFT];
},
primaryAlt: function primaryAlt(_isApple) {
return _isApple() ? [ALT, COMMAND] : [CTRL, ALT];
},
secondary: function secondary(_isApple) {
return _isApple() ? [SHIFT, ALT, COMMAND] : [CTRL, SHIFT, ALT];
},
access: function access(_isApple) {
return _isApple() ? [CTRL, ALT] : [SHIFT, ALT];
},
ctrl: function ctrl() {
return [CTRL];
},
alt: function alt() {
return [ALT];
},
ctrlShift: function ctrlShift() {
return [CTRL, SHIFT];
},
shift: function shift() {
return [SHIFT];
},
shiftAlt: function shiftAlt() {
return [SHIFT, ALT];
}
};
/**
* An object that contains functions to get raw shortcuts.
* E.g. rawShortcut.primary( 'm' ) will return 'meta+m' on Mac.
* These are intended for user with the KeyboardShortcuts component or TinyMCE.
*
* @type {Object} Keyed map of functions to raw shortcuts.
*/
var rawShortcut = Object(lodash__WEBPACK_IMPORTED_MODULE_2__["mapValues"])(modifiers, function (modifier) {
return function (character) {
var _isApple = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _platform__WEBPACK_IMPORTED_MODULE_4__["isAppleOS"];
return [].concat(Object(_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_1__["default"])(modifier(_isApple)), [character.toLowerCase()]).join('+');
};
});
/**
* Return an array of the parts of a keyboard shortcut chord for display
* E.g displayShortcutList.primary( 'm' ) will return [ '⌘', 'M' ] on Mac.
*
* @type {Object} keyed map of functions to shortcut sequences
*/
var displayShortcutList = Object(lodash__WEBPACK_IMPORTED_MODULE_2__["mapValues"])(modifiers, function (modifier) {
return function (character) {
var _replacementKeyMap;
var _isApple = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _platform__WEBPACK_IMPORTED_MODULE_4__["isAppleOS"];
var isApple = _isApple();
var replacementKeyMap = (_replacementKeyMap = {}, Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__["default"])(_replacementKeyMap, ALT, isApple ? '⌥' : 'Alt'), Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__["default"])(_replacementKeyMap, CTRL, isApple ? '^' : 'Ctrl'), Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__["default"])(_replacementKeyMap, COMMAND, '⌘'), Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__["default"])(_replacementKeyMap, SHIFT, isApple ? '⇧' : 'Shift'), _replacementKeyMap);
var modifierKeys = modifier(_isApple).reduce(function (accumulator, key) {
var replacementKey = Object(lodash__WEBPACK_IMPORTED_MODULE_2__["get"])(replacementKeyMap, key, key); // If on the Mac, adhere to platform convention and don't show plus between keys.
if (isApple) {
return [].concat(Object(_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_1__["default"])(accumulator), [replacementKey]);
}
return [].concat(Object(_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_1__["default"])(accumulator), [replacementKey, '+']);
}, []);
var capitalizedCharacter = Object(lodash__WEBPACK_IMPORTED_MODULE_2__["capitalize"])(character);
return [].concat(Object(_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_1__["default"])(modifierKeys), [capitalizedCharacter]);
};
});
/**
* An object that contains functions to display shortcuts.
* E.g. displayShortcut.primary( 'm' ) will return '⌘M' on Mac.
*
* @type {Object} Keyed map of functions to display shortcuts.
*/
var displayShortcut = Object(lodash__WEBPACK_IMPORTED_MODULE_2__["mapValues"])(displayShortcutList, function (shortcutList) {
return function (character) {
var _isApple = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _platform__WEBPACK_IMPORTED_MODULE_4__["isAppleOS"];
return shortcutList(character, _isApple).join('');
};
});
/**
* An object that contains functions to return an aria label for a keyboard shortcut.
* E.g. shortcutAriaLabel.primary( '.' ) will return 'Command + Period' on Mac.
*/
var shortcutAriaLabel = Object(lodash__WEBPACK_IMPORTED_MODULE_2__["mapValues"])(modifiers, function (modifier) {
return function (character) {
var _replacementKeyMap2;
var _isApple = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _platform__WEBPACK_IMPORTED_MODULE_4__["isAppleOS"];
var isApple = _isApple();
var replacementKeyMap = (_replacementKeyMap2 = {}, Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__["default"])(_replacementKeyMap2, SHIFT, 'Shift'), Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__["default"])(_replacementKeyMap2, COMMAND, isApple ? 'Command' : 'Control'), Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__["default"])(_replacementKeyMap2, CTRL, 'Control'), Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__["default"])(_replacementKeyMap2, ALT, isApple ? 'Option' : 'Alt'), Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__["default"])(_replacementKeyMap2, ',', Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__["__"])('Comma')), Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__["default"])(_replacementKeyMap2, '.', Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__["__"])('Period')), Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__["default"])(_replacementKeyMap2, '`', Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__["__"])('Backtick')), _replacementKeyMap2);
return [].concat(Object(_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_1__["default"])(modifier(_isApple)), [character]).map(function (key) {
return Object(lodash__WEBPACK_IMPORTED_MODULE_2__["capitalize"])(Object(lodash__WEBPACK_IMPORTED_MODULE_2__["get"])(replacementKeyMap, key, key));
}).join(isApple ? ' ' : ' + ');
};
});
/**
* An object that contains functions to check if a keyboard event matches a
* predefined shortcut combination.
* E.g. isKeyboardEvent.primary( event, 'm' ) will return true if the event
* signals pressing ⌘M.
*
* @type {Object} Keyed map of functions to match events.
*/
var isKeyboardEvent = Object(lodash__WEBPACK_IMPORTED_MODULE_2__["mapValues"])(modifiers, function (getModifiers) {
return function (event, character) {
var _isApple = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : _platform__WEBPACK_IMPORTED_MODULE_4__["isAppleOS"];
var mods = getModifiers(_isApple);
if (!mods.every(function (key) {
return event["".concat(key, "Key")];
})) {
return false;
}
if (!character) {
return Object(lodash__WEBPACK_IMPORTED_MODULE_2__["includes"])(mods, event.key.toLowerCase());
}
return event.key === character;
};
});
/***/ }),
/***/ "./node_modules/@wordpress/keycodes/build-module/platform.js":
/*!*******************************************************************!*\
!*** ./node_modules/@wordpress/keycodes/build-module/platform.js ***!
\*******************************************************************/
/*! exports provided: isAppleOS */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isAppleOS", function() { return isAppleOS; });
/* 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
*/
/**
* Return true if platform is MacOS.
*
* @param {Object} _window window object by default; used for DI testing.
*
* @return {boolean} True if MacOS; false otherwise.
*/
function isAppleOS() {
var _window = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : window;
var platform = _window.navigator.platform;
return platform.indexOf('Mac') !== -1 || Object(lodash__WEBPACK_IMPORTED_MODULE_0__["includes"])(['iPad', 'iPhone'], platform);
}
/***/ }),
/***/ "./node_modules/@wordpress/priority-queue/build-module/index.js":
/*!**********************************************************************!*\
!*** ./node_modules/@wordpress/priority-queue/build-module/index.js ***!
\**********************************************************************/
/*! exports provided: createQueue */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createQueue", function() { return createQueue; });
var requestIdleCallback = window.requestIdleCallback ? window.requestIdleCallback : window.requestAnimationFrame;
/**
* Creates a context-aware queue that only executes
* the last task of a given context.
*
* @example
*```js
* import { createQueue } from '@wordpress/priority-queue';
*
* const queue = createQueue();
*
* // Context objects.
* const ctx1 = {};
* const ctx2 = {};
*
* // For a given context in the queue, only the last callback is executed.
* queue.add( ctx1, () => console.log( 'This will be printed first' ) );
* queue.add( ctx2, () => console.log( 'This won\'t be printed' ) );
* queue.add( ctx2, () => console.log( 'This will be printed second' ) );
*```
*
* @return {Object} Queue object with `add` and `flush` methods.
*/
var createQueue = function createQueue() {
var waitingList = [];
var elementsMap = new WeakMap();
var isRunning = false;
var runWaitingList = function runWaitingList(deadline) {
do {
if (waitingList.length === 0) {
isRunning = false;
return;
}
var nextElement = waitingList.shift();
elementsMap.get(nextElement)();
elementsMap.delete(nextElement);
} while (deadline && deadline.timeRemaining && deadline.timeRemaining() > 0);
requestIdleCallback(runWaitingList);
};
var add = function add(element, item) {
if (!elementsMap.has(element)) {
waitingList.push(element);
}
elementsMap.set(element, item);
if (!isRunning) {
isRunning = true;
requestIdleCallback(runWaitingList);
}
};
var flush = function flush(element) {
if (!elementsMap.has(element)) {
return false;
}
elementsMap.delete(element);
var index = waitingList.indexOf(element);
waitingList.splice(index, 1);
return true;
};
return {
add: add,
flush: flush
};
};
/***/ }),
/***/ "./node_modules/@wordpress/redux-routine/build-module/index.js":
/*!*********************************************************************!*\
!*** ./node_modules/@wordpress/redux-routine/build-module/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 createMiddleware; });
/* harmony import */ var _is_generator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-generator */ "./node_modules/@wordpress/redux-routine/build-module/is-generator.js");
/* harmony import */ var _runtime__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./runtime */ "./node_modules/@wordpress/redux-routine/build-module/runtime.js");
/**
* Internal dependencies
*/
/**
* Creates a Redux middleware, given an object of controls where each key is an
* action type for which to act upon, the value a function which returns either
* a promise which is to resolve when evaluation of the action should continue,
* or a value. The value or resolved promise value is assigned on the return
* value of the yield assignment. If the control handler returns undefined, the
* execution is not continued.
*
* @param {Object} controls Object of control handlers.
*
* @return {Function} Co-routine runtime
*/
function createMiddleware() {
var controls = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
return function (store) {
var runtime = Object(_runtime__WEBPACK_IMPORTED_MODULE_1__["default"])(controls, store.dispatch);
return function (next) {
return function (action) {
if (!Object(_is_generator__WEBPACK_IMPORTED_MODULE_0__["default"])(action)) {
return next(action);
}
return runtime(action);
};
};
};
}
/***/ }),
/***/ "./node_modules/@wordpress/redux-routine/build-module/is-action.js":
/*!*************************************************************************!*\
!*** ./node_modules/@wordpress/redux-routine/build-module/is-action.js ***!
\*************************************************************************/
/*! exports provided: isAction, isActionOfType */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isAction", function() { return isAction; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isActionOfType", function() { return isActionOfType; });
/* 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
*/
/**
* Returns true if the given object quacks like an action.
*
* @param {*} object Object to test
*
* @return {boolean} Whether object is an action.
*/
function isAction(object) {
return Object(lodash__WEBPACK_IMPORTED_MODULE_0__["isPlainObject"])(object) && Object(lodash__WEBPACK_IMPORTED_MODULE_0__["isString"])(object.type);
}
/**
* Returns true if the given object quacks like an action and has a specific
* action type
*
* @param {*} object Object to test
* @param {string} expectedType The expected type for the action.
*
* @return {boolean} Whether object is an action and is of specific type.
*/
function isActionOfType(object, expectedType) {
return isAction(object) && object.type === expectedType;
}
/***/ }),
/***/ "./node_modules/@wordpress/redux-routine/build-module/is-generator.js":
/*!****************************************************************************!*\
!*** ./node_modules/@wordpress/redux-routine/build-module/is-generator.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 isGenerator; });
/**
* Returns true if the given object is a generator, or false otherwise.
*
* @see https://www.ecma-international.org/ecma-262/6.0/#sec-generator-objects
*
* @param {*} object Object to test.
*
* @return {boolean} Whether object is a generator.
*/
function isGenerator(object) {
return !!object && object[Symbol.toStringTag] === 'Generator';
}
/***/ }),
/***/ "./node_modules/@wordpress/redux-routine/build-module/runtime.js":
/*!***********************************************************************!*\
!*** ./node_modules/@wordpress/redux-routine/build-module/runtime.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 createRuntime; });
/* harmony import */ var rungen__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! rungen */ "./node_modules/rungen/dist/index.js");
/* harmony import */ var rungen__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(rungen__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 is_promise__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! is-promise */ "./node_modules/is-promise/index.js");
/* harmony import */ var is_promise__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(is_promise__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _is_action__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./is-action */ "./node_modules/@wordpress/redux-routine/build-module/is-action.js");
/**
* External dependencies
*/
/**
* Internal dependencies
*/
/**
* Create a co-routine runtime.
*
* @param {Object} controls Object of control handlers.
* @param {Function} dispatch Unhandled action dispatch.
*
* @return {Function} co-routine runtime
*/
function createRuntime() {
var controls = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
var dispatch = arguments.length > 1 ? arguments[1] : undefined;
var rungenControls = Object(lodash__WEBPACK_IMPORTED_MODULE_1__["map"])(controls, function (control, actionType) {
return function (value, next, iterate, yieldNext, yieldError) {
if (!Object(_is_action__WEBPACK_IMPORTED_MODULE_3__["isActionOfType"])(value, actionType)) {
return false;
}
var routine = control(value);
if (is_promise__WEBPACK_IMPORTED_MODULE_2___default()(routine)) {
// Async control routine awaits resolution.
routine.then(yieldNext, yieldError);
} else {
yieldNext(routine);
}
return true;
};
});
var unhandledActionControl = function unhandledActionControl(value, next) {
if (!Object(_is_action__WEBPACK_IMPORTED_MODULE_3__["isAction"])(value)) {
return false;
}
dispatch(value);
next();
return true;
};
rungenControls.push(unhandledActionControl);
var rungenRuntime = Object(rungen__WEBPACK_IMPORTED_MODULE_0__["create"])(rungenControls);
return function (action) {
return new Promise(function (resolve, reject) {
return rungenRuntime(action, function (result) {
if (Object(_is_action__WEBPACK_IMPORTED_MODULE_3__["isAction"])(result)) {
dispatch(result);
}
resolve(result);
}, reject);
});
};
}
/***/ }),
/***/ "./node_modules/@wordpress/rich-text/build-module/apply-format.js":
/*!************************************************************************!*\
!*** ./node_modules/@wordpress/rich-text/build-module/apply-format.js ***!
\************************************************************************/
/*! exports provided: applyFormat */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "applyFormat", function() { return applyFormat; });
/* 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_objectSpread__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectSpread */ "./node_modules/@babel/runtime/helpers/esm/objectSpread.js");
/* 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 _normalise_formats__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./normalise-formats */ "./node_modules/@wordpress/rich-text/build-module/normalise-formats.js");
/**
* External dependencies
*/
/**
* Internal dependencies
*/
function replace(array, index, value) {
array = array.slice();
array[index] = value;
return array;
}
/**
* Apply a format object to a Rich Text value from the given `startIndex` to the
* given `endIndex`. Indices are retrieved from the selection if none are
* provided.
*
* @param {Object} value Value to modify.
* @param {Object} format Format to apply.
* @param {number} [startIndex] Start index.
* @param {number} [endIndex] End index.
*
* @return {Object} A new value with the format applied.
*/
function applyFormat(value, format) {
var startIndex = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : value.start;
var endIndex = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : value.end;
var formats = value.formats,
activeFormats = value.activeFormats;
var newFormats = formats.slice(); // The selection is collapsed.
if (startIndex === endIndex) {
var startFormat = Object(lodash__WEBPACK_IMPORTED_MODULE_2__["find"])(newFormats[startIndex], {
type: format.type
}); // If the caret is at a format of the same type, expand start and end to
// the edges of the format. This is useful to apply new attributes.
if (startFormat) {
var index = newFormats[startIndex].indexOf(startFormat);
while (newFormats[startIndex] && newFormats[startIndex][index] === startFormat) {
newFormats[startIndex] = replace(newFormats[startIndex], index, format);
startIndex--;
}
endIndex++;
while (newFormats[endIndex] && newFormats[endIndex][index] === startFormat) {
newFormats[endIndex] = replace(newFormats[endIndex], index, format);
endIndex++;
}
}
} else {
// Determine the highest position the new format can be inserted at.
var position = +Infinity;
for (var _index = startIndex; _index < endIndex; _index++) {
if (newFormats[_index]) {
newFormats[_index] = newFormats[_index].filter(function (_ref) {
var type = _ref.type;
return type !== format.type;
});
var length = newFormats[_index].length;
if (length < position) {
position = length;
}
} else {
newFormats[_index] = [];
position = 0;
}
}
for (var _index2 = startIndex; _index2 < endIndex; _index2++) {
newFormats[_index2].splice(position, 0, format);
}
}
return Object(_normalise_formats__WEBPACK_IMPORTED_MODULE_3__["normaliseFormats"])(Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_1__["default"])({}, value, {
formats: newFormats,
// Always revise active formats. This serves as a placeholder for new
// inputs with the format so new input appears with the format applied,
// and ensures a format of the same type uses the latest values.
activeFormats: [].concat(Object(_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_0__["default"])(Object(lodash__WEBPACK_IMPORTED_MODULE_2__["reject"])(activeFormats, {
type: format.type
})), [format])
}));
}
/***/ }),
/***/ "./node_modules/@wordpress/rich-text/build-module/change-list-type.js":
/*!****************************************************************************!*\
!*** ./node_modules/@wordpress/rich-text/build-module/change-list-type.js ***!
\****************************************************************************/
/*! exports provided: changeListType */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "changeListType", function() { return changeListType; });
/* 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 _special_characters__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./special-characters */ "./node_modules/@wordpress/rich-text/build-module/special-characters.js");
/* harmony import */ var _get_line_index__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./get-line-index */ "./node_modules/@wordpress/rich-text/build-module/get-line-index.js");
/* harmony import */ var _get_parent_line_index__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./get-parent-line-index */ "./node_modules/@wordpress/rich-text/build-module/get-parent-line-index.js");
/**
* Internal dependencies
*/
/**
* Changes the list type of the selected indented list, if any. Looks at the
* currently selected list item and takes the parent list, then changes the list
* type of this list. When multiple lines are selected, the parent lists are
* takes and changed.
*
* @param {Object} value Value to change.
* @param {Object} newFormat The new list format object. Choose between
* `{ type: 'ol' }` and `{ type: 'ul' }`.
*
* @return {Object} The changed value.
*/
function changeListType(value, newFormat) {
var text = value.text,
replacements = value.replacements,
start = value.start,
end = value.end;
var startingLineIndex = Object(_get_line_index__WEBPACK_IMPORTED_MODULE_2__["getLineIndex"])(value, start);
var startLineFormats = replacements[startingLineIndex] || [];
var endLineFormats = replacements[Object(_get_line_index__WEBPACK_IMPORTED_MODULE_2__["getLineIndex"])(value, end)] || [];
var startIndex = Object(_get_parent_line_index__WEBPACK_IMPORTED_MODULE_3__["getParentLineIndex"])(value, startingLineIndex);
var newReplacements = replacements.slice();
var startCount = startLineFormats.length - 1;
var endCount = endLineFormats.length - 1;
var changed;
for (var index = startIndex + 1 || 0; index < text.length; index++) {
if (text[index] !== _special_characters__WEBPACK_IMPORTED_MODULE_1__["LINE_SEPARATOR"]) {
continue;
}
if ((newReplacements[index] || []).length <= startCount) {
break;
}
if (!newReplacements[index]) {
continue;
}
changed = true;
newReplacements[index] = newReplacements[index].map(function (format, i) {
return i < startCount || i > endCount ? format : newFormat;
});
}
if (!changed) {
return value;
}
return Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_0__["default"])({}, value, {
replacements: newReplacements
});
}
/***/ }),
/***/ "./node_modules/@wordpress/rich-text/build-module/component/aria.js":
/*!**************************************************************************!*\
!*** ./node_modules/@wordpress/rich-text/build-module/component/aria.js ***!
\**************************************************************************/
/*! exports provided: pickAriaProps, diffAriaProps */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "pickAriaProps", function() { return pickAriaProps; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "diffAriaProps", function() { return diffAriaProps; });
/* 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 isAriaPropName = function isAriaPropName(name) {
return Object(lodash__WEBPACK_IMPORTED_MODULE_0__["startsWith"])(name, 'aria-');
};
var pickAriaProps = function pickAriaProps(props) {
return Object(lodash__WEBPACK_IMPORTED_MODULE_0__["pickBy"])(props, function (value, key) {
return isAriaPropName(key) && !Object(lodash__WEBPACK_IMPORTED_MODULE_0__["isNil"])(value);
});
};
var diffAriaProps = function diffAriaProps(props, nextProps) {
var prevAriaKeys = Object(lodash__WEBPACK_IMPORTED_MODULE_0__["keys"])(pickAriaProps(props));
var nextAriaKeys = Object(lodash__WEBPACK_IMPORTED_MODULE_0__["keys"])(pickAriaProps(nextProps));
var removedKeys = Object(lodash__WEBPACK_IMPORTED_MODULE_0__["difference"])(prevAriaKeys, nextAriaKeys);
var updatedKeys = nextAriaKeys.filter(function (key) {
return !Object(lodash__WEBPACK_IMPORTED_MODULE_0__["isEqual"])(props[key], nextProps[key]);
});
return {
removedKeys: removedKeys,
updatedKeys: updatedKeys
};
};
/***/ }),
/***/ "./node_modules/@wordpress/rich-text/build-module/component/editable.js":
/*!******************************************************************************!*\
!*** ./node_modules/@wordpress/rich-text/build-module/component/editable.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 Editable; });
/* harmony import */ var _babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutProperties */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js");
/* harmony import */ var _babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_1__ = __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_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_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @babel/runtime/helpers/esm/assertThisInitialized */ "./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.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 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_element__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @wordpress/element */ "./node_modules/@wordpress/element/build-module/index.js");
/* harmony import */ var _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @wordpress/keycodes */ "./node_modules/@wordpress/keycodes/build-module/index.js");
/* harmony import */ var _aria__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./aria */ "./node_modules/@wordpress/rich-text/build-module/component/aria.js");
/**
* External dependencies
*/
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
/**
* Browser dependencies
*/
var userAgent = window.navigator.userAgent;
/**
* Applies a fix that provides `input` events for contenteditable in Internet Explorer.
*
* @param {Element} editorNode The root editor node.
*
* @return {Function} A function to remove the fix (for cleanup).
*/
function applyInternetExplorerInputFix(editorNode) {
/**
* Dispatches `input` events in response to `textinput` events.
*
* IE provides a `textinput` event that is similar to an `input` event,
* and we use it to manually dispatch an `input` event.
* `textinput` is dispatched for text entry but for not deletions.
*
* @param {Event} textInputEvent An Internet Explorer `textinput` event.
*/
function mapTextInputEvent(textInputEvent) {
textInputEvent.stopImmediatePropagation();
var inputEvent = document.createEvent('Event');
inputEvent.initEvent('input', true, false);
inputEvent.data = textInputEvent.data;
textInputEvent.target.dispatchEvent(inputEvent);
}
/**
* Dispatches `input` events in response to Delete and Backspace keyup.
*
* It would be better dispatch an `input` event after each deleting
* `keydown` because the DOM is updated after each, but it is challenging
* to determine the right time to dispatch `input` since propagation of
* `keydown` can be stopped at any point.
*
* It's easier to listen for `keyup` in the capture phase and dispatch
* `input` before `keyup` propagates further. It's not perfect, but should
* be good enough.
*
* @param {KeyboardEvent} keyUp
* @param {Node} keyUp.target The event target.
* @param {number} keyUp.keyCode The key code.
*/
function mapDeletionKeyUpEvents(_ref) {
var target = _ref.target,
keyCode = _ref.keyCode;
var isDeletion = _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_10__["BACKSPACE"] === keyCode || _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_10__["DELETE"] === keyCode;
if (isDeletion && editorNode.contains(target)) {
var inputEvent = document.createEvent('Event');
inputEvent.initEvent('input', true, false);
inputEvent.data = null;
target.dispatchEvent(inputEvent);
}
}
editorNode.addEventListener('textinput', mapTextInputEvent);
document.addEventListener('keyup', mapDeletionKeyUpEvents, true);
return function removeInternetExplorerInputFix() {
editorNode.removeEventListener('textinput', mapTextInputEvent);
document.removeEventListener('keyup', mapDeletionKeyUpEvents, true);
};
}
/**
* Whether or not the user agent is Internet Explorer.
*
* @type {boolean}
*/
var IS_IE = userAgent.indexOf('Trident') >= 0;
var Editable =
/*#__PURE__*/
function (_Component) {
Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_7__["default"])(Editable, _Component);
function Editable() {
var _this;
Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_2__["default"])(this, Editable);
_this = Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_4__["default"])(this, Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_5__["default"])(Editable).call(this));
_this.bindEditorNode = _this.bindEditorNode.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__["default"])(_this));
return _this;
} // We must prevent rerenders because the browser will modify the DOM. React
// will rerender the DOM fine, but we're losing selection and it would be
// more expensive to do so as it would just set the inner HTML through
// `dangerouslySetInnerHTML`. Instead RichText does it's own diffing and
// selection setting.
//
// Because we never update the component, we have to look through props and
// update the attributes on the wrapper nodes here. `componentDidUpdate`
// will never be called.
Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_3__["default"])(Editable, [{
key: "shouldComponentUpdate",
value: function shouldComponentUpdate(nextProps) {
var _this2 = this;
if (!Object(lodash__WEBPACK_IMPORTED_MODULE_8__["isEqual"])(this.props.style, nextProps.style)) {
this.editorNode.setAttribute('style', '');
Object.assign(this.editorNode.style, Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_1__["default"])({}, nextProps.style || {}, {
whiteSpace: 'pre-wrap'
}));
}
if (!Object(lodash__WEBPACK_IMPORTED_MODULE_8__["isEqual"])(this.props.className, nextProps.className)) {
this.editorNode.className = nextProps.className;
}
if (this.props.start !== nextProps.start) {
this.editorNode.setAttribute('start', nextProps.start);
}
if (this.props.reversed !== nextProps.reversed) {
this.editorNode.reversed = nextProps.reversed;
}
var _diffAriaProps = Object(_aria__WEBPACK_IMPORTED_MODULE_11__["diffAriaProps"])(this.props, nextProps),
removedKeys = _diffAriaProps.removedKeys,
updatedKeys = _diffAriaProps.updatedKeys;
removedKeys.forEach(function (key) {
return _this2.editorNode.removeAttribute(key);
});
updatedKeys.forEach(function (key) {
return _this2.editorNode.setAttribute(key, nextProps[key]);
});
return false;
}
}, {
key: "bindEditorNode",
value: function bindEditorNode(editorNode) {
this.editorNode = editorNode;
this.props.setRef(editorNode);
if (IS_IE) {
if (editorNode) {
// Mounting:
this.removeInternetExplorerInputFix = applyInternetExplorerInputFix(editorNode);
} else {
// Unmounting:
this.removeInternetExplorerInputFix();
}
}
}
}, {
key: "render",
value: function render() {
var _this$props = this.props,
_this$props$tagName = _this$props.tagName,
tagName = _this$props$tagName === void 0 ? 'div' : _this$props$tagName,
_this$props$style = _this$props.style,
style = _this$props$style === void 0 ? {} : _this$props$style,
record = _this$props.record,
valueToEditableHTML = _this$props.valueToEditableHTML,
className = _this$props.className,
remainingProps = Object(_babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_0__["default"])(_this$props, ["tagName", "style", "record", "valueToEditableHTML", "className"]);
delete remainingProps.setRef; // In HTML, leading and trailing spaces are not visible, and multiple
// spaces elsewhere are visually reduced to one space. This rule
// prevents spaces from collapsing so all space is visible in the editor
// and can be removed.
// It also prevents some browsers from inserting non-breaking spaces at
// the end of a line to prevent the space from visually disappearing.
// Sometimes these non breaking spaces can linger in the editor causing
// unwanted non breaking spaces in between words. If also prevent
// Firefox from inserting a trailing `br` node to visualise any trailing
// space, causing the element to be saved.
//
// > Authors are encouraged to set the 'white-space' property on editing
// > hosts and on markup that was originally created through these
// > editing mechanisms to the value 'pre-wrap'. Default HTML whitespace
// > handling is not well suited to WYSIWYG editing, and line wrapping
// > will not work correctly in some corner cases if 'white-space' is
// > left at its default value.
// >
// > https://html.spec.whatwg.org/multipage/interaction.html#best-practices-for-in-page-editors
var whiteSpace = 'pre-wrap';
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_9__["createElement"])(tagName, Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_1__["default"])({
role: 'textbox',
'aria-multiline': true,
className: className,
contentEditable: true,
ref: this.bindEditorNode,
style: Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_1__["default"])({}, style, {
whiteSpace: whiteSpace
}),
suppressContentEditableWarning: true,
dangerouslySetInnerHTML: {
__html: valueToEditableHTML(record)
}
}, remainingProps));
}
}]);
return Editable;
}(_wordpress_element__WEBPACK_IMPORTED_MODULE_9__["Component"]);
/***/ }),
/***/ "./node_modules/@wordpress/rich-text/build-module/component/format-edit.js":
/*!*********************************************************************************!*\
!*** ./node_modules/@wordpress/rich-text/build-module/component/format-edit.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 */ "./node_modules/@wordpress/element/build-module/index.js");
/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/data */ "./node_modules/@wordpress/data/build-module/index.js");
/* harmony import */ var _get_active_format__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../get-active-format */ "./node_modules/@wordpress/rich-text/build-module/get-active-format.js");
/* harmony import */ var _get_active_object__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../get-active-object */ "./node_modules/@wordpress/rich-text/build-module/get-active-object.js");
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
/**
* Set of all interactive content tags.
*
* @see https://html.spec.whatwg.org/multipage/dom.html#interactive-content
*/
var interactiveContentTags = new Set(['a', 'audio', 'button', 'details', 'embed', 'iframe', 'input', 'label', 'select', 'textarea', 'video']);
var FormatEdit = function FormatEdit(_ref) {
var formatTypes = _ref.formatTypes,
onChange = _ref.onChange,
value = _ref.value,
allowedFormats = _ref.allowedFormats,
withoutInteractiveFormatting = _ref.withoutInteractiveFormatting;
return formatTypes.map(function (_ref2) {
var name = _ref2.name,
Edit = _ref2.edit,
tagName = _ref2.tagName;
if (!Edit) {
return null;
}
if (allowedFormats && allowedFormats.indexOf(name) === -1) {
return null;
}
if (withoutInteractiveFormatting && interactiveContentTags.has(tagName)) {
return null;
}
var activeFormat = Object(_get_active_format__WEBPACK_IMPORTED_MODULE_2__["getActiveFormat"])(value, name);
var isActive = activeFormat !== undefined;
var activeObject = Object(_get_active_object__WEBPACK_IMPORTED_MODULE_3__["getActiveObject"])(value);
var isObjectActive = activeObject !== undefined;
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(Edit, {
key: name,
isActive: isActive,
activeAttributes: isActive ? activeFormat.attributes || {} : {},
isObjectActive: isObjectActive,
activeObjectAttributes: isObjectActive ? activeObject.attributes || {} : {},
value: value,
onChange: onChange
});
});
};
/* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_1__["withSelect"])(function (select) {
return {
formatTypes: select('core/rich-text').getFormatTypes()
};
})(FormatEdit));
/***/ }),
/***/ "./node_modules/@wordpress/rich-text/build-module/component/index.js":
/*!***************************************************************************!*\
!*** ./node_modules/@wordpress/rich-text/build-module/component/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_objectSpread__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectSpread */ "./node_modules/@babel/runtime/helpers/esm/objectSpread.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 _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_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_inherits__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inherits */ "./node_modules/@babel/runtime/helpers/esm/inherits.js");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @wordpress/element */ "./node_modules/@wordpress/element/build-module/index.js");
/* 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 */ "./node_modules/@wordpress/keycodes/build-module/index.js");
/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @wordpress/data */ "./node_modules/@wordpress/data/build-module/index.js");
/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! @wordpress/compose */ "./node_modules/@wordpress/compose/build-module/index.js");
/* harmony import */ var _wordpress_is_shallow_equal__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! @wordpress/is-shallow-equal */ "./node_modules/@wordpress/is-shallow-equal/index.js");
/* harmony import */ var _wordpress_is_shallow_equal__WEBPACK_IMPORTED_MODULE_15___default = /*#__PURE__*/__webpack_require__.n(_wordpress_is_shallow_equal__WEBPACK_IMPORTED_MODULE_15__);
/* harmony import */ var _format_edit__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./format-edit */ "./node_modules/@wordpress/rich-text/build-module/component/format-edit.js");
/* harmony import */ var _editable__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./editable */ "./node_modules/@wordpress/rich-text/build-module/component/editable.js");
/* harmony import */ var _aria__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./aria */ "./node_modules/@wordpress/rich-text/build-module/component/aria.js");
/* harmony import */ var _create__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ../create */ "./node_modules/@wordpress/rich-text/build-module/create.js");
/* harmony import */ var _to_dom__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ../to-dom */ "./node_modules/@wordpress/rich-text/build-module/to-dom.js");
/* harmony import */ var _to_html_string__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ../to-html-string */ "./node_modules/@wordpress/rich-text/build-module/to-html-string.js");
/* harmony import */ var _remove__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ../remove */ "./node_modules/@wordpress/rich-text/build-module/remove.js");
/* harmony import */ var _remove_format__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ../remove-format */ "./node_modules/@wordpress/rich-text/build-module/remove-format.js");
/* harmony import */ var _is_collapsed__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ../is-collapsed */ "./node_modules/@wordpress/rich-text/build-module/is-collapsed.js");
/* harmony import */ var _special_characters__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ../special-characters */ "./node_modules/@wordpress/rich-text/build-module/special-characters.js");
/* harmony import */ var _indent_list_items__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ../indent-list-items */ "./node_modules/@wordpress/rich-text/build-module/indent-list-items.js");
/* harmony import */ var _get_active_formats__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ../get-active-formats */ "./node_modules/@wordpress/rich-text/build-module/get-active-formats.js");
/* harmony import */ var _update_formats__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ../update-formats */ "./node_modules/@wordpress/rich-text/build-module/update-formats.js");
/* harmony import */ var _remove_line_separator__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ../remove-line-separator */ "./node_modules/@wordpress/rich-text/build-module/remove-line-separator.js");
/**
* External dependencies
*/
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
/**
* Browser dependencies
*/
var _window = window,
getSelection = _window.getSelection,
getComputedStyle = _window.getComputedStyle;
/**
* All inserting input types that would insert HTML into the DOM.
*
* @see https://www.w3.org/TR/input-events-2/#interface-InputEvent-Attributes
*
* @type {Set}
*/
var INSERTION_INPUT_TYPES_TO_IGNORE = new Set(['insertParagraph', 'insertOrderedList', 'insertUnorderedList', 'insertHorizontalRule', 'insertLink']);
/**
* Global stylesheet.
*/
var globalStyle = document.createElement('style');
document.head.appendChild(globalStyle);
function createPrepareEditableTree(props, prefix) {
var fns = Object.keys(props).reduce(function (accumulator, key) {
if (key.startsWith(prefix)) {
accumulator.push(props[key]);
}
return accumulator;
}, []);
return function (value) {
return fns.reduce(function (accumulator, fn) {
return fn(accumulator, value.text);
}, value.formats);
};
}
/**
* See export statement below.
*/
var RichText =
/*#__PURE__*/
function (_Component) {
Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_8__["default"])(RichText, _Component);
function RichText(_ref) {
var _this;
var value = _ref.value,
selectionStart = _ref.selectionStart,
selectionEnd = _ref.selectionEnd;
Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_3__["default"])(this, RichText);
_this = Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_5__["default"])(this, Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_6__["default"])(RichText).apply(this, arguments));
_this.onFocus = _this.onFocus.bind(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"])(_this));
_this.onChange = _this.onChange.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(_this));
_this.handleDelete = _this.handleDelete.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(_this));
_this.handleEnter = _this.handleEnter.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(_this));
_this.handleSpace = _this.handleSpace.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(_this));
_this.handleHorizontalNavigation = _this.handleHorizontalNavigation.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(_this));
_this.onPaste = _this.onPaste.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(_this));
_this.onCreateUndoLevel = _this.onCreateUndoLevel.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(_this));
_this.onInput = _this.onInput.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(_this));
_this.onCompositionEnd = _this.onCompositionEnd.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(_this));
_this.onSelectionChange = _this.onSelectionChange.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(_this));
_this.createRecord = _this.createRecord.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(_this));
_this.applyRecord = _this.applyRecord.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(_this));
_this.valueToFormat = _this.valueToFormat.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(_this));
_this.setRef = _this.setRef.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(_this));
_this.valueToEditableHTML = _this.valueToEditableHTML.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(_this));
_this.onPointerDown = _this.onPointerDown.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(_this));
_this.formatToValue = _this.formatToValue.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(_this));
_this.Editable = _this.Editable.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(_this));
_this.onKeyDown = function (event) {
_this.handleDelete(event);
_this.handleEnter(event);
_this.handleSpace(event);
_this.handleHorizontalNavigation(event);
};
_this.state = {};
_this.lastHistoryValue = value; // Internal values are updated synchronously, unlike props and state.
_this.value = value;
_this.record = _this.formatToValue(value);
_this.record.start = selectionStart;
_this.record.end = selectionEnd;
return _this;
}
Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_4__["default"])(RichText, [{
key: "componentWillUnmount",
value: function componentWillUnmount() {
document.removeEventListener('selectionchange', this.onSelectionChange);
window.cancelAnimationFrame(this.rafId);
}
}, {
key: "setRef",
value: function setRef(node) {
if (node) {
if (true) {
var computedStyle = getComputedStyle(node);
if (computedStyle.display === 'inline') {
// eslint-disable-next-line no-console
console.warn('RichText cannot be used with an inline container. Please use a different tagName.');
}
}
this.editableRef = node;
} else {
delete this.editableRef;
}
}
}, {
key: "createRecord",
value: function createRecord() {
var multilineTag = this.props.__unstableMultilineTag;
var selection = getSelection();
var range = selection.rangeCount > 0 ? selection.getRangeAt(0) : null;
return Object(_create__WEBPACK_IMPORTED_MODULE_19__["create"])({
element: this.editableRef,
range: range,
multilineTag: multilineTag,
multilineWrapperTags: multilineTag === 'li' ? ['ul', 'ol'] : undefined,
__unstableIsEditableTree: true
});
}
}, {
key: "applyRecord",
value: function applyRecord(record) {
var _ref2 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
domOnly = _ref2.domOnly;
var multilineTag = this.props.__unstableMultilineTag;
Object(_to_dom__WEBPACK_IMPORTED_MODULE_20__["apply"])({
value: record,
current: this.editableRef,
multilineTag: multilineTag,
multilineWrapperTags: multilineTag === 'li' ? ['ul', 'ol'] : undefined,
prepareEditableTree: createPrepareEditableTree(this.props, 'format_prepare_functions'),
__unstableDomOnly: domOnly,
placeholder: this.props.placeholder
});
}
/**
* Handles a paste event.
*
* Saves the pasted data as plain text in `pastedPlainText`.
*
* @param {PasteEvent} event The paste event.
*/
}, {
key: "onPaste",
value: function onPaste(event) {
var _this$props = this.props,
formatTypes = _this$props.formatTypes,
onPaste = _this$props.onPaste;
var clipboardData = event.clipboardData;
var items = clipboardData.items,
files = clipboardData.files; // In Edge these properties can be null instead of undefined, so a more
// rigorous test is required over using default values.
items = Object(lodash__WEBPACK_IMPORTED_MODULE_11__["isNil"])(items) ? [] : items;
files = Object(lodash__WEBPACK_IMPORTED_MODULE_11__["isNil"])(files) ? [] : files;
var plainText = '';
var html = ''; // IE11 only supports `Text` as an argument for `getData` and will
// otherwise throw an invalid argument error, so we try the standard
// arguments first, then fallback to `Text` if they fail.
try {
plainText = clipboardData.getData('text/plain');
html = clipboardData.getData('text/html');
} catch (error1) {
try {
html = clipboardData.getData('Text');
} catch (error2) {
// Some browsers like UC Browser paste plain text by default and
// don't support clipboardData at all, so allow default
// behaviour.
return;
}
}
event.preventDefault(); // Allows us to ask for this information when we get a report.
window.console.log('Received HTML:\n\n', html);
window.console.log('Received plain text:\n\n', plainText);
var record = this.record;
var transformed = formatTypes.reduce(function (accumlator, _ref3) {
var __unstablePasteRule = _ref3.__unstablePasteRule; // Only allow one transform.
if (__unstablePasteRule && accumlator === record) {
accumlator = __unstablePasteRule(record, {
html: html,
plainText: plainText
});
}
return accumlator;
}, record);
if (transformed !== record) {
this.onChange(transformed);
return;
}
if (onPaste) {
// Only process file if no HTML is present.
// Note: a pasted file may have the URL as plain text.
var image = Object(lodash__WEBPACK_IMPORTED_MODULE_11__["find"])([].concat(Object(_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_2__["default"])(items), Object(_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_2__["default"])(files)), function (_ref4) {
var type = _ref4.type;
return /^image\/(?:jpe?g|png|gif)$/.test(type);
});
onPaste({
value: this.removeEditorOnlyFormats(record),
onChange: this.onChange,
html: html,
plainText: plainText,
image: image
});
}
}
/**
* Handles a focus event on the contenteditable field, calling the
* `unstableOnFocus` prop callback if one is defined. The callback does not
* receive any arguments.
*
* This is marked as a private API and the `unstableOnFocus` prop is not
* documented, as the current requirements where it is used are subject to
* future refactoring following `isSelected` handling.
*
* In contrast with `setFocusedElement`, this is only triggered in response
* to focus within the contenteditable field, whereas `setFocusedElement`
* is triggered on focus within any `RichText` descendent element.
*
* @see setFocusedElement
*
* @private
*/
}, {
key: "onFocus",
value: function onFocus() {
var unstableOnFocus = this.props.unstableOnFocus;
if (unstableOnFocus) {
unstableOnFocus();
}
this.recalculateBoundaryStyle(); // We know for certain that on focus, the old selection is invalid. It
// will be recalculated on the next mouseup, keyup, or touchend event.
var index = undefined;
var activeFormats = undefined;
this.record = Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_1__["default"])({}, this.record, {
start: index,
end: index,
activeFormats: activeFormats
});
this.props.onSelectionChange(index, index);
this.setState({
activeFormats: activeFormats
}); // Update selection as soon as possible, which is at the next animation
// frame. The event listener for selection changes may be added too late
// at this point, but this focus event is still too early to calculate
// the selection.
this.rafId = window.requestAnimationFrame(this.onSelectionChange);
document.addEventListener('selectionchange', this.onSelectionChange);
}
}, {
key: "onBlur",
value: function onBlur() {
document.removeEventListener('selectionchange', this.onSelectionChange);
}
/**
* Handle input on the next selection change event.
*
* @param {SyntheticEvent} event Synthetic input event.
*/
}, {
key: "onInput",
value: function onInput(event) {
// For Input Method Editor (IME), used in Chinese, Japanese, and Korean
// (CJK), do not trigger a change if characters are being composed.
// Browsers setting `isComposing` to `true` will usually emit a final
// `input` event when the characters are composed.
if (event && event.nativeEvent.isComposing) {
// Also don't update any selection.
document.removeEventListener('selectionchange', this.onSelectionChange);
return;
}
var inputType;
if (event) {
inputType = event.nativeEvent.inputType;
} // The browser formatted something or tried to insert HTML.
// Overwrite it. It will be handled later by the format library if
// needed.
if (inputType && (inputType.indexOf('format') === 0 || INSERTION_INPUT_TYPES_TO_IGNORE.has(inputType))) {
this.applyRecord(this.record);
return;
}
var value = this.createRecord();
var _this$record = this.record,
start = _this$record.start,
_this$record$activeFo = _this$record.activeFormats,
activeFormats = _this$record$activeFo === void 0 ? [] : _this$record$activeFo; // Update the formats between the last and new caret position.
var change = Object(_update_formats__WEBPACK_IMPORTED_MODULE_28__["updateFormats"])({
value: value,
start: start,
end: value.start,
formats: activeFormats
});
this.onChange(change, {
withoutHistory: true
});
var _this$props2 = this.props,
inputRule = _this$props2.__unstableInputRule,
markAutomaticChange = _this$props2.__unstableMarkAutomaticChange,
formatTypes = _this$props2.formatTypes,
setTimeout = _this$props2.setTimeout,
clearTimeout = _this$props2.clearTimeout; // Create an undo level when input stops for over a second.
clearTimeout(this.onInput.timeout);
this.onInput.timeout = setTimeout(this.onCreateUndoLevel, 1000); // Only run input rules when inserting text.
if (inputType !== 'insertText') {
return;
}
if (inputRule) {
inputRule(change, this.valueToFormat);
}
var transformed = formatTypes.reduce(function (accumlator, _ref5) {
var __unstableInputRule = _ref5.__unstableInputRule;
if (__unstableInputRule) {
accumlator = __unstableInputRule(accumlator);
}
return accumlator;
}, change);
if (transformed !== change) {
this.onCreateUndoLevel();
this.onChange(Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_1__["default"])({}, transformed, {
activeFormats: activeFormats
}));
markAutomaticChange();
}
}
}, {
key: "onCompositionEnd",
value: function onCompositionEnd() {
// Ensure the value is up-to-date for browsers that don't emit a final
// input event after composition.
this.onInput(); // Tracking selection changes can be resumed.
document.addEventListener('selectionchange', this.onSelectionChange);
}
/**
* Syncs the selection to local state. A callback for the `selectionchange`
* native events, `keyup`, `mouseup` and `touchend` synthetic events, and
* animation frames after the `focus` event.
*
* @param {Event|SyntheticEvent|DOMHighResTimeStamp} event
*/
}, {
key: "onSelectionChange",
value: function onSelectionChange(event) {
if (event.type !== 'selectionchange' && !this.props.__unstableIsSelected) {
return;
} // In case of a keyboard event, ignore selection changes during
// composition.
if (event.nativeEvent && event.nativeEvent.isComposing) {
return;
}
var _this$createRecord = this.createRecord(),
start = _this$createRecord.start,
end = _this$createRecord.end;
var value = this.record;
if (start === value.start && end === value.end) {
return;
}
var _this$props3 = this.props,
isCaretWithinFormattedText = _this$props3.__unstableIsCaretWithinFormattedText,
onEnterFormattedText = _this$props3.__unstableOnEnterFormattedText,
onExitFormattedText = _this$props3.__unstableOnExitFormattedText;
var newValue = Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_1__["default"])({}, value, {
start: start,
end: end,
// Allow `getActiveFormats` to get new `activeFormats`.
activeFormats: undefined
});
var activeFormats = Object(_get_active_formats__WEBPACK_IMPORTED_MODULE_27__["getActiveFormats"])(newValue); // Update the value with the new active formats.
newValue.activeFormats = activeFormats;
if (!isCaretWithinFormattedText && activeFormats.length) {
onEnterFormattedText();
} else if (isCaretWithinFormattedText && !activeFormats.length) {
onExitFormattedText();
} // It is important that the internal value is updated first,
// otherwise the value will be wrong on render!
this.record = newValue;
this.applyRecord(newValue, {
domOnly: true
});
this.props.onSelectionChange(start, end);
this.setState({
activeFormats: activeFormats
});
if (activeFormats.length > 0) {
this.recalculateBoundaryStyle();
}
}
}, {
key: "recalculateBoundaryStyle",
value: function recalculateBoundaryStyle() {
var boundarySelector = '*[data-rich-text-format-boundary]';
var element = this.editableRef.querySelector(boundarySelector);
if (!element) {
return;
}
var computedStyle = getComputedStyle(element);
var newColor = computedStyle.color.replace(')', ', 0.2)').replace('rgb', 'rgba');
var selector = ".rich-text:focus ".concat(boundarySelector);
var rule = "background-color: ".concat(newColor);
globalStyle.innerHTML = "".concat(selector, " {").concat(rule, "}");
}
/**
* Sync the value to global state. The node tree and selection will also be
* updated if differences are found.
*
* @param {Object} record The record to sync and apply.
* @param {Object} $2 Named options.
* @param {boolean} $2.withoutHistory If true, no undo level will be
* created.
*/
}, {
key: "onChange",
value: function onChange(record) {
var _ref6 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
withoutHistory = _ref6.withoutHistory;
this.applyRecord(record);
var start = record.start,
end = record.end,
_record$activeFormats = record.activeFormats,
activeFormats = _record$activeFormats === void 0 ? [] : _record$activeFormats;
var changeHandlers = Object(lodash__WEBPACK_IMPORTED_MODULE_11__["pickBy"])(this.props, function (v, key) {
return key.startsWith('format_on_change_functions_');
});
Object.values(changeHandlers).forEach(function (changeHandler) {
changeHandler(record.formats, record.text);
});
this.value = this.valueToFormat(record);
this.record = record;
this.props.onChange(this.value);
this.props.onSelectionChange(start, end);
this.setState({
activeFormats: activeFormats
});
if (!withoutHistory) {
this.onCreateUndoLevel();
}
}
}, {
key: "onCreateUndoLevel",
value: function onCreateUndoLevel() {
// If the content is the same, no level needs to be created.
if (this.lastHistoryValue === this.value) {
return;
}
this.props.__unstableOnCreateUndoLevel();
this.lastHistoryValue = this.value;
}
/**
* Handles delete on keydown:
* - outdent list items,
* - delete content if everything is selected,
* - trigger the onDelete prop when selection is uncollapsed and at an edge.
*
* @param {SyntheticEvent} event A synthetic keyboard event.
*/
}, {
key: "handleDelete",
value: function handleDelete(event) {
var keyCode = event.keyCode;
if (keyCode !== _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_12__["DELETE"] && keyCode !== _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_12__["BACKSPACE"] && keyCode !== _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_12__["ESCAPE"]) {
return;
}
if (this.props.__unstableDidAutomaticChange) {
event.preventDefault();
this.props.__unstableUndo();
return;
}
if (keyCode === _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_12__["ESCAPE"]) {
return;
}
var _this$props4 = this.props,
onDelete = _this$props4.onDelete,
multilineTag = _this$props4.__unstableMultilineTag;
var _this$state$activeFor = this.state.activeFormats,
activeFormats = _this$state$activeFor === void 0 ? [] : _this$state$activeFor;
var value = this.createRecord();
var start = value.start,
end = value.end,
text = value.text;
var isReverse = keyCode === _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_12__["BACKSPACE"];
if (multilineTag) {
var newValue = Object(_remove_line_separator__WEBPACK_IMPORTED_MODULE_29__["removeLineSeparator"])(value, isReverse);
if (newValue) {
this.onChange(newValue);
event.preventDefault();
}
} // Always handle full content deletion ourselves.
if (start === 0 && end !== 0 && end === text.length) {
this.onChange(Object(_remove__WEBPACK_IMPORTED_MODULE_22__["remove"])(value));
event.preventDefault();
return;
} // Only process delete if the key press occurs at an uncollapsed edge.
if (!onDelete || !Object(_is_collapsed__WEBPACK_IMPORTED_MODULE_24__["isCollapsed"])(value) || activeFormats.length || isReverse && start !== 0 || !isReverse && end !== text.length) {
return;
}
onDelete({
isReverse: isReverse,
value: value
});
event.preventDefault();
}
/**
* Triggers the `onEnter` prop on keydown.
*
* @param {SyntheticEvent} event A synthetic keyboard event.
*/
}, {
key: "handleEnter",
value: function handleEnter(event) {
if (event.keyCode !== _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_12__["ENTER"]) {
return;
}
event.preventDefault();
var onEnter = this.props.onEnter;
if (!onEnter) {
return;
}
onEnter({
value: this.removeEditorOnlyFormats(this.createRecord()),
onChange: this.onChange,
shiftKey: event.shiftKey
});
}
/**
* Indents list items on space keydown.
*
* @param {SyntheticEvent} event A synthetic keyboard event.
*/
}, {
key: "handleSpace",
value: function handleSpace(event) {
var _this$props5 = this.props,
tagName = _this$props5.tagName,
multilineTag = _this$props5.__unstableMultilineTag;
if (event.keyCode !== _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_12__["SPACE"] || multilineTag !== 'li') {
return;
}
var value = this.createRecord();
if (!Object(_is_collapsed__WEBPACK_IMPORTED_MODULE_24__["isCollapsed"])(value)) {
return;
}
var text = value.text,
start = value.start;
var characterBefore = text[start - 1]; // The caret must be at the start of a line.
if (characterBefore && characterBefore !== _special_characters__WEBPACK_IMPORTED_MODULE_25__["LINE_SEPARATOR"]) {
return;
}
this.onChange(Object(_indent_list_items__WEBPACK_IMPORTED_MODULE_26__["indentListItems"])(value, {
type: tagName
}));
event.preventDefault();
}
/**
* Handles horizontal keyboard navigation when no modifiers are pressed. The
* navigation is handled separately to move correctly around format
* boundaries.
*
* @param {SyntheticEvent} event A synthetic keyboard event.
*/
}, {
key: "handleHorizontalNavigation",
value: function handleHorizontalNavigation(event) {
var _this2 = this;
var keyCode = event.keyCode,
shiftKey = event.shiftKey,
altKey = event.altKey,
metaKey = event.metaKey,
ctrlKey = event.ctrlKey;
if ( // Only override left and right keys without modifiers pressed.
shiftKey || altKey || metaKey || ctrlKey || keyCode !== _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_12__["LEFT"] && keyCode !== _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_12__["RIGHT"]) {
return;
}
var value = this.record;
var text = value.text,
formats = value.formats,
start = value.start,
end = value.end,
_value$activeFormats = value.activeFormats,
activeFormats = _value$activeFormats === void 0 ? [] : _value$activeFormats;
var collapsed = Object(_is_collapsed__WEBPACK_IMPORTED_MODULE_24__["isCollapsed"])(value); // To do: ideally, we should look at visual position instead.
var _getComputedStyle = getComputedStyle(this.editableRef),
direction = _getComputedStyle.direction;
var reverseKey = direction === 'rtl' ? _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_12__["RIGHT"] : _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_12__["LEFT"];
var isReverse = event.keyCode === reverseKey; // If the selection is collapsed and at the very start, do nothing if
// navigating backward.
// If the selection is collapsed and at the very end, do nothing if
// navigating forward.
if (collapsed && activeFormats.length === 0) {
if (start === 0 && isReverse) {
return;
}
if (end === text.length && !isReverse) {
return;
}
} // If the selection is not collapsed, let the browser handle collapsing
// the selection for now. Later we could expand this logic to set
// boundary positions if needed.
if (!collapsed) {
return;
} // In all other cases, prevent default behaviour.
event.preventDefault();
var formatsBefore = formats[start - 1] || [];
var formatsAfter = formats[start] || [];
var newActiveFormatsLength = activeFormats.length;
var source = formatsAfter;
if (formatsBefore.length > formatsAfter.length) {
source = formatsBefore;
} // If the amount of formats before the caret and after the caret is
// different, the caret is at a format boundary.
if (formatsBefore.length < formatsAfter.length) {
if (!isReverse && activeFormats.length < formatsAfter.length) {
newActiveFormatsLength++;
}
if (isReverse && activeFormats.length > formatsBefore.length) {
newActiveFormatsLength--;
}
} else if (formatsBefore.length > formatsAfter.length) {
if (!isReverse && activeFormats.length > formatsAfter.length) {
newActiveFormatsLength--;
}
if (isReverse && activeFormats.length < formatsBefore.length) {
newActiveFormatsLength++;
}
} // Wait for boundary class to be added.
this.props.setTimeout(function () {
return _this2.recalculateBoundaryStyle();
});
if (newActiveFormatsLength !== activeFormats.length) {
var _newActiveFormats = source.slice(0, newActiveFormatsLength);
var _newValue = Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_1__["default"])({}, value, {
activeFormats: _newActiveFormats
});
this.record = _newValue;
this.applyRecord(_newValue);
this.setState({
activeFormats: _newActiveFormats
});
return;
}
var newPos = start + (isReverse ? -1 : 1);
var newActiveFormats = isReverse ? formatsBefore : formatsAfter;
var newValue = Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_1__["default"])({}, value, {
start: newPos,
end: newPos,
activeFormats: newActiveFormats
});
this.record = newValue;
this.applyRecord(newValue);
this.props.onSelectionChange(newPos, newPos);
this.setState({
activeFormats: newActiveFormats
});
}
/**
* Select object when they are clicked. The browser will not set any
* selection when clicking e.g. an image.
*
* @param {SyntheticEvent} event Synthetic mousedown or touchstart event.
*/
}, {
key: "onPointerDown",
value: function onPointerDown(event) {
var target = event.target; // If the child element has no text content, it must be an object.
if (target === this.editableRef || target.textContent) {
return;
}
var parentNode = target.parentNode;
var index = Array.from(parentNode.childNodes).indexOf(target);
var range = target.ownerDocument.createRange();
var selection = getSelection();
range.setStart(target.parentNode, index);
range.setEnd(target.parentNode, index + 1);
selection.removeAllRanges();
selection.addRange(range);
}
}, {
key: "componentDidUpdate",
value: function componentDidUpdate(prevProps) {
var _this$props6 = this.props,
tagName = _this$props6.tagName,
value = _this$props6.value,
selectionStart = _this$props6.selectionStart,
selectionEnd = _this$props6.selectionEnd,
placeholder = _this$props6.placeholder,
isSelected = _this$props6.__unstableIsSelected; // Check if the content changed.
var shouldReapply = tagName === prevProps.tagName && value !== prevProps.value && value !== this.value; // Check if the selection changed.
shouldReapply = shouldReapply || isSelected && !prevProps.isSelected && (this.record.start !== selectionStart || this.record.end !== selectionEnd);
var prefix = 'format_prepare_props_';
var predicate = function predicate(v, key) {
return key.startsWith(prefix);
};
var prepareProps = Object(lodash__WEBPACK_IMPORTED_MODULE_11__["pickBy"])(this.props, predicate);
var prevPrepareProps = Object(lodash__WEBPACK_IMPORTED_MODULE_11__["pickBy"])(prevProps, predicate); // Check if any format props changed.
shouldReapply = shouldReapply || !_wordpress_is_shallow_equal__WEBPACK_IMPORTED_MODULE_15___default()(prepareProps, prevPrepareProps); // Rerender if the placeholder changed.
shouldReapply = shouldReapply || placeholder !== prevProps.placeholder;
var _this$record$activeFo2 = this.record.activeFormats,
activeFormats = _this$record$activeFo2 === void 0 ? [] : _this$record$activeFo2;
if (shouldReapply) {
this.value = value;
this.record = this.formatToValue(value);
this.record.start = selectionStart;
this.record.end = selectionEnd;
Object(_update_formats__WEBPACK_IMPORTED_MODULE_28__["updateFormats"])({
value: this.record,
start: this.record.start,
end: this.record.end,
formats: activeFormats
});
this.applyRecord(this.record);
} else if (this.record.start !== selectionStart || this.record.end !== selectionEnd) {
this.record = Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_1__["default"])({}, this.record, {
start: selectionStart,
end: selectionEnd
});
}
}
/**
* Converts the outside data structure to our internal representation.
*
* @param {*} value The outside value, data type depends on props.
* @return {Object} An internal rich-text value.
*/
}, {
key: "formatToValue",
value: function formatToValue(value) {
var _this$props7 = this.props,
format = _this$props7.format,
multilineTag = _this$props7.__unstableMultilineTag;
if (format !== 'string') {
return value;
}
var prepare = createPrepareEditableTree(this.props, 'format_value_functions');
value = Object(_create__WEBPACK_IMPORTED_MODULE_19__["create"])({
html: value,
multilineTag: multilineTag,
multilineWrapperTags: multilineTag === 'li' ? ['ul', 'ol'] : undefined
});
value.formats = prepare(value);
return value;
}
}, {
key: "valueToEditableHTML",
value: function valueToEditableHTML(value) {
var multilineTag = this.props.__unstableMultilineTag;
return Object(_to_dom__WEBPACK_IMPORTED_MODULE_20__["toDom"])({
value: value,
multilineTag: multilineTag,
prepareEditableTree: createPrepareEditableTree(this.props, 'format_prepare_functions'),
placeholder: this.props.placeholder
}).body.innerHTML;
}
/**
* Removes editor only formats from the value.
*
* Editor only formats are applied using `prepareEditableTree`, so we need to
* remove them before converting the internal state
*
* @param {Object} value The internal rich-text value.
* @return {Object} A new rich-text value.
*/
}, {
key: "removeEditorOnlyFormats",
value: function removeEditorOnlyFormats(value) {
this.props.formatTypes.forEach(function (formatType) {
// Remove formats created by prepareEditableTree, because they are editor only.
if (formatType.__experimentalCreatePrepareEditableTree) {
value = Object(_remove_format__WEBPACK_IMPORTED_MODULE_23__["removeFormat"])(value, formatType.name, 0, value.text.length);
}
});
return value;
}
/**
* Converts the internal value to the external data format.
*
* @param {Object} value The internal rich-text value.
* @return {*} The external data format, data type depends on props.
*/
}, {
key: "valueToFormat",
value: function valueToFormat(value) {
var _this$props8 = this.props,
format = _this$props8.format,
multilineTag = _this$props8.__unstableMultilineTag;
value = this.removeEditorOnlyFormats(value);
if (format !== 'string') {
return;
}
return Object(_to_html_string__WEBPACK_IMPORTED_MODULE_21__["toHTMLString"])({
value: value,
multilineTag: multilineTag
});
}
}, {
key: "Editable",
value: function Editable(props) {
var _this$props9 = this.props,
_this$props9$tagName = _this$props9.tagName,
Tagname = _this$props9$tagName === void 0 ? 'div' : _this$props9$tagName,
style = _this$props9.style,
className = _this$props9.className,
placeholder = _this$props9.placeholder; // Generating a key that includes `tagName` ensures that if the tag
// changes, we replace the relevant element. This is needed because we
// prevent Editable component updates.
var key = Tagname;
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_9__["createElement"])(_editable__WEBPACK_IMPORTED_MODULE_17__["default"], Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, props, {
tagName: Tagname,
style: style,
record: this.record,
valueToEditableHTML: this.valueToEditableHTML,
"aria-label": placeholder
}, Object(_aria__WEBPACK_IMPORTED_MODULE_18__["pickAriaProps"])(this.props), {
className: classnames__WEBPACK_IMPORTED_MODULE_10___default()('rich-text', className),
key: key,
onPaste: this.onPaste,
onInput: this.onInput,
onCompositionEnd: this.onCompositionEnd,
onKeyDown: this.onKeyDown,
onFocus: this.onFocus,
onBlur: this.onBlur,
onMouseDown: this.onPointerDown,
onTouchStart: this.onPointerDown,
setRef: this.setRef // Selection updates must be done at these events as they
// happen before the `selectionchange` event. In some cases,
// the `selectionchange` event may not even fire, for
// example when the window receives focus again on click.
,
onKeyUp: this.onSelectionChange,
onMouseUp: this.onSelectionChange,
onTouchEnd: this.onSelectionChange
}));
}
}, {
key: "render",
value: function render() {
var _this$props10 = this.props,
isSelected = _this$props10.__unstableIsSelected,
children = _this$props10.children,
allowedFormats = _this$props10.allowedFormats,
withoutInteractiveFormatting = _this$props10.withoutInteractiveFormatting;
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_9__["createElement"])(_wordpress_element__WEBPACK_IMPORTED_MODULE_9__["Fragment"], null, isSelected && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_9__["createElement"])(_format_edit__WEBPACK_IMPORTED_MODULE_16__["default"], {
allowedFormats: allowedFormats,
withoutInteractiveFormatting: withoutInteractiveFormatting,
value: this.record,
onChange: this.onChange
}), children && children({
isSelected: isSelected,
value: this.record,
onChange: this.onChange,
Editable: this.Editable
}), !children && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_9__["createElement"])(this.Editable, null));
}
}]);
return RichText;
}(_wordpress_element__WEBPACK_IMPORTED_MODULE_9__["Component"]);
RichText.defaultProps = {
format: 'string',
value: ''
};
/**
* Renders a rich content input, providing users with the option to format the
* content.
*/
/* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_14__["compose"])([Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_13__["withSelect"])(function (select) {
return {
formatTypes: select('core/rich-text').getFormatTypes()
};
}), _wordpress_compose__WEBPACK_IMPORTED_MODULE_14__["withSafeTimeout"]])(RichText));
/***/ }),
/***/ "./node_modules/@wordpress/rich-text/build-module/concat.js":
/*!******************************************************************!*\
!*** ./node_modules/@wordpress/rich-text/build-module/concat.js ***!
\******************************************************************/
/*! exports provided: mergePair, concat */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "mergePair", function() { return mergePair; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "concat", function() { return concat; });
/* harmony import */ var _normalise_formats__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./normalise-formats */ "./node_modules/@wordpress/rich-text/build-module/normalise-formats.js");
/* harmony import */ var _create__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./create */ "./node_modules/@wordpress/rich-text/build-module/create.js");
/**
* Internal dependencies
*/
/**
* Concats a pair of rich text values. Not that this mutates `a` and does NOT
* normalise formats!
*
* @param {Object} a Value to mutate.
* @param {Object} b Value to add read from.
*
* @return {Object} `a`, mutated.
*/
function mergePair(a, b) {
a.formats = a.formats.concat(b.formats);
a.replacements = a.replacements.concat(b.replacements);
a.text += b.text;
return a;
}
/**
* Combine all Rich Text values into one. This is similar to
* `String.prototype.concat`.
*
* @param {...Object} values Objects to combine.
*
* @return {Object} A new value combining all given records.
*/
function concat() {
for (var _len = arguments.length, values = new Array(_len), _key = 0; _key < _len; _key++) {
values[_key] = arguments[_key];
}
return Object(_normalise_formats__WEBPACK_IMPORTED_MODULE_0__["normaliseFormats"])(values.reduce(mergePair, Object(_create__WEBPACK_IMPORTED_MODULE_1__["create"])()));
}
/***/ }),
/***/ "./node_modules/@wordpress/rich-text/build-module/create-element.js":
/*!**************************************************************************!*\
!*** ./node_modules/@wordpress/rich-text/build-module/create-element.js ***!
\**************************************************************************/
/*! exports provided: createElement */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createElement", function() { return createElement; });
/**
* Parse the given HTML into a body element.
*
* Note: The current implementation will return a shared reference, reset on
* each call to `createElement`. Therefore, you should not hold a reference to
* the value to operate upon asynchronously, as it may have unexpected results.
*
* @param {HTMLDocument} document The HTML document to use to parse.
* @param {string} html The HTML to parse.
*
* @return {HTMLBodyElement} Body element with parsed HTML.
*/
function createElement(_ref, html) {
var implementation = _ref.implementation; // Because `createHTMLDocument` is an expensive operation, and with this
// function being internal to `rich-text` (full control in avoiding a risk
// of asynchronous operations on the shared reference), a single document
// is reused and reset for each call to the function.
if (!createElement.body) {
createElement.body = implementation.createHTMLDocument('').body;
}
createElement.body.innerHTML = html;
return createElement.body;
}
/***/ }),
/***/ "./node_modules/@wordpress/rich-text/build-module/create.js":
/*!******************************************************************!*\
!*** ./node_modules/@wordpress/rich-text/build-module/create.js ***!
\******************************************************************/
/*! exports provided: create */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "create", function() { return create; });
/* 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_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_typeof__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/typeof */ "./node_modules/@babel/runtime/helpers/esm/typeof.js");
/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/data */ "./node_modules/@wordpress/data/build-module/index.js");
/* harmony import */ var _is_format_equal__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./is-format-equal */ "./node_modules/@wordpress/rich-text/build-module/is-format-equal.js");
/* harmony import */ var _create_element__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./create-element */ "./node_modules/@wordpress/rich-text/build-module/create-element.js");
/* harmony import */ var _concat__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./concat */ "./node_modules/@wordpress/rich-text/build-module/concat.js");
/* harmony import */ var _special_characters__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./special-characters */ "./node_modules/@wordpress/rich-text/build-module/special-characters.js");
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
/**
* Browser dependencies
*/
var _window$Node = window.Node,
TEXT_NODE = _window$Node.TEXT_NODE,
ELEMENT_NODE = _window$Node.ELEMENT_NODE;
function createEmptyValue() {
return {
formats: [],
replacements: [],
text: ''
};
}
function simpleFindKey(object, value) {
for (var key in object) {
if (object[key] === value) {
return key;
}
}
}
function toFormat(_ref) {
var type = _ref.type,
attributes = _ref.attributes;
var formatType;
if (attributes && attributes.class) {
formatType = Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_3__["select"])('core/rich-text').getFormatTypeForClassName(attributes.class);
if (formatType) {
// Preserve any additional classes.
attributes.class = " ".concat(attributes.class, " ").replace(" ".concat(formatType.className, " "), ' ').trim();
if (!attributes.class) {
delete attributes.class;
}
}
}
if (!formatType) {
formatType = Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_3__["select"])('core/rich-text').getFormatTypeForBareElement(type);
}
if (!formatType) {
return attributes ? {
type: type,
attributes: attributes
} : {
type: type
};
}
if (formatType.__experimentalCreatePrepareEditableTree && !formatType.__experimentalCreateOnChangeEditableValue) {
return null;
}
if (!attributes) {
return {
type: formatType.name
};
}
var registeredAttributes = {};
var unregisteredAttributes = {};
for (var name in attributes) {
var key = simpleFindKey(formatType.attributes, name);
if (key) {
registeredAttributes[key] = attributes[name];
} else {
unregisteredAttributes[name] = attributes[name];
}
}
return {
type: formatType.name,
attributes: registeredAttributes,
unregisteredAttributes: unregisteredAttributes
};
}
/**
* Create a RichText value from an `Element` tree (DOM), an HTML string or a
* plain text string, with optionally a `Range` object to set the selection. If
* called without any input, an empty value will be created. If
* `multilineTag` is provided, any content of direct children whose type matches
* `multilineTag` will be separated by two newlines. The optional functions can
* be used to filter out content.
*
* A value will have the following shape, which you are strongly encouraged not
* to modify without the use of helper functions:
*
* ```js
* {
* text: string,
* formats: Array,
* replacements: Array,
* ?start: number,
* ?end: number,
* }
* ```
*
* As you can see, text and formatting are separated. `text` holds the text,
* including any replacement characters for objects and lines. `formats`,
* `objects` and `lines` are all sparse arrays of the same length as `text`. It
* holds information about the formatting at the relevant text indices. Finally
* `start` and `end` state which text indices are selected. They are only
* provided if a `Range` was given.
*
* @param {Object} [$1] Optional named arguments.
* @param {Element} [$1.element] Element to create value from.
* @param {string} [$1.text] Text to create value from.
* @param {string} [$1.html] HTML to create value from.
* @param {Range} [$1.range] Range to create value from.
* @param {string} [$1.multilineTag] Multiline tag if the structure is
* multiline.
* @param {Array} [$1.multilineWrapperTags] Tags where lines can be found if
* nesting is possible.
*
* @return {Object} A rich text value.
*/
function create() {
var _ref2 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
element = _ref2.element,
text = _ref2.text,
html = _ref2.html,
range = _ref2.range,
multilineTag = _ref2.multilineTag,
multilineWrapperTags = _ref2.multilineWrapperTags,
isEditableTree = _ref2.__unstableIsEditableTree;
if (typeof text === 'string' && text.length > 0) {
return {
formats: Array(text.length),
replacements: Array(text.length),
text: text
};
}
if (typeof html === 'string' && html.length > 0) {
element = Object(_create_element__WEBPACK_IMPORTED_MODULE_5__["createElement"])(document, html);
}
if (Object(_babel_runtime_helpers_esm_typeof__WEBPACK_IMPORTED_MODULE_2__["default"])(element) !== 'object') {
return createEmptyValue();
}
if (!multilineTag) {
return createFromElement({
element: element,
range: range,
isEditableTree: isEditableTree
});
}
return createFromMultilineElement({
element: element,
range: range,
multilineTag: multilineTag,
multilineWrapperTags: multilineWrapperTags,
isEditableTree: isEditableTree
});
}
/**
* Helper to accumulate the value's selection start and end from the current
* node and range.
*
* @param {Object} accumulator Object to accumulate into.
* @param {Node} node Node to create value with.
* @param {Range} range Range to create value with.
* @param {Object} value Value that is being accumulated.
*/
function accumulateSelection(accumulator, node, range, value) {
if (!range) {
return;
}
var parentNode = node.parentNode;
var startContainer = range.startContainer,
startOffset = range.startOffset,
endContainer = range.endContainer,
endOffset = range.endOffset;
var currentLength = accumulator.text.length; // Selection can be extracted from value.
if (value.start !== undefined) {
accumulator.start = currentLength + value.start; // Range indicates that the current node has selection.
} else if (node === startContainer && node.nodeType === TEXT_NODE) {
accumulator.start = currentLength + startOffset; // Range indicates that the current node is selected.
} else if (parentNode === startContainer && node === startContainer.childNodes[startOffset]) {
accumulator.start = currentLength; // Range indicates that the selection is after the current node.
} else if (parentNode === startContainer && node === startContainer.childNodes[startOffset - 1]) {
accumulator.start = currentLength + value.text.length; // Fallback if no child inside handled the selection.
} else if (node === startContainer) {
accumulator.start = currentLength;
} // Selection can be extracted from value.
if (value.end !== undefined) {
accumulator.end = currentLength + value.end; // Range indicates that the current node has selection.
} else if (node === endContainer && node.nodeType === TEXT_NODE) {
accumulator.end = currentLength + endOffset; // Range indicates that the current node is selected.
} else if (parentNode === endContainer && node === endContainer.childNodes[endOffset - 1]) {
accumulator.end = currentLength + value.text.length; // Range indicates that the selection is before the current node.
} else if (parentNode === endContainer && node === endContainer.childNodes[endOffset]) {
accumulator.end = currentLength; // Fallback if no child inside handled the selection.
} else if (node === endContainer) {
accumulator.end = currentLength + endOffset;
}
}
/**
* Adjusts the start and end offsets from a range based on a text filter.
*
* @param {Node} node Node of which the text should be filtered.
* @param {Range} range The range to filter.
* @param {Function} filter Function to use to filter the text.
*
* @return {?Object} Object containing range properties.
*/
function filterRange(node, range, filter) {
if (!range) {
return;
}
var startContainer = range.startContainer,
endContainer = range.endContainer;
var startOffset = range.startOffset,
endOffset = range.endOffset;
if (node === startContainer) {
startOffset = filter(node.nodeValue.slice(0, startOffset)).length;
}
if (node === endContainer) {
endOffset = filter(node.nodeValue.slice(0, endOffset)).length;
}
return {
startContainer: startContainer,
startOffset: startOffset,
endContainer: endContainer,
endOffset: endOffset
};
}
var ZWNBSPRegExp = new RegExp(_special_characters__WEBPACK_IMPORTED_MODULE_7__["ZWNBSP"], 'g');
function filterString(string) {
// Reduce any whitespace used for HTML formatting to one space
// character, because it will also be displayed as such by the browser.
return string.replace(/[\n\r\t]+/g, ' ') // Remove padding added by `toTree`.
.replace(ZWNBSPRegExp, '');
}
/**
* Creates a Rich Text value from a DOM element and range.
*
* @param {Object} $1 Named argements.
* @param {?Element} $1.element Element to create value from.
* @param {?Range} $1.range Range to create value from.
* @param {?string} $1.multilineTag Multiline tag if the structure is
* multiline.
* @param {?Array} $1.multilineWrapperTags Tags where lines can be found if
* nesting is possible.
*
* @return {Object} A rich text value.
*/
function createFromElement(_ref3) {
var element = _ref3.element,
range = _ref3.range,
multilineTag = _ref3.multilineTag,
multilineWrapperTags = _ref3.multilineWrapperTags,
_ref3$currentWrapperT = _ref3.currentWrapperTags,
currentWrapperTags = _ref3$currentWrapperT === void 0 ? [] : _ref3$currentWrapperT,
isEditableTree = _ref3.isEditableTree;
var accumulator = createEmptyValue();
if (!element) {
return accumulator;
}
if (!element.hasChildNodes()) {
accumulateSelection(accumulator, element, range, createEmptyValue());
return accumulator;
}
var length = element.childNodes.length; // Optimise for speed.
var _loop = function _loop(index) {
var node = element.childNodes[index];
var type = node.nodeName.toLowerCase();
if (node.nodeType === TEXT_NODE) {
var text = filterString(node.nodeValue);
range = filterRange(node, range, filterString);
accumulateSelection(accumulator, node, range, {
text: text
}); // Create a sparse array of the same length as `text`, in which
// formats can be added.
accumulator.formats.length += text.length;
accumulator.replacements.length += text.length;
accumulator.text += text;
return "continue";
}
if (node.nodeType !== ELEMENT_NODE) {
return "continue";
}
if (isEditableTree && ( // Ignore any placeholders.
node.getAttribute('data-rich-text-placeholder') || // Ignore any line breaks that are not inserted by us.
type === 'br' && !node.getAttribute('data-rich-text-line-break'))) {
accumulateSelection(accumulator, node, range, createEmptyValue());
return "continue";
}
if (type === 'br') {
accumulateSelection(accumulator, node, range, createEmptyValue());
Object(_concat__WEBPACK_IMPORTED_MODULE_6__["mergePair"])(accumulator, create({
text: '\n'
}));
return "continue";
}
var lastFormats = accumulator.formats[accumulator.formats.length - 1];
var lastFormat = lastFormats && lastFormats[lastFormats.length - 1];
var newFormat = toFormat({
type: type,
attributes: getAttributes({
element: node
})
});
var format = Object(_is_format_equal__WEBPACK_IMPORTED_MODULE_4__["isFormatEqual"])(newFormat, lastFormat) ? lastFormat : newFormat;
if (multilineWrapperTags && multilineWrapperTags.indexOf(type) !== -1) {
var _value = createFromMultilineElement({
element: node,
range: range,
multilineTag: multilineTag,
multilineWrapperTags: multilineWrapperTags,
currentWrapperTags: [].concat(Object(_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_1__["default"])(currentWrapperTags), [format]),
isEditableTree: isEditableTree
});
accumulateSelection(accumulator, node, range, _value);
Object(_concat__WEBPACK_IMPORTED_MODULE_6__["mergePair"])(accumulator, _value);
return "continue";
}
var value = createFromElement({
element: node,
range: range,
multilineTag: multilineTag,
multilineWrapperTags: multilineWrapperTags,
isEditableTree: isEditableTree
});
accumulateSelection(accumulator, node, range, value);
if (!format) {
Object(_concat__WEBPACK_IMPORTED_MODULE_6__["mergePair"])(accumulator, value);
} else if (value.text.length === 0) {
if (format.attributes) {
Object(_concat__WEBPACK_IMPORTED_MODULE_6__["mergePair"])(accumulator, {
formats: [,],
replacements: [format],
text: _special_characters__WEBPACK_IMPORTED_MODULE_7__["OBJECT_REPLACEMENT_CHARACTER"]
});
}
} else {
Object(_concat__WEBPACK_IMPORTED_MODULE_6__["mergePair"])(accumulator, Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_0__["default"])({}, value, {
formats: Array.from(value.formats, function (formats) {
return formats ? [format].concat(Object(_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_1__["default"])(formats)) : [format];
})
}));
}
};
for (var index = 0; index < length; index++) {
var _ret = _loop(index);
if (_ret === "continue") continue;
}
return accumulator;
}
/**
* Creates a rich text value from a DOM element and range that should be
* multiline.
*
* @param {Object} $1 Named argements.
* @param {?Element} $1.element Element to create value from.
* @param {?Range} $1.range Range to create value from.
* @param {?string} $1.multilineTag Multiline tag if the structure is
* multiline.
* @param {?Array} $1.multilineWrapperTags Tags where lines can be found if
* nesting is possible.
* @param {boolean} $1.currentWrapperTags Whether to prepend a line
* separator.
*
* @return {Object} A rich text value.
*/
function createFromMultilineElement(_ref4) {
var element = _ref4.element,
range = _ref4.range,
multilineTag = _ref4.multilineTag,
multilineWrapperTags = _ref4.multilineWrapperTags,
_ref4$currentWrapperT = _ref4.currentWrapperTags,
currentWrapperTags = _ref4$currentWrapperT === void 0 ? [] : _ref4$currentWrapperT,
isEditableTree = _ref4.isEditableTree;
var accumulator = createEmptyValue();
if (!element || !element.hasChildNodes()) {
return accumulator;
}
var length = element.children.length; // Optimise for speed.
for (var index = 0; index < length; index++) {
var node = element.children[index];
if (node.nodeName.toLowerCase() !== multilineTag) {
continue;
}
var value = createFromElement({
element: node,
range: range,
multilineTag: multilineTag,
multilineWrapperTags: multilineWrapperTags,
currentWrapperTags: currentWrapperTags,
isEditableTree: isEditableTree
}); // Multiline value text should be separated by a line separator.
if (index !== 0 || currentWrapperTags.length > 0) {
Object(_concat__WEBPACK_IMPORTED_MODULE_6__["mergePair"])(accumulator, {
formats: [,],
replacements: currentWrapperTags.length > 0 ? [currentWrapperTags] : [,],
text: _special_characters__WEBPACK_IMPORTED_MODULE_7__["LINE_SEPARATOR"]
});
}
accumulateSelection(accumulator, node, range, value);
Object(_concat__WEBPACK_IMPORTED_MODULE_6__["mergePair"])(accumulator, value);
}
return accumulator;
}
/**
* Gets the attributes of an element in object shape.
*
* @param {Object} $1 Named argements.
* @param {Element} $1.element Element to get attributes from.
*
* @return {?Object} Attribute object or `undefined` if the element has no
* attributes.
*/
function getAttributes(_ref5) {
var element = _ref5.element;
if (!element.hasAttributes()) {
return;
}
var length = element.attributes.length;
var accumulator; // Optimise for speed.
for (var i = 0; i < length; i++) {
var _element$attributes$i = element.attributes[i],
name = _element$attributes$i.name,
value = _element$attributes$i.value;
if (name.indexOf('data-rich-text-') === 0) {
continue;
}
accumulator = accumulator || {};
accumulator[name] = value;
}
return accumulator;
}
/***/ }),
/***/ "./node_modules/@wordpress/rich-text/build-module/get-active-format.js":
/*!*****************************************************************************!*\
!*** ./node_modules/@wordpress/rich-text/build-module/get-active-format.js ***!
\*****************************************************************************/
/*! exports provided: getActiveFormat */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getActiveFormat", function() { return getActiveFormat; });
/* 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__);
/* harmony import */ var _get_active_formats__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./get-active-formats */ "./node_modules/@wordpress/rich-text/build-module/get-active-formats.js");
/**
* External dependencies
*/
/**
* Internal dependencies
*/
/**
* Gets the format object by type at the start of the selection. This can be
* used to get e.g. the URL of a link format at the current selection, but also
* to check if a format is active at the selection. Returns undefined if there
* is no format at the selection.
*
* @param {Object} value Value to inspect.
* @param {string} formatType Format type to look for.
*
* @return {Object|undefined} Active format object of the specified type, or undefined.
*/
function getActiveFormat(value, formatType) {
return Object(lodash__WEBPACK_IMPORTED_MODULE_0__["find"])(Object(_get_active_formats__WEBPACK_IMPORTED_MODULE_1__["getActiveFormats"])(value), {
type: formatType
});
}
/***/ }),
/***/ "./node_modules/@wordpress/rich-text/build-module/get-active-formats.js":
/*!******************************************************************************!*\
!*** ./node_modules/@wordpress/rich-text/build-module/get-active-formats.js ***!
\******************************************************************************/
/*! exports provided: getActiveFormats */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getActiveFormats", function() { return getActiveFormats; });
/**
* Gets the all format objects at the start of the selection.
*
* @param {Object} value Value to inspect.
*
* @return {?Object} Active format objects.
*/
function getActiveFormats(_ref) {
var formats = _ref.formats,
start = _ref.start,
end = _ref.end,
activeFormats = _ref.activeFormats;
if (start === undefined) {
return [];
}
if (start === end) {
// For a collapsed caret, it is possible to override the active formats.
if (activeFormats) {
return activeFormats;
}
var formatsBefore = formats[start - 1] || [];
var formatsAfter = formats[start] || []; // By default, select the lowest amount of formats possible (which means
// the caret is positioned outside the format boundary). The user can
// then use arrow keys to define `activeFormats`.
if (formatsBefore.length < formatsAfter.length) {
return formatsBefore;
}
return formatsAfter;
}
return formats[start] || [];
}
/***/ }),
/***/ "./node_modules/@wordpress/rich-text/build-module/get-active-object.js":
/*!*****************************************************************************!*\
!*** ./node_modules/@wordpress/rich-text/build-module/get-active-object.js ***!
\*****************************************************************************/
/*! exports provided: getActiveObject */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getActiveObject", function() { return getActiveObject; });
/* harmony import */ var _special_characters__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./special-characters */ "./node_modules/@wordpress/rich-text/build-module/special-characters.js");
/**
* Internal dependencies
*/
/**
* Gets the active object, if there is any.
*
* @param {Object} value Value to inspect.
*
* @return {?Object} Active object, or undefined.
*/
function getActiveObject(_ref) {
var start = _ref.start,
end = _ref.end,
replacements = _ref.replacements,
text = _ref.text;
if (start + 1 !== end || text[start] !== _special_characters__WEBPACK_IMPORTED_MODULE_0__["OBJECT_REPLACEMENT_CHARACTER"]) {
return;
}
return replacements[start];
}
/***/ }),
/***/ "./node_modules/@wordpress/rich-text/build-module/get-format-type.js":
/*!***************************************************************************!*\
!*** ./node_modules/@wordpress/rich-text/build-module/get-format-type.js ***!
\***************************************************************************/
/*! exports provided: getFormatType */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getFormatType", function() { return getFormatType; });
/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/data */ "./node_modules/@wordpress/data/build-module/index.js");
/**
* WordPress dependencies
*/
/**
* Returns a registered format type.
*
* @param {string} name Format name.
*
* @return {?Object} Format type.
*/
function getFormatType(name) {
return Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_0__["select"])('core/rich-text').getFormatType(name);
}
/***/ }),
/***/ "./node_modules/@wordpress/rich-text/build-module/get-last-child-index.js":
/*!********************************************************************************!*\
!*** ./node_modules/@wordpress/rich-text/build-module/get-last-child-index.js ***!
\********************************************************************************/
/*! exports provided: getLastChildIndex */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getLastChildIndex", function() { return getLastChildIndex; });
/* harmony import */ var _special_characters__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./special-characters */ "./node_modules/@wordpress/rich-text/build-module/special-characters.js");
/**
* Internal dependencies
*/
/**
* Gets the line index of the last child in the list.
*
* @param {Object} value Value to search.
* @param {number} lineIndex Line index of a list item in the list.
*
* @return {Array} The index of the last child.
*/
function getLastChildIndex(_ref, lineIndex) {
var text = _ref.text,
replacements = _ref.replacements;
var lineFormats = replacements[lineIndex] || []; // Use the given line index in case there are no next children.
var childIndex = lineIndex; // `lineIndex` could be `undefined` if it's the first line.
for (var index = lineIndex || 0; index < text.length; index++) {
// We're only interested in line indices.
if (text[index] !== _special_characters__WEBPACK_IMPORTED_MODULE_0__["LINE_SEPARATOR"]) {
continue;
}
var formatsAtIndex = replacements[index] || []; // If the amout of formats is equal or more, store it, then return the
// last one if the amount of formats is less.
if (formatsAtIndex.length >= lineFormats.length) {
childIndex = index;
} else {
return childIndex;
}
} // If the end of the text is reached, return the last child index.
return childIndex;
}
/***/ }),
/***/ "./node_modules/@wordpress/rich-text/build-module/get-line-index.js":
/*!**************************************************************************!*\
!*** ./node_modules/@wordpress/rich-text/build-module/get-line-index.js ***!
\**************************************************************************/
/*! exports provided: getLineIndex */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getLineIndex", function() { return getLineIndex; });
/* harmony import */ var _special_characters__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./special-characters */ "./node_modules/@wordpress/rich-text/build-module/special-characters.js");
/**
* Internal dependencies
*/
/**
* Gets the currently selected line index, or the first line index if the
* selection spans over multiple items.
*
* @param {Object} value Value to get the line index from.
* @param {boolean} startIndex Optional index that should be contained by the
* line. Defaults to the selection start of the
* value.
*
* @return {?boolean} The line index. Undefined if not found.
*/
function getLineIndex(_ref) {
var start = _ref.start,
text = _ref.text;
var startIndex = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : start;
var index = startIndex;
while (index--) {
if (text[index] === _special_characters__WEBPACK_IMPORTED_MODULE_0__["LINE_SEPARATOR"]) {
return index;
}
}
}
/***/ }),
/***/ "./node_modules/@wordpress/rich-text/build-module/get-parent-line-index.js":
/*!*********************************************************************************!*\
!*** ./node_modules/@wordpress/rich-text/build-module/get-parent-line-index.js ***!
\*********************************************************************************/
/*! exports provided: getParentLineIndex */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getParentLineIndex", function() { return getParentLineIndex; });
/* harmony import */ var _special_characters__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./special-characters */ "./node_modules/@wordpress/rich-text/build-module/special-characters.js");
/**
* Internal dependencies
*/
/**
* Gets the index of the first parent list. To get the parent list formats, we
* go through every list item until we find one with exactly one format type
* less.
*
* @param {Object} value Value to search.
* @param {number} lineIndex Line index of a child list item.
*
* @return {Array} The parent list line index.
*/
function getParentLineIndex(_ref, lineIndex) {
var text = _ref.text,
replacements = _ref.replacements;
var startFormats = replacements[lineIndex] || [];
var index = lineIndex;
while (index-- >= 0) {
if (text[index] !== _special_characters__WEBPACK_IMPORTED_MODULE_0__["LINE_SEPARATOR"]) {
continue;
}
var formatsAtIndex = replacements[index] || [];
if (formatsAtIndex.length === startFormats.length - 1) {
return index;
}
}
}
/***/ }),
/***/ "./node_modules/@wordpress/rich-text/build-module/get-text-content.js":
/*!****************************************************************************!*\
!*** ./node_modules/@wordpress/rich-text/build-module/get-text-content.js ***!
\****************************************************************************/
/*! exports provided: getTextContent */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getTextContent", function() { return getTextContent; });
/**
* Get the textual content of a Rich Text value. This is similar to
* `Element.textContent`.
*
* @param {Object} value Value to use.
*
* @return {string} The text content.
*/
function getTextContent(_ref) {
var text = _ref.text;
return text;
}
/***/ }),
/***/ "./node_modules/@wordpress/rich-text/build-module/indent-list-items.js":
/*!*****************************************************************************!*\
!*** ./node_modules/@wordpress/rich-text/build-module/indent-list-items.js ***!
\*****************************************************************************/
/*! exports provided: indentListItems */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "indentListItems", function() { return indentListItems; });
/* 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 _special_characters__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./special-characters */ "./node_modules/@wordpress/rich-text/build-module/special-characters.js");
/* harmony import */ var _get_line_index__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./get-line-index */ "./node_modules/@wordpress/rich-text/build-module/get-line-index.js");
/**
* Internal dependencies
*/
/**
* Gets the line index of the first previous list item with higher indentation.
*
* @param {Object} value Value to search.
* @param {number} lineIndex Line index of the list item to compare with.
*
* @return {boolean} The line index.
*/
function getTargetLevelLineIndex(_ref, lineIndex) {
var text = _ref.text,
replacements = _ref.replacements;
var startFormats = replacements[lineIndex] || [];
var index = lineIndex;
while (index-- >= 0) {
if (text[index] !== _special_characters__WEBPACK_IMPORTED_MODULE_1__["LINE_SEPARATOR"]) {
continue;
}
var formatsAtIndex = replacements[index] || []; // Return the first line index that is one level higher. If the level is
// lower or equal, there is no result.
if (formatsAtIndex.length === startFormats.length + 1) {
return index;
} else if (formatsAtIndex.length <= startFormats.length) {
return;
}
}
}
/**
* Indents any selected list items if possible.
*
* @param {Object} value Value to change.
* @param {Object} rootFormat Root format.
*
* @return {Object} The changed value.
*/
function indentListItems(value, rootFormat) {
var lineIndex = Object(_get_line_index__WEBPACK_IMPORTED_MODULE_2__["getLineIndex"])(value); // There is only one line, so the line cannot be indented.
if (lineIndex === undefined) {
return value;
}
var text = value.text,
replacements = value.replacements,
end = value.end;
var previousLineIndex = Object(_get_line_index__WEBPACK_IMPORTED_MODULE_2__["getLineIndex"])(value, lineIndex);
var formatsAtLineIndex = replacements[lineIndex] || [];
var formatsAtPreviousLineIndex = replacements[previousLineIndex] || []; // The the indentation of the current line is greater than previous line,
// then the line cannot be furter indented.
if (formatsAtLineIndex.length > formatsAtPreviousLineIndex.length) {
return value;
}
var newFormats = replacements.slice();
var targetLevelLineIndex = getTargetLevelLineIndex(value, lineIndex);
for (var index = lineIndex; index < end; index++) {
if (text[index] !== _special_characters__WEBPACK_IMPORTED_MODULE_1__["LINE_SEPARATOR"]) {
continue;
} // Get the previous list, and if there's a child list, take over the
// formats. If not, duplicate the last level and create a new level.
if (targetLevelLineIndex) {
var targetFormats = replacements[targetLevelLineIndex] || [];
newFormats[index] = targetFormats.concat((newFormats[index] || []).slice(targetFormats.length - 1));
} else {
var _targetFormats = replacements[previousLineIndex] || [];
var lastformat = _targetFormats[_targetFormats.length - 1] || rootFormat;
newFormats[index] = _targetFormats.concat([lastformat], (newFormats[index] || []).slice(_targetFormats.length));
}
}
return Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_0__["default"])({}, value, {
replacements: newFormats
});
}
/***/ }),
/***/ "./node_modules/@wordpress/rich-text/build-module/index.js":
/*!*****************************************************************!*\
!*** ./node_modules/@wordpress/rich-text/build-module/index.js ***!
\*****************************************************************/
/*! exports provided: applyFormat, concat, create, getActiveFormat, getActiveObject, getTextContent, __unstableIsListRootSelected, __unstableIsActiveListType, isCollapsed, isEmpty, __unstableIsEmptyLine, join, registerFormatType, removeFormat, remove, replace, insert, __unstableInsertLineSeparator, __unstableRemoveLineSeparator, insertObject, slice, split, __unstableToDom, toHTMLString, toggleFormat, __UNSTABLE_LINE_SEPARATOR, unregisterFormatType, __unstableIndentListItems, __unstableOutdentListItems, __unstableChangeListType, __unstableCreateElement, RichText, __unstableFormatEdit */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _store__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./store */ "./node_modules/@wordpress/rich-text/build-module/store/index.js");
/* harmony import */ var _apply_format__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./apply-format */ "./node_modules/@wordpress/rich-text/build-module/apply-format.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "applyFormat", function() { return _apply_format__WEBPACK_IMPORTED_MODULE_1__["applyFormat"]; });
/* harmony import */ var _concat__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./concat */ "./node_modules/@wordpress/rich-text/build-module/concat.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "concat", function() { return _concat__WEBPACK_IMPORTED_MODULE_2__["concat"]; });
/* harmony import */ var _create__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./create */ "./node_modules/@wordpress/rich-text/build-module/create.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "create", function() { return _create__WEBPACK_IMPORTED_MODULE_3__["create"]; });
/* harmony import */ var _get_active_format__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./get-active-format */ "./node_modules/@wordpress/rich-text/build-module/get-active-format.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getActiveFormat", function() { return _get_active_format__WEBPACK_IMPORTED_MODULE_4__["getActiveFormat"]; });
/* harmony import */ var _get_active_object__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./get-active-object */ "./node_modules/@wordpress/rich-text/build-module/get-active-object.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getActiveObject", function() { return _get_active_object__WEBPACK_IMPORTED_MODULE_5__["getActiveObject"]; });
/* harmony import */ var _get_text_content__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./get-text-content */ "./node_modules/@wordpress/rich-text/build-module/get-text-content.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getTextContent", function() { return _get_text_content__WEBPACK_IMPORTED_MODULE_6__["getTextContent"]; });
/* harmony import */ var _is_list_root_selected__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./is-list-root-selected */ "./node_modules/@wordpress/rich-text/build-module/is-list-root-selected.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "__unstableIsListRootSelected", function() { return _is_list_root_selected__WEBPACK_IMPORTED_MODULE_7__["isListRootSelected"]; });
/* harmony import */ var _is_active_list_type__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./is-active-list-type */ "./node_modules/@wordpress/rich-text/build-module/is-active-list-type.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "__unstableIsActiveListType", function() { return _is_active_list_type__WEBPACK_IMPORTED_MODULE_8__["isActiveListType"]; });
/* harmony import */ var _is_collapsed__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./is-collapsed */ "./node_modules/@wordpress/rich-text/build-module/is-collapsed.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isCollapsed", function() { return _is_collapsed__WEBPACK_IMPORTED_MODULE_9__["isCollapsed"]; });
/* harmony import */ var _is_empty__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./is-empty */ "./node_modules/@wordpress/rich-text/build-module/is-empty.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isEmpty", function() { return _is_empty__WEBPACK_IMPORTED_MODULE_10__["isEmpty"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "__unstableIsEmptyLine", function() { return _is_empty__WEBPACK_IMPORTED_MODULE_10__["isEmptyLine"]; });
/* harmony import */ var _join__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./join */ "./node_modules/@wordpress/rich-text/build-module/join.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "join", function() { return _join__WEBPACK_IMPORTED_MODULE_11__["join"]; });
/* harmony import */ var _register_format_type__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./register-format-type */ "./node_modules/@wordpress/rich-text/build-module/register-format-type.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "registerFormatType", function() { return _register_format_type__WEBPACK_IMPORTED_MODULE_12__["registerFormatType"]; });
/* harmony import */ var _remove_format__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./remove-format */ "./node_modules/@wordpress/rich-text/build-module/remove-format.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "removeFormat", function() { return _remove_format__WEBPACK_IMPORTED_MODULE_13__["removeFormat"]; });
/* harmony import */ var _remove__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./remove */ "./node_modules/@wordpress/rich-text/build-module/remove.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "remove", function() { return _remove__WEBPACK_IMPORTED_MODULE_14__["remove"]; });
/* harmony import */ var _replace__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./replace */ "./node_modules/@wordpress/rich-text/build-module/replace.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "replace", function() { return _replace__WEBPACK_IMPORTED_MODULE_15__["replace"]; });
/* harmony import */ var _insert__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./insert */ "./node_modules/@wordpress/rich-text/build-module/insert.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "insert", function() { return _insert__WEBPACK_IMPORTED_MODULE_16__["insert"]; });
/* harmony import */ var _insert_line_separator__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./insert-line-separator */ "./node_modules/@wordpress/rich-text/build-module/insert-line-separator.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "__unstableInsertLineSeparator", function() { return _insert_line_separator__WEBPACK_IMPORTED_MODULE_17__["insertLineSeparator"]; });
/* harmony import */ var _remove_line_separator__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./remove-line-separator */ "./node_modules/@wordpress/rich-text/build-module/remove-line-separator.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "__unstableRemoveLineSeparator", function() { return _remove_line_separator__WEBPACK_IMPORTED_MODULE_18__["removeLineSeparator"]; });
/* harmony import */ var _insert_object__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./insert-object */ "./node_modules/@wordpress/rich-text/build-module/insert-object.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "insertObject", function() { return _insert_object__WEBPACK_IMPORTED_MODULE_19__["insertObject"]; });
/* harmony import */ var _slice__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./slice */ "./node_modules/@wordpress/rich-text/build-module/slice.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "slice", function() { return _slice__WEBPACK_IMPORTED_MODULE_20__["slice"]; });
/* harmony import */ var _split__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./split */ "./node_modules/@wordpress/rich-text/build-module/split.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "split", function() { return _split__WEBPACK_IMPORTED_MODULE_21__["split"]; });
/* harmony import */ var _to_dom__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./to-dom */ "./node_modules/@wordpress/rich-text/build-module/to-dom.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "__unstableToDom", function() { return _to_dom__WEBPACK_IMPORTED_MODULE_22__["toDom"]; });
/* harmony import */ var _to_html_string__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./to-html-string */ "./node_modules/@wordpress/rich-text/build-module/to-html-string.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "toHTMLString", function() { return _to_html_string__WEBPACK_IMPORTED_MODULE_23__["toHTMLString"]; });
/* harmony import */ var _toggle_format__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./toggle-format */ "./node_modules/@wordpress/rich-text/build-module/toggle-format.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "toggleFormat", function() { return _toggle_format__WEBPACK_IMPORTED_MODULE_24__["toggleFormat"]; });
/* harmony import */ var _special_characters__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./special-characters */ "./node_modules/@wordpress/rich-text/build-module/special-characters.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "__UNSTABLE_LINE_SEPARATOR", function() { return _special_characters__WEBPACK_IMPORTED_MODULE_25__["LINE_SEPARATOR"]; });
/* harmony import */ var _unregister_format_type__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ./unregister-format-type */ "./node_modules/@wordpress/rich-text/build-module/unregister-format-type.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "unregisterFormatType", function() { return _unregister_format_type__WEBPACK_IMPORTED_MODULE_26__["unregisterFormatType"]; });
/* harmony import */ var _indent_list_items__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ./indent-list-items */ "./node_modules/@wordpress/rich-text/build-module/indent-list-items.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "__unstableIndentListItems", function() { return _indent_list_items__WEBPACK_IMPORTED_MODULE_27__["indentListItems"]; });
/* harmony import */ var _outdent_list_items__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ./outdent-list-items */ "./node_modules/@wordpress/rich-text/build-module/outdent-list-items.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "__unstableOutdentListItems", function() { return _outdent_list_items__WEBPACK_IMPORTED_MODULE_28__["outdentListItems"]; });
/* harmony import */ var _change_list_type__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ./change-list-type */ "./node_modules/@wordpress/rich-text/build-module/change-list-type.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "__unstableChangeListType", function() { return _change_list_type__WEBPACK_IMPORTED_MODULE_29__["changeListType"]; });
/* harmony import */ var _create_element__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ./create-element */ "./node_modules/@wordpress/rich-text/build-module/create-element.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "__unstableCreateElement", function() { return _create_element__WEBPACK_IMPORTED_MODULE_30__["createElement"]; });
/* harmony import */ var _component__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! ./component */ "./node_modules/@wordpress/rich-text/build-module/component/index.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "RichText", function() { return _component__WEBPACK_IMPORTED_MODULE_31__["default"]; });
/* harmony import */ var _component_format_edit__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! ./component/format-edit */ "./node_modules/@wordpress/rich-text/build-module/component/format-edit.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "__unstableFormatEdit", function() { return _component_format_edit__WEBPACK_IMPORTED_MODULE_32__["default"]; });
/**
* Internal dependencies
*/
/***/ }),
/***/ "./node_modules/@wordpress/rich-text/build-module/insert-line-separator.js":
/*!*********************************************************************************!*\
!*** ./node_modules/@wordpress/rich-text/build-module/insert-line-separator.js ***!
\*********************************************************************************/
/*! exports provided: insertLineSeparator */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "insertLineSeparator", function() { return insertLineSeparator; });
/* harmony import */ var _get_text_content__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./get-text-content */ "./node_modules/@wordpress/rich-text/build-module/get-text-content.js");
/* harmony import */ var _insert__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./insert */ "./node_modules/@wordpress/rich-text/build-module/insert.js");
/* harmony import */ var _special_characters__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./special-characters */ "./node_modules/@wordpress/rich-text/build-module/special-characters.js");
/**
* Internal dependencies
*/
/**
* Insert a line break character into a Rich Text value at the given
* `startIndex`. Any content between `startIndex` and `endIndex` will be
* removed. Indices are retrieved from the selection if none are provided.
*
* @param {Object} value Value to modify.
* @param {number} [startIndex] Start index.
* @param {number} [endIndex] End index.
*
* @return {Object} A new value with the value inserted.
*/
function insertLineSeparator(value) {
var startIndex = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : value.start;
var endIndex = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : value.end;
var beforeText = Object(_get_text_content__WEBPACK_IMPORTED_MODULE_0__["getTextContent"])(value).slice(0, startIndex);
var previousLineSeparatorIndex = beforeText.lastIndexOf(_special_characters__WEBPACK_IMPORTED_MODULE_2__["LINE_SEPARATOR"]);
var previousLineSeparatorFormats = value.replacements[previousLineSeparatorIndex];
var replacements = [,];
if (previousLineSeparatorFormats) {
replacements = [previousLineSeparatorFormats];
}
var valueToInsert = {
formats: [,],
replacements: replacements,
text: _special_characters__WEBPACK_IMPORTED_MODULE_2__["LINE_SEPARATOR"]
};
return Object(_insert__WEBPACK_IMPORTED_MODULE_1__["insert"])(value, valueToInsert, startIndex, endIndex);
}
/***/ }),
/***/ "./node_modules/@wordpress/rich-text/build-module/insert-object.js":
/*!*************************************************************************!*\
!*** ./node_modules/@wordpress/rich-text/build-module/insert-object.js ***!
\*************************************************************************/
/*! exports provided: insertObject */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "insertObject", function() { return insertObject; });
/* harmony import */ var _insert__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./insert */ "./node_modules/@wordpress/rich-text/build-module/insert.js");
/**
* Internal dependencies
*/
var OBJECT_REPLACEMENT_CHARACTER = "\uFFFC";
/**
* Insert a format as an object into a Rich Text value at the given
* `startIndex`. Any content between `startIndex` and `endIndex` will be
* removed. Indices are retrieved from the selection if none are provided.
*
* @param {Object} value Value to modify.
* @param {Object} formatToInsert Format to insert as object.
* @param {number} [startIndex] Start index.
* @param {number} [endIndex] End index.
*
* @return {Object} A new value with the object inserted.
*/
function insertObject(value, formatToInsert, startIndex, endIndex) {
var valueToInsert = {
formats: [,],
replacements: [formatToInsert],
text: OBJECT_REPLACEMENT_CHARACTER
};
return Object(_insert__WEBPACK_IMPORTED_MODULE_0__["insert"])(value, valueToInsert, startIndex, endIndex);
}
/***/ }),
/***/ "./node_modules/@wordpress/rich-text/build-module/insert.js":
/*!******************************************************************!*\
!*** ./node_modules/@wordpress/rich-text/build-module/insert.js ***!
\******************************************************************/
/*! exports provided: insert */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "insert", function() { return insert; });
/* harmony import */ var _create__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./create */ "./node_modules/@wordpress/rich-text/build-module/create.js");
/* harmony import */ var _normalise_formats__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./normalise-formats */ "./node_modules/@wordpress/rich-text/build-module/normalise-formats.js");
/**
* Internal dependencies
*/
/**
* Insert a Rich Text value, an HTML string, or a plain text string, into a
* Rich Text value at the given `startIndex`. Any content between `startIndex`
* and `endIndex` will be removed. Indices are retrieved from the selection if
* none are provided.
*
* @param {Object} value Value to modify.
* @param {Object|string} valueToInsert Value to insert.
* @param {number} [startIndex] Start index.
* @param {number} [endIndex] End index.
*
* @return {Object} A new value with the value inserted.
*/
function insert(value, valueToInsert) {
var startIndex = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : value.start;
var endIndex = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : value.end;
var formats = value.formats,
replacements = value.replacements,
text = value.text;
if (typeof valueToInsert === 'string') {
valueToInsert = Object(_create__WEBPACK_IMPORTED_MODULE_0__["create"])({
text: valueToInsert
});
}
var index = startIndex + valueToInsert.text.length;
return Object(_normalise_formats__WEBPACK_IMPORTED_MODULE_1__["normaliseFormats"])({
formats: formats.slice(0, startIndex).concat(valueToInsert.formats, formats.slice(endIndex)),
replacements: replacements.slice(0, startIndex).concat(valueToInsert.replacements, replacements.slice(endIndex)),
text: text.slice(0, startIndex) + valueToInsert.text + text.slice(endIndex),
start: index,
end: index
});
}
/***/ }),
/***/ "./node_modules/@wordpress/rich-text/build-module/is-active-list-type.js":
/*!*******************************************************************************!*\
!*** ./node_modules/@wordpress/rich-text/build-module/is-active-list-type.js ***!
\*******************************************************************************/
/*! exports provided: isActiveListType */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isActiveListType", function() { return isActiveListType; });
/* harmony import */ var _get_line_index__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./get-line-index */ "./node_modules/@wordpress/rich-text/build-module/get-line-index.js");
/**
* Internal dependencies
*/
/**
* Wether or not the selected list has the given tag name.
*
* @param {Object} value The value to check.
* @param {string} type The tag name the list should have.
* @param {string} rootType The current root tag name, to compare with in case
* nothing is selected.
*
* @return {boolean} True if the current list type matches `type`, false if not.
*/
function isActiveListType(value, type, rootType) {
var replacements = value.replacements,
start = value.start;
var lineIndex = Object(_get_line_index__WEBPACK_IMPORTED_MODULE_0__["getLineIndex"])(value, start);
var replacement = replacements[lineIndex];
if (!replacement || replacement.length === 0) {
return type === rootType;
}
var lastFormat = replacement[replacement.length - 1];
return lastFormat.type === type;
}
/***/ }),
/***/ "./node_modules/@wordpress/rich-text/build-module/is-collapsed.js":
/*!************************************************************************!*\
!*** ./node_modules/@wordpress/rich-text/build-module/is-collapsed.js ***!
\************************************************************************/
/*! exports provided: isCollapsed */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isCollapsed", function() { return isCollapsed; });
/**
* Check if the selection of a Rich Text value is collapsed or not. Collapsed
* means that no characters are selected, but there is a caret present. If there
* is no selection, `undefined` will be returned. This is similar to
* `window.getSelection().isCollapsed()`.
*
* @param {Object} value The rich text value to check.
*
* @return {boolean|undefined} True if the selection is collapsed, false if not,
* undefined if there is no selection.
*/
function isCollapsed(_ref) {
var start = _ref.start,
end = _ref.end;
if (start === undefined || end === undefined) {
return;
}
return start === end;
}
/***/ }),
/***/ "./node_modules/@wordpress/rich-text/build-module/is-empty.js":
/*!********************************************************************!*\
!*** ./node_modules/@wordpress/rich-text/build-module/is-empty.js ***!
\********************************************************************/
/*! exports provided: isEmpty, isEmptyLine */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isEmpty", function() { return isEmpty; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isEmptyLine", function() { return isEmptyLine; });
/* harmony import */ var _special_characters__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./special-characters */ "./node_modules/@wordpress/rich-text/build-module/special-characters.js");
/**
* Internal dependencies
*/
/**
* Check if a Rich Text value is Empty, meaning it contains no text or any
* objects (such as images).
*
* @param {Object} value Value to use.
*
* @return {boolean} True if the value is empty, false if not.
*/
function isEmpty(_ref) {
var text = _ref.text;
return text.length === 0;
}
/**
* Check if the current collapsed selection is on an empty line in case of a
* multiline value.
*
* @param {Object} value Value te check.
*
* @return {boolean} True if the line is empty, false if not.
*/
function isEmptyLine(_ref2) {
var text = _ref2.text,
start = _ref2.start,
end = _ref2.end;
if (start !== end) {
return false;
}
if (text.length === 0) {
return true;
}
if (start === 0 && text.slice(0, 1) === _special_characters__WEBPACK_IMPORTED_MODULE_0__["LINE_SEPARATOR"]) {
return true;
}
if (start === text.length && text.slice(-1) === _special_characters__WEBPACK_IMPORTED_MODULE_0__["LINE_SEPARATOR"]) {
return true;
}
return text.slice(start - 1, end + 1) === "".concat(_special_characters__WEBPACK_IMPORTED_MODULE_0__["LINE_SEPARATOR"]).concat(_special_characters__WEBPACK_IMPORTED_MODULE_0__["LINE_SEPARATOR"]);
}
/***/ }),
/***/ "./node_modules/@wordpress/rich-text/build-module/is-format-equal.js":
/*!***************************************************************************!*\
!*** ./node_modules/@wordpress/rich-text/build-module/is-format-equal.js ***!
\***************************************************************************/
/*! exports provided: isFormatEqual */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isFormatEqual", function() { return isFormatEqual; });
/**
* Optimised equality check for format objects.
*
* @param {?Object} format1 Format to compare.
* @param {?Object} format2 Format to compare.
*
* @return {boolean} True if formats are equal, false if not.
*/
function isFormatEqual(format1, format2) {
// Both not defined.
if (format1 === format2) {
return true;
} // Either not defined.
if (!format1 || !format2) {
return false;
}
if (format1.type !== format2.type) {
return false;
}
var attributes1 = format1.attributes;
var attributes2 = format2.attributes; // Both not defined.
if (attributes1 === attributes2) {
return true;
} // Either not defined.
if (!attributes1 || !attributes2) {
return false;
}
var keys1 = Object.keys(attributes1);
var keys2 = Object.keys(attributes2);
if (keys1.length !== keys2.length) {
return false;
}
var length = keys1.length; // Optimise for speed.
for (var i = 0; i < length; i++) {
var name = keys1[i];
if (attributes1[name] !== attributes2[name]) {
return false;
}
}
return true;
}
/***/ }),
/***/ "./node_modules/@wordpress/rich-text/build-module/is-list-root-selected.js":
/*!*********************************************************************************!*\
!*** ./node_modules/@wordpress/rich-text/build-module/is-list-root-selected.js ***!
\*********************************************************************************/
/*! exports provided: isListRootSelected */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isListRootSelected", function() { return isListRootSelected; });
/* harmony import */ var _get_line_index__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./get-line-index */ "./node_modules/@wordpress/rich-text/build-module/get-line-index.js");
/**
* Internal dependencies
*/
/**
* Whether or not the root list is selected.
*
* @param {Object} value The value to check.
*
* @return {boolean} True if the root list or nothing is selected, false if an
* inner list is selected.
*/
function isListRootSelected(value) {
var replacements = value.replacements,
start = value.start;
var lineIndex = Object(_get_line_index__WEBPACK_IMPORTED_MODULE_0__["getLineIndex"])(value, start);
var replacement = replacements[lineIndex];
return !replacement || replacement.length < 1;
}
/***/ }),
/***/ "./node_modules/@wordpress/rich-text/build-module/join.js":
/*!****************************************************************!*\
!*** ./node_modules/@wordpress/rich-text/build-module/join.js ***!
\****************************************************************/
/*! exports provided: join */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "join", function() { return join; });
/* harmony import */ var _create__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./create */ "./node_modules/@wordpress/rich-text/build-module/create.js");
/* harmony import */ var _normalise_formats__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./normalise-formats */ "./node_modules/@wordpress/rich-text/build-module/normalise-formats.js");
/**
* Internal dependencies
*/
/**
* Combine an array of Rich Text values into one, optionally separated by
* `separator`, which can be a Rich Text value, HTML string, or plain text
* string. This is similar to `Array.prototype.join`.
*
* @param {Array<Object>} values An array of values to join.
* @param {string|Object} [separator] Separator string or value.
*
* @return {Object} A new combined value.
*/
function join(values) {
var separator = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
if (typeof separator === 'string') {
separator = Object(_create__WEBPACK_IMPORTED_MODULE_0__["create"])({
text: separator
});
}
return Object(_normalise_formats__WEBPACK_IMPORTED_MODULE_1__["normaliseFormats"])(values.reduce(function (accumlator, _ref) {
var formats = _ref.formats,
replacements = _ref.replacements,
text = _ref.text;
return {
formats: accumlator.formats.concat(separator.formats, formats),
replacements: accumlator.replacements.concat(separator.replacements, replacements),
text: accumlator.text + separator.text + text
};
}));
}
/***/ }),
/***/ "./node_modules/@wordpress/rich-text/build-module/normalise-formats.js":
/*!*****************************************************************************!*\
!*** ./node_modules/@wordpress/rich-text/build-module/normalise-formats.js ***!
\*****************************************************************************/
/*! exports provided: normaliseFormats */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "normaliseFormats", function() { return normaliseFormats; });
/* 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 _is_format_equal__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./is-format-equal */ "./node_modules/@wordpress/rich-text/build-module/is-format-equal.js");
/**
* Internal dependencies
*/
/**
* Normalises formats: ensures subsequent adjacent equal formats have the same
* reference.
*
* @param {Object} value Value to normalise formats of.
*
* @return {Object} New value with normalised formats.
*/
function normaliseFormats(value) {
var newFormats = value.formats.slice();
newFormats.forEach(function (formatsAtIndex, index) {
var formatsAtPreviousIndex = newFormats[index - 1];
if (formatsAtPreviousIndex) {
var newFormatsAtIndex = formatsAtIndex.slice();
newFormatsAtIndex.forEach(function (format, formatIndex) {
var previousFormat = formatsAtPreviousIndex[formatIndex];
if (Object(_is_format_equal__WEBPACK_IMPORTED_MODULE_1__["isFormatEqual"])(format, previousFormat)) {
newFormatsAtIndex[formatIndex] = previousFormat;
}
});
newFormats[index] = newFormatsAtIndex;
}
});
return Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_0__["default"])({}, value, {
formats: newFormats
});
}
/***/ }),
/***/ "./node_modules/@wordpress/rich-text/build-module/outdent-list-items.js":
/*!******************************************************************************!*\
!*** ./node_modules/@wordpress/rich-text/build-module/outdent-list-items.js ***!
\******************************************************************************/
/*! exports provided: outdentListItems */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "outdentListItems", function() { return outdentListItems; });
/* 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 _special_characters__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./special-characters */ "./node_modules/@wordpress/rich-text/build-module/special-characters.js");
/* harmony import */ var _get_line_index__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./get-line-index */ "./node_modules/@wordpress/rich-text/build-module/get-line-index.js");
/* harmony import */ var _get_parent_line_index__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./get-parent-line-index */ "./node_modules/@wordpress/rich-text/build-module/get-parent-line-index.js");
/* harmony import */ var _get_last_child_index__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./get-last-child-index */ "./node_modules/@wordpress/rich-text/build-module/get-last-child-index.js");
/**
* Internal dependencies
*/
/**
* Outdents any selected list items if possible.
*
* @param {Object} value Value to change.
*
* @return {Object} The changed value.
*/
function outdentListItems(value) {
var text = value.text,
replacements = value.replacements,
start = value.start,
end = value.end;
var startingLineIndex = Object(_get_line_index__WEBPACK_IMPORTED_MODULE_2__["getLineIndex"])(value, start); // Return early if the starting line index cannot be further outdented.
if (replacements[startingLineIndex] === undefined) {
return value;
}
var newFormats = replacements.slice(0);
var parentFormats = replacements[Object(_get_parent_line_index__WEBPACK_IMPORTED_MODULE_3__["getParentLineIndex"])(value, startingLineIndex)] || [];
var endingLineIndex = Object(_get_line_index__WEBPACK_IMPORTED_MODULE_2__["getLineIndex"])(value, end);
var lastChildIndex = Object(_get_last_child_index__WEBPACK_IMPORTED_MODULE_4__["getLastChildIndex"])(value, endingLineIndex); // Outdent all list items from the starting line index until the last child
// index of the ending list. All children of the ending list need to be
// outdented, otherwise they'll be orphaned.
for (var index = startingLineIndex; index <= lastChildIndex; index++) {
// Skip indices that are not line separators.
if (text[index] !== _special_characters__WEBPACK_IMPORTED_MODULE_1__["LINE_SEPARATOR"]) {
continue;
} // In the case of level 0, the formats at the index are undefined.
var currentFormats = newFormats[index] || []; // Omit the indentation level where the selection starts.
newFormats[index] = parentFormats.concat(currentFormats.slice(parentFormats.length + 1));
if (newFormats[index].length === 0) {
delete newFormats[index];
}
}
return Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_0__["default"])({}, value, {
replacements: newFormats
});
}
/***/ }),
/***/ "./node_modules/@wordpress/rich-text/build-module/register-format-type.js":
/*!********************************************************************************!*\
!*** ./node_modules/@wordpress/rich-text/build-module/register-format-type.js ***!
\********************************************************************************/
/*! exports provided: registerFormatType */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "registerFormatType", function() { return registerFormatType; });
/* 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 */ "./node_modules/@wordpress/element/build-module/index.js");
/* 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_data__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/data */ "./node_modules/@wordpress/data/build-module/index.js");
/* harmony import */ var _wordpress_hooks__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/hooks */ "./node_modules/@wordpress/hooks/build-module/index.js");
/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/compose */ "./node_modules/@wordpress/compose/build-module/index.js");
/**
* External dependencies
*/
/**
* WordPress dependencies
*/
/**
* Registers a new format provided a unique name and an object defining its
* behavior.
*
* @param {string} name Format name.
* @param {Object} settings Format settings.
* @param {string} settings.tagName The HTML tag this format will wrap the selection with.
* @param {string} [settings.className] A class to match the format.
* @param {string} settings.title Name of the format.
* @param {Function} settings.edit Should return a component for the user to interact with the new registered format.
*
* @return {WPFormat|undefined} The format, if it has been successfully registered;
* otherwise `undefined`.
*/
function registerFormatType(name, settings) {
settings = Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_0__["default"])({
name: name
}, settings);
if (typeof settings.name !== 'string') {
window.console.error('Format names must be strings.');
return;
}
if (!/^[a-z][a-z0-9-]*\/[a-z][a-z0-9-]*$/.test(settings.name)) {
window.console.error('Format names must contain a namespace prefix, include only lowercase alphanumeric characters or dashes, and start with a letter. Example: my-plugin/my-custom-format');
return;
}
if (Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_3__["select"])('core/rich-text').getFormatType(settings.name)) {
window.console.error('Format "' + settings.name + '" is already registered.');
return;
}
if (typeof settings.tagName !== 'string' || settings.tagName === '') {
window.console.error('Format tag names must be a string.');
return;
}
if ((typeof settings.className !== 'string' || settings.className === '') && settings.className !== null) {
window.console.error('Format class names must be a string, or null to handle bare elements.');
return;
}
if (!/^[_a-zA-Z]+[a-zA-Z0-9-]*$/.test(settings.className)) {
window.console.error('A class name must begin with a letter, followed by any number of hyphens, letters, or numbers.');
return;
}
if (settings.className === null) {
var formatTypeForBareElement = Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_3__["select"])('core/rich-text').getFormatTypeForBareElement(settings.tagName);
if (formatTypeForBareElement) {
window.console.error("Format \"".concat(formatTypeForBareElement.name, "\" is already registered to handle bare tag name \"").concat(settings.tagName, "\"."));
return;
}
} else {
var formatTypeForClassName = Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_3__["select"])('core/rich-text').getFormatTypeForClassName(settings.className);
if (formatTypeForClassName) {
window.console.error("Format \"".concat(formatTypeForClassName.name, "\" is already registered to handle class name \"").concat(settings.className, "\"."));
return;
}
}
if (!('title' in settings) || settings.title === '') {
window.console.error('The format "' + settings.name + '" must have a title.');
return;
}
if ('keywords' in settings && settings.keywords.length > 3) {
window.console.error('The format "' + settings.name + '" can have a maximum of 3 keywords.');
return;
}
if (typeof settings.title !== 'string') {
window.console.error('Format titles must be strings.');
return;
}
Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_3__["dispatch"])('core/rich-text').addFormatTypes(settings);
if (settings.__experimentalCreatePrepareEditableTree) {
Object(_wordpress_hooks__WEBPACK_IMPORTED_MODULE_4__["addFilter"])('experimentalRichText', name, function (OriginalComponent) {
var selectPrefix = "format_prepare_props_(".concat(name, ")_");
var dispatchPrefix = "format_on_change_props_(".concat(name, ")_");
var Component = function Component(props) {
var newProps = Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_0__["default"])({}, props);
var propsByPrefix = Object.keys(props).reduce(function (accumulator, key) {
if (key.startsWith(selectPrefix)) {
accumulator[key.slice(selectPrefix.length)] = props[key];
}
if (key.startsWith(dispatchPrefix)) {
accumulator[key.slice(dispatchPrefix.length)] = props[key];
}
return accumulator;
}, {});
var args = {
richTextIdentifier: props.identifier,
blockClientId: props.clientId
};
if (settings.__experimentalCreateOnChangeEditableValue) {
newProps["format_value_functions_(".concat(name, ")")] = settings.__experimentalCreatePrepareEditableTree(propsByPrefix, args);
newProps["format_on_change_functions_(".concat(name, ")")] = settings.__experimentalCreateOnChangeEditableValue(propsByPrefix, args);
} else {
newProps["format_prepare_functions_(".concat(name, ")")] = settings.__experimentalCreatePrepareEditableTree(propsByPrefix, args);
}
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])(OriginalComponent, newProps);
};
var hocs = [];
if (settings.__experimentalGetPropsForEditableTreePreparation) {
hocs.push(Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_3__["withSelect"])(function (sel, _ref) {
var clientId = _ref.clientId,
identifier = _ref.identifier;
return Object(lodash__WEBPACK_IMPORTED_MODULE_2__["mapKeys"])(settings.__experimentalGetPropsForEditableTreePreparation(sel, {
richTextIdentifier: identifier,
blockClientId: clientId
}), function (value, key) {
return selectPrefix + key;
});
}));
}
if (settings.__experimentalGetPropsForEditableTreeChangeHandler) {
hocs.push(Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_3__["withDispatch"])(function (disp, _ref2) {
var clientId = _ref2.clientId,
identifier = _ref2.identifier;
return Object(lodash__WEBPACK_IMPORTED_MODULE_2__["mapKeys"])(settings.__experimentalGetPropsForEditableTreeChangeHandler(disp, {
richTextIdentifier: identifier,
blockClientId: clientId
}), function (value, key) {
return dispatchPrefix + key;
});
}));
}
return hocs.length ? Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_5__["compose"])(hocs)(Component) : Component;
});
}
return settings;
}
/***/ }),
/***/ "./node_modules/@wordpress/rich-text/build-module/remove-format.js":
/*!*************************************************************************!*\
!*** ./node_modules/@wordpress/rich-text/build-module/remove-format.js ***!
\*************************************************************************/
/*! exports provided: removeFormat */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "removeFormat", function() { return removeFormat; });
/* 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__);
/* harmony import */ var _normalise_formats__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./normalise-formats */ "./node_modules/@wordpress/rich-text/build-module/normalise-formats.js");
/**
* External dependencies
*/
/**
* Internal dependencies
*/
/**
* Remove any format object from a Rich Text value by type from the given
* `startIndex` to the given `endIndex`. Indices are retrieved from the
* selection if none are provided.
*
* @param {Object} value Value to modify.
* @param {string} formatType Format type to remove.
* @param {number} [startIndex] Start index.
* @param {number} [endIndex] End index.
*
* @return {Object} A new value with the format applied.
*/
function removeFormat(value, formatType) {
var startIndex = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : value.start;
var endIndex = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : value.end;
var formats = value.formats,
activeFormats = value.activeFormats;
var newFormats = formats.slice(); // If the selection is collapsed, expand start and end to the edges of the
// format.
if (startIndex === endIndex) {
var format = Object(lodash__WEBPACK_IMPORTED_MODULE_1__["find"])(newFormats[startIndex], {
type: formatType
});
if (format) {
while (Object(lodash__WEBPACK_IMPORTED_MODULE_1__["find"])(newFormats[startIndex], format)) {
filterFormats(newFormats, startIndex, formatType);
startIndex--;
}
endIndex++;
while (Object(lodash__WEBPACK_IMPORTED_MODULE_1__["find"])(newFormats[endIndex], format)) {
filterFormats(newFormats, endIndex, formatType);
endIndex++;
}
}
} else {
for (var i = startIndex; i < endIndex; i++) {
if (newFormats[i]) {
filterFormats(newFormats, i, formatType);
}
}
}
return Object(_normalise_formats__WEBPACK_IMPORTED_MODULE_2__["normaliseFormats"])(Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_0__["default"])({}, value, {
formats: newFormats,
activeFormats: Object(lodash__WEBPACK_IMPORTED_MODULE_1__["reject"])(activeFormats, {
type: formatType
})
}));
}
function filterFormats(formats, index, formatType) {
var newFormats = formats[index].filter(function (_ref) {
var type = _ref.type;
return type !== formatType;
});
if (newFormats.length) {
formats[index] = newFormats;
} else {
delete formats[index];
}
}
/***/ }),
/***/ "./node_modules/@wordpress/rich-text/build-module/remove-line-separator.js":
/*!*********************************************************************************!*\
!*** ./node_modules/@wordpress/rich-text/build-module/remove-line-separator.js ***!
\*********************************************************************************/
/*! exports provided: removeLineSeparator */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "removeLineSeparator", function() { return removeLineSeparator; });
/* 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 _special_characters__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./special-characters */ "./node_modules/@wordpress/rich-text/build-module/special-characters.js");
/* harmony import */ var _is_collapsed__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./is-collapsed */ "./node_modules/@wordpress/rich-text/build-module/is-collapsed.js");
/* harmony import */ var _remove__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./remove */ "./node_modules/@wordpress/rich-text/build-module/remove.js");
/**
* Internal dependencies
*/
/**
* Removes a line separator character, if existing, from a Rich Text value at the current
* indices. If no line separator exists on the indices it will return undefined.
*
* @param {Object} value Value to modify.
* @param {boolean} backward indicates if are removing from the start index or the end index.
*
* @return {Object|undefined} A new value with the line separator removed. Or undefined if no line separator is found on the position.
*/
function removeLineSeparator(value) {
var backward = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
var replacements = value.replacements,
text = value.text,
start = value.start,
end = value.end;
var collapsed = Object(_is_collapsed__WEBPACK_IMPORTED_MODULE_2__["isCollapsed"])(value);
var index = start - 1;
var removeStart = collapsed ? start - 1 : start;
var removeEnd = end;
if (!backward) {
index = end;
removeStart = start;
removeEnd = collapsed ? end + 1 : end;
}
if (text[index] !== _special_characters__WEBPACK_IMPORTED_MODULE_1__["LINE_SEPARATOR"]) {
return;
}
var newValue; // If the line separator that is about te be removed
// contains wrappers, remove the wrappers first.
if (collapsed && replacements[index] && replacements[index].length) {
var newReplacements = replacements.slice();
newReplacements[index] = replacements[index].slice(0, -1);
newValue = Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_0__["default"])({}, value, {
replacements: newReplacements
});
} else {
newValue = Object(_remove__WEBPACK_IMPORTED_MODULE_3__["remove"])(value, removeStart, removeEnd);
}
return newValue;
}
/***/ }),
/***/ "./node_modules/@wordpress/rich-text/build-module/remove.js":
/*!******************************************************************!*\
!*** ./node_modules/@wordpress/rich-text/build-module/remove.js ***!
\******************************************************************/
/*! exports provided: remove */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "remove", function() { return remove; });
/* harmony import */ var _insert__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./insert */ "./node_modules/@wordpress/rich-text/build-module/insert.js");
/* harmony import */ var _create__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./create */ "./node_modules/@wordpress/rich-text/build-module/create.js");
/**
* Internal dependencies
*/
/**
* Remove content from a Rich Text value between the given `startIndex` and
* `endIndex`. Indices are retrieved from the selection if none are provided.
*
* @param {Object} value Value to modify.
* @param {number} [startIndex] Start index.
* @param {number} [endIndex] End index.
*
* @return {Object} A new value with the content removed.
*/
function remove(value, startIndex, endIndex) {
return Object(_insert__WEBPACK_IMPORTED_MODULE_0__["insert"])(value, Object(_create__WEBPACK_IMPORTED_MODULE_1__["create"])(), startIndex, endIndex);
}
/***/ }),
/***/ "./node_modules/@wordpress/rich-text/build-module/replace.js":
/*!*******************************************************************!*\
!*** ./node_modules/@wordpress/rich-text/build-module/replace.js ***!
\*******************************************************************/
/*! exports provided: replace */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "replace", function() { return replace; });
/* harmony import */ var _babel_runtime_helpers_esm_typeof__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/typeof */ "./node_modules/@babel/runtime/helpers/esm/typeof.js");
/* harmony import */ var _normalise_formats__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./normalise-formats */ "./node_modules/@wordpress/rich-text/build-module/normalise-formats.js");
/**
* Internal dependencies
*/
/**
* Search a Rich Text value and replace the match(es) with `replacement`. This
* is similar to `String.prototype.replace`.
*
* @param {Object} value The value to modify.
* @param {RegExp|string} pattern A RegExp object or literal. Can also be
* a string. It is treated as a verbatim
* string and is not interpreted as a
* regular expression. Only the first
* occurrence will be replaced.
* @param {Function|string} replacement The match or matches are replaced with
* the specified or the value returned by
* the specified function.
*
* @return {Object} A new value with replacements applied.
*/
function replace(_ref, pattern, replacement) {
var formats = _ref.formats,
replacements = _ref.replacements,
text = _ref.text,
start = _ref.start,
end = _ref.end;
text = text.replace(pattern, function (match) {
for (var _len = arguments.length, rest = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
rest[_key - 1] = arguments[_key];
}
var offset = rest[rest.length - 2];
var newText = replacement;
var newFormats;
var newReplacements;
if (typeof newText === 'function') {
newText = replacement.apply(void 0, [match].concat(rest));
}
if (Object(_babel_runtime_helpers_esm_typeof__WEBPACK_IMPORTED_MODULE_0__["default"])(newText) === 'object') {
newFormats = newText.formats;
newReplacements = newText.replacements;
newText = newText.text;
} else {
newFormats = Array(newText.length);
newReplacements = Array(newText.length);
if (formats[offset]) {
newFormats = newFormats.fill(formats[offset]);
}
}
formats = formats.slice(0, offset).concat(newFormats, formats.slice(offset + match.length));
replacements = replacements.slice(0, offset).concat(newReplacements, replacements.slice(offset + match.length));
if (start) {
start = end = offset + newText.length;
}
return newText;
});
return Object(_normalise_formats__WEBPACK_IMPORTED_MODULE_1__["normaliseFormats"])({
formats: formats,
replacements: replacements,
text: text,
start: start,
end: end
});
}
/***/ }),
/***/ "./node_modules/@wordpress/rich-text/build-module/slice.js":
/*!*****************************************************************!*\
!*** ./node_modules/@wordpress/rich-text/build-module/slice.js ***!
\*****************************************************************/
/*! exports provided: slice */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "slice", function() { return slice; });
/* 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");
/**
* Slice a Rich Text value from `startIndex` to `endIndex`. Indices are
* retrieved from the selection if none are provided. This is similar to
* `String.prototype.slice`.
*
* @param {Object} value Value to modify.
* @param {number} [startIndex] Start index.
* @param {number} [endIndex] End index.
*
* @return {Object} A new extracted value.
*/
function slice(value) {
var startIndex = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : value.start;
var endIndex = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : value.end;
var formats = value.formats,
replacements = value.replacements,
text = value.text;
if (startIndex === undefined || endIndex === undefined) {
return Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_0__["default"])({}, value);
}
return {
formats: formats.slice(startIndex, endIndex),
replacements: replacements.slice(startIndex, endIndex),
text: text.slice(startIndex, endIndex)
};
}
/***/ }),
/***/ "./node_modules/@wordpress/rich-text/build-module/special-characters.js":
/*!******************************************************************************!*\
!*** ./node_modules/@wordpress/rich-text/build-module/special-characters.js ***!
\******************************************************************************/
/*! exports provided: LINE_SEPARATOR, OBJECT_REPLACEMENT_CHARACTER, ZWNBSP */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LINE_SEPARATOR", function() { return LINE_SEPARATOR; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "OBJECT_REPLACEMENT_CHARACTER", function() { return OBJECT_REPLACEMENT_CHARACTER; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ZWNBSP", function() { return ZWNBSP; });
/**
* Line separator character, used for multiline text.
*/
var LINE_SEPARATOR = "\u2028";
/**
* Object replacement character, used as a placeholder for objects.
*/
var OBJECT_REPLACEMENT_CHARACTER = "\uFFFC";
/**
* Zero width non-breaking space, used as padding in the editable DOM tree when
* it is empty otherwise.
*/
var ZWNBSP = "\uFEFF";
/***/ }),
/***/ "./node_modules/@wordpress/rich-text/build-module/split.js":
/*!*****************************************************************!*\
!*** ./node_modules/@wordpress/rich-text/build-module/split.js ***!
\*****************************************************************/
/*! exports provided: split */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "split", function() { return split; });
/* harmony import */ var _replace__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./replace */ "./node_modules/@wordpress/rich-text/build-module/replace.js");
/**
* Internal dependencies
*/
/**
* Split a Rich Text value in two at the given `startIndex` and `endIndex`, or
* split at the given separator. This is similar to `String.prototype.split`.
* Indices are retrieved from the selection if none are provided.
*
* @param {Object} value
* @param {Object[]} value.formats
* @param {Object[]} value.replacements
* @param {string} value.text
* @param {number} value.start
* @param {number} value.end
* @param {number|string} [string] Start index, or string at which to split.
*
* @return {Array} An array of new values.
*/
function split(_ref, string) {
var formats = _ref.formats,
replacements = _ref.replacements,
text = _ref.text,
start = _ref.start,
end = _ref.end;
if (typeof string !== 'string') {
return splitAtSelection.apply(void 0, arguments);
}
var nextStart = 0;
return text.split(string).map(function (substring) {
var startIndex = nextStart;
var value = {
formats: formats.slice(startIndex, startIndex + substring.length),
replacements: replacements.slice(startIndex, startIndex + substring.length),
text: substring
};
nextStart += string.length + substring.length;
if (start !== undefined && end !== undefined) {
if (start >= startIndex && start < nextStart) {
value.start = start - startIndex;
} else if (start < startIndex && end > startIndex) {
value.start = 0;
}
if (end >= startIndex && end < nextStart) {
value.end = end - startIndex;
} else if (start < nextStart && end > nextStart) {
value.end = substring.length;
}
}
return value;
});
}
function splitAtSelection(_ref2) {
var formats = _ref2.formats,
replacements = _ref2.replacements,
text = _ref2.text,
start = _ref2.start,
end = _ref2.end;
var startIndex = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : start;
var endIndex = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : end;
var before = {
formats: formats.slice(0, startIndex),
replacements: replacements.slice(0, startIndex),
text: text.slice(0, startIndex)
};
var after = {
formats: formats.slice(endIndex),
replacements: replacements.slice(endIndex),
text: text.slice(endIndex),
start: 0,
end: 0
};
return [// Ensure newlines are trimmed.
Object(_replace__WEBPACK_IMPORTED_MODULE_0__["replace"])(before, /\u2028+$/, ''), Object(_replace__WEBPACK_IMPORTED_MODULE_0__["replace"])(after, /^\u2028+/, '')];
}
/***/ }),
/***/ "./node_modules/@wordpress/rich-text/build-module/store/actions.js":
/*!*************************************************************************!*\
!*** ./node_modules/@wordpress/rich-text/build-module/store/actions.js ***!
\*************************************************************************/
/*! exports provided: addFormatTypes, removeFormatTypes */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addFormatTypes", function() { return addFormatTypes; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "removeFormatTypes", function() { return removeFormatTypes; });
/* 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
*/
/**
* Returns an action object used in signalling that format types have been
* added.
*
* @param {Array|Object} formatTypes Format types received.
*
* @return {Object} Action object.
*/
function addFormatTypes(formatTypes) {
return {
type: 'ADD_FORMAT_TYPES',
formatTypes: Object(lodash__WEBPACK_IMPORTED_MODULE_0__["castArray"])(formatTypes)
};
}
/**
* Returns an action object used to remove a registered format type.
*
* @param {string|Array} names Format name.
*
* @return {Object} Action object.
*/
function removeFormatTypes(names) {
return {
type: 'REMOVE_FORMAT_TYPES',
names: Object(lodash__WEBPACK_IMPORTED_MODULE_0__["castArray"])(names)
};
}
/***/ }),
/***/ "./node_modules/@wordpress/rich-text/build-module/store/index.js":
/*!***********************************************************************!*\
!*** ./node_modules/@wordpress/rich-text/build-module/store/index.js ***!
\***********************************************************************/
/*! no exports provided */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/data */ "./node_modules/@wordpress/data/build-module/index.js");
/* harmony import */ var _reducer__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./reducer */ "./node_modules/@wordpress/rich-text/build-module/store/reducer.js");
/* harmony import */ var _selectors__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./selectors */ "./node_modules/@wordpress/rich-text/build-module/store/selectors.js");
/* harmony import */ var _actions__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./actions */ "./node_modules/@wordpress/rich-text/build-module/store/actions.js");
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_0__["registerStore"])('core/rich-text', {
reducer: _reducer__WEBPACK_IMPORTED_MODULE_1__["default"],
selectors: _selectors__WEBPACK_IMPORTED_MODULE_2__,
actions: _actions__WEBPACK_IMPORTED_MODULE_3__
});
/***/ }),
/***/ "./node_modules/@wordpress/rich-text/build-module/store/reducer.js":
/*!*************************************************************************!*\
!*** ./node_modules/@wordpress/rich-text/build-module/store/reducer.js ***!
\*************************************************************************/
/*! exports provided: formatTypes, default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "formatTypes", function() { return formatTypes; });
/* 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__);
/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/data */ "./node_modules/@wordpress/data/build-module/index.js");
/**
* External dependencies
*/
/**
* WordPress dependencies
*/
/**
* Reducer managing the format types
*
* @param {Object} state Current state.
* @param {Object} action Dispatched action.
*
* @return {Object} Updated state.
*/
function formatTypes() {
var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
var action = arguments.length > 1 ? arguments[1] : undefined;
switch (action.type) {
case 'ADD_FORMAT_TYPES':
return Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_0__["default"])({}, state, Object(lodash__WEBPACK_IMPORTED_MODULE_1__["keyBy"])(action.formatTypes, 'name'));
case 'REMOVE_FORMAT_TYPES':
return Object(lodash__WEBPACK_IMPORTED_MODULE_1__["omit"])(state, action.names);
}
return state;
}
/* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_2__["combineReducers"])({
formatTypes: formatTypes
}));
/***/ }),
/***/ "./node_modules/@wordpress/rich-text/build-module/store/selectors.js":
/*!***************************************************************************!*\
!*** ./node_modules/@wordpress/rich-text/build-module/store/selectors.js ***!
\***************************************************************************/
/*! exports provided: getFormatTypes, getFormatType, getFormatTypeForBareElement, getFormatTypeForClassName */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getFormatTypes", function() { return getFormatTypes; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getFormatType", function() { return getFormatType; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getFormatTypeForBareElement", function() { return getFormatTypeForBareElement; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getFormatTypeForClassName", function() { return getFormatTypeForClassName; });
/* harmony import */ var rememo__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! rememo */ "./node_modules/rememo/es/rememo.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 all the available format types.
*
* @param {Object} state Data state.
*
* @return {Array} Format types.
*/
var getFormatTypes = Object(rememo__WEBPACK_IMPORTED_MODULE_0__["default"])(function (state) {
return Object.values(state.formatTypes);
}, function (state) {
return [state.formatTypes];
});
/**
* Returns a format type by name.
*
* @param {Object} state Data state.
* @param {string} name Format type name.
*
* @return {Object?} Format type.
*/
function getFormatType(state, name) {
return state.formatTypes[name];
}
/**
* Gets the format type, if any, that can handle a bare element (without a
* data-format-type attribute), given the tag name of this element.
*
* @param {Object} state Data state.
* @param {string} bareElementTagName The tag name of the element to find a
* format type for.
* @return {?Object} Format type.
*/
function getFormatTypeForBareElement(state, bareElementTagName) {
return Object(lodash__WEBPACK_IMPORTED_MODULE_1__["find"])(getFormatTypes(state), function (_ref) {
var className = _ref.className,
tagName = _ref.tagName;
return className === null && bareElementTagName === tagName;
});
}
/**
* Gets the format type, if any, that can handle an element, given its classes.
*
* @param {Object} state Data state.
* @param {string} elementClassName The classes of the element to find a format
* type for.
* @return {?Object} Format type.
*/
function getFormatTypeForClassName(state, elementClassName) {
return Object(lodash__WEBPACK_IMPORTED_MODULE_1__["find"])(getFormatTypes(state), function (_ref2) {
var className = _ref2.className;
if (className === null) {
return false;
}
return " ".concat(elementClassName, " ").indexOf(" ".concat(className, " ")) >= 0;
});
}
/***/ }),
/***/ "./node_modules/@wordpress/rich-text/build-module/to-dom.js":
/*!******************************************************************!*\
!*** ./node_modules/@wordpress/rich-text/build-module/to-dom.js ***!
\******************************************************************/
/*! exports provided: toDom, apply, applyValue, applySelection */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "toDom", function() { return toDom; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "apply", function() { return apply; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "applyValue", function() { return applyValue; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "applySelection", function() { return applySelection; });
/* 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_toConsumableArray__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/toConsumableArray */ "./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js");
/* harmony import */ var _to_tree__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./to-tree */ "./node_modules/@wordpress/rich-text/build-module/to-tree.js");
/* harmony import */ var _create_element__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./create-element */ "./node_modules/@wordpress/rich-text/build-module/create-element.js");
/**
* Internal dependencies
*/
/**
* Browser dependencies
*/
var TEXT_NODE = window.Node.TEXT_NODE;
/**
* Creates a path as an array of indices from the given root node to the given
* node.
*
* @param {Node} node Node to find the path of.
* @param {HTMLElement} rootNode Root node to find the path from.
* @param {Array} path Initial path to build on.
*
* @return {Array} The path from the root node to the node.
*/
function createPathToNode(node, rootNode, path) {
var parentNode = node.parentNode;
var i = 0;
while (node = node.previousSibling) {
i++;
}
path = [i].concat(Object(_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_1__["default"])(path));
if (parentNode !== rootNode) {
path = createPathToNode(parentNode, rootNode, path);
}
return path;
}
/**
* Gets a node given a path (array of indices) from the given node.
*
* @param {HTMLElement} node Root node to find the wanted node in.
* @param {Array} path Path (indices) to the wanted node.
*
* @return {Object} Object with the found node and the remaining offset (if any).
*/
function getNodeByPath(node, path) {
path = Object(_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_1__["default"])(path);
while (node && path.length > 1) {
node = node.childNodes[path.shift()];
}
return {
node: node,
offset: path[0]
};
}
/**
* Returns a new instance of a DOM tree upon which RichText operations can be
* applied.
*
* Note: The current implementation will return a shared reference, reset on
* each call to `createEmpty`. Therefore, you should not hold a reference to
* the value to operate upon asynchronously, as it may have unexpected results.
*
* @return {WPRichTextTree} RichText tree.
*/
var createEmpty = function createEmpty() {
return Object(_create_element__WEBPACK_IMPORTED_MODULE_3__["createElement"])(document, '');
};
function append(element, child) {
if (typeof child === 'string') {
child = element.ownerDocument.createTextNode(child);
}
var _child = child,
type = _child.type,
attributes = _child.attributes;
if (type) {
child = element.ownerDocument.createElement(type);
for (var key in attributes) {
child.setAttribute(key, attributes[key]);
}
}
return element.appendChild(child);
}
function appendText(node, text) {
node.appendData(text);
}
function getLastChild(_ref) {
var lastChild = _ref.lastChild;
return lastChild;
}
function getParent(_ref2) {
var parentNode = _ref2.parentNode;
return parentNode;
}
function isText(_ref3) {
var nodeType = _ref3.nodeType;
return nodeType === TEXT_NODE;
}
function getText(_ref4) {
var nodeValue = _ref4.nodeValue;
return nodeValue;
}
function remove(node) {
return node.parentNode.removeChild(node);
}
function toDom(_ref5) {
var value = _ref5.value,
multilineTag = _ref5.multilineTag,
prepareEditableTree = _ref5.prepareEditableTree,
_ref5$isEditableTree = _ref5.isEditableTree,
isEditableTree = _ref5$isEditableTree === void 0 ? true : _ref5$isEditableTree,
placeholder = _ref5.placeholder;
var startPath = [];
var endPath = [];
if (prepareEditableTree) {
value = Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_0__["default"])({}, value, {
formats: prepareEditableTree(value)
});
}
var tree = Object(_to_tree__WEBPACK_IMPORTED_MODULE_2__["toTree"])({
value: value,
multilineTag: multilineTag,
createEmpty: createEmpty,
append: append,
getLastChild: getLastChild,
getParent: getParent,
isText: isText,
getText: getText,
remove: remove,
appendText: appendText,
onStartIndex: function onStartIndex(body, pointer) {
startPath = createPathToNode(pointer, body, [pointer.nodeValue.length]);
},
onEndIndex: function onEndIndex(body, pointer) {
endPath = createPathToNode(pointer, body, [pointer.nodeValue.length]);
},
isEditableTree: isEditableTree,
placeholder: placeholder
});
return {
body: tree,
selection: {
startPath: startPath,
endPath: endPath
}
};
}
/**
* Create an `Element` tree from a Rich Text value and applies the difference to
* the `Element` tree contained by `current`. If a `multilineTag` is provided,
* text separated by two new lines will be wrapped in an `Element` of that type.
*
* @param {Object} $1 Named arguments.
* @param {Object} $1.value Value to apply.
* @param {HTMLElement} $1.current The live root node to apply the element tree to.
* @param {string} [$1.multilineTag] Multiline tag.
* @param {Array} [$1.multilineWrapperTags] Tags where lines can be found if nesting is possible.
*/
function apply(_ref6) {
var value = _ref6.value,
current = _ref6.current,
multilineTag = _ref6.multilineTag,
prepareEditableTree = _ref6.prepareEditableTree,
__unstableDomOnly = _ref6.__unstableDomOnly,
placeholder = _ref6.placeholder; // Construct a new element tree in memory.
var _toDom = toDom({
value: value,
multilineTag: multilineTag,
prepareEditableTree: prepareEditableTree,
placeholder: placeholder
}),
body = _toDom.body,
selection = _toDom.selection;
applyValue(body, current);
if (value.start !== undefined && !__unstableDomOnly) {
applySelection(selection, current);
}
}
function applyValue(future, current) {
var i = 0;
var futureChild;
while (futureChild = future.firstChild) {
var currentChild = current.childNodes[i];
if (!currentChild) {
current.appendChild(futureChild);
} else if (!currentChild.isEqualNode(futureChild)) {
if (currentChild.nodeName !== futureChild.nodeName || currentChild.nodeType === TEXT_NODE && currentChild.data !== futureChild.data) {
current.replaceChild(futureChild, currentChild);
} else {
var currentAttributes = currentChild.attributes;
var futureAttributes = futureChild.attributes;
if (currentAttributes) {
var ii = currentAttributes.length; // Reverse loop because `removeAttribute` on `currentChild`
// changes `currentAttributes`.
while (ii--) {
var name = currentAttributes[ii].name;
if (!futureChild.getAttribute(name)) {
currentChild.removeAttribute(name);
}
}
}
if (futureAttributes) {
for (var _ii = 0; _ii < futureAttributes.length; _ii++) {
var _futureAttributes$_ii = futureAttributes[_ii],
name = _futureAttributes$_ii.name,
value = _futureAttributes$_ii.value;
if (currentChild.getAttribute(name) !== value) {
currentChild.setAttribute(name, value);
}
}
}
applyValue(futureChild, currentChild);
future.removeChild(futureChild);
}
} else {
future.removeChild(futureChild);
}
i++;
}
while (current.childNodes[i]) {
current.removeChild(current.childNodes[i]);
}
}
/**
* Returns true if two ranges are equal, or false otherwise. Ranges are
* considered equal if their start and end occur in the same container and
* offset.
*
* @param {Range} a First range object to test.
* @param {Range} b First range object to test.
*
* @return {boolean} Whether the two ranges are equal.
*/
function isRangeEqual(a, b) {
return a.startContainer === b.startContainer && a.startOffset === b.startOffset && a.endContainer === b.endContainer && a.endOffset === b.endOffset;
}
function applySelection(_ref7, current) {
var startPath = _ref7.startPath,
endPath = _ref7.endPath;
var _getNodeByPath = getNodeByPath(current, startPath),
startContainer = _getNodeByPath.node,
startOffset = _getNodeByPath.offset;
var _getNodeByPath2 = getNodeByPath(current, endPath),
endContainer = _getNodeByPath2.node,
endOffset = _getNodeByPath2.offset;
var selection = window.getSelection();
var ownerDocument = current.ownerDocument;
var range = ownerDocument.createRange();
range.setStart(startContainer, startOffset);
range.setEnd(endContainer, endOffset); // Set back focus if focus is lost.
if (ownerDocument.activeElement !== current) {
current.focus();
}
if (selection.rangeCount > 0) {
// If the to be added range and the live range are the same, there's no
// need to remove the live range and add the equivalent range.
if (isRangeEqual(range, selection.getRangeAt(0))) {
return;
}
selection.removeAllRanges();
}
selection.addRange(range);
}
/***/ }),
/***/ "./node_modules/@wordpress/rich-text/build-module/to-html-string.js":
/*!**************************************************************************!*\
!*** ./node_modules/@wordpress/rich-text/build-module/to-html-string.js ***!
\**************************************************************************/
/*! exports provided: toHTMLString */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "toHTMLString", function() { return toHTMLString; });
/* harmony import */ var _wordpress_escape_html__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/escape-html */ "./node_modules/@wordpress/escape-html/build-module/index.js");
/* harmony import */ var _to_tree__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./to-tree */ "./node_modules/@wordpress/rich-text/build-module/to-tree.js");
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
/**
* Create an HTML string from a Rich Text value. If a `multilineTag` is
* provided, text separated by a line separator will be wrapped in it.
*
* @param {Object} $1 Named argements.
* @param {Object} $1.value Rich text value.
* @param {string} [$1.multilineTag] Multiline tag.
*
* @return {string} HTML string.
*/
function toHTMLString(_ref) {
var value = _ref.value,
multilineTag = _ref.multilineTag;
var tree = Object(_to_tree__WEBPACK_IMPORTED_MODULE_1__["toTree"])({
value: value,
multilineTag: multilineTag,
createEmpty: createEmpty,
append: append,
getLastChild: getLastChild,
getParent: getParent,
isText: isText,
getText: getText,
remove: remove,
appendText: appendText
});
return createChildrenHTML(tree.children);
}
function createEmpty() {
return {};
}
function getLastChild(_ref2) {
var children = _ref2.children;
return children && children[children.length - 1];
}
function append(parent, object) {
if (typeof object === 'string') {
object = {
text: object
};
}
object.parent = parent;
parent.children = parent.children || [];
parent.children.push(object);
return object;
}
function appendText(object, text) {
object.text += text;
}
function getParent(_ref3) {
var parent = _ref3.parent;
return parent;
}
function isText(_ref4) {
var text = _ref4.text;
return typeof text === 'string';
}
function getText(_ref5) {
var text = _ref5.text;
return text;
}
function remove(object) {
var index = object.parent.children.indexOf(object);
if (index !== -1) {
object.parent.children.splice(index, 1);
}
return object;
}
function createElementHTML(_ref6) {
var type = _ref6.type,
attributes = _ref6.attributes,
object = _ref6.object,
children = _ref6.children;
var attributeString = '';
for (var key in attributes) {
if (!Object(_wordpress_escape_html__WEBPACK_IMPORTED_MODULE_0__["isValidAttributeName"])(key)) {
continue;
}
attributeString += " ".concat(key, "=\"").concat(Object(_wordpress_escape_html__WEBPACK_IMPORTED_MODULE_0__["escapeAttribute"])(attributes[key]), "\"");
}
if (object) {
return "<".concat(type).concat(attributeString, ">");
}
return "<".concat(type).concat(attributeString, ">").concat(createChildrenHTML(children), "</").concat(type, ">");
}
function createChildrenHTML() {
var children = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
return children.map(function (child) {
return child.text === undefined ? createElementHTML(child) : Object(_wordpress_escape_html__WEBPACK_IMPORTED_MODULE_0__["escapeHTML"])(child.text);
}).join('');
}
/***/ }),
/***/ "./node_modules/@wordpress/rich-text/build-module/to-tree.js":
/*!*******************************************************************!*\
!*** ./node_modules/@wordpress/rich-text/build-module/to-tree.js ***!
\*******************************************************************/
/*! exports provided: toTree */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "toTree", function() { return toTree; });
/* 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_objectSpread__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectSpread */ "./node_modules/@babel/runtime/helpers/esm/objectSpread.js");
/* harmony import */ var _get_active_formats__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./get-active-formats */ "./node_modules/@wordpress/rich-text/build-module/get-active-formats.js");
/* harmony import */ var _get_format_type__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./get-format-type */ "./node_modules/@wordpress/rich-text/build-module/get-format-type.js");
/* harmony import */ var _special_characters__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./special-characters */ "./node_modules/@wordpress/rich-text/build-module/special-characters.js");
/**
* Internal dependencies
*/
/**
* Converts a format object to information that can be used to create an element
* from (type, attributes and object).
*
* @param {Object} $1 Named parameters.
* @param {string} $1.type The format type.
* @param {Object} $1.attributes The format attributes.
* @param {Object} $1.unregisteredAttributes The unregistered format
* attributes.
* @param {boolean} $1.object Wether or not it is an object
* format.
* @param {boolean} $1.boundaryClass Wether or not to apply a boundary
* class.
* @return {Object} Information to be used for
* element creation.
*/
function fromFormat(_ref) {
var type = _ref.type,
attributes = _ref.attributes,
unregisteredAttributes = _ref.unregisteredAttributes,
object = _ref.object,
boundaryClass = _ref.boundaryClass;
var formatType = Object(_get_format_type__WEBPACK_IMPORTED_MODULE_3__["getFormatType"])(type);
var elementAttributes = {};
if (boundaryClass) {
elementAttributes['data-rich-text-format-boundary'] = 'true';
}
if (!formatType) {
if (attributes) {
elementAttributes = Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_1__["default"])({}, attributes, elementAttributes);
}
return {
type: type,
attributes: elementAttributes,
object: object
};
}
elementAttributes = Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_1__["default"])({}, unregisteredAttributes, elementAttributes);
for (var name in attributes) {
var key = formatType.attributes ? formatType.attributes[name] : false;
if (key) {
elementAttributes[key] = attributes[name];
} else {
elementAttributes[name] = attributes[name];
}
}
if (formatType.className) {
if (elementAttributes.class) {
elementAttributes.class = "".concat(formatType.className, " ").concat(elementAttributes.class);
} else {
elementAttributes.class = formatType.className;
}
}
return {
type: formatType.tagName,
object: formatType.object,
attributes: elementAttributes
};
}
function toTree(_ref2) {
var value = _ref2.value,
multilineTag = _ref2.multilineTag,
createEmpty = _ref2.createEmpty,
append = _ref2.append,
getLastChild = _ref2.getLastChild,
getParent = _ref2.getParent,
isText = _ref2.isText,
getText = _ref2.getText,
remove = _ref2.remove,
appendText = _ref2.appendText,
onStartIndex = _ref2.onStartIndex,
onEndIndex = _ref2.onEndIndex,
isEditableTree = _ref2.isEditableTree,
placeholder = _ref2.placeholder;
var formats = value.formats,
replacements = value.replacements,
text = value.text,
start = value.start,
end = value.end;
var formatsLength = formats.length + 1;
var tree = createEmpty();
var multilineFormat = {
type: multilineTag
};
var activeFormats = Object(_get_active_formats__WEBPACK_IMPORTED_MODULE_2__["getActiveFormats"])(value);
var deepestActiveFormat = activeFormats[activeFormats.length - 1];
var lastSeparatorFormats;
var lastCharacterFormats;
var lastCharacter; // If we're building a multiline tree, start off with a multiline element.
if (multilineTag) {
append(append(tree, {
type: multilineTag
}), '');
lastCharacterFormats = lastSeparatorFormats = [multilineFormat];
} else {
append(tree, '');
}
var _loop = function _loop(i) {
var character = text.charAt(i);
var shouldInsertPadding = isEditableTree && ( // Pad the line if the line is empty.
!lastCharacter || lastCharacter === _special_characters__WEBPACK_IMPORTED_MODULE_4__["LINE_SEPARATOR"] || // Pad the line if the previous character is a line break, otherwise
// the line break won't be visible.
lastCharacter === '\n');
var characterFormats = formats[i]; // Set multiline tags in queue for building the tree.
if (multilineTag) {
if (character === _special_characters__WEBPACK_IMPORTED_MODULE_4__["LINE_SEPARATOR"]) {
characterFormats = lastSeparatorFormats = (replacements[i] || []).reduce(function (accumulator, format) {
accumulator.push(format, multilineFormat);
return accumulator;
}, [multilineFormat]);
} else {
characterFormats = [].concat(Object(_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_0__["default"])(lastSeparatorFormats), Object(_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_0__["default"])(characterFormats || []));
}
}
var pointer = getLastChild(tree);
if (shouldInsertPadding && character === _special_characters__WEBPACK_IMPORTED_MODULE_4__["LINE_SEPARATOR"]) {
var node = pointer;
while (!isText(node)) {
node = getLastChild(node);
}
append(getParent(node), _special_characters__WEBPACK_IMPORTED_MODULE_4__["ZWNBSP"]);
} // Set selection for the start of line.
if (lastCharacter === _special_characters__WEBPACK_IMPORTED_MODULE_4__["LINE_SEPARATOR"]) {
var _node = pointer;
while (!isText(_node)) {
_node = getLastChild(_node);
}
if (onStartIndex && start === i) {
onStartIndex(tree, _node);
}
if (onEndIndex && end === i) {
onEndIndex(tree, _node);
}
}
if (characterFormats) {
characterFormats.forEach(function (format, formatIndex) {
if (pointer && lastCharacterFormats && format === lastCharacterFormats[formatIndex] && ( // Do not reuse the last element if the character is a
// line separator.
character !== _special_characters__WEBPACK_IMPORTED_MODULE_4__["LINE_SEPARATOR"] || characterFormats.length - 1 !== formatIndex)) {
pointer = getLastChild(pointer);
return;
}
var type = format.type,
attributes = format.attributes,
unregisteredAttributes = format.unregisteredAttributes;
var boundaryClass = isEditableTree && character !== _special_characters__WEBPACK_IMPORTED_MODULE_4__["LINE_SEPARATOR"] && format === deepestActiveFormat;
var parent = getParent(pointer);
var newNode = append(parent, fromFormat({
type: type,
attributes: attributes,
unregisteredAttributes: unregisteredAttributes,
boundaryClass: boundaryClass
}));
if (isText(pointer) && getText(pointer).length === 0) {
remove(pointer);
}
pointer = append(newNode, '');
});
} // No need for further processing if the character is a line separator.
if (character === _special_characters__WEBPACK_IMPORTED_MODULE_4__["LINE_SEPARATOR"]) {
lastCharacterFormats = characterFormats;
lastCharacter = character;
return "continue";
} // If there is selection at 0, handle it before characters are inserted.
if (i === 0) {
if (onStartIndex && start === 0) {
onStartIndex(tree, pointer);
}
if (onEndIndex && end === 0) {
onEndIndex(tree, pointer);
}
}
if (character === _special_characters__WEBPACK_IMPORTED_MODULE_4__["OBJECT_REPLACEMENT_CHARACTER"]) {
pointer = append(getParent(pointer), fromFormat(Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_1__["default"])({}, replacements[i], {
object: true
}))); // Ensure pointer is text node.
pointer = append(getParent(pointer), '');
} else if (character === '\n') {
pointer = append(getParent(pointer), {
type: 'br',
attributes: isEditableTree ? {
'data-rich-text-line-break': 'true'
} : undefined,
object: true
}); // Ensure pointer is text node.
pointer = append(getParent(pointer), '');
} else if (!isText(pointer)) {
pointer = append(getParent(pointer), character);
} else {
appendText(pointer, character);
}
if (onStartIndex && start === i + 1) {
onStartIndex(tree, pointer);
}
if (onEndIndex && end === i + 1) {
onEndIndex(tree, pointer);
}
if (shouldInsertPadding && i === text.length) {
append(getParent(pointer), _special_characters__WEBPACK_IMPORTED_MODULE_4__["ZWNBSP"]);
if (placeholder && text.length === 0) {
append(getParent(pointer), {
type: 'span',
attributes: {
'data-rich-text-placeholder': placeholder,
// Necessary to prevent the placeholder from catching
// selection. The placeholder is also not editable after
// all.
contenteditable: 'false'
}
});
}
}
lastCharacterFormats = characterFormats;
lastCharacter = character;
};
for (var i = 0; i < formatsLength; i++) {
var _ret = _loop(i);
if (_ret === "continue") continue;
}
return tree;
}
/***/ }),
/***/ "./node_modules/@wordpress/rich-text/build-module/toggle-format.js":
/*!*************************************************************************!*\
!*** ./node_modules/@wordpress/rich-text/build-module/toggle-format.js ***!
\*************************************************************************/
/*! exports provided: toggleFormat */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "toggleFormat", function() { return toggleFormat; });
/* harmony import */ var _get_active_format__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./get-active-format */ "./node_modules/@wordpress/rich-text/build-module/get-active-format.js");
/* harmony import */ var _remove_format__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./remove-format */ "./node_modules/@wordpress/rich-text/build-module/remove-format.js");
/* harmony import */ var _apply_format__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./apply-format */ "./node_modules/@wordpress/rich-text/build-module/apply-format.js");
/**
* Internal dependencies
*/
/**
* Toggles a format object to a Rich Text value at the current selection.
*
* @param {Object} value Value to modify.
* @param {Object} format Format to apply or remove.
*
* @return {Object} A new value with the format applied or removed.
*/
function toggleFormat(value, format) {
if (Object(_get_active_format__WEBPACK_IMPORTED_MODULE_0__["getActiveFormat"])(value, format.type)) {
return Object(_remove_format__WEBPACK_IMPORTED_MODULE_1__["removeFormat"])(value, format.type);
}
return Object(_apply_format__WEBPACK_IMPORTED_MODULE_2__["applyFormat"])(value, format);
}
/***/ }),
/***/ "./node_modules/@wordpress/rich-text/build-module/unregister-format-type.js":
/*!**********************************************************************************!*\
!*** ./node_modules/@wordpress/rich-text/build-module/unregister-format-type.js ***!
\**********************************************************************************/
/*! exports provided: unregisterFormatType */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "unregisterFormatType", function() { return unregisterFormatType; });
/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/data */ "./node_modules/@wordpress/data/build-module/index.js");
/* harmony import */ var _wordpress_hooks__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/hooks */ "./node_modules/@wordpress/hooks/build-module/index.js");
/**
* WordPress dependencies
*/
/**
* Unregisters a format.
*
* @param {string} name Format name.
*
* @return {WPFormat|undefined} The previous format value, if it has been successfully
* unregistered; otherwise `undefined`.
*/
function unregisterFormatType(name) {
var oldFormat = Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_0__["select"])('core/rich-text').getFormatType(name);
if (!oldFormat) {
window.console.error("Format ".concat(name, " is not registered."));
return;
}
if (oldFormat.__experimentalCreatePrepareEditableTree) {
Object(_wordpress_hooks__WEBPACK_IMPORTED_MODULE_1__["removeFilter"])('experimentalRichText', name);
}
Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_0__["dispatch"])('core/rich-text').removeFormatTypes(name);
return oldFormat;
}
/***/ }),
/***/ "./node_modules/@wordpress/rich-text/build-module/update-formats.js":
/*!**************************************************************************!*\
!*** ./node_modules/@wordpress/rich-text/build-module/update-formats.js ***!
\**************************************************************************/
/*! exports provided: updateFormats */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "updateFormats", function() { return updateFormats; });
/* harmony import */ var _is_format_equal__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-format-equal */ "./node_modules/@wordpress/rich-text/build-module/is-format-equal.js");
/**
* Internal dependencies
*/
/**
* Efficiently updates all the formats from `start` (including) until `end`
* (excluding) with the active formats. Mutates `value`.
*
* @param {Object} $1 Named paramentes.
* @param {Object} $1.value Value te update.
* @param {number} $1.start Index to update from.
* @param {number} $1.end Index to update until.
* @param {Array} $1.formats Replacement formats.
*
* @return {Object} Mutated value.
*/
function updateFormats(_ref) {
var value = _ref.value,
start = _ref.start,
end = _ref.end,
formats = _ref.formats;
var formatsBefore = value.formats[start - 1] || [];
var formatsAfter = value.formats[end] || []; // First, fix the references. If any format right before or after are
// equal, the replacement format should use the same reference.
value.activeFormats = formats.map(function (format, index) {
if (formatsBefore[index]) {
if (Object(_is_format_equal__WEBPACK_IMPORTED_MODULE_0__["isFormatEqual"])(format, formatsBefore[index])) {
return formatsBefore[index];
}
} else if (formatsAfter[index]) {
if (Object(_is_format_equal__WEBPACK_IMPORTED_MODULE_0__["isFormatEqual"])(format, formatsAfter[index])) {
return formatsAfter[index];
}
}
return format;
});
while (--end >= start) {
if (value.activeFormats.length > 0) {
value.formats[end] = value.activeFormats;
} else {
delete value.formats[end];
}
}
return value;
}
/***/ }),
/***/ "./node_modules/airbnb-prop-types/build/and.js":
/*!*****************************************************!*\
!*** ./node_modules/airbnb-prop-types/build/and.js ***!
\*****************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = andValidator;
var _wrapValidator = _interopRequireDefault(__webpack_require__(/*! ./helpers/wrapValidator */ "./node_modules/airbnb-prop-types/build/helpers/wrapValidator.js"));
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
"default": obj
};
}
function andValidator(validators) {
var name = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'and';
if (!Array.isArray(validators)) {
throw new TypeError('and: 2 or more validators are required');
}
if (validators.length <= 1) {
throw new RangeError('and: 2 or more validators are required');
}
var validator = function and() {
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
var firstError = null;
validators.some(function (validatorFn) {
firstError = validatorFn.apply(void 0, args);
return firstError != null;
});
return firstError == null ? null : firstError;
};
validator.isRequired = function andIsRequired() {
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
args[_key2] = arguments[_key2];
}
var firstError = null;
validators.some(function (validatorFn) {
firstError = validatorFn.isRequired.apply(validatorFn, args);
return firstError != null;
});
return firstError == null ? null : firstError;
};
return (0, _wrapValidator["default"])(validator, name, validators);
}
/***/ }),
/***/ "./node_modules/airbnb-prop-types/build/between.js":
/*!*********************************************************!*\
!*** ./node_modules/airbnb-prop-types/build/between.js ***!
\*********************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = betweenValidator;
var _object = _interopRequireDefault(__webpack_require__(/*! object.entries */ "./node_modules/object.entries/index.js"));
var _shape = _interopRequireDefault(__webpack_require__(/*! ./shape */ "./node_modules/airbnb-prop-types/build/shape.js"));
var _valuesOf = _interopRequireDefault(__webpack_require__(/*! ./valuesOf */ "./node_modules/airbnb-prop-types/build/valuesOf.js"));
var _wrapValidator = _interopRequireDefault(__webpack_require__(/*! ./helpers/wrapValidator */ "./node_modules/airbnb-prop-types/build/helpers/wrapValidator.js"));
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
"default": obj
};
}
function _typeof(obj) {
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
_typeof = function _typeof(obj) {
return typeof obj;
};
} else {
_typeof = function _typeof(obj) {
return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
};
}
return _typeof(obj);
}
function ownKeys(object, enumerableOnly) {
var keys = Object.keys(object);
if (Object.getOwnPropertySymbols) {
var symbols = Object.getOwnPropertySymbols(object);
if (enumerableOnly) symbols = symbols.filter(function (sym) {
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
});
keys.push.apply(keys, symbols);
}
return keys;
}
function _objectSpread(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i] != null ? arguments[i] : {};
if (i % 2) {
ownKeys(source, true).forEach(function (key) {
_defineProperty(target, key, source[key]);
});
} else if (Object.getOwnPropertyDescriptors) {
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
} else {
ownKeys(source).forEach(function (key) {
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
});
}
}
return target;
}
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 _slicedToArray(arr, i) {
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest();
}
function _nonIterableRest() {
throw new TypeError("Invalid attempt to destructure non-iterable instance");
}
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;
}
function _arrayWithHoles(arr) {
if (Array.isArray(arr)) return arr;
}
function number(props, propName, componentName) {
var value = props[propName];
if (typeof value === 'number' && !isNaN(value)) {
return null;
}
return new TypeError("".concat(componentName, ": ").concat(propName, " must be a non-NaN number."));
}
function numberOrPropsFunc(props, propName) {
var value = props[propName];
if (typeof value === 'function') {
return null;
}
if (typeof value === 'number' && !isNaN(value)) {
return null;
}
return new TypeError("".concat(propName, ": a function, or a non-NaN number is required"));
}
function lowerCompare(value, _ref) {
var gt = _ref.gt,
gte = _ref.gte;
if (typeof gt === 'number') {
return value > gt;
}
if (typeof gte === 'number') {
return value >= gte;
}
return true;
}
function upperCompare(value, _ref2) {
var lt = _ref2.lt,
lte = _ref2.lte;
if (typeof lt === 'number') {
return value < lt;
}
if (typeof lte === 'number') {
return value <= lte;
}
return true;
}
function greaterThanError(_ref3) {
var gt = _ref3.gt,
gte = _ref3.gte;
if (typeof gt === 'number') {
return "greater than ".concat(gt);
}
if (typeof gte === 'number') {
return "greater than or equal to ".concat(gte);
}
return '';
}
function lessThanError(_ref4) {
var lt = _ref4.lt,
lte = _ref4.lte;
if (typeof lt === 'number') {
return "less than ".concat(lt);
}
if (typeof lte === 'number') {
return "less than or equal to ".concat(lte);
}
return '';
}
function errorMessage(componentName, propName, opts) {
var errors = [greaterThanError(opts), lessThanError(opts)].filter(Boolean).join(' and ');
return "".concat(componentName, ": ").concat(propName, " must be ").concat(errors);
}
function propsThunkify(opts) {
return (0, _object["default"])(opts).reduce(function (acc, _ref5) {
var _ref6 = _slicedToArray(_ref5, 2),
key = _ref6[0],
value = _ref6[1];
var numberThunk = typeof value === 'number' ? function () {
return value;
} : value;
return _objectSpread({}, acc, _defineProperty({}, key, numberThunk));
}, {});
}
function invokeWithProps(optsThunks, props) {
return (0, _object["default"])(optsThunks).reduce(function (acc, _ref7) {
var _ref8 = _slicedToArray(_ref7, 2),
key = _ref8[0],
thunk = _ref8[1];
var value = thunk(props);
return _objectSpread({}, acc, _defineProperty({}, key, value));
}, {});
}
var argValidators = [(0, _shape["default"])({
lt: numberOrPropsFunc,
gt: numberOrPropsFunc
}).isRequired, (0, _shape["default"])({
lte: numberOrPropsFunc,
gt: numberOrPropsFunc
}).isRequired, (0, _shape["default"])({
lt: numberOrPropsFunc,
gte: numberOrPropsFunc
}).isRequired, (0, _shape["default"])({
lte: numberOrPropsFunc,
gte: numberOrPropsFunc
}).isRequired, (0, _shape["default"])({
lt: numberOrPropsFunc
}).isRequired, (0, _shape["default"])({
lte: numberOrPropsFunc
}).isRequired, (0, _shape["default"])({
gt: numberOrPropsFunc
}).isRequired, (0, _shape["default"])({
gte: numberOrPropsFunc
}).isRequired];
function argValidator(props, propName) {
return argValidators.every(function (validator) {
return !!validator(props, propName);
});
}
var thunkValueValidator = (0, _valuesOf["default"])(number).isRequired;
function betweenValidator(options) {
var argError = argValidator({
options: options
}, 'options');
if (argError) {
throw new TypeError('between: only one of the pairs of `lt`/`lte`, and `gt`/`gte`, may be supplied, and at least one pair must be provided.');
}
var optsThunks = propsThunkify(options);
var validator = function between(props, propName, componentName) {
var propValue = props[propName];
if (propValue == null) {
return null;
}
if (typeof propValue !== 'number') {
return new RangeError("".concat(componentName, ": ").concat(propName, " must be a number, got \"").concat(_typeof(propValue), "\""));
}
var opts = invokeWithProps(optsThunks, props);
for (var _len = arguments.length, rest = new Array(_len > 3 ? _len - 3 : 0), _key = 3; _key < _len; _key++) {
rest[_key - 3] = arguments[_key];
}
var thunkValuesError = thunkValueValidator.apply(void 0, [_defineProperty({}, propName, opts), propName, componentName].concat(rest));
if (thunkValuesError) {
return thunkValuesError;
}
if (!lowerCompare(propValue, opts) || !upperCompare(propValue, opts)) {
return new RangeError(errorMessage(componentName, propName, opts));
}
return null;
};
validator.isRequired = function betweenRequired(props, propName, componentName) {
var propValue = props[propName];
if (typeof propValue !== 'number') {
return new RangeError("".concat(componentName, ": ").concat(propName, " must be a number, got \"").concat(_typeof(propValue), "\""));
}
var opts = invokeWithProps(optsThunks, props);
for (var _len2 = arguments.length, rest = new Array(_len2 > 3 ? _len2 - 3 : 0), _key2 = 3; _key2 < _len2; _key2++) {
rest[_key2 - 3] = arguments[_key2];
}
var thunkValuesError = thunkValueValidator.apply(void 0, [_defineProperty({}, propName, opts), propName, componentName].concat(rest));
if (thunkValuesError) {
return thunkValuesError;
}
if (!lowerCompare(propValue, opts) || !upperCompare(propValue, opts)) {
return new RangeError(errorMessage(componentName, propName, opts));
}
return null;
};
return (0, _wrapValidator["default"])(validator, 'between', options);
}
/***/ }),
/***/ "./node_modules/airbnb-prop-types/build/booleanSome.js":
/*!*************************************************************!*\
!*** ./node_modules/airbnb-prop-types/build/booleanSome.js ***!
\*************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = booleanSomeValidator;
var _propTypes = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js");
var _wrapValidator = _interopRequireDefault(__webpack_require__(/*! ./helpers/wrapValidator */ "./node_modules/airbnb-prop-types/build/helpers/wrapValidator.js"));
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
"default": obj
};
}
function booleanSomeValidator() {
for (var _len = arguments.length, notAllPropsFalse = new Array(_len), _key = 0; _key < _len; _key++) {
notAllPropsFalse[_key] = arguments[_key];
}
if (notAllPropsFalse.length < 1) {
throw new TypeError('at least one prop (one of which must be `true`) is required');
}
if (!notAllPropsFalse.every(function (x) {
return typeof x === 'string';
})) {
throw new TypeError('all booleanSome props must be strings');
}
var propsList = notAllPropsFalse.join(', or ');
var validator = function booleanSome(props, propName, componentName) {
var countFalse = function countFalse(count, prop) {
return count + (props[prop] === false ? 1 : 0);
};
var falsePropCount = notAllPropsFalse.reduce(countFalse, 0);
if (falsePropCount === notAllPropsFalse.length) {
return new Error("A ".concat(componentName, " must have at least one of these boolean props be `true`: ").concat(propsList));
}
for (var _len2 = arguments.length, rest = new Array(_len2 > 3 ? _len2 - 3 : 0), _key2 = 3; _key2 < _len2; _key2++) {
rest[_key2 - 3] = arguments[_key2];
}
return _propTypes.bool.apply(void 0, [props, propName, componentName].concat(rest));
};
validator.isRequired = function booleanSomeRequired(props, propName, componentName) {
var countFalse = function countFalse(count, prop) {
return count + (props[prop] === false ? 1 : 0);
};
var falsePropCount = notAllPropsFalse.reduce(countFalse, 0);
if (falsePropCount === notAllPropsFalse.length) {
return new Error("A ".concat(componentName, " must have at least one of these boolean props be `true`: ").concat(propsList));
}
for (var _len3 = arguments.length, rest = new Array(_len3 > 3 ? _len3 - 3 : 0), _key3 = 3; _key3 < _len3; _key3++) {
rest[_key3 - 3] = arguments[_key3];
}
return _propTypes.bool.isRequired.apply(_propTypes.bool, [props, propName, componentName].concat(rest));
};
return (0, _wrapValidator["default"])(validator, "booleanSome: ".concat(propsList), notAllPropsFalse);
}
/***/ }),
/***/ "./node_modules/airbnb-prop-types/build/childrenHavePropXorChildren.js":
/*!*****************************************************************************!*\
!*** ./node_modules/airbnb-prop-types/build/childrenHavePropXorChildren.js ***!
\*****************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = childrenHavePropXorChildren;
var _react = _interopRequireDefault(__webpack_require__(/*! react */ "react"));
var _wrapValidator = _interopRequireDefault(__webpack_require__(/*! ./helpers/wrapValidator */ "./node_modules/airbnb-prop-types/build/helpers/wrapValidator.js"));
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
"default": obj
};
}
function _typeof(obj) {
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
_typeof = function _typeof(obj) {
return typeof obj;
};
} else {
_typeof = function _typeof(obj) {
return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
};
}
return _typeof(obj);
}
function childrenHavePropXorChildren(prop) {
if (typeof prop !== 'string' && _typeof(prop) !== 'symbol') {
throw new TypeError('invalid prop: must be string or symbol');
}
var validator = function childrenHavePropXorChildrenWithProp(_ref, _, componentName) {
var children = _ref.children;
var truthyChildrenCount = 0;
var propCount = 0;
var grandchildrenCount = 0;
_react["default"].Children.forEach(children, function (child) {
if (!child) {
return;
}
truthyChildrenCount += 1;
if (child.props[prop]) {
propCount += 1;
}
if (_react["default"].Children.count(child.props.children)) {
grandchildrenCount += 1;
}
});
if (propCount === truthyChildrenCount && grandchildrenCount === 0 || propCount === 0 && grandchildrenCount === truthyChildrenCount || propCount === 0 && grandchildrenCount === 0) {
return null;
}
return new TypeError("`".concat(componentName, "` requires children to all have prop \u201C").concat(prop, "\u201D, all have children, or all have neither."));
};
validator.isRequired = validator;
return (0, _wrapValidator["default"])(validator, "childrenHavePropXorChildrenWithProp:".concat(prop), prop);
}
/***/ }),
/***/ "./node_modules/airbnb-prop-types/build/childrenOf.js":
/*!************************************************************!*\
!*** ./node_modules/airbnb-prop-types/build/childrenOf.js ***!
\************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = childrenOf;
var _renderableChildren = _interopRequireDefault(__webpack_require__(/*! ./helpers/renderableChildren */ "./node_modules/airbnb-prop-types/build/helpers/renderableChildren.js"));
var _wrapValidator = _interopRequireDefault(__webpack_require__(/*! ./helpers/wrapValidator */ "./node_modules/airbnb-prop-types/build/helpers/wrapValidator.js"));
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
"default": obj
};
}
function ownKeys(object, enumerableOnly) {
var keys = Object.keys(object);
if (Object.getOwnPropertySymbols) {
var symbols = Object.getOwnPropertySymbols(object);
if (enumerableOnly) symbols = symbols.filter(function (sym) {
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
});
keys.push.apply(keys, symbols);
}
return keys;
}
function _objectSpread(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i] != null ? arguments[i] : {};
if (i % 2) {
ownKeys(source, true).forEach(function (key) {
_defineProperty(target, key, source[key]);
});
} else if (Object.getOwnPropertyDescriptors) {
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
} else {
ownKeys(source).forEach(function (key) {
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
});
}
}
return target;
}
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 validateChildren(propType, children, props) {
for (var _len = arguments.length, rest = new Array(_len > 3 ? _len - 3 : 0), _key = 3; _key < _len; _key++) {
rest[_key - 3] = arguments[_key];
}
var error;
children.some(function (child) {
error = propType.apply(void 0, [_objectSpread({}, props, {
children: child
}), 'children'].concat(rest));
return error;
});
return error || null;
}
function childrenOf(propType) {
function childrenOfPropType(props, propName, componentName) {
if (propName !== 'children') {
return new TypeError("".concat(componentName, " is using the childrenOf validator on non-children prop \"").concat(propName, "\""));
}
var propValue = props[propName];
if (propValue == null) {
return null;
}
var children = (0, _renderableChildren["default"])(propValue);
if (children.length === 0) {
return null;
}
for (var _len2 = arguments.length, rest = new Array(_len2 > 3 ? _len2 - 3 : 0), _key2 = 3; _key2 < _len2; _key2++) {
rest[_key2 - 3] = arguments[_key2];
}
return validateChildren.apply(void 0, [propType, children, props, componentName].concat(rest));
}
childrenOfPropType.isRequired = function (props, propName, componentName) {
if (propName !== 'children') {
return new TypeError("".concat(componentName, " is using the childrenOf validator on non-children prop \"").concat(propName, "\""));
}
var children = (0, _renderableChildren["default"])(props[propName]);
if (children.length === 0) {
return new TypeError("`".concat(componentName, "` requires at least one node of type ").concat(propType.typeName || propType.name));
}
for (var _len3 = arguments.length, rest = new Array(_len3 > 3 ? _len3 - 3 : 0), _key3 = 3; _key3 < _len3; _key3++) {
rest[_key3 - 3] = arguments[_key3];
}
return validateChildren.apply(void 0, [propType, children, props, componentName].concat(rest));
};
return (0, _wrapValidator["default"])(childrenOfPropType, 'childrenOf', propType);
}
/***/ }),
/***/ "./node_modules/airbnb-prop-types/build/childrenOfType.js":
/*!****************************************************************!*\
!*** ./node_modules/airbnb-prop-types/build/childrenOfType.js ***!
\****************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = void 0;
var _arrayPrototype = _interopRequireDefault(__webpack_require__(/*! array.prototype.find */ "./node_modules/array.prototype.find/index.js"));
var _getComponentName = _interopRequireDefault(__webpack_require__(/*! ./helpers/getComponentName */ "./node_modules/airbnb-prop-types/build/helpers/getComponentName.js"));
var _renderableChildren = _interopRequireDefault(__webpack_require__(/*! ./helpers/renderableChildren */ "./node_modules/airbnb-prop-types/build/helpers/renderableChildren.js"));
var _wrapValidator = _interopRequireDefault(__webpack_require__(/*! ./helpers/wrapValidator */ "./node_modules/airbnb-prop-types/build/helpers/wrapValidator.js"));
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
"default": obj
};
}
function onlyTypes(types, children, componentName) {
if (!children.every(function (child) {
return child && (0, _arrayPrototype["default"])(types, function (Type) {
return Type === '*' || child.type === Type;
});
})) {
var typeNames = types.map(_getComponentName["default"]).join(', or ');
return new TypeError("`".concat(componentName, "` only accepts children of type ").concat(typeNames));
}
return null;
}
function isRequired(types, children, componentName) {
if (children.length === 0) {
var typeNames = types.map(_getComponentName["default"]).join(', or ');
return new TypeError("`".concat(componentName, "` requires at least one node of type ").concat(typeNames));
}
return null;
}
function childrenOfType() {
for (var _len = arguments.length, types = new Array(_len), _key = 0; _key < _len; _key++) {
types[_key] = arguments[_key];
}
if (types.length < 1) {
throw new TypeError('childrenOfType: at least 1 type is required');
}
function validator(props, propName, componentName) {
return onlyTypes(types, (0, _renderableChildren["default"])(props[propName]), componentName);
}
validator.isRequired = function (props, propName, componentName) {
var children = (0, _renderableChildren["default"])(props[propName]);
return isRequired(types, children, componentName) || onlyTypes(types, children, componentName);
};
return (0, _wrapValidator["default"])(validator, 'childrenOfType', types);
}
var _default = childrenOfType;
exports["default"] = _default;
/***/ }),
/***/ "./node_modules/airbnb-prop-types/build/childrenSequenceOf.js":
/*!********************************************************************!*\
!*** ./node_modules/airbnb-prop-types/build/childrenSequenceOf.js ***!
\********************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = childrenSequenceOfValidator;
var _sequenceOf = _interopRequireDefault(__webpack_require__(/*! ./sequenceOf */ "./node_modules/airbnb-prop-types/build/sequenceOf.js"));
var _renderableChildren = _interopRequireDefault(__webpack_require__(/*! ./helpers/renderableChildren */ "./node_modules/airbnb-prop-types/build/helpers/renderableChildren.js"));
var _wrapValidator = _interopRequireDefault(__webpack_require__(/*! ./helpers/wrapValidator */ "./node_modules/airbnb-prop-types/build/helpers/wrapValidator.js"));
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
"default": obj
};
}
function ownKeys(object, enumerableOnly) {
var keys = Object.keys(object);
if (Object.getOwnPropertySymbols) {
var symbols = Object.getOwnPropertySymbols(object);
if (enumerableOnly) symbols = symbols.filter(function (sym) {
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
});
keys.push.apply(keys, symbols);
}
return keys;
}
function _objectSpread(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i] != null ? arguments[i] : {};
if (i % 2) {
ownKeys(source, true).forEach(function (key) {
_defineProperty(target, key, source[key]);
});
} else if (Object.getOwnPropertyDescriptors) {
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
} else {
ownKeys(source).forEach(function (key) {
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
});
}
}
return target;
}
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 childrenSequenceOfValidator() {
for (var _len = arguments.length, specifiers = new Array(_len), _key = 0; _key < _len; _key++) {
specifiers[_key] = arguments[_key];
}
var seq = _sequenceOf["default"].apply(void 0, specifiers);
var validator = function childrenSequenceOf(props, propName, componentName) {
if (propName !== 'children') {
return new TypeError("".concat(componentName, " is using the childrenSequenceOf validator on non-children prop \"").concat(propName, "\""));
}
var propValue = props[propName];
var children = (0, _renderableChildren["default"])(propValue);
if (children.length === 0) {
return null;
}
for (var _len2 = arguments.length, rest = new Array(_len2 > 3 ? _len2 - 3 : 0), _key2 = 3; _key2 < _len2; _key2++) {
rest[_key2 - 3] = arguments[_key2];
}
return seq.apply(void 0, [_objectSpread({}, props, {
children: children
}), propName, componentName].concat(rest));
};
validator.isRequired = function childrenSequenceOfRequired(props, propName, componentName) {
if (propName !== 'children') {
return new TypeError("".concat(componentName, " is using the childrenSequenceOf validator on non-children prop \"").concat(propName, "\""));
}
var propValue = props[propName];
var children = (0, _renderableChildren["default"])(propValue);
if (children.length === 0) {
return new TypeError("".concat(componentName, ": renderable children are required."));
}
for (var _len3 = arguments.length, rest = new Array(_len3 > 3 ? _len3 - 3 : 0), _key3 = 3; _key3 < _len3; _key3++) {
rest[_key3 - 3] = arguments[_key3];
}
return seq.isRequired.apply(seq, [_objectSpread({}, props, {
children: children
}), propName, componentName].concat(rest));
};
return (0, _wrapValidator["default"])(validator, 'childrenSequenceOf', specifiers);
}
/***/ }),
/***/ "./node_modules/airbnb-prop-types/build/componentWithName.js":
/*!*******************************************************************!*\
!*** ./node_modules/airbnb-prop-types/build/componentWithName.js ***!
\*******************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = componentWithName;
var _react = _interopRequireDefault(__webpack_require__(/*! react */ "react"));
var _isRegex = _interopRequireDefault(__webpack_require__(/*! is-regex */ "./node_modules/is-regex/index.js"));
var _arrayPrototype = _interopRequireDefault(__webpack_require__(/*! array.prototype.find */ "./node_modules/array.prototype.find/index.js"));
var _getComponentName = _interopRequireDefault(__webpack_require__(/*! ./helpers/getComponentName */ "./node_modules/airbnb-prop-types/build/helpers/getComponentName.js"));
var _wrapValidator = _interopRequireDefault(__webpack_require__(/*! ./helpers/wrapValidator */ "./node_modules/airbnb-prop-types/build/helpers/wrapValidator.js"));
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
"default": obj
};
}
function stripHOCs(fullName, namesOfHOCsToStrip) {
var innerName = fullName;
while (/\([^()]*\)/g.test(innerName)) {
var HOC = innerName;
var previousHOC = void 0;
do {
previousHOC = HOC;
HOC = previousHOC.replace(/\([^()]*\)/g, '');
} while (previousHOC !== HOC);
if (namesOfHOCsToStrip.indexOf(HOC) === -1) {
return innerName;
}
innerName = innerName.replace(RegExp("^".concat(HOC, "\\(|\\)$"), 'g'), '');
}
return innerName;
}
function hasName(name, namesOfHOCsToStrip, propValue, propName, componentName) {
for (var _len = arguments.length, rest = new Array(_len > 5 ? _len - 5 : 0), _key = 5; _key < _len; _key++) {
rest[_key - 5] = arguments[_key];
}
if (Array.isArray(propValue)) {
return (0, _arrayPrototype["default"])(propValue.map(function (item) {
return hasName.apply(void 0, [name, namesOfHOCsToStrip, item, propName, componentName].concat(rest));
}), Boolean) || null;
}
if (!_react["default"].isValidElement(propValue)) {
return new TypeError("".concat(componentName, ".").concat(propName, " is not a valid React element"));
}
var type = propValue.type;
var componentNameFromType = (0, _getComponentName["default"])(type);
var innerComponentName = namesOfHOCsToStrip.length > 0 ? stripHOCs(componentNameFromType, namesOfHOCsToStrip) : componentNameFromType;
if ((0, _isRegex["default"])(name) && !name.test(innerComponentName)) {
return new TypeError("`".concat(componentName, ".").concat(propName, "` only accepts components matching the regular expression ").concat(name));
}
if (!(0, _isRegex["default"])(name) && innerComponentName !== name) {
return new TypeError("`".concat(componentName, ".").concat(propName, "` only accepts components named ").concat(name, ", got ").concat(innerComponentName));
}
return null;
}
function componentWithName(name) {
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
if (typeof name !== 'string' && !(0, _isRegex["default"])(name)) {
throw new TypeError('name must be a string or a regex');
}
var passedOptions = Object.keys(options);
if (passedOptions.length > 1 || passedOptions.length === 1 && passedOptions[0] !== 'stripHOCs') {
throw new TypeError("The only options supported are: \u201CstripHOCs\u201D, got: \u201C".concat(passedOptions.join('”, “'), "\u201D"));
}
var _options$stripHOCs = options.stripHOCs,
namesOfHOCsToStrip = _options$stripHOCs === void 0 ? [] : _options$stripHOCs;
var allHOCNamesAreValid = namesOfHOCsToStrip.every(function (x) {
if (typeof x !== 'string' || /[()]/g.test(x)) {
return false;
}
return /^(?:[a-z][a-zA-Z0-9]+|[A-Z][a-z][a-zA-Z0-9]+)$/.test(x);
});
if (!allHOCNamesAreValid) {
throw new TypeError('every provided HOC name must be a string with no parens, and in camelCase');
}
function componentWithNameValidator(props, propName, componentName) {
var propValue = props[propName];
if (props[propName] == null) {
return null;
}
for (var _len2 = arguments.length, rest = new Array(_len2 > 3 ? _len2 - 3 : 0), _key2 = 3; _key2 < _len2; _key2++) {
rest[_key2 - 3] = arguments[_key2];
}
return hasName.apply(void 0, [name, namesOfHOCsToStrip, propValue, propName, componentName].concat(rest));
}
componentWithNameValidator.isRequired = function componentWithNameRequired(props, propName, componentName) {
var propValue = props[propName];
if (propValue == null) {
return new TypeError("`".concat(componentName, ".").concat(propName, "` requires at least one component named ").concat(name));
}
for (var _len3 = arguments.length, rest = new Array(_len3 > 3 ? _len3 - 3 : 0), _key3 = 3; _key3 < _len3; _key3++) {
rest[_key3 - 3] = arguments[_key3];
}
return hasName.apply(void 0, [name, namesOfHOCsToStrip, propValue, propName, componentName].concat(rest));
};
return (0, _wrapValidator["default"])(componentWithNameValidator, "componentWithName:".concat(name), name);
}
/***/ }),
/***/ "./node_modules/airbnb-prop-types/build/disallowedIf.js":
/*!**************************************************************!*\
!*** ./node_modules/airbnb-prop-types/build/disallowedIf.js ***!
\**************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = disallowedIf;
var _wrapValidator = _interopRequireDefault(__webpack_require__(/*! ./helpers/wrapValidator */ "./node_modules/airbnb-prop-types/build/helpers/wrapValidator.js"));
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
"default": obj
};
}
function disallowedIf(propType, otherPropName, otherPropType) {
if (typeof propType !== 'function' || typeof propType.isRequired !== 'function') {
throw new TypeError('a propType validator is required; propType validators must also provide `.isRequired`');
}
if (typeof otherPropName !== 'string') {
throw new TypeError('other prop name must be a string');
}
if (typeof otherPropType !== 'function') {
throw new TypeError('other prop type validator is required');
}
function disallowedIfRequired(props, propName, componentName) {
for (var _len = arguments.length, rest = new Array(_len > 3 ? _len - 3 : 0), _key = 3; _key < _len; _key++) {
rest[_key - 3] = arguments[_key];
}
var error = propType.isRequired.apply(propType, [props, propName, componentName].concat(rest));
if (error) {
return error;
}
if (props[otherPropName] == null) {
return null;
}
var otherError = otherPropType.apply(void 0, [props, otherPropName, componentName].concat(rest));
if (otherError) {
return null;
}
return new Error("prop \u201C".concat(propName, "\u201D is disallowed when \u201C").concat(otherPropName, "\u201D matches the provided validator"));
}
var validator = function disallowedIfPropType(props, propName) {
if (props[propName] == null) {
return null;
}
for (var _len2 = arguments.length, rest = new Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {
rest[_key2 - 2] = arguments[_key2];
}
return disallowedIfRequired.apply(void 0, [props, propName].concat(rest));
};
validator.isRequired = disallowedIfRequired;
return (0, _wrapValidator["default"])(validator, 'disallowedIf', {
propType: propType,
otherPropName: otherPropName,
otherPropType: otherPropType
});
}
/***/ }),
/***/ "./node_modules/airbnb-prop-types/build/elementType.js":
/*!*************************************************************!*\
!*** ./node_modules/airbnb-prop-types/build/elementType.js ***!
\*************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = elementTypeValidator;
var _propTypes = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js");
var _reactIs = __webpack_require__(/*! react-is */ "./node_modules/react-is/index.js");
var _and = _interopRequireDefault(__webpack_require__(/*! ./and */ "./node_modules/airbnb-prop-types/build/and.js"));
var _getComponentName = _interopRequireDefault(__webpack_require__(/*! ./helpers/getComponentName */ "./node_modules/airbnb-prop-types/build/helpers/getComponentName.js"));
var _wrapValidator = _interopRequireDefault(__webpack_require__(/*! ./helpers/wrapValidator */ "./node_modules/airbnb-prop-types/build/helpers/wrapValidator.js"));
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
"default": obj
};
}
function _typeof(obj) {
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
_typeof = function _typeof(obj) {
return typeof obj;
};
} else {
_typeof = function _typeof(obj) {
return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
};
}
return _typeof(obj);
}
function getTypeName(Type) {
if (typeof Type === 'string') {
return Type;
}
var type = (0, _getComponentName["default"])(Type);
/* istanbul ignore next */
// in environments where functions do not have names
return type || 'Anonymous Component';
}
function validateElementType(Type, props, propName, componentName) {
var type = props[propName].type;
if (type === Type) {
return null;
}
return new TypeError("".concat(componentName, ".").concat(propName, " must be a React element of type ").concat(getTypeName(Type)));
}
function elementTypeValidator(Type) {
if (Type === '*') {
return (0, _wrapValidator["default"])(_propTypes.element, 'elementType(*)', Type);
}
if (!(0, _reactIs.isValidElementType)(Type)) {
throw new TypeError("Type must be a React Component, an HTML element tag name, or \"*\". Got an ".concat(_typeof(Type)));
}
function elementType(props, propName, componentName) {
if (props[propName] == null) {
return null;
}
for (var _len = arguments.length, rest = new Array(_len > 3 ? _len - 3 : 0), _key = 3; _key < _len; _key++) {
rest[_key - 3] = arguments[_key];
}
return validateElementType.apply(void 0, [Type, props, propName, componentName].concat(rest));
}
elementType.isRequired = elementType; // covered by and + element
var typeName = getTypeName(Type);
var validatorName = "elementType(".concat(typeName, ")");
return (0, _wrapValidator["default"])((0, _and["default"])([_propTypes.element, elementType], validatorName), validatorName, Type);
}
/***/ }),
/***/ "./node_modules/airbnb-prop-types/build/empty.js":
/*!*******************************************************!*\
!*** ./node_modules/airbnb-prop-types/build/empty.js ***!
\*******************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = void 0;
var _propTypes = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js");
var _or = _interopRequireDefault(__webpack_require__(/*! ./or */ "./node_modules/airbnb-prop-types/build/or.js"));
var _explicitNull = _interopRequireDefault(__webpack_require__(/*! ./explicitNull */ "./node_modules/airbnb-prop-types/build/explicitNull.js"));
var _withShape = _interopRequireDefault(__webpack_require__(/*! ./withShape */ "./node_modules/airbnb-prop-types/build/withShape.js"));
var _wrapValidator = _interopRequireDefault(__webpack_require__(/*! ./helpers/wrapValidator */ "./node_modules/airbnb-prop-types/build/helpers/wrapValidator.js"));
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
"default": obj
};
}
var arrayOfValidator;
var validator = (0, _or["default"])([_explicitNull["default"], // null/undefined
(0, _propTypes.oneOf)([false, '', NaN]), (0, _withShape["default"])(_propTypes.array, {
length: (0, _propTypes.oneOf)([0]).isRequired
}).isRequired, function () {
return arrayOfValidator.apply(void 0, arguments);
}]);
arrayOfValidator = (0, _propTypes.arrayOf)(validator).isRequired;
var _default = function _default() {
return (0, _wrapValidator["default"])(validator, 'empty');
};
exports["default"] = _default;
/***/ }),
/***/ "./node_modules/airbnb-prop-types/build/explicitNull.js":
/*!**************************************************************!*\
!*** ./node_modules/airbnb-prop-types/build/explicitNull.js ***!
\**************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = void 0;
var _wrapValidator = _interopRequireDefault(__webpack_require__(/*! ./helpers/wrapValidator */ "./node_modules/airbnb-prop-types/build/helpers/wrapValidator.js"));
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
"default": obj
};
}
function _typeof(obj) {
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
_typeof = function _typeof(obj) {
return typeof obj;
};
} else {
_typeof = function _typeof(obj) {
return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
};
}
return _typeof(obj);
}
function explicitNull(props, propName, componentName) {
if (props[propName] == null) {
return null;
}
return new TypeError("".concat(componentName, ": prop \u201C").concat(propName, "\u201D must be null or undefined; received ").concat(_typeof(props[propName])));
}
explicitNull.isRequired = function explicitNullRequired(props, propName, componentName) {
if (props[propName] === null) {
return null;
}
return new TypeError("".concat(componentName, ": prop \u201C").concat(propName, "\u201D must be null; received ").concat(_typeof(props[propName])));
};
var _default = function _default() {
return (0, _wrapValidator["default"])(explicitNull, 'explicitNull');
};
exports["default"] = _default;
/***/ }),
/***/ "./node_modules/airbnb-prop-types/build/helpers/getComponentName.js":
/*!**************************************************************************!*\
!*** ./node_modules/airbnb-prop-types/build/helpers/getComponentName.js ***!
\**************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = getComponentName;
var _functionPrototype = _interopRequireDefault(__webpack_require__(/*! function.prototype.name */ "./node_modules/function.prototype.name/index.js"));
var _reactIs = __webpack_require__(/*! react-is */ "./node_modules/react-is/index.js");
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
"default": obj
};
}
function getComponentName(Component) {
if (typeof Component === 'string') {
return Component;
}
if (typeof Component === 'function') {
return Component.displayName || (0, _functionPrototype["default"])(Component);
}
if ((0, _reactIs.isForwardRef)({
type: Component,
$$typeof: _reactIs.Element
})) {
return Component.displayName;
}
if ((0, _reactIs.isMemo)(Component)) {
return getComponentName(Component.type);
}
return null;
}
/***/ }),
/***/ "./node_modules/airbnb-prop-types/build/helpers/isInteger.js":
/*!*******************************************************************!*\
!*** ./node_modules/airbnb-prop-types/build/helpers/isInteger.js ***!
\*******************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = void 0;
var floor = Math.floor;
var finite = isFinite;
var _default = Number.isInteger ||
/* istanbul ignore next */
function (x) {
return typeof x === 'number' && finite(x) && floor(x) === x;
};
exports["default"] = _default;
/***/ }),
/***/ "./node_modules/airbnb-prop-types/build/helpers/isPlainObject.js":
/*!***********************************************************************!*\
!*** ./node_modules/airbnb-prop-types/build/helpers/isPlainObject.js ***!
\***********************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = void 0;
var _isPlainObject = _interopRequireDefault(__webpack_require__(/*! prop-types-exact/build/helpers/isPlainObject */ "./node_modules/prop-types-exact/build/helpers/isPlainObject.js"));
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
"default": obj
};
}
var _default = _isPlainObject["default"];
exports["default"] = _default;
/***/ }),
/***/ "./node_modules/airbnb-prop-types/build/helpers/isPrimitive.js":
/*!*********************************************************************!*\
!*** ./node_modules/airbnb-prop-types/build/helpers/isPrimitive.js ***!
\*********************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = isPrimitive;
function _typeof(obj) {
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
_typeof = function _typeof(obj) {
return typeof obj;
};
} else {
_typeof = function _typeof(obj) {
return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
};
}
return _typeof(obj);
}
function isPrimitive(x) {
return !x || _typeof(x) !== 'object' && typeof x !== 'function';
}
/***/ }),
/***/ "./node_modules/airbnb-prop-types/build/helpers/renderableChildren.js":
/*!****************************************************************************!*\
!*** ./node_modules/airbnb-prop-types/build/helpers/renderableChildren.js ***!
\****************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = renderableChildren;
var _react = _interopRequireDefault(__webpack_require__(/*! react */ "react"));
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
"default": obj
};
}
function renderableChildren(childrenProp) {
return _react["default"].Children.toArray(childrenProp).filter(function (child) {
return child === 0 || child;
});
}
/***/ }),
/***/ "./node_modules/airbnb-prop-types/build/helpers/typeOf.js":
/*!****************************************************************!*\
!*** ./node_modules/airbnb-prop-types/build/helpers/typeOf.js ***!
\****************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = typeOf;
var _react = _interopRequireDefault(__webpack_require__(/*! react */ "react"));
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
"default": obj
};
}
function _typeof(obj) {
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
_typeof = function _typeof(obj) {
return typeof obj;
};
} else {
_typeof = function _typeof(obj) {
return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
};
}
return _typeof(obj);
}
function typeOf(child) {
if (child === null) {
return 'null';
}
if (Array.isArray(child)) {
return 'array';
}
if (_typeof(child) !== 'object') {
return _typeof(child);
}
if (_react["default"].isValidElement(child)) {
return child.type;
}
return child;
}
/***/ }),
/***/ "./node_modules/airbnb-prop-types/build/helpers/wrapValidator.js":
/*!***********************************************************************!*\
!*** ./node_modules/airbnb-prop-types/build/helpers/wrapValidator.js ***!
\***********************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = wrapValidator;
var _object = _interopRequireDefault(__webpack_require__(/*! object.assign */ "./node_modules/object.assign/index.js"));
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
"default": obj
};
}
function wrapValidator(validator, typeName) {
var typeChecker = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
return (0, _object["default"])(validator.bind(), {
typeName: typeName,
typeChecker: typeChecker,
isRequired: (0, _object["default"])(validator.isRequired.bind(), {
typeName: typeName,
typeChecker: typeChecker,
typeRequired: true
})
});
}
/***/ }),
/***/ "./node_modules/airbnb-prop-types/build/index.js":
/*!*******************************************************!*\
!*** ./node_modules/airbnb-prop-types/build/index.js ***!
\*******************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var _propTypesExact = _interopRequireDefault(__webpack_require__(/*! prop-types-exact */ "./node_modules/prop-types-exact/build/index.js"));
var _and = _interopRequireDefault(__webpack_require__(/*! ./and */ "./node_modules/airbnb-prop-types/build/and.js"));
var _between = _interopRequireDefault(__webpack_require__(/*! ./between */ "./node_modules/airbnb-prop-types/build/between.js"));
var _booleanSome = _interopRequireDefault(__webpack_require__(/*! ./booleanSome */ "./node_modules/airbnb-prop-types/build/booleanSome.js"));
var _childrenHavePropXorChildren = _interopRequireDefault(__webpack_require__(/*! ./childrenHavePropXorChildren */ "./node_modules/airbnb-prop-types/build/childrenHavePropXorChildren.js"));
var _childrenOf = _interopRequireDefault(__webpack_require__(/*! ./childrenOf */ "./node_modules/airbnb-prop-types/build/childrenOf.js"));
var _childrenOfType = _interopRequireDefault(__webpack_require__(/*! ./childrenOfType */ "./node_modules/airbnb-prop-types/build/childrenOfType.js"));
var _childrenSequenceOf = _interopRequireDefault(__webpack_require__(/*! ./childrenSequenceOf */ "./node_modules/airbnb-prop-types/build/childrenSequenceOf.js"));
var _componentWithName = _interopRequireDefault(__webpack_require__(/*! ./componentWithName */ "./node_modules/airbnb-prop-types/build/componentWithName.js"));
var _disallowedIf = _interopRequireDefault(__webpack_require__(/*! ./disallowedIf */ "./node_modules/airbnb-prop-types/build/disallowedIf.js"));
var _elementType = _interopRequireDefault(__webpack_require__(/*! ./elementType */ "./node_modules/airbnb-prop-types/build/elementType.js"));
var _empty = _interopRequireDefault(__webpack_require__(/*! ./empty */ "./node_modules/airbnb-prop-types/build/empty.js"));
var _explicitNull = _interopRequireDefault(__webpack_require__(/*! ./explicitNull */ "./node_modules/airbnb-prop-types/build/explicitNull.js"));
var _integer = _interopRequireDefault(__webpack_require__(/*! ./integer */ "./node_modules/airbnb-prop-types/build/integer.js"));
var _keysOf = _interopRequireDefault(__webpack_require__(/*! ./keysOf */ "./node_modules/airbnb-prop-types/build/keysOf.js"));
var _mutuallyExclusiveProps = _interopRequireDefault(__webpack_require__(/*! ./mutuallyExclusiveProps */ "./node_modules/airbnb-prop-types/build/mutuallyExclusiveProps.js"));
var _mutuallyExclusiveTrueProps = _interopRequireDefault(__webpack_require__(/*! ./mutuallyExclusiveTrueProps */ "./node_modules/airbnb-prop-types/build/mutuallyExclusiveTrueProps.js"));
var _nChildren = _interopRequireDefault(__webpack_require__(/*! ./nChildren */ "./node_modules/airbnb-prop-types/build/nChildren.js"));
var _nonNegativeInteger = _interopRequireDefault(__webpack_require__(/*! ./nonNegativeInteger */ "./node_modules/airbnb-prop-types/build/nonNegativeInteger.js"));
var _nonNegativeNumber = _interopRequireDefault(__webpack_require__(/*! ./nonNegativeNumber */ "./node_modules/airbnb-prop-types/build/nonNegativeNumber.js"));
var _numericString = _interopRequireDefault(__webpack_require__(/*! ./numericString */ "./node_modules/airbnb-prop-types/build/numericString.js"));
var _object = _interopRequireDefault(__webpack_require__(/*! ./object */ "./node_modules/airbnb-prop-types/build/object.js"));
var _or = _interopRequireDefault(__webpack_require__(/*! ./or */ "./node_modules/airbnb-prop-types/build/or.js"));
var _range = _interopRequireDefault(__webpack_require__(/*! ./range */ "./node_modules/airbnb-prop-types/build/range.js"));
var _ref = _interopRequireDefault(__webpack_require__(/*! ./ref */ "./node_modules/airbnb-prop-types/build/ref.js"));
var _requiredBy = _interopRequireDefault(__webpack_require__(/*! ./requiredBy */ "./node_modules/airbnb-prop-types/build/requiredBy.js"));
var _restrictedProp = _interopRequireDefault(__webpack_require__(/*! ./restrictedProp */ "./node_modules/airbnb-prop-types/build/restrictedProp.js"));
var _sequenceOf = _interopRequireDefault(__webpack_require__(/*! ./sequenceOf */ "./node_modules/airbnb-prop-types/build/sequenceOf.js"));
var _shape = _interopRequireDefault(__webpack_require__(/*! ./shape */ "./node_modules/airbnb-prop-types/build/shape.js"));
var _stringEndsWith = _interopRequireDefault(__webpack_require__(/*! ./stringEndsWith */ "./node_modules/airbnb-prop-types/build/stringEndsWith.js"));
var _stringStartsWith = _interopRequireDefault(__webpack_require__(/*! ./stringStartsWith */ "./node_modules/airbnb-prop-types/build/stringStartsWith.js"));
var _uniqueArray = _interopRequireDefault(__webpack_require__(/*! ./uniqueArray */ "./node_modules/airbnb-prop-types/build/uniqueArray.js"));
var _uniqueArrayOf = _interopRequireDefault(__webpack_require__(/*! ./uniqueArrayOf */ "./node_modules/airbnb-prop-types/build/uniqueArrayOf.js"));
var _valuesOf = _interopRequireDefault(__webpack_require__(/*! ./valuesOf */ "./node_modules/airbnb-prop-types/build/valuesOf.js"));
var _withShape = _interopRequireDefault(__webpack_require__(/*! ./withShape */ "./node_modules/airbnb-prop-types/build/withShape.js"));
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
"default": obj
};
}
module.exports = {
and: _and["default"],
between: _between["default"],
booleanSome: _booleanSome["default"],
childrenHavePropXorChildren: _childrenHavePropXorChildren["default"],
childrenOf: _childrenOf["default"],
childrenOfType: _childrenOfType["default"],
childrenSequenceOf: _childrenSequenceOf["default"],
componentWithName: _componentWithName["default"],
disallowedIf: _disallowedIf["default"],
elementType: _elementType["default"],
empty: _empty["default"],
explicitNull: _explicitNull["default"],
forbidExtraProps: _propTypesExact["default"],
integer: _integer["default"],
keysOf: _keysOf["default"],
mutuallyExclusiveProps: _mutuallyExclusiveProps["default"],
mutuallyExclusiveTrueProps: _mutuallyExclusiveTrueProps["default"],
nChildren: _nChildren["default"],
nonNegativeInteger: _nonNegativeInteger["default"],
nonNegativeNumber: _nonNegativeNumber["default"],
numericString: _numericString["default"],
object: _object["default"],
or: _or["default"],
range: _range["default"],
ref: _ref["default"],
requiredBy: _requiredBy["default"],
restrictedProp: _restrictedProp["default"],
sequenceOf: _sequenceOf["default"],
shape: _shape["default"],
stringEndsWith: _stringEndsWith["default"],
stringStartsWith: _stringStartsWith["default"],
uniqueArray: _uniqueArray["default"],
uniqueArrayOf: _uniqueArrayOf["default"],
valuesOf: _valuesOf["default"],
withShape: _withShape["default"]
};
/***/ }),
/***/ "./node_modules/airbnb-prop-types/build/integer.js":
/*!*********************************************************!*\
!*** ./node_modules/airbnb-prop-types/build/integer.js ***!
\*********************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = void 0;
var _isInteger = _interopRequireDefault(__webpack_require__(/*! ./helpers/isInteger */ "./node_modules/airbnb-prop-types/build/helpers/isInteger.js"));
var _wrapValidator = _interopRequireDefault(__webpack_require__(/*! ./helpers/wrapValidator */ "./node_modules/airbnb-prop-types/build/helpers/wrapValidator.js"));
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
"default": obj
};
}
function requiredInteger(props, propName, componentName) {
var propValue = props[propName];
if (propValue == null || !(0, _isInteger["default"])(propValue)) {
return new RangeError("".concat(propName, " in ").concat(componentName, " must be an integer"));
}
return null;
}
var validator = function integer(props, propName) {
var propValue = props[propName];
if (propValue == null) {
return null;
}
for (var _len = arguments.length, rest = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
rest[_key - 2] = arguments[_key];
}
return requiredInteger.apply(void 0, [props, propName].concat(rest));
};
validator.isRequired = requiredInteger;
var _default = function _default() {
return (0, _wrapValidator["default"])(validator, 'integer');
};
exports["default"] = _default;
/***/ }),
/***/ "./node_modules/airbnb-prop-types/build/keysOf.js":
/*!********************************************************!*\
!*** ./node_modules/airbnb-prop-types/build/keysOf.js ***!
\********************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = keysOfValidator;
var _isPrimitive = _interopRequireDefault(__webpack_require__(/*! ./helpers/isPrimitive */ "./node_modules/airbnb-prop-types/build/helpers/isPrimitive.js"));
var _wrapValidator = _interopRequireDefault(__webpack_require__(/*! ./helpers/wrapValidator */ "./node_modules/airbnb-prop-types/build/helpers/wrapValidator.js"));
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 keysOfValidator(propType) {
var name = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'keysOf';
if (typeof propType !== 'function') {
throw new TypeError('argument to keysOf must be a valid PropType function');
}
var validator = function keysOf(props, propName, componentName, location, propFullName) {
for (var _len = arguments.length, rest = new Array(_len > 5 ? _len - 5 : 0), _key = 5; _key < _len; _key++) {
rest[_key - 5] = arguments[_key];
}
var propValue = props[propName];
if (propValue == null || (0, _isPrimitive["default"])(propValue)) {
return null;
}
var firstError = null;
Object.keys(propValue).some(function (key) {
firstError = propType.apply(void 0, [_defineProperty({}, key, key), key, componentName, location, "(".concat(propFullName, ").").concat(key)].concat(rest));
return firstError != null;
});
return firstError || null;
};
validator.isRequired = function keyedByRequired(props, propName, componentName) {
var propValue = props[propName];
if (propValue == null) {
return new TypeError("".concat(componentName, ": ").concat(propName, " is required, but value is ").concat(propValue));
}
for (var _len2 = arguments.length, rest = new Array(_len2 > 3 ? _len2 - 3 : 0), _key2 = 3; _key2 < _len2; _key2++) {
rest[_key2 - 3] = arguments[_key2];
}
return validator.apply(void 0, [props, propName, componentName].concat(rest));
};
return (0, _wrapValidator["default"])(validator, name, propType);
}
/***/ }),
/***/ "./node_modules/airbnb-prop-types/build/mutuallyExclusiveProps.js":
/*!************************************************************************!*\
!*** ./node_modules/airbnb-prop-types/build/mutuallyExclusiveProps.js ***!
\************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = mutuallyExclusiveOfType;
var _wrapValidator = _interopRequireDefault(__webpack_require__(/*! ./helpers/wrapValidator */ "./node_modules/airbnb-prop-types/build/helpers/wrapValidator.js"));
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
"default": obj
};
}
function ownKeys(object, enumerableOnly) {
var keys = Object.keys(object);
if (Object.getOwnPropertySymbols) {
var symbols = Object.getOwnPropertySymbols(object);
if (enumerableOnly) symbols = symbols.filter(function (sym) {
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
});
keys.push.apply(keys, symbols);
}
return keys;
}
function _objectSpread(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i] != null ? arguments[i] : {};
if (i % 2) {
ownKeys(source, true).forEach(function (key) {
_defineProperty(target, key, source[key]);
});
} else if (Object.getOwnPropertyDescriptors) {
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
} else {
ownKeys(source).forEach(function (key) {
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
});
}
}
return target;
}
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 mutuallyExclusiveOfType(propType) {
if (typeof propType !== 'function') {
throw new TypeError('a propType is required');
}
for (var _len = arguments.length, exclusiveProps = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
exclusiveProps[_key - 1] = arguments[_key];
}
if (exclusiveProps.length < 1) {
throw new TypeError('at least one prop that is mutually exclusive with this propType is required');
}
var propList = exclusiveProps.join(', or ');
var map = exclusiveProps.reduce(function (acc, prop) {
return _objectSpread({}, acc, _defineProperty({}, prop, true));
}, {});
var countProps = function countProps(count, prop) {
return count + (map[prop] ? 1 : 0);
};
var validator = function mutuallyExclusiveProps(props, propName, componentName) {
var exclusivePropCount = Object.keys(props).filter(function (prop) {
return props[prop] != null;
}).reduce(countProps, 0);
if (exclusivePropCount > 1) {
return new Error("A ".concat(componentName, " cannot have more than one of these props: ").concat(propList));
}
for (var _len2 = arguments.length, rest = new Array(_len2 > 3 ? _len2 - 3 : 0), _key2 = 3; _key2 < _len2; _key2++) {
rest[_key2 - 3] = arguments[_key2];
}
return propType.apply(void 0, [props, propName, componentName].concat(rest));
};
validator.isRequired = function mutuallyExclusivePropsRequired(props, propName, componentName) {
var exclusivePropCount = Object.keys(props).filter(function (prop) {
return prop === propName || props[prop] != null;
}).reduce(countProps, 0);
if (exclusivePropCount > 1) {
return new Error("A ".concat(componentName, " cannot have more than one of these props: ").concat(propList));
}
for (var _len3 = arguments.length, rest = new Array(_len3 > 3 ? _len3 - 3 : 0), _key3 = 3; _key3 < _len3; _key3++) {
rest[_key3 - 3] = arguments[_key3];
}
return propType.apply(void 0, [props, propName, componentName].concat(rest));
};
return (0, _wrapValidator["default"])(validator, "mutuallyExclusiveProps:".concat(propList), exclusiveProps);
}
/***/ }),
/***/ "./node_modules/airbnb-prop-types/build/mutuallyExclusiveTrueProps.js":
/*!****************************************************************************!*\
!*** ./node_modules/airbnb-prop-types/build/mutuallyExclusiveTrueProps.js ***!
\****************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = mutuallyExclusiveTrue;
var _propTypes = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js");
var _wrapValidator = _interopRequireDefault(__webpack_require__(/*! ./helpers/wrapValidator */ "./node_modules/airbnb-prop-types/build/helpers/wrapValidator.js"));
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
"default": obj
};
}
function mutuallyExclusiveTrue() {
for (var _len = arguments.length, exclusiveProps = new Array(_len), _key = 0; _key < _len; _key++) {
exclusiveProps[_key] = arguments[_key];
}
if (exclusiveProps.length < 1) {
throw new TypeError('at least one prop that is mutually exclusive is required');
}
if (!exclusiveProps.every(function (x) {
return typeof x === 'string';
})) {
throw new TypeError('all exclusive true props must be strings');
}
var propsList = exclusiveProps.join(', or ');
var validator = function mutuallyExclusiveTrueProps(props, propName, componentName) {
var countProps = function countProps(count, prop) {
return count + (props[prop] ? 1 : 0);
};
var exclusivePropCount = exclusiveProps.reduce(countProps, 0);
if (exclusivePropCount > 1) {
return new Error("A ".concat(componentName, " cannot have more than one of these boolean props be true: ").concat(propsList));
}
for (var _len2 = arguments.length, rest = new Array(_len2 > 3 ? _len2 - 3 : 0), _key2 = 3; _key2 < _len2; _key2++) {
rest[_key2 - 3] = arguments[_key2];
}
return _propTypes.bool.apply(void 0, [props, propName, componentName].concat(rest));
};
validator.isRequired = function mutuallyExclusiveTruePropsRequired(props, propName, componentName) {
var countProps = function countProps(count, prop) {
return count + (props[prop] ? 1 : 0);
};
var exclusivePropCount = exclusiveProps.reduce(countProps, 0);
if (exclusivePropCount > 1) {
return new Error("A ".concat(componentName, " cannot have more than one of these boolean props be true: ").concat(propsList));
}
for (var _len3 = arguments.length, rest = new Array(_len3 > 3 ? _len3 - 3 : 0), _key3 = 3; _key3 < _len3; _key3++) {
rest[_key3 - 3] = arguments[_key3];
}
return _propTypes.bool.isRequired.apply(_propTypes.bool, [props, propName, componentName].concat(rest));
};
return (0, _wrapValidator["default"])(validator, "mutuallyExclusiveTrueProps: ".concat(propsList), exclusiveProps);
}
/***/ }),
/***/ "./node_modules/airbnb-prop-types/build/nChildren.js":
/*!***********************************************************!*\
!*** ./node_modules/airbnb-prop-types/build/nChildren.js ***!
\***********************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = nChildren;
var _react = _interopRequireDefault(__webpack_require__(/*! react */ "react"));
var _propTypes = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js");
var _wrapValidator = _interopRequireDefault(__webpack_require__(/*! ./helpers/wrapValidator */ "./node_modules/airbnb-prop-types/build/helpers/wrapValidator.js"));
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
"default": obj
};
}
function nChildren(n) {
var propType = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _propTypes.node;
if (typeof n !== 'number' || isNaN(n) || n < 0) {
throw new TypeError('a non-negative number is required');
}
var validator = function nChildrenValidator(props, propName, componentName) {
if (propName !== 'children') {
return new TypeError("".concat(componentName, " is using the nChildren validator on a non-children prop"));
}
var children = props.children;
var childrenCount = _react["default"].Children.count(children);
if (childrenCount !== n) {
return new RangeError("".concat(componentName, " expects to receive ").concat(n, " children, but received ").concat(childrenCount, " children."));
}
for (var _len = arguments.length, rest = new Array(_len > 3 ? _len - 3 : 0), _key = 3; _key < _len; _key++) {
rest[_key - 3] = arguments[_key];
}
return propType.apply(void 0, [props, propName, componentName].concat(rest));
};
validator.isRequired = validator;
return (0, _wrapValidator["default"])(validator, "nChildren:".concat(n), n);
}
/***/ }),
/***/ "./node_modules/airbnb-prop-types/build/nonNegativeInteger.js":
/*!********************************************************************!*\
!*** ./node_modules/airbnb-prop-types/build/nonNegativeInteger.js ***!
\********************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = void 0;
var _and = _interopRequireDefault(__webpack_require__(/*! ./and */ "./node_modules/airbnb-prop-types/build/and.js"));
var _integer = _interopRequireDefault(__webpack_require__(/*! ./integer */ "./node_modules/airbnb-prop-types/build/integer.js"));
var _nonNegativeNumber = _interopRequireDefault(__webpack_require__(/*! ./nonNegativeNumber */ "./node_modules/airbnb-prop-types/build/nonNegativeNumber.js"));
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
"default": obj
};
}
var _default = (0, _and["default"])([(0, _integer["default"])(), (0, _nonNegativeNumber["default"])()], 'nonNegativeInteger');
exports["default"] = _default;
/***/ }),
/***/ "./node_modules/airbnb-prop-types/build/nonNegativeNumber.js":
/*!*******************************************************************!*\
!*** ./node_modules/airbnb-prop-types/build/nonNegativeNumber.js ***!
\*******************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = void 0;
var _objectIs = _interopRequireDefault(__webpack_require__(/*! object-is */ "./node_modules/object-is/index.js"));
var _wrapValidator = _interopRequireDefault(__webpack_require__(/*! ./helpers/wrapValidator */ "./node_modules/airbnb-prop-types/build/helpers/wrapValidator.js"));
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
"default": obj
};
}
function isNonNegative(x) {
return typeof x === 'number' && isFinite(x) && x >= 0 && !(0, _objectIs["default"])(x, -0);
}
function nonNegativeNumber(props, propName, componentName) {
var value = props[propName];
if (value == null || isNonNegative(value)) {
return null;
}
return new RangeError("".concat(propName, " in ").concat(componentName, " must be a non-negative number"));
}
function requiredNonNegativeNumber(props, propName, componentName) {
var value = props[propName];
if (isNonNegative(value)) {
return null;
}
return new RangeError("".concat(propName, " in ").concat(componentName, " must be a non-negative number"));
}
nonNegativeNumber.isRequired = requiredNonNegativeNumber;
var _default = function _default() {
return (0, _wrapValidator["default"])(nonNegativeNumber, 'nonNegativeNumber');
};
exports["default"] = _default;
/***/ }),
/***/ "./node_modules/airbnb-prop-types/build/numericString.js":
/*!***************************************************************!*\
!*** ./node_modules/airbnb-prop-types/build/numericString.js ***!
\***************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = void 0;
var _propTypes = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js");
var _wrapValidator = _interopRequireDefault(__webpack_require__(/*! ./helpers/wrapValidator */ "./node_modules/airbnb-prop-types/build/helpers/wrapValidator.js"));
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
"default": obj
};
}
var validNumericChars = /^[-+]?(?:[1-9][0-9]*(?:\.[0-9]+)?|0|0\.[0-9]+)$/;
var validator = function numericString(props, propName, componentName) {
if (props[propName] == null) {
return null;
}
for (var _len = arguments.length, rest = new Array(_len > 3 ? _len - 3 : 0), _key = 3; _key < _len; _key++) {
rest[_key - 3] = arguments[_key];
}
var stringError = _propTypes.string.apply(void 0, [props, propName, componentName].concat(rest));
if (stringError) {
return stringError;
}
var value = props[propName];
var passesRegex = validNumericChars.test(value);
if (passesRegex) {
return null;
}
return new TypeError("".concat(componentName, ": prop \"").concat(propName, "\" (value \"").concat(value, "\") must be a numeric string:\n - starting with an optional + or -\n - that does not have a leading zero\n - with an optional decimal part (that contains only one decimal point, if present)\n - that otherwise only contains digits (0-9)\n - not +-NaN, or +-Infinity\n "));
};
validator.isRequired = function numericStringRequired(props, propName, componentName) {
if (props[propName] == null) {
return new TypeError("".concat(componentName, ": ").concat(propName, " is required"));
}
for (var _len2 = arguments.length, rest = new Array(_len2 > 3 ? _len2 - 3 : 0), _key2 = 3; _key2 < _len2; _key2++) {
rest[_key2 - 3] = arguments[_key2];
}
return validator.apply(void 0, [props, propName, componentName].concat(rest));
};
var _default = function _default() {
return (0, _wrapValidator["default"])(validator, 'numericString');
};
exports["default"] = _default;
/***/ }),
/***/ "./node_modules/airbnb-prop-types/build/object.js":
/*!********************************************************!*\
!*** ./node_modules/airbnb-prop-types/build/object.js ***!
\********************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = void 0;
var _isPlainObject = _interopRequireDefault(__webpack_require__(/*! ./helpers/isPlainObject */ "./node_modules/airbnb-prop-types/build/helpers/isPlainObject.js"));
var _typeOf = _interopRequireDefault(__webpack_require__(/*! ./helpers/typeOf */ "./node_modules/airbnb-prop-types/build/helpers/typeOf.js"));
var _wrapValidator = _interopRequireDefault(__webpack_require__(/*! ./helpers/wrapValidator */ "./node_modules/airbnb-prop-types/build/helpers/wrapValidator.js"));
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
"default": obj
};
}
/*
code adapted from https://github.com/facebook/react/blob/14156e56b9cf18ac86963185c5af4abddf3ff811/src/isomorphic/classic/types/ReactPropTypes.js#L202-L206
so that it can be called outside of React's normal PropType flow
*/
var ReactPropTypeLocationNames = {
prop: 'prop',
context: 'context',
childContext: 'child context'
};
function object(props, propName, componentName, location, propFullName) {
var propValue = props[propName];
if (propValue == null) {
return null;
}
if ((0, _isPlainObject["default"])(propValue)) {
return null;
}
var locationName = ReactPropTypeLocationNames[location] || location;
return new TypeError("Invalid ".concat(locationName, " `").concat(propFullName, "` of type `").concat((0, _typeOf["default"])(propValue), "` supplied to `").concat(componentName, "`, expected `object`."));
}
object.isRequired = function objectRequired(props, propName, componentName, location, propFullName) {
var propValue = props[propName];
if (propValue == null) {
var locationName = ReactPropTypeLocationNames[location] || location;
return new TypeError("The ".concat(locationName, " `").concat(propFullName, "` is marked as required in `").concat(componentName, "`, but its value is `").concat(propValue, "`."));
}
for (var _len = arguments.length, rest = new Array(_len > 5 ? _len - 5 : 0), _key = 5; _key < _len; _key++) {
rest[_key - 5] = arguments[_key];
}
return object.apply(void 0, [props, propName, componentName, location, propFullName].concat(rest));
};
var _default = function _default() {
return (0, _wrapValidator["default"])(object, 'object');
};
exports["default"] = _default;
/***/ }),
/***/ "./node_modules/airbnb-prop-types/build/or.js":
/*!****************************************************!*\
!*** ./node_modules/airbnb-prop-types/build/or.js ***!
\****************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = or;
var _propTypes = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js");
var _wrapValidator = _interopRequireDefault(__webpack_require__(/*! ./helpers/wrapValidator */ "./node_modules/airbnb-prop-types/build/helpers/wrapValidator.js"));
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
"default": obj
};
}
function _toConsumableArray(arr) {
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread();
}
function _nonIterableSpread() {
throw new TypeError("Invalid attempt to spread non-iterable instance");
}
function _iterableToArray(iter) {
if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter);
}
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;
}
}
function oneOfTypeValidator(validators) {
var validator = function oneOfType(props, propName, componentName) {
for (var _len = arguments.length, rest = new Array(_len > 3 ? _len - 3 : 0), _key = 3; _key < _len; _key++) {
rest[_key - 3] = arguments[_key];
}
var propValue = props[propName];
if (typeof propValue === 'undefined') {
return null;
}
var errors = validators.map(function (v) {
return v.apply(void 0, [props, propName, componentName].concat(rest));
}).filter(Boolean);
if (errors.length < validators.length) {
return null;
}
return new TypeError("".concat(componentName, ": invalid value supplied to ").concat(propName, "."));
};
validator.isRequired = function oneOfTypeRequired(props, propName, componentName) {
for (var _len2 = arguments.length, rest = new Array(_len2 > 3 ? _len2 - 3 : 0), _key2 = 3; _key2 < _len2; _key2++) {
rest[_key2 - 3] = arguments[_key2];
}
var propValue = props[propName];
if (typeof propValue === 'undefined') {
return new TypeError("".concat(componentName, ": missing value for required ").concat(propName, "."));
}
var errors = validators.map(function (v) {
return v.apply(void 0, [props, propName, componentName].concat(rest));
}).filter(Boolean);
if (errors.length === validators.length) {
return new TypeError("".concat(componentName, ": invalid value ").concat(errors, " supplied to required ").concat(propName, "."));
}
return null;
};
return (0, _wrapValidator["default"])(validator, 'oneOfType', validators);
}
function or(validators) {
var name = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'or';
if (!Array.isArray(validators)) {
throw new TypeError('or: 2 or more validators are required');
}
if (validators.length <= 1) {
throw new RangeError('or: 2 or more validators are required');
}
var validator = oneOfTypeValidator([(0, _propTypes.arrayOf)(oneOfTypeValidator(validators))].concat(_toConsumableArray(validators)));
return (0, _wrapValidator["default"])(validator, name, validators);
}
/***/ }),
/***/ "./node_modules/airbnb-prop-types/build/range.js":
/*!*******************************************************!*\
!*** ./node_modules/airbnb-prop-types/build/range.js ***!
\*******************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = range;
var _and = _interopRequireDefault(__webpack_require__(/*! ./and */ "./node_modules/airbnb-prop-types/build/and.js"));
var _between = _interopRequireDefault(__webpack_require__(/*! ./between */ "./node_modules/airbnb-prop-types/build/between.js"));
var _integer = _interopRequireDefault(__webpack_require__(/*! ./integer */ "./node_modules/airbnb-prop-types/build/integer.js"));
var _isInteger = _interopRequireDefault(__webpack_require__(/*! ./helpers/isInteger */ "./node_modules/airbnb-prop-types/build/helpers/isInteger.js"));
var _wrapValidator = _interopRequireDefault(__webpack_require__(/*! ./helpers/wrapValidator */ "./node_modules/airbnb-prop-types/build/helpers/wrapValidator.js"));
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
"default": obj
};
}
var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER ||
/* istanbul ignore next */
Math.pow(2, 53) - 1;
function isValidLength(x) {
return (0, _isInteger["default"])(x) && Math.abs(x) < MAX_SAFE_INTEGER;
}
function range(min, max) {
if (!isValidLength(min) || !isValidLength(max)) {
throw new RangeError("\"range\" requires two integers: ".concat(min, " and ").concat(max, " given"));
}
if (min === max) {
throw new RangeError('min and max must not be the same');
}
return (0, _wrapValidator["default"])((0, _and["default"])([(0, _integer["default"])(), (0, _between["default"])({
gte: min,
lt: max
})], 'range'), 'range', {
min: min,
max: max
});
}
/***/ }),
/***/ "./node_modules/airbnb-prop-types/build/ref.js":
/*!*****************************************************!*\
!*** ./node_modules/airbnb-prop-types/build/ref.js ***!
\*****************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = void 0;
var _react = __webpack_require__(/*! react */ "react");
var _isPlainObject = _interopRequireDefault(__webpack_require__(/*! ./helpers/isPlainObject */ "./node_modules/airbnb-prop-types/build/helpers/isPlainObject.js"));
var _wrapValidator = _interopRequireDefault(__webpack_require__(/*! ./helpers/wrapValidator */ "./node_modules/airbnb-prop-types/build/helpers/wrapValidator.js"));
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
"default": obj
};
}
var isPrototypeOf = Object.prototype.isPrototypeOf;
function isNewRef(prop) {
if (!(0, _isPlainObject["default"])(prop)) {
return false;
}
var ownProperties = Object.keys(prop);
return ownProperties.length === 1 && ownProperties[0] === 'current';
}
function isCallbackRef(prop) {
return typeof prop === 'function' && !isPrototypeOf.call(_react.Component, prop) && (!_react.PureComponent || !isPrototypeOf.call(_react.PureComponent, prop));
}
function requiredRef(props, propName, componentName) {
var propValue = props[propName];
if (isCallbackRef(propValue) || isNewRef(propValue)) {
return null;
}
return new TypeError("".concat(propName, " in ").concat(componentName, " must be a ref"));
}
function ref(props, propName, componentName) {
var propValue = props[propName];
if (propValue == null) {
return null;
}
for (var _len = arguments.length, rest = new Array(_len > 3 ? _len - 3 : 0), _key = 3; _key < _len; _key++) {
rest[_key - 3] = arguments[_key];
}
return requiredRef.apply(void 0, [props, propName, componentName].concat(rest));
}
ref.isRequired = requiredRef;
var _default = function _default() {
return (0, _wrapValidator["default"])(ref, 'ref');
};
exports["default"] = _default;
/***/ }),
/***/ "./node_modules/airbnb-prop-types/build/requiredBy.js":
/*!************************************************************!*\
!*** ./node_modules/airbnb-prop-types/build/requiredBy.js ***!
\************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = getRequiredBy;
var _objectIs = _interopRequireDefault(__webpack_require__(/*! object-is */ "./node_modules/object-is/index.js"));
var _wrapValidator = _interopRequireDefault(__webpack_require__(/*! ./helpers/wrapValidator */ "./node_modules/airbnb-prop-types/build/helpers/wrapValidator.js"));
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
"default": obj
};
}
function getRequiredBy(requiredByPropName, propType) {
var defaultValue = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
function requiredBy(props, propName, componentName) {
if (props[requiredByPropName]) {
var propValue = props[propName];
if ((0, _objectIs["default"])(propValue, defaultValue) || typeof propValue === 'undefined') {
return new TypeError("".concat(componentName, ": when ").concat(requiredByPropName, " is true, prop \u201C").concat(propName, "\u201D must be present."));
}
}
for (var _len = arguments.length, rest = new Array(_len > 3 ? _len - 3 : 0), _key = 3; _key < _len; _key++) {
rest[_key - 3] = arguments[_key];
}
return propType.apply(void 0, [props, propName, componentName].concat(rest));
}
requiredBy.isRequired = function requiredByRequired(props, propName, componentName) {
var propValue = props[propName];
if ((0, _objectIs["default"])(propValue, defaultValue)) {
return new TypeError("".concat(componentName, ": prop \u201C").concat(propName, "\u201D must be present."));
}
for (var _len2 = arguments.length, rest = new Array(_len2 > 3 ? _len2 - 3 : 0), _key2 = 3; _key2 < _len2; _key2++) {
rest[_key2 - 3] = arguments[_key2];
}
return propType.isRequired.apply(propType, [props, propName, componentName].concat(rest));
};
return (0, _wrapValidator["default"])(requiredBy, "requiredBy \u201C".concat(requiredByPropName, "\u201D"), [requiredByPropName, defaultValue]);
}
/***/ }),
/***/ "./node_modules/airbnb-prop-types/build/restrictedProp.js":
/*!****************************************************************!*\
!*** ./node_modules/airbnb-prop-types/build/restrictedProp.js ***!
\****************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = void 0;
var _wrapValidator = _interopRequireDefault(__webpack_require__(/*! ./helpers/wrapValidator */ "./node_modules/airbnb-prop-types/build/helpers/wrapValidator.js"));
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
"default": obj
};
}
function customMessageWrapper(messsageFunction) {
function restrictedProp(props, propName, componentName, location) {
if (props[propName] == null) {
return null;
}
if (messsageFunction && typeof messsageFunction === 'function') {
for (var _len = arguments.length, rest = new Array(_len > 4 ? _len - 4 : 0), _key = 4; _key < _len; _key++) {
rest[_key - 4] = arguments[_key];
}
return new TypeError(messsageFunction.apply(void 0, [props, propName, componentName, location].concat(rest)));
}
return new TypeError("The ".concat(propName, " ").concat(location, " on ").concat(componentName, " is not allowed."));
}
restrictedProp.isRequired = restrictedProp;
return restrictedProp;
}
var _default = function _default() {
var messsageFunction = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
return (0, _wrapValidator["default"])(customMessageWrapper(messsageFunction), 'restrictedProp');
};
exports["default"] = _default;
/***/ }),
/***/ "./node_modules/airbnb-prop-types/build/sequenceOf.js":
/*!************************************************************!*\
!*** ./node_modules/airbnb-prop-types/build/sequenceOf.js ***!
\************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = sequenceOfValidator;
var _propTypes = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js");
var _and = _interopRequireDefault(__webpack_require__(/*! ./and */ "./node_modules/airbnb-prop-types/build/and.js"));
var _between = _interopRequireDefault(__webpack_require__(/*! ./between */ "./node_modules/airbnb-prop-types/build/between.js"));
var _nonNegativeInteger = _interopRequireDefault(__webpack_require__(/*! ./nonNegativeInteger */ "./node_modules/airbnb-prop-types/build/nonNegativeInteger.js"));
var _object = _interopRequireDefault(__webpack_require__(/*! ./object */ "./node_modules/airbnb-prop-types/build/object.js"));
var _withShape = _interopRequireDefault(__webpack_require__(/*! ./withShape */ "./node_modules/airbnb-prop-types/build/withShape.js"));
var _typeOf = _interopRequireDefault(__webpack_require__(/*! ./helpers/typeOf */ "./node_modules/airbnb-prop-types/build/helpers/typeOf.js"));
var _wrapValidator = _interopRequireDefault(__webpack_require__(/*! ./helpers/wrapValidator */ "./node_modules/airbnb-prop-types/build/helpers/wrapValidator.js"));
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
"default": obj
};
}
function ownKeys(object, enumerableOnly) {
var keys = Object.keys(object);
if (Object.getOwnPropertySymbols) {
var symbols = Object.getOwnPropertySymbols(object);
if (enumerableOnly) symbols = symbols.filter(function (sym) {
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
});
keys.push.apply(keys, symbols);
}
return keys;
}
function _objectSpread(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i] != null ? arguments[i] : {};
if (i % 2) {
ownKeys(source, true).forEach(function (key) {
_defineProperty(target, key, source[key]);
});
} else if (Object.getOwnPropertyDescriptors) {
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
} else {
ownKeys(source).forEach(function (key) {
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
});
}
}
return target;
}
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;
}
var minValidator = _nonNegativeInteger["default"];
var maxValidator = (0, _and["default"])([_nonNegativeInteger["default"], (0, _between["default"])({
gte: 1
})]);
function validateRange(min, max) {
if (typeof max !== 'number' || typeof min !== 'number') {
return null; // no additional checking needed unless both are present
}
if (min <= max) {
return null;
}
return new RangeError('min must be less than or equal to max');
}
var specifierShape = {
validator: function validator(props, propName) {
var propValue = props[propName];
if (typeof propValue !== 'function') {
return new TypeError('"validator" must be a propType validator function');
}
return null;
},
min: function min(props, propName) {
return minValidator(props, propName) || validateRange(props.min, props.max);
},
max: function max(props, propName) {
return maxValidator(props, propName) || validateRange(props.min, props.max);
}
};
function getMinMax(_ref) {
var min = _ref.min,
max = _ref.max;
var minimum;
var maximum;
if (typeof min !== 'number' && typeof max !== 'number') {
// neither provided, default to "1"
minimum = 1;
maximum = 1;
} else {
minimum = typeof min === 'number' ? min : 1;
maximum = typeof max === 'number' ? max : Infinity;
}
return {
minimum: minimum,
maximum: maximum
};
}
function chunkByType(items) {
var chunk = [];
var lastType;
return items.reduce(function (chunks, item) {
var itemType = (0, _typeOf["default"])(item);
if (!lastType || itemType === lastType) {
chunk.push(item);
} else {
chunks.push(chunk);
chunk = [item];
}
lastType = itemType;
return chunks;
}, []).concat(chunk.length > 0 ? [chunk] : []);
}
function validateChunks(specifiers, props, propName, componentName) {
var items = props[propName];
var chunks = chunkByType(items);
for (var _len = arguments.length, rest = new Array(_len > 4 ? _len - 4 : 0), _key = 4; _key < _len; _key++) {
rest[_key - 4] = arguments[_key];
}
for (var i = 0; i < specifiers.length; i += 1) {
var _specifiers$i = specifiers[i],
validator = _specifiers$i.validator,
min = _specifiers$i.min,
max = _specifiers$i.max;
var _getMinMax = getMinMax({
min: min,
max: max
}),
minimum = _getMinMax.minimum,
maximum = _getMinMax.maximum;
if (chunks.length === 0 && minimum === 0) {
// no chunks left, but this specifier does not require any items
continue; // eslint-disable-line no-continue
}
var arrayOfValidator = (0, _propTypes.arrayOf)(validator).isRequired;
var chunk = chunks.shift(); // extract the next chunk to test
var chunkError = arrayOfValidator.apply(void 0, [_objectSpread({}, props, _defineProperty({}, propName, chunk)), propName, componentName].concat(rest));
if (chunkError) {
// this chunk is invalid
if (minimum === 0) {
// but, specifier has a min of 0 and can be skipped
chunks.unshift(chunk); // put the chunk back, for the next iteration
continue; // eslint-disable-line no-continue
}
return chunkError;
} // chunk is valid!
if (chunk.length < minimum) {
return new RangeError("".concat(componentName, ": specifier index ").concat(i, " requires a minimum of ").concat(min, " items, but only has ").concat(chunk.length, "."));
}
if (chunk.length > maximum) {
return new RangeError("".concat(componentName, ": specifier index ").concat(i, " requires a maximum of ").concat(max, " items, but has ").concat(chunk.length, "."));
}
}
if (chunks.length > 0) {
return new TypeError("".concat(componentName, ": after all ").concat(specifiers.length, " specifiers matched, ").concat(chunks.length, " types of items were remaining."));
}
return null;
}
var specifierValidator = (0, _withShape["default"])((0, _object["default"])(), specifierShape).isRequired;
function sequenceOfValidator() {
for (var _len2 = arguments.length, specifiers = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
specifiers[_key2] = arguments[_key2];
}
if (specifiers.length === 0) {
throw new RangeError('sequenceOf: at least one specifier is required');
}
var errors = specifiers.map(function (specifier, i) {
return specifierValidator({
specifier: specifier
}, 'specifier', 'sequenceOf specifier', "suequenceOf specifier, index ".concat(i), "specifier, index ".concat(i));
});
if (errors.some(Boolean)) {
throw new TypeError("\n sequenceOf: all specifiers must match the appropriate shape.\n\n Errors:\n ".concat(errors.map(function (e, i) {
return " - Argument index ".concat(i, ": ").concat(e.message);
}).join(',\n '), "\n "));
}
var validator = function sequenceOf(props, propName) {
var propValue = props[propName];
if (propValue == null) {
return null;
}
for (var _len3 = arguments.length, rest = new Array(_len3 > 2 ? _len3 - 2 : 0), _key3 = 2; _key3 < _len3; _key3++) {
rest[_key3 - 2] = arguments[_key3];
}
var error = _propTypes.array.apply(void 0, [props, propName].concat(rest));
if (error) {
return error;
}
return validateChunks.apply(void 0, [specifiers, props, propName].concat(rest));
};
validator.isRequired = function sequenceOfRequired(props, propName, componentName) {
for (var _len4 = arguments.length, rest = new Array(_len4 > 3 ? _len4 - 3 : 0), _key4 = 3; _key4 < _len4; _key4++) {
rest[_key4 - 3] = arguments[_key4];
}
var error = _propTypes.array.isRequired.apply(_propTypes.array, [props, propName, componentName].concat(rest));
if (error) {
return error;
}
return validateChunks.apply(void 0, [specifiers, props, propName, componentName].concat(rest));
};
return (0, _wrapValidator["default"])(validator, 'sequenceOf', specifiers);
}
/***/ }),
/***/ "./node_modules/airbnb-prop-types/build/shape.js":
/*!*******************************************************!*\
!*** ./node_modules/airbnb-prop-types/build/shape.js ***!
\*******************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = shapeValidator;
var _isPlainObject = _interopRequireDefault(__webpack_require__(/*! ./helpers/isPlainObject */ "./node_modules/airbnb-prop-types/build/helpers/isPlainObject.js"));
var _wrapValidator = _interopRequireDefault(__webpack_require__(/*! ./helpers/wrapValidator */ "./node_modules/airbnb-prop-types/build/helpers/wrapValidator.js"));
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
"default": obj
};
}
function shapeValidator(shapeTypes) {
if (!(0, _isPlainObject["default"])(shapeTypes)) {
throw new TypeError('shape must be a normal object');
}
function shape(props, propName, componentName, location) {
var propValue = props[propName];
if (propValue == null) {
return null;
} // code adapted from PropTypes.shape: https://github.com/facebook/react/blob/14156e56b9cf18ac86963185c5af4abddf3ff811/src/isomorphic/classic/types/ReactPropTypes.js#L381
// eslint-disable-next-line guard-for-in, no-restricted-syntax
for (var _len = arguments.length, rest = new Array(_len > 4 ? _len - 4 : 0), _key = 4; _key < _len; _key++) {
rest[_key - 4] = arguments[_key];
}
for (var key in shapeTypes) {
var checker = shapeTypes[key];
if (checker) {
var error = checker.apply(void 0, [propValue, key, componentName, location].concat(rest));
if (error) {
return error;
}
}
}
return null;
}
shape.isRequired = function shapeRequired(props, propName, componentName) {
var propValue = props[propName];
if (propValue == null) {
return new TypeError("".concat(componentName, ": ").concat(propName, " is required."));
}
for (var _len2 = arguments.length, rest = new Array(_len2 > 3 ? _len2 - 3 : 0), _key2 = 3; _key2 < _len2; _key2++) {
rest[_key2 - 3] = arguments[_key2];
}
return shape.apply(void 0, [props, propName, componentName].concat(rest));
};
return (0, _wrapValidator["default"])(shape, 'shape', shapeTypes);
}
/***/ }),
/***/ "./node_modules/airbnb-prop-types/build/stringEndsWith.js":
/*!****************************************************************!*\
!*** ./node_modules/airbnb-prop-types/build/stringEndsWith.js ***!
\****************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = stringEndsWithValidator;
var _propTypes = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js");
var _wrapValidator = _interopRequireDefault(__webpack_require__(/*! ./helpers/wrapValidator */ "./node_modules/airbnb-prop-types/build/helpers/wrapValidator.js"));
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
"default": obj
};
}
function stringEndsWithValidator(end) {
if (typeof end !== 'string' || end.length === 0) {
throw new TypeError('a non-empty string is required');
}
var validator = function stringEndsWith(props, propName, componentName) {
var propValue = props[propName];
if (propValue == null) {
return null;
}
for (var _len = arguments.length, rest = new Array(_len > 3 ? _len - 3 : 0), _key = 3; _key < _len; _key++) {
rest[_key - 3] = arguments[_key];
}
var stringError = _propTypes.string.apply(void 0, [props, propName, componentName].concat(rest));
if (stringError) {
return stringError;
}
if (!propValue.endsWith(end) || propValue.length <= end.length) {
return new TypeError("".concat(componentName, ": ").concat(propName, " does not end with \"").concat(end, "\""));
}
return null;
};
validator.isRequired = function requiredStringEndsWith() {
var stringError = _propTypes.string.isRequired.apply(_propTypes.string, arguments);
if (stringError) {
return stringError;
}
return validator.apply(void 0, arguments);
};
return (0, _wrapValidator["default"])(validator, "stringEndsWith: ".concat(end));
}
/***/ }),
/***/ "./node_modules/airbnb-prop-types/build/stringStartsWith.js":
/*!******************************************************************!*\
!*** ./node_modules/airbnb-prop-types/build/stringStartsWith.js ***!
\******************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = stringStartsWithValidator;
var _propTypes = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js");
var _wrapValidator = _interopRequireDefault(__webpack_require__(/*! ./helpers/wrapValidator */ "./node_modules/airbnb-prop-types/build/helpers/wrapValidator.js"));
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
"default": obj
};
}
function stringStartsWithValidator(start) {
if (typeof start !== 'string' || start.length === 0) {
throw new TypeError('a non-empty string is required');
}
var validator = function stringStartsWith(props, propName, componentName) {
var propValue = props[propName];
if (propValue == null) {
return null;
}
for (var _len = arguments.length, rest = new Array(_len > 3 ? _len - 3 : 0), _key = 3; _key < _len; _key++) {
rest[_key - 3] = arguments[_key];
}
var stringError = _propTypes.string.apply(void 0, [props, propName, componentName].concat(rest));
if (stringError) {
return stringError;
}
if (!propValue.startsWith(start) || propValue.length <= start.length) {
return new TypeError("".concat(componentName, ": ").concat(propName, " does not start with \"").concat(start, "\""));
}
return null;
};
validator.isRequired = function requiredStringStartsWith() {
var stringError = _propTypes.string.isRequired.apply(_propTypes.string, arguments);
if (stringError) {
return stringError;
}
return validator.apply(void 0, arguments);
};
return (0, _wrapValidator["default"])(validator, "stringStartsWith: ".concat(start));
}
/***/ }),
/***/ "./node_modules/airbnb-prop-types/build/uniqueArray.js":
/*!*************************************************************!*\
!*** ./node_modules/airbnb-prop-types/build/uniqueArray.js ***!
\*************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = void 0;
var _propTypes = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js");
var _wrapValidator = _interopRequireDefault(__webpack_require__(/*! ./helpers/wrapValidator */ "./node_modules/airbnb-prop-types/build/helpers/wrapValidator.js"));
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
"default": obj
};
}
function uniqueCountWithSet(arr) {
return new Set(arr).size;
}
/* istanbul ignore next */
function uniqueCountLegacy(arr) {
var seen = [];
arr.forEach(function (item) {
if (seen.indexOf(item) === -1) {
seen.push(item);
}
});
return seen.length;
}
var getUniqueCount = typeof Set === 'function' ? uniqueCountWithSet :
/* istanbul ignore next */
uniqueCountLegacy;
function requiredUniqueArray(props, propName, componentName) {
for (var _len = arguments.length, rest = new Array(_len > 3 ? _len - 3 : 0), _key = 3; _key < _len; _key++) {
rest[_key - 3] = arguments[_key];
}
var result = _propTypes.array.isRequired.apply(_propTypes.array, [props, propName, componentName].concat(rest));
if (result != null) {
return result;
}
var propValue = props[propName];
var uniqueCount = getUniqueCount(propValue);
if (uniqueCount !== propValue.length) {
return new RangeError("".concat(componentName, ": values must be unique. ").concat(propValue.length - uniqueCount, " duplicate values found."));
}
return null;
}
function uniqueArray(props, propName) {
var propValue = props[propName];
if (propValue == null) {
return null;
}
for (var _len2 = arguments.length, rest = new Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {
rest[_key2 - 2] = arguments[_key2];
}
return requiredUniqueArray.apply(void 0, [props, propName].concat(rest));
}
uniqueArray.isRequired = requiredUniqueArray;
var _default = function _default() {
return (0, _wrapValidator["default"])(uniqueArray, 'uniqueArray');
};
exports["default"] = _default;
/***/ }),
/***/ "./node_modules/airbnb-prop-types/build/uniqueArrayOf.js":
/*!***************************************************************!*\
!*** ./node_modules/airbnb-prop-types/build/uniqueArrayOf.js ***!
\***************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = uniqueArrayOfTypeValidator;
var _propTypes = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js");
var _and = _interopRequireDefault(__webpack_require__(/*! ./and */ "./node_modules/airbnb-prop-types/build/and.js"));
var _uniqueArray = _interopRequireDefault(__webpack_require__(/*! ./uniqueArray */ "./node_modules/airbnb-prop-types/build/uniqueArray.js"));
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
"default": obj
};
}
function ownKeys(object, enumerableOnly) {
var keys = Object.keys(object);
if (Object.getOwnPropertySymbols) {
var symbols = Object.getOwnPropertySymbols(object);
if (enumerableOnly) symbols = symbols.filter(function (sym) {
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
});
keys.push.apply(keys, symbols);
}
return keys;
}
function _objectSpread(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i] != null ? arguments[i] : {};
if (i % 2) {
ownKeys(source, true).forEach(function (key) {
_defineProperty(target, key, source[key]);
});
} else if (Object.getOwnPropertyDescriptors) {
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
} else {
ownKeys(source).forEach(function (key) {
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
});
}
}
return target;
}
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;
}
var unique = (0, _uniqueArray["default"])();
function uniqueArrayOfTypeValidator(type) {
if (typeof type !== 'function') {
throw new TypeError('type must be a validator function');
}
var mapper = null;
var name = 'uniqueArrayOfType';
for (var _len = arguments.length, rest = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
rest[_key - 1] = arguments[_key];
}
if (rest.length === 1) {
if (typeof rest[0] === 'function') {
mapper = rest[0];
} else if (typeof rest[0] === 'string') {
name = rest[0];
} else {
throw new TypeError('single input must either be string or function');
}
} else if (rest.length === 2) {
if (typeof rest[0] === 'function' && typeof rest[1] === 'string') {
mapper = rest[0];
name = rest[1];
} else {
throw new TypeError('multiple inputs must be in [function, string] order');
}
} else if (rest.length > 2) {
throw new TypeError('only [], [name], [mapper], and [mapper, name] are valid inputs');
}
function uniqueArrayOfMapped(props, propName) {
var propValue = props[propName];
if (propValue == null) {
return null;
}
var values = propValue.map(mapper);
for (var _len2 = arguments.length, args = new Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {
args[_key2 - 2] = arguments[_key2];
}
return unique.apply(void 0, [_objectSpread({}, props, _defineProperty({}, propName, values)), propName].concat(args));
}
uniqueArrayOfMapped.isRequired = function isRequired(props, propName) {
var propValue = props[propName];
for (var _len3 = arguments.length, args = new Array(_len3 > 2 ? _len3 - 2 : 0), _key3 = 2; _key3 < _len3; _key3++) {
args[_key3 - 2] = arguments[_key3];
}
if (propValue == null) {
return _propTypes.array.isRequired.apply(_propTypes.array, [props, propName].concat(args));
}
return uniqueArrayOfMapped.apply(void 0, [props, propName].concat(args));
};
var arrayValidator = (0, _propTypes.arrayOf)(type);
var uniqueValidator = mapper ? uniqueArrayOfMapped : unique;
var validator = (0, _and["default"])([arrayValidator, uniqueValidator], name);
validator.isRequired = (0, _and["default"])([uniqueValidator.isRequired, arrayValidator.isRequired], "".concat(name, ".isRequired"));
return validator;
}
/***/ }),
/***/ "./node_modules/airbnb-prop-types/build/valuesOf.js":
/*!**********************************************************!*\
!*** ./node_modules/airbnb-prop-types/build/valuesOf.js ***!
\**********************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = valuesOfValidator;
var _isPrimitive = _interopRequireDefault(__webpack_require__(/*! ./helpers/isPrimitive */ "./node_modules/airbnb-prop-types/build/helpers/isPrimitive.js"));
var _wrapValidator = _interopRequireDefault(__webpack_require__(/*! ./helpers/wrapValidator */ "./node_modules/airbnb-prop-types/build/helpers/wrapValidator.js"));
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
"default": obj
};
} // code adapted from https://github.com/facebook/react/blob/14156e56b9cf18ac86963185c5af4abddf3ff811/src/isomorphic/classic/types/ReactPropTypes.js#L307-L340
function valuesOfValidator(propType) {
if (typeof propType !== 'function') {
throw new TypeError('objectOf: propType must be a function');
}
var validator = function valuesOf(props, propName, componentName, location, propFullName) {
for (var _len = arguments.length, rest = new Array(_len > 5 ? _len - 5 : 0), _key = 5; _key < _len; _key++) {
rest[_key - 5] = arguments[_key];
}
var propValue = props[propName];
if (propValue == null || (0, _isPrimitive["default"])(propValue)) {
return null;
}
var firstError;
Object.keys(propValue).some(function (key) {
firstError = propType.apply(void 0, [propValue, key, componentName, location, "".concat(propFullName, ".").concat(key)].concat(rest));
return firstError;
});
return firstError || null;
};
validator.isRequired = function valuesOfRequired(props, propName, componentName) {
var propValue = props[propName];
if (propValue == null) {
return new TypeError("".concat(componentName, ": ").concat(propName, " is required."));
}
for (var _len2 = arguments.length, rest = new Array(_len2 > 3 ? _len2 - 3 : 0), _key2 = 3; _key2 < _len2; _key2++) {
rest[_key2 - 3] = arguments[_key2];
}
return validator.apply(void 0, [props, propName, componentName].concat(rest));
};
return (0, _wrapValidator["default"])(validator, 'valuesOf', propType);
}
/***/ }),
/***/ "./node_modules/airbnb-prop-types/build/withShape.js":
/*!***********************************************************!*\
!*** ./node_modules/airbnb-prop-types/build/withShape.js ***!
\***********************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = withShape;
var _and = _interopRequireDefault(__webpack_require__(/*! ./and */ "./node_modules/airbnb-prop-types/build/and.js"));
var _shape = _interopRequireDefault(__webpack_require__(/*! ./shape */ "./node_modules/airbnb-prop-types/build/shape.js"));
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
"default": obj
};
}
function withShape(type, shapeTypes) {
if (typeof type !== 'function') {
throw new TypeError('type must be a valid PropType');
}
var shapeValidator = (0, _shape["default"])(shapeTypes);
return (0, _and["default"])([type, shapeValidator], 'withShape');
}
/***/ }),
/***/ "./node_modules/airbnb-prop-types/index.js":
/*!*************************************************!*\
!*** ./node_modules/airbnb-prop-types/index.js ***!
\*************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
module.exports = false ? undefined : __webpack_require__(/*! ./build */ "./node_modules/airbnb-prop-types/build/index.js");
/***/ }),
/***/ "./node_modules/array.prototype.find/implementation.js":
/*!*************************************************************!*\
!*** ./node_modules/array.prototype.find/implementation.js ***!
\*************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var ES = __webpack_require__(/*! es-abstract/es6 */ "./node_modules/es-abstract/es6.js");
module.exports = function find(predicate) {
var list = ES.ToObject(this);
var length = ES.ToLength(list.length);
if (!ES.IsCallable(predicate)) {
throw new TypeError('Array#find: predicate must be a function');
}
if (length === 0) {
return void 0;
}
var thisArg;
if (arguments.length > 0) {
thisArg = arguments[1];
}
for (var i = 0, value; i < length; i++) {
value = list[i]; // inlined for performance: if (ES.Call(predicate, thisArg, [value, i, list])) {
if (predicate.apply(thisArg, [value, i, list])) {
return value;
}
}
return void 0;
};
/***/ }),
/***/ "./node_modules/array.prototype.find/index.js":
/*!****************************************************!*\
!*** ./node_modules/array.prototype.find/index.js ***!
\****************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var define = __webpack_require__(/*! define-properties */ "./node_modules/define-properties/index.js");
var ES = __webpack_require__(/*! es-abstract/es6 */ "./node_modules/es-abstract/es6.js");
var implementation = __webpack_require__(/*! ./implementation */ "./node_modules/array.prototype.find/implementation.js");
var getPolyfill = __webpack_require__(/*! ./polyfill */ "./node_modules/array.prototype.find/polyfill.js");
var shim = __webpack_require__(/*! ./shim */ "./node_modules/array.prototype.find/shim.js");
var slice = Array.prototype.slice;
var polyfill = getPolyfill();
var boundFindShim = function find(array, predicate) {
// eslint-disable-line no-unused-vars
ES.RequireObjectCoercible(array);
var args = slice.call(arguments, 1);
return polyfill.apply(array, args);
};
define(boundFindShim, {
getPolyfill: getPolyfill,
implementation: implementation,
shim: shim
});
module.exports = boundFindShim;
/***/ }),
/***/ "./node_modules/array.prototype.find/polyfill.js":
/*!*******************************************************!*\
!*** ./node_modules/array.prototype.find/polyfill.js ***!
\*******************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
module.exports = function getPolyfill() {
// Detect if an implementation exists
// Detect early implementations which skipped holes in sparse arrays
// eslint-disable-next-line no-sparse-arrays
var implemented = Array.prototype.find && [, 1].find(function () {
return true;
}) !== 1; // eslint-disable-next-line global-require
return implemented ? Array.prototype.find : __webpack_require__(/*! ./implementation */ "./node_modules/array.prototype.find/implementation.js");
};
/***/ }),
/***/ "./node_modules/array.prototype.find/shim.js":
/*!***************************************************!*\
!*** ./node_modules/array.prototype.find/shim.js ***!
\***************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var define = __webpack_require__(/*! define-properties */ "./node_modules/define-properties/index.js");
var getPolyfill = __webpack_require__(/*! ./polyfill */ "./node_modules/array.prototype.find/polyfill.js");
module.exports = function shimArrayPrototypeFind() {
var polyfill = getPolyfill();
define(Array.prototype, {
find: polyfill
}, {
find: function () {
return Array.prototype.find !== polyfill;
}
});
return polyfill;
};
/***/ }),
/***/ "./node_modules/array.prototype.flat/implementation.js":
/*!*************************************************************!*\
!*** ./node_modules/array.prototype.flat/implementation.js ***!
\*************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var ES = __webpack_require__(/*! es-abstract/es2017 */ "./node_modules/es-abstract/es2017.js");
var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || Math.pow(2, 53) - 1; // eslint-disable-next-line max-params, max-statements
var FlattenIntoArray = function FlattenIntoArray(target, source, sourceLen, start, depth) {
var targetIndex = start;
var sourceIndex = 0;
/*
var mapperFunction;
if (arguments.length > 5) {
mapperFunction = arguments[5];
}
*/
while (sourceIndex < sourceLen) {
var P = ES.ToString(sourceIndex);
var exists = ES.HasProperty(source, P);
if (exists) {
var element = ES.Get(source, P);
/*
if (typeof mapperFunction !== 'undefined') {
if (arguments.length <= 6) {
throw new TypeError('Assertion failed: thisArg is required when mapperFunction is provided');
}
element = ES.Call(mapperFunction, arguments[6], [element, sourceIndex, source]);
}
*/
var shouldFlatten = false;
if (depth > 0) {
shouldFlatten = ES.IsArray(element);
}
if (shouldFlatten) {
var elementLen = ES.ToLength(ES.Get(element, 'length'));
targetIndex = FlattenIntoArray(target, element, elementLen, targetIndex, depth - 1);
} else {
if (targetIndex >= MAX_SAFE_INTEGER) {
throw new TypeError('index too large');
}
ES.CreateDataPropertyOrThrow(target, ES.ToString(targetIndex), element);
targetIndex += 1;
}
}
sourceIndex += 1;
}
return targetIndex;
};
module.exports = function flat() {
var O = ES.ToObject(this);
var sourceLen = ES.ToLength(ES.Get(O, 'length'));
var depthNum = 1;
if (arguments.length > 0 && typeof arguments[0] !== 'undefined') {
depthNum = ES.ToInteger(arguments[0]);
}
var A = ES.ArraySpeciesCreate(O, 0);
FlattenIntoArray(A, O, sourceLen, 0, depthNum);
return A;
};
/***/ }),
/***/ "./node_modules/array.prototype.flat/index.js":
/*!****************************************************!*\
!*** ./node_modules/array.prototype.flat/index.js ***!
\****************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var define = __webpack_require__(/*! define-properties */ "./node_modules/define-properties/index.js");
var bind = __webpack_require__(/*! function-bind */ "./node_modules/function-bind/index.js");
var implementation = __webpack_require__(/*! ./implementation */ "./node_modules/array.prototype.flat/implementation.js");
var getPolyfill = __webpack_require__(/*! ./polyfill */ "./node_modules/array.prototype.flat/polyfill.js");
var polyfill = getPolyfill();
var shim = __webpack_require__(/*! ./shim */ "./node_modules/array.prototype.flat/shim.js");
var boundFlat = bind.call(Function.call, polyfill);
define(boundFlat, {
getPolyfill: getPolyfill,
implementation: implementation,
shim: shim
});
module.exports = boundFlat;
/***/ }),
/***/ "./node_modules/array.prototype.flat/polyfill.js":
/*!*******************************************************!*\
!*** ./node_modules/array.prototype.flat/polyfill.js ***!
\*******************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var implementation = __webpack_require__(/*! ./implementation */ "./node_modules/array.prototype.flat/implementation.js");
module.exports = function getPolyfill() {
return Array.prototype.flat || implementation;
};
/***/ }),
/***/ "./node_modules/array.prototype.flat/shim.js":
/*!***************************************************!*\
!*** ./node_modules/array.prototype.flat/shim.js ***!
\***************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var define = __webpack_require__(/*! define-properties */ "./node_modules/define-properties/index.js");
var getPolyfill = __webpack_require__(/*! ./polyfill */ "./node_modules/array.prototype.flat/polyfill.js");
module.exports = function shimFlat() {
var polyfill = getPolyfill();
define(Array.prototype, {
flat: polyfill
}, {
flat: function () {
return Array.prototype.flat !== polyfill;
}
});
return polyfill;
};
/***/ }),
/***/ "./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/dist/clipboard.js":
/*!**************************************************!*\
!*** ./node_modules/clipboard/dist/clipboard.js ***!
\**************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
/*!
* clipboard.js v2.0.4
* https://zenorocha.github.io/clipboard.js
*
* Licensed MIT © Zeno Rocha
*/
(function webpackUniversalModuleDefinition(root, factory) {
if (true) module.exports = factory();else {}
})(this, function () {
return (
/******/
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 = 0);
/******/
}(
/************************************************************************/
/******/
[
/* 0 */
/***/
function (module, exports, __webpack_require__) {
"use strict";
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 _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 = __webpack_require__(1);
var _clipboardAction2 = _interopRequireDefault(_clipboardAction);
var _tinyEmitter = __webpack_require__(3);
var _tinyEmitter2 = _interopRequireDefault(_tinyEmitter);
var _goodListener = __webpack_require__(4);
var _goodListener2 = _interopRequireDefault(_goodListener);
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;
}
/**
* Base class which takes one or more elements, adds event listeners to them,
* and instantiates a new `ClipboardAction` on each click.
*/
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;
}
/**
* Adds a click event listener to the passed trigger.
* @param {String|HTMLElement|HTMLCollection|NodeList} trigger
*/
}, {
key: 'listenClick',
value: function listenClick(trigger) {
var _this2 = this;
this.listener = (0, _goodListener2.default)(trigger, 'click', function (e) {
return _this2.onClick(e);
});
}
/**
* Defines a new `ClipboardAction` on each click event.
* @param {Event} 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
});
}
/**
* Default `action` lookup function.
* @param {Element} trigger
*/
}, {
key: 'defaultAction',
value: function defaultAction(trigger) {
return getAttributeValue('action', trigger);
}
/**
* Default `target` lookup function.
* @param {Element} trigger
*/
}, {
key: 'defaultTarget',
value: function defaultTarget(trigger) {
var selector = getAttributeValue('target', trigger);
if (selector) {
return document.querySelector(selector);
}
}
/**
* Returns the support of the given action, or all actions if no action is
* given.
* @param {String} [action]
*/
}, {
key: 'defaultText',
/**
* Default `text` lookup function.
* @param {Element} trigger
*/
value: function defaultText(trigger) {
return getAttributeValue('text', trigger);
}
/**
* Destroy lifecycle.
*/
}, {
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;
/***/
},
/* 1 */
/***/
function (module, exports, __webpack_require__) {
"use strict";
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 _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 _select = __webpack_require__(2);
var _select2 = _interopRequireDefault(_select);
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");
}
}
/**
* Inner class which performs selection from either `text` or `target`
* properties and then executes copy or cut operations.
*/
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 = '';
}
/**
* Decides which selection strategy is going to be applied based
* on the existence of `text` and `target` properties.
*/
}, {
key: 'initSelection',
value: function initSelection() {
if (this.text) {
this.selectFake();
} else if (this.target) {
this.selectTarget();
}
}
/**
* Creates a fake textarea element, sets its value from `text` property,
* and makes a selection on it.
*/
}, {
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();
}
/**
* Only removes the fake element after another click event, that way
* a user can hit `Ctrl+C` to copy because selection still exists.
*/
}, {
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;
}
}
/**
* Selects the content from element passed on `target` property.
*/
}, {
key: 'selectTarget',
value: function selectTarget() {
this.selectedText = (0, _select2.default)(this.target);
this.copyText();
}
/**
* Executes the copy operation based on the current selection.
*/
}, {
key: 'copyText',
value: function copyText() {
var succeeded = void 0;
try {
succeeded = document.execCommand(this.action);
} catch (err) {
succeeded = false;
}
this.handleResult(succeeded);
}
/**
* Fires an event based on the copy operation result.
* @param {Boolean} 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)
});
}
/**
* Moves focus away from `target` and back to the trigger, removes current selection.
*/
}, {
key: 'clearSelection',
value: function clearSelection() {
if (this.trigger) {
this.trigger.focus();
}
window.getSelection().removeAllRanges();
}
/**
* Sets the `action` to be performed which can be either 'copy' or 'cut'.
* @param {String} action
*/
}, {
key: 'destroy',
/**
* Destroy lifecycle.
*/
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"');
}
}
/**
* Gets the `action` property.
* @return {String}
*/
,
get: function get() {
return this._action;
}
/**
* Sets the `target` property using an element
* that will be have its content copied.
* @param {Element} target
*/
}, {
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');
}
}
}
/**
* Gets the `target` property.
* @return {String|HTMLElement}
*/
,
get: function get() {
return this._target;
}
}]);
return ClipboardAction;
}();
module.exports = ClipboardAction;
/***/
},
/* 2 */
/***/
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;
/***/
},
/* 3 */
/***/
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;
/***/
},
/* 4 */
/***/
function (module, exports, __webpack_require__) {
var is = __webpack_require__(5);
var delegate = __webpack_require__(6);
/**
* 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;
/***/
},
/* 5 */
/***/
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]';
};
/***/
},
/* 6 */
/***/
function (module, exports, __webpack_require__) {
var closest = __webpack_require__(7);
/**
* 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;
/***/
},
/* 7 */
/***/
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/consolidated-events/lib/index.esm.js":
/*!***********************************************************!*\
!*** ./node_modules/consolidated-events/lib/index.esm.js ***!
\***********************************************************/
/*! exports provided: addEventListener */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addEventListener", function() { return addEventListener; });
var CAN_USE_DOM = !!(typeof window !== 'undefined' && window.document && window.document.createElement); // Adapted from Modernizr
// https://github.com/Modernizr/Modernizr/blob/acb3f0d9/feature-detects/dom/passiveeventlisteners.js#L26-L37
function testPassiveEventListeners() {
if (!CAN_USE_DOM) {
return false;
}
if (!window.addEventListener || !window.removeEventListener || !Object.defineProperty) {
return false;
}
var supportsPassiveOption = false;
try {
var opts = Object.defineProperty({}, 'passive', {
// eslint-disable-next-line getter-return
get: function () {
function get() {
supportsPassiveOption = true;
}
return get;
}()
});
var noop = function noop() {};
window.addEventListener('testPassiveEventSupport', noop, opts);
window.removeEventListener('testPassiveEventSupport', noop, opts);
} catch (e) {// do nothing
}
return supportsPassiveOption;
}
var memoized = void 0;
function canUsePassiveEventListeners() {
if (memoized === undefined) {
memoized = testPassiveEventListeners();
}
return memoized;
}
function normalizeEventOptions(eventOptions) {
if (!eventOptions) {
return undefined;
}
if (!canUsePassiveEventListeners()) {
// If the browser does not support the passive option, then it is expecting
// a boolean for the options argument to specify whether it should use
// capture or not. In more modern browsers, this is passed via the `capture`
// option, so let's just hoist that value up.
return !!eventOptions.capture;
}
return eventOptions;
}
/* eslint-disable no-bitwise */
/**
* Generate a unique key for any set of event options
*/
function eventOptionsKey(normalizedEventOptions) {
if (!normalizedEventOptions) {
return 0;
} // If the browser does not support passive event listeners, the normalized
// event options will be a boolean.
if (normalizedEventOptions === true) {
return 100;
} // At this point, the browser supports passive event listeners, so we expect
// the event options to be an object with possible properties of capture,
// passive, and once.
//
// We want to consistently return the same value, regardless of the order of
// these properties, so let's use binary maths to assign each property to a
// bit, and then add those together (with an offset to account for the
// booleans at the beginning of this function).
var capture = normalizedEventOptions.capture << 0;
var passive = normalizedEventOptions.passive << 1;
var once = normalizedEventOptions.once << 2;
return capture + passive + once;
}
function ensureCanMutateNextEventHandlers(eventHandlers) {
if (eventHandlers.handlers === eventHandlers.nextHandlers) {
// eslint-disable-next-line no-param-reassign
eventHandlers.nextHandlers = eventHandlers.handlers.slice();
}
}
function TargetEventHandlers(target) {
this.target = target;
this.events = {};
}
TargetEventHandlers.prototype.getEventHandlers = function () {
function getEventHandlers(eventName, options) {
var key = String(eventName) + ' ' + String(eventOptionsKey(options));
if (!this.events[key]) {
this.events[key] = {
handlers: [],
handleEvent: undefined
};
this.events[key].nextHandlers = this.events[key].handlers;
}
return this.events[key];
}
return getEventHandlers;
}();
TargetEventHandlers.prototype.handleEvent = function () {
function handleEvent(eventName, options, event) {
var eventHandlers = this.getEventHandlers(eventName, options);
eventHandlers.handlers = eventHandlers.nextHandlers;
eventHandlers.handlers.forEach(function (handler) {
if (handler) {
// We need to check for presence here because a handler function may
// cause later handlers to get removed. This can happen if you for
// instance have a waypoint that unmounts another waypoint as part of an
// onEnter/onLeave handler.
handler(event);
}
});
}
return handleEvent;
}();
TargetEventHandlers.prototype.add = function () {
function add(eventName, listener, options) {
var _this = this; // options has already been normalized at this point.
var eventHandlers = this.getEventHandlers(eventName, options);
ensureCanMutateNextEventHandlers(eventHandlers);
if (eventHandlers.nextHandlers.length === 0) {
eventHandlers.handleEvent = this.handleEvent.bind(this, eventName, options);
this.target.addEventListener(eventName, eventHandlers.handleEvent, options);
}
eventHandlers.nextHandlers.push(listener);
var isSubscribed = true;
var unsubscribe = function () {
function unsubscribe() {
if (!isSubscribed) {
return;
}
isSubscribed = false;
ensureCanMutateNextEventHandlers(eventHandlers);
var index = eventHandlers.nextHandlers.indexOf(listener);
eventHandlers.nextHandlers.splice(index, 1);
if (eventHandlers.nextHandlers.length === 0) {
// All event handlers have been removed, so we want to remove the event
// listener from the target node.
if (_this.target) {
// There can be a race condition where the target may no longer exist
// when this function is called, e.g. when a React component is
// unmounting. Guarding against this prevents the following error:
//
// Cannot read property 'removeEventListener' of undefined
_this.target.removeEventListener(eventName, eventHandlers.handleEvent, options);
}
eventHandlers.handleEvent = undefined;
}
}
return unsubscribe;
}();
return unsubscribe;
}
return add;
}();
var EVENT_HANDLERS_KEY = '__consolidated_events_handlers__'; // eslint-disable-next-line import/prefer-default-export
function addEventListener(target, eventName, listener, options) {
if (!target[EVENT_HANDLERS_KEY]) {
// eslint-disable-next-line no-param-reassign
target[EVENT_HANDLERS_KEY] = new TargetEventHandlers(target);
}
var normalizedEventOptions = normalizeEventOptions(options);
return target[EVENT_HANDLERS_KEY].add(eventName, listener, normalizedEventOptions);
}
/***/ }),
/***/ "./node_modules/define-properties/index.js":
/*!*************************************************!*\
!*** ./node_modules/define-properties/index.js ***!
\*************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var keys = __webpack_require__(/*! object-keys */ "./node_modules/object-keys/index.js");
var hasSymbols = typeof Symbol === 'function' && typeof Symbol('foo') === 'symbol';
var toStr = Object.prototype.toString;
var concat = Array.prototype.concat;
var origDefineProperty = Object.defineProperty;
var isFunction = function (fn) {
return typeof fn === 'function' && toStr.call(fn) === '[object Function]';
};
var arePropertyDescriptorsSupported = function () {
var obj = {};
try {
origDefineProperty(obj, 'x', {
enumerable: false,
value: obj
}); // eslint-disable-next-line no-unused-vars, no-restricted-syntax
for (var _ in obj) {
// jscs:ignore disallowUnusedVariables
return false;
}
return obj.x === obj;
} catch (e) {
/* this is IE 8. */
return false;
}
};
var supportsDescriptors = origDefineProperty && arePropertyDescriptorsSupported();
var defineProperty = function (object, name, value, predicate) {
if (name in object && (!isFunction(predicate) || !predicate())) {
return;
}
if (supportsDescriptors) {
origDefineProperty(object, name, {
configurable: true,
enumerable: false,
value: value,
writable: true
});
} else {
object[name] = value;
}
};
var defineProperties = function (object, map) {
var predicates = arguments.length > 2 ? arguments[2] : {};
var props = keys(map);
if (hasSymbols) {
props = concat.call(props, Object.getOwnPropertySymbols(map));
}
for (var i = 0; i < props.length; i += 1) {
defineProperty(object, props[i], map[props[i]], predicates[props[i]]);
}
};
defineProperties.supportsDescriptors = !!supportsDescriptors;
module.exports = defineProperties;
/***/ }),
/***/ "./node_modules/document.contains/implementation.js":
/*!**********************************************************!*\
!*** ./node_modules/document.contains/implementation.js ***!
\**********************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
module.exports = function contains(other) {
if (arguments.length < 1) {
throw new TypeError('1 argument is required');
}
if (typeof other !== 'object') {
throw new TypeError('Argument 1 (”other“) to Node.contains must be an instance of Node');
}
var node = other;
do {
if (this === node) {
return true;
}
if (node) {
node = node.parentNode;
}
} while (node);
return false;
};
/***/ }),
/***/ "./node_modules/document.contains/index.js":
/*!*************************************************!*\
!*** ./node_modules/document.contains/index.js ***!
\*************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var define = __webpack_require__(/*! define-properties */ "./node_modules/define-properties/index.js");
var implementation = __webpack_require__(/*! ./implementation */ "./node_modules/document.contains/implementation.js");
var getPolyfill = __webpack_require__(/*! ./polyfill */ "./node_modules/document.contains/polyfill.js");
var polyfill = getPolyfill();
var shim = __webpack_require__(/*! ./shim */ "./node_modules/document.contains/shim.js");
var boundContains = function contains(node, other) {
return polyfill.apply(node, [other]);
};
define(boundContains, {
getPolyfill: getPolyfill,
implementation: implementation,
shim: shim
});
module.exports = boundContains;
/***/ }),
/***/ "./node_modules/document.contains/polyfill.js":
/*!****************************************************!*\
!*** ./node_modules/document.contains/polyfill.js ***!
\****************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var implementation = __webpack_require__(/*! ./implementation */ "./node_modules/document.contains/implementation.js");
module.exports = function getPolyfill() {
if (typeof document !== 'undefined') {
if (document.contains) {
return document.contains;
}
if (document.body && document.body.contains) {
return document.body.contains;
}
}
return implementation;
};
/***/ }),
/***/ "./node_modules/document.contains/shim.js":
/*!************************************************!*\
!*** ./node_modules/document.contains/shim.js ***!
\************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var define = __webpack_require__(/*! define-properties */ "./node_modules/define-properties/index.js");
var getPolyfill = __webpack_require__(/*! ./polyfill */ "./node_modules/document.contains/polyfill.js");
module.exports = function shimContains() {
var polyfill = getPolyfill();
if (typeof document !== 'undefined') {
define(document, {
contains: polyfill
}, {
contains: function () {
return document.contains !== polyfill;
}
});
if (typeof Element !== 'undefined') {
define(Element.prototype, {
contains: polyfill
}, {
contains: function () {
return Element.prototype.contains !== polyfill;
}
});
}
}
return polyfill;
};
/***/ }),
/***/ "./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/equivalent-key-map/equivalent-key-map.js":
/*!***************************************************************!*\
!*** ./node_modules/equivalent-key-map/equivalent-key-map.js ***!
\***************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
function _typeof(obj) {
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
_typeof = function (obj) {
return typeof obj;
};
} else {
_typeof = function (obj) {
return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
};
}
return _typeof(obj);
}
function _classCallCheck(instance, Constructor) {
if (!(instance instanceof Constructor)) {
throw new TypeError("Cannot call a class as a 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);
}
}
function _createClass(Constructor, protoProps, staticProps) {
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
if (staticProps) _defineProperties(Constructor, staticProps);
return Constructor;
}
/**
* Given an instance of EquivalentKeyMap, returns its internal value pair tuple
* for a key, if one exists. The tuple members consist of the last reference
* value for the key (used in efficient subsequent lookups) and the value
* assigned for the key at the leaf node.
*
* @param {EquivalentKeyMap} instance EquivalentKeyMap instance.
* @param {*} key The key for which to return value pair.
*
* @return {?Array} Value pair, if exists.
*/
function getValuePair(instance, key) {
var _map = instance._map,
_arrayTreeMap = instance._arrayTreeMap,
_objectTreeMap = instance._objectTreeMap; // Map keeps a reference to the last object-like key used to set the
// value, which can be used to shortcut immediately to the value.
if (_map.has(key)) {
return _map.get(key);
} // Sort keys to ensure stable retrieval from tree.
var properties = Object.keys(key).sort(); // Tree by type to avoid conflicts on numeric object keys, empty value.
var map = Array.isArray(key) ? _arrayTreeMap : _objectTreeMap;
for (var i = 0; i < properties.length; i++) {
var property = properties[i];
map = map.get(property);
if (map === undefined) {
return;
}
var propertyValue = key[property];
map = map.get(propertyValue);
if (map === undefined) {
return;
}
}
var valuePair = map.get('_ekm_value');
if (!valuePair) {
return;
} // If reached, it implies that an object-like key was set with another
// reference, so delete the reference and replace with the current.
_map.delete(valuePair[0]);
valuePair[0] = key;
map.set('_ekm_value', valuePair);
_map.set(key, valuePair);
return valuePair;
}
/**
* Variant of a Map object which enables lookup by equivalent (deeply equal)
* object and array keys.
*/
var EquivalentKeyMap =
/*#__PURE__*/
function () {
/**
* Constructs a new instance of EquivalentKeyMap.
*
* @param {Iterable.<*>} iterable Initial pair of key, value for map.
*/
function EquivalentKeyMap(iterable) {
_classCallCheck(this, EquivalentKeyMap);
this.clear();
if (iterable instanceof EquivalentKeyMap) {
// Map#forEach is only means of iterating with support for IE11.
var iterablePairs = [];
iterable.forEach(function (value, key) {
iterablePairs.push([key, value]);
});
iterable = iterablePairs;
}
if (iterable != null) {
for (var i = 0; i < iterable.length; i++) {
this.set(iterable[i][0], iterable[i][1]);
}
}
}
/**
* Accessor property returning the number of elements.
*
* @return {number} Number of elements.
*/
_createClass(EquivalentKeyMap, [{
key: "set",
/**
* Add or update an element with a specified key and value.
*
* @param {*} key The key of the element to add.
* @param {*} value The value of the element to add.
*
* @return {EquivalentKeyMap} Map instance.
*/
value: function set(key, value) {
// Shortcut non-object-like to set on internal Map.
if (key === null || _typeof(key) !== 'object') {
this._map.set(key, value);
return this;
} // Sort keys to ensure stable assignment into tree.
var properties = Object.keys(key).sort();
var valuePair = [key, value]; // Tree by type to avoid conflicts on numeric object keys, empty value.
var map = Array.isArray(key) ? this._arrayTreeMap : this._objectTreeMap;
for (var i = 0; i < properties.length; i++) {
var property = properties[i];
if (!map.has(property)) {
map.set(property, new EquivalentKeyMap());
}
map = map.get(property);
var propertyValue = key[property];
if (!map.has(propertyValue)) {
map.set(propertyValue, new EquivalentKeyMap());
}
map = map.get(propertyValue);
} // If an _ekm_value exists, there was already an equivalent key. Before
// overriding, ensure that the old key reference is removed from map to
// avoid memory leak of accumulating equivalent keys. This is, in a
// sense, a poor man's WeakMap, while still enabling iterability.
var previousValuePair = map.get('_ekm_value');
if (previousValuePair) {
this._map.delete(previousValuePair[0]);
}
map.set('_ekm_value', valuePair);
this._map.set(key, valuePair);
return this;
}
/**
* Returns a specified element.
*
* @param {*} key The key of the element to return.
*
* @return {?*} The element associated with the specified key or undefined
* if the key can't be found.
*/
}, {
key: "get",
value: function get(key) {
// Shortcut non-object-like to get from internal Map.
if (key === null || _typeof(key) !== 'object') {
return this._map.get(key);
}
var valuePair = getValuePair(this, key);
if (valuePair) {
return valuePair[1];
}
}
/**
* Returns a boolean indicating whether an element with the specified key
* exists or not.
*
* @param {*} key The key of the element to test for presence.
*
* @return {boolean} Whether an element with the specified key exists.
*/
}, {
key: "has",
value: function has(key) {
if (key === null || _typeof(key) !== 'object') {
return this._map.has(key);
} // Test on the _presence_ of the pair, not its value, as even undefined
// can be a valid member value for a key.
return getValuePair(this, key) !== undefined;
}
/**
* Removes the specified element.
*
* @param {*} key The key of the element to remove.
*
* @return {boolean} Returns true if an element existed and has been
* removed, or false if the element does not exist.
*/
}, {
key: "delete",
value: function _delete(key) {
if (!this.has(key)) {
return false;
} // This naive implementation will leave orphaned child trees. A better
// implementation should traverse and remove orphans.
this.set(key, undefined);
return true;
}
/**
* Executes a provided function once per each key/value pair, in insertion
* order.
*
* @param {Function} callback Function to execute for each element.
* @param {*} thisArg Value to use as `this` when executing
* `callback`.
*/
}, {
key: "forEach",
value: function forEach(callback) {
var _this = this;
var thisArg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this;
this._map.forEach(function (value, key) {
// Unwrap value from object-like value pair.
if (key !== null && _typeof(key) === 'object') {
value = value[1];
}
callback.call(thisArg, value, key, _this);
});
}
/**
* Removes all elements.
*/
}, {
key: "clear",
value: function clear() {
this._map = new Map();
this._arrayTreeMap = new Map();
this._objectTreeMap = new Map();
}
}, {
key: "size",
get: function get() {
return this._map.size;
}
}]);
return EquivalentKeyMap;
}();
module.exports = EquivalentKeyMap;
/***/ }),
/***/ "./node_modules/es-abstract/GetIntrinsic.js":
/*!**************************************************!*\
!*** ./node_modules/es-abstract/GetIntrinsic.js ***!
\**************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/* globals
Atomics,
SharedArrayBuffer,
*/
var undefined; // eslint-disable-line no-shadow-restricted-names
var ThrowTypeError = Object.getOwnPropertyDescriptor ? function () {
return Object.getOwnPropertyDescriptor(arguments, 'callee').get;
}() : function () {
throw new TypeError();
};
var hasSymbols = typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol';
var getProto = Object.getPrototypeOf || function (x) {
return x.__proto__;
}; // eslint-disable-line no-proto
var generator; // = function * () {};
var generatorFunction = generator ? getProto(generator) : undefined;
var asyncFn; // async function() {};
var asyncFunction = asyncFn ? asyncFn.constructor : undefined;
var asyncGen; // async function * () {};
var asyncGenFunction = asyncGen ? getProto(asyncGen) : undefined;
var asyncGenIterator = asyncGen ? asyncGen() : undefined;
var TypedArray = typeof Uint8Array === 'undefined' ? undefined : getProto(Uint8Array);
var INTRINSICS = {
'$ %Array%': Array,
'$ %ArrayBuffer%': typeof ArrayBuffer === 'undefined' ? undefined : ArrayBuffer,
'$ %ArrayBufferPrototype%': typeof ArrayBuffer === 'undefined' ? undefined : ArrayBuffer.prototype,
'$ %ArrayIteratorPrototype%': hasSymbols ? getProto([][Symbol.iterator]()) : undefined,
'$ %ArrayPrototype%': Array.prototype,
'$ %ArrayProto_entries%': Array.prototype.entries,
'$ %ArrayProto_forEach%': Array.prototype.forEach,
'$ %ArrayProto_keys%': Array.prototype.keys,
'$ %ArrayProto_values%': Array.prototype.values,
'$ %AsyncFromSyncIteratorPrototype%': undefined,
'$ %AsyncFunction%': asyncFunction,
'$ %AsyncFunctionPrototype%': asyncFunction ? asyncFunction.prototype : undefined,
'$ %AsyncGenerator%': asyncGen ? getProto(asyncGenIterator) : undefined,
'$ %AsyncGeneratorFunction%': asyncGenFunction,
'$ %AsyncGeneratorPrototype%': asyncGenFunction ? asyncGenFunction.prototype : undefined,
'$ %AsyncIteratorPrototype%': asyncGenIterator && hasSymbols && Symbol.asyncIterator ? asyncGenIterator[Symbol.asyncIterator]() : undefined,
'$ %Atomics%': typeof Atomics === 'undefined' ? undefined : Atomics,
'$ %Boolean%': Boolean,
'$ %BooleanPrototype%': Boolean.prototype,
'$ %DataView%': typeof DataView === 'undefined' ? undefined : DataView,
'$ %DataViewPrototype%': typeof DataView === 'undefined' ? undefined : DataView.prototype,
'$ %Date%': Date,
'$ %DatePrototype%': Date.prototype,
'$ %decodeURI%': decodeURI,
'$ %decodeURIComponent%': decodeURIComponent,
'$ %encodeURI%': encodeURI,
'$ %encodeURIComponent%': encodeURIComponent,
'$ %Error%': Error,
'$ %ErrorPrototype%': Error.prototype,
'$ %eval%': eval,
// eslint-disable-line no-eval
'$ %EvalError%': EvalError,
'$ %EvalErrorPrototype%': EvalError.prototype,
'$ %Float32Array%': typeof Float32Array === 'undefined' ? undefined : Float32Array,
'$ %Float32ArrayPrototype%': typeof Float32Array === 'undefined' ? undefined : Float32Array.prototype,
'$ %Float64Array%': typeof Float64Array === 'undefined' ? undefined : Float64Array,
'$ %Float64ArrayPrototype%': typeof Float64Array === 'undefined' ? undefined : Float64Array.prototype,
'$ %Function%': Function,
'$ %FunctionPrototype%': Function.prototype,
'$ %Generator%': generator ? getProto(generator()) : undefined,
'$ %GeneratorFunction%': generatorFunction,
'$ %GeneratorPrototype%': generatorFunction ? generatorFunction.prototype : undefined,
'$ %Int8Array%': typeof Int8Array === 'undefined' ? undefined : Int8Array,
'$ %Int8ArrayPrototype%': typeof Int8Array === 'undefined' ? undefined : Int8Array.prototype,
'$ %Int16Array%': typeof Int16Array === 'undefined' ? undefined : Int16Array,
'$ %Int16ArrayPrototype%': typeof Int16Array === 'undefined' ? undefined : Int8Array.prototype,
'$ %Int32Array%': typeof Int32Array === 'undefined' ? undefined : Int32Array,
'$ %Int32ArrayPrototype%': typeof Int32Array === 'undefined' ? undefined : Int32Array.prototype,
'$ %isFinite%': isFinite,
'$ %isNaN%': isNaN,
'$ %IteratorPrototype%': hasSymbols ? getProto(getProto([][Symbol.iterator]())) : undefined,
'$ %JSON%': JSON,
'$ %JSONParse%': JSON.parse,
'$ %Map%': typeof Map === 'undefined' ? undefined : Map,
'$ %MapIteratorPrototype%': typeof Map === 'undefined' || !hasSymbols ? undefined : getProto(new Map()[Symbol.iterator]()),
'$ %MapPrototype%': typeof Map === 'undefined' ? undefined : Map.prototype,
'$ %Math%': Math,
'$ %Number%': Number,
'$ %NumberPrototype%': Number.prototype,
'$ %Object%': Object,
'$ %ObjectPrototype%': Object.prototype,
'$ %ObjProto_toString%': Object.prototype.toString,
'$ %ObjProto_valueOf%': Object.prototype.valueOf,
'$ %parseFloat%': parseFloat,
'$ %parseInt%': parseInt,
'$ %Promise%': typeof Promise === 'undefined' ? undefined : Promise,
'$ %PromisePrototype%': typeof Promise === 'undefined' ? undefined : Promise.prototype,
'$ %PromiseProto_then%': typeof Promise === 'undefined' ? undefined : Promise.prototype.then,
'$ %Promise_all%': typeof Promise === 'undefined' ? undefined : Promise.all,
'$ %Promise_reject%': typeof Promise === 'undefined' ? undefined : Promise.reject,
'$ %Promise_resolve%': typeof Promise === 'undefined' ? undefined : Promise.resolve,
'$ %Proxy%': typeof Proxy === 'undefined' ? undefined : Proxy,
'$ %RangeError%': RangeError,
'$ %RangeErrorPrototype%': RangeError.prototype,
'$ %ReferenceError%': ReferenceError,
'$ %ReferenceErrorPrototype%': ReferenceError.prototype,
'$ %Reflect%': typeof Reflect === 'undefined' ? undefined : Reflect,
'$ %RegExp%': RegExp,
'$ %RegExpPrototype%': RegExp.prototype,
'$ %Set%': typeof Set === 'undefined' ? undefined : Set,
'$ %SetIteratorPrototype%': typeof Set === 'undefined' || !hasSymbols ? undefined : getProto(new Set()[Symbol.iterator]()),
'$ %SetPrototype%': typeof Set === 'undefined' ? undefined : Set.prototype,
'$ %SharedArrayBuffer%': typeof SharedArrayBuffer === 'undefined' ? undefined : SharedArrayBuffer,
'$ %SharedArrayBufferPrototype%': typeof SharedArrayBuffer === 'undefined' ? undefined : SharedArrayBuffer.prototype,
'$ %String%': String,
'$ %StringIteratorPrototype%': hasSymbols ? getProto(''[Symbol.iterator]()) : undefined,
'$ %StringPrototype%': String.prototype,
'$ %Symbol%': hasSymbols ? Symbol : undefined,
'$ %SymbolPrototype%': hasSymbols ? Symbol.prototype : undefined,
'$ %SyntaxError%': SyntaxError,
'$ %SyntaxErrorPrototype%': SyntaxError.prototype,
'$ %ThrowTypeError%': ThrowTypeError,
'$ %TypedArray%': TypedArray,
'$ %TypedArrayPrototype%': TypedArray ? TypedArray.prototype : undefined,
'$ %TypeError%': TypeError,
'$ %TypeErrorPrototype%': TypeError.prototype,
'$ %Uint8Array%': typeof Uint8Array === 'undefined' ? undefined : Uint8Array,
'$ %Uint8ArrayPrototype%': typeof Uint8Array === 'undefined' ? undefined : Uint8Array.prototype,
'$ %Uint8ClampedArray%': typeof Uint8ClampedArray === 'undefined' ? undefined : Uint8ClampedArray,
'$ %Uint8ClampedArrayPrototype%': typeof Uint8ClampedArray === 'undefined' ? undefined : Uint8ClampedArray.prototype,
'$ %Uint16Array%': typeof Uint16Array === 'undefined' ? undefined : Uint16Array,
'$ %Uint16ArrayPrototype%': typeof Uint16Array === 'undefined' ? undefined : Uint16Array.prototype,
'$ %Uint32Array%': typeof Uint32Array === 'undefined' ? undefined : Uint32Array,
'$ %Uint32ArrayPrototype%': typeof Uint32Array === 'undefined' ? undefined : Uint32Array.prototype,
'$ %URIError%': URIError,
'$ %URIErrorPrototype%': URIError.prototype,
'$ %WeakMap%': typeof WeakMap === 'undefined' ? undefined : WeakMap,
'$ %WeakMapPrototype%': typeof WeakMap === 'undefined' ? undefined : WeakMap.prototype,
'$ %WeakSet%': typeof WeakSet === 'undefined' ? undefined : WeakSet,
'$ %WeakSetPrototype%': typeof WeakSet === 'undefined' ? undefined : WeakSet.prototype
};
module.exports = function GetIntrinsic(name, allowMissing) {
if (arguments.length > 1 && typeof allowMissing !== 'boolean') {
throw new TypeError('"allowMissing" argument must be a boolean');
}
var key = '$ ' + name;
if (!(key in INTRINSICS)) {
throw new SyntaxError('intrinsic ' + name + ' does not exist!');
} // istanbul ignore if // hopefully this is impossible to test :-)
if (typeof INTRINSICS[key] === 'undefined' && !allowMissing) {
throw new TypeError('intrinsic ' + name + ' exists, but is not available. Please file an issue!');
}
return INTRINSICS[key];
};
/***/ }),
/***/ "./node_modules/es-abstract/es2015.js":
/*!********************************************!*\
!*** ./node_modules/es-abstract/es2015.js ***!
\********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var has = __webpack_require__(/*! has */ "./node_modules/has/src/index.js");
var toPrimitive = __webpack_require__(/*! es-to-primitive/es6 */ "./node_modules/es-to-primitive/es6.js");
var keys = __webpack_require__(/*! object-keys */ "./node_modules/object-keys/index.js");
var inspect = __webpack_require__(/*! object-inspect */ "./node_modules/object-inspect/index.js");
var GetIntrinsic = __webpack_require__(/*! ./GetIntrinsic */ "./node_modules/es-abstract/GetIntrinsic.js");
var $TypeError = GetIntrinsic('%TypeError%');
var $RangeError = GetIntrinsic('%RangeError%');
var $SyntaxError = GetIntrinsic('%SyntaxError%');
var $Array = GetIntrinsic('%Array%');
var $ArrayPrototype = $Array.prototype;
var $String = GetIntrinsic('%String%');
var $Object = GetIntrinsic('%Object%');
var $Number = GetIntrinsic('%Number%');
var $Symbol = GetIntrinsic('%Symbol%', true);
var $RegExp = GetIntrinsic('%RegExp%');
var $Promise = GetIntrinsic('%Promise%', true);
var $preventExtensions = $Object.preventExtensions;
var hasSymbols = __webpack_require__(/*! has-symbols */ "./node_modules/has-symbols/index.js")();
var assertRecord = __webpack_require__(/*! ./helpers/assertRecord */ "./node_modules/es-abstract/helpers/assertRecord.js");
var $isNaN = __webpack_require__(/*! ./helpers/isNaN */ "./node_modules/es-abstract/helpers/isNaN.js");
var $isFinite = __webpack_require__(/*! ./helpers/isFinite */ "./node_modules/es-abstract/helpers/isFinite.js");
var MAX_ARRAY_LENGTH = Math.pow(2, 32) - 1;
var MAX_SAFE_INTEGER = $Number.MAX_SAFE_INTEGER || Math.pow(2, 53) - 1;
var assign = __webpack_require__(/*! ./helpers/assign */ "./node_modules/es-abstract/helpers/assign.js");
var sign = __webpack_require__(/*! ./helpers/sign */ "./node_modules/es-abstract/helpers/sign.js");
var mod = __webpack_require__(/*! ./helpers/mod */ "./node_modules/es-abstract/helpers/mod.js");
var isPrimitive = __webpack_require__(/*! ./helpers/isPrimitive */ "./node_modules/es-abstract/helpers/isPrimitive.js");
var forEach = __webpack_require__(/*! ./helpers/forEach */ "./node_modules/es-abstract/helpers/forEach.js");
var every = __webpack_require__(/*! ./helpers/every */ "./node_modules/es-abstract/helpers/every.js");
var isSamePropertyDescriptor = __webpack_require__(/*! ./helpers/isSamePropertyDescriptor */ "./node_modules/es-abstract/helpers/isSamePropertyDescriptor.js");
var isPropertyDescriptor = __webpack_require__(/*! ./helpers/isPropertyDescriptor */ "./node_modules/es-abstract/helpers/isPropertyDescriptor.js");
var parseInteger = parseInt;
var callBind = __webpack_require__(/*! ./helpers/callBind */ "./node_modules/es-abstract/helpers/callBind.js");
var $PromiseThen = $Promise ? callBind(GetIntrinsic('%PromiseProto_then%')) : null;
var arraySlice = callBind($Array.prototype.slice);
var strSlice = callBind($String.prototype.slice);
var isBinary = callBind($RegExp.prototype.test, /^0b[01]+$/i);
var isOctal = callBind($RegExp.prototype.test, /^0o[0-7]+$/i);
var isDigit = callBind($RegExp.prototype.test, /^[0-9]$/);
var regexExec = callBind($RegExp.prototype.exec);
var nonWS = ['\u0085', '\u200b', '\ufffe'].join('');
var nonWSregex = new $RegExp('[' + nonWS + ']', 'g');
var hasNonWS = callBind($RegExp.prototype.test, nonWSregex);
var invalidHexLiteral = /^[-+]0x[0-9a-f]+$/i;
var isInvalidHexLiteral = callBind($RegExp.prototype.test, invalidHexLiteral);
var $charCodeAt = callBind($String.prototype.charCodeAt);
var $isEnumerable = callBind($Object.prototype.propertyIsEnumerable);
var toStr = callBind($Object.prototype.toString);
var $NumberValueOf = callBind(GetIntrinsic('%NumberPrototype%').valueOf);
var $BooleanValueOf = callBind(GetIntrinsic('%BooleanPrototype%').valueOf);
var $StringValueOf = callBind(GetIntrinsic('%StringPrototype%').valueOf);
var $DateValueOf = callBind(GetIntrinsic('%DatePrototype%').valueOf);
var $SymbolToString = hasSymbols && callBind(GetIntrinsic('%SymbolPrototype%').toString);
var $floor = Math.floor;
var $abs = Math.abs;
var $ObjectCreate = $Object.create;
var $gOPD = $Object.getOwnPropertyDescriptor;
var $gOPN = $Object.getOwnPropertyNames;
var $gOPS = $Object.getOwnPropertySymbols;
var $isExtensible = $Object.isExtensible;
var $defineProperty = $Object.defineProperty;
var $setProto = Object.setPrototypeOf || ( // eslint-disable-next-line no-proto, no-negated-condition
[].__proto__ !== Array.prototype ? null : function (O, proto) {
O.__proto__ = proto; // eslint-disable-line no-proto
return O;
});
var DefineOwnProperty = function DefineOwnProperty(ES, O, P, desc) {
if (!$defineProperty) {
if (!ES.IsDataDescriptor(desc)) {
// ES3 does not support getters/setters
return false;
}
if (!desc['[[Configurable]]'] || !desc['[[Writable]]']) {
return false;
} // fallback for ES3
if (P in O && $isEnumerable(O, P) !== !!desc['[[Enumerable]]']) {
// a non-enumerable existing property
return false;
} // property does not exist at all, or exists but is enumerable
var V = desc['[[Value]]'];
O[P] = V; // will use [[Define]]
return ES.SameValue(O[P], V);
}
$defineProperty(O, P, ES.FromPropertyDescriptor(desc));
return true;
}; // whitespace from: https://es5.github.io/#x15.5.4.20
// implementation from https://github.com/es-shims/es5-shim/blob/v3.4.0/es5-shim.js#L1304-L1324
var ws = ['\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003', '\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028', '\u2029\uFEFF'].join('');
var trimRegex = new RegExp('(^[' + ws + ']+)|([' + ws + ']+$)', 'g');
var $replace = callBind($String.prototype.replace);
var trim = function (value) {
return $replace(value, trimRegex, '');
};
var ES5 = __webpack_require__(/*! ./es5 */ "./node_modules/es-abstract/es5.js");
var hasRegExpMatcher = __webpack_require__(/*! is-regex */ "./node_modules/is-regex/index.js"); // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-abstract-operations
var ES6 = assign(assign({}, ES5), {
// https://people.mozilla.org/~jorendorff/es6-draft.html#sec-call-f-v-args
Call: function Call(F, V) {
var args = arguments.length > 2 ? arguments[2] : [];
if (!this.IsCallable(F)) {
throw new $TypeError(inspect(F) + ' is not a function');
}
return F.apply(V, args);
},
// https://people.mozilla.org/~jorendorff/es6-draft.html#sec-toprimitive
ToPrimitive: toPrimitive,
// https://people.mozilla.org/~jorendorff/es6-draft.html#sec-toboolean
// ToBoolean: ES5.ToBoolean,
// https://ecma-international.org/ecma-262/6.0/#sec-tonumber
ToNumber: function ToNumber(argument) {
var value = isPrimitive(argument) ? argument : toPrimitive(argument, $Number);
if (typeof value === 'symbol') {
throw new $TypeError('Cannot convert a Symbol value to a number');
}
if (typeof value === 'string') {
if (isBinary(value)) {
return this.ToNumber(parseInteger(strSlice(value, 2), 2));
} else if (isOctal(value)) {
return this.ToNumber(parseInteger(strSlice(value, 2), 8));
} else if (hasNonWS(value) || isInvalidHexLiteral(value)) {
return NaN;
} else {
var trimmed = trim(value);
if (trimmed !== value) {
return this.ToNumber(trimmed);
}
}
}
return $Number(value);
},
// https://people.mozilla.org/~jorendorff/es6-draft.html#sec-tointeger
// ToInteger: ES5.ToNumber,
// https://people.mozilla.org/~jorendorff/es6-draft.html#sec-toint32
// ToInt32: ES5.ToInt32,
// https://people.mozilla.org/~jorendorff/es6-draft.html#sec-touint32
// ToUint32: ES5.ToUint32,
// https://people.mozilla.org/~jorendorff/es6-draft.html#sec-toint16
ToInt16: function ToInt16(argument) {
var int16bit = this.ToUint16(argument);
return int16bit >= 0x8000 ? int16bit - 0x10000 : int16bit;
},
// https://people.mozilla.org/~jorendorff/es6-draft.html#sec-touint16
// ToUint16: ES5.ToUint16,
// https://people.mozilla.org/~jorendorff/es6-draft.html#sec-toint8
ToInt8: function ToInt8(argument) {
var int8bit = this.ToUint8(argument);
return int8bit >= 0x80 ? int8bit - 0x100 : int8bit;
},
// https://people.mozilla.org/~jorendorff/es6-draft.html#sec-touint8
ToUint8: function ToUint8(argument) {
var number = this.ToNumber(argument);
if ($isNaN(number) || number === 0 || !$isFinite(number)) {
return 0;
}
var posInt = sign(number) * $floor($abs(number));
return mod(posInt, 0x100);
},
// https://people.mozilla.org/~jorendorff/es6-draft.html#sec-touint8clamp
ToUint8Clamp: function ToUint8Clamp(argument) {
var number = this.ToNumber(argument);
if ($isNaN(number) || number <= 0) {
return 0;
}
if (number >= 0xFF) {
return 0xFF;
}
var f = $floor(argument);
if (f + 0.5 < number) {
return f + 1;
}
if (number < f + 0.5) {
return f;
}
if (f % 2 !== 0) {
return f + 1;
}
return f;
},
// https://people.mozilla.org/~jorendorff/es6-draft.html#sec-tostring
ToString: function ToString(argument) {
if (typeof argument === 'symbol') {
throw new $TypeError('Cannot convert a Symbol value to a string');
}
return $String(argument);
},
// https://people.mozilla.org/~jorendorff/es6-draft.html#sec-toobject
ToObject: function ToObject(value) {
this.RequireObjectCoercible(value);
return $Object(value);
},
// https://people.mozilla.org/~jorendorff/es6-draft.html#sec-topropertykey
ToPropertyKey: function ToPropertyKey(argument) {
var key = this.ToPrimitive(argument, $String);
return typeof key === 'symbol' ? key : this.ToString(key);
},
// https://people.mozilla.org/~jorendorff/es6-draft.html#sec-tolength
ToLength: function ToLength(argument) {
var len = this.ToInteger(argument);
if (len <= 0) {
return 0;
} // includes converting -0 to +0
if (len > MAX_SAFE_INTEGER) {
return MAX_SAFE_INTEGER;
}
return len;
},
// https://ecma-international.org/ecma-262/6.0/#sec-canonicalnumericindexstring
CanonicalNumericIndexString: function CanonicalNumericIndexString(argument) {
if (toStr(argument) !== '[object String]') {
throw new $TypeError('must be a string');
}
if (argument === '-0') {
return -0;
}
var n = this.ToNumber(argument);
if (this.SameValue(this.ToString(n), argument)) {
return n;
}
return void 0;
},
// https://people.mozilla.org/~jorendorff/es6-draft.html#sec-requireobjectcoercible
RequireObjectCoercible: ES5.CheckObjectCoercible,
// https://people.mozilla.org/~jorendorff/es6-draft.html#sec-isarray
IsArray: $Array.isArray || function IsArray(argument) {
return toStr(argument) === '[object Array]';
},
// https://people.mozilla.org/~jorendorff/es6-draft.html#sec-iscallable
// IsCallable: ES5.IsCallable,
// https://people.mozilla.org/~jorendorff/es6-draft.html#sec-isconstructor
IsConstructor: function IsConstructor(argument) {
return typeof argument === 'function' && !!argument.prototype; // unfortunately there's no way to truly check this without try/catch `new argument`
},
// https://people.mozilla.org/~jorendorff/es6-draft.html#sec-isextensible-o
IsExtensible: $preventExtensions ? function IsExtensible(obj) {
if (isPrimitive(obj)) {
return false;
}
return $isExtensible(obj);
} : function isExtensible(obj) {
return true;
},
// eslint-disable-line no-unused-vars
// https://people.mozilla.org/~jorendorff/es6-draft.html#sec-isinteger
IsInteger: function IsInteger(argument) {
if (typeof argument !== 'number' || $isNaN(argument) || !$isFinite(argument)) {
return false;
}
var abs = $abs(argument);
return $floor(abs) === abs;
},
// https://people.mozilla.org/~jorendorff/es6-draft.html#sec-ispropertykey
IsPropertyKey: function IsPropertyKey(argument) {
return typeof argument === 'string' || typeof argument === 'symbol';
},
// https://ecma-international.org/ecma-262/6.0/#sec-isregexp
IsRegExp: function IsRegExp(argument) {
if (!argument || typeof argument !== 'object') {
return false;
}
if (hasSymbols) {
var isRegExp = argument[$Symbol.match];
if (typeof isRegExp !== 'undefined') {
return ES5.ToBoolean(isRegExp);
}
}
return hasRegExpMatcher(argument);
},
// https://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevalue
// SameValue: ES5.SameValue,
// https://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevaluezero
SameValueZero: function SameValueZero(x, y) {
return x === y || $isNaN(x) && $isNaN(y);
},
/**
* 7.3.2 GetV (V, P)
* 1. Assert: IsPropertyKey(P) is true.
* 2. Let O be ToObject(V).
* 3. ReturnIfAbrupt(O).
* 4. Return O.[[Get]](P, V).
*/
GetV: function GetV(V, P) {
// 7.3.2.1
if (!this.IsPropertyKey(P)) {
throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true');
} // 7.3.2.2-3
var O = this.ToObject(V); // 7.3.2.4
return O[P];
},
/**
* 7.3.9 - https://ecma-international.org/ecma-262/6.0/#sec-getmethod
* 1. Assert: IsPropertyKey(P) is true.
* 2. Let func be GetV(O, P).
* 3. ReturnIfAbrupt(func).
* 4. If func is either undefined or null, return undefined.
* 5. If IsCallable(func) is false, throw a TypeError exception.
* 6. Return func.
*/
GetMethod: function GetMethod(O, P) {
// 7.3.9.1
if (!this.IsPropertyKey(P)) {
throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true');
} // 7.3.9.2
var func = this.GetV(O, P); // 7.3.9.4
if (func == null) {
return void 0;
} // 7.3.9.5
if (!this.IsCallable(func)) {
throw new $TypeError(P + 'is not a function');
} // 7.3.9.6
return func;
},
/**
* 7.3.1 Get (O, P) - https://ecma-international.org/ecma-262/6.0/#sec-get-o-p
* 1. Assert: Type(O) is Object.
* 2. Assert: IsPropertyKey(P) is true.
* 3. Return O.[[Get]](P, O).
*/
Get: function Get(O, P) {
// 7.3.1.1
if (this.Type(O) !== 'Object') {
throw new $TypeError('Assertion failed: Type(O) is not Object');
} // 7.3.1.2
if (!this.IsPropertyKey(P)) {
throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true, got ' + inspect(P));
} // 7.3.1.3
return O[P];
},
Type: function Type(x) {
if (typeof x === 'symbol') {
return 'Symbol';
}
return ES5.Type(x);
},
// https://ecma-international.org/ecma-262/6.0/#sec-speciesconstructor
SpeciesConstructor: function SpeciesConstructor(O, defaultConstructor) {
if (this.Type(O) !== 'Object') {
throw new $TypeError('Assertion failed: Type(O) is not Object');
}
var C = O.constructor;
if (typeof C === 'undefined') {
return defaultConstructor;
}
if (this.Type(C) !== 'Object') {
throw new $TypeError('O.constructor is not an Object');
}
var S = hasSymbols && $Symbol.species ? C[$Symbol.species] : void 0;
if (S == null) {
return defaultConstructor;
}
if (this.IsConstructor(S)) {
return S;
}
throw new $TypeError('no constructor found');
},
// https://www.ecma-international.org/ecma-262/6.0/#sec-frompropertydescriptor
FromPropertyDescriptor: function FromPropertyDescriptor(Desc) {
if (typeof Desc === 'undefined') {
return Desc;
}
assertRecord(this, 'Property Descriptor', 'Desc', Desc);
var obj = {};
if ('[[Value]]' in Desc) {
obj.value = Desc['[[Value]]'];
}
if ('[[Writable]]' in Desc) {
obj.writable = Desc['[[Writable]]'];
}
if ('[[Get]]' in Desc) {
obj.get = Desc['[[Get]]'];
}
if ('[[Set]]' in Desc) {
obj.set = Desc['[[Set]]'];
}
if ('[[Enumerable]]' in Desc) {
obj.enumerable = Desc['[[Enumerable]]'];
}
if ('[[Configurable]]' in Desc) {
obj.configurable = Desc['[[Configurable]]'];
}
return obj;
},
// https://ecma-international.org/ecma-262/6.0/#sec-completepropertydescriptor
CompletePropertyDescriptor: function CompletePropertyDescriptor(Desc) {
assertRecord(this, 'Property Descriptor', 'Desc', Desc);
if (this.IsGenericDescriptor(Desc) || this.IsDataDescriptor(Desc)) {
if (!has(Desc, '[[Value]]')) {
Desc['[[Value]]'] = void 0;
}
if (!has(Desc, '[[Writable]]')) {
Desc['[[Writable]]'] = false;
}
} else {
if (!has(Desc, '[[Get]]')) {
Desc['[[Get]]'] = void 0;
}
if (!has(Desc, '[[Set]]')) {
Desc['[[Set]]'] = void 0;
}
}
if (!has(Desc, '[[Enumerable]]')) {
Desc['[[Enumerable]]'] = false;
}
if (!has(Desc, '[[Configurable]]')) {
Desc['[[Configurable]]'] = false;
}
return Desc;
},
// https://ecma-international.org/ecma-262/6.0/#sec-set-o-p-v-throw
Set: function Set(O, P, V, Throw) {
if (this.Type(O) !== 'Object') {
throw new $TypeError('O must be an Object');
}
if (!this.IsPropertyKey(P)) {
throw new $TypeError('P must be a Property Key');
}
if (this.Type(Throw) !== 'Boolean') {
throw new $TypeError('Throw must be a Boolean');
}
if (Throw) {
O[P] = V;
return true;
} else {
try {
O[P] = V;
} catch (e) {
return false;
}
}
},
// https://ecma-international.org/ecma-262/6.0/#sec-hasownproperty
HasOwnProperty: function HasOwnProperty(O, P) {
if (this.Type(O) !== 'Object') {
throw new $TypeError('O must be an Object');
}
if (!this.IsPropertyKey(P)) {
throw new $TypeError('P must be a Property Key');
}
return has(O, P);
},
// https://ecma-international.org/ecma-262/6.0/#sec-hasproperty
HasProperty: function HasProperty(O, P) {
if (this.Type(O) !== 'Object') {
throw new $TypeError('O must be an Object');
}
if (!this.IsPropertyKey(P)) {
throw new $TypeError('P must be a Property Key');
}
return P in O;
},
// https://ecma-international.org/ecma-262/6.0/#sec-isconcatspreadable
IsConcatSpreadable: function IsConcatSpreadable(O) {
if (this.Type(O) !== 'Object') {
return false;
}
if (hasSymbols && typeof $Symbol.isConcatSpreadable === 'symbol') {
var spreadable = this.Get(O, Symbol.isConcatSpreadable);
if (typeof spreadable !== 'undefined') {
return this.ToBoolean(spreadable);
}
}
return this.IsArray(O);
},
// https://ecma-international.org/ecma-262/6.0/#sec-invoke
Invoke: function Invoke(O, P) {
if (!this.IsPropertyKey(P)) {
throw new $TypeError('P must be a Property Key');
}
var argumentsList = arraySlice(arguments, 2);
var func = this.GetV(O, P);
return this.Call(func, O, argumentsList);
},
// https://ecma-international.org/ecma-262/6.0/#sec-getiterator
GetIterator: function GetIterator(obj, method) {
var actualMethod = method;
if (arguments.length < 2) {
if (!hasSymbols) {
throw new SyntaxError('GetIterator depends on native Symbol support when `method` is not passed');
}
actualMethod = this.GetMethod(obj, $Symbol.iterator);
}
var iterator = this.Call(actualMethod, obj);
if (this.Type(iterator) !== 'Object') {
throw new $TypeError('iterator must return an object');
}
return iterator;
},
// https://ecma-international.org/ecma-262/6.0/#sec-iteratornext
IteratorNext: function IteratorNext(iterator, value) {
var result = this.Invoke(iterator, 'next', arguments.length < 2 ? [] : [value]);
if (this.Type(result) !== 'Object') {
throw new $TypeError('iterator next must return an object');
}
return result;
},
// https://ecma-international.org/ecma-262/6.0/#sec-iteratorcomplete
IteratorComplete: function IteratorComplete(iterResult) {
if (this.Type(iterResult) !== 'Object') {
throw new $TypeError('Assertion failed: Type(iterResult) is not Object');
}
return this.ToBoolean(this.Get(iterResult, 'done'));
},
// https://ecma-international.org/ecma-262/6.0/#sec-iteratorvalue
IteratorValue: function IteratorValue(iterResult) {
if (this.Type(iterResult) !== 'Object') {
throw new $TypeError('Assertion failed: Type(iterResult) is not Object');
}
return this.Get(iterResult, 'value');
},
// https://ecma-international.org/ecma-262/6.0/#sec-iteratorstep
IteratorStep: function IteratorStep(iterator) {
var result = this.IteratorNext(iterator);
var done = this.IteratorComplete(result);
return done === true ? false : result;
},
// https://ecma-international.org/ecma-262/6.0/#sec-iteratorclose
IteratorClose: function IteratorClose(iterator, completion) {
if (this.Type(iterator) !== 'Object') {
throw new $TypeError('Assertion failed: Type(iterator) is not Object');
}
if (!this.IsCallable(completion)) {
throw new $TypeError('Assertion failed: completion is not a thunk for a Completion Record');
}
var completionThunk = completion;
var iteratorReturn = this.GetMethod(iterator, 'return');
if (typeof iteratorReturn === 'undefined') {
return completionThunk();
}
var completionRecord;
try {
var innerResult = this.Call(iteratorReturn, iterator, []);
} catch (e) {
// if we hit here, then "e" is the innerResult completion that needs re-throwing
// if the completion is of type "throw", this will throw.
completionRecord = completionThunk();
completionThunk = null; // ensure it's not called twice.
// if not, then return the innerResult completion
throw e;
}
completionRecord = completionThunk(); // if innerResult worked, then throw if the completion does
completionThunk = null; // ensure it's not called twice.
if (this.Type(innerResult) !== 'Object') {
throw new $TypeError('iterator .return must return an object');
}
return completionRecord;
},
// https://ecma-international.org/ecma-262/6.0/#sec-createiterresultobject
CreateIterResultObject: function CreateIterResultObject(value, done) {
if (this.Type(done) !== 'Boolean') {
throw new $TypeError('Assertion failed: Type(done) is not Boolean');
}
return {
value: value,
done: done
};
},
// https://ecma-international.org/ecma-262/6.0/#sec-regexpexec
RegExpExec: function RegExpExec(R, S) {
if (this.Type(R) !== 'Object') {
throw new $TypeError('R must be an Object');
}
if (this.Type(S) !== 'String') {
throw new $TypeError('S must be a String');
}
var exec = this.Get(R, 'exec');
if (this.IsCallable(exec)) {
var result = this.Call(exec, R, [S]);
if (result === null || this.Type(result) === 'Object') {
return result;
}
throw new $TypeError('"exec" method must return `null` or an Object');
}
return regexExec(R, S);
},
// https://ecma-international.org/ecma-262/6.0/#sec-arrayspeciescreate
ArraySpeciesCreate: function ArraySpeciesCreate(originalArray, length) {
if (!this.IsInteger(length) || length < 0) {
throw new $TypeError('Assertion failed: length must be an integer >= 0');
}
var len = length === 0 ? 0 : length;
var C;
var isArray = this.IsArray(originalArray);
if (isArray) {
C = this.Get(originalArray, 'constructor'); // TODO: figure out how to make a cross-realm normal Array, a same-realm Array
// if (this.IsConstructor(C)) {
// if C is another realm's Array, C = undefined
// Object.getPrototypeOf(Object.getPrototypeOf(Object.getPrototypeOf(Array))) === null ?
// }
if (this.Type(C) === 'Object' && hasSymbols && $Symbol.species) {
C = this.Get(C, $Symbol.species);
if (C === null) {
C = void 0;
}
}
}
if (typeof C === 'undefined') {
return $Array(len);
}
if (!this.IsConstructor(C)) {
throw new $TypeError('C must be a constructor');
}
return new C(len); // this.Construct(C, len);
},
CreateDataProperty: function CreateDataProperty(O, P, V) {
if (this.Type(O) !== 'Object') {
throw new $TypeError('Assertion failed: Type(O) is not Object');
}
if (!this.IsPropertyKey(P)) {
throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true');
}
var oldDesc = $gOPD(O, P);
var extensible = oldDesc || this.IsExtensible(O);
var immutable = oldDesc && (!oldDesc.writable || !oldDesc.configurable);
if (immutable || !extensible) {
return false;
}
return DefineOwnProperty(this, O, P, {
'[[Configurable]]': true,
'[[Enumerable]]': true,
'[[Value]]': V,
'[[Writable]]': true
});
},
// https://ecma-international.org/ecma-262/6.0/#sec-createdatapropertyorthrow
CreateDataPropertyOrThrow: function CreateDataPropertyOrThrow(O, P, V) {
if (this.Type(O) !== 'Object') {
throw new $TypeError('Assertion failed: Type(O) is not Object');
}
if (!this.IsPropertyKey(P)) {
throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true');
}
var success = this.CreateDataProperty(O, P, V);
if (!success) {
throw new $TypeError('unable to create data property');
}
return success;
},
// https://www.ecma-international.org/ecma-262/6.0/#sec-objectcreate
ObjectCreate: function ObjectCreate(proto, internalSlotsList) {
if (proto !== null && this.Type(proto) !== 'Object') {
throw new $TypeError('Assertion failed: proto must be null or an object');
}
var slots = arguments.length < 2 ? [] : internalSlotsList;
if (slots.length > 0) {
throw new $SyntaxError('es-abstract does not yet support internal slots');
}
if (proto === null && !$ObjectCreate) {
throw new $SyntaxError('native Object.create support is required to create null objects');
}
return $ObjectCreate(proto);
},
// https://ecma-international.org/ecma-262/6.0/#sec-advancestringindex
AdvanceStringIndex: function AdvanceStringIndex(S, index, unicode) {
if (this.Type(S) !== 'String') {
throw new $TypeError('S must be a String');
}
if (!this.IsInteger(index) || index < 0 || index > MAX_SAFE_INTEGER) {
throw new $TypeError('Assertion failed: length must be an integer >= 0 and <= 2**53');
}
if (this.Type(unicode) !== 'Boolean') {
throw new $TypeError('Assertion failed: unicode must be a Boolean');
}
if (!unicode) {
return index + 1;
}
var length = S.length;
if (index + 1 >= length) {
return index + 1;
}
var first = $charCodeAt(S, index);
if (first < 0xD800 || first > 0xDBFF) {
return index + 1;
}
var second = $charCodeAt(S, index + 1);
if (second < 0xDC00 || second > 0xDFFF) {
return index + 1;
}
return index + 2;
},
// https://www.ecma-international.org/ecma-262/6.0/#sec-createmethodproperty
CreateMethodProperty: function CreateMethodProperty(O, P, V) {
if (this.Type(O) !== 'Object') {
throw new $TypeError('Assertion failed: Type(O) is not Object');
}
if (!this.IsPropertyKey(P)) {
throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true');
}
var newDesc = {
'[[Configurable]]': true,
'[[Enumerable]]': false,
'[[Value]]': V,
'[[Writable]]': true
};
return DefineOwnProperty(this, O, P, newDesc);
},
// https://www.ecma-international.org/ecma-262/6.0/#sec-definepropertyorthrow
DefinePropertyOrThrow: function DefinePropertyOrThrow(O, P, desc) {
if (this.Type(O) !== 'Object') {
throw new $TypeError('Assertion failed: Type(O) is not Object');
}
if (!this.IsPropertyKey(P)) {
throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true');
}
var Desc = isPropertyDescriptor(this, desc) ? desc : this.ToPropertyDescriptor(desc);
if (!isPropertyDescriptor(this, Desc)) {
throw new $TypeError('Assertion failed: Desc is not a valid Property Descriptor');
}
return DefineOwnProperty(this, O, P, Desc);
},
// https://www.ecma-international.org/ecma-262/6.0/#sec-deletepropertyorthrow
DeletePropertyOrThrow: function DeletePropertyOrThrow(O, P) {
if (this.Type(O) !== 'Object') {
throw new $TypeError('Assertion failed: Type(O) is not Object');
}
if (!this.IsPropertyKey(P)) {
throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true');
}
var success = delete O[P];
if (!success) {
throw new TypeError('Attempt to delete property failed.');
}
return success;
},
// https://www.ecma-international.org/ecma-262/6.0/#sec-enumerableownnames
EnumerableOwnNames: function EnumerableOwnNames(O) {
if (this.Type(O) !== 'Object') {
throw new $TypeError('Assertion failed: Type(O) is not Object');
}
return keys(O);
},
// https://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-number-prototype-object
thisNumberValue: function thisNumberValue(value) {
if (this.Type(value) === 'Number') {
return value;
}
return $NumberValueOf(value);
},
// https://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-boolean-prototype-object
thisBooleanValue: function thisBooleanValue(value) {
if (this.Type(value) === 'Boolean') {
return value;
}
return $BooleanValueOf(value);
},
// https://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-string-prototype-object
thisStringValue: function thisStringValue(value) {
if (this.Type(value) === 'String') {
return value;
}
return $StringValueOf(value);
},
// https://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-date-prototype-object
thisTimeValue: function thisTimeValue(value) {
return $DateValueOf(value);
},
// https://www.ecma-international.org/ecma-262/6.0/#sec-setintegritylevel
SetIntegrityLevel: function SetIntegrityLevel(O, level) {
if (this.Type(O) !== 'Object') {
throw new $TypeError('Assertion failed: Type(O) is not Object');
}
if (level !== 'sealed' && level !== 'frozen') {
throw new $TypeError('Assertion failed: `level` must be `"sealed"` or `"frozen"`');
}
if (!$preventExtensions) {
throw new $SyntaxError('SetIntegrityLevel requires native `Object.preventExtensions` support');
}
var status = $preventExtensions(O);
if (!status) {
return false;
}
if (!$gOPN) {
throw new $SyntaxError('SetIntegrityLevel requires native `Object.getOwnPropertyNames` support');
}
var theKeys = $gOPN(O);
var ES = this;
if (level === 'sealed') {
forEach(theKeys, function (k) {
ES.DefinePropertyOrThrow(O, k, {
configurable: false
});
});
} else if (level === 'frozen') {
forEach(theKeys, function (k) {
var currentDesc = $gOPD(O, k);
if (typeof currentDesc !== 'undefined') {
var desc;
if (ES.IsAccessorDescriptor(ES.ToPropertyDescriptor(currentDesc))) {
desc = {
configurable: false
};
} else {
desc = {
configurable: false,
writable: false
};
}
ES.DefinePropertyOrThrow(O, k, desc);
}
});
}
return true;
},
// https://www.ecma-international.org/ecma-262/6.0/#sec-testintegritylevel
TestIntegrityLevel: function TestIntegrityLevel(O, level) {
if (this.Type(O) !== 'Object') {
throw new $TypeError('Assertion failed: Type(O) is not Object');
}
if (level !== 'sealed' && level !== 'frozen') {
throw new $TypeError('Assertion failed: `level` must be `"sealed"` or `"frozen"`');
}
var status = this.IsExtensible(O);
if (status) {
return false;
}
var theKeys = $gOPN(O);
var ES = this;
return theKeys.length === 0 || every(theKeys, function (k) {
var currentDesc = $gOPD(O, k);
if (typeof currentDesc !== 'undefined') {
if (currentDesc.configurable) {
return false;
}
if (level === 'frozen' && ES.IsDataDescriptor(ES.ToPropertyDescriptor(currentDesc)) && currentDesc.writable) {
return false;
}
}
return true;
});
},
// https://www.ecma-international.org/ecma-262/6.0/#sec-ordinaryhasinstance
OrdinaryHasInstance: function OrdinaryHasInstance(C, O) {
if (this.IsCallable(C) === false) {
return false;
}
if (this.Type(O) !== 'Object') {
return false;
}
var P = this.Get(C, 'prototype');
if (this.Type(P) !== 'Object') {
throw new $TypeError('OrdinaryHasInstance called on an object with an invalid prototype property.');
}
return O instanceof C;
},
// https://www.ecma-international.org/ecma-262/6.0/#sec-ordinaryhasproperty
OrdinaryHasProperty: function OrdinaryHasProperty(O, P) {
if (this.Type(O) !== 'Object') {
throw new $TypeError('Assertion failed: Type(O) is not Object');
}
if (!this.IsPropertyKey(P)) {
throw new $TypeError('Assertion failed: P must be a Property Key');
}
return P in O;
},
// https://www.ecma-international.org/ecma-262/6.0/#sec-instanceofoperator
InstanceofOperator: function InstanceofOperator(O, C) {
if (this.Type(O) !== 'Object') {
throw new $TypeError('Assertion failed: Type(O) is not Object');
}
var instOfHandler = hasSymbols && $Symbol.hasInstance ? this.GetMethod(C, $Symbol.hasInstance) : void 0;
if (typeof instOfHandler !== 'undefined') {
return this.ToBoolean(this.Call(instOfHandler, C, [O]));
}
if (!this.IsCallable(C)) {
throw new $TypeError('`C` is not Callable');
}
return this.OrdinaryHasInstance(C, O);
},
// https://www.ecma-international.org/ecma-262/6.0/#sec-ispromise
IsPromise: function IsPromise(x) {
if (this.Type(x) !== 'Object') {
return false;
}
if (!$Promise) {
// Promises are not supported
return false;
}
try {
$PromiseThen(x); // throws if not a promise
} catch (e) {
return false;
}
return true;
},
// https://www.ecma-international.org/ecma-262/6.0/#sec-abstract-equality-comparison
'Abstract Equality Comparison': function AbstractEqualityComparison(x, y) {
var xType = this.Type(x);
var yType = this.Type(y);
if (xType === yType) {
return x === y; // ES6+ specified this shortcut anyways.
}
if (x == null && y == null) {
return true;
}
if (xType === 'Number' && yType === 'String') {
return this['Abstract Equality Comparison'](x, this.ToNumber(y));
}
if (xType === 'String' && yType === 'Number') {
return this['Abstract Equality Comparison'](this.ToNumber(x), y);
}
if (xType === 'Boolean') {
return this['Abstract Equality Comparison'](this.ToNumber(x), y);
}
if (yType === 'Boolean') {
return this['Abstract Equality Comparison'](x, this.ToNumber(y));
}
if ((xType === 'String' || xType === 'Number' || xType === 'Symbol') && yType === 'Object') {
return this['Abstract Equality Comparison'](x, this.ToPrimitive(y));
}
if (xType === 'Object' && (yType === 'String' || yType === 'Number' || yType === 'Symbol')) {
return this['Abstract Equality Comparison'](this.ToPrimitive(x), y);
}
return false;
},
// eslint-disable-next-line max-lines-per-function, max-statements, id-length, max-params
ValidateAndApplyPropertyDescriptor: function ValidateAndApplyPropertyDescriptor(O, P, extensible, Desc, current) {
// this uses the ES2017+ logic, since it fixes a number of bugs in the ES2015 logic.
var oType = this.Type(O);
if (oType !== 'Undefined' && oType !== 'Object') {
throw new $TypeError('Assertion failed: O must be undefined or an Object');
}
if (this.Type(extensible) !== 'Boolean') {
throw new $TypeError('Assertion failed: extensible must be a Boolean');
}
if (!isPropertyDescriptor(this, Desc)) {
throw new $TypeError('Assertion failed: Desc must be a Property Descriptor');
}
if (this.Type(current) !== 'Undefined' && !isPropertyDescriptor(this, current)) {
throw new $TypeError('Assertion failed: current must be a Property Descriptor, or undefined');
}
if (oType !== 'Undefined' && !this.IsPropertyKey(P)) {
throw new $TypeError('Assertion failed: if O is not undefined, P must be a Property Key');
}
if (this.Type(current) === 'Undefined') {
if (!extensible) {
return false;
}
if (this.IsGenericDescriptor(Desc) || this.IsDataDescriptor(Desc)) {
if (oType !== 'Undefined') {
DefineOwnProperty(this, O, P, {
'[[Configurable]]': Desc['[[Configurable]]'],
'[[Enumerable]]': Desc['[[Enumerable]]'],
'[[Value]]': Desc['[[Value]]'],
'[[Writable]]': Desc['[[Writable]]']
});
}
} else {
if (!this.IsAccessorDescriptor(Desc)) {
throw new $TypeError('Assertion failed: Desc is not an accessor descriptor');
}
if (oType !== 'Undefined') {
return DefineOwnProperty(this, O, P, Desc);
}
}
return true;
}
if (this.IsGenericDescriptor(Desc) && !('[[Configurable]]' in Desc) && !('[[Enumerable]]' in Desc)) {
return true;
}
if (isSamePropertyDescriptor(this, Desc, current)) {
return true; // removed by ES2017, but should still be correct
} // "if every field in Desc is absent, return true" can't really match the assertion that it's a Property Descriptor
if (!current['[[Configurable]]']) {
if (Desc['[[Configurable]]']) {
return false;
}
if ('[[Enumerable]]' in Desc && !Desc['[[Enumerable]]'] === !!current['[[Enumerable]]']) {
return false;
}
}
if (this.IsGenericDescriptor(Desc)) {// no further validation is required.
} else if (this.IsDataDescriptor(current) !== this.IsDataDescriptor(Desc)) {
if (!current['[[Configurable]]']) {
return false;
}
if (this.IsDataDescriptor(current)) {
if (oType !== 'Undefined') {
DefineOwnProperty(this, O, P, {
'[[Configurable]]': current['[[Configurable]]'],
'[[Enumerable]]': current['[[Enumerable]]'],
'[[Get]]': undefined
});
}
} else if (oType !== 'Undefined') {
DefineOwnProperty(this, O, P, {
'[[Configurable]]': current['[[Configurable]]'],
'[[Enumerable]]': current['[[Enumerable]]'],
'[[Value]]': undefined
});
}
} else if (this.IsDataDescriptor(current) && this.IsDataDescriptor(Desc)) {
if (!current['[[Configurable]]'] && !current['[[Writable]]']) {
if ('[[Writable]]' in Desc && Desc['[[Writable]]']) {
return false;
}
if ('[[Value]]' in Desc && !this.SameValue(Desc['[[Value]]'], current['[[Value]]'])) {
return false;
}
return true;
}
} else if (this.IsAccessorDescriptor(current) && this.IsAccessorDescriptor(Desc)) {
if (!current['[[Configurable]]']) {
if ('[[Set]]' in Desc && !this.SameValue(Desc['[[Set]]'], current['[[Set]]'])) {
return false;
}
if ('[[Get]]' in Desc && !this.SameValue(Desc['[[Get]]'], current['[[Get]]'])) {
return false;
}
return true;
}
} else {
throw new $TypeError('Assertion failed: current and Desc are not both data, both accessors, or one accessor and one data.');
}
if (oType !== 'Undefined') {
return DefineOwnProperty(this, O, P, Desc);
}
return true;
},
// https://www.ecma-international.org/ecma-262/6.0/#sec-ordinarydefineownproperty
OrdinaryDefineOwnProperty: function OrdinaryDefineOwnProperty(O, P, Desc) {
if (this.Type(O) !== 'Object') {
throw new $TypeError('Assertion failed: O must be an Object');
}
if (!this.IsPropertyKey(P)) {
throw new $TypeError('Assertion failed: P must be a Property Key');
}
if (!isPropertyDescriptor(this, Desc)) {
throw new $TypeError('Assertion failed: Desc must be a Property Descriptor');
}
var desc = $gOPD(O, P);
var current = desc && this.ToPropertyDescriptor(desc);
var extensible = this.IsExtensible(O);
return this.ValidateAndApplyPropertyDescriptor(O, P, extensible, Desc, current);
},
// https://www.ecma-international.org/ecma-262/6.0/#sec-ordinarygetownproperty
OrdinaryGetOwnProperty: function OrdinaryGetOwnProperty(O, P) {
if (this.Type(O) !== 'Object') {
throw new $TypeError('Assertion failed: O must be an Object');
}
if (!this.IsPropertyKey(P)) {
throw new $TypeError('Assertion failed: P must be a Property Key');
}
if (!has(O, P)) {
return void 0;
}
if (!$gOPD) {
// ES3 fallback
var arrayLength = this.IsArray(O) && P === 'length';
var regexLastIndex = this.IsRegExp(O) && P === 'lastIndex';
return {
'[[Configurable]]': !(arrayLength || regexLastIndex),
'[[Enumerable]]': $isEnumerable(O, P),
'[[Value]]': O[P],
'[[Writable]]': true
};
}
return this.ToPropertyDescriptor($gOPD(O, P));
},
// https://www.ecma-international.org/ecma-262/6.0/#sec-arraycreate
ArrayCreate: function ArrayCreate(length) {
if (!this.IsInteger(length) || length < 0) {
throw new $TypeError('Assertion failed: `length` must be an integer Number >= 0');
}
if (length > MAX_ARRAY_LENGTH) {
throw new $RangeError('length is greater than (2**32 - 1)');
}
var proto = arguments.length > 1 ? arguments[1] : $ArrayPrototype;
var A = []; // steps 5 - 7, and 9
if (proto !== $ArrayPrototype) {
// step 8
if (!$setProto) {
throw new $SyntaxError('ArrayCreate: a `proto` argument that is not `Array.prototype` is not supported in an environment that does not support setting the [[Prototype]]');
}
$setProto(A, proto);
}
if (length !== 0) {
// bypasses the need for step 2
A.length = length;
}
/* step 10, the above as a shortcut for the below
this.OrdinaryDefineOwnProperty(A, 'length', {
'[[Configurable]]': false,
'[[Enumerable]]': false,
'[[Value]]': length,
'[[Writable]]': true
});
*/
return A;
},
// eslint-disable-next-line max-statements, max-lines-per-function
ArraySetLength: function ArraySetLength(A, Desc) {
if (!this.IsArray(A)) {
throw new $TypeError('Assertion failed: A must be an Array');
}
if (!isPropertyDescriptor(this, Desc)) {
throw new $TypeError('Assertion failed: Desc must be a Property Descriptor');
}
if (!('[[Value]]' in Desc)) {
return this.OrdinaryDefineOwnProperty(A, 'length', Desc);
}
var newLenDesc = assign({}, Desc);
var newLen = this.ToUint32(Desc['[[Value]]']);
var numberLen = this.ToNumber(Desc['[[Value]]']);
if (newLen !== numberLen) {
throw new $RangeError('Invalid array length');
}
newLenDesc['[[Value]]'] = newLen;
var oldLenDesc = this.OrdinaryGetOwnProperty(A, 'length');
if (!this.IsDataDescriptor(oldLenDesc)) {
throw new $TypeError('Assertion failed: an array had a non-data descriptor on `length`');
}
var oldLen = oldLenDesc['[[Value]]'];
if (newLen >= oldLen) {
return this.OrdinaryDefineOwnProperty(A, 'length', newLenDesc);
}
if (!oldLenDesc['[[Writable]]']) {
return false;
}
var newWritable;
if (!('[[Writable]]' in newLenDesc) || newLenDesc['[[Writable]]']) {
newWritable = true;
} else {
newWritable = false;
newLenDesc['[[Writable]]'] = true;
}
var succeeded = this.OrdinaryDefineOwnProperty(A, 'length', newLenDesc);
if (!succeeded) {
return false;
}
while (newLen < oldLen) {
oldLen -= 1;
var deleteSucceeded = delete A[this.ToString(oldLen)];
if (!deleteSucceeded) {
newLenDesc['[[Value]]'] = oldLen + 1;
if (!newWritable) {
newLenDesc['[[Writable]]'] = false;
this.OrdinaryDefineOwnProperty(A, 'length', newLenDesc);
return false;
}
}
}
if (!newWritable) {
return this.OrdinaryDefineOwnProperty(A, 'length', {
'[[Writable]]': false
});
}
return true;
},
// https://www.ecma-international.org/ecma-262/6.0/#sec-createhtml
CreateHTML: function CreateHTML(string, tag, attribute, value) {
if (this.Type(tag) !== 'String' || this.Type(attribute) !== 'String') {
throw new $TypeError('Assertion failed: `tag` and `attribute` must be strings');
}
var str = this.RequireObjectCoercible(string);
var S = this.ToString(str);
var p1 = '<' + tag;
if (attribute !== '') {
var V = this.ToString(value);
var escapedV = $replace(V, /\x22/g, '"');
p1 += '\x20' + attribute + '\x3D\x22' + escapedV + '\x22';
}
return p1 + '>' + S + '</' + tag + '>';
},
// https://www.ecma-international.org/ecma-262/6.0/#sec-getownpropertykeys
GetOwnPropertyKeys: function GetOwnPropertyKeys(O, Type) {
if (this.Type(O) !== 'Object') {
throw new $TypeError('Assertion failed: Type(O) is not Object');
}
if (Type === 'Symbol') {
return hasSymbols && $gOPS ? $gOPS(O) : [];
}
if (Type === 'String') {
if (!$gOPN) {
return keys(O);
}
return $gOPN(O);
}
throw new $TypeError('Assertion failed: `Type` must be `"String"` or `"Symbol"`');
},
// https://www.ecma-international.org/ecma-262/6.0/#sec-symboldescriptivestring
SymbolDescriptiveString: function SymbolDescriptiveString(sym) {
if (this.Type(sym) !== 'Symbol') {
throw new $TypeError('Assertion failed: `sym` must be a Symbol');
}
return $SymbolToString(sym);
},
// https://www.ecma-international.org/ecma-262/6.0/#sec-getsubstitution
// eslint-disable-next-line max-statements, max-params, max-lines-per-function
GetSubstitution: function GetSubstitution(matched, str, position, captures, replacement) {
if (this.Type(matched) !== 'String') {
throw new $TypeError('Assertion failed: `matched` must be a String');
}
var matchLength = matched.length;
if (this.Type(str) !== 'String') {
throw new $TypeError('Assertion failed: `str` must be a String');
}
var stringLength = str.length;
if (!this.IsInteger(position) || position < 0 || position > stringLength) {
throw new $TypeError('Assertion failed: `position` must be a nonnegative integer, and less than or equal to the length of `string`, got ' + inspect(position));
}
var ES = this;
var isStringOrHole = function (capture, index, arr) {
return ES.Type(capture) === 'String' || !(index in arr);
};
if (!this.IsArray(captures) || !every(captures, isStringOrHole)) {
throw new $TypeError('Assertion failed: `captures` must be a List of Strings, got ' + inspect(captures));
}
if (this.Type(replacement) !== 'String') {
throw new $TypeError('Assertion failed: `replacement` must be a String');
}
var tailPos = position + matchLength;
var m = captures.length;
var result = '';
for (var i = 0; i < replacement.length; i += 1) {
// if this is a $, and it's not the end of the replacement
var current = replacement[i];
var isLast = i + 1 >= replacement.length;
var nextIsLast = i + 2 >= replacement.length;
if (current === '$' && !isLast) {
var next = replacement[i + 1];
if (next === '$') {
result += '$';
i += 1;
} else if (next === '&') {
result += matched;
i += 1;
} else if (next === '`') {
result += position === 0 ? '' : strSlice(str, 0, position - 1);
i += 1;
} else if (next === "'") {
result += tailPos >= stringLength ? '' : strSlice(str, tailPos);
i += 1;
} else {
var nextNext = nextIsLast ? null : replacement[i + 2];
if (isDigit(next) && next !== '0' && (nextIsLast || !isDigit(nextNext))) {
// $1 through $9, and not followed by a digit
var n = parseInteger(next, 10); // if (n > m, impl-defined)
result += n <= m && this.Type(captures[n - 1]) === 'Undefined' ? '' : captures[n - 1];
i += 1;
} else if (isDigit(next) && (nextIsLast || isDigit(nextNext))) {
// $00 through $99
var nn = next + nextNext;
var nnI = parseInteger(nn, 10) - 1; // if nn === '00' or nn > m, impl-defined
result += nn <= m && this.Type(captures[nnI]) === 'Undefined' ? '' : captures[nnI];
i += 2;
} else {
result += '$';
}
}
} else {
// the final $, or else not a $
result += replacement[i];
}
}
return result;
}
});
delete ES6.CheckObjectCoercible; // renamed in ES6 to RequireObjectCoercible
module.exports = ES6;
/***/ }),
/***/ "./node_modules/es-abstract/es2016.js":
/*!********************************************!*\
!*** ./node_modules/es-abstract/es2016.js ***!
\********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var GetIntrinsic = __webpack_require__(/*! ./GetIntrinsic */ "./node_modules/es-abstract/GetIntrinsic.js");
var $Array = GetIntrinsic('%Array%');
var hasSymbols = __webpack_require__(/*! has-symbols */ "./node_modules/has-symbols/index.js")();
var ES2015 = __webpack_require__(/*! ./es2015 */ "./node_modules/es-abstract/es2015.js");
var assign = __webpack_require__(/*! ./helpers/assign */ "./node_modules/es-abstract/helpers/assign.js");
var callBind = __webpack_require__(/*! ./helpers/callBind */ "./node_modules/es-abstract/helpers/callBind.js");
var $arrayPush = callBind($Array.prototype.push);
var $arraySlice = callBind($Array.prototype.slice);
var $arrayJoin = callBind($Array.prototype.join);
var ES2016 = assign(assign({}, ES2015), {
// https://www.ecma-international.org/ecma-262/7.0/#sec-samevaluenonnumber
SameValueNonNumber: function SameValueNonNumber(x, y) {
if (typeof x === 'number' || typeof x !== typeof y) {
throw new TypeError('SameValueNonNumber requires two non-number values of the same type.');
}
return this.SameValue(x, y);
},
// https://www.ecma-international.org/ecma-262/7.0/#sec-iterabletoarraylike
IterableToArrayLike: function IterableToArrayLike(items) {
var usingIterator;
if (hasSymbols) {
usingIterator = this.GetMethod(items, Symbol.iterator);
} else if (this.IsArray(items)) {
usingIterator = function () {
var i = -1;
var arr = this; // eslint-disable-line no-invalid-this
return {
next: function () {
i += 1;
return {
done: i >= arr.length,
value: arr[i]
};
}
};
};
} else if (this.Type(items) === 'String') {
var ES = this;
usingIterator = function () {
var i = 0;
return {
next: function () {
var nextIndex = ES.AdvanceStringIndex(items, i, true);
var value = $arrayJoin($arraySlice(items, i, nextIndex), '');
i = nextIndex;
return {
done: nextIndex > items.length,
value: value
};
}
};
};
}
if (typeof usingIterator !== 'undefined') {
var iterator = this.GetIterator(items, usingIterator);
var values = [];
var next = true;
while (next) {
next = this.IteratorStep(iterator);
if (next) {
var nextValue = this.IteratorValue(next);
$arrayPush(values, nextValue);
}
}
return values;
}
return this.ToObject(items);
}
});
module.exports = ES2016;
/***/ }),
/***/ "./node_modules/es-abstract/es2017.js":
/*!********************************************!*\
!*** ./node_modules/es-abstract/es2017.js ***!
\********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var GetIntrinsic = __webpack_require__(/*! ./GetIntrinsic */ "./node_modules/es-abstract/GetIntrinsic.js");
var ES2016 = __webpack_require__(/*! ./es2016 */ "./node_modules/es-abstract/es2016.js");
var assign = __webpack_require__(/*! ./helpers/assign */ "./node_modules/es-abstract/helpers/assign.js");
var forEach = __webpack_require__(/*! ./helpers/forEach */ "./node_modules/es-abstract/helpers/forEach.js");
var callBind = __webpack_require__(/*! ./helpers/callBind */ "./node_modules/es-abstract/helpers/callBind.js");
var $TypeError = GetIntrinsic('%TypeError%');
var $Array = GetIntrinsic('%Array%');
var $isEnumerable = callBind(GetIntrinsic('%ObjectPrototype%').propertyIsEnumerable);
var $pushApply = callBind.apply(GetIntrinsic('%ArrayPrototype%').push);
var $arrayPush = callBind($Array.prototype.push);
var ES2017 = assign(assign({}, ES2016), {
ToIndex: function ToIndex(value) {
if (typeof value === 'undefined') {
return 0;
}
var integerIndex = this.ToInteger(value);
if (integerIndex < 0) {
throw new RangeError('index must be >= 0');
}
var index = this.ToLength(integerIndex);
if (!this.SameValueZero(integerIndex, index)) {
throw new RangeError('index must be >= 0 and < 2 ** 53 - 1');
}
return index;
},
// https://www.ecma-international.org/ecma-262/8.0/#sec-enumerableownproperties
EnumerableOwnProperties: function EnumerableOwnProperties(O, kind) {
var keys = ES2016.EnumerableOwnNames(O);
if (kind === 'key') {
return keys;
}
if (kind === 'value' || kind === 'key+value') {
var results = [];
forEach(keys, function (key) {
if ($isEnumerable(O, key)) {
$pushApply(results, [kind === 'value' ? O[key] : [key, O[key]]]);
}
});
return results;
}
throw new $TypeError('Assertion failed: "kind" is not "key", "value", or "key+value": ' + kind);
},
// https://www.ecma-international.org/ecma-262/8.0/#sec-iterabletolist
IterableToList: function IterableToList(items, method) {
var iterator = this.GetIterator(items, method);
var values = [];
var next = true;
while (next) {
next = this.IteratorStep(iterator);
if (next) {
var nextValue = this.IteratorValue(next);
$arrayPush(values, nextValue);
}
}
return values;
}
});
delete ES2017.EnumerableOwnNames; // replaced with EnumerableOwnProperties
delete ES2017.IterableToArrayLike; // replaced with IterableToList
module.exports = ES2017;
/***/ }),
/***/ "./node_modules/es-abstract/es5.js":
/*!*****************************************!*\
!*** ./node_modules/es-abstract/es5.js ***!
\*****************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var GetIntrinsic = __webpack_require__(/*! ./GetIntrinsic */ "./node_modules/es-abstract/GetIntrinsic.js");
var $Object = GetIntrinsic('%Object%');
var $TypeError = GetIntrinsic('%TypeError%');
var $String = GetIntrinsic('%String%');
var $Number = GetIntrinsic('%Number%');
var assertRecord = __webpack_require__(/*! ./helpers/assertRecord */ "./node_modules/es-abstract/helpers/assertRecord.js");
var isPropertyDescriptor = __webpack_require__(/*! ./helpers/isPropertyDescriptor */ "./node_modules/es-abstract/helpers/isPropertyDescriptor.js");
var $isNaN = __webpack_require__(/*! ./helpers/isNaN */ "./node_modules/es-abstract/helpers/isNaN.js");
var $isFinite = __webpack_require__(/*! ./helpers/isFinite */ "./node_modules/es-abstract/helpers/isFinite.js");
var sign = __webpack_require__(/*! ./helpers/sign */ "./node_modules/es-abstract/helpers/sign.js");
var mod = __webpack_require__(/*! ./helpers/mod */ "./node_modules/es-abstract/helpers/mod.js");
var IsCallable = __webpack_require__(/*! is-callable */ "./node_modules/is-callable/index.js");
var toPrimitive = __webpack_require__(/*! es-to-primitive/es5 */ "./node_modules/es-to-primitive/es5.js");
var has = __webpack_require__(/*! has */ "./node_modules/has/src/index.js");
var callBind = __webpack_require__(/*! ./helpers/callBind */ "./node_modules/es-abstract/helpers/callBind.js");
var strSlice = callBind($String.prototype.slice);
var isPrefixOf = function isPrefixOf(prefix, string) {
if (prefix === string) {
return true;
}
if (prefix.length > string.length) {
return false;
}
return strSlice(string, 0, prefix.length) === prefix;
}; // https://es5.github.io/#x9
var ES5 = {
ToPrimitive: toPrimitive,
ToBoolean: function ToBoolean(value) {
return !!value;
},
ToNumber: function ToNumber(value) {
return +value; // eslint-disable-line no-implicit-coercion
},
ToInteger: function ToInteger(value) {
var number = this.ToNumber(value);
if ($isNaN(number)) {
return 0;
}
if (number === 0 || !$isFinite(number)) {
return number;
}
return sign(number) * Math.floor(Math.abs(number));
},
ToInt32: function ToInt32(x) {
return this.ToNumber(x) >> 0;
},
ToUint32: function ToUint32(x) {
return this.ToNumber(x) >>> 0;
},
ToUint16: function ToUint16(value) {
var number = this.ToNumber(value);
if ($isNaN(number) || number === 0 || !$isFinite(number)) {
return 0;
}
var posInt = sign(number) * Math.floor(Math.abs(number));
return mod(posInt, 0x10000);
},
ToString: function ToString(value) {
return $String(value);
},
ToObject: function ToObject(value) {
this.CheckObjectCoercible(value);
return $Object(value);
},
CheckObjectCoercible: function CheckObjectCoercible(value, optMessage) {
/* jshint eqnull:true */
if (value == null) {
throw new $TypeError(optMessage || 'Cannot call method on ' + value);
}
return value;
},
IsCallable: IsCallable,
SameValue: function SameValue(x, y) {
if (x === y) {
// 0 === -0, but they are not identical.
if (x === 0) {
return 1 / x === 1 / y;
}
return true;
}
return $isNaN(x) && $isNaN(y);
},
// https://www.ecma-international.org/ecma-262/5.1/#sec-8
Type: function Type(x) {
if (x === null) {
return 'Null';
}
if (typeof x === 'undefined') {
return 'Undefined';
}
if (typeof x === 'function' || typeof x === 'object') {
return 'Object';
}
if (typeof x === 'number') {
return 'Number';
}
if (typeof x === 'boolean') {
return 'Boolean';
}
if (typeof x === 'string') {
return 'String';
}
},
// https://ecma-international.org/ecma-262/6.0/#sec-property-descriptor-specification-type
IsPropertyDescriptor: function IsPropertyDescriptor(Desc) {
return isPropertyDescriptor(this, Desc);
},
// https://ecma-international.org/ecma-262/5.1/#sec-8.10.1
IsAccessorDescriptor: function IsAccessorDescriptor(Desc) {
if (typeof Desc === 'undefined') {
return false;
}
assertRecord(this, 'Property Descriptor', 'Desc', Desc);
if (!has(Desc, '[[Get]]') && !has(Desc, '[[Set]]')) {
return false;
}
return true;
},
// https://ecma-international.org/ecma-262/5.1/#sec-8.10.2
IsDataDescriptor: function IsDataDescriptor(Desc) {
if (typeof Desc === 'undefined') {
return false;
}
assertRecord(this, 'Property Descriptor', 'Desc', Desc);
if (!has(Desc, '[[Value]]') && !has(Desc, '[[Writable]]')) {
return false;
}
return true;
},
// https://ecma-international.org/ecma-262/5.1/#sec-8.10.3
IsGenericDescriptor: function IsGenericDescriptor(Desc) {
if (typeof Desc === 'undefined') {
return false;
}
assertRecord(this, 'Property Descriptor', 'Desc', Desc);
if (!this.IsAccessorDescriptor(Desc) && !this.IsDataDescriptor(Desc)) {
return true;
}
return false;
},
// https://ecma-international.org/ecma-262/5.1/#sec-8.10.4
FromPropertyDescriptor: function FromPropertyDescriptor(Desc) {
if (typeof Desc === 'undefined') {
return Desc;
}
assertRecord(this, 'Property Descriptor', 'Desc', Desc);
if (this.IsDataDescriptor(Desc)) {
return {
value: Desc['[[Value]]'],
writable: !!Desc['[[Writable]]'],
enumerable: !!Desc['[[Enumerable]]'],
configurable: !!Desc['[[Configurable]]']
};
} else if (this.IsAccessorDescriptor(Desc)) {
return {
get: Desc['[[Get]]'],
set: Desc['[[Set]]'],
enumerable: !!Desc['[[Enumerable]]'],
configurable: !!Desc['[[Configurable]]']
};
} else {
throw new $TypeError('FromPropertyDescriptor must be called with a fully populated Property Descriptor');
}
},
// https://ecma-international.org/ecma-262/5.1/#sec-8.10.5
ToPropertyDescriptor: function ToPropertyDescriptor(Obj) {
if (this.Type(Obj) !== 'Object') {
throw new $TypeError('ToPropertyDescriptor requires an object');
}
var desc = {};
if (has(Obj, 'enumerable')) {
desc['[[Enumerable]]'] = this.ToBoolean(Obj.enumerable);
}
if (has(Obj, 'configurable')) {
desc['[[Configurable]]'] = this.ToBoolean(Obj.configurable);
}
if (has(Obj, 'value')) {
desc['[[Value]]'] = Obj.value;
}
if (has(Obj, 'writable')) {
desc['[[Writable]]'] = this.ToBoolean(Obj.writable);
}
if (has(Obj, 'get')) {
var getter = Obj.get;
if (typeof getter !== 'undefined' && !this.IsCallable(getter)) {
throw new TypeError('getter must be a function');
}
desc['[[Get]]'] = getter;
}
if (has(Obj, 'set')) {
var setter = Obj.set;
if (typeof setter !== 'undefined' && !this.IsCallable(setter)) {
throw new $TypeError('setter must be a function');
}
desc['[[Set]]'] = setter;
}
if ((has(desc, '[[Get]]') || has(desc, '[[Set]]')) && (has(desc, '[[Value]]') || has(desc, '[[Writable]]'))) {
throw new $TypeError('Invalid property descriptor. Cannot both specify accessors and a value or writable attribute');
}
return desc;
},
// https://www.ecma-international.org/ecma-262/5.1/#sec-11.9.3
'Abstract Equality Comparison': function AbstractEqualityComparison(x, y) {
var xType = this.Type(x);
var yType = this.Type(y);
if (xType === yType) {
return x === y; // ES6+ specified this shortcut anyways.
}
if (x == null && y == null) {
return true;
}
if (xType === 'Number' && yType === 'String') {
return this['Abstract Equality Comparison'](x, this.ToNumber(y));
}
if (xType === 'String' && yType === 'Number') {
return this['Abstract Equality Comparison'](this.ToNumber(x), y);
}
if (xType === 'Boolean') {
return this['Abstract Equality Comparison'](this.ToNumber(x), y);
}
if (yType === 'Boolean') {
return this['Abstract Equality Comparison'](x, this.ToNumber(y));
}
if ((xType === 'String' || xType === 'Number') && yType === 'Object') {
return this['Abstract Equality Comparison'](x, this.ToPrimitive(y));
}
if (xType === 'Object' && (yType === 'String' || yType === 'Number')) {
return this['Abstract Equality Comparison'](this.ToPrimitive(x), y);
}
return false;
},
// https://www.ecma-international.org/ecma-262/5.1/#sec-11.9.6
'Strict Equality Comparison': function StrictEqualityComparison(x, y) {
var xType = this.Type(x);
var yType = this.Type(y);
if (xType !== yType) {
return false;
}
if (xType === 'Undefined' || xType === 'Null') {
return true;
}
return x === y; // shortcut for steps 4-7
},
// https://www.ecma-international.org/ecma-262/5.1/#sec-11.8.5
// eslint-disable-next-line max-statements
'Abstract Relational Comparison': function AbstractRelationalComparison(x, y, LeftFirst) {
if (this.Type(LeftFirst) !== 'Boolean') {
throw new $TypeError('Assertion failed: LeftFirst argument must be a Boolean');
}
var px;
var py;
if (LeftFirst) {
px = this.ToPrimitive(x, $Number);
py = this.ToPrimitive(y, $Number);
} else {
py = this.ToPrimitive(y, $Number);
px = this.ToPrimitive(x, $Number);
}
var bothStrings = this.Type(px) === 'String' && this.Type(py) === 'String';
if (!bothStrings) {
var nx = this.ToNumber(px);
var ny = this.ToNumber(py);
if ($isNaN(nx) || $isNaN(ny)) {
return undefined;
}
if ($isFinite(nx) && $isFinite(ny) && nx === ny) {
return false;
}
if (nx === 0 && ny === 0) {
return false;
}
if (nx === Infinity) {
return false;
}
if (ny === Infinity) {
return true;
}
if (ny === -Infinity) {
return false;
}
if (nx === -Infinity) {
return true;
}
return nx < ny; // by now, these are both nonzero, finite, and not equal
}
if (isPrefixOf(py, px)) {
return false;
}
if (isPrefixOf(px, py)) {
return true;
}
return px < py; // both strings, neither a prefix of the other. shortcut for steps c-f
}
};
module.exports = ES5;
/***/ }),
/***/ "./node_modules/es-abstract/es6.js":
/*!*****************************************!*\
!*** ./node_modules/es-abstract/es6.js ***!
\*****************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
module.exports = __webpack_require__(/*! ./es2015 */ "./node_modules/es-abstract/es2015.js");
/***/ }),
/***/ "./node_modules/es-abstract/es7.js":
/*!*****************************************!*\
!*** ./node_modules/es-abstract/es7.js ***!
\*****************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
module.exports = __webpack_require__(/*! ./es2016 */ "./node_modules/es-abstract/es2016.js");
/***/ }),
/***/ "./node_modules/es-abstract/helpers/assertRecord.js":
/*!**********************************************************!*\
!*** ./node_modules/es-abstract/helpers/assertRecord.js ***!
\**********************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var GetIntrinsic = __webpack_require__(/*! ../GetIntrinsic */ "./node_modules/es-abstract/GetIntrinsic.js");
var $TypeError = GetIntrinsic('%TypeError%');
var $SyntaxError = GetIntrinsic('%SyntaxError%');
var has = __webpack_require__(/*! has */ "./node_modules/has/src/index.js");
var predicates = {
// https://ecma-international.org/ecma-262/6.0/#sec-property-descriptor-specification-type
'Property Descriptor': function isPropertyDescriptor(ES, Desc) {
if (ES.Type(Desc) !== 'Object') {
return false;
}
var allowed = {
'[[Configurable]]': true,
'[[Enumerable]]': true,
'[[Get]]': true,
'[[Set]]': true,
'[[Value]]': true,
'[[Writable]]': true
};
for (var key in Desc) {
// eslint-disable-line
if (has(Desc, key) && !allowed[key]) {
return false;
}
}
var isData = has(Desc, '[[Value]]');
var IsAccessor = has(Desc, '[[Get]]') || has(Desc, '[[Set]]');
if (isData && IsAccessor) {
throw new $TypeError('Property Descriptors may not be both accessor and data descriptors');
}
return true;
}
};
module.exports = function assertRecord(ES, recordType, argumentName, value) {
var predicate = predicates[recordType];
if (typeof predicate !== 'function') {
throw new $SyntaxError('unknown record type: ' + recordType);
}
if (!predicate(ES, value)) {
throw new $TypeError(argumentName + ' must be a ' + recordType);
}
};
/***/ }),
/***/ "./node_modules/es-abstract/helpers/assign.js":
/*!****************************************************!*\
!*** ./node_modules/es-abstract/helpers/assign.js ***!
\****************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var GetIntrinsic = __webpack_require__(/*! ../GetIntrinsic */ "./node_modules/es-abstract/GetIntrinsic.js");
var has = __webpack_require__(/*! has */ "./node_modules/has/src/index.js");
var $assign = GetIntrinsic('%Object%').assign;
module.exports = function assign(target, source) {
if ($assign) {
return $assign(target, source);
} // eslint-disable-next-line no-restricted-syntax
for (var key in source) {
if (has(source, key)) {
target[key] = source[key];
}
}
return target;
};
/***/ }),
/***/ "./node_modules/es-abstract/helpers/callBind.js":
/*!******************************************************!*\
!*** ./node_modules/es-abstract/helpers/callBind.js ***!
\******************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var bind = __webpack_require__(/*! function-bind */ "./node_modules/function-bind/index.js");
var GetIntrinsic = __webpack_require__(/*! ../GetIntrinsic */ "./node_modules/es-abstract/GetIntrinsic.js");
var $Function = GetIntrinsic('%Function%');
var $apply = $Function.apply;
var $call = $Function.call;
module.exports = function callBind() {
return bind.apply($call, arguments);
};
module.exports.apply = function applyBind() {
return bind.apply($apply, arguments);
};
/***/ }),
/***/ "./node_modules/es-abstract/helpers/every.js":
/*!***************************************************!*\
!*** ./node_modules/es-abstract/helpers/every.js ***!
\***************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
module.exports = function every(array, predicate) {
for (var i = 0; i < array.length; i += 1) {
if (!predicate(array[i], i, array)) {
return false;
}
}
return true;
};
/***/ }),
/***/ "./node_modules/es-abstract/helpers/forEach.js":
/*!*****************************************************!*\
!*** ./node_modules/es-abstract/helpers/forEach.js ***!
\*****************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
module.exports = function forEach(array, callback) {
for (var i = 0; i < array.length; i += 1) {
callback(array[i], i, array); // eslint-disable-line callback-return
}
};
/***/ }),
/***/ "./node_modules/es-abstract/helpers/isFinite.js":
/*!******************************************************!*\
!*** ./node_modules/es-abstract/helpers/isFinite.js ***!
\******************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var $isNaN = Number.isNaN || function (a) {
return a !== a;
};
module.exports = Number.isFinite || function (x) {
return typeof x === 'number' && !$isNaN(x) && x !== Infinity && x !== -Infinity;
};
/***/ }),
/***/ "./node_modules/es-abstract/helpers/isNaN.js":
/*!***************************************************!*\
!*** ./node_modules/es-abstract/helpers/isNaN.js ***!
\***************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
module.exports = Number.isNaN || function isNaN(a) {
return a !== a;
};
/***/ }),
/***/ "./node_modules/es-abstract/helpers/isPrimitive.js":
/*!*********************************************************!*\
!*** ./node_modules/es-abstract/helpers/isPrimitive.js ***!
\*********************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
module.exports = function isPrimitive(value) {
return value === null || typeof value !== 'function' && typeof value !== 'object';
};
/***/ }),
/***/ "./node_modules/es-abstract/helpers/isPropertyDescriptor.js":
/*!******************************************************************!*\
!*** ./node_modules/es-abstract/helpers/isPropertyDescriptor.js ***!
\******************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var GetIntrinsic = __webpack_require__(/*! ../GetIntrinsic */ "./node_modules/es-abstract/GetIntrinsic.js");
var has = __webpack_require__(/*! has */ "./node_modules/has/src/index.js");
var $TypeError = GetIntrinsic('%TypeError%');
module.exports = function IsPropertyDescriptor(ES, Desc) {
if (ES.Type(Desc) !== 'Object') {
return false;
}
var allowed = {
'[[Configurable]]': true,
'[[Enumerable]]': true,
'[[Get]]': true,
'[[Set]]': true,
'[[Value]]': true,
'[[Writable]]': true
};
for (var key in Desc) {
// eslint-disable-line
if (has(Desc, key) && !allowed[key]) {
return false;
}
}
if (ES.IsDataDescriptor(Desc) && ES.IsAccessorDescriptor(Desc)) {
throw new $TypeError('Property Descriptors may not be both accessor and data descriptors');
}
return true;
};
/***/ }),
/***/ "./node_modules/es-abstract/helpers/isSamePropertyDescriptor.js":
/*!**********************************************************************!*\
!*** ./node_modules/es-abstract/helpers/isSamePropertyDescriptor.js ***!
\**********************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var every = __webpack_require__(/*! ./every */ "./node_modules/es-abstract/helpers/every.js");
module.exports = function isSamePropertyDescriptor(ES, D1, D2) {
var fields = ['[[Configurable]]', '[[Enumerable]]', '[[Get]]', '[[Set]]', '[[Value]]', '[[Writable]]'];
return every(fields, function (field) {
if (field in D1 !== field in D2) {
return false;
}
return ES.SameValue(D1[field], D2[field]);
});
};
/***/ }),
/***/ "./node_modules/es-abstract/helpers/mod.js":
/*!*************************************************!*\
!*** ./node_modules/es-abstract/helpers/mod.js ***!
\*************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
module.exports = function mod(number, modulo) {
var remain = number % modulo;
return Math.floor(remain >= 0 ? remain : remain + modulo);
};
/***/ }),
/***/ "./node_modules/es-abstract/helpers/sign.js":
/*!**************************************************!*\
!*** ./node_modules/es-abstract/helpers/sign.js ***!
\**************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
module.exports = function sign(number) {
return number >= 0 ? 1 : -1;
};
/***/ }),
/***/ "./node_modules/es-to-primitive/es2015.js":
/*!************************************************!*\
!*** ./node_modules/es-to-primitive/es2015.js ***!
\************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var hasSymbols = typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol';
var isPrimitive = __webpack_require__(/*! ./helpers/isPrimitive */ "./node_modules/es-to-primitive/helpers/isPrimitive.js");
var isCallable = __webpack_require__(/*! is-callable */ "./node_modules/is-callable/index.js");
var isDate = __webpack_require__(/*! is-date-object */ "./node_modules/is-date-object/index.js");
var isSymbol = __webpack_require__(/*! is-symbol */ "./node_modules/is-symbol/index.js");
var ordinaryToPrimitive = function OrdinaryToPrimitive(O, hint) {
if (typeof O === 'undefined' || O === null) {
throw new TypeError('Cannot call method on ' + O);
}
if (typeof hint !== 'string' || hint !== 'number' && hint !== 'string') {
throw new TypeError('hint must be "string" or "number"');
}
var methodNames = hint === 'string' ? ['toString', 'valueOf'] : ['valueOf', 'toString'];
var method, result, i;
for (i = 0; i < methodNames.length; ++i) {
method = O[methodNames[i]];
if (isCallable(method)) {
result = method.call(O);
if (isPrimitive(result)) {
return result;
}
}
}
throw new TypeError('No default value');
};
var GetMethod = function GetMethod(O, P) {
var func = O[P];
if (func !== null && typeof func !== 'undefined') {
if (!isCallable(func)) {
throw new TypeError(func + ' returned for property ' + P + ' of object ' + O + ' is not a function');
}
return func;
}
return void 0;
}; // http://www.ecma-international.org/ecma-262/6.0/#sec-toprimitive
module.exports = function ToPrimitive(input) {
if (isPrimitive(input)) {
return input;
}
var hint = 'default';
if (arguments.length > 1) {
if (arguments[1] === String) {
hint = 'string';
} else if (arguments[1] === Number) {
hint = 'number';
}
}
var exoticToPrim;
if (hasSymbols) {
if (Symbol.toPrimitive) {
exoticToPrim = GetMethod(input, Symbol.toPrimitive);
} else if (isSymbol(input)) {
exoticToPrim = Symbol.prototype.valueOf;
}
}
if (typeof exoticToPrim !== 'undefined') {
var result = exoticToPrim.call(input, hint);
if (isPrimitive(result)) {
return result;
}
throw new TypeError('unable to convert exotic object to primitive');
}
if (hint === 'default' && (isDate(input) || isSymbol(input))) {
hint = 'string';
}
return ordinaryToPrimitive(input, hint === 'default' ? 'number' : hint);
};
/***/ }),
/***/ "./node_modules/es-to-primitive/es5.js":
/*!*********************************************!*\
!*** ./node_modules/es-to-primitive/es5.js ***!
\*********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var toStr = Object.prototype.toString;
var isPrimitive = __webpack_require__(/*! ./helpers/isPrimitive */ "./node_modules/es-to-primitive/helpers/isPrimitive.js");
var isCallable = __webpack_require__(/*! is-callable */ "./node_modules/is-callable/index.js"); // http://ecma-international.org/ecma-262/5.1/#sec-8.12.8
var ES5internalSlots = {
'[[DefaultValue]]': function (O) {
var actualHint;
if (arguments.length > 1) {
actualHint = arguments[1];
} else {
actualHint = toStr.call(O) === '[object Date]' ? String : Number;
}
if (actualHint === String || actualHint === Number) {
var methods = actualHint === String ? ['toString', 'valueOf'] : ['valueOf', 'toString'];
var value, i;
for (i = 0; i < methods.length; ++i) {
if (isCallable(O[methods[i]])) {
value = O[methods[i]]();
if (isPrimitive(value)) {
return value;
}
}
}
throw new TypeError('No default value');
}
throw new TypeError('invalid [[DefaultValue]] hint supplied');
}
}; // http://ecma-international.org/ecma-262/5.1/#sec-9.1
module.exports = function ToPrimitive(input) {
if (isPrimitive(input)) {
return input;
}
if (arguments.length > 1) {
return ES5internalSlots['[[DefaultValue]]'](input, arguments[1]);
}
return ES5internalSlots['[[DefaultValue]]'](input);
};
/***/ }),
/***/ "./node_modules/es-to-primitive/es6.js":
/*!*********************************************!*\
!*** ./node_modules/es-to-primitive/es6.js ***!
\*********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
module.exports = __webpack_require__(/*! ./es2015 */ "./node_modules/es-to-primitive/es2015.js");
/***/ }),
/***/ "./node_modules/es-to-primitive/helpers/isPrimitive.js":
/*!*************************************************************!*\
!*** ./node_modules/es-to-primitive/helpers/isPrimitive.js ***!
\*************************************************************/
/*! no static exports found */
/***/ (function(module, exports) {
module.exports = function isPrimitive(value) {
return value === null || typeof value !== 'function' && typeof value !== 'object';
};
/***/ }),
/***/ "./node_modules/fast-memoize/src/index.js":
/*!************************************************!*\
!*** ./node_modules/fast-memoize/src/index.js ***!
\************************************************/
/*! no static exports found */
/***/ (function(module, exports) {
//
// Main
//
function memoize(fn, options) {
var cache = options && options.cache ? options.cache : cacheDefault;
var serializer = options && options.serializer ? options.serializer : serializerDefault;
var strategy = options && options.strategy ? options.strategy : strategyDefault;
return strategy(fn, {
cache: cache,
serializer: serializer
});
} //
// Strategy
//
function isPrimitive(value) {
return value == null || typeof value === 'number' || typeof value === 'boolean'; // || typeof value === "string" 'unsafe' primitive for our needs
}
function monadic(fn, cache, serializer, arg) {
var cacheKey = isPrimitive(arg) ? arg : serializer(arg);
var computedValue = cache.get(cacheKey);
if (typeof computedValue === 'undefined') {
computedValue = fn.call(this, arg);
cache.set(cacheKey, computedValue);
}
return computedValue;
}
function variadic(fn, cache, serializer) {
var args = Array.prototype.slice.call(arguments, 3);
var cacheKey = serializer(args);
var computedValue = cache.get(cacheKey);
if (typeof computedValue === 'undefined') {
computedValue = fn.apply(this, args);
cache.set(cacheKey, computedValue);
}
return computedValue;
}
function assemble(fn, context, strategy, cache, serialize) {
return strategy.bind(context, fn, cache, serialize);
}
function strategyDefault(fn, options) {
var strategy = fn.length === 1 ? monadic : variadic;
return assemble(fn, this, strategy, options.cache.create(), options.serializer);
}
function strategyVariadic(fn, options) {
var strategy = variadic;
return assemble(fn, this, strategy, options.cache.create(), options.serializer);
}
function strategyMonadic(fn, options) {
var strategy = monadic;
return assemble(fn, this, strategy, options.cache.create(), options.serializer);
} //
// Serializer
//
function serializerDefault() {
return JSON.stringify(arguments);
} //
// Cache
//
function ObjectWithoutPrototypeCache() {
this.cache = Object.create(null);
}
ObjectWithoutPrototypeCache.prototype.has = function (key) {
return key in this.cache;
};
ObjectWithoutPrototypeCache.prototype.get = function (key) {
return this.cache[key];
};
ObjectWithoutPrototypeCache.prototype.set = function (key, value) {
this.cache[key] = value;
};
var cacheDefault = {
create: function create() {
return new ObjectWithoutPrototypeCache();
}
}; //
// API
//
module.exports = memoize;
module.exports.strategies = {
variadic: strategyVariadic,
monadic: strategyMonadic
};
/***/ }),
/***/ "./node_modules/fbjs/lib/shallowEqual.js":
/*!***********************************************!*\
!*** ./node_modules/fbjs/lib/shallowEqual.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.
*
* @typechecks
*
*/
/*eslint-disable no-self-compare */
var hasOwnProperty = Object.prototype.hasOwnProperty;
/**
* 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
*/
function is(x, y) {
// SameValue algorithm
if (x === y) {
// Steps 1-5, 7-10
// Steps 6.b-6.e: +0 != -0
// Added the nonzero y check to make Flow happy, but it is redundant
return x !== 0 || y !== 0 || 1 / x === 1 / y;
} else {
// Step 6.a: NaN == NaN
return x !== x && y !== y;
}
}
/**
* Performs equality by iterating through keys on an object and returning false
* when any key has values which are not strictly equal between the arguments.
* Returns true when the values of all keys are strictly equal.
*/
function shallowEqual(objA, objB) {
if (is(objA, objB)) {
return true;
}
if (typeof objA !== 'object' || objA === null || typeof objB !== 'object' || objB === null) {
return false;
}
var keysA = Object.keys(objA);
var keysB = Object.keys(objB);
if (keysA.length !== keysB.length) {
return false;
} // Test for A's keys different from B.
for (var i = 0; i < keysA.length; i++) {
if (!hasOwnProperty.call(objB, keysA[i]) || !is(objA[keysA[i]], objB[keysA[i]])) {
return false;
}
}
return true;
}
module.exports = shallowEqual;
/***/ }),
/***/ "./node_modules/function-bind/implementation.js":
/*!******************************************************!*\
!*** ./node_modules/function-bind/implementation.js ***!
\******************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/* eslint no-invalid-this: 1 */
var ERROR_MESSAGE = 'Function.prototype.bind called on incompatible ';
var slice = Array.prototype.slice;
var toStr = Object.prototype.toString;
var funcType = '[object Function]';
module.exports = function bind(that) {
var target = this;
if (typeof target !== 'function' || toStr.call(target) !== funcType) {
throw new TypeError(ERROR_MESSAGE + target);
}
var args = slice.call(arguments, 1);
var bound;
var binder = function () {
if (this instanceof bound) {
var result = target.apply(this, args.concat(slice.call(arguments)));
if (Object(result) === result) {
return result;
}
return this;
} else {
return target.apply(that, args.concat(slice.call(arguments)));
}
};
var boundLength = Math.max(0, target.length - args.length);
var boundArgs = [];
for (var i = 0; i < boundLength; i++) {
boundArgs.push('$' + i);
}
bound = Function('binder', 'return function (' + boundArgs.join(',') + '){ return binder.apply(this,arguments); }')(binder);
if (target.prototype) {
var Empty = function Empty() {};
Empty.prototype = target.prototype;
bound.prototype = new Empty();
Empty.prototype = null;
}
return bound;
};
/***/ }),
/***/ "./node_modules/function-bind/index.js":
/*!*********************************************!*\
!*** ./node_modules/function-bind/index.js ***!
\*********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var implementation = __webpack_require__(/*! ./implementation */ "./node_modules/function-bind/implementation.js");
module.exports = Function.prototype.bind || implementation;
/***/ }),
/***/ "./node_modules/function.prototype.name/implementation.js":
/*!****************************************************************!*\
!*** ./node_modules/function.prototype.name/implementation.js ***!
\****************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var isCallable = __webpack_require__(/*! is-callable */ "./node_modules/is-callable/index.js");
var functionsHaveNames = __webpack_require__(/*! functions-have-names */ "./node_modules/functions-have-names/index.js")();
var bind = __webpack_require__(/*! function-bind */ "./node_modules/function-bind/index.js");
var functionToString = bind.call(Function.call, Function.prototype.toString);
var stringMatch = bind.call(Function.call, String.prototype.match);
var classRegex = /^class /;
var isClass = function isClassConstructor(fn) {
if (isCallable(fn)) {
return false;
}
if (typeof fn !== 'function') {
return false;
}
try {
var match = stringMatch(functionToString(fn), classRegex);
return !!match;
} catch (e) {}
return false;
};
var regex = /\s*function\s+([^(\s]*)\s*/;
var functionProto = Function.prototype;
module.exports = function getName() {
if (!isClass(this) && !isCallable(this)) {
throw new TypeError('Function.prototype.name sham getter called on non-function');
}
if (functionsHaveNames) {
return this.name;
}
if (this === functionProto) {
return '';
}
var str = functionToString(this);
var match = stringMatch(str, regex);
var name = match && match[1];
return name;
};
/***/ }),
/***/ "./node_modules/function.prototype.name/index.js":
/*!*******************************************************!*\
!*** ./node_modules/function.prototype.name/index.js ***!
\*******************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var define = __webpack_require__(/*! define-properties */ "./node_modules/define-properties/index.js");
var bind = __webpack_require__(/*! function-bind */ "./node_modules/function-bind/index.js");
var implementation = __webpack_require__(/*! ./implementation */ "./node_modules/function.prototype.name/implementation.js");
var getPolyfill = __webpack_require__(/*! ./polyfill */ "./node_modules/function.prototype.name/polyfill.js");
var shim = __webpack_require__(/*! ./shim */ "./node_modules/function.prototype.name/shim.js");
var bound = bind.call(Function.call, implementation);
define(bound, {
getPolyfill: getPolyfill,
implementation: implementation,
shim: shim
});
module.exports = bound;
/***/ }),
/***/ "./node_modules/function.prototype.name/polyfill.js":
/*!**********************************************************!*\
!*** ./node_modules/function.prototype.name/polyfill.js ***!
\**********************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var implementation = __webpack_require__(/*! ./implementation */ "./node_modules/function.prototype.name/implementation.js");
module.exports = function getPolyfill() {
return implementation;
};
/***/ }),
/***/ "./node_modules/function.prototype.name/shim.js":
/*!******************************************************!*\
!*** ./node_modules/function.prototype.name/shim.js ***!
\******************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var supportsDescriptors = __webpack_require__(/*! define-properties */ "./node_modules/define-properties/index.js").supportsDescriptors;
var functionsHaveNames = __webpack_require__(/*! functions-have-names */ "./node_modules/functions-have-names/index.js")();
var getPolyfill = __webpack_require__(/*! ./polyfill */ "./node_modules/function.prototype.name/polyfill.js");
var defineProperty = Object.defineProperty;
var TypeErr = TypeError;
module.exports = function shimName() {
var polyfill = getPolyfill();
if (functionsHaveNames) {
return polyfill;
}
if (!supportsDescriptors) {
throw new TypeErr('Shimming Function.prototype.name support requires ES5 property descriptor support.');
}
var functionProto = Function.prototype;
defineProperty(functionProto, 'name', {
configurable: true,
enumerable: false,
get: function () {
var name = polyfill.call(this);
if (this !== functionProto) {
defineProperty(this, 'name', {
configurable: true,
enumerable: false,
value: name,
writable: false
});
}
return name;
}
});
return polyfill;
};
/***/ }),
/***/ "./node_modules/functions-have-names/index.js":
/*!****************************************************!*\
!*** ./node_modules/functions-have-names/index.js ***!
\****************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var functionsHaveNames = function functionsHaveNames() {
return typeof function f() {}.name === 'string';
};
var gOPD = Object.getOwnPropertyDescriptor;
functionsHaveNames.functionsHaveConfigurableNames = function functionsHaveConfigurableNames() {
return functionsHaveNames() && gOPD && !!gOPD(function () {}, 'name').configurable;
};
module.exports = functionsHaveNames;
/***/ }),
/***/ "./node_modules/global-cache/index.js":
/*!********************************************!*\
!*** ./node_modules/global-cache/index.js ***!
\********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/* WEBPACK VAR INJECTION */(function(global) {
var define = __webpack_require__(/*! define-properties */ "./node_modules/define-properties/index.js");
var isSymbol = __webpack_require__(/*! is-symbol */ "./node_modules/is-symbol/index.js");
var globalKey = '__ global cache key __';
/* istanbul ignore else */
// eslint-disable-next-line no-restricted-properties
if (typeof Symbol === 'function' && isSymbol(Symbol('foo')) && typeof Symbol['for'] === 'function') {
// eslint-disable-next-line no-restricted-properties
globalKey = Symbol['for'](globalKey);
}
var trueThunk = function () {
return true;
};
var ensureCache = function ensureCache() {
if (!global[globalKey]) {
var properties = {};
properties[globalKey] = {};
var predicates = {};
predicates[globalKey] = trueThunk;
define(global, properties, predicates);
}
return global[globalKey];
};
var cache = ensureCache();
var isPrimitive = function isPrimitive(val) {
return val === null || typeof val !== 'object' && typeof val !== 'function';
};
var getPrimitiveKey = function getPrimitiveKey(val) {
if (isSymbol(val)) {
return Symbol.prototype.valueOf.call(val);
}
return typeof val + ' | ' + String(val);
};
var requirePrimitiveKey = function requirePrimitiveKey(val) {
if (!isPrimitive(val)) {
throw new TypeError('key must not be an object');
}
};
var globalCache = {
clear: function clear() {
delete global[globalKey];
cache = ensureCache();
},
'delete': function deleteKey(key) {
requirePrimitiveKey(key);
delete cache[getPrimitiveKey(key)];
return !globalCache.has(key);
},
get: function get(key) {
requirePrimitiveKey(key);
return cache[getPrimitiveKey(key)];
},
has: function has(key) {
requirePrimitiveKey(key);
return getPrimitiveKey(key) in cache;
},
set: function set(key, value) {
requirePrimitiveKey(key);
var primitiveKey = getPrimitiveKey(key);
var props = {};
props[primitiveKey] = value;
var predicates = {};
predicates[primitiveKey] = trueThunk;
define(cache, props, predicates);
return globalCache.has(key);
},
setIfMissingThenGet: function setIfMissingThenGet(key, valueThunk) {
if (globalCache.has(key)) {
return globalCache.get(key);
}
var item = valueThunk();
globalCache.set(key, item);
return item;
}
};
module.exports = globalCache;
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js")))
/***/ }),
/***/ "./node_modules/has-symbols/index.js":
/*!*******************************************!*\
!*** ./node_modules/has-symbols/index.js ***!
\*******************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/* WEBPACK VAR INJECTION */(function(global) {
var origSymbol = global.Symbol;
var hasSymbolSham = __webpack_require__(/*! ./shams */ "./node_modules/has-symbols/shams.js");
module.exports = function hasNativeSymbols() {
if (typeof origSymbol !== 'function') {
return false;
}
if (typeof Symbol !== 'function') {
return false;
}
if (typeof origSymbol('foo') !== 'symbol') {
return false;
}
if (typeof Symbol('bar') !== 'symbol') {
return false;
}
return hasSymbolSham();
};
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js")))
/***/ }),
/***/ "./node_modules/has-symbols/shams.js":
/*!*******************************************!*\
!*** ./node_modules/has-symbols/shams.js ***!
\*******************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/* eslint complexity: [2, 17], max-statements: [2, 33] */
module.exports = function hasSymbols() {
if (typeof Symbol !== 'function' || typeof Object.getOwnPropertySymbols !== 'function') {
return false;
}
if (typeof Symbol.iterator === 'symbol') {
return true;
}
var obj = {};
var sym = Symbol('test');
var symObj = Object(sym);
if (typeof sym === 'string') {
return false;
}
if (Object.prototype.toString.call(sym) !== '[object Symbol]') {
return false;
}
if (Object.prototype.toString.call(symObj) !== '[object Symbol]') {
return false;
} // temp disabled per https://github.com/ljharb/object.assign/issues/17
// if (sym instanceof Symbol) { return false; }
// temp disabled per https://github.com/WebReflection/get-own-property-symbols/issues/4
// if (!(symObj instanceof Symbol)) { return false; }
// if (typeof Symbol.prototype.toString !== 'function') { return false; }
// if (String(sym) !== Symbol.prototype.toString.call(sym)) { return false; }
var symVal = 42;
obj[sym] = symVal;
for (sym in obj) {
return false;
} // eslint-disable-line no-restricted-syntax
if (typeof Object.keys === 'function' && Object.keys(obj).length !== 0) {
return false;
}
if (typeof Object.getOwnPropertyNames === 'function' && Object.getOwnPropertyNames(obj).length !== 0) {
return false;
}
var syms = Object.getOwnPropertySymbols(obj);
if (syms.length !== 1 || syms[0] !== sym) {
return false;
}
if (!Object.prototype.propertyIsEnumerable.call(obj, sym)) {
return false;
}
if (typeof Object.getOwnPropertyDescriptor === 'function') {
var descriptor = Object.getOwnPropertyDescriptor(obj, sym);
if (descriptor.value !== symVal || descriptor.enumerable !== true) {
return false;
}
}
return true;
};
/***/ }),
/***/ "./node_modules/has/src/index.js":
/*!***************************************!*\
!*** ./node_modules/has/src/index.js ***!
\***************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var bind = __webpack_require__(/*! function-bind */ "./node_modules/function-bind/index.js");
module.exports = bind.call(Function.call, Object.prototype.hasOwnProperty);
/***/ }),
/***/ "./node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js":
/*!**********************************************************************************!*\
!*** ./node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.cjs.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 ReactIs = __webpack_require__(/*! react-is */ "./node_modules/react-is/index.js");
var REACT_STATICS = {
childContextTypes: true,
contextType: true,
contextTypes: true,
defaultProps: true,
displayName: true,
getDefaultProps: true,
getDerivedStateFromError: true,
getDerivedStateFromProps: true,
mixins: true,
propTypes: true,
type: true
};
var KNOWN_STATICS = {
name: true,
length: true,
prototype: true,
caller: true,
callee: true,
arguments: true,
arity: true
};
var FORWARD_REF_STATICS = {
'$$typeof': true,
render: true,
defaultProps: true,
displayName: true,
propTypes: true
};
var MEMO_STATICS = {
'$$typeof': true,
compare: true,
defaultProps: true,
displayName: true,
propTypes: true,
type: true
};
var TYPE_STATICS = {};
TYPE_STATICS[ReactIs.ForwardRef] = FORWARD_REF_STATICS;
function getStatics(component) {
if (ReactIs.isMemo(component)) {
return MEMO_STATICS;
}
return TYPE_STATICS[component['$$typeof']] || REACT_STATICS;
}
var defineProperty = Object.defineProperty;
var getOwnPropertyNames = Object.getOwnPropertyNames;
var getOwnPropertySymbols = Object.getOwnPropertySymbols;
var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
var getPrototypeOf = Object.getPrototypeOf;
var objectPrototype = Object.prototype;
function hoistNonReactStatics(targetComponent, sourceComponent, blacklist) {
if (typeof sourceComponent !== 'string') {
// don't hoist over string (html) components
if (objectPrototype) {
var inheritedComponent = getPrototypeOf(sourceComponent);
if (inheritedComponent && inheritedComponent !== objectPrototype) {
hoistNonReactStatics(targetComponent, inheritedComponent, blacklist);
}
}
var keys = getOwnPropertyNames(sourceComponent);
if (getOwnPropertySymbols) {
keys = keys.concat(getOwnPropertySymbols(sourceComponent));
}
var targetStatics = getStatics(targetComponent);
var sourceStatics = getStatics(sourceComponent);
for (var i = 0; i < keys.length; ++i) {
var key = keys[i];
if (!KNOWN_STATICS[key] && !(blacklist && blacklist[key]) && !(sourceStatics && sourceStatics[key]) && !(targetStatics && targetStatics[key])) {
var descriptor = getOwnPropertyDescriptor(sourceComponent, key);
try {
// Avoid failures from read-only properties
defineProperty(targetComponent, key, descriptor);
} catch (e) {}
}
}
return targetComponent;
}
return targetComponent;
}
module.exports = hoistNonReactStatics;
/***/ }),
/***/ "./node_modules/is-callable/index.js":
/*!*******************************************!*\
!*** ./node_modules/is-callable/index.js ***!
\*******************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var fnToStr = Function.prototype.toString;
var constructorRegex = /^\s*class\b/;
var isES6ClassFn = function isES6ClassFunction(value) {
try {
var fnStr = fnToStr.call(value);
return constructorRegex.test(fnStr);
} catch (e) {
return false; // not a function
}
};
var tryFunctionObject = function tryFunctionToStr(value) {
try {
if (isES6ClassFn(value)) {
return false;
}
fnToStr.call(value);
return true;
} catch (e) {
return false;
}
};
var toStr = Object.prototype.toString;
var fnClass = '[object Function]';
var genClass = '[object GeneratorFunction]';
var hasToStringTag = typeof Symbol === 'function' && typeof Symbol.toStringTag === 'symbol';
module.exports = function isCallable(value) {
if (!value) {
return false;
}
if (typeof value !== 'function' && typeof value !== 'object') {
return false;
}
if (typeof value === 'function' && !value.prototype) {
return true;
}
if (hasToStringTag) {
return tryFunctionObject(value);
}
if (isES6ClassFn(value)) {
return false;
}
var strClass = toStr.call(value);
return strClass === fnClass || strClass === genClass;
};
/***/ }),
/***/ "./node_modules/is-date-object/index.js":
/*!**********************************************!*\
!*** ./node_modules/is-date-object/index.js ***!
\**********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var getDay = Date.prototype.getDay;
var tryDateObject = function tryDateObject(value) {
try {
getDay.call(value);
return true;
} catch (e) {
return false;
}
};
var toStr = Object.prototype.toString;
var dateClass = '[object Date]';
var hasToStringTag = typeof Symbol === 'function' && typeof Symbol.toStringTag === 'symbol';
module.exports = function isDateObject(value) {
if (typeof value !== 'object' || value === null) {
return false;
}
return hasToStringTag ? tryDateObject(value) : toStr.call(value) === dateClass;
};
/***/ }),
/***/ "./node_modules/is-promise/index.js":
/*!******************************************!*\
!*** ./node_modules/is-promise/index.js ***!
\******************************************/
/*! no static exports found */
/***/ (function(module, exports) {
module.exports = isPromise;
function isPromise(obj) {
return !!obj && (typeof obj === 'object' || typeof obj === 'function') && typeof obj.then === 'function';
}
/***/ }),
/***/ "./node_modules/is-regex/index.js":
/*!****************************************!*\
!*** ./node_modules/is-regex/index.js ***!
\****************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var has = __webpack_require__(/*! has */ "./node_modules/has/src/index.js");
var regexExec = RegExp.prototype.exec;
var gOPD = Object.getOwnPropertyDescriptor;
var tryRegexExecCall = function tryRegexExec(value) {
try {
var lastIndex = value.lastIndex;
value.lastIndex = 0;
regexExec.call(value);
return true;
} catch (e) {
return false;
} finally {
value.lastIndex = lastIndex;
}
};
var toStr = Object.prototype.toString;
var regexClass = '[object RegExp]';
var hasToStringTag = typeof Symbol === 'function' && typeof Symbol.toStringTag === 'symbol';
module.exports = function isRegex(value) {
if (!value || typeof value !== 'object') {
return false;
}
if (!hasToStringTag) {
return toStr.call(value) === regexClass;
}
var descriptor = gOPD(value, 'lastIndex');
var hasLastIndexDataProperty = descriptor && has(descriptor, 'value');
if (!hasLastIndexDataProperty) {
return false;
}
return tryRegexExecCall(value);
};
/***/ }),
/***/ "./node_modules/is-symbol/index.js":
/*!*****************************************!*\
!*** ./node_modules/is-symbol/index.js ***!
\*****************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var toStr = Object.prototype.toString;
var hasSymbols = __webpack_require__(/*! has-symbols */ "./node_modules/has-symbols/index.js")();
if (hasSymbols) {
var symToStr = Symbol.prototype.toString;
var symStringRegex = /^Symbol\(.*\)$/;
var isSymbolObject = function isRealSymbolObject(value) {
if (typeof value.valueOf() !== 'symbol') {
return false;
}
return symStringRegex.test(symToStr.call(value));
};
module.exports = function isSymbol(value) {
if (typeof value === 'symbol') {
return true;
}
if (toStr.call(value) !== '[object Symbol]') {
return false;
}
try {
return isSymbolObject(value);
} catch (e) {
return false;
}
};
} else {
module.exports = function isSymbol(value) {
// this environment does not support Symbols.
return false && false;
};
}
/***/ }),
/***/ "./node_modules/is-touch-device/build/index.js":
/*!*****************************************************!*\
!*** ./node_modules/is-touch-device/build/index.js ***!
\*****************************************************/
/*! no static exports found */
/***/ (function(module, exports) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports['default'] = isTouchDevice;
function isTouchDevice() {
return !!(typeof window !== 'undefined' && ('ontouchstart' in window || window.DocumentTouch && typeof document !== 'undefined' && document instanceof window.DocumentTouch)) || !!(typeof navigator !== 'undefined' && (navigator.maxTouchPoints || navigator.msMaxTouchPoints));
}
module.exports = exports['default'];
/***/ }),
/***/ "./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/_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/_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/_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/_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/_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/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/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/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/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/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/memize/index.js":
/*!**************************************!*\
!*** ./node_modules/memize/index.js ***!
\**************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
module.exports = function memize(fn, options) {
var size = 0,
maxSize,
head,
tail;
if (options && options.maxSize) {
maxSize = options.maxSize;
}
function memoized()
/* ...args */
{
var node = head,
len = arguments.length,
args,
i;
searchCache: while (node) {
// Perform a shallow equality test to confirm that whether the node
// under test is a candidate for the arguments passed. Two arrays
// are shallowly equal if their length matches and each entry is
// strictly equal between the two sets. Avoid abstracting to a
// function which could incur an arguments leaking deoptimization.
// Check whether node arguments match arguments length
if (node.args.length !== arguments.length) {
node = node.next;
continue;
} // Check whether node arguments match arguments values
for (i = 0; i < len; i++) {
if (node.args[i] !== arguments[i]) {
node = node.next;
continue searchCache;
}
} // At this point we can assume we've found a match
// Surface matched node to head if not already
if (node !== head) {
// As tail, shift to previous. Must only shift if not also
// head, since if both head and tail, there is no previous.
if (node === tail) {
tail = node.prev;
} // Adjust siblings to point to each other. If node was tail,
// this also handles new tail's empty `next` assignment.
node.prev.next = node.next;
if (node.next) {
node.next.prev = node.prev;
}
node.next = head;
node.prev = null;
head.prev = node;
head = node;
} // Return immediately
return node.val;
} // No cached value found. Continue to insertion phase:
// Create a copy of arguments (avoid leaking deoptimization)
args = new Array(len);
for (i = 0; i < len; i++) {
args[i] = arguments[i];
}
node = {
args: args,
// Generate the result from original function
val: fn.apply(null, args)
}; // Don't need to check whether node is already head, since it would
// have been returned above already if it was
// Shift existing head down list
if (head) {
head.prev = node;
node.next = head;
} else {
// If no head, follows that there's no tail (at initial or reset)
tail = node;
} // Trim tail if we're reached max size and are pending cache insertion
if (size === maxSize) {
tail = tail.prev;
tail.next = null;
} else {
size++;
}
head = node;
return node.val;
}
memoized.clear = function () {
head = null;
tail = null;
size = 0;
};
if (false) {}
return memoized;
};
/***/ }),
/***/ "./node_modules/moment/locale sync recursive ^\\.\\/.*$":
/*!**************************************************!*\
!*** ./node_modules/moment/locale sync ^\.\/.*$ ***!
\**************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var map = {
"./af": "./node_modules/moment/locale/af.js",
"./af.js": "./node_modules/moment/locale/af.js",
"./ar": "./node_modules/moment/locale/ar.js",
"./ar-dz": "./node_modules/moment/locale/ar-dz.js",
"./ar-dz.js": "./node_modules/moment/locale/ar-dz.js",
"./ar-kw": "./node_modules/moment/locale/ar-kw.js",
"./ar-kw.js": "./node_modules/moment/locale/ar-kw.js",
"./ar-ly": "./node_modules/moment/locale/ar-ly.js",
"./ar-ly.js": "./node_modules/moment/locale/ar-ly.js",
"./ar-ma": "./node_modules/moment/locale/ar-ma.js",
"./ar-ma.js": "./node_modules/moment/locale/ar-ma.js",
"./ar-sa": "./node_modules/moment/locale/ar-sa.js",
"./ar-sa.js": "./node_modules/moment/locale/ar-sa.js",
"./ar-tn": "./node_modules/moment/locale/ar-tn.js",
"./ar-tn.js": "./node_modules/moment/locale/ar-tn.js",
"./ar.js": "./node_modules/moment/locale/ar.js",
"./az": "./node_modules/moment/locale/az.js",
"./az.js": "./node_modules/moment/locale/az.js",
"./be": "./node_modules/moment/locale/be.js",
"./be.js": "./node_modules/moment/locale/be.js",
"./bg": "./node_modules/moment/locale/bg.js",
"./bg.js": "./node_modules/moment/locale/bg.js",
"./bm": "./node_modules/moment/locale/bm.js",
"./bm.js": "./node_modules/moment/locale/bm.js",
"./bn": "./node_modules/moment/locale/bn.js",
"./bn.js": "./node_modules/moment/locale/bn.js",
"./bo": "./node_modules/moment/locale/bo.js",
"./bo.js": "./node_modules/moment/locale/bo.js",
"./br": "./node_modules/moment/locale/br.js",
"./br.js": "./node_modules/moment/locale/br.js",
"./bs": "./node_modules/moment/locale/bs.js",
"./bs.js": "./node_modules/moment/locale/bs.js",
"./ca": "./node_modules/moment/locale/ca.js",
"./ca.js": "./node_modules/moment/locale/ca.js",
"./cs": "./node_modules/moment/locale/cs.js",
"./cs.js": "./node_modules/moment/locale/cs.js",
"./cv": "./node_modules/moment/locale/cv.js",
"./cv.js": "./node_modules/moment/locale/cv.js",
"./cy": "./node_modules/moment/locale/cy.js",
"./cy.js": "./node_modules/moment/locale/cy.js",
"./da": "./node_modules/moment/locale/da.js",
"./da.js": "./node_modules/moment/locale/da.js",
"./de": "./node_modules/moment/locale/de.js",
"./de-at": "./node_modules/moment/locale/de-at.js",
"./de-at.js": "./node_modules/moment/locale/de-at.js",
"./de-ch": "./node_modules/moment/locale/de-ch.js",
"./de-ch.js": "./node_modules/moment/locale/de-ch.js",
"./de.js": "./node_modules/moment/locale/de.js",
"./dv": "./node_modules/moment/locale/dv.js",
"./dv.js": "./node_modules/moment/locale/dv.js",
"./el": "./node_modules/moment/locale/el.js",
"./el.js": "./node_modules/moment/locale/el.js",
"./en-SG": "./node_modules/moment/locale/en-SG.js",
"./en-SG.js": "./node_modules/moment/locale/en-SG.js",
"./en-au": "./node_modules/moment/locale/en-au.js",
"./en-au.js": "./node_modules/moment/locale/en-au.js",
"./en-ca": "./node_modules/moment/locale/en-ca.js",
"./en-ca.js": "./node_modules/moment/locale/en-ca.js",
"./en-gb": "./node_modules/moment/locale/en-gb.js",
"./en-gb.js": "./node_modules/moment/locale/en-gb.js",
"./en-ie": "./node_modules/moment/locale/en-ie.js",
"./en-ie.js": "./node_modules/moment/locale/en-ie.js",
"./en-il": "./node_modules/moment/locale/en-il.js",
"./en-il.js": "./node_modules/moment/locale/en-il.js",
"./en-nz": "./node_modules/moment/locale/en-nz.js",
"./en-nz.js": "./node_modules/moment/locale/en-nz.js",
"./eo": "./node_modules/moment/locale/eo.js",
"./eo.js": "./node_modules/moment/locale/eo.js",
"./es": "./node_modules/moment/locale/es.js",
"./es-do": "./node_modules/moment/locale/es-do.js",
"./es-do.js": "./node_modules/moment/locale/es-do.js",
"./es-us": "./node_modules/moment/locale/es-us.js",
"./es-us.js": "./node_modules/moment/locale/es-us.js",
"./es.js": "./node_modules/moment/locale/es.js",
"./et": "./node_modules/moment/locale/et.js",
"./et.js": "./node_modules/moment/locale/et.js",
"./eu": "./node_modules/moment/locale/eu.js",
"./eu.js": "./node_modules/moment/locale/eu.js",
"./fa": "./node_modules/moment/locale/fa.js",
"./fa.js": "./node_modules/moment/locale/fa.js",
"./fi": "./node_modules/moment/locale/fi.js",
"./fi.js": "./node_modules/moment/locale/fi.js",
"./fo": "./node_modules/moment/locale/fo.js",
"./fo.js": "./node_modules/moment/locale/fo.js",
"./fr": "./node_modules/moment/locale/fr.js",
"./fr-ca": "./node_modules/moment/locale/fr-ca.js",
"./fr-ca.js": "./node_modules/moment/locale/fr-ca.js",
"./fr-ch": "./node_modules/moment/locale/fr-ch.js",
"./fr-ch.js": "./node_modules/moment/locale/fr-ch.js",
"./fr.js": "./node_modules/moment/locale/fr.js",
"./fy": "./node_modules/moment/locale/fy.js",
"./fy.js": "./node_modules/moment/locale/fy.js",
"./ga": "./node_modules/moment/locale/ga.js",
"./ga.js": "./node_modules/moment/locale/ga.js",
"./gd": "./node_modules/moment/locale/gd.js",
"./gd.js": "./node_modules/moment/locale/gd.js",
"./gl": "./node_modules/moment/locale/gl.js",
"./gl.js": "./node_modules/moment/locale/gl.js",
"./gom-latn": "./node_modules/moment/locale/gom-latn.js",
"./gom-latn.js": "./node_modules/moment/locale/gom-latn.js",
"./gu": "./node_modules/moment/locale/gu.js",
"./gu.js": "./node_modules/moment/locale/gu.js",
"./he": "./node_modules/moment/locale/he.js",
"./he.js": "./node_modules/moment/locale/he.js",
"./hi": "./node_modules/moment/locale/hi.js",
"./hi.js": "./node_modules/moment/locale/hi.js",
"./hr": "./node_modules/moment/locale/hr.js",
"./hr.js": "./node_modules/moment/locale/hr.js",
"./hu": "./node_modules/moment/locale/hu.js",
"./hu.js": "./node_modules/moment/locale/hu.js",
"./hy-am": "./node_modules/moment/locale/hy-am.js",
"./hy-am.js": "./node_modules/moment/locale/hy-am.js",
"./id": "./node_modules/moment/locale/id.js",
"./id.js": "./node_modules/moment/locale/id.js",
"./is": "./node_modules/moment/locale/is.js",
"./is.js": "./node_modules/moment/locale/is.js",
"./it": "./node_modules/moment/locale/it.js",
"./it-ch": "./node_modules/moment/locale/it-ch.js",
"./it-ch.js": "./node_modules/moment/locale/it-ch.js",
"./it.js": "./node_modules/moment/locale/it.js",
"./ja": "./node_modules/moment/locale/ja.js",
"./ja.js": "./node_modules/moment/locale/ja.js",
"./jv": "./node_modules/moment/locale/jv.js",
"./jv.js": "./node_modules/moment/locale/jv.js",
"./ka": "./node_modules/moment/locale/ka.js",
"./ka.js": "./node_modules/moment/locale/ka.js",
"./kk": "./node_modules/moment/locale/kk.js",
"./kk.js": "./node_modules/moment/locale/kk.js",
"./km": "./node_modules/moment/locale/km.js",
"./km.js": "./node_modules/moment/locale/km.js",
"./kn": "./node_modules/moment/locale/kn.js",
"./kn.js": "./node_modules/moment/locale/kn.js",
"./ko": "./node_modules/moment/locale/ko.js",
"./ko.js": "./node_modules/moment/locale/ko.js",
"./ku": "./node_modules/moment/locale/ku.js",
"./ku.js": "./node_modules/moment/locale/ku.js",
"./ky": "./node_modules/moment/locale/ky.js",
"./ky.js": "./node_modules/moment/locale/ky.js",
"./lb": "./node_modules/moment/locale/lb.js",
"./lb.js": "./node_modules/moment/locale/lb.js",
"./lo": "./node_modules/moment/locale/lo.js",
"./lo.js": "./node_modules/moment/locale/lo.js",
"./lt": "./node_modules/moment/locale/lt.js",
"./lt.js": "./node_modules/moment/locale/lt.js",
"./lv": "./node_modules/moment/locale/lv.js",
"./lv.js": "./node_modules/moment/locale/lv.js",
"./me": "./node_modules/moment/locale/me.js",
"./me.js": "./node_modules/moment/locale/me.js",
"./mi": "./node_modules/moment/locale/mi.js",
"./mi.js": "./node_modules/moment/locale/mi.js",
"./mk": "./node_modules/moment/locale/mk.js",
"./mk.js": "./node_modules/moment/locale/mk.js",
"./ml": "./node_modules/moment/locale/ml.js",
"./ml.js": "./node_modules/moment/locale/ml.js",
"./mn": "./node_modules/moment/locale/mn.js",
"./mn.js": "./node_modules/moment/locale/mn.js",
"./mr": "./node_modules/moment/locale/mr.js",
"./mr.js": "./node_modules/moment/locale/mr.js",
"./ms": "./node_modules/moment/locale/ms.js",
"./ms-my": "./node_modules/moment/locale/ms-my.js",
"./ms-my.js": "./node_modules/moment/locale/ms-my.js",
"./ms.js": "./node_modules/moment/locale/ms.js",
"./mt": "./node_modules/moment/locale/mt.js",
"./mt.js": "./node_modules/moment/locale/mt.js",
"./my": "./node_modules/moment/locale/my.js",
"./my.js": "./node_modules/moment/locale/my.js",
"./nb": "./node_modules/moment/locale/nb.js",
"./nb.js": "./node_modules/moment/locale/nb.js",
"./ne": "./node_modules/moment/locale/ne.js",
"./ne.js": "./node_modules/moment/locale/ne.js",
"./nl": "./node_modules/moment/locale/nl.js",
"./nl-be": "./node_modules/moment/locale/nl-be.js",
"./nl-be.js": "./node_modules/moment/locale/nl-be.js",
"./nl.js": "./node_modules/moment/locale/nl.js",
"./nn": "./node_modules/moment/locale/nn.js",
"./nn.js": "./node_modules/moment/locale/nn.js",
"./pa-in": "./node_modules/moment/locale/pa-in.js",
"./pa-in.js": "./node_modules/moment/locale/pa-in.js",
"./pl": "./node_modules/moment/locale/pl.js",
"./pl.js": "./node_modules/moment/locale/pl.js",
"./pt": "./node_modules/moment/locale/pt.js",
"./pt-br": "./node_modules/moment/locale/pt-br.js",
"./pt-br.js": "./node_modules/moment/locale/pt-br.js",
"./pt.js": "./node_modules/moment/locale/pt.js",
"./ro": "./node_modules/moment/locale/ro.js",
"./ro.js": "./node_modules/moment/locale/ro.js",
"./ru": "./node_modules/moment/locale/ru.js",
"./ru.js": "./node_modules/moment/locale/ru.js",
"./sd": "./node_modules/moment/locale/sd.js",
"./sd.js": "./node_modules/moment/locale/sd.js",
"./se": "./node_modules/moment/locale/se.js",
"./se.js": "./node_modules/moment/locale/se.js",
"./si": "./node_modules/moment/locale/si.js",
"./si.js": "./node_modules/moment/locale/si.js",
"./sk": "./node_modules/moment/locale/sk.js",
"./sk.js": "./node_modules/moment/locale/sk.js",
"./sl": "./node_modules/moment/locale/sl.js",
"./sl.js": "./node_modules/moment/locale/sl.js",
"./sq": "./node_modules/moment/locale/sq.js",
"./sq.js": "./node_modules/moment/locale/sq.js",
"./sr": "./node_modules/moment/locale/sr.js",
"./sr-cyrl": "./node_modules/moment/locale/sr-cyrl.js",
"./sr-cyrl.js": "./node_modules/moment/locale/sr-cyrl.js",
"./sr.js": "./node_modules/moment/locale/sr.js",
"./ss": "./node_modules/moment/locale/ss.js",
"./ss.js": "./node_modules/moment/locale/ss.js",
"./sv": "./node_modules/moment/locale/sv.js",
"./sv.js": "./node_modules/moment/locale/sv.js",
"./sw": "./node_modules/moment/locale/sw.js",
"./sw.js": "./node_modules/moment/locale/sw.js",
"./ta": "./node_modules/moment/locale/ta.js",
"./ta.js": "./node_modules/moment/locale/ta.js",
"./te": "./node_modules/moment/locale/te.js",
"./te.js": "./node_modules/moment/locale/te.js",
"./tet": "./node_modules/moment/locale/tet.js",
"./tet.js": "./node_modules/moment/locale/tet.js",
"./tg": "./node_modules/moment/locale/tg.js",
"./tg.js": "./node_modules/moment/locale/tg.js",
"./th": "./node_modules/moment/locale/th.js",
"./th.js": "./node_modules/moment/locale/th.js",
"./tl-ph": "./node_modules/moment/locale/tl-ph.js",
"./tl-ph.js": "./node_modules/moment/locale/tl-ph.js",
"./tlh": "./node_modules/moment/locale/tlh.js",
"./tlh.js": "./node_modules/moment/locale/tlh.js",
"./tr": "./node_modules/moment/locale/tr.js",
"./tr.js": "./node_modules/moment/locale/tr.js",
"./tzl": "./node_modules/moment/locale/tzl.js",
"./tzl.js": "./node_modules/moment/locale/tzl.js",
"./tzm": "./node_modules/moment/locale/tzm.js",
"./tzm-latn": "./node_modules/moment/locale/tzm-latn.js",
"./tzm-latn.js": "./node_modules/moment/locale/tzm-latn.js",
"./tzm.js": "./node_modules/moment/locale/tzm.js",
"./ug-cn": "./node_modules/moment/locale/ug-cn.js",
"./ug-cn.js": "./node_modules/moment/locale/ug-cn.js",
"./uk": "./node_modules/moment/locale/uk.js",
"./uk.js": "./node_modules/moment/locale/uk.js",
"./ur": "./node_modules/moment/locale/ur.js",
"./ur.js": "./node_modules/moment/locale/ur.js",
"./uz": "./node_modules/moment/locale/uz.js",
"./uz-latn": "./node_modules/moment/locale/uz-latn.js",
"./uz-latn.js": "./node_modules/moment/locale/uz-latn.js",
"./uz.js": "./node_modules/moment/locale/uz.js",
"./vi": "./node_modules/moment/locale/vi.js",
"./vi.js": "./node_modules/moment/locale/vi.js",
"./x-pseudo": "./node_modules/moment/locale/x-pseudo.js",
"./x-pseudo.js": "./node_modules/moment/locale/x-pseudo.js",
"./yo": "./node_modules/moment/locale/yo.js",
"./yo.js": "./node_modules/moment/locale/yo.js",
"./zh-cn": "./node_modules/moment/locale/zh-cn.js",
"./zh-cn.js": "./node_modules/moment/locale/zh-cn.js",
"./zh-hk": "./node_modules/moment/locale/zh-hk.js",
"./zh-hk.js": "./node_modules/moment/locale/zh-hk.js",
"./zh-tw": "./node_modules/moment/locale/zh-tw.js",
"./zh-tw.js": "./node_modules/moment/locale/zh-tw.js"
};
function webpackContext(req) {
var id = webpackContextResolve(req);
return __webpack_require__(id);
}
function webpackContextResolve(req) {
if(!__webpack_require__.o(map, req)) {
var e = new Error("Cannot find module '" + req + "'");
e.code = 'MODULE_NOT_FOUND';
throw e;
}
return map[req];
}
webpackContext.keys = function webpackContextKeys() {
return Object.keys(map);
};
webpackContext.resolve = webpackContextResolve;
module.exports = webpackContext;
webpackContext.id = "./node_modules/moment/locale sync recursive ^\\.\\/.*$";
/***/ }),
/***/ "./node_modules/moment/locale/af.js":
/*!******************************************!*\
!*** ./node_modules/moment/locale/af.js ***!
\******************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
;
(function (global, factory) {
true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : undefined;
})(this, function (moment) {
'use strict';
var af = moment.defineLocale('af', {
months: 'Januarie_Februarie_Maart_April_Mei_Junie_Julie_Augustus_September_Oktober_November_Desember'.split('_'),
monthsShort: 'Jan_Feb_Mrt_Apr_Mei_Jun_Jul_Aug_Sep_Okt_Nov_Des'.split('_'),
weekdays: 'Sondag_Maandag_Dinsdag_Woensdag_Donderdag_Vrydag_Saterdag'.split('_'),
weekdaysShort: 'Son_Maa_Din_Woe_Don_Vry_Sat'.split('_'),
weekdaysMin: 'So_Ma_Di_Wo_Do_Vr_Sa'.split('_'),
meridiemParse: /vm|nm/i,
isPM: function (input) {
return /^nm$/i.test(input);
},
meridiem: function (hours, minutes, isLower) {
if (hours < 12) {
return isLower ? 'vm' : 'VM';
} else {
return isLower ? 'nm' : 'NM';
}
},
longDateFormat: {
LT: 'HH:mm',
LTS: 'HH:mm:ss',
L: 'DD/MM/YYYY',
LL: 'D MMMM YYYY',
LLL: 'D MMMM YYYY HH:mm',
LLLL: 'dddd, D MMMM YYYY HH:mm'
},
calendar: {
sameDay: '[Vandag om] LT',
nextDay: '[Môre om] LT',
nextWeek: 'dddd [om] LT',
lastDay: '[Gister om] LT',
lastWeek: '[Laas] dddd [om] LT',
sameElse: 'L'
},
relativeTime: {
future: 'oor %s',
past: '%s gelede',
s: '\'n paar sekondes',
ss: '%d sekondes',
m: '\'n minuut',
mm: '%d minute',
h: '\'n uur',
hh: '%d ure',
d: '\'n dag',
dd: '%d dae',
M: '\'n maand',
MM: '%d maande',
y: '\'n jaar',
yy: '%d jaar'
},
dayOfMonthOrdinalParse: /\d{1,2}(ste|de)/,
ordinal: function (number) {
return number + (number === 1 || number === 8 || number >= 20 ? 'ste' : 'de'); // Thanks to Joris Röling : https://github.com/jjupiter
},
week: {
dow: 1,
// Maandag is die eerste dag van die week.
doy: 4 // Die week wat die 4de Januarie bevat is die eerste week van die jaar.
}
});
return af;
});
/***/ }),
/***/ "./node_modules/moment/locale/ar-dz.js":
/*!*********************************************!*\
!*** ./node_modules/moment/locale/ar-dz.js ***!
\*********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
;
(function (global, factory) {
true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : undefined;
})(this, function (moment) {
'use strict';
var arDz = moment.defineLocale('ar-dz', {
months: 'جانفي_فيفري_مارس_أفريل_ماي_جوان_جويلية_أوت_سبتمبر_أكتوبر_نوفمبر_ديسمبر'.split('_'),
monthsShort: 'جانفي_فيفري_مارس_أفريل_ماي_جوان_جويلية_أوت_سبتمبر_أكتوبر_نوفمبر_ديسمبر'.split('_'),
weekdays: 'الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت'.split('_'),
weekdaysShort: 'احد_اثنين_ثلاثاء_اربعاء_خميس_جمعة_سبت'.split('_'),
weekdaysMin: 'أح_إث_ثلا_أر_خم_جم_سب'.split('_'),
weekdaysParseExact: true,
longDateFormat: {
LT: 'HH:mm',
LTS: 'HH:mm:ss',
L: 'DD/MM/YYYY',
LL: 'D MMMM YYYY',
LLL: 'D MMMM YYYY HH:mm',
LLLL: 'dddd D MMMM YYYY HH:mm'
},
calendar: {
sameDay: '[اليوم على الساعة] LT',
nextDay: '[غدا على الساعة] LT',
nextWeek: 'dddd [على الساعة] LT',
lastDay: '[أمس على الساعة] LT',
lastWeek: 'dddd [على الساعة] LT',
sameElse: 'L'
},
relativeTime: {
future: 'في %s',
past: 'منذ %s',
s: 'ثوان',
ss: '%d ثانية',
m: 'دقيقة',
mm: '%d دقائق',
h: 'ساعة',
hh: '%d ساعات',
d: 'يوم',
dd: '%d أيام',
M: 'شهر',
MM: '%d أشهر',
y: 'سنة',
yy: '%d سنوات'
},
week: {
dow: 0,
// Sunday is the first day of the week.
doy: 4 // The week that contains Jan 4th is the first week of the year.
}
});
return arDz;
});
/***/ }),
/***/ "./node_modules/moment/locale/ar-kw.js":
/*!*********************************************!*\
!*** ./node_modules/moment/locale/ar-kw.js ***!
\*********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
;
(function (global, factory) {
true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : undefined;
})(this, function (moment) {
'use strict';
var arKw = moment.defineLocale('ar-kw', {
months: 'يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر'.split('_'),
monthsShort: 'يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر'.split('_'),
weekdays: 'الأحد_الإتنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت'.split('_'),
weekdaysShort: 'احد_اتنين_ثلاثاء_اربعاء_خميس_جمعة_سبت'.split('_'),
weekdaysMin: 'ح_ن_ث_ر_خ_ج_س'.split('_'),
weekdaysParseExact: true,
longDateFormat: {
LT: 'HH:mm',
LTS: 'HH:mm:ss',
L: 'DD/MM/YYYY',
LL: 'D MMMM YYYY',
LLL: 'D MMMM YYYY HH:mm',
LLLL: 'dddd D MMMM YYYY HH:mm'
},
calendar: {
sameDay: '[اليوم على الساعة] LT',
nextDay: '[غدا على الساعة] LT',
nextWeek: 'dddd [على الساعة] LT',
lastDay: '[أمس على الساعة] LT',
lastWeek: 'dddd [على الساعة] LT',
sameElse: 'L'
},
relativeTime: {
future: 'في %s',
past: 'منذ %s',
s: 'ثوان',
ss: '%d ثانية',
m: 'دقيقة',
mm: '%d دقائق',
h: 'ساعة',
hh: '%d ساعات',
d: 'يوم',
dd: '%d أيام',
M: 'شهر',
MM: '%d أشهر',
y: 'سنة',
yy: '%d سنوات'
},
week: {
dow: 0,
// Sunday is the first day of the week.
doy: 12 // The week that contains Jan 12th is the first week of the year.
}
});
return arKw;
});
/***/ }),
/***/ "./node_modules/moment/locale/ar-ly.js":
/*!*********************************************!*\
!*** ./node_modules/moment/locale/ar-ly.js ***!
\*********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
;
(function (global, factory) {
true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : undefined;
})(this, function (moment) {
'use strict';
var symbolMap = {
'1': '1',
'2': '2',
'3': '3',
'4': '4',
'5': '5',
'6': '6',
'7': '7',
'8': '8',
'9': '9',
'0': '0'
},
pluralForm = function (n) {
return n === 0 ? 0 : n === 1 ? 1 : n === 2 ? 2 : n % 100 >= 3 && n % 100 <= 10 ? 3 : n % 100 >= 11 ? 4 : 5;
},
plurals = {
s: ['أقل من ثانية', 'ثانية واحدة', ['ثانيتان', 'ثانيتين'], '%d ثوان', '%d ثانية', '%d ثانية'],
m: ['أقل من دقيقة', 'دقيقة واحدة', ['دقيقتان', 'دقيقتين'], '%d دقائق', '%d دقيقة', '%d دقيقة'],
h: ['أقل من ساعة', 'ساعة واحدة', ['ساعتان', 'ساعتين'], '%d ساعات', '%d ساعة', '%d ساعة'],
d: ['أقل من يوم', 'يوم واحد', ['يومان', 'يومين'], '%d أيام', '%d يومًا', '%d يوم'],
M: ['أقل من شهر', 'شهر واحد', ['شهران', 'شهرين'], '%d أشهر', '%d شهرا', '%d شهر'],
y: ['أقل من عام', 'عام واحد', ['عامان', 'عامين'], '%d أعوام', '%d عامًا', '%d عام']
},
pluralize = function (u) {
return function (number, withoutSuffix, string, isFuture) {
var f = pluralForm(number),
str = plurals[u][pluralForm(number)];
if (f === 2) {
str = str[withoutSuffix ? 0 : 1];
}
return str.replace(/%d/i, number);
};
},
months = ['يناير', 'فبراير', 'مارس', 'أبريل', 'مايو', 'يونيو', 'يوليو', 'أغسطس', 'سبتمبر', 'أكتوبر', 'نوفمبر', 'ديسمبر'];
var arLy = moment.defineLocale('ar-ly', {
months: months,
monthsShort: months,
weekdays: 'الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت'.split('_'),
weekdaysShort: 'أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت'.split('_'),
weekdaysMin: 'ح_ن_ث_ر_خ_ج_س'.split('_'),
weekdaysParseExact: true,
longDateFormat: {
LT: 'HH:mm',
LTS: 'HH:mm:ss',
L: 'D/\u200FM/\u200FYYYY',
LL: 'D MMMM YYYY',
LLL: 'D MMMM YYYY HH:mm',
LLLL: 'dddd D MMMM YYYY HH:mm'
},
meridiemParse: /ص|م/,
isPM: function (input) {
return 'م' === input;
},
meridiem: function (hour, minute, isLower) {
if (hour < 12) {
return 'ص';
} else {
return 'م';
}
},
calendar: {
sameDay: '[اليوم عند الساعة] LT',
nextDay: '[غدًا عند الساعة] LT',
nextWeek: 'dddd [عند الساعة] LT',
lastDay: '[أمس عند الساعة] LT',
lastWeek: 'dddd [عند الساعة] LT',
sameElse: 'L'
},
relativeTime: {
future: 'بعد %s',
past: 'منذ %s',
s: pluralize('s'),
ss: pluralize('s'),
m: pluralize('m'),
mm: pluralize('m'),
h: pluralize('h'),
hh: pluralize('h'),
d: pluralize('d'),
dd: pluralize('d'),
M: pluralize('M'),
MM: pluralize('M'),
y: pluralize('y'),
yy: pluralize('y')
},
preparse: function (string) {
return string.replace(/،/g, ',');
},
postformat: function (string) {
return string.replace(/\d/g, function (match) {
return symbolMap[match];
}).replace(/,/g, '،');
},
week: {
dow: 6,
// Saturday is the first day of the week.
doy: 12 // The week that contains Jan 12th is the first week of the year.
}
});
return arLy;
});
/***/ }),
/***/ "./node_modules/moment/locale/ar-ma.js":
/*!*********************************************!*\
!*** ./node_modules/moment/locale/ar-ma.js ***!
\*********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
;
(function (global, factory) {
true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : undefined;
})(this, function (moment) {
'use strict';
var arMa = moment.defineLocale('ar-ma', {
months: 'يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر'.split('_'),
monthsShort: 'يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر'.split('_'),
weekdays: 'الأحد_الإتنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت'.split('_'),
weekdaysShort: 'احد_اتنين_ثلاثاء_اربعاء_خميس_جمعة_سبت'.split('_'),
weekdaysMin: 'ح_ن_ث_ر_خ_ج_س'.split('_'),
weekdaysParseExact: true,
longDateFormat: {
LT: 'HH:mm',
LTS: 'HH:mm:ss',
L: 'DD/MM/YYYY',
LL: 'D MMMM YYYY',
LLL: 'D MMMM YYYY HH:mm',
LLLL: 'dddd D MMMM YYYY HH:mm'
},
calendar: {
sameDay: '[اليوم على الساعة] LT',
nextDay: '[غدا على الساعة] LT',
nextWeek: 'dddd [على الساعة] LT',
lastDay: '[أمس على الساعة] LT',
lastWeek: 'dddd [على الساعة] LT',
sameElse: 'L'
},
relativeTime: {
future: 'في %s',
past: 'منذ %s',
s: 'ثوان',
ss: '%d ثانية',
m: 'دقيقة',
mm: '%d دقائق',
h: 'ساعة',
hh: '%d ساعات',
d: 'يوم',
dd: '%d أيام',
M: 'شهر',
MM: '%d أشهر',
y: 'سنة',
yy: '%d سنوات'
},
week: {
dow: 6,
// Saturday is the first day of the week.
doy: 12 // The week that contains Jan 12th is the first week of the year.
}
});
return arMa;
});
/***/ }),
/***/ "./node_modules/moment/locale/ar-sa.js":
/*!*********************************************!*\
!*** ./node_modules/moment/locale/ar-sa.js ***!
\*********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
;
(function (global, factory) {
true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : undefined;
})(this, function (moment) {
'use strict';
var symbolMap = {
'1': '١',
'2': '٢',
'3': '٣',
'4': '٤',
'5': '٥',
'6': '٦',
'7': '٧',
'8': '٨',
'9': '٩',
'0': '٠'
},
numberMap = {
'١': '1',
'٢': '2',
'٣': '3',
'٤': '4',
'٥': '5',
'٦': '6',
'٧': '7',
'٨': '8',
'٩': '9',
'٠': '0'
};
var arSa = moment.defineLocale('ar-sa', {
months: 'يناير_فبراير_مارس_أبريل_مايو_يونيو_يوليو_أغسطس_سبتمبر_أكتوبر_نوفمبر_ديسمبر'.split('_'),
monthsShort: 'يناير_فبراير_مارس_أبريل_مايو_يونيو_يوليو_أغسطس_سبتمبر_أكتوبر_نوفمبر_ديسمبر'.split('_'),
weekdays: 'الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت'.split('_'),
weekdaysShort: 'أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت'.split('_'),
weekdaysMin: 'ح_ن_ث_ر_خ_ج_س'.split('_'),
weekdaysParseExact: true,
longDateFormat: {
LT: 'HH:mm',
LTS: 'HH:mm:ss',
L: 'DD/MM/YYYY',
LL: 'D MMMM YYYY',
LLL: 'D MMMM YYYY HH:mm',
LLLL: 'dddd D MMMM YYYY HH:mm'
},
meridiemParse: /ص|م/,
isPM: function (input) {
return 'م' === input;
},
meridiem: function (hour, minute, isLower) {
if (hour < 12) {
return 'ص';
} else {
return 'م';
}
},
calendar: {
sameDay: '[اليوم على الساعة] LT',
nextDay: '[غدا على الساعة] LT',
nextWeek: 'dddd [على الساعة] LT',
lastDay: '[أمس على الساعة] LT',
lastWeek: 'dddd [على الساعة] LT',
sameElse: 'L'
},
relativeTime: {
future: 'في %s',
past: 'منذ %s',
s: 'ثوان',
ss: '%d ثانية',
m: 'دقيقة',
mm: '%d دقائق',
h: 'ساعة',
hh: '%d ساعات',
d: 'يوم',
dd: '%d أيام',
M: 'شهر',
MM: '%d أشهر',
y: 'سنة',
yy: '%d سنوات'
},
preparse: function (string) {
return string.replace(/[١٢٣٤٥٦٧٨٩٠]/g, function (match) {
return numberMap[match];
}).replace(/،/g, ',');
},
postformat: function (string) {
return string.replace(/\d/g, function (match) {
return symbolMap[match];
}).replace(/,/g, '،');
},
week: {
dow: 0,
// Sunday is the first day of the week.
doy: 6 // The week that contains Jan 6th is the first week of the year.
}
});
return arSa;
});
/***/ }),
/***/ "./node_modules/moment/locale/ar-tn.js":
/*!*********************************************!*\
!*** ./node_modules/moment/locale/ar-tn.js ***!
\*********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
;
(function (global, factory) {
true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : undefined;
})(this, function (moment) {
'use strict';
var arTn = moment.defineLocale('ar-tn', {
months: 'جانفي_فيفري_مارس_أفريل_ماي_جوان_جويلية_أوت_سبتمبر_أكتوبر_نوفمبر_ديسمبر'.split('_'),
monthsShort: 'جانفي_فيفري_مارس_أفريل_ماي_جوان_جويلية_أوت_سبتمبر_أكتوبر_نوفمبر_ديسمبر'.split('_'),
weekdays: 'الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت'.split('_'),
weekdaysShort: 'أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت'.split('_'),
weekdaysMin: 'ح_ن_ث_ر_خ_ج_س'.split('_'),
weekdaysParseExact: true,
longDateFormat: {
LT: 'HH:mm',
LTS: 'HH:mm:ss',
L: 'DD/MM/YYYY',
LL: 'D MMMM YYYY',
LLL: 'D MMMM YYYY HH:mm',
LLLL: 'dddd D MMMM YYYY HH:mm'
},
calendar: {
sameDay: '[اليوم على الساعة] LT',
nextDay: '[غدا على الساعة] LT',
nextWeek: 'dddd [على الساعة] LT',
lastDay: '[أمس على الساعة] LT',
lastWeek: 'dddd [على الساعة] LT',
sameElse: 'L'
},
relativeTime: {
future: 'في %s',
past: 'منذ %s',
s: 'ثوان',
ss: '%d ثانية',
m: 'دقيقة',
mm: '%d دقائق',
h: 'ساعة',
hh: '%d ساعات',
d: 'يوم',
dd: '%d أيام',
M: 'شهر',
MM: '%d أشهر',
y: 'سنة',
yy: '%d سنوات'
},
week: {
dow: 1,
// Monday is the first day of the week.
doy: 4 // The week that contains Jan 4th is the first week of the year.
}
});
return arTn;
});
/***/ }),
/***/ "./node_modules/moment/locale/ar.js":
/*!******************************************!*\
!*** ./node_modules/moment/locale/ar.js ***!
\******************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
;
(function (global, factory) {
true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : undefined;
})(this, function (moment) {
'use strict';
var symbolMap = {
'1': '١',
'2': '٢',
'3': '٣',
'4': '٤',
'5': '٥',
'6': '٦',
'7': '٧',
'8': '٨',
'9': '٩',
'0': '٠'
},
numberMap = {
'١': '1',
'٢': '2',
'٣': '3',
'٤': '4',
'٥': '5',
'٦': '6',
'٧': '7',
'٨': '8',
'٩': '9',
'٠': '0'
},
pluralForm = function (n) {
return n === 0 ? 0 : n === 1 ? 1 : n === 2 ? 2 : n % 100 >= 3 && n % 100 <= 10 ? 3 : n % 100 >= 11 ? 4 : 5;
},
plurals = {
s: ['أقل من ثانية', 'ثانية واحدة', ['ثانيتان', 'ثانيتين'], '%d ثوان', '%d ثانية', '%d ثانية'],
m: ['أقل من دقيقة', 'دقيقة واحدة', ['دقيقتان', 'دقيقتين'], '%d دقائق', '%d دقيقة', '%d دقيقة'],
h: ['أقل من ساعة', 'ساعة واحدة', ['ساعتان', 'ساعتين'], '%d ساعات', '%d ساعة', '%d ساعة'],
d: ['أقل من يوم', 'يوم واحد', ['يومان', 'يومين'], '%d أيام', '%d يومًا', '%d يوم'],
M: ['أقل من شهر', 'شهر واحد', ['شهران', 'شهرين'], '%d أشهر', '%d شهرا', '%d شهر'],
y: ['أقل من عام', 'عام واحد', ['عامان', 'عامين'], '%d أعوام', '%d عامًا', '%d عام']
},
pluralize = function (u) {
return function (number, withoutSuffix, string, isFuture) {
var f = pluralForm(number),
str = plurals[u][pluralForm(number)];
if (f === 2) {
str = str[withoutSuffix ? 0 : 1];
}
return str.replace(/%d/i, number);
};
},
months = ['يناير', 'فبراير', 'مارس', 'أبريل', 'مايو', 'يونيو', 'يوليو', 'أغسطس', 'سبتمبر', 'أكتوبر', 'نوفمبر', 'ديسمبر'];
var ar = moment.defineLocale('ar', {
months: months,
monthsShort: months,
weekdays: 'الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت'.split('_'),
weekdaysShort: 'أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت'.split('_'),
weekdaysMin: 'ح_ن_ث_ر_خ_ج_س'.split('_'),
weekdaysParseExact: true,
longDateFormat: {
LT: 'HH:mm',
LTS: 'HH:mm:ss',
L: 'D/\u200FM/\u200FYYYY',
LL: 'D MMMM YYYY',
LLL: 'D MMMM YYYY HH:mm',
LLLL: 'dddd D MMMM YYYY HH:mm'
},
meridiemParse: /ص|م/,
isPM: function (input) {
return 'م' === input;
},
meridiem: function (hour, minute, isLower) {
if (hour < 12) {
return 'ص';
} else {
return 'م';
}
},
calendar: {
sameDay: '[اليوم عند الساعة] LT',
nextDay: '[غدًا عند الساعة] LT',
nextWeek: 'dddd [عند الساعة] LT',
lastDay: '[أمس عند الساعة] LT',
lastWeek: 'dddd [عند الساعة] LT',
sameElse: 'L'
},
relativeTime: {
future: 'بعد %s',
past: 'منذ %s',
s: pluralize('s'),
ss: pluralize('s'),
m: pluralize('m'),
mm: pluralize('m'),
h: pluralize('h'),
hh: pluralize('h'),
d: pluralize('d'),
dd: pluralize('d'),
M: pluralize('M'),
MM: pluralize('M'),
y: pluralize('y'),
yy: pluralize('y')
},
preparse: function (string) {
return string.replace(/[١٢٣٤٥٦٧٨٩٠]/g, function (match) {
return numberMap[match];
}).replace(/،/g, ',');
},
postformat: function (string) {
return string.replace(/\d/g, function (match) {
return symbolMap[match];
}).replace(/,/g, '،');
},
week: {
dow: 6,
// Saturday is the first day of the week.
doy: 12 // The week that contains Jan 12th is the first week of the year.
}
});
return ar;
});
/***/ }),
/***/ "./node_modules/moment/locale/az.js":
/*!******************************************!*\
!*** ./node_modules/moment/locale/az.js ***!
\******************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
;
(function (global, factory) {
true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : undefined;
})(this, function (moment) {
'use strict';
var suffixes = {
1: '-inci',
5: '-inci',
8: '-inci',
70: '-inci',
80: '-inci',
2: '-nci',
7: '-nci',
20: '-nci',
50: '-nci',
3: '-üncü',
4: '-üncü',
100: '-üncü',
6: '-ncı',
9: '-uncu',
10: '-uncu',
30: '-uncu',
60: '-ıncı',
90: '-ıncı'
};
var az = moment.defineLocale('az', {
months: 'yanvar_fevral_mart_aprel_may_iyun_iyul_avqust_sentyabr_oktyabr_noyabr_dekabr'.split('_'),
monthsShort: 'yan_fev_mar_apr_may_iyn_iyl_avq_sen_okt_noy_dek'.split('_'),
weekdays: 'Bazar_Bazar ertəsi_Çərşənbə axşamı_Çərşənbə_Cümə axşamı_Cümə_Şənbə'.split('_'),
weekdaysShort: 'Baz_BzE_ÇAx_Çər_CAx_Cüm_Şən'.split('_'),
weekdaysMin: 'Bz_BE_ÇA_Çə_CA_Cü_Şə'.split('_'),
weekdaysParseExact: true,
longDateFormat: {
LT: 'HH:mm',
LTS: 'HH:mm:ss',
L: 'DD.MM.YYYY',
LL: 'D MMMM YYYY',
LLL: 'D MMMM YYYY HH:mm',
LLLL: 'dddd, D MMMM YYYY HH:mm'
},
calendar: {
sameDay: '[bugün saat] LT',
nextDay: '[sabah saat] LT',
nextWeek: '[gələn həftə] dddd [saat] LT',
lastDay: '[dünən] LT',
lastWeek: '[keçən həftə] dddd [saat] LT',
sameElse: 'L'
},
relativeTime: {
future: '%s sonra',
past: '%s əvvəl',
s: 'birneçə saniyə',
ss: '%d saniyə',
m: 'bir dəqiqə',
mm: '%d dəqiqə',
h: 'bir saat',
hh: '%d saat',
d: 'bir gün',
dd: '%d gün',
M: 'bir ay',
MM: '%d ay',
y: 'bir il',
yy: '%d il'
},
meridiemParse: /gecə|səhər|gündüz|axşam/,
isPM: function (input) {
return /^(gündüz|axşam)$/.test(input);
},
meridiem: function (hour, minute, isLower) {
if (hour < 4) {
return 'gecə';
} else if (hour < 12) {
return 'səhər';
} else if (hour < 17) {
return 'gündüz';
} else {
return 'axşam';
}
},
dayOfMonthOrdinalParse: /\d{1,2}-(ıncı|inci|nci|üncü|ncı|uncu)/,
ordinal: function (number) {
if (number === 0) {
// special case for zero
return number + '-ıncı';
}
var a = number % 10,
b = number % 100 - a,
c = number >= 100 ? 100 : null;
return number + (suffixes[a] || suffixes[b] || suffixes[c]);
},
week: {
dow: 1,
// Monday is the first day of the week.
doy: 7 // The week that contains Jan 7th is the first week of the year.
}
});
return az;
});
/***/ }),
/***/ "./node_modules/moment/locale/be.js":
/*!******************************************!*\
!*** ./node_modules/moment/locale/be.js ***!
\******************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
;
(function (global, factory) {
true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : undefined;
})(this, function (moment) {
'use strict';
function plural(word, num) {
var forms = word.split('_');
return num % 10 === 1 && num % 100 !== 11 ? forms[0] : num % 10 >= 2 && num % 10 <= 4 && (num % 100 < 10 || num % 100 >= 20) ? forms[1] : forms[2];
}
function relativeTimeWithPlural(number, withoutSuffix, key) {
var format = {
'ss': withoutSuffix ? 'секунда_секунды_секунд' : 'секунду_секунды_секунд',
'mm': withoutSuffix ? 'хвіліна_хвіліны_хвілін' : 'хвіліну_хвіліны_хвілін',
'hh': withoutSuffix ? 'гадзіна_гадзіны_гадзін' : 'гадзіну_гадзіны_гадзін',
'dd': 'дзень_дні_дзён',
'MM': 'месяц_месяцы_месяцаў',
'yy': 'год_гады_гадоў'
};
if (key === 'm') {
return withoutSuffix ? 'хвіліна' : 'хвіліну';
} else if (key === 'h') {
return withoutSuffix ? 'гадзіна' : 'гадзіну';
} else {
return number + ' ' + plural(format[key], +number);
}
}
var be = moment.defineLocale('be', {
months: {
format: 'студзеня_лютага_сакавіка_красавіка_траўня_чэрвеня_ліпеня_жніўня_верасня_кастрычніка_лістапада_снежня'.split('_'),
standalone: 'студзень_люты_сакавік_красавік_травень_чэрвень_ліпень_жнівень_верасень_кастрычнік_лістапад_снежань'.split('_')
},
monthsShort: 'студ_лют_сак_крас_трав_чэрв_ліп_жнів_вер_каст_ліст_снеж'.split('_'),
weekdays: {
format: 'нядзелю_панядзелак_аўторак_сераду_чацвер_пятніцу_суботу'.split('_'),
standalone: 'нядзеля_панядзелак_аўторак_серада_чацвер_пятніца_субота'.split('_'),
isFormat: /\[ ?[Ууў] ?(?:мінулую|наступную)? ?\] ?dddd/
},
weekdaysShort: 'нд_пн_ат_ср_чц_пт_сб'.split('_'),
weekdaysMin: 'нд_пн_ат_ср_чц_пт_сб'.split('_'),
longDateFormat: {
LT: 'HH:mm',
LTS: 'HH:mm:ss',
L: 'DD.MM.YYYY',
LL: 'D MMMM YYYY г.',
LLL: 'D MMMM YYYY г., HH:mm',
LLLL: 'dddd, D MMMM YYYY г., HH:mm'
},
calendar: {
sameDay: '[Сёння ў] LT',
nextDay: '[Заўтра ў] LT',
lastDay: '[Учора ў] LT',
nextWeek: function () {
return '[У] dddd [ў] LT';
},
lastWeek: function () {
switch (this.day()) {
case 0:
case 3:
case 5:
case 6:
return '[У мінулую] dddd [ў] LT';
case 1:
case 2:
case 4:
return '[У мінулы] dddd [ў] LT';
}
},
sameElse: 'L'
},
relativeTime: {
future: 'праз %s',
past: '%s таму',
s: 'некалькі секунд',
m: relativeTimeWithPlural,
mm: relativeTimeWithPlural,
h: relativeTimeWithPlural,
hh: relativeTimeWithPlural,
d: 'дзень',
dd: relativeTimeWithPlural,
M: 'месяц',
MM: relativeTimeWithPlural,
y: 'год',
yy: relativeTimeWithPlural
},
meridiemParse: /ночы|раніцы|дня|вечара/,
isPM: function (input) {
return /^(дня|вечара)$/.test(input);
},
meridiem: function (hour, minute, isLower) {
if (hour < 4) {
return 'ночы';
} else if (hour < 12) {
return 'раніцы';
} else if (hour < 17) {
return 'дня';
} else {
return 'вечара';
}
},
dayOfMonthOrdinalParse: /\d{1,2}-(і|ы|га)/,
ordinal: function (number, period) {
switch (period) {
case 'M':
case 'd':
case 'DDD':
case 'w':
case 'W':
return (number % 10 === 2 || number % 10 === 3) && number % 100 !== 12 && number % 100 !== 13 ? number + '-і' : number + '-ы';
case 'D':
return number + '-га';
default:
return number;
}
},
week: {
dow: 1,
// Monday is the first day of the week.
doy: 7 // The week that contains Jan 7th is the first week of the year.
}
});
return be;
});
/***/ }),
/***/ "./node_modules/moment/locale/bg.js":
/*!******************************************!*\
!*** ./node_modules/moment/locale/bg.js ***!
\******************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
;
(function (global, factory) {
true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : undefined;
})(this, function (moment) {
'use strict';
var bg = moment.defineLocale('bg', {
months: 'януари_февруари_март_април_май_юни_юли_август_септември_октомври_ноември_декември'.split('_'),
monthsShort: 'янр_фев_мар_апр_май_юни_юли_авг_сеп_окт_ное_дек'.split('_'),
weekdays: 'неделя_понеделник_вторник_сряда_четвъртък_петък_събота'.split('_'),
weekdaysShort: 'нед_пон_вто_сря_чет_пет_съб'.split('_'),
weekdaysMin: 'нд_пн_вт_ср_чт_пт_сб'.split('_'),
longDateFormat: {
LT: 'H:mm',
LTS: 'H:mm:ss',
L: 'D.MM.YYYY',
LL: 'D MMMM YYYY',
LLL: 'D MMMM YYYY H:mm',
LLLL: 'dddd, D MMMM YYYY H:mm'
},
calendar: {
sameDay: '[Днес в] LT',
nextDay: '[Утре в] LT',
nextWeek: 'dddd [в] LT',
lastDay: '[Вчера в] LT',
lastWeek: function () {
switch (this.day()) {
case 0:
case 3:
case 6:
return '[В изминалата] dddd [в] LT';
case 1:
case 2:
case 4:
case 5:
return '[В изминалия] dddd [в] LT';
}
},
sameElse: 'L'
},
relativeTime: {
future: 'след %s',
past: 'преди %s',
s: 'няколко секунди',
ss: '%d секунди',
m: 'минута',
mm: '%d минути',
h: 'час',
hh: '%d часа',
d: 'ден',
dd: '%d дни',
M: 'месец',
MM: '%d месеца',
y: 'година',
yy: '%d години'
},
dayOfMonthOrdinalParse: /\d{1,2}-(ев|ен|ти|ви|ри|ми)/,
ordinal: function (number) {
var lastDigit = number % 10,
last2Digits = number % 100;
if (number === 0) {
return number + '-ев';
} else if (last2Digits === 0) {
return number + '-ен';
} else if (last2Digits > 10 && last2Digits < 20) {
return number + '-ти';
} else if (lastDigit === 1) {
return number + '-ви';
} else if (lastDigit === 2) {
return number + '-ри';
} else if (lastDigit === 7 || lastDigit === 8) {
return number + '-ми';
} else {
return number + '-ти';
}
},
week: {
dow: 1,
// Monday is the first day of the week.
doy: 7 // The week that contains Jan 7th is the first week of the year.
}
});
return bg;
});
/***/ }),
/***/ "./node_modules/moment/locale/bm.js":
/*!******************************************!*\
!*** ./node_modules/moment/locale/bm.js ***!
\******************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
;
(function (global, factory) {
true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : undefined;
})(this, function (moment) {
'use strict';
var bm = moment.defineLocale('bm', {
months: 'Zanwuyekalo_Fewuruyekalo_Marisikalo_Awirilikalo_Mɛkalo_Zuwɛnkalo_Zuluyekalo_Utikalo_Sɛtanburukalo_ɔkutɔburukalo_Nowanburukalo_Desanburukalo'.split('_'),
monthsShort: 'Zan_Few_Mar_Awi_Mɛ_Zuw_Zul_Uti_Sɛt_ɔku_Now_Des'.split('_'),
weekdays: 'Kari_Ntɛnɛn_Tarata_Araba_Alamisa_Juma_Sibiri'.split('_'),
weekdaysShort: 'Kar_Ntɛ_Tar_Ara_Ala_Jum_Sib'.split('_'),
weekdaysMin: 'Ka_Nt_Ta_Ar_Al_Ju_Si'.split('_'),
longDateFormat: {
LT: 'HH:mm',
LTS: 'HH:mm:ss',
L: 'DD/MM/YYYY',
LL: 'MMMM [tile] D [san] YYYY',
LLL: 'MMMM [tile] D [san] YYYY [lɛrɛ] HH:mm',
LLLL: 'dddd MMMM [tile] D [san] YYYY [lɛrɛ] HH:mm'
},
calendar: {
sameDay: '[Bi lɛrɛ] LT',
nextDay: '[Sini lɛrɛ] LT',
nextWeek: 'dddd [don lɛrɛ] LT',
lastDay: '[Kunu lɛrɛ] LT',
lastWeek: 'dddd [tɛmɛnen lɛrɛ] LT',
sameElse: 'L'
},
relativeTime: {
future: '%s kɔnɔ',
past: 'a bɛ %s bɔ',
s: 'sanga dama dama',
ss: 'sekondi %d',
m: 'miniti kelen',
mm: 'miniti %d',
h: 'lɛrɛ kelen',
hh: 'lɛrɛ %d',
d: 'tile kelen',
dd: 'tile %d',
M: 'kalo kelen',
MM: 'kalo %d',
y: 'san kelen',
yy: 'san %d'
},
week: {
dow: 1,
// Monday is the first day of the week.
doy: 4 // The week that contains Jan 4th is the first week of the year.
}
});
return bm;
});
/***/ }),
/***/ "./node_modules/moment/locale/bn.js":
/*!******************************************!*\
!*** ./node_modules/moment/locale/bn.js ***!
\******************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
;
(function (global, factory) {
true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : undefined;
})(this, function (moment) {
'use strict';
var symbolMap = {
'1': '১',
'2': '২',
'3': '৩',
'4': '৪',
'5': '৫',
'6': '৬',
'7': '৭',
'8': '৮',
'9': '৯',
'0': '০'
},
numberMap = {
'১': '1',
'২': '2',
'৩': '3',
'৪': '4',
'৫': '5',
'৬': '6',
'৭': '7',
'৮': '8',
'৯': '9',
'০': '0'
};
var bn = moment.defineLocale('bn', {
months: 'জানুয়ারী_ফেব্রুয়ারি_মার্চ_এপ্রিল_মে_জুন_জুলাই_আগস্ট_সেপ্টেম্বর_অক্টোবর_নভেম্বর_ডিসেম্বর'.split('_'),
monthsShort: 'জানু_ফেব_মার্চ_এপ্র_মে_জুন_জুল_আগ_সেপ্ট_অক্টো_নভে_ডিসে'.split('_'),
weekdays: 'রবিবার_সোমবার_মঙ্গলবার_বুধবার_বৃহস্পতিবার_শুক্রবার_শনিবার'.split('_'),
weekdaysShort: 'রবি_সোম_মঙ্গল_বুধ_বৃহস্পতি_শুক্র_শনি'.split('_'),
weekdaysMin: 'রবি_সোম_মঙ্গ_বুধ_বৃহঃ_শুক্র_শনি'.split('_'),
longDateFormat: {
LT: 'A h:mm সময়',
LTS: 'A h:mm:ss সময়',
L: 'DD/MM/YYYY',
LL: 'D MMMM YYYY',
LLL: 'D MMMM YYYY, A h:mm সময়',
LLLL: 'dddd, D MMMM YYYY, A h:mm সময়'
},
calendar: {
sameDay: '[আজ] LT',
nextDay: '[আগামীকাল] LT',
nextWeek: 'dddd, LT',
lastDay: '[গতকাল] LT',
lastWeek: '[গত] dddd, LT',
sameElse: 'L'
},
relativeTime: {
future: '%s পরে',
past: '%s আগে',
s: 'কয়েক সেকেন্ড',
ss: '%d সেকেন্ড',
m: 'এক মিনিট',
mm: '%d মিনিট',
h: 'এক ঘন্টা',
hh: '%d ঘন্টা',
d: 'এক দিন',
dd: '%d দিন',
M: 'এক মাস',
MM: '%d মাস',
y: 'এক বছর',
yy: '%d বছর'
},
preparse: function (string) {
return string.replace(/[১২৩৪৫৬৭৮৯০]/g, function (match) {
return numberMap[match];
});
},
postformat: function (string) {
return string.replace(/\d/g, function (match) {
return symbolMap[match];
});
},
meridiemParse: /রাত|সকাল|দুপুর|বিকাল|রাত/,
meridiemHour: function (hour, meridiem) {
if (hour === 12) {
hour = 0;
}
if (meridiem === 'রাত' && hour >= 4 || meridiem === 'দুপুর' && hour < 5 || meridiem === 'বিকাল') {
return hour + 12;
} else {
return hour;
}
},
meridiem: function (hour, minute, isLower) {
if (hour < 4) {
return 'রাত';
} else if (hour < 10) {
return 'সকাল';
} else if (hour < 17) {
return 'দুপুর';
} else if (hour < 20) {
return 'বিকাল';
} else {
return 'রাত';
}
},
week: {
dow: 0,
// Sunday is the first day of the week.
doy: 6 // The week that contains Jan 6th is the first week of the year.
}
});
return bn;
});
/***/ }),
/***/ "./node_modules/moment/locale/bo.js":
/*!******************************************!*\
!*** ./node_modules/moment/locale/bo.js ***!
\******************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
;
(function (global, factory) {
true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : undefined;
})(this, function (moment) {
'use strict';
var symbolMap = {
'1': '༡',
'2': '༢',
'3': '༣',
'4': '༤',
'5': '༥',
'6': '༦',
'7': '༧',
'8': '༨',
'9': '༩',
'0': '༠'
},
numberMap = {
'༡': '1',
'༢': '2',
'༣': '3',
'༤': '4',
'༥': '5',
'༦': '6',
'༧': '7',
'༨': '8',
'༩': '9',
'༠': '0'
};
var bo = moment.defineLocale('bo', {
months: 'ཟླ་བ་དང་པོ_ཟླ་བ་གཉིས་པ_ཟླ་བ་གསུམ་པ_ཟླ་བ་བཞི་པ_ཟླ་བ་ལྔ་པ_ཟླ་བ་དྲུག་པ_ཟླ་བ་བདུན་པ_ཟླ་བ་བརྒྱད་པ_ཟླ་བ་དགུ་པ_ཟླ་བ་བཅུ་པ_ཟླ་བ་བཅུ་གཅིག་པ_ཟླ་བ་བཅུ་གཉིས་པ'.split('_'),
monthsShort: 'ཟླ་བ་དང་པོ_ཟླ་བ་གཉིས་པ_ཟླ་བ་གསུམ་པ_ཟླ་བ་བཞི་པ_ཟླ་བ་ལྔ་པ_ཟླ་བ་དྲུག་པ_ཟླ་བ་བདུན་པ_ཟླ་བ་བརྒྱད་པ_ཟླ་བ་དགུ་པ_ཟླ་བ་བཅུ་པ_ཟླ་བ་བཅུ་གཅིག་པ_ཟླ་བ་བཅུ་གཉིས་པ'.split('_'),
weekdays: 'གཟའ་ཉི་མ་_གཟའ་ཟླ་བ་_གཟའ་མིག་དམར་_གཟའ་ལྷག་པ་_གཟའ་ཕུར་བུ_གཟའ་པ་སངས་_གཟའ་སྤེན་པ་'.split('_'),
weekdaysShort: 'ཉི་མ་_ཟླ་བ་_མིག་དམར་_ལྷག་པ་_ཕུར་བུ_པ་སངས་_སྤེན་པ་'.split('_'),
weekdaysMin: 'ཉི་མ་_ཟླ་བ་_མིག་དམར་_ལྷག་པ་_ཕུར་བུ_པ་སངས་_སྤེན་པ་'.split('_'),
longDateFormat: {
LT: 'A h:mm',
LTS: 'A h:mm:ss',
L: 'DD/MM/YYYY',
LL: 'D MMMM YYYY',
LLL: 'D MMMM YYYY, A h:mm',
LLLL: 'dddd, D MMMM YYYY, A h:mm'
},
calendar: {
sameDay: '[དི་རིང] LT',
nextDay: '[སང་ཉིན] LT',
nextWeek: '[བདུན་ཕྲག་རྗེས་མ], LT',
lastDay: '[ཁ་སང] LT',
lastWeek: '[བདུན་ཕྲག་མཐའ་མ] dddd, LT',
sameElse: 'L'
},
relativeTime: {
future: '%s ལ་',
past: '%s སྔན་ལ',
s: 'ལམ་སང',
ss: '%d སྐར་ཆ།',
m: 'སྐར་མ་གཅིག',
mm: '%d སྐར་མ',
h: 'ཆུ་ཚོད་གཅིག',
hh: '%d ཆུ་ཚོད',
d: 'ཉིན་གཅིག',
dd: '%d ཉིན་',
M: 'ཟླ་བ་གཅིག',
MM: '%d ཟླ་བ',
y: 'ལོ་གཅིག',
yy: '%d ལོ'
},
preparse: function (string) {
return string.replace(/[༡༢༣༤༥༦༧༨༩༠]/g, function (match) {
return numberMap[match];
});
},
postformat: function (string) {
return string.replace(/\d/g, function (match) {
return symbolMap[match];
});
},
meridiemParse: /མཚན་མོ|ཞོགས་ཀས|ཉིན་གུང|དགོང་དག|མཚན་མོ/,
meridiemHour: function (hour, meridiem) {
if (hour === 12) {
hour = 0;
}
if (meridiem === 'མཚན་མོ' && hour >= 4 || meridiem === 'ཉིན་གུང' && hour < 5 || meridiem === 'དགོང་དག') {
return hour + 12;
} else {
return hour;
}
},
meridiem: function (hour, minute, isLower) {
if (hour < 4) {
return 'མཚན་མོ';
} else if (hour < 10) {
return 'ཞོགས་ཀས';
} else if (hour < 17) {
return 'ཉིན་གུང';
} else if (hour < 20) {
return 'དགོང་དག';
} else {
return 'མཚན་མོ';
}
},
week: {
dow: 0,
// Sunday is the first day of the week.
doy: 6 // The week that contains Jan 6th is the first week of the year.
}
});
return bo;
});
/***/ }),
/***/ "./node_modules/moment/locale/br.js":
/*!******************************************!*\
!*** ./node_modules/moment/locale/br.js ***!
\******************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
;
(function (global, factory) {
true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : undefined;
})(this, function (moment) {
'use strict';
function relativeTimeWithMutation(number, withoutSuffix, key) {
var format = {
'mm': 'munutenn',
'MM': 'miz',
'dd': 'devezh'
};
return number + ' ' + mutation(format[key], number);
}
function specialMutationForYears(number) {
switch (lastNumber(number)) {
case 1:
case 3:
case 4:
case 5:
case 9:
return number + ' bloaz';
default:
return number + ' vloaz';
}
}
function lastNumber(number) {
if (number > 9) {
return lastNumber(number % 10);
}
return number;
}
function mutation(text, number) {
if (number === 2) {
return softMutation(text);
}
return text;
}
function softMutation(text) {
var mutationTable = {
'm': 'v',
'b': 'v',
'd': 'z'
};
if (mutationTable[text.charAt(0)] === undefined) {
return text;
}
return mutationTable[text.charAt(0)] + text.substring(1);
}
var br = moment.defineLocale('br', {
months: 'Genver_C\'hwevrer_Meurzh_Ebrel_Mae_Mezheven_Gouere_Eost_Gwengolo_Here_Du_Kerzu'.split('_'),
monthsShort: 'Gen_C\'hwe_Meu_Ebr_Mae_Eve_Gou_Eos_Gwe_Her_Du_Ker'.split('_'),
weekdays: 'Sul_Lun_Meurzh_Merc\'her_Yaou_Gwener_Sadorn'.split('_'),
weekdaysShort: 'Sul_Lun_Meu_Mer_Yao_Gwe_Sad'.split('_'),
weekdaysMin: 'Su_Lu_Me_Mer_Ya_Gw_Sa'.split('_'),
weekdaysParseExact: true,
longDateFormat: {
LT: 'h[e]mm A',
LTS: 'h[e]mm:ss A',
L: 'DD/MM/YYYY',
LL: 'D [a viz] MMMM YYYY',
LLL: 'D [a viz] MMMM YYYY h[e]mm A',
LLLL: 'dddd, D [a viz] MMMM YYYY h[e]mm A'
},
calendar: {
sameDay: '[Hiziv da] LT',
nextDay: '[Warc\'hoazh da] LT',
nextWeek: 'dddd [da] LT',
lastDay: '[Dec\'h da] LT',
lastWeek: 'dddd [paset da] LT',
sameElse: 'L'
},
relativeTime: {
future: 'a-benn %s',
past: '%s \'zo',
s: 'un nebeud segondennoù',
ss: '%d eilenn',
m: 'ur vunutenn',
mm: relativeTimeWithMutation,
h: 'un eur',
hh: '%d eur',
d: 'un devezh',
dd: relativeTimeWithMutation,
M: 'ur miz',
MM: relativeTimeWithMutation,
y: 'ur bloaz',
yy: specialMutationForYears
},
dayOfMonthOrdinalParse: /\d{1,2}(añ|vet)/,
ordinal: function (number) {
var output = number === 1 ? 'añ' : 'vet';
return number + output;
},
week: {
dow: 1,
// Monday is the first day of the week.
doy: 4 // The week that contains Jan 4th is the first week of the year.
}
});
return br;
});
/***/ }),
/***/ "./node_modules/moment/locale/bs.js":
/*!******************************************!*\
!*** ./node_modules/moment/locale/bs.js ***!
\******************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
;
(function (global, factory) {
true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : undefined;
})(this, function (moment) {
'use strict';
function translate(number, withoutSuffix, key) {
var result = number + ' ';
switch (key) {
case 'ss':
if (number === 1) {
result += 'sekunda';
} else if (number === 2 || number === 3 || number === 4) {
result += 'sekunde';
} else {
result += 'sekundi';
}
return result;
case 'm':
return withoutSuffix ? 'jedna minuta' : 'jedne minute';
case 'mm':
if (number === 1) {
result += 'minuta';
} else if (number === 2 || number === 3 || number === 4) {
result += 'minute';
} else {
result += 'minuta';
}
return result;
case 'h':
return withoutSuffix ? 'jedan sat' : 'jednog sata';
case 'hh':
if (number === 1) {
result += 'sat';
} else if (number === 2 || number === 3 || number === 4) {
result += 'sata';
} else {
result += 'sati';
}
return result;
case 'dd':
if (number === 1) {
result += 'dan';
} else {
result += 'dana';
}
return result;
case 'MM':
if (number === 1) {
result += 'mjesec';
} else if (number === 2 || number === 3 || number === 4) {
result += 'mjeseca';
} else {
result += 'mjeseci';
}
return result;
case 'yy':
if (number === 1) {
result += 'godina';
} else if (number === 2 || number === 3 || number === 4) {
result += 'godine';
} else {
result += 'godina';
}
return result;
}
}
var bs = moment.defineLocale('bs', {
months: 'januar_februar_mart_april_maj_juni_juli_august_septembar_oktobar_novembar_decembar'.split('_'),
monthsShort: 'jan._feb._mar._apr._maj._jun._jul._aug._sep._okt._nov._dec.'.split('_'),
monthsParseExact: true,
weekdays: 'nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota'.split('_'),
weekdaysShort: 'ned._pon._uto._sri._čet._pet._sub.'.split('_'),
weekdaysMin: 'ne_po_ut_sr_če_pe_su'.split('_'),
weekdaysParseExact: true,
longDateFormat: {
LT: 'H:mm',
LTS: 'H:mm:ss',
L: 'DD.MM.YYYY',
LL: 'D. MMMM YYYY',
LLL: 'D. MMMM YYYY H:mm',
LLLL: 'dddd, D. MMMM YYYY H:mm'
},
calendar: {
sameDay: '[danas u] LT',
nextDay: '[sutra u] LT',
nextWeek: function () {
switch (this.day()) {
case 0:
return '[u] [nedjelju] [u] LT';
case 3:
return '[u] [srijedu] [u] LT';
case 6:
return '[u] [subotu] [u] LT';
case 1:
case 2:
case 4:
case 5:
return '[u] dddd [u] LT';
}
},
lastDay: '[jučer u] LT',
lastWeek: function () {
switch (this.day()) {
case 0:
case 3:
return '[prošlu] dddd [u] LT';
case 6:
return '[prošle] [subote] [u] LT';
case 1:
case 2:
case 4:
case 5:
return '[prošli] dddd [u] LT';
}
},
sameElse: 'L'
},
relativeTime: {
future: 'za %s',
past: 'prije %s',
s: 'par sekundi',
ss: translate,
m: translate,
mm: translate,
h: translate,
hh: translate,
d: 'dan',
dd: translate,
M: 'mjesec',
MM: translate,
y: 'godinu',
yy: translate
},
dayOfMonthOrdinalParse: /\d{1,2}\./,
ordinal: '%d.',
week: {
dow: 1,
// Monday is the first day of the week.
doy: 7 // The week that contains Jan 7th is the first week of the year.
}
});
return bs;
});
/***/ }),
/***/ "./node_modules/moment/locale/ca.js":
/*!******************************************!*\
!*** ./node_modules/moment/locale/ca.js ***!
\******************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
;
(function (global, factory) {
true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : undefined;
})(this, function (moment) {
'use strict';
var ca = moment.defineLocale('ca', {
months: {
standalone: 'gener_febrer_març_abril_maig_juny_juliol_agost_setembre_octubre_novembre_desembre'.split('_'),
format: 'de gener_de febrer_de març_d\'abril_de maig_de juny_de juliol_d\'agost_de setembre_d\'octubre_de novembre_de desembre'.split('_'),
isFormat: /D[oD]?(\s)+MMMM/
},
monthsShort: 'gen._febr._març_abr._maig_juny_jul._ag._set._oct._nov._des.'.split('_'),
monthsParseExact: true,
weekdays: 'diumenge_dilluns_dimarts_dimecres_dijous_divendres_dissabte'.split('_'),
weekdaysShort: 'dg._dl._dt._dc._dj._dv._ds.'.split('_'),
weekdaysMin: 'dg_dl_dt_dc_dj_dv_ds'.split('_'),
weekdaysParseExact: true,
longDateFormat: {
LT: 'H:mm',
LTS: 'H:mm:ss',
L: 'DD/MM/YYYY',
LL: 'D MMMM [de] YYYY',
ll: 'D MMM YYYY',
LLL: 'D MMMM [de] YYYY [a les] H:mm',
lll: 'D MMM YYYY, H:mm',
LLLL: 'dddd D MMMM [de] YYYY [a les] H:mm',
llll: 'ddd D MMM YYYY, H:mm'
},
calendar: {
sameDay: function () {
return '[avui a ' + (this.hours() !== 1 ? 'les' : 'la') + '] LT';
},
nextDay: function () {
return '[demà a ' + (this.hours() !== 1 ? 'les' : 'la') + '] LT';
},
nextWeek: function () {
return 'dddd [a ' + (this.hours() !== 1 ? 'les' : 'la') + '] LT';
},
lastDay: function () {
return '[ahir a ' + (this.hours() !== 1 ? 'les' : 'la') + '] LT';
},
lastWeek: function () {
return '[el] dddd [passat a ' + (this.hours() !== 1 ? 'les' : 'la') + '] LT';
},
sameElse: 'L'
},
relativeTime: {
future: 'd\'aquí %s',
past: 'fa %s',
s: 'uns segons',
ss: '%d segons',
m: 'un minut',
mm: '%d minuts',
h: 'una hora',
hh: '%d hores',
d: 'un dia',
dd: '%d dies',
M: 'un mes',
MM: '%d mesos',
y: 'un any',
yy: '%d anys'
},
dayOfMonthOrdinalParse: /\d{1,2}(r|n|t|è|a)/,
ordinal: function (number, period) {
var output = number === 1 ? 'r' : number === 2 ? 'n' : number === 3 ? 'r' : number === 4 ? 't' : 'è';
if (period === 'w' || period === 'W') {
output = 'a';
}
return number + output;
},
week: {
dow: 1,
// Monday is the first day of the week.
doy: 4 // The week that contains Jan 4th is the first week of the year.
}
});
return ca;
});
/***/ }),
/***/ "./node_modules/moment/locale/cs.js":
/*!******************************************!*\
!*** ./node_modules/moment/locale/cs.js ***!
\******************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
;
(function (global, factory) {
true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : undefined;
})(this, function (moment) {
'use strict';
var months = 'leden_únor_březen_duben_květen_červen_červenec_srpen_září_říjen_listopad_prosinec'.split('_'),
monthsShort = 'led_úno_bře_dub_kvě_čvn_čvc_srp_zář_říj_lis_pro'.split('_');
var monthsParse = [/^led/i, /^úno/i, /^bře/i, /^dub/i, /^kvě/i, /^(čvn|červen$|června)/i, /^(čvc|červenec|července)/i, /^srp/i, /^zář/i, /^říj/i, /^lis/i, /^pro/i]; // NOTE: 'červen' is substring of 'červenec'; therefore 'červenec' must precede 'červen' in the regex to be fully matched.
// Otherwise parser matches '1. červenec' as '1. červen' + 'ec'.
var monthsRegex = /^(leden|únor|březen|duben|květen|červenec|července|červen|června|srpen|září|říjen|listopad|prosinec|led|úno|bře|dub|kvě|čvn|čvc|srp|zář|říj|lis|pro)/i;
function plural(n) {
return n > 1 && n < 5 && ~~(n / 10) !== 1;
}
function translate(number, withoutSuffix, key, isFuture) {
var result = number + ' ';
switch (key) {
case 's':
// a few seconds / in a few seconds / a few seconds ago
return withoutSuffix || isFuture ? 'pár sekund' : 'pár sekundami';
case 'ss':
// 9 seconds / in 9 seconds / 9 seconds ago
if (withoutSuffix || isFuture) {
return result + (plural(number) ? 'sekundy' : 'sekund');
} else {
return result + 'sekundami';
}
break;
case 'm':
// a minute / in a minute / a minute ago
return withoutSuffix ? 'minuta' : isFuture ? 'minutu' : 'minutou';
case 'mm':
// 9 minutes / in 9 minutes / 9 minutes ago
if (withoutSuffix || isFuture) {
return result + (plural(number) ? 'minuty' : 'minut');
} else {
return result + 'minutami';
}
break;
case 'h':
// an hour / in an hour / an hour ago
return withoutSuffix ? 'hodina' : isFuture ? 'hodinu' : 'hodinou';
case 'hh':
// 9 hours / in 9 hours / 9 hours ago
if (withoutSuffix || isFuture) {
return result + (plural(number) ? 'hodiny' : 'hodin');
} else {
return result + 'hodinami';
}
break;
case 'd':
// a day / in a day / a day ago
return withoutSuffix || isFuture ? 'den' : 'dnem';
case 'dd':
// 9 days / in 9 days / 9 days ago
if (withoutSuffix || isFuture) {
return result + (plural(number) ? 'dny' : 'dní');
} else {
return result + 'dny';
}
break;
case 'M':
// a month / in a month / a month ago
return withoutSuffix || isFuture ? 'měsíc' : 'měsícem';
case 'MM':
// 9 months / in 9 months / 9 months ago
if (withoutSuffix || isFuture) {
return result + (plural(number) ? 'měsíce' : 'měsíců');
} else {
return result + 'měsíci';
}
break;
case 'y':
// a year / in a year / a year ago
return withoutSuffix || isFuture ? 'rok' : 'rokem';
case 'yy':
// 9 years / in 9 years / 9 years ago
if (withoutSuffix || isFuture) {
return result + (plural(number) ? 'roky' : 'let');
} else {
return result + 'lety';
}
break;
}
}
var cs = moment.defineLocale('cs', {
months: months,
monthsShort: monthsShort,
monthsRegex: monthsRegex,
monthsShortRegex: monthsRegex,
// NOTE: 'červen' is substring of 'červenec'; therefore 'červenec' must precede 'červen' in the regex to be fully matched.
// Otherwise parser matches '1. červenec' as '1. červen' + 'ec'.
monthsStrictRegex: /^(leden|ledna|února|únor|březen|března|duben|dubna|květen|května|červenec|července|červen|června|srpen|srpna|září|říjen|října|listopadu|listopad|prosinec|prosince)/i,
monthsShortStrictRegex: /^(led|úno|bře|dub|kvě|čvn|čvc|srp|zář|říj|lis|pro)/i,
monthsParse: monthsParse,
longMonthsParse: monthsParse,
shortMonthsParse: monthsParse,
weekdays: 'neděle_pondělí_úterý_středa_čtvrtek_pátek_sobota'.split('_'),
weekdaysShort: 'ne_po_út_st_čt_pá_so'.split('_'),
weekdaysMin: 'ne_po_út_st_čt_pá_so'.split('_'),
longDateFormat: {
LT: 'H:mm',
LTS: 'H:mm:ss',
L: 'DD.MM.YYYY',
LL: 'D. MMMM YYYY',
LLL: 'D. MMMM YYYY H:mm',
LLLL: 'dddd D. MMMM YYYY H:mm',
l: 'D. M. YYYY'
},
calendar: {
sameDay: '[dnes v] LT',
nextDay: '[zítra v] LT',
nextWeek: function () {
switch (this.day()) {
case 0:
return '[v neděli v] LT';
case 1:
case 2:
return '[v] dddd [v] LT';
case 3:
return '[ve středu v] LT';
case 4:
return '[ve čtvrtek v] LT';
case 5:
return '[v pátek v] LT';
case 6:
return '[v sobotu v] LT';
}
},
lastDay: '[včera v] LT',
lastWeek: function () {
switch (this.day()) {
case 0:
return '[minulou neděli v] LT';
case 1:
case 2:
return '[minulé] dddd [v] LT';
case 3:
return '[minulou středu v] LT';
case 4:
case 5:
return '[minulý] dddd [v] LT';
case 6:
return '[minulou sobotu v] LT';
}
},
sameElse: 'L'
},
relativeTime: {
future: 'za %s',
past: 'před %s',
s: translate,
ss: translate,
m: translate,
mm: translate,
h: translate,
hh: translate,
d: translate,
dd: translate,
M: translate,
MM: translate,
y: translate,
yy: translate
},
dayOfMonthOrdinalParse: /\d{1,2}\./,
ordinal: '%d.',
week: {
dow: 1,
// Monday is the first day of the week.
doy: 4 // The week that contains Jan 4th is the first week of the year.
}
});
return cs;
});
/***/ }),
/***/ "./node_modules/moment/locale/cv.js":
/*!******************************************!*\
!*** ./node_modules/moment/locale/cv.js ***!
\******************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
;
(function (global, factory) {
true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : undefined;
})(this, function (moment) {
'use strict';
var cv = moment.defineLocale('cv', {
months: 'кӑрлач_нарӑс_пуш_ака_май_ҫӗртме_утӑ_ҫурла_авӑн_юпа_чӳк_раштав'.split('_'),
monthsShort: 'кӑр_нар_пуш_ака_май_ҫӗр_утӑ_ҫур_авн_юпа_чӳк_раш'.split('_'),
weekdays: 'вырсарникун_тунтикун_ытларикун_юнкун_кӗҫнерникун_эрнекун_шӑматкун'.split('_'),
weekdaysShort: 'выр_тун_ытл_юн_кӗҫ_эрн_шӑм'.split('_'),
weekdaysMin: 'вр_тн_ыт_юн_кҫ_эр_шм'.split('_'),
longDateFormat: {
LT: 'HH:mm',
LTS: 'HH:mm:ss',
L: 'DD-MM-YYYY',
LL: 'YYYY [ҫулхи] MMMM [уйӑхӗн] D[-мӗшӗ]',
LLL: 'YYYY [ҫулхи] MMMM [уйӑхӗн] D[-мӗшӗ], HH:mm',
LLLL: 'dddd, YYYY [ҫулхи] MMMM [уйӑхӗн] D[-мӗшӗ], HH:mm'
},
calendar: {
sameDay: '[Паян] LT [сехетре]',
nextDay: '[Ыран] LT [сехетре]',
lastDay: '[Ӗнер] LT [сехетре]',
nextWeek: '[Ҫитес] dddd LT [сехетре]',
lastWeek: '[Иртнӗ] dddd LT [сехетре]',
sameElse: 'L'
},
relativeTime: {
future: function (output) {
var affix = /сехет$/i.exec(output) ? 'рен' : /ҫул$/i.exec(output) ? 'тан' : 'ран';
return output + affix;
},
past: '%s каялла',
s: 'пӗр-ик ҫеккунт',
ss: '%d ҫеккунт',
m: 'пӗр минут',
mm: '%d минут',
h: 'пӗр сехет',
hh: '%d сехет',
d: 'пӗр кун',
dd: '%d кун',
M: 'пӗр уйӑх',
MM: '%d уйӑх',
y: 'пӗр ҫул',
yy: '%d ҫул'
},
dayOfMonthOrdinalParse: /\d{1,2}-мӗш/,
ordinal: '%d-мӗш',
week: {
dow: 1,
// Monday is the first day of the week.
doy: 7 // The week that contains Jan 7th is the first week of the year.
}
});
return cv;
});
/***/ }),
/***/ "./node_modules/moment/locale/cy.js":
/*!******************************************!*\
!*** ./node_modules/moment/locale/cy.js ***!
\******************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
;
(function (global, factory) {
true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : undefined;
})(this, function (moment) {
'use strict';
var cy = moment.defineLocale('cy', {
months: 'Ionawr_Chwefror_Mawrth_Ebrill_Mai_Mehefin_Gorffennaf_Awst_Medi_Hydref_Tachwedd_Rhagfyr'.split('_'),
monthsShort: 'Ion_Chwe_Maw_Ebr_Mai_Meh_Gor_Aws_Med_Hyd_Tach_Rhag'.split('_'),
weekdays: 'Dydd Sul_Dydd Llun_Dydd Mawrth_Dydd Mercher_Dydd Iau_Dydd Gwener_Dydd Sadwrn'.split('_'),
weekdaysShort: 'Sul_Llun_Maw_Mer_Iau_Gwe_Sad'.split('_'),
weekdaysMin: 'Su_Ll_Ma_Me_Ia_Gw_Sa'.split('_'),
weekdaysParseExact: true,
// time formats are the same as en-gb
longDateFormat: {
LT: 'HH:mm',
LTS: 'HH:mm:ss',
L: 'DD/MM/YYYY',
LL: 'D MMMM YYYY',
LLL: 'D MMMM YYYY HH:mm',
LLLL: 'dddd, D MMMM YYYY HH:mm'
},
calendar: {
sameDay: '[Heddiw am] LT',
nextDay: '[Yfory am] LT',
nextWeek: 'dddd [am] LT',
lastDay: '[Ddoe am] LT',
lastWeek: 'dddd [diwethaf am] LT',
sameElse: 'L'
},
relativeTime: {
future: 'mewn %s',
past: '%s yn ôl',
s: 'ychydig eiliadau',
ss: '%d eiliad',
m: 'munud',
mm: '%d munud',
h: 'awr',
hh: '%d awr',
d: 'diwrnod',
dd: '%d diwrnod',
M: 'mis',
MM: '%d mis',
y: 'blwyddyn',
yy: '%d flynedd'
},
dayOfMonthOrdinalParse: /\d{1,2}(fed|ain|af|il|ydd|ed|eg)/,
// traditional ordinal numbers above 31 are not commonly used in colloquial Welsh
ordinal: function (number) {
var b = number,
output = '',
lookup = ['', 'af', 'il', 'ydd', 'ydd', 'ed', 'ed', 'ed', 'fed', 'fed', 'fed', // 1af to 10fed
'eg', 'fed', 'eg', 'eg', 'fed', 'eg', 'eg', 'fed', 'eg', 'fed' // 11eg to 20fed
];
if (b > 20) {
if (b === 40 || b === 50 || b === 60 || b === 80 || b === 100) {
output = 'fed'; // not 30ain, 70ain or 90ain
} else {
output = 'ain';
}
} else if (b > 0) {
output = lookup[b];
}
return number + output;
},
week: {
dow: 1,
// Monday is the first day of the week.
doy: 4 // The week that contains Jan 4th is the first week of the year.
}
});
return cy;
});
/***/ }),
/***/ "./node_modules/moment/locale/da.js":
/*!******************************************!*\
!*** ./node_modules/moment/locale/da.js ***!
\******************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
;
(function (global, factory) {
true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : undefined;
})(this, function (moment) {
'use strict';
var da = moment.defineLocale('da', {
months: 'januar_februar_marts_april_maj_juni_juli_august_september_oktober_november_december'.split('_'),
monthsShort: 'jan_feb_mar_apr_maj_jun_jul_aug_sep_okt_nov_dec'.split('_'),
weekdays: 'søndag_mandag_tirsdag_onsdag_torsdag_fredag_lørdag'.split('_'),
weekdaysShort: 'søn_man_tir_ons_tor_fre_lør'.split('_'),
weekdaysMin: 'sø_ma_ti_on_to_fr_lø'.split('_'),
longDateFormat: {
LT: 'HH:mm',
LTS: 'HH:mm:ss',
L: 'DD.MM.YYYY',
LL: 'D. MMMM YYYY',
LLL: 'D. MMMM YYYY HH:mm',
LLLL: 'dddd [d.] D. MMMM YYYY [kl.] HH:mm'
},
calendar: {
sameDay: '[i dag kl.] LT',
nextDay: '[i morgen kl.] LT',
nextWeek: 'på dddd [kl.] LT',
lastDay: '[i går kl.] LT',
lastWeek: '[i] dddd[s kl.] LT',
sameElse: 'L'
},
relativeTime: {
future: 'om %s',
past: '%s siden',
s: 'få sekunder',
ss: '%d sekunder',
m: 'et minut',
mm: '%d minutter',
h: 'en time',
hh: '%d timer',
d: 'en dag',
dd: '%d dage',
M: 'en måned',
MM: '%d måneder',
y: 'et år',
yy: '%d år'
},
dayOfMonthOrdinalParse: /\d{1,2}\./,
ordinal: '%d.',
week: {
dow: 1,
// Monday is the first day of the week.
doy: 4 // The week that contains Jan 4th is the first week of the year.
}
});
return da;
});
/***/ }),
/***/ "./node_modules/moment/locale/de-at.js":
/*!*********************************************!*\
!*** ./node_modules/moment/locale/de-at.js ***!
\*********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
;
(function (global, factory) {
true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : undefined;
})(this, function (moment) {
'use strict';
function processRelativeTime(number, withoutSuffix, key, isFuture) {
var format = {
'm': ['eine Minute', 'einer Minute'],
'h': ['eine Stunde', 'einer Stunde'],
'd': ['ein Tag', 'einem Tag'],
'dd': [number + ' Tage', number + ' Tagen'],
'M': ['ein Monat', 'einem Monat'],
'MM': [number + ' Monate', number + ' Monaten'],
'y': ['ein Jahr', 'einem Jahr'],
'yy': [number + ' Jahre', number + ' Jahren']
};
return withoutSuffix ? format[key][0] : format[key][1];
}
var deAt = moment.defineLocale('de-at', {
months: 'Jänner_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember'.split('_'),
monthsShort: 'Jän._Feb._März_Apr._Mai_Juni_Juli_Aug._Sep._Okt._Nov._Dez.'.split('_'),
monthsParseExact: true,
weekdays: 'Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag'.split('_'),
weekdaysShort: 'So._Mo._Di._Mi._Do._Fr._Sa.'.split('_'),
weekdaysMin: 'So_Mo_Di_Mi_Do_Fr_Sa'.split('_'),
weekdaysParseExact: true,
longDateFormat: {
LT: 'HH:mm',
LTS: 'HH:mm:ss',
L: 'DD.MM.YYYY',
LL: 'D. MMMM YYYY',
LLL: 'D. MMMM YYYY HH:mm',
LLLL: 'dddd, D. MMMM YYYY HH:mm'
},
calendar: {
sameDay: '[heute um] LT [Uhr]',
sameElse: 'L',
nextDay: '[morgen um] LT [Uhr]',
nextWeek: 'dddd [um] LT [Uhr]',
lastDay: '[gestern um] LT [Uhr]',
lastWeek: '[letzten] dddd [um] LT [Uhr]'
},
relativeTime: {
future: 'in %s',
past: 'vor %s',
s: 'ein paar Sekunden',
ss: '%d Sekunden',
m: processRelativeTime,
mm: '%d Minuten',
h: processRelativeTime,
hh: '%d Stunden',
d: processRelativeTime,
dd: processRelativeTime,
M: processRelativeTime,
MM: processRelativeTime,
y: processRelativeTime,
yy: processRelativeTime
},
dayOfMonthOrdinalParse: /\d{1,2}\./,
ordinal: '%d.',
week: {
dow: 1,
// Monday is the first day of the week.
doy: 4 // The week that contains Jan 4th is the first week of the year.
}
});
return deAt;
});
/***/ }),
/***/ "./node_modules/moment/locale/de-ch.js":
/*!*********************************************!*\
!*** ./node_modules/moment/locale/de-ch.js ***!
\*********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
;
(function (global, factory) {
true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : undefined;
})(this, function (moment) {
'use strict';
function processRelativeTime(number, withoutSuffix, key, isFuture) {
var format = {
'm': ['eine Minute', 'einer Minute'],
'h': ['eine Stunde', 'einer Stunde'],
'd': ['ein Tag', 'einem Tag'],
'dd': [number + ' Tage', number + ' Tagen'],
'M': ['ein Monat', 'einem Monat'],
'MM': [number + ' Monate', number + ' Monaten'],
'y': ['ein Jahr', 'einem Jahr'],
'yy': [number + ' Jahre', number + ' Jahren']
};
return withoutSuffix ? format[key][0] : format[key][1];
}
var deCh = moment.defineLocale('de-ch', {
months: 'Januar_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember'.split('_'),
monthsShort: 'Jan._Feb._März_Apr._Mai_Juni_Juli_Aug._Sep._Okt._Nov._Dez.'.split('_'),
monthsParseExact: true,
weekdays: 'Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag'.split('_'),
weekdaysShort: 'So_Mo_Di_Mi_Do_Fr_Sa'.split('_'),
weekdaysMin: 'So_Mo_Di_Mi_Do_Fr_Sa'.split('_'),
weekdaysParseExact: true,
longDateFormat: {
LT: 'HH:mm',
LTS: 'HH:mm:ss',
L: 'DD.MM.YYYY',
LL: 'D. MMMM YYYY',
LLL: 'D. MMMM YYYY HH:mm',
LLLL: 'dddd, D. MMMM YYYY HH:mm'
},
calendar: {
sameDay: '[heute um] LT [Uhr]',
sameElse: 'L',
nextDay: '[morgen um] LT [Uhr]',
nextWeek: 'dddd [um] LT [Uhr]',
lastDay: '[gestern um] LT [Uhr]',
lastWeek: '[letzten] dddd [um] LT [Uhr]'
},
relativeTime: {
future: 'in %s',
past: 'vor %s',
s: 'ein paar Sekunden',
ss: '%d Sekunden',
m: processRelativeTime,
mm: '%d Minuten',
h: processRelativeTime,
hh: '%d Stunden',
d: processRelativeTime,
dd: processRelativeTime,
M: processRelativeTime,
MM: processRelativeTime,
y: processRelativeTime,
yy: processRelativeTime
},
dayOfMonthOrdinalParse: /\d{1,2}\./,
ordinal: '%d.',
week: {
dow: 1,
// Monday is the first day of the week.
doy: 4 // The week that contains Jan 4th is the first week of the year.
}
});
return deCh;
});
/***/ }),
/***/ "./node_modules/moment/locale/de.js":
/*!******************************************!*\
!*** ./node_modules/moment/locale/de.js ***!
\******************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
;
(function (global, factory) {
true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : undefined;
})(this, function (moment) {
'use strict';
function processRelativeTime(number, withoutSuffix, key, isFuture) {
var format = {
'm': ['eine Minute', 'einer Minute'],
'h': ['eine Stunde', 'einer Stunde'],
'd': ['ein Tag', 'einem Tag'],
'dd': [number + ' Tage', number + ' Tagen'],
'M': ['ein Monat', 'einem Monat'],
'MM': [number + ' Monate', number + ' Monaten'],
'y': ['ein Jahr', 'einem Jahr'],
'yy': [number + ' Jahre', number + ' Jahren']
};
return withoutSuffix ? format[key][0] : format[key][1];
}
var de = moment.defineLocale('de', {
months: 'Januar_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember'.split('_'),
monthsShort: 'Jan._Feb._März_Apr._Mai_Juni_Juli_Aug._Sep._Okt._Nov._Dez.'.split('_'),
monthsParseExact: true,
weekdays: 'Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag'.split('_'),
weekdaysShort: 'So._Mo._Di._Mi._Do._Fr._Sa.'.split('_'),
weekdaysMin: 'So_Mo_Di_Mi_Do_Fr_Sa'.split('_'),
weekdaysParseExact: true,
longDateFormat: {
LT: 'HH:mm',
LTS: 'HH:mm:ss',
L: 'DD.MM.YYYY',
LL: 'D. MMMM YYYY',
LLL: 'D. MMMM YYYY HH:mm',
LLLL: 'dddd, D. MMMM YYYY HH:mm'
},
calendar: {
sameDay: '[heute um] LT [Uhr]',
sameElse: 'L',
nextDay: '[morgen um] LT [Uhr]',
nextWeek: 'dddd [um] LT [Uhr]',
lastDay: '[gestern um] LT [Uhr]',
lastWeek: '[letzten] dddd [um] LT [Uhr]'
},
relativeTime: {
future: 'in %s',
past: 'vor %s',
s: 'ein paar Sekunden',
ss: '%d Sekunden',
m: processRelativeTime,
mm: '%d Minuten',
h: processRelativeTime,
hh: '%d Stunden',
d: processRelativeTime,
dd: processRelativeTime,
M: processRelativeTime,
MM: processRelativeTime,
y: processRelativeTime,
yy: processRelativeTime
},
dayOfMonthOrdinalParse: /\d{1,2}\./,
ordinal: '%d.',
week: {
dow: 1,
// Monday is the first day of the week.
doy: 4 // The week that contains Jan 4th is the first week of the year.
}
});
return de;
});
/***/ }),
/***/ "./node_modules/moment/locale/dv.js":
/*!******************************************!*\
!*** ./node_modules/moment/locale/dv.js ***!
\******************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
;
(function (global, factory) {
true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : undefined;
})(this, function (moment) {
'use strict';
var months = ['ޖެނުއަރީ', 'ފެބްރުއަރީ', 'މާރިޗު', 'އޭޕްރީލު', 'މޭ', 'ޖޫން', 'ޖުލައި', 'އޯގަސްޓު', 'ސެޕްޓެމްބަރު', 'އޮކްޓޯބަރު', 'ނޮވެމްބަރު', 'ޑިސެމްބަރު'],
weekdays = ['އާދިއްތަ', 'ހޯމަ', 'އަންގާރަ', 'ބުދަ', 'ބުރާސްފަތި', 'ހުކުރު', 'ހޮނިހިރު'];
var dv = moment.defineLocale('dv', {
months: months,
monthsShort: months,
weekdays: weekdays,
weekdaysShort: weekdays,
weekdaysMin: 'އާދި_ހޯމަ_އަން_ބުދަ_ބުރާ_ހުކު_ހޮނި'.split('_'),
longDateFormat: {
LT: 'HH:mm',
LTS: 'HH:mm:ss',
L: 'D/M/YYYY',
LL: 'D MMMM YYYY',
LLL: 'D MMMM YYYY HH:mm',
LLLL: 'dddd D MMMM YYYY HH:mm'
},
meridiemParse: /މކ|މފ/,
isPM: function (input) {
return 'މފ' === input;
},
meridiem: function (hour, minute, isLower) {
if (hour < 12) {
return 'މކ';
} else {
return 'މފ';
}
},
calendar: {
sameDay: '[މިއަދު] LT',
nextDay: '[މާދަމާ] LT',
nextWeek: 'dddd LT',
lastDay: '[އިއްޔެ] LT',
lastWeek: '[ފާއިތުވި] dddd LT',
sameElse: 'L'
},
relativeTime: {
future: 'ތެރޭގައި %s',
past: 'ކުރިން %s',
s: 'ސިކުންތުކޮޅެއް',
ss: 'd% ސިކުންތު',
m: 'މިނިޓެއް',
mm: 'މިނިޓު %d',
h: 'ގަޑިއިރެއް',
hh: 'ގަޑިއިރު %d',
d: 'ދުވަހެއް',
dd: 'ދުވަސް %d',
M: 'މަހެއް',
MM: 'މަސް %d',
y: 'އަހަރެއް',
yy: 'އަހަރު %d'
},
preparse: function (string) {
return string.replace(/،/g, ',');
},
postformat: function (string) {
return string.replace(/,/g, '،');
},
week: {
dow: 7,
// Sunday is the first day of the week.
doy: 12 // The week that contains Jan 12th is the first week of the year.
}
});
return dv;
});
/***/ }),
/***/ "./node_modules/moment/locale/el.js":
/*!******************************************!*\
!*** ./node_modules/moment/locale/el.js ***!
\******************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
;
(function (global, factory) {
true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : undefined;
})(this, function (moment) {
'use strict';
function isFunction(input) {
return input instanceof Function || Object.prototype.toString.call(input) === '[object Function]';
}
var el = moment.defineLocale('el', {
monthsNominativeEl: 'Ιανουάριος_Φεβρουάριος_Μάρτιος_Απρίλιος_Μάιος_Ιούνιος_Ιούλιος_Αύγουστος_Σεπτέμβριος_Οκτώβριος_Νοέμβριος_Δεκέμβριος'.split('_'),
monthsGenitiveEl: 'Ιανουαρίου_Φεβρουαρίου_Μαρτίου_Απριλίου_Μαΐου_Ιουνίου_Ιουλίου_Αυγούστου_Σεπτεμβρίου_Οκτωβρίου_Νοεμβρίου_Δεκεμβρίου'.split('_'),
months: function (momentToFormat, format) {
if (!momentToFormat) {
return this._monthsNominativeEl;
} else if (typeof format === 'string' && /D/.test(format.substring(0, format.indexOf('MMMM')))) {
// if there is a day number before 'MMMM'
return this._monthsGenitiveEl[momentToFormat.month()];
} else {
return this._monthsNominativeEl[momentToFormat.month()];
}
},
monthsShort: 'Ιαν_Φεβ_Μαρ_Απρ_Μαϊ_Ιουν_Ιουλ_Αυγ_Σεπ_Οκτ_Νοε_Δεκ'.split('_'),
weekdays: 'Κυριακή_Δευτέρα_Τρίτη_Τετάρτη_Πέμπτη_Παρασκευή_Σάββατο'.split('_'),
weekdaysShort: 'Κυρ_Δευ_Τρι_Τετ_Πεμ_Παρ_Σαβ'.split('_'),
weekdaysMin: 'Κυ_Δε_Τρ_Τε_Πε_Πα_Σα'.split('_'),
meridiem: function (hours, minutes, isLower) {
if (hours > 11) {
return isLower ? 'μμ' : 'ΜΜ';
} else {
return isLower ? 'πμ' : 'ΠΜ';
}
},
isPM: function (input) {
return (input + '').toLowerCase()[0] === 'μ';
},
meridiemParse: /[ΠΜ]\.?Μ?\.?/i,
longDateFormat: {
LT: 'h:mm A',
LTS: 'h:mm:ss A',
L: 'DD/MM/YYYY',
LL: 'D MMMM YYYY',
LLL: 'D MMMM YYYY h:mm A',
LLLL: 'dddd, D MMMM YYYY h:mm A'
},
calendarEl: {
sameDay: '[Σήμερα {}] LT',
nextDay: '[Αύριο {}] LT',
nextWeek: 'dddd [{}] LT',
lastDay: '[Χθες {}] LT',
lastWeek: function () {
switch (this.day()) {
case 6:
return '[το προηγούμενο] dddd [{}] LT';
default:
return '[την προηγούμενη] dddd [{}] LT';
}
},
sameElse: 'L'
},
calendar: function (key, mom) {
var output = this._calendarEl[key],
hours = mom && mom.hours();
if (isFunction(output)) {
output = output.apply(mom);
}
return output.replace('{}', hours % 12 === 1 ? 'στη' : 'στις');
},
relativeTime: {
future: 'σε %s',
past: '%s πριν',
s: 'λίγα δευτερόλεπτα',
ss: '%d δευτερόλεπτα',
m: 'ένα λεπτό',
mm: '%d λεπτά',
h: 'μία ώρα',
hh: '%d ώρες',
d: 'μία μέρα',
dd: '%d μέρες',
M: 'ένας μήνας',
MM: '%d μήνες',
y: 'ένας χρόνος',
yy: '%d χρόνια'
},
dayOfMonthOrdinalParse: /\d{1,2}η/,
ordinal: '%dη',
week: {
dow: 1,
// Monday is the first day of the week.
doy: 4 // The week that contains Jan 4st is the first week of the year.
}
});
return el;
});
/***/ }),
/***/ "./node_modules/moment/locale/en-SG.js":
/*!*********************************************!*\
!*** ./node_modules/moment/locale/en-SG.js ***!
\*********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
;
(function (global, factory) {
true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : undefined;
})(this, function (moment) {
'use strict';
var enSG = moment.defineLocale('en-SG', {
months: 'January_February_March_April_May_June_July_August_September_October_November_December'.split('_'),
monthsShort: 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'),
weekdays: 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_'),
weekdaysShort: 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'),
weekdaysMin: 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'),
longDateFormat: {
LT: 'HH:mm',
LTS: 'HH:mm:ss',
L: 'DD/MM/YYYY',
LL: 'D MMMM YYYY',
LLL: 'D MMMM YYYY HH:mm',
LLLL: 'dddd, D MMMM YYYY HH:mm'
},
calendar: {
sameDay: '[Today at] LT',
nextDay: '[Tomorrow at] LT',
nextWeek: 'dddd [at] LT',
lastDay: '[Yesterday at] LT',
lastWeek: '[Last] dddd [at] LT',
sameElse: 'L'
},
relativeTime: {
future: 'in %s',
past: '%s ago',
s: 'a few seconds',
ss: '%d seconds',
m: 'a minute',
mm: '%d minutes',
h: 'an hour',
hh: '%d hours',
d: 'a day',
dd: '%d days',
M: 'a month',
MM: '%d months',
y: 'a year',
yy: '%d years'
},
dayOfMonthOrdinalParse: /\d{1,2}(st|nd|rd|th)/,
ordinal: function (number) {
var b = number % 10,
output = ~~(number % 100 / 10) === 1 ? 'th' : b === 1 ? 'st' : b === 2 ? 'nd' : b === 3 ? 'rd' : 'th';
return number + output;
},
week: {
dow: 1,
// Monday is the first day of the week.
doy: 4 // The week that contains Jan 4th is the first week of the year.
}
});
return enSG;
});
/***/ }),
/***/ "./node_modules/moment/locale/en-au.js":
/*!*********************************************!*\
!*** ./node_modules/moment/locale/en-au.js ***!
\*********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
;
(function (global, factory) {
true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : undefined;
})(this, function (moment) {
'use strict';
var enAu = moment.defineLocale('en-au', {
months: 'January_February_March_April_May_June_July_August_September_October_November_December'.split('_'),
monthsShort: 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'),
weekdays: 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_'),
weekdaysShort: 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'),
weekdaysMin: 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'),
longDateFormat: {
LT: 'h:mm A',
LTS: 'h:mm:ss A',
L: 'DD/MM/YYYY',
LL: 'D MMMM YYYY',
LLL: 'D MMMM YYYY h:mm A',
LLLL: 'dddd, D MMMM YYYY h:mm A'
},
calendar: {
sameDay: '[Today at] LT',
nextDay: '[Tomorrow at] LT',
nextWeek: 'dddd [at] LT',
lastDay: '[Yesterday at] LT',
lastWeek: '[Last] dddd [at] LT',
sameElse: 'L'
},
relativeTime: {
future: 'in %s',
past: '%s ago',
s: 'a few seconds',
ss: '%d seconds',
m: 'a minute',
mm: '%d minutes',
h: 'an hour',
hh: '%d hours',
d: 'a day',
dd: '%d days',
M: 'a month',
MM: '%d months',
y: 'a year',
yy: '%d years'
},
dayOfMonthOrdinalParse: /\d{1,2}(st|nd|rd|th)/,
ordinal: function (number) {
var b = number % 10,
output = ~~(number % 100 / 10) === 1 ? 'th' : b === 1 ? 'st' : b === 2 ? 'nd' : b === 3 ? 'rd' : 'th';
return number + output;
},
week: {
dow: 1,
// Monday is the first day of the week.
doy: 4 // The week that contains Jan 4th is the first week of the year.
}
});
return enAu;
});
/***/ }),
/***/ "./node_modules/moment/locale/en-ca.js":
/*!*********************************************!*\
!*** ./node_modules/moment/locale/en-ca.js ***!
\*********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
;
(function (global, factory) {
true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : undefined;
})(this, function (moment) {
'use strict';
var enCa = moment.defineLocale('en-ca', {
months: 'January_February_March_April_May_June_July_August_September_October_November_December'.split('_'),
monthsShort: 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'),
weekdays: 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_'),
weekdaysShort: 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'),
weekdaysMin: 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'),
longDateFormat: {
LT: 'h:mm A',
LTS: 'h:mm:ss A',
L: 'YYYY-MM-DD',
LL: 'MMMM D, YYYY',
LLL: 'MMMM D, YYYY h:mm A',
LLLL: 'dddd, MMMM D, YYYY h:mm A'
},
calendar: {
sameDay: '[Today at] LT',
nextDay: '[Tomorrow at] LT',
nextWeek: 'dddd [at] LT',
lastDay: '[Yesterday at] LT',
lastWeek: '[Last] dddd [at] LT',
sameElse: 'L'
},
relativeTime: {
future: 'in %s',
past: '%s ago',
s: 'a few seconds',
ss: '%d seconds',
m: 'a minute',
mm: '%d minutes',
h: 'an hour',
hh: '%d hours',
d: 'a day',
dd: '%d days',
M: 'a month',
MM: '%d months',
y: 'a year',
yy: '%d years'
},
dayOfMonthOrdinalParse: /\d{1,2}(st|nd|rd|th)/,
ordinal: function (number) {
var b = number % 10,
output = ~~(number % 100 / 10) === 1 ? 'th' : b === 1 ? 'st' : b === 2 ? 'nd' : b === 3 ? 'rd' : 'th';
return number + output;
}
});
return enCa;
});
/***/ }),
/***/ "./node_modules/moment/locale/en-gb.js":
/*!*********************************************!*\
!*** ./node_modules/moment/locale/en-gb.js ***!
\*********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
;
(function (global, factory) {
true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : undefined;
})(this, function (moment) {
'use strict';
var enGb = moment.defineLocale('en-gb', {
months: 'January_February_March_April_May_June_July_August_September_October_November_December'.split('_'),
monthsShort: 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'),
weekdays: 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_'),
weekdaysShort: 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'),
weekdaysMin: 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'),
longDateFormat: {
LT: 'HH:mm',
LTS: 'HH:mm:ss',
L: 'DD/MM/YYYY',
LL: 'D MMMM YYYY',
LLL: 'D MMMM YYYY HH:mm',
LLLL: 'dddd, D MMMM YYYY HH:mm'
},
calendar: {
sameDay: '[Today at] LT',
nextDay: '[Tomorrow at] LT',
nextWeek: 'dddd [at] LT',
lastDay: '[Yesterday at] LT',
lastWeek: '[Last] dddd [at] LT',
sameElse: 'L'
},
relativeTime: {
future: 'in %s',
past: '%s ago',
s: 'a few seconds',
ss: '%d seconds',
m: 'a minute',
mm: '%d minutes',
h: 'an hour',
hh: '%d hours',
d: 'a day',
dd: '%d days',
M: 'a month',
MM: '%d months',
y: 'a year',
yy: '%d years'
},
dayOfMonthOrdinalParse: /\d{1,2}(st|nd|rd|th)/,
ordinal: function (number) {
var b = number % 10,
output = ~~(number % 100 / 10) === 1 ? 'th' : b === 1 ? 'st' : b === 2 ? 'nd' : b === 3 ? 'rd' : 'th';
return number + output;
},
week: {
dow: 1,
// Monday is the first day of the week.
doy: 4 // The week that contains Jan 4th is the first week of the year.
}
});
return enGb;
});
/***/ }),
/***/ "./node_modules/moment/locale/en-ie.js":
/*!*********************************************!*\
!*** ./node_modules/moment/locale/en-ie.js ***!
\*********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
;
(function (global, factory) {
true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : undefined;
})(this, function (moment) {
'use strict';
var enIe = moment.defineLocale('en-ie', {
months: 'January_February_March_April_May_June_July_August_September_October_November_December'.split('_'),
monthsShort: 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'),
weekdays: 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_'),
weekdaysShort: 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'),
weekdaysMin: 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'),
longDateFormat: {
LT: 'HH:mm',
LTS: 'HH:mm:ss',
L: 'DD/MM/YYYY',
LL: 'D MMMM YYYY',
LLL: 'D MMMM YYYY HH:mm',
LLLL: 'dddd D MMMM YYYY HH:mm'
},
calendar: {
sameDay: '[Today at] LT',
nextDay: '[Tomorrow at] LT',
nextWeek: 'dddd [at] LT',
lastDay: '[Yesterday at] LT',
lastWeek: '[Last] dddd [at] LT',
sameElse: 'L'
},
relativeTime: {
future: 'in %s',
past: '%s ago',
s: 'a few seconds',
ss: '%d seconds',
m: 'a minute',
mm: '%d minutes',
h: 'an hour',
hh: '%d hours',
d: 'a day',
dd: '%d days',
M: 'a month',
MM: '%d months',
y: 'a year',
yy: '%d years'
},
dayOfMonthOrdinalParse: /\d{1,2}(st|nd|rd|th)/,
ordinal: function (number) {
var b = number % 10,
output = ~~(number % 100 / 10) === 1 ? 'th' : b === 1 ? 'st' : b === 2 ? 'nd' : b === 3 ? 'rd' : 'th';
return number + output;
},
week: {
dow: 1,
// Monday is the first day of the week.
doy: 4 // The week that contains Jan 4th is the first week of the year.
}
});
return enIe;
});
/***/ }),
/***/ "./node_modules/moment/locale/en-il.js":
/*!*********************************************!*\
!*** ./node_modules/moment/locale/en-il.js ***!
\*********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
;
(function (global, factory) {
true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : undefined;
})(this, function (moment) {
'use strict';
var enIl = moment.defineLocale('en-il', {
months: 'January_February_March_April_May_June_July_August_September_October_November_December'.split('_'),
monthsShort: 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'),
weekdays: 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_'),
weekdaysShort: 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'),
weekdaysMin: 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'),
longDateFormat: {
LT: 'HH:mm',
LTS: 'HH:mm:ss',
L: 'DD/MM/YYYY',
LL: 'D MMMM YYYY',
LLL: 'D MMMM YYYY HH:mm',
LLLL: 'dddd, D MMMM YYYY HH:mm'
},
calendar: {
sameDay: '[Today at] LT',
nextDay: '[Tomorrow at] LT',
nextWeek: 'dddd [at] LT',
lastDay: '[Yesterday at] LT',
lastWeek: '[Last] dddd [at] LT',
sameElse: 'L'
},
relativeTime: {
future: 'in %s',
past: '%s ago',
s: 'a few seconds',
m: 'a minute',
mm: '%d minutes',
h: 'an hour',
hh: '%d hours',
d: 'a day',
dd: '%d days',
M: 'a month',
MM: '%d months',
y: 'a year',
yy: '%d years'
},
dayOfMonthOrdinalParse: /\d{1,2}(st|nd|rd|th)/,
ordinal: function (number) {
var b = number % 10,
output = ~~(number % 100 / 10) === 1 ? 'th' : b === 1 ? 'st' : b === 2 ? 'nd' : b === 3 ? 'rd' : 'th';
return number + output;
}
});
return enIl;
});
/***/ }),
/***/ "./node_modules/moment/locale/en-nz.js":
/*!*********************************************!*\
!*** ./node_modules/moment/locale/en-nz.js ***!
\*********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
;
(function (global, factory) {
true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : undefined;
})(this, function (moment) {
'use strict';
var enNz = moment.defineLocale('en-nz', {
months: 'January_February_March_April_May_June_July_August_September_October_November_December'.split('_'),
monthsShort: 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'),
weekdays: 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_'),
weekdaysShort: 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'),
weekdaysMin: 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'),
longDateFormat: {
LT: 'h:mm A',
LTS: 'h:mm:ss A',
L: 'DD/MM/YYYY',
LL: 'D MMMM YYYY',
LLL: 'D MMMM YYYY h:mm A',
LLLL: 'dddd, D MMMM YYYY h:mm A'
},
calendar: {
sameDay: '[Today at] LT',
nextDay: '[Tomorrow at] LT',
nextWeek: 'dddd [at] LT',
lastDay: '[Yesterday at] LT',
lastWeek: '[Last] dddd [at] LT',
sameElse: 'L'
},
relativeTime: {
future: 'in %s',
past: '%s ago',
s: 'a few seconds',
ss: '%d seconds',
m: 'a minute',
mm: '%d minutes',
h: 'an hour',
hh: '%d hours',
d: 'a day',
dd: '%d days',
M: 'a month',
MM: '%d months',
y: 'a year',
yy: '%d years'
},
dayOfMonthOrdinalParse: /\d{1,2}(st|nd|rd|th)/,
ordinal: function (number) {
var b = number % 10,
output = ~~(number % 100 / 10) === 1 ? 'th' : b === 1 ? 'st' : b === 2 ? 'nd' : b === 3 ? 'rd' : 'th';
return number + output;
},
week: {
dow: 1,
// Monday is the first day of the week.
doy: 4 // The week that contains Jan 4th is the first week of the year.
}
});
return enNz;
});
/***/ }),
/***/ "./node_modules/moment/locale/eo.js":
/*!******************************************!*\
!*** ./node_modules/moment/locale/eo.js ***!
\******************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
;
(function (global, factory) {
true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : undefined;
})(this, function (moment) {
'use strict';
var eo = moment.defineLocale('eo', {
months: 'januaro_februaro_marto_aprilo_majo_junio_julio_aŭgusto_septembro_oktobro_novembro_decembro'.split('_'),
monthsShort: 'jan_feb_mar_apr_maj_jun_jul_aŭg_sep_okt_nov_dec'.split('_'),
weekdays: 'dimanĉo_lundo_mardo_merkredo_ĵaŭdo_vendredo_sabato'.split('_'),
weekdaysShort: 'dim_lun_mard_merk_ĵaŭ_ven_sab'.split('_'),
weekdaysMin: 'di_lu_ma_me_ĵa_ve_sa'.split('_'),
longDateFormat: {
LT: 'HH:mm',
LTS: 'HH:mm:ss',
L: 'YYYY-MM-DD',
LL: 'D[-a de] MMMM, YYYY',
LLL: 'D[-a de] MMMM, YYYY HH:mm',
LLLL: 'dddd, [la] D[-a de] MMMM, YYYY HH:mm'
},
meridiemParse: /[ap]\.t\.m/i,
isPM: function (input) {
return input.charAt(0).toLowerCase() === 'p';
},
meridiem: function (hours, minutes, isLower) {
if (hours > 11) {
return isLower ? 'p.t.m.' : 'P.T.M.';
} else {
return isLower ? 'a.t.m.' : 'A.T.M.';
}
},
calendar: {
sameDay: '[Hodiaŭ je] LT',
nextDay: '[Morgaŭ je] LT',
nextWeek: 'dddd [je] LT',
lastDay: '[Hieraŭ je] LT',
lastWeek: '[pasinta] dddd [je] LT',
sameElse: 'L'
},
relativeTime: {
future: 'post %s',
past: 'antaŭ %s',
s: 'sekundoj',
ss: '%d sekundoj',
m: 'minuto',
mm: '%d minutoj',
h: 'horo',
hh: '%d horoj',
d: 'tago',
//ne 'diurno', ĉar estas uzita por proksimumo
dd: '%d tagoj',
M: 'monato',
MM: '%d monatoj',
y: 'jaro',
yy: '%d jaroj'
},
dayOfMonthOrdinalParse: /\d{1,2}a/,
ordinal: '%da',
week: {
dow: 1,
// Monday is the first day of the week.
doy: 7 // The week that contains Jan 7th is the first week of the year.
}
});
return eo;
});
/***/ }),
/***/ "./node_modules/moment/locale/es-do.js":
/*!*********************************************!*\
!*** ./node_modules/moment/locale/es-do.js ***!
\*********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
;
(function (global, factory) {
true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : undefined;
})(this, function (moment) {
'use strict';
var monthsShortDot = 'ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.'.split('_'),
monthsShort = 'ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic'.split('_');
var monthsParse = [/^ene/i, /^feb/i, /^mar/i, /^abr/i, /^may/i, /^jun/i, /^jul/i, /^ago/i, /^sep/i, /^oct/i, /^nov/i, /^dic/i];
var monthsRegex = /^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre|ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i;
var esDo = moment.defineLocale('es-do', {
months: 'enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre'.split('_'),
monthsShort: function (m, format) {
if (!m) {
return monthsShortDot;
} else if (/-MMM-/.test(format)) {
return monthsShort[m.month()];
} else {
return monthsShortDot[m.month()];
}
},
monthsRegex: monthsRegex,
monthsShortRegex: monthsRegex,
monthsStrictRegex: /^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)/i,
monthsShortStrictRegex: /^(ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i,
monthsParse: monthsParse,
longMonthsParse: monthsParse,
shortMonthsParse: monthsParse,
weekdays: 'domingo_lunes_martes_miércoles_jueves_viernes_sábado'.split('_'),
weekdaysShort: 'dom._lun._mar._mié._jue._vie._sáb.'.split('_'),
weekdaysMin: 'do_lu_ma_mi_ju_vi_sá'.split('_'),
weekdaysParseExact: true,
longDateFormat: {
LT: 'h:mm A',
LTS: 'h:mm:ss A',
L: 'DD/MM/YYYY',
LL: 'D [de] MMMM [de] YYYY',
LLL: 'D [de] MMMM [de] YYYY h:mm A',
LLLL: 'dddd, D [de] MMMM [de] YYYY h:mm A'
},
calendar: {
sameDay: function () {
return '[hoy a la' + (this.hours() !== 1 ? 's' : '') + '] LT';
},
nextDay: function () {
return '[mañana a la' + (this.hours() !== 1 ? 's' : '') + '] LT';
},
nextWeek: function () {
return 'dddd [a la' + (this.hours() !== 1 ? 's' : '') + '] LT';
},
lastDay: function () {
return '[ayer a la' + (this.hours() !== 1 ? 's' : '') + '] LT';
},
lastWeek: function () {
return '[el] dddd [pasado a la' + (this.hours() !== 1 ? 's' : '') + '] LT';
},
sameElse: 'L'
},
relativeTime: {
future: 'en %s',
past: 'hace %s',
s: 'unos segundos',
ss: '%d segundos',
m: 'un minuto',
mm: '%d minutos',
h: 'una hora',
hh: '%d horas',
d: 'un día',
dd: '%d días',
M: 'un mes',
MM: '%d meses',
y: 'un año',
yy: '%d años'
},
dayOfMonthOrdinalParse: /\d{1,2}º/,
ordinal: '%dº',
week: {
dow: 1,
// Monday is the first day of the week.
doy: 4 // The week that contains Jan 4th is the first week of the year.
}
});
return esDo;
});
/***/ }),
/***/ "./node_modules/moment/locale/es-us.js":
/*!*********************************************!*\
!*** ./node_modules/moment/locale/es-us.js ***!
\*********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
;
(function (global, factory) {
true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : undefined;
})(this, function (moment) {
'use strict';
var monthsShortDot = 'ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.'.split('_'),
monthsShort = 'ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic'.split('_');
var monthsParse = [/^ene/i, /^feb/i, /^mar/i, /^abr/i, /^may/i, /^jun/i, /^jul/i, /^ago/i, /^sep/i, /^oct/i, /^nov/i, /^dic/i];
var monthsRegex = /^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre|ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i;
var esUs = moment.defineLocale('es-us', {
months: 'enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre'.split('_'),
monthsShort: function (m, format) {
if (!m) {
return monthsShortDot;
} else if (/-MMM-/.test(format)) {
return monthsShort[m.month()];
} else {
return monthsShortDot[m.month()];
}
},
monthsRegex: monthsRegex,
monthsShortRegex: monthsRegex,
monthsStrictRegex: /^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)/i,
monthsShortStrictRegex: /^(ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i,
monthsParse: monthsParse,
longMonthsParse: monthsParse,
shortMonthsParse: monthsParse,
weekdays: 'domingo_lunes_martes_miércoles_jueves_viernes_sábado'.split('_'),
weekdaysShort: 'dom._lun._mar._mié._jue._vie._sáb.'.split('_'),
weekdaysMin: 'do_lu_ma_mi_ju_vi_sá'.split('_'),
weekdaysParseExact: true,
longDateFormat: {
LT: 'h:mm A',
LTS: 'h:mm:ss A',
L: 'MM/DD/YYYY',
LL: 'D [de] MMMM [de] YYYY',
LLL: 'D [de] MMMM [de] YYYY h:mm A',
LLLL: 'dddd, D [de] MMMM [de] YYYY h:mm A'
},
calendar: {
sameDay: function () {
return '[hoy a la' + (this.hours() !== 1 ? 's' : '') + '] LT';
},
nextDay: function () {
return '[mañana a la' + (this.hours() !== 1 ? 's' : '') + '] LT';
},
nextWeek: function () {
return 'dddd [a la' + (this.hours() !== 1 ? 's' : '') + '] LT';
},
lastDay: function () {
return '[ayer a la' + (this.hours() !== 1 ? 's' : '') + '] LT';
},
lastWeek: function () {
return '[el] dddd [pasado a la' + (this.hours() !== 1 ? 's' : '') + '] LT';
},
sameElse: 'L'
},
relativeTime: {
future: 'en %s',
past: 'hace %s',
s: 'unos segundos',
ss: '%d segundos',
m: 'un minuto',
mm: '%d minutos',
h: 'una hora',
hh: '%d horas',
d: 'un día',
dd: '%d días',
M: 'un mes',
MM: '%d meses',
y: 'un año',
yy: '%d años'
},
dayOfMonthOrdinalParse: /\d{1,2}º/,
ordinal: '%dº',
week: {
dow: 0,
// Sunday is the first day of the week.
doy: 6 // The week that contains Jan 6th is the first week of the year.
}
});
return esUs;
});
/***/ }),
/***/ "./node_modules/moment/locale/es.js":
/*!******************************************!*\
!*** ./node_modules/moment/locale/es.js ***!
\******************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
;
(function (global, factory) {
true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : undefined;
})(this, function (moment) {
'use strict';
var monthsShortDot = 'ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.'.split('_'),
monthsShort = 'ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic'.split('_');
var monthsParse = [/^ene/i, /^feb/i, /^mar/i, /^abr/i, /^may/i, /^jun/i, /^jul/i, /^ago/i, /^sep/i, /^oct/i, /^nov/i, /^dic/i];
var monthsRegex = /^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre|ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i;
var es = moment.defineLocale('es', {
months: 'enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre'.split('_'),
monthsShort: function (m, format) {
if (!m) {
return monthsShortDot;
} else if (/-MMM-/.test(format)) {
return monthsShort[m.month()];
} else {
return monthsShortDot[m.month()];
}
},
monthsRegex: monthsRegex,
monthsShortRegex: monthsRegex,
monthsStrictRegex: /^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)/i,
monthsShortStrictRegex: /^(ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i,
monthsParse: monthsParse,
longMonthsParse: monthsParse,
shortMonthsParse: monthsParse,
weekdays: 'domingo_lunes_martes_miércoles_jueves_viernes_sábado'.split('_'),
weekdaysShort: 'dom._lun._mar._mié._jue._vie._sáb.'.split('_'),
weekdaysMin: 'do_lu_ma_mi_ju_vi_sá'.split('_'),
weekdaysParseExact: true,
longDateFormat: {
LT: 'H:mm',
LTS: 'H:mm:ss',
L: 'DD/MM/YYYY',
LL: 'D [de] MMMM [de] YYYY',
LLL: 'D [de] MMMM [de] YYYY H:mm',
LLLL: 'dddd, D [de] MMMM [de] YYYY H:mm'
},
calendar: {
sameDay: function () {
return '[hoy a la' + (this.hours() !== 1 ? 's' : '') + '] LT';
},
nextDay: function () {
return '[mañana a la' + (this.hours() !== 1 ? 's' : '') + '] LT';
},
nextWeek: function () {
return 'dddd [a la' + (this.hours() !== 1 ? 's' : '') + '] LT';
},
lastDay: function () {
return '[ayer a la' + (this.hours() !== 1 ? 's' : '') + '] LT';
},
lastWeek: function () {
return '[el] dddd [pasado a la' + (this.hours() !== 1 ? 's' : '') + '] LT';
},
sameElse: 'L'
},
relativeTime: {
future: 'en %s',
past: 'hace %s',
s: 'unos segundos',
ss: '%d segundos',
m: 'un minuto',
mm: '%d minutos',
h: 'una hora',
hh: '%d horas',
d: 'un día',
dd: '%d días',
M: 'un mes',
MM: '%d meses',
y: 'un año',
yy: '%d años'
},
dayOfMonthOrdinalParse: /\d{1,2}º/,
ordinal: '%dº',
week: {
dow: 1,
// Monday is the first day of the week.
doy: 4 // The week that contains Jan 4th is the first week of the year.
}
});
return es;
});
/***/ }),
/***/ "./node_modules/moment/locale/et.js":
/*!******************************************!*\
!*** ./node_modules/moment/locale/et.js ***!
\******************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
;
(function (global, factory) {
true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : undefined;
})(this, function (moment) {
'use strict';
function processRelativeTime(number, withoutSuffix, key, isFuture) {
var format = {
's': ['mõne sekundi', 'mõni sekund', 'paar sekundit'],
'ss': [number + 'sekundi', number + 'sekundit'],
'm': ['ühe minuti', 'üks minut'],
'mm': [number + ' minuti', number + ' minutit'],
'h': ['ühe tunni', 'tund aega', 'üks tund'],
'hh': [number + ' tunni', number + ' tundi'],
'd': ['ühe päeva', 'üks päev'],
'M': ['kuu aja', 'kuu aega', 'üks kuu'],
'MM': [number + ' kuu', number + ' kuud'],
'y': ['ühe aasta', 'aasta', 'üks aasta'],
'yy': [number + ' aasta', number + ' aastat']
};
if (withoutSuffix) {
return format[key][2] ? format[key][2] : format[key][1];
}
return isFuture ? format[key][0] : format[key][1];
}
var et = moment.defineLocale('et', {
months: 'jaanuar_veebruar_märts_aprill_mai_juuni_juuli_august_september_oktoober_november_detsember'.split('_'),
monthsShort: 'jaan_veebr_märts_apr_mai_juuni_juuli_aug_sept_okt_nov_dets'.split('_'),
weekdays: 'pühapäev_esmaspäev_teisipäev_kolmapäev_neljapäev_reede_laupäev'.split('_'),
weekdaysShort: 'P_E_T_K_N_R_L'.split('_'),
weekdaysMin: 'P_E_T_K_N_R_L'.split('_'),
longDateFormat: {
LT: 'H:mm',
LTS: 'H:mm:ss',
L: 'DD.MM.YYYY',
LL: 'D. MMMM YYYY',
LLL: 'D. MMMM YYYY H:mm',
LLLL: 'dddd, D. MMMM YYYY H:mm'
},
calendar: {
sameDay: '[Täna,] LT',
nextDay: '[Homme,] LT',
nextWeek: '[Järgmine] dddd LT',
lastDay: '[Eile,] LT',
lastWeek: '[Eelmine] dddd LT',
sameElse: 'L'
},
relativeTime: {
future: '%s pärast',
past: '%s tagasi',
s: processRelativeTime,
ss: processRelativeTime,
m: processRelativeTime,
mm: processRelativeTime,
h: processRelativeTime,
hh: processRelativeTime,
d: processRelativeTime,
dd: '%d päeva',
M: processRelativeTime,
MM: processRelativeTime,
y: processRelativeTime,
yy: processRelativeTime
},
dayOfMonthOrdinalParse: /\d{1,2}\./,
ordinal: '%d.',
week: {
dow: 1,
// Monday is the first day of the week.
doy: 4 // The week that contains Jan 4th is the first week of the year.
}
});
return et;
});
/***/ }),
/***/ "./node_modules/moment/locale/eu.js":
/*!******************************************!*\
!*** ./node_modules/moment/locale/eu.js ***!
\******************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
;
(function (global, factory) {
true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : undefined;
})(this, function (moment) {
'use strict';
var eu = moment.defineLocale('eu', {
months: 'urtarrila_otsaila_martxoa_apirila_maiatza_ekaina_uztaila_abuztua_iraila_urria_azaroa_abendua'.split('_'),
monthsShort: 'urt._ots._mar._api._mai._eka._uzt._abu._ira._urr._aza._abe.'.split('_'),
monthsParseExact: true,
weekdays: 'igandea_astelehena_asteartea_asteazkena_osteguna_ostirala_larunbata'.split('_'),
weekdaysShort: 'ig._al._ar._az._og._ol._lr.'.split('_'),
weekdaysMin: 'ig_al_ar_az_og_ol_lr'.split('_'),
weekdaysParseExact: true,
longDateFormat: {
LT: 'HH:mm',
LTS: 'HH:mm:ss',
L: 'YYYY-MM-DD',
LL: 'YYYY[ko] MMMM[ren] D[a]',
LLL: 'YYYY[ko] MMMM[ren] D[a] HH:mm',
LLLL: 'dddd, YYYY[ko] MMMM[ren] D[a] HH:mm',
l: 'YYYY-M-D',
ll: 'YYYY[ko] MMM D[a]',
lll: 'YYYY[ko] MMM D[a] HH:mm',
llll: 'ddd, YYYY[ko] MMM D[a] HH:mm'
},
calendar: {
sameDay: '[gaur] LT[etan]',
nextDay: '[bihar] LT[etan]',
nextWeek: 'dddd LT[etan]',
lastDay: '[atzo] LT[etan]',
lastWeek: '[aurreko] dddd LT[etan]',
sameElse: 'L'
},
relativeTime: {
future: '%s barru',
past: 'duela %s',
s: 'segundo batzuk',
ss: '%d segundo',
m: 'minutu bat',
mm: '%d minutu',
h: 'ordu bat',
hh: '%d ordu',
d: 'egun bat',
dd: '%d egun',
M: 'hilabete bat',
MM: '%d hilabete',
y: 'urte bat',
yy: '%d urte'
},
dayOfMonthOrdinalParse: /\d{1,2}\./,
ordinal: '%d.',
week: {
dow: 1,
// Monday is the first day of the week.
doy: 7 // The week that contains Jan 7th is the first week of the year.
}
});
return eu;
});
/***/ }),
/***/ "./node_modules/moment/locale/fa.js":
/*!******************************************!*\
!*** ./node_modules/moment/locale/fa.js ***!
\******************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
;
(function (global, factory) {
true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : undefined;
})(this, function (moment) {
'use strict';
var symbolMap = {
'1': '۱',
'2': '۲',
'3': '۳',
'4': '۴',
'5': '۵',
'6': '۶',
'7': '۷',
'8': '۸',
'9': '۹',
'0': '۰'
},
numberMap = {
'۱': '1',
'۲': '2',
'۳': '3',
'۴': '4',
'۵': '5',
'۶': '6',
'۷': '7',
'۸': '8',
'۹': '9',
'۰': '0'
};
var fa = moment.defineLocale('fa', {
months: 'ژانویه_فوریه_مارس_آوریل_مه_ژوئن_ژوئیه_اوت_سپتامبر_اکتبر_نوامبر_دسامبر'.split('_'),
monthsShort: 'ژانویه_فوریه_مارس_آوریل_مه_ژوئن_ژوئیه_اوت_سپتامبر_اکتبر_نوامبر_دسامبر'.split('_'),
weekdays: 'یک\u200cشنبه_دوشنبه_سه\u200cشنبه_چهارشنبه_پنج\u200cشنبه_جمعه_شنبه'.split('_'),
weekdaysShort: 'یک\u200cشنبه_دوشنبه_سه\u200cشنبه_چهارشنبه_پنج\u200cشنبه_جمعه_شنبه'.split('_'),
weekdaysMin: 'ی_د_س_چ_پ_ج_ش'.split('_'),
weekdaysParseExact: true,
longDateFormat: {
LT: 'HH:mm',
LTS: 'HH:mm:ss',
L: 'DD/MM/YYYY',
LL: 'D MMMM YYYY',
LLL: 'D MMMM YYYY HH:mm',
LLLL: 'dddd, D MMMM YYYY HH:mm'
},
meridiemParse: /قبل از ظهر|بعد از ظهر/,
isPM: function (input) {
return /بعد از ظهر/.test(input);
},
meridiem: function (hour, minute, isLower) {
if (hour < 12) {
return 'قبل از ظهر';
} else {
return 'بعد از ظهر';
}
},
calendar: {
sameDay: '[امروز ساعت] LT',
nextDay: '[فردا ساعت] LT',
nextWeek: 'dddd [ساعت] LT',
lastDay: '[دیروز ساعت] LT',
lastWeek: 'dddd [پیش] [ساعت] LT',
sameElse: 'L'
},
relativeTime: {
future: 'در %s',
past: '%s پیش',
s: 'چند ثانیه',
ss: 'ثانیه d%',
m: 'یک دقیقه',
mm: '%d دقیقه',
h: 'یک ساعت',
hh: '%d ساعت',
d: 'یک روز',
dd: '%d روز',
M: 'یک ماه',
MM: '%d ماه',
y: 'یک سال',
yy: '%d سال'
},
preparse: function (string) {
return string.replace(/[۰-۹]/g, function (match) {
return numberMap[match];
}).replace(/،/g, ',');
},
postformat: function (string) {
return string.replace(/\d/g, function (match) {
return symbolMap[match];
}).replace(/,/g, '،');
},
dayOfMonthOrdinalParse: /\d{1,2}م/,
ordinal: '%dم',
week: {
dow: 6,
// Saturday is the first day of the week.
doy: 12 // The week that contains Jan 12th is the first week of the year.
}
});
return fa;
});
/***/ }),
/***/ "./node_modules/moment/locale/fi.js":
/*!******************************************!*\
!*** ./node_modules/moment/locale/fi.js ***!
\******************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
;
(function (global, factory) {
true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : undefined;
})(this, function (moment) {
'use strict';
var numbersPast = 'nolla yksi kaksi kolme neljä viisi kuusi seitsemän kahdeksan yhdeksän'.split(' '),
numbersFuture = ['nolla', 'yhden', 'kahden', 'kolmen', 'neljän', 'viiden', 'kuuden', numbersPast[7], numbersPast[8], numbersPast[9]];
function translate(number, withoutSuffix, key, isFuture) {
var result = '';
switch (key) {
case 's':
return isFuture ? 'muutaman sekunnin' : 'muutama sekunti';
case 'ss':
return isFuture ? 'sekunnin' : 'sekuntia';
case 'm':
return isFuture ? 'minuutin' : 'minuutti';
case 'mm':
result = isFuture ? 'minuutin' : 'minuuttia';
break;
case 'h':
return isFuture ? 'tunnin' : 'tunti';
case 'hh':
result = isFuture ? 'tunnin' : 'tuntia';
break;
case 'd':
return isFuture ? 'päivän' : 'päivä';
case 'dd':
result = isFuture ? 'päivän' : 'päivää';
break;
case 'M':
return isFuture ? 'kuukauden' : 'kuukausi';
case 'MM':
result = isFuture ? 'kuukauden' : 'kuukautta';
break;
case 'y':
return isFuture ? 'vuoden' : 'vuosi';
case 'yy':
result = isFuture ? 'vuoden' : 'vuotta';
break;
}
result = verbalNumber(number, isFuture) + ' ' + result;
return result;
}
function verbalNumber(number, isFuture) {
return number < 10 ? isFuture ? numbersFuture[number] : numbersPast[number] : number;
}
var fi = moment.defineLocale('fi', {
months: 'tammikuu_helmikuu_maaliskuu_huhtikuu_toukokuu_kesäkuu_heinäkuu_elokuu_syyskuu_lokakuu_marraskuu_joulukuu'.split('_'),
monthsShort: 'tammi_helmi_maalis_huhti_touko_kesä_heinä_elo_syys_loka_marras_joulu'.split('_'),
weekdays: 'sunnuntai_maanantai_tiistai_keskiviikko_torstai_perjantai_lauantai'.split('_'),
weekdaysShort: 'su_ma_ti_ke_to_pe_la'.split('_'),
weekdaysMin: 'su_ma_ti_ke_to_pe_la'.split('_'),
longDateFormat: {
LT: 'HH.mm',
LTS: 'HH.mm.ss',
L: 'DD.MM.YYYY',
LL: 'Do MMMM[ta] YYYY',
LLL: 'Do MMMM[ta] YYYY, [klo] HH.mm',
LLLL: 'dddd, Do MMMM[ta] YYYY, [klo] HH.mm',
l: 'D.M.YYYY',
ll: 'Do MMM YYYY',
lll: 'Do MMM YYYY, [klo] HH.mm',
llll: 'ddd, Do MMM YYYY, [klo] HH.mm'
},
calendar: {
sameDay: '[tänään] [klo] LT',
nextDay: '[huomenna] [klo] LT',
nextWeek: 'dddd [klo] LT',
lastDay: '[eilen] [klo] LT',
lastWeek: '[viime] dddd[na] [klo] LT',
sameElse: 'L'
},
relativeTime: {
future: '%s päästä',
past: '%s sitten',
s: translate,
ss: translate,
m: translate,
mm: translate,
h: translate,
hh: translate,
d: translate,
dd: translate,
M: translate,
MM: translate,
y: translate,
yy: translate
},
dayOfMonthOrdinalParse: /\d{1,2}\./,
ordinal: '%d.',
week: {
dow: 1,
// Monday is the first day of the week.
doy: 4 // The week that contains Jan 4th is the first week of the year.
}
});
return fi;
});
/***/ }),
/***/ "./node_modules/moment/locale/fo.js":
/*!******************************************!*\
!*** ./node_modules/moment/locale/fo.js ***!
\******************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
;
(function (global, factory) {
true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : undefined;
})(this, function (moment) {
'use strict';
var fo = moment.defineLocale('fo', {
months: 'januar_februar_mars_apríl_mai_juni_juli_august_september_oktober_november_desember'.split('_'),
monthsShort: 'jan_feb_mar_apr_mai_jun_jul_aug_sep_okt_nov_des'.split('_'),
weekdays: 'sunnudagur_mánadagur_týsdagur_mikudagur_hósdagur_fríggjadagur_leygardagur'.split('_'),
weekdaysShort: 'sun_mán_týs_mik_hós_frí_ley'.split('_'),
weekdaysMin: 'su_má_tý_mi_hó_fr_le'.split('_'),
longDateFormat: {
LT: 'HH:mm',
LTS: 'HH:mm:ss',
L: 'DD/MM/YYYY',
LL: 'D MMMM YYYY',
LLL: 'D MMMM YYYY HH:mm',
LLLL: 'dddd D. MMMM, YYYY HH:mm'
},
calendar: {
sameDay: '[Í dag kl.] LT',
nextDay: '[Í morgin kl.] LT',
nextWeek: 'dddd [kl.] LT',
lastDay: '[Í gjár kl.] LT',
lastWeek: '[síðstu] dddd [kl] LT',
sameElse: 'L'
},
relativeTime: {
future: 'um %s',
past: '%s síðani',
s: 'fá sekund',
ss: '%d sekundir',
m: 'ein minuttur',
mm: '%d minuttir',
h: 'ein tími',
hh: '%d tímar',
d: 'ein dagur',
dd: '%d dagar',
M: 'ein mánaður',
MM: '%d mánaðir',
y: 'eitt ár',
yy: '%d ár'
},
dayOfMonthOrdinalParse: /\d{1,2}\./,
ordinal: '%d.',
week: {
dow: 1,
// Monday is the first day of the week.
doy: 4 // The week that contains Jan 4th is the first week of the year.
}
});
return fo;
});
/***/ }),
/***/ "./node_modules/moment/locale/fr-ca.js":
/*!*********************************************!*\
!*** ./node_modules/moment/locale/fr-ca.js ***!
\*********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
;
(function (global, factory) {
true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : undefined;
})(this, function (moment) {
'use strict';
var frCa = moment.defineLocale('fr-ca', {
months: 'janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre'.split('_'),
monthsShort: 'janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.'.split('_'),
monthsParseExact: true,
weekdays: 'dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi'.split('_'),
weekdaysShort: 'dim._lun._mar._mer._jeu._ven._sam.'.split('_'),
weekdaysMin: 'di_lu_ma_me_je_ve_sa'.split('_'),
weekdaysParseExact: true,
longDateFormat: {
LT: 'HH:mm',
LTS: 'HH:mm:ss',
L: 'YYYY-MM-DD',
LL: 'D MMMM YYYY',
LLL: 'D MMMM YYYY HH:mm',
LLLL: 'dddd D MMMM YYYY HH:mm'
},
calendar: {
sameDay: '[Aujourd’hui à] LT',
nextDay: '[Demain à] LT',
nextWeek: 'dddd [à] LT',
lastDay: '[Hier à] LT',
lastWeek: 'dddd [dernier à] LT',
sameElse: 'L'
},
relativeTime: {
future: 'dans %s',
past: 'il y a %s',
s: 'quelques secondes',
ss: '%d secondes',
m: 'une minute',
mm: '%d minutes',
h: 'une heure',
hh: '%d heures',
d: 'un jour',
dd: '%d jours',
M: 'un mois',
MM: '%d mois',
y: 'un an',
yy: '%d ans'
},
dayOfMonthOrdinalParse: /\d{1,2}(er|e)/,
ordinal: function (number, period) {
switch (period) {
// Words with masculine grammatical gender: mois, trimestre, jour
default:
case 'M':
case 'Q':
case 'D':
case 'DDD':
case 'd':
return number + (number === 1 ? 'er' : 'e');
// Words with feminine grammatical gender: semaine
case 'w':
case 'W':
return number + (number === 1 ? 're' : 'e');
}
}
});
return frCa;
});
/***/ }),
/***/ "./node_modules/moment/locale/fr-ch.js":
/*!*********************************************!*\
!*** ./node_modules/moment/locale/fr-ch.js ***!
\*********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
;
(function (global, factory) {
true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : undefined;
})(this, function (moment) {
'use strict';
var frCh = moment.defineLocale('fr-ch', {
months: 'janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre'.split('_'),
monthsShort: 'janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.'.split('_'),
monthsParseExact: true,
weekdays: 'dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi'.split('_'),
weekdaysShort: 'dim._lun._mar._mer._jeu._ven._sam.'.split('_'),
weekdaysMin: 'di_lu_ma_me_je_ve_sa'.split('_'),
weekdaysParseExact: true,
longDateFormat: {
LT: 'HH:mm',
LTS: 'HH:mm:ss',
L: 'DD.MM.YYYY',
LL: 'D MMMM YYYY',
LLL: 'D MMMM YYYY HH:mm',
LLLL: 'dddd D MMMM YYYY HH:mm'
},
calendar: {
sameDay: '[Aujourd’hui à] LT',
nextDay: '[Demain à] LT',
nextWeek: 'dddd [à] LT',
lastDay: '[Hier à] LT',
lastWeek: 'dddd [dernier à] LT',
sameElse: 'L'
},
relativeTime: {
future: 'dans %s',
past: 'il y a %s',
s: 'quelques secondes',
ss: '%d secondes',
m: 'une minute',
mm: '%d minutes',
h: 'une heure',
hh: '%d heures',
d: 'un jour',
dd: '%d jours',
M: 'un mois',
MM: '%d mois',
y: 'un an',
yy: '%d ans'
},
dayOfMonthOrdinalParse: /\d{1,2}(er|e)/,
ordinal: function (number, period) {
switch (period) {
// Words with masculine grammatical gender: mois, trimestre, jour
default:
case 'M':
case 'Q':
case 'D':
case 'DDD':
case 'd':
return number + (number === 1 ? 'er' : 'e');
// Words with feminine grammatical gender: semaine
case 'w':
case 'W':
return number + (number === 1 ? 're' : 'e');
}
},
week: {
dow: 1,
// Monday is the first day of the week.
doy: 4 // The week that contains Jan 4th is the first week of the year.
}
});
return frCh;
});
/***/ }),
/***/ "./node_modules/moment/locale/fr.js":
/*!******************************************!*\
!*** ./node_modules/moment/locale/fr.js ***!
\******************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
;
(function (global, factory) {
true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : undefined;
})(this, function (moment) {
'use strict';
var fr = moment.defineLocale('fr', {
months: 'janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre'.split('_'),
monthsShort: 'janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.'.split('_'),
monthsParseExact: true,
weekdays: 'dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi'.split('_'),
weekdaysShort: 'dim._lun._mar._mer._jeu._ven._sam.'.split('_'),
weekdaysMin: 'di_lu_ma_me_je_ve_sa'.split('_'),
weekdaysParseExact: true,
longDateFormat: {
LT: 'HH:mm',
LTS: 'HH:mm:ss',
L: 'DD/MM/YYYY',
LL: 'D MMMM YYYY',
LLL: 'D MMMM YYYY HH:mm',
LLLL: 'dddd D MMMM YYYY HH:mm'
},
calendar: {
sameDay: '[Aujourd’hui à] LT',
nextDay: '[Demain à] LT',
nextWeek: 'dddd [à] LT',
lastDay: '[Hier à] LT',
lastWeek: 'dddd [dernier à] LT',
sameElse: 'L'
},
relativeTime: {
future: 'dans %s',
past: 'il y a %s',
s: 'quelques secondes',
ss: '%d secondes',
m: 'une minute',
mm: '%d minutes',
h: 'une heure',
hh: '%d heures',
d: 'un jour',
dd: '%d jours',
M: 'un mois',
MM: '%d mois',
y: 'un an',
yy: '%d ans'
},
dayOfMonthOrdinalParse: /\d{1,2}(er|)/,
ordinal: function (number, period) {
switch (period) {
// TODO: Return 'e' when day of month > 1. Move this case inside
// block for masculine words below.
// See https://github.com/moment/moment/issues/3375
case 'D':
return number + (number === 1 ? 'er' : '');
// Words with masculine grammatical gender: mois, trimestre, jour
default:
case 'M':
case 'Q':
case 'DDD':
case 'd':
return number + (number === 1 ? 'er' : 'e');
// Words with feminine grammatical gender: semaine
case 'w':
case 'W':
return number + (number === 1 ? 're' : 'e');
}
},
week: {
dow: 1,
// Monday is the first day of the week.
doy: 4 // The week that contains Jan 4th is the first week of the year.
}
});
return fr;
});
/***/ }),
/***/ "./node_modules/moment/locale/fy.js":
/*!******************************************!*\
!*** ./node_modules/moment/locale/fy.js ***!
\******************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
;
(function (global, factory) {
true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : undefined;
})(this, function (moment) {
'use strict';
var monthsShortWithDots = 'jan._feb._mrt._apr._mai_jun._jul._aug._sep._okt._nov._des.'.split('_'),
monthsShortWithoutDots = 'jan_feb_mrt_apr_mai_jun_jul_aug_sep_okt_nov_des'.split('_');
var fy = moment.defineLocale('fy', {
months: 'jannewaris_febrewaris_maart_april_maaie_juny_july_augustus_septimber_oktober_novimber_desimber'.split('_'),
monthsShort: function (m, format) {
if (!m) {
return monthsShortWithDots;
} else if (/-MMM-/.test(format)) {
return monthsShortWithoutDots[m.month()];
} else {
return monthsShortWithDots[m.month()];
}
},
monthsParseExact: true,
weekdays: 'snein_moandei_tiisdei_woansdei_tongersdei_freed_sneon'.split('_'),
weekdaysShort: 'si._mo._ti._wo._to._fr._so.'.split('_'),
weekdaysMin: 'Si_Mo_Ti_Wo_To_Fr_So'.split('_'),
weekdaysParseExact: true,
longDateFormat: {
LT: 'HH:mm',
LTS: 'HH:mm:ss',
L: 'DD-MM-YYYY',
LL: 'D MMMM YYYY',
LLL: 'D MMMM YYYY HH:mm',
LLLL: 'dddd D MMMM YYYY HH:mm'
},
calendar: {
sameDay: '[hjoed om] LT',
nextDay: '[moarn om] LT',
nextWeek: 'dddd [om] LT',
lastDay: '[juster om] LT',
lastWeek: '[ôfrûne] dddd [om] LT',
sameElse: 'L'
},
relativeTime: {
future: 'oer %s',
past: '%s lyn',
s: 'in pear sekonden',
ss: '%d sekonden',
m: 'ien minút',
mm: '%d minuten',
h: 'ien oere',
hh: '%d oeren',
d: 'ien dei',
dd: '%d dagen',
M: 'ien moanne',
MM: '%d moannen',
y: 'ien jier',
yy: '%d jierren'
},
dayOfMonthOrdinalParse: /\d{1,2}(ste|de)/,
ordinal: function (number) {
return number + (number === 1 || number === 8 || number >= 20 ? 'ste' : 'de');
},
week: {
dow: 1,
// Monday is the first day of the week.
doy: 4 // The week that contains Jan 4th is the first week of the year.
}
});
return fy;
});
/***/ }),
/***/ "./node_modules/moment/locale/ga.js":
/*!******************************************!*\
!*** ./node_modules/moment/locale/ga.js ***!
\******************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
;
(function (global, factory) {
true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : undefined;
})(this, function (moment) {
'use strict';
var months = ['Eanáir', 'Feabhra', 'Márta', 'Aibreán', 'Bealtaine', 'Méitheamh', 'Iúil', 'Lúnasa', 'Meán Fómhair', 'Deaireadh Fómhair', 'Samhain', 'Nollaig'];
var monthsShort = ['Eaná', 'Feab', 'Márt', 'Aibr', 'Beal', 'Méit', 'Iúil', 'Lúna', 'Meán', 'Deai', 'Samh', 'Noll'];
var weekdays = ['Dé Domhnaigh', 'Dé Luain', 'Dé Máirt', 'Dé Céadaoin', 'Déardaoin', 'Dé hAoine', 'Dé Satharn'];
var weekdaysShort = ['Dom', 'Lua', 'Mái', 'Céa', 'Déa', 'hAo', 'Sat'];
var weekdaysMin = ['Do', 'Lu', 'Má', 'Ce', 'Dé', 'hA', 'Sa'];
var ga = moment.defineLocale('ga', {
months: months,
monthsShort: monthsShort,
monthsParseExact: true,
weekdays: weekdays,
weekdaysShort: weekdaysShort,
weekdaysMin: weekdaysMin,
longDateFormat: {
LT: 'HH:mm',
LTS: 'HH:mm:ss',
L: 'DD/MM/YYYY',
LL: 'D MMMM YYYY',
LLL: 'D MMMM YYYY HH:mm',
LLLL: 'dddd, D MMMM YYYY HH:mm'
},
calendar: {
sameDay: '[Inniu ag] LT',
nextDay: '[Amárach ag] LT',
nextWeek: 'dddd [ag] LT',
lastDay: '[Inné aig] LT',
lastWeek: 'dddd [seo caite] [ag] LT',
sameElse: 'L'
},
relativeTime: {
future: 'i %s',
past: '%s ó shin',
s: 'cúpla soicind',
ss: '%d soicind',
m: 'nóiméad',
mm: '%d nóiméad',
h: 'uair an chloig',
hh: '%d uair an chloig',
d: 'lá',
dd: '%d lá',
M: 'mí',
MM: '%d mí',
y: 'bliain',
yy: '%d bliain'
},
dayOfMonthOrdinalParse: /\d{1,2}(d|na|mh)/,
ordinal: function (number) {
var output = number === 1 ? 'd' : number % 10 === 2 ? 'na' : 'mh';
return number + output;
},
week: {
dow: 1,
// Monday is the first day of the week.
doy: 4 // The week that contains Jan 4th is the first week of the year.
}
});
return ga;
});
/***/ }),
/***/ "./node_modules/moment/locale/gd.js":
/*!******************************************!*\
!*** ./node_modules/moment/locale/gd.js ***!
\******************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
;
(function (global, factory) {
true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : undefined;
})(this, function (moment) {
'use strict';
var months = ['Am Faoilleach', 'An Gearran', 'Am Màrt', 'An Giblean', 'An Cèitean', 'An t-Ògmhios', 'An t-Iuchar', 'An Lùnastal', 'An t-Sultain', 'An Dàmhair', 'An t-Samhain', 'An Dùbhlachd'];
var monthsShort = ['Faoi', 'Gear', 'Màrt', 'Gibl', 'Cèit', 'Ògmh', 'Iuch', 'Lùn', 'Sult', 'Dàmh', 'Samh', 'Dùbh'];
var weekdays = ['Didòmhnaich', 'Diluain', 'Dimàirt', 'Diciadain', 'Diardaoin', 'Dihaoine', 'Disathairne'];
var weekdaysShort = ['Did', 'Dil', 'Dim', 'Dic', 'Dia', 'Dih', 'Dis'];
var weekdaysMin = ['Dò', 'Lu', 'Mà', 'Ci', 'Ar', 'Ha', 'Sa'];
var gd = moment.defineLocale('gd', {
months: months,
monthsShort: monthsShort,
monthsParseExact: true,
weekdays: weekdays,
weekdaysShort: weekdaysShort,
weekdaysMin: weekdaysMin,
longDateFormat: {
LT: 'HH:mm',
LTS: 'HH:mm:ss',
L: 'DD/MM/YYYY',
LL: 'D MMMM YYYY',
LLL: 'D MMMM YYYY HH:mm',
LLLL: 'dddd, D MMMM YYYY HH:mm'
},
calendar: {
sameDay: '[An-diugh aig] LT',
nextDay: '[A-màireach aig] LT',
nextWeek: 'dddd [aig] LT',
lastDay: '[An-dè aig] LT',
lastWeek: 'dddd [seo chaidh] [aig] LT',
sameElse: 'L'
},
relativeTime: {
future: 'ann an %s',
past: 'bho chionn %s',
s: 'beagan diogan',
ss: '%d diogan',
m: 'mionaid',
mm: '%d mionaidean',
h: 'uair',
hh: '%d uairean',
d: 'latha',
dd: '%d latha',
M: 'mìos',
MM: '%d mìosan',
y: 'bliadhna',
yy: '%d bliadhna'
},
dayOfMonthOrdinalParse: /\d{1,2}(d|na|mh)/,
ordinal: function (number) {
var output = number === 1 ? 'd' : number % 10 === 2 ? 'na' : 'mh';
return number + output;
},
week: {
dow: 1,
// Monday is the first day of the week.
doy: 4 // The week that contains Jan 4th is the first week of the year.
}
});
return gd;
});
/***/ }),
/***/ "./node_modules/moment/locale/gl.js":
/*!******************************************!*\
!*** ./node_modules/moment/locale/gl.js ***!
\******************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
;
(function (global, factory) {
true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : undefined;
})(this, function (moment) {
'use strict';
var gl = moment.defineLocale('gl', {
months: 'xaneiro_febreiro_marzo_abril_maio_xuño_xullo_agosto_setembro_outubro_novembro_decembro'.split('_'),
monthsShort: 'xan._feb._mar._abr._mai._xuñ._xul._ago._set._out._nov._dec.'.split('_'),
monthsParseExact: true,
weekdays: 'domingo_luns_martes_mércores_xoves_venres_sábado'.split('_'),
weekdaysShort: 'dom._lun._mar._mér._xov._ven._sáb.'.split('_'),
weekdaysMin: 'do_lu_ma_mé_xo_ve_sá'.split('_'),
weekdaysParseExact: true,
longDateFormat: {
LT: 'H:mm',
LTS: 'H:mm:ss',
L: 'DD/MM/YYYY',
LL: 'D [de] MMMM [de] YYYY',
LLL: 'D [de] MMMM [de] YYYY H:mm',
LLLL: 'dddd, D [de] MMMM [de] YYYY H:mm'
},
calendar: {
sameDay: function () {
return '[hoxe ' + (this.hours() !== 1 ? 'ás' : 'á') + '] LT';
},
nextDay: function () {
return '[mañá ' + (this.hours() !== 1 ? 'ás' : 'á') + '] LT';
},
nextWeek: function () {
return 'dddd [' + (this.hours() !== 1 ? 'ás' : 'a') + '] LT';
},
lastDay: function () {
return '[onte ' + (this.hours() !== 1 ? 'á' : 'a') + '] LT';
},
lastWeek: function () {
return '[o] dddd [pasado ' + (this.hours() !== 1 ? 'ás' : 'a') + '] LT';
},
sameElse: 'L'
},
relativeTime: {
future: function (str) {
if (str.indexOf('un') === 0) {
return 'n' + str;
}
return 'en ' + str;
},
past: 'hai %s',
s: 'uns segundos',
ss: '%d segundos',
m: 'un minuto',
mm: '%d minutos',
h: 'unha hora',
hh: '%d horas',
d: 'un día',
dd: '%d días',
M: 'un mes',
MM: '%d meses',
y: 'un ano',
yy: '%d anos'
},
dayOfMonthOrdinalParse: /\d{1,2}º/,
ordinal: '%dº',
week: {
dow: 1,
// Monday is the first day of the week.
doy: 4 // The week that contains Jan 4th is the first week of the year.
}
});
return gl;
});
/***/ }),
/***/ "./node_modules/moment/locale/gom-latn.js":
/*!************************************************!*\
!*** ./node_modules/moment/locale/gom-latn.js ***!
\************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
;
(function (global, factory) {
true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : undefined;
})(this, function (moment) {
'use strict';
function processRelativeTime(number, withoutSuffix, key, isFuture) {
var format = {
's': ['thodde secondanim', 'thodde second'],
'ss': [number + ' secondanim', number + ' second'],
'm': ['eka mintan', 'ek minute'],
'mm': [number + ' mintanim', number + ' mintam'],
'h': ['eka voran', 'ek vor'],
'hh': [number + ' voranim', number + ' voram'],
'd': ['eka disan', 'ek dis'],
'dd': [number + ' disanim', number + ' dis'],
'M': ['eka mhoinean', 'ek mhoino'],
'MM': [number + ' mhoineanim', number + ' mhoine'],
'y': ['eka vorsan', 'ek voros'],
'yy': [number + ' vorsanim', number + ' vorsam']
};
return withoutSuffix ? format[key][0] : format[key][1];
}
var gomLatn = moment.defineLocale('gom-latn', {
months: 'Janer_Febrer_Mars_Abril_Mai_Jun_Julai_Agost_Setembr_Otubr_Novembr_Dezembr'.split('_'),
monthsShort: 'Jan._Feb._Mars_Abr._Mai_Jun_Jul._Ago._Set._Otu._Nov._Dez.'.split('_'),
monthsParseExact: true,
weekdays: 'Aitar_Somar_Mongllar_Budvar_Brestar_Sukrar_Son\'var'.split('_'),
weekdaysShort: 'Ait._Som._Mon._Bud._Bre._Suk._Son.'.split('_'),
weekdaysMin: 'Ai_Sm_Mo_Bu_Br_Su_Sn'.split('_'),
weekdaysParseExact: true,
longDateFormat: {
LT: 'A h:mm [vazta]',
LTS: 'A h:mm:ss [vazta]',
L: 'DD-MM-YYYY',
LL: 'D MMMM YYYY',
LLL: 'D MMMM YYYY A h:mm [vazta]',
LLLL: 'dddd, MMMM[achea] Do, YYYY, A h:mm [vazta]',
llll: 'ddd, D MMM YYYY, A h:mm [vazta]'
},
calendar: {
sameDay: '[Aiz] LT',
nextDay: '[Faleam] LT',
nextWeek: '[Ieta to] dddd[,] LT',
lastDay: '[Kal] LT',
lastWeek: '[Fatlo] dddd[,] LT',
sameElse: 'L'
},
relativeTime: {
future: '%s',
past: '%s adim',
s: processRelativeTime,
ss: processRelativeTime,
m: processRelativeTime,
mm: processRelativeTime,
h: processRelativeTime,
hh: processRelativeTime,
d: processRelativeTime,
dd: processRelativeTime,
M: processRelativeTime,
MM: processRelativeTime,
y: processRelativeTime,
yy: processRelativeTime
},
dayOfMonthOrdinalParse: /\d{1,2}(er)/,
ordinal: function (number, period) {
switch (period) {
// the ordinal 'er' only applies to day of the month
case 'D':
return number + 'er';
default:
case 'M':
case 'Q':
case 'DDD':
case 'd':
case 'w':
case 'W':
return number;
}
},
week: {
dow: 1,
// Monday is the first day of the week.
doy: 4 // The week that contains Jan 4th is the first week of the year.
},
meridiemParse: /rati|sokalli|donparam|sanje/,
meridiemHour: function (hour, meridiem) {
if (hour === 12) {
hour = 0;
}
if (meridiem === 'rati') {
return hour < 4 ? hour : hour + 12;
} else if (meridiem === 'sokalli') {
return hour;
} else if (meridiem === 'donparam') {
return hour > 12 ? hour : hour + 12;
} else if (meridiem === 'sanje') {
return hour + 12;
}
},
meridiem: function (hour, minute, isLower) {
if (hour < 4) {
return 'rati';
} else if (hour < 12) {
return 'sokalli';
} else if (hour < 16) {
return 'donparam';
} else if (hour < 20) {
return 'sanje';
} else {
return 'rati';
}
}
});
return gomLatn;
});
/***/ }),
/***/ "./node_modules/moment/locale/gu.js":
/*!******************************************!*\
!*** ./node_modules/moment/locale/gu.js ***!
\******************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
;
(function (global, factory) {
true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : undefined;
})(this, function (moment) {
'use strict';
var symbolMap = {
'1': '૧',
'2': '૨',
'3': '૩',
'4': '૪',
'5': '૫',
'6': '૬',
'7': '૭',
'8': '૮',
'9': '૯',
'0': '૦'
},
numberMap = {
'૧': '1',
'૨': '2',
'૩': '3',
'૪': '4',
'૫': '5',
'૬': '6',
'૭': '7',
'૮': '8',
'૯': '9',
'૦': '0'
};
var gu = moment.defineLocale('gu', {
months: 'જાન્યુઆરી_ફેબ્રુઆરી_માર્ચ_એપ્રિલ_મે_જૂન_જુલાઈ_ઑગસ્ટ_સપ્ટેમ્બર_ઑક્ટ્બર_નવેમ્બર_ડિસેમ્બર'.split('_'),
monthsShort: 'જાન્યુ._ફેબ્રુ._માર્ચ_એપ્રિ._મે_જૂન_જુલા._ઑગ._સપ્ટે._ઑક્ટ્._નવે._ડિસે.'.split('_'),
monthsParseExact: true,
weekdays: 'રવિવાર_સોમવાર_મંગળવાર_બુધ્વાર_ગુરુવાર_શુક્રવાર_શનિવાર'.split('_'),
weekdaysShort: 'રવિ_સોમ_મંગળ_બુધ્_ગુરુ_શુક્ર_શનિ'.split('_'),
weekdaysMin: 'ર_સો_મં_બુ_ગુ_શુ_શ'.split('_'),
longDateFormat: {
LT: 'A h:mm વાગ્યે',
LTS: 'A h:mm:ss વાગ્યે',
L: 'DD/MM/YYYY',
LL: 'D MMMM YYYY',
LLL: 'D MMMM YYYY, A h:mm વાગ્યે',
LLLL: 'dddd, D MMMM YYYY, A h:mm વાગ્યે'
},
calendar: {
sameDay: '[આજ] LT',
nextDay: '[કાલે] LT',
nextWeek: 'dddd, LT',
lastDay: '[ગઇકાલે] LT',
lastWeek: '[પાછલા] dddd, LT',
sameElse: 'L'
},
relativeTime: {
future: '%s મા',
past: '%s પેહલા',
s: 'અમુક પળો',
ss: '%d સેકંડ',
m: 'એક મિનિટ',
mm: '%d મિનિટ',
h: 'એક કલાક',
hh: '%d કલાક',
d: 'એક દિવસ',
dd: '%d દિવસ',
M: 'એક મહિનો',
MM: '%d મહિનો',
y: 'એક વર્ષ',
yy: '%d વર્ષ'
},
preparse: function (string) {
return string.replace(/[૧૨૩૪૫૬૭૮૯૦]/g, function (match) {
return numberMap[match];
});
},
postformat: function (string) {
return string.replace(/\d/g, function (match) {
return symbolMap[match];
});
},
// Gujarati notation for meridiems are quite fuzzy in practice. While there exists
// a rigid notion of a 'Pahar' it is not used as rigidly in modern Gujarati.
meridiemParse: /રાત|બપોર|સવાર|સાંજ/,
meridiemHour: function (hour, meridiem) {
if (hour === 12) {
hour = 0;
}
if (meridiem === 'રાત') {
return hour < 4 ? hour : hour + 12;
} else if (meridiem === 'સવાર') {
return hour;
} else if (meridiem === 'બપોર') {
return hour >= 10 ? hour : hour + 12;
} else if (meridiem === 'સાંજ') {
return hour + 12;
}
},
meridiem: function (hour, minute, isLower) {
if (hour < 4) {
return 'રાત';
} else if (hour < 10) {
return 'સવાર';
} else if (hour < 17) {
return 'બપોર';
} else if (hour < 20) {
return 'સાંજ';
} else {
return 'રાત';
}
},
week: {
dow: 0,
// Sunday is the first day of the week.
doy: 6 // The week that contains Jan 6th is the first week of the year.
}
});
return gu;
});
/***/ }),
/***/ "./node_modules/moment/locale/he.js":
/*!******************************************!*\
!*** ./node_modules/moment/locale/he.js ***!
\******************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
;
(function (global, factory) {
true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : undefined;
})(this, function (moment) {
'use strict';
var he = moment.defineLocale('he', {
months: 'ינואר_פברואר_מרץ_אפריל_מאי_יוני_יולי_אוגוסט_ספטמבר_אוקטובר_נובמבר_דצמבר'.split('_'),
monthsShort: 'ינו׳_פבר׳_מרץ_אפר׳_מאי_יוני_יולי_אוג׳_ספט׳_אוק׳_נוב׳_דצמ׳'.split('_'),
weekdays: 'ראשון_שני_שלישי_רביעי_חמישי_שישי_שבת'.split('_'),
weekdaysShort: 'א׳_ב׳_ג׳_ד׳_ה׳_ו׳_ש׳'.split('_'),
weekdaysMin: 'א_ב_ג_ד_ה_ו_ש'.split('_'),
longDateFormat: {
LT: 'HH:mm',
LTS: 'HH:mm:ss',
L: 'DD/MM/YYYY',
LL: 'D [ב]MMMM YYYY',
LLL: 'D [ב]MMMM YYYY HH:mm',
LLLL: 'dddd, D [ב]MMMM YYYY HH:mm',
l: 'D/M/YYYY',
ll: 'D MMM YYYY',
lll: 'D MMM YYYY HH:mm',
llll: 'ddd, D MMM YYYY HH:mm'
},
calendar: {
sameDay: '[היום ב־]LT',
nextDay: '[מחר ב־]LT',
nextWeek: 'dddd [בשעה] LT',
lastDay: '[אתמול ב־]LT',
lastWeek: '[ביום] dddd [האחרון בשעה] LT',
sameElse: 'L'
},
relativeTime: {
future: 'בעוד %s',
past: 'לפני %s',
s: 'מספר שניות',
ss: '%d שניות',
m: 'דקה',
mm: '%d דקות',
h: 'שעה',
hh: function (number) {
if (number === 2) {
return 'שעתיים';
}
return number + ' שעות';
},
d: 'יום',
dd: function (number) {
if (number === 2) {
return 'יומיים';
}
return number + ' ימים';
},
M: 'חודש',
MM: function (number) {
if (number === 2) {
return 'חודשיים';
}
return number + ' חודשים';
},
y: 'שנה',
yy: function (number) {
if (number === 2) {
return 'שנתיים';
} else if (number % 10 === 0 && number !== 10) {
return number + ' שנה';
}
return number + ' שנים';
}
},
meridiemParse: /אחה"צ|לפנה"צ|אחרי הצהריים|לפני הצהריים|לפנות בוקר|בבוקר|בערב/i,
isPM: function (input) {
return /^(אחה"צ|אחרי הצהריים|בערב)$/.test(input);
},
meridiem: function (hour, minute, isLower) {
if (hour < 5) {
return 'לפנות בוקר';
} else if (hour < 10) {
return 'בבוקר';
} else if (hour < 12) {
return isLower ? 'לפנה"צ' : 'לפני הצהריים';
} else if (hour < 18) {
return isLower ? 'אחה"צ' : 'אחרי הצהריים';
} else {
return 'בערב';
}
}
});
return he;
});
/***/ }),
/***/ "./node_modules/moment/locale/hi.js":
/*!******************************************!*\
!*** ./node_modules/moment/locale/hi.js ***!
\******************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
;
(function (global, factory) {
true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : undefined;
})(this, function (moment) {
'use strict';
var symbolMap = {
'1': '१',
'2': '२',
'3': '३',
'4': '४',
'5': '५',
'6': '६',
'7': '७',
'8': '८',
'9': '९',
'0': '०'
},
numberMap = {
'१': '1',
'२': '2',
'३': '3',
'४': '4',
'५': '5',
'६': '6',
'७': '7',
'८': '8',
'९': '9',
'०': '0'
};
var hi = moment.defineLocale('hi', {
months: 'जनवरी_फ़रवरी_मार्च_अप्रैल_मई_जून_जुलाई_अगस्त_सितम्बर_अक्टूबर_नवम्बर_दिसम्बर'.split('_'),
monthsShort: 'जन._फ़र._मार्च_अप्रै._मई_जून_जुल._अग._सित._अक्टू._नव._दिस.'.split('_'),
monthsParseExact: true,
weekdays: 'रविवार_सोमवार_मंगलवार_बुधवार_गुरूवार_शुक्रवार_शनिवार'.split('_'),
weekdaysShort: 'रवि_सोम_मंगल_बुध_गुरू_शुक्र_शनि'.split('_'),
weekdaysMin: 'र_सो_मं_बु_गु_शु_श'.split('_'),
longDateFormat: {
LT: 'A h:mm बजे',
LTS: 'A h:mm:ss बजे',
L: 'DD/MM/YYYY',
LL: 'D MMMM YYYY',
LLL: 'D MMMM YYYY, A h:mm बजे',
LLLL: 'dddd, D MMMM YYYY, A h:mm बजे'
},
calendar: {
sameDay: '[आज] LT',
nextDay: '[कल] LT',
nextWeek: 'dddd, LT',
lastDay: '[कल] LT',
lastWeek: '[पिछले] dddd, LT',
sameElse: 'L'
},
relativeTime: {
future: '%s में',
past: '%s पहले',
s: 'कुछ ही क्षण',
ss: '%d सेकंड',
m: 'एक मिनट',
mm: '%d मिनट',
h: 'एक घंटा',
hh: '%d घंटे',
d: 'एक दिन',
dd: '%d दिन',
M: 'एक महीने',
MM: '%d महीने',
y: 'एक वर्ष',
yy: '%d वर्ष'
},
preparse: function (string) {
return string.replace(/[१२३४५६७८९०]/g, function (match) {
return numberMap[match];
});
},
postformat: function (string) {
return string.replace(/\d/g, function (match) {
return symbolMap[match];
});
},
// Hindi notation for meridiems are quite fuzzy in practice. While there exists
// a rigid notion of a 'Pahar' it is not used as rigidly in modern Hindi.
meridiemParse: /रात|सुबह|दोपहर|शाम/,
meridiemHour: function (hour, meridiem) {
if (hour === 12) {
hour = 0;
}
if (meridiem === 'रात') {
return hour < 4 ? hour : hour + 12;
} else if (meridiem === 'सुबह') {
return hour;
} else if (meridiem === 'दोपहर') {
return hour >= 10 ? hour : hour + 12;
} else if (meridiem === 'शाम') {
return hour + 12;
}
},
meridiem: function (hour, minute, isLower) {
if (hour < 4) {
return 'रात';
} else if (hour < 10) {
return 'सुबह';
} else if (hour < 17) {
return 'दोपहर';
} else if (hour < 20) {
return 'शाम';
} else {
return 'रात';
}
},
week: {
dow: 0,
// Sunday is the first day of the week.
doy: 6 // The week that contains Jan 6th is the first week of the year.
}
});
return hi;
});
/***/ }),
/***/ "./node_modules/moment/locale/hr.js":
/*!******************************************!*\
!*** ./node_modules/moment/locale/hr.js ***!
\******************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
;
(function (global, factory) {
true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : undefined;
})(this, function (moment) {
'use strict';
function translate(number, withoutSuffix, key) {
var result = number + ' ';
switch (key) {
case 'ss':
if (number === 1) {
result += 'sekunda';
} else if (number === 2 || number === 3 || number === 4) {
result += 'sekunde';
} else {
result += 'sekundi';
}
return result;
case 'm':
return withoutSuffix ? 'jedna minuta' : 'jedne minute';
case 'mm':
if (number === 1) {
result += 'minuta';
} else if (number === 2 || number === 3 || number === 4) {
result += 'minute';
} else {
result += 'minuta';
}
return result;
case 'h':
return withoutSuffix ? 'jedan sat' : 'jednog sata';
case 'hh':
if (number === 1) {
result += 'sat';
} else if (number === 2 || number === 3 || number === 4) {
result += 'sata';
} else {
result += 'sati';
}
return result;
case 'dd':
if (number === 1) {
result += 'dan';
} else {
result += 'dana';
}
return result;
case 'MM':
if (number === 1) {
result += 'mjesec';
} else if (number === 2 || number === 3 || number === 4) {
result += 'mjeseca';
} else {
result += 'mjeseci';
}
return result;
case 'yy':
if (number === 1) {
result += 'godina';
} else if (number === 2 || number === 3 || number === 4) {
result += 'godine';
} else {
result += 'godina';
}
return result;
}
}
var hr = moment.defineLocale('hr', {
months: {
format: 'siječnja_veljače_ožujka_travnja_svibnja_lipnja_srpnja_kolovoza_rujna_listopada_studenoga_prosinca'.split('_'),
standalone: 'siječanj_veljača_ožujak_travanj_svibanj_lipanj_srpanj_kolovoz_rujan_listopad_studeni_prosinac'.split('_')
},
monthsShort: 'sij._velj._ožu._tra._svi._lip._srp._kol._ruj._lis._stu._pro.'.split('_'),
monthsParseExact: true,
weekdays: 'nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota'.split('_'),
weekdaysShort: 'ned._pon._uto._sri._čet._pet._sub.'.split('_'),
weekdaysMin: 'ne_po_ut_sr_če_pe_su'.split('_'),
weekdaysParseExact: true,
longDateFormat: {
LT: 'H:mm',
LTS: 'H:mm:ss',
L: 'DD.MM.YYYY',
LL: 'D. MMMM YYYY',
LLL: 'D. MMMM YYYY H:mm',
LLLL: 'dddd, D. MMMM YYYY H:mm'
},
calendar: {
sameDay: '[danas u] LT',
nextDay: '[sutra u] LT',
nextWeek: function () {
switch (this.day()) {
case 0:
return '[u] [nedjelju] [u] LT';
case 3:
return '[u] [srijedu] [u] LT';
case 6:
return '[u] [subotu] [u] LT';
case 1:
case 2:
case 4:
case 5:
return '[u] dddd [u] LT';
}
},
lastDay: '[jučer u] LT',
lastWeek: function () {
switch (this.day()) {
case 0:
case 3:
return '[prošlu] dddd [u] LT';
case 6:
return '[prošle] [subote] [u] LT';
case 1:
case 2:
case 4:
case 5:
return '[prošli] dddd [u] LT';
}
},
sameElse: 'L'
},
relativeTime: {
future: 'za %s',
past: 'prije %s',
s: 'par sekundi',
ss: translate,
m: translate,
mm: translate,
h: translate,
hh: translate,
d: 'dan',
dd: translate,
M: 'mjesec',
MM: translate,
y: 'godinu',
yy: translate
},
dayOfMonthOrdinalParse: /\d{1,2}\./,
ordinal: '%d.',
week: {
dow: 1,
// Monday is the first day of the week.
doy: 7 // The week that contains Jan 7th is the first week of the year.
}
});
return hr;
});
/***/ }),
/***/ "./node_modules/moment/locale/hu.js":
/*!******************************************!*\
!*** ./node_modules/moment/locale/hu.js ***!
\******************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
;
(function (global, factory) {
true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : undefined;
})(this, function (moment) {
'use strict';
var weekEndings = 'vasárnap hétfőn kedden szerdán csütörtökön pénteken szombaton'.split(' ');
function translate(number, withoutSuffix, key, isFuture) {
var num = number;
switch (key) {
case 's':
return isFuture || withoutSuffix ? 'néhány másodperc' : 'néhány másodperce';
case 'ss':
return num + (isFuture || withoutSuffix) ? ' másodperc' : ' másodperce';
case 'm':
return 'egy' + (isFuture || withoutSuffix ? ' perc' : ' perce');
case 'mm':
return num + (isFuture || withoutSuffix ? ' perc' : ' perce');
case 'h':
return 'egy' + (isFuture || withoutSuffix ? ' óra' : ' órája');
case 'hh':
return num + (isFuture || withoutSuffix ? ' óra' : ' órája');
case 'd':
return 'egy' + (isFuture || withoutSuffix ? ' nap' : ' napja');
case 'dd':
return num + (isFuture || withoutSuffix ? ' nap' : ' napja');
case 'M':
return 'egy' + (isFuture || withoutSuffix ? ' hónap' : ' hónapja');
case 'MM':
return num + (isFuture || withoutSuffix ? ' hónap' : ' hónapja');
case 'y':
return 'egy' + (isFuture || withoutSuffix ? ' év' : ' éve');
case 'yy':
return num + (isFuture || withoutSuffix ? ' év' : ' éve');
}
return '';
}
function week(isFuture) {
return (isFuture ? '' : '[múlt] ') + '[' + weekEndings[this.day()] + '] LT[-kor]';
}
var hu = moment.defineLocale('hu', {
months: 'január_február_március_április_május_június_július_augusztus_szeptember_október_november_december'.split('_'),
monthsShort: 'jan_feb_márc_ápr_máj_jún_júl_aug_szept_okt_nov_dec'.split('_'),
weekdays: 'vasárnap_hétfő_kedd_szerda_csütörtök_péntek_szombat'.split('_'),
weekdaysShort: 'vas_hét_kedd_sze_csüt_pén_szo'.split('_'),
weekdaysMin: 'v_h_k_sze_cs_p_szo'.split('_'),
longDateFormat: {
LT: 'H:mm',
LTS: 'H:mm:ss',
L: 'YYYY.MM.DD.',
LL: 'YYYY. MMMM D.',
LLL: 'YYYY. MMMM D. H:mm',
LLLL: 'YYYY. MMMM D., dddd H:mm'
},
meridiemParse: /de|du/i,
isPM: function (input) {
return input.charAt(1).toLowerCase() === 'u';
},
meridiem: function (hours, minutes, isLower) {
if (hours < 12) {
return isLower === true ? 'de' : 'DE';
} else {
return isLower === true ? 'du' : 'DU';
}
},
calendar: {
sameDay: '[ma] LT[-kor]',
nextDay: '[holnap] LT[-kor]',
nextWeek: function () {
return week.call(this, true);
},
lastDay: '[tegnap] LT[-kor]',
lastWeek: function () {
return week.call(this, false);
},
sameElse: 'L'
},
relativeTime: {
future: '%s múlva',
past: '%s',
s: translate,
ss: translate,
m: translate,
mm: translate,
h: translate,
hh: translate,
d: translate,
dd: translate,
M: translate,
MM: translate,
y: translate,
yy: translate
},
dayOfMonthOrdinalParse: /\d{1,2}\./,
ordinal: '%d.',
week: {
dow: 1,
// Monday is the first day of the week.
doy: 4 // The week that contains Jan 4th is the first week of the year.
}
});
return hu;
});
/***/ }),
/***/ "./node_modules/moment/locale/hy-am.js":
/*!*********************************************!*\
!*** ./node_modules/moment/locale/hy-am.js ***!
\*********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
;
(function (global, factory) {
true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : undefined;
})(this, function (moment) {
'use strict';
var hyAm = moment.defineLocale('hy-am', {
months: {
format: 'հունվարի_փետրվարի_մարտի_ապրիլի_մայիսի_հունիսի_հուլիսի_օգոստոսի_սեպտեմբերի_հոկտեմբերի_նոյեմբերի_դեկտեմբերի'.split('_'),
standalone: 'հունվար_փետրվար_մարտ_ապրիլ_մայիս_հունիս_հուլիս_օգոստոս_սեպտեմբեր_հոկտեմբեր_նոյեմբեր_դեկտեմբեր'.split('_')
},
monthsShort: 'հնվ_փտր_մրտ_ապր_մյս_հնս_հլս_օգս_սպտ_հկտ_նմբ_դկտ'.split('_'),
weekdays: 'կիրակի_երկուշաբթի_երեքշաբթի_չորեքշաբթի_հինգշաբթի_ուրբաթ_շաբաթ'.split('_'),
weekdaysShort: 'կրկ_երկ_երք_չրք_հնգ_ուրբ_շբթ'.split('_'),
weekdaysMin: 'կրկ_երկ_երք_չրք_հնգ_ուրբ_շբթ'.split('_'),
longDateFormat: {
LT: 'HH:mm',
LTS: 'HH:mm:ss',
L: 'DD.MM.YYYY',
LL: 'D MMMM YYYY թ.',
LLL: 'D MMMM YYYY թ., HH:mm',
LLLL: 'dddd, D MMMM YYYY թ., HH:mm'
},
calendar: {
sameDay: '[այսօր] LT',
nextDay: '[վաղը] LT',
lastDay: '[երեկ] LT',
nextWeek: function () {
return 'dddd [օրը ժամը] LT';
},
lastWeek: function () {
return '[անցած] dddd [օրը ժամը] LT';
},
sameElse: 'L'
},
relativeTime: {
future: '%s հետո',
past: '%s առաջ',
s: 'մի քանի վայրկյան',
ss: '%d վայրկյան',
m: 'րոպե',
mm: '%d րոպե',
h: 'ժամ',
hh: '%d ժամ',
d: 'օր',
dd: '%d օր',
M: 'ամիս',
MM: '%d ամիս',
y: 'տարի',
yy: '%d տարի'
},
meridiemParse: /գիշերվա|առավոտվա|ցերեկվա|երեկոյան/,
isPM: function (input) {
return /^(ցերեկվա|երեկոյան)$/.test(input);
},
meridiem: function (hour) {
if (hour < 4) {
return 'գիշերվա';
} else if (hour < 12) {
return 'առավոտվա';
} else if (hour < 17) {
return 'ցերեկվա';
} else {
return 'երեկոյան';
}
},
dayOfMonthOrdinalParse: /\d{1,2}|\d{1,2}-(ին|րդ)/,
ordinal: function (number, period) {
switch (period) {
case 'DDD':
case 'w':
case 'W':
case 'DDDo':
if (number === 1) {
return number + '-ին';
}
return number + '-րդ';
default:
return number;
}
},
week: {
dow: 1,
// Monday is the first day of the week.
doy: 7 // The week that contains Jan 7th is the first week of the year.
}
});
return hyAm;
});
/***/ }),
/***/ "./node_modules/moment/locale/id.js":
/*!******************************************!*\
!*** ./node_modules/moment/locale/id.js ***!
\******************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
;
(function (global, factory) {
true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : undefined;
})(this, function (moment) {
'use strict';
var id = moment.defineLocale('id', {
months: 'Januari_Februari_Maret_April_Mei_Juni_Juli_Agustus_September_Oktober_November_Desember'.split('_'),
monthsShort: 'Jan_Feb_Mar_Apr_Mei_Jun_Jul_Agt_Sep_Okt_Nov_Des'.split('_'),
weekdays: 'Minggu_Senin_Selasa_Rabu_Kamis_Jumat_Sabtu'.split('_'),
weekdaysShort: 'Min_Sen_Sel_Rab_Kam_Jum_Sab'.split('_'),
weekdaysMin: 'Mg_Sn_Sl_Rb_Km_Jm_Sb'.split('_'),
longDateFormat: {
LT: 'HH.mm',
LTS: 'HH.mm.ss',
L: 'DD/MM/YYYY',
LL: 'D MMMM YYYY',
LLL: 'D MMMM YYYY [pukul] HH.mm',
LLLL: 'dddd, D MMMM YYYY [pukul] HH.mm'
},
meridiemParse: /pagi|siang|sore|malam/,
meridiemHour: function (hour, meridiem) {
if (hour === 12) {
hour = 0;
}
if (meridiem === 'pagi') {
return hour;
} else if (meridiem === 'siang') {
return hour >= 11 ? hour : hour + 12;
} else if (meridiem === 'sore' || meridiem === 'malam') {
return hour + 12;
}
},
meridiem: function (hours, minutes, isLower) {
if (hours < 11) {
return 'pagi';
} else if (hours < 15) {
return 'siang';
} else if (hours < 19) {
return 'sore';
} else {
return 'malam';
}
},
calendar: {
sameDay: '[Hari ini pukul] LT',
nextDay: '[Besok pukul] LT',
nextWeek: 'dddd [pukul] LT',
lastDay: '[Kemarin pukul] LT',
lastWeek: 'dddd [lalu pukul] LT',
sameElse: 'L'
},
relativeTime: {
future: 'dalam %s',
past: '%s yang lalu',
s: 'beberapa detik',
ss: '%d detik',
m: 'semenit',
mm: '%d menit',
h: 'sejam',
hh: '%d jam',
d: 'sehari',
dd: '%d hari',
M: 'sebulan',
MM: '%d bulan',
y: 'setahun',
yy: '%d tahun'
},
week: {
dow: 1,
// Monday is the first day of the week.
doy: 7 // The week that contains Jan 7th is the first week of the year.
}
});
return id;
});
/***/ }),
/***/ "./node_modules/moment/locale/is.js":
/*!******************************************!*\
!*** ./node_modules/moment/locale/is.js ***!
\******************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
;
(function (global, factory) {
true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : undefined;
})(this, function (moment) {
'use strict';
function plural(n) {
if (n % 100 === 11) {
return true;
} else if (n % 10 === 1) {
return false;
}
return true;
}
function translate(number, withoutSuffix, key, isFuture) {
var result = number + ' ';
switch (key) {
case 's':
return withoutSuffix || isFuture ? 'nokkrar sekúndur' : 'nokkrum sekúndum';
case 'ss':
if (plural(number)) {
return result + (withoutSuffix || isFuture ? 'sekúndur' : 'sekúndum');
}
return result + 'sekúnda';
case 'm':
return withoutSuffix ? 'mínúta' : 'mínútu';
case 'mm':
if (plural(number)) {
return result + (withoutSuffix || isFuture ? 'mínútur' : 'mínútum');
} else if (withoutSuffix) {
return result + 'mínúta';
}
return result + 'mínútu';
case 'hh':
if (plural(number)) {
return result + (withoutSuffix || isFuture ? 'klukkustundir' : 'klukkustundum');
}
return result + 'klukkustund';
case 'd':
if (withoutSuffix) {
return 'dagur';
}
return isFuture ? 'dag' : 'degi';
case 'dd':
if (plural(number)) {
if (withoutSuffix) {
return result + 'dagar';
}
return result + (isFuture ? 'daga' : 'dögum');
} else if (withoutSuffix) {
return result + 'dagur';
}
return result + (isFuture ? 'dag' : 'degi');
case 'M':
if (withoutSuffix) {
return 'mánuður';
}
return isFuture ? 'mánuð' : 'mánuði';
case 'MM':
if (plural(number)) {
if (withoutSuffix) {
return result + 'mánuðir';
}
return result + (isFuture ? 'mánuði' : 'mánuðum');
} else if (withoutSuffix) {
return result + 'mánuður';
}
return result + (isFuture ? 'mánuð' : 'mánuði');
case 'y':
return withoutSuffix || isFuture ? 'ár' : 'ári';
case 'yy':
if (plural(number)) {
return result + (withoutSuffix || isFuture ? 'ár' : 'árum');
}
return result + (withoutSuffix || isFuture ? 'ár' : 'ári');
}
}
var is = moment.defineLocale('is', {
months: 'janúar_febrúar_mars_apríl_maí_júní_júlí_ágúst_september_október_nóvember_desember'.split('_'),
monthsShort: 'jan_feb_mar_apr_maí_jún_júl_ágú_sep_okt_nóv_des'.split('_'),
weekdays: 'sunnudagur_mánudagur_þriðjudagur_miðvikudagur_fimmtudagur_föstudagur_laugardagur'.split('_'),
weekdaysShort: 'sun_mán_þri_mið_fim_fös_lau'.split('_'),
weekdaysMin: 'Su_Má_Þr_Mi_Fi_Fö_La'.split('_'),
longDateFormat: {
LT: 'H:mm',
LTS: 'H:mm:ss',
L: 'DD.MM.YYYY',
LL: 'D. MMMM YYYY',
LLL: 'D. MMMM YYYY [kl.] H:mm',
LLLL: 'dddd, D. MMMM YYYY [kl.] H:mm'
},
calendar: {
sameDay: '[í dag kl.] LT',
nextDay: '[á morgun kl.] LT',
nextWeek: 'dddd [kl.] LT',
lastDay: '[í gær kl.] LT',
lastWeek: '[síðasta] dddd [kl.] LT',
sameElse: 'L'
},
relativeTime: {
future: 'eftir %s',
past: 'fyrir %s síðan',
s: translate,
ss: translate,
m: translate,
mm: translate,
h: 'klukkustund',
hh: translate,
d: translate,
dd: translate,
M: translate,
MM: translate,
y: translate,
yy: translate
},
dayOfMonthOrdinalParse: /\d{1,2}\./,
ordinal: '%d.',
week: {
dow: 1,
// Monday is the first day of the week.
doy: 4 // The week that contains Jan 4th is the first week of the year.
}
});
return is;
});
/***/ }),
/***/ "./node_modules/moment/locale/it-ch.js":
/*!*********************************************!*\
!*** ./node_modules/moment/locale/it-ch.js ***!
\*********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
;
(function (global, factory) {
true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : undefined;
})(this, function (moment) {
'use strict';
var itCh = moment.defineLocale('it-ch', {
months: 'gennaio_febbraio_marzo_aprile_maggio_giugno_luglio_agosto_settembre_ottobre_novembre_dicembre'.split('_'),
monthsShort: 'gen_feb_mar_apr_mag_giu_lug_ago_set_ott_nov_dic'.split('_'),
weekdays: 'domenica_lunedì_martedì_mercoledì_giovedì_venerdì_sabato'.split('_'),
weekdaysShort: 'dom_lun_mar_mer_gio_ven_sab'.split('_'),
weekdaysMin: 'do_lu_ma_me_gi_ve_sa'.split('_'),
longDateFormat: {
LT: 'HH:mm',
LTS: 'HH:mm:ss',
L: 'DD.MM.YYYY',
LL: 'D MMMM YYYY',
LLL: 'D MMMM YYYY HH:mm',
LLLL: 'dddd D MMMM YYYY HH:mm'
},
calendar: {
sameDay: '[Oggi alle] LT',
nextDay: '[Domani alle] LT',
nextWeek: 'dddd [alle] LT',
lastDay: '[Ieri alle] LT',
lastWeek: function () {
switch (this.day()) {
case 0:
return '[la scorsa] dddd [alle] LT';
default:
return '[lo scorso] dddd [alle] LT';
}
},
sameElse: 'L'
},
relativeTime: {
future: function (s) {
return (/^[0-9].+$/.test(s) ? 'tra' : 'in') + ' ' + s;
},
past: '%s fa',
s: 'alcuni secondi',
ss: '%d secondi',
m: 'un minuto',
mm: '%d minuti',
h: 'un\'ora',
hh: '%d ore',
d: 'un giorno',
dd: '%d giorni',
M: 'un mese',
MM: '%d mesi',
y: 'un anno',
yy: '%d anni'
},
dayOfMonthOrdinalParse: /\d{1,2}º/,
ordinal: '%dº',
week: {
dow: 1,
// Monday is the first day of the week.
doy: 4 // The week that contains Jan 4th is the first week of the year.
}
});
return itCh;
});
/***/ }),
/***/ "./node_modules/moment/locale/it.js":
/*!******************************************!*\
!*** ./node_modules/moment/locale/it.js ***!
\******************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
;
(function (global, factory) {
true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : undefined;
})(this, function (moment) {
'use strict';
var it = moment.defineLocale('it', {
months: 'gennaio_febbraio_marzo_aprile_maggio_giugno_luglio_agosto_settembre_ottobre_novembre_dicembre'.split('_'),
monthsShort: 'gen_feb_mar_apr_mag_giu_lug_ago_set_ott_nov_dic'.split('_'),
weekdays: 'domenica_lunedì_martedì_mercoledì_giovedì_venerdì_sabato'.split('_'),
weekdaysShort: 'dom_lun_mar_mer_gio_ven_sab'.split('_'),
weekdaysMin: 'do_lu_ma_me_gi_ve_sa'.split('_'),
longDateFormat: {
LT: 'HH:mm',
LTS: 'HH:mm:ss',
L: 'DD/MM/YYYY',
LL: 'D MMMM YYYY',
LLL: 'D MMMM YYYY HH:mm',
LLLL: 'dddd D MMMM YYYY HH:mm'
},
calendar: {
sameDay: '[Oggi alle] LT',
nextDay: '[Domani alle] LT',
nextWeek: 'dddd [alle] LT',
lastDay: '[Ieri alle] LT',
lastWeek: function () {
switch (this.day()) {
case 0:
return '[la scorsa] dddd [alle] LT';
default:
return '[lo scorso] dddd [alle] LT';
}
},
sameElse: 'L'
},
relativeTime: {
future: function (s) {
return (/^[0-9].+$/.test(s) ? 'tra' : 'in') + ' ' + s;
},
past: '%s fa',
s: 'alcuni secondi',
ss: '%d secondi',
m: 'un minuto',
mm: '%d minuti',
h: 'un\'ora',
hh: '%d ore',
d: 'un giorno',
dd: '%d giorni',
M: 'un mese',
MM: '%d mesi',
y: 'un anno',
yy: '%d anni'
},
dayOfMonthOrdinalParse: /\d{1,2}º/,
ordinal: '%dº',
week: {
dow: 1,
// Monday is the first day of the week.
doy: 4 // The week that contains Jan 4th is the first week of the year.
}
});
return it;
});
/***/ }),
/***/ "./node_modules/moment/locale/ja.js":
/*!******************************************!*\
!*** ./node_modules/moment/locale/ja.js ***!
\******************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
;
(function (global, factory) {
true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : undefined;
})(this, function (moment) {
'use strict';
var ja = moment.defineLocale('ja', {
months: '一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月'.split('_'),
monthsShort: '1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月'.split('_'),
weekdays: '日曜日_月曜日_火曜日_水曜日_木曜日_金曜日_土曜日'.split('_'),
weekdaysShort: '日_月_火_水_木_金_土'.split('_'),
weekdaysMin: '日_月_火_水_木_金_土'.split('_'),
longDateFormat: {
LT: 'HH:mm',
LTS: 'HH:mm:ss',
L: 'YYYY/MM/DD',
LL: 'YYYY年M月D日',
LLL: 'YYYY年M月D日 HH:mm',
LLLL: 'YYYY年M月D日 dddd HH:mm',
l: 'YYYY/MM/DD',
ll: 'YYYY年M月D日',
lll: 'YYYY年M月D日 HH:mm',
llll: 'YYYY年M月D日(ddd) HH:mm'
},
meridiemParse: /午前|午後/i,
isPM: function (input) {
return input === '午後';
},
meridiem: function (hour, minute, isLower) {
if (hour < 12) {
return '午前';
} else {
return '午後';
}
},
calendar: {
sameDay: '[今日] LT',
nextDay: '[明日] LT',
nextWeek: function (now) {
if (now.week() < this.week()) {
return '[来週]dddd LT';
} else {
return 'dddd LT';
}
},
lastDay: '[昨日] LT',
lastWeek: function (now) {
if (this.week() < now.week()) {
return '[先週]dddd LT';
} else {
return 'dddd LT';
}
},
sameElse: 'L'
},
dayOfMonthOrdinalParse: /\d{1,2}日/,
ordinal: function (number, period) {
switch (period) {
case 'd':
case 'D':
case 'DDD':
return number + '日';
default:
return number;
}
},
relativeTime: {
future: '%s後',
past: '%s前',
s: '数秒',
ss: '%d秒',
m: '1分',
mm: '%d分',
h: '1時間',
hh: '%d時間',
d: '1日',
dd: '%d日',
M: '1ヶ月',
MM: '%dヶ月',
y: '1年',
yy: '%d年'
}
});
return ja;
});
/***/ }),
/***/ "./node_modules/moment/locale/jv.js":
/*!******************************************!*\
!*** ./node_modules/moment/locale/jv.js ***!
\******************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
;
(function (global, factory) {
true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : undefined;
})(this, function (moment) {
'use strict';
var jv = moment.defineLocale('jv', {
months: 'Januari_Februari_Maret_April_Mei_Juni_Juli_Agustus_September_Oktober_Nopember_Desember'.split('_'),
monthsShort: 'Jan_Feb_Mar_Apr_Mei_Jun_Jul_Ags_Sep_Okt_Nop_Des'.split('_'),
weekdays: 'Minggu_Senen_Seloso_Rebu_Kemis_Jemuwah_Septu'.split('_'),
weekdaysShort: 'Min_Sen_Sel_Reb_Kem_Jem_Sep'.split('_'),
weekdaysMin: 'Mg_Sn_Sl_Rb_Km_Jm_Sp'.split('_'),
longDateFormat: {
LT: 'HH.mm',
LTS: 'HH.mm.ss',
L: 'DD/MM/YYYY',
LL: 'D MMMM YYYY',
LLL: 'D MMMM YYYY [pukul] HH.mm',
LLLL: 'dddd, D MMMM YYYY [pukul] HH.mm'
},
meridiemParse: /enjing|siyang|sonten|ndalu/,
meridiemHour: function (hour, meridiem) {
if (hour === 12) {
hour = 0;
}
if (meridiem === 'enjing') {
return hour;
} else if (meridiem === 'siyang') {
return hour >= 11 ? hour : hour + 12;
} else if (meridiem === 'sonten' || meridiem === 'ndalu') {
return hour + 12;
}
},
meridiem: function (hours, minutes, isLower) {
if (hours < 11) {
return 'enjing';
} else if (hours < 15) {
return 'siyang';
} else if (hours < 19) {
return 'sonten';
} else {
return 'ndalu';
}
},
calendar: {
sameDay: '[Dinten puniko pukul] LT',
nextDay: '[Mbenjang pukul] LT',
nextWeek: 'dddd [pukul] LT',
lastDay: '[Kala wingi pukul] LT',
lastWeek: 'dddd [kepengker pukul] LT',
sameElse: 'L'
},
relativeTime: {
future: 'wonten ing %s',
past: '%s ingkang kepengker',
s: 'sawetawis detik',
ss: '%d detik',
m: 'setunggal menit',
mm: '%d menit',
h: 'setunggal jam',
hh: '%d jam',
d: 'sedinten',
dd: '%d dinten',
M: 'sewulan',
MM: '%d wulan',
y: 'setaun',
yy: '%d taun'
},
week: {
dow: 1,
// Monday is the first day of the week.
doy: 7 // The week that contains Jan 7th is the first week of the year.
}
});
return jv;
});
/***/ }),
/***/ "./node_modules/moment/locale/ka.js":
/*!******************************************!*\
!*** ./node_modules/moment/locale/ka.js ***!
\******************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
;
(function (global, factory) {
true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : undefined;
})(this, function (moment) {
'use strict';
var ka = moment.defineLocale('ka', {
months: {
standalone: 'იანვარი_თებერვალი_მარტი_აპრილი_მაისი_ივნისი_ივლისი_აგვისტო_სექტემბერი_ოქტომბერი_ნოემბერი_დეკემბერი'.split('_'),
format: 'იანვარს_თებერვალს_მარტს_აპრილის_მაისს_ივნისს_ივლისს_აგვისტს_სექტემბერს_ოქტომბერს_ნოემბერს_დეკემბერს'.split('_')
},
monthsShort: 'იან_თებ_მარ_აპრ_მაი_ივნ_ივლ_აგვ_სექ_ოქტ_ნოე_დეკ'.split('_'),
weekdays: {
standalone: 'კვირა_ორშაბათი_სამშაბათი_ოთხშაბათი_ხუთშაბათი_პარასკევი_შაბათი'.split('_'),
format: 'კვირას_ორშაბათს_სამშაბათს_ოთხშაბათს_ხუთშაბათს_პარასკევს_შაბათს'.split('_'),
isFormat: /(წინა|შემდეგ)/
},
weekdaysShort: 'კვი_ორშ_სამ_ოთხ_ხუთ_პარ_შაბ'.split('_'),
weekdaysMin: 'კვ_ორ_სა_ოთ_ხუ_პა_შა'.split('_'),
longDateFormat: {
LT: 'h:mm A',
LTS: 'h:mm:ss A',
L: 'DD/MM/YYYY',
LL: 'D MMMM YYYY',
LLL: 'D MMMM YYYY h:mm A',
LLLL: 'dddd, D MMMM YYYY h:mm A'
},
calendar: {
sameDay: '[დღეს] LT[-ზე]',
nextDay: '[ხვალ] LT[-ზე]',
lastDay: '[გუშინ] LT[-ზე]',
nextWeek: '[შემდეგ] dddd LT[-ზე]',
lastWeek: '[წინა] dddd LT-ზე',
sameElse: 'L'
},
relativeTime: {
future: function (s) {
return /(წამი|წუთი|საათი|წელი)/.test(s) ? s.replace(/ი$/, 'ში') : s + 'ში';
},
past: function (s) {
if (/(წამი|წუთი|საათი|დღე|თვე)/.test(s)) {
return s.replace(/(ი|ე)$/, 'ის წინ');
}
if (/წელი/.test(s)) {
return s.replace(/წელი$/, 'წლის წინ');
}
},
s: 'რამდენიმე წამი',
ss: '%d წამი',
m: 'წუთი',
mm: '%d წუთი',
h: 'საათი',
hh: '%d საათი',
d: 'დღე',
dd: '%d დღე',
M: 'თვე',
MM: '%d თვე',
y: 'წელი',
yy: '%d წელი'
},
dayOfMonthOrdinalParse: /0|1-ლი|მე-\d{1,2}|\d{1,2}-ე/,
ordinal: function (number) {
if (number === 0) {
return number;
}
if (number === 1) {
return number + '-ლი';
}
if (number < 20 || number <= 100 && number % 20 === 0 || number % 100 === 0) {
return 'მე-' + number;
}
return number + '-ე';
},
week: {
dow: 1,
doy: 7
}
});
return ka;
});
/***/ }),
/***/ "./node_modules/moment/locale/kk.js":
/*!******************************************!*\
!*** ./node_modules/moment/locale/kk.js ***!
\******************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
;
(function (global, factory) {
true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : undefined;
})(this, function (moment) {
'use strict';
var suffixes = {
0: '-ші',
1: '-ші',
2: '-ші',
3: '-ші',
4: '-ші',
5: '-ші',
6: '-шы',
7: '-ші',
8: '-ші',
9: '-шы',
10: '-шы',
20: '-шы',
30: '-шы',
40: '-шы',
50: '-ші',
60: '-шы',
70: '-ші',
80: '-ші',
90: '-шы',
100: '-ші'
};
var kk = moment.defineLocale('kk', {
months: 'қаңтар_ақпан_наурыз_сәуір_мамыр_маусым_шілде_тамыз_қыркүйек_қазан_қараша_желтоқсан'.split('_'),
monthsShort: 'қаң_ақп_нау_сәу_мам_мау_шіл_там_қыр_қаз_қар_жел'.split('_'),
weekdays: 'жексенбі_дүйсенбі_сейсенбі_сәрсенбі_бейсенбі_жұма_сенбі'.split('_'),
weekdaysShort: 'жек_дүй_сей_сәр_бей_жұм_сен'.split('_'),
weekdaysMin: 'жк_дй_сй_ср_бй_жм_сн'.split('_'),
longDateFormat: {
LT: 'HH:mm',
LTS: 'HH:mm:ss',
L: 'DD.MM.YYYY',
LL: 'D MMMM YYYY',
LLL: 'D MMMM YYYY HH:mm',
LLLL: 'dddd, D MMMM YYYY HH:mm'
},
calendar: {
sameDay: '[Бүгін сағат] LT',
nextDay: '[Ертең сағат] LT',
nextWeek: 'dddd [сағат] LT',
lastDay: '[Кеше сағат] LT',
lastWeek: '[Өткен аптаның] dddd [сағат] LT',
sameElse: 'L'
},
relativeTime: {
future: '%s ішінде',
past: '%s бұрын',
s: 'бірнеше секунд',
ss: '%d секунд',
m: 'бір минут',
mm: '%d минут',
h: 'бір сағат',
hh: '%d сағат',
d: 'бір күн',
dd: '%d күн',
M: 'бір ай',
MM: '%d ай',
y: 'бір жыл',
yy: '%d жыл'
},
dayOfMonthOrdinalParse: /\d{1,2}-(ші|шы)/,
ordinal: function (number) {
var a = number % 10,
b = number >= 100 ? 100 : null;
return number + (suffixes[number] || suffixes[a] || suffixes[b]);
},
week: {
dow: 1,
// Monday is the first day of the week.
doy: 7 // The week that contains Jan 7th is the first week of the year.
}
});
return kk;
});
/***/ }),
/***/ "./node_modules/moment/locale/km.js":
/*!******************************************!*\
!*** ./node_modules/moment/locale/km.js ***!
\******************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
;
(function (global, factory) {
true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : undefined;
})(this, function (moment) {
'use strict';
var symbolMap = {
'1': '១',
'2': '២',
'3': '៣',
'4': '៤',
'5': '៥',
'6': '៦',
'7': '៧',
'8': '៨',
'9': '៩',
'0': '០'
},
numberMap = {
'១': '1',
'២': '2',
'៣': '3',
'៤': '4',
'៥': '5',
'៦': '6',
'៧': '7',
'៨': '8',
'៩': '9',
'០': '0'
};
var km = moment.defineLocale('km', {
months: 'មករា_កុម្ភៈ_មីនា_មេសា_ឧសភា_មិថុនា_កក្កដា_សីហា_កញ្ញា_តុលា_វិច្ឆិកា_ធ្នូ'.split('_'),
monthsShort: 'មករា_កុម្ភៈ_មីនា_មេសា_ឧសភា_មិថុនា_កក្កដា_សីហា_កញ្ញា_តុលា_វិច្ឆិកា_ធ្នូ'.split('_'),
weekdays: 'អាទិត្យ_ច័ន្ទ_អង្គារ_ពុធ_ព្រហស្បតិ៍_សុក្រ_សៅរ៍'.split('_'),
weekdaysShort: 'អា_ច_អ_ព_ព្រ_សុ_ស'.split('_'),
weekdaysMin: 'អា_ច_អ_ព_ព្រ_សុ_ស'.split('_'),
weekdaysParseExact: true,
longDateFormat: {
LT: 'HH:mm',
LTS: 'HH:mm:ss',
L: 'DD/MM/YYYY',
LL: 'D MMMM YYYY',
LLL: 'D MMMM YYYY HH:mm',
LLLL: 'dddd, D MMMM YYYY HH:mm'
},
meridiemParse: /ព្រឹក|ល្ងាច/,
isPM: function (input) {
return input === 'ល្ងាច';
},
meridiem: function (hour, minute, isLower) {
if (hour < 12) {
return 'ព្រឹក';
} else {
return 'ល្ងាច';
}
},
calendar: {
sameDay: '[ថ្ងៃនេះ ម៉ោង] LT',
nextDay: '[ស្អែក ម៉ោង] LT',
nextWeek: 'dddd [ម៉ោង] LT',
lastDay: '[ម្សិលមិញ ម៉ោង] LT',
lastWeek: 'dddd [សប្តាហ៍មុន] [ម៉ោង] LT',
sameElse: 'L'
},
relativeTime: {
future: '%sទៀត',
past: '%sមុន',
s: 'ប៉ុន្មានវិនាទី',
ss: '%d វិនាទី',
m: 'មួយនាទី',
mm: '%d នាទី',
h: 'មួយម៉ោង',
hh: '%d ម៉ោង',
d: 'មួយថ្ងៃ',
dd: '%d ថ្ងៃ',
M: 'មួយខែ',
MM: '%d ខែ',
y: 'មួយឆ្នាំ',
yy: '%d ឆ្នាំ'
},
dayOfMonthOrdinalParse: /ទី\d{1,2}/,
ordinal: 'ទី%d',
preparse: function (string) {
return string.replace(/[១២៣៤៥៦៧៨៩០]/g, function (match) {
return numberMap[match];
});
},
postformat: function (string) {
return string.replace(/\d/g, function (match) {
return symbolMap[match];
});
},
week: {
dow: 1,
// Monday is the first day of the week.
doy: 4 // The week that contains Jan 4th is the first week of the year.
}
});
return km;
});
/***/ }),
/***/ "./node_modules/moment/locale/kn.js":
/*!******************************************!*\
!*** ./node_modules/moment/locale/kn.js ***!
\******************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
;
(function (global, factory) {
true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : undefined;
})(this, function (moment) {
'use strict';
var symbolMap = {
'1': '೧',
'2': '೨',
'3': '೩',
'4': '೪',
'5': '೫',
'6': '೬',
'7': '೭',
'8': '೮',
'9': '೯',
'0': '೦'
},
numberMap = {
'೧': '1',
'೨': '2',
'೩': '3',
'೪': '4',
'೫': '5',
'೬': '6',
'೭': '7',
'೮': '8',
'೯': '9',
'೦': '0'
};
var kn = moment.defineLocale('kn', {
months: 'ಜನವರಿ_ಫೆಬ್ರವರಿ_ಮಾರ್ಚ್_ಏಪ್ರಿಲ್_ಮೇ_ಜೂನ್_ಜುಲೈ_ಆಗಸ್ಟ್_ಸೆಪ್ಟೆಂಬರ್_ಅಕ್ಟೋಬರ್_ನವೆಂಬರ್_ಡಿಸೆಂಬರ್'.split('_'),
monthsShort: 'ಜನ_ಫೆಬ್ರ_ಮಾರ್ಚ್_ಏಪ್ರಿಲ್_ಮೇ_ಜೂನ್_ಜುಲೈ_ಆಗಸ್ಟ್_ಸೆಪ್ಟೆಂ_ಅಕ್ಟೋ_ನವೆಂ_ಡಿಸೆಂ'.split('_'),
monthsParseExact: true,
weekdays: 'ಭಾನುವಾರ_ಸೋಮವಾರ_ಮಂಗಳವಾರ_ಬುಧವಾರ_ಗುರುವಾರ_ಶುಕ್ರವಾರ_ಶನಿವಾರ'.split('_'),
weekdaysShort: 'ಭಾನು_ಸೋಮ_ಮಂಗಳ_ಬುಧ_ಗುರು_ಶುಕ್ರ_ಶನಿ'.split('_'),
weekdaysMin: 'ಭಾ_ಸೋ_ಮಂ_ಬು_ಗು_ಶು_ಶ'.split('_'),
longDateFormat: {
LT: 'A h:mm',
LTS: 'A h:mm:ss',
L: 'DD/MM/YYYY',
LL: 'D MMMM YYYY',
LLL: 'D MMMM YYYY, A h:mm',
LLLL: 'dddd, D MMMM YYYY, A h:mm'
},
calendar: {
sameDay: '[ಇಂದು] LT',
nextDay: '[ನಾಳೆ] LT',
nextWeek: 'dddd, LT',
lastDay: '[ನಿನ್ನೆ] LT',
lastWeek: '[ಕೊನೆಯ] dddd, LT',
sameElse: 'L'
},
relativeTime: {
future: '%s ನಂತರ',
past: '%s ಹಿಂದೆ',
s: 'ಕೆಲವು ಕ್ಷಣಗಳು',
ss: '%d ಸೆಕೆಂಡುಗಳು',
m: 'ಒಂದು ನಿಮಿಷ',
mm: '%d ನಿಮಿಷ',
h: 'ಒಂದು ಗಂಟೆ',
hh: '%d ಗಂಟೆ',
d: 'ಒಂದು ದಿನ',
dd: '%d ದಿನ',
M: 'ಒಂದು ತಿಂಗಳು',
MM: '%d ತಿಂಗಳು',
y: 'ಒಂದು ವರ್ಷ',
yy: '%d ವರ್ಷ'
},
preparse: function (string) {
return string.replace(/[೧೨೩೪೫೬೭೮೯೦]/g, function (match) {
return numberMap[match];
});
},
postformat: function (string) {
return string.replace(/\d/g, function (match) {
return symbolMap[match];
});
},
meridiemParse: /ರಾತ್ರಿ|ಬೆಳಿಗ್ಗೆ|ಮಧ್ಯಾಹ್ನ|ಸಂಜೆ/,
meridiemHour: function (hour, meridiem) {
if (hour === 12) {
hour = 0;
}
if (meridiem === 'ರಾತ್ರಿ') {
return hour < 4 ? hour : hour + 12;
} else if (meridiem === 'ಬೆಳಿಗ್ಗೆ') {
return hour;
} else if (meridiem === 'ಮಧ್ಯಾಹ್ನ') {
return hour >= 10 ? hour : hour + 12;
} else if (meridiem === 'ಸಂಜೆ') {
return hour + 12;
}
},
meridiem: function (hour, minute, isLower) {
if (hour < 4) {
return 'ರಾತ್ರಿ';
} else if (hour < 10) {
return 'ಬೆಳಿಗ್ಗೆ';
} else if (hour < 17) {
return 'ಮಧ್ಯಾಹ್ನ';
} else if (hour < 20) {
return 'ಸಂಜೆ';
} else {
return 'ರಾತ್ರಿ';
}
},
dayOfMonthOrdinalParse: /\d{1,2}(ನೇ)/,
ordinal: function (number) {
return number + 'ನೇ';
},
week: {
dow: 0,
// Sunday is the first day of the week.
doy: 6 // The week that contains Jan 6th is the first week of the year.
}
});
return kn;
});
/***/ }),
/***/ "./node_modules/moment/locale/ko.js":
/*!******************************************!*\
!*** ./node_modules/moment/locale/ko.js ***!
\******************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
;
(function (global, factory) {
true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : undefined;
})(this, function (moment) {
'use strict';
var ko = moment.defineLocale('ko', {
months: '1월_2월_3월_4월_5월_6월_7월_8월_9월_10월_11월_12월'.split('_'),
monthsShort: '1월_2월_3월_4월_5월_6월_7월_8월_9월_10월_11월_12월'.split('_'),
weekdays: '일요일_월요일_화요일_수요일_목요일_금요일_토요일'.split('_'),
weekdaysShort: '일_월_화_수_목_금_토'.split('_'),
weekdaysMin: '일_월_화_수_목_금_토'.split('_'),
longDateFormat: {
LT: 'A h:mm',
LTS: 'A h:mm:ss',
L: 'YYYY.MM.DD.',
LL: 'YYYY년 MMMM D일',
LLL: 'YYYY년 MMMM D일 A h:mm',
LLLL: 'YYYY년 MMMM D일 dddd A h:mm',
l: 'YYYY.MM.DD.',
ll: 'YYYY년 MMMM D일',
lll: 'YYYY년 MMMM D일 A h:mm',
llll: 'YYYY년 MMMM D일 dddd A h:mm'
},
calendar: {
sameDay: '오늘 LT',
nextDay: '내일 LT',
nextWeek: 'dddd LT',
lastDay: '어제 LT',
lastWeek: '지난주 dddd LT',
sameElse: 'L'
},
relativeTime: {
future: '%s 후',
past: '%s 전',
s: '몇 초',
ss: '%d초',
m: '1분',
mm: '%d분',
h: '한 시간',
hh: '%d시간',
d: '하루',
dd: '%d일',
M: '한 달',
MM: '%d달',
y: '일 년',
yy: '%d년'
},
dayOfMonthOrdinalParse: /\d{1,2}(일|월|주)/,
ordinal: function (number, period) {
switch (period) {
case 'd':
case 'D':
case 'DDD':
return number + '일';
case 'M':
return number + '월';
case 'w':
case 'W':
return number + '주';
default:
return number;
}
},
meridiemParse: /오전|오후/,
isPM: function (token) {
return token === '오후';
},
meridiem: function (hour, minute, isUpper) {
return hour < 12 ? '오전' : '오후';
}
});
return ko;
});
/***/ }),
/***/ "./node_modules/moment/locale/ku.js":
/*!******************************************!*\
!*** ./node_modules/moment/locale/ku.js ***!
\******************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
;
(function (global, factory) {
true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : undefined;
})(this, function (moment) {
'use strict';
var symbolMap = {
'1': '١',
'2': '٢',
'3': '٣',
'4': '٤',
'5': '٥',
'6': '٦',
'7': '٧',
'8': '٨',
'9': '٩',
'0': '٠'
},
numberMap = {
'١': '1',
'٢': '2',
'٣': '3',
'٤': '4',
'٥': '5',
'٦': '6',
'٧': '7',
'٨': '8',
'٩': '9',
'٠': '0'
},
months = ['کانونی دووەم', 'شوبات', 'ئازار', 'نیسان', 'ئایار', 'حوزەیران', 'تەمموز', 'ئاب', 'ئەیلوول', 'تشرینی یەكەم', 'تشرینی دووەم', 'كانونی یەکەم'];
var ku = moment.defineLocale('ku', {
months: months,
monthsShort: months,
weekdays: 'یهكشهممه_دووشهممه_سێشهممه_چوارشهممه_پێنجشهممه_ههینی_شهممه'.split('_'),
weekdaysShort: 'یهكشهم_دووشهم_سێشهم_چوارشهم_پێنجشهم_ههینی_شهممه'.split('_'),
weekdaysMin: 'ی_د_س_چ_پ_ه_ش'.split('_'),
weekdaysParseExact: true,
longDateFormat: {
LT: 'HH:mm',
LTS: 'HH:mm:ss',
L: 'DD/MM/YYYY',
LL: 'D MMMM YYYY',
LLL: 'D MMMM YYYY HH:mm',
LLLL: 'dddd, D MMMM YYYY HH:mm'
},
meridiemParse: /ئێواره|بهیانی/,
isPM: function (input) {
return /ئێواره/.test(input);
},
meridiem: function (hour, minute, isLower) {
if (hour < 12) {
return 'بهیانی';
} else {
return 'ئێواره';
}
},
calendar: {
sameDay: '[ئهمرۆ كاتژمێر] LT',
nextDay: '[بهیانی كاتژمێر] LT',
nextWeek: 'dddd [كاتژمێر] LT',
lastDay: '[دوێنێ كاتژمێر] LT',
lastWeek: 'dddd [كاتژمێر] LT',
sameElse: 'L'
},
relativeTime: {
future: 'له %s',
past: '%s',
s: 'چهند چركهیهك',
ss: 'چركه %d',
m: 'یهك خولهك',
mm: '%d خولهك',
h: 'یهك كاتژمێر',
hh: '%d كاتژمێر',
d: 'یهك ڕۆژ',
dd: '%d ڕۆژ',
M: 'یهك مانگ',
MM: '%d مانگ',
y: 'یهك ساڵ',
yy: '%d ساڵ'
},
preparse: function (string) {
return string.replace(/[١٢٣٤٥٦٧٨٩٠]/g, function (match) {
return numberMap[match];
}).replace(/،/g, ',');
},
postformat: function (string) {
return string.replace(/\d/g, function (match) {
return symbolMap[match];
}).replace(/,/g, '،');
},
week: {
dow: 6,
// Saturday is the first day of the week.
doy: 12 // The week that contains Jan 12th is the first week of the year.
}
});
return ku;
});
/***/ }),
/***/ "./node_modules/moment/locale/ky.js":
/*!******************************************!*\
!*** ./node_modules/moment/locale/ky.js ***!
\******************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
;
(function (global, factory) {
true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : undefined;
})(this, function (moment) {
'use strict';
var suffixes = {
0: '-чү',
1: '-чи',
2: '-чи',
3: '-чү',
4: '-чү',
5: '-чи',
6: '-чы',
7: '-чи',
8: '-чи',
9: '-чу',
10: '-чу',
20: '-чы',
30: '-чу',
40: '-чы',
50: '-чү',
60: '-чы',
70: '-чи',
80: '-чи',
90: '-чу',
100: '-чү'
};
var ky = moment.defineLocale('ky', {
months: 'январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь'.split('_'),
monthsShort: 'янв_фев_март_апр_май_июнь_июль_авг_сен_окт_ноя_дек'.split('_'),
weekdays: 'Жекшемби_Дүйшөмбү_Шейшемби_Шаршемби_Бейшемби_Жума_Ишемби'.split('_'),
weekdaysShort: 'Жек_Дүй_Шей_Шар_Бей_Жум_Ише'.split('_'),
weekdaysMin: 'Жк_Дй_Шй_Шр_Бй_Жм_Иш'.split('_'),
longDateFormat: {
LT: 'HH:mm',
LTS: 'HH:mm:ss',
L: 'DD.MM.YYYY',
LL: 'D MMMM YYYY',
LLL: 'D MMMM YYYY HH:mm',
LLLL: 'dddd, D MMMM YYYY HH:mm'
},
calendar: {
sameDay: '[Бүгүн саат] LT',
nextDay: '[Эртең саат] LT',
nextWeek: 'dddd [саат] LT',
lastDay: '[Кечээ саат] LT',
lastWeek: '[Өткөн аптанын] dddd [күнү] [саат] LT',
sameElse: 'L'
},
relativeTime: {
future: '%s ичинде',
past: '%s мурун',
s: 'бирнече секунд',
ss: '%d секунд',
m: 'бир мүнөт',
mm: '%d мүнөт',
h: 'бир саат',
hh: '%d саат',
d: 'бир күн',
dd: '%d күн',
M: 'бир ай',
MM: '%d ай',
y: 'бир жыл',
yy: '%d жыл'
},
dayOfMonthOrdinalParse: /\d{1,2}-(чи|чы|чү|чу)/,
ordinal: function (number) {
var a = number % 10,
b = number >= 100 ? 100 : null;
return number + (suffixes[number] || suffixes[a] || suffixes[b]);
},
week: {
dow: 1,
// Monday is the first day of the week.
doy: 7 // The week that contains Jan 7th is the first week of the year.
}
});
return ky;
});
/***/ }),
/***/ "./node_modules/moment/locale/lb.js":
/*!******************************************!*\
!*** ./node_modules/moment/locale/lb.js ***!
\******************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
;
(function (global, factory) {
true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : undefined;
})(this, function (moment) {
'use strict';
function processRelativeTime(number, withoutSuffix, key, isFuture) {
var format = {
'm': ['eng Minutt', 'enger Minutt'],
'h': ['eng Stonn', 'enger Stonn'],
'd': ['een Dag', 'engem Dag'],
'M': ['ee Mount', 'engem Mount'],
'y': ['ee Joer', 'engem Joer']
};
return withoutSuffix ? format[key][0] : format[key][1];
}
function processFutureTime(string) {
var number = string.substr(0, string.indexOf(' '));
if (eifelerRegelAppliesToNumber(number)) {
return 'a ' + string;
}
return 'an ' + string;
}
function processPastTime(string) {
var number = string.substr(0, string.indexOf(' '));
if (eifelerRegelAppliesToNumber(number)) {
return 'viru ' + string;
}
return 'virun ' + string;
}
/**
* Returns true if the word before the given number loses the '-n' ending.
* e.g. 'an 10 Deeg' but 'a 5 Deeg'
*
* @param number {integer}
* @returns {boolean}
*/
function eifelerRegelAppliesToNumber(number) {
number = parseInt(number, 10);
if (isNaN(number)) {
return false;
}
if (number < 0) {
// Negative Number --> always true
return true;
} else if (number < 10) {
// Only 1 digit
if (4 <= number && number <= 7) {
return true;
}
return false;
} else if (number < 100) {
// 2 digits
var lastDigit = number % 10,
firstDigit = number / 10;
if (lastDigit === 0) {
return eifelerRegelAppliesToNumber(firstDigit);
}
return eifelerRegelAppliesToNumber(lastDigit);
} else if (number < 10000) {
// 3 or 4 digits --> recursively check first digit
while (number >= 10) {
number = number / 10;
}
return eifelerRegelAppliesToNumber(number);
} else {
// Anything larger than 4 digits: recursively check first n-3 digits
number = number / 1000;
return eifelerRegelAppliesToNumber(number);
}
}
var lb = moment.defineLocale('lb', {
months: 'Januar_Februar_Mäerz_Abrëll_Mee_Juni_Juli_August_September_Oktober_November_Dezember'.split('_'),
monthsShort: 'Jan._Febr._Mrz._Abr._Mee_Jun._Jul._Aug._Sept._Okt._Nov._Dez.'.split('_'),
monthsParseExact: true,
weekdays: 'Sonndeg_Méindeg_Dënschdeg_Mëttwoch_Donneschdeg_Freideg_Samschdeg'.split('_'),
weekdaysShort: 'So._Mé._Dë._Më._Do._Fr._Sa.'.split('_'),
weekdaysMin: 'So_Mé_Dë_Më_Do_Fr_Sa'.split('_'),
weekdaysParseExact: true,
longDateFormat: {
LT: 'H:mm [Auer]',
LTS: 'H:mm:ss [Auer]',
L: 'DD.MM.YYYY',
LL: 'D. MMMM YYYY',
LLL: 'D. MMMM YYYY H:mm [Auer]',
LLLL: 'dddd, D. MMMM YYYY H:mm [Auer]'
},
calendar: {
sameDay: '[Haut um] LT',
sameElse: 'L',
nextDay: '[Muer um] LT',
nextWeek: 'dddd [um] LT',
lastDay: '[Gëschter um] LT',
lastWeek: function () {
// Different date string for 'Dënschdeg' (Tuesday) and 'Donneschdeg' (Thursday) due to phonological rule
switch (this.day()) {
case 2:
case 4:
return '[Leschten] dddd [um] LT';
default:
return '[Leschte] dddd [um] LT';
}
}
},
relativeTime: {
future: processFutureTime,
past: processPastTime,
s: 'e puer Sekonnen',
ss: '%d Sekonnen',
m: processRelativeTime,
mm: '%d Minutten',
h: processRelativeTime,
hh: '%d Stonnen',
d: processRelativeTime,
dd: '%d Deeg',
M: processRelativeTime,
MM: '%d Méint',
y: processRelativeTime,
yy: '%d Joer'
},
dayOfMonthOrdinalParse: /\d{1,2}\./,
ordinal: '%d.',
week: {
dow: 1,
// Monday is the first day of the week.
doy: 4 // The week that contains Jan 4th is the first week of the year.
}
});
return lb;
});
/***/ }),
/***/ "./node_modules/moment/locale/lo.js":
/*!******************************************!*\
!*** ./node_modules/moment/locale/lo.js ***!
\******************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
;
(function (global, factory) {
true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : undefined;
})(this, function (moment) {
'use strict';
var lo = moment.defineLocale('lo', {
months: 'ມັງກອນ_ກຸມພາ_ມີນາ_ເມສາ_ພຶດສະພາ_ມິຖຸນາ_ກໍລະກົດ_ສິງຫາ_ກັນຍາ_ຕຸລາ_ພະຈິກ_ທັນວາ'.split('_'),
monthsShort: 'ມັງກອນ_ກຸມພາ_ມີນາ_ເມສາ_ພຶດສະພາ_ມິຖຸນາ_ກໍລະກົດ_ສິງຫາ_ກັນຍາ_ຕຸລາ_ພະຈິກ_ທັນວາ'.split('_'),
weekdays: 'ອາທິດ_ຈັນ_ອັງຄານ_ພຸດ_ພະຫັດ_ສຸກ_ເສົາ'.split('_'),
weekdaysShort: 'ທິດ_ຈັນ_ອັງຄານ_ພຸດ_ພະຫັດ_ສຸກ_ເສົາ'.split('_'),
weekdaysMin: 'ທ_ຈ_ອຄ_ພ_ພຫ_ສກ_ສ'.split('_'),
weekdaysParseExact: true,
longDateFormat: {
LT: 'HH:mm',
LTS: 'HH:mm:ss',
L: 'DD/MM/YYYY',
LL: 'D MMMM YYYY',
LLL: 'D MMMM YYYY HH:mm',
LLLL: 'ວັນdddd D MMMM YYYY HH:mm'
},
meridiemParse: /ຕອນເຊົ້າ|ຕອນແລງ/,
isPM: function (input) {
return input === 'ຕອນແລງ';
},
meridiem: function (hour, minute, isLower) {
if (hour < 12) {
return 'ຕອນເຊົ້າ';
} else {
return 'ຕອນແລງ';
}
},
calendar: {
sameDay: '[ມື້ນີ້ເວລາ] LT',
nextDay: '[ມື້ອື່ນເວລາ] LT',
nextWeek: '[ວັນ]dddd[ໜ້າເວລາ] LT',
lastDay: '[ມື້ວານນີ້ເວລາ] LT',
lastWeek: '[ວັນ]dddd[ແລ້ວນີ້ເວລາ] LT',
sameElse: 'L'
},
relativeTime: {
future: 'ອີກ %s',
past: '%sຜ່ານມາ',
s: 'ບໍ່ເທົ່າໃດວິນາທີ',
ss: '%d ວິນາທີ',
m: '1 ນາທີ',
mm: '%d ນາທີ',
h: '1 ຊົ່ວໂມງ',
hh: '%d ຊົ່ວໂມງ',
d: '1 ມື້',
dd: '%d ມື້',
M: '1 ເດືອນ',
MM: '%d ເດືອນ',
y: '1 ປີ',
yy: '%d ປີ'
},
dayOfMonthOrdinalParse: /(ທີ່)\d{1,2}/,
ordinal: function (number) {
return 'ທີ່' + number;
}
});
return lo;
});
/***/ }),
/***/ "./node_modules/moment/locale/lt.js":
/*!******************************************!*\
!*** ./node_modules/moment/locale/lt.js ***!
\******************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
;
(function (global, factory) {
true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : undefined;
})(this, function (moment) {
'use strict';
var units = {
'ss': 'sekundė_sekundžių_sekundes',
'm': 'minutė_minutės_minutę',
'mm': 'minutės_minučių_minutes',
'h': 'valanda_valandos_valandą',
'hh': 'valandos_valandų_valandas',
'd': 'diena_dienos_dieną',
'dd': 'dienos_dienų_dienas',
'M': 'mėnuo_mėnesio_mėnesį',
'MM': 'mėnesiai_mėnesių_mėnesius',
'y': 'metai_metų_metus',
'yy': 'metai_metų_metus'
};
function translateSeconds(number, withoutSuffix, key, isFuture) {
if (withoutSuffix) {
return 'kelios sekundės';
} else {
return isFuture ? 'kelių sekundžių' : 'kelias sekundes';
}
}
function translateSingular(number, withoutSuffix, key, isFuture) {
return withoutSuffix ? forms(key)[0] : isFuture ? forms(key)[1] : forms(key)[2];
}
function special(number) {
return number % 10 === 0 || number > 10 && number < 20;
}
function forms(key) {
return units[key].split('_');
}
function translate(number, withoutSuffix, key, isFuture) {
var result = number + ' ';
if (number === 1) {
return result + translateSingular(number, withoutSuffix, key[0], isFuture);
} else if (withoutSuffix) {
return result + (special(number) ? forms(key)[1] : forms(key)[0]);
} else {
if (isFuture) {
return result + forms(key)[1];
} else {
return result + (special(number) ? forms(key)[1] : forms(key)[2]);
}
}
}
var lt = moment.defineLocale('lt', {
months: {
format: 'sausio_vasario_kovo_balandžio_gegužės_birželio_liepos_rugpjūčio_rugsėjo_spalio_lapkričio_gruodžio'.split('_'),
standalone: 'sausis_vasaris_kovas_balandis_gegužė_birželis_liepa_rugpjūtis_rugsėjis_spalis_lapkritis_gruodis'.split('_'),
isFormat: /D[oD]?(\[[^\[\]]*\]|\s)+MMMM?|MMMM?(\[[^\[\]]*\]|\s)+D[oD]?/
},
monthsShort: 'sau_vas_kov_bal_geg_bir_lie_rgp_rgs_spa_lap_grd'.split('_'),
weekdays: {
format: 'sekmadienį_pirmadienį_antradienį_trečiadienį_ketvirtadienį_penktadienį_šeštadienį'.split('_'),
standalone: 'sekmadienis_pirmadienis_antradienis_trečiadienis_ketvirtadienis_penktadienis_šeštadienis'.split('_'),
isFormat: /dddd HH:mm/
},
weekdaysShort: 'Sek_Pir_Ant_Tre_Ket_Pen_Šeš'.split('_'),
weekdaysMin: 'S_P_A_T_K_Pn_Š'.split('_'),
weekdaysParseExact: true,
longDateFormat: {
LT: 'HH:mm',
LTS: 'HH:mm:ss',
L: 'YYYY-MM-DD',
LL: 'YYYY [m.] MMMM D [d.]',
LLL: 'YYYY [m.] MMMM D [d.], HH:mm [val.]',
LLLL: 'YYYY [m.] MMMM D [d.], dddd, HH:mm [val.]',
l: 'YYYY-MM-DD',
ll: 'YYYY [m.] MMMM D [d.]',
lll: 'YYYY [m.] MMMM D [d.], HH:mm [val.]',
llll: 'YYYY [m.] MMMM D [d.], ddd, HH:mm [val.]'
},
calendar: {
sameDay: '[Šiandien] LT',
nextDay: '[Rytoj] LT',
nextWeek: 'dddd LT',
lastDay: '[Vakar] LT',
lastWeek: '[Praėjusį] dddd LT',
sameElse: 'L'
},
relativeTime: {
future: 'po %s',
past: 'prieš %s',
s: translateSeconds,
ss: translate,
m: translateSingular,
mm: translate,
h: translateSingular,
hh: translate,
d: translateSingular,
dd: translate,
M: translateSingular,
MM: translate,
y: translateSingular,
yy: translate
},
dayOfMonthOrdinalParse: /\d{1,2}-oji/,
ordinal: function (number) {
return number + '-oji';
},
week: {
dow: 1,
// Monday is the first day of the week.
doy: 4 // The week that contains Jan 4th is the first week of the year.
}
});
return lt;
});
/***/ }),
/***/ "./node_modules/moment/locale/lv.js":
/*!******************************************!*\
!*** ./node_modules/moment/locale/lv.js ***!
\******************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
;
(function (global, factory) {
true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : undefined;
})(this, function (moment) {
'use strict';
var units = {
'ss': 'sekundes_sekundēm_sekunde_sekundes'.split('_'),
'm': 'minūtes_minūtēm_minūte_minūtes'.split('_'),
'mm': 'minūtes_minūtēm_minūte_minūtes'.split('_'),
'h': 'stundas_stundām_stunda_stundas'.split('_'),
'hh': 'stundas_stundām_stunda_stundas'.split('_'),
'd': 'dienas_dienām_diena_dienas'.split('_'),
'dd': 'dienas_dienām_diena_dienas'.split('_'),
'M': 'mēneša_mēnešiem_mēnesis_mēneši'.split('_'),
'MM': 'mēneša_mēnešiem_mēnesis_mēneši'.split('_'),
'y': 'gada_gadiem_gads_gadi'.split('_'),
'yy': 'gada_gadiem_gads_gadi'.split('_')
};
/**
* @param withoutSuffix boolean true = a length of time; false = before/after a period of time.
*/
function format(forms, number, withoutSuffix) {
if (withoutSuffix) {
// E.g. "21 minūte", "3 minūtes".
return number % 10 === 1 && number % 100 !== 11 ? forms[2] : forms[3];
} else {
// E.g. "21 minūtes" as in "pēc 21 minūtes".
// E.g. "3 minūtēm" as in "pēc 3 minūtēm".
return number % 10 === 1 && number % 100 !== 11 ? forms[0] : forms[1];
}
}
function relativeTimeWithPlural(number, withoutSuffix, key) {
return number + ' ' + format(units[key], number, withoutSuffix);
}
function relativeTimeWithSingular(number, withoutSuffix, key) {
return format(units[key], number, withoutSuffix);
}
function relativeSeconds(number, withoutSuffix) {
return withoutSuffix ? 'dažas sekundes' : 'dažām sekundēm';
}
var lv = moment.defineLocale('lv', {
months: 'janvāris_februāris_marts_aprīlis_maijs_jūnijs_jūlijs_augusts_septembris_oktobris_novembris_decembris'.split('_'),
monthsShort: 'jan_feb_mar_apr_mai_jūn_jūl_aug_sep_okt_nov_dec'.split('_'),
weekdays: 'svētdiena_pirmdiena_otrdiena_trešdiena_ceturtdiena_piektdiena_sestdiena'.split('_'),
weekdaysShort: 'Sv_P_O_T_C_Pk_S'.split('_'),
weekdaysMin: 'Sv_P_O_T_C_Pk_S'.split('_'),
weekdaysParseExact: true,
longDateFormat: {
LT: 'HH:mm',
LTS: 'HH:mm:ss',
L: 'DD.MM.YYYY.',
LL: 'YYYY. [gada] D. MMMM',
LLL: 'YYYY. [gada] D. MMMM, HH:mm',
LLLL: 'YYYY. [gada] D. MMMM, dddd, HH:mm'
},
calendar: {
sameDay: '[Šodien pulksten] LT',
nextDay: '[Rīt pulksten] LT',
nextWeek: 'dddd [pulksten] LT',
lastDay: '[Vakar pulksten] LT',
lastWeek: '[Pagājušā] dddd [pulksten] LT',
sameElse: 'L'
},
relativeTime: {
future: 'pēc %s',
past: 'pirms %s',
s: relativeSeconds,
ss: relativeTimeWithPlural,
m: relativeTimeWithSingular,
mm: relativeTimeWithPlural,
h: relativeTimeWithSingular,
hh: relativeTimeWithPlural,
d: relativeTimeWithSingular,
dd: relativeTimeWithPlural,
M: relativeTimeWithSingular,
MM: relativeTimeWithPlural,
y: relativeTimeWithSingular,
yy: relativeTimeWithPlural
},
dayOfMonthOrdinalParse: /\d{1,2}\./,
ordinal: '%d.',
week: {
dow: 1,
// Monday is the first day of the week.
doy: 4 // The week that contains Jan 4th is the first week of the year.
}
});
return lv;
});
/***/ }),
/***/ "./node_modules/moment/locale/me.js":
/*!******************************************!*\
!*** ./node_modules/moment/locale/me.js ***!
\******************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
;
(function (global, factory) {
true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : undefined;
})(this, function (moment) {
'use strict';
var translator = {
words: {
//Different grammatical cases
ss: ['sekund', 'sekunda', 'sekundi'],
m: ['jedan minut', 'jednog minuta'],
mm: ['minut', 'minuta', 'minuta'],
h: ['jedan sat', 'jednog sata'],
hh: ['sat', 'sata', 'sati'],
dd: ['dan', 'dana', 'dana'],
MM: ['mjesec', 'mjeseca', 'mjeseci'],
yy: ['godina', 'godine', 'godina']
},
correctGrammaticalCase: function (number, wordKey) {
return number === 1 ? wordKey[0] : number >= 2 && number <= 4 ? wordKey[1] : wordKey[2];
},
translate: function (number, withoutSuffix, key) {
var wordKey = translator.words[key];
if (key.length === 1) {
return withoutSuffix ? wordKey[0] : wordKey[1];
} else {
return number + ' ' + translator.correctGrammaticalCase(number, wordKey);
}
}
};
var me = moment.defineLocale('me', {
months: 'januar_februar_mart_april_maj_jun_jul_avgust_septembar_oktobar_novembar_decembar'.split('_'),
monthsShort: 'jan._feb._mar._apr._maj_jun_jul_avg._sep._okt._nov._dec.'.split('_'),
monthsParseExact: true,
weekdays: 'nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota'.split('_'),
weekdaysShort: 'ned._pon._uto._sri._čet._pet._sub.'.split('_'),
weekdaysMin: 'ne_po_ut_sr_če_pe_su'.split('_'),
weekdaysParseExact: true,
longDateFormat: {
LT: 'H:mm',
LTS: 'H:mm:ss',
L: 'DD.MM.YYYY',
LL: 'D. MMMM YYYY',
LLL: 'D. MMMM YYYY H:mm',
LLLL: 'dddd, D. MMMM YYYY H:mm'
},
calendar: {
sameDay: '[danas u] LT',
nextDay: '[sjutra u] LT',
nextWeek: function () {
switch (this.day()) {
case 0:
return '[u] [nedjelju] [u] LT';
case 3:
return '[u] [srijedu] [u] LT';
case 6:
return '[u] [subotu] [u] LT';
case 1:
case 2:
case 4:
case 5:
return '[u] dddd [u] LT';
}
},
lastDay: '[juče u] LT',
lastWeek: function () {
var lastWeekDays = ['[prošle] [nedjelje] [u] LT', '[prošlog] [ponedjeljka] [u] LT', '[prošlog] [utorka] [u] LT', '[prošle] [srijede] [u] LT', '[prošlog] [četvrtka] [u] LT', '[prošlog] [petka] [u] LT', '[prošle] [subote] [u] LT'];
return lastWeekDays[this.day()];
},
sameElse: 'L'
},
relativeTime: {
future: 'za %s',
past: 'prije %s',
s: 'nekoliko sekundi',
ss: translator.translate,
m: translator.translate,
mm: translator.translate,
h: translator.translate,
hh: translator.translate,
d: 'dan',
dd: translator.translate,
M: 'mjesec',
MM: translator.translate,
y: 'godinu',
yy: translator.translate
},
dayOfMonthOrdinalParse: /\d{1,2}\./,
ordinal: '%d.',
week: {
dow: 1,
// Monday is the first day of the week.
doy: 7 // The week that contains Jan 7th is the first week of the year.
}
});
return me;
});
/***/ }),
/***/ "./node_modules/moment/locale/mi.js":
/*!******************************************!*\
!*** ./node_modules/moment/locale/mi.js ***!
\******************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
;
(function (global, factory) {
true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : undefined;
})(this, function (moment) {
'use strict';
var mi = moment.defineLocale('mi', {
months: 'Kohi-tāte_Hui-tanguru_Poutū-te-rangi_Paenga-whāwhā_Haratua_Pipiri_Hōngoingoi_Here-turi-kōkā_Mahuru_Whiringa-ā-nuku_Whiringa-ā-rangi_Hakihea'.split('_'),
monthsShort: 'Kohi_Hui_Pou_Pae_Hara_Pipi_Hōngoi_Here_Mahu_Whi-nu_Whi-ra_Haki'.split('_'),
monthsRegex: /(?:['a-z\u0101\u014D\u016B]+\-?){1,3}/i,
monthsStrictRegex: /(?:['a-z\u0101\u014D\u016B]+\-?){1,3}/i,
monthsShortRegex: /(?:['a-z\u0101\u014D\u016B]+\-?){1,3}/i,
monthsShortStrictRegex: /(?:['a-z\u0101\u014D\u016B]+\-?){1,2}/i,
weekdays: 'Rātapu_Mane_Tūrei_Wenerei_Tāite_Paraire_Hātarei'.split('_'),
weekdaysShort: 'Ta_Ma_Tū_We_Tāi_Pa_Hā'.split('_'),
weekdaysMin: 'Ta_Ma_Tū_We_Tāi_Pa_Hā'.split('_'),
longDateFormat: {
LT: 'HH:mm',
LTS: 'HH:mm:ss',
L: 'DD/MM/YYYY',
LL: 'D MMMM YYYY',
LLL: 'D MMMM YYYY [i] HH:mm',
LLLL: 'dddd, D MMMM YYYY [i] HH:mm'
},
calendar: {
sameDay: '[i teie mahana, i] LT',
nextDay: '[apopo i] LT',
nextWeek: 'dddd [i] LT',
lastDay: '[inanahi i] LT',
lastWeek: 'dddd [whakamutunga i] LT',
sameElse: 'L'
},
relativeTime: {
future: 'i roto i %s',
past: '%s i mua',
s: 'te hēkona ruarua',
ss: '%d hēkona',
m: 'he meneti',
mm: '%d meneti',
h: 'te haora',
hh: '%d haora',
d: 'he ra',
dd: '%d ra',
M: 'he marama',
MM: '%d marama',
y: 'he tau',
yy: '%d tau'
},
dayOfMonthOrdinalParse: /\d{1,2}º/,
ordinal: '%dº',
week: {
dow: 1,
// Monday is the first day of the week.
doy: 4 // The week that contains Jan 4th is the first week of the year.
}
});
return mi;
});
/***/ }),
/***/ "./node_modules/moment/locale/mk.js":
/*!******************************************!*\
!*** ./node_modules/moment/locale/mk.js ***!
\******************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
;
(function (global, factory) {
true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : undefined;
})(this, function (moment) {
'use strict';
var mk = moment.defineLocale('mk', {
months: 'јануари_февруари_март_април_мај_јуни_јули_август_септември_октомври_ноември_декември'.split('_'),
monthsShort: 'јан_фев_мар_апр_мај_јун_јул_авг_сеп_окт_ное_дек'.split('_'),
weekdays: 'недела_понеделник_вторник_среда_четврток_петок_сабота'.split('_'),
weekdaysShort: 'нед_пон_вто_сре_чет_пет_саб'.split('_'),
weekdaysMin: 'нe_пo_вт_ср_че_пе_сa'.split('_'),
longDateFormat: {
LT: 'H:mm',
LTS: 'H:mm:ss',
L: 'D.MM.YYYY',
LL: 'D MMMM YYYY',
LLL: 'D MMMM YYYY H:mm',
LLLL: 'dddd, D MMMM YYYY H:mm'
},
calendar: {
sameDay: '[Денес во] LT',
nextDay: '[Утре во] LT',
nextWeek: '[Во] dddd [во] LT',
lastDay: '[Вчера во] LT',
lastWeek: function () {
switch (this.day()) {
case 0:
case 3:
case 6:
return '[Изминатата] dddd [во] LT';
case 1:
case 2:
case 4:
case 5:
return '[Изминатиот] dddd [во] LT';
}
},
sameElse: 'L'
},
relativeTime: {
future: 'после %s',
past: 'пред %s',
s: 'неколку секунди',
ss: '%d секунди',
m: 'минута',
mm: '%d минути',
h: 'час',
hh: '%d часа',
d: 'ден',
dd: '%d дена',
M: 'месец',
MM: '%d месеци',
y: 'година',
yy: '%d години'
},
dayOfMonthOrdinalParse: /\d{1,2}-(ев|ен|ти|ви|ри|ми)/,
ordinal: function (number) {
var lastDigit = number % 10,
last2Digits = number % 100;
if (number === 0) {
return number + '-ев';
} else if (last2Digits === 0) {
return number + '-ен';
} else if (last2Digits > 10 && last2Digits < 20) {
return number + '-ти';
} else if (lastDigit === 1) {
return number + '-ви';
} else if (lastDigit === 2) {
return number + '-ри';
} else if (lastDigit === 7 || lastDigit === 8) {
return number + '-ми';
} else {
return number + '-ти';
}
},
week: {
dow: 1,
// Monday is the first day of the week.
doy: 7 // The week that contains Jan 7th is the first week of the year.
}
});
return mk;
});
/***/ }),
/***/ "./node_modules/moment/locale/ml.js":
/*!******************************************!*\
!*** ./node_modules/moment/locale/ml.js ***!
\******************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
;
(function (global, factory) {
true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : undefined;
})(this, function (moment) {
'use strict';
var ml = moment.defineLocale('ml', {
months: 'ജനുവരി_ഫെബ്രുവരി_മാർച്ച്_ഏപ്രിൽ_മേയ്_ജൂൺ_ജൂലൈ_ഓഗസ്റ്റ്_സെപ്റ്റംബർ_ഒക്ടോബർ_നവംബർ_ഡിസംബർ'.split('_'),
monthsShort: 'ജനു._ഫെബ്രു._മാർ._ഏപ്രി._മേയ്_ജൂൺ_ജൂലൈ._ഓഗ._സെപ്റ്റ._ഒക്ടോ._നവം._ഡിസം.'.split('_'),
monthsParseExact: true,
weekdays: 'ഞായറാഴ്ച_തിങ്കളാഴ്ച_ചൊവ്വാഴ്ച_ബുധനാഴ്ച_വ്യാഴാഴ്ച_വെള്ളിയാഴ്ച_ശനിയാഴ്ച'.split('_'),
weekdaysShort: 'ഞായർ_തിങ്കൾ_ചൊവ്വ_ബുധൻ_വ്യാഴം_വെള്ളി_ശനി'.split('_'),
weekdaysMin: 'ഞാ_തി_ചൊ_ബു_വ്യാ_വെ_ശ'.split('_'),
longDateFormat: {
LT: 'A h:mm -നു',
LTS: 'A h:mm:ss -നു',
L: 'DD/MM/YYYY',
LL: 'D MMMM YYYY',
LLL: 'D MMMM YYYY, A h:mm -നു',
LLLL: 'dddd, D MMMM YYYY, A h:mm -നു'
},
calendar: {
sameDay: '[ഇന്ന്] LT',
nextDay: '[നാളെ] LT',
nextWeek: 'dddd, LT',
lastDay: '[ഇന്നലെ] LT',
lastWeek: '[കഴിഞ്ഞ] dddd, LT',
sameElse: 'L'
},
relativeTime: {
future: '%s കഴിഞ്ഞ്',
past: '%s മുൻപ്',
s: 'അൽപ നിമിഷങ്ങൾ',
ss: '%d സെക്കൻഡ്',
m: 'ഒരു മിനിറ്റ്',
mm: '%d മിനിറ്റ്',
h: 'ഒരു മണിക്കൂർ',
hh: '%d മണിക്കൂർ',
d: 'ഒരു ദിവസം',
dd: '%d ദിവസം',
M: 'ഒരു മാസം',
MM: '%d മാസം',
y: 'ഒരു വർഷം',
yy: '%d വർഷം'
},
meridiemParse: /രാത്രി|രാവിലെ|ഉച്ച കഴിഞ്ഞ്|വൈകുന്നേരം|രാത്രി/i,
meridiemHour: function (hour, meridiem) {
if (hour === 12) {
hour = 0;
}
if (meridiem === 'രാത്രി' && hour >= 4 || meridiem === 'ഉച്ച കഴിഞ്ഞ്' || meridiem === 'വൈകുന്നേരം') {
return hour + 12;
} else {
return hour;
}
},
meridiem: function (hour, minute, isLower) {
if (hour < 4) {
return 'രാത്രി';
} else if (hour < 12) {
return 'രാവിലെ';
} else if (hour < 17) {
return 'ഉച്ച കഴിഞ്ഞ്';
} else if (hour < 20) {
return 'വൈകുന്നേരം';
} else {
return 'രാത്രി';
}
}
});
return ml;
});
/***/ }),
/***/ "./node_modules/moment/locale/mn.js":
/*!******************************************!*\
!*** ./node_modules/moment/locale/mn.js ***!
\******************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
;
(function (global, factory) {
true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : undefined;
})(this, function (moment) {
'use strict';
function translate(number, withoutSuffix, key, isFuture) {
switch (key) {
case 's':
return withoutSuffix ? 'хэдхэн секунд' : 'хэдхэн секундын';
case 'ss':
return number + (withoutSuffix ? ' секунд' : ' секундын');
case 'm':
case 'mm':
return number + (withoutSuffix ? ' минут' : ' минутын');
case 'h':
case 'hh':
return number + (withoutSuffix ? ' цаг' : ' цагийн');
case 'd':
case 'dd':
return number + (withoutSuffix ? ' өдөр' : ' өдрийн');
case 'M':
case 'MM':
return number + (withoutSuffix ? ' сар' : ' сарын');
case 'y':
case 'yy':
return number + (withoutSuffix ? ' жил' : ' жилийн');
default:
return number;
}
}
var mn = moment.defineLocale('mn', {
months: 'Нэгдүгээр сар_Хоёрдугаар сар_Гуравдугаар сар_Дөрөвдүгээр сар_Тавдугаар сар_Зургадугаар сар_Долдугаар сар_Наймдугаар сар_Есдүгээр сар_Аравдугаар сар_Арван нэгдүгээр сар_Арван хоёрдугаар сар'.split('_'),
monthsShort: '1 сар_2 сар_3 сар_4 сар_5 сар_6 сар_7 сар_8 сар_9 сар_10 сар_11 сар_12 сар'.split('_'),
monthsParseExact: true,
weekdays: 'Ням_Даваа_Мягмар_Лхагва_Пүрэв_Баасан_Бямба'.split('_'),
weekdaysShort: 'Ням_Дав_Мяг_Лха_Пүр_Баа_Бям'.split('_'),
weekdaysMin: 'Ня_Да_Мя_Лх_Пү_Ба_Бя'.split('_'),
weekdaysParseExact: true,
longDateFormat: {
LT: 'HH:mm',
LTS: 'HH:mm:ss',
L: 'YYYY-MM-DD',
LL: 'YYYY оны MMMMын D',
LLL: 'YYYY оны MMMMын D HH:mm',
LLLL: 'dddd, YYYY оны MMMMын D HH:mm'
},
meridiemParse: /ҮӨ|ҮХ/i,
isPM: function (input) {
return input === 'ҮХ';
},
meridiem: function (hour, minute, isLower) {
if (hour < 12) {
return 'ҮӨ';
} else {
return 'ҮХ';
}
},
calendar: {
sameDay: '[Өнөөдөр] LT',
nextDay: '[Маргааш] LT',
nextWeek: '[Ирэх] dddd LT',
lastDay: '[Өчигдөр] LT',
lastWeek: '[Өнгөрсөн] dddd LT',
sameElse: 'L'
},
relativeTime: {
future: '%s дараа',
past: '%s өмнө',
s: translate,
ss: translate,
m: translate,
mm: translate,
h: translate,
hh: translate,
d: translate,
dd: translate,
M: translate,
MM: translate,
y: translate,
yy: translate
},
dayOfMonthOrdinalParse: /\d{1,2} өдөр/,
ordinal: function (number, period) {
switch (period) {
case 'd':
case 'D':
case 'DDD':
return number + ' өдөр';
default:
return number;
}
}
});
return mn;
});
/***/ }),
/***/ "./node_modules/moment/locale/mr.js":
/*!******************************************!*\
!*** ./node_modules/moment/locale/mr.js ***!
\******************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
;
(function (global, factory) {
true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : undefined;
})(this, function (moment) {
'use strict';
var symbolMap = {
'1': '१',
'2': '२',
'3': '३',
'4': '४',
'5': '५',
'6': '६',
'7': '७',
'8': '८',
'9': '९',
'0': '०'
},
numberMap = {
'१': '1',
'२': '2',
'३': '3',
'४': '4',
'५': '5',
'६': '6',
'७': '7',
'८': '8',
'९': '9',
'०': '0'
};
function relativeTimeMr(number, withoutSuffix, string, isFuture) {
var output = '';
if (withoutSuffix) {
switch (string) {
case 's':
output = 'काही सेकंद';
break;
case 'ss':
output = '%d सेकंद';
break;
case 'm':
output = 'एक मिनिट';
break;
case 'mm':
output = '%d मिनिटे';
break;
case 'h':
output = 'एक तास';
break;
case 'hh':
output = '%d तास';
break;
case 'd':
output = 'एक दिवस';
break;
case 'dd':
output = '%d दिवस';
break;
case 'M':
output = 'एक महिना';
break;
case 'MM':
output = '%d महिने';
break;
case 'y':
output = 'एक वर्ष';
break;
case 'yy':
output = '%d वर्षे';
break;
}
} else {
switch (string) {
case 's':
output = 'काही सेकंदां';
break;
case 'ss':
output = '%d सेकंदां';
break;
case 'm':
output = 'एका मिनिटा';
break;
case 'mm':
output = '%d मिनिटां';
break;
case 'h':
output = 'एका तासा';
break;
case 'hh':
output = '%d तासां';
break;
case 'd':
output = 'एका दिवसा';
break;
case 'dd':
output = '%d दिवसां';
break;
case 'M':
output = 'एका महिन्या';
break;
case 'MM':
output = '%d महिन्यां';
break;
case 'y':
output = 'एका वर्षा';
break;
case 'yy':
output = '%d वर्षां';
break;
}
}
return output.replace(/%d/i, number);
}
var mr = moment.defineLocale('mr', {
months: 'जानेवारी_फेब्रुवारी_मार्च_एप्रिल_मे_जून_जुलै_ऑगस्ट_सप्टेंबर_ऑक्टोबर_नोव्हेंबर_डिसेंबर'.split('_'),
monthsShort: 'जाने._फेब्रु._मार्च._एप्रि._मे._जून._जुलै._ऑग._सप्टें._ऑक्टो._नोव्हें._डिसें.'.split('_'),
monthsParseExact: true,
weekdays: 'रविवार_सोमवार_मंगळवार_बुधवार_गुरूवार_शुक्रवार_शनिवार'.split('_'),
weekdaysShort: 'रवि_सोम_मंगळ_बुध_गुरू_शुक्र_शनि'.split('_'),
weekdaysMin: 'र_सो_मं_बु_गु_शु_श'.split('_'),
longDateFormat: {
LT: 'A h:mm वाजता',
LTS: 'A h:mm:ss वाजता',
L: 'DD/MM/YYYY',
LL: 'D MMMM YYYY',
LLL: 'D MMMM YYYY, A h:mm वाजता',
LLLL: 'dddd, D MMMM YYYY, A h:mm वाजता'
},
calendar: {
sameDay: '[आज] LT',
nextDay: '[उद्या] LT',
nextWeek: 'dddd, LT',
lastDay: '[काल] LT',
lastWeek: '[मागील] dddd, LT',
sameElse: 'L'
},
relativeTime: {
future: '%sमध्ये',
past: '%sपूर्वी',
s: relativeTimeMr,
ss: relativeTimeMr,
m: relativeTimeMr,
mm: relativeTimeMr,
h: relativeTimeMr,
hh: relativeTimeMr,
d: relativeTimeMr,
dd: relativeTimeMr,
M: relativeTimeMr,
MM: relativeTimeMr,
y: relativeTimeMr,
yy: relativeTimeMr
},
preparse: function (string) {
return string.replace(/[१२३४५६७८९०]/g, function (match) {
return numberMap[match];
});
},
postformat: function (string) {
return string.replace(/\d/g, function (match) {
return symbolMap[match];
});
},
meridiemParse: /रात्री|सकाळी|दुपारी|सायंकाळी/,
meridiemHour: function (hour, meridiem) {
if (hour === 12) {
hour = 0;
}
if (meridiem === 'रात्री') {
return hour < 4 ? hour : hour + 12;
} else if (meridiem === 'सकाळी') {
return hour;
} else if (meridiem === 'दुपारी') {
return hour >= 10 ? hour : hour + 12;
} else if (meridiem === 'सायंकाळी') {
return hour + 12;
}
},
meridiem: function (hour, minute, isLower) {
if (hour < 4) {
return 'रात्री';
} else if (hour < 10) {
return 'सकाळी';
} else if (hour < 17) {
return 'दुपारी';
} else if (hour < 20) {
return 'सायंकाळी';
} else {
return 'रात्री';
}
},
week: {
dow: 0,
// Sunday is the first day of the week.
doy: 6 // The week that contains Jan 6th is the first week of the year.
}
});
return mr;
});
/***/ }),
/***/ "./node_modules/moment/locale/ms-my.js":
/*!*********************************************!*\
!*** ./node_modules/moment/locale/ms-my.js ***!
\*********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
;
(function (global, factory) {
true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : undefined;
})(this, function (moment) {
'use strict';
var msMy = moment.defineLocale('ms-my', {
months: 'Januari_Februari_Mac_April_Mei_Jun_Julai_Ogos_September_Oktober_November_Disember'.split('_'),
monthsShort: 'Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ogs_Sep_Okt_Nov_Dis'.split('_'),
weekdays: 'Ahad_Isnin_Selasa_Rabu_Khamis_Jumaat_Sabtu'.split('_'),
weekdaysShort: 'Ahd_Isn_Sel_Rab_Kha_Jum_Sab'.split('_'),
weekdaysMin: 'Ah_Is_Sl_Rb_Km_Jm_Sb'.split('_'),
longDateFormat: {
LT: 'HH.mm',
LTS: 'HH.mm.ss',
L: 'DD/MM/YYYY',
LL: 'D MMMM YYYY',
LLL: 'D MMMM YYYY [pukul] HH.mm',
LLLL: 'dddd, D MMMM YYYY [pukul] HH.mm'
},
meridiemParse: /pagi|tengahari|petang|malam/,
meridiemHour: function (hour, meridiem) {
if (hour === 12) {
hour = 0;
}
if (meridiem === 'pagi') {
return hour;
} else if (meridiem === 'tengahari') {
return hour >= 11 ? hour : hour + 12;
} else if (meridiem === 'petang' || meridiem === 'malam') {
return hour + 12;
}
},
meridiem: function (hours, minutes, isLower) {
if (hours < 11) {
return 'pagi';
} else if (hours < 15) {
return 'tengahari';
} else if (hours < 19) {
return 'petang';
} else {
return 'malam';
}
},
calendar: {
sameDay: '[Hari ini pukul] LT',
nextDay: '[Esok pukul] LT',
nextWeek: 'dddd [pukul] LT',
lastDay: '[Kelmarin pukul] LT',
lastWeek: 'dddd [lepas pukul] LT',
sameElse: 'L'
},
relativeTime: {
future: 'dalam %s',
past: '%s yang lepas',
s: 'beberapa saat',
ss: '%d saat',
m: 'seminit',
mm: '%d minit',
h: 'sejam',
hh: '%d jam',
d: 'sehari',
dd: '%d hari',
M: 'sebulan',
MM: '%d bulan',
y: 'setahun',
yy: '%d tahun'
},
week: {
dow: 1,
// Monday is the first day of the week.
doy: 7 // The week that contains Jan 7th is the first week of the year.
}
});
return msMy;
});
/***/ }),
/***/ "./node_modules/moment/locale/ms.js":
/*!******************************************!*\
!*** ./node_modules/moment/locale/ms.js ***!
\******************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
;
(function (global, factory) {
true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : undefined;
})(this, function (moment) {
'use strict';
var ms = moment.defineLocale('ms', {
months: 'Januari_Februari_Mac_April_Mei_Jun_Julai_Ogos_September_Oktober_November_Disember'.split('_'),
monthsShort: 'Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ogs_Sep_Okt_Nov_Dis'.split('_'),
weekdays: 'Ahad_Isnin_Selasa_Rabu_Khamis_Jumaat_Sabtu'.split('_'),
weekdaysShort: 'Ahd_Isn_Sel_Rab_Kha_Jum_Sab'.split('_'),
weekdaysMin: 'Ah_Is_Sl_Rb_Km_Jm_Sb'.split('_'),
longDateFormat: {
LT: 'HH.mm',
LTS: 'HH.mm.ss',
L: 'DD/MM/YYYY',
LL: 'D MMMM YYYY',
LLL: 'D MMMM YYYY [pukul] HH.mm',
LLLL: 'dddd, D MMMM YYYY [pukul] HH.mm'
},
meridiemParse: /pagi|tengahari|petang|malam/,
meridiemHour: function (hour, meridiem) {
if (hour === 12) {
hour = 0;
}
if (meridiem === 'pagi') {
return hour;
} else if (meridiem === 'tengahari') {
return hour >= 11 ? hour : hour + 12;
} else if (meridiem === 'petang' || meridiem === 'malam') {
return hour + 12;
}
},
meridiem: function (hours, minutes, isLower) {
if (hours < 11) {
return 'pagi';
} else if (hours < 15) {
return 'tengahari';
} else if (hours < 19) {
return 'petang';
} else {
return 'malam';
}
},
calendar: {
sameDay: '[Hari ini pukul] LT',
nextDay: '[Esok pukul] LT',
nextWeek: 'dddd [pukul] LT',
lastDay: '[Kelmarin pukul] LT',
lastWeek: 'dddd [lepas pukul] LT',
sameElse: 'L'
},
relativeTime: {
future: 'dalam %s',
past: '%s yang lepas',
s: 'beberapa saat',
ss: '%d saat',
m: 'seminit',
mm: '%d minit',
h: 'sejam',
hh: '%d jam',
d: 'sehari',
dd: '%d hari',
M: 'sebulan',
MM: '%d bulan',
y: 'setahun',
yy: '%d tahun'
},
week: {
dow: 1,
// Monday is the first day of the week.
doy: 7 // The week that contains Jan 7th is the first week of the year.
}
});
return ms;
});
/***/ }),
/***/ "./node_modules/moment/locale/mt.js":
/*!******************************************!*\
!*** ./node_modules/moment/locale/mt.js ***!
\******************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
;
(function (global, factory) {
true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : undefined;
})(this, function (moment) {
'use strict';
var mt = moment.defineLocale('mt', {
months: 'Jannar_Frar_Marzu_April_Mejju_Ġunju_Lulju_Awwissu_Settembru_Ottubru_Novembru_Diċembru'.split('_'),
monthsShort: 'Jan_Fra_Mar_Apr_Mej_Ġun_Lul_Aww_Set_Ott_Nov_Diċ'.split('_'),
weekdays: 'Il-Ħadd_It-Tnejn_It-Tlieta_L-Erbgħa_Il-Ħamis_Il-Ġimgħa_Is-Sibt'.split('_'),
weekdaysShort: 'Ħad_Tne_Tli_Erb_Ħam_Ġim_Sib'.split('_'),
weekdaysMin: 'Ħa_Tn_Tl_Er_Ħa_Ġi_Si'.split('_'),
longDateFormat: {
LT: 'HH:mm',
LTS: 'HH:mm:ss',
L: 'DD/MM/YYYY',
LL: 'D MMMM YYYY',
LLL: 'D MMMM YYYY HH:mm',
LLLL: 'dddd, D MMMM YYYY HH:mm'
},
calendar: {
sameDay: '[Illum fil-]LT',
nextDay: '[Għada fil-]LT',
nextWeek: 'dddd [fil-]LT',
lastDay: '[Il-bieraħ fil-]LT',
lastWeek: 'dddd [li għadda] [fil-]LT',
sameElse: 'L'
},
relativeTime: {
future: 'f’ %s',
past: '%s ilu',
s: 'ftit sekondi',
ss: '%d sekondi',
m: 'minuta',
mm: '%d minuti',
h: 'siegħa',
hh: '%d siegħat',
d: 'ġurnata',
dd: '%d ġranet',
M: 'xahar',
MM: '%d xhur',
y: 'sena',
yy: '%d sni'
},
dayOfMonthOrdinalParse: /\d{1,2}º/,
ordinal: '%dº',
week: {
dow: 1,
// Monday is the first day of the week.
doy: 4 // The week that contains Jan 4th is the first week of the year.
}
});
return mt;
});
/***/ }),
/***/ "./node_modules/moment/locale/my.js":
/*!******************************************!*\
!*** ./node_modules/moment/locale/my.js ***!
\******************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
;
(function (global, factory) {
true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : undefined;
})(this, function (moment) {
'use strict';
var symbolMap = {
'1': '၁',
'2': '၂',
'3': '၃',
'4': '၄',
'5': '၅',
'6': '၆',
'7': '၇',
'8': '၈',
'9': '၉',
'0': '၀'
},
numberMap = {
'၁': '1',
'၂': '2',
'၃': '3',
'၄': '4',
'၅': '5',
'၆': '6',
'၇': '7',
'၈': '8',
'၉': '9',
'၀': '0'
};
var my = moment.defineLocale('my', {
months: 'ဇန်နဝါရီ_ဖေဖော်ဝါရီ_မတ်_ဧပြီ_မေ_ဇွန်_ဇူလိုင်_သြဂုတ်_စက်တင်ဘာ_အောက်တိုဘာ_နိုဝင်ဘာ_ဒီဇင်ဘာ'.split('_'),
monthsShort: 'ဇန်_ဖေ_မတ်_ပြီ_မေ_ဇွန်_လိုင်_သြ_စက်_အောက်_နို_ဒီ'.split('_'),
weekdays: 'တနင်္ဂနွေ_တနင်္လာ_အင်္ဂါ_ဗုဒ္ဓဟူး_ကြာသပတေး_သောကြာ_စနေ'.split('_'),
weekdaysShort: 'နွေ_လာ_ဂါ_ဟူး_ကြာ_သော_နေ'.split('_'),
weekdaysMin: 'နွေ_လာ_ဂါ_ဟူး_ကြာ_သော_နေ'.split('_'),
longDateFormat: {
LT: 'HH:mm',
LTS: 'HH:mm:ss',
L: 'DD/MM/YYYY',
LL: 'D MMMM YYYY',
LLL: 'D MMMM YYYY HH:mm',
LLLL: 'dddd D MMMM YYYY HH:mm'
},
calendar: {
sameDay: '[ယနေ.] LT [မှာ]',
nextDay: '[မနက်ဖြန်] LT [မှာ]',
nextWeek: 'dddd LT [မှာ]',
lastDay: '[မနေ.က] LT [မှာ]',
lastWeek: '[ပြီးခဲ့သော] dddd LT [မှာ]',
sameElse: 'L'
},
relativeTime: {
future: 'လာမည့် %s မှာ',
past: 'လွန်ခဲ့သော %s က',
s: 'စက္ကန်.အနည်းငယ်',
ss: '%d စက္ကန့်',
m: 'တစ်မိနစ်',
mm: '%d မိနစ်',
h: 'တစ်နာရီ',
hh: '%d နာရီ',
d: 'တစ်ရက်',
dd: '%d ရက်',
M: 'တစ်လ',
MM: '%d လ',
y: 'တစ်နှစ်',
yy: '%d နှစ်'
},
preparse: function (string) {
return string.replace(/[၁၂၃၄၅၆၇၈၉၀]/g, function (match) {
return numberMap[match];
});
},
postformat: function (string) {
return string.replace(/\d/g, function (match) {
return symbolMap[match];
});
},
week: {
dow: 1,
// Monday is the first day of the week.
doy: 4 // The week that contains Jan 4th is the first week of the year.
}
});
return my;
});
/***/ }),
/***/ "./node_modules/moment/locale/nb.js":
/*!******************************************!*\
!*** ./node_modules/moment/locale/nb.js ***!
\******************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
;
(function (global, factory) {
true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : undefined;
})(this, function (moment) {
'use strict';
var nb = moment.defineLocale('nb', {
months: 'januar_februar_mars_april_mai_juni_juli_august_september_oktober_november_desember'.split('_'),
monthsShort: 'jan._feb._mars_april_mai_juni_juli_aug._sep._okt._nov._des.'.split('_'),
monthsParseExact: true,
weekdays: 'søndag_mandag_tirsdag_onsdag_torsdag_fredag_lørdag'.split('_'),
weekdaysShort: 'sø._ma._ti._on._to._fr._lø.'.split('_'),
weekdaysMin: 'sø_ma_ti_on_to_fr_lø'.split('_'),
weekdaysParseExact: true,
longDateFormat: {
LT: 'HH:mm',
LTS: 'HH:mm:ss',
L: 'DD.MM.YYYY',
LL: 'D. MMMM YYYY',
LLL: 'D. MMMM YYYY [kl.] HH:mm',
LLLL: 'dddd D. MMMM YYYY [kl.] HH:mm'
},
calendar: {
sameDay: '[i dag kl.] LT',
nextDay: '[i morgen kl.] LT',
nextWeek: 'dddd [kl.] LT',
lastDay: '[i går kl.] LT',
lastWeek: '[forrige] dddd [kl.] LT',
sameElse: 'L'
},
relativeTime: {
future: 'om %s',
past: '%s siden',
s: 'noen sekunder',
ss: '%d sekunder',
m: 'ett minutt',
mm: '%d minutter',
h: 'en time',
hh: '%d timer',
d: 'en dag',
dd: '%d dager',
M: 'en måned',
MM: '%d måneder',
y: 'ett år',
yy: '%d år'
},
dayOfMonthOrdinalParse: /\d{1,2}\./,
ordinal: '%d.',
week: {
dow: 1,
// Monday is the first day of the week.
doy: 4 // The week that contains Jan 4th is the first week of the year.
}
});
return nb;
});
/***/ }),
/***/ "./node_modules/moment/locale/ne.js":
/*!******************************************!*\
!*** ./node_modules/moment/locale/ne.js ***!
\******************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
;
(function (global, factory) {
true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : undefined;
})(this, function (moment) {
'use strict';
var symbolMap = {
'1': '१',
'2': '२',
'3': '३',
'4': '४',
'5': '५',
'6': '६',
'7': '७',
'8': '८',
'9': '९',
'0': '०'
},
numberMap = {
'१': '1',
'२': '2',
'३': '3',
'४': '4',
'५': '5',
'६': '6',
'७': '7',
'८': '8',
'९': '9',
'०': '0'
};
var ne = moment.defineLocale('ne', {
months: 'जनवरी_फेब्रुवरी_मार्च_अप्रिल_मई_जुन_जुलाई_अगष्ट_सेप्टेम्बर_अक्टोबर_नोभेम्बर_डिसेम्बर'.split('_'),
monthsShort: 'जन._फेब्रु._मार्च_अप्रि._मई_जुन_जुलाई._अग._सेप्ट._अक्टो._नोभे._डिसे.'.split('_'),
monthsParseExact: true,
weekdays: 'आइतबार_सोमबार_मङ्गलबार_बुधबार_बिहिबार_शुक्रबार_शनिबार'.split('_'),
weekdaysShort: 'आइत._सोम._मङ्गल._बुध._बिहि._शुक्र._शनि.'.split('_'),
weekdaysMin: 'आ._सो._मं._बु._बि._शु._श.'.split('_'),
weekdaysParseExact: true,
longDateFormat: {
LT: 'Aको h:mm बजे',
LTS: 'Aको h:mm:ss बजे',
L: 'DD/MM/YYYY',
LL: 'D MMMM YYYY',
LLL: 'D MMMM YYYY, Aको h:mm बजे',
LLLL: 'dddd, D MMMM YYYY, Aको h:mm बजे'
},
preparse: function (string) {
return string.replace(/[१२३४५६७८९०]/g, function (match) {
return numberMap[match];
});
},
postformat: function (string) {
return string.replace(/\d/g, function (match) {
return symbolMap[match];
});
},
meridiemParse: /राति|बिहान|दिउँसो|साँझ/,
meridiemHour: function (hour, meridiem) {
if (hour === 12) {
hour = 0;
}
if (meridiem === 'राति') {
return hour < 4 ? hour : hour + 12;
} else if (meridiem === 'बिहान') {
return hour;
} else if (meridiem === 'दिउँसो') {
return hour >= 10 ? hour : hour + 12;
} else if (meridiem === 'साँझ') {
return hour + 12;
}
},
meridiem: function (hour, minute, isLower) {
if (hour < 3) {
return 'राति';
} else if (hour < 12) {
return 'बिहान';
} else if (hour < 16) {
return 'दिउँसो';
} else if (hour < 20) {
return 'साँझ';
} else {
return 'राति';
}
},
calendar: {
sameDay: '[आज] LT',
nextDay: '[भोलि] LT',
nextWeek: '[आउँदो] dddd[,] LT',
lastDay: '[हिजो] LT',
lastWeek: '[गएको] dddd[,] LT',
sameElse: 'L'
},
relativeTime: {
future: '%sमा',
past: '%s अगाडि',
s: 'केही क्षण',
ss: '%d सेकेण्ड',
m: 'एक मिनेट',
mm: '%d मिनेट',
h: 'एक घण्टा',
hh: '%d घण्टा',
d: 'एक दिन',
dd: '%d दिन',
M: 'एक महिना',
MM: '%d महिना',
y: 'एक बर्ष',
yy: '%d बर्ष'
},
week: {
dow: 0,
// Sunday is the first day of the week.
doy: 6 // The week that contains Jan 6th is the first week of the year.
}
});
return ne;
});
/***/ }),
/***/ "./node_modules/moment/locale/nl-be.js":
/*!*********************************************!*\
!*** ./node_modules/moment/locale/nl-be.js ***!
\*********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
;
(function (global, factory) {
true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : undefined;
})(this, function (moment) {
'use strict';
var monthsShortWithDots = 'jan._feb._mrt._apr._mei_jun._jul._aug._sep._okt._nov._dec.'.split('_'),
monthsShortWithoutDots = 'jan_feb_mrt_apr_mei_jun_jul_aug_sep_okt_nov_dec'.split('_');
var monthsParse = [/^jan/i, /^feb/i, /^maart|mrt.?$/i, /^apr/i, /^mei$/i, /^jun[i.]?$/i, /^jul[i.]?$/i, /^aug/i, /^sep/i, /^okt/i, /^nov/i, /^dec/i];
var monthsRegex = /^(januari|februari|maart|april|mei|ju[nl]i|augustus|september|oktober|november|december|jan\.?|feb\.?|mrt\.?|apr\.?|ju[nl]\.?|aug\.?|sep\.?|okt\.?|nov\.?|dec\.?)/i;
var nlBe = moment.defineLocale('nl-be', {
months: 'januari_februari_maart_april_mei_juni_juli_augustus_september_oktober_november_december'.split('_'),
monthsShort: function (m, format) {
if (!m) {
return monthsShortWithDots;
} else if (/-MMM-/.test(format)) {
return monthsShortWithoutDots[m.month()];
} else {
return monthsShortWithDots[m.month()];
}
},
monthsRegex: monthsRegex,
monthsShortRegex: monthsRegex,
monthsStrictRegex: /^(januari|februari|maart|april|mei|ju[nl]i|augustus|september|oktober|november|december)/i,
monthsShortStrictRegex: /^(jan\.?|feb\.?|mrt\.?|apr\.?|mei|ju[nl]\.?|aug\.?|sep\.?|okt\.?|nov\.?|dec\.?)/i,
monthsParse: monthsParse,
longMonthsParse: monthsParse,
shortMonthsParse: monthsParse,
weekdays: 'zondag_maandag_dinsdag_woensdag_donderdag_vrijdag_zaterdag'.split('_'),
weekdaysShort: 'zo._ma._di._wo._do._vr._za.'.split('_'),
weekdaysMin: 'zo_ma_di_wo_do_vr_za'.split('_'),
weekdaysParseExact: true,
longDateFormat: {
LT: 'HH:mm',
LTS: 'HH:mm:ss',
L: 'DD/MM/YYYY',
LL: 'D MMMM YYYY',
LLL: 'D MMMM YYYY HH:mm',
LLLL: 'dddd D MMMM YYYY HH:mm'
},
calendar: {
sameDay: '[vandaag om] LT',
nextDay: '[morgen om] LT',
nextWeek: 'dddd [om] LT',
lastDay: '[gisteren om] LT',
lastWeek: '[afgelopen] dddd [om] LT',
sameElse: 'L'
},
relativeTime: {
future: 'over %s',
past: '%s geleden',
s: 'een paar seconden',
ss: '%d seconden',
m: 'één minuut',
mm: '%d minuten',
h: 'één uur',
hh: '%d uur',
d: 'één dag',
dd: '%d dagen',
M: 'één maand',
MM: '%d maanden',
y: 'één jaar',
yy: '%d jaar'
},
dayOfMonthOrdinalParse: /\d{1,2}(ste|de)/,
ordinal: function (number) {
return number + (number === 1 || number === 8 || number >= 20 ? 'ste' : 'de');
},
week: {
dow: 1,
// Monday is the first day of the week.
doy: 4 // The week that contains Jan 4th is the first week of the year.
}
});
return nlBe;
});
/***/ }),
/***/ "./node_modules/moment/locale/nl.js":
/*!******************************************!*\
!*** ./node_modules/moment/locale/nl.js ***!
\******************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
;
(function (global, factory) {
true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : undefined;
})(this, function (moment) {
'use strict';
var monthsShortWithDots = 'jan._feb._mrt._apr._mei_jun._jul._aug._sep._okt._nov._dec.'.split('_'),
monthsShortWithoutDots = 'jan_feb_mrt_apr_mei_jun_jul_aug_sep_okt_nov_dec'.split('_');
var monthsParse = [/^jan/i, /^feb/i, /^maart|mrt.?$/i, /^apr/i, /^mei$/i, /^jun[i.]?$/i, /^jul[i.]?$/i, /^aug/i, /^sep/i, /^okt/i, /^nov/i, /^dec/i];
var monthsRegex = /^(januari|februari|maart|april|mei|ju[nl]i|augustus|september|oktober|november|december|jan\.?|feb\.?|mrt\.?|apr\.?|ju[nl]\.?|aug\.?|sep\.?|okt\.?|nov\.?|dec\.?)/i;
var nl = moment.defineLocale('nl', {
months: 'januari_februari_maart_april_mei_juni_juli_augustus_september_oktober_november_december'.split('_'),
monthsShort: function (m, format) {
if (!m) {
return monthsShortWithDots;
} else if (/-MMM-/.test(format)) {
return monthsShortWithoutDots[m.month()];
} else {
return monthsShortWithDots[m.month()];
}
},
monthsRegex: monthsRegex,
monthsShortRegex: monthsRegex,
monthsStrictRegex: /^(januari|februari|maart|april|mei|ju[nl]i|augustus|september|oktober|november|december)/i,
monthsShortStrictRegex: /^(jan\.?|feb\.?|mrt\.?|apr\.?|mei|ju[nl]\.?|aug\.?|sep\.?|okt\.?|nov\.?|dec\.?)/i,
monthsParse: monthsParse,
longMonthsParse: monthsParse,
shortMonthsParse: monthsParse,
weekdays: 'zondag_maandag_dinsdag_woensdag_donderdag_vrijdag_zaterdag'.split('_'),
weekdaysShort: 'zo._ma._di._wo._do._vr._za.'.split('_'),
weekdaysMin: 'zo_ma_di_wo_do_vr_za'.split('_'),
weekdaysParseExact: true,
longDateFormat: {
LT: 'HH:mm',
LTS: 'HH:mm:ss',
L: 'DD-MM-YYYY',
LL: 'D MMMM YYYY',
LLL: 'D MMMM YYYY HH:mm',
LLLL: 'dddd D MMMM YYYY HH:mm'
},
calendar: {
sameDay: '[vandaag om] LT',
nextDay: '[morgen om] LT',
nextWeek: 'dddd [om] LT',
lastDay: '[gisteren om] LT',
lastWeek: '[afgelopen] dddd [om] LT',
sameElse: 'L'
},
relativeTime: {
future: 'over %s',
past: '%s geleden',
s: 'een paar seconden',
ss: '%d seconden',
m: 'één minuut',
mm: '%d minuten',
h: 'één uur',
hh: '%d uur',
d: 'één dag',
dd: '%d dagen',
M: 'één maand',
MM: '%d maanden',
y: 'één jaar',
yy: '%d jaar'
},
dayOfMonthOrdinalParse: /\d{1,2}(ste|de)/,
ordinal: function (number) {
return number + (number === 1 || number === 8 || number >= 20 ? 'ste' : 'de');
},
week: {
dow: 1,
// Monday is the first day of the week.
doy: 4 // The week that contains Jan 4th is the first week of the year.
}
});
return nl;
});
/***/ }),
/***/ "./node_modules/moment/locale/nn.js":
/*!******************************************!*\
!*** ./node_modules/moment/locale/nn.js ***!
\******************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
;
(function (global, factory) {
true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : undefined;
})(this, function (moment) {
'use strict';
var nn = moment.defineLocale('nn', {
months: 'januar_februar_mars_april_mai_juni_juli_august_september_oktober_november_desember'.split('_'),
monthsShort: 'jan_feb_mar_apr_mai_jun_jul_aug_sep_okt_nov_des'.split('_'),
weekdays: 'sundag_måndag_tysdag_onsdag_torsdag_fredag_laurdag'.split('_'),
weekdaysShort: 'sun_mån_tys_ons_tor_fre_lau'.split('_'),
weekdaysMin: 'su_må_ty_on_to_fr_lø'.split('_'),
longDateFormat: {
LT: 'HH:mm',
LTS: 'HH:mm:ss',
L: 'DD.MM.YYYY',
LL: 'D. MMMM YYYY',
LLL: 'D. MMMM YYYY [kl.] H:mm',
LLLL: 'dddd D. MMMM YYYY [kl.] HH:mm'
},
calendar: {
sameDay: '[I dag klokka] LT',
nextDay: '[I morgon klokka] LT',
nextWeek: 'dddd [klokka] LT',
lastDay: '[I går klokka] LT',
lastWeek: '[Føregåande] dddd [klokka] LT',
sameElse: 'L'
},
relativeTime: {
future: 'om %s',
past: '%s sidan',
s: 'nokre sekund',
ss: '%d sekund',
m: 'eit minutt',
mm: '%d minutt',
h: 'ein time',
hh: '%d timar',
d: 'ein dag',
dd: '%d dagar',
M: 'ein månad',
MM: '%d månader',
y: 'eit år',
yy: '%d år'
},
dayOfMonthOrdinalParse: /\d{1,2}\./,
ordinal: '%d.',
week: {
dow: 1,
// Monday is the first day of the week.
doy: 4 // The week that contains Jan 4th is the first week of the year.
}
});
return nn;
});
/***/ }),
/***/ "./node_modules/moment/locale/pa-in.js":
/*!*********************************************!*\
!*** ./node_modules/moment/locale/pa-in.js ***!
\*********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
;
(function (global, factory) {
true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : undefined;
})(this, function (moment) {
'use strict';
var symbolMap = {
'1': '੧',
'2': '੨',
'3': '੩',
'4': '੪',
'5': '੫',
'6': '੬',
'7': '੭',
'8': '੮',
'9': '੯',
'0': '੦'
},
numberMap = {
'੧': '1',
'੨': '2',
'੩': '3',
'੪': '4',
'੫': '5',
'੬': '6',
'੭': '7',
'੮': '8',
'੯': '9',
'੦': '0'
};
var paIn = moment.defineLocale('pa-in', {
// There are months name as per Nanakshahi Calendar but they are not used as rigidly in modern Punjabi.
months: 'ਜਨਵਰੀ_ਫ਼ਰਵਰੀ_ਮਾਰਚ_ਅਪ੍ਰੈਲ_ਮਈ_ਜੂਨ_ਜੁਲਾਈ_ਅਗਸਤ_ਸਤੰਬਰ_ਅਕਤੂਬਰ_ਨਵੰਬਰ_ਦਸੰਬਰ'.split('_'),
monthsShort: 'ਜਨਵਰੀ_ਫ਼ਰਵਰੀ_ਮਾਰਚ_ਅਪ੍ਰੈਲ_ਮਈ_ਜੂਨ_ਜੁਲਾਈ_ਅਗਸਤ_ਸਤੰਬਰ_ਅਕਤੂਬਰ_ਨਵੰਬਰ_ਦਸੰਬਰ'.split('_'),
weekdays: 'ਐਤਵਾਰ_ਸੋਮਵਾਰ_ਮੰਗਲਵਾਰ_ਬੁਧਵਾਰ_ਵੀਰਵਾਰ_ਸ਼ੁੱਕਰਵਾਰ_ਸ਼ਨੀਚਰਵਾਰ'.split('_'),
weekdaysShort: 'ਐਤ_ਸੋਮ_ਮੰਗਲ_ਬੁਧ_ਵੀਰ_ਸ਼ੁਕਰ_ਸ਼ਨੀ'.split('_'),
weekdaysMin: 'ਐਤ_ਸੋਮ_ਮੰਗਲ_ਬੁਧ_ਵੀਰ_ਸ਼ੁਕਰ_ਸ਼ਨੀ'.split('_'),
longDateFormat: {
LT: 'A h:mm ਵਜੇ',
LTS: 'A h:mm:ss ਵਜੇ',
L: 'DD/MM/YYYY',
LL: 'D MMMM YYYY',
LLL: 'D MMMM YYYY, A h:mm ਵਜੇ',
LLLL: 'dddd, D MMMM YYYY, A h:mm ਵਜੇ'
},
calendar: {
sameDay: '[ਅਜ] LT',
nextDay: '[ਕਲ] LT',
nextWeek: '[ਅਗਲਾ] dddd, LT',
lastDay: '[ਕਲ] LT',
lastWeek: '[ਪਿਛਲੇ] dddd, LT',
sameElse: 'L'
},
relativeTime: {
future: '%s ਵਿੱਚ',
past: '%s ਪਿਛਲੇ',
s: 'ਕੁਝ ਸਕਿੰਟ',
ss: '%d ਸਕਿੰਟ',
m: 'ਇਕ ਮਿੰਟ',
mm: '%d ਮਿੰਟ',
h: 'ਇੱਕ ਘੰਟਾ',
hh: '%d ਘੰਟੇ',
d: 'ਇੱਕ ਦਿਨ',
dd: '%d ਦਿਨ',
M: 'ਇੱਕ ਮਹੀਨਾ',
MM: '%d ਮਹੀਨੇ',
y: 'ਇੱਕ ਸਾਲ',
yy: '%d ਸਾਲ'
},
preparse: function (string) {
return string.replace(/[੧੨੩੪੫੬੭੮੯੦]/g, function (match) {
return numberMap[match];
});
},
postformat: function (string) {
return string.replace(/\d/g, function (match) {
return symbolMap[match];
});
},
// Punjabi notation for meridiems are quite fuzzy in practice. While there exists
// a rigid notion of a 'Pahar' it is not used as rigidly in modern Punjabi.
meridiemParse: /ਰਾਤ|ਸਵੇਰ|ਦੁਪਹਿਰ|ਸ਼ਾਮ/,
meridiemHour: function (hour, meridiem) {
if (hour === 12) {
hour = 0;
}
if (meridiem === 'ਰਾਤ') {
return hour < 4 ? hour : hour + 12;
} else if (meridiem === 'ਸਵੇਰ') {
return hour;
} else if (meridiem === 'ਦੁਪਹਿਰ') {
return hour >= 10 ? hour : hour + 12;
} else if (meridiem === 'ਸ਼ਾਮ') {
return hour + 12;
}
},
meridiem: function (hour, minute, isLower) {
if (hour < 4) {
return 'ਰਾਤ';
} else if (hour < 10) {
return 'ਸਵੇਰ';
} else if (hour < 17) {
return 'ਦੁਪਹਿਰ';
} else if (hour < 20) {
return 'ਸ਼ਾਮ';
} else {
return 'ਰਾਤ';
}
},
week: {
dow: 0,
// Sunday is the first day of the week.
doy: 6 // The week that contains Jan 6th is the first week of the year.
}
});
return paIn;
});
/***/ }),
/***/ "./node_modules/moment/locale/pl.js":
/*!******************************************!*\
!*** ./node_modules/moment/locale/pl.js ***!
\******************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
;
(function (global, factory) {
true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : undefined;
})(this, function (moment) {
'use strict';
var monthsNominative = 'styczeń_luty_marzec_kwiecień_maj_czerwiec_lipiec_sierpień_wrzesień_październik_listopad_grudzień'.split('_'),
monthsSubjective = 'stycznia_lutego_marca_kwietnia_maja_czerwca_lipca_sierpnia_września_października_listopada_grudnia'.split('_');
function plural(n) {
return n % 10 < 5 && n % 10 > 1 && ~~(n / 10) % 10 !== 1;
}
function translate(number, withoutSuffix, key) {
var result = number + ' ';
switch (key) {
case 'ss':
return result + (plural(number) ? 'sekundy' : 'sekund');
case 'm':
return withoutSuffix ? 'minuta' : 'minutę';
case 'mm':
return result + (plural(number) ? 'minuty' : 'minut');
case 'h':
return withoutSuffix ? 'godzina' : 'godzinę';
case 'hh':
return result + (plural(number) ? 'godziny' : 'godzin');
case 'MM':
return result + (plural(number) ? 'miesiące' : 'miesięcy');
case 'yy':
return result + (plural(number) ? 'lata' : 'lat');
}
}
var pl = moment.defineLocale('pl', {
months: function (momentToFormat, format) {
if (!momentToFormat) {
return monthsNominative;
} else if (format === '') {
// Hack: if format empty we know this is used to generate
// RegExp by moment. Give then back both valid forms of months
// in RegExp ready format.
return '(' + monthsSubjective[momentToFormat.month()] + '|' + monthsNominative[momentToFormat.month()] + ')';
} else if (/D MMMM/.test(format)) {
return monthsSubjective[momentToFormat.month()];
} else {
return monthsNominative[momentToFormat.month()];
}
},
monthsShort: 'sty_lut_mar_kwi_maj_cze_lip_sie_wrz_paź_lis_gru'.split('_'),
weekdays: 'niedziela_poniedziałek_wtorek_środa_czwartek_piątek_sobota'.split('_'),
weekdaysShort: 'ndz_pon_wt_śr_czw_pt_sob'.split('_'),
weekdaysMin: 'Nd_Pn_Wt_Śr_Cz_Pt_So'.split('_'),
longDateFormat: {
LT: 'HH:mm',
LTS: 'HH:mm:ss',
L: 'DD.MM.YYYY',
LL: 'D MMMM YYYY',
LLL: 'D MMMM YYYY HH:mm',
LLLL: 'dddd, D MMMM YYYY HH:mm'
},
calendar: {
sameDay: '[Dziś o] LT',
nextDay: '[Jutro o] LT',
nextWeek: function () {
switch (this.day()) {
case 0:
return '[W niedzielę o] LT';
case 2:
return '[We wtorek o] LT';
case 3:
return '[W środę o] LT';
case 6:
return '[W sobotę o] LT';
default:
return '[W] dddd [o] LT';
}
},
lastDay: '[Wczoraj o] LT',
lastWeek: function () {
switch (this.day()) {
case 0:
return '[W zeszłą niedzielę o] LT';
case 3:
return '[W zeszłą środę o] LT';
case 6:
return '[W zeszłą sobotę o] LT';
default:
return '[W zeszły] dddd [o] LT';
}
},
sameElse: 'L'
},
relativeTime: {
future: 'za %s',
past: '%s temu',
s: 'kilka sekund',
ss: translate,
m: translate,
mm: translate,
h: translate,
hh: translate,
d: '1 dzień',
dd: '%d dni',
M: 'miesiąc',
MM: translate,
y: 'rok',
yy: translate
},
dayOfMonthOrdinalParse: /\d{1,2}\./,
ordinal: '%d.',
week: {
dow: 1,
// Monday is the first day of the week.
doy: 4 // The week that contains Jan 4th is the first week of the year.
}
});
return pl;
});
/***/ }),
/***/ "./node_modules/moment/locale/pt-br.js":
/*!*********************************************!*\
!*** ./node_modules/moment/locale/pt-br.js ***!
\*********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
;
(function (global, factory) {
true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : undefined;
})(this, function (moment) {
'use strict';
var ptBr = moment.defineLocale('pt-br', {
months: 'Janeiro_Fevereiro_Março_Abril_Maio_Junho_Julho_Agosto_Setembro_Outubro_Novembro_Dezembro'.split('_'),
monthsShort: 'Jan_Fev_Mar_Abr_Mai_Jun_Jul_Ago_Set_Out_Nov_Dez'.split('_'),
weekdays: 'Domingo_Segunda-feira_Terça-feira_Quarta-feira_Quinta-feira_Sexta-feira_Sábado'.split('_'),
weekdaysShort: 'Dom_Seg_Ter_Qua_Qui_Sex_Sáb'.split('_'),
weekdaysMin: 'Do_2ª_3ª_4ª_5ª_6ª_Sá'.split('_'),
weekdaysParseExact: true,
longDateFormat: {
LT: 'HH:mm',
LTS: 'HH:mm:ss',
L: 'DD/MM/YYYY',
LL: 'D [de] MMMM [de] YYYY',
LLL: 'D [de] MMMM [de] YYYY [às] HH:mm',
LLLL: 'dddd, D [de] MMMM [de] YYYY [às] HH:mm'
},
calendar: {
sameDay: '[Hoje às] LT',
nextDay: '[Amanhã às] LT',
nextWeek: 'dddd [às] LT',
lastDay: '[Ontem às] LT',
lastWeek: function () {
return this.day() === 0 || this.day() === 6 ? '[Último] dddd [às] LT' : // Saturday + Sunday
'[Última] dddd [às] LT'; // Monday - Friday
},
sameElse: 'L'
},
relativeTime: {
future: 'em %s',
past: 'há %s',
s: 'poucos segundos',
ss: '%d segundos',
m: 'um minuto',
mm: '%d minutos',
h: 'uma hora',
hh: '%d horas',
d: 'um dia',
dd: '%d dias',
M: 'um mês',
MM: '%d meses',
y: 'um ano',
yy: '%d anos'
},
dayOfMonthOrdinalParse: /\d{1,2}º/,
ordinal: '%dº'
});
return ptBr;
});
/***/ }),
/***/ "./node_modules/moment/locale/pt.js":
/*!******************************************!*\
!*** ./node_modules/moment/locale/pt.js ***!
\******************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
;
(function (global, factory) {
true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : undefined;
})(this, function (moment) {
'use strict';
var pt = moment.defineLocale('pt', {
months: 'Janeiro_Fevereiro_Março_Abril_Maio_Junho_Julho_Agosto_Setembro_Outubro_Novembro_Dezembro'.split('_'),
monthsShort: 'Jan_Fev_Mar_Abr_Mai_Jun_Jul_Ago_Set_Out_Nov_Dez'.split('_'),
weekdays: 'Domingo_Segunda-feira_Terça-feira_Quarta-feira_Quinta-feira_Sexta-feira_Sábado'.split('_'),
weekdaysShort: 'Dom_Seg_Ter_Qua_Qui_Sex_Sáb'.split('_'),
weekdaysMin: 'Do_2ª_3ª_4ª_5ª_6ª_Sá'.split('_'),
weekdaysParseExact: true,
longDateFormat: {
LT: 'HH:mm',
LTS: 'HH:mm:ss',
L: 'DD/MM/YYYY',
LL: 'D [de] MMMM [de] YYYY',
LLL: 'D [de] MMMM [de] YYYY HH:mm',
LLLL: 'dddd, D [de] MMMM [de] YYYY HH:mm'
},
calendar: {
sameDay: '[Hoje às] LT',
nextDay: '[Amanhã às] LT',
nextWeek: 'dddd [às] LT',
lastDay: '[Ontem às] LT',
lastWeek: function () {
return this.day() === 0 || this.day() === 6 ? '[Último] dddd [às] LT' : // Saturday + Sunday
'[Última] dddd [às] LT'; // Monday - Friday
},
sameElse: 'L'
},
relativeTime: {
future: 'em %s',
past: 'há %s',
s: 'segundos',
ss: '%d segundos',
m: 'um minuto',
mm: '%d minutos',
h: 'uma hora',
hh: '%d horas',
d: 'um dia',
dd: '%d dias',
M: 'um mês',
MM: '%d meses',
y: 'um ano',
yy: '%d anos'
},
dayOfMonthOrdinalParse: /\d{1,2}º/,
ordinal: '%dº',
week: {
dow: 1,
// Monday is the first day of the week.
doy: 4 // The week that contains Jan 4th is the first week of the year.
}
});
return pt;
});
/***/ }),
/***/ "./node_modules/moment/locale/ro.js":
/*!******************************************!*\
!*** ./node_modules/moment/locale/ro.js ***!
\******************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
;
(function (global, factory) {
true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : undefined;
})(this, function (moment) {
'use strict';
function relativeTimeWithPlural(number, withoutSuffix, key) {
var format = {
'ss': 'secunde',
'mm': 'minute',
'hh': 'ore',
'dd': 'zile',
'MM': 'luni',
'yy': 'ani'
},
separator = ' ';
if (number % 100 >= 20 || number >= 100 && number % 100 === 0) {
separator = ' de ';
}
return number + separator + format[key];
}
var ro = moment.defineLocale('ro', {
months: 'ianuarie_februarie_martie_aprilie_mai_iunie_iulie_august_septembrie_octombrie_noiembrie_decembrie'.split('_'),
monthsShort: 'ian._febr._mart._apr._mai_iun._iul._aug._sept._oct._nov._dec.'.split('_'),
monthsParseExact: true,
weekdays: 'duminică_luni_marți_miercuri_joi_vineri_sâmbătă'.split('_'),
weekdaysShort: 'Dum_Lun_Mar_Mie_Joi_Vin_Sâm'.split('_'),
weekdaysMin: 'Du_Lu_Ma_Mi_Jo_Vi_Sâ'.split('_'),
longDateFormat: {
LT: 'H:mm',
LTS: 'H:mm:ss',
L: 'DD.MM.YYYY',
LL: 'D MMMM YYYY',
LLL: 'D MMMM YYYY H:mm',
LLLL: 'dddd, D MMMM YYYY H:mm'
},
calendar: {
sameDay: '[azi la] LT',
nextDay: '[mâine la] LT',
nextWeek: 'dddd [la] LT',
lastDay: '[ieri la] LT',
lastWeek: '[fosta] dddd [la] LT',
sameElse: 'L'
},
relativeTime: {
future: 'peste %s',
past: '%s în urmă',
s: 'câteva secunde',
ss: relativeTimeWithPlural,
m: 'un minut',
mm: relativeTimeWithPlural,
h: 'o oră',
hh: relativeTimeWithPlural,
d: 'o zi',
dd: relativeTimeWithPlural,
M: 'o lună',
MM: relativeTimeWithPlural,
y: 'un an',
yy: relativeTimeWithPlural
},
week: {
dow: 1,
// Monday is the first day of the week.
doy: 7 // The week that contains Jan 7th is the first week of the year.
}
});
return ro;
});
/***/ }),
/***/ "./node_modules/moment/locale/ru.js":
/*!******************************************!*\
!*** ./node_modules/moment/locale/ru.js ***!
\******************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
;
(function (global, factory) {
true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : undefined;
})(this, function (moment) {
'use strict';
function plural(word, num) {
var forms = word.split('_');
return num % 10 === 1 && num % 100 !== 11 ? forms[0] : num % 10 >= 2 && num % 10 <= 4 && (num % 100 < 10 || num % 100 >= 20) ? forms[1] : forms[2];
}
function relativeTimeWithPlural(number, withoutSuffix, key) {
var format = {
'ss': withoutSuffix ? 'секунда_секунды_секунд' : 'секунду_секунды_секунд',
'mm': withoutSuffix ? 'минута_минуты_минут' : 'минуту_минуты_минут',
'hh': 'час_часа_часов',
'dd': 'день_дня_дней',
'MM': 'месяц_месяца_месяцев',
'yy': 'год_года_лет'
};
if (key === 'm') {
return withoutSuffix ? 'минута' : 'минуту';
} else {
return number + ' ' + plural(format[key], +number);
}
}
var monthsParse = [/^янв/i, /^фев/i, /^мар/i, /^апр/i, /^ма[йя]/i, /^июн/i, /^июл/i, /^авг/i, /^сен/i, /^окт/i, /^ноя/i, /^дек/i]; // http://new.gramota.ru/spravka/rules/139-prop : § 103
// Сокращения месяцев: http://new.gramota.ru/spravka/buro/search-answer?s=242637
// CLDR data: http://www.unicode.org/cldr/charts/28/summary/ru.html#1753
var ru = moment.defineLocale('ru', {
months: {
format: 'января_февраля_марта_апреля_мая_июня_июля_августа_сентября_октября_ноября_декабря'.split('_'),
standalone: 'январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь'.split('_')
},
monthsShort: {
// по CLDR именно "июл." и "июн.", но какой смысл менять букву на точку ?
format: 'янв._февр._мар._апр._мая_июня_июля_авг._сент._окт._нояб._дек.'.split('_'),
standalone: 'янв._февр._март_апр._май_июнь_июль_авг._сент._окт._нояб._дек.'.split('_')
},
weekdays: {
standalone: 'воскресенье_понедельник_вторник_среда_четверг_пятница_суббота'.split('_'),
format: 'воскресенье_понедельник_вторник_среду_четверг_пятницу_субботу'.split('_'),
isFormat: /\[ ?[Вв] ?(?:прошлую|следующую|эту)? ?\] ?dddd/
},
weekdaysShort: 'вс_пн_вт_ср_чт_пт_сб'.split('_'),
weekdaysMin: 'вс_пн_вт_ср_чт_пт_сб'.split('_'),
monthsParse: monthsParse,
longMonthsParse: monthsParse,
shortMonthsParse: monthsParse,
// полные названия с падежами, по три буквы, для некоторых, по 4 буквы, сокращения с точкой и без точки
monthsRegex: /^(январ[ья]|янв\.?|феврал[ья]|февр?\.?|марта?|мар\.?|апрел[ья]|апр\.?|ма[йя]|июн[ья]|июн\.?|июл[ья]|июл\.?|августа?|авг\.?|сентябр[ья]|сент?\.?|октябр[ья]|окт\.?|ноябр[ья]|нояб?\.?|декабр[ья]|дек\.?)/i,
// копия предыдущего
monthsShortRegex: /^(январ[ья]|янв\.?|феврал[ья]|февр?\.?|марта?|мар\.?|апрел[ья]|апр\.?|ма[йя]|июн[ья]|июн\.?|июл[ья]|июл\.?|августа?|авг\.?|сентябр[ья]|сент?\.?|октябр[ья]|окт\.?|ноябр[ья]|нояб?\.?|декабр[ья]|дек\.?)/i,
// полные названия с падежами
monthsStrictRegex: /^(январ[яь]|феврал[яь]|марта?|апрел[яь]|ма[яй]|июн[яь]|июл[яь]|августа?|сентябр[яь]|октябр[яь]|ноябр[яь]|декабр[яь])/i,
// Выражение, которое соотвествует только сокращённым формам
monthsShortStrictRegex: /^(янв\.|февр?\.|мар[т.]|апр\.|ма[яй]|июн[ья.]|июл[ья.]|авг\.|сент?\.|окт\.|нояб?\.|дек\.)/i,
longDateFormat: {
LT: 'H:mm',
LTS: 'H:mm:ss',
L: 'DD.MM.YYYY',
LL: 'D MMMM YYYY г.',
LLL: 'D MMMM YYYY г., H:mm',
LLLL: 'dddd, D MMMM YYYY г., H:mm'
},
calendar: {
sameDay: '[Сегодня, в] LT',
nextDay: '[Завтра, в] LT',
lastDay: '[Вчера, в] LT',
nextWeek: function (now) {
if (now.week() !== this.week()) {
switch (this.day()) {
case 0:
return '[В следующее] dddd, [в] LT';
case 1:
case 2:
case 4:
return '[В следующий] dddd, [в] LT';
case 3:
case 5:
case 6:
return '[В следующую] dddd, [в] LT';
}
} else {
if (this.day() === 2) {
return '[Во] dddd, [в] LT';
} else {
return '[В] dddd, [в] LT';
}
}
},
lastWeek: function (now) {
if (now.week() !== this.week()) {
switch (this.day()) {
case 0:
return '[В прошлое] dddd, [в] LT';
case 1:
case 2:
case 4:
return '[В прошлый] dddd, [в] LT';
case 3:
case 5:
case 6:
return '[В прошлую] dddd, [в] LT';
}
} else {
if (this.day() === 2) {
return '[Во] dddd, [в] LT';
} else {
return '[В] dddd, [в] LT';
}
}
},
sameElse: 'L'
},
relativeTime: {
future: 'через %s',
past: '%s назад',
s: 'несколько секунд',
ss: relativeTimeWithPlural,
m: relativeTimeWithPlural,
mm: relativeTimeWithPlural,
h: 'час',
hh: relativeTimeWithPlural,
d: 'день',
dd: relativeTimeWithPlural,
M: 'месяц',
MM: relativeTimeWithPlural,
y: 'год',
yy: relativeTimeWithPlural
},
meridiemParse: /ночи|утра|дня|вечера/i,
isPM: function (input) {
return /^(дня|вечера)$/.test(input);
},
meridiem: function (hour, minute, isLower) {
if (hour < 4) {
return 'ночи';
} else if (hour < 12) {
return 'утра';
} else if (hour < 17) {
return 'дня';
} else {
return 'вечера';
}
},
dayOfMonthOrdinalParse: /\d{1,2}-(й|го|я)/,
ordinal: function (number, period) {
switch (period) {
case 'M':
case 'd':
case 'DDD':
return number + '-й';
case 'D':
return number + '-го';
case 'w':
case 'W':
return number + '-я';
default:
return number;
}
},
week: {
dow: 1,
// Monday is the first day of the week.
doy: 4 // The week that contains Jan 4th is the first week of the year.
}
});
return ru;
});
/***/ }),
/***/ "./node_modules/moment/locale/sd.js":
/*!******************************************!*\
!*** ./node_modules/moment/locale/sd.js ***!
\******************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
;
(function (global, factory) {
true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : undefined;
})(this, function (moment) {
'use strict';
var months = ['جنوري', 'فيبروري', 'مارچ', 'اپريل', 'مئي', 'جون', 'جولاءِ', 'آگسٽ', 'سيپٽمبر', 'آڪٽوبر', 'نومبر', 'ڊسمبر'];
var days = ['آچر', 'سومر', 'اڱارو', 'اربع', 'خميس', 'جمع', 'ڇنڇر'];
var sd = moment.defineLocale('sd', {
months: months,
monthsShort: months,
weekdays: days,
weekdaysShort: days,
weekdaysMin: days,
longDateFormat: {
LT: 'HH:mm',
LTS: 'HH:mm:ss',
L: 'DD/MM/YYYY',
LL: 'D MMMM YYYY',
LLL: 'D MMMM YYYY HH:mm',
LLLL: 'dddd، D MMMM YYYY HH:mm'
},
meridiemParse: /صبح|شام/,
isPM: function (input) {
return 'شام' === input;
},
meridiem: function (hour, minute, isLower) {
if (hour < 12) {
return 'صبح';
}
return 'شام';
},
calendar: {
sameDay: '[اڄ] LT',
nextDay: '[سڀاڻي] LT',
nextWeek: 'dddd [اڳين هفتي تي] LT',
lastDay: '[ڪالهه] LT',
lastWeek: '[گزريل هفتي] dddd [تي] LT',
sameElse: 'L'
},
relativeTime: {
future: '%s پوء',
past: '%s اڳ',
s: 'چند سيڪنڊ',
ss: '%d سيڪنڊ',
m: 'هڪ منٽ',
mm: '%d منٽ',
h: 'هڪ ڪلاڪ',
hh: '%d ڪلاڪ',
d: 'هڪ ڏينهن',
dd: '%d ڏينهن',
M: 'هڪ مهينو',
MM: '%d مهينا',
y: 'هڪ سال',
yy: '%d سال'
},
preparse: function (string) {
return string.replace(/،/g, ',');
},
postformat: function (string) {
return string.replace(/,/g, '،');
},
week: {
dow: 1,
// Monday is the first day of the week.
doy: 4 // The week that contains Jan 4th is the first week of the year.
}
});
return sd;
});
/***/ }),
/***/ "./node_modules/moment/locale/se.js":
/*!******************************************!*\
!*** ./node_modules/moment/locale/se.js ***!
\******************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
;
(function (global, factory) {
true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : undefined;
})(this, function (moment) {
'use strict';
var se = moment.defineLocale('se', {
months: 'ođđajagemánnu_guovvamánnu_njukčamánnu_cuoŋománnu_miessemánnu_geassemánnu_suoidnemánnu_borgemánnu_čakčamánnu_golggotmánnu_skábmamánnu_juovlamánnu'.split('_'),
monthsShort: 'ođđj_guov_njuk_cuo_mies_geas_suoi_borg_čakč_golg_skáb_juov'.split('_'),
weekdays: 'sotnabeaivi_vuossárga_maŋŋebárga_gaskavahkku_duorastat_bearjadat_lávvardat'.split('_'),
weekdaysShort: 'sotn_vuos_maŋ_gask_duor_bear_láv'.split('_'),
weekdaysMin: 's_v_m_g_d_b_L'.split('_'),
longDateFormat: {
LT: 'HH:mm',
LTS: 'HH:mm:ss',
L: 'DD.MM.YYYY',
LL: 'MMMM D. [b.] YYYY',
LLL: 'MMMM D. [b.] YYYY [ti.] HH:mm',
LLLL: 'dddd, MMMM D. [b.] YYYY [ti.] HH:mm'
},
calendar: {
sameDay: '[otne ti] LT',
nextDay: '[ihttin ti] LT',
nextWeek: 'dddd [ti] LT',
lastDay: '[ikte ti] LT',
lastWeek: '[ovddit] dddd [ti] LT',
sameElse: 'L'
},
relativeTime: {
future: '%s geažes',
past: 'maŋit %s',
s: 'moadde sekunddat',
ss: '%d sekunddat',
m: 'okta minuhta',
mm: '%d minuhtat',
h: 'okta diimmu',
hh: '%d diimmut',
d: 'okta beaivi',
dd: '%d beaivvit',
M: 'okta mánnu',
MM: '%d mánut',
y: 'okta jahki',
yy: '%d jagit'
},
dayOfMonthOrdinalParse: /\d{1,2}\./,
ordinal: '%d.',
week: {
dow: 1,
// Monday is the first day of the week.
doy: 4 // The week that contains Jan 4th is the first week of the year.
}
});
return se;
});
/***/ }),
/***/ "./node_modules/moment/locale/si.js":
/*!******************************************!*\
!*** ./node_modules/moment/locale/si.js ***!
\******************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
;
(function (global, factory) {
true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : undefined;
})(this, function (moment) {
'use strict';
/*jshint -W100*/
var si = moment.defineLocale('si', {
months: 'ජනවාරි_පෙබරවාරි_මාර්තු_අප්රේල්_මැයි_ජූනි_ජූලි_අගෝස්තු_සැප්තැම්බර්_ඔක්තෝබර්_නොවැම්බර්_දෙසැම්බර්'.split('_'),
monthsShort: 'ජන_පෙබ_මාර්_අප්_මැයි_ජූනි_ජූලි_අගෝ_සැප්_ඔක්_නොවැ_දෙසැ'.split('_'),
weekdays: 'ඉරිදා_සඳුදා_අඟහරුවාදා_බදාදා_බ්රහස්පතින්දා_සිකුරාදා_සෙනසුරාදා'.split('_'),
weekdaysShort: 'ඉරි_සඳු_අඟ_බදා_බ්රහ_සිකු_සෙන'.split('_'),
weekdaysMin: 'ඉ_ස_අ_බ_බ්ර_සි_සෙ'.split('_'),
weekdaysParseExact: true,
longDateFormat: {
LT: 'a h:mm',
LTS: 'a h:mm:ss',
L: 'YYYY/MM/DD',
LL: 'YYYY MMMM D',
LLL: 'YYYY MMMM D, a h:mm',
LLLL: 'YYYY MMMM D [වැනි] dddd, a h:mm:ss'
},
calendar: {
sameDay: '[අද] LT[ට]',
nextDay: '[හෙට] LT[ට]',
nextWeek: 'dddd LT[ට]',
lastDay: '[ඊයේ] LT[ට]',
lastWeek: '[පසුගිය] dddd LT[ට]',
sameElse: 'L'
},
relativeTime: {
future: '%sකින්',
past: '%sකට පෙර',
s: 'තත්පර කිහිපය',
ss: 'තත්පර %d',
m: 'මිනිත්තුව',
mm: 'මිනිත්තු %d',
h: 'පැය',
hh: 'පැය %d',
d: 'දිනය',
dd: 'දින %d',
M: 'මාසය',
MM: 'මාස %d',
y: 'වසර',
yy: 'වසර %d'
},
dayOfMonthOrdinalParse: /\d{1,2} වැනි/,
ordinal: function (number) {
return number + ' වැනි';
},
meridiemParse: /පෙර වරු|පස් වරු|පෙ.ව|ප.ව./,
isPM: function (input) {
return input === 'ප.ව.' || input === 'පස් වරු';
},
meridiem: function (hours, minutes, isLower) {
if (hours > 11) {
return isLower ? 'ප.ව.' : 'පස් වරු';
} else {
return isLower ? 'පෙ.ව.' : 'පෙර වරු';
}
}
});
return si;
});
/***/ }),
/***/ "./node_modules/moment/locale/sk.js":
/*!******************************************!*\
!*** ./node_modules/moment/locale/sk.js ***!
\******************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
;
(function (global, factory) {
true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : undefined;
})(this, function (moment) {
'use strict';
var months = 'január_február_marec_apríl_máj_jún_júl_august_september_október_november_december'.split('_'),
monthsShort = 'jan_feb_mar_apr_máj_jún_júl_aug_sep_okt_nov_dec'.split('_');
function plural(n) {
return n > 1 && n < 5;
}
function translate(number, withoutSuffix, key, isFuture) {
var result = number + ' ';
switch (key) {
case 's':
// a few seconds / in a few seconds / a few seconds ago
return withoutSuffix || isFuture ? 'pár sekúnd' : 'pár sekundami';
case 'ss':
// 9 seconds / in 9 seconds / 9 seconds ago
if (withoutSuffix || isFuture) {
return result + (plural(number) ? 'sekundy' : 'sekúnd');
} else {
return result + 'sekundami';
}
break;
case 'm':
// a minute / in a minute / a minute ago
return withoutSuffix ? 'minúta' : isFuture ? 'minútu' : 'minútou';
case 'mm':
// 9 minutes / in 9 minutes / 9 minutes ago
if (withoutSuffix || isFuture) {
return result + (plural(number) ? 'minúty' : 'minút');
} else {
return result + 'minútami';
}
break;
case 'h':
// an hour / in an hour / an hour ago
return withoutSuffix ? 'hodina' : isFuture ? 'hodinu' : 'hodinou';
case 'hh':
// 9 hours / in 9 hours / 9 hours ago
if (withoutSuffix || isFuture) {
return result + (plural(number) ? 'hodiny' : 'hodín');
} else {
return result + 'hodinami';
}
break;
case 'd':
// a day / in a day / a day ago
return withoutSuffix || isFuture ? 'deň' : 'dňom';
case 'dd':
// 9 days / in 9 days / 9 days ago
if (withoutSuffix || isFuture) {
return result + (plural(number) ? 'dni' : 'dní');
} else {
return result + 'dňami';
}
break;
case 'M':
// a month / in a month / a month ago
return withoutSuffix || isFuture ? 'mesiac' : 'mesiacom';
case 'MM':
// 9 months / in 9 months / 9 months ago
if (withoutSuffix || isFuture) {
return result + (plural(number) ? 'mesiace' : 'mesiacov');
} else {
return result + 'mesiacmi';
}
break;
case 'y':
// a year / in a year / a year ago
return withoutSuffix || isFuture ? 'rok' : 'rokom';
case 'yy':
// 9 years / in 9 years / 9 years ago
if (withoutSuffix || isFuture) {
return result + (plural(number) ? 'roky' : 'rokov');
} else {
return result + 'rokmi';
}
break;
}
}
var sk = moment.defineLocale('sk', {
months: months,
monthsShort: monthsShort,
weekdays: 'nedeľa_pondelok_utorok_streda_štvrtok_piatok_sobota'.split('_'),
weekdaysShort: 'ne_po_ut_st_št_pi_so'.split('_'),
weekdaysMin: 'ne_po_ut_st_št_pi_so'.split('_'),
longDateFormat: {
LT: 'H:mm',
LTS: 'H:mm:ss',
L: 'DD.MM.YYYY',
LL: 'D. MMMM YYYY',
LLL: 'D. MMMM YYYY H:mm',
LLLL: 'dddd D. MMMM YYYY H:mm'
},
calendar: {
sameDay: '[dnes o] LT',
nextDay: '[zajtra o] LT',
nextWeek: function () {
switch (this.day()) {
case 0:
return '[v nedeľu o] LT';
case 1:
case 2:
return '[v] dddd [o] LT';
case 3:
return '[v stredu o] LT';
case 4:
return '[vo štvrtok o] LT';
case 5:
return '[v piatok o] LT';
case 6:
return '[v sobotu o] LT';
}
},
lastDay: '[včera o] LT',
lastWeek: function () {
switch (this.day()) {
case 0:
return '[minulú nedeľu o] LT';
case 1:
case 2:
return '[minulý] dddd [o] LT';
case 3:
return '[minulú stredu o] LT';
case 4:
case 5:
return '[minulý] dddd [o] LT';
case 6:
return '[minulú sobotu o] LT';
}
},
sameElse: 'L'
},
relativeTime: {
future: 'za %s',
past: 'pred %s',
s: translate,
ss: translate,
m: translate,
mm: translate,
h: translate,
hh: translate,
d: translate,
dd: translate,
M: translate,
MM: translate,
y: translate,
yy: translate
},
dayOfMonthOrdinalParse: /\d{1,2}\./,
ordinal: '%d.',
week: {
dow: 1,
// Monday is the first day of the week.
doy: 4 // The week that contains Jan 4th is the first week of the year.
}
});
return sk;
});
/***/ }),
/***/ "./node_modules/moment/locale/sl.js":
/*!******************************************!*\
!*** ./node_modules/moment/locale/sl.js ***!
\******************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
;
(function (global, factory) {
true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : undefined;
})(this, function (moment) {
'use strict';
function processRelativeTime(number, withoutSuffix, key, isFuture) {
var result = number + ' ';
switch (key) {
case 's':
return withoutSuffix || isFuture ? 'nekaj sekund' : 'nekaj sekundami';
case 'ss':
if (number === 1) {
result += withoutSuffix ? 'sekundo' : 'sekundi';
} else if (number === 2) {
result += withoutSuffix || isFuture ? 'sekundi' : 'sekundah';
} else if (number < 5) {
result += withoutSuffix || isFuture ? 'sekunde' : 'sekundah';
} else {
result += 'sekund';
}
return result;
case 'm':
return withoutSuffix ? 'ena minuta' : 'eno minuto';
case 'mm':
if (number === 1) {
result += withoutSuffix ? 'minuta' : 'minuto';
} else if (number === 2) {
result += withoutSuffix || isFuture ? 'minuti' : 'minutama';
} else if (number < 5) {
result += withoutSuffix || isFuture ? 'minute' : 'minutami';
} else {
result += withoutSuffix || isFuture ? 'minut' : 'minutami';
}
return result;
case 'h':
return withoutSuffix ? 'ena ura' : 'eno uro';
case 'hh':
if (number === 1) {
result += withoutSuffix ? 'ura' : 'uro';
} else if (number === 2) {
result += withoutSuffix || isFuture ? 'uri' : 'urama';
} else if (number < 5) {
result += withoutSuffix || isFuture ? 'ure' : 'urami';
} else {
result += withoutSuffix || isFuture ? 'ur' : 'urami';
}
return result;
case 'd':
return withoutSuffix || isFuture ? 'en dan' : 'enim dnem';
case 'dd':
if (number === 1) {
result += withoutSuffix || isFuture ? 'dan' : 'dnem';
} else if (number === 2) {
result += withoutSuffix || isFuture ? 'dni' : 'dnevoma';
} else {
result += withoutSuffix || isFuture ? 'dni' : 'dnevi';
}
return result;
case 'M':
return withoutSuffix || isFuture ? 'en mesec' : 'enim mesecem';
case 'MM':
if (number === 1) {
result += withoutSuffix || isFuture ? 'mesec' : 'mesecem';
} else if (number === 2) {
result += withoutSuffix || isFuture ? 'meseca' : 'mesecema';
} else if (number < 5) {
result += withoutSuffix || isFuture ? 'mesece' : 'meseci';
} else {
result += withoutSuffix || isFuture ? 'mesecev' : 'meseci';
}
return result;
case 'y':
return withoutSuffix || isFuture ? 'eno leto' : 'enim letom';
case 'yy':
if (number === 1) {
result += withoutSuffix || isFuture ? 'leto' : 'letom';
} else if (number === 2) {
result += withoutSuffix || isFuture ? 'leti' : 'letoma';
} else if (number < 5) {
result += withoutSuffix || isFuture ? 'leta' : 'leti';
} else {
result += withoutSuffix || isFuture ? 'let' : 'leti';
}
return result;
}
}
var sl = moment.defineLocale('sl', {
months: 'januar_februar_marec_april_maj_junij_julij_avgust_september_oktober_november_december'.split('_'),
monthsShort: 'jan._feb._mar._apr._maj._jun._jul._avg._sep._okt._nov._dec.'.split('_'),
monthsParseExact: true,
weekdays: 'nedelja_ponedeljek_torek_sreda_četrtek_petek_sobota'.split('_'),
weekdaysShort: 'ned._pon._tor._sre._čet._pet._sob.'.split('_'),
weekdaysMin: 'ne_po_to_sr_če_pe_so'.split('_'),
weekdaysParseExact: true,
longDateFormat: {
LT: 'H:mm',
LTS: 'H:mm:ss',
L: 'DD.MM.YYYY',
LL: 'D. MMMM YYYY',
LLL: 'D. MMMM YYYY H:mm',
LLLL: 'dddd, D. MMMM YYYY H:mm'
},
calendar: {
sameDay: '[danes ob] LT',
nextDay: '[jutri ob] LT',
nextWeek: function () {
switch (this.day()) {
case 0:
return '[v] [nedeljo] [ob] LT';
case 3:
return '[v] [sredo] [ob] LT';
case 6:
return '[v] [soboto] [ob] LT';
case 1:
case 2:
case 4:
case 5:
return '[v] dddd [ob] LT';
}
},
lastDay: '[včeraj ob] LT',
lastWeek: function () {
switch (this.day()) {
case 0:
return '[prejšnjo] [nedeljo] [ob] LT';
case 3:
return '[prejšnjo] [sredo] [ob] LT';
case 6:
return '[prejšnjo] [soboto] [ob] LT';
case 1:
case 2:
case 4:
case 5:
return '[prejšnji] dddd [ob] LT';
}
},
sameElse: 'L'
},
relativeTime: {
future: 'čez %s',
past: 'pred %s',
s: processRelativeTime,
ss: processRelativeTime,
m: processRelativeTime,
mm: processRelativeTime,
h: processRelativeTime,
hh: processRelativeTime,
d: processRelativeTime,
dd: processRelativeTime,
M: processRelativeTime,
MM: processRelativeTime,
y: processRelativeTime,
yy: processRelativeTime
},
dayOfMonthOrdinalParse: /\d{1,2}\./,
ordinal: '%d.',
week: {
dow: 1,
// Monday is the first day of the week.
doy: 7 // The week that contains Jan 7th is the first week of the year.
}
});
return sl;
});
/***/ }),
/***/ "./node_modules/moment/locale/sq.js":
/*!******************************************!*\
!*** ./node_modules/moment/locale/sq.js ***!
\******************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
;
(function (global, factory) {
true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : undefined;
})(this, function (moment) {
'use strict';
var sq = moment.defineLocale('sq', {
months: 'Janar_Shkurt_Mars_Prill_Maj_Qershor_Korrik_Gusht_Shtator_Tetor_Nëntor_Dhjetor'.split('_'),
monthsShort: 'Jan_Shk_Mar_Pri_Maj_Qer_Kor_Gus_Sht_Tet_Nën_Dhj'.split('_'),
weekdays: 'E Diel_E Hënë_E Martë_E Mërkurë_E Enjte_E Premte_E Shtunë'.split('_'),
weekdaysShort: 'Die_Hën_Mar_Mër_Enj_Pre_Sht'.split('_'),
weekdaysMin: 'D_H_Ma_Më_E_P_Sh'.split('_'),
weekdaysParseExact: true,
meridiemParse: /PD|MD/,
isPM: function (input) {
return input.charAt(0) === 'M';
},
meridiem: function (hours, minutes, isLower) {
return hours < 12 ? 'PD' : 'MD';
},
longDateFormat: {
LT: 'HH:mm',
LTS: 'HH:mm:ss',
L: 'DD/MM/YYYY',
LL: 'D MMMM YYYY',
LLL: 'D MMMM YYYY HH:mm',
LLLL: 'dddd, D MMMM YYYY HH:mm'
},
calendar: {
sameDay: '[Sot në] LT',
nextDay: '[Nesër në] LT',
nextWeek: 'dddd [në] LT',
lastDay: '[Dje në] LT',
lastWeek: 'dddd [e kaluar në] LT',
sameElse: 'L'
},
relativeTime: {
future: 'në %s',
past: '%s më parë',
s: 'disa sekonda',
ss: '%d sekonda',
m: 'një minutë',
mm: '%d minuta',
h: 'një orë',
hh: '%d orë',
d: 'një ditë',
dd: '%d ditë',
M: 'një muaj',
MM: '%d muaj',
y: 'një vit',
yy: '%d vite'
},
dayOfMonthOrdinalParse: /\d{1,2}\./,
ordinal: '%d.',
week: {
dow: 1,
// Monday is the first day of the week.
doy: 4 // The week that contains Jan 4th is the first week of the year.
}
});
return sq;
});
/***/ }),
/***/ "./node_modules/moment/locale/sr-cyrl.js":
/*!***********************************************!*\
!*** ./node_modules/moment/locale/sr-cyrl.js ***!
\***********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
;
(function (global, factory) {
true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : undefined;
})(this, function (moment) {
'use strict';
var translator = {
words: {
//Different grammatical cases
ss: ['секунда', 'секунде', 'секунди'],
m: ['један минут', 'једне минуте'],
mm: ['минут', 'минуте', 'минута'],
h: ['један сат', 'једног сата'],
hh: ['сат', 'сата', 'сати'],
dd: ['дан', 'дана', 'дана'],
MM: ['месец', 'месеца', 'месеци'],
yy: ['година', 'године', 'година']
},
correctGrammaticalCase: function (number, wordKey) {
return number === 1 ? wordKey[0] : number >= 2 && number <= 4 ? wordKey[1] : wordKey[2];
},
translate: function (number, withoutSuffix, key) {
var wordKey = translator.words[key];
if (key.length === 1) {
return withoutSuffix ? wordKey[0] : wordKey[1];
} else {
return number + ' ' + translator.correctGrammaticalCase(number, wordKey);
}
}
};
var srCyrl = moment.defineLocale('sr-cyrl', {
months: 'јануар_фебруар_март_април_мај_јун_јул_август_септембар_октобар_новембар_децембар'.split('_'),
monthsShort: 'јан._феб._мар._апр._мај_јун_јул_авг._сеп._окт._нов._дец.'.split('_'),
monthsParseExact: true,
weekdays: 'недеља_понедељак_уторак_среда_четвртак_петак_субота'.split('_'),
weekdaysShort: 'нед._пон._уто._сре._чет._пет._суб.'.split('_'),
weekdaysMin: 'не_по_ут_ср_че_пе_су'.split('_'),
weekdaysParseExact: true,
longDateFormat: {
LT: 'H:mm',
LTS: 'H:mm:ss',
L: 'DD.MM.YYYY',
LL: 'D. MMMM YYYY',
LLL: 'D. MMMM YYYY H:mm',
LLLL: 'dddd, D. MMMM YYYY H:mm'
},
calendar: {
sameDay: '[данас у] LT',
nextDay: '[сутра у] LT',
nextWeek: function () {
switch (this.day()) {
case 0:
return '[у] [недељу] [у] LT';
case 3:
return '[у] [среду] [у] LT';
case 6:
return '[у] [суботу] [у] LT';
case 1:
case 2:
case 4:
case 5:
return '[у] dddd [у] LT';
}
},
lastDay: '[јуче у] LT',
lastWeek: function () {
var lastWeekDays = ['[прошле] [недеље] [у] LT', '[прошлог] [понедељка] [у] LT', '[прошлог] [уторка] [у] LT', '[прошле] [среде] [у] LT', '[прошлог] [четвртка] [у] LT', '[прошлог] [петка] [у] LT', '[прошле] [суботе] [у] LT'];
return lastWeekDays[this.day()];
},
sameElse: 'L'
},
relativeTime: {
future: 'за %s',
past: 'пре %s',
s: 'неколико секунди',
ss: translator.translate,
m: translator.translate,
mm: translator.translate,
h: translator.translate,
hh: translator.translate,
d: 'дан',
dd: translator.translate,
M: 'месец',
MM: translator.translate,
y: 'годину',
yy: translator.translate
},
dayOfMonthOrdinalParse: /\d{1,2}\./,
ordinal: '%d.',
week: {
dow: 1,
// Monday is the first day of the week.
doy: 7 // The week that contains Jan 7th is the first week of the year.
}
});
return srCyrl;
});
/***/ }),
/***/ "./node_modules/moment/locale/sr.js":
/*!******************************************!*\
!*** ./node_modules/moment/locale/sr.js ***!
\******************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
;
(function (global, factory) {
true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : undefined;
})(this, function (moment) {
'use strict';
var translator = {
words: {
//Different grammatical cases
ss: ['sekunda', 'sekunde', 'sekundi'],
m: ['jedan minut', 'jedne minute'],
mm: ['minut', 'minute', 'minuta'],
h: ['jedan sat', 'jednog sata'],
hh: ['sat', 'sata', 'sati'],
dd: ['dan', 'dana', 'dana'],
MM: ['mesec', 'meseca', 'meseci'],
yy: ['godina', 'godine', 'godina']
},
correctGrammaticalCase: function (number, wordKey) {
return number === 1 ? wordKey[0] : number >= 2 && number <= 4 ? wordKey[1] : wordKey[2];
},
translate: function (number, withoutSuffix, key) {
var wordKey = translator.words[key];
if (key.length === 1) {
return withoutSuffix ? wordKey[0] : wordKey[1];
} else {
return number + ' ' + translator.correctGrammaticalCase(number, wordKey);
}
}
};
var sr = moment.defineLocale('sr', {
months: 'januar_februar_mart_april_maj_jun_jul_avgust_septembar_oktobar_novembar_decembar'.split('_'),
monthsShort: 'jan._feb._mar._apr._maj_jun_jul_avg._sep._okt._nov._dec.'.split('_'),
monthsParseExact: true,
weekdays: 'nedelja_ponedeljak_utorak_sreda_četvrtak_petak_subota'.split('_'),
weekdaysShort: 'ned._pon._uto._sre._čet._pet._sub.'.split('_'),
weekdaysMin: 'ne_po_ut_sr_če_pe_su'.split('_'),
weekdaysParseExact: true,
longDateFormat: {
LT: 'H:mm',
LTS: 'H:mm:ss',
L: 'DD.MM.YYYY',
LL: 'D. MMMM YYYY',
LLL: 'D. MMMM YYYY H:mm',
LLLL: 'dddd, D. MMMM YYYY H:mm'
},
calendar: {
sameDay: '[danas u] LT',
nextDay: '[sutra u] LT',
nextWeek: function () {
switch (this.day()) {
case 0:
return '[u] [nedelju] [u] LT';
case 3:
return '[u] [sredu] [u] LT';
case 6:
return '[u] [subotu] [u] LT';
case 1:
case 2:
case 4:
case 5:
return '[u] dddd [u] LT';
}
},
lastDay: '[juče u] LT',
lastWeek: function () {
var lastWeekDays = ['[prošle] [nedelje] [u] LT', '[prošlog] [ponedeljka] [u] LT', '[prošlog] [utorka] [u] LT', '[prošle] [srede] [u] LT', '[prošlog] [četvrtka] [u] LT', '[prošlog] [petka] [u] LT', '[prošle] [subote] [u] LT'];
return lastWeekDays[this.day()];
},
sameElse: 'L'
},
relativeTime: {
future: 'za %s',
past: 'pre %s',
s: 'nekoliko sekundi',
ss: translator.translate,
m: translator.translate,
mm: translator.translate,
h: translator.translate,
hh: translator.translate,
d: 'dan',
dd: translator.translate,
M: 'mesec',
MM: translator.translate,
y: 'godinu',
yy: translator.translate
},
dayOfMonthOrdinalParse: /\d{1,2}\./,
ordinal: '%d.',
week: {
dow: 1,
// Monday is the first day of the week.
doy: 7 // The week that contains Jan 7th is the first week of the year.
}
});
return sr;
});
/***/ }),
/***/ "./node_modules/moment/locale/ss.js":
/*!******************************************!*\
!*** ./node_modules/moment/locale/ss.js ***!
\******************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
;
(function (global, factory) {
true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : undefined;
})(this, function (moment) {
'use strict';
var ss = moment.defineLocale('ss', {
months: "Bhimbidvwane_Indlovana_Indlov'lenkhulu_Mabasa_Inkhwekhweti_Inhlaba_Kholwane_Ingci_Inyoni_Imphala_Lweti_Ingongoni".split('_'),
monthsShort: 'Bhi_Ina_Inu_Mab_Ink_Inh_Kho_Igc_Iny_Imp_Lwe_Igo'.split('_'),
weekdays: 'Lisontfo_Umsombuluko_Lesibili_Lesitsatfu_Lesine_Lesihlanu_Umgcibelo'.split('_'),
weekdaysShort: 'Lis_Umb_Lsb_Les_Lsi_Lsh_Umg'.split('_'),
weekdaysMin: 'Li_Us_Lb_Lt_Ls_Lh_Ug'.split('_'),
weekdaysParseExact: true,
longDateFormat: {
LT: 'h:mm A',
LTS: 'h:mm:ss A',
L: 'DD/MM/YYYY',
LL: 'D MMMM YYYY',
LLL: 'D MMMM YYYY h:mm A',
LLLL: 'dddd, D MMMM YYYY h:mm A'
},
calendar: {
sameDay: '[Namuhla nga] LT',
nextDay: '[Kusasa nga] LT',
nextWeek: 'dddd [nga] LT',
lastDay: '[Itolo nga] LT',
lastWeek: 'dddd [leliphelile] [nga] LT',
sameElse: 'L'
},
relativeTime: {
future: 'nga %s',
past: 'wenteka nga %s',
s: 'emizuzwana lomcane',
ss: '%d mzuzwana',
m: 'umzuzu',
mm: '%d emizuzu',
h: 'lihora',
hh: '%d emahora',
d: 'lilanga',
dd: '%d emalanga',
M: 'inyanga',
MM: '%d tinyanga',
y: 'umnyaka',
yy: '%d iminyaka'
},
meridiemParse: /ekuseni|emini|entsambama|ebusuku/,
meridiem: function (hours, minutes, isLower) {
if (hours < 11) {
return 'ekuseni';
} else if (hours < 15) {
return 'emini';
} else if (hours < 19) {
return 'entsambama';
} else {
return 'ebusuku';
}
},
meridiemHour: function (hour, meridiem) {
if (hour === 12) {
hour = 0;
}
if (meridiem === 'ekuseni') {
return hour;
} else if (meridiem === 'emini') {
return hour >= 11 ? hour : hour + 12;
} else if (meridiem === 'entsambama' || meridiem === 'ebusuku') {
if (hour === 0) {
return 0;
}
return hour + 12;
}
},
dayOfMonthOrdinalParse: /\d{1,2}/,
ordinal: '%d',
week: {
dow: 1,
// Monday is the first day of the week.
doy: 4 // The week that contains Jan 4th is the first week of the year.
}
});
return ss;
});
/***/ }),
/***/ "./node_modules/moment/locale/sv.js":
/*!******************************************!*\
!*** ./node_modules/moment/locale/sv.js ***!
\******************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
;
(function (global, factory) {
true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : undefined;
})(this, function (moment) {
'use strict';
var sv = moment.defineLocale('sv', {
months: 'januari_februari_mars_april_maj_juni_juli_augusti_september_oktober_november_december'.split('_'),
monthsShort: 'jan_feb_mar_apr_maj_jun_jul_aug_sep_okt_nov_dec'.split('_'),
weekdays: 'söndag_måndag_tisdag_onsdag_torsdag_fredag_lördag'.split('_'),
weekdaysShort: 'sön_mån_tis_ons_tor_fre_lör'.split('_'),
weekdaysMin: 'sö_må_ti_on_to_fr_lö'.split('_'),
longDateFormat: {
LT: 'HH:mm',
LTS: 'HH:mm:ss',
L: 'YYYY-MM-DD',
LL: 'D MMMM YYYY',
LLL: 'D MMMM YYYY [kl.] HH:mm',
LLLL: 'dddd D MMMM YYYY [kl.] HH:mm',
lll: 'D MMM YYYY HH:mm',
llll: 'ddd D MMM YYYY HH:mm'
},
calendar: {
sameDay: '[Idag] LT',
nextDay: '[Imorgon] LT',
lastDay: '[Igår] LT',
nextWeek: '[På] dddd LT',
lastWeek: '[I] dddd[s] LT',
sameElse: 'L'
},
relativeTime: {
future: 'om %s',
past: 'för %s sedan',
s: 'några sekunder',
ss: '%d sekunder',
m: 'en minut',
mm: '%d minuter',
h: 'en timme',
hh: '%d timmar',
d: 'en dag',
dd: '%d dagar',
M: 'en månad',
MM: '%d månader',
y: 'ett år',
yy: '%d år'
},
dayOfMonthOrdinalParse: /\d{1,2}(e|a)/,
ordinal: function (number) {
var b = number % 10,
output = ~~(number % 100 / 10) === 1 ? 'e' : b === 1 ? 'a' : b === 2 ? 'a' : b === 3 ? 'e' : 'e';
return number + output;
},
week: {
dow: 1,
// Monday is the first day of the week.
doy: 4 // The week that contains Jan 4th is the first week of the year.
}
});
return sv;
});
/***/ }),
/***/ "./node_modules/moment/locale/sw.js":
/*!******************************************!*\
!*** ./node_modules/moment/locale/sw.js ***!
\******************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
;
(function (global, factory) {
true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : undefined;
})(this, function (moment) {
'use strict';
var sw = moment.defineLocale('sw', {
months: 'Januari_Februari_Machi_Aprili_Mei_Juni_Julai_Agosti_Septemba_Oktoba_Novemba_Desemba'.split('_'),
monthsShort: 'Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ago_Sep_Okt_Nov_Des'.split('_'),
weekdays: 'Jumapili_Jumatatu_Jumanne_Jumatano_Alhamisi_Ijumaa_Jumamosi'.split('_'),
weekdaysShort: 'Jpl_Jtat_Jnne_Jtan_Alh_Ijm_Jmos'.split('_'),
weekdaysMin: 'J2_J3_J4_J5_Al_Ij_J1'.split('_'),
weekdaysParseExact: true,
longDateFormat: {
LT: 'HH:mm',
LTS: 'HH:mm:ss',
L: 'DD.MM.YYYY',
LL: 'D MMMM YYYY',
LLL: 'D MMMM YYYY HH:mm',
LLLL: 'dddd, D MMMM YYYY HH:mm'
},
calendar: {
sameDay: '[leo saa] LT',
nextDay: '[kesho saa] LT',
nextWeek: '[wiki ijayo] dddd [saat] LT',
lastDay: '[jana] LT',
lastWeek: '[wiki iliyopita] dddd [saat] LT',
sameElse: 'L'
},
relativeTime: {
future: '%s baadaye',
past: 'tokea %s',
s: 'hivi punde',
ss: 'sekunde %d',
m: 'dakika moja',
mm: 'dakika %d',
h: 'saa limoja',
hh: 'masaa %d',
d: 'siku moja',
dd: 'masiku %d',
M: 'mwezi mmoja',
MM: 'miezi %d',
y: 'mwaka mmoja',
yy: 'miaka %d'
},
week: {
dow: 1,
// Monday is the first day of the week.
doy: 7 // The week that contains Jan 7th is the first week of the year.
}
});
return sw;
});
/***/ }),
/***/ "./node_modules/moment/locale/ta.js":
/*!******************************************!*\
!*** ./node_modules/moment/locale/ta.js ***!
\******************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
;
(function (global, factory) {
true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : undefined;
})(this, function (moment) {
'use strict';
var symbolMap = {
'1': '௧',
'2': '௨',
'3': '௩',
'4': '௪',
'5': '௫',
'6': '௬',
'7': '௭',
'8': '௮',
'9': '௯',
'0': '௦'
},
numberMap = {
'௧': '1',
'௨': '2',
'௩': '3',
'௪': '4',
'௫': '5',
'௬': '6',
'௭': '7',
'௮': '8',
'௯': '9',
'௦': '0'
};
var ta = moment.defineLocale('ta', {
months: 'ஜனவரி_பிப்ரவரி_மார்ச்_ஏப்ரல்_மே_ஜூன்_ஜூலை_ஆகஸ்ட்_செப்டெம்பர்_அக்டோபர்_நவம்பர்_டிசம்பர்'.split('_'),
monthsShort: 'ஜனவரி_பிப்ரவரி_மார்ச்_ஏப்ரல்_மே_ஜூன்_ஜூலை_ஆகஸ்ட்_செப்டெம்பர்_அக்டோபர்_நவம்பர்_டிசம்பர்'.split('_'),
weekdays: 'ஞாயிற்றுக்கிழமை_திங்கட்கிழமை_செவ்வாய்கிழமை_புதன்கிழமை_வியாழக்கிழமை_வெள்ளிக்கிழமை_சனிக்கிழமை'.split('_'),
weekdaysShort: 'ஞாயிறு_திங்கள்_செவ்வாய்_புதன்_வியாழன்_வெள்ளி_சனி'.split('_'),
weekdaysMin: 'ஞா_தி_செ_பு_வி_வெ_ச'.split('_'),
longDateFormat: {
LT: 'HH:mm',
LTS: 'HH:mm:ss',
L: 'DD/MM/YYYY',
LL: 'D MMMM YYYY',
LLL: 'D MMMM YYYY, HH:mm',
LLLL: 'dddd, D MMMM YYYY, HH:mm'
},
calendar: {
sameDay: '[இன்று] LT',
nextDay: '[நாளை] LT',
nextWeek: 'dddd, LT',
lastDay: '[நேற்று] LT',
lastWeek: '[கடந்த வாரம்] dddd, LT',
sameElse: 'L'
},
relativeTime: {
future: '%s இல்',
past: '%s முன்',
s: 'ஒரு சில விநாடிகள்',
ss: '%d விநாடிகள்',
m: 'ஒரு நிமிடம்',
mm: '%d நிமிடங்கள்',
h: 'ஒரு மணி நேரம்',
hh: '%d மணி நேரம்',
d: 'ஒரு நாள்',
dd: '%d நாட்கள்',
M: 'ஒரு மாதம்',
MM: '%d மாதங்கள்',
y: 'ஒரு வருடம்',
yy: '%d ஆண்டுகள்'
},
dayOfMonthOrdinalParse: /\d{1,2}வது/,
ordinal: function (number) {
return number + 'வது';
},
preparse: function (string) {
return string.replace(/[௧௨௩௪௫௬௭௮௯௦]/g, function (match) {
return numberMap[match];
});
},
postformat: function (string) {
return string.replace(/\d/g, function (match) {
return symbolMap[match];
});
},
// refer http://ta.wikipedia.org/s/1er1
meridiemParse: /யாமம்|வைகறை|காலை|நண்பகல்|எற்பாடு|மாலை/,
meridiem: function (hour, minute, isLower) {
if (hour < 2) {
return ' யாமம்';
} else if (hour < 6) {
return ' வைகறை'; // வைகறை
} else if (hour < 10) {
return ' காலை'; // காலை
} else if (hour < 14) {
return ' நண்பகல்'; // நண்பகல்
} else if (hour < 18) {
return ' எற்பாடு'; // எற்பாடு
} else if (hour < 22) {
return ' மாலை'; // மாலை
} else {
return ' யாமம்';
}
},
meridiemHour: function (hour, meridiem) {
if (hour === 12) {
hour = 0;
}
if (meridiem === 'யாமம்') {
return hour < 2 ? hour : hour + 12;
} else if (meridiem === 'வைகறை' || meridiem === 'காலை') {
return hour;
} else if (meridiem === 'நண்பகல்') {
return hour >= 10 ? hour : hour + 12;
} else {
return hour + 12;
}
},
week: {
dow: 0,
// Sunday is the first day of the week.
doy: 6 // The week that contains Jan 6th is the first week of the year.
}
});
return ta;
});
/***/ }),
/***/ "./node_modules/moment/locale/te.js":
/*!******************************************!*\
!*** ./node_modules/moment/locale/te.js ***!
\******************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
;
(function (global, factory) {
true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : undefined;
})(this, function (moment) {
'use strict';
var te = moment.defineLocale('te', {
months: 'జనవరి_ఫిబ్రవరి_మార్చి_ఏప్రిల్_మే_జూన్_జులై_ఆగస్టు_సెప్టెంబర్_అక్టోబర్_నవంబర్_డిసెంబర్'.split('_'),
monthsShort: 'జన._ఫిబ్ర._మార్చి_ఏప్రి._మే_జూన్_జులై_ఆగ._సెప్._అక్టో._నవ._డిసె.'.split('_'),
monthsParseExact: true,
weekdays: 'ఆదివారం_సోమవారం_మంగళవారం_బుధవారం_గురువారం_శుక్రవారం_శనివారం'.split('_'),
weekdaysShort: 'ఆది_సోమ_మంగళ_బుధ_గురు_శుక్ర_శని'.split('_'),
weekdaysMin: 'ఆ_సో_మం_బు_గు_శు_శ'.split('_'),
longDateFormat: {
LT: 'A h:mm',
LTS: 'A h:mm:ss',
L: 'DD/MM/YYYY',
LL: 'D MMMM YYYY',
LLL: 'D MMMM YYYY, A h:mm',
LLLL: 'dddd, D MMMM YYYY, A h:mm'
},
calendar: {
sameDay: '[నేడు] LT',
nextDay: '[రేపు] LT',
nextWeek: 'dddd, LT',
lastDay: '[నిన్న] LT',
lastWeek: '[గత] dddd, LT',
sameElse: 'L'
},
relativeTime: {
future: '%s లో',
past: '%s క్రితం',
s: 'కొన్ని క్షణాలు',
ss: '%d సెకన్లు',
m: 'ఒక నిమిషం',
mm: '%d నిమిషాలు',
h: 'ఒక గంట',
hh: '%d గంటలు',
d: 'ఒక రోజు',
dd: '%d రోజులు',
M: 'ఒక నెల',
MM: '%d నెలలు',
y: 'ఒక సంవత్సరం',
yy: '%d సంవత్సరాలు'
},
dayOfMonthOrdinalParse: /\d{1,2}వ/,
ordinal: '%dవ',
meridiemParse: /రాత్రి|ఉదయం|మధ్యాహ్నం|సాయంత్రం/,
meridiemHour: function (hour, meridiem) {
if (hour === 12) {
hour = 0;
}
if (meridiem === 'రాత్రి') {
return hour < 4 ? hour : hour + 12;
} else if (meridiem === 'ఉదయం') {
return hour;
} else if (meridiem === 'మధ్యాహ్నం') {
return hour >= 10 ? hour : hour + 12;
} else if (meridiem === 'సాయంత్రం') {
return hour + 12;
}
},
meridiem: function (hour, minute, isLower) {
if (hour < 4) {
return 'రాత్రి';
} else if (hour < 10) {
return 'ఉదయం';
} else if (hour < 17) {
return 'మధ్యాహ్నం';
} else if (hour < 20) {
return 'సాయంత్రం';
} else {
return 'రాత్రి';
}
},
week: {
dow: 0,
// Sunday is the first day of the week.
doy: 6 // The week that contains Jan 6th is the first week of the year.
}
});
return te;
});
/***/ }),
/***/ "./node_modules/moment/locale/tet.js":
/*!*******************************************!*\
!*** ./node_modules/moment/locale/tet.js ***!
\*******************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
;
(function (global, factory) {
true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : undefined;
})(this, function (moment) {
'use strict';
var tet = moment.defineLocale('tet', {
months: 'Janeiru_Fevereiru_Marsu_Abril_Maiu_Juñu_Jullu_Agustu_Setembru_Outubru_Novembru_Dezembru'.split('_'),
monthsShort: 'Jan_Fev_Mar_Abr_Mai_Jun_Jul_Ago_Set_Out_Nov_Dez'.split('_'),
weekdays: 'Domingu_Segunda_Tersa_Kuarta_Kinta_Sesta_Sabadu'.split('_'),
weekdaysShort: 'Dom_Seg_Ters_Kua_Kint_Sest_Sab'.split('_'),
weekdaysMin: 'Do_Seg_Te_Ku_Ki_Ses_Sa'.split('_'),
longDateFormat: {
LT: 'HH:mm',
LTS: 'HH:mm:ss',
L: 'DD/MM/YYYY',
LL: 'D MMMM YYYY',
LLL: 'D MMMM YYYY HH:mm',
LLLL: 'dddd, D MMMM YYYY HH:mm'
},
calendar: {
sameDay: '[Ohin iha] LT',
nextDay: '[Aban iha] LT',
nextWeek: 'dddd [iha] LT',
lastDay: '[Horiseik iha] LT',
lastWeek: 'dddd [semana kotuk] [iha] LT',
sameElse: 'L'
},
relativeTime: {
future: 'iha %s',
past: '%s liuba',
s: 'minutu balun',
ss: 'minutu %d',
m: 'minutu ida',
mm: 'minutu %d',
h: 'oras ida',
hh: 'oras %d',
d: 'loron ida',
dd: 'loron %d',
M: 'fulan ida',
MM: 'fulan %d',
y: 'tinan ida',
yy: 'tinan %d'
},
dayOfMonthOrdinalParse: /\d{1,2}(st|nd|rd|th)/,
ordinal: function (number) {
var b = number % 10,
output = ~~(number % 100 / 10) === 1 ? 'th' : b === 1 ? 'st' : b === 2 ? 'nd' : b === 3 ? 'rd' : 'th';
return number + output;
},
week: {
dow: 1,
// Monday is the first day of the week.
doy: 4 // The week that contains Jan 4th is the first week of the year.
}
});
return tet;
});
/***/ }),
/***/ "./node_modules/moment/locale/tg.js":
/*!******************************************!*\
!*** ./node_modules/moment/locale/tg.js ***!
\******************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
;
(function (global, factory) {
true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : undefined;
})(this, function (moment) {
'use strict';
var suffixes = {
0: '-ум',
1: '-ум',
2: '-юм',
3: '-юм',
4: '-ум',
5: '-ум',
6: '-ум',
7: '-ум',
8: '-ум',
9: '-ум',
10: '-ум',
12: '-ум',
13: '-ум',
20: '-ум',
30: '-юм',
40: '-ум',
50: '-ум',
60: '-ум',
70: '-ум',
80: '-ум',
90: '-ум',
100: '-ум'
};
var tg = moment.defineLocale('tg', {
months: 'январ_феврал_март_апрел_май_июн_июл_август_сентябр_октябр_ноябр_декабр'.split('_'),
monthsShort: 'янв_фев_мар_апр_май_июн_июл_авг_сен_окт_ноя_дек'.split('_'),
weekdays: 'якшанбе_душанбе_сешанбе_чоршанбе_панҷшанбе_ҷумъа_шанбе'.split('_'),
weekdaysShort: 'яшб_дшб_сшб_чшб_пшб_ҷум_шнб'.split('_'),
weekdaysMin: 'яш_дш_сш_чш_пш_ҷм_шб'.split('_'),
longDateFormat: {
LT: 'HH:mm',
LTS: 'HH:mm:ss',
L: 'DD/MM/YYYY',
LL: 'D MMMM YYYY',
LLL: 'D MMMM YYYY HH:mm',
LLLL: 'dddd, D MMMM YYYY HH:mm'
},
calendar: {
sameDay: '[Имрӯз соати] LT',
nextDay: '[Пагоҳ соати] LT',
lastDay: '[Дирӯз соати] LT',
nextWeek: 'dddd[и] [ҳафтаи оянда соати] LT',
lastWeek: 'dddd[и] [ҳафтаи гузашта соати] LT',
sameElse: 'L'
},
relativeTime: {
future: 'баъди %s',
past: '%s пеш',
s: 'якчанд сония',
m: 'як дақиқа',
mm: '%d дақиқа',
h: 'як соат',
hh: '%d соат',
d: 'як рӯз',
dd: '%d рӯз',
M: 'як моҳ',
MM: '%d моҳ',
y: 'як сол',
yy: '%d сол'
},
meridiemParse: /шаб|субҳ|рӯз|бегоҳ/,
meridiemHour: function (hour, meridiem) {
if (hour === 12) {
hour = 0;
}
if (meridiem === 'шаб') {
return hour < 4 ? hour : hour + 12;
} else if (meridiem === 'субҳ') {
return hour;
} else if (meridiem === 'рӯз') {
return hour >= 11 ? hour : hour + 12;
} else if (meridiem === 'бегоҳ') {
return hour + 12;
}
},
meridiem: function (hour, minute, isLower) {
if (hour < 4) {
return 'шаб';
} else if (hour < 11) {
return 'субҳ';
} else if (hour < 16) {
return 'рӯз';
} else if (hour < 19) {
return 'бегоҳ';
} else {
return 'шаб';
}
},
dayOfMonthOrdinalParse: /\d{1,2}-(ум|юм)/,
ordinal: function (number) {
var a = number % 10,
b = number >= 100 ? 100 : null;
return number + (suffixes[number] || suffixes[a] || suffixes[b]);
},
week: {
dow: 1,
// Monday is the first day of the week.
doy: 7 // The week that contains Jan 1th is the first week of the year.
}
});
return tg;
});
/***/ }),
/***/ "./node_modules/moment/locale/th.js":
/*!******************************************!*\
!*** ./node_modules/moment/locale/th.js ***!
\******************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
;
(function (global, factory) {
true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : undefined;
})(this, function (moment) {
'use strict';
var th = moment.defineLocale('th', {
months: 'มกราคม_กุมภาพันธ์_มีนาคม_เมษายน_พฤษภาคม_มิถุนายน_กรกฎาคม_สิงหาคม_กันยายน_ตุลาคม_พฤศจิกายน_ธันวาคม'.split('_'),
monthsShort: 'ม.ค._ก.พ._มี.ค._เม.ย._พ.ค._มิ.ย._ก.ค._ส.ค._ก.ย._ต.ค._พ.ย._ธ.ค.'.split('_'),
monthsParseExact: true,
weekdays: 'อาทิตย์_จันทร์_อังคาร_พุธ_พฤหัสบดี_ศุกร์_เสาร์'.split('_'),
weekdaysShort: 'อาทิตย์_จันทร์_อังคาร_พุธ_พฤหัส_ศุกร์_เสาร์'.split('_'),
// yes, three characters difference
weekdaysMin: 'อา._จ._อ._พ._พฤ._ศ._ส.'.split('_'),
weekdaysParseExact: true,
longDateFormat: {
LT: 'H:mm',
LTS: 'H:mm:ss',
L: 'DD/MM/YYYY',
LL: 'D MMMM YYYY',
LLL: 'D MMMM YYYY เวลา H:mm',
LLLL: 'วันddddที่ D MMMM YYYY เวลา H:mm'
},
meridiemParse: /ก่อนเที่ยง|หลังเที่ยง/,
isPM: function (input) {
return input === 'หลังเที่ยง';
},
meridiem: function (hour, minute, isLower) {
if (hour < 12) {
return 'ก่อนเที่ยง';
} else {
return 'หลังเที่ยง';
}
},
calendar: {
sameDay: '[วันนี้ เวลา] LT',
nextDay: '[พรุ่งนี้ เวลา] LT',
nextWeek: 'dddd[หน้า เวลา] LT',
lastDay: '[เมื่อวานนี้ เวลา] LT',
lastWeek: '[วัน]dddd[ที่แล้ว เวลา] LT',
sameElse: 'L'
},
relativeTime: {
future: 'อีก %s',
past: '%sที่แล้ว',
s: 'ไม่กี่วินาที',
ss: '%d วินาที',
m: '1 นาที',
mm: '%d นาที',
h: '1 ชั่วโมง',
hh: '%d ชั่วโมง',
d: '1 วัน',
dd: '%d วัน',
M: '1 เดือน',
MM: '%d เดือน',
y: '1 ปี',
yy: '%d ปี'
}
});
return th;
});
/***/ }),
/***/ "./node_modules/moment/locale/tl-ph.js":
/*!*********************************************!*\
!*** ./node_modules/moment/locale/tl-ph.js ***!
\*********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
;
(function (global, factory) {
true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : undefined;
})(this, function (moment) {
'use strict';
var tlPh = moment.defineLocale('tl-ph', {
months: 'Enero_Pebrero_Marso_Abril_Mayo_Hunyo_Hulyo_Agosto_Setyembre_Oktubre_Nobyembre_Disyembre'.split('_'),
monthsShort: 'Ene_Peb_Mar_Abr_May_Hun_Hul_Ago_Set_Okt_Nob_Dis'.split('_'),
weekdays: 'Linggo_Lunes_Martes_Miyerkules_Huwebes_Biyernes_Sabado'.split('_'),
weekdaysShort: 'Lin_Lun_Mar_Miy_Huw_Biy_Sab'.split('_'),
weekdaysMin: 'Li_Lu_Ma_Mi_Hu_Bi_Sab'.split('_'),
longDateFormat: {
LT: 'HH:mm',
LTS: 'HH:mm:ss',
L: 'MM/D/YYYY',
LL: 'MMMM D, YYYY',
LLL: 'MMMM D, YYYY HH:mm',
LLLL: 'dddd, MMMM DD, YYYY HH:mm'
},
calendar: {
sameDay: 'LT [ngayong araw]',
nextDay: '[Bukas ng] LT',
nextWeek: 'LT [sa susunod na] dddd',
lastDay: 'LT [kahapon]',
lastWeek: 'LT [noong nakaraang] dddd',
sameElse: 'L'
},
relativeTime: {
future: 'sa loob ng %s',
past: '%s ang nakalipas',
s: 'ilang segundo',
ss: '%d segundo',
m: 'isang minuto',
mm: '%d minuto',
h: 'isang oras',
hh: '%d oras',
d: 'isang araw',
dd: '%d araw',
M: 'isang buwan',
MM: '%d buwan',
y: 'isang taon',
yy: '%d taon'
},
dayOfMonthOrdinalParse: /\d{1,2}/,
ordinal: function (number) {
return number;
},
week: {
dow: 1,
// Monday is the first day of the week.
doy: 4 // The week that contains Jan 4th is the first week of the year.
}
});
return tlPh;
});
/***/ }),
/***/ "./node_modules/moment/locale/tlh.js":
/*!*******************************************!*\
!*** ./node_modules/moment/locale/tlh.js ***!
\*******************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
;
(function (global, factory) {
true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : undefined;
})(this, function (moment) {
'use strict';
var numbersNouns = 'pagh_wa’_cha’_wej_loS_vagh_jav_Soch_chorgh_Hut'.split('_');
function translateFuture(output) {
var time = output;
time = output.indexOf('jaj') !== -1 ? time.slice(0, -3) + 'leS' : output.indexOf('jar') !== -1 ? time.slice(0, -3) + 'waQ' : output.indexOf('DIS') !== -1 ? time.slice(0, -3) + 'nem' : time + ' pIq';
return time;
}
function translatePast(output) {
var time = output;
time = output.indexOf('jaj') !== -1 ? time.slice(0, -3) + 'Hu’' : output.indexOf('jar') !== -1 ? time.slice(0, -3) + 'wen' : output.indexOf('DIS') !== -1 ? time.slice(0, -3) + 'ben' : time + ' ret';
return time;
}
function translate(number, withoutSuffix, string, isFuture) {
var numberNoun = numberAsNoun(number);
switch (string) {
case 'ss':
return numberNoun + ' lup';
case 'mm':
return numberNoun + ' tup';
case 'hh':
return numberNoun + ' rep';
case 'dd':
return numberNoun + ' jaj';
case 'MM':
return numberNoun + ' jar';
case 'yy':
return numberNoun + ' DIS';
}
}
function numberAsNoun(number) {
var hundred = Math.floor(number % 1000 / 100),
ten = Math.floor(number % 100 / 10),
one = number % 10,
word = '';
if (hundred > 0) {
word += numbersNouns[hundred] + 'vatlh';
}
if (ten > 0) {
word += (word !== '' ? ' ' : '') + numbersNouns[ten] + 'maH';
}
if (one > 0) {
word += (word !== '' ? ' ' : '') + numbersNouns[one];
}
return word === '' ? 'pagh' : word;
}
var tlh = moment.defineLocale('tlh', {
months: 'tera’ jar wa’_tera’ jar cha’_tera’ jar wej_tera’ jar loS_tera’ jar vagh_tera’ jar jav_tera’ jar Soch_tera’ jar chorgh_tera’ jar Hut_tera’ jar wa’maH_tera’ jar wa’maH wa’_tera’ jar wa’maH cha’'.split('_'),
monthsShort: 'jar wa’_jar cha’_jar wej_jar loS_jar vagh_jar jav_jar Soch_jar chorgh_jar Hut_jar wa’maH_jar wa’maH wa’_jar wa’maH cha’'.split('_'),
monthsParseExact: true,
weekdays: 'lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj'.split('_'),
weekdaysShort: 'lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj'.split('_'),
weekdaysMin: 'lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj'.split('_'),
longDateFormat: {
LT: 'HH:mm',
LTS: 'HH:mm:ss',
L: 'DD.MM.YYYY',
LL: 'D MMMM YYYY',
LLL: 'D MMMM YYYY HH:mm',
LLLL: 'dddd, D MMMM YYYY HH:mm'
},
calendar: {
sameDay: '[DaHjaj] LT',
nextDay: '[wa’leS] LT',
nextWeek: 'LLL',
lastDay: '[wa’Hu’] LT',
lastWeek: 'LLL',
sameElse: 'L'
},
relativeTime: {
future: translateFuture,
past: translatePast,
s: 'puS lup',
ss: translate,
m: 'wa’ tup',
mm: translate,
h: 'wa’ rep',
hh: translate,
d: 'wa’ jaj',
dd: translate,
M: 'wa’ jar',
MM: translate,
y: 'wa’ DIS',
yy: translate
},
dayOfMonthOrdinalParse: /\d{1,2}\./,
ordinal: '%d.',
week: {
dow: 1,
// Monday is the first day of the week.
doy: 4 // The week that contains Jan 4th is the first week of the year.
}
});
return tlh;
});
/***/ }),
/***/ "./node_modules/moment/locale/tr.js":
/*!******************************************!*\
!*** ./node_modules/moment/locale/tr.js ***!
\******************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
;
(function (global, factory) {
true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : undefined;
})(this, function (moment) {
'use strict';
var suffixes = {
1: '\'inci',
5: '\'inci',
8: '\'inci',
70: '\'inci',
80: '\'inci',
2: '\'nci',
7: '\'nci',
20: '\'nci',
50: '\'nci',
3: '\'üncü',
4: '\'üncü',
100: '\'üncü',
6: '\'ncı',
9: '\'uncu',
10: '\'uncu',
30: '\'uncu',
60: '\'ıncı',
90: '\'ıncı'
};
var tr = moment.defineLocale('tr', {
months: 'Ocak_Şubat_Mart_Nisan_Mayıs_Haziran_Temmuz_Ağustos_Eylül_Ekim_Kasım_Aralık'.split('_'),
monthsShort: 'Oca_Şub_Mar_Nis_May_Haz_Tem_Ağu_Eyl_Eki_Kas_Ara'.split('_'),
weekdays: 'Pazar_Pazartesi_Salı_Çarşamba_Perşembe_Cuma_Cumartesi'.split('_'),
weekdaysShort: 'Paz_Pts_Sal_Çar_Per_Cum_Cts'.split('_'),
weekdaysMin: 'Pz_Pt_Sa_Ça_Pe_Cu_Ct'.split('_'),
longDateFormat: {
LT: 'HH:mm',
LTS: 'HH:mm:ss',
L: 'DD.MM.YYYY',
LL: 'D MMMM YYYY',
LLL: 'D MMMM YYYY HH:mm',
LLLL: 'dddd, D MMMM YYYY HH:mm'
},
calendar: {
sameDay: '[bugün saat] LT',
nextDay: '[yarın saat] LT',
nextWeek: '[gelecek] dddd [saat] LT',
lastDay: '[dün] LT',
lastWeek: '[geçen] dddd [saat] LT',
sameElse: 'L'
},
relativeTime: {
future: '%s sonra',
past: '%s önce',
s: 'birkaç saniye',
ss: '%d saniye',
m: 'bir dakika',
mm: '%d dakika',
h: 'bir saat',
hh: '%d saat',
d: 'bir gün',
dd: '%d gün',
M: 'bir ay',
MM: '%d ay',
y: 'bir yıl',
yy: '%d yıl'
},
ordinal: function (number, period) {
switch (period) {
case 'd':
case 'D':
case 'Do':
case 'DD':
return number;
default:
if (number === 0) {
// special case for zero
return number + '\'ıncı';
}
var a = number % 10,
b = number % 100 - a,
c = number >= 100 ? 100 : null;
return number + (suffixes[a] || suffixes[b] || suffixes[c]);
}
},
week: {
dow: 1,
// Monday is the first day of the week.
doy: 7 // The week that contains Jan 7th is the first week of the year.
}
});
return tr;
});
/***/ }),
/***/ "./node_modules/moment/locale/tzl.js":
/*!*******************************************!*\
!*** ./node_modules/moment/locale/tzl.js ***!
\*******************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
;
(function (global, factory) {
true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : undefined;
})(this, function (moment) {
'use strict'; // After the year there should be a slash and the amount of years since December 26, 1979 in Roman numerals.
// This is currently too difficult (maybe even impossible) to add.
var tzl = moment.defineLocale('tzl', {
months: 'Januar_Fevraglh_Març_Avrïu_Mai_Gün_Julia_Guscht_Setemvar_Listopäts_Noemvar_Zecemvar'.split('_'),
monthsShort: 'Jan_Fev_Mar_Avr_Mai_Gün_Jul_Gus_Set_Lis_Noe_Zec'.split('_'),
weekdays: 'Súladi_Lúneçi_Maitzi_Márcuri_Xhúadi_Viénerçi_Sáturi'.split('_'),
weekdaysShort: 'Súl_Lún_Mai_Már_Xhú_Vié_Sát'.split('_'),
weekdaysMin: 'Sú_Lú_Ma_Má_Xh_Vi_Sá'.split('_'),
longDateFormat: {
LT: 'HH.mm',
LTS: 'HH.mm.ss',
L: 'DD.MM.YYYY',
LL: 'D. MMMM [dallas] YYYY',
LLL: 'D. MMMM [dallas] YYYY HH.mm',
LLLL: 'dddd, [li] D. MMMM [dallas] YYYY HH.mm'
},
meridiemParse: /d\'o|d\'a/i,
isPM: function (input) {
return 'd\'o' === input.toLowerCase();
},
meridiem: function (hours, minutes, isLower) {
if (hours > 11) {
return isLower ? 'd\'o' : 'D\'O';
} else {
return isLower ? 'd\'a' : 'D\'A';
}
},
calendar: {
sameDay: '[oxhi à] LT',
nextDay: '[demà à] LT',
nextWeek: 'dddd [à] LT',
lastDay: '[ieiri à] LT',
lastWeek: '[sür el] dddd [lasteu à] LT',
sameElse: 'L'
},
relativeTime: {
future: 'osprei %s',
past: 'ja%s',
s: processRelativeTime,
ss: processRelativeTime,
m: processRelativeTime,
mm: processRelativeTime,
h: processRelativeTime,
hh: processRelativeTime,
d: processRelativeTime,
dd: processRelativeTime,
M: processRelativeTime,
MM: processRelativeTime,
y: processRelativeTime,
yy: processRelativeTime
},
dayOfMonthOrdinalParse: /\d{1,2}\./,
ordinal: '%d.',
week: {
dow: 1,
// Monday is the first day of the week.
doy: 4 // The week that contains Jan 4th is the first week of the year.
}
});
function processRelativeTime(number, withoutSuffix, key, isFuture) {
var format = {
's': ['viensas secunds', '\'iensas secunds'],
'ss': [number + ' secunds', '' + number + ' secunds'],
'm': ['\'n míut', '\'iens míut'],
'mm': [number + ' míuts', '' + number + ' míuts'],
'h': ['\'n þora', '\'iensa þora'],
'hh': [number + ' þoras', '' + number + ' þoras'],
'd': ['\'n ziua', '\'iensa ziua'],
'dd': [number + ' ziuas', '' + number + ' ziuas'],
'M': ['\'n mes', '\'iens mes'],
'MM': [number + ' mesen', '' + number + ' mesen'],
'y': ['\'n ar', '\'iens ar'],
'yy': [number + ' ars', '' + number + ' ars']
};
return isFuture ? format[key][0] : withoutSuffix ? format[key][0] : format[key][1];
}
return tzl;
});
/***/ }),
/***/ "./node_modules/moment/locale/tzm-latn.js":
/*!************************************************!*\
!*** ./node_modules/moment/locale/tzm-latn.js ***!
\************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
;
(function (global, factory) {
true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : undefined;
})(this, function (moment) {
'use strict';
var tzmLatn = moment.defineLocale('tzm-latn', {
months: 'innayr_brˤayrˤ_marˤsˤ_ibrir_mayyw_ywnyw_ywlywz_ɣwšt_šwtanbir_ktˤwbrˤ_nwwanbir_dwjnbir'.split('_'),
monthsShort: 'innayr_brˤayrˤ_marˤsˤ_ibrir_mayyw_ywnyw_ywlywz_ɣwšt_šwtanbir_ktˤwbrˤ_nwwanbir_dwjnbir'.split('_'),
weekdays: 'asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas'.split('_'),
weekdaysShort: 'asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas'.split('_'),
weekdaysMin: 'asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas'.split('_'),
longDateFormat: {
LT: 'HH:mm',
LTS: 'HH:mm:ss',
L: 'DD/MM/YYYY',
LL: 'D MMMM YYYY',
LLL: 'D MMMM YYYY HH:mm',
LLLL: 'dddd D MMMM YYYY HH:mm'
},
calendar: {
sameDay: '[asdkh g] LT',
nextDay: '[aska g] LT',
nextWeek: 'dddd [g] LT',
lastDay: '[assant g] LT',
lastWeek: 'dddd [g] LT',
sameElse: 'L'
},
relativeTime: {
future: 'dadkh s yan %s',
past: 'yan %s',
s: 'imik',
ss: '%d imik',
m: 'minuḍ',
mm: '%d minuḍ',
h: 'saɛa',
hh: '%d tassaɛin',
d: 'ass',
dd: '%d ossan',
M: 'ayowr',
MM: '%d iyyirn',
y: 'asgas',
yy: '%d isgasn'
},
week: {
dow: 6,
// Saturday is the first day of the week.
doy: 12 // The week that contains Jan 12th is the first week of the year.
}
});
return tzmLatn;
});
/***/ }),
/***/ "./node_modules/moment/locale/tzm.js":
/*!*******************************************!*\
!*** ./node_modules/moment/locale/tzm.js ***!
\*******************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
;
(function (global, factory) {
true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : undefined;
})(this, function (moment) {
'use strict';
var tzm = moment.defineLocale('tzm', {
months: 'ⵉⵏⵏⴰⵢⵔ_ⴱⵕⴰⵢⵕ_ⵎⴰⵕⵚ_ⵉⴱⵔⵉⵔ_ⵎⴰⵢⵢⵓ_ⵢⵓⵏⵢⵓ_ⵢⵓⵍⵢⵓⵣ_ⵖⵓⵛⵜ_ⵛⵓⵜⴰⵏⴱⵉⵔ_ⴽⵟⵓⴱⵕ_ⵏⵓⵡⴰⵏⴱⵉⵔ_ⴷⵓⵊⵏⴱⵉⵔ'.split('_'),
monthsShort: 'ⵉⵏⵏⴰⵢⵔ_ⴱⵕⴰⵢⵕ_ⵎⴰⵕⵚ_ⵉⴱⵔⵉⵔ_ⵎⴰⵢⵢⵓ_ⵢⵓⵏⵢⵓ_ⵢⵓⵍⵢⵓⵣ_ⵖⵓⵛⵜ_ⵛⵓⵜⴰⵏⴱⵉⵔ_ⴽⵟⵓⴱⵕ_ⵏⵓⵡⴰⵏⴱⵉⵔ_ⴷⵓⵊⵏⴱⵉⵔ'.split('_'),
weekdays: 'ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ'.split('_'),
weekdaysShort: 'ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ'.split('_'),
weekdaysMin: 'ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ'.split('_'),
longDateFormat: {
LT: 'HH:mm',
LTS: 'HH:mm:ss',
L: 'DD/MM/YYYY',
LL: 'D MMMM YYYY',
LLL: 'D MMMM YYYY HH:mm',
LLLL: 'dddd D MMMM YYYY HH:mm'
},
calendar: {
sameDay: '[ⴰⵙⴷⵅ ⴴ] LT',
nextDay: '[ⴰⵙⴽⴰ ⴴ] LT',
nextWeek: 'dddd [ⴴ] LT',
lastDay: '[ⴰⵚⴰⵏⵜ ⴴ] LT',
lastWeek: 'dddd [ⴴ] LT',
sameElse: 'L'
},
relativeTime: {
future: 'ⴷⴰⴷⵅ ⵙ ⵢⴰⵏ %s',
past: 'ⵢⴰⵏ %s',
s: 'ⵉⵎⵉⴽ',
ss: '%d ⵉⵎⵉⴽ',
m: 'ⵎⵉⵏⵓⴺ',
mm: '%d ⵎⵉⵏⵓⴺ',
h: 'ⵙⴰⵄⴰ',
hh: '%d ⵜⴰⵙⵙⴰⵄⵉⵏ',
d: 'ⴰⵙⵙ',
dd: '%d oⵙⵙⴰⵏ',
M: 'ⴰⵢoⵓⵔ',
MM: '%d ⵉⵢⵢⵉⵔⵏ',
y: 'ⴰⵙⴳⴰⵙ',
yy: '%d ⵉⵙⴳⴰⵙⵏ'
},
week: {
dow: 6,
// Saturday is the first day of the week.
doy: 12 // The week that contains Jan 12th is the first week of the year.
}
});
return tzm;
});
/***/ }),
/***/ "./node_modules/moment/locale/ug-cn.js":
/*!*********************************************!*\
!*** ./node_modules/moment/locale/ug-cn.js ***!
\*********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js language configuration
;
(function (global, factory) {
true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : undefined;
})(this, function (moment) {
'use strict';
var ugCn = moment.defineLocale('ug-cn', {
months: 'يانۋار_فېۋرال_مارت_ئاپرېل_ماي_ئىيۇن_ئىيۇل_ئاۋغۇست_سېنتەبىر_ئۆكتەبىر_نويابىر_دېكابىر'.split('_'),
monthsShort: 'يانۋار_فېۋرال_مارت_ئاپرېل_ماي_ئىيۇن_ئىيۇل_ئاۋغۇست_سېنتەبىر_ئۆكتەبىر_نويابىر_دېكابىر'.split('_'),
weekdays: 'يەكشەنبە_دۈشەنبە_سەيشەنبە_چارشەنبە_پەيشەنبە_جۈمە_شەنبە'.split('_'),
weekdaysShort: 'يە_دۈ_سە_چا_پە_جۈ_شە'.split('_'),
weekdaysMin: 'يە_دۈ_سە_چا_پە_جۈ_شە'.split('_'),
longDateFormat: {
LT: 'HH:mm',
LTS: 'HH:mm:ss',
L: 'YYYY-MM-DD',
LL: 'YYYY-يىلىM-ئاينىڭD-كۈنى',
LLL: 'YYYY-يىلىM-ئاينىڭD-كۈنى، HH:mm',
LLLL: 'dddd، YYYY-يىلىM-ئاينىڭD-كۈنى، HH:mm'
},
meridiemParse: /يېرىم كېچە|سەھەر|چۈشتىن بۇرۇن|چۈش|چۈشتىن كېيىن|كەچ/,
meridiemHour: function (hour, meridiem) {
if (hour === 12) {
hour = 0;
}
if (meridiem === 'يېرىم كېچە' || meridiem === 'سەھەر' || meridiem === 'چۈشتىن بۇرۇن') {
return hour;
} else if (meridiem === 'چۈشتىن كېيىن' || meridiem === 'كەچ') {
return hour + 12;
} else {
return hour >= 11 ? hour : hour + 12;
}
},
meridiem: function (hour, minute, isLower) {
var hm = hour * 100 + minute;
if (hm < 600) {
return 'يېرىم كېچە';
} else if (hm < 900) {
return 'سەھەر';
} else if (hm < 1130) {
return 'چۈشتىن بۇرۇن';
} else if (hm < 1230) {
return 'چۈش';
} else if (hm < 1800) {
return 'چۈشتىن كېيىن';
} else {
return 'كەچ';
}
},
calendar: {
sameDay: '[بۈگۈن سائەت] LT',
nextDay: '[ئەتە سائەت] LT',
nextWeek: '[كېلەركى] dddd [سائەت] LT',
lastDay: '[تۆنۈگۈن] LT',
lastWeek: '[ئالدىنقى] dddd [سائەت] LT',
sameElse: 'L'
},
relativeTime: {
future: '%s كېيىن',
past: '%s بۇرۇن',
s: 'نەچچە سېكونت',
ss: '%d سېكونت',
m: 'بىر مىنۇت',
mm: '%d مىنۇت',
h: 'بىر سائەت',
hh: '%d سائەت',
d: 'بىر كۈن',
dd: '%d كۈن',
M: 'بىر ئاي',
MM: '%d ئاي',
y: 'بىر يىل',
yy: '%d يىل'
},
dayOfMonthOrdinalParse: /\d{1,2}(-كۈنى|-ئاي|-ھەپتە)/,
ordinal: function (number, period) {
switch (period) {
case 'd':
case 'D':
case 'DDD':
return number + '-كۈنى';
case 'w':
case 'W':
return number + '-ھەپتە';
default:
return number;
}
},
preparse: function (string) {
return string.replace(/،/g, ',');
},
postformat: function (string) {
return string.replace(/,/g, '،');
},
week: {
// GB/T 7408-1994《数据元和交换格式·信息交换·日期和时间表示法》与ISO 8601:1988等效
dow: 1,
// Monday is the first day of the week.
doy: 7 // The week that contains Jan 1st is the first week of the year.
}
});
return ugCn;
});
/***/ }),
/***/ "./node_modules/moment/locale/uk.js":
/*!******************************************!*\
!*** ./node_modules/moment/locale/uk.js ***!
\******************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
;
(function (global, factory) {
true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : undefined;
})(this, function (moment) {
'use strict';
function plural(word, num) {
var forms = word.split('_');
return num % 10 === 1 && num % 100 !== 11 ? forms[0] : num % 10 >= 2 && num % 10 <= 4 && (num % 100 < 10 || num % 100 >= 20) ? forms[1] : forms[2];
}
function relativeTimeWithPlural(number, withoutSuffix, key) {
var format = {
'ss': withoutSuffix ? 'секунда_секунди_секунд' : 'секунду_секунди_секунд',
'mm': withoutSuffix ? 'хвилина_хвилини_хвилин' : 'хвилину_хвилини_хвилин',
'hh': withoutSuffix ? 'година_години_годин' : 'годину_години_годин',
'dd': 'день_дні_днів',
'MM': 'місяць_місяці_місяців',
'yy': 'рік_роки_років'
};
if (key === 'm') {
return withoutSuffix ? 'хвилина' : 'хвилину';
} else if (key === 'h') {
return withoutSuffix ? 'година' : 'годину';
} else {
return number + ' ' + plural(format[key], +number);
}
}
function weekdaysCaseReplace(m, format) {
var weekdays = {
'nominative': 'неділя_понеділок_вівторок_середа_четвер_п’ятниця_субота'.split('_'),
'accusative': 'неділю_понеділок_вівторок_середу_четвер_п’ятницю_суботу'.split('_'),
'genitive': 'неділі_понеділка_вівторка_середи_четверга_п’ятниці_суботи'.split('_')
};
if (m === true) {
return weekdays['nominative'].slice(1, 7).concat(weekdays['nominative'].slice(0, 1));
}
if (!m) {
return weekdays['nominative'];
}
var nounCase = /(\[[ВвУу]\]) ?dddd/.test(format) ? 'accusative' : /\[?(?:минулої|наступної)? ?\] ?dddd/.test(format) ? 'genitive' : 'nominative';
return weekdays[nounCase][m.day()];
}
function processHoursFunction(str) {
return function () {
return str + 'о' + (this.hours() === 11 ? 'б' : '') + '] LT';
};
}
var uk = moment.defineLocale('uk', {
months: {
'format': 'січня_лютого_березня_квітня_травня_червня_липня_серпня_вересня_жовтня_листопада_грудня'.split('_'),
'standalone': 'січень_лютий_березень_квітень_травень_червень_липень_серпень_вересень_жовтень_листопад_грудень'.split('_')
},
monthsShort: 'січ_лют_бер_квіт_трав_черв_лип_серп_вер_жовт_лист_груд'.split('_'),
weekdays: weekdaysCaseReplace,
weekdaysShort: 'нд_пн_вт_ср_чт_пт_сб'.split('_'),
weekdaysMin: 'нд_пн_вт_ср_чт_пт_сб'.split('_'),
longDateFormat: {
LT: 'HH:mm',
LTS: 'HH:mm:ss',
L: 'DD.MM.YYYY',
LL: 'D MMMM YYYY р.',
LLL: 'D MMMM YYYY р., HH:mm',
LLLL: 'dddd, D MMMM YYYY р., HH:mm'
},
calendar: {
sameDay: processHoursFunction('[Сьогодні '),
nextDay: processHoursFunction('[Завтра '),
lastDay: processHoursFunction('[Вчора '),
nextWeek: processHoursFunction('[У] dddd ['),
lastWeek: function () {
switch (this.day()) {
case 0:
case 3:
case 5:
case 6:
return processHoursFunction('[Минулої] dddd [').call(this);
case 1:
case 2:
case 4:
return processHoursFunction('[Минулого] dddd [').call(this);
}
},
sameElse: 'L'
},
relativeTime: {
future: 'за %s',
past: '%s тому',
s: 'декілька секунд',
ss: relativeTimeWithPlural,
m: relativeTimeWithPlural,
mm: relativeTimeWithPlural,
h: 'годину',
hh: relativeTimeWithPlural,
d: 'день',
dd: relativeTimeWithPlural,
M: 'місяць',
MM: relativeTimeWithPlural,
y: 'рік',
yy: relativeTimeWithPlural
},
// M. E.: those two are virtually unused but a user might want to implement them for his/her website for some reason
meridiemParse: /ночі|ранку|дня|вечора/,
isPM: function (input) {
return /^(дня|вечора)$/.test(input);
},
meridiem: function (hour, minute, isLower) {
if (hour < 4) {
return 'ночі';
} else if (hour < 12) {
return 'ранку';
} else if (hour < 17) {
return 'дня';
} else {
return 'вечора';
}
},
dayOfMonthOrdinalParse: /\d{1,2}-(й|го)/,
ordinal: function (number, period) {
switch (period) {
case 'M':
case 'd':
case 'DDD':
case 'w':
case 'W':
return number + '-й';
case 'D':
return number + '-го';
default:
return number;
}
},
week: {
dow: 1,
// Monday is the first day of the week.
doy: 7 // The week that contains Jan 7th is the first week of the year.
}
});
return uk;
});
/***/ }),
/***/ "./node_modules/moment/locale/ur.js":
/*!******************************************!*\
!*** ./node_modules/moment/locale/ur.js ***!
\******************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
;
(function (global, factory) {
true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : undefined;
})(this, function (moment) {
'use strict';
var months = ['جنوری', 'فروری', 'مارچ', 'اپریل', 'مئی', 'جون', 'جولائی', 'اگست', 'ستمبر', 'اکتوبر', 'نومبر', 'دسمبر'];
var days = ['اتوار', 'پیر', 'منگل', 'بدھ', 'جمعرات', 'جمعہ', 'ہفتہ'];
var ur = moment.defineLocale('ur', {
months: months,
monthsShort: months,
weekdays: days,
weekdaysShort: days,
weekdaysMin: days,
longDateFormat: {
LT: 'HH:mm',
LTS: 'HH:mm:ss',
L: 'DD/MM/YYYY',
LL: 'D MMMM YYYY',
LLL: 'D MMMM YYYY HH:mm',
LLLL: 'dddd، D MMMM YYYY HH:mm'
},
meridiemParse: /صبح|شام/,
isPM: function (input) {
return 'شام' === input;
},
meridiem: function (hour, minute, isLower) {
if (hour < 12) {
return 'صبح';
}
return 'شام';
},
calendar: {
sameDay: '[آج بوقت] LT',
nextDay: '[کل بوقت] LT',
nextWeek: 'dddd [بوقت] LT',
lastDay: '[گذشتہ روز بوقت] LT',
lastWeek: '[گذشتہ] dddd [بوقت] LT',
sameElse: 'L'
},
relativeTime: {
future: '%s بعد',
past: '%s قبل',
s: 'چند سیکنڈ',
ss: '%d سیکنڈ',
m: 'ایک منٹ',
mm: '%d منٹ',
h: 'ایک گھنٹہ',
hh: '%d گھنٹے',
d: 'ایک دن',
dd: '%d دن',
M: 'ایک ماہ',
MM: '%d ماہ',
y: 'ایک سال',
yy: '%d سال'
},
preparse: function (string) {
return string.replace(/،/g, ',');
},
postformat: function (string) {
return string.replace(/,/g, '،');
},
week: {
dow: 1,
// Monday is the first day of the week.
doy: 4 // The week that contains Jan 4th is the first week of the year.
}
});
return ur;
});
/***/ }),
/***/ "./node_modules/moment/locale/uz-latn.js":
/*!***********************************************!*\
!*** ./node_modules/moment/locale/uz-latn.js ***!
\***********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
;
(function (global, factory) {
true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : undefined;
})(this, function (moment) {
'use strict';
var uzLatn = moment.defineLocale('uz-latn', {
months: 'Yanvar_Fevral_Mart_Aprel_May_Iyun_Iyul_Avgust_Sentabr_Oktabr_Noyabr_Dekabr'.split('_'),
monthsShort: 'Yan_Fev_Mar_Apr_May_Iyun_Iyul_Avg_Sen_Okt_Noy_Dek'.split('_'),
weekdays: 'Yakshanba_Dushanba_Seshanba_Chorshanba_Payshanba_Juma_Shanba'.split('_'),
weekdaysShort: 'Yak_Dush_Sesh_Chor_Pay_Jum_Shan'.split('_'),
weekdaysMin: 'Ya_Du_Se_Cho_Pa_Ju_Sha'.split('_'),
longDateFormat: {
LT: 'HH:mm',
LTS: 'HH:mm:ss',
L: 'DD/MM/YYYY',
LL: 'D MMMM YYYY',
LLL: 'D MMMM YYYY HH:mm',
LLLL: 'D MMMM YYYY, dddd HH:mm'
},
calendar: {
sameDay: '[Bugun soat] LT [da]',
nextDay: '[Ertaga] LT [da]',
nextWeek: 'dddd [kuni soat] LT [da]',
lastDay: '[Kecha soat] LT [da]',
lastWeek: '[O\'tgan] dddd [kuni soat] LT [da]',
sameElse: 'L'
},
relativeTime: {
future: 'Yaqin %s ichida',
past: 'Bir necha %s oldin',
s: 'soniya',
ss: '%d soniya',
m: 'bir daqiqa',
mm: '%d daqiqa',
h: 'bir soat',
hh: '%d soat',
d: 'bir kun',
dd: '%d kun',
M: 'bir oy',
MM: '%d oy',
y: 'bir yil',
yy: '%d yil'
},
week: {
dow: 1,
// Monday is the first day of the week.
doy: 7 // The week that contains Jan 7th is the first week of the year.
}
});
return uzLatn;
});
/***/ }),
/***/ "./node_modules/moment/locale/uz.js":
/*!******************************************!*\
!*** ./node_modules/moment/locale/uz.js ***!
\******************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
;
(function (global, factory) {
true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : undefined;
})(this, function (moment) {
'use strict';
var uz = moment.defineLocale('uz', {
months: 'январ_феврал_март_апрел_май_июн_июл_август_сентябр_октябр_ноябр_декабр'.split('_'),
monthsShort: 'янв_фев_мар_апр_май_июн_июл_авг_сен_окт_ноя_дек'.split('_'),
weekdays: 'Якшанба_Душанба_Сешанба_Чоршанба_Пайшанба_Жума_Шанба'.split('_'),
weekdaysShort: 'Якш_Душ_Сеш_Чор_Пай_Жум_Шан'.split('_'),
weekdaysMin: 'Як_Ду_Се_Чо_Па_Жу_Ша'.split('_'),
longDateFormat: {
LT: 'HH:mm',
LTS: 'HH:mm:ss',
L: 'DD/MM/YYYY',
LL: 'D MMMM YYYY',
LLL: 'D MMMM YYYY HH:mm',
LLLL: 'D MMMM YYYY, dddd HH:mm'
},
calendar: {
sameDay: '[Бугун соат] LT [да]',
nextDay: '[Эртага] LT [да]',
nextWeek: 'dddd [куни соат] LT [да]',
lastDay: '[Кеча соат] LT [да]',
lastWeek: '[Утган] dddd [куни соат] LT [да]',
sameElse: 'L'
},
relativeTime: {
future: 'Якин %s ичида',
past: 'Бир неча %s олдин',
s: 'фурсат',
ss: '%d фурсат',
m: 'бир дакика',
mm: '%d дакика',
h: 'бир соат',
hh: '%d соат',
d: 'бир кун',
dd: '%d кун',
M: 'бир ой',
MM: '%d ой',
y: 'бир йил',
yy: '%d йил'
},
week: {
dow: 1,
// Monday is the first day of the week.
doy: 7 // The week that contains Jan 4th is the first week of the year.
}
});
return uz;
});
/***/ }),
/***/ "./node_modules/moment/locale/vi.js":
/*!******************************************!*\
!*** ./node_modules/moment/locale/vi.js ***!
\******************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
;
(function (global, factory) {
true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : undefined;
})(this, function (moment) {
'use strict';
var vi = moment.defineLocale('vi', {
months: 'tháng 1_tháng 2_tháng 3_tháng 4_tháng 5_tháng 6_tháng 7_tháng 8_tháng 9_tháng 10_tháng 11_tháng 12'.split('_'),
monthsShort: 'Th01_Th02_Th03_Th04_Th05_Th06_Th07_Th08_Th09_Th10_Th11_Th12'.split('_'),
monthsParseExact: true,
weekdays: 'chủ nhật_thứ hai_thứ ba_thứ tư_thứ năm_thứ sáu_thứ bảy'.split('_'),
weekdaysShort: 'CN_T2_T3_T4_T5_T6_T7'.split('_'),
weekdaysMin: 'CN_T2_T3_T4_T5_T6_T7'.split('_'),
weekdaysParseExact: true,
meridiemParse: /sa|ch/i,
isPM: function (input) {
return /^ch$/i.test(input);
},
meridiem: function (hours, minutes, isLower) {
if (hours < 12) {
return isLower ? 'sa' : 'SA';
} else {
return isLower ? 'ch' : 'CH';
}
},
longDateFormat: {
LT: 'HH:mm',
LTS: 'HH:mm:ss',
L: 'DD/MM/YYYY',
LL: 'D MMMM [năm] YYYY',
LLL: 'D MMMM [năm] YYYY HH:mm',
LLLL: 'dddd, D MMMM [năm] YYYY HH:mm',
l: 'DD/M/YYYY',
ll: 'D MMM YYYY',
lll: 'D MMM YYYY HH:mm',
llll: 'ddd, D MMM YYYY HH:mm'
},
calendar: {
sameDay: '[Hôm nay lúc] LT',
nextDay: '[Ngày mai lúc] LT',
nextWeek: 'dddd [tuần tới lúc] LT',
lastDay: '[Hôm qua lúc] LT',
lastWeek: 'dddd [tuần rồi lúc] LT',
sameElse: 'L'
},
relativeTime: {
future: '%s tới',
past: '%s trước',
s: 'vài giây',
ss: '%d giây',
m: 'một phút',
mm: '%d phút',
h: 'một giờ',
hh: '%d giờ',
d: 'một ngày',
dd: '%d ngày',
M: 'một tháng',
MM: '%d tháng',
y: 'một năm',
yy: '%d năm'
},
dayOfMonthOrdinalParse: /\d{1,2}/,
ordinal: function (number) {
return number;
},
week: {
dow: 1,
// Monday is the first day of the week.
doy: 4 // The week that contains Jan 4th is the first week of the year.
}
});
return vi;
});
/***/ }),
/***/ "./node_modules/moment/locale/x-pseudo.js":
/*!************************************************!*\
!*** ./node_modules/moment/locale/x-pseudo.js ***!
\************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
;
(function (global, factory) {
true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : undefined;
})(this, function (moment) {
'use strict';
var xPseudo = moment.defineLocale('x-pseudo', {
months: 'J~áñúá~rý_F~ébrú~árý_~Márc~h_Áp~ríl_~Máý_~Júñé~_Júl~ý_Áú~gúst~_Sép~témb~ér_Ó~ctób~ér_Ñ~óvém~bér_~Décé~mbér'.split('_'),
monthsShort: 'J~áñ_~Féb_~Már_~Ápr_~Máý_~Júñ_~Júl_~Áúg_~Sép_~Óct_~Ñóv_~Déc'.split('_'),
monthsParseExact: true,
weekdays: 'S~úñdá~ý_Mó~ñdáý~_Túé~sdáý~_Wéd~ñésd~áý_T~húrs~dáý_~Fríd~áý_S~átúr~dáý'.split('_'),
weekdaysShort: 'S~úñ_~Móñ_~Túé_~Wéd_~Thú_~Frí_~Sát'.split('_'),
weekdaysMin: 'S~ú_Mó~_Tú_~Wé_T~h_Fr~_Sá'.split('_'),
weekdaysParseExact: true,
longDateFormat: {
LT: 'HH:mm',
L: 'DD/MM/YYYY',
LL: 'D MMMM YYYY',
LLL: 'D MMMM YYYY HH:mm',
LLLL: 'dddd, D MMMM YYYY HH:mm'
},
calendar: {
sameDay: '[T~ódá~ý át] LT',
nextDay: '[T~ómó~rró~w át] LT',
nextWeek: 'dddd [át] LT',
lastDay: '[Ý~ést~érdá~ý át] LT',
lastWeek: '[L~ást] dddd [át] LT',
sameElse: 'L'
},
relativeTime: {
future: 'í~ñ %s',
past: '%s á~gó',
s: 'á ~féw ~sécó~ñds',
ss: '%d s~écóñ~ds',
m: 'á ~míñ~úté',
mm: '%d m~íñú~tés',
h: 'á~ñ hó~úr',
hh: '%d h~óúrs',
d: 'á ~dáý',
dd: '%d d~áýs',
M: 'á ~móñ~th',
MM: '%d m~óñt~hs',
y: 'á ~ýéár',
yy: '%d ý~éárs'
},
dayOfMonthOrdinalParse: /\d{1,2}(th|st|nd|rd)/,
ordinal: function (number) {
var b = number % 10,
output = ~~(number % 100 / 10) === 1 ? 'th' : b === 1 ? 'st' : b === 2 ? 'nd' : b === 3 ? 'rd' : 'th';
return number + output;
},
week: {
dow: 1,
// Monday is the first day of the week.
doy: 4 // The week that contains Jan 4th is the first week of the year.
}
});
return xPseudo;
});
/***/ }),
/***/ "./node_modules/moment/locale/yo.js":
/*!******************************************!*\
!*** ./node_modules/moment/locale/yo.js ***!
\******************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
;
(function (global, factory) {
true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : undefined;
})(this, function (moment) {
'use strict';
var yo = moment.defineLocale('yo', {
months: 'Sẹ́rẹ́_Èrèlè_Ẹrẹ̀nà_Ìgbé_Èbibi_Òkùdu_Agẹmo_Ògún_Owewe_Ọ̀wàrà_Bélú_Ọ̀pẹ̀̀'.split('_'),
monthsShort: 'Sẹ́r_Èrl_Ẹrn_Ìgb_Èbi_Òkù_Agẹ_Ògú_Owe_Ọ̀wà_Bél_Ọ̀pẹ̀̀'.split('_'),
weekdays: 'Àìkú_Ajé_Ìsẹ́gun_Ọjọ́rú_Ọjọ́bọ_Ẹtì_Àbámẹ́ta'.split('_'),
weekdaysShort: 'Àìk_Ajé_Ìsẹ́_Ọjr_Ọjb_Ẹtì_Àbá'.split('_'),
weekdaysMin: 'Àì_Aj_Ìs_Ọr_Ọb_Ẹt_Àb'.split('_'),
longDateFormat: {
LT: 'h:mm A',
LTS: 'h:mm:ss A',
L: 'DD/MM/YYYY',
LL: 'D MMMM YYYY',
LLL: 'D MMMM YYYY h:mm A',
LLLL: 'dddd, D MMMM YYYY h:mm A'
},
calendar: {
sameDay: '[Ònì ni] LT',
nextDay: '[Ọ̀la ni] LT',
nextWeek: 'dddd [Ọsẹ̀ tón\'bọ] [ni] LT',
lastDay: '[Àna ni] LT',
lastWeek: 'dddd [Ọsẹ̀ tólọ́] [ni] LT',
sameElse: 'L'
},
relativeTime: {
future: 'ní %s',
past: '%s kọjá',
s: 'ìsẹjú aayá die',
ss: 'aayá %d',
m: 'ìsẹjú kan',
mm: 'ìsẹjú %d',
h: 'wákati kan',
hh: 'wákati %d',
d: 'ọjọ́ kan',
dd: 'ọjọ́ %d',
M: 'osù kan',
MM: 'osù %d',
y: 'ọdún kan',
yy: 'ọdún %d'
},
dayOfMonthOrdinalParse: /ọjọ́\s\d{1,2}/,
ordinal: 'ọjọ́ %d',
week: {
dow: 1,
// Monday is the first day of the week.
doy: 4 // The week that contains Jan 4th is the first week of the year.
}
});
return yo;
});
/***/ }),
/***/ "./node_modules/moment/locale/zh-cn.js":
/*!*********************************************!*\
!*** ./node_modules/moment/locale/zh-cn.js ***!
\*********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
;
(function (global, factory) {
true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : undefined;
})(this, function (moment) {
'use strict';
var zhCn = moment.defineLocale('zh-cn', {
months: '一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月'.split('_'),
monthsShort: '1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月'.split('_'),
weekdays: '星期日_星期一_星期二_星期三_星期四_星期五_星期六'.split('_'),
weekdaysShort: '周日_周一_周二_周三_周四_周五_周六'.split('_'),
weekdaysMin: '日_一_二_三_四_五_六'.split('_'),
longDateFormat: {
LT: 'HH:mm',
LTS: 'HH:mm:ss',
L: 'YYYY/MM/DD',
LL: 'YYYY年M月D日',
LLL: 'YYYY年M月D日Ah点mm分',
LLLL: 'YYYY年M月D日ddddAh点mm分',
l: 'YYYY/M/D',
ll: 'YYYY年M月D日',
lll: 'YYYY年M月D日 HH:mm',
llll: 'YYYY年M月D日dddd HH:mm'
},
meridiemParse: /凌晨|早上|上午|中午|下午|晚上/,
meridiemHour: function (hour, meridiem) {
if (hour === 12) {
hour = 0;
}
if (meridiem === '凌晨' || meridiem === '早上' || meridiem === '上午') {
return hour;
} else if (meridiem === '下午' || meridiem === '晚上') {
return hour + 12;
} else {
// '中午'
return hour >= 11 ? hour : hour + 12;
}
},
meridiem: function (hour, minute, isLower) {
var hm = hour * 100 + minute;
if (hm < 600) {
return '凌晨';
} else if (hm < 900) {
return '早上';
} else if (hm < 1130) {
return '上午';
} else if (hm < 1230) {
return '中午';
} else if (hm < 1800) {
return '下午';
} else {
return '晚上';
}
},
calendar: {
sameDay: '[今天]LT',
nextDay: '[明天]LT',
nextWeek: '[下]ddddLT',
lastDay: '[昨天]LT',
lastWeek: '[上]ddddLT',
sameElse: 'L'
},
dayOfMonthOrdinalParse: /\d{1,2}(日|月|周)/,
ordinal: function (number, period) {
switch (period) {
case 'd':
case 'D':
case 'DDD':
return number + '日';
case 'M':
return number + '月';
case 'w':
case 'W':
return number + '周';
default:
return number;
}
},
relativeTime: {
future: '%s内',
past: '%s前',
s: '几秒',
ss: '%d 秒',
m: '1 分钟',
mm: '%d 分钟',
h: '1 小时',
hh: '%d 小时',
d: '1 天',
dd: '%d 天',
M: '1 个月',
MM: '%d 个月',
y: '1 年',
yy: '%d 年'
},
week: {
// GB/T 7408-1994《数据元和交换格式·信息交换·日期和时间表示法》与ISO 8601:1988等效
dow: 1,
// Monday is the first day of the week.
doy: 4 // The week that contains Jan 4th is the first week of the year.
}
});
return zhCn;
});
/***/ }),
/***/ "./node_modules/moment/locale/zh-hk.js":
/*!*********************************************!*\
!*** ./node_modules/moment/locale/zh-hk.js ***!
\*********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
;
(function (global, factory) {
true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : undefined;
})(this, function (moment) {
'use strict';
var zhHk = moment.defineLocale('zh-hk', {
months: '一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月'.split('_'),
monthsShort: '1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月'.split('_'),
weekdays: '星期日_星期一_星期二_星期三_星期四_星期五_星期六'.split('_'),
weekdaysShort: '週日_週一_週二_週三_週四_週五_週六'.split('_'),
weekdaysMin: '日_一_二_三_四_五_六'.split('_'),
longDateFormat: {
LT: 'HH:mm',
LTS: 'HH:mm:ss',
L: 'YYYY/MM/DD',
LL: 'YYYY年M月D日',
LLL: 'YYYY年M月D日 HH:mm',
LLLL: 'YYYY年M月D日dddd HH:mm',
l: 'YYYY/M/D',
ll: 'YYYY年M月D日',
lll: 'YYYY年M月D日 HH:mm',
llll: 'YYYY年M月D日dddd HH:mm'
},
meridiemParse: /凌晨|早上|上午|中午|下午|晚上/,
meridiemHour: function (hour, meridiem) {
if (hour === 12) {
hour = 0;
}
if (meridiem === '凌晨' || meridiem === '早上' || meridiem === '上午') {
return hour;
} else if (meridiem === '中午') {
return hour >= 11 ? hour : hour + 12;
} else if (meridiem === '下午' || meridiem === '晚上') {
return hour + 12;
}
},
meridiem: function (hour, minute, isLower) {
var hm = hour * 100 + minute;
if (hm < 600) {
return '凌晨';
} else if (hm < 900) {
return '早上';
} else if (hm < 1130) {
return '上午';
} else if (hm < 1230) {
return '中午';
} else if (hm < 1800) {
return '下午';
} else {
return '晚上';
}
},
calendar: {
sameDay: '[今天]LT',
nextDay: '[明天]LT',
nextWeek: '[下]ddddLT',
lastDay: '[昨天]LT',
lastWeek: '[上]ddddLT',
sameElse: 'L'
},
dayOfMonthOrdinalParse: /\d{1,2}(日|月|週)/,
ordinal: function (number, period) {
switch (period) {
case 'd':
case 'D':
case 'DDD':
return number + '日';
case 'M':
return number + '月';
case 'w':
case 'W':
return number + '週';
default:
return number;
}
},
relativeTime: {
future: '%s內',
past: '%s前',
s: '幾秒',
ss: '%d 秒',
m: '1 分鐘',
mm: '%d 分鐘',
h: '1 小時',
hh: '%d 小時',
d: '1 天',
dd: '%d 天',
M: '1 個月',
MM: '%d 個月',
y: '1 年',
yy: '%d 年'
}
});
return zhHk;
});
/***/ }),
/***/ "./node_modules/moment/locale/zh-tw.js":
/*!*********************************************!*\
!*** ./node_modules/moment/locale/zh-tw.js ***!
\*********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
;
(function (global, factory) {
true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : undefined;
})(this, function (moment) {
'use strict';
var zhTw = moment.defineLocale('zh-tw', {
months: '一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月'.split('_'),
monthsShort: '1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月'.split('_'),
weekdays: '星期日_星期一_星期二_星期三_星期四_星期五_星期六'.split('_'),
weekdaysShort: '週日_週一_週二_週三_週四_週五_週六'.split('_'),
weekdaysMin: '日_一_二_三_四_五_六'.split('_'),
longDateFormat: {
LT: 'HH:mm',
LTS: 'HH:mm:ss',
L: 'YYYY/MM/DD',
LL: 'YYYY年M月D日',
LLL: 'YYYY年M月D日 HH:mm',
LLLL: 'YYYY年M月D日dddd HH:mm',
l: 'YYYY/M/D',
ll: 'YYYY年M月D日',
lll: 'YYYY年M月D日 HH:mm',
llll: 'YYYY年M月D日dddd HH:mm'
},
meridiemParse: /凌晨|早上|上午|中午|下午|晚上/,
meridiemHour: function (hour, meridiem) {
if (hour === 12) {
hour = 0;
}
if (meridiem === '凌晨' || meridiem === '早上' || meridiem === '上午') {
return hour;
} else if (meridiem === '中午') {
return hour >= 11 ? hour : hour + 12;
} else if (meridiem === '下午' || meridiem === '晚上') {
return hour + 12;
}
},
meridiem: function (hour, minute, isLower) {
var hm = hour * 100 + minute;
if (hm < 600) {
return '凌晨';
} else if (hm < 900) {
return '早上';
} else if (hm < 1130) {
return '上午';
} else if (hm < 1230) {
return '中午';
} else if (hm < 1800) {
return '下午';
} else {
return '晚上';
}
},
calendar: {
sameDay: '[今天] LT',
nextDay: '[明天] LT',
nextWeek: '[下]dddd LT',
lastDay: '[昨天] LT',
lastWeek: '[上]dddd LT',
sameElse: 'L'
},
dayOfMonthOrdinalParse: /\d{1,2}(日|月|週)/,
ordinal: function (number, period) {
switch (period) {
case 'd':
case 'D':
case 'DDD':
return number + '日';
case 'M':
return number + '月';
case 'w':
case 'W':
return number + '週';
default:
return number;
}
},
relativeTime: {
future: '%s內',
past: '%s前',
s: '幾秒',
ss: '%d 秒',
m: '1 分鐘',
mm: '%d 分鐘',
h: '1 小時',
hh: '%d 小時',
d: '1 天',
dd: '%d 天',
M: '1 個月',
MM: '%d 個月',
y: '1 年',
yy: '%d 年'
}
});
return zhTw;
});
/***/ }),
/***/ "./node_modules/moment/moment.js":
/*!***************************************!*\
!*** ./node_modules/moment/moment.js ***!
\***************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(module) {var require;//! moment.js
;
(function (global, factory) {
true ? module.exports = factory() : undefined;
})(this, function () {
'use strict';
var hookCallback;
function hooks() {
return hookCallback.apply(null, arguments);
} // This is done to register the method called with moment()
// without creating circular dependencies.
function setHookCallback(callback) {
hookCallback = callback;
}
function isArray(input) {
return input instanceof Array || Object.prototype.toString.call(input) === '[object Array]';
}
function isObject(input) {
// IE8 will treat undefined and null as object if it wasn't for
// input != null
return input != null && Object.prototype.toString.call(input) === '[object Object]';
}
function isObjectEmpty(obj) {
if (Object.getOwnPropertyNames) {
return Object.getOwnPropertyNames(obj).length === 0;
} else {
var k;
for (k in obj) {
if (obj.hasOwnProperty(k)) {
return false;
}
}
return true;
}
}
function isUndefined(input) {
return input === void 0;
}
function isNumber(input) {
return typeof input === 'number' || Object.prototype.toString.call(input) === '[object Number]';
}
function isDate(input) {
return input instanceof Date || Object.prototype.toString.call(input) === '[object Date]';
}
function map(arr, fn) {
var res = [],
i;
for (i = 0; i < arr.length; ++i) {
res.push(fn(arr[i], i));
}
return res;
}
function hasOwnProp(a, b) {
return Object.prototype.hasOwnProperty.call(a, b);
}
function extend(a, b) {
for (var i in b) {
if (hasOwnProp(b, i)) {
a[i] = b[i];
}
}
if (hasOwnProp(b, 'toString')) {
a.toString = b.toString;
}
if (hasOwnProp(b, 'valueOf')) {
a.valueOf = b.valueOf;
}
return a;
}
function createUTC(input, format, locale, strict) {
return createLocalOrUTC(input, format, locale, strict, true).utc();
}
function defaultParsingFlags() {
// We need to deep clone this object.
return {
empty: false,
unusedTokens: [],
unusedInput: [],
overflow: -2,
charsLeftOver: 0,
nullInput: false,
invalidMonth: null,
invalidFormat: false,
userInvalidated: false,
iso: false,
parsedDateParts: [],
meridiem: null,
rfc2822: false,
weekdayMismatch: false
};
}
function getParsingFlags(m) {
if (m._pf == null) {
m._pf = defaultParsingFlags();
}
return m._pf;
}
var some;
if (Array.prototype.some) {
some = Array.prototype.some;
} else {
some = function (fun) {
var t = Object(this);
var len = t.length >>> 0;
for (var i = 0; i < len; i++) {
if (i in t && fun.call(this, t[i], i, t)) {
return true;
}
}
return false;
};
}
function isValid(m) {
if (m._isValid == null) {
var flags = getParsingFlags(m);
var parsedParts = some.call(flags.parsedDateParts, function (i) {
return i != null;
});
var isNowValid = !isNaN(m._d.getTime()) && flags.overflow < 0 && !flags.empty && !flags.invalidMonth && !flags.invalidWeekday && !flags.weekdayMismatch && !flags.nullInput && !flags.invalidFormat && !flags.userInvalidated && (!flags.meridiem || flags.meridiem && parsedParts);
if (m._strict) {
isNowValid = isNowValid && flags.charsLeftOver === 0 && flags.unusedTokens.length === 0 && flags.bigHour === undefined;
}
if (Object.isFrozen == null || !Object.isFrozen(m)) {
m._isValid = isNowValid;
} else {
return isNowValid;
}
}
return m._isValid;
}
function createInvalid(flags) {
var m = createUTC(NaN);
if (flags != null) {
extend(getParsingFlags(m), flags);
} else {
getParsingFlags(m).userInvalidated = true;
}
return m;
} // Plugins that add properties should also add the key here (null value),
// so we can properly clone ourselves.
var momentProperties = hooks.momentProperties = [];
function copyConfig(to, from) {
var i, prop, val;
if (!isUndefined(from._isAMomentObject)) {
to._isAMomentObject = from._isAMomentObject;
}
if (!isUndefined(from._i)) {
to._i = from._i;
}
if (!isUndefined(from._f)) {
to._f = from._f;
}
if (!isUndefined(from._l)) {
to._l = from._l;
}
if (!isUndefined(from._strict)) {
to._strict = from._strict;
}
if (!isUndefined(from._tzm)) {
to._tzm = from._tzm;
}
if (!isUndefined(from._isUTC)) {
to._isUTC = from._isUTC;
}
if (!isUndefined(from._offset)) {
to._offset = from._offset;
}
if (!isUndefined(from._pf)) {
to._pf = getParsingFlags(from);
}
if (!isUndefined(from._locale)) {
to._locale = from._locale;
}
if (momentProperties.length > 0) {
for (i = 0; i < momentProperties.length; i++) {
prop = momentProperties[i];
val = from[prop];
if (!isUndefined(val)) {
to[prop] = val;
}
}
}
return to;
}
var updateInProgress = false; // Moment prototype object
function Moment(config) {
copyConfig(this, config);
this._d = new Date(config._d != null ? config._d.getTime() : NaN);
if (!this.isValid()) {
this._d = new Date(NaN);
} // Prevent infinite loop in case updateOffset creates new moment
// objects.
if (updateInProgress === false) {
updateInProgress = true;
hooks.updateOffset(this);
updateInProgress = false;
}
}
function isMoment(obj) {
return obj instanceof Moment || obj != null && obj._isAMomentObject != null;
}
function absFloor(number) {
if (number < 0) {
// -0 -> 0
return Math.ceil(number) || 0;
} else {
return Math.floor(number);
}
}
function toInt(argumentForCoercion) {
var coercedNumber = +argumentForCoercion,
value = 0;
if (coercedNumber !== 0 && isFinite(coercedNumber)) {
value = absFloor(coercedNumber);
}
return value;
} // compare two arrays, return the number of differences
function compareArrays(array1, array2, dontConvert) {
var len = Math.min(array1.length, array2.length),
lengthDiff = Math.abs(array1.length - array2.length),
diffs = 0,
i;
for (i = 0; i < len; i++) {
if (dontConvert && array1[i] !== array2[i] || !dontConvert && toInt(array1[i]) !== toInt(array2[i])) {
diffs++;
}
}
return diffs + lengthDiff;
}
function warn(msg) {
if (hooks.suppressDeprecationWarnings === false && typeof console !== 'undefined' && console.warn) {
console.warn('Deprecation warning: ' + msg);
}
}
function deprecate(msg, fn) {
var firstTime = true;
return extend(function () {
if (hooks.deprecationHandler != null) {
hooks.deprecationHandler(null, msg);
}
if (firstTime) {
var args = [];
var arg;
for (var i = 0; i < arguments.length; i++) {
arg = '';
if (typeof arguments[i] === 'object') {
arg += '\n[' + i + '] ';
for (var key in arguments[0]) {
arg += key + ': ' + arguments[0][key] + ', ';
}
arg = arg.slice(0, -2); // Remove trailing comma and space
} else {
arg = arguments[i];
}
args.push(arg);
}
warn(msg + '\nArguments: ' + Array.prototype.slice.call(args).join('') + '\n' + new Error().stack);
firstTime = false;
}
return fn.apply(this, arguments);
}, fn);
}
var deprecations = {};
function deprecateSimple(name, msg) {
if (hooks.deprecationHandler != null) {
hooks.deprecationHandler(name, msg);
}
if (!deprecations[name]) {
warn(msg);
deprecations[name] = true;
}
}
hooks.suppressDeprecationWarnings = false;
hooks.deprecationHandler = null;
function isFunction(input) {
return input instanceof Function || Object.prototype.toString.call(input) === '[object Function]';
}
function set(config) {
var prop, i;
for (i in config) {
prop = config[i];
if (isFunction(prop)) {
this[i] = prop;
} else {
this['_' + i] = prop;
}
}
this._config = config; // Lenient ordinal parsing accepts just a number in addition to
// number + (possibly) stuff coming from _dayOfMonthOrdinalParse.
// TODO: Remove "ordinalParse" fallback in next major release.
this._dayOfMonthOrdinalParseLenient = new RegExp((this._dayOfMonthOrdinalParse.source || this._ordinalParse.source) + '|' + /\d{1,2}/.source);
}
function mergeConfigs(parentConfig, childConfig) {
var res = extend({}, parentConfig),
prop;
for (prop in childConfig) {
if (hasOwnProp(childConfig, prop)) {
if (isObject(parentConfig[prop]) && isObject(childConfig[prop])) {
res[prop] = {};
extend(res[prop], parentConfig[prop]);
extend(res[prop], childConfig[prop]);
} else if (childConfig[prop] != null) {
res[prop] = childConfig[prop];
} else {
delete res[prop];
}
}
}
for (prop in parentConfig) {
if (hasOwnProp(parentConfig, prop) && !hasOwnProp(childConfig, prop) && isObject(parentConfig[prop])) {
// make sure changes to properties don't modify parent config
res[prop] = extend({}, res[prop]);
}
}
return res;
}
function Locale(config) {
if (config != null) {
this.set(config);
}
}
var keys;
if (Object.keys) {
keys = Object.keys;
} else {
keys = function (obj) {
var i,
res = [];
for (i in obj) {
if (hasOwnProp(obj, i)) {
res.push(i);
}
}
return res;
};
}
var defaultCalendar = {
sameDay: '[Today at] LT',
nextDay: '[Tomorrow at] LT',
nextWeek: 'dddd [at] LT',
lastDay: '[Yesterday at] LT',
lastWeek: '[Last] dddd [at] LT',
sameElse: 'L'
};
function calendar(key, mom, now) {
var output = this._calendar[key] || this._calendar['sameElse'];
return isFunction(output) ? output.call(mom, now) : output;
}
var defaultLongDateFormat = {
LTS: 'h:mm:ss A',
LT: 'h:mm A',
L: 'MM/DD/YYYY',
LL: 'MMMM D, YYYY',
LLL: 'MMMM D, YYYY h:mm A',
LLLL: 'dddd, MMMM D, YYYY h:mm A'
};
function longDateFormat(key) {
var format = this._longDateFormat[key],
formatUpper = this._longDateFormat[key.toUpperCase()];
if (format || !formatUpper) {
return format;
}
this._longDateFormat[key] = formatUpper.replace(/MMMM|MM|DD|dddd/g, function (val) {
return val.slice(1);
});
return this._longDateFormat[key];
}
var defaultInvalidDate = 'Invalid date';
function invalidDate() {
return this._invalidDate;
}
var defaultOrdinal = '%d';
var defaultDayOfMonthOrdinalParse = /\d{1,2}/;
function ordinal(number) {
return this._ordinal.replace('%d', number);
}
var defaultRelativeTime = {
future: 'in %s',
past: '%s ago',
s: 'a few seconds',
ss: '%d seconds',
m: 'a minute',
mm: '%d minutes',
h: 'an hour',
hh: '%d hours',
d: 'a day',
dd: '%d days',
M: 'a month',
MM: '%d months',
y: 'a year',
yy: '%d years'
};
function relativeTime(number, withoutSuffix, string, isFuture) {
var output = this._relativeTime[string];
return isFunction(output) ? output(number, withoutSuffix, string, isFuture) : output.replace(/%d/i, number);
}
function pastFuture(diff, output) {
var format = this._relativeTime[diff > 0 ? 'future' : 'past'];
return isFunction(format) ? format(output) : format.replace(/%s/i, output);
}
var aliases = {};
function addUnitAlias(unit, shorthand) {
var lowerCase = unit.toLowerCase();
aliases[lowerCase] = aliases[lowerCase + 's'] = aliases[shorthand] = unit;
}
function normalizeUnits(units) {
return typeof units === 'string' ? aliases[units] || aliases[units.toLowerCase()] : undefined;
}
function normalizeObjectUnits(inputObject) {
var normalizedInput = {},
normalizedProp,
prop;
for (prop in inputObject) {
if (hasOwnProp(inputObject, prop)) {
normalizedProp = normalizeUnits(prop);
if (normalizedProp) {
normalizedInput[normalizedProp] = inputObject[prop];
}
}
}
return normalizedInput;
}
var priorities = {};
function addUnitPriority(unit, priority) {
priorities[unit] = priority;
}
function getPrioritizedUnits(unitsObj) {
var units = [];
for (var u in unitsObj) {
units.push({
unit: u,
priority: priorities[u]
});
}
units.sort(function (a, b) {
return a.priority - b.priority;
});
return units;
}
function zeroFill(number, targetLength, forceSign) {
var absNumber = '' + Math.abs(number),
zerosToFill = targetLength - absNumber.length,
sign = number >= 0;
return (sign ? forceSign ? '+' : '' : '-') + Math.pow(10, Math.max(0, zerosToFill)).toString().substr(1) + absNumber;
}
var formattingTokens = /(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g;
var localFormattingTokens = /(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g;
var formatFunctions = {};
var formatTokenFunctions = {}; // token: 'M'
// padded: ['MM', 2]
// ordinal: 'Mo'
// callback: function () { this.month() + 1 }
function addFormatToken(token, padded, ordinal, callback) {
var func = callback;
if (typeof callback === 'string') {
func = function () {
return this[callback]();
};
}
if (token) {
formatTokenFunctions[token] = func;
}
if (padded) {
formatTokenFunctions[padded[0]] = function () {
return zeroFill(func.apply(this, arguments), padded[1], padded[2]);
};
}
if (ordinal) {
formatTokenFunctions[ordinal] = function () {
return this.localeData().ordinal(func.apply(this, arguments), token);
};
}
}
function removeFormattingTokens(input) {
if (input.match(/\[[\s\S]/)) {
return input.replace(/^\[|\]$/g, '');
}
return input.replace(/\\/g, '');
}
function makeFormatFunction(format) {
var array = format.match(formattingTokens),
i,
length;
for (i = 0, length = array.length; i < length; i++) {
if (formatTokenFunctions[array[i]]) {
array[i] = formatTokenFunctions[array[i]];
} else {
array[i] = removeFormattingTokens(array[i]);
}
}
return function (mom) {
var output = '',
i;
for (i = 0; i < length; i++) {
output += isFunction(array[i]) ? array[i].call(mom, format) : array[i];
}
return output;
};
} // format date using native date object
function formatMoment(m, format) {
if (!m.isValid()) {
return m.localeData().invalidDate();
}
format = expandFormat(format, m.localeData());
formatFunctions[format] = formatFunctions[format] || makeFormatFunction(format);
return formatFunctions[format](m);
}
function expandFormat(format, locale) {
var i = 5;
function replaceLongDateFormatTokens(input) {
return locale.longDateFormat(input) || input;
}
localFormattingTokens.lastIndex = 0;
while (i >= 0 && localFormattingTokens.test(format)) {
format = format.replace(localFormattingTokens, replaceLongDateFormatTokens);
localFormattingTokens.lastIndex = 0;
i -= 1;
}
return format;
}
var match1 = /\d/; // 0 - 9
var match2 = /\d\d/; // 00 - 99
var match3 = /\d{3}/; // 000 - 999
var match4 = /\d{4}/; // 0000 - 9999
var match6 = /[+-]?\d{6}/; // -999999 - 999999
var match1to2 = /\d\d?/; // 0 - 99
var match3to4 = /\d\d\d\d?/; // 999 - 9999
var match5to6 = /\d\d\d\d\d\d?/; // 99999 - 999999
var match1to3 = /\d{1,3}/; // 0 - 999
var match1to4 = /\d{1,4}/; // 0 - 9999
var match1to6 = /[+-]?\d{1,6}/; // -999999 - 999999
var matchUnsigned = /\d+/; // 0 - inf
var matchSigned = /[+-]?\d+/; // -inf - inf
var matchOffset = /Z|[+-]\d\d:?\d\d/gi; // +00:00 -00:00 +0000 -0000 or Z
var matchShortOffset = /Z|[+-]\d\d(?::?\d\d)?/gi; // +00 -00 +00:00 -00:00 +0000 -0000 or Z
var matchTimestamp = /[+-]?\d+(\.\d{1,3})?/; // 123456789 123456789.123
// any word (or two) characters or numbers including two/three word month in arabic.
// includes scottish gaelic two word and hyphenated months
var matchWord = /[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i;
var regexes = {};
function addRegexToken(token, regex, strictRegex) {
regexes[token] = isFunction(regex) ? regex : function (isStrict, localeData) {
return isStrict && strictRegex ? strictRegex : regex;
};
}
function getParseRegexForToken(token, config) {
if (!hasOwnProp(regexes, token)) {
return new RegExp(unescapeFormat(token));
}
return regexes[token](config._strict, config._locale);
} // Code from http://stackoverflow.com/questions/3561493/is-there-a-regexp-escape-function-in-javascript
function unescapeFormat(s) {
return regexEscape(s.replace('\\', '').replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g, function (matched, p1, p2, p3, p4) {
return p1 || p2 || p3 || p4;
}));
}
function regexEscape(s) {
return s.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&');
}
var tokens = {};
function addParseToken(token, callback) {
var i,
func = callback;
if (typeof token === 'string') {
token = [token];
}
if (isNumber(callback)) {
func = function (input, array) {
array[callback] = toInt(input);
};
}
for (i = 0; i < token.length; i++) {
tokens[token[i]] = func;
}
}
function addWeekParseToken(token, callback) {
addParseToken(token, function (input, array, config, token) {
config._w = config._w || {};
callback(input, config._w, config, token);
});
}
function addTimeToArrayFromToken(token, input, config) {
if (input != null && hasOwnProp(tokens, token)) {
tokens[token](input, config._a, config, token);
}
}
var YEAR = 0;
var MONTH = 1;
var DATE = 2;
var HOUR = 3;
var MINUTE = 4;
var SECOND = 5;
var MILLISECOND = 6;
var WEEK = 7;
var WEEKDAY = 8; // FORMATTING
addFormatToken('Y', 0, 0, function () {
var y = this.year();
return y <= 9999 ? '' + y : '+' + y;
});
addFormatToken(0, ['YY', 2], 0, function () {
return this.year() % 100;
});
addFormatToken(0, ['YYYY', 4], 0, 'year');
addFormatToken(0, ['YYYYY', 5], 0, 'year');
addFormatToken(0, ['YYYYYY', 6, true], 0, 'year'); // ALIASES
addUnitAlias('year', 'y'); // PRIORITIES
addUnitPriority('year', 1); // PARSING
addRegexToken('Y', matchSigned);
addRegexToken('YY', match1to2, match2);
addRegexToken('YYYY', match1to4, match4);
addRegexToken('YYYYY', match1to6, match6);
addRegexToken('YYYYYY', match1to6, match6);
addParseToken(['YYYYY', 'YYYYYY'], YEAR);
addParseToken('YYYY', function (input, array) {
array[YEAR] = input.length === 2 ? hooks.parseTwoDigitYear(input) : toInt(input);
});
addParseToken('YY', function (input, array) {
array[YEAR] = hooks.parseTwoDigitYear(input);
});
addParseToken('Y', function (input, array) {
array[YEAR] = parseInt(input, 10);
}); // HELPERS
function daysInYear(year) {
return isLeapYear(year) ? 366 : 365;
}
function isLeapYear(year) {
return year % 4 === 0 && year % 100 !== 0 || year % 400 === 0;
} // HOOKS
hooks.parseTwoDigitYear = function (input) {
return toInt(input) + (toInt(input) > 68 ? 1900 : 2000);
}; // MOMENTS
var getSetYear = makeGetSet('FullYear', true);
function getIsLeapYear() {
return isLeapYear(this.year());
}
function makeGetSet(unit, keepTime) {
return function (value) {
if (value != null) {
set$1(this, unit, value);
hooks.updateOffset(this, keepTime);
return this;
} else {
return get(this, unit);
}
};
}
function get(mom, unit) {
return mom.isValid() ? mom._d['get' + (mom._isUTC ? 'UTC' : '') + unit]() : NaN;
}
function set$1(mom, unit, value) {
if (mom.isValid() && !isNaN(value)) {
if (unit === 'FullYear' && isLeapYear(mom.year()) && mom.month() === 1 && mom.date() === 29) {
mom._d['set' + (mom._isUTC ? 'UTC' : '') + unit](value, mom.month(), daysInMonth(value, mom.month()));
} else {
mom._d['set' + (mom._isUTC ? 'UTC' : '') + unit](value);
}
}
} // MOMENTS
function stringGet(units) {
units = normalizeUnits(units);
if (isFunction(this[units])) {
return this[units]();
}
return this;
}
function stringSet(units, value) {
if (typeof units === 'object') {
units = normalizeObjectUnits(units);
var prioritized = getPrioritizedUnits(units);
for (var i = 0; i < prioritized.length; i++) {
this[prioritized[i].unit](units[prioritized[i].unit]);
}
} else {
units = normalizeUnits(units);
if (isFunction(this[units])) {
return this[units](value);
}
}
return this;
}
function mod(n, x) {
return (n % x + x) % x;
}
var indexOf;
if (Array.prototype.indexOf) {
indexOf = Array.prototype.indexOf;
} else {
indexOf = function (o) {
// I know
var i;
for (i = 0; i < this.length; ++i) {
if (this[i] === o) {
return i;
}
}
return -1;
};
}
function daysInMonth(year, month) {
if (isNaN(year) || isNaN(month)) {
return NaN;
}
var modMonth = mod(month, 12);
year += (month - modMonth) / 12;
return modMonth === 1 ? isLeapYear(year) ? 29 : 28 : 31 - modMonth % 7 % 2;
} // FORMATTING
addFormatToken('M', ['MM', 2], 'Mo', function () {
return this.month() + 1;
});
addFormatToken('MMM', 0, 0, function (format) {
return this.localeData().monthsShort(this, format);
});
addFormatToken('MMMM', 0, 0, function (format) {
return this.localeData().months(this, format);
}); // ALIASES
addUnitAlias('month', 'M'); // PRIORITY
addUnitPriority('month', 8); // PARSING
addRegexToken('M', match1to2);
addRegexToken('MM', match1to2, match2);
addRegexToken('MMM', function (isStrict, locale) {
return locale.monthsShortRegex(isStrict);
});
addRegexToken('MMMM', function (isStrict, locale) {
return locale.monthsRegex(isStrict);
});
addParseToken(['M', 'MM'], function (input, array) {
array[MONTH] = toInt(input) - 1;
});
addParseToken(['MMM', 'MMMM'], function (input, array, config, token) {
var month = config._locale.monthsParse(input, token, config._strict); // if we didn't find a month name, mark the date as invalid.
if (month != null) {
array[MONTH] = month;
} else {
getParsingFlags(config).invalidMonth = input;
}
}); // LOCALES
var MONTHS_IN_FORMAT = /D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/;
var defaultLocaleMonths = 'January_February_March_April_May_June_July_August_September_October_November_December'.split('_');
function localeMonths(m, format) {
if (!m) {
return isArray(this._months) ? this._months : this._months['standalone'];
}
return isArray(this._months) ? this._months[m.month()] : this._months[(this._months.isFormat || MONTHS_IN_FORMAT).test(format) ? 'format' : 'standalone'][m.month()];
}
var defaultLocaleMonthsShort = 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_');
function localeMonthsShort(m, format) {
if (!m) {
return isArray(this._monthsShort) ? this._monthsShort : this._monthsShort['standalone'];
}
return isArray(this._monthsShort) ? this._monthsShort[m.month()] : this._monthsShort[MONTHS_IN_FORMAT.test(format) ? 'format' : 'standalone'][m.month()];
}
function handleStrictParse(monthName, format, strict) {
var i,
ii,
mom,
llc = monthName.toLocaleLowerCase();
if (!this._monthsParse) {
// this is not used
this._monthsParse = [];
this._longMonthsParse = [];
this._shortMonthsParse = [];
for (i = 0; i < 12; ++i) {
mom = createUTC([2000, i]);
this._shortMonthsParse[i] = this.monthsShort(mom, '').toLocaleLowerCase();
this._longMonthsParse[i] = this.months(mom, '').toLocaleLowerCase();
}
}
if (strict) {
if (format === 'MMM') {
ii = indexOf.call(this._shortMonthsParse, llc);
return ii !== -1 ? ii : null;
} else {
ii = indexOf.call(this._longMonthsParse, llc);
return ii !== -1 ? ii : null;
}
} else {
if (format === 'MMM') {
ii = indexOf.call(this._shortMonthsParse, llc);
if (ii !== -1) {
return ii;
}
ii = indexOf.call(this._longMonthsParse, llc);
return ii !== -1 ? ii : null;
} else {
ii = indexOf.call(this._longMonthsParse, llc);
if (ii !== -1) {
return ii;
}
ii = indexOf.call(this._shortMonthsParse, llc);
return ii !== -1 ? ii : null;
}
}
}
function localeMonthsParse(monthName, format, strict) {
var i, mom, regex;
if (this._monthsParseExact) {
return handleStrictParse.call(this, monthName, format, strict);
}
if (!this._monthsParse) {
this._monthsParse = [];
this._longMonthsParse = [];
this._shortMonthsParse = [];
} // TODO: add sorting
// Sorting makes sure if one month (or abbr) is a prefix of another
// see sorting in computeMonthsParse
for (i = 0; i < 12; i++) {
// make the regex if we don't have it already
mom = createUTC([2000, i]);
if (strict && !this._longMonthsParse[i]) {
this._longMonthsParse[i] = new RegExp('^' + this.months(mom, '').replace('.', '') + '$', 'i');
this._shortMonthsParse[i] = new RegExp('^' + this.monthsShort(mom, '').replace('.', '') + '$', 'i');
}
if (!strict && !this._monthsParse[i]) {
regex = '^' + this.months(mom, '') + '|^' + this.monthsShort(mom, '');
this._monthsParse[i] = new RegExp(regex.replace('.', ''), 'i');
} // test the regex
if (strict && format === 'MMMM' && this._longMonthsParse[i].test(monthName)) {
return i;
} else if (strict && format === 'MMM' && this._shortMonthsParse[i].test(monthName)) {
return i;
} else if (!strict && this._monthsParse[i].test(monthName)) {
return i;
}
}
} // MOMENTS
function setMonth(mom, value) {
var dayOfMonth;
if (!mom.isValid()) {
// No op
return mom;
}
if (typeof value === 'string') {
if (/^\d+$/.test(value)) {
value = toInt(value);
} else {
value = mom.localeData().monthsParse(value); // TODO: Another silent failure?
if (!isNumber(value)) {
return mom;
}
}
}
dayOfMonth = Math.min(mom.date(), daysInMonth(mom.year(), value));
mom._d['set' + (mom._isUTC ? 'UTC' : '') + 'Month'](value, dayOfMonth);
return mom;
}
function getSetMonth(value) {
if (value != null) {
setMonth(this, value);
hooks.updateOffset(this, true);
return this;
} else {
return get(this, 'Month');
}
}
function getDaysInMonth() {
return daysInMonth(this.year(), this.month());
}
var defaultMonthsShortRegex = matchWord;
function monthsShortRegex(isStrict) {
if (this._monthsParseExact) {
if (!hasOwnProp(this, '_monthsRegex')) {
computeMonthsParse.call(this);
}
if (isStrict) {
return this._monthsShortStrictRegex;
} else {
return this._monthsShortRegex;
}
} else {
if (!hasOwnProp(this, '_monthsShortRegex')) {
this._monthsShortRegex = defaultMonthsShortRegex;
}
return this._monthsShortStrictRegex && isStrict ? this._monthsShortStrictRegex : this._monthsShortRegex;
}
}
var defaultMonthsRegex = matchWord;
function monthsRegex(isStrict) {
if (this._monthsParseExact) {
if (!hasOwnProp(this, '_monthsRegex')) {
computeMonthsParse.call(this);
}
if (isStrict) {
return this._monthsStrictRegex;
} else {
return this._monthsRegex;
}
} else {
if (!hasOwnProp(this, '_monthsRegex')) {
this._monthsRegex = defaultMonthsRegex;
}
return this._monthsStrictRegex && isStrict ? this._monthsStrictRegex : this._monthsRegex;
}
}
function computeMonthsParse() {
function cmpLenRev(a, b) {
return b.length - a.length;
}
var shortPieces = [],
longPieces = [],
mixedPieces = [],
i,
mom;
for (i = 0; i < 12; i++) {
// make the regex if we don't have it already
mom = createUTC([2000, i]);
shortPieces.push(this.monthsShort(mom, ''));
longPieces.push(this.months(mom, ''));
mixedPieces.push(this.months(mom, ''));
mixedPieces.push(this.monthsShort(mom, ''));
} // Sorting makes sure if one month (or abbr) is a prefix of another it
// will match the longer piece.
shortPieces.sort(cmpLenRev);
longPieces.sort(cmpLenRev);
mixedPieces.sort(cmpLenRev);
for (i = 0; i < 12; i++) {
shortPieces[i] = regexEscape(shortPieces[i]);
longPieces[i] = regexEscape(longPieces[i]);
}
for (i = 0; i < 24; i++) {
mixedPieces[i] = regexEscape(mixedPieces[i]);
}
this._monthsRegex = new RegExp('^(' + mixedPieces.join('|') + ')', 'i');
this._monthsShortRegex = this._monthsRegex;
this._monthsStrictRegex = new RegExp('^(' + longPieces.join('|') + ')', 'i');
this._monthsShortStrictRegex = new RegExp('^(' + shortPieces.join('|') + ')', 'i');
}
function createDate(y, m, d, h, M, s, ms) {
// can't just apply() to create a date:
// https://stackoverflow.com/q/181348
var date; // the date constructor remaps years 0-99 to 1900-1999
if (y < 100 && y >= 0) {
// preserve leap years using a full 400 year cycle, then reset
date = new Date(y + 400, m, d, h, M, s, ms);
if (isFinite(date.getFullYear())) {
date.setFullYear(y);
}
} else {
date = new Date(y, m, d, h, M, s, ms);
}
return date;
}
function createUTCDate(y) {
var date; // the Date.UTC function remaps years 0-99 to 1900-1999
if (y < 100 && y >= 0) {
var args = Array.prototype.slice.call(arguments); // preserve leap years using a full 400 year cycle, then reset
args[0] = y + 400;
date = new Date(Date.UTC.apply(null, args));
if (isFinite(date.getUTCFullYear())) {
date.setUTCFullYear(y);
}
} else {
date = new Date(Date.UTC.apply(null, arguments));
}
return date;
} // start-of-first-week - start-of-year
function firstWeekOffset(year, dow, doy) {
var // first-week day -- which january is always in the first week (4 for iso, 1 for other)
fwd = 7 + dow - doy,
// first-week day local weekday -- which local weekday is fwd
fwdlw = (7 + createUTCDate(year, 0, fwd).getUTCDay() - dow) % 7;
return -fwdlw + fwd - 1;
} // https://en.wikipedia.org/wiki/ISO_week_date#Calculating_a_date_given_the_year.2C_week_number_and_weekday
function dayOfYearFromWeeks(year, week, weekday, dow, doy) {
var localWeekday = (7 + weekday - dow) % 7,
weekOffset = firstWeekOffset(year, dow, doy),
dayOfYear = 1 + 7 * (week - 1) + localWeekday + weekOffset,
resYear,
resDayOfYear;
if (dayOfYear <= 0) {
resYear = year - 1;
resDayOfYear = daysInYear(resYear) + dayOfYear;
} else if (dayOfYear > daysInYear(year)) {
resYear = year + 1;
resDayOfYear = dayOfYear - daysInYear(year);
} else {
resYear = year;
resDayOfYear = dayOfYear;
}
return {
year: resYear,
dayOfYear: resDayOfYear
};
}
function weekOfYear(mom, dow, doy) {
var weekOffset = firstWeekOffset(mom.year(), dow, doy),
week = Math.floor((mom.dayOfYear() - weekOffset - 1) / 7) + 1,
resWeek,
resYear;
if (week < 1) {
resYear = mom.year() - 1;
resWeek = week + weeksInYear(resYear, dow, doy);
} else if (week > weeksInYear(mom.year(), dow, doy)) {
resWeek = week - weeksInYear(mom.year(), dow, doy);
resYear = mom.year() + 1;
} else {
resYear = mom.year();
resWeek = week;
}
return {
week: resWeek,
year: resYear
};
}
function weeksInYear(year, dow, doy) {
var weekOffset = firstWeekOffset(year, dow, doy),
weekOffsetNext = firstWeekOffset(year + 1, dow, doy);
return (daysInYear(year) - weekOffset + weekOffsetNext) / 7;
} // FORMATTING
addFormatToken('w', ['ww', 2], 'wo', 'week');
addFormatToken('W', ['WW', 2], 'Wo', 'isoWeek'); // ALIASES
addUnitAlias('week', 'w');
addUnitAlias('isoWeek', 'W'); // PRIORITIES
addUnitPriority('week', 5);
addUnitPriority('isoWeek', 5); // PARSING
addRegexToken('w', match1to2);
addRegexToken('ww', match1to2, match2);
addRegexToken('W', match1to2);
addRegexToken('WW', match1to2, match2);
addWeekParseToken(['w', 'ww', 'W', 'WW'], function (input, week, config, token) {
week[token.substr(0, 1)] = toInt(input);
}); // HELPERS
// LOCALES
function localeWeek(mom) {
return weekOfYear(mom, this._week.dow, this._week.doy).week;
}
var defaultLocaleWeek = {
dow: 0,
// Sunday is the first day of the week.
doy: 6 // The week that contains Jan 6th is the first week of the year.
};
function localeFirstDayOfWeek() {
return this._week.dow;
}
function localeFirstDayOfYear() {
return this._week.doy;
} // MOMENTS
function getSetWeek(input) {
var week = this.localeData().week(this);
return input == null ? week : this.add((input - week) * 7, 'd');
}
function getSetISOWeek(input) {
var week = weekOfYear(this, 1, 4).week;
return input == null ? week : this.add((input - week) * 7, 'd');
} // FORMATTING
addFormatToken('d', 0, 'do', 'day');
addFormatToken('dd', 0, 0, function (format) {
return this.localeData().weekdaysMin(this, format);
});
addFormatToken('ddd', 0, 0, function (format) {
return this.localeData().weekdaysShort(this, format);
});
addFormatToken('dddd', 0, 0, function (format) {
return this.localeData().weekdays(this, format);
});
addFormatToken('e', 0, 0, 'weekday');
addFormatToken('E', 0, 0, 'isoWeekday'); // ALIASES
addUnitAlias('day', 'd');
addUnitAlias('weekday', 'e');
addUnitAlias('isoWeekday', 'E'); // PRIORITY
addUnitPriority('day', 11);
addUnitPriority('weekday', 11);
addUnitPriority('isoWeekday', 11); // PARSING
addRegexToken('d', match1to2);
addRegexToken('e', match1to2);
addRegexToken('E', match1to2);
addRegexToken('dd', function (isStrict, locale) {
return locale.weekdaysMinRegex(isStrict);
});
addRegexToken('ddd', function (isStrict, locale) {
return locale.weekdaysShortRegex(isStrict);
});
addRegexToken('dddd', function (isStrict, locale) {
return locale.weekdaysRegex(isStrict);
});
addWeekParseToken(['dd', 'ddd', 'dddd'], function (input, week, config, token) {
var weekday = config._locale.weekdaysParse(input, token, config._strict); // if we didn't get a weekday name, mark the date as invalid
if (weekday != null) {
week.d = weekday;
} else {
getParsingFlags(config).invalidWeekday = input;
}
});
addWeekParseToken(['d', 'e', 'E'], function (input, week, config, token) {
week[token] = toInt(input);
}); // HELPERS
function parseWeekday(input, locale) {
if (typeof input !== 'string') {
return input;
}
if (!isNaN(input)) {
return parseInt(input, 10);
}
input = locale.weekdaysParse(input);
if (typeof input === 'number') {
return input;
}
return null;
}
function parseIsoWeekday(input, locale) {
if (typeof input === 'string') {
return locale.weekdaysParse(input) % 7 || 7;
}
return isNaN(input) ? null : input;
} // LOCALES
function shiftWeekdays(ws, n) {
return ws.slice(n, 7).concat(ws.slice(0, n));
}
var defaultLocaleWeekdays = 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_');
function localeWeekdays(m, format) {
var weekdays = isArray(this._weekdays) ? this._weekdays : this._weekdays[m && m !== true && this._weekdays.isFormat.test(format) ? 'format' : 'standalone'];
return m === true ? shiftWeekdays(weekdays, this._week.dow) : m ? weekdays[m.day()] : weekdays;
}
var defaultLocaleWeekdaysShort = 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_');
function localeWeekdaysShort(m) {
return m === true ? shiftWeekdays(this._weekdaysShort, this._week.dow) : m ? this._weekdaysShort[m.day()] : this._weekdaysShort;
}
var defaultLocaleWeekdaysMin = 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_');
function localeWeekdaysMin(m) {
return m === true ? shiftWeekdays(this._weekdaysMin, this._week.dow) : m ? this._weekdaysMin[m.day()] : this._weekdaysMin;
}
function handleStrictParse$1(weekdayName, format, strict) {
var i,
ii,
mom,
llc = weekdayName.toLocaleLowerCase();
if (!this._weekdaysParse) {
this._weekdaysParse = [];
this._shortWeekdaysParse = [];
this._minWeekdaysParse = [];
for (i = 0; i < 7; ++i) {
mom = createUTC([2000, 1]).day(i);
this._minWeekdaysParse[i] = this.weekdaysMin(mom, '').toLocaleLowerCase();
this._shortWeekdaysParse[i] = this.weekdaysShort(mom, '').toLocaleLowerCase();
this._weekdaysParse[i] = this.weekdays(mom, '').toLocaleLowerCase();
}
}
if (strict) {
if (format === 'dddd') {
ii = indexOf.call(this._weekdaysParse, llc);
return ii !== -1 ? ii : null;
} else if (format === 'ddd') {
ii = indexOf.call(this._shortWeekdaysParse, llc);
return ii !== -1 ? ii : null;
} else {
ii = indexOf.call(this._minWeekdaysParse, llc);
return ii !== -1 ? ii : null;
}
} else {
if (format === 'dddd') {
ii = indexOf.call(this._weekdaysParse, llc);
if (ii !== -1) {
return ii;
}
ii = indexOf.call(this._shortWeekdaysParse, llc);
if (ii !== -1) {
return ii;
}
ii = indexOf.call(this._minWeekdaysParse, llc);
return ii !== -1 ? ii : null;
} else if (format === 'ddd') {
ii = indexOf.call(this._shortWeekdaysParse, llc);
if (ii !== -1) {
return ii;
}
ii = indexOf.call(this._weekdaysParse, llc);
if (ii !== -1) {
return ii;
}
ii = indexOf.call(this._minWeekdaysParse, llc);
return ii !== -1 ? ii : null;
} else {
ii = indexOf.call(this._minWeekdaysParse, llc);
if (ii !== -1) {
return ii;
}
ii = indexOf.call(this._weekdaysParse, llc);
if (ii !== -1) {
return ii;
}
ii = indexOf.call(this._shortWeekdaysParse, llc);
return ii !== -1 ? ii : null;
}
}
}
function localeWeekdaysParse(weekdayName, format, strict) {
var i, mom, regex;
if (this._weekdaysParseExact) {
return handleStrictParse$1.call(this, weekdayName, format, strict);
}
if (!this._weekdaysParse) {
this._weekdaysParse = [];
this._minWeekdaysParse = [];
this._shortWeekdaysParse = [];
this._fullWeekdaysParse = [];
}
for (i = 0; i < 7; i++) {
// make the regex if we don't have it already
mom = createUTC([2000, 1]).day(i);
if (strict && !this._fullWeekdaysParse[i]) {
this._fullWeekdaysParse[i] = new RegExp('^' + this.weekdays(mom, '').replace('.', '\\.?') + '$', 'i');
this._shortWeekdaysParse[i] = new RegExp('^' + this.weekdaysShort(mom, '').replace('.', '\\.?') + '$', 'i');
this._minWeekdaysParse[i] = new RegExp('^' + this.weekdaysMin(mom, '').replace('.', '\\.?') + '$', 'i');
}
if (!this._weekdaysParse[i]) {
regex = '^' + this.weekdays(mom, '') + '|^' + this.weekdaysShort(mom, '') + '|^' + this.weekdaysMin(mom, '');
this._weekdaysParse[i] = new RegExp(regex.replace('.', ''), 'i');
} // test the regex
if (strict && format === 'dddd' && this._fullWeekdaysParse[i].test(weekdayName)) {
return i;
} else if (strict && format === 'ddd' && this._shortWeekdaysParse[i].test(weekdayName)) {
return i;
} else if (strict && format === 'dd' && this._minWeekdaysParse[i].test(weekdayName)) {
return i;
} else if (!strict && this._weekdaysParse[i].test(weekdayName)) {
return i;
}
}
} // MOMENTS
function getSetDayOfWeek(input) {
if (!this.isValid()) {
return input != null ? this : NaN;
}
var day = this._isUTC ? this._d.getUTCDay() : this._d.getDay();
if (input != null) {
input = parseWeekday(input, this.localeData());
return this.add(input - day, 'd');
} else {
return day;
}
}
function getSetLocaleDayOfWeek(input) {
if (!this.isValid()) {
return input != null ? this : NaN;
}
var weekday = (this.day() + 7 - this.localeData()._week.dow) % 7;
return input == null ? weekday : this.add(input - weekday, 'd');
}
function getSetISODayOfWeek(input) {
if (!this.isValid()) {
return input != null ? this : NaN;
} // behaves the same as moment#day except
// as a getter, returns 7 instead of 0 (1-7 range instead of 0-6)
// as a setter, sunday should belong to the previous week.
if (input != null) {
var weekday = parseIsoWeekday(input, this.localeData());
return this.day(this.day() % 7 ? weekday : weekday - 7);
} else {
return this.day() || 7;
}
}
var defaultWeekdaysRegex = matchWord;
function weekdaysRegex(isStrict) {
if (this._weekdaysParseExact) {
if (!hasOwnProp(this, '_weekdaysRegex')) {
computeWeekdaysParse.call(this);
}
if (isStrict) {
return this._weekdaysStrictRegex;
} else {
return this._weekdaysRegex;
}
} else {
if (!hasOwnProp(this, '_weekdaysRegex')) {
this._weekdaysRegex = defaultWeekdaysRegex;
}
return this._weekdaysStrictRegex && isStrict ? this._weekdaysStrictRegex : this._weekdaysRegex;
}
}
var defaultWeekdaysShortRegex = matchWord;
function weekdaysShortRegex(isStrict) {
if (this._weekdaysParseExact) {
if (!hasOwnProp(this, '_weekdaysRegex')) {
computeWeekdaysParse.call(this);
}
if (isStrict) {
return this._weekdaysShortStrictRegex;
} else {
return this._weekdaysShortRegex;
}
} else {
if (!hasOwnProp(this, '_weekdaysShortRegex')) {
this._weekdaysShortRegex = defaultWeekdaysShortRegex;
}
return this._weekdaysShortStrictRegex && isStrict ? this._weekdaysShortStrictRegex : this._weekdaysShortRegex;
}
}
var defaultWeekdaysMinRegex = matchWord;
function weekdaysMinRegex(isStrict) {
if (this._weekdaysParseExact) {
if (!hasOwnProp(this, '_weekdaysRegex')) {
computeWeekdaysParse.call(this);
}
if (isStrict) {
return this._weekdaysMinStrictRegex;
} else {
return this._weekdaysMinRegex;
}
} else {
if (!hasOwnProp(this, '_weekdaysMinRegex')) {
this._weekdaysMinRegex = defaultWeekdaysMinRegex;
}
return this._weekdaysMinStrictRegex && isStrict ? this._weekdaysMinStrictRegex : this._weekdaysMinRegex;
}
}
function computeWeekdaysParse() {
function cmpLenRev(a, b) {
return b.length - a.length;
}
var minPieces = [],
shortPieces = [],
longPieces = [],
mixedPieces = [],
i,
mom,
minp,
shortp,
longp;
for (i = 0; i < 7; i++) {
// make the regex if we don't have it already
mom = createUTC([2000, 1]).day(i);
minp = this.weekdaysMin(mom, '');
shortp = this.weekdaysShort(mom, '');
longp = this.weekdays(mom, '');
minPieces.push(minp);
shortPieces.push(shortp);
longPieces.push(longp);
mixedPieces.push(minp);
mixedPieces.push(shortp);
mixedPieces.push(longp);
} // Sorting makes sure if one weekday (or abbr) is a prefix of another it
// will match the longer piece.
minPieces.sort(cmpLenRev);
shortPieces.sort(cmpLenRev);
longPieces.sort(cmpLenRev);
mixedPieces.sort(cmpLenRev);
for (i = 0; i < 7; i++) {
shortPieces[i] = regexEscape(shortPieces[i]);
longPieces[i] = regexEscape(longPieces[i]);
mixedPieces[i] = regexEscape(mixedPieces[i]);
}
this._weekdaysRegex = new RegExp('^(' + mixedPieces.join('|') + ')', 'i');
this._weekdaysShortRegex = this._weekdaysRegex;
this._weekdaysMinRegex = this._weekdaysRegex;
this._weekdaysStrictRegex = new RegExp('^(' + longPieces.join('|') + ')', 'i');
this._weekdaysShortStrictRegex = new RegExp('^(' + shortPieces.join('|') + ')', 'i');
this._weekdaysMinStrictRegex = new RegExp('^(' + minPieces.join('|') + ')', 'i');
} // FORMATTING
function hFormat() {
return this.hours() % 12 || 12;
}
function kFormat() {
return this.hours() || 24;
}
addFormatToken('H', ['HH', 2], 0, 'hour');
addFormatToken('h', ['hh', 2], 0, hFormat);
addFormatToken('k', ['kk', 2], 0, kFormat);
addFormatToken('hmm', 0, 0, function () {
return '' + hFormat.apply(this) + zeroFill(this.minutes(), 2);
});
addFormatToken('hmmss', 0, 0, function () {
return '' + hFormat.apply(this) + zeroFill(this.minutes(), 2) + zeroFill(this.seconds(), 2);
});
addFormatToken('Hmm', 0, 0, function () {
return '' + this.hours() + zeroFill(this.minutes(), 2);
});
addFormatToken('Hmmss', 0, 0, function () {
return '' + this.hours() + zeroFill(this.minutes(), 2) + zeroFill(this.seconds(), 2);
});
function meridiem(token, lowercase) {
addFormatToken(token, 0, 0, function () {
return this.localeData().meridiem(this.hours(), this.minutes(), lowercase);
});
}
meridiem('a', true);
meridiem('A', false); // ALIASES
addUnitAlias('hour', 'h'); // PRIORITY
addUnitPriority('hour', 13); // PARSING
function matchMeridiem(isStrict, locale) {
return locale._meridiemParse;
}
addRegexToken('a', matchMeridiem);
addRegexToken('A', matchMeridiem);
addRegexToken('H', match1to2);
addRegexToken('h', match1to2);
addRegexToken('k', match1to2);
addRegexToken('HH', match1to2, match2);
addRegexToken('hh', match1to2, match2);
addRegexToken('kk', match1to2, match2);
addRegexToken('hmm', match3to4);
addRegexToken('hmmss', match5to6);
addRegexToken('Hmm', match3to4);
addRegexToken('Hmmss', match5to6);
addParseToken(['H', 'HH'], HOUR);
addParseToken(['k', 'kk'], function (input, array, config) {
var kInput = toInt(input);
array[HOUR] = kInput === 24 ? 0 : kInput;
});
addParseToken(['a', 'A'], function (input, array, config) {
config._isPm = config._locale.isPM(input);
config._meridiem = input;
});
addParseToken(['h', 'hh'], function (input, array, config) {
array[HOUR] = toInt(input);
getParsingFlags(config).bigHour = true;
});
addParseToken('hmm', function (input, array, config) {
var pos = input.length - 2;
array[HOUR] = toInt(input.substr(0, pos));
array[MINUTE] = toInt(input.substr(pos));
getParsingFlags(config).bigHour = true;
});
addParseToken('hmmss', function (input, array, config) {
var pos1 = input.length - 4;
var pos2 = input.length - 2;
array[HOUR] = toInt(input.substr(0, pos1));
array[MINUTE] = toInt(input.substr(pos1, 2));
array[SECOND] = toInt(input.substr(pos2));
getParsingFlags(config).bigHour = true;
});
addParseToken('Hmm', function (input, array, config) {
var pos = input.length - 2;
array[HOUR] = toInt(input.substr(0, pos));
array[MINUTE] = toInt(input.substr(pos));
});
addParseToken('Hmmss', function (input, array, config) {
var pos1 = input.length - 4;
var pos2 = input.length - 2;
array[HOUR] = toInt(input.substr(0, pos1));
array[MINUTE] = toInt(input.substr(pos1, 2));
array[SECOND] = toInt(input.substr(pos2));
}); // LOCALES
function localeIsPM(input) {
// IE8 Quirks Mode & IE7 Standards Mode do not allow accessing strings like arrays
// Using charAt should be more compatible.
return (input + '').toLowerCase().charAt(0) === 'p';
}
var defaultLocaleMeridiemParse = /[ap]\.?m?\.?/i;
function localeMeridiem(hours, minutes, isLower) {
if (hours > 11) {
return isLower ? 'pm' : 'PM';
} else {
return isLower ? 'am' : 'AM';
}
} // MOMENTS
// Setting the hour should keep the time, because the user explicitly
// specified which hour they want. So trying to maintain the same hour (in
// a new timezone) makes sense. Adding/subtracting hours does not follow
// this rule.
var getSetHour = makeGetSet('Hours', true);
var baseConfig = {
calendar: defaultCalendar,
longDateFormat: defaultLongDateFormat,
invalidDate: defaultInvalidDate,
ordinal: defaultOrdinal,
dayOfMonthOrdinalParse: defaultDayOfMonthOrdinalParse,
relativeTime: defaultRelativeTime,
months: defaultLocaleMonths,
monthsShort: defaultLocaleMonthsShort,
week: defaultLocaleWeek,
weekdays: defaultLocaleWeekdays,
weekdaysMin: defaultLocaleWeekdaysMin,
weekdaysShort: defaultLocaleWeekdaysShort,
meridiemParse: defaultLocaleMeridiemParse
}; // internal storage for locale config files
var locales = {};
var localeFamilies = {};
var globalLocale;
function normalizeLocale(key) {
return key ? key.toLowerCase().replace('_', '-') : key;
} // pick the locale from the array
// try ['en-au', 'en-gb'] as 'en-au', 'en-gb', 'en', as in move through the list trying each
// substring from most specific to least, but move to the next array item if it's a more specific variant than the current root
function chooseLocale(names) {
var i = 0,
j,
next,
locale,
split;
while (i < names.length) {
split = normalizeLocale(names[i]).split('-');
j = split.length;
next = normalizeLocale(names[i + 1]);
next = next ? next.split('-') : null;
while (j > 0) {
locale = loadLocale(split.slice(0, j).join('-'));
if (locale) {
return locale;
}
if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {
//the next array item is better than a shallower substring of this one
break;
}
j--;
}
i++;
}
return globalLocale;
}
function loadLocale(name) {
var oldLocale = null; // TODO: Find a better way to register and load all the locales in Node
if (!locales[name] && typeof module !== 'undefined' && module && module.exports) {
try {
oldLocale = globalLocale._abbr;
var aliasedRequire = require;
__webpack_require__("./node_modules/moment/locale sync recursive ^\\.\\/.*$")("./" + name);
getSetGlobalLocale(oldLocale);
} catch (e) {}
}
return locales[name];
} // This function will load locale and then set the global locale. If
// no arguments are passed in, it will simply return the current global
// locale key.
function getSetGlobalLocale(key, values) {
var data;
if (key) {
if (isUndefined(values)) {
data = getLocale(key);
} else {
data = defineLocale(key, values);
}
if (data) {
// moment.duration._locale = moment._locale = data;
globalLocale = data;
} else {
if (typeof console !== 'undefined' && console.warn) {
//warn user if arguments are passed but the locale could not be set
console.warn('Locale ' + key + ' not found. Did you forget to load it?');
}
}
}
return globalLocale._abbr;
}
function defineLocale(name, config) {
if (config !== null) {
var locale,
parentConfig = baseConfig;
config.abbr = name;
if (locales[name] != null) {
deprecateSimple('defineLocaleOverride', 'use moment.updateLocale(localeName, config) to change ' + 'an existing locale. moment.defineLocale(localeName, ' + 'config) should only be used for creating a new locale ' + 'See http://momentjs.com/guides/#/warnings/define-locale/ for more info.');
parentConfig = locales[name]._config;
} else if (config.parentLocale != null) {
if (locales[config.parentLocale] != null) {
parentConfig = locales[config.parentLocale]._config;
} else {
locale = loadLocale(config.parentLocale);
if (locale != null) {
parentConfig = locale._config;
} else {
if (!localeFamilies[config.parentLocale]) {
localeFamilies[config.parentLocale] = [];
}
localeFamilies[config.parentLocale].push({
name: name,
config: config
});
return null;
}
}
}
locales[name] = new Locale(mergeConfigs(parentConfig, config));
if (localeFamilies[name]) {
localeFamilies[name].forEach(function (x) {
defineLocale(x.name, x.config);
});
} // backwards compat for now: also set the locale
// make sure we set the locale AFTER all child locales have been
// created, so we won't end up with the child locale set.
getSetGlobalLocale(name);
return locales[name];
} else {
// useful for testing
delete locales[name];
return null;
}
}
function updateLocale(name, config) {
if (config != null) {
var locale,
tmpLocale,
parentConfig = baseConfig; // MERGE
tmpLocale = loadLocale(name);
if (tmpLocale != null) {
parentConfig = tmpLocale._config;
}
config = mergeConfigs(parentConfig, config);
locale = new Locale(config);
locale.parentLocale = locales[name];
locales[name] = locale; // backwards compat for now: also set the locale
getSetGlobalLocale(name);
} else {
// pass null for config to unupdate, useful for tests
if (locales[name] != null) {
if (locales[name].parentLocale != null) {
locales[name] = locales[name].parentLocale;
} else if (locales[name] != null) {
delete locales[name];
}
}
}
return locales[name];
} // returns locale data
function getLocale(key) {
var locale;
if (key && key._locale && key._locale._abbr) {
key = key._locale._abbr;
}
if (!key) {
return globalLocale;
}
if (!isArray(key)) {
//short-circuit everything else
locale = loadLocale(key);
if (locale) {
return locale;
}
key = [key];
}
return chooseLocale(key);
}
function listLocales() {
return keys(locales);
}
function checkOverflow(m) {
var overflow;
var a = m._a;
if (a && getParsingFlags(m).overflow === -2) {
overflow = a[MONTH] < 0 || a[MONTH] > 11 ? MONTH : a[DATE] < 1 || a[DATE] > daysInMonth(a[YEAR], a[MONTH]) ? DATE : a[HOUR] < 0 || a[HOUR] > 24 || a[HOUR] === 24 && (a[MINUTE] !== 0 || a[SECOND] !== 0 || a[MILLISECOND] !== 0) ? HOUR : a[MINUTE] < 0 || a[MINUTE] > 59 ? MINUTE : a[SECOND] < 0 || a[SECOND] > 59 ? SECOND : a[MILLISECOND] < 0 || a[MILLISECOND] > 999 ? MILLISECOND : -1;
if (getParsingFlags(m)._overflowDayOfYear && (overflow < YEAR || overflow > DATE)) {
overflow = DATE;
}
if (getParsingFlags(m)._overflowWeeks && overflow === -1) {
overflow = WEEK;
}
if (getParsingFlags(m)._overflowWeekday && overflow === -1) {
overflow = WEEKDAY;
}
getParsingFlags(m).overflow = overflow;
}
return m;
} // Pick the first defined of two or three arguments.
function defaults(a, b, c) {
if (a != null) {
return a;
}
if (b != null) {
return b;
}
return c;
}
function currentDateArray(config) {
// hooks is actually the exported moment object
var nowValue = new Date(hooks.now());
if (config._useUTC) {
return [nowValue.getUTCFullYear(), nowValue.getUTCMonth(), nowValue.getUTCDate()];
}
return [nowValue.getFullYear(), nowValue.getMonth(), nowValue.getDate()];
} // convert an array to a date.
// the array should mirror the parameters below
// note: all values past the year are optional and will default to the lowest possible value.
// [year, month, day , hour, minute, second, millisecond]
function configFromArray(config) {
var i,
date,
input = [],
currentDate,
expectedWeekday,
yearToUse;
if (config._d) {
return;
}
currentDate = currentDateArray(config); //compute day of the year from weeks and weekdays
if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {
dayOfYearFromWeekInfo(config);
} //if the day of the year is set, figure out what it is
if (config._dayOfYear != null) {
yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);
if (config._dayOfYear > daysInYear(yearToUse) || config._dayOfYear === 0) {
getParsingFlags(config)._overflowDayOfYear = true;
}
date = createUTCDate(yearToUse, 0, config._dayOfYear);
config._a[MONTH] = date.getUTCMonth();
config._a[DATE] = date.getUTCDate();
} // Default to current date.
// * if no year, month, day of month are given, default to today
// * if day of month is given, default month and year
// * if month is given, default only year
// * if year is given, don't default anything
for (i = 0; i < 3 && config._a[i] == null; ++i) {
config._a[i] = input[i] = currentDate[i];
} // Zero out whatever was not defaulted, including time
for (; i < 7; i++) {
config._a[i] = input[i] = config._a[i] == null ? i === 2 ? 1 : 0 : config._a[i];
} // Check for 24:00:00.000
if (config._a[HOUR] === 24 && config._a[MINUTE] === 0 && config._a[SECOND] === 0 && config._a[MILLISECOND] === 0) {
config._nextDay = true;
config._a[HOUR] = 0;
}
config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);
expectedWeekday = config._useUTC ? config._d.getUTCDay() : config._d.getDay(); // Apply timezone offset from input. The actual utcOffset can be changed
// with parseZone.
if (config._tzm != null) {
config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);
}
if (config._nextDay) {
config._a[HOUR] = 24;
} // check for mismatching day of week
if (config._w && typeof config._w.d !== 'undefined' && config._w.d !== expectedWeekday) {
getParsingFlags(config).weekdayMismatch = true;
}
}
function dayOfYearFromWeekInfo(config) {
var w, weekYear, week, weekday, dow, doy, temp, weekdayOverflow;
w = config._w;
if (w.GG != null || w.W != null || w.E != null) {
dow = 1;
doy = 4; // TODO: We need to take the current isoWeekYear, but that depends on
// how we interpret now (local, utc, fixed offset). So create
// a now version of current config (take local/utc/offset flags, and
// create now).
weekYear = defaults(w.GG, config._a[YEAR], weekOfYear(createLocal(), 1, 4).year);
week = defaults(w.W, 1);
weekday = defaults(w.E, 1);
if (weekday < 1 || weekday > 7) {
weekdayOverflow = true;
}
} else {
dow = config._locale._week.dow;
doy = config._locale._week.doy;
var curWeek = weekOfYear(createLocal(), dow, doy);
weekYear = defaults(w.gg, config._a[YEAR], curWeek.year); // Default to current week.
week = defaults(w.w, curWeek.week);
if (w.d != null) {
// weekday -- low day numbers are considered next week
weekday = w.d;
if (weekday < 0 || weekday > 6) {
weekdayOverflow = true;
}
} else if (w.e != null) {
// local weekday -- counting starts from beginning of week
weekday = w.e + dow;
if (w.e < 0 || w.e > 6) {
weekdayOverflow = true;
}
} else {
// default to beginning of week
weekday = dow;
}
}
if (week < 1 || week > weeksInYear(weekYear, dow, doy)) {
getParsingFlags(config)._overflowWeeks = true;
} else if (weekdayOverflow != null) {
getParsingFlags(config)._overflowWeekday = true;
} else {
temp = dayOfYearFromWeeks(weekYear, week, weekday, dow, doy);
config._a[YEAR] = temp.year;
config._dayOfYear = temp.dayOfYear;
}
} // iso 8601 regex
// 0000-00-00 0000-W00 or 0000-W00-0 + T + 00 or 00:00 or 00:00:00 or 00:00:00.000 + +00:00 or +0000 or +00)
var extendedIsoRegex = /^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/;
var basicIsoRegex = /^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/;
var tzRegex = /Z|[+-]\d\d(?::?\d\d)?/;
var isoDates = [['YYYYYY-MM-DD', /[+-]\d{6}-\d\d-\d\d/], ['YYYY-MM-DD', /\d{4}-\d\d-\d\d/], ['GGGG-[W]WW-E', /\d{4}-W\d\d-\d/], ['GGGG-[W]WW', /\d{4}-W\d\d/, false], ['YYYY-DDD', /\d{4}-\d{3}/], ['YYYY-MM', /\d{4}-\d\d/, false], ['YYYYYYMMDD', /[+-]\d{10}/], ['YYYYMMDD', /\d{8}/], // YYYYMM is NOT allowed by the standard
['GGGG[W]WWE', /\d{4}W\d{3}/], ['GGGG[W]WW', /\d{4}W\d{2}/, false], ['YYYYDDD', /\d{7}/]]; // iso time formats and regexes
var isoTimes = [['HH:mm:ss.SSSS', /\d\d:\d\d:\d\d\.\d+/], ['HH:mm:ss,SSSS', /\d\d:\d\d:\d\d,\d+/], ['HH:mm:ss', /\d\d:\d\d:\d\d/], ['HH:mm', /\d\d:\d\d/], ['HHmmss.SSSS', /\d\d\d\d\d\d\.\d+/], ['HHmmss,SSSS', /\d\d\d\d\d\d,\d+/], ['HHmmss', /\d\d\d\d\d\d/], ['HHmm', /\d\d\d\d/], ['HH', /\d\d/]];
var aspNetJsonRegex = /^\/?Date\((\-?\d+)/i; // date from iso format
function configFromISO(config) {
var i,
l,
string = config._i,
match = extendedIsoRegex.exec(string) || basicIsoRegex.exec(string),
allowTime,
dateFormat,
timeFormat,
tzFormat;
if (match) {
getParsingFlags(config).iso = true;
for (i = 0, l = isoDates.length; i < l; i++) {
if (isoDates[i][1].exec(match[1])) {
dateFormat = isoDates[i][0];
allowTime = isoDates[i][2] !== false;
break;
}
}
if (dateFormat == null) {
config._isValid = false;
return;
}
if (match[3]) {
for (i = 0, l = isoTimes.length; i < l; i++) {
if (isoTimes[i][1].exec(match[3])) {
// match[2] should be 'T' or space
timeFormat = (match[2] || ' ') + isoTimes[i][0];
break;
}
}
if (timeFormat == null) {
config._isValid = false;
return;
}
}
if (!allowTime && timeFormat != null) {
config._isValid = false;
return;
}
if (match[4]) {
if (tzRegex.exec(match[4])) {
tzFormat = 'Z';
} else {
config._isValid = false;
return;
}
}
config._f = dateFormat + (timeFormat || '') + (tzFormat || '');
configFromStringAndFormat(config);
} else {
config._isValid = false;
}
} // RFC 2822 regex: For details see https://tools.ietf.org/html/rfc2822#section-3.3
var rfc2822 = /^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/;
function extractFromRFC2822Strings(yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr) {
var result = [untruncateYear(yearStr), defaultLocaleMonthsShort.indexOf(monthStr), parseInt(dayStr, 10), parseInt(hourStr, 10), parseInt(minuteStr, 10)];
if (secondStr) {
result.push(parseInt(secondStr, 10));
}
return result;
}
function untruncateYear(yearStr) {
var year = parseInt(yearStr, 10);
if (year <= 49) {
return 2000 + year;
} else if (year <= 999) {
return 1900 + year;
}
return year;
}
function preprocessRFC2822(s) {
// Remove comments and folding whitespace and replace multiple-spaces with a single space
return s.replace(/\([^)]*\)|[\n\t]/g, ' ').replace(/(\s\s+)/g, ' ').replace(/^\s\s*/, '').replace(/\s\s*$/, '');
}
function checkWeekday(weekdayStr, parsedInput, config) {
if (weekdayStr) {
// TODO: Replace the vanilla JS Date object with an indepentent day-of-week check.
var weekdayProvided = defaultLocaleWeekdaysShort.indexOf(weekdayStr),
weekdayActual = new Date(parsedInput[0], parsedInput[1], parsedInput[2]).getDay();
if (weekdayProvided !== weekdayActual) {
getParsingFlags(config).weekdayMismatch = true;
config._isValid = false;
return false;
}
}
return true;
}
var obsOffsets = {
UT: 0,
GMT: 0,
EDT: -4 * 60,
EST: -5 * 60,
CDT: -5 * 60,
CST: -6 * 60,
MDT: -6 * 60,
MST: -7 * 60,
PDT: -7 * 60,
PST: -8 * 60
};
function calculateOffset(obsOffset, militaryOffset, numOffset) {
if (obsOffset) {
return obsOffsets[obsOffset];
} else if (militaryOffset) {
// the only allowed military tz is Z
return 0;
} else {
var hm = parseInt(numOffset, 10);
var m = hm % 100,
h = (hm - m) / 100;
return h * 60 + m;
}
} // date and time from ref 2822 format
function configFromRFC2822(config) {
var match = rfc2822.exec(preprocessRFC2822(config._i));
if (match) {
var parsedArray = extractFromRFC2822Strings(match[4], match[3], match[2], match[5], match[6], match[7]);
if (!checkWeekday(match[1], parsedArray, config)) {
return;
}
config._a = parsedArray;
config._tzm = calculateOffset(match[8], match[9], match[10]);
config._d = createUTCDate.apply(null, config._a);
config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);
getParsingFlags(config).rfc2822 = true;
} else {
config._isValid = false;
}
} // date from iso format or fallback
function configFromString(config) {
var matched = aspNetJsonRegex.exec(config._i);
if (matched !== null) {
config._d = new Date(+matched[1]);
return;
}
configFromISO(config);
if (config._isValid === false) {
delete config._isValid;
} else {
return;
}
configFromRFC2822(config);
if (config._isValid === false) {
delete config._isValid;
} else {
return;
} // Final attempt, use Input Fallback
hooks.createFromInputFallback(config);
}
hooks.createFromInputFallback = deprecate('value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), ' + 'which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are ' + 'discouraged and will be removed in an upcoming major release. Please refer to ' + 'http://momentjs.com/guides/#/warnings/js-date/ for more info.', function (config) {
config._d = new Date(config._i + (config._useUTC ? ' UTC' : ''));
}); // constant that refers to the ISO standard
hooks.ISO_8601 = function () {}; // constant that refers to the RFC 2822 form
hooks.RFC_2822 = function () {}; // date from string and format string
function configFromStringAndFormat(config) {
// TODO: Move this to another part of the creation flow to prevent circular deps
if (config._f === hooks.ISO_8601) {
configFromISO(config);
return;
}
if (config._f === hooks.RFC_2822) {
configFromRFC2822(config);
return;
}
config._a = [];
getParsingFlags(config).empty = true; // This array is used to make a Date, either with `new Date` or `Date.UTC`
var string = '' + config._i,
i,
parsedInput,
tokens,
token,
skipped,
stringLength = string.length,
totalParsedInputLength = 0;
tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];
for (i = 0; i < tokens.length; i++) {
token = tokens[i];
parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0]; // console.log('token', token, 'parsedInput', parsedInput,
// 'regex', getParseRegexForToken(token, config));
if (parsedInput) {
skipped = string.substr(0, string.indexOf(parsedInput));
if (skipped.length > 0) {
getParsingFlags(config).unusedInput.push(skipped);
}
string = string.slice(string.indexOf(parsedInput) + parsedInput.length);
totalParsedInputLength += parsedInput.length;
} // don't parse if it's not a known token
if (formatTokenFunctions[token]) {
if (parsedInput) {
getParsingFlags(config).empty = false;
} else {
getParsingFlags(config).unusedTokens.push(token);
}
addTimeToArrayFromToken(token, parsedInput, config);
} else if (config._strict && !parsedInput) {
getParsingFlags(config).unusedTokens.push(token);
}
} // add remaining unparsed input length to the string
getParsingFlags(config).charsLeftOver = stringLength - totalParsedInputLength;
if (string.length > 0) {
getParsingFlags(config).unusedInput.push(string);
} // clear _12h flag if hour is <= 12
if (config._a[HOUR] <= 12 && getParsingFlags(config).bigHour === true && config._a[HOUR] > 0) {
getParsingFlags(config).bigHour = undefined;
}
getParsingFlags(config).parsedDateParts = config._a.slice(0);
getParsingFlags(config).meridiem = config._meridiem; // handle meridiem
config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR], config._meridiem);
configFromArray(config);
checkOverflow(config);
}
function meridiemFixWrap(locale, hour, meridiem) {
var isPm;
if (meridiem == null) {
// nothing to do
return hour;
}
if (locale.meridiemHour != null) {
return locale.meridiemHour(hour, meridiem);
} else if (locale.isPM != null) {
// Fallback
isPm = locale.isPM(meridiem);
if (isPm && hour < 12) {
hour += 12;
}
if (!isPm && hour === 12) {
hour = 0;
}
return hour;
} else {
// this is not supposed to happen
return hour;
}
} // date from string and array of format strings
function configFromStringAndArray(config) {
var tempConfig, bestMoment, scoreToBeat, i, currentScore;
if (config._f.length === 0) {
getParsingFlags(config).invalidFormat = true;
config._d = new Date(NaN);
return;
}
for (i = 0; i < config._f.length; i++) {
currentScore = 0;
tempConfig = copyConfig({}, config);
if (config._useUTC != null) {
tempConfig._useUTC = config._useUTC;
}
tempConfig._f = config._f[i];
configFromStringAndFormat(tempConfig);
if (!isValid(tempConfig)) {
continue;
} // if there is any input that was not parsed add a penalty for that format
currentScore += getParsingFlags(tempConfig).charsLeftOver; //or tokens
currentScore += getParsingFlags(tempConfig).unusedTokens.length * 10;
getParsingFlags(tempConfig).score = currentScore;
if (scoreToBeat == null || currentScore < scoreToBeat) {
scoreToBeat = currentScore;
bestMoment = tempConfig;
}
}
extend(config, bestMoment || tempConfig);
}
function configFromObject(config) {
if (config._d) {
return;
}
var i = normalizeObjectUnits(config._i);
config._a = map([i.year, i.month, i.day || i.date, i.hour, i.minute, i.second, i.millisecond], function (obj) {
return obj && parseInt(obj, 10);
});
configFromArray(config);
}
function createFromConfig(config) {
var res = new Moment(checkOverflow(prepareConfig(config)));
if (res._nextDay) {
// Adding is smart enough around DST
res.add(1, 'd');
res._nextDay = undefined;
}
return res;
}
function prepareConfig(config) {
var input = config._i,
format = config._f;
config._locale = config._locale || getLocale(config._l);
if (input === null || format === undefined && input === '') {
return createInvalid({
nullInput: true
});
}
if (typeof input === 'string') {
config._i = input = config._locale.preparse(input);
}
if (isMoment(input)) {
return new Moment(checkOverflow(input));
} else if (isDate(input)) {
config._d = input;
} else if (isArray(format)) {
configFromStringAndArray(config);
} else if (format) {
configFromStringAndFormat(config);
} else {
configFromInput(config);
}
if (!isValid(config)) {
config._d = null;
}
return config;
}
function configFromInput(config) {
var input = config._i;
if (isUndefined(input)) {
config._d = new Date(hooks.now());
} else if (isDate(input)) {
config._d = new Date(input.valueOf());
} else if (typeof input === 'string') {
configFromString(config);
} else if (isArray(input)) {
config._a = map(input.slice(0), function (obj) {
return parseInt(obj, 10);
});
configFromArray(config);
} else if (isObject(input)) {
configFromObject(config);
} else if (isNumber(input)) {
// from milliseconds
config._d = new Date(input);
} else {
hooks.createFromInputFallback(config);
}
}
function createLocalOrUTC(input, format, locale, strict, isUTC) {
var c = {};
if (locale === true || locale === false) {
strict = locale;
locale = undefined;
}
if (isObject(input) && isObjectEmpty(input) || isArray(input) && input.length === 0) {
input = undefined;
} // object construction must be done this way.
// https://github.com/moment/moment/issues/1423
c._isAMomentObject = true;
c._useUTC = c._isUTC = isUTC;
c._l = locale;
c._i = input;
c._f = format;
c._strict = strict;
return createFromConfig(c);
}
function createLocal(input, format, locale, strict) {
return createLocalOrUTC(input, format, locale, strict, false);
}
var prototypeMin = deprecate('moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/', function () {
var other = createLocal.apply(null, arguments);
if (this.isValid() && other.isValid()) {
return other < this ? this : other;
} else {
return createInvalid();
}
});
var prototypeMax = deprecate('moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/', function () {
var other = createLocal.apply(null, arguments);
if (this.isValid() && other.isValid()) {
return other > this ? this : other;
} else {
return createInvalid();
}
}); // Pick a moment m from moments so that m[fn](other) is true for all
// other. This relies on the function fn to be transitive.
//
// moments should either be an array of moment objects or an array, whose
// first element is an array of moment objects.
function pickBy(fn, moments) {
var res, i;
if (moments.length === 1 && isArray(moments[0])) {
moments = moments[0];
}
if (!moments.length) {
return createLocal();
}
res = moments[0];
for (i = 1; i < moments.length; ++i) {
if (!moments[i].isValid() || moments[i][fn](res)) {
res = moments[i];
}
}
return res;
} // TODO: Use [].sort instead?
function min() {
var args = [].slice.call(arguments, 0);
return pickBy('isBefore', args);
}
function max() {
var args = [].slice.call(arguments, 0);
return pickBy('isAfter', args);
}
var now = function () {
return Date.now ? Date.now() : +new Date();
};
var ordering = ['year', 'quarter', 'month', 'week', 'day', 'hour', 'minute', 'second', 'millisecond'];
function isDurationValid(m) {
for (var key in m) {
if (!(indexOf.call(ordering, key) !== -1 && (m[key] == null || !isNaN(m[key])))) {
return false;
}
}
var unitHasDecimal = false;
for (var i = 0; i < ordering.length; ++i) {
if (m[ordering[i]]) {
if (unitHasDecimal) {
return false; // only allow non-integers for smallest unit
}
if (parseFloat(m[ordering[i]]) !== toInt(m[ordering[i]])) {
unitHasDecimal = true;
}
}
}
return true;
}
function isValid$1() {
return this._isValid;
}
function createInvalid$1() {
return createDuration(NaN);
}
function Duration(duration) {
var normalizedInput = normalizeObjectUnits(duration),
years = normalizedInput.year || 0,
quarters = normalizedInput.quarter || 0,
months = normalizedInput.month || 0,
weeks = normalizedInput.week || normalizedInput.isoWeek || 0,
days = normalizedInput.day || 0,
hours = normalizedInput.hour || 0,
minutes = normalizedInput.minute || 0,
seconds = normalizedInput.second || 0,
milliseconds = normalizedInput.millisecond || 0;
this._isValid = isDurationValid(normalizedInput); // representation for dateAddRemove
this._milliseconds = +milliseconds + seconds * 1e3 + // 1000
minutes * 6e4 + // 1000 * 60
hours * 1000 * 60 * 60; //using 1000 * 60 * 60 instead of 36e5 to avoid floating point rounding errors https://github.com/moment/moment/issues/2978
// Because of dateAddRemove treats 24 hours as different from a
// day when working around DST, we need to store them separately
this._days = +days + weeks * 7; // It is impossible to translate months into days without knowing
// which months you are are talking about, so we have to store
// it separately.
this._months = +months + quarters * 3 + years * 12;
this._data = {};
this._locale = getLocale();
this._bubble();
}
function isDuration(obj) {
return obj instanceof Duration;
}
function absRound(number) {
if (number < 0) {
return Math.round(-1 * number) * -1;
} else {
return Math.round(number);
}
} // FORMATTING
function offset(token, separator) {
addFormatToken(token, 0, 0, function () {
var offset = this.utcOffset();
var sign = '+';
if (offset < 0) {
offset = -offset;
sign = '-';
}
return sign + zeroFill(~~(offset / 60), 2) + separator + zeroFill(~~offset % 60, 2);
});
}
offset('Z', ':');
offset('ZZ', ''); // PARSING
addRegexToken('Z', matchShortOffset);
addRegexToken('ZZ', matchShortOffset);
addParseToken(['Z', 'ZZ'], function (input, array, config) {
config._useUTC = true;
config._tzm = offsetFromString(matchShortOffset, input);
}); // HELPERS
// timezone chunker
// '+10:00' > ['10', '00']
// '-1530' > ['-15', '30']
var chunkOffset = /([\+\-]|\d\d)/gi;
function offsetFromString(matcher, string) {
var matches = (string || '').match(matcher);
if (matches === null) {
return null;
}
var chunk = matches[matches.length - 1] || [];
var parts = (chunk + '').match(chunkOffset) || ['-', 0, 0];
var minutes = +(parts[1] * 60) + toInt(parts[2]);
return minutes === 0 ? 0 : parts[0] === '+' ? minutes : -minutes;
} // Return a moment from input, that is local/utc/zone equivalent to model.
function cloneWithOffset(input, model) {
var res, diff;
if (model._isUTC) {
res = model.clone();
diff = (isMoment(input) || isDate(input) ? input.valueOf() : createLocal(input).valueOf()) - res.valueOf(); // Use low-level api, because this fn is low-level api.
res._d.setTime(res._d.valueOf() + diff);
hooks.updateOffset(res, false);
return res;
} else {
return createLocal(input).local();
}
}
function getDateOffset(m) {
// On Firefox.24 Date#getTimezoneOffset returns a floating point.
// https://github.com/moment/moment/pull/1871
return -Math.round(m._d.getTimezoneOffset() / 15) * 15;
} // HOOKS
// This function will be called whenever a moment is mutated.
// It is intended to keep the offset in sync with the timezone.
hooks.updateOffset = function () {}; // MOMENTS
// keepLocalTime = true means only change the timezone, without
// affecting the local hour. So 5:31:26 +0300 --[utcOffset(2, true)]-->
// 5:31:26 +0200 It is possible that 5:31:26 doesn't exist with offset
// +0200, so we adjust the time as needed, to be valid.
//
// Keeping the time actually adds/subtracts (one hour)
// from the actual represented time. That is why we call updateOffset
// a second time. In case it wants us to change the offset again
// _changeInProgress == true case, then we have to adjust, because
// there is no such time in the given timezone.
function getSetOffset(input, keepLocalTime, keepMinutes) {
var offset = this._offset || 0,
localAdjust;
if (!this.isValid()) {
return input != null ? this : NaN;
}
if (input != null) {
if (typeof input === 'string') {
input = offsetFromString(matchShortOffset, input);
if (input === null) {
return this;
}
} else if (Math.abs(input) < 16 && !keepMinutes) {
input = input * 60;
}
if (!this._isUTC && keepLocalTime) {
localAdjust = getDateOffset(this);
}
this._offset = input;
this._isUTC = true;
if (localAdjust != null) {
this.add(localAdjust, 'm');
}
if (offset !== input) {
if (!keepLocalTime || this._changeInProgress) {
addSubtract(this, createDuration(input - offset, 'm'), 1, false);
} else if (!this._changeInProgress) {
this._changeInProgress = true;
hooks.updateOffset(this, true);
this._changeInProgress = null;
}
}
return this;
} else {
return this._isUTC ? offset : getDateOffset(this);
}
}
function getSetZone(input, keepLocalTime) {
if (input != null) {
if (typeof input !== 'string') {
input = -input;
}
this.utcOffset(input, keepLocalTime);
return this;
} else {
return -this.utcOffset();
}
}
function setOffsetToUTC(keepLocalTime) {
return this.utcOffset(0, keepLocalTime);
}
function setOffsetToLocal(keepLocalTime) {
if (this._isUTC) {
this.utcOffset(0, keepLocalTime);
this._isUTC = false;
if (keepLocalTime) {
this.subtract(getDateOffset(this), 'm');
}
}
return this;
}
function setOffsetToParsedOffset() {
if (this._tzm != null) {
this.utcOffset(this._tzm, false, true);
} else if (typeof this._i === 'string') {
var tZone = offsetFromString(matchOffset, this._i);
if (tZone != null) {
this.utcOffset(tZone);
} else {
this.utcOffset(0, true);
}
}
return this;
}
function hasAlignedHourOffset(input) {
if (!this.isValid()) {
return false;
}
input = input ? createLocal(input).utcOffset() : 0;
return (this.utcOffset() - input) % 60 === 0;
}
function isDaylightSavingTime() {
return this.utcOffset() > this.clone().month(0).utcOffset() || this.utcOffset() > this.clone().month(5).utcOffset();
}
function isDaylightSavingTimeShifted() {
if (!isUndefined(this._isDSTShifted)) {
return this._isDSTShifted;
}
var c = {};
copyConfig(c, this);
c = prepareConfig(c);
if (c._a) {
var other = c._isUTC ? createUTC(c._a) : createLocal(c._a);
this._isDSTShifted = this.isValid() && compareArrays(c._a, other.toArray()) > 0;
} else {
this._isDSTShifted = false;
}
return this._isDSTShifted;
}
function isLocal() {
return this.isValid() ? !this._isUTC : false;
}
function isUtcOffset() {
return this.isValid() ? this._isUTC : false;
}
function isUtc() {
return this.isValid() ? this._isUTC && this._offset === 0 : false;
} // ASP.NET json date format regex
var aspNetRegex = /^(\-|\+)?(?:(\d*)[. ])?(\d+)\:(\d+)(?:\:(\d+)(\.\d*)?)?$/; // from http://docs.closure-library.googlecode.com/git/closure_goog_date_date.js.source.html
// somewhat more in line with 4.4.3.2 2004 spec, but allows decimal anywhere
// and further modified to allow for strings containing both week and day
var isoRegex = /^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;
function createDuration(input, key) {
var duration = input,
// matching against regexp is expensive, do it on demand
match = null,
sign,
ret,
diffRes;
if (isDuration(input)) {
duration = {
ms: input._milliseconds,
d: input._days,
M: input._months
};
} else if (isNumber(input)) {
duration = {};
if (key) {
duration[key] = input;
} else {
duration.milliseconds = input;
}
} else if (!!(match = aspNetRegex.exec(input))) {
sign = match[1] === '-' ? -1 : 1;
duration = {
y: 0,
d: toInt(match[DATE]) * sign,
h: toInt(match[HOUR]) * sign,
m: toInt(match[MINUTE]) * sign,
s: toInt(match[SECOND]) * sign,
ms: toInt(absRound(match[MILLISECOND] * 1000)) * sign // the millisecond decimal point is included in the match
};
} else if (!!(match = isoRegex.exec(input))) {
sign = match[1] === '-' ? -1 : 1;
duration = {
y: parseIso(match[2], sign),
M: parseIso(match[3], sign),
w: parseIso(match[4], sign),
d: parseIso(match[5], sign),
h: parseIso(match[6], sign),
m: parseIso(match[7], sign),
s: parseIso(match[8], sign)
};
} else if (duration == null) {
// checks for null or undefined
duration = {};
} else if (typeof duration === 'object' && ('from' in duration || 'to' in duration)) {
diffRes = momentsDifference(createLocal(duration.from), createLocal(duration.to));
duration = {};
duration.ms = diffRes.milliseconds;
duration.M = diffRes.months;
}
ret = new Duration(duration);
if (isDuration(input) && hasOwnProp(input, '_locale')) {
ret._locale = input._locale;
}
return ret;
}
createDuration.fn = Duration.prototype;
createDuration.invalid = createInvalid$1;
function parseIso(inp, sign) {
// We'd normally use ~~inp for this, but unfortunately it also
// converts floats to ints.
// inp may be undefined, so careful calling replace on it.
var res = inp && parseFloat(inp.replace(',', '.')); // apply sign while we're at it
return (isNaN(res) ? 0 : res) * sign;
}
function positiveMomentsDifference(base, other) {
var res = {};
res.months = other.month() - base.month() + (other.year() - base.year()) * 12;
if (base.clone().add(res.months, 'M').isAfter(other)) {
--res.months;
}
res.milliseconds = +other - +base.clone().add(res.months, 'M');
return res;
}
function momentsDifference(base, other) {
var res;
if (!(base.isValid() && other.isValid())) {
return {
milliseconds: 0,
months: 0
};
}
other = cloneWithOffset(other, base);
if (base.isBefore(other)) {
res = positiveMomentsDifference(base, other);
} else {
res = positiveMomentsDifference(other, base);
res.milliseconds = -res.milliseconds;
res.months = -res.months;
}
return res;
} // TODO: remove 'name' arg after deprecation is removed
function createAdder(direction, name) {
return function (val, period) {
var dur, tmp; //invert the arguments, but complain about it
if (period !== null && !isNaN(+period)) {
deprecateSimple(name, 'moment().' + name + '(period, number) is deprecated. Please use moment().' + name + '(number, period). ' + 'See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.');
tmp = val;
val = period;
period = tmp;
}
val = typeof val === 'string' ? +val : val;
dur = createDuration(val, period);
addSubtract(this, dur, direction);
return this;
};
}
function addSubtract(mom, duration, isAdding, updateOffset) {
var milliseconds = duration._milliseconds,
days = absRound(duration._days),
months = absRound(duration._months);
if (!mom.isValid()) {
// No op
return;
}
updateOffset = updateOffset == null ? true : updateOffset;
if (months) {
setMonth(mom, get(mom, 'Month') + months * isAdding);
}
if (days) {
set$1(mom, 'Date', get(mom, 'Date') + days * isAdding);
}
if (milliseconds) {
mom._d.setTime(mom._d.valueOf() + milliseconds * isAdding);
}
if (updateOffset) {
hooks.updateOffset(mom, days || months);
}
}
var add = createAdder(1, 'add');
var subtract = createAdder(-1, 'subtract');
function getCalendarFormat(myMoment, now) {
var diff = myMoment.diff(now, 'days', true);
return diff < -6 ? 'sameElse' : diff < -1 ? 'lastWeek' : diff < 0 ? 'lastDay' : diff < 1 ? 'sameDay' : diff < 2 ? 'nextDay' : diff < 7 ? 'nextWeek' : 'sameElse';
}
function calendar$1(time, formats) {
// We want to compare the start of today, vs this.
// Getting start-of-today depends on whether we're local/utc/offset or not.
var now = time || createLocal(),
sod = cloneWithOffset(now, this).startOf('day'),
format = hooks.calendarFormat(this, sod) || 'sameElse';
var output = formats && (isFunction(formats[format]) ? formats[format].call(this, now) : formats[format]);
return this.format(output || this.localeData().calendar(format, this, createLocal(now)));
}
function clone() {
return new Moment(this);
}
function isAfter(input, units) {
var localInput = isMoment(input) ? input : createLocal(input);
if (!(this.isValid() && localInput.isValid())) {
return false;
}
units = normalizeUnits(units) || 'millisecond';
if (units === 'millisecond') {
return this.valueOf() > localInput.valueOf();
} else {
return localInput.valueOf() < this.clone().startOf(units).valueOf();
}
}
function isBefore(input, units) {
var localInput = isMoment(input) ? input : createLocal(input);
if (!(this.isValid() && localInput.isValid())) {
return false;
}
units = normalizeUnits(units) || 'millisecond';
if (units === 'millisecond') {
return this.valueOf() < localInput.valueOf();
} else {
return this.clone().endOf(units).valueOf() < localInput.valueOf();
}
}
function isBetween(from, to, units, inclusivity) {
var localFrom = isMoment(from) ? from : createLocal(from),
localTo = isMoment(to) ? to : createLocal(to);
if (!(this.isValid() && localFrom.isValid() && localTo.isValid())) {
return false;
}
inclusivity = inclusivity || '()';
return (inclusivity[0] === '(' ? this.isAfter(localFrom, units) : !this.isBefore(localFrom, units)) && (inclusivity[1] === ')' ? this.isBefore(localTo, units) : !this.isAfter(localTo, units));
}
function isSame(input, units) {
var localInput = isMoment(input) ? input : createLocal(input),
inputMs;
if (!(this.isValid() && localInput.isValid())) {
return false;
}
units = normalizeUnits(units) || 'millisecond';
if (units === 'millisecond') {
return this.valueOf() === localInput.valueOf();
} else {
inputMs = localInput.valueOf();
return this.clone().startOf(units).valueOf() <= inputMs && inputMs <= this.clone().endOf(units).valueOf();
}
}
function isSameOrAfter(input, units) {
return this.isSame(input, units) || this.isAfter(input, units);
}
function isSameOrBefore(input, units) {
return this.isSame(input, units) || this.isBefore(input, units);
}
function diff(input, units, asFloat) {
var that, zoneDelta, output;
if (!this.isValid()) {
return NaN;
}
that = cloneWithOffset(input, this);
if (!that.isValid()) {
return NaN;
}
zoneDelta = (that.utcOffset() - this.utcOffset()) * 6e4;
units = normalizeUnits(units);
switch (units) {
case 'year':
output = monthDiff(this, that) / 12;
break;
case 'month':
output = monthDiff(this, that);
break;
case 'quarter':
output = monthDiff(this, that) / 3;
break;
case 'second':
output = (this - that) / 1e3;
break;
// 1000
case 'minute':
output = (this - that) / 6e4;
break;
// 1000 * 60
case 'hour':
output = (this - that) / 36e5;
break;
// 1000 * 60 * 60
case 'day':
output = (this - that - zoneDelta) / 864e5;
break;
// 1000 * 60 * 60 * 24, negate dst
case 'week':
output = (this - that - zoneDelta) / 6048e5;
break;
// 1000 * 60 * 60 * 24 * 7, negate dst
default:
output = this - that;
}
return asFloat ? output : absFloor(output);
}
function monthDiff(a, b) {
// difference in months
var wholeMonthDiff = (b.year() - a.year()) * 12 + (b.month() - a.month()),
// b is in (anchor - 1 month, anchor + 1 month)
anchor = a.clone().add(wholeMonthDiff, 'months'),
anchor2,
adjust;
if (b - anchor < 0) {
anchor2 = a.clone().add(wholeMonthDiff - 1, 'months'); // linear across the month
adjust = (b - anchor) / (anchor - anchor2);
} else {
anchor2 = a.clone().add(wholeMonthDiff + 1, 'months'); // linear across the month
adjust = (b - anchor) / (anchor2 - anchor);
} //check for negative zero, return zero if negative zero
return -(wholeMonthDiff + adjust) || 0;
}
hooks.defaultFormat = 'YYYY-MM-DDTHH:mm:ssZ';
hooks.defaultFormatUtc = 'YYYY-MM-DDTHH:mm:ss[Z]';
function toString() {
return this.clone().locale('en').format('ddd MMM DD YYYY HH:mm:ss [GMT]ZZ');
}
function toISOString(keepOffset) {
if (!this.isValid()) {
return null;
}
var utc = keepOffset !== true;
var m = utc ? this.clone().utc() : this;
if (m.year() < 0 || m.year() > 9999) {
return formatMoment(m, utc ? 'YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]' : 'YYYYYY-MM-DD[T]HH:mm:ss.SSSZ');
}
if (isFunction(Date.prototype.toISOString)) {
// native implementation is ~50x faster, use it when we can
if (utc) {
return this.toDate().toISOString();
} else {
return new Date(this.valueOf() + this.utcOffset() * 60 * 1000).toISOString().replace('Z', formatMoment(m, 'Z'));
}
}
return formatMoment(m, utc ? 'YYYY-MM-DD[T]HH:mm:ss.SSS[Z]' : 'YYYY-MM-DD[T]HH:mm:ss.SSSZ');
}
/**
* Return a human readable representation of a moment that can
* also be evaluated to get a new moment which is the same
*
* @link https://nodejs.org/dist/latest/docs/api/util.html#util_custom_inspect_function_on_objects
*/
function inspect() {
if (!this.isValid()) {
return 'moment.invalid(/* ' + this._i + ' */)';
}
var func = 'moment';
var zone = '';
if (!this.isLocal()) {
func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';
zone = 'Z';
}
var prefix = '[' + func + '("]';
var year = 0 <= this.year() && this.year() <= 9999 ? 'YYYY' : 'YYYYYY';
var datetime = '-MM-DD[T]HH:mm:ss.SSS';
var suffix = zone + '[")]';
return this.format(prefix + year + datetime + suffix);
}
function format(inputString) {
if (!inputString) {
inputString = this.isUtc() ? hooks.defaultFormatUtc : hooks.defaultFormat;
}
var output = formatMoment(this, inputString);
return this.localeData().postformat(output);
}
function from(time, withoutSuffix) {
if (this.isValid() && (isMoment(time) && time.isValid() || createLocal(time).isValid())) {
return createDuration({
to: this,
from: time
}).locale(this.locale()).humanize(!withoutSuffix);
} else {
return this.localeData().invalidDate();
}
}
function fromNow(withoutSuffix) {
return this.from(createLocal(), withoutSuffix);
}
function to(time, withoutSuffix) {
if (this.isValid() && (isMoment(time) && time.isValid() || createLocal(time).isValid())) {
return createDuration({
from: this,
to: time
}).locale(this.locale()).humanize(!withoutSuffix);
} else {
return this.localeData().invalidDate();
}
}
function toNow(withoutSuffix) {
return this.to(createLocal(), withoutSuffix);
} // If passed a locale key, it will set the locale for this
// instance. Otherwise, it will return the locale configuration
// variables for this instance.
function locale(key) {
var newLocaleData;
if (key === undefined) {
return this._locale._abbr;
} else {
newLocaleData = getLocale(key);
if (newLocaleData != null) {
this._locale = newLocaleData;
}
return this;
}
}
var lang = deprecate('moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.', function (key) {
if (key === undefined) {
return this.localeData();
} else {
return this.locale(key);
}
});
function localeData() {
return this._locale;
}
var MS_PER_SECOND = 1000;
var MS_PER_MINUTE = 60 * MS_PER_SECOND;
var MS_PER_HOUR = 60 * MS_PER_MINUTE;
var MS_PER_400_YEARS = (365 * 400 + 97) * 24 * MS_PER_HOUR; // actual modulo - handles negative numbers (for dates before 1970):
function mod$1(dividend, divisor) {
return (dividend % divisor + divisor) % divisor;
}
function localStartOfDate(y, m, d) {
// the date constructor remaps years 0-99 to 1900-1999
if (y < 100 && y >= 0) {
// preserve leap years using a full 400 year cycle, then reset
return new Date(y + 400, m, d) - MS_PER_400_YEARS;
} else {
return new Date(y, m, d).valueOf();
}
}
function utcStartOfDate(y, m, d) {
// Date.UTC remaps years 0-99 to 1900-1999
if (y < 100 && y >= 0) {
// preserve leap years using a full 400 year cycle, then reset
return Date.UTC(y + 400, m, d) - MS_PER_400_YEARS;
} else {
return Date.UTC(y, m, d);
}
}
function startOf(units) {
var time;
units = normalizeUnits(units);
if (units === undefined || units === 'millisecond' || !this.isValid()) {
return this;
}
var startOfDate = this._isUTC ? utcStartOfDate : localStartOfDate;
switch (units) {
case 'year':
time = startOfDate(this.year(), 0, 1);
break;
case 'quarter':
time = startOfDate(this.year(), this.month() - this.month() % 3, 1);
break;
case 'month':
time = startOfDate(this.year(), this.month(), 1);
break;
case 'week':
time = startOfDate(this.year(), this.month(), this.date() - this.weekday());
break;
case 'isoWeek':
time = startOfDate(this.year(), this.month(), this.date() - (this.isoWeekday() - 1));
break;
case 'day':
case 'date':
time = startOfDate(this.year(), this.month(), this.date());
break;
case 'hour':
time = this._d.valueOf();
time -= mod$1(time + (this._isUTC ? 0 : this.utcOffset() * MS_PER_MINUTE), MS_PER_HOUR);
break;
case 'minute':
time = this._d.valueOf();
time -= mod$1(time, MS_PER_MINUTE);
break;
case 'second':
time = this._d.valueOf();
time -= mod$1(time, MS_PER_SECOND);
break;
}
this._d.setTime(time);
hooks.updateOffset(this, true);
return this;
}
function endOf(units) {
var time;
units = normalizeUnits(units);
if (units === undefined || units === 'millisecond' || !this.isValid()) {
return this;
}
var startOfDate = this._isUTC ? utcStartOfDate : localStartOfDate;
switch (units) {
case 'year':
time = startOfDate(this.year() + 1, 0, 1) - 1;
break;
case 'quarter':
time = startOfDate(this.year(), this.month() - this.month() % 3 + 3, 1) - 1;
break;
case 'month':
time = startOfDate(this.year(), this.month() + 1, 1) - 1;
break;
case 'week':
time = startOfDate(this.year(), this.month(), this.date() - this.weekday() + 7) - 1;
break;
case 'isoWeek':
time = startOfDate(this.year(), this.month(), this.date() - (this.isoWeekday() - 1) + 7) - 1;
break;
case 'day':
case 'date':
time = startOfDate(this.year(), this.month(), this.date() + 1) - 1;
break;
case 'hour':
time = this._d.valueOf();
time += MS_PER_HOUR - mod$1(time + (this._isUTC ? 0 : this.utcOffset() * MS_PER_MINUTE), MS_PER_HOUR) - 1;
break;
case 'minute':
time = this._d.valueOf();
time += MS_PER_MINUTE - mod$1(time, MS_PER_MINUTE) - 1;
break;
case 'second':
time = this._d.valueOf();
time += MS_PER_SECOND - mod$1(time, MS_PER_SECOND) - 1;
break;
}
this._d.setTime(time);
hooks.updateOffset(this, true);
return this;
}
function valueOf() {
return this._d.valueOf() - (this._offset || 0) * 60000;
}
function unix() {
return Math.floor(this.valueOf() / 1000);
}
function toDate() {
return new Date(this.valueOf());
}
function toArray() {
var m = this;
return [m.year(), m.month(), m.date(), m.hour(), m.minute(), m.second(), m.millisecond()];
}
function toObject() {
var m = this;
return {
years: m.year(),
months: m.month(),
date: m.date(),
hours: m.hours(),
minutes: m.minutes(),
seconds: m.seconds(),
milliseconds: m.milliseconds()
};
}
function toJSON() {
// new Date(NaN).toJSON() === null
return this.isValid() ? this.toISOString() : null;
}
function isValid$2() {
return isValid(this);
}
function parsingFlags() {
return extend({}, getParsingFlags(this));
}
function invalidAt() {
return getParsingFlags(this).overflow;
}
function creationData() {
return {
input: this._i,
format: this._f,
locale: this._locale,
isUTC: this._isUTC,
strict: this._strict
};
} // FORMATTING
addFormatToken(0, ['gg', 2], 0, function () {
return this.weekYear() % 100;
});
addFormatToken(0, ['GG', 2], 0, function () {
return this.isoWeekYear() % 100;
});
function addWeekYearFormatToken(token, getter) {
addFormatToken(0, [token, token.length], 0, getter);
}
addWeekYearFormatToken('gggg', 'weekYear');
addWeekYearFormatToken('ggggg', 'weekYear');
addWeekYearFormatToken('GGGG', 'isoWeekYear');
addWeekYearFormatToken('GGGGG', 'isoWeekYear'); // ALIASES
addUnitAlias('weekYear', 'gg');
addUnitAlias('isoWeekYear', 'GG'); // PRIORITY
addUnitPriority('weekYear', 1);
addUnitPriority('isoWeekYear', 1); // PARSING
addRegexToken('G', matchSigned);
addRegexToken('g', matchSigned);
addRegexToken('GG', match1to2, match2);
addRegexToken('gg', match1to2, match2);
addRegexToken('GGGG', match1to4, match4);
addRegexToken('gggg', match1to4, match4);
addRegexToken('GGGGG', match1to6, match6);
addRegexToken('ggggg', match1to6, match6);
addWeekParseToken(['gggg', 'ggggg', 'GGGG', 'GGGGG'], function (input, week, config, token) {
week[token.substr(0, 2)] = toInt(input);
});
addWeekParseToken(['gg', 'GG'], function (input, week, config, token) {
week[token] = hooks.parseTwoDigitYear(input);
}); // MOMENTS
function getSetWeekYear(input) {
return getSetWeekYearHelper.call(this, input, this.week(), this.weekday(), this.localeData()._week.dow, this.localeData()._week.doy);
}
function getSetISOWeekYear(input) {
return getSetWeekYearHelper.call(this, input, this.isoWeek(), this.isoWeekday(), 1, 4);
}
function getISOWeeksInYear() {
return weeksInYear(this.year(), 1, 4);
}
function getWeeksInYear() {
var weekInfo = this.localeData()._week;
return weeksInYear(this.year(), weekInfo.dow, weekInfo.doy);
}
function getSetWeekYearHelper(input, week, weekday, dow, doy) {
var weeksTarget;
if (input == null) {
return weekOfYear(this, dow, doy).year;
} else {
weeksTarget = weeksInYear(input, dow, doy);
if (week > weeksTarget) {
week = weeksTarget;
}
return setWeekAll.call(this, input, week, weekday, dow, doy);
}
}
function setWeekAll(weekYear, week, weekday, dow, doy) {
var dayOfYearData = dayOfYearFromWeeks(weekYear, week, weekday, dow, doy),
date = createUTCDate(dayOfYearData.year, 0, dayOfYearData.dayOfYear);
this.year(date.getUTCFullYear());
this.month(date.getUTCMonth());
this.date(date.getUTCDate());
return this;
} // FORMATTING
addFormatToken('Q', 0, 'Qo', 'quarter'); // ALIASES
addUnitAlias('quarter', 'Q'); // PRIORITY
addUnitPriority('quarter', 7); // PARSING
addRegexToken('Q', match1);
addParseToken('Q', function (input, array) {
array[MONTH] = (toInt(input) - 1) * 3;
}); // MOMENTS
function getSetQuarter(input) {
return input == null ? Math.ceil((this.month() + 1) / 3) : this.month((input - 1) * 3 + this.month() % 3);
} // FORMATTING
addFormatToken('D', ['DD', 2], 'Do', 'date'); // ALIASES
addUnitAlias('date', 'D'); // PRIORITY
addUnitPriority('date', 9); // PARSING
addRegexToken('D', match1to2);
addRegexToken('DD', match1to2, match2);
addRegexToken('Do', function (isStrict, locale) {
// TODO: Remove "ordinalParse" fallback in next major release.
return isStrict ? locale._dayOfMonthOrdinalParse || locale._ordinalParse : locale._dayOfMonthOrdinalParseLenient;
});
addParseToken(['D', 'DD'], DATE);
addParseToken('Do', function (input, array) {
array[DATE] = toInt(input.match(match1to2)[0]);
}); // MOMENTS
var getSetDayOfMonth = makeGetSet('Date', true); // FORMATTING
addFormatToken('DDD', ['DDDD', 3], 'DDDo', 'dayOfYear'); // ALIASES
addUnitAlias('dayOfYear', 'DDD'); // PRIORITY
addUnitPriority('dayOfYear', 4); // PARSING
addRegexToken('DDD', match1to3);
addRegexToken('DDDD', match3);
addParseToken(['DDD', 'DDDD'], function (input, array, config) {
config._dayOfYear = toInt(input);
}); // HELPERS
// MOMENTS
function getSetDayOfYear(input) {
var dayOfYear = Math.round((this.clone().startOf('day') - this.clone().startOf('year')) / 864e5) + 1;
return input == null ? dayOfYear : this.add(input - dayOfYear, 'd');
} // FORMATTING
addFormatToken('m', ['mm', 2], 0, 'minute'); // ALIASES
addUnitAlias('minute', 'm'); // PRIORITY
addUnitPriority('minute', 14); // PARSING
addRegexToken('m', match1to2);
addRegexToken('mm', match1to2, match2);
addParseToken(['m', 'mm'], MINUTE); // MOMENTS
var getSetMinute = makeGetSet('Minutes', false); // FORMATTING
addFormatToken('s', ['ss', 2], 0, 'second'); // ALIASES
addUnitAlias('second', 's'); // PRIORITY
addUnitPriority('second', 15); // PARSING
addRegexToken('s', match1to2);
addRegexToken('ss', match1to2, match2);
addParseToken(['s', 'ss'], SECOND); // MOMENTS
var getSetSecond = makeGetSet('Seconds', false); // FORMATTING
addFormatToken('S', 0, 0, function () {
return ~~(this.millisecond() / 100);
});
addFormatToken(0, ['SS', 2], 0, function () {
return ~~(this.millisecond() / 10);
});
addFormatToken(0, ['SSS', 3], 0, 'millisecond');
addFormatToken(0, ['SSSS', 4], 0, function () {
return this.millisecond() * 10;
});
addFormatToken(0, ['SSSSS', 5], 0, function () {
return this.millisecond() * 100;
});
addFormatToken(0, ['SSSSSS', 6], 0, function () {
return this.millisecond() * 1000;
});
addFormatToken(0, ['SSSSSSS', 7], 0, function () {
return this.millisecond() * 10000;
});
addFormatToken(0, ['SSSSSSSS', 8], 0, function () {
return this.millisecond() * 100000;
});
addFormatToken(0, ['SSSSSSSSS', 9], 0, function () {
return this.millisecond() * 1000000;
}); // ALIASES
addUnitAlias('millisecond', 'ms'); // PRIORITY
addUnitPriority('millisecond', 16); // PARSING
addRegexToken('S', match1to3, match1);
addRegexToken('SS', match1to3, match2);
addRegexToken('SSS', match1to3, match3);
var token;
for (token = 'SSSS'; token.length <= 9; token += 'S') {
addRegexToken(token, matchUnsigned);
}
function parseMs(input, array) {
array[MILLISECOND] = toInt(('0.' + input) * 1000);
}
for (token = 'S'; token.length <= 9; token += 'S') {
addParseToken(token, parseMs);
} // MOMENTS
var getSetMillisecond = makeGetSet('Milliseconds', false); // FORMATTING
addFormatToken('z', 0, 0, 'zoneAbbr');
addFormatToken('zz', 0, 0, 'zoneName'); // MOMENTS
function getZoneAbbr() {
return this._isUTC ? 'UTC' : '';
}
function getZoneName() {
return this._isUTC ? 'Coordinated Universal Time' : '';
}
var proto = Moment.prototype;
proto.add = add;
proto.calendar = calendar$1;
proto.clone = clone;
proto.diff = diff;
proto.endOf = endOf;
proto.format = format;
proto.from = from;
proto.fromNow = fromNow;
proto.to = to;
proto.toNow = toNow;
proto.get = stringGet;
proto.invalidAt = invalidAt;
proto.isAfter = isAfter;
proto.isBefore = isBefore;
proto.isBetween = isBetween;
proto.isSame = isSame;
proto.isSameOrAfter = isSameOrAfter;
proto.isSameOrBefore = isSameOrBefore;
proto.isValid = isValid$2;
proto.lang = lang;
proto.locale = locale;
proto.localeData = localeData;
proto.max = prototypeMax;
proto.min = prototypeMin;
proto.parsingFlags = parsingFlags;
proto.set = stringSet;
proto.startOf = startOf;
proto.subtract = subtract;
proto.toArray = toArray;
proto.toObject = toObject;
proto.toDate = toDate;
proto.toISOString = toISOString;
proto.inspect = inspect;
proto.toJSON = toJSON;
proto.toString = toString;
proto.unix = unix;
proto.valueOf = valueOf;
proto.creationData = creationData;
proto.year = getSetYear;
proto.isLeapYear = getIsLeapYear;
proto.weekYear = getSetWeekYear;
proto.isoWeekYear = getSetISOWeekYear;
proto.quarter = proto.quarters = getSetQuarter;
proto.month = getSetMonth;
proto.daysInMonth = getDaysInMonth;
proto.week = proto.weeks = getSetWeek;
proto.isoWeek = proto.isoWeeks = getSetISOWeek;
proto.weeksInYear = getWeeksInYear;
proto.isoWeeksInYear = getISOWeeksInYear;
proto.date = getSetDayOfMonth;
proto.day = proto.days = getSetDayOfWeek;
proto.weekday = getSetLocaleDayOfWeek;
proto.isoWeekday = getSetISODayOfWeek;
proto.dayOfYear = getSetDayOfYear;
proto.hour = proto.hours = getSetHour;
proto.minute = proto.minutes = getSetMinute;
proto.second = proto.seconds = getSetSecond;
proto.millisecond = proto.milliseconds = getSetMillisecond;
proto.utcOffset = getSetOffset;
proto.utc = setOffsetToUTC;
proto.local = setOffsetToLocal;
proto.parseZone = setOffsetToParsedOffset;
proto.hasAlignedHourOffset = hasAlignedHourOffset;
proto.isDST = isDaylightSavingTime;
proto.isLocal = isLocal;
proto.isUtcOffset = isUtcOffset;
proto.isUtc = isUtc;
proto.isUTC = isUtc;
proto.zoneAbbr = getZoneAbbr;
proto.zoneName = getZoneName;
proto.dates = deprecate('dates accessor is deprecated. Use date instead.', getSetDayOfMonth);
proto.months = deprecate('months accessor is deprecated. Use month instead', getSetMonth);
proto.years = deprecate('years accessor is deprecated. Use year instead', getSetYear);
proto.zone = deprecate('moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/', getSetZone);
proto.isDSTShifted = deprecate('isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information', isDaylightSavingTimeShifted);
function createUnix(input) {
return createLocal(input * 1000);
}
function createInZone() {
return createLocal.apply(null, arguments).parseZone();
}
function preParsePostFormat(string) {
return string;
}
var proto$1 = Locale.prototype;
proto$1.calendar = calendar;
proto$1.longDateFormat = longDateFormat;
proto$1.invalidDate = invalidDate;
proto$1.ordinal = ordinal;
proto$1.preparse = preParsePostFormat;
proto$1.postformat = preParsePostFormat;
proto$1.relativeTime = relativeTime;
proto$1.pastFuture = pastFuture;
proto$1.set = set;
proto$1.months = localeMonths;
proto$1.monthsShort = localeMonthsShort;
proto$1.monthsParse = localeMonthsParse;
proto$1.monthsRegex = monthsRegex;
proto$1.monthsShortRegex = monthsShortRegex;
proto$1.week = localeWeek;
proto$1.firstDayOfYear = localeFirstDayOfYear;
proto$1.firstDayOfWeek = localeFirstDayOfWeek;
proto$1.weekdays = localeWeekdays;
proto$1.weekdaysMin = localeWeekdaysMin;
proto$1.weekdaysShort = localeWeekdaysShort;
proto$1.weekdaysParse = localeWeekdaysParse;
proto$1.weekdaysRegex = weekdaysRegex;
proto$1.weekdaysShortRegex = weekdaysShortRegex;
proto$1.weekdaysMinRegex = weekdaysMinRegex;
proto$1.isPM = localeIsPM;
proto$1.meridiem = localeMeridiem;
function get$1(format, index, field, setter) {
var locale = getLocale();
var utc = createUTC().set(setter, index);
return locale[field](utc, format);
}
function listMonthsImpl(format, index, field) {
if (isNumber(format)) {
index = format;
format = undefined;
}
format = format || '';
if (index != null) {
return get$1(format, index, field, 'month');
}
var i;
var out = [];
for (i = 0; i < 12; i++) {
out[i] = get$1(format, i, field, 'month');
}
return out;
} // ()
// (5)
// (fmt, 5)
// (fmt)
// (true)
// (true, 5)
// (true, fmt, 5)
// (true, fmt)
function listWeekdaysImpl(localeSorted, format, index, field) {
if (typeof localeSorted === 'boolean') {
if (isNumber(format)) {
index = format;
format = undefined;
}
format = format || '';
} else {
format = localeSorted;
index = format;
localeSorted = false;
if (isNumber(format)) {
index = format;
format = undefined;
}
format = format || '';
}
var locale = getLocale(),
shift = localeSorted ? locale._week.dow : 0;
if (index != null) {
return get$1(format, (index + shift) % 7, field, 'day');
}
var i;
var out = [];
for (i = 0; i < 7; i++) {
out[i] = get$1(format, (i + shift) % 7, field, 'day');
}
return out;
}
function listMonths(format, index) {
return listMonthsImpl(format, index, 'months');
}
function listMonthsShort(format, index) {
return listMonthsImpl(format, index, 'monthsShort');
}
function listWeekdays(localeSorted, format, index) {
return listWeekdaysImpl(localeSorted, format, index, 'weekdays');
}
function listWeekdaysShort(localeSorted, format, index) {
return listWeekdaysImpl(localeSorted, format, index, 'weekdaysShort');
}
function listWeekdaysMin(localeSorted, format, index) {
return listWeekdaysImpl(localeSorted, format, index, 'weekdaysMin');
}
getSetGlobalLocale('en', {
dayOfMonthOrdinalParse: /\d{1,2}(th|st|nd|rd)/,
ordinal: function (number) {
var b = number % 10,
output = toInt(number % 100 / 10) === 1 ? 'th' : b === 1 ? 'st' : b === 2 ? 'nd' : b === 3 ? 'rd' : 'th';
return number + output;
}
}); // Side effect imports
hooks.lang = deprecate('moment.lang is deprecated. Use moment.locale instead.', getSetGlobalLocale);
hooks.langData = deprecate('moment.langData is deprecated. Use moment.localeData instead.', getLocale);
var mathAbs = Math.abs;
function abs() {
var data = this._data;
this._milliseconds = mathAbs(this._milliseconds);
this._days = mathAbs(this._days);
this._months = mathAbs(this._months);
data.milliseconds = mathAbs(data.milliseconds);
data.seconds = mathAbs(data.seconds);
data.minutes = mathAbs(data.minutes);
data.hours = mathAbs(data.hours);
data.months = mathAbs(data.months);
data.years = mathAbs(data.years);
return this;
}
function addSubtract$1(duration, input, value, direction) {
var other = createDuration(input, value);
duration._milliseconds += direction * other._milliseconds;
duration._days += direction * other._days;
duration._months += direction * other._months;
return duration._bubble();
} // supports only 2.0-style add(1, 's') or add(duration)
function add$1(input, value) {
return addSubtract$1(this, input, value, 1);
} // supports only 2.0-style subtract(1, 's') or subtract(duration)
function subtract$1(input, value) {
return addSubtract$1(this, input, value, -1);
}
function absCeil(number) {
if (number < 0) {
return Math.floor(number);
} else {
return Math.ceil(number);
}
}
function bubble() {
var milliseconds = this._milliseconds;
var days = this._days;
var months = this._months;
var data = this._data;
var seconds, minutes, hours, years, monthsFromDays; // if we have a mix of positive and negative values, bubble down first
// check: https://github.com/moment/moment/issues/2166
if (!(milliseconds >= 0 && days >= 0 && months >= 0 || milliseconds <= 0 && days <= 0 && months <= 0)) {
milliseconds += absCeil(monthsToDays(months) + days) * 864e5;
days = 0;
months = 0;
} // The following code bubbles up values, see the tests for
// examples of what that means.
data.milliseconds = milliseconds % 1000;
seconds = absFloor(milliseconds / 1000);
data.seconds = seconds % 60;
minutes = absFloor(seconds / 60);
data.minutes = minutes % 60;
hours = absFloor(minutes / 60);
data.hours = hours % 24;
days += absFloor(hours / 24); // convert days to months
monthsFromDays = absFloor(daysToMonths(days));
months += monthsFromDays;
days -= absCeil(monthsToDays(monthsFromDays)); // 12 months -> 1 year
years = absFloor(months / 12);
months %= 12;
data.days = days;
data.months = months;
data.years = years;
return this;
}
function daysToMonths(days) {
// 400 years have 146097 days (taking into account leap year rules)
// 400 years have 12 months === 4800
return days * 4800 / 146097;
}
function monthsToDays(months) {
// the reverse of daysToMonths
return months * 146097 / 4800;
}
function as(units) {
if (!this.isValid()) {
return NaN;
}
var days;
var months;
var milliseconds = this._milliseconds;
units = normalizeUnits(units);
if (units === 'month' || units === 'quarter' || units === 'year') {
days = this._days + milliseconds / 864e5;
months = this._months + daysToMonths(days);
switch (units) {
case 'month':
return months;
case 'quarter':
return months / 3;
case 'year':
return months / 12;
}
} else {
// handle milliseconds separately because of floating point math errors (issue #1867)
days = this._days + Math.round(monthsToDays(this._months));
switch (units) {
case 'week':
return days / 7 + milliseconds / 6048e5;
case 'day':
return days + milliseconds / 864e5;
case 'hour':
return days * 24 + milliseconds / 36e5;
case 'minute':
return days * 1440 + milliseconds / 6e4;
case 'second':
return days * 86400 + milliseconds / 1000;
// Math.floor prevents floating point math errors here
case 'millisecond':
return Math.floor(days * 864e5) + milliseconds;
default:
throw new Error('Unknown unit ' + units);
}
}
} // TODO: Use this.as('ms')?
function valueOf$1() {
if (!this.isValid()) {
return NaN;
}
return this._milliseconds + this._days * 864e5 + this._months % 12 * 2592e6 + toInt(this._months / 12) * 31536e6;
}
function makeAs(alias) {
return function () {
return this.as(alias);
};
}
var asMilliseconds = makeAs('ms');
var asSeconds = makeAs('s');
var asMinutes = makeAs('m');
var asHours = makeAs('h');
var asDays = makeAs('d');
var asWeeks = makeAs('w');
var asMonths = makeAs('M');
var asQuarters = makeAs('Q');
var asYears = makeAs('y');
function clone$1() {
return createDuration(this);
}
function get$2(units) {
units = normalizeUnits(units);
return this.isValid() ? this[units + 's']() : NaN;
}
function makeGetter(name) {
return function () {
return this.isValid() ? this._data[name] : NaN;
};
}
var milliseconds = makeGetter('milliseconds');
var seconds = makeGetter('seconds');
var minutes = makeGetter('minutes');
var hours = makeGetter('hours');
var days = makeGetter('days');
var months = makeGetter('months');
var years = makeGetter('years');
function weeks() {
return absFloor(this.days() / 7);
}
var round = Math.round;
var thresholds = {
ss: 44,
// a few seconds to seconds
s: 45,
// seconds to minute
m: 45,
// minutes to hour
h: 22,
// hours to day
d: 26,
// days to month
M: 11 // months to year
}; // helper function for moment.fn.from, moment.fn.fromNow, and moment.duration.fn.humanize
function substituteTimeAgo(string, number, withoutSuffix, isFuture, locale) {
return locale.relativeTime(number || 1, !!withoutSuffix, string, isFuture);
}
function relativeTime$1(posNegDuration, withoutSuffix, locale) {
var duration = createDuration(posNegDuration).abs();
var seconds = round(duration.as('s'));
var minutes = round(duration.as('m'));
var hours = round(duration.as('h'));
var days = round(duration.as('d'));
var months = round(duration.as('M'));
var years = round(duration.as('y'));
var a = seconds <= thresholds.ss && ['s', seconds] || seconds < thresholds.s && ['ss', seconds] || minutes <= 1 && ['m'] || minutes < thresholds.m && ['mm', minutes] || hours <= 1 && ['h'] || hours < thresholds.h && ['hh', hours] || days <= 1 && ['d'] || days < thresholds.d && ['dd', days] || months <= 1 && ['M'] || months < thresholds.M && ['MM', months] || years <= 1 && ['y'] || ['yy', years];
a[2] = withoutSuffix;
a[3] = +posNegDuration > 0;
a[4] = locale;
return substituteTimeAgo.apply(null, a);
} // This function allows you to set the rounding function for relative time strings
function getSetRelativeTimeRounding(roundingFunction) {
if (roundingFunction === undefined) {
return round;
}
if (typeof roundingFunction === 'function') {
round = roundingFunction;
return true;
}
return false;
} // This function allows you to set a threshold for relative time strings
function getSetRelativeTimeThreshold(threshold, limit) {
if (thresholds[threshold] === undefined) {
return false;
}
if (limit === undefined) {
return thresholds[threshold];
}
thresholds[threshold] = limit;
if (threshold === 's') {
thresholds.ss = limit - 1;
}
return true;
}
function humanize(withSuffix) {
if (!this.isValid()) {
return this.localeData().invalidDate();
}
var locale = this.localeData();
var output = relativeTime$1(this, !withSuffix, locale);
if (withSuffix) {
output = locale.pastFuture(+this, output);
}
return locale.postformat(output);
}
var abs$1 = Math.abs;
function sign(x) {
return (x > 0) - (x < 0) || +x;
}
function toISOString$1() {
// for ISO strings we do not use the normal bubbling rules:
// * milliseconds bubble up until they become hours
// * days do not bubble at all
// * months bubble up until they become years
// This is because there is no context-free conversion between hours and days
// (think of clock changes)
// and also not between days and months (28-31 days per month)
if (!this.isValid()) {
return this.localeData().invalidDate();
}
var seconds = abs$1(this._milliseconds) / 1000;
var days = abs$1(this._days);
var months = abs$1(this._months);
var minutes, hours, years; // 3600 seconds -> 60 minutes -> 1 hour
minutes = absFloor(seconds / 60);
hours = absFloor(minutes / 60);
seconds %= 60;
minutes %= 60; // 12 months -> 1 year
years = absFloor(months / 12);
months %= 12; // inspired by https://github.com/dordille/moment-isoduration/blob/master/moment.isoduration.js
var Y = years;
var M = months;
var D = days;
var h = hours;
var m = minutes;
var s = seconds ? seconds.toFixed(3).replace(/\.?0+$/, '') : '';
var total = this.asSeconds();
if (!total) {
// this is the same as C#'s (Noda) and python (isodate)...
// but not other JS (goog.date)
return 'P0D';
}
var totalSign = total < 0 ? '-' : '';
var ymSign = sign(this._months) !== sign(total) ? '-' : '';
var daysSign = sign(this._days) !== sign(total) ? '-' : '';
var hmsSign = sign(this._milliseconds) !== sign(total) ? '-' : '';
return totalSign + 'P' + (Y ? ymSign + Y + 'Y' : '') + (M ? ymSign + M + 'M' : '') + (D ? daysSign + D + 'D' : '') + (h || m || s ? 'T' : '') + (h ? hmsSign + h + 'H' : '') + (m ? hmsSign + m + 'M' : '') + (s ? hmsSign + s + 'S' : '');
}
var proto$2 = Duration.prototype;
proto$2.isValid = isValid$1;
proto$2.abs = abs;
proto$2.add = add$1;
proto$2.subtract = subtract$1;
proto$2.as = as;
proto$2.asMilliseconds = asMilliseconds;
proto$2.asSeconds = asSeconds;
proto$2.asMinutes = asMinutes;
proto$2.asHours = asHours;
proto$2.asDays = asDays;
proto$2.asWeeks = asWeeks;
proto$2.asMonths = asMonths;
proto$2.asQuarters = asQuarters;
proto$2.asYears = asYears;
proto$2.valueOf = valueOf$1;
proto$2._bubble = bubble;
proto$2.clone = clone$1;
proto$2.get = get$2;
proto$2.milliseconds = milliseconds;
proto$2.seconds = seconds;
proto$2.minutes = minutes;
proto$2.hours = hours;
proto$2.days = days;
proto$2.weeks = weeks;
proto$2.months = months;
proto$2.years = years;
proto$2.humanize = humanize;
proto$2.toISOString = toISOString$1;
proto$2.toString = toISOString$1;
proto$2.toJSON = toISOString$1;
proto$2.locale = locale;
proto$2.localeData = localeData;
proto$2.toIsoString = deprecate('toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)', toISOString$1);
proto$2.lang = lang; // Side effect imports
// FORMATTING
addFormatToken('X', 0, 0, 'unix');
addFormatToken('x', 0, 0, 'valueOf'); // PARSING
addRegexToken('x', matchSigned);
addRegexToken('X', matchTimestamp);
addParseToken('X', function (input, array, config) {
config._d = new Date(parseFloat(input, 10) * 1000);
});
addParseToken('x', function (input, array, config) {
config._d = new Date(toInt(input));
}); // Side effect imports
hooks.version = '2.24.0';
setHookCallback(createLocal);
hooks.fn = proto;
hooks.min = min;
hooks.max = max;
hooks.now = now;
hooks.utc = createUTC;
hooks.unix = createUnix;
hooks.months = listMonths;
hooks.isDate = isDate;
hooks.locale = getSetGlobalLocale;
hooks.invalid = createInvalid;
hooks.duration = createDuration;
hooks.isMoment = isMoment;
hooks.weekdays = listWeekdays;
hooks.parseZone = createInZone;
hooks.localeData = getLocale;
hooks.isDuration = isDuration;
hooks.monthsShort = listMonthsShort;
hooks.weekdaysMin = listWeekdaysMin;
hooks.defineLocale = defineLocale;
hooks.updateLocale = updateLocale;
hooks.locales = listLocales;
hooks.weekdaysShort = listWeekdaysShort;
hooks.normalizeUnits = normalizeUnits;
hooks.relativeTimeRounding = getSetRelativeTimeRounding;
hooks.relativeTimeThreshold = getSetRelativeTimeThreshold;
hooks.calendarFormat = getCalendarFormat;
hooks.prototype = proto; // currently HTML5 input type only supports 24-hour formats
hooks.HTML5_FMT = {
DATETIME_LOCAL: 'YYYY-MM-DDTHH:mm',
// <input type="datetime-local" />
DATETIME_LOCAL_SECONDS: 'YYYY-MM-DDTHH:mm:ss',
// <input type="datetime-local" step="1" />
DATETIME_LOCAL_MS: 'YYYY-MM-DDTHH:mm:ss.SSS',
// <input type="datetime-local" step="0.001" />
DATE: 'YYYY-MM-DD',
// <input type="date" />
TIME: 'HH:mm',
// <input type="time" />
TIME_SECONDS: 'HH:mm:ss',
// <input type="time" step="1" />
TIME_MS: 'HH:mm:ss.SSS',
// <input type="time" step="0.001" />
WEEK: 'GGGG-[W]WW',
// <input type="week" />
MONTH: 'YYYY-MM' // <input type="month" />
};
return hooks;
});
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../webpack/buildin/module.js */ "./node_modules/webpack/buildin/module.js")(module)))
/***/ }),
/***/ "./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.3
* @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;
} // Events originating from a shadow DOM are re-targetted and `e.target` is the shadow host,
// not the initial event target in the shadow tree. Note that not all events cross the
// shadow boundary.
// For shadow trees with `mode: 'open'`, the initial event target is the first element in
// the event’s composed path. For shadow trees with `mode: 'closed'`, the initial event
// target cannot be obtained.
if ('composedPath' in e && typeof e.composedPath === 'function') {
// For open shadow trees, update `element` so that the following check works.
var initialEventTarget = e.composedPath()[0];
if (initialEventTarget !== e.target) {
element = initialEventTarget;
}
} // 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/object-inspect/index.js":
/*!**********************************************!*\
!*** ./node_modules/object-inspect/index.js ***!
\**********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var hasMap = typeof Map === 'function' && Map.prototype;
var mapSizeDescriptor = Object.getOwnPropertyDescriptor && hasMap ? Object.getOwnPropertyDescriptor(Map.prototype, 'size') : null;
var mapSize = hasMap && mapSizeDescriptor && typeof mapSizeDescriptor.get === 'function' ? mapSizeDescriptor.get : null;
var mapForEach = hasMap && Map.prototype.forEach;
var hasSet = typeof Set === 'function' && Set.prototype;
var setSizeDescriptor = Object.getOwnPropertyDescriptor && hasSet ? Object.getOwnPropertyDescriptor(Set.prototype, 'size') : null;
var setSize = hasSet && setSizeDescriptor && typeof setSizeDescriptor.get === 'function' ? setSizeDescriptor.get : null;
var setForEach = hasSet && Set.prototype.forEach;
var booleanValueOf = Boolean.prototype.valueOf;
var objectToString = Object.prototype.toString;
var bigIntValueOf = typeof BigInt === 'function' ? BigInt.prototype.valueOf : null;
var inspectCustom = __webpack_require__(/*! ./util.inspect */ 0).custom;
var inspectSymbol = inspectCustom && isSymbol(inspectCustom) ? inspectCustom : null;
module.exports = function inspect_(obj, opts, depth, seen) {
if (!opts) opts = {};
if (has(opts, 'quoteStyle') && opts.quoteStyle !== 'single' && opts.quoteStyle !== 'double') {
throw new TypeError('option "quoteStyle" must be "single" or "double"');
}
if (typeof obj === 'undefined') {
return 'undefined';
}
if (obj === null) {
return 'null';
}
if (typeof obj === 'boolean') {
return obj ? 'true' : 'false';
}
if (typeof obj === 'string') {
return inspectString(obj, opts);
}
if (typeof obj === 'number') {
if (obj === 0) {
return Infinity / obj > 0 ? '0' : '-0';
}
return String(obj);
}
if (typeof obj === 'bigint') {
return String(obj) + 'n';
}
var maxDepth = typeof opts.depth === 'undefined' ? 5 : opts.depth;
if (typeof depth === 'undefined') depth = 0;
if (depth >= maxDepth && maxDepth > 0 && typeof obj === 'object') {
return '[Object]';
}
if (typeof seen === 'undefined') seen = [];else if (indexOf(seen, obj) >= 0) {
return '[Circular]';
}
function inspect(value, from) {
if (from) {
seen = seen.slice();
seen.push(from);
}
return inspect_(value, opts, depth + 1, seen);
}
if (typeof obj === 'function') {
var name = nameOf(obj);
return '[Function' + (name ? ': ' + name : '') + ']';
}
if (isSymbol(obj)) {
var symString = Symbol.prototype.toString.call(obj);
return typeof obj === 'object' ? markBoxed(symString) : symString;
}
if (isElement(obj)) {
var s = '<' + String(obj.nodeName).toLowerCase();
var attrs = obj.attributes || [];
for (var i = 0; i < attrs.length; i++) {
s += ' ' + attrs[i].name + '=' + wrapQuotes(quote(attrs[i].value), 'double', opts);
}
s += '>';
if (obj.childNodes && obj.childNodes.length) s += '...';
s += '</' + String(obj.nodeName).toLowerCase() + '>';
return s;
}
if (isArray(obj)) {
if (obj.length === 0) return '[]';
return '[ ' + arrObjKeys(obj, inspect).join(', ') + ' ]';
}
if (isError(obj)) {
var parts = arrObjKeys(obj, inspect);
if (parts.length === 0) return '[' + String(obj) + ']';
return '{ [' + String(obj) + '] ' + parts.join(', ') + ' }';
}
if (typeof obj === 'object') {
if (inspectSymbol && typeof obj[inspectSymbol] === 'function') {
return obj[inspectSymbol]();
} else if (typeof obj.inspect === 'function') {
return obj.inspect();
}
}
if (isMap(obj)) {
var parts = [];
mapForEach.call(obj, function (value, key) {
parts.push(inspect(key, obj) + ' => ' + inspect(value, obj));
});
return collectionOf('Map', mapSize.call(obj), parts);
}
if (isSet(obj)) {
var parts = [];
setForEach.call(obj, function (value) {
parts.push(inspect(value, obj));
});
return collectionOf('Set', setSize.call(obj), parts);
}
if (isNumber(obj)) {
return markBoxed(inspect(Number(obj)));
}
if (isBigInt(obj)) {
return markBoxed(inspect(bigIntValueOf.call(obj)));
}
if (isBoolean(obj)) {
return markBoxed(booleanValueOf.call(obj));
}
if (isString(obj)) {
return markBoxed(inspect(String(obj)));
}
if (!isDate(obj) && !isRegExp(obj)) {
var xs = arrObjKeys(obj, inspect);
if (xs.length === 0) return '{}';
return '{ ' + xs.join(', ') + ' }';
}
return String(obj);
};
function wrapQuotes(s, defaultStyle, opts) {
var quoteChar = (opts.quoteStyle || defaultStyle) === 'double' ? '"' : "'";
return quoteChar + s + quoteChar;
}
function quote(s) {
return String(s).replace(/"/g, '"');
}
function isArray(obj) {
return toStr(obj) === '[object Array]';
}
function isDate(obj) {
return toStr(obj) === '[object Date]';
}
function isRegExp(obj) {
return toStr(obj) === '[object RegExp]';
}
function isError(obj) {
return toStr(obj) === '[object Error]';
}
function isSymbol(obj) {
return toStr(obj) === '[object Symbol]';
}
function isString(obj) {
return toStr(obj) === '[object String]';
}
function isNumber(obj) {
return toStr(obj) === '[object Number]';
}
function isBigInt(obj) {
return toStr(obj) === '[object BigInt]';
}
function isBoolean(obj) {
return toStr(obj) === '[object Boolean]';
}
var hasOwn = Object.prototype.hasOwnProperty || function (key) {
return key in this;
};
function has(obj, key) {
return hasOwn.call(obj, key);
}
function toStr(obj) {
return objectToString.call(obj);
}
function nameOf(f) {
if (f.name) return f.name;
var m = String(f).match(/^function\s*([\w$]+)/);
if (m) return m[1];
}
function indexOf(xs, x) {
if (xs.indexOf) return xs.indexOf(x);
for (var i = 0, l = xs.length; i < l; i++) {
if (xs[i] === x) return i;
}
return -1;
}
function isMap(x) {
if (!mapSize) {
return false;
}
try {
mapSize.call(x);
try {
setSize.call(x);
} catch (s) {
return true;
}
return x instanceof Map; // core-js workaround, pre-v2.5.0
} catch (e) {}
return false;
}
function isSet(x) {
if (!setSize) {
return false;
}
try {
setSize.call(x);
try {
mapSize.call(x);
} catch (m) {
return true;
}
return x instanceof Set; // core-js workaround, pre-v2.5.0
} catch (e) {}
return false;
}
function isElement(x) {
if (!x || typeof x !== 'object') return false;
if (typeof HTMLElement !== 'undefined' && x instanceof HTMLElement) {
return true;
}
return typeof x.nodeName === 'string' && typeof x.getAttribute === 'function';
}
function inspectString(str, opts) {
var s = str.replace(/(['\\])/g, '\\$1').replace(/[\x00-\x1f]/g, lowbyte);
return wrapQuotes(s, 'single', opts);
}
function lowbyte(c) {
var n = c.charCodeAt(0);
var x = {
8: 'b',
9: 't',
10: 'n',
12: 'f',
13: 'r'
}[n];
if (x) return '\\' + x;
return '\\x' + (n < 0x10 ? '0' : '') + n.toString(16);
}
function markBoxed(str) {
return 'Object(' + str + ')';
}
function collectionOf(type, size, entries) {
return type + ' (' + size + ') {' + entries.join(', ') + '}';
}
function arrObjKeys(obj, inspect) {
var isArr = isArray(obj);
var xs = [];
if (isArr) {
xs.length = obj.length;
for (var i = 0; i < obj.length; i++) {
xs[i] = has(obj, i) ? inspect(obj[i], obj) : '';
}
}
for (var key in obj) {
if (!has(obj, key)) continue;
if (isArr && String(Number(key)) === key && key < obj.length) continue;
if (/[^\w$]/.test(key)) {
xs.push(inspect(key, obj) + ': ' + inspect(obj[key], obj));
} else {
xs.push(key + ': ' + inspect(obj[key], obj));
}
}
return xs;
}
/***/ }),
/***/ "./node_modules/object-is/index.js":
/*!*****************************************!*\
!*** ./node_modules/object-is/index.js ***!
\*****************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/* https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.is */
var NumberIsNaN = function (value) {
return value !== value;
};
module.exports = function is(a, b) {
if (a === 0 && b === 0) {
return 1 / a === 1 / b;
} else if (a === b) {
return true;
} else if (NumberIsNaN(a) && NumberIsNaN(b)) {
return true;
}
return false;
};
/***/ }),
/***/ "./node_modules/object-keys/implementation.js":
/*!****************************************************!*\
!*** ./node_modules/object-keys/implementation.js ***!
\****************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var keysShim;
if (!Object.keys) {
// modified from https://github.com/es-shims/es5-shim
var has = Object.prototype.hasOwnProperty;
var toStr = Object.prototype.toString;
var isArgs = __webpack_require__(/*! ./isArguments */ "./node_modules/object-keys/isArguments.js"); // eslint-disable-line global-require
var isEnumerable = Object.prototype.propertyIsEnumerable;
var hasDontEnumBug = !isEnumerable.call({
toString: null
}, 'toString');
var hasProtoEnumBug = isEnumerable.call(function () {}, 'prototype');
var dontEnums = ['toString', 'toLocaleString', 'valueOf', 'hasOwnProperty', 'isPrototypeOf', 'propertyIsEnumerable', 'constructor'];
var equalsConstructorPrototype = function (o) {
var ctor = o.constructor;
return ctor && ctor.prototype === o;
};
var excludedKeys = {
$applicationCache: true,
$console: true,
$external: true,
$frame: true,
$frameElement: true,
$frames: true,
$innerHeight: true,
$innerWidth: true,
$onmozfullscreenchange: true,
$onmozfullscreenerror: true,
$outerHeight: true,
$outerWidth: true,
$pageXOffset: true,
$pageYOffset: true,
$parent: true,
$scrollLeft: true,
$scrollTop: true,
$scrollX: true,
$scrollY: true,
$self: true,
$webkitIndexedDB: true,
$webkitStorageInfo: true,
$window: true
};
var hasAutomationEqualityBug = function () {
/* global window */
if (typeof window === 'undefined') {
return false;
}
for (var k in window) {
try {
if (!excludedKeys['$' + k] && has.call(window, k) && window[k] !== null && typeof window[k] === 'object') {
try {
equalsConstructorPrototype(window[k]);
} catch (e) {
return true;
}
}
} catch (e) {
return true;
}
}
return false;
}();
var equalsConstructorPrototypeIfNotBuggy = function (o) {
/* global window */
if (typeof window === 'undefined' || !hasAutomationEqualityBug) {
return equalsConstructorPrototype(o);
}
try {
return equalsConstructorPrototype(o);
} catch (e) {
return false;
}
};
keysShim = function keys(object) {
var isObject = object !== null && typeof object === 'object';
var isFunction = toStr.call(object) === '[object Function]';
var isArguments = isArgs(object);
var isString = isObject && toStr.call(object) === '[object String]';
var theKeys = [];
if (!isObject && !isFunction && !isArguments) {
throw new TypeError('Object.keys called on a non-object');
}
var skipProto = hasProtoEnumBug && isFunction;
if (isString && object.length > 0 && !has.call(object, 0)) {
for (var i = 0; i < object.length; ++i) {
theKeys.push(String(i));
}
}
if (isArguments && object.length > 0) {
for (var j = 0; j < object.length; ++j) {
theKeys.push(String(j));
}
} else {
for (var name in object) {
if (!(skipProto && name === 'prototype') && has.call(object, name)) {
theKeys.push(String(name));
}
}
}
if (hasDontEnumBug) {
var skipConstructor = equalsConstructorPrototypeIfNotBuggy(object);
for (var k = 0; k < dontEnums.length; ++k) {
if (!(skipConstructor && dontEnums[k] === 'constructor') && has.call(object, dontEnums[k])) {
theKeys.push(dontEnums[k]);
}
}
}
return theKeys;
};
}
module.exports = keysShim;
/***/ }),
/***/ "./node_modules/object-keys/index.js":
/*!*******************************************!*\
!*** ./node_modules/object-keys/index.js ***!
\*******************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var slice = Array.prototype.slice;
var isArgs = __webpack_require__(/*! ./isArguments */ "./node_modules/object-keys/isArguments.js");
var origKeys = Object.keys;
var keysShim = origKeys ? function keys(o) {
return origKeys(o);
} : __webpack_require__(/*! ./implementation */ "./node_modules/object-keys/implementation.js");
var originalKeys = Object.keys;
keysShim.shim = function shimObjectKeys() {
if (Object.keys) {
var keysWorksWithArguments = function () {
// Safari 5.0 bug
var args = Object.keys(arguments);
return args && args.length === arguments.length;
}(1, 2);
if (!keysWorksWithArguments) {
Object.keys = function keys(object) {
// eslint-disable-line func-name-matching
if (isArgs(object)) {
return originalKeys(slice.call(object));
}
return originalKeys(object);
};
}
} else {
Object.keys = keysShim;
}
return Object.keys || keysShim;
};
module.exports = keysShim;
/***/ }),
/***/ "./node_modules/object-keys/isArguments.js":
/*!*************************************************!*\
!*** ./node_modules/object-keys/isArguments.js ***!
\*************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var toStr = Object.prototype.toString;
module.exports = function isArguments(value) {
var str = toStr.call(value);
var isArgs = str === '[object Arguments]';
if (!isArgs) {
isArgs = str !== '[object Array]' && value !== null && typeof value === 'object' && typeof value.length === 'number' && value.length >= 0 && toStr.call(value.callee) === '[object Function]';
}
return isArgs;
};
/***/ }),
/***/ "./node_modules/object.assign/implementation.js":
/*!******************************************************!*\
!*** ./node_modules/object.assign/implementation.js ***!
\******************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
// modified from https://github.com/es-shims/es6-shim
var keys = __webpack_require__(/*! object-keys */ "./node_modules/object-keys/index.js");
var bind = __webpack_require__(/*! function-bind */ "./node_modules/function-bind/index.js");
var canBeObject = function (obj) {
return typeof obj !== 'undefined' && obj !== null;
};
var hasSymbols = __webpack_require__(/*! has-symbols/shams */ "./node_modules/has-symbols/shams.js")();
var toObject = Object;
var push = bind.call(Function.call, Array.prototype.push);
var propIsEnumerable = bind.call(Function.call, Object.prototype.propertyIsEnumerable);
var originalGetSymbols = hasSymbols ? Object.getOwnPropertySymbols : null;
module.exports = function assign(target, source1) {
if (!canBeObject(target)) {
throw new TypeError('target must be an object');
}
var objTarget = toObject(target);
var s, source, i, props, syms, value, key;
for (s = 1; s < arguments.length; ++s) {
source = toObject(arguments[s]);
props = keys(source);
var getSymbols = hasSymbols && (Object.getOwnPropertySymbols || originalGetSymbols);
if (getSymbols) {
syms = getSymbols(source);
for (i = 0; i < syms.length; ++i) {
key = syms[i];
if (propIsEnumerable(source, key)) {
push(props, key);
}
}
}
for (i = 0; i < props.length; ++i) {
key = props[i];
value = source[key];
if (propIsEnumerable(source, key)) {
objTarget[key] = value;
}
}
}
return objTarget;
};
/***/ }),
/***/ "./node_modules/object.assign/index.js":
/*!*********************************************!*\
!*** ./node_modules/object.assign/index.js ***!
\*********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var defineProperties = __webpack_require__(/*! define-properties */ "./node_modules/define-properties/index.js");
var implementation = __webpack_require__(/*! ./implementation */ "./node_modules/object.assign/implementation.js");
var getPolyfill = __webpack_require__(/*! ./polyfill */ "./node_modules/object.assign/polyfill.js");
var shim = __webpack_require__(/*! ./shim */ "./node_modules/object.assign/shim.js");
var polyfill = getPolyfill();
defineProperties(polyfill, {
getPolyfill: getPolyfill,
implementation: implementation,
shim: shim
});
module.exports = polyfill;
/***/ }),
/***/ "./node_modules/object.assign/polyfill.js":
/*!************************************************!*\
!*** ./node_modules/object.assign/polyfill.js ***!
\************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var implementation = __webpack_require__(/*! ./implementation */ "./node_modules/object.assign/implementation.js");
var lacksProperEnumerationOrder = function () {
if (!Object.assign) {
return false;
} // v8, specifically in node 4.x, has a bug with incorrect property enumeration order
// note: this does not detect the bug unless there's 20 characters
var str = 'abcdefghijklmnopqrst';
var letters = str.split('');
var map = {};
for (var i = 0; i < letters.length; ++i) {
map[letters[i]] = letters[i];
}
var obj = Object.assign({}, map);
var actual = '';
for (var k in obj) {
actual += k;
}
return str !== actual;
};
var assignHasPendingExceptions = function () {
if (!Object.assign || !Object.preventExtensions) {
return false;
} // Firefox 37 still has "pending exception" logic in its Object.assign implementation,
// which is 72% slower than our shim, and Firefox 40's native implementation.
var thrower = Object.preventExtensions({
1: 2
});
try {
Object.assign(thrower, 'xy');
} catch (e) {
return thrower[1] === 'y';
}
return false;
};
module.exports = function getPolyfill() {
if (!Object.assign) {
return implementation;
}
if (lacksProperEnumerationOrder()) {
return implementation;
}
if (assignHasPendingExceptions()) {
return implementation;
}
return Object.assign;
};
/***/ }),
/***/ "./node_modules/object.assign/shim.js":
/*!********************************************!*\
!*** ./node_modules/object.assign/shim.js ***!
\********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var define = __webpack_require__(/*! define-properties */ "./node_modules/define-properties/index.js");
var getPolyfill = __webpack_require__(/*! ./polyfill */ "./node_modules/object.assign/polyfill.js");
module.exports = function shimAssign() {
var polyfill = getPolyfill();
define(Object, {
assign: polyfill
}, {
assign: function () {
return Object.assign !== polyfill;
}
});
return polyfill;
};
/***/ }),
/***/ "./node_modules/object.entries/implementation.js":
/*!*******************************************************!*\
!*** ./node_modules/object.entries/implementation.js ***!
\*******************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var ES = __webpack_require__(/*! es-abstract/es7 */ "./node_modules/es-abstract/es7.js");
var has = __webpack_require__(/*! has */ "./node_modules/has/src/index.js");
var bind = __webpack_require__(/*! function-bind */ "./node_modules/function-bind/index.js");
var isEnumerable = bind.call(Function.call, Object.prototype.propertyIsEnumerable);
module.exports = function entries(O) {
var obj = ES.RequireObjectCoercible(O);
var entrys = [];
for (var key in obj) {
if (has(obj, key) && isEnumerable(obj, key)) {
entrys.push([key, obj[key]]);
}
}
return entrys;
};
/***/ }),
/***/ "./node_modules/object.entries/index.js":
/*!**********************************************!*\
!*** ./node_modules/object.entries/index.js ***!
\**********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var define = __webpack_require__(/*! define-properties */ "./node_modules/define-properties/index.js");
var implementation = __webpack_require__(/*! ./implementation */ "./node_modules/object.entries/implementation.js");
var getPolyfill = __webpack_require__(/*! ./polyfill */ "./node_modules/object.entries/polyfill.js");
var shim = __webpack_require__(/*! ./shim */ "./node_modules/object.entries/shim.js");
var polyfill = getPolyfill();
define(polyfill, {
getPolyfill: getPolyfill,
implementation: implementation,
shim: shim
});
module.exports = polyfill;
/***/ }),
/***/ "./node_modules/object.entries/polyfill.js":
/*!*************************************************!*\
!*** ./node_modules/object.entries/polyfill.js ***!
\*************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var implementation = __webpack_require__(/*! ./implementation */ "./node_modules/object.entries/implementation.js");
module.exports = function getPolyfill() {
return typeof Object.entries === 'function' ? Object.entries : implementation;
};
/***/ }),
/***/ "./node_modules/object.entries/shim.js":
/*!*********************************************!*\
!*** ./node_modules/object.entries/shim.js ***!
\*********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var getPolyfill = __webpack_require__(/*! ./polyfill */ "./node_modules/object.entries/polyfill.js");
var define = __webpack_require__(/*! define-properties */ "./node_modules/define-properties/index.js");
module.exports = function shimEntries() {
var polyfill = getPolyfill();
define(Object, {
entries: polyfill
}, {
entries: function testEntries() {
return Object.entries !== polyfill;
}
});
return polyfill;
};
/***/ }),
/***/ "./node_modules/object.values/implementation.js":
/*!******************************************************!*\
!*** ./node_modules/object.values/implementation.js ***!
\******************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var ES = __webpack_require__(/*! es-abstract/es7 */ "./node_modules/es-abstract/es7.js");
var has = __webpack_require__(/*! has */ "./node_modules/has/src/index.js");
var bind = __webpack_require__(/*! function-bind */ "./node_modules/function-bind/index.js");
var isEnumerable = bind.call(Function.call, Object.prototype.propertyIsEnumerable);
module.exports = function values(O) {
var obj = ES.RequireObjectCoercible(O);
var vals = [];
for (var key in obj) {
if (has(obj, key) && isEnumerable(obj, key)) {
vals.push(obj[key]);
}
}
return vals;
};
/***/ }),
/***/ "./node_modules/object.values/index.js":
/*!*********************************************!*\
!*** ./node_modules/object.values/index.js ***!
\*********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var define = __webpack_require__(/*! define-properties */ "./node_modules/define-properties/index.js");
var implementation = __webpack_require__(/*! ./implementation */ "./node_modules/object.values/implementation.js");
var getPolyfill = __webpack_require__(/*! ./polyfill */ "./node_modules/object.values/polyfill.js");
var shim = __webpack_require__(/*! ./shim */ "./node_modules/object.values/shim.js");
var polyfill = getPolyfill();
define(polyfill, {
getPolyfill: getPolyfill,
implementation: implementation,
shim: shim
});
module.exports = polyfill;
/***/ }),
/***/ "./node_modules/object.values/polyfill.js":
/*!************************************************!*\
!*** ./node_modules/object.values/polyfill.js ***!
\************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var implementation = __webpack_require__(/*! ./implementation */ "./node_modules/object.values/implementation.js");
module.exports = function getPolyfill() {
return typeof Object.values === 'function' ? Object.values : implementation;
};
/***/ }),
/***/ "./node_modules/object.values/shim.js":
/*!********************************************!*\
!*** ./node_modules/object.values/shim.js ***!
\********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var getPolyfill = __webpack_require__(/*! ./polyfill */ "./node_modules/object.values/polyfill.js");
var define = __webpack_require__(/*! define-properties */ "./node_modules/define-properties/index.js");
module.exports = function shimValues() {
var polyfill = getPolyfill();
define(Object, {
values: polyfill
}, {
values: function testValues() {
return Object.values !== polyfill;
}
});
return polyfill;
};
/***/ }),
/***/ "./node_modules/process/browser.js":
/*!*****************************************!*\
!*** ./node_modules/process/browser.js ***!
\*****************************************/
/*! no static exports found */
/***/ (function(module, exports) {
// shim for using process in browser
var process = module.exports = {}; // cached from whatever global is present so that test runners that stub it
// don't break things. But we need to wrap it in a try catch in case it is
// wrapped in strict mode code which doesn't define any globals. It's inside a
// function because try/catches deoptimize in certain engines.
var cachedSetTimeout;
var cachedClearTimeout;
function defaultSetTimout() {
throw new Error('setTimeout has not been defined');
}
function defaultClearTimeout() {
throw new Error('clearTimeout has not been defined');
}
(function () {
try {
if (typeof setTimeout === 'function') {
cachedSetTimeout = setTimeout;
} else {
cachedSetTimeout = defaultSetTimout;
}
} catch (e) {
cachedSetTimeout = defaultSetTimout;
}
try {
if (typeof clearTimeout === 'function') {
cachedClearTimeout = clearTimeout;
} else {
cachedClearTimeout = defaultClearTimeout;
}
} catch (e) {
cachedClearTimeout = defaultClearTimeout;
}
})();
function runTimeout(fun) {
if (cachedSetTimeout === setTimeout) {
//normal enviroments in sane situations
return setTimeout(fun, 0);
} // if setTimeout wasn't available but was latter defined
if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
cachedSetTimeout = setTimeout;
return setTimeout(fun, 0);
}
try {
// when when somebody has screwed with setTimeout but no I.E. maddness
return cachedSetTimeout(fun, 0);
} catch (e) {
try {
// When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
return cachedSetTimeout.call(null, fun, 0);
} catch (e) {
// same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error
return cachedSetTimeout.call(this, fun, 0);
}
}
}
function runClearTimeout(marker) {
if (cachedClearTimeout === clearTimeout) {
//normal enviroments in sane situations
return clearTimeout(marker);
} // if clearTimeout wasn't available but was latter defined
if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {
cachedClearTimeout = clearTimeout;
return clearTimeout(marker);
}
try {
// when when somebody has screwed with setTimeout but no I.E. maddness
return cachedClearTimeout(marker);
} catch (e) {
try {
// When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
return cachedClearTimeout.call(null, marker);
} catch (e) {
// same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.
// Some versions of I.E. have different rules for clearTimeout vs setTimeout
return cachedClearTimeout.call(this, marker);
}
}
}
var queue = [];
var draining = false;
var currentQueue;
var queueIndex = -1;
function cleanUpNextTick() {
if (!draining || !currentQueue) {
return;
}
draining = false;
if (currentQueue.length) {
queue = currentQueue.concat(queue);
} else {
queueIndex = -1;
}
if (queue.length) {
drainQueue();
}
}
function drainQueue() {
if (draining) {
return;
}
var timeout = runTimeout(cleanUpNextTick);
draining = true;
var len = queue.length;
while (len) {
currentQueue = queue;
queue = [];
while (++queueIndex < len) {
if (currentQueue) {
currentQueue[queueIndex].run();
}
}
queueIndex = -1;
len = queue.length;
}
currentQueue = null;
draining = false;
runClearTimeout(timeout);
}
process.nextTick = function (fun) {
var args = new Array(arguments.length - 1);
if (arguments.length > 1) {
for (var i = 1; i < arguments.length; i++) {
args[i - 1] = arguments[i];
}
}
queue.push(new Item(fun, args));
if (queue.length === 1 && !draining) {
runTimeout(drainQueue);
}
}; // v8 likes predictible objects
function Item(fun, array) {
this.fun = fun;
this.array = array;
}
Item.prototype.run = function () {
this.fun.apply(null, this.array);
};
process.title = 'browser';
process.browser = true;
process.env = {};
process.argv = [];
process.version = ''; // empty string to avoid regexp issues
process.versions = {};
function noop() {}
process.on = noop;
process.addListener = noop;
process.once = noop;
process.off = noop;
process.removeListener = noop;
process.removeAllListeners = noop;
process.emit = noop;
process.prependListener = noop;
process.prependOnceListener = noop;
process.listeners = function (name) {
return [];
};
process.binding = function (name) {
throw new Error('process.binding is not supported');
};
process.cwd = function () {
return '/';
};
process.chdir = function (dir) {
throw new Error('process.chdir is not supported');
};
process.umask = function () {
return 0;
};
/***/ }),
/***/ "./node_modules/prop-types-exact/build/helpers/isPlainObject.js":
/*!**********************************************************************!*\
!*** ./node_modules/prop-types-exact/build/helpers/isPlainObject.js ***!
\**********************************************************************/
/*! no static exports found */
/***/ (function(module, exports) {
Object.defineProperty(exports, "__esModule", {
value: true
});
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;
};
exports['default'] = isPlainObject;
function isPlainObject(x) {
return x && (typeof x === 'undefined' ? 'undefined' : _typeof(x)) === 'object' && !Array.isArray(x);
}
module.exports = exports['default'];
/***/ }),
/***/ "./node_modules/prop-types-exact/build/index.js":
/*!******************************************************!*\
!*** ./node_modules/prop-types-exact/build/index.js ***!
\******************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports['default'] = forbidExtraProps;
var _object = __webpack_require__(/*! object.assign */ "./node_modules/object.assign/index.js");
var _object2 = _interopRequireDefault(_object);
var _has = __webpack_require__(/*! has */ "./node_modules/has/src/index.js");
var _has2 = _interopRequireDefault(_has);
var _isPlainObject = __webpack_require__(/*! ./helpers/isPlainObject */ "./node_modules/prop-types-exact/build/helpers/isPlainObject.js");
var _isPlainObject2 = _interopRequireDefault(_isPlainObject);
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;
}
var zeroWidthSpace = '\u200B';
var specialProperty = 'prop-types-exact: ' + zeroWidthSpace;
var semaphore = typeof Symbol === 'function' && typeof Symbol['for'] === 'function' ? Symbol['for'](specialProperty) :
/* istanbul ignore next */
specialProperty;
function brand(fn) {
return (0, _object2['default'])(fn, _defineProperty({}, specialProperty, semaphore));
}
function isBranded(value) {
return value && value[specialProperty] === semaphore;
}
function forbidExtraProps(propTypes) {
if (!(0, _isPlainObject2['default'])(propTypes)) {
throw new TypeError('given propTypes must be an object');
}
if ((0, _has2['default'])(propTypes, specialProperty) && !isBranded(propTypes[specialProperty])) {
throw new TypeError('Against all odds, you created a propType for a prop that uses both the zero-width space and our custom string - which, sadly, conflicts with `prop-types-exact`');
}
return (0, _object2['default'])({}, propTypes, _defineProperty({}, specialProperty, brand(function () {
function forbidUnknownProps(props, _, componentName) {
var unknownProps = Object.keys(props).filter(function (prop) {
return !(0, _has2['default'])(propTypes, prop);
});
if (unknownProps.length > 0) {
return new TypeError(String(componentName) + ': unknown props found: ' + String(unknownProps.join(', ')));
}
return null;
}
return forbidUnknownProps;
}())));
}
module.exports = exports['default'];
/***/ }),
/***/ "./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 = {};
var has = Function.call.bind(Object.prototype.hasOwnProperty);
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 (has(typeSpecs, 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 : ''));
}
}
}
}
}
/**
* Resets warning cache when testing.
*
* @private
*/
checkPropTypes.resetWarningCache = function () {
if (true) {
loggedTypeFailures = {};
}
};
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 ReactIs = __webpack_require__(/*! react-is */ "./node_modules/react-is/index.js");
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 has = Function.call.bind(Object.prototype.hasOwnProperty);
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(),
elementType: createElementTypeTypeChecker(),
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 createElementTypeTypeChecker() {
function validate(props, propName, componentName, location, propFullName) {
var propValue = props[propName];
if (!ReactIs.isValidElementType(propValue)) {
var propType = getPropType(propValue);
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement type.'));
}
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)) {
if (true) {
if (arguments.length > 1) {
printWarning('Invalid arguments supplied to oneOf, expected an array, got ' + arguments.length + ' arguments. ' + 'A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).');
} else {
printWarning('Invalid argument supplied to oneOf, expected an array.');
}
}
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, function replacer(key, value) {
var type = getPreciseType(value);
if (type === 'symbol') {
return String(value);
}
return value;
});
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of value `' + String(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 (has(propValue, 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;
} // falsy value can't be a Symbol
if (!propValue) {
return false;
} // 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.resetWarningCache = checkPropTypes.resetWarningCache;
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 ReactIs = __webpack_require__(/*! react-is */ "./node_modules/react-is/index.js"); // 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")(ReactIs.isElement, 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 ***!
\************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var __extends = this && this.__extends || function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function (d, b) {
d.__proto__ = b;
} || function (d, b) {
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
};
return extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() {
this.constructor = d;
}
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
}();
var __assign = this && this.__assign || function () {
__assign = Object.assign || function (t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
}
return t;
};
return __assign.apply(this, arguments);
};
var __importStar = this && this.__importStar || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
result["default"] = mod;
return result;
};
var __importDefault = this && this.__importDefault || function (mod) {
return mod && mod.__esModule ? mod : {
"default": mod
};
};
Object.defineProperty(exports, "__esModule", {
value: true
});
var React = __importStar(__webpack_require__(/*! react */ "react"));
var resizer_1 = __webpack_require__(/*! ./resizer */ "./node_modules/re-resizable/lib/resizer.js");
var fast_memoize_1 = __importDefault(__webpack_require__(/*! fast-memoize */ "./node_modules/fast-memoize/src/index.js"));
var DEFAULT_SIZE = {
width: 'auto',
height: 'auto'
};
var clamp = fast_memoize_1.default(function (n, min, max) {
return Math.max(Math.min(n, max), min);
});
var snap = fast_memoize_1.default(function (n, size) {
return Math.round(n / size) * size;
});
var hasDirection = fast_memoize_1.default(function (dir, target) {
return new RegExp(dir, 'i').test(target);
});
var findClosestSnap = fast_memoize_1.default(function (n, snapArray, snapGap) {
if (snapGap === void 0) {
snapGap = 0;
}
var closestGapIndex = snapArray.reduce(function (prev, curr, index) {
return Math.abs(curr - n) < Math.abs(snapArray[prev] - n) ? index : prev;
}, 0);
var gap = Math.abs(snapArray[closestGapIndex] - n);
return snapGap === 0 || gap < snapGap ? snapArray[closestGapIndex] : n;
});
var endsWith = fast_memoize_1.default(function (str, searchStr) {
return str.substr(str.length - searchStr.length, searchStr.length) === searchStr;
});
var getStringSize = fast_memoize_1.default(function (n) {
n = n.toString();
if (n === 'auto') {
return n;
}
if (endsWith(n, 'px')) {
return n;
}
if (endsWith(n, '%')) {
return n;
}
if (endsWith(n, 'vh')) {
return n;
}
if (endsWith(n, 'vw')) {
return n;
}
if (endsWith(n, 'vmax')) {
return n;
}
if (endsWith(n, 'vmin')) {
return n;
}
return n + "px";
});
var calculateNewMax = fast_memoize_1.default(function (parentSize, maxWidth, maxHeight, minWidth, minHeight) {
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 ratio = Number(maxHeight.replace('%', '')) / 100;
maxHeight = parentSize.height * ratio;
}
if (minWidth && typeof minWidth === 'string' && endsWith(minWidth, '%')) {
var ratio = Number(minWidth.replace('%', '')) / 100;
minWidth = parentSize.width * ratio;
}
if (minHeight && typeof minHeight === 'string' && endsWith(minHeight, '%')) {
var ratio = Number(minHeight.replace('%', '')) / 100;
minHeight = parentSize.height * ratio;
}
return {
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 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', 'resizeRatio', 'snapGap']; // HACK: This class is used to calculate % size.
var baseClassName = '__resizable_base__';
var Resizable =
/** @class */
function (_super) {
__extends(Resizable, _super);
function Resizable(props) {
var _this = _super.call(this, props) || this;
_this.ratio = 1;
_this.resizable = null; // For parent boundary
_this.parentLeft = 0;
_this.parentTop = 0; // For boundary
_this.resizableLeft = 0;
_this.resizableTop = 0; // For target boundary
_this.targetLeft = 0;
_this.targetTop = 0;
_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.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;
}
Object.defineProperty(Resizable.prototype, "parentNode", {
get: function () {
if (!this.resizable) {
return null;
}
return this.resizable.parentNode;
},
enumerable: true,
configurable: true
});
Object.defineProperty(Resizable.prototype, "propsSize", {
get: function () {
return this.props.size || this.props.defaultSize || DEFAULT_SIZE;
},
enumerable: true,
configurable: true
});
Object.defineProperty(Resizable.prototype, "base", {
get: function () {
var parent = this.parentNode;
if (!parent) {
return undefined;
}
var children = [].slice.call(parent.children);
for (var _i = 0, children_1 = children; _i < children_1.length; _i++) {
var n = children_1[_i];
if (n instanceof HTMLElement) {
if (n.classList.contains(baseClassName)) {
return n;
}
}
}
return undefined;
},
enumerable: true,
configurable: true
});
Object.defineProperty(Resizable.prototype, "size", {
get: function () {
var width = 0;
var height = 0;
if (typeof window !== 'undefined' && this.resizable) {
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
};
},
enumerable: true,
configurable: true
});
Object.defineProperty(Resizable.prototype, "sizeStyle", {
get: function () {
var _this = this;
var size = this.props.size;
var getSize = function (key) {
if (typeof _this.state[key] === 'undefined' || _this.state[key] === 'auto') {
return 'auto';
}
if (_this.propsSize && _this.propsSize[key] && endsWith(_this.propsSize[key].toString(), '%')) {
if (endsWith(_this.state[key].toString(), '%')) {
return _this.state[key].toString();
}
var parentSize = _this.getParentSize();
var value = Number(_this.state[key].toString().replace('px', ''));
var percent = value / parentSize[key] * 100;
return percent + "%";
}
return getStringSize(_this.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
};
},
enumerable: true,
configurable: true
});
Resizable.prototype.getParentSize = function () {
if (!this.base || !this.parentNode) {
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 = this.base.style.minWidth;
if (wrap !== 'wrap') {
wrapChanged = true;
this.parentNode.style.flexWrap = 'wrap'; // HACK: Use relative to get parent padding size
}
this.base.style.position = 'relative';
this.base.style.minWidth = '100%';
var size = {
width: this.base.offsetWidth,
height: this.base.offsetHeight
};
this.base.style.position = 'absolute';
if (wrapChanged) {
this.parentNode.style.flexWrap = wrap;
}
this.base.style.minWidth = minWidth;
return size;
};
Resizable.prototype.componentDidMount = function () {
this.setState({
width: this.state.width || this.size.width,
height: this.state.height || this.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);
};
Resizable.prototype.componentWillUnmount = function () {
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_1 = this.parentNode;
if (!this.base || !parent_1) {
return;
}
if (!(parent_1 instanceof HTMLElement) || !(this.base instanceof Node)) {
return;
}
parent_1.removeChild(this.base);
}
};
Resizable.prototype.createSizeForCssProperty = function (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;
};
Resizable.prototype.calculateNewMaxFromBoundary = function (maxWidth, maxHeight) {
if (this.props.bounds === 'parent') {
var parent_2 = this.parentNode;
if (parent_2 instanceof HTMLElement) {
var boundWidth = parent_2.offsetWidth + (this.parentLeft - this.resizableLeft);
var boundHeight = parent_2.offsetHeight + (this.parentTop - this.resizableTop);
maxWidth = maxWidth && maxWidth < boundWidth ? maxWidth : boundWidth;
maxHeight = maxHeight && maxHeight < boundHeight ? maxHeight : boundHeight;
}
} else if (this.props.bounds === 'window') {
if (typeof window !== 'undefined') {
var boundWidth = window.innerWidth - this.resizableLeft;
var boundHeight = window.innerHeight - this.resizableTop;
maxWidth = maxWidth && maxWidth < boundWidth ? maxWidth : boundWidth;
maxHeight = maxHeight && maxHeight < boundHeight ? maxHeight : boundHeight;
}
} else if (this.props.bounds instanceof HTMLElement) {
var boundWidth = this.props.bounds.offsetWidth + (this.targetLeft - this.resizableLeft);
var boundHeight = this.props.bounds.offsetHeight + (this.targetTop - this.resizableTop);
maxWidth = maxWidth && maxWidth < boundWidth ? maxWidth : boundWidth;
maxHeight = maxHeight && maxHeight < boundHeight ? maxHeight : boundHeight;
}
return {
maxWidth: maxWidth,
maxHeight: maxHeight
};
};
Resizable.prototype.calculateNewSizeFromDirection = function (clientX, clientY) {
var scale = this.props.scale || 1;
var resizeRatio = this.props.resizeRatio || 1;
var _a = this.state,
direction = _a.direction,
original = _a.original;
var _b = this.props,
lockAspectRatio = _b.lockAspectRatio,
lockAspectRatioExtraHeight = _b.lockAspectRatioExtraHeight,
lockAspectRatioExtraWidth = _b.lockAspectRatioExtraWidth;
var newWidth = original.width;
var newHeight = original.height;
var extraHeight = lockAspectRatioExtraHeight || 0;
var extraWidth = lockAspectRatioExtraWidth || 0;
if (hasDirection('right', direction)) {
newWidth = original.width + (clientX - original.x) * resizeRatio / scale;
if (lockAspectRatio) {
newHeight = (newWidth - extraWidth) / this.ratio + extraHeight;
}
}
if (hasDirection('left', direction)) {
newWidth = original.width - (clientX - original.x) * resizeRatio / scale;
if (lockAspectRatio) {
newHeight = (newWidth - extraWidth) / this.ratio + extraHeight;
}
}
if (hasDirection('bottom', direction)) {
newHeight = original.height + (clientY - original.y) * resizeRatio / scale;
if (lockAspectRatio) {
newWidth = (newHeight - extraHeight) * this.ratio + extraWidth;
}
}
if (hasDirection('top', direction)) {
newHeight = original.height - (clientY - original.y) * resizeRatio / scale;
if (lockAspectRatio) {
newWidth = (newHeight - extraHeight) * this.ratio + extraWidth;
}
}
return {
newWidth: newWidth,
newHeight: newHeight
};
};
Resizable.prototype.calculateNewSizeFromAspectRatio = function (newWidth, newHeight, max, min) {
var _a = this.props,
lockAspectRatio = _a.lockAspectRatio,
lockAspectRatioExtraHeight = _a.lockAspectRatioExtraHeight,
lockAspectRatioExtraWidth = _a.lockAspectRatioExtraWidth;
var computedMinWidth = typeof min.width === 'undefined' ? 10 : min.width;
var computedMaxWidth = typeof max.width === 'undefined' || max.width < 0 ? newWidth : max.width;
var computedMinHeight = typeof min.height === 'undefined' ? 10 : min.height;
var computedMaxHeight = typeof max.height === 'undefined' || max.height < 0 ? newHeight : max.height;
var extraHeight = lockAspectRatioExtraHeight || 0;
var extraWidth = lockAspectRatioExtraWidth || 0;
if (lockAspectRatio) {
var extraMinWidth = (computedMinHeight - extraHeight) * this.ratio + extraWidth;
var extraMaxWidth = (computedMaxHeight - extraHeight) * this.ratio + extraWidth;
var extraMinHeight = (computedMinWidth - extraWidth) / this.ratio + extraHeight;
var extraMaxHeight = (computedMaxWidth - extraWidth) / this.ratio + extraHeight;
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);
}
return {
newWidth: newWidth,
newHeight: newHeight
};
};
Resizable.prototype.setBoundingClientRect = function () {
// For parent boundary
if (this.props.bounds === 'parent') {
var parent_3 = this.parentNode;
if (parent_3 instanceof HTMLElement) {
var parentRect = parent_3.getBoundingClientRect();
this.parentLeft = parentRect.left;
this.parentTop = parentRect.top;
}
} // For target(html element) boundary
if (this.props.bounds instanceof HTMLElement) {
var targetRect = this.props.bounds.getBoundingClientRect();
this.targetLeft = targetRect.left;
this.targetTop = targetRect.top;
} // For boundary
if (this.resizable) {
var _a = this.resizable.getBoundingClientRect(),
left = _a.left,
top_1 = _a.top;
this.resizableLeft = left;
this.resizableTop = top_1;
}
};
Resizable.prototype.onResizeStart = function (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) {
if (this.resizable) {
var startResize = this.props.onResizeStart(event, direction, this.resizable);
if (startResize === false) {
return;
}
}
} // 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
});
}
} // For lockAspectRatio case
this.ratio = typeof this.props.lockAspectRatio === 'number' ? this.props.lockAspectRatio : this.size.width / this.size.height; // For boundary
this.setBoundingClientRect();
this.setState({
original: {
x: clientX,
y: clientY,
width: this.size.width,
height: this.size.height
},
isResizing: true,
resizeCursor: window.getComputedStyle(event.target).cursor || 'auto',
direction: direction
});
};
Resizable.prototype.onMouseMove = function (event) {
if (!this.state.isResizing || !this.resizable) {
return;
}
var _a = this.props,
maxWidth = _a.maxWidth,
maxHeight = _a.maxHeight,
minWidth = _a.minWidth,
minHeight = _a.minHeight;
var clientX = event instanceof MouseEvent ? event.clientX : event.touches[0].clientX;
var clientY = event instanceof MouseEvent ? event.clientY : event.touches[0].clientY;
var _b = this.state,
direction = _b.direction,
original = _b.original,
width = _b.width,
height = _b.height;
var parentSize = this.getParentSize();
var max = calculateNewMax(parentSize, maxWidth, maxHeight, minWidth, minHeight);
maxWidth = max.maxWidth;
maxHeight = max.maxHeight;
minWidth = max.minWidth;
minHeight = max.minHeight; // Calculate new size
var _c = this.calculateNewSizeFromDirection(clientX, clientY),
newHeight = _c.newHeight,
newWidth = _c.newWidth; // Calculate max size from boundary settings
var boundaryMax = this.calculateNewMaxFromBoundary(maxWidth, maxHeight); // Calculate new size from aspect ratio
var newSize = this.calculateNewSizeFromAspectRatio(newWidth, newHeight, {
width: boundaryMax.maxWidth,
height: boundaryMax.maxHeight
}, {
width: minWidth,
height: minHeight
});
newWidth = newSize.newWidth;
newHeight = newSize.newHeight;
if (this.props.grid) {
var newGridWidth = snap(newWidth, this.props.grid[0]);
var newGridHeight = snap(newHeight, this.props.grid[1]);
var gap = this.props.snapGap || 0;
newWidth = gap === 0 || Math.abs(newGridWidth - newWidth) <= gap ? newGridWidth : newWidth;
newHeight = gap === 0 || Math.abs(newGridHeight - newHeight) <= gap ? newGridHeight : newHeight;
}
if (this.props.snap && this.props.snap.x) {
newWidth = findClosestSnap(newWidth, this.props.snap.x, this.props.snapGap);
}
if (this.props.snap && this.props.snap.y) {
newHeight = findClosestSnap(newHeight, this.props.snap.y, this.props.snapGap);
}
var delta = {
width: newWidth - original.width,
height: newHeight - original.height
};
if (width && typeof width === 'string') {
if (endsWith(width, '%')) {
var percent = newWidth / parentSize.width * 100;
newWidth = percent + "%";
} else if (endsWith(width, 'vw')) {
var vw = newWidth / window.innerWidth * 100;
newWidth = vw + "vw";
} else if (endsWith(width, 'vh')) {
var vh = newWidth / window.innerHeight * 100;
newWidth = vh + "vh";
}
}
if (height && typeof height === 'string') {
if (endsWith(height, '%')) {
var percent = newHeight / parentSize.height * 100;
newHeight = percent + "%";
} else if (endsWith(height, 'vw')) {
var vw = newHeight / window.innerWidth * 100;
newHeight = vw + "vw";
} else if (endsWith(height, 'vh')) {
var vh = newHeight / window.innerHeight * 100;
newHeight = vh + "vh";
}
}
this.setState({
width: this.createSizeForCssProperty(newWidth, 'width'),
height: this.createSizeForCssProperty(newHeight, 'height')
});
if (this.props.onResize) {
this.props.onResize(event, direction, this.resizable, delta);
}
};
Resizable.prototype.onMouseUp = function (event) {
var _a = this.state,
isResizing = _a.isResizing,
direction = _a.direction,
original = _a.original;
if (!isResizing || !this.resizable) {
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'
});
};
Resizable.prototype.updateSize = function (size) {
this.setState({
width: size.width,
height: size.height
});
};
Resizable.prototype.renderResizer = function () {
var _this = this;
var _a = this.props,
enable = _a.enable,
handleStyles = _a.handleStyles,
handleClasses = _a.handleClasses,
handleWrapperStyle = _a.handleWrapperStyle,
handleWrapperClass = _a.handleWrapperClass,
handleComponent = _a.handleComponent;
if (!enable) {
return null;
}
var resizers = Object.keys(enable).map(function (dir) {
if (enable[dir] !== false) {
return React.createElement(resizer_1.Resizer, {
key: dir,
direction: dir,
onResizeStart: _this.onResizeStart,
replaceStyles: handleStyles && handleStyles[dir],
className: handleClasses && handleClasses[dir]
}, handleComponent && handleComponent[dir] ? handleComponent[dir] : null);
}
return null;
}); // #93 Wrap the resize box in span (will not break 100% width/height)
return React.createElement("span", {
className: handleWrapperClass,
style: handleWrapperStyle
}, resizers);
};
Resizable.prototype.render = function () {
var _this = this;
var extendsProps = Object.keys(this.props).reduce(function (acc, key) {
if (definedProps.indexOf(key) !== -1) {
return acc;
}
acc[key] = _this.props[key];
return acc;
}, {});
return React.createElement("div", __assign({
ref: function (c) {
if (c) {
_this.resizable = c;
}
},
style: __assign({
position: 'relative',
userSelect: this.state.isResizing ? 'none' : 'auto'
}, 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
}, extendsProps), this.state.isResizing && React.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());
};
Resizable.defaultProps = {
onResizeStart: function () {},
onResize: function () {},
onResizeStop: function () {},
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,
resizeRatio: 1,
snapGap: 0
};
return Resizable;
}(React.PureComponent);
exports.Resizable = Resizable;
/***/ }),
/***/ "./node_modules/re-resizable/lib/resizer.js":
/*!**************************************************!*\
!*** ./node_modules/re-resizable/lib/resizer.js ***!
\**************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var __assign = this && this.__assign || function () {
__assign = Object.assign || function (t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
}
return t;
};
return __assign.apply(this, arguments);
};
var __importStar = this && this.__importStar || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
result["default"] = mod;
return result;
};
Object.defineProperty(exports, "__esModule", {
value: true
});
var React = __importStar(__webpack_require__(/*! react */ "react"));
var styles = {
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'
}
};
function Resizer(props) {
return React.createElement("div", {
className: props.className || '',
style: __assign({
position: 'absolute',
userSelect: 'none'
}, styles[props.direction], props.replaceStyles || {}),
onMouseDown: function (e) {
props.onResizeStart(e, props.direction);
},
onTouchStart: function (e) {
props.onResizeStart(e, props.direction);
}
}, props.children);
}
exports.Resizer = Resizer;
/***/ }),
/***/ "./node_modules/react-addons-shallow-compare/index.js":
/*!************************************************************!*\
!*** ./node_modules/react-addons-shallow-compare/index.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.
*
* @providesModule shallowCompare
*/
var shallowEqual = __webpack_require__(/*! fbjs/lib/shallowEqual */ "./node_modules/fbjs/lib/shallowEqual.js");
/**
* Does a shallow comparison for props and state.
* See ReactComponentWithPureRenderMixin
* See also https://facebook.github.io/react/docs/shallow-compare.html
*/
function shallowCompare(instance, nextProps, nextState) {
return !shallowEqual(instance.props, nextProps) || !shallowEqual(instance.state, nextState);
}
module.exports = shallowCompare;
/***/ }),
/***/ "./node_modules/react-dates/index.js":
/*!*******************************************!*\
!*** ./node_modules/react-dates/index.js ***!
\*******************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
// eslint-disable-next-line import/no-unresolved
module.exports = __webpack_require__(/*! ./lib */ "./node_modules/react-dates/lib/index.js");
/***/ }),
/***/ "./node_modules/react-dates/initialize.js":
/*!************************************************!*\
!*** ./node_modules/react-dates/initialize.js ***!
\************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
// eslint-disable-next-line import/no-unresolved
__webpack_require__(/*! ./lib/initialize */ "./node_modules/react-dates/lib/initialize.js");
/***/ }),
/***/ "./node_modules/react-dates/lib/components/CalendarDay.js":
/*!****************************************************************!*\
!*** ./node_modules/react-dates/lib/components/CalendarDay.js ***!
\****************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.PureCalendarDay = 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 _object = __webpack_require__(/*! object.assign */ "./node_modules/object.assign/index.js");
var _object2 = _interopRequireDefault(_object);
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 _reactAddonsShallowCompare = __webpack_require__(/*! react-addons-shallow-compare */ "./node_modules/react-addons-shallow-compare/index.js");
var _reactAddonsShallowCompare2 = _interopRequireDefault(_reactAddonsShallowCompare);
var _reactMomentProptypes = __webpack_require__(/*! react-moment-proptypes */ "./node_modules/react-moment-proptypes/src/index.js");
var _reactMomentProptypes2 = _interopRequireDefault(_reactMomentProptypes);
var _airbnbPropTypes = __webpack_require__(/*! airbnb-prop-types */ "./node_modules/airbnb-prop-types/index.js");
var _reactWithStyles = __webpack_require__(/*! react-with-styles */ "./node_modules/react-with-styles/lib/withStyles.js");
var _moment = __webpack_require__(/*! moment */ "./node_modules/moment/moment.js");
var _moment2 = _interopRequireDefault(_moment);
var _defaultPhrases = __webpack_require__(/*! ../defaultPhrases */ "./node_modules/react-dates/lib/defaultPhrases.js");
var _getPhrasePropTypes = __webpack_require__(/*! ../utils/getPhrasePropTypes */ "./node_modules/react-dates/lib/utils/getPhrasePropTypes.js");
var _getPhrasePropTypes2 = _interopRequireDefault(_getPhrasePropTypes);
var _getCalendarDaySettings = __webpack_require__(/*! ../utils/getCalendarDaySettings */ "./node_modules/react-dates/lib/utils/getCalendarDaySettings.js");
var _getCalendarDaySettings2 = _interopRequireDefault(_getCalendarDaySettings);
var _ModifiersShape = __webpack_require__(/*! ../shapes/ModifiersShape */ "./node_modules/react-dates/lib/shapes/ModifiersShape.js");
var _ModifiersShape2 = _interopRequireDefault(_ModifiersShape);
var _constants = __webpack_require__(/*! ../constants */ "./node_modules/react-dates/lib/constants.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;
}
var propTypes = (0, _airbnbPropTypes.forbidExtraProps)((0, _object2['default'])({}, _reactWithStyles.withStylesPropTypes, {
day: _reactMomentProptypes2['default'].momentObj,
daySize: _airbnbPropTypes.nonNegativeInteger,
isOutsideDay: _propTypes2['default'].bool,
modifiers: _ModifiersShape2['default'],
isFocused: _propTypes2['default'].bool,
tabIndex: _propTypes2['default'].oneOf([0, -1]),
onDayClick: _propTypes2['default'].func,
onDayMouseEnter: _propTypes2['default'].func,
onDayMouseLeave: _propTypes2['default'].func,
renderDayContents: _propTypes2['default'].func,
ariaLabelFormat: _propTypes2['default'].string,
// internationalization
phrases: _propTypes2['default'].shape((0, _getPhrasePropTypes2['default'])(_defaultPhrases.CalendarDayPhrases))
}));
var defaultProps = {
day: (0, _moment2['default'])(),
daySize: _constants.DAY_SIZE,
isOutsideDay: false,
modifiers: new Set(),
isFocused: false,
tabIndex: -1,
onDayClick: function () {
function onDayClick() {}
return onDayClick;
}(),
onDayMouseEnter: function () {
function onDayMouseEnter() {}
return onDayMouseEnter;
}(),
onDayMouseLeave: function () {
function onDayMouseLeave() {}
return onDayMouseLeave;
}(),
renderDayContents: null,
ariaLabelFormat: 'dddd, LL',
// internationalization
phrases: _defaultPhrases.CalendarDayPhrases
};
var CalendarDay = function (_React$Component) {
_inherits(CalendarDay, _React$Component);
function CalendarDay() {
var _ref;
_classCallCheck(this, CalendarDay);
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
var _this = _possibleConstructorReturn(this, (_ref = CalendarDay.__proto__ || Object.getPrototypeOf(CalendarDay)).call.apply(_ref, [this].concat(args)));
_this.setButtonRef = _this.setButtonRef.bind(_this);
return _this;
}
_createClass(CalendarDay, [{
key: 'shouldComponentUpdate',
value: function () {
function shouldComponentUpdate(nextProps, nextState) {
return (0, _reactAddonsShallowCompare2['default'])(this, nextProps, nextState);
}
return shouldComponentUpdate;
}()
}, {
key: 'componentDidUpdate',
value: function () {
function componentDidUpdate(prevProps) {
var _props = this.props,
isFocused = _props.isFocused,
tabIndex = _props.tabIndex;
if (tabIndex === 0) {
if (isFocused || tabIndex !== prevProps.tabIndex) {
this.buttonRef.focus();
}
}
}
return componentDidUpdate;
}()
}, {
key: 'onDayClick',
value: function () {
function onDayClick(day, e) {
var onDayClick = this.props.onDayClick;
onDayClick(day, e);
}
return onDayClick;
}()
}, {
key: 'onDayMouseEnter',
value: function () {
function onDayMouseEnter(day, e) {
var onDayMouseEnter = this.props.onDayMouseEnter;
onDayMouseEnter(day, e);
}
return onDayMouseEnter;
}()
}, {
key: 'onDayMouseLeave',
value: function () {
function onDayMouseLeave(day, e) {
var onDayMouseLeave = this.props.onDayMouseLeave;
onDayMouseLeave(day, e);
}
return onDayMouseLeave;
}()
}, {
key: 'onKeyDown',
value: function () {
function onKeyDown(day, e) {
var onDayClick = this.props.onDayClick;
var key = e.key;
if (key === 'Enter' || key === ' ') {
onDayClick(day, e);
}
}
return onKeyDown;
}()
}, {
key: 'setButtonRef',
value: function () {
function setButtonRef(ref) {
this.buttonRef = ref;
}
return setButtonRef;
}()
}, {
key: 'render',
value: function () {
function render() {
var _this2 = this;
var _props2 = this.props,
day = _props2.day,
ariaLabelFormat = _props2.ariaLabelFormat,
daySize = _props2.daySize,
isOutsideDay = _props2.isOutsideDay,
modifiers = _props2.modifiers,
renderDayContents = _props2.renderDayContents,
tabIndex = _props2.tabIndex,
styles = _props2.styles,
phrases = _props2.phrases;
if (!day) return _react2['default'].createElement('td', null);
var _getCalendarDaySettin = (0, _getCalendarDaySettings2['default'])(day, ariaLabelFormat, daySize, modifiers, phrases),
daySizeStyles = _getCalendarDaySettin.daySizeStyles,
useDefaultCursor = _getCalendarDaySettin.useDefaultCursor,
selected = _getCalendarDaySettin.selected,
hoveredSpan = _getCalendarDaySettin.hoveredSpan,
isOutsideRange = _getCalendarDaySettin.isOutsideRange,
ariaLabel = _getCalendarDaySettin.ariaLabel;
return _react2['default'].createElement('td', _extends({}, (0, _reactWithStyles.css)(styles.CalendarDay, useDefaultCursor && styles.CalendarDay__defaultCursor, styles.CalendarDay__default, isOutsideDay && styles.CalendarDay__outside, modifiers.has('today') && styles.CalendarDay__today, modifiers.has('first-day-of-week') && styles.CalendarDay__firstDayOfWeek, modifiers.has('last-day-of-week') && styles.CalendarDay__lastDayOfWeek, modifiers.has('hovered-offset') && styles.CalendarDay__hovered_offset, modifiers.has('highlighted-calendar') && styles.CalendarDay__highlighted_calendar, modifiers.has('blocked-minimum-nights') && styles.CalendarDay__blocked_minimum_nights, modifiers.has('blocked-calendar') && styles.CalendarDay__blocked_calendar, hoveredSpan && styles.CalendarDay__hovered_span, modifiers.has('selected-span') && styles.CalendarDay__selected_span, modifiers.has('last-in-range') && styles.CalendarDay__last_in_range, modifiers.has('selected-start') && styles.CalendarDay__selected_start, modifiers.has('selected-end') && styles.CalendarDay__selected_end, selected && styles.CalendarDay__selected, isOutsideRange && styles.CalendarDay__blocked_out_of_range, daySizeStyles), {
role: 'button' // eslint-disable-line jsx-a11y/no-noninteractive-element-to-interactive-role
,
ref: this.setButtonRef,
'aria-label': ariaLabel,
onMouseEnter: function () {
function onMouseEnter(e) {
_this2.onDayMouseEnter(day, e);
}
return onMouseEnter;
}(),
onMouseLeave: function () {
function onMouseLeave(e) {
_this2.onDayMouseLeave(day, e);
}
return onMouseLeave;
}(),
onMouseUp: function () {
function onMouseUp(e) {
e.currentTarget.blur();
}
return onMouseUp;
}(),
onClick: function () {
function onClick(e) {
_this2.onDayClick(day, e);
}
return onClick;
}(),
onKeyDown: function () {
function onKeyDown(e) {
_this2.onKeyDown(day, e);
}
return onKeyDown;
}(),
tabIndex: tabIndex
}), renderDayContents ? renderDayContents(day, modifiers) : day.format('D'));
}
return render;
}()
}]);
return CalendarDay;
}(_react2['default'].Component);
CalendarDay.propTypes = propTypes;
CalendarDay.defaultProps = defaultProps;
exports.PureCalendarDay = CalendarDay;
exports['default'] = (0, _reactWithStyles.withStyles)(function (_ref2) {
var _ref2$reactDates = _ref2.reactDates,
color = _ref2$reactDates.color,
font = _ref2$reactDates.font;
return {
CalendarDay: {
boxSizing: 'border-box',
cursor: 'pointer',
fontSize: font.size,
textAlign: 'center',
':active': {
outline: 0
}
},
CalendarDay__defaultCursor: {
cursor: 'default'
},
CalendarDay__default: {
border: '1px solid ' + String(color.core.borderLight),
color: color.text,
background: color.background,
':hover': {
background: color.core.borderLight,
border: '1px double ' + String(color.core.borderLight),
color: 'inherit'
}
},
CalendarDay__hovered_offset: {
background: color.core.borderBright,
border: '1px double ' + String(color.core.borderLight),
color: 'inherit'
},
CalendarDay__outside: {
border: 0,
background: color.outside.backgroundColor,
color: color.outside.color,
':hover': {
border: 0
}
},
CalendarDay__blocked_minimum_nights: {
background: color.minimumNights.backgroundColor,
border: '1px solid ' + String(color.minimumNights.borderColor),
color: color.minimumNights.color,
':hover': {
background: color.minimumNights.backgroundColor_hover,
color: color.minimumNights.color_active
},
':active': {
background: color.minimumNights.backgroundColor_active,
color: color.minimumNights.color_active
}
},
CalendarDay__highlighted_calendar: {
background: color.highlighted.backgroundColor,
color: color.highlighted.color,
':hover': {
background: color.highlighted.backgroundColor_hover,
color: color.highlighted.color_active
},
':active': {
background: color.highlighted.backgroundColor_active,
color: color.highlighted.color_active
}
},
CalendarDay__selected_span: {
background: color.selectedSpan.backgroundColor,
border: '1px solid ' + String(color.selectedSpan.borderColor),
color: color.selectedSpan.color,
':hover': {
background: color.selectedSpan.backgroundColor_hover,
border: '1px solid ' + String(color.selectedSpan.borderColor),
color: color.selectedSpan.color_active
},
':active': {
background: color.selectedSpan.backgroundColor_active,
border: '1px solid ' + String(color.selectedSpan.borderColor),
color: color.selectedSpan.color_active
}
},
CalendarDay__last_in_range: {
borderRight: color.core.primary
},
CalendarDay__selected: {
background: color.selected.backgroundColor,
border: '1px solid ' + String(color.selected.borderColor),
color: color.selected.color,
':hover': {
background: color.selected.backgroundColor_hover,
border: '1px solid ' + String(color.selected.borderColor),
color: color.selected.color_active
},
':active': {
background: color.selected.backgroundColor_active,
border: '1px solid ' + String(color.selected.borderColor),
color: color.selected.color_active
}
},
CalendarDay__hovered_span: {
background: color.hoveredSpan.backgroundColor,
border: '1px solid ' + String(color.hoveredSpan.borderColor),
color: color.hoveredSpan.color,
':hover': {
background: color.hoveredSpan.backgroundColor_hover,
border: '1px solid ' + String(color.hoveredSpan.borderColor),
color: color.hoveredSpan.color_active
},
':active': {
background: color.hoveredSpan.backgroundColor_active,
border: '1px solid ' + String(color.hoveredSpan.borderColor),
color: color.hoveredSpan.color_active
}
},
CalendarDay__blocked_calendar: {
background: color.blocked_calendar.backgroundColor,
border: '1px solid ' + String(color.blocked_calendar.borderColor),
color: color.blocked_calendar.color,
':hover': {
background: color.blocked_calendar.backgroundColor_hover,
border: '1px solid ' + String(color.blocked_calendar.borderColor),
color: color.blocked_calendar.color_active
},
':active': {
background: color.blocked_calendar.backgroundColor_active,
border: '1px solid ' + String(color.blocked_calendar.borderColor),
color: color.blocked_calendar.color_active
}
},
CalendarDay__blocked_out_of_range: {
background: color.blocked_out_of_range.backgroundColor,
border: '1px solid ' + String(color.blocked_out_of_range.borderColor),
color: color.blocked_out_of_range.color,
':hover': {
background: color.blocked_out_of_range.backgroundColor_hover,
border: '1px solid ' + String(color.blocked_out_of_range.borderColor),
color: color.blocked_out_of_range.color_active
},
':active': {
background: color.blocked_out_of_range.backgroundColor_active,
border: '1px solid ' + String(color.blocked_out_of_range.borderColor),
color: color.blocked_out_of_range.color_active
}
},
CalendarDay__selected_start: {},
CalendarDay__selected_end: {},
CalendarDay__today: {},
CalendarDay__firstDayOfWeek: {},
CalendarDay__lastDayOfWeek: {}
};
})(CalendarDay);
/***/ }),
/***/ "./node_modules/react-dates/lib/components/CalendarIcon.js":
/*!*****************************************************************!*\
!*** ./node_modules/react-dates/lib/components/CalendarIcon.js ***!
\*****************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _react = __webpack_require__(/*! react */ "react");
var _react2 = _interopRequireDefault(_react);
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
'default': obj
};
}
var CalendarIcon = function () {
function CalendarIcon(props) {
return _react2['default'].createElement('svg', props, _react2['default'].createElement('path', {
d: 'M107.2 1392.9h241.1v-241.1H107.2v241.1zm294.7 0h267.9v-241.1H401.9v241.1zm-294.7-294.7h241.1V830.4H107.2v267.8zm294.7 0h267.9V830.4H401.9v267.8zM107.2 776.8h241.1V535.7H107.2v241.1zm616.2 616.1h267.9v-241.1H723.4v241.1zM401.9 776.8h267.9V535.7H401.9v241.1zm642.9 616.1H1286v-241.1h-241.1v241.1zm-321.4-294.7h267.9V830.4H723.4v267.8zM428.7 375V133.9c0-7.3-2.7-13.5-8-18.8-5.3-5.3-11.6-8-18.8-8h-53.6c-7.3 0-13.5 2.7-18.8 8-5.3 5.3-8 11.6-8 18.8V375c0 7.3 2.7 13.5 8 18.8 5.3 5.3 11.6 8 18.8 8h53.6c7.3 0 13.5-2.7 18.8-8 5.3-5.3 8-11.5 8-18.8zm616.1 723.2H1286V830.4h-241.1v267.8zM723.4 776.8h267.9V535.7H723.4v241.1zm321.4 0H1286V535.7h-241.1v241.1zm26.8-401.8V133.9c0-7.3-2.7-13.5-8-18.8-5.3-5.3-11.6-8-18.8-8h-53.6c-7.3 0-13.5 2.7-18.8 8-5.3 5.3-8 11.6-8 18.8V375c0 7.3 2.7 13.5 8 18.8 5.3 5.3 11.6 8 18.8 8h53.6c7.3 0 13.5-2.7 18.8-8 5.4-5.3 8-11.5 8-18.8zm321.5-53.6v1071.4c0 29-10.6 54.1-31.8 75.3-21.2 21.2-46.3 31.8-75.3 31.8H107.2c-29 0-54.1-10.6-75.3-31.8C10.6 1447 0 1421.9 0 1392.9V321.4c0-29 10.6-54.1 31.8-75.3s46.3-31.8 75.3-31.8h107.2v-80.4c0-36.8 13.1-68.4 39.3-94.6S311.4 0 348.3 0h53.6c36.8 0 68.4 13.1 94.6 39.3 26.2 26.2 39.3 57.8 39.3 94.6v80.4h321.5v-80.4c0-36.8 13.1-68.4 39.3-94.6C922.9 13.1 954.4 0 991.3 0h53.6c36.8 0 68.4 13.1 94.6 39.3s39.3 57.8 39.3 94.6v80.4H1286c29 0 54.1 10.6 75.3 31.8 21.2 21.2 31.8 46.3 31.8 75.3z'
}));
}
return CalendarIcon;
}();
CalendarIcon.defaultProps = {
viewBox: '0 0 1393.1 1500'
};
exports['default'] = CalendarIcon;
/***/ }),
/***/ "./node_modules/react-dates/lib/components/CalendarMonth.js":
/*!******************************************************************!*\
!*** ./node_modules/react-dates/lib/components/CalendarMonth.js ***!
\******************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
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 _object = __webpack_require__(/*! object.assign */ "./node_modules/object.assign/index.js");
var _object2 = _interopRequireDefault(_object);
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 _reactAddonsShallowCompare = __webpack_require__(/*! react-addons-shallow-compare */ "./node_modules/react-addons-shallow-compare/index.js");
var _reactAddonsShallowCompare2 = _interopRequireDefault(_reactAddonsShallowCompare);
var _reactMomentProptypes = __webpack_require__(/*! react-moment-proptypes */ "./node_modules/react-moment-proptypes/src/index.js");
var _reactMomentProptypes2 = _interopRequireDefault(_reactMomentProptypes);
var _airbnbPropTypes = __webpack_require__(/*! airbnb-prop-types */ "./node_modules/airbnb-prop-types/index.js");
var _reactWithStyles = __webpack_require__(/*! react-with-styles */ "./node_modules/react-with-styles/lib/withStyles.js");
var _moment = __webpack_require__(/*! moment */ "./node_modules/moment/moment.js");
var _moment2 = _interopRequireDefault(_moment);
var _defaultPhrases = __webpack_require__(/*! ../defaultPhrases */ "./node_modules/react-dates/lib/defaultPhrases.js");
var _getPhrasePropTypes = __webpack_require__(/*! ../utils/getPhrasePropTypes */ "./node_modules/react-dates/lib/utils/getPhrasePropTypes.js");
var _getPhrasePropTypes2 = _interopRequireDefault(_getPhrasePropTypes);
var _CalendarWeek = __webpack_require__(/*! ./CalendarWeek */ "./node_modules/react-dates/lib/components/CalendarWeek.js");
var _CalendarWeek2 = _interopRequireDefault(_CalendarWeek);
var _CalendarDay = __webpack_require__(/*! ./CalendarDay */ "./node_modules/react-dates/lib/components/CalendarDay.js");
var _CalendarDay2 = _interopRequireDefault(_CalendarDay);
var _calculateDimension = __webpack_require__(/*! ../utils/calculateDimension */ "./node_modules/react-dates/lib/utils/calculateDimension.js");
var _calculateDimension2 = _interopRequireDefault(_calculateDimension);
var _getCalendarMonthWeeks = __webpack_require__(/*! ../utils/getCalendarMonthWeeks */ "./node_modules/react-dates/lib/utils/getCalendarMonthWeeks.js");
var _getCalendarMonthWeeks2 = _interopRequireDefault(_getCalendarMonthWeeks);
var _isSameDay = __webpack_require__(/*! ../utils/isSameDay */ "./node_modules/react-dates/lib/utils/isSameDay.js");
var _isSameDay2 = _interopRequireDefault(_isSameDay);
var _toISODateString = __webpack_require__(/*! ../utils/toISODateString */ "./node_modules/react-dates/lib/utils/toISODateString.js");
var _toISODateString2 = _interopRequireDefault(_toISODateString);
var _ModifiersShape = __webpack_require__(/*! ../shapes/ModifiersShape */ "./node_modules/react-dates/lib/shapes/ModifiersShape.js");
var _ModifiersShape2 = _interopRequireDefault(_ModifiersShape);
var _ScrollableOrientationShape = __webpack_require__(/*! ../shapes/ScrollableOrientationShape */ "./node_modules/react-dates/lib/shapes/ScrollableOrientationShape.js");
var _ScrollableOrientationShape2 = _interopRequireDefault(_ScrollableOrientationShape);
var _DayOfWeekShape = __webpack_require__(/*! ../shapes/DayOfWeekShape */ "./node_modules/react-dates/lib/shapes/DayOfWeekShape.js");
var _DayOfWeekShape2 = _interopRequireDefault(_DayOfWeekShape);
var _constants = __webpack_require__(/*! ../constants */ "./node_modules/react-dates/lib/constants.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 react/no-array-index-key: 0 */
var propTypes = (0, _airbnbPropTypes.forbidExtraProps)((0, _object2['default'])({}, _reactWithStyles.withStylesPropTypes, {
month: _reactMomentProptypes2['default'].momentObj,
horizontalMonthPadding: _airbnbPropTypes.nonNegativeInteger,
isVisible: _propTypes2['default'].bool,
enableOutsideDays: _propTypes2['default'].bool,
modifiers: _propTypes2['default'].objectOf(_ModifiersShape2['default']),
orientation: _ScrollableOrientationShape2['default'],
daySize: _airbnbPropTypes.nonNegativeInteger,
onDayClick: _propTypes2['default'].func,
onDayMouseEnter: _propTypes2['default'].func,
onDayMouseLeave: _propTypes2['default'].func,
onMonthSelect: _propTypes2['default'].func,
onYearSelect: _propTypes2['default'].func,
renderMonthText: (0, _airbnbPropTypes.mutuallyExclusiveProps)(_propTypes2['default'].func, 'renderMonthText', 'renderMonthElement'),
renderCalendarDay: _propTypes2['default'].func,
renderDayContents: _propTypes2['default'].func,
renderMonthElement: (0, _airbnbPropTypes.mutuallyExclusiveProps)(_propTypes2['default'].func, 'renderMonthText', 'renderMonthElement'),
firstDayOfWeek: _DayOfWeekShape2['default'],
setMonthTitleHeight: _propTypes2['default'].func,
verticalBorderSpacing: _airbnbPropTypes.nonNegativeInteger,
focusedDate: _reactMomentProptypes2['default'].momentObj,
// indicates focusable day
isFocused: _propTypes2['default'].bool,
// indicates whether or not to move focus to focusable day
// i18n
monthFormat: _propTypes2['default'].string,
phrases: _propTypes2['default'].shape((0, _getPhrasePropTypes2['default'])(_defaultPhrases.CalendarDayPhrases)),
dayAriaLabelFormat: _propTypes2['default'].string
}));
var defaultProps = {
month: (0, _moment2['default'])(),
horizontalMonthPadding: 13,
isVisible: true,
enableOutsideDays: false,
modifiers: {},
orientation: _constants.HORIZONTAL_ORIENTATION,
daySize: _constants.DAY_SIZE,
onDayClick: function () {
function onDayClick() {}
return onDayClick;
}(),
onDayMouseEnter: function () {
function onDayMouseEnter() {}
return onDayMouseEnter;
}(),
onDayMouseLeave: function () {
function onDayMouseLeave() {}
return onDayMouseLeave;
}(),
onMonthSelect: function () {
function onMonthSelect() {}
return onMonthSelect;
}(),
onYearSelect: function () {
function onYearSelect() {}
return onYearSelect;
}(),
renderMonthText: null,
renderCalendarDay: function () {
function renderCalendarDay(props) {
return _react2['default'].createElement(_CalendarDay2['default'], props);
}
return renderCalendarDay;
}(),
renderDayContents: null,
renderMonthElement: null,
firstDayOfWeek: null,
setMonthTitleHeight: null,
focusedDate: null,
isFocused: false,
// i18n
monthFormat: 'MMMM YYYY',
// english locale
phrases: _defaultPhrases.CalendarDayPhrases,
dayAriaLabelFormat: undefined,
verticalBorderSpacing: undefined
};
var CalendarMonth = function (_React$Component) {
_inherits(CalendarMonth, _React$Component);
function CalendarMonth(props) {
_classCallCheck(this, CalendarMonth);
var _this = _possibleConstructorReturn(this, (CalendarMonth.__proto__ || Object.getPrototypeOf(CalendarMonth)).call(this, props));
_this.state = {
weeks: (0, _getCalendarMonthWeeks2['default'])(props.month, props.enableOutsideDays, props.firstDayOfWeek == null ? _moment2['default'].localeData().firstDayOfWeek() : props.firstDayOfWeek)
};
_this.setCaptionRef = _this.setCaptionRef.bind(_this);
_this.setMonthTitleHeight = _this.setMonthTitleHeight.bind(_this);
return _this;
}
_createClass(CalendarMonth, [{
key: 'componentDidMount',
value: function () {
function componentDidMount() {
this.setMonthTitleHeightTimeout = setTimeout(this.setMonthTitleHeight, 0);
}
return componentDidMount;
}()
}, {
key: 'componentWillReceiveProps',
value: function () {
function componentWillReceiveProps(nextProps) {
var month = nextProps.month,
enableOutsideDays = nextProps.enableOutsideDays,
firstDayOfWeek = nextProps.firstDayOfWeek;
var _props = this.props,
prevMonth = _props.month,
prevEnableOutsideDays = _props.enableOutsideDays,
prevFirstDayOfWeek = _props.firstDayOfWeek;
if (!month.isSame(prevMonth) || enableOutsideDays !== prevEnableOutsideDays || firstDayOfWeek !== prevFirstDayOfWeek) {
this.setState({
weeks: (0, _getCalendarMonthWeeks2['default'])(month, enableOutsideDays, firstDayOfWeek == null ? _moment2['default'].localeData().firstDayOfWeek() : firstDayOfWeek)
});
}
}
return componentWillReceiveProps;
}()
}, {
key: 'shouldComponentUpdate',
value: function () {
function shouldComponentUpdate(nextProps, nextState) {
return (0, _reactAddonsShallowCompare2['default'])(this, nextProps, nextState);
}
return shouldComponentUpdate;
}()
}, {
key: 'componentWillUnmount',
value: function () {
function componentWillUnmount() {
if (this.setMonthTitleHeightTimeout) {
clearTimeout(this.setMonthTitleHeightTimeout);
}
}
return componentWillUnmount;
}()
}, {
key: 'setMonthTitleHeight',
value: function () {
function setMonthTitleHeight() {
var setMonthTitleHeight = this.props.setMonthTitleHeight;
if (setMonthTitleHeight) {
var captionHeight = (0, _calculateDimension2['default'])(this.captionRef, 'height', true, true);
setMonthTitleHeight(captionHeight);
}
}
return setMonthTitleHeight;
}()
}, {
key: 'setCaptionRef',
value: function () {
function setCaptionRef(ref) {
this.captionRef = ref;
}
return setCaptionRef;
}()
}, {
key: 'render',
value: function () {
function render() {
var _props2 = this.props,
dayAriaLabelFormat = _props2.dayAriaLabelFormat,
daySize = _props2.daySize,
focusedDate = _props2.focusedDate,
horizontalMonthPadding = _props2.horizontalMonthPadding,
isFocused = _props2.isFocused,
isVisible = _props2.isVisible,
modifiers = _props2.modifiers,
month = _props2.month,
monthFormat = _props2.monthFormat,
onDayClick = _props2.onDayClick,
onDayMouseEnter = _props2.onDayMouseEnter,
onDayMouseLeave = _props2.onDayMouseLeave,
onMonthSelect = _props2.onMonthSelect,
onYearSelect = _props2.onYearSelect,
orientation = _props2.orientation,
phrases = _props2.phrases,
renderCalendarDay = _props2.renderCalendarDay,
renderDayContents = _props2.renderDayContents,
renderMonthElement = _props2.renderMonthElement,
renderMonthText = _props2.renderMonthText,
styles = _props2.styles,
verticalBorderSpacing = _props2.verticalBorderSpacing;
var weeks = this.state.weeks;
var monthTitle = renderMonthText ? renderMonthText(month) : month.format(monthFormat);
var verticalScrollable = orientation === _constants.VERTICAL_SCROLLABLE;
return _react2['default'].createElement('div', _extends({}, (0, _reactWithStyles.css)(styles.CalendarMonth, {
padding: '0 ' + String(horizontalMonthPadding) + 'px'
}), {
'data-visible': isVisible
}), _react2['default'].createElement('div', _extends({
ref: this.setCaptionRef
}, (0, _reactWithStyles.css)(styles.CalendarMonth_caption, verticalScrollable && styles.CalendarMonth_caption__verticalScrollable)), renderMonthElement ? renderMonthElement({
month: month,
onMonthSelect: onMonthSelect,
onYearSelect: onYearSelect
}) : _react2['default'].createElement('strong', null, monthTitle)), _react2['default'].createElement('table', _extends({}, (0, _reactWithStyles.css)(!verticalBorderSpacing && styles.CalendarMonth_table, verticalBorderSpacing && styles.CalendarMonth_verticalSpacing, verticalBorderSpacing && {
borderSpacing: '0px ' + String(verticalBorderSpacing) + 'px'
}), {
role: 'presentation'
}), _react2['default'].createElement('tbody', null, weeks.map(function (week, i) {
return _react2['default'].createElement(_CalendarWeek2['default'], {
key: i
}, week.map(function (day, dayOfWeek) {
return renderCalendarDay({
key: dayOfWeek,
day: day,
daySize: daySize,
isOutsideDay: !day || day.month() !== month.month(),
tabIndex: isVisible && (0, _isSameDay2['default'])(day, focusedDate) ? 0 : -1,
isFocused: isFocused,
onDayMouseEnter: onDayMouseEnter,
onDayMouseLeave: onDayMouseLeave,
onDayClick: onDayClick,
renderDayContents: renderDayContents,
phrases: phrases,
modifiers: modifiers[(0, _toISODateString2['default'])(day)],
ariaLabelFormat: dayAriaLabelFormat
});
}));
}))));
}
return render;
}()
}]);
return CalendarMonth;
}(_react2['default'].Component);
CalendarMonth.propTypes = propTypes;
CalendarMonth.defaultProps = defaultProps;
exports['default'] = (0, _reactWithStyles.withStyles)(function (_ref) {
var _ref$reactDates = _ref.reactDates,
color = _ref$reactDates.color,
font = _ref$reactDates.font,
spacing = _ref$reactDates.spacing;
return {
CalendarMonth: {
background: color.background,
textAlign: 'center',
verticalAlign: 'top',
userSelect: 'none'
},
CalendarMonth_table: {
borderCollapse: 'collapse',
borderSpacing: 0
},
CalendarMonth_verticalSpacing: {
borderCollapse: 'separate'
},
CalendarMonth_caption: {
color: color.text,
fontSize: font.captionSize,
textAlign: 'center',
paddingTop: spacing.captionPaddingTop,
paddingBottom: spacing.captionPaddingBottom,
captionSide: 'initial'
},
CalendarMonth_caption__verticalScrollable: {
paddingTop: 12,
paddingBottom: 7
}
};
})(CalendarMonth);
/***/ }),
/***/ "./node_modules/react-dates/lib/components/CalendarMonthGrid.js":
/*!**********************************************************************!*\
!*** ./node_modules/react-dates/lib/components/CalendarMonthGrid.js ***!
\**********************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
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 _object = __webpack_require__(/*! object.assign */ "./node_modules/object.assign/index.js");
var _object2 = _interopRequireDefault(_object);
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 _reactAddonsShallowCompare = __webpack_require__(/*! react-addons-shallow-compare */ "./node_modules/react-addons-shallow-compare/index.js");
var _reactAddonsShallowCompare2 = _interopRequireDefault(_reactAddonsShallowCompare);
var _reactMomentProptypes = __webpack_require__(/*! react-moment-proptypes */ "./node_modules/react-moment-proptypes/src/index.js");
var _reactMomentProptypes2 = _interopRequireDefault(_reactMomentProptypes);
var _airbnbPropTypes = __webpack_require__(/*! airbnb-prop-types */ "./node_modules/airbnb-prop-types/index.js");
var _reactWithStyles = __webpack_require__(/*! react-with-styles */ "./node_modules/react-with-styles/lib/withStyles.js");
var _moment = __webpack_require__(/*! moment */ "./node_modules/moment/moment.js");
var _moment2 = _interopRequireDefault(_moment);
var _consolidatedEvents = __webpack_require__(/*! consolidated-events */ "./node_modules/consolidated-events/lib/index.esm.js");
var _defaultPhrases = __webpack_require__(/*! ../defaultPhrases */ "./node_modules/react-dates/lib/defaultPhrases.js");
var _getPhrasePropTypes = __webpack_require__(/*! ../utils/getPhrasePropTypes */ "./node_modules/react-dates/lib/utils/getPhrasePropTypes.js");
var _getPhrasePropTypes2 = _interopRequireDefault(_getPhrasePropTypes);
var _CalendarMonth = __webpack_require__(/*! ./CalendarMonth */ "./node_modules/react-dates/lib/components/CalendarMonth.js");
var _CalendarMonth2 = _interopRequireDefault(_CalendarMonth);
var _isTransitionEndSupported = __webpack_require__(/*! ../utils/isTransitionEndSupported */ "./node_modules/react-dates/lib/utils/isTransitionEndSupported.js");
var _isTransitionEndSupported2 = _interopRequireDefault(_isTransitionEndSupported);
var _getTransformStyles = __webpack_require__(/*! ../utils/getTransformStyles */ "./node_modules/react-dates/lib/utils/getTransformStyles.js");
var _getTransformStyles2 = _interopRequireDefault(_getTransformStyles);
var _getCalendarMonthWidth = __webpack_require__(/*! ../utils/getCalendarMonthWidth */ "./node_modules/react-dates/lib/utils/getCalendarMonthWidth.js");
var _getCalendarMonthWidth2 = _interopRequireDefault(_getCalendarMonthWidth);
var _toISOMonthString = __webpack_require__(/*! ../utils/toISOMonthString */ "./node_modules/react-dates/lib/utils/toISOMonthString.js");
var _toISOMonthString2 = _interopRequireDefault(_toISOMonthString);
var _isPrevMonth = __webpack_require__(/*! ../utils/isPrevMonth */ "./node_modules/react-dates/lib/utils/isPrevMonth.js");
var _isPrevMonth2 = _interopRequireDefault(_isPrevMonth);
var _isNextMonth = __webpack_require__(/*! ../utils/isNextMonth */ "./node_modules/react-dates/lib/utils/isNextMonth.js");
var _isNextMonth2 = _interopRequireDefault(_isNextMonth);
var _ModifiersShape = __webpack_require__(/*! ../shapes/ModifiersShape */ "./node_modules/react-dates/lib/shapes/ModifiersShape.js");
var _ModifiersShape2 = _interopRequireDefault(_ModifiersShape);
var _ScrollableOrientationShape = __webpack_require__(/*! ../shapes/ScrollableOrientationShape */ "./node_modules/react-dates/lib/shapes/ScrollableOrientationShape.js");
var _ScrollableOrientationShape2 = _interopRequireDefault(_ScrollableOrientationShape);
var _DayOfWeekShape = __webpack_require__(/*! ../shapes/DayOfWeekShape */ "./node_modules/react-dates/lib/shapes/DayOfWeekShape.js");
var _DayOfWeekShape2 = _interopRequireDefault(_DayOfWeekShape);
var _constants = __webpack_require__(/*! ../constants */ "./node_modules/react-dates/lib/constants.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;
}
var propTypes = (0, _airbnbPropTypes.forbidExtraProps)((0, _object2['default'])({}, _reactWithStyles.withStylesPropTypes, {
enableOutsideDays: _propTypes2['default'].bool,
firstVisibleMonthIndex: _propTypes2['default'].number,
horizontalMonthPadding: _airbnbPropTypes.nonNegativeInteger,
initialMonth: _reactMomentProptypes2['default'].momentObj,
isAnimating: _propTypes2['default'].bool,
numberOfMonths: _propTypes2['default'].number,
modifiers: _propTypes2['default'].objectOf(_propTypes2['default'].objectOf(_ModifiersShape2['default'])),
orientation: _ScrollableOrientationShape2['default'],
onDayClick: _propTypes2['default'].func,
onDayMouseEnter: _propTypes2['default'].func,
onDayMouseLeave: _propTypes2['default'].func,
onMonthTransitionEnd: _propTypes2['default'].func,
onMonthChange: _propTypes2['default'].func,
onYearChange: _propTypes2['default'].func,
renderMonthText: (0, _airbnbPropTypes.mutuallyExclusiveProps)(_propTypes2['default'].func, 'renderMonthText', 'renderMonthElement'),
renderCalendarDay: _propTypes2['default'].func,
renderDayContents: _propTypes2['default'].func,
translationValue: _propTypes2['default'].number,
renderMonthElement: (0, _airbnbPropTypes.mutuallyExclusiveProps)(_propTypes2['default'].func, 'renderMonthText', 'renderMonthElement'),
daySize: _airbnbPropTypes.nonNegativeInteger,
focusedDate: _reactMomentProptypes2['default'].momentObj,
// indicates focusable day
isFocused: _propTypes2['default'].bool,
// indicates whether or not to move focus to focusable day
firstDayOfWeek: _DayOfWeekShape2['default'],
setMonthTitleHeight: _propTypes2['default'].func,
isRTL: _propTypes2['default'].bool,
transitionDuration: _airbnbPropTypes.nonNegativeInteger,
verticalBorderSpacing: _airbnbPropTypes.nonNegativeInteger,
// i18n
monthFormat: _propTypes2['default'].string,
phrases: _propTypes2['default'].shape((0, _getPhrasePropTypes2['default'])(_defaultPhrases.CalendarDayPhrases)),
dayAriaLabelFormat: _propTypes2['default'].string
}));
var defaultProps = {
enableOutsideDays: false,
firstVisibleMonthIndex: 0,
horizontalMonthPadding: 13,
initialMonth: (0, _moment2['default'])(),
isAnimating: false,
numberOfMonths: 1,
modifiers: {},
orientation: _constants.HORIZONTAL_ORIENTATION,
onDayClick: function () {
function onDayClick() {}
return onDayClick;
}(),
onDayMouseEnter: function () {
function onDayMouseEnter() {}
return onDayMouseEnter;
}(),
onDayMouseLeave: function () {
function onDayMouseLeave() {}
return onDayMouseLeave;
}(),
onMonthChange: function () {
function onMonthChange() {}
return onMonthChange;
}(),
onYearChange: function () {
function onYearChange() {}
return onYearChange;
}(),
onMonthTransitionEnd: function () {
function onMonthTransitionEnd() {}
return onMonthTransitionEnd;
}(),
renderMonthText: null,
renderCalendarDay: undefined,
renderDayContents: null,
translationValue: null,
renderMonthElement: null,
daySize: _constants.DAY_SIZE,
focusedDate: null,
isFocused: false,
firstDayOfWeek: null,
setMonthTitleHeight: null,
isRTL: false,
transitionDuration: 200,
verticalBorderSpacing: undefined,
// i18n
monthFormat: 'MMMM YYYY',
// english locale
phrases: _defaultPhrases.CalendarDayPhrases,
dayAriaLabelFormat: undefined
};
function getMonths(initialMonth, numberOfMonths, withoutTransitionMonths) {
var month = initialMonth.clone();
if (!withoutTransitionMonths) month = month.subtract(1, 'month');
var months = [];
for (var i = 0; i < (withoutTransitionMonths ? numberOfMonths : numberOfMonths + 2); i += 1) {
months.push(month);
month = month.clone().add(1, 'month');
}
return months;
}
var CalendarMonthGrid = function (_React$Component) {
_inherits(CalendarMonthGrid, _React$Component);
function CalendarMonthGrid(props) {
_classCallCheck(this, CalendarMonthGrid);
var _this = _possibleConstructorReturn(this, (CalendarMonthGrid.__proto__ || Object.getPrototypeOf(CalendarMonthGrid)).call(this, props));
var withoutTransitionMonths = props.orientation === _constants.VERTICAL_SCROLLABLE;
_this.state = {
months: getMonths(props.initialMonth, props.numberOfMonths, withoutTransitionMonths)
};
_this.isTransitionEndSupported = (0, _isTransitionEndSupported2['default'])();
_this.onTransitionEnd = _this.onTransitionEnd.bind(_this);
_this.setContainerRef = _this.setContainerRef.bind(_this);
_this.locale = _moment2['default'].locale();
_this.onMonthSelect = _this.onMonthSelect.bind(_this);
_this.onYearSelect = _this.onYearSelect.bind(_this);
return _this;
}
_createClass(CalendarMonthGrid, [{
key: 'componentDidMount',
value: function () {
function componentDidMount() {
this.removeEventListener = (0, _consolidatedEvents.addEventListener)(this.container, 'transitionend', this.onTransitionEnd);
}
return componentDidMount;
}()
}, {
key: 'componentWillReceiveProps',
value: function () {
function componentWillReceiveProps(nextProps) {
var _this2 = this;
var initialMonth = nextProps.initialMonth,
numberOfMonths = nextProps.numberOfMonths,
orientation = nextProps.orientation;
var months = this.state.months;
var _props = this.props,
prevInitialMonth = _props.initialMonth,
prevNumberOfMonths = _props.numberOfMonths;
var hasMonthChanged = !prevInitialMonth.isSame(initialMonth, 'month');
var hasNumberOfMonthsChanged = prevNumberOfMonths !== numberOfMonths;
var newMonths = months;
if (hasMonthChanged && !hasNumberOfMonthsChanged) {
if ((0, _isNextMonth2['default'])(prevInitialMonth, initialMonth)) {
newMonths = months.slice(1);
newMonths.push(months[months.length - 1].clone().add(1, 'month'));
} else if ((0, _isPrevMonth2['default'])(prevInitialMonth, initialMonth)) {
newMonths = months.slice(0, months.length - 1);
newMonths.unshift(months[0].clone().subtract(1, 'month'));
} else {
var withoutTransitionMonths = orientation === _constants.VERTICAL_SCROLLABLE;
newMonths = getMonths(initialMonth, numberOfMonths, withoutTransitionMonths);
}
}
if (hasNumberOfMonthsChanged) {
var _withoutTransitionMonths = orientation === _constants.VERTICAL_SCROLLABLE;
newMonths = getMonths(initialMonth, numberOfMonths, _withoutTransitionMonths);
}
var momentLocale = _moment2['default'].locale();
if (this.locale !== momentLocale) {
this.locale = momentLocale;
newMonths = newMonths.map(function (m) {
return m.locale(_this2.locale);
});
}
this.setState({
months: newMonths
});
}
return componentWillReceiveProps;
}()
}, {
key: 'shouldComponentUpdate',
value: function () {
function shouldComponentUpdate(nextProps, nextState) {
return (0, _reactAddonsShallowCompare2['default'])(this, nextProps, nextState);
}
return shouldComponentUpdate;
}()
}, {
key: 'componentDidUpdate',
value: function () {
function componentDidUpdate() {
var _props2 = this.props,
isAnimating = _props2.isAnimating,
transitionDuration = _props2.transitionDuration,
onMonthTransitionEnd = _props2.onMonthTransitionEnd; // For IE9, immediately call onMonthTransitionEnd instead of
// waiting for the animation to complete. Similarly, if transitionDuration
// is set to 0, also immediately invoke the onMonthTransitionEnd callback
if ((!this.isTransitionEndSupported || !transitionDuration) && isAnimating) {
onMonthTransitionEnd();
}
}
return componentDidUpdate;
}()
}, {
key: 'componentWillUnmount',
value: function () {
function componentWillUnmount() {
if (this.removeEventListener) this.removeEventListener();
}
return componentWillUnmount;
}()
}, {
key: 'onTransitionEnd',
value: function () {
function onTransitionEnd() {
var onMonthTransitionEnd = this.props.onMonthTransitionEnd;
onMonthTransitionEnd();
}
return onTransitionEnd;
}()
}, {
key: 'onMonthSelect',
value: function () {
function onMonthSelect(currentMonth, newMonthVal) {
var newMonth = currentMonth.clone();
var _props3 = this.props,
onMonthChange = _props3.onMonthChange,
orientation = _props3.orientation;
var months = this.state.months;
var withoutTransitionMonths = orientation === _constants.VERTICAL_SCROLLABLE;
var initialMonthSubtraction = months.indexOf(currentMonth);
if (!withoutTransitionMonths) {
initialMonthSubtraction -= 1;
}
newMonth.set('month', newMonthVal).subtract(initialMonthSubtraction, 'months');
onMonthChange(newMonth);
}
return onMonthSelect;
}()
}, {
key: 'onYearSelect',
value: function () {
function onYearSelect(currentMonth, newYearVal) {
var newMonth = currentMonth.clone();
var _props4 = this.props,
onYearChange = _props4.onYearChange,
orientation = _props4.orientation;
var months = this.state.months;
var withoutTransitionMonths = orientation === _constants.VERTICAL_SCROLLABLE;
var initialMonthSubtraction = months.indexOf(currentMonth);
if (!withoutTransitionMonths) {
initialMonthSubtraction -= 1;
}
newMonth.set('year', newYearVal).subtract(initialMonthSubtraction, 'months');
onYearChange(newMonth);
}
return onYearSelect;
}()
}, {
key: 'setContainerRef',
value: function () {
function setContainerRef(ref) {
this.container = ref;
}
return setContainerRef;
}()
}, {
key: 'render',
value: function () {
function render() {
var _this3 = this;
var _props5 = this.props,
enableOutsideDays = _props5.enableOutsideDays,
firstVisibleMonthIndex = _props5.firstVisibleMonthIndex,
horizontalMonthPadding = _props5.horizontalMonthPadding,
isAnimating = _props5.isAnimating,
modifiers = _props5.modifiers,
numberOfMonths = _props5.numberOfMonths,
monthFormat = _props5.monthFormat,
orientation = _props5.orientation,
translationValue = _props5.translationValue,
daySize = _props5.daySize,
onDayMouseEnter = _props5.onDayMouseEnter,
onDayMouseLeave = _props5.onDayMouseLeave,
onDayClick = _props5.onDayClick,
renderMonthText = _props5.renderMonthText,
renderCalendarDay = _props5.renderCalendarDay,
renderDayContents = _props5.renderDayContents,
renderMonthElement = _props5.renderMonthElement,
onMonthTransitionEnd = _props5.onMonthTransitionEnd,
firstDayOfWeek = _props5.firstDayOfWeek,
focusedDate = _props5.focusedDate,
isFocused = _props5.isFocused,
isRTL = _props5.isRTL,
styles = _props5.styles,
phrases = _props5.phrases,
dayAriaLabelFormat = _props5.dayAriaLabelFormat,
transitionDuration = _props5.transitionDuration,
verticalBorderSpacing = _props5.verticalBorderSpacing,
setMonthTitleHeight = _props5.setMonthTitleHeight;
var months = this.state.months;
var isVertical = orientation === _constants.VERTICAL_ORIENTATION;
var isVerticalScrollable = orientation === _constants.VERTICAL_SCROLLABLE;
var isHorizontal = orientation === _constants.HORIZONTAL_ORIENTATION;
var calendarMonthWidth = (0, _getCalendarMonthWidth2['default'])(daySize, horizontalMonthPadding);
var width = isVertical || isVerticalScrollable ? calendarMonthWidth : (numberOfMonths + 2) * calendarMonthWidth;
var transformType = isVertical || isVerticalScrollable ? 'translateY' : 'translateX';
var transformValue = transformType + '(' + String(translationValue) + 'px)';
return _react2['default'].createElement('div', _extends({}, (0, _reactWithStyles.css)(styles.CalendarMonthGrid, isHorizontal && styles.CalendarMonthGrid__horizontal, isVertical && styles.CalendarMonthGrid__vertical, isVerticalScrollable && styles.CalendarMonthGrid__vertical_scrollable, isAnimating && styles.CalendarMonthGrid__animating, isAnimating && transitionDuration && {
transition: 'transform ' + String(transitionDuration) + 'ms ease-in-out'
}, (0, _object2['default'])({}, (0, _getTransformStyles2['default'])(transformValue), {
width: width
})), {
ref: this.setContainerRef,
onTransitionEnd: onMonthTransitionEnd
}), months.map(function (month, i) {
var isVisible = i >= firstVisibleMonthIndex && i < firstVisibleMonthIndex + numberOfMonths;
var hideForAnimation = i === 0 && !isVisible;
var showForAnimation = i === 0 && isAnimating && isVisible;
var monthString = (0, _toISOMonthString2['default'])(month);
return _react2['default'].createElement('div', _extends({
key: monthString
}, (0, _reactWithStyles.css)(isHorizontal && styles.CalendarMonthGrid_month__horizontal, hideForAnimation && styles.CalendarMonthGrid_month__hideForAnimation, showForAnimation && !isVertical && !isRTL && {
position: 'absolute',
left: -calendarMonthWidth
}, showForAnimation && !isVertical && isRTL && {
position: 'absolute',
right: 0
}, showForAnimation && isVertical && {
position: 'absolute',
top: -translationValue
}, !isVisible && !isAnimating && styles.CalendarMonthGrid_month__hidden)), _react2['default'].createElement(_CalendarMonth2['default'], {
month: month,
isVisible: isVisible,
enableOutsideDays: enableOutsideDays,
modifiers: modifiers[monthString],
monthFormat: monthFormat,
orientation: orientation,
onDayMouseEnter: onDayMouseEnter,
onDayMouseLeave: onDayMouseLeave,
onDayClick: onDayClick,
onMonthSelect: _this3.onMonthSelect,
onYearSelect: _this3.onYearSelect,
renderMonthText: renderMonthText,
renderCalendarDay: renderCalendarDay,
renderDayContents: renderDayContents,
renderMonthElement: renderMonthElement,
firstDayOfWeek: firstDayOfWeek,
daySize: daySize,
focusedDate: isVisible ? focusedDate : null,
isFocused: isFocused,
phrases: phrases,
setMonthTitleHeight: setMonthTitleHeight,
dayAriaLabelFormat: dayAriaLabelFormat,
verticalBorderSpacing: verticalBorderSpacing,
horizontalMonthPadding: horizontalMonthPadding
}));
}));
}
return render;
}()
}]);
return CalendarMonthGrid;
}(_react2['default'].Component);
CalendarMonthGrid.propTypes = propTypes;
CalendarMonthGrid.defaultProps = defaultProps;
exports['default'] = (0, _reactWithStyles.withStyles)(function (_ref) {
var _ref$reactDates = _ref.reactDates,
color = _ref$reactDates.color,
noScrollBarOnVerticalScrollable = _ref$reactDates.noScrollBarOnVerticalScrollable,
spacing = _ref$reactDates.spacing,
zIndex = _ref$reactDates.zIndex;
return {
CalendarMonthGrid: {
background: color.background,
textAlign: 'left',
zIndex: zIndex
},
CalendarMonthGrid__animating: {
zIndex: zIndex + 1
},
CalendarMonthGrid__horizontal: {
position: 'absolute',
left: spacing.dayPickerHorizontalPadding
},
CalendarMonthGrid__vertical: {
margin: '0 auto'
},
CalendarMonthGrid__vertical_scrollable: (0, _object2['default'])({
margin: '0 auto',
overflowY: 'scroll'
}, noScrollBarOnVerticalScrollable && {
'-webkitOverflowScrolling': 'touch',
'::-webkit-scrollbar': {
'-webkit-appearance': 'none',
display: 'none'
}
}),
CalendarMonthGrid_month__horizontal: {
display: 'inline-block',
verticalAlign: 'top',
minHeight: '100%'
},
CalendarMonthGrid_month__hideForAnimation: {
position: 'absolute',
zIndex: zIndex - 1,
opacity: 0,
pointerEvents: 'none'
},
CalendarMonthGrid_month__hidden: {
visibility: 'hidden'
}
};
})(CalendarMonthGrid);
/***/ }),
/***/ "./node_modules/react-dates/lib/components/CalendarWeek.js":
/*!*****************************************************************!*\
!*** ./node_modules/react-dates/lib/components/CalendarWeek.js ***!
\*****************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports['default'] = CalendarWeek;
var _react = __webpack_require__(/*! react */ "react");
var _react2 = _interopRequireDefault(_react);
var _airbnbPropTypes = __webpack_require__(/*! airbnb-prop-types */ "./node_modules/airbnb-prop-types/index.js");
var _CalendarDay = __webpack_require__(/*! ./CalendarDay */ "./node_modules/react-dates/lib/components/CalendarDay.js");
var _CalendarDay2 = _interopRequireDefault(_CalendarDay);
var _CustomizableCalendarDay = __webpack_require__(/*! ./CustomizableCalendarDay */ "./node_modules/react-dates/lib/components/CustomizableCalendarDay.js");
var _CustomizableCalendarDay2 = _interopRequireDefault(_CustomizableCalendarDay);
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
'default': obj
};
}
var propTypes = (0, _airbnbPropTypes.forbidExtraProps)({
children: (0, _airbnbPropTypes.or)([(0, _airbnbPropTypes.childrenOfType)(_CalendarDay2['default']), (0, _airbnbPropTypes.childrenOfType)(_CustomizableCalendarDay2['default'])]).isRequired
});
function CalendarWeek(_ref) {
var children = _ref.children;
return _react2['default'].createElement('tr', null, children);
}
CalendarWeek.propTypes = propTypes;
/***/ }),
/***/ "./node_modules/react-dates/lib/components/ChevronDown.js":
/*!****************************************************************!*\
!*** ./node_modules/react-dates/lib/components/ChevronDown.js ***!
\****************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _react = __webpack_require__(/*! react */ "react");
var _react2 = _interopRequireDefault(_react);
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
'default': obj
};
}
var ChevronDown = function () {
function ChevronDown(props) {
return _react2['default'].createElement('svg', props, _react2['default'].createElement('path', {
d: 'M967.5 288.5L514.3 740.7c-11 11-21 11-32 0L29.1 288.5c-4-5-6-11-6-16 0-13 10-23 23-23 6 0 11 2 15 7l437.2 436.2 437.2-436.2c4-5 9-7 16-7 6 0 11 2 16 7 9 10.9 9 21 0 32z'
}));
}
return ChevronDown;
}();
ChevronDown.defaultProps = {
viewBox: '0 0 1000 1000'
};
exports['default'] = ChevronDown;
/***/ }),
/***/ "./node_modules/react-dates/lib/components/ChevronUp.js":
/*!**************************************************************!*\
!*** ./node_modules/react-dates/lib/components/ChevronUp.js ***!
\**************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _react = __webpack_require__(/*! react */ "react");
var _react2 = _interopRequireDefault(_react);
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
'default': obj
};
}
var ChevronUp = function () {
function ChevronUp(props) {
return _react2['default'].createElement('svg', props, _react2['default'].createElement('path', {
d: 'M32.1 712.6l453.2-452.2c11-11 21-11 32 0l453.2 452.2c4 5 6 10 6 16 0 13-10 23-22 23-7 0-12-2-16-7L501.3 308.5 64.1 744.7c-4 5-9 7-15 7-7 0-12-2-17-7-9-11-9-21 0-32.1z'
}));
}
return ChevronUp;
}();
ChevronUp.defaultProps = {
viewBox: '0 0 1000 1000'
};
exports['default'] = ChevronUp;
/***/ }),
/***/ "./node_modules/react-dates/lib/components/CloseButton.js":
/*!****************************************************************!*\
!*** ./node_modules/react-dates/lib/components/CloseButton.js ***!
\****************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _react = __webpack_require__(/*! react */ "react");
var _react2 = _interopRequireDefault(_react);
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
'default': obj
};
}
var CloseButton = function () {
function CloseButton(props) {
return _react2['default'].createElement('svg', props, _react2['default'].createElement('path', {
fillRule: 'evenodd',
d: 'M11.53.47a.75.75 0 0 0-1.061 0l-4.47 4.47L1.529.47A.75.75 0 1 0 .468 1.531l4.47 4.47-4.47 4.47a.75.75 0 1 0 1.061 1.061l4.47-4.47 4.47 4.47a.75.75 0 1 0 1.061-1.061l-4.47-4.47 4.47-4.47a.75.75 0 0 0 0-1.061z'
}));
}
return CloseButton;
}();
CloseButton.defaultProps = {
viewBox: '0 0 12 12'
};
exports['default'] = CloseButton;
/***/ }),
/***/ "./node_modules/react-dates/lib/components/CustomizableCalendarDay.js":
/*!****************************************************************************!*\
!*** ./node_modules/react-dates/lib/components/CustomizableCalendarDay.js ***!
\****************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.PureCustomizableCalendarDay = exports.selectedStyles = exports.lastInRangeStyles = exports.selectedSpanStyles = exports.hoveredSpanStyles = exports.blockedOutOfRangeStyles = exports.blockedCalendarStyles = exports.blockedMinNightsStyles = exports.highlightedCalendarStyles = exports.outsideStyles = exports.defaultStyles = 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 _object = __webpack_require__(/*! object.assign */ "./node_modules/object.assign/index.js");
var _object2 = _interopRequireDefault(_object);
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 _reactAddonsShallowCompare = __webpack_require__(/*! react-addons-shallow-compare */ "./node_modules/react-addons-shallow-compare/index.js");
var _reactAddonsShallowCompare2 = _interopRequireDefault(_reactAddonsShallowCompare);
var _reactMomentProptypes = __webpack_require__(/*! react-moment-proptypes */ "./node_modules/react-moment-proptypes/src/index.js");
var _reactMomentProptypes2 = _interopRequireDefault(_reactMomentProptypes);
var _airbnbPropTypes = __webpack_require__(/*! airbnb-prop-types */ "./node_modules/airbnb-prop-types/index.js");
var _reactWithStyles = __webpack_require__(/*! react-with-styles */ "./node_modules/react-with-styles/lib/withStyles.js");
var _moment = __webpack_require__(/*! moment */ "./node_modules/moment/moment.js");
var _moment2 = _interopRequireDefault(_moment);
var _defaultPhrases = __webpack_require__(/*! ../defaultPhrases */ "./node_modules/react-dates/lib/defaultPhrases.js");
var _getPhrasePropTypes = __webpack_require__(/*! ../utils/getPhrasePropTypes */ "./node_modules/react-dates/lib/utils/getPhrasePropTypes.js");
var _getPhrasePropTypes2 = _interopRequireDefault(_getPhrasePropTypes);
var _getCalendarDaySettings = __webpack_require__(/*! ../utils/getCalendarDaySettings */ "./node_modules/react-dates/lib/utils/getCalendarDaySettings.js");
var _getCalendarDaySettings2 = _interopRequireDefault(_getCalendarDaySettings);
var _constants = __webpack_require__(/*! ../constants */ "./node_modules/react-dates/lib/constants.js");
var _DefaultTheme = __webpack_require__(/*! ../theme/DefaultTheme */ "./node_modules/react-dates/lib/theme/DefaultTheme.js");
var _DefaultTheme2 = _interopRequireDefault(_DefaultTheme);
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 color = _DefaultTheme2['default'].reactDates.color;
function getStyles(stylesObj, isHovered) {
if (!stylesObj) return null;
var hover = stylesObj.hover;
if (isHovered && hover) {
return hover;
}
return stylesObj;
}
var DayStyleShape = _propTypes2['default'].shape({
background: _propTypes2['default'].string,
border: (0, _airbnbPropTypes.or)([_propTypes2['default'].string, _propTypes2['default'].number]),
color: _propTypes2['default'].string,
hover: _propTypes2['default'].shape({
background: _propTypes2['default'].string,
border: (0, _airbnbPropTypes.or)([_propTypes2['default'].string, _propTypes2['default'].number]),
color: _propTypes2['default'].string
})
});
var propTypes = (0, _airbnbPropTypes.forbidExtraProps)((0, _object2['default'])({}, _reactWithStyles.withStylesPropTypes, {
day: _reactMomentProptypes2['default'].momentObj,
daySize: _airbnbPropTypes.nonNegativeInteger,
isOutsideDay: _propTypes2['default'].bool,
modifiers: _propTypes2['default'].instanceOf(Set),
isFocused: _propTypes2['default'].bool,
tabIndex: _propTypes2['default'].oneOf([0, -1]),
onDayClick: _propTypes2['default'].func,
onDayMouseEnter: _propTypes2['default'].func,
onDayMouseLeave: _propTypes2['default'].func,
renderDayContents: _propTypes2['default'].func,
ariaLabelFormat: _propTypes2['default'].string,
// style overrides
defaultStyles: DayStyleShape,
outsideStyles: DayStyleShape,
todayStyles: DayStyleShape,
firstDayOfWeekStyles: DayStyleShape,
lastDayOfWeekStyles: DayStyleShape,
highlightedCalendarStyles: DayStyleShape,
blockedMinNightsStyles: DayStyleShape,
blockedCalendarStyles: DayStyleShape,
blockedOutOfRangeStyles: DayStyleShape,
hoveredSpanStyles: DayStyleShape,
selectedSpanStyles: DayStyleShape,
lastInRangeStyles: DayStyleShape,
selectedStyles: DayStyleShape,
selectedStartStyles: DayStyleShape,
selectedEndStyles: DayStyleShape,
afterHoveredStartStyles: DayStyleShape,
// internationalization
phrases: _propTypes2['default'].shape((0, _getPhrasePropTypes2['default'])(_defaultPhrases.CalendarDayPhrases))
}));
var defaultStyles = exports.defaultStyles = {
border: '1px solid ' + String(color.core.borderLight),
color: color.text,
background: color.background,
hover: {
background: color.core.borderLight,
border: '1px double ' + String(color.core.borderLight),
color: 'inherit'
}
};
var outsideStyles = exports.outsideStyles = {
background: color.outside.backgroundColor,
border: 0,
color: color.outside.color
};
var highlightedCalendarStyles = exports.highlightedCalendarStyles = {
background: color.highlighted.backgroundColor,
color: color.highlighted.color,
hover: {
background: color.highlighted.backgroundColor_hover,
color: color.highlighted.color_active
}
};
var blockedMinNightsStyles = exports.blockedMinNightsStyles = {
background: color.minimumNights.backgroundColor,
border: '1px solid ' + String(color.minimumNights.borderColor),
color: color.minimumNights.color,
hover: {
background: color.minimumNights.backgroundColor_hover,
color: color.minimumNights.color_active
}
};
var blockedCalendarStyles = exports.blockedCalendarStyles = {
background: color.blocked_calendar.backgroundColor,
border: '1px solid ' + String(color.blocked_calendar.borderColor),
color: color.blocked_calendar.color,
hover: {
background: color.blocked_calendar.backgroundColor_hover,
border: '1px solid ' + String(color.blocked_calendar.borderColor),
color: color.blocked_calendar.color_active
}
};
var blockedOutOfRangeStyles = exports.blockedOutOfRangeStyles = {
background: color.blocked_out_of_range.backgroundColor,
border: '1px solid ' + String(color.blocked_out_of_range.borderColor),
color: color.blocked_out_of_range.color,
hover: {
background: color.blocked_out_of_range.backgroundColor_hover,
border: '1px solid ' + String(color.blocked_out_of_range.borderColor),
color: color.blocked_out_of_range.color_active
}
};
var hoveredSpanStyles = exports.hoveredSpanStyles = {
background: color.hoveredSpan.backgroundColor,
border: '1px solid ' + String(color.hoveredSpan.borderColor),
color: color.hoveredSpan.color,
hover: {
background: color.hoveredSpan.backgroundColor_hover,
border: '1px solid ' + String(color.hoveredSpan.borderColor),
color: color.hoveredSpan.color_active
}
};
var selectedSpanStyles = exports.selectedSpanStyles = {
background: color.selectedSpan.backgroundColor,
border: '1px solid ' + String(color.selectedSpan.borderColor),
color: color.selectedSpan.color,
hover: {
background: color.selectedSpan.backgroundColor_hover,
border: '1px solid ' + String(color.selectedSpan.borderColor),
color: color.selectedSpan.color_active
}
};
var lastInRangeStyles = exports.lastInRangeStyles = {
borderRight: color.core.primary
};
var selectedStyles = exports.selectedStyles = {
background: color.selected.backgroundColor,
border: '1px solid ' + String(color.selected.borderColor),
color: color.selected.color,
hover: {
background: color.selected.backgroundColor_hover,
border: '1px solid ' + String(color.selected.borderColor),
color: color.selected.color_active
}
};
var defaultProps = {
day: (0, _moment2['default'])(),
daySize: _constants.DAY_SIZE,
isOutsideDay: false,
modifiers: new Set(),
isFocused: false,
tabIndex: -1,
onDayClick: function () {
function onDayClick() {}
return onDayClick;
}(),
onDayMouseEnter: function () {
function onDayMouseEnter() {}
return onDayMouseEnter;
}(),
onDayMouseLeave: function () {
function onDayMouseLeave() {}
return onDayMouseLeave;
}(),
renderDayContents: null,
ariaLabelFormat: 'dddd, LL',
// style defaults
defaultStyles: defaultStyles,
outsideStyles: outsideStyles,
todayStyles: {},
highlightedCalendarStyles: highlightedCalendarStyles,
blockedMinNightsStyles: blockedMinNightsStyles,
blockedCalendarStyles: blockedCalendarStyles,
blockedOutOfRangeStyles: blockedOutOfRangeStyles,
hoveredSpanStyles: hoveredSpanStyles,
selectedSpanStyles: selectedSpanStyles,
lastInRangeStyles: lastInRangeStyles,
selectedStyles: selectedStyles,
selectedStartStyles: {},
selectedEndStyles: {},
afterHoveredStartStyles: {},
firstDayOfWeekStyles: {},
lastDayOfWeekStyles: {},
// internationalization
phrases: _defaultPhrases.CalendarDayPhrases
};
var CustomizableCalendarDay = function (_React$Component) {
_inherits(CustomizableCalendarDay, _React$Component);
function CustomizableCalendarDay() {
var _ref;
_classCallCheck(this, CustomizableCalendarDay);
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
var _this = _possibleConstructorReturn(this, (_ref = CustomizableCalendarDay.__proto__ || Object.getPrototypeOf(CustomizableCalendarDay)).call.apply(_ref, [this].concat(args)));
_this.state = {
isHovered: false
};
_this.setButtonRef = _this.setButtonRef.bind(_this);
return _this;
}
_createClass(CustomizableCalendarDay, [{
key: 'shouldComponentUpdate',
value: function () {
function shouldComponentUpdate(nextProps, nextState) {
return (0, _reactAddonsShallowCompare2['default'])(this, nextProps, nextState);
}
return shouldComponentUpdate;
}()
}, {
key: 'componentDidUpdate',
value: function () {
function componentDidUpdate(prevProps) {
var _props = this.props,
isFocused = _props.isFocused,
tabIndex = _props.tabIndex;
if (tabIndex === 0) {
if (isFocused || tabIndex !== prevProps.tabIndex) {
this.buttonRef.focus();
}
}
}
return componentDidUpdate;
}()
}, {
key: 'onDayClick',
value: function () {
function onDayClick(day, e) {
var onDayClick = this.props.onDayClick;
onDayClick(day, e);
}
return onDayClick;
}()
}, {
key: 'onDayMouseEnter',
value: function () {
function onDayMouseEnter(day, e) {
var onDayMouseEnter = this.props.onDayMouseEnter;
this.setState({
isHovered: true
});
onDayMouseEnter(day, e);
}
return onDayMouseEnter;
}()
}, {
key: 'onDayMouseLeave',
value: function () {
function onDayMouseLeave(day, e) {
var onDayMouseLeave = this.props.onDayMouseLeave;
this.setState({
isHovered: false
});
onDayMouseLeave(day, e);
}
return onDayMouseLeave;
}()
}, {
key: 'onKeyDown',
value: function () {
function onKeyDown(day, e) {
var onDayClick = this.props.onDayClick;
var key = e.key;
if (key === 'Enter' || key === ' ') {
onDayClick(day, e);
}
}
return onKeyDown;
}()
}, {
key: 'setButtonRef',
value: function () {
function setButtonRef(ref) {
this.buttonRef = ref;
}
return setButtonRef;
}()
}, {
key: 'render',
value: function () {
function render() {
var _this2 = this;
var _props2 = this.props,
day = _props2.day,
ariaLabelFormat = _props2.ariaLabelFormat,
daySize = _props2.daySize,
isOutsideDay = _props2.isOutsideDay,
modifiers = _props2.modifiers,
tabIndex = _props2.tabIndex,
renderDayContents = _props2.renderDayContents,
styles = _props2.styles,
phrases = _props2.phrases,
defaultStylesWithHover = _props2.defaultStyles,
outsideStylesWithHover = _props2.outsideStyles,
todayStylesWithHover = _props2.todayStyles,
firstDayOfWeekStylesWithHover = _props2.firstDayOfWeekStyles,
lastDayOfWeekStylesWithHover = _props2.lastDayOfWeekStyles,
highlightedCalendarStylesWithHover = _props2.highlightedCalendarStyles,
blockedMinNightsStylesWithHover = _props2.blockedMinNightsStyles,
blockedCalendarStylesWithHover = _props2.blockedCalendarStyles,
blockedOutOfRangeStylesWithHover = _props2.blockedOutOfRangeStyles,
hoveredSpanStylesWithHover = _props2.hoveredSpanStyles,
selectedSpanStylesWithHover = _props2.selectedSpanStyles,
lastInRangeStylesWithHover = _props2.lastInRangeStyles,
selectedStylesWithHover = _props2.selectedStyles,
selectedStartStylesWithHover = _props2.selectedStartStyles,
selectedEndStylesWithHover = _props2.selectedEndStyles,
afterHoveredStartStylesWithHover = _props2.afterHoveredStartStyles;
var isHovered = this.state.isHovered;
if (!day) return _react2['default'].createElement('td', null);
var _getCalendarDaySettin = (0, _getCalendarDaySettings2['default'])(day, ariaLabelFormat, daySize, modifiers, phrases),
daySizeStyles = _getCalendarDaySettin.daySizeStyles,
useDefaultCursor = _getCalendarDaySettin.useDefaultCursor,
selected = _getCalendarDaySettin.selected,
hoveredSpan = _getCalendarDaySettin.hoveredSpan,
isOutsideRange = _getCalendarDaySettin.isOutsideRange,
ariaLabel = _getCalendarDaySettin.ariaLabel;
return _react2['default'].createElement('td', _extends({}, (0, _reactWithStyles.css)(styles.CalendarDay, useDefaultCursor && styles.CalendarDay__defaultCursor, daySizeStyles, getStyles(defaultStylesWithHover, isHovered), isOutsideDay && getStyles(outsideStylesWithHover, isHovered), modifiers.has('today') && getStyles(todayStylesWithHover, isHovered), modifiers.has('first-day-of-week') && getStyles(firstDayOfWeekStylesWithHover, isHovered), modifiers.has('last-day-of-week') && getStyles(lastDayOfWeekStylesWithHover, isHovered), modifiers.has('highlighted-calendar') && getStyles(highlightedCalendarStylesWithHover, isHovered), modifiers.has('blocked-minimum-nights') && getStyles(blockedMinNightsStylesWithHover, isHovered), modifiers.has('blocked-calendar') && getStyles(blockedCalendarStylesWithHover, isHovered), hoveredSpan && getStyles(hoveredSpanStylesWithHover, isHovered), modifiers.has('after-hovered-start') && getStyles(afterHoveredStartStylesWithHover, isHovered), modifiers.has('selected-span') && getStyles(selectedSpanStylesWithHover, isHovered), modifiers.has('last-in-range') && getStyles(lastInRangeStylesWithHover, isHovered), selected && getStyles(selectedStylesWithHover, isHovered), modifiers.has('selected-start') && getStyles(selectedStartStylesWithHover, isHovered), modifiers.has('selected-end') && getStyles(selectedEndStylesWithHover, isHovered), isOutsideRange && getStyles(blockedOutOfRangeStylesWithHover, isHovered)), {
role: 'button' // eslint-disable-line jsx-a11y/no-noninteractive-element-to-interactive-role
,
ref: this.setButtonRef,
'aria-label': ariaLabel,
onMouseEnter: function () {
function onMouseEnter(e) {
_this2.onDayMouseEnter(day, e);
}
return onMouseEnter;
}(),
onMouseLeave: function () {
function onMouseLeave(e) {
_this2.onDayMouseLeave(day, e);
}
return onMouseLeave;
}(),
onMouseUp: function () {
function onMouseUp(e) {
e.currentTarget.blur();
}
return onMouseUp;
}(),
onClick: function () {
function onClick(e) {
_this2.onDayClick(day, e);
}
return onClick;
}(),
onKeyDown: function () {
function onKeyDown(e) {
_this2.onKeyDown(day, e);
}
return onKeyDown;
}(),
tabIndex: tabIndex
}), renderDayContents ? renderDayContents(day, modifiers) : day.format('D'));
}
return render;
}()
}]);
return CustomizableCalendarDay;
}(_react2['default'].Component);
CustomizableCalendarDay.propTypes = propTypes;
CustomizableCalendarDay.defaultProps = defaultProps;
exports.PureCustomizableCalendarDay = CustomizableCalendarDay;
exports['default'] = (0, _reactWithStyles.withStyles)(function (_ref2) {
var font = _ref2.reactDates.font;
return {
CalendarDay: {
boxSizing: 'border-box',
cursor: 'pointer',
fontSize: font.size,
textAlign: 'center',
':active': {
outline: 0
}
},
CalendarDay__defaultCursor: {
cursor: 'default'
}
};
})(CustomizableCalendarDay);
/***/ }),
/***/ "./node_modules/react-dates/lib/components/DateInput.js":
/*!**************************************************************!*\
!*** ./node_modules/react-dates/lib/components/DateInput.js ***!
\**************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
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 _object = __webpack_require__(/*! object.assign */ "./node_modules/object.assign/index.js");
var _object2 = _interopRequireDefault(_object);
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 _airbnbPropTypes = __webpack_require__(/*! airbnb-prop-types */ "./node_modules/airbnb-prop-types/index.js");
var _reactWithStyles = __webpack_require__(/*! react-with-styles */ "./node_modules/react-with-styles/lib/withStyles.js");
var _throttle = __webpack_require__(/*! lodash/throttle */ "./node_modules/lodash/throttle.js");
var _throttle2 = _interopRequireDefault(_throttle);
var _isTouchDevice = __webpack_require__(/*! is-touch-device */ "./node_modules/is-touch-device/build/index.js");
var _isTouchDevice2 = _interopRequireDefault(_isTouchDevice);
var _getInputHeight = __webpack_require__(/*! ../utils/getInputHeight */ "./node_modules/react-dates/lib/utils/getInputHeight.js");
var _getInputHeight2 = _interopRequireDefault(_getInputHeight);
var _OpenDirectionShape = __webpack_require__(/*! ../shapes/OpenDirectionShape */ "./node_modules/react-dates/lib/shapes/OpenDirectionShape.js");
var _OpenDirectionShape2 = _interopRequireDefault(_OpenDirectionShape);
var _constants = __webpack_require__(/*! ../constants */ "./node_modules/react-dates/lib/constants.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;
}
var FANG_PATH_TOP = 'M0,' + String(_constants.FANG_HEIGHT_PX) + ' ' + String(_constants.FANG_WIDTH_PX) + ',' + String(_constants.FANG_HEIGHT_PX) + ' ' + _constants.FANG_WIDTH_PX / 2 + ',0z';
var FANG_STROKE_TOP = 'M0,' + String(_constants.FANG_HEIGHT_PX) + ' ' + _constants.FANG_WIDTH_PX / 2 + ',0 ' + String(_constants.FANG_WIDTH_PX) + ',' + String(_constants.FANG_HEIGHT_PX);
var FANG_PATH_BOTTOM = 'M0,0 ' + String(_constants.FANG_WIDTH_PX) + ',0 ' + _constants.FANG_WIDTH_PX / 2 + ',' + String(_constants.FANG_HEIGHT_PX) + 'z';
var FANG_STROKE_BOTTOM = 'M0,0 ' + _constants.FANG_WIDTH_PX / 2 + ',' + String(_constants.FANG_HEIGHT_PX) + ' ' + String(_constants.FANG_WIDTH_PX) + ',0';
var propTypes = (0, _airbnbPropTypes.forbidExtraProps)((0, _object2['default'])({}, _reactWithStyles.withStylesPropTypes, {
id: _propTypes2['default'].string.isRequired,
placeholder: _propTypes2['default'].string,
// also used as label
displayValue: _propTypes2['default'].string,
screenReaderMessage: _propTypes2['default'].string,
focused: _propTypes2['default'].bool,
disabled: _propTypes2['default'].bool,
required: _propTypes2['default'].bool,
readOnly: _propTypes2['default'].bool,
openDirection: _OpenDirectionShape2['default'],
showCaret: _propTypes2['default'].bool,
verticalSpacing: _airbnbPropTypes.nonNegativeInteger,
small: _propTypes2['default'].bool,
block: _propTypes2['default'].bool,
regular: _propTypes2['default'].bool,
onChange: _propTypes2['default'].func,
onFocus: _propTypes2['default'].func,
onKeyDownShiftTab: _propTypes2['default'].func,
onKeyDownTab: _propTypes2['default'].func,
onKeyDownArrowDown: _propTypes2['default'].func,
onKeyDownQuestionMark: _propTypes2['default'].func,
// accessibility
isFocused: _propTypes2['default'].bool // describes actual DOM focus
}));
var defaultProps = {
placeholder: 'Select Date',
displayValue: '',
screenReaderMessage: '',
focused: false,
disabled: false,
required: false,
readOnly: null,
openDirection: _constants.OPEN_DOWN,
showCaret: false,
verticalSpacing: _constants.DEFAULT_VERTICAL_SPACING,
small: false,
block: false,
regular: false,
onChange: function () {
function onChange() {}
return onChange;
}(),
onFocus: function () {
function onFocus() {}
return onFocus;
}(),
onKeyDownShiftTab: function () {
function onKeyDownShiftTab() {}
return onKeyDownShiftTab;
}(),
onKeyDownTab: function () {
function onKeyDownTab() {}
return onKeyDownTab;
}(),
onKeyDownArrowDown: function () {
function onKeyDownArrowDown() {}
return onKeyDownArrowDown;
}(),
onKeyDownQuestionMark: function () {
function onKeyDownQuestionMark() {}
return onKeyDownQuestionMark;
}(),
// accessibility
isFocused: false
};
var DateInput = function (_React$Component) {
_inherits(DateInput, _React$Component);
function DateInput(props) {
_classCallCheck(this, DateInput);
var _this = _possibleConstructorReturn(this, (DateInput.__proto__ || Object.getPrototypeOf(DateInput)).call(this, props));
_this.state = {
dateString: '',
isTouchDevice: false
};
_this.onChange = _this.onChange.bind(_this);
_this.onKeyDown = _this.onKeyDown.bind(_this);
_this.setInputRef = _this.setInputRef.bind(_this);
_this.throttledKeyDown = (0, _throttle2['default'])(_this.onFinalKeyDown, 300, {
trailing: false
});
return _this;
}
_createClass(DateInput, [{
key: 'componentDidMount',
value: function () {
function componentDidMount() {
this.setState({
isTouchDevice: (0, _isTouchDevice2['default'])()
});
}
return componentDidMount;
}()
}, {
key: 'componentWillReceiveProps',
value: function () {
function componentWillReceiveProps(nextProps) {
var dateString = this.state.dateString;
if (dateString && nextProps.displayValue) {
this.setState({
dateString: ''
});
}
}
return componentWillReceiveProps;
}()
}, {
key: 'componentDidUpdate',
value: function () {
function componentDidUpdate(prevProps) {
var _props = this.props,
focused = _props.focused,
isFocused = _props.isFocused;
if (prevProps.focused === focused && prevProps.isFocused === isFocused) return;
if (focused && isFocused) {
this.inputRef.focus();
}
}
return componentDidUpdate;
}()
}, {
key: 'onChange',
value: function () {
function onChange(e) {
var _props2 = this.props,
onChange = _props2.onChange,
onKeyDownQuestionMark = _props2.onKeyDownQuestionMark;
var dateString = e.target.value; // In Safari, onKeyDown does not consistently fire ahead of onChange. As a result, we need to
// special case the `?` key so that it always triggers the appropriate callback, instead of
// modifying the input value
if (dateString[dateString.length - 1] === '?') {
onKeyDownQuestionMark(e);
} else {
this.setState({
dateString: dateString
}, function () {
return onChange(dateString);
});
}
}
return onChange;
}()
}, {
key: 'onKeyDown',
value: function () {
function onKeyDown(e) {
e.stopPropagation();
if (!_constants.MODIFIER_KEY_NAMES.has(e.key)) {
this.throttledKeyDown(e);
}
}
return onKeyDown;
}()
}, {
key: 'onFinalKeyDown',
value: function () {
function onFinalKeyDown(e) {
var _props3 = this.props,
onKeyDownShiftTab = _props3.onKeyDownShiftTab,
onKeyDownTab = _props3.onKeyDownTab,
onKeyDownArrowDown = _props3.onKeyDownArrowDown,
onKeyDownQuestionMark = _props3.onKeyDownQuestionMark;
var key = e.key;
if (key === 'Tab') {
if (e.shiftKey) {
onKeyDownShiftTab(e);
} else {
onKeyDownTab(e);
}
} else if (key === 'ArrowDown') {
onKeyDownArrowDown(e);
} else if (key === '?') {
e.preventDefault();
onKeyDownQuestionMark(e);
}
}
return onFinalKeyDown;
}()
}, {
key: 'setInputRef',
value: function () {
function setInputRef(ref) {
this.inputRef = ref;
}
return setInputRef;
}()
}, {
key: 'render',
value: function () {
function render() {
var _state = this.state,
dateString = _state.dateString,
isTouch = _state.isTouchDevice;
var _props4 = this.props,
id = _props4.id,
placeholder = _props4.placeholder,
displayValue = _props4.displayValue,
screenReaderMessage = _props4.screenReaderMessage,
focused = _props4.focused,
showCaret = _props4.showCaret,
onFocus = _props4.onFocus,
disabled = _props4.disabled,
required = _props4.required,
readOnly = _props4.readOnly,
openDirection = _props4.openDirection,
verticalSpacing = _props4.verticalSpacing,
small = _props4.small,
regular = _props4.regular,
block = _props4.block,
styles = _props4.styles,
reactDates = _props4.theme.reactDates;
var value = dateString || displayValue || '';
var screenReaderMessageId = 'DateInput__screen-reader-message-' + String(id);
var withFang = showCaret && focused;
var inputHeight = (0, _getInputHeight2['default'])(reactDates, small);
return _react2['default'].createElement('div', (0, _reactWithStyles.css)(styles.DateInput, small && styles.DateInput__small, block && styles.DateInput__block, withFang && styles.DateInput__withFang, disabled && styles.DateInput__disabled, withFang && openDirection === _constants.OPEN_DOWN && styles.DateInput__openDown, withFang && openDirection === _constants.OPEN_UP && styles.DateInput__openUp), _react2['default'].createElement('input', _extends({}, (0, _reactWithStyles.css)(styles.DateInput_input, small && styles.DateInput_input__small, regular && styles.DateInput_input__regular, readOnly && styles.DateInput_input__readOnly, focused && styles.DateInput_input__focused, disabled && styles.DateInput_input__disabled), {
'aria-label': placeholder,
type: 'text',
id: id,
name: id,
ref: this.setInputRef,
value: value,
onChange: this.onChange,
onKeyDown: this.onKeyDown,
onFocus: onFocus,
placeholder: placeholder,
autoComplete: 'off',
disabled: disabled,
readOnly: typeof readOnly === 'boolean' ? readOnly : isTouch,
required: required,
'aria-describedby': screenReaderMessage && screenReaderMessageId
})), withFang && _react2['default'].createElement('svg', _extends({
role: 'presentation',
focusable: 'false'
}, (0, _reactWithStyles.css)(styles.DateInput_fang, openDirection === _constants.OPEN_DOWN && {
top: inputHeight + verticalSpacing - _constants.FANG_HEIGHT_PX - 1
}, openDirection === _constants.OPEN_UP && {
bottom: inputHeight + verticalSpacing - _constants.FANG_HEIGHT_PX - 1
})), _react2['default'].createElement('path', _extends({}, (0, _reactWithStyles.css)(styles.DateInput_fangShape), {
d: openDirection === _constants.OPEN_DOWN ? FANG_PATH_TOP : FANG_PATH_BOTTOM
})), _react2['default'].createElement('path', _extends({}, (0, _reactWithStyles.css)(styles.DateInput_fangStroke), {
d: openDirection === _constants.OPEN_DOWN ? FANG_STROKE_TOP : FANG_STROKE_BOTTOM
}))), screenReaderMessage && _react2['default'].createElement('p', _extends({}, (0, _reactWithStyles.css)(styles.DateInput_screenReaderMessage), {
id: screenReaderMessageId
}), screenReaderMessage));
}
return render;
}()
}]);
return DateInput;
}(_react2['default'].Component);
DateInput.propTypes = propTypes;
DateInput.defaultProps = defaultProps;
exports['default'] = (0, _reactWithStyles.withStyles)(function (_ref) {
var _ref$reactDates = _ref.reactDates,
border = _ref$reactDates.border,
color = _ref$reactDates.color,
sizing = _ref$reactDates.sizing,
spacing = _ref$reactDates.spacing,
font = _ref$reactDates.font,
zIndex = _ref$reactDates.zIndex;
return {
DateInput: {
margin: 0,
padding: spacing.inputPadding,
background: color.background,
position: 'relative',
display: 'inline-block',
width: sizing.inputWidth,
verticalAlign: 'middle'
},
DateInput__small: {
width: sizing.inputWidth_small
},
DateInput__block: {
width: '100%'
},
DateInput__disabled: {
background: color.disabled,
color: color.textDisabled
},
DateInput_input: {
fontWeight: 200,
fontSize: font.input.size,
lineHeight: font.input.lineHeight,
color: color.text,
backgroundColor: color.background,
width: '100%',
padding: String(spacing.displayTextPaddingVertical) + 'px ' + String(spacing.displayTextPaddingHorizontal) + 'px',
paddingTop: spacing.displayTextPaddingTop,
paddingBottom: spacing.displayTextPaddingBottom,
paddingLeft: spacing.displayTextPaddingLeft,
paddingRight: spacing.displayTextPaddingRight,
border: border.input.border,
borderTop: border.input.borderTop,
borderRight: border.input.borderRight,
borderBottom: border.input.borderBottom,
borderLeft: border.input.borderLeft,
borderRadius: border.input.borderRadius
},
DateInput_input__small: {
fontSize: font.input.size_small,
lineHeight: font.input.lineHeight_small,
letterSpacing: font.input.letterSpacing_small,
padding: String(spacing.displayTextPaddingVertical_small) + 'px ' + String(spacing.displayTextPaddingHorizontal_small) + 'px',
paddingTop: spacing.displayTextPaddingTop_small,
paddingBottom: spacing.displayTextPaddingBottom_small,
paddingLeft: spacing.displayTextPaddingLeft_small,
paddingRight: spacing.displayTextPaddingRight_small
},
DateInput_input__regular: {
fontWeight: 'auto'
},
DateInput_input__readOnly: {
userSelect: 'none'
},
DateInput_input__focused: {
outline: border.input.outlineFocused,
background: color.backgroundFocused,
border: border.input.borderFocused,
borderTop: border.input.borderTopFocused,
borderRight: border.input.borderRightFocused,
borderBottom: border.input.borderBottomFocused,
borderLeft: border.input.borderLeftFocused
},
DateInput_input__disabled: {
background: color.disabled,
fontStyle: font.input.styleDisabled
},
DateInput_screenReaderMessage: {
border: 0,
clip: 'rect(0, 0, 0, 0)',
height: 1,
margin: -1,
overflow: 'hidden',
padding: 0,
position: 'absolute',
width: 1
},
DateInput_fang: {
position: 'absolute',
width: _constants.FANG_WIDTH_PX,
height: _constants.FANG_HEIGHT_PX,
left: 22,
zIndex: zIndex + 2
},
DateInput_fangShape: {
fill: color.background
},
DateInput_fangStroke: {
stroke: color.core.border,
fill: 'transparent'
}
};
})(DateInput);
/***/ }),
/***/ "./node_modules/react-dates/lib/components/DateRangePicker.js":
/*!********************************************************************!*\
!*** ./node_modules/react-dates/lib/components/DateRangePicker.js ***!
\********************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.PureDateRangePicker = 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 _object = __webpack_require__(/*! object.assign */ "./node_modules/object.assign/index.js");
var _object2 = _interopRequireDefault(_object);
var _react = __webpack_require__(/*! react */ "react");
var _react2 = _interopRequireDefault(_react);
var _reactAddonsShallowCompare = __webpack_require__(/*! react-addons-shallow-compare */ "./node_modules/react-addons-shallow-compare/index.js");
var _reactAddonsShallowCompare2 = _interopRequireDefault(_reactAddonsShallowCompare);
var _moment = __webpack_require__(/*! moment */ "./node_modules/moment/moment.js");
var _moment2 = _interopRequireDefault(_moment);
var _reactWithStyles = __webpack_require__(/*! react-with-styles */ "./node_modules/react-with-styles/lib/withStyles.js");
var _reactPortal = __webpack_require__(/*! react-portal */ "./node_modules/react-portal/es/index.js");
var _airbnbPropTypes = __webpack_require__(/*! airbnb-prop-types */ "./node_modules/airbnb-prop-types/index.js");
var _consolidatedEvents = __webpack_require__(/*! consolidated-events */ "./node_modules/consolidated-events/lib/index.esm.js");
var _isTouchDevice = __webpack_require__(/*! is-touch-device */ "./node_modules/is-touch-device/build/index.js");
var _isTouchDevice2 = _interopRequireDefault(_isTouchDevice);
var _reactOutsideClickHandler = __webpack_require__(/*! react-outside-click-handler */ "./node_modules/react-outside-click-handler/index.js");
var _reactOutsideClickHandler2 = _interopRequireDefault(_reactOutsideClickHandler);
var _DateRangePickerShape = __webpack_require__(/*! ../shapes/DateRangePickerShape */ "./node_modules/react-dates/lib/shapes/DateRangePickerShape.js");
var _DateRangePickerShape2 = _interopRequireDefault(_DateRangePickerShape);
var _defaultPhrases = __webpack_require__(/*! ../defaultPhrases */ "./node_modules/react-dates/lib/defaultPhrases.js");
var _getResponsiveContainerStyles = __webpack_require__(/*! ../utils/getResponsiveContainerStyles */ "./node_modules/react-dates/lib/utils/getResponsiveContainerStyles.js");
var _getResponsiveContainerStyles2 = _interopRequireDefault(_getResponsiveContainerStyles);
var _getDetachedContainerStyles = __webpack_require__(/*! ../utils/getDetachedContainerStyles */ "./node_modules/react-dates/lib/utils/getDetachedContainerStyles.js");
var _getDetachedContainerStyles2 = _interopRequireDefault(_getDetachedContainerStyles);
var _getInputHeight = __webpack_require__(/*! ../utils/getInputHeight */ "./node_modules/react-dates/lib/utils/getInputHeight.js");
var _getInputHeight2 = _interopRequireDefault(_getInputHeight);
var _isInclusivelyAfterDay = __webpack_require__(/*! ../utils/isInclusivelyAfterDay */ "./node_modules/react-dates/lib/utils/isInclusivelyAfterDay.js");
var _isInclusivelyAfterDay2 = _interopRequireDefault(_isInclusivelyAfterDay);
var _disableScroll2 = __webpack_require__(/*! ../utils/disableScroll */ "./node_modules/react-dates/lib/utils/disableScroll.js");
var _disableScroll3 = _interopRequireDefault(_disableScroll2);
var _DateRangePickerInputController = __webpack_require__(/*! ./DateRangePickerInputController */ "./node_modules/react-dates/lib/components/DateRangePickerInputController.js");
var _DateRangePickerInputController2 = _interopRequireDefault(_DateRangePickerInputController);
var _DayPickerRangeController = __webpack_require__(/*! ./DayPickerRangeController */ "./node_modules/react-dates/lib/components/DayPickerRangeController.js");
var _DayPickerRangeController2 = _interopRequireDefault(_DayPickerRangeController);
var _CloseButton = __webpack_require__(/*! ./CloseButton */ "./node_modules/react-dates/lib/components/CloseButton.js");
var _CloseButton2 = _interopRequireDefault(_CloseButton);
var _constants = __webpack_require__(/*! ../constants */ "./node_modules/react-dates/lib/constants.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;
}
var propTypes = (0, _airbnbPropTypes.forbidExtraProps)((0, _object2['default'])({}, _reactWithStyles.withStylesPropTypes, _DateRangePickerShape2['default']));
var defaultProps = {
// required props for a functional interactive DateRangePicker
startDate: null,
endDate: null,
focusedInput: null,
// input related props
startDatePlaceholderText: 'Start Date',
endDatePlaceholderText: 'End Date',
disabled: false,
required: false,
readOnly: false,
screenReaderInputMessage: '',
showClearDates: false,
showDefaultInputIcon: false,
inputIconPosition: _constants.ICON_BEFORE_POSITION,
customInputIcon: null,
customArrowIcon: null,
customCloseIcon: null,
noBorder: false,
block: false,
small: false,
regular: false,
keepFocusOnInput: false,
// calendar presentation and interaction related props
renderMonthText: null,
orientation: _constants.HORIZONTAL_ORIENTATION,
anchorDirection: _constants.ANCHOR_LEFT,
openDirection: _constants.OPEN_DOWN,
horizontalMargin: 0,
withPortal: false,
withFullScreenPortal: false,
appendToBody: false,
disableScroll: false,
initialVisibleMonth: null,
numberOfMonths: 2,
keepOpenOnDateSelect: false,
reopenPickerOnClearDates: false,
renderCalendarInfo: null,
calendarInfoPosition: _constants.INFO_POSITION_BOTTOM,
hideKeyboardShortcutsPanel: false,
daySize: _constants.DAY_SIZE,
isRTL: false,
firstDayOfWeek: null,
verticalHeight: null,
transitionDuration: undefined,
verticalSpacing: _constants.DEFAULT_VERTICAL_SPACING,
// navigation related props
navPrev: null,
navNext: null,
onPrevMonthClick: function () {
function onPrevMonthClick() {}
return onPrevMonthClick;
}(),
onNextMonthClick: function () {
function onNextMonthClick() {}
return onNextMonthClick;
}(),
onClose: function () {
function onClose() {}
return onClose;
}(),
// day presentation and interaction related props
renderCalendarDay: undefined,
renderDayContents: null,
renderMonthElement: null,
minimumNights: 1,
enableOutsideDays: false,
isDayBlocked: function () {
function isDayBlocked() {
return false;
}
return isDayBlocked;
}(),
isOutsideRange: function () {
function isOutsideRange(day) {
return !(0, _isInclusivelyAfterDay2['default'])(day, (0, _moment2['default'])());
}
return isOutsideRange;
}(),
isDayHighlighted: function () {
function isDayHighlighted() {
return false;
}
return isDayHighlighted;
}(),
// internationalization
displayFormat: function () {
function displayFormat() {
return _moment2['default'].localeData().longDateFormat('L');
}
return displayFormat;
}(),
monthFormat: 'MMMM YYYY',
weekDayFormat: 'dd',
phrases: _defaultPhrases.DateRangePickerPhrases,
dayAriaLabelFormat: undefined
};
var DateRangePicker = function (_React$Component) {
_inherits(DateRangePicker, _React$Component);
function DateRangePicker(props) {
_classCallCheck(this, DateRangePicker);
var _this = _possibleConstructorReturn(this, (DateRangePicker.__proto__ || Object.getPrototypeOf(DateRangePicker)).call(this, props));
_this.state = {
dayPickerContainerStyles: {},
isDateRangePickerInputFocused: false,
isDayPickerFocused: false,
showKeyboardShortcuts: false
};
_this.isTouchDevice = false;
_this.onOutsideClick = _this.onOutsideClick.bind(_this);
_this.onDateRangePickerInputFocus = _this.onDateRangePickerInputFocus.bind(_this);
_this.onDayPickerFocus = _this.onDayPickerFocus.bind(_this);
_this.onDayPickerBlur = _this.onDayPickerBlur.bind(_this);
_this.showKeyboardShortcutsPanel = _this.showKeyboardShortcutsPanel.bind(_this);
_this.responsivizePickerPosition = _this.responsivizePickerPosition.bind(_this);
_this.disableScroll = _this.disableScroll.bind(_this);
_this.setDayPickerContainerRef = _this.setDayPickerContainerRef.bind(_this);
_this.setContainerRef = _this.setContainerRef.bind(_this);
return _this;
}
_createClass(DateRangePicker, [{
key: 'componentDidMount',
value: function () {
function componentDidMount() {
this.removeEventListener = (0, _consolidatedEvents.addEventListener)(window, 'resize', this.responsivizePickerPosition, {
passive: true
});
this.responsivizePickerPosition();
this.disableScroll();
var focusedInput = this.props.focusedInput;
if (focusedInput) {
this.setState({
isDateRangePickerInputFocused: true
});
}
this.isTouchDevice = (0, _isTouchDevice2['default'])();
}
return componentDidMount;
}()
}, {
key: 'shouldComponentUpdate',
value: function () {
function shouldComponentUpdate(nextProps, nextState) {
return (0, _reactAddonsShallowCompare2['default'])(this, nextProps, nextState);
}
return shouldComponentUpdate;
}()
}, {
key: 'componentDidUpdate',
value: function () {
function componentDidUpdate(prevProps) {
var focusedInput = this.props.focusedInput;
if (!prevProps.focusedInput && focusedInput && this.isOpened()) {
// The date picker just changed from being closed to being open.
this.responsivizePickerPosition();
this.disableScroll();
} else if (prevProps.focusedInput && !focusedInput && !this.isOpened()) {
// The date picker just changed from being open to being closed.
if (this.enableScroll) this.enableScroll();
}
}
return componentDidUpdate;
}()
}, {
key: 'componentWillUnmount',
value: function () {
function componentWillUnmount() {
if (this.removeEventListener) this.removeEventListener();
if (this.enableScroll) this.enableScroll();
}
return componentWillUnmount;
}()
}, {
key: 'onOutsideClick',
value: function () {
function onOutsideClick(event) {
var _props = this.props,
onFocusChange = _props.onFocusChange,
onClose = _props.onClose,
startDate = _props.startDate,
endDate = _props.endDate,
appendToBody = _props.appendToBody;
if (!this.isOpened()) return;
if (appendToBody && this.dayPickerContainer.contains(event.target)) return;
this.setState({
isDateRangePickerInputFocused: false,
isDayPickerFocused: false,
showKeyboardShortcuts: false
});
onFocusChange(null);
onClose({
startDate: startDate,
endDate: endDate
});
}
return onOutsideClick;
}()
}, {
key: 'onDateRangePickerInputFocus',
value: function () {
function onDateRangePickerInputFocus(focusedInput) {
var _props2 = this.props,
onFocusChange = _props2.onFocusChange,
readOnly = _props2.readOnly,
withPortal = _props2.withPortal,
withFullScreenPortal = _props2.withFullScreenPortal,
keepFocusOnInput = _props2.keepFocusOnInput;
if (focusedInput) {
var withAnyPortal = withPortal || withFullScreenPortal;
var moveFocusToDayPicker = withAnyPortal || readOnly && !keepFocusOnInput || this.isTouchDevice && !keepFocusOnInput;
if (moveFocusToDayPicker) {
this.onDayPickerFocus();
} else {
this.onDayPickerBlur();
}
}
onFocusChange(focusedInput);
}
return onDateRangePickerInputFocus;
}()
}, {
key: 'onDayPickerFocus',
value: function () {
function onDayPickerFocus() {
var _props3 = this.props,
focusedInput = _props3.focusedInput,
onFocusChange = _props3.onFocusChange;
if (!focusedInput) onFocusChange(_constants.START_DATE);
this.setState({
isDateRangePickerInputFocused: false,
isDayPickerFocused: true,
showKeyboardShortcuts: false
});
}
return onDayPickerFocus;
}()
}, {
key: 'onDayPickerBlur',
value: function () {
function onDayPickerBlur() {
this.setState({
isDateRangePickerInputFocused: true,
isDayPickerFocused: false,
showKeyboardShortcuts: false
});
}
return onDayPickerBlur;
}()
}, {
key: 'setDayPickerContainerRef',
value: function () {
function setDayPickerContainerRef(ref) {
this.dayPickerContainer = ref;
}
return setDayPickerContainerRef;
}()
}, {
key: 'setContainerRef',
value: function () {
function setContainerRef(ref) {
this.container = ref;
}
return setContainerRef;
}()
}, {
key: 'isOpened',
value: function () {
function isOpened() {
var focusedInput = this.props.focusedInput;
return focusedInput === _constants.START_DATE || focusedInput === _constants.END_DATE;
}
return isOpened;
}()
}, {
key: 'disableScroll',
value: function () {
function disableScroll() {
var _props4 = this.props,
appendToBody = _props4.appendToBody,
propDisableScroll = _props4.disableScroll;
if (!appendToBody && !propDisableScroll) return;
if (!this.isOpened()) return; // Disable scroll for every ancestor of this DateRangePicker up to the
// document level. This ensures the input and the picker never move. Other
// sibling elements or the picker itself can scroll.
this.enableScroll = (0, _disableScroll3['default'])(this.container);
}
return disableScroll;
}()
}, {
key: 'responsivizePickerPosition',
value: function () {
function responsivizePickerPosition() {
// It's possible the portal props have been changed in response to window resizes
// So let's ensure we reset this back to the base state each time
this.setState({
dayPickerContainerStyles: {}
});
if (!this.isOpened()) {
return;
}
var _props5 = this.props,
openDirection = _props5.openDirection,
anchorDirection = _props5.anchorDirection,
horizontalMargin = _props5.horizontalMargin,
withPortal = _props5.withPortal,
withFullScreenPortal = _props5.withFullScreenPortal,
appendToBody = _props5.appendToBody;
var dayPickerContainerStyles = this.state.dayPickerContainerStyles;
var isAnchoredLeft = anchorDirection === _constants.ANCHOR_LEFT;
if (!withPortal && !withFullScreenPortal) {
var containerRect = this.dayPickerContainer.getBoundingClientRect();
var currentOffset = dayPickerContainerStyles[anchorDirection] || 0;
var containerEdge = isAnchoredLeft ? containerRect[_constants.ANCHOR_RIGHT] : containerRect[_constants.ANCHOR_LEFT];
this.setState({
dayPickerContainerStyles: (0, _object2['default'])({}, (0, _getResponsiveContainerStyles2['default'])(anchorDirection, currentOffset, containerEdge, horizontalMargin), appendToBody && (0, _getDetachedContainerStyles2['default'])(openDirection, anchorDirection, this.container))
});
}
}
return responsivizePickerPosition;
}()
}, {
key: 'showKeyboardShortcutsPanel',
value: function () {
function showKeyboardShortcutsPanel() {
this.setState({
isDateRangePickerInputFocused: false,
isDayPickerFocused: true,
showKeyboardShortcuts: true
});
}
return showKeyboardShortcutsPanel;
}()
}, {
key: 'maybeRenderDayPickerWithPortal',
value: function () {
function maybeRenderDayPickerWithPortal() {
var _props6 = this.props,
withPortal = _props6.withPortal,
withFullScreenPortal = _props6.withFullScreenPortal,
appendToBody = _props6.appendToBody;
if (!this.isOpened()) {
return null;
}
if (withPortal || withFullScreenPortal || appendToBody) {
return _react2['default'].createElement(_reactPortal.Portal, null, this.renderDayPicker());
}
return this.renderDayPicker();
}
return maybeRenderDayPickerWithPortal;
}()
}, {
key: 'renderDayPicker',
value: function () {
function renderDayPicker() {
var _props7 = this.props,
anchorDirection = _props7.anchorDirection,
openDirection = _props7.openDirection,
isDayBlocked = _props7.isDayBlocked,
isDayHighlighted = _props7.isDayHighlighted,
isOutsideRange = _props7.isOutsideRange,
numberOfMonths = _props7.numberOfMonths,
orientation = _props7.orientation,
monthFormat = _props7.monthFormat,
renderMonthText = _props7.renderMonthText,
navPrev = _props7.navPrev,
navNext = _props7.navNext,
onPrevMonthClick = _props7.onPrevMonthClick,
onNextMonthClick = _props7.onNextMonthClick,
onDatesChange = _props7.onDatesChange,
onFocusChange = _props7.onFocusChange,
withPortal = _props7.withPortal,
withFullScreenPortal = _props7.withFullScreenPortal,
daySize = _props7.daySize,
enableOutsideDays = _props7.enableOutsideDays,
focusedInput = _props7.focusedInput,
startDate = _props7.startDate,
endDate = _props7.endDate,
minimumNights = _props7.minimumNights,
keepOpenOnDateSelect = _props7.keepOpenOnDateSelect,
renderCalendarDay = _props7.renderCalendarDay,
renderDayContents = _props7.renderDayContents,
renderCalendarInfo = _props7.renderCalendarInfo,
renderMonthElement = _props7.renderMonthElement,
calendarInfoPosition = _props7.calendarInfoPosition,
firstDayOfWeek = _props7.firstDayOfWeek,
initialVisibleMonth = _props7.initialVisibleMonth,
hideKeyboardShortcutsPanel = _props7.hideKeyboardShortcutsPanel,
customCloseIcon = _props7.customCloseIcon,
onClose = _props7.onClose,
phrases = _props7.phrases,
dayAriaLabelFormat = _props7.dayAriaLabelFormat,
isRTL = _props7.isRTL,
weekDayFormat = _props7.weekDayFormat,
styles = _props7.styles,
verticalHeight = _props7.verticalHeight,
transitionDuration = _props7.transitionDuration,
verticalSpacing = _props7.verticalSpacing,
small = _props7.small,
disabled = _props7.disabled,
reactDates = _props7.theme.reactDates;
var _state = this.state,
dayPickerContainerStyles = _state.dayPickerContainerStyles,
isDayPickerFocused = _state.isDayPickerFocused,
showKeyboardShortcuts = _state.showKeyboardShortcuts;
var onOutsideClick = !withFullScreenPortal && withPortal ? this.onOutsideClick : undefined;
var initialVisibleMonthThunk = initialVisibleMonth || function () {
return startDate || endDate || (0, _moment2['default'])();
};
var closeIcon = customCloseIcon || _react2['default'].createElement(_CloseButton2['default'], (0, _reactWithStyles.css)(styles.DateRangePicker_closeButton_svg));
var inputHeight = (0, _getInputHeight2['default'])(reactDates, small);
var withAnyPortal = withPortal || withFullScreenPortal;
return _react2['default'].createElement('div', _extends({
// eslint-disable-line jsx-a11y/no-static-element-interactions
ref: this.setDayPickerContainerRef
}, (0, _reactWithStyles.css)(styles.DateRangePicker_picker, anchorDirection === _constants.ANCHOR_LEFT && styles.DateRangePicker_picker__directionLeft, anchorDirection === _constants.ANCHOR_RIGHT && styles.DateRangePicker_picker__directionRight, orientation === _constants.HORIZONTAL_ORIENTATION && styles.DateRangePicker_picker__horizontal, orientation === _constants.VERTICAL_ORIENTATION && styles.DateRangePicker_picker__vertical, !withAnyPortal && openDirection === _constants.OPEN_DOWN && {
top: inputHeight + verticalSpacing
}, !withAnyPortal && openDirection === _constants.OPEN_UP && {
bottom: inputHeight + verticalSpacing
}, withAnyPortal && styles.DateRangePicker_picker__portal, withFullScreenPortal && styles.DateRangePicker_picker__fullScreenPortal, isRTL && styles.DateRangePicker_picker__rtl, dayPickerContainerStyles), {
onClick: onOutsideClick
}), _react2['default'].createElement(_DayPickerRangeController2['default'], {
orientation: orientation,
enableOutsideDays: enableOutsideDays,
numberOfMonths: numberOfMonths,
onPrevMonthClick: onPrevMonthClick,
onNextMonthClick: onNextMonthClick,
onDatesChange: onDatesChange,
onFocusChange: onFocusChange,
onClose: onClose,
focusedInput: focusedInput,
startDate: startDate,
endDate: endDate,
monthFormat: monthFormat,
renderMonthText: renderMonthText,
withPortal: withAnyPortal,
daySize: daySize,
initialVisibleMonth: initialVisibleMonthThunk,
hideKeyboardShortcutsPanel: hideKeyboardShortcutsPanel,
navPrev: navPrev,
navNext: navNext,
minimumNights: minimumNights,
isOutsideRange: isOutsideRange,
isDayHighlighted: isDayHighlighted,
isDayBlocked: isDayBlocked,
keepOpenOnDateSelect: keepOpenOnDateSelect,
renderCalendarDay: renderCalendarDay,
renderDayContents: renderDayContents,
renderCalendarInfo: renderCalendarInfo,
renderMonthElement: renderMonthElement,
calendarInfoPosition: calendarInfoPosition,
isFocused: isDayPickerFocused,
showKeyboardShortcuts: showKeyboardShortcuts,
onBlur: this.onDayPickerBlur,
phrases: phrases,
dayAriaLabelFormat: dayAriaLabelFormat,
isRTL: isRTL,
firstDayOfWeek: firstDayOfWeek,
weekDayFormat: weekDayFormat,
verticalHeight: verticalHeight,
transitionDuration: transitionDuration,
disabled: disabled
}), withFullScreenPortal && _react2['default'].createElement('button', _extends({}, (0, _reactWithStyles.css)(styles.DateRangePicker_closeButton), {
type: 'button',
onClick: this.onOutsideClick,
'aria-label': phrases.closeDatePicker
}), closeIcon));
}
return renderDayPicker;
}()
}, {
key: 'render',
value: function () {
function render() {
var _props8 = this.props,
startDate = _props8.startDate,
startDateId = _props8.startDateId,
startDatePlaceholderText = _props8.startDatePlaceholderText,
endDate = _props8.endDate,
endDateId = _props8.endDateId,
endDatePlaceholderText = _props8.endDatePlaceholderText,
focusedInput = _props8.focusedInput,
screenReaderInputMessage = _props8.screenReaderInputMessage,
showClearDates = _props8.showClearDates,
showDefaultInputIcon = _props8.showDefaultInputIcon,
inputIconPosition = _props8.inputIconPosition,
customInputIcon = _props8.customInputIcon,
customArrowIcon = _props8.customArrowIcon,
customCloseIcon = _props8.customCloseIcon,
disabled = _props8.disabled,
required = _props8.required,
readOnly = _props8.readOnly,
openDirection = _props8.openDirection,
phrases = _props8.phrases,
isOutsideRange = _props8.isOutsideRange,
minimumNights = _props8.minimumNights,
withPortal = _props8.withPortal,
withFullScreenPortal = _props8.withFullScreenPortal,
displayFormat = _props8.displayFormat,
reopenPickerOnClearDates = _props8.reopenPickerOnClearDates,
keepOpenOnDateSelect = _props8.keepOpenOnDateSelect,
onDatesChange = _props8.onDatesChange,
onClose = _props8.onClose,
isRTL = _props8.isRTL,
noBorder = _props8.noBorder,
block = _props8.block,
verticalSpacing = _props8.verticalSpacing,
small = _props8.small,
regular = _props8.regular,
styles = _props8.styles;
var isDateRangePickerInputFocused = this.state.isDateRangePickerInputFocused;
var enableOutsideClick = !withPortal && !withFullScreenPortal;
var hideFang = verticalSpacing < _constants.FANG_HEIGHT_PX;
var input = _react2['default'].createElement(_DateRangePickerInputController2['default'], {
startDate: startDate,
startDateId: startDateId,
startDatePlaceholderText: startDatePlaceholderText,
isStartDateFocused: focusedInput === _constants.START_DATE,
endDate: endDate,
endDateId: endDateId,
endDatePlaceholderText: endDatePlaceholderText,
isEndDateFocused: focusedInput === _constants.END_DATE,
displayFormat: displayFormat,
showClearDates: showClearDates,
showCaret: !withPortal && !withFullScreenPortal && !hideFang,
showDefaultInputIcon: showDefaultInputIcon,
inputIconPosition: inputIconPosition,
customInputIcon: customInputIcon,
customArrowIcon: customArrowIcon,
customCloseIcon: customCloseIcon,
disabled: disabled,
required: required,
readOnly: readOnly,
openDirection: openDirection,
reopenPickerOnClearDates: reopenPickerOnClearDates,
keepOpenOnDateSelect: keepOpenOnDateSelect,
isOutsideRange: isOutsideRange,
minimumNights: minimumNights,
withFullScreenPortal: withFullScreenPortal,
onDatesChange: onDatesChange,
onFocusChange: this.onDateRangePickerInputFocus,
onKeyDownArrowDown: this.onDayPickerFocus,
onKeyDownQuestionMark: this.showKeyboardShortcutsPanel,
onClose: onClose,
phrases: phrases,
screenReaderMessage: screenReaderInputMessage,
isFocused: isDateRangePickerInputFocused,
isRTL: isRTL,
noBorder: noBorder,
block: block,
small: small,
regular: regular,
verticalSpacing: verticalSpacing
});
return _react2['default'].createElement('div', _extends({
ref: this.setContainerRef
}, (0, _reactWithStyles.css)(styles.DateRangePicker, block && styles.DateRangePicker__block)), enableOutsideClick && _react2['default'].createElement(_reactOutsideClickHandler2['default'], {
onOutsideClick: this.onOutsideClick
}, input, this.maybeRenderDayPickerWithPortal()), !enableOutsideClick && input, !enableOutsideClick && this.maybeRenderDayPickerWithPortal());
}
return render;
}()
}]);
return DateRangePicker;
}(_react2['default'].Component);
DateRangePicker.propTypes = propTypes;
DateRangePicker.defaultProps = defaultProps;
exports.PureDateRangePicker = DateRangePicker;
exports['default'] = (0, _reactWithStyles.withStyles)(function (_ref) {
var _ref$reactDates = _ref.reactDates,
color = _ref$reactDates.color,
zIndex = _ref$reactDates.zIndex;
return {
DateRangePicker: {
position: 'relative',
display: 'inline-block'
},
DateRangePicker__block: {
display: 'block'
},
DateRangePicker_picker: {
zIndex: zIndex + 1,
backgroundColor: color.background,
position: 'absolute'
},
DateRangePicker_picker__rtl: {
direction: 'rtl'
},
DateRangePicker_picker__directionLeft: {
left: 0
},
DateRangePicker_picker__directionRight: {
right: 0
},
DateRangePicker_picker__portal: {
backgroundColor: 'rgba(0, 0, 0, 0.3)',
position: 'fixed',
top: 0,
left: 0,
height: '100%',
width: '100%'
},
DateRangePicker_picker__fullScreenPortal: {
backgroundColor: color.background
},
DateRangePicker_closeButton: {
background: 'none',
border: 0,
color: 'inherit',
font: 'inherit',
lineHeight: 'normal',
overflow: 'visible',
cursor: 'pointer',
position: 'absolute',
top: 0,
right: 0,
padding: 15,
zIndex: zIndex + 2,
':hover': {
color: 'darken(' + String(color.core.grayLighter) + ', 10%)',
textDecoration: 'none'
},
':focus': {
color: 'darken(' + String(color.core.grayLighter) + ', 10%)',
textDecoration: 'none'
}
},
DateRangePicker_closeButton_svg: {
height: 15,
width: 15,
fill: color.core.grayLighter
}
};
})(DateRangePicker);
/***/ }),
/***/ "./node_modules/react-dates/lib/components/DateRangePickerInput.js":
/*!*************************************************************************!*\
!*** ./node_modules/react-dates/lib/components/DateRangePickerInput.js ***!
\*************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
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 _object = __webpack_require__(/*! object.assign */ "./node_modules/object.assign/index.js");
var _object2 = _interopRequireDefault(_object);
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 _airbnbPropTypes = __webpack_require__(/*! airbnb-prop-types */ "./node_modules/airbnb-prop-types/index.js");
var _reactWithStyles = __webpack_require__(/*! react-with-styles */ "./node_modules/react-with-styles/lib/withStyles.js");
var _defaultPhrases = __webpack_require__(/*! ../defaultPhrases */ "./node_modules/react-dates/lib/defaultPhrases.js");
var _getPhrasePropTypes = __webpack_require__(/*! ../utils/getPhrasePropTypes */ "./node_modules/react-dates/lib/utils/getPhrasePropTypes.js");
var _getPhrasePropTypes2 = _interopRequireDefault(_getPhrasePropTypes);
var _OpenDirectionShape = __webpack_require__(/*! ../shapes/OpenDirectionShape */ "./node_modules/react-dates/lib/shapes/OpenDirectionShape.js");
var _OpenDirectionShape2 = _interopRequireDefault(_OpenDirectionShape);
var _DateInput = __webpack_require__(/*! ./DateInput */ "./node_modules/react-dates/lib/components/DateInput.js");
var _DateInput2 = _interopRequireDefault(_DateInput);
var _IconPositionShape = __webpack_require__(/*! ../shapes/IconPositionShape */ "./node_modules/react-dates/lib/shapes/IconPositionShape.js");
var _IconPositionShape2 = _interopRequireDefault(_IconPositionShape);
var _DisabledShape = __webpack_require__(/*! ../shapes/DisabledShape */ "./node_modules/react-dates/lib/shapes/DisabledShape.js");
var _DisabledShape2 = _interopRequireDefault(_DisabledShape);
var _RightArrow = __webpack_require__(/*! ./RightArrow */ "./node_modules/react-dates/lib/components/RightArrow.js");
var _RightArrow2 = _interopRequireDefault(_RightArrow);
var _LeftArrow = __webpack_require__(/*! ./LeftArrow */ "./node_modules/react-dates/lib/components/LeftArrow.js");
var _LeftArrow2 = _interopRequireDefault(_LeftArrow);
var _CloseButton = __webpack_require__(/*! ./CloseButton */ "./node_modules/react-dates/lib/components/CloseButton.js");
var _CloseButton2 = _interopRequireDefault(_CloseButton);
var _CalendarIcon = __webpack_require__(/*! ./CalendarIcon */ "./node_modules/react-dates/lib/components/CalendarIcon.js");
var _CalendarIcon2 = _interopRequireDefault(_CalendarIcon);
var _constants = __webpack_require__(/*! ../constants */ "./node_modules/react-dates/lib/constants.js");
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
'default': obj
};
}
var propTypes = (0, _airbnbPropTypes.forbidExtraProps)((0, _object2['default'])({}, _reactWithStyles.withStylesPropTypes, {
startDateId: _propTypes2['default'].string,
startDatePlaceholderText: _propTypes2['default'].string,
screenReaderMessage: _propTypes2['default'].string,
endDateId: _propTypes2['default'].string,
endDatePlaceholderText: _propTypes2['default'].string,
onStartDateFocus: _propTypes2['default'].func,
onEndDateFocus: _propTypes2['default'].func,
onStartDateChange: _propTypes2['default'].func,
onEndDateChange: _propTypes2['default'].func,
onStartDateShiftTab: _propTypes2['default'].func,
onEndDateTab: _propTypes2['default'].func,
onClearDates: _propTypes2['default'].func,
onKeyDownArrowDown: _propTypes2['default'].func,
onKeyDownQuestionMark: _propTypes2['default'].func,
startDate: _propTypes2['default'].string,
endDate: _propTypes2['default'].string,
isStartDateFocused: _propTypes2['default'].bool,
isEndDateFocused: _propTypes2['default'].bool,
showClearDates: _propTypes2['default'].bool,
disabled: _DisabledShape2['default'],
required: _propTypes2['default'].bool,
readOnly: _propTypes2['default'].bool,
openDirection: _OpenDirectionShape2['default'],
showCaret: _propTypes2['default'].bool,
showDefaultInputIcon: _propTypes2['default'].bool,
inputIconPosition: _IconPositionShape2['default'],
customInputIcon: _propTypes2['default'].node,
customArrowIcon: _propTypes2['default'].node,
customCloseIcon: _propTypes2['default'].node,
noBorder: _propTypes2['default'].bool,
block: _propTypes2['default'].bool,
small: _propTypes2['default'].bool,
regular: _propTypes2['default'].bool,
verticalSpacing: _airbnbPropTypes.nonNegativeInteger,
// accessibility
isFocused: _propTypes2['default'].bool,
// describes actual DOM focus
// i18n
phrases: _propTypes2['default'].shape((0, _getPhrasePropTypes2['default'])(_defaultPhrases.DateRangePickerInputPhrases)),
isRTL: _propTypes2['default'].bool
}));
var defaultProps = {
startDateId: _constants.START_DATE,
endDateId: _constants.END_DATE,
startDatePlaceholderText: 'Start Date',
endDatePlaceholderText: 'End Date',
screenReaderMessage: '',
onStartDateFocus: function () {
function onStartDateFocus() {}
return onStartDateFocus;
}(),
onEndDateFocus: function () {
function onEndDateFocus() {}
return onEndDateFocus;
}(),
onStartDateChange: function () {
function onStartDateChange() {}
return onStartDateChange;
}(),
onEndDateChange: function () {
function onEndDateChange() {}
return onEndDateChange;
}(),
onStartDateShiftTab: function () {
function onStartDateShiftTab() {}
return onStartDateShiftTab;
}(),
onEndDateTab: function () {
function onEndDateTab() {}
return onEndDateTab;
}(),
onClearDates: function () {
function onClearDates() {}
return onClearDates;
}(),
onKeyDownArrowDown: function () {
function onKeyDownArrowDown() {}
return onKeyDownArrowDown;
}(),
onKeyDownQuestionMark: function () {
function onKeyDownQuestionMark() {}
return onKeyDownQuestionMark;
}(),
startDate: '',
endDate: '',
isStartDateFocused: false,
isEndDateFocused: false,
showClearDates: false,
disabled: false,
required: false,
readOnly: false,
openDirection: _constants.OPEN_DOWN,
showCaret: false,
showDefaultInputIcon: false,
inputIconPosition: _constants.ICON_BEFORE_POSITION,
customInputIcon: null,
customArrowIcon: null,
customCloseIcon: null,
noBorder: false,
block: false,
small: false,
regular: false,
verticalSpacing: undefined,
// accessibility
isFocused: false,
// i18n
phrases: _defaultPhrases.DateRangePickerInputPhrases,
isRTL: false
};
function DateRangePickerInput(_ref) {
var startDate = _ref.startDate,
startDateId = _ref.startDateId,
startDatePlaceholderText = _ref.startDatePlaceholderText,
screenReaderMessage = _ref.screenReaderMessage,
isStartDateFocused = _ref.isStartDateFocused,
onStartDateChange = _ref.onStartDateChange,
onStartDateFocus = _ref.onStartDateFocus,
onStartDateShiftTab = _ref.onStartDateShiftTab,
endDate = _ref.endDate,
endDateId = _ref.endDateId,
endDatePlaceholderText = _ref.endDatePlaceholderText,
isEndDateFocused = _ref.isEndDateFocused,
onEndDateChange = _ref.onEndDateChange,
onEndDateFocus = _ref.onEndDateFocus,
onEndDateTab = _ref.onEndDateTab,
onKeyDownArrowDown = _ref.onKeyDownArrowDown,
onKeyDownQuestionMark = _ref.onKeyDownQuestionMark,
onClearDates = _ref.onClearDates,
showClearDates = _ref.showClearDates,
disabled = _ref.disabled,
required = _ref.required,
readOnly = _ref.readOnly,
showCaret = _ref.showCaret,
openDirection = _ref.openDirection,
showDefaultInputIcon = _ref.showDefaultInputIcon,
inputIconPosition = _ref.inputIconPosition,
customInputIcon = _ref.customInputIcon,
customArrowIcon = _ref.customArrowIcon,
customCloseIcon = _ref.customCloseIcon,
isFocused = _ref.isFocused,
phrases = _ref.phrases,
isRTL = _ref.isRTL,
noBorder = _ref.noBorder,
block = _ref.block,
verticalSpacing = _ref.verticalSpacing,
small = _ref.small,
regular = _ref.regular,
styles = _ref.styles;
var calendarIcon = customInputIcon || _react2['default'].createElement(_CalendarIcon2['default'], (0, _reactWithStyles.css)(styles.DateRangePickerInput_calendarIcon_svg));
var arrowIcon = customArrowIcon || _react2['default'].createElement(_RightArrow2['default'], (0, _reactWithStyles.css)(styles.DateRangePickerInput_arrow_svg));
if (isRTL) arrowIcon = _react2['default'].createElement(_LeftArrow2['default'], (0, _reactWithStyles.css)(styles.DateRangePickerInput_arrow_svg));
if (small) arrowIcon = '-';
var closeIcon = customCloseIcon || _react2['default'].createElement(_CloseButton2['default'], (0, _reactWithStyles.css)(styles.DateRangePickerInput_clearDates_svg, small && styles.DateRangePickerInput_clearDates_svg__small));
var screenReaderText = screenReaderMessage || phrases.keyboardNavigationInstructions;
var inputIcon = (showDefaultInputIcon || customInputIcon !== null) && _react2['default'].createElement('button', _extends({}, (0, _reactWithStyles.css)(styles.DateRangePickerInput_calendarIcon), {
type: 'button',
disabled: disabled,
'aria-label': phrases.focusStartDate,
onClick: onKeyDownArrowDown
}), calendarIcon);
var startDateDisabled = disabled === _constants.START_DATE || disabled === true;
var endDateDisabled = disabled === _constants.END_DATE || disabled === true;
return _react2['default'].createElement('div', (0, _reactWithStyles.css)(styles.DateRangePickerInput, disabled && styles.DateRangePickerInput__disabled, isRTL && styles.DateRangePickerInput__rtl, !noBorder && styles.DateRangePickerInput__withBorder, block && styles.DateRangePickerInput__block, showClearDates && styles.DateRangePickerInput__showClearDates), inputIconPosition === _constants.ICON_BEFORE_POSITION && inputIcon, _react2['default'].createElement(_DateInput2['default'], {
id: startDateId,
placeholder: startDatePlaceholderText,
displayValue: startDate,
screenReaderMessage: screenReaderText,
focused: isStartDateFocused,
isFocused: isFocused,
disabled: startDateDisabled,
required: required,
readOnly: readOnly,
showCaret: showCaret,
openDirection: openDirection,
onChange: onStartDateChange,
onFocus: onStartDateFocus,
onKeyDownShiftTab: onStartDateShiftTab,
onKeyDownArrowDown: onKeyDownArrowDown,
onKeyDownQuestionMark: onKeyDownQuestionMark,
verticalSpacing: verticalSpacing,
small: small,
regular: regular
}), _react2['default'].createElement('div', _extends({}, (0, _reactWithStyles.css)(styles.DateRangePickerInput_arrow), {
'aria-hidden': 'true',
role: 'presentation'
}), arrowIcon), _react2['default'].createElement(_DateInput2['default'], {
id: endDateId,
placeholder: endDatePlaceholderText,
displayValue: endDate,
screenReaderMessage: screenReaderText,
focused: isEndDateFocused,
isFocused: isFocused,
disabled: endDateDisabled,
required: required,
readOnly: readOnly,
showCaret: showCaret,
openDirection: openDirection,
onChange: onEndDateChange,
onFocus: onEndDateFocus,
onKeyDownTab: onEndDateTab,
onKeyDownArrowDown: onKeyDownArrowDown,
onKeyDownQuestionMark: onKeyDownQuestionMark,
verticalSpacing: verticalSpacing,
small: small,
regular: regular
}), showClearDates && _react2['default'].createElement('button', _extends({
type: 'button',
'aria-label': phrases.clearDates
}, (0, _reactWithStyles.css)(styles.DateRangePickerInput_clearDates, small && styles.DateRangePickerInput_clearDates__small, !customCloseIcon && styles.DateRangePickerInput_clearDates_default, !(startDate || endDate) && styles.DateRangePickerInput_clearDates__hide), {
onClick: onClearDates,
disabled: disabled
}), closeIcon), inputIconPosition === _constants.ICON_AFTER_POSITION && inputIcon);
}
DateRangePickerInput.propTypes = propTypes;
DateRangePickerInput.defaultProps = defaultProps;
exports['default'] = (0, _reactWithStyles.withStyles)(function (_ref2) {
var _ref2$reactDates = _ref2.reactDates,
border = _ref2$reactDates.border,
color = _ref2$reactDates.color,
sizing = _ref2$reactDates.sizing;
return {
DateRangePickerInput: {
backgroundColor: color.background,
display: 'inline-block'
},
DateRangePickerInput__disabled: {
background: color.disabled
},
DateRangePickerInput__withBorder: {
borderColor: color.border,
borderWidth: border.pickerInput.borderWidth,
borderStyle: border.pickerInput.borderStyle,
borderRadius: border.pickerInput.borderRadius
},
DateRangePickerInput__rtl: {
direction: 'rtl'
},
DateRangePickerInput__block: {
display: 'block'
},
DateRangePickerInput__showClearDates: {
paddingRight: 30
},
DateRangePickerInput_arrow: {
display: 'inline-block',
verticalAlign: 'middle',
color: color.text
},
DateRangePickerInput_arrow_svg: {
verticalAlign: 'middle',
fill: color.text,
height: sizing.arrowWidth,
width: sizing.arrowWidth
},
DateRangePickerInput_clearDates: {
background: 'none',
border: 0,
color: 'inherit',
font: 'inherit',
lineHeight: 'normal',
overflow: 'visible',
cursor: 'pointer',
padding: 10,
margin: '0 10px 0 5px',
position: 'absolute',
right: 0,
top: '50%',
transform: 'translateY(-50%)'
},
DateRangePickerInput_clearDates__small: {
padding: 6
},
DateRangePickerInput_clearDates_default: {
':focus': {
background: color.core.border,
borderRadius: '50%'
},
':hover': {
background: color.core.border,
borderRadius: '50%'
}
},
DateRangePickerInput_clearDates__hide: {
visibility: 'hidden'
},
DateRangePickerInput_clearDates_svg: {
fill: color.core.grayLight,
height: 12,
width: 15,
verticalAlign: 'middle'
},
DateRangePickerInput_clearDates_svg__small: {
height: 9
},
DateRangePickerInput_calendarIcon: {
background: 'none',
border: 0,
color: 'inherit',
font: 'inherit',
lineHeight: 'normal',
overflow: 'visible',
cursor: 'pointer',
display: 'inline-block',
verticalAlign: 'middle',
padding: 10,
margin: '0 5px 0 10px'
},
DateRangePickerInput_calendarIcon_svg: {
fill: color.core.grayLight,
height: 15,
width: 14,
verticalAlign: 'middle'
}
};
})(DateRangePickerInput);
/***/ }),
/***/ "./node_modules/react-dates/lib/components/DateRangePickerInputController.js":
/*!***********************************************************************************!*\
!*** ./node_modules/react-dates/lib/components/DateRangePickerInputController.js ***!
\***********************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
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 _moment = __webpack_require__(/*! moment */ "./node_modules/moment/moment.js");
var _moment2 = _interopRequireDefault(_moment);
var _reactMomentProptypes = __webpack_require__(/*! react-moment-proptypes */ "./node_modules/react-moment-proptypes/src/index.js");
var _reactMomentProptypes2 = _interopRequireDefault(_reactMomentProptypes);
var _airbnbPropTypes = __webpack_require__(/*! airbnb-prop-types */ "./node_modules/airbnb-prop-types/index.js");
var _OpenDirectionShape = __webpack_require__(/*! ../shapes/OpenDirectionShape */ "./node_modules/react-dates/lib/shapes/OpenDirectionShape.js");
var _OpenDirectionShape2 = _interopRequireDefault(_OpenDirectionShape);
var _defaultPhrases = __webpack_require__(/*! ../defaultPhrases */ "./node_modules/react-dates/lib/defaultPhrases.js");
var _getPhrasePropTypes = __webpack_require__(/*! ../utils/getPhrasePropTypes */ "./node_modules/react-dates/lib/utils/getPhrasePropTypes.js");
var _getPhrasePropTypes2 = _interopRequireDefault(_getPhrasePropTypes);
var _DateRangePickerInput = __webpack_require__(/*! ./DateRangePickerInput */ "./node_modules/react-dates/lib/components/DateRangePickerInput.js");
var _DateRangePickerInput2 = _interopRequireDefault(_DateRangePickerInput);
var _IconPositionShape = __webpack_require__(/*! ../shapes/IconPositionShape */ "./node_modules/react-dates/lib/shapes/IconPositionShape.js");
var _IconPositionShape2 = _interopRequireDefault(_IconPositionShape);
var _DisabledShape = __webpack_require__(/*! ../shapes/DisabledShape */ "./node_modules/react-dates/lib/shapes/DisabledShape.js");
var _DisabledShape2 = _interopRequireDefault(_DisabledShape);
var _toMomentObject = __webpack_require__(/*! ../utils/toMomentObject */ "./node_modules/react-dates/lib/utils/toMomentObject.js");
var _toMomentObject2 = _interopRequireDefault(_toMomentObject);
var _toLocalizedDateString = __webpack_require__(/*! ../utils/toLocalizedDateString */ "./node_modules/react-dates/lib/utils/toLocalizedDateString.js");
var _toLocalizedDateString2 = _interopRequireDefault(_toLocalizedDateString);
var _isInclusivelyAfterDay = __webpack_require__(/*! ../utils/isInclusivelyAfterDay */ "./node_modules/react-dates/lib/utils/isInclusivelyAfterDay.js");
var _isInclusivelyAfterDay2 = _interopRequireDefault(_isInclusivelyAfterDay);
var _isBeforeDay = __webpack_require__(/*! ../utils/isBeforeDay */ "./node_modules/react-dates/lib/utils/isBeforeDay.js");
var _isBeforeDay2 = _interopRequireDefault(_isBeforeDay);
var _constants = __webpack_require__(/*! ../constants */ "./node_modules/react-dates/lib/constants.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;
}
var propTypes = (0, _airbnbPropTypes.forbidExtraProps)({
startDate: _reactMomentProptypes2['default'].momentObj,
startDateId: _propTypes2['default'].string,
startDatePlaceholderText: _propTypes2['default'].string,
isStartDateFocused: _propTypes2['default'].bool,
endDate: _reactMomentProptypes2['default'].momentObj,
endDateId: _propTypes2['default'].string,
endDatePlaceholderText: _propTypes2['default'].string,
isEndDateFocused: _propTypes2['default'].bool,
screenReaderMessage: _propTypes2['default'].string,
showClearDates: _propTypes2['default'].bool,
showCaret: _propTypes2['default'].bool,
showDefaultInputIcon: _propTypes2['default'].bool,
inputIconPosition: _IconPositionShape2['default'],
disabled: _DisabledShape2['default'],
required: _propTypes2['default'].bool,
readOnly: _propTypes2['default'].bool,
openDirection: _OpenDirectionShape2['default'],
noBorder: _propTypes2['default'].bool,
block: _propTypes2['default'].bool,
small: _propTypes2['default'].bool,
regular: _propTypes2['default'].bool,
verticalSpacing: _airbnbPropTypes.nonNegativeInteger,
keepOpenOnDateSelect: _propTypes2['default'].bool,
reopenPickerOnClearDates: _propTypes2['default'].bool,
withFullScreenPortal: _propTypes2['default'].bool,
minimumNights: _airbnbPropTypes.nonNegativeInteger,
isOutsideRange: _propTypes2['default'].func,
displayFormat: _propTypes2['default'].oneOfType([_propTypes2['default'].string, _propTypes2['default'].func]),
onFocusChange: _propTypes2['default'].func,
onClose: _propTypes2['default'].func,
onDatesChange: _propTypes2['default'].func,
onKeyDownArrowDown: _propTypes2['default'].func,
onKeyDownQuestionMark: _propTypes2['default'].func,
customInputIcon: _propTypes2['default'].node,
customArrowIcon: _propTypes2['default'].node,
customCloseIcon: _propTypes2['default'].node,
// accessibility
isFocused: _propTypes2['default'].bool,
// i18n
phrases: _propTypes2['default'].shape((0, _getPhrasePropTypes2['default'])(_defaultPhrases.DateRangePickerInputPhrases)),
isRTL: _propTypes2['default'].bool
});
var defaultProps = {
startDate: null,
startDateId: _constants.START_DATE,
startDatePlaceholderText: 'Start Date',
isStartDateFocused: false,
endDate: null,
endDateId: _constants.END_DATE,
endDatePlaceholderText: 'End Date',
isEndDateFocused: false,
screenReaderMessage: '',
showClearDates: false,
showCaret: false,
showDefaultInputIcon: false,
inputIconPosition: _constants.ICON_BEFORE_POSITION,
disabled: false,
required: false,
readOnly: false,
openDirection: _constants.OPEN_DOWN,
noBorder: false,
block: false,
small: false,
regular: false,
verticalSpacing: undefined,
keepOpenOnDateSelect: false,
reopenPickerOnClearDates: false,
withFullScreenPortal: false,
minimumNights: 1,
isOutsideRange: function () {
function isOutsideRange(day) {
return !(0, _isInclusivelyAfterDay2['default'])(day, (0, _moment2['default'])());
}
return isOutsideRange;
}(),
displayFormat: function () {
function displayFormat() {
return _moment2['default'].localeData().longDateFormat('L');
}
return displayFormat;
}(),
onFocusChange: function () {
function onFocusChange() {}
return onFocusChange;
}(),
onClose: function () {
function onClose() {}
return onClose;
}(),
onDatesChange: function () {
function onDatesChange() {}
return onDatesChange;
}(),
onKeyDownArrowDown: function () {
function onKeyDownArrowDown() {}
return onKeyDownArrowDown;
}(),
onKeyDownQuestionMark: function () {
function onKeyDownQuestionMark() {}
return onKeyDownQuestionMark;
}(),
customInputIcon: null,
customArrowIcon: null,
customCloseIcon: null,
// accessibility
isFocused: false,
// i18n
phrases: _defaultPhrases.DateRangePickerInputPhrases,
isRTL: false
};
var DateRangePickerInputController = function (_React$Component) {
_inherits(DateRangePickerInputController, _React$Component);
function DateRangePickerInputController(props) {
_classCallCheck(this, DateRangePickerInputController);
var _this = _possibleConstructorReturn(this, (DateRangePickerInputController.__proto__ || Object.getPrototypeOf(DateRangePickerInputController)).call(this, props));
_this.onClearFocus = _this.onClearFocus.bind(_this);
_this.onStartDateChange = _this.onStartDateChange.bind(_this);
_this.onStartDateFocus = _this.onStartDateFocus.bind(_this);
_this.onEndDateChange = _this.onEndDateChange.bind(_this);
_this.onEndDateFocus = _this.onEndDateFocus.bind(_this);
_this.clearDates = _this.clearDates.bind(_this);
return _this;
}
_createClass(DateRangePickerInputController, [{
key: 'onClearFocus',
value: function () {
function onClearFocus() {
var _props = this.props,
onFocusChange = _props.onFocusChange,
onClose = _props.onClose,
startDate = _props.startDate,
endDate = _props.endDate;
onFocusChange(null);
onClose({
startDate: startDate,
endDate: endDate
});
}
return onClearFocus;
}()
}, {
key: 'onEndDateChange',
value: function () {
function onEndDateChange(endDateString) {
var _props2 = this.props,
startDate = _props2.startDate,
isOutsideRange = _props2.isOutsideRange,
minimumNights = _props2.minimumNights,
keepOpenOnDateSelect = _props2.keepOpenOnDateSelect,
onDatesChange = _props2.onDatesChange;
var endDate = (0, _toMomentObject2['default'])(endDateString, this.getDisplayFormat());
var isEndDateValid = endDate && !isOutsideRange(endDate) && !(startDate && (0, _isBeforeDay2['default'])(endDate, startDate.clone().add(minimumNights, 'days')));
if (isEndDateValid) {
onDatesChange({
startDate: startDate,
endDate: endDate
});
if (!keepOpenOnDateSelect) this.onClearFocus();
} else {
onDatesChange({
startDate: startDate,
endDate: null
});
}
}
return onEndDateChange;
}()
}, {
key: 'onEndDateFocus',
value: function () {
function onEndDateFocus() {
var _props3 = this.props,
startDate = _props3.startDate,
onFocusChange = _props3.onFocusChange,
withFullScreenPortal = _props3.withFullScreenPortal,
disabled = _props3.disabled;
if (!startDate && withFullScreenPortal && (!disabled || disabled === _constants.END_DATE)) {
// When the datepicker is full screen, we never want to focus the end date first
// because there's no indication that that is the case once the datepicker is open and it
// might confuse the user
onFocusChange(_constants.START_DATE);
} else if (!disabled || disabled === _constants.START_DATE) {
onFocusChange(_constants.END_DATE);
}
}
return onEndDateFocus;
}()
}, {
key: 'onStartDateChange',
value: function () {
function onStartDateChange(startDateString) {
var endDate = this.props.endDate;
var _props4 = this.props,
isOutsideRange = _props4.isOutsideRange,
minimumNights = _props4.minimumNights,
onDatesChange = _props4.onDatesChange,
onFocusChange = _props4.onFocusChange,
disabled = _props4.disabled;
var startDate = (0, _toMomentObject2['default'])(startDateString, this.getDisplayFormat());
var isEndDateBeforeStartDate = startDate && (0, _isBeforeDay2['default'])(endDate, startDate.clone().add(minimumNights, 'days'));
var isStartDateValid = startDate && !isOutsideRange(startDate) && !(disabled === _constants.END_DATE && isEndDateBeforeStartDate);
if (isStartDateValid) {
if (isEndDateBeforeStartDate) {
endDate = null;
}
onDatesChange({
startDate: startDate,
endDate: endDate
});
onFocusChange(_constants.END_DATE);
} else {
onDatesChange({
startDate: null,
endDate: endDate
});
}
}
return onStartDateChange;
}()
}, {
key: 'onStartDateFocus',
value: function () {
function onStartDateFocus() {
var _props5 = this.props,
disabled = _props5.disabled,
onFocusChange = _props5.onFocusChange;
if (!disabled || disabled === _constants.END_DATE) {
onFocusChange(_constants.START_DATE);
}
}
return onStartDateFocus;
}()
}, {
key: 'getDisplayFormat',
value: function () {
function getDisplayFormat() {
var displayFormat = this.props.displayFormat;
return typeof displayFormat === 'string' ? displayFormat : displayFormat();
}
return getDisplayFormat;
}()
}, {
key: 'getDateString',
value: function () {
function getDateString(date) {
var displayFormat = this.getDisplayFormat();
if (date && displayFormat) {
return date && date.format(displayFormat);
}
return (0, _toLocalizedDateString2['default'])(date);
}
return getDateString;
}()
}, {
key: 'clearDates',
value: function () {
function clearDates() {
var _props6 = this.props,
onDatesChange = _props6.onDatesChange,
reopenPickerOnClearDates = _props6.reopenPickerOnClearDates,
onFocusChange = _props6.onFocusChange;
onDatesChange({
startDate: null,
endDate: null
});
if (reopenPickerOnClearDates) {
onFocusChange(_constants.START_DATE);
}
}
return clearDates;
}()
}, {
key: 'render',
value: function () {
function render() {
var _props7 = this.props,
startDate = _props7.startDate,
startDateId = _props7.startDateId,
startDatePlaceholderText = _props7.startDatePlaceholderText,
isStartDateFocused = _props7.isStartDateFocused,
endDate = _props7.endDate,
endDateId = _props7.endDateId,
endDatePlaceholderText = _props7.endDatePlaceholderText,
isEndDateFocused = _props7.isEndDateFocused,
screenReaderMessage = _props7.screenReaderMessage,
showClearDates = _props7.showClearDates,
showCaret = _props7.showCaret,
showDefaultInputIcon = _props7.showDefaultInputIcon,
inputIconPosition = _props7.inputIconPosition,
customInputIcon = _props7.customInputIcon,
customArrowIcon = _props7.customArrowIcon,
customCloseIcon = _props7.customCloseIcon,
disabled = _props7.disabled,
required = _props7.required,
readOnly = _props7.readOnly,
openDirection = _props7.openDirection,
isFocused = _props7.isFocused,
phrases = _props7.phrases,
onKeyDownArrowDown = _props7.onKeyDownArrowDown,
onKeyDownQuestionMark = _props7.onKeyDownQuestionMark,
isRTL = _props7.isRTL,
noBorder = _props7.noBorder,
block = _props7.block,
small = _props7.small,
regular = _props7.regular,
verticalSpacing = _props7.verticalSpacing;
var startDateString = this.getDateString(startDate);
var endDateString = this.getDateString(endDate);
return _react2['default'].createElement(_DateRangePickerInput2['default'], {
startDate: startDateString,
startDateId: startDateId,
startDatePlaceholderText: startDatePlaceholderText,
isStartDateFocused: isStartDateFocused,
endDate: endDateString,
endDateId: endDateId,
endDatePlaceholderText: endDatePlaceholderText,
isEndDateFocused: isEndDateFocused,
isFocused: isFocused,
disabled: disabled,
required: required,
readOnly: readOnly,
openDirection: openDirection,
showCaret: showCaret,
showDefaultInputIcon: showDefaultInputIcon,
inputIconPosition: inputIconPosition,
customInputIcon: customInputIcon,
customArrowIcon: customArrowIcon,
customCloseIcon: customCloseIcon,
phrases: phrases,
onStartDateChange: this.onStartDateChange,
onStartDateFocus: this.onStartDateFocus,
onStartDateShiftTab: this.onClearFocus,
onEndDateChange: this.onEndDateChange,
onEndDateFocus: this.onEndDateFocus,
onEndDateTab: this.onClearFocus,
showClearDates: showClearDates,
onClearDates: this.clearDates,
screenReaderMessage: screenReaderMessage,
onKeyDownArrowDown: onKeyDownArrowDown,
onKeyDownQuestionMark: onKeyDownQuestionMark,
isRTL: isRTL,
noBorder: noBorder,
block: block,
small: small,
regular: regular,
verticalSpacing: verticalSpacing
});
}
return render;
}()
}]);
return DateRangePickerInputController;
}(_react2['default'].Component);
exports['default'] = DateRangePickerInputController;
DateRangePickerInputController.propTypes = propTypes;
DateRangePickerInputController.defaultProps = defaultProps;
/***/ }),
/***/ "./node_modules/react-dates/lib/components/DayPicker.js":
/*!**************************************************************!*\
!*** ./node_modules/react-dates/lib/components/DayPicker.js ***!
\**************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.PureDayPicker = exports.defaultProps = 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 _object = __webpack_require__(/*! object.assign */ "./node_modules/object.assign/index.js");
var _object2 = _interopRequireDefault(_object);
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 _reactAddonsShallowCompare = __webpack_require__(/*! react-addons-shallow-compare */ "./node_modules/react-addons-shallow-compare/index.js");
var _reactAddonsShallowCompare2 = _interopRequireDefault(_reactAddonsShallowCompare);
var _airbnbPropTypes = __webpack_require__(/*! airbnb-prop-types */ "./node_modules/airbnb-prop-types/index.js");
var _reactWithStyles = __webpack_require__(/*! react-with-styles */ "./node_modules/react-with-styles/lib/withStyles.js");
var _moment = __webpack_require__(/*! moment */ "./node_modules/moment/moment.js");
var _moment2 = _interopRequireDefault(_moment);
var _throttle = __webpack_require__(/*! lodash/throttle */ "./node_modules/lodash/throttle.js");
var _throttle2 = _interopRequireDefault(_throttle);
var _isTouchDevice = __webpack_require__(/*! is-touch-device */ "./node_modules/is-touch-device/build/index.js");
var _isTouchDevice2 = _interopRequireDefault(_isTouchDevice);
var _reactOutsideClickHandler = __webpack_require__(/*! react-outside-click-handler */ "./node_modules/react-outside-click-handler/index.js");
var _reactOutsideClickHandler2 = _interopRequireDefault(_reactOutsideClickHandler);
var _defaultPhrases = __webpack_require__(/*! ../defaultPhrases */ "./node_modules/react-dates/lib/defaultPhrases.js");
var _getPhrasePropTypes = __webpack_require__(/*! ../utils/getPhrasePropTypes */ "./node_modules/react-dates/lib/utils/getPhrasePropTypes.js");
var _getPhrasePropTypes2 = _interopRequireDefault(_getPhrasePropTypes);
var _CalendarMonthGrid = __webpack_require__(/*! ./CalendarMonthGrid */ "./node_modules/react-dates/lib/components/CalendarMonthGrid.js");
var _CalendarMonthGrid2 = _interopRequireDefault(_CalendarMonthGrid);
var _DayPickerNavigation = __webpack_require__(/*! ./DayPickerNavigation */ "./node_modules/react-dates/lib/components/DayPickerNavigation.js");
var _DayPickerNavigation2 = _interopRequireDefault(_DayPickerNavigation);
var _DayPickerKeyboardShortcuts = __webpack_require__(/*! ./DayPickerKeyboardShortcuts */ "./node_modules/react-dates/lib/components/DayPickerKeyboardShortcuts.js");
var _DayPickerKeyboardShortcuts2 = _interopRequireDefault(_DayPickerKeyboardShortcuts);
var _getNumberOfCalendarMonthWeeks = __webpack_require__(/*! ../utils/getNumberOfCalendarMonthWeeks */ "./node_modules/react-dates/lib/utils/getNumberOfCalendarMonthWeeks.js");
var _getNumberOfCalendarMonthWeeks2 = _interopRequireDefault(_getNumberOfCalendarMonthWeeks);
var _getCalendarMonthWidth = __webpack_require__(/*! ../utils/getCalendarMonthWidth */ "./node_modules/react-dates/lib/utils/getCalendarMonthWidth.js");
var _getCalendarMonthWidth2 = _interopRequireDefault(_getCalendarMonthWidth);
var _calculateDimension = __webpack_require__(/*! ../utils/calculateDimension */ "./node_modules/react-dates/lib/utils/calculateDimension.js");
var _calculateDimension2 = _interopRequireDefault(_calculateDimension);
var _getActiveElement = __webpack_require__(/*! ../utils/getActiveElement */ "./node_modules/react-dates/lib/utils/getActiveElement.js");
var _getActiveElement2 = _interopRequireDefault(_getActiveElement);
var _isDayVisible = __webpack_require__(/*! ../utils/isDayVisible */ "./node_modules/react-dates/lib/utils/isDayVisible.js");
var _isDayVisible2 = _interopRequireDefault(_isDayVisible);
var _ModifiersShape = __webpack_require__(/*! ../shapes/ModifiersShape */ "./node_modules/react-dates/lib/shapes/ModifiersShape.js");
var _ModifiersShape2 = _interopRequireDefault(_ModifiersShape);
var _ScrollableOrientationShape = __webpack_require__(/*! ../shapes/ScrollableOrientationShape */ "./node_modules/react-dates/lib/shapes/ScrollableOrientationShape.js");
var _ScrollableOrientationShape2 = _interopRequireDefault(_ScrollableOrientationShape);
var _DayOfWeekShape = __webpack_require__(/*! ../shapes/DayOfWeekShape */ "./node_modules/react-dates/lib/shapes/DayOfWeekShape.js");
var _DayOfWeekShape2 = _interopRequireDefault(_DayOfWeekShape);
var _CalendarInfoPositionShape = __webpack_require__(/*! ../shapes/CalendarInfoPositionShape */ "./node_modules/react-dates/lib/shapes/CalendarInfoPositionShape.js");
var _CalendarInfoPositionShape2 = _interopRequireDefault(_CalendarInfoPositionShape);
var _constants = __webpack_require__(/*! ../constants */ "./node_modules/react-dates/lib/constants.js");
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
'default': obj
};
}
function _toConsumableArray(arr) {
if (Array.isArray(arr)) {
for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) {
arr2[i] = arr[i];
}
return arr2;
} else {
return Array.from(arr);
}
}
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 MONTH_PADDING = 23;
var PREV_TRANSITION = 'prev';
var NEXT_TRANSITION = 'next';
var MONTH_SELECTION_TRANSITION = 'month_selection';
var YEAR_SELECTION_TRANSITION = 'year_selection';
var propTypes = (0, _airbnbPropTypes.forbidExtraProps)((0, _object2['default'])({}, _reactWithStyles.withStylesPropTypes, {
// calendar presentation props
enableOutsideDays: _propTypes2['default'].bool,
numberOfMonths: _propTypes2['default'].number,
orientation: _ScrollableOrientationShape2['default'],
withPortal: _propTypes2['default'].bool,
onOutsideClick: _propTypes2['default'].func,
hidden: _propTypes2['default'].bool,
initialVisibleMonth: _propTypes2['default'].func,
firstDayOfWeek: _DayOfWeekShape2['default'],
renderCalendarInfo: _propTypes2['default'].func,
calendarInfoPosition: _CalendarInfoPositionShape2['default'],
hideKeyboardShortcutsPanel: _propTypes2['default'].bool,
daySize: _airbnbPropTypes.nonNegativeInteger,
isRTL: _propTypes2['default'].bool,
verticalHeight: _airbnbPropTypes.nonNegativeInteger,
noBorder: _propTypes2['default'].bool,
transitionDuration: _airbnbPropTypes.nonNegativeInteger,
verticalBorderSpacing: _airbnbPropTypes.nonNegativeInteger,
horizontalMonthPadding: _airbnbPropTypes.nonNegativeInteger,
// navigation props
navPrev: _propTypes2['default'].node,
navNext: _propTypes2['default'].node,
noNavButtons: _propTypes2['default'].bool,
onPrevMonthClick: _propTypes2['default'].func,
onNextMonthClick: _propTypes2['default'].func,
onMonthChange: _propTypes2['default'].func,
onYearChange: _propTypes2['default'].func,
onMultiplyScrollableMonths: _propTypes2['default'].func,
// VERTICAL_SCROLLABLE daypickers only
// month props
renderMonthText: (0, _airbnbPropTypes.mutuallyExclusiveProps)(_propTypes2['default'].func, 'renderMonthText', 'renderMonthElement'),
renderMonthElement: (0, _airbnbPropTypes.mutuallyExclusiveProps)(_propTypes2['default'].func, 'renderMonthText', 'renderMonthElement'),
// day props
modifiers: _propTypes2['default'].objectOf(_propTypes2['default'].objectOf(_ModifiersShape2['default'])),
renderCalendarDay: _propTypes2['default'].func,
renderDayContents: _propTypes2['default'].func,
onDayClick: _propTypes2['default'].func,
onDayMouseEnter: _propTypes2['default'].func,
onDayMouseLeave: _propTypes2['default'].func,
// accessibility props
isFocused: _propTypes2['default'].bool,
getFirstFocusableDay: _propTypes2['default'].func,
onBlur: _propTypes2['default'].func,
showKeyboardShortcuts: _propTypes2['default'].bool,
// internationalization
monthFormat: _propTypes2['default'].string,
weekDayFormat: _propTypes2['default'].string,
phrases: _propTypes2['default'].shape((0, _getPhrasePropTypes2['default'])(_defaultPhrases.DayPickerPhrases)),
dayAriaLabelFormat: _propTypes2['default'].string
}));
var defaultProps = exports.defaultProps = {
// calendar presentation props
enableOutsideDays: false,
numberOfMonths: 2,
orientation: _constants.HORIZONTAL_ORIENTATION,
withPortal: false,
onOutsideClick: function () {
function onOutsideClick() {}
return onOutsideClick;
}(),
hidden: false,
initialVisibleMonth: function () {
function initialVisibleMonth() {
return (0, _moment2['default'])();
}
return initialVisibleMonth;
}(),
firstDayOfWeek: null,
renderCalendarInfo: null,
calendarInfoPosition: _constants.INFO_POSITION_BOTTOM,
hideKeyboardShortcutsPanel: false,
daySize: _constants.DAY_SIZE,
isRTL: false,
verticalHeight: null,
noBorder: false,
transitionDuration: undefined,
verticalBorderSpacing: undefined,
horizontalMonthPadding: 13,
// navigation props
navPrev: null,
navNext: null,
noNavButtons: false,
onPrevMonthClick: function () {
function onPrevMonthClick() {}
return onPrevMonthClick;
}(),
onNextMonthClick: function () {
function onNextMonthClick() {}
return onNextMonthClick;
}(),
onMonthChange: function () {
function onMonthChange() {}
return onMonthChange;
}(),
onYearChange: function () {
function onYearChange() {}
return onYearChange;
}(),
onMultiplyScrollableMonths: function () {
function onMultiplyScrollableMonths() {}
return onMultiplyScrollableMonths;
}(),
// month props
renderMonthText: null,
renderMonthElement: null,
// day props
modifiers: {},
renderCalendarDay: undefined,
renderDayContents: null,
onDayClick: function () {
function onDayClick() {}
return onDayClick;
}(),
onDayMouseEnter: function () {
function onDayMouseEnter() {}
return onDayMouseEnter;
}(),
onDayMouseLeave: function () {
function onDayMouseLeave() {}
return onDayMouseLeave;
}(),
// accessibility props
isFocused: false,
getFirstFocusableDay: null,
onBlur: function () {
function onBlur() {}
return onBlur;
}(),
showKeyboardShortcuts: false,
// internationalization
monthFormat: 'MMMM YYYY',
weekDayFormat: 'dd',
phrases: _defaultPhrases.DayPickerPhrases,
dayAriaLabelFormat: undefined
};
var DayPicker = function (_React$Component) {
_inherits(DayPicker, _React$Component);
function DayPicker(props) {
_classCallCheck(this, DayPicker);
var _this = _possibleConstructorReturn(this, (DayPicker.__proto__ || Object.getPrototypeOf(DayPicker)).call(this, props));
var currentMonth = props.hidden ? (0, _moment2['default'])() : props.initialVisibleMonth();
var focusedDate = currentMonth.clone().startOf('month');
if (props.getFirstFocusableDay) {
focusedDate = props.getFirstFocusableDay(currentMonth);
}
var horizontalMonthPadding = props.horizontalMonthPadding;
var translationValue = props.isRTL && _this.isHorizontal() ? -(0, _getCalendarMonthWidth2['default'])(props.daySize, horizontalMonthPadding) : 0;
_this.hasSetInitialVisibleMonth = !props.hidden;
_this.state = {
currentMonth: currentMonth,
monthTransition: null,
translationValue: translationValue,
scrollableMonthMultiple: 1,
calendarMonthWidth: (0, _getCalendarMonthWidth2['default'])(props.daySize, horizontalMonthPadding),
focusedDate: !props.hidden || props.isFocused ? focusedDate : null,
nextFocusedDate: null,
showKeyboardShortcuts: props.showKeyboardShortcuts,
onKeyboardShortcutsPanelClose: function () {
function onKeyboardShortcutsPanelClose() {}
return onKeyboardShortcutsPanelClose;
}(),
isTouchDevice: (0, _isTouchDevice2['default'])(),
withMouseInteractions: true,
calendarInfoWidth: 0,
monthTitleHeight: null,
hasSetHeight: false
};
_this.setCalendarMonthWeeks(currentMonth);
_this.calendarMonthGridHeight = 0;
_this.setCalendarInfoWidthTimeout = null;
_this.onKeyDown = _this.onKeyDown.bind(_this);
_this.throttledKeyDown = (0, _throttle2['default'])(_this.onFinalKeyDown, 200, {
trailing: false
});
_this.onPrevMonthClick = _this.onPrevMonthClick.bind(_this);
_this.onNextMonthClick = _this.onNextMonthClick.bind(_this);
_this.onMonthChange = _this.onMonthChange.bind(_this);
_this.onYearChange = _this.onYearChange.bind(_this);
_this.multiplyScrollableMonths = _this.multiplyScrollableMonths.bind(_this);
_this.updateStateAfterMonthTransition = _this.updateStateAfterMonthTransition.bind(_this);
_this.openKeyboardShortcutsPanel = _this.openKeyboardShortcutsPanel.bind(_this);
_this.closeKeyboardShortcutsPanel = _this.closeKeyboardShortcutsPanel.bind(_this);
_this.setCalendarInfoRef = _this.setCalendarInfoRef.bind(_this);
_this.setContainerRef = _this.setContainerRef.bind(_this);
_this.setTransitionContainerRef = _this.setTransitionContainerRef.bind(_this);
_this.setMonthTitleHeight = _this.setMonthTitleHeight.bind(_this);
return _this;
}
_createClass(DayPicker, [{
key: 'componentDidMount',
value: function () {
function componentDidMount() {
var currentMonth = this.state.currentMonth;
if (this.calendarInfo) {
this.setState({
isTouchDevice: (0, _isTouchDevice2['default'])(),
calendarInfoWidth: (0, _calculateDimension2['default'])(this.calendarInfo, 'width', true, true)
});
} else {
this.setState({
isTouchDevice: (0, _isTouchDevice2['default'])()
});
}
this.setCalendarMonthWeeks(currentMonth);
}
return componentDidMount;
}()
}, {
key: 'componentWillReceiveProps',
value: function () {
function componentWillReceiveProps(nextProps) {
var hidden = nextProps.hidden,
isFocused = nextProps.isFocused,
showKeyboardShortcuts = nextProps.showKeyboardShortcuts,
onBlur = nextProps.onBlur,
renderMonthText = nextProps.renderMonthText,
horizontalMonthPadding = nextProps.horizontalMonthPadding;
var currentMonth = this.state.currentMonth;
if (!hidden) {
if (!this.hasSetInitialVisibleMonth) {
this.hasSetInitialVisibleMonth = true;
this.setState({
currentMonth: nextProps.initialVisibleMonth()
});
}
}
var _props = this.props,
daySize = _props.daySize,
prevIsFocused = _props.isFocused,
prevRenderMonthText = _props.renderMonthText;
if (nextProps.daySize !== daySize) {
this.setState({
calendarMonthWidth: (0, _getCalendarMonthWidth2['default'])(nextProps.daySize, horizontalMonthPadding)
});
}
if (isFocused !== prevIsFocused) {
if (isFocused) {
var focusedDate = this.getFocusedDay(currentMonth);
var onKeyboardShortcutsPanelClose = this.state.onKeyboardShortcutsPanelClose;
if (nextProps.showKeyboardShortcuts) {
// the ? shortcut came from the input and we should return input there once it is close
onKeyboardShortcutsPanelClose = onBlur;
}
this.setState({
showKeyboardShortcuts: showKeyboardShortcuts,
onKeyboardShortcutsPanelClose: onKeyboardShortcutsPanelClose,
focusedDate: focusedDate,
withMouseInteractions: false
});
} else {
this.setState({
focusedDate: null
});
}
}
if (renderMonthText !== prevRenderMonthText) {
this.setState({
monthTitleHeight: null
});
}
}
return componentWillReceiveProps;
}()
}, {
key: 'shouldComponentUpdate',
value: function () {
function shouldComponentUpdate(nextProps, nextState) {
return (0, _reactAddonsShallowCompare2['default'])(this, nextProps, nextState);
}
return shouldComponentUpdate;
}()
}, {
key: 'componentWillUpdate',
value: function () {
function componentWillUpdate() {
var _this2 = this;
var transitionDuration = this.props.transitionDuration; // Calculating the dimensions trigger a DOM repaint which
// breaks the CSS transition.
// The setTimeout will wait until the transition ends.
if (this.calendarInfo) {
this.setCalendarInfoWidthTimeout = setTimeout(function () {
var calendarInfoWidth = _this2.state.calendarInfoWidth;
var calendarInfoPanelWidth = (0, _calculateDimension2['default'])(_this2.calendarInfo, 'width', true, true);
if (calendarInfoWidth !== calendarInfoPanelWidth) {
_this2.setState({
calendarInfoWidth: calendarInfoPanelWidth
});
}
}, transitionDuration);
}
}
return componentWillUpdate;
}()
}, {
key: 'componentDidUpdate',
value: function () {
function componentDidUpdate(prevProps) {
var _props2 = this.props,
orientation = _props2.orientation,
daySize = _props2.daySize,
isFocused = _props2.isFocused,
numberOfMonths = _props2.numberOfMonths;
var _state = this.state,
focusedDate = _state.focusedDate,
monthTitleHeight = _state.monthTitleHeight;
if (this.isHorizontal() && (orientation !== prevProps.orientation || daySize !== prevProps.daySize)) {
var visibleCalendarWeeks = this.calendarMonthWeeks.slice(1, numberOfMonths + 1);
var calendarMonthWeeksHeight = Math.max.apply(Math, [0].concat(_toConsumableArray(visibleCalendarWeeks))) * (daySize - 1);
var newMonthHeight = monthTitleHeight + calendarMonthWeeksHeight + 1;
this.adjustDayPickerHeight(newMonthHeight);
}
if (!prevProps.isFocused && isFocused && !focusedDate) {
this.container.focus();
}
}
return componentDidUpdate;
}()
}, {
key: 'componentWillUnmount',
value: function () {
function componentWillUnmount() {
clearTimeout(this.setCalendarInfoWidthTimeout);
}
return componentWillUnmount;
}()
}, {
key: 'onKeyDown',
value: function () {
function onKeyDown(e) {
e.stopPropagation();
if (!_constants.MODIFIER_KEY_NAMES.has(e.key)) {
this.throttledKeyDown(e);
}
}
return onKeyDown;
}()
}, {
key: 'onFinalKeyDown',
value: function () {
function onFinalKeyDown(e) {
this.setState({
withMouseInteractions: false
});
var _props3 = this.props,
onBlur = _props3.onBlur,
isRTL = _props3.isRTL;
var _state2 = this.state,
focusedDate = _state2.focusedDate,
showKeyboardShortcuts = _state2.showKeyboardShortcuts;
if (!focusedDate) return;
var newFocusedDate = focusedDate.clone();
var didTransitionMonth = false; // focus might be anywhere when the keyboard shortcuts panel is opened so we want to
// return it to wherever it was before when the panel was opened
var activeElement = (0, _getActiveElement2['default'])();
var onKeyboardShortcutsPanelClose = function () {
function onKeyboardShortcutsPanelClose() {
if (activeElement) activeElement.focus();
}
return onKeyboardShortcutsPanelClose;
}();
switch (e.key) {
case 'ArrowUp':
e.preventDefault();
newFocusedDate.subtract(1, 'week');
didTransitionMonth = this.maybeTransitionPrevMonth(newFocusedDate);
break;
case 'ArrowLeft':
e.preventDefault();
if (isRTL) {
newFocusedDate.add(1, 'day');
} else {
newFocusedDate.subtract(1, 'day');
}
didTransitionMonth = this.maybeTransitionPrevMonth(newFocusedDate);
break;
case 'Home':
e.preventDefault();
newFocusedDate.startOf('week');
didTransitionMonth = this.maybeTransitionPrevMonth(newFocusedDate);
break;
case 'PageUp':
e.preventDefault();
newFocusedDate.subtract(1, 'month');
didTransitionMonth = this.maybeTransitionPrevMonth(newFocusedDate);
break;
case 'ArrowDown':
e.preventDefault();
newFocusedDate.add(1, 'week');
didTransitionMonth = this.maybeTransitionNextMonth(newFocusedDate);
break;
case 'ArrowRight':
e.preventDefault();
if (isRTL) {
newFocusedDate.subtract(1, 'day');
} else {
newFocusedDate.add(1, 'day');
}
didTransitionMonth = this.maybeTransitionNextMonth(newFocusedDate);
break;
case 'End':
e.preventDefault();
newFocusedDate.endOf('week');
didTransitionMonth = this.maybeTransitionNextMonth(newFocusedDate);
break;
case 'PageDown':
e.preventDefault();
newFocusedDate.add(1, 'month');
didTransitionMonth = this.maybeTransitionNextMonth(newFocusedDate);
break;
case '?':
this.openKeyboardShortcutsPanel(onKeyboardShortcutsPanelClose);
break;
case 'Escape':
if (showKeyboardShortcuts) {
this.closeKeyboardShortcutsPanel();
} else {
onBlur();
}
break;
default:
break;
} // If there was a month transition, do not update the focused date until the transition has
// completed. Otherwise, attempting to focus on a DOM node may interrupt the CSS animation. If
// didTransitionMonth is true, the focusedDate gets updated in #updateStateAfterMonthTransition
if (!didTransitionMonth) {
this.setState({
focusedDate: newFocusedDate
});
}
}
return onFinalKeyDown;
}()
}, {
key: 'onPrevMonthClick',
value: function () {
function onPrevMonthClick(nextFocusedDate, e) {
var _props4 = this.props,
daySize = _props4.daySize,
isRTL = _props4.isRTL,
numberOfMonths = _props4.numberOfMonths;
var _state3 = this.state,
calendarMonthWidth = _state3.calendarMonthWidth,
monthTitleHeight = _state3.monthTitleHeight;
if (e) e.preventDefault();
var translationValue = void 0;
if (this.isVertical()) {
var calendarMonthWeeksHeight = this.calendarMonthWeeks[0] * (daySize - 1);
translationValue = monthTitleHeight + calendarMonthWeeksHeight + 1;
} else if (this.isHorizontal()) {
translationValue = calendarMonthWidth;
if (isRTL) {
translationValue = -2 * calendarMonthWidth;
}
var visibleCalendarWeeks = this.calendarMonthWeeks.slice(0, numberOfMonths);
var _calendarMonthWeeksHeight = Math.max.apply(Math, [0].concat(_toConsumableArray(visibleCalendarWeeks))) * (daySize - 1);
var newMonthHeight = monthTitleHeight + _calendarMonthWeeksHeight + 1;
this.adjustDayPickerHeight(newMonthHeight);
}
this.setState({
monthTransition: PREV_TRANSITION,
translationValue: translationValue,
focusedDate: null,
nextFocusedDate: nextFocusedDate
});
}
return onPrevMonthClick;
}()
}, {
key: 'onMonthChange',
value: function () {
function onMonthChange(currentMonth) {
this.setCalendarMonthWeeks(currentMonth);
this.calculateAndSetDayPickerHeight(); // Translation value is a hack to force an invisible transition that
// properly rerenders the CalendarMonthGrid
this.setState({
monthTransition: MONTH_SELECTION_TRANSITION,
translationValue: 0.00001,
focusedDate: null,
nextFocusedDate: currentMonth,
currentMonth: currentMonth
});
}
return onMonthChange;
}()
}, {
key: 'onYearChange',
value: function () {
function onYearChange(currentMonth) {
this.setCalendarMonthWeeks(currentMonth);
this.calculateAndSetDayPickerHeight(); // Translation value is a hack to force an invisible transition that
// properly rerenders the CalendarMonthGrid
this.setState({
monthTransition: YEAR_SELECTION_TRANSITION,
translationValue: 0.0001,
focusedDate: null,
nextFocusedDate: currentMonth,
currentMonth: currentMonth
});
}
return onYearChange;
}()
}, {
key: 'onNextMonthClick',
value: function () {
function onNextMonthClick(nextFocusedDate, e) {
var _props5 = this.props,
isRTL = _props5.isRTL,
numberOfMonths = _props5.numberOfMonths,
daySize = _props5.daySize;
var _state4 = this.state,
calendarMonthWidth = _state4.calendarMonthWidth,
monthTitleHeight = _state4.monthTitleHeight;
if (e) e.preventDefault();
var translationValue = void 0;
if (this.isVertical()) {
var firstVisibleMonthWeeks = this.calendarMonthWeeks[1];
var calendarMonthWeeksHeight = firstVisibleMonthWeeks * (daySize - 1);
translationValue = -(monthTitleHeight + calendarMonthWeeksHeight + 1);
}
if (this.isHorizontal()) {
translationValue = -calendarMonthWidth;
if (isRTL) {
translationValue = 0;
}
var visibleCalendarWeeks = this.calendarMonthWeeks.slice(2, numberOfMonths + 2);
var _calendarMonthWeeksHeight2 = Math.max.apply(Math, [0].concat(_toConsumableArray(visibleCalendarWeeks))) * (daySize - 1);
var newMonthHeight = monthTitleHeight + _calendarMonthWeeksHeight2 + 1;
this.adjustDayPickerHeight(newMonthHeight);
}
this.setState({
monthTransition: NEXT_TRANSITION,
translationValue: translationValue,
focusedDate: null,
nextFocusedDate: nextFocusedDate
});
}
return onNextMonthClick;
}()
}, {
key: 'getFirstDayOfWeek',
value: function () {
function getFirstDayOfWeek() {
var firstDayOfWeek = this.props.firstDayOfWeek;
if (firstDayOfWeek == null) {
return _moment2['default'].localeData().firstDayOfWeek();
}
return firstDayOfWeek;
}
return getFirstDayOfWeek;
}()
}, {
key: 'getFirstVisibleIndex',
value: function () {
function getFirstVisibleIndex() {
var orientation = this.props.orientation;
var monthTransition = this.state.monthTransition;
if (orientation === _constants.VERTICAL_SCROLLABLE) return 0;
var firstVisibleMonthIndex = 1;
if (monthTransition === PREV_TRANSITION) {
firstVisibleMonthIndex -= 1;
} else if (monthTransition === NEXT_TRANSITION) {
firstVisibleMonthIndex += 1;
}
return firstVisibleMonthIndex;
}
return getFirstVisibleIndex;
}()
}, {
key: 'getFocusedDay',
value: function () {
function getFocusedDay(newMonth) {
var _props6 = this.props,
getFirstFocusableDay = _props6.getFirstFocusableDay,
numberOfMonths = _props6.numberOfMonths;
var focusedDate = void 0;
if (getFirstFocusableDay) {
focusedDate = getFirstFocusableDay(newMonth);
}
if (newMonth && (!focusedDate || !(0, _isDayVisible2['default'])(focusedDate, newMonth, numberOfMonths))) {
focusedDate = newMonth.clone().startOf('month');
}
return focusedDate;
}
return getFocusedDay;
}()
}, {
key: 'setMonthTitleHeight',
value: function () {
function setMonthTitleHeight(monthTitleHeight) {
var _this3 = this;
this.setState({
monthTitleHeight: monthTitleHeight
}, function () {
_this3.calculateAndSetDayPickerHeight();
});
}
return setMonthTitleHeight;
}()
}, {
key: 'setCalendarMonthWeeks',
value: function () {
function setCalendarMonthWeeks(currentMonth) {
var numberOfMonths = this.props.numberOfMonths;
this.calendarMonthWeeks = [];
var month = currentMonth.clone().subtract(1, 'months');
var firstDayOfWeek = this.getFirstDayOfWeek();
for (var i = 0; i < numberOfMonths + 2; i += 1) {
var numberOfWeeks = (0, _getNumberOfCalendarMonthWeeks2['default'])(month, firstDayOfWeek);
this.calendarMonthWeeks.push(numberOfWeeks);
month = month.add(1, 'months');
}
}
return setCalendarMonthWeeks;
}()
}, {
key: 'setContainerRef',
value: function () {
function setContainerRef(ref) {
this.container = ref;
}
return setContainerRef;
}()
}, {
key: 'setCalendarInfoRef',
value: function () {
function setCalendarInfoRef(ref) {
this.calendarInfo = ref;
}
return setCalendarInfoRef;
}()
}, {
key: 'setTransitionContainerRef',
value: function () {
function setTransitionContainerRef(ref) {
this.transitionContainer = ref;
}
return setTransitionContainerRef;
}()
}, {
key: 'maybeTransitionNextMonth',
value: function () {
function maybeTransitionNextMonth(newFocusedDate) {
var numberOfMonths = this.props.numberOfMonths;
var _state5 = this.state,
currentMonth = _state5.currentMonth,
focusedDate = _state5.focusedDate;
var newFocusedDateMonth = newFocusedDate.month();
var focusedDateMonth = focusedDate.month();
var isNewFocusedDateVisible = (0, _isDayVisible2['default'])(newFocusedDate, currentMonth, numberOfMonths);
if (newFocusedDateMonth !== focusedDateMonth && !isNewFocusedDateVisible) {
this.onNextMonthClick(newFocusedDate);
return true;
}
return false;
}
return maybeTransitionNextMonth;
}()
}, {
key: 'maybeTransitionPrevMonth',
value: function () {
function maybeTransitionPrevMonth(newFocusedDate) {
var numberOfMonths = this.props.numberOfMonths;
var _state6 = this.state,
currentMonth = _state6.currentMonth,
focusedDate = _state6.focusedDate;
var newFocusedDateMonth = newFocusedDate.month();
var focusedDateMonth = focusedDate.month();
var isNewFocusedDateVisible = (0, _isDayVisible2['default'])(newFocusedDate, currentMonth, numberOfMonths);
if (newFocusedDateMonth !== focusedDateMonth && !isNewFocusedDateVisible) {
this.onPrevMonthClick(newFocusedDate);
return true;
}
return false;
}
return maybeTransitionPrevMonth;
}()
}, {
key: 'multiplyScrollableMonths',
value: function () {
function multiplyScrollableMonths(e) {
var onMultiplyScrollableMonths = this.props.onMultiplyScrollableMonths;
if (e) e.preventDefault();
if (onMultiplyScrollableMonths) onMultiplyScrollableMonths(e);
this.setState(function (_ref) {
var scrollableMonthMultiple = _ref.scrollableMonthMultiple;
return {
scrollableMonthMultiple: scrollableMonthMultiple + 1
};
});
}
return multiplyScrollableMonths;
}()
}, {
key: 'isHorizontal',
value: function () {
function isHorizontal() {
var orientation = this.props.orientation;
return orientation === _constants.HORIZONTAL_ORIENTATION;
}
return isHorizontal;
}()
}, {
key: 'isVertical',
value: function () {
function isVertical() {
var orientation = this.props.orientation;
return orientation === _constants.VERTICAL_ORIENTATION || orientation === _constants.VERTICAL_SCROLLABLE;
}
return isVertical;
}()
}, {
key: 'updateStateAfterMonthTransition',
value: function () {
function updateStateAfterMonthTransition() {
var _this4 = this;
var _props7 = this.props,
onPrevMonthClick = _props7.onPrevMonthClick,
onNextMonthClick = _props7.onNextMonthClick,
numberOfMonths = _props7.numberOfMonths,
onMonthChange = _props7.onMonthChange,
onYearChange = _props7.onYearChange,
isRTL = _props7.isRTL;
var _state7 = this.state,
currentMonth = _state7.currentMonth,
monthTransition = _state7.monthTransition,
focusedDate = _state7.focusedDate,
nextFocusedDate = _state7.nextFocusedDate,
withMouseInteractions = _state7.withMouseInteractions,
calendarMonthWidth = _state7.calendarMonthWidth;
if (!monthTransition) return;
var newMonth = currentMonth.clone();
var firstDayOfWeek = this.getFirstDayOfWeek();
if (monthTransition === PREV_TRANSITION) {
newMonth.subtract(1, 'month');
if (onPrevMonthClick) onPrevMonthClick(newMonth);
var newInvisibleMonth = newMonth.clone().subtract(1, 'month');
var numberOfWeeks = (0, _getNumberOfCalendarMonthWeeks2['default'])(newInvisibleMonth, firstDayOfWeek);
this.calendarMonthWeeks = [numberOfWeeks].concat(_toConsumableArray(this.calendarMonthWeeks.slice(0, -1)));
} else if (monthTransition === NEXT_TRANSITION) {
newMonth.add(1, 'month');
if (onNextMonthClick) onNextMonthClick(newMonth);
var _newInvisibleMonth = newMonth.clone().add(numberOfMonths, 'month');
var _numberOfWeeks = (0, _getNumberOfCalendarMonthWeeks2['default'])(_newInvisibleMonth, firstDayOfWeek);
this.calendarMonthWeeks = [].concat(_toConsumableArray(this.calendarMonthWeeks.slice(1)), [_numberOfWeeks]);
} else if (monthTransition === MONTH_SELECTION_TRANSITION) {
if (onMonthChange) onMonthChange(newMonth);
} else if (monthTransition === YEAR_SELECTION_TRANSITION) {
if (onYearChange) onYearChange(newMonth);
}
var newFocusedDate = null;
if (nextFocusedDate) {
newFocusedDate = nextFocusedDate;
} else if (!focusedDate && !withMouseInteractions) {
newFocusedDate = this.getFocusedDay(newMonth);
}
this.setState({
currentMonth: newMonth,
monthTransition: null,
translationValue: isRTL && this.isHorizontal() ? -calendarMonthWidth : 0,
nextFocusedDate: null,
focusedDate: newFocusedDate
}, function () {
// we don't want to focus on the relevant calendar day after a month transition
// if the user is navigating around using a mouse
if (withMouseInteractions) {
var activeElement = (0, _getActiveElement2['default'])();
if (activeElement && activeElement !== document.body && _this4.container.contains(activeElement)) {
activeElement.blur();
}
}
});
}
return updateStateAfterMonthTransition;
}()
}, {
key: 'adjustDayPickerHeight',
value: function () {
function adjustDayPickerHeight(newMonthHeight) {
var _this5 = this;
var monthHeight = newMonthHeight + MONTH_PADDING;
if (monthHeight !== this.calendarMonthGridHeight) {
this.transitionContainer.style.height = String(monthHeight) + 'px';
if (!this.calendarMonthGridHeight) {
setTimeout(function () {
_this5.setState({
hasSetHeight: true
});
}, 0);
}
this.calendarMonthGridHeight = monthHeight;
}
}
return adjustDayPickerHeight;
}()
}, {
key: 'calculateAndSetDayPickerHeight',
value: function () {
function calculateAndSetDayPickerHeight() {
var _props8 = this.props,
daySize = _props8.daySize,
numberOfMonths = _props8.numberOfMonths;
var monthTitleHeight = this.state.monthTitleHeight;
var visibleCalendarWeeks = this.calendarMonthWeeks.slice(1, numberOfMonths + 1);
var calendarMonthWeeksHeight = Math.max.apply(Math, [0].concat(_toConsumableArray(visibleCalendarWeeks))) * (daySize - 1);
var newMonthHeight = monthTitleHeight + calendarMonthWeeksHeight + 1;
if (this.isHorizontal()) {
this.adjustDayPickerHeight(newMonthHeight);
}
}
return calculateAndSetDayPickerHeight;
}()
}, {
key: 'openKeyboardShortcutsPanel',
value: function () {
function openKeyboardShortcutsPanel(onCloseCallBack) {
this.setState({
showKeyboardShortcuts: true,
onKeyboardShortcutsPanelClose: onCloseCallBack
});
}
return openKeyboardShortcutsPanel;
}()
}, {
key: 'closeKeyboardShortcutsPanel',
value: function () {
function closeKeyboardShortcutsPanel() {
var onKeyboardShortcutsPanelClose = this.state.onKeyboardShortcutsPanelClose;
if (onKeyboardShortcutsPanelClose) {
onKeyboardShortcutsPanelClose();
}
this.setState({
onKeyboardShortcutsPanelClose: null,
showKeyboardShortcuts: false
});
}
return closeKeyboardShortcutsPanel;
}()
}, {
key: 'renderNavigation',
value: function () {
function renderNavigation() {
var _this6 = this;
var _props9 = this.props,
navPrev = _props9.navPrev,
navNext = _props9.navNext,
noNavButtons = _props9.noNavButtons,
orientation = _props9.orientation,
phrases = _props9.phrases,
isRTL = _props9.isRTL;
if (noNavButtons) {
return null;
}
var onNextMonthClick = void 0;
if (orientation === _constants.VERTICAL_SCROLLABLE) {
onNextMonthClick = this.multiplyScrollableMonths;
} else {
onNextMonthClick = function () {
function onNextMonthClick(e) {
_this6.onNextMonthClick(null, e);
}
return onNextMonthClick;
}();
}
return _react2['default'].createElement(_DayPickerNavigation2['default'], {
onPrevMonthClick: function () {
function onPrevMonthClick(e) {
_this6.onPrevMonthClick(null, e);
}
return onPrevMonthClick;
}(),
onNextMonthClick: onNextMonthClick,
navPrev: navPrev,
navNext: navNext,
orientation: orientation,
phrases: phrases,
isRTL: isRTL
});
}
return renderNavigation;
}()
}, {
key: 'renderWeekHeader',
value: function () {
function renderWeekHeader(index) {
var _props10 = this.props,
daySize = _props10.daySize,
horizontalMonthPadding = _props10.horizontalMonthPadding,
orientation = _props10.orientation,
weekDayFormat = _props10.weekDayFormat,
styles = _props10.styles;
var calendarMonthWidth = this.state.calendarMonthWidth;
var verticalScrollable = orientation === _constants.VERTICAL_SCROLLABLE;
var horizontalStyle = {
left: index * calendarMonthWidth
};
var verticalStyle = {
marginLeft: -calendarMonthWidth / 2
};
var weekHeaderStyle = {}; // no styles applied to the vertical-scrollable orientation
if (this.isHorizontal()) {
weekHeaderStyle = horizontalStyle;
} else if (this.isVertical() && !verticalScrollable) {
weekHeaderStyle = verticalStyle;
}
var firstDayOfWeek = this.getFirstDayOfWeek();
var header = [];
for (var i = 0; i < 7; i += 1) {
header.push(_react2['default'].createElement('li', _extends({
key: i
}, (0, _reactWithStyles.css)(styles.DayPicker_weekHeader_li, {
width: daySize
})), _react2['default'].createElement('small', null, (0, _moment2['default'])().day((i + firstDayOfWeek) % 7).format(weekDayFormat))));
}
return _react2['default'].createElement('div', _extends({}, (0, _reactWithStyles.css)(styles.DayPicker_weekHeader, this.isVertical() && styles.DayPicker_weekHeader__vertical, verticalScrollable && styles.DayPicker_weekHeader__verticalScrollable, weekHeaderStyle, {
padding: '0 ' + String(horizontalMonthPadding) + 'px'
}), {
key: 'week-' + String(index)
}), _react2['default'].createElement('ul', (0, _reactWithStyles.css)(styles.DayPicker_weekHeader_ul), header));
}
return renderWeekHeader;
}()
}, {
key: 'render',
value: function () {
function render() {
var _this7 = this;
var _state8 = this.state,
calendarMonthWidth = _state8.calendarMonthWidth,
currentMonth = _state8.currentMonth,
monthTransition = _state8.monthTransition,
translationValue = _state8.translationValue,
scrollableMonthMultiple = _state8.scrollableMonthMultiple,
focusedDate = _state8.focusedDate,
showKeyboardShortcuts = _state8.showKeyboardShortcuts,
isTouch = _state8.isTouchDevice,
hasSetHeight = _state8.hasSetHeight,
calendarInfoWidth = _state8.calendarInfoWidth,
monthTitleHeight = _state8.monthTitleHeight;
var _props11 = this.props,
enableOutsideDays = _props11.enableOutsideDays,
numberOfMonths = _props11.numberOfMonths,
orientation = _props11.orientation,
modifiers = _props11.modifiers,
withPortal = _props11.withPortal,
onDayClick = _props11.onDayClick,
onDayMouseEnter = _props11.onDayMouseEnter,
onDayMouseLeave = _props11.onDayMouseLeave,
firstDayOfWeek = _props11.firstDayOfWeek,
renderMonthText = _props11.renderMonthText,
renderCalendarDay = _props11.renderCalendarDay,
renderDayContents = _props11.renderDayContents,
renderCalendarInfo = _props11.renderCalendarInfo,
renderMonthElement = _props11.renderMonthElement,
calendarInfoPosition = _props11.calendarInfoPosition,
hideKeyboardShortcutsPanel = _props11.hideKeyboardShortcutsPanel,
onOutsideClick = _props11.onOutsideClick,
monthFormat = _props11.monthFormat,
daySize = _props11.daySize,
isFocused = _props11.isFocused,
isRTL = _props11.isRTL,
styles = _props11.styles,
theme = _props11.theme,
phrases = _props11.phrases,
verticalHeight = _props11.verticalHeight,
dayAriaLabelFormat = _props11.dayAriaLabelFormat,
noBorder = _props11.noBorder,
transitionDuration = _props11.transitionDuration,
verticalBorderSpacing = _props11.verticalBorderSpacing,
horizontalMonthPadding = _props11.horizontalMonthPadding;
var dayPickerHorizontalPadding = theme.reactDates.spacing.dayPickerHorizontalPadding;
var isHorizontal = this.isHorizontal();
var numOfWeekHeaders = this.isVertical() ? 1 : numberOfMonths;
var weekHeaders = [];
for (var i = 0; i < numOfWeekHeaders; i += 1) {
weekHeaders.push(this.renderWeekHeader(i));
}
var verticalScrollable = orientation === _constants.VERTICAL_SCROLLABLE;
var height = void 0;
if (isHorizontal) {
height = this.calendarMonthGridHeight;
} else if (this.isVertical() && !verticalScrollable && !withPortal) {
// If the user doesn't set a desired height,
// we default back to this kind of made-up value that generally looks good
height = verticalHeight || 1.75 * calendarMonthWidth;
}
var isCalendarMonthGridAnimating = monthTransition !== null;
var shouldFocusDate = !isCalendarMonthGridAnimating && isFocused;
var keyboardShortcutButtonLocation = _DayPickerKeyboardShortcuts.BOTTOM_RIGHT;
if (this.isVertical()) {
keyboardShortcutButtonLocation = withPortal ? _DayPickerKeyboardShortcuts.TOP_LEFT : _DayPickerKeyboardShortcuts.TOP_RIGHT;
}
var shouldAnimateHeight = isHorizontal && hasSetHeight;
var calendarInfoPositionTop = calendarInfoPosition === _constants.INFO_POSITION_TOP;
var calendarInfoPositionBottom = calendarInfoPosition === _constants.INFO_POSITION_BOTTOM;
var calendarInfoPositionBefore = calendarInfoPosition === _constants.INFO_POSITION_BEFORE;
var calendarInfoPositionAfter = calendarInfoPosition === _constants.INFO_POSITION_AFTER;
var calendarInfoIsInline = calendarInfoPositionBefore || calendarInfoPositionAfter;
var calendarInfo = renderCalendarInfo && _react2['default'].createElement('div', _extends({
ref: this.setCalendarInfoRef
}, (0, _reactWithStyles.css)(calendarInfoIsInline && styles.DayPicker_calendarInfo__horizontal)), renderCalendarInfo());
var calendarInfoPanelWidth = renderCalendarInfo && calendarInfoIsInline ? calendarInfoWidth : 0;
var firstVisibleMonthIndex = this.getFirstVisibleIndex();
var wrapperHorizontalWidth = calendarMonthWidth * numberOfMonths + 2 * dayPickerHorizontalPadding; // Adding `1px` because of whitespace between 2 inline-block
var fullHorizontalWidth = wrapperHorizontalWidth + calendarInfoPanelWidth + 1;
var transitionContainerStyle = {
width: isHorizontal && wrapperHorizontalWidth,
height: height
};
var dayPickerWrapperStyle = {
width: isHorizontal && wrapperHorizontalWidth
};
var dayPickerStyle = {
width: isHorizontal && fullHorizontalWidth,
// These values are to center the datepicker (approximately) on the page
marginLeft: isHorizontal && withPortal ? -fullHorizontalWidth / 2 : null,
marginTop: isHorizontal && withPortal ? -calendarMonthWidth / 2 : null
};
return _react2['default'].createElement('div', _extends({
role: 'application',
'aria-label': phrases.calendarLabel
}, (0, _reactWithStyles.css)(styles.DayPicker, isHorizontal && styles.DayPicker__horizontal, verticalScrollable && styles.DayPicker__verticalScrollable, isHorizontal && withPortal && styles.DayPicker_portal__horizontal, this.isVertical() && withPortal && styles.DayPicker_portal__vertical, dayPickerStyle, !monthTitleHeight && styles.DayPicker__hidden, !noBorder && styles.DayPicker__withBorder)), _react2['default'].createElement(_reactOutsideClickHandler2['default'], {
onOutsideClick: onOutsideClick
}, (calendarInfoPositionTop || calendarInfoPositionBefore) && calendarInfo, _react2['default'].createElement('div', (0, _reactWithStyles.css)(dayPickerWrapperStyle, calendarInfoIsInline && isHorizontal && styles.DayPicker_wrapper__horizontal), _react2['default'].createElement('div', _extends({}, (0, _reactWithStyles.css)(styles.DayPicker_weekHeaders, isHorizontal && styles.DayPicker_weekHeaders__horizontal), {
'aria-hidden': 'true',
role: 'presentation'
}), weekHeaders), _react2['default'].createElement('div', _extends({}, (0, _reactWithStyles.css)(styles.DayPicker_focusRegion), {
ref: this.setContainerRef,
onClick: function () {
function onClick(e) {
e.stopPropagation();
}
return onClick;
}(),
onKeyDown: this.onKeyDown,
onMouseUp: function () {
function onMouseUp() {
_this7.setState({
withMouseInteractions: true
});
}
return onMouseUp;
}(),
role: 'region',
tabIndex: -1
}), !verticalScrollable && this.renderNavigation(), _react2['default'].createElement('div', _extends({}, (0, _reactWithStyles.css)(styles.DayPicker_transitionContainer, shouldAnimateHeight && styles.DayPicker_transitionContainer__horizontal, this.isVertical() && styles.DayPicker_transitionContainer__vertical, verticalScrollable && styles.DayPicker_transitionContainer__verticalScrollable, transitionContainerStyle), {
ref: this.setTransitionContainerRef
}), _react2['default'].createElement(_CalendarMonthGrid2['default'], {
setMonthTitleHeight: !monthTitleHeight ? this.setMonthTitleHeight : undefined,
translationValue: translationValue,
enableOutsideDays: enableOutsideDays,
firstVisibleMonthIndex: firstVisibleMonthIndex,
initialMonth: currentMonth,
isAnimating: isCalendarMonthGridAnimating,
modifiers: modifiers,
orientation: orientation,
numberOfMonths: numberOfMonths * scrollableMonthMultiple,
onDayClick: onDayClick,
onDayMouseEnter: onDayMouseEnter,
onDayMouseLeave: onDayMouseLeave,
onMonthChange: this.onMonthChange,
onYearChange: this.onYearChange,
renderMonthText: renderMonthText,
renderCalendarDay: renderCalendarDay,
renderDayContents: renderDayContents,
renderMonthElement: renderMonthElement,
onMonthTransitionEnd: this.updateStateAfterMonthTransition,
monthFormat: monthFormat,
daySize: daySize,
firstDayOfWeek: firstDayOfWeek,
isFocused: shouldFocusDate,
focusedDate: focusedDate,
phrases: phrases,
isRTL: isRTL,
dayAriaLabelFormat: dayAriaLabelFormat,
transitionDuration: transitionDuration,
verticalBorderSpacing: verticalBorderSpacing,
horizontalMonthPadding: horizontalMonthPadding
}), verticalScrollable && this.renderNavigation()), !isTouch && !hideKeyboardShortcutsPanel && _react2['default'].createElement(_DayPickerKeyboardShortcuts2['default'], {
block: this.isVertical() && !withPortal,
buttonLocation: keyboardShortcutButtonLocation,
showKeyboardShortcutsPanel: showKeyboardShortcuts,
openKeyboardShortcutsPanel: this.openKeyboardShortcutsPanel,
closeKeyboardShortcutsPanel: this.closeKeyboardShortcutsPanel,
phrases: phrases
}))), (calendarInfoPositionBottom || calendarInfoPositionAfter) && calendarInfo));
}
return render;
}()
}]);
return DayPicker;
}(_react2['default'].Component);
DayPicker.propTypes = propTypes;
DayPicker.defaultProps = defaultProps;
exports.PureDayPicker = DayPicker;
exports['default'] = (0, _reactWithStyles.withStyles)(function (_ref2) {
var _ref2$reactDates = _ref2.reactDates,
color = _ref2$reactDates.color,
font = _ref2$reactDates.font,
noScrollBarOnVerticalScrollable = _ref2$reactDates.noScrollBarOnVerticalScrollable,
spacing = _ref2$reactDates.spacing,
zIndex = _ref2$reactDates.zIndex;
return {
DayPicker: {
background: color.background,
position: 'relative',
textAlign: 'left'
},
DayPicker__horizontal: {
background: color.background
},
DayPicker__verticalScrollable: {
height: '100%'
},
DayPicker__hidden: {
visibility: 'hidden'
},
DayPicker__withBorder: {
boxShadow: '0 2px 6px rgba(0, 0, 0, 0.05), 0 0 0 1px rgba(0, 0, 0, 0.07)',
borderRadius: 3
},
DayPicker_portal__horizontal: {
boxShadow: 'none',
position: 'absolute',
left: '50%',
top: '50%'
},
DayPicker_portal__vertical: {
position: 'initial'
},
DayPicker_focusRegion: {
outline: 'none'
},
DayPicker_calendarInfo__horizontal: {
display: 'inline-block',
verticalAlign: 'top'
},
DayPicker_wrapper__horizontal: {
display: 'inline-block',
verticalAlign: 'top'
},
DayPicker_weekHeaders: {
position: 'relative'
},
DayPicker_weekHeaders__horizontal: {
marginLeft: spacing.dayPickerHorizontalPadding
},
DayPicker_weekHeader: {
color: color.placeholderText,
position: 'absolute',
top: 62,
zIndex: zIndex + 2,
textAlign: 'left'
},
DayPicker_weekHeader__vertical: {
left: '50%'
},
DayPicker_weekHeader__verticalScrollable: {
top: 0,
display: 'table-row',
borderBottom: '1px solid ' + String(color.core.border),
background: color.background,
marginLeft: 0,
left: 0,
width: '100%',
textAlign: 'center'
},
DayPicker_weekHeader_ul: {
listStyle: 'none',
margin: '1px 0',
paddingLeft: 0,
paddingRight: 0,
fontSize: font.size
},
DayPicker_weekHeader_li: {
display: 'inline-block',
textAlign: 'center'
},
DayPicker_transitionContainer: {
position: 'relative',
overflow: 'hidden',
borderRadius: 3
},
DayPicker_transitionContainer__horizontal: {
transition: 'height 0.2s ease-in-out'
},
DayPicker_transitionContainer__vertical: {
width: '100%'
},
DayPicker_transitionContainer__verticalScrollable: (0, _object2['default'])({
paddingTop: 20,
height: '100%',
position: 'absolute',
top: 0,
bottom: 0,
right: 0,
left: 0,
overflowY: 'scroll'
}, noScrollBarOnVerticalScrollable && {
'-webkitOverflowScrolling': 'touch',
'::-webkit-scrollbar': {
'-webkit-appearance': 'none',
display: 'none'
}
})
};
})(DayPicker);
/***/ }),
/***/ "./node_modules/react-dates/lib/components/DayPickerKeyboardShortcuts.js":
/*!*******************************************************************************!*\
!*** ./node_modules/react-dates/lib/components/DayPickerKeyboardShortcuts.js ***!
\*******************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.BOTTOM_RIGHT = exports.TOP_RIGHT = exports.TOP_LEFT = 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 _object = __webpack_require__(/*! object.assign */ "./node_modules/object.assign/index.js");
var _object2 = _interopRequireDefault(_object);
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 _airbnbPropTypes = __webpack_require__(/*! airbnb-prop-types */ "./node_modules/airbnb-prop-types/index.js");
var _reactWithStyles = __webpack_require__(/*! react-with-styles */ "./node_modules/react-with-styles/lib/withStyles.js");
var _defaultPhrases = __webpack_require__(/*! ../defaultPhrases */ "./node_modules/react-dates/lib/defaultPhrases.js");
var _getPhrasePropTypes = __webpack_require__(/*! ../utils/getPhrasePropTypes */ "./node_modules/react-dates/lib/utils/getPhrasePropTypes.js");
var _getPhrasePropTypes2 = _interopRequireDefault(_getPhrasePropTypes);
var _KeyboardShortcutRow = __webpack_require__(/*! ./KeyboardShortcutRow */ "./node_modules/react-dates/lib/components/KeyboardShortcutRow.js");
var _KeyboardShortcutRow2 = _interopRequireDefault(_KeyboardShortcutRow);
var _CloseButton = __webpack_require__(/*! ./CloseButton */ "./node_modules/react-dates/lib/components/CloseButton.js");
var _CloseButton2 = _interopRequireDefault(_CloseButton);
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 TOP_LEFT = exports.TOP_LEFT = 'top-left';
var TOP_RIGHT = exports.TOP_RIGHT = 'top-right';
var BOTTOM_RIGHT = exports.BOTTOM_RIGHT = 'bottom-right';
var propTypes = (0, _airbnbPropTypes.forbidExtraProps)((0, _object2['default'])({}, _reactWithStyles.withStylesPropTypes, {
block: _propTypes2['default'].bool,
buttonLocation: _propTypes2['default'].oneOf([TOP_LEFT, TOP_RIGHT, BOTTOM_RIGHT]),
showKeyboardShortcutsPanel: _propTypes2['default'].bool,
openKeyboardShortcutsPanel: _propTypes2['default'].func,
closeKeyboardShortcutsPanel: _propTypes2['default'].func,
phrases: _propTypes2['default'].shape((0, _getPhrasePropTypes2['default'])(_defaultPhrases.DayPickerKeyboardShortcutsPhrases))
}));
var defaultProps = {
block: false,
buttonLocation: BOTTOM_RIGHT,
showKeyboardShortcutsPanel: false,
openKeyboardShortcutsPanel: function () {
function openKeyboardShortcutsPanel() {}
return openKeyboardShortcutsPanel;
}(),
closeKeyboardShortcutsPanel: function () {
function closeKeyboardShortcutsPanel() {}
return closeKeyboardShortcutsPanel;
}(),
phrases: _defaultPhrases.DayPickerKeyboardShortcutsPhrases
};
function getKeyboardShortcuts(phrases) {
return [{
unicode: '↵',
label: phrases.enterKey,
action: phrases.selectFocusedDate
}, {
unicode: '←/→',
label: phrases.leftArrowRightArrow,
action: phrases.moveFocusByOneDay
}, {
unicode: '↑/↓',
label: phrases.upArrowDownArrow,
action: phrases.moveFocusByOneWeek
}, {
unicode: 'PgUp/PgDn',
label: phrases.pageUpPageDown,
action: phrases.moveFocusByOneMonth
}, {
unicode: 'Home/End',
label: phrases.homeEnd,
action: phrases.moveFocustoStartAndEndOfWeek
}, {
unicode: 'Esc',
label: phrases.escape,
action: phrases.returnFocusToInput
}, {
unicode: '?',
label: phrases.questionMark,
action: phrases.openThisPanel
}];
}
var DayPickerKeyboardShortcuts = function (_React$Component) {
_inherits(DayPickerKeyboardShortcuts, _React$Component);
function DayPickerKeyboardShortcuts() {
var _ref;
_classCallCheck(this, DayPickerKeyboardShortcuts);
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
var _this = _possibleConstructorReturn(this, (_ref = DayPickerKeyboardShortcuts.__proto__ || Object.getPrototypeOf(DayPickerKeyboardShortcuts)).call.apply(_ref, [this].concat(args)));
var phrases = _this.props.phrases;
_this.keyboardShortcuts = getKeyboardShortcuts(phrases);
_this.onShowKeyboardShortcutsButtonClick = _this.onShowKeyboardShortcutsButtonClick.bind(_this);
_this.setShowKeyboardShortcutsButtonRef = _this.setShowKeyboardShortcutsButtonRef.bind(_this);
_this.setHideKeyboardShortcutsButtonRef = _this.setHideKeyboardShortcutsButtonRef.bind(_this);
_this.handleFocus = _this.handleFocus.bind(_this);
_this.onKeyDown = _this.onKeyDown.bind(_this);
return _this;
}
_createClass(DayPickerKeyboardShortcuts, [{
key: 'componentWillReceiveProps',
value: function () {
function componentWillReceiveProps(nextProps) {
var phrases = this.props.phrases;
if (nextProps.phrases !== phrases) {
this.keyboardShortcuts = getKeyboardShortcuts(nextProps.phrases);
}
}
return componentWillReceiveProps;
}()
}, {
key: 'componentDidUpdate',
value: function () {
function componentDidUpdate() {
this.handleFocus();
}
return componentDidUpdate;
}()
}, {
key: 'onKeyDown',
value: function () {
function onKeyDown(e) {
e.stopPropagation();
var closeKeyboardShortcutsPanel = this.props.closeKeyboardShortcutsPanel; // Because the close button is the only focusable element inside of the panel, this
// amounts to a very basic focus trap. The user can exit the panel by "pressing" the
// close button or hitting escape
switch (e.key) {
case 'Enter':
case ' ':
case 'Spacebar': // for older browsers
case 'Escape':
closeKeyboardShortcutsPanel();
break;
// do nothing - this allows the up and down arrows continue their
// default behavior of scrolling the content of the Keyboard Shortcuts Panel
// which is needed when only a single month is shown for instance.
case 'ArrowUp':
case 'ArrowDown':
break;
// completely block the rest of the keys that have functionality outside of this panel
case 'Tab':
case 'Home':
case 'End':
case 'PageUp':
case 'PageDown':
case 'ArrowLeft':
case 'ArrowRight':
e.preventDefault();
break;
default:
break;
}
}
return onKeyDown;
}()
}, {
key: 'onShowKeyboardShortcutsButtonClick',
value: function () {
function onShowKeyboardShortcutsButtonClick() {
var _this2 = this;
var openKeyboardShortcutsPanel = this.props.openKeyboardShortcutsPanel; // we want to return focus to this button after closing the keyboard shortcuts panel
openKeyboardShortcutsPanel(function () {
_this2.showKeyboardShortcutsButton.focus();
});
}
return onShowKeyboardShortcutsButtonClick;
}()
}, {
key: 'setShowKeyboardShortcutsButtonRef',
value: function () {
function setShowKeyboardShortcutsButtonRef(ref) {
this.showKeyboardShortcutsButton = ref;
}
return setShowKeyboardShortcutsButtonRef;
}()
}, {
key: 'setHideKeyboardShortcutsButtonRef',
value: function () {
function setHideKeyboardShortcutsButtonRef(ref) {
this.hideKeyboardShortcutsButton = ref;
}
return setHideKeyboardShortcutsButtonRef;
}()
}, {
key: 'handleFocus',
value: function () {
function handleFocus() {
if (this.hideKeyboardShortcutsButton) {
// automatically move focus into the dialog by moving
// to the only interactive element, the hide button
this.hideKeyboardShortcutsButton.focus();
}
}
return handleFocus;
}()
}, {
key: 'render',
value: function () {
function render() {
var _this3 = this;
var _props = this.props,
block = _props.block,
buttonLocation = _props.buttonLocation,
showKeyboardShortcutsPanel = _props.showKeyboardShortcutsPanel,
closeKeyboardShortcutsPanel = _props.closeKeyboardShortcutsPanel,
styles = _props.styles,
phrases = _props.phrases;
var toggleButtonText = showKeyboardShortcutsPanel ? phrases.hideKeyboardShortcutsPanel : phrases.showKeyboardShortcutsPanel;
var bottomRight = buttonLocation === BOTTOM_RIGHT;
var topRight = buttonLocation === TOP_RIGHT;
var topLeft = buttonLocation === TOP_LEFT;
return _react2['default'].createElement('div', null, _react2['default'].createElement('button', _extends({
ref: this.setShowKeyboardShortcutsButtonRef
}, (0, _reactWithStyles.css)(styles.DayPickerKeyboardShortcuts_buttonReset, styles.DayPickerKeyboardShortcuts_show, bottomRight && styles.DayPickerKeyboardShortcuts_show__bottomRight, topRight && styles.DayPickerKeyboardShortcuts_show__topRight, topLeft && styles.DayPickerKeyboardShortcuts_show__topLeft), {
type: 'button',
'aria-label': toggleButtonText,
onClick: this.onShowKeyboardShortcutsButtonClick,
onKeyDown: function () {
function onKeyDown(e) {
if (e.key === 'Enter') {
e.preventDefault();
} else if (e.key === 'Space') {
_this3.onShowKeyboardShortcutsButtonClick(e);
}
}
return onKeyDown;
}(),
onMouseUp: function () {
function onMouseUp(e) {
e.currentTarget.blur();
}
return onMouseUp;
}()
}), _react2['default'].createElement('span', (0, _reactWithStyles.css)(styles.DayPickerKeyboardShortcuts_showSpan, bottomRight && styles.DayPickerKeyboardShortcuts_showSpan__bottomRight, topRight && styles.DayPickerKeyboardShortcuts_showSpan__topRight, topLeft && styles.DayPickerKeyboardShortcuts_showSpan__topLeft), '?')), showKeyboardShortcutsPanel && _react2['default'].createElement('div', _extends({}, (0, _reactWithStyles.css)(styles.DayPickerKeyboardShortcuts_panel), {
role: 'dialog',
'aria-labelledby': 'DayPickerKeyboardShortcuts_title',
'aria-describedby': 'DayPickerKeyboardShortcuts_description'
}), _react2['default'].createElement('div', _extends({}, (0, _reactWithStyles.css)(styles.DayPickerKeyboardShortcuts_title), {
id: 'DayPickerKeyboardShortcuts_title'
}), phrases.keyboardShortcuts), _react2['default'].createElement('button', _extends({
ref: this.setHideKeyboardShortcutsButtonRef
}, (0, _reactWithStyles.css)(styles.DayPickerKeyboardShortcuts_buttonReset, styles.DayPickerKeyboardShortcuts_close), {
type: 'button',
tabIndex: '0',
'aria-label': phrases.hideKeyboardShortcutsPanel,
onClick: closeKeyboardShortcutsPanel,
onKeyDown: this.onKeyDown
}), _react2['default'].createElement(_CloseButton2['default'], (0, _reactWithStyles.css)(styles.DayPickerKeyboardShortcuts_closeSvg))), _react2['default'].createElement('ul', _extends({}, (0, _reactWithStyles.css)(styles.DayPickerKeyboardShortcuts_list), {
id: 'DayPickerKeyboardShortcuts_description'
}), this.keyboardShortcuts.map(function (_ref2) {
var unicode = _ref2.unicode,
label = _ref2.label,
action = _ref2.action;
return _react2['default'].createElement(_KeyboardShortcutRow2['default'], {
key: label,
unicode: unicode,
label: label,
action: action,
block: block
});
}))));
}
return render;
}()
}]);
return DayPickerKeyboardShortcuts;
}(_react2['default'].Component);
DayPickerKeyboardShortcuts.propTypes = propTypes;
DayPickerKeyboardShortcuts.defaultProps = defaultProps;
exports['default'] = (0, _reactWithStyles.withStyles)(function (_ref3) {
var _ref3$reactDates = _ref3.reactDates,
color = _ref3$reactDates.color,
font = _ref3$reactDates.font,
zIndex = _ref3$reactDates.zIndex;
return {
DayPickerKeyboardShortcuts_buttonReset: {
background: 'none',
border: 0,
borderRadius: 0,
color: 'inherit',
font: 'inherit',
lineHeight: 'normal',
overflow: 'visible',
padding: 0,
cursor: 'pointer',
fontSize: font.size,
':active': {
outline: 'none'
}
},
DayPickerKeyboardShortcuts_show: {
width: 22,
position: 'absolute',
zIndex: zIndex + 2
},
DayPickerKeyboardShortcuts_show__bottomRight: {
borderTop: '26px solid transparent',
borderRight: '33px solid ' + String(color.core.primary),
bottom: 0,
right: 0,
':hover': {
borderRight: '33px solid ' + String(color.core.primary_dark)
}
},
DayPickerKeyboardShortcuts_show__topRight: {
borderBottom: '26px solid transparent',
borderRight: '33px solid ' + String(color.core.primary),
top: 0,
right: 0,
':hover': {
borderRight: '33px solid ' + String(color.core.primary_dark)
}
},
DayPickerKeyboardShortcuts_show__topLeft: {
borderBottom: '26px solid transparent',
borderLeft: '33px solid ' + String(color.core.primary),
top: 0,
left: 0,
':hover': {
borderLeft: '33px solid ' + String(color.core.primary_dark)
}
},
DayPickerKeyboardShortcuts_showSpan: {
color: color.core.white,
position: 'absolute'
},
DayPickerKeyboardShortcuts_showSpan__bottomRight: {
bottom: 0,
right: -28
},
DayPickerKeyboardShortcuts_showSpan__topRight: {
top: 1,
right: -28
},
DayPickerKeyboardShortcuts_showSpan__topLeft: {
top: 1,
left: -28
},
DayPickerKeyboardShortcuts_panel: {
overflow: 'auto',
background: color.background,
border: '1px solid ' + String(color.core.border),
borderRadius: 2,
position: 'absolute',
top: 0,
bottom: 0,
right: 0,
left: 0,
zIndex: zIndex + 2,
padding: 22,
margin: 33
},
DayPickerKeyboardShortcuts_title: {
fontSize: 16,
fontWeight: 'bold',
margin: 0
},
DayPickerKeyboardShortcuts_list: {
listStyle: 'none',
padding: 0,
fontSize: font.size
},
DayPickerKeyboardShortcuts_close: {
position: 'absolute',
right: 22,
top: 22,
zIndex: zIndex + 2,
':active': {
outline: 'none'
}
},
DayPickerKeyboardShortcuts_closeSvg: {
height: 15,
width: 15,
fill: color.core.grayLighter,
':hover': {
fill: color.core.grayLight
},
':focus': {
fill: color.core.grayLight
}
}
};
})(DayPickerKeyboardShortcuts);
/***/ }),
/***/ "./node_modules/react-dates/lib/components/DayPickerNavigation.js":
/*!************************************************************************!*\
!*** ./node_modules/react-dates/lib/components/DayPickerNavigation.js ***!
\************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
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 _object = __webpack_require__(/*! object.assign */ "./node_modules/object.assign/index.js");
var _object2 = _interopRequireDefault(_object);
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 _airbnbPropTypes = __webpack_require__(/*! airbnb-prop-types */ "./node_modules/airbnb-prop-types/index.js");
var _reactWithStyles = __webpack_require__(/*! react-with-styles */ "./node_modules/react-with-styles/lib/withStyles.js");
var _defaultPhrases = __webpack_require__(/*! ../defaultPhrases */ "./node_modules/react-dates/lib/defaultPhrases.js");
var _getPhrasePropTypes = __webpack_require__(/*! ../utils/getPhrasePropTypes */ "./node_modules/react-dates/lib/utils/getPhrasePropTypes.js");
var _getPhrasePropTypes2 = _interopRequireDefault(_getPhrasePropTypes);
var _LeftArrow = __webpack_require__(/*! ./LeftArrow */ "./node_modules/react-dates/lib/components/LeftArrow.js");
var _LeftArrow2 = _interopRequireDefault(_LeftArrow);
var _RightArrow = __webpack_require__(/*! ./RightArrow */ "./node_modules/react-dates/lib/components/RightArrow.js");
var _RightArrow2 = _interopRequireDefault(_RightArrow);
var _ChevronUp = __webpack_require__(/*! ./ChevronUp */ "./node_modules/react-dates/lib/components/ChevronUp.js");
var _ChevronUp2 = _interopRequireDefault(_ChevronUp);
var _ChevronDown = __webpack_require__(/*! ./ChevronDown */ "./node_modules/react-dates/lib/components/ChevronDown.js");
var _ChevronDown2 = _interopRequireDefault(_ChevronDown);
var _ScrollableOrientationShape = __webpack_require__(/*! ../shapes/ScrollableOrientationShape */ "./node_modules/react-dates/lib/shapes/ScrollableOrientationShape.js");
var _ScrollableOrientationShape2 = _interopRequireDefault(_ScrollableOrientationShape);
var _constants = __webpack_require__(/*! ../constants */ "./node_modules/react-dates/lib/constants.js");
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
'default': obj
};
}
function _toConsumableArray(arr) {
if (Array.isArray(arr)) {
for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) {
arr2[i] = arr[i];
}
return arr2;
} else {
return Array.from(arr);
}
}
var propTypes = (0, _airbnbPropTypes.forbidExtraProps)((0, _object2['default'])({}, _reactWithStyles.withStylesPropTypes, {
navPrev: _propTypes2['default'].node,
navNext: _propTypes2['default'].node,
orientation: _ScrollableOrientationShape2['default'],
onPrevMonthClick: _propTypes2['default'].func,
onNextMonthClick: _propTypes2['default'].func,
// internationalization
phrases: _propTypes2['default'].shape((0, _getPhrasePropTypes2['default'])(_defaultPhrases.DayPickerNavigationPhrases)),
isRTL: _propTypes2['default'].bool
}));
var defaultProps = {
navPrev: null,
navNext: null,
orientation: _constants.HORIZONTAL_ORIENTATION,
onPrevMonthClick: function () {
function onPrevMonthClick() {}
return onPrevMonthClick;
}(),
onNextMonthClick: function () {
function onNextMonthClick() {}
return onNextMonthClick;
}(),
// internationalization
phrases: _defaultPhrases.DayPickerNavigationPhrases,
isRTL: false
};
function DayPickerNavigation(_ref) {
var navPrev = _ref.navPrev,
navNext = _ref.navNext,
onPrevMonthClick = _ref.onPrevMonthClick,
onNextMonthClick = _ref.onNextMonthClick,
orientation = _ref.orientation,
phrases = _ref.phrases,
isRTL = _ref.isRTL,
styles = _ref.styles;
var isHorizontal = orientation === _constants.HORIZONTAL_ORIENTATION;
var isVertical = orientation !== _constants.HORIZONTAL_ORIENTATION;
var isVerticalScrollable = orientation === _constants.VERTICAL_SCROLLABLE;
var navPrevIcon = navPrev;
var navNextIcon = navNext;
var isDefaultNavPrev = false;
var isDefaultNavNext = false;
if (!navPrevIcon) {
isDefaultNavPrev = true;
var Icon = isVertical ? _ChevronUp2['default'] : _LeftArrow2['default'];
if (isRTL && !isVertical) {
Icon = _RightArrow2['default'];
}
navPrevIcon = _react2['default'].createElement(Icon, (0, _reactWithStyles.css)(isHorizontal && styles.DayPickerNavigation_svg__horizontal, isVertical && styles.DayPickerNavigation_svg__vertical));
}
if (!navNextIcon) {
isDefaultNavNext = true;
var _Icon = isVertical ? _ChevronDown2['default'] : _RightArrow2['default'];
if (isRTL && !isVertical) {
_Icon = _LeftArrow2['default'];
}
navNextIcon = _react2['default'].createElement(_Icon, (0, _reactWithStyles.css)(isHorizontal && styles.DayPickerNavigation_svg__horizontal, isVertical && styles.DayPickerNavigation_svg__vertical));
}
var isDefaultNav = isVerticalScrollable ? isDefaultNavNext : isDefaultNavNext || isDefaultNavPrev;
return _react2['default'].createElement('div', _reactWithStyles.css.apply(undefined, [styles.DayPickerNavigation, isHorizontal && styles.DayPickerNavigation__horizontal].concat(_toConsumableArray(isVertical && [styles.DayPickerNavigation__vertical, isDefaultNav && styles.DayPickerNavigation__verticalDefault]), _toConsumableArray(isVerticalScrollable && [styles.DayPickerNavigation__verticalScrollable, isDefaultNav && styles.DayPickerNavigation__verticalScrollableDefault]))), !isVerticalScrollable && _react2['default'].createElement('div', _extends({
role: 'button',
tabIndex: '0'
}, _reactWithStyles.css.apply(undefined, [styles.DayPickerNavigation_button, isDefaultNavPrev && styles.DayPickerNavigation_button__default].concat(_toConsumableArray(isHorizontal && [styles.DayPickerNavigation_button__horizontal].concat(_toConsumableArray(isDefaultNavPrev && [styles.DayPickerNavigation_button__horizontalDefault, !isRTL && styles.DayPickerNavigation_leftButton__horizontalDefault, isRTL && styles.DayPickerNavigation_rightButton__horizontalDefault]))), _toConsumableArray(isVertical && [styles.DayPickerNavigation_button__vertical].concat(_toConsumableArray(isDefaultNavPrev && [styles.DayPickerNavigation_button__verticalDefault, styles.DayPickerNavigation_prevButton__verticalDefault]))))), {
'aria-label': phrases.jumpToPrevMonth,
onClick: onPrevMonthClick,
onKeyUp: function () {
function onKeyUp(e) {
var key = e.key;
if (key === 'Enter' || key === ' ') onPrevMonthClick(e);
}
return onKeyUp;
}(),
onMouseUp: function () {
function onMouseUp(e) {
e.currentTarget.blur();
}
return onMouseUp;
}()
}), navPrevIcon), _react2['default'].createElement('div', _extends({
role: 'button',
tabIndex: '0'
}, _reactWithStyles.css.apply(undefined, [styles.DayPickerNavigation_button, isDefaultNavNext && styles.DayPickerNavigation_button__default].concat(_toConsumableArray(isHorizontal && [styles.DayPickerNavigation_button__horizontal].concat(_toConsumableArray(isDefaultNavNext && [styles.DayPickerNavigation_button__horizontalDefault, isRTL && styles.DayPickerNavigation_leftButton__horizontalDefault, !isRTL && styles.DayPickerNavigation_rightButton__horizontalDefault]))), _toConsumableArray(isVertical && [styles.DayPickerNavigation_button__vertical, styles.DayPickerNavigation_nextButton__vertical].concat(_toConsumableArray(isDefaultNavNext && [styles.DayPickerNavigation_button__verticalDefault, styles.DayPickerNavigation_nextButton__verticalDefault, isVerticalScrollable && styles.DayPickerNavigation_nextButton__verticalScrollableDefault]))))), {
'aria-label': phrases.jumpToNextMonth,
onClick: onNextMonthClick,
onKeyUp: function () {
function onKeyUp(e) {
var key = e.key;
if (key === 'Enter' || key === ' ') onNextMonthClick(e);
}
return onKeyUp;
}(),
onMouseUp: function () {
function onMouseUp(e) {
e.currentTarget.blur();
}
return onMouseUp;
}()
}), navNextIcon));
}
DayPickerNavigation.propTypes = propTypes;
DayPickerNavigation.defaultProps = defaultProps;
exports['default'] = (0, _reactWithStyles.withStyles)(function (_ref2) {
var _ref2$reactDates = _ref2.reactDates,
color = _ref2$reactDates.color,
zIndex = _ref2$reactDates.zIndex;
return {
DayPickerNavigation: {
position: 'relative',
zIndex: zIndex + 2
},
DayPickerNavigation__horizontal: {
height: 0
},
DayPickerNavigation__vertical: {},
DayPickerNavigation__verticalScrollable: {},
DayPickerNavigation__verticalDefault: {
position: 'absolute',
width: '100%',
height: 52,
bottom: 0,
left: 0
},
DayPickerNavigation__verticalScrollableDefault: {
position: 'relative'
},
DayPickerNavigation_button: {
cursor: 'pointer',
userSelect: 'none',
border: 0,
padding: 0,
margin: 0
},
DayPickerNavigation_button__default: {
border: '1px solid ' + String(color.core.borderLight),
backgroundColor: color.background,
color: color.placeholderText,
':focus': {
border: '1px solid ' + String(color.core.borderMedium)
},
':hover': {
border: '1px solid ' + String(color.core.borderMedium)
},
':active': {
background: color.backgroundDark
}
},
DayPickerNavigation_button__horizontal: {},
DayPickerNavigation_button__horizontalDefault: {
position: 'absolute',
top: 18,
lineHeight: 0.78,
borderRadius: 3,
padding: '6px 9px'
},
DayPickerNavigation_leftButton__horizontalDefault: {
left: 22
},
DayPickerNavigation_rightButton__horizontalDefault: {
right: 22
},
DayPickerNavigation_button__vertical: {},
DayPickerNavigation_button__verticalDefault: {
padding: 5,
background: color.background,
boxShadow: '0 0 5px 2px rgba(0, 0, 0, 0.1)',
position: 'relative',
display: 'inline-block',
height: '100%',
width: '50%'
},
DayPickerNavigation_prevButton__verticalDefault: {},
DayPickerNavigation_nextButton__verticalDefault: {
borderLeft: 0
},
DayPickerNavigation_nextButton__verticalScrollableDefault: {
width: '100%'
},
DayPickerNavigation_svg__horizontal: {
height: 19,
width: 19,
fill: color.core.grayLight,
display: 'block'
},
DayPickerNavigation_svg__vertical: {
height: 42,
width: 42,
fill: color.text,
display: 'block'
}
};
})(DayPickerNavigation);
/***/ }),
/***/ "./node_modules/react-dates/lib/components/DayPickerRangeController.js":
/*!*****************************************************************************!*\
!*** ./node_modules/react-dates/lib/components/DayPickerRangeController.js ***!
\*****************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _slicedToArray = function () {
function sliceIterator(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"]) _i["return"]();
} finally {
if (_d) throw _e;
}
}
return _arr;
}
return function (arr, i) {
if (Array.isArray(arr)) {
return arr;
} else if (Symbol.iterator in Object(arr)) {
return sliceIterator(arr, i);
} else {
throw new TypeError("Invalid attempt to destructure non-iterable instance");
}
};
}();
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 _object = __webpack_require__(/*! object.assign */ "./node_modules/object.assign/index.js");
var _object2 = _interopRequireDefault(_object);
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 _reactMomentProptypes = __webpack_require__(/*! react-moment-proptypes */ "./node_modules/react-moment-proptypes/src/index.js");
var _reactMomentProptypes2 = _interopRequireDefault(_reactMomentProptypes);
var _airbnbPropTypes = __webpack_require__(/*! airbnb-prop-types */ "./node_modules/airbnb-prop-types/index.js");
var _moment = __webpack_require__(/*! moment */ "./node_modules/moment/moment.js");
var _moment2 = _interopRequireDefault(_moment);
var _object3 = __webpack_require__(/*! object.values */ "./node_modules/object.values/index.js");
var _object4 = _interopRequireDefault(_object3);
var _isTouchDevice = __webpack_require__(/*! is-touch-device */ "./node_modules/is-touch-device/build/index.js");
var _isTouchDevice2 = _interopRequireDefault(_isTouchDevice);
var _defaultPhrases = __webpack_require__(/*! ../defaultPhrases */ "./node_modules/react-dates/lib/defaultPhrases.js");
var _getPhrasePropTypes = __webpack_require__(/*! ../utils/getPhrasePropTypes */ "./node_modules/react-dates/lib/utils/getPhrasePropTypes.js");
var _getPhrasePropTypes2 = _interopRequireDefault(_getPhrasePropTypes);
var _isInclusivelyAfterDay = __webpack_require__(/*! ../utils/isInclusivelyAfterDay */ "./node_modules/react-dates/lib/utils/isInclusivelyAfterDay.js");
var _isInclusivelyAfterDay2 = _interopRequireDefault(_isInclusivelyAfterDay);
var _isNextDay = __webpack_require__(/*! ../utils/isNextDay */ "./node_modules/react-dates/lib/utils/isNextDay.js");
var _isNextDay2 = _interopRequireDefault(_isNextDay);
var _isSameDay = __webpack_require__(/*! ../utils/isSameDay */ "./node_modules/react-dates/lib/utils/isSameDay.js");
var _isSameDay2 = _interopRequireDefault(_isSameDay);
var _isAfterDay = __webpack_require__(/*! ../utils/isAfterDay */ "./node_modules/react-dates/lib/utils/isAfterDay.js");
var _isAfterDay2 = _interopRequireDefault(_isAfterDay);
var _isBeforeDay = __webpack_require__(/*! ../utils/isBeforeDay */ "./node_modules/react-dates/lib/utils/isBeforeDay.js");
var _isBeforeDay2 = _interopRequireDefault(_isBeforeDay);
var _getVisibleDays = __webpack_require__(/*! ../utils/getVisibleDays */ "./node_modules/react-dates/lib/utils/getVisibleDays.js");
var _getVisibleDays2 = _interopRequireDefault(_getVisibleDays);
var _isDayVisible = __webpack_require__(/*! ../utils/isDayVisible */ "./node_modules/react-dates/lib/utils/isDayVisible.js");
var _isDayVisible2 = _interopRequireDefault(_isDayVisible);
var _getSelectedDateOffset = __webpack_require__(/*! ../utils/getSelectedDateOffset */ "./node_modules/react-dates/lib/utils/getSelectedDateOffset.js");
var _getSelectedDateOffset2 = _interopRequireDefault(_getSelectedDateOffset);
var _toISODateString = __webpack_require__(/*! ../utils/toISODateString */ "./node_modules/react-dates/lib/utils/toISODateString.js");
var _toISODateString2 = _interopRequireDefault(_toISODateString);
var _toISOMonthString = __webpack_require__(/*! ../utils/toISOMonthString */ "./node_modules/react-dates/lib/utils/toISOMonthString.js");
var _toISOMonthString2 = _interopRequireDefault(_toISOMonthString);
var _DisabledShape = __webpack_require__(/*! ../shapes/DisabledShape */ "./node_modules/react-dates/lib/shapes/DisabledShape.js");
var _DisabledShape2 = _interopRequireDefault(_DisabledShape);
var _FocusedInputShape = __webpack_require__(/*! ../shapes/FocusedInputShape */ "./node_modules/react-dates/lib/shapes/FocusedInputShape.js");
var _FocusedInputShape2 = _interopRequireDefault(_FocusedInputShape);
var _ScrollableOrientationShape = __webpack_require__(/*! ../shapes/ScrollableOrientationShape */ "./node_modules/react-dates/lib/shapes/ScrollableOrientationShape.js");
var _ScrollableOrientationShape2 = _interopRequireDefault(_ScrollableOrientationShape);
var _DayOfWeekShape = __webpack_require__(/*! ../shapes/DayOfWeekShape */ "./node_modules/react-dates/lib/shapes/DayOfWeekShape.js");
var _DayOfWeekShape2 = _interopRequireDefault(_DayOfWeekShape);
var _CalendarInfoPositionShape = __webpack_require__(/*! ../shapes/CalendarInfoPositionShape */ "./node_modules/react-dates/lib/shapes/CalendarInfoPositionShape.js");
var _CalendarInfoPositionShape2 = _interopRequireDefault(_CalendarInfoPositionShape);
var _constants = __webpack_require__(/*! ../constants */ "./node_modules/react-dates/lib/constants.js");
var _DayPicker = __webpack_require__(/*! ./DayPicker */ "./node_modules/react-dates/lib/components/DayPicker.js");
var _DayPicker2 = _interopRequireDefault(_DayPicker);
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 propTypes = (0, _airbnbPropTypes.forbidExtraProps)({
startDate: _reactMomentProptypes2['default'].momentObj,
endDate: _reactMomentProptypes2['default'].momentObj,
onDatesChange: _propTypes2['default'].func,
startDateOffset: _propTypes2['default'].func,
endDateOffset: _propTypes2['default'].func,
focusedInput: _FocusedInputShape2['default'],
onFocusChange: _propTypes2['default'].func,
onClose: _propTypes2['default'].func,
keepOpenOnDateSelect: _propTypes2['default'].bool,
minimumNights: _propTypes2['default'].number,
disabled: _DisabledShape2['default'],
isOutsideRange: _propTypes2['default'].func,
isDayBlocked: _propTypes2['default'].func,
isDayHighlighted: _propTypes2['default'].func,
// DayPicker props
renderMonthText: (0, _airbnbPropTypes.mutuallyExclusiveProps)(_propTypes2['default'].func, 'renderMonthText', 'renderMonthElement'),
renderMonthElement: (0, _airbnbPropTypes.mutuallyExclusiveProps)(_propTypes2['default'].func, 'renderMonthText', 'renderMonthElement'),
enableOutsideDays: _propTypes2['default'].bool,
numberOfMonths: _propTypes2['default'].number,
orientation: _ScrollableOrientationShape2['default'],
withPortal: _propTypes2['default'].bool,
initialVisibleMonth: _propTypes2['default'].func,
hideKeyboardShortcutsPanel: _propTypes2['default'].bool,
daySize: _airbnbPropTypes.nonNegativeInteger,
noBorder: _propTypes2['default'].bool,
verticalBorderSpacing: _airbnbPropTypes.nonNegativeInteger,
horizontalMonthPadding: _airbnbPropTypes.nonNegativeInteger,
navPrev: _propTypes2['default'].node,
navNext: _propTypes2['default'].node,
noNavButtons: _propTypes2['default'].bool,
onPrevMonthClick: _propTypes2['default'].func,
onNextMonthClick: _propTypes2['default'].func,
onOutsideClick: _propTypes2['default'].func,
renderCalendarDay: _propTypes2['default'].func,
renderDayContents: _propTypes2['default'].func,
renderCalendarInfo: _propTypes2['default'].func,
calendarInfoPosition: _CalendarInfoPositionShape2['default'],
firstDayOfWeek: _DayOfWeekShape2['default'],
verticalHeight: _airbnbPropTypes.nonNegativeInteger,
transitionDuration: _airbnbPropTypes.nonNegativeInteger,
// accessibility
onBlur: _propTypes2['default'].func,
isFocused: _propTypes2['default'].bool,
showKeyboardShortcuts: _propTypes2['default'].bool,
// i18n
monthFormat: _propTypes2['default'].string,
weekDayFormat: _propTypes2['default'].string,
phrases: _propTypes2['default'].shape((0, _getPhrasePropTypes2['default'])(_defaultPhrases.DayPickerPhrases)),
dayAriaLabelFormat: _propTypes2['default'].string,
isRTL: _propTypes2['default'].bool
});
var defaultProps = {
startDate: undefined,
// TODO: use null
endDate: undefined,
// TODO: use null
onDatesChange: function () {
function onDatesChange() {}
return onDatesChange;
}(),
startDateOffset: undefined,
endDateOffset: undefined,
focusedInput: null,
onFocusChange: function () {
function onFocusChange() {}
return onFocusChange;
}(),
onClose: function () {
function onClose() {}
return onClose;
}(),
keepOpenOnDateSelect: false,
minimumNights: 1,
disabled: false,
isOutsideRange: function () {
function isOutsideRange() {}
return isOutsideRange;
}(),
isDayBlocked: function () {
function isDayBlocked() {}
return isDayBlocked;
}(),
isDayHighlighted: function () {
function isDayHighlighted() {}
return isDayHighlighted;
}(),
// DayPicker props
renderMonthText: null,
enableOutsideDays: false,
numberOfMonths: 1,
orientation: _constants.HORIZONTAL_ORIENTATION,
withPortal: false,
hideKeyboardShortcutsPanel: false,
initialVisibleMonth: null,
daySize: _constants.DAY_SIZE,
navPrev: null,
navNext: null,
noNavButtons: false,
onPrevMonthClick: function () {
function onPrevMonthClick() {}
return onPrevMonthClick;
}(),
onNextMonthClick: function () {
function onNextMonthClick() {}
return onNextMonthClick;
}(),
onOutsideClick: function () {
function onOutsideClick() {}
return onOutsideClick;
}(),
renderCalendarDay: undefined,
renderDayContents: null,
renderCalendarInfo: null,
renderMonthElement: null,
calendarInfoPosition: _constants.INFO_POSITION_BOTTOM,
firstDayOfWeek: null,
verticalHeight: null,
noBorder: false,
transitionDuration: undefined,
verticalBorderSpacing: undefined,
horizontalMonthPadding: 13,
// accessibility
onBlur: function () {
function onBlur() {}
return onBlur;
}(),
isFocused: false,
showKeyboardShortcuts: false,
// i18n
monthFormat: 'MMMM YYYY',
weekDayFormat: 'dd',
phrases: _defaultPhrases.DayPickerPhrases,
dayAriaLabelFormat: undefined,
isRTL: false
};
var getChooseAvailableDatePhrase = function getChooseAvailableDatePhrase(phrases, focusedInput) {
if (focusedInput === _constants.START_DATE) {
return phrases.chooseAvailableStartDate;
}
if (focusedInput === _constants.END_DATE) {
return phrases.chooseAvailableEndDate;
}
return phrases.chooseAvailableDate;
};
var DayPickerRangeController = function (_React$Component) {
_inherits(DayPickerRangeController, _React$Component);
function DayPickerRangeController(props) {
_classCallCheck(this, DayPickerRangeController);
var _this = _possibleConstructorReturn(this, (DayPickerRangeController.__proto__ || Object.getPrototypeOf(DayPickerRangeController)).call(this, props));
_this.isTouchDevice = (0, _isTouchDevice2['default'])();
_this.today = (0, _moment2['default'])();
_this.modifiers = {
today: function () {
function today(day) {
return _this.isToday(day);
}
return today;
}(),
blocked: function () {
function blocked(day) {
return _this.isBlocked(day);
}
return blocked;
}(),
'blocked-calendar': function () {
function blockedCalendar(day) {
return props.isDayBlocked(day);
}
return blockedCalendar;
}(),
'blocked-out-of-range': function () {
function blockedOutOfRange(day) {
return props.isOutsideRange(day);
}
return blockedOutOfRange;
}(),
'highlighted-calendar': function () {
function highlightedCalendar(day) {
return props.isDayHighlighted(day);
}
return highlightedCalendar;
}(),
valid: function () {
function valid(day) {
return !_this.isBlocked(day);
}
return valid;
}(),
'selected-start': function () {
function selectedStart(day) {
return _this.isStartDate(day);
}
return selectedStart;
}(),
'selected-end': function () {
function selectedEnd(day) {
return _this.isEndDate(day);
}
return selectedEnd;
}(),
'blocked-minimum-nights': function () {
function blockedMinimumNights(day) {
return _this.doesNotMeetMinimumNights(day);
}
return blockedMinimumNights;
}(),
'selected-span': function () {
function selectedSpan(day) {
return _this.isInSelectedSpan(day);
}
return selectedSpan;
}(),
'last-in-range': function () {
function lastInRange(day) {
return _this.isLastInRange(day);
}
return lastInRange;
}(),
hovered: function () {
function hovered(day) {
return _this.isHovered(day);
}
return hovered;
}(),
'hovered-span': function () {
function hoveredSpan(day) {
return _this.isInHoveredSpan(day);
}
return hoveredSpan;
}(),
'hovered-offset': function () {
function hoveredOffset(day) {
return _this.isInHoveredSpan(day);
}
return hoveredOffset;
}(),
'after-hovered-start': function () {
function afterHoveredStart(day) {
return _this.isDayAfterHoveredStartDate(day);
}
return afterHoveredStart;
}(),
'first-day-of-week': function () {
function firstDayOfWeek(day) {
return _this.isFirstDayOfWeek(day);
}
return firstDayOfWeek;
}(),
'last-day-of-week': function () {
function lastDayOfWeek(day) {
return _this.isLastDayOfWeek(day);
}
return lastDayOfWeek;
}()
};
var _this$getStateForNewM = _this.getStateForNewMonth(props),
currentMonth = _this$getStateForNewM.currentMonth,
visibleDays = _this$getStateForNewM.visibleDays; // initialize phrases
// set the appropriate CalendarDay phrase based on focusedInput
var chooseAvailableDate = getChooseAvailableDatePhrase(props.phrases, props.focusedInput);
_this.state = {
hoverDate: null,
currentMonth: currentMonth,
phrases: (0, _object2['default'])({}, props.phrases, {
chooseAvailableDate: chooseAvailableDate
}),
visibleDays: visibleDays
};
_this.onDayClick = _this.onDayClick.bind(_this);
_this.onDayMouseEnter = _this.onDayMouseEnter.bind(_this);
_this.onDayMouseLeave = _this.onDayMouseLeave.bind(_this);
_this.onPrevMonthClick = _this.onPrevMonthClick.bind(_this);
_this.onNextMonthClick = _this.onNextMonthClick.bind(_this);
_this.onMonthChange = _this.onMonthChange.bind(_this);
_this.onYearChange = _this.onYearChange.bind(_this);
_this.onMultiplyScrollableMonths = _this.onMultiplyScrollableMonths.bind(_this);
_this.getFirstFocusableDay = _this.getFirstFocusableDay.bind(_this);
return _this;
}
_createClass(DayPickerRangeController, [{
key: 'componentWillReceiveProps',
value: function () {
function componentWillReceiveProps(nextProps) {
var _this2 = this;
var startDate = nextProps.startDate,
endDate = nextProps.endDate,
focusedInput = nextProps.focusedInput,
minimumNights = nextProps.minimumNights,
isOutsideRange = nextProps.isOutsideRange,
isDayBlocked = nextProps.isDayBlocked,
isDayHighlighted = nextProps.isDayHighlighted,
phrases = nextProps.phrases,
initialVisibleMonth = nextProps.initialVisibleMonth,
numberOfMonths = nextProps.numberOfMonths,
enableOutsideDays = nextProps.enableOutsideDays;
var _props = this.props,
prevStartDate = _props.startDate,
prevEndDate = _props.endDate,
prevFocusedInput = _props.focusedInput,
prevMinimumNights = _props.minimumNights,
prevIsOutsideRange = _props.isOutsideRange,
prevIsDayBlocked = _props.isDayBlocked,
prevIsDayHighlighted = _props.isDayHighlighted,
prevPhrases = _props.phrases,
prevInitialVisibleMonth = _props.initialVisibleMonth,
prevNumberOfMonths = _props.numberOfMonths,
prevEnableOutsideDays = _props.enableOutsideDays;
var visibleDays = this.state.visibleDays;
var recomputeOutsideRange = false;
var recomputeDayBlocked = false;
var recomputeDayHighlighted = false;
if (isOutsideRange !== prevIsOutsideRange) {
this.modifiers['blocked-out-of-range'] = function (day) {
return isOutsideRange(day);
};
recomputeOutsideRange = true;
}
if (isDayBlocked !== prevIsDayBlocked) {
this.modifiers['blocked-calendar'] = function (day) {
return isDayBlocked(day);
};
recomputeDayBlocked = true;
}
if (isDayHighlighted !== prevIsDayHighlighted) {
this.modifiers['highlighted-calendar'] = function (day) {
return isDayHighlighted(day);
};
recomputeDayHighlighted = true;
}
var recomputePropModifiers = recomputeOutsideRange || recomputeDayBlocked || recomputeDayHighlighted;
var didStartDateChange = startDate !== prevStartDate;
var didEndDateChange = endDate !== prevEndDate;
var didFocusChange = focusedInput !== prevFocusedInput;
if (numberOfMonths !== prevNumberOfMonths || enableOutsideDays !== prevEnableOutsideDays || initialVisibleMonth !== prevInitialVisibleMonth && !prevFocusedInput && didFocusChange) {
var newMonthState = this.getStateForNewMonth(nextProps);
var currentMonth = newMonthState.currentMonth;
visibleDays = newMonthState.visibleDays;
this.setState({
currentMonth: currentMonth,
visibleDays: visibleDays
});
}
var modifiers = {};
if (didStartDateChange) {
modifiers = this.deleteModifier(modifiers, prevStartDate, 'selected-start');
modifiers = this.addModifier(modifiers, startDate, 'selected-start');
if (prevStartDate) {
var startSpan = prevStartDate.clone().add(1, 'day');
var endSpan = prevStartDate.clone().add(prevMinimumNights + 1, 'days');
modifiers = this.deleteModifierFromRange(modifiers, startSpan, endSpan, 'after-hovered-start');
}
}
if (didEndDateChange) {
modifiers = this.deleteModifier(modifiers, prevEndDate, 'selected-end');
modifiers = this.addModifier(modifiers, endDate, 'selected-end');
}
if (didStartDateChange || didEndDateChange) {
if (prevStartDate && prevEndDate) {
modifiers = this.deleteModifierFromRange(modifiers, prevStartDate, prevEndDate.clone().add(1, 'day'), 'selected-span');
}
if (startDate && endDate) {
modifiers = this.deleteModifierFromRange(modifiers, startDate, endDate.clone().add(1, 'day'), 'hovered-span');
modifiers = this.addModifierToRange(modifiers, startDate.clone().add(1, 'day'), endDate, 'selected-span');
}
}
if (!this.isTouchDevice && didStartDateChange && startDate && !endDate) {
var _startSpan = startDate.clone().add(1, 'day');
var _endSpan = startDate.clone().add(minimumNights + 1, 'days');
modifiers = this.addModifierToRange(modifiers, _startSpan, _endSpan, 'after-hovered-start');
}
if (prevMinimumNights > 0) {
if (didFocusChange || didStartDateChange || minimumNights !== prevMinimumNights) {
var _startSpan2 = prevStartDate || this.today;
modifiers = this.deleteModifierFromRange(modifiers, _startSpan2, _startSpan2.clone().add(prevMinimumNights, 'days'), 'blocked-minimum-nights');
modifiers = this.deleteModifierFromRange(modifiers, _startSpan2, _startSpan2.clone().add(prevMinimumNights, 'days'), 'blocked');
}
}
if (didFocusChange || recomputePropModifiers) {
(0, _object4['default'])(visibleDays).forEach(function (days) {
Object.keys(days).forEach(function (day) {
var momentObj = (0, _moment2['default'])(day);
var isBlocked = false;
if (didFocusChange || recomputeOutsideRange) {
if (isOutsideRange(momentObj)) {
modifiers = _this2.addModifier(modifiers, momentObj, 'blocked-out-of-range');
isBlocked = true;
} else {
modifiers = _this2.deleteModifier(modifiers, momentObj, 'blocked-out-of-range');
}
}
if (didFocusChange || recomputeDayBlocked) {
if (isDayBlocked(momentObj)) {
modifiers = _this2.addModifier(modifiers, momentObj, 'blocked-calendar');
isBlocked = true;
} else {
modifiers = _this2.deleteModifier(modifiers, momentObj, 'blocked-calendar');
}
}
if (isBlocked) {
modifiers = _this2.addModifier(modifiers, momentObj, 'blocked');
} else {
modifiers = _this2.deleteModifier(modifiers, momentObj, 'blocked');
}
if (didFocusChange || recomputeDayHighlighted) {
if (isDayHighlighted(momentObj)) {
modifiers = _this2.addModifier(modifiers, momentObj, 'highlighted-calendar');
} else {
modifiers = _this2.deleteModifier(modifiers, momentObj, 'highlighted-calendar');
}
}
});
});
}
if (minimumNights > 0 && startDate && focusedInput === _constants.END_DATE) {
modifiers = this.addModifierToRange(modifiers, startDate, startDate.clone().add(minimumNights, 'days'), 'blocked-minimum-nights');
modifiers = this.addModifierToRange(modifiers, startDate, startDate.clone().add(minimumNights, 'days'), 'blocked');
}
var today = (0, _moment2['default'])();
if (!(0, _isSameDay2['default'])(this.today, today)) {
modifiers = this.deleteModifier(modifiers, this.today, 'today');
modifiers = this.addModifier(modifiers, today, 'today');
this.today = today;
}
if (Object.keys(modifiers).length > 0) {
this.setState({
visibleDays: (0, _object2['default'])({}, visibleDays, modifiers)
});
}
if (didFocusChange || phrases !== prevPhrases) {
// set the appropriate CalendarDay phrase based on focusedInput
var chooseAvailableDate = getChooseAvailableDatePhrase(phrases, focusedInput);
this.setState({
phrases: (0, _object2['default'])({}, phrases, {
chooseAvailableDate: chooseAvailableDate
})
});
}
}
return componentWillReceiveProps;
}()
}, {
key: 'onDayClick',
value: function () {
function onDayClick(day, e) {
var _props2 = this.props,
keepOpenOnDateSelect = _props2.keepOpenOnDateSelect,
minimumNights = _props2.minimumNights,
onBlur = _props2.onBlur,
focusedInput = _props2.focusedInput,
onFocusChange = _props2.onFocusChange,
onClose = _props2.onClose,
onDatesChange = _props2.onDatesChange,
startDateOffset = _props2.startDateOffset,
endDateOffset = _props2.endDateOffset,
disabled = _props2.disabled;
if (e) e.preventDefault();
if (this.isBlocked(day)) return;
var _props3 = this.props,
startDate = _props3.startDate,
endDate = _props3.endDate;
if (startDateOffset || endDateOffset) {
startDate = (0, _getSelectedDateOffset2['default'])(startDateOffset, day);
endDate = (0, _getSelectedDateOffset2['default'])(endDateOffset, day);
if (!keepOpenOnDateSelect) {
onFocusChange(null);
onClose({
startDate: startDate,
endDate: endDate
});
}
} else if (focusedInput === _constants.START_DATE) {
var lastAllowedStartDate = endDate && endDate.clone().subtract(minimumNights, 'days');
var isStartDateAfterEndDate = (0, _isBeforeDay2['default'])(lastAllowedStartDate, day) || (0, _isAfterDay2['default'])(startDate, endDate);
var isEndDateDisabled = disabled === _constants.END_DATE;
if (!isEndDateDisabled || !isStartDateAfterEndDate) {
startDate = day;
if (isStartDateAfterEndDate) {
endDate = null;
}
}
if (isEndDateDisabled && !isStartDateAfterEndDate) {
onFocusChange(null);
onClose({
startDate: startDate,
endDate: endDate
});
} else if (!isEndDateDisabled) {
onFocusChange(_constants.END_DATE);
}
} else if (focusedInput === _constants.END_DATE) {
var firstAllowedEndDate = startDate && startDate.clone().add(minimumNights, 'days');
if (!startDate) {
endDate = day;
onFocusChange(_constants.START_DATE);
} else if ((0, _isInclusivelyAfterDay2['default'])(day, firstAllowedEndDate)) {
endDate = day;
if (!keepOpenOnDateSelect) {
onFocusChange(null);
onClose({
startDate: startDate,
endDate: endDate
});
}
} else if (disabled !== _constants.START_DATE) {
startDate = day;
endDate = null;
}
}
onDatesChange({
startDate: startDate,
endDate: endDate
});
onBlur();
}
return onDayClick;
}()
}, {
key: 'onDayMouseEnter',
value: function () {
function onDayMouseEnter(day) {
/* eslint react/destructuring-assignment: 1 */
if (this.isTouchDevice) return;
var _props4 = this.props,
startDate = _props4.startDate,
endDate = _props4.endDate,
focusedInput = _props4.focusedInput,
minimumNights = _props4.minimumNights,
startDateOffset = _props4.startDateOffset,
endDateOffset = _props4.endDateOffset;
var _state = this.state,
hoverDate = _state.hoverDate,
visibleDays = _state.visibleDays;
var dateOffset = null;
if (focusedInput) {
var hasOffset = startDateOffset || endDateOffset;
var modifiers = {};
if (hasOffset) {
var start = (0, _getSelectedDateOffset2['default'])(startDateOffset, day);
var end = (0, _getSelectedDateOffset2['default'])(endDateOffset, day, function (rangeDay) {
return rangeDay.add(1, 'day');
});
dateOffset = {
start: start,
end: end
}; // eslint-disable-next-line react/destructuring-assignment
if (this.state.dateOffset && this.state.dateOffset.start && this.state.dateOffset.end) {
modifiers = this.deleteModifierFromRange(modifiers, this.state.dateOffset.start, this.state.dateOffset.end, 'hovered-offset');
}
modifiers = this.addModifierToRange(modifiers, start, end, 'hovered-offset');
}
if (!hasOffset) {
modifiers = this.deleteModifier(modifiers, hoverDate, 'hovered');
modifiers = this.addModifier(modifiers, day, 'hovered');
if (startDate && !endDate && focusedInput === _constants.END_DATE) {
if ((0, _isAfterDay2['default'])(hoverDate, startDate)) {
var endSpan = hoverDate.clone().add(1, 'day');
modifiers = this.deleteModifierFromRange(modifiers, startDate, endSpan, 'hovered-span');
}
if (!this.isBlocked(day) && (0, _isAfterDay2['default'])(day, startDate)) {
var _endSpan2 = day.clone().add(1, 'day');
modifiers = this.addModifierToRange(modifiers, startDate, _endSpan2, 'hovered-span');
}
}
if (!startDate && endDate && focusedInput === _constants.START_DATE) {
if ((0, _isBeforeDay2['default'])(hoverDate, endDate)) {
modifiers = this.deleteModifierFromRange(modifiers, hoverDate, endDate, 'hovered-span');
}
if (!this.isBlocked(day) && (0, _isBeforeDay2['default'])(day, endDate)) {
modifiers = this.addModifierToRange(modifiers, day, endDate, 'hovered-span');
}
}
if (startDate) {
var startSpan = startDate.clone().add(1, 'day');
var _endSpan3 = startDate.clone().add(minimumNights + 1, 'days');
modifiers = this.deleteModifierFromRange(modifiers, startSpan, _endSpan3, 'after-hovered-start');
if ((0, _isSameDay2['default'])(day, startDate)) {
var newStartSpan = startDate.clone().add(1, 'day');
var newEndSpan = startDate.clone().add(minimumNights + 1, 'days');
modifiers = this.addModifierToRange(modifiers, newStartSpan, newEndSpan, 'after-hovered-start');
}
}
}
this.setState({
hoverDate: day,
dateOffset: dateOffset,
visibleDays: (0, _object2['default'])({}, visibleDays, modifiers)
});
}
}
return onDayMouseEnter;
}()
}, {
key: 'onDayMouseLeave',
value: function () {
function onDayMouseLeave(day) {
var _props5 = this.props,
startDate = _props5.startDate,
endDate = _props5.endDate,
minimumNights = _props5.minimumNights;
var _state2 = this.state,
hoverDate = _state2.hoverDate,
visibleDays = _state2.visibleDays,
dateOffset = _state2.dateOffset;
if (this.isTouchDevice || !hoverDate) return;
var modifiers = {};
modifiers = this.deleteModifier(modifiers, hoverDate, 'hovered');
if (dateOffset) {
modifiers = this.deleteModifierFromRange(modifiers, this.state.dateOffset.start, this.state.dateOffset.end, 'hovered-offset');
}
if (startDate && !endDate && (0, _isAfterDay2['default'])(hoverDate, startDate)) {
var endSpan = hoverDate.clone().add(1, 'day');
modifiers = this.deleteModifierFromRange(modifiers, startDate, endSpan, 'hovered-span');
}
if (!startDate && endDate && (0, _isAfterDay2['default'])(endDate, hoverDate)) {
modifiers = this.deleteModifierFromRange(modifiers, hoverDate, endDate, 'hovered-span');
}
if (startDate && (0, _isSameDay2['default'])(day, startDate)) {
var startSpan = startDate.clone().add(1, 'day');
var _endSpan4 = startDate.clone().add(minimumNights + 1, 'days');
modifiers = this.deleteModifierFromRange(modifiers, startSpan, _endSpan4, 'after-hovered-start');
}
this.setState({
hoverDate: null,
visibleDays: (0, _object2['default'])({}, visibleDays, modifiers)
});
}
return onDayMouseLeave;
}()
}, {
key: 'onPrevMonthClick',
value: function () {
function onPrevMonthClick() {
var _props6 = this.props,
onPrevMonthClick = _props6.onPrevMonthClick,
numberOfMonths = _props6.numberOfMonths,
enableOutsideDays = _props6.enableOutsideDays;
var _state3 = this.state,
currentMonth = _state3.currentMonth,
visibleDays = _state3.visibleDays;
var newVisibleDays = {};
Object.keys(visibleDays).sort().slice(0, numberOfMonths + 1).forEach(function (month) {
newVisibleDays[month] = visibleDays[month];
});
var prevMonth = currentMonth.clone().subtract(2, 'months');
var prevMonthVisibleDays = (0, _getVisibleDays2['default'])(prevMonth, 1, enableOutsideDays, true);
var newCurrentMonth = currentMonth.clone().subtract(1, 'month');
this.setState({
currentMonth: newCurrentMonth,
visibleDays: (0, _object2['default'])({}, newVisibleDays, this.getModifiers(prevMonthVisibleDays))
}, function () {
onPrevMonthClick(newCurrentMonth.clone());
});
}
return onPrevMonthClick;
}()
}, {
key: 'onNextMonthClick',
value: function () {
function onNextMonthClick() {
var _props7 = this.props,
onNextMonthClick = _props7.onNextMonthClick,
numberOfMonths = _props7.numberOfMonths,
enableOutsideDays = _props7.enableOutsideDays;
var _state4 = this.state,
currentMonth = _state4.currentMonth,
visibleDays = _state4.visibleDays;
var newVisibleDays = {};
Object.keys(visibleDays).sort().slice(1).forEach(function (month) {
newVisibleDays[month] = visibleDays[month];
});
var nextMonth = currentMonth.clone().add(numberOfMonths + 1, 'month');
var nextMonthVisibleDays = (0, _getVisibleDays2['default'])(nextMonth, 1, enableOutsideDays, true);
var newCurrentMonth = currentMonth.clone().add(1, 'month');
this.setState({
currentMonth: newCurrentMonth,
visibleDays: (0, _object2['default'])({}, newVisibleDays, this.getModifiers(nextMonthVisibleDays))
}, function () {
onNextMonthClick(newCurrentMonth.clone());
});
}
return onNextMonthClick;
}()
}, {
key: 'onMonthChange',
value: function () {
function onMonthChange(newMonth) {
var _props8 = this.props,
numberOfMonths = _props8.numberOfMonths,
enableOutsideDays = _props8.enableOutsideDays,
orientation = _props8.orientation;
var withoutTransitionMonths = orientation === _constants.VERTICAL_SCROLLABLE;
var newVisibleDays = (0, _getVisibleDays2['default'])(newMonth, numberOfMonths, enableOutsideDays, withoutTransitionMonths);
this.setState({
currentMonth: newMonth.clone(),
visibleDays: this.getModifiers(newVisibleDays)
});
}
return onMonthChange;
}()
}, {
key: 'onYearChange',
value: function () {
function onYearChange(newMonth) {
var _props9 = this.props,
numberOfMonths = _props9.numberOfMonths,
enableOutsideDays = _props9.enableOutsideDays,
orientation = _props9.orientation;
var withoutTransitionMonths = orientation === _constants.VERTICAL_SCROLLABLE;
var newVisibleDays = (0, _getVisibleDays2['default'])(newMonth, numberOfMonths, enableOutsideDays, withoutTransitionMonths);
this.setState({
currentMonth: newMonth.clone(),
visibleDays: this.getModifiers(newVisibleDays)
});
}
return onYearChange;
}()
}, {
key: 'onMultiplyScrollableMonths',
value: function () {
function onMultiplyScrollableMonths() {
var _props10 = this.props,
numberOfMonths = _props10.numberOfMonths,
enableOutsideDays = _props10.enableOutsideDays;
var _state5 = this.state,
currentMonth = _state5.currentMonth,
visibleDays = _state5.visibleDays;
var numberOfVisibleMonths = Object.keys(visibleDays).length;
var nextMonth = currentMonth.clone().add(numberOfVisibleMonths, 'month');
var newVisibleDays = (0, _getVisibleDays2['default'])(nextMonth, numberOfMonths, enableOutsideDays, true);
this.setState({
visibleDays: (0, _object2['default'])({}, visibleDays, this.getModifiers(newVisibleDays))
});
}
return onMultiplyScrollableMonths;
}()
}, {
key: 'getFirstFocusableDay',
value: function () {
function getFirstFocusableDay(newMonth) {
var _this3 = this;
var _props11 = this.props,
startDate = _props11.startDate,
endDate = _props11.endDate,
focusedInput = _props11.focusedInput,
minimumNights = _props11.minimumNights,
numberOfMonths = _props11.numberOfMonths;
var focusedDate = newMonth.clone().startOf('month');
if (focusedInput === _constants.START_DATE && startDate) {
focusedDate = startDate.clone();
} else if (focusedInput === _constants.END_DATE && !endDate && startDate) {
focusedDate = startDate.clone().add(minimumNights, 'days');
} else if (focusedInput === _constants.END_DATE && endDate) {
focusedDate = endDate.clone();
}
if (this.isBlocked(focusedDate)) {
var days = [];
var lastVisibleDay = newMonth.clone().add(numberOfMonths - 1, 'months').endOf('month');
var currentDay = focusedDate.clone();
while (!(0, _isAfterDay2['default'])(currentDay, lastVisibleDay)) {
currentDay = currentDay.clone().add(1, 'day');
days.push(currentDay);
}
var viableDays = days.filter(function (day) {
return !_this3.isBlocked(day);
});
if (viableDays.length > 0) {
var _viableDays = _slicedToArray(viableDays, 1);
focusedDate = _viableDays[0];
}
}
return focusedDate;
}
return getFirstFocusableDay;
}()
}, {
key: 'getModifiers',
value: function () {
function getModifiers(visibleDays) {
var _this4 = this;
var modifiers = {};
Object.keys(visibleDays).forEach(function (month) {
modifiers[month] = {};
visibleDays[month].forEach(function (day) {
modifiers[month][(0, _toISODateString2['default'])(day)] = _this4.getModifiersForDay(day);
});
});
return modifiers;
}
return getModifiers;
}()
}, {
key: 'getModifiersForDay',
value: function () {
function getModifiersForDay(day) {
var _this5 = this;
return new Set(Object.keys(this.modifiers).filter(function (modifier) {
return _this5.modifiers[modifier](day);
}));
}
return getModifiersForDay;
}()
}, {
key: 'getStateForNewMonth',
value: function () {
function getStateForNewMonth(nextProps) {
var _this6 = this;
var initialVisibleMonth = nextProps.initialVisibleMonth,
numberOfMonths = nextProps.numberOfMonths,
enableOutsideDays = nextProps.enableOutsideDays,
orientation = nextProps.orientation,
startDate = nextProps.startDate;
var initialVisibleMonthThunk = initialVisibleMonth || (startDate ? function () {
return startDate;
} : function () {
return _this6.today;
});
var currentMonth = initialVisibleMonthThunk();
var withoutTransitionMonths = orientation === _constants.VERTICAL_SCROLLABLE;
var visibleDays = this.getModifiers((0, _getVisibleDays2['default'])(currentMonth, numberOfMonths, enableOutsideDays, withoutTransitionMonths));
return {
currentMonth: currentMonth,
visibleDays: visibleDays
};
}
return getStateForNewMonth;
}()
}, {
key: 'addModifier',
value: function () {
function addModifier(updatedDays, day, modifier) {
var _props12 = this.props,
numberOfVisibleMonths = _props12.numberOfMonths,
enableOutsideDays = _props12.enableOutsideDays,
orientation = _props12.orientation;
var _state6 = this.state,
firstVisibleMonth = _state6.currentMonth,
visibleDays = _state6.visibleDays;
var currentMonth = firstVisibleMonth;
var numberOfMonths = numberOfVisibleMonths;
if (orientation === _constants.VERTICAL_SCROLLABLE) {
numberOfMonths = Object.keys(visibleDays).length;
} else {
currentMonth = currentMonth.clone().subtract(1, 'month');
numberOfMonths += 2;
}
if (!day || !(0, _isDayVisible2['default'])(day, currentMonth, numberOfMonths, enableOutsideDays)) {
return updatedDays;
}
var iso = (0, _toISODateString2['default'])(day);
var updatedDaysAfterAddition = (0, _object2['default'])({}, updatedDays);
if (enableOutsideDays) {
var monthsToUpdate = Object.keys(visibleDays).filter(function (monthKey) {
return Object.keys(visibleDays[monthKey]).indexOf(iso) > -1;
});
updatedDaysAfterAddition = monthsToUpdate.reduce(function (days, monthIso) {
var month = updatedDays[monthIso] || visibleDays[monthIso];
var modifiers = new Set(month[iso]);
modifiers.add(modifier);
return (0, _object2['default'])({}, days, _defineProperty({}, monthIso, (0, _object2['default'])({}, month, _defineProperty({}, iso, modifiers))));
}, updatedDaysAfterAddition);
} else {
var monthIso = (0, _toISOMonthString2['default'])(day);
var month = updatedDays[monthIso] || visibleDays[monthIso];
var modifiers = new Set(month[iso]);
modifiers.add(modifier);
updatedDaysAfterAddition = (0, _object2['default'])({}, updatedDaysAfterAddition, _defineProperty({}, monthIso, (0, _object2['default'])({}, month, _defineProperty({}, iso, modifiers))));
}
return updatedDaysAfterAddition;
}
return addModifier;
}()
}, {
key: 'addModifierToRange',
value: function () {
function addModifierToRange(updatedDays, start, end, modifier) {
var days = updatedDays;
var spanStart = start.clone();
while ((0, _isBeforeDay2['default'])(spanStart, end)) {
days = this.addModifier(days, spanStart, modifier);
spanStart = spanStart.clone().add(1, 'day');
}
return days;
}
return addModifierToRange;
}()
}, {
key: 'deleteModifier',
value: function () {
function deleteModifier(updatedDays, day, modifier) {
var _props13 = this.props,
numberOfVisibleMonths = _props13.numberOfMonths,
enableOutsideDays = _props13.enableOutsideDays,
orientation = _props13.orientation;
var _state7 = this.state,
firstVisibleMonth = _state7.currentMonth,
visibleDays = _state7.visibleDays;
var currentMonth = firstVisibleMonth;
var numberOfMonths = numberOfVisibleMonths;
if (orientation === _constants.VERTICAL_SCROLLABLE) {
numberOfMonths = Object.keys(visibleDays).length;
} else {
currentMonth = currentMonth.clone().subtract(1, 'month');
numberOfMonths += 2;
}
if (!day || !(0, _isDayVisible2['default'])(day, currentMonth, numberOfMonths, enableOutsideDays)) {
return updatedDays;
}
var iso = (0, _toISODateString2['default'])(day);
var updatedDaysAfterDeletion = (0, _object2['default'])({}, updatedDays);
if (enableOutsideDays) {
var monthsToUpdate = Object.keys(visibleDays).filter(function (monthKey) {
return Object.keys(visibleDays[monthKey]).indexOf(iso) > -1;
});
updatedDaysAfterDeletion = monthsToUpdate.reduce(function (days, monthIso) {
var month = updatedDays[monthIso] || visibleDays[monthIso];
var modifiers = new Set(month[iso]);
modifiers['delete'](modifier);
return (0, _object2['default'])({}, days, _defineProperty({}, monthIso, (0, _object2['default'])({}, month, _defineProperty({}, iso, modifiers))));
}, updatedDaysAfterDeletion);
} else {
var monthIso = (0, _toISOMonthString2['default'])(day);
var month = updatedDays[monthIso] || visibleDays[monthIso];
var modifiers = new Set(month[iso]);
modifiers['delete'](modifier);
updatedDaysAfterDeletion = (0, _object2['default'])({}, updatedDaysAfterDeletion, _defineProperty({}, monthIso, (0, _object2['default'])({}, month, _defineProperty({}, iso, modifiers))));
}
return updatedDaysAfterDeletion;
}
return deleteModifier;
}()
}, {
key: 'deleteModifierFromRange',
value: function () {
function deleteModifierFromRange(updatedDays, start, end, modifier) {
var days = updatedDays;
var spanStart = start.clone();
while ((0, _isBeforeDay2['default'])(spanStart, end)) {
days = this.deleteModifier(days, spanStart, modifier);
spanStart = spanStart.clone().add(1, 'day');
}
return days;
}
return deleteModifierFromRange;
}()
}, {
key: 'doesNotMeetMinimumNights',
value: function () {
function doesNotMeetMinimumNights(day) {
var _props14 = this.props,
startDate = _props14.startDate,
isOutsideRange = _props14.isOutsideRange,
focusedInput = _props14.focusedInput,
minimumNights = _props14.minimumNights;
if (focusedInput !== _constants.END_DATE) return false;
if (startDate) {
var dayDiff = day.diff(startDate.clone().startOf('day').hour(12), 'days');
return dayDiff < minimumNights && dayDiff >= 0;
}
return isOutsideRange((0, _moment2['default'])(day).subtract(minimumNights, 'days'));
}
return doesNotMeetMinimumNights;
}()
}, {
key: 'isDayAfterHoveredStartDate',
value: function () {
function isDayAfterHoveredStartDate(day) {
var _props15 = this.props,
startDate = _props15.startDate,
endDate = _props15.endDate,
minimumNights = _props15.minimumNights;
var _ref = this.state || {},
hoverDate = _ref.hoverDate;
return !!startDate && !endDate && !this.isBlocked(day) && (0, _isNextDay2['default'])(hoverDate, day) && minimumNights > 0 && (0, _isSameDay2['default'])(hoverDate, startDate);
}
return isDayAfterHoveredStartDate;
}()
}, {
key: 'isEndDate',
value: function () {
function isEndDate(day) {
var endDate = this.props.endDate;
return (0, _isSameDay2['default'])(day, endDate);
}
return isEndDate;
}()
}, {
key: 'isHovered',
value: function () {
function isHovered(day) {
var _ref2 = this.state || {},
hoverDate = _ref2.hoverDate;
var focusedInput = this.props.focusedInput;
return !!focusedInput && (0, _isSameDay2['default'])(day, hoverDate);
}
return isHovered;
}()
}, {
key: 'isInHoveredSpan',
value: function () {
function isInHoveredSpan(day) {
var _props16 = this.props,
startDate = _props16.startDate,
endDate = _props16.endDate;
var _ref3 = this.state || {},
hoverDate = _ref3.hoverDate;
var isForwardRange = !!startDate && !endDate && (day.isBetween(startDate, hoverDate) || (0, _isSameDay2['default'])(hoverDate, day));
var isBackwardRange = !!endDate && !startDate && (day.isBetween(hoverDate, endDate) || (0, _isSameDay2['default'])(hoverDate, day));
var isValidDayHovered = hoverDate && !this.isBlocked(hoverDate);
return (isForwardRange || isBackwardRange) && isValidDayHovered;
}
return isInHoveredSpan;
}()
}, {
key: 'isInSelectedSpan',
value: function () {
function isInSelectedSpan(day) {
var _props17 = this.props,
startDate = _props17.startDate,
endDate = _props17.endDate;
return day.isBetween(startDate, endDate);
}
return isInSelectedSpan;
}()
}, {
key: 'isLastInRange',
value: function () {
function isLastInRange(day) {
var endDate = this.props.endDate;
return this.isInSelectedSpan(day) && (0, _isNextDay2['default'])(day, endDate);
}
return isLastInRange;
}()
}, {
key: 'isStartDate',
value: function () {
function isStartDate(day) {
var startDate = this.props.startDate;
return (0, _isSameDay2['default'])(day, startDate);
}
return isStartDate;
}()
}, {
key: 'isBlocked',
value: function () {
function isBlocked(day) {
var _props18 = this.props,
isDayBlocked = _props18.isDayBlocked,
isOutsideRange = _props18.isOutsideRange;
return isDayBlocked(day) || isOutsideRange(day) || this.doesNotMeetMinimumNights(day);
}
return isBlocked;
}()
}, {
key: 'isToday',
value: function () {
function isToday(day) {
return (0, _isSameDay2['default'])(day, this.today);
}
return isToday;
}()
}, {
key: 'isFirstDayOfWeek',
value: function () {
function isFirstDayOfWeek(day) {
var firstDayOfWeek = this.props.firstDayOfWeek;
return day.day() === (firstDayOfWeek || _moment2['default'].localeData().firstDayOfWeek());
}
return isFirstDayOfWeek;
}()
}, {
key: 'isLastDayOfWeek',
value: function () {
function isLastDayOfWeek(day) {
var firstDayOfWeek = this.props.firstDayOfWeek;
return day.day() === ((firstDayOfWeek || _moment2['default'].localeData().firstDayOfWeek()) + 6) % 7;
}
return isLastDayOfWeek;
}()
}, {
key: 'render',
value: function () {
function render() {
var _props19 = this.props,
numberOfMonths = _props19.numberOfMonths,
orientation = _props19.orientation,
monthFormat = _props19.monthFormat,
renderMonthText = _props19.renderMonthText,
navPrev = _props19.navPrev,
navNext = _props19.navNext,
noNavButtons = _props19.noNavButtons,
onOutsideClick = _props19.onOutsideClick,
withPortal = _props19.withPortal,
enableOutsideDays = _props19.enableOutsideDays,
firstDayOfWeek = _props19.firstDayOfWeek,
hideKeyboardShortcutsPanel = _props19.hideKeyboardShortcutsPanel,
daySize = _props19.daySize,
focusedInput = _props19.focusedInput,
renderCalendarDay = _props19.renderCalendarDay,
renderDayContents = _props19.renderDayContents,
renderCalendarInfo = _props19.renderCalendarInfo,
renderMonthElement = _props19.renderMonthElement,
calendarInfoPosition = _props19.calendarInfoPosition,
onBlur = _props19.onBlur,
isFocused = _props19.isFocused,
showKeyboardShortcuts = _props19.showKeyboardShortcuts,
isRTL = _props19.isRTL,
weekDayFormat = _props19.weekDayFormat,
dayAriaLabelFormat = _props19.dayAriaLabelFormat,
verticalHeight = _props19.verticalHeight,
noBorder = _props19.noBorder,
transitionDuration = _props19.transitionDuration,
verticalBorderSpacing = _props19.verticalBorderSpacing,
horizontalMonthPadding = _props19.horizontalMonthPadding;
var _state8 = this.state,
currentMonth = _state8.currentMonth,
phrases = _state8.phrases,
visibleDays = _state8.visibleDays;
return _react2['default'].createElement(_DayPicker2['default'], {
orientation: orientation,
enableOutsideDays: enableOutsideDays,
modifiers: visibleDays,
numberOfMonths: numberOfMonths,
onDayClick: this.onDayClick,
onDayMouseEnter: this.onDayMouseEnter,
onDayMouseLeave: this.onDayMouseLeave,
onPrevMonthClick: this.onPrevMonthClick,
onNextMonthClick: this.onNextMonthClick,
onMonthChange: this.onMonthChange,
onYearChange: this.onYearChange,
onMultiplyScrollableMonths: this.onMultiplyScrollableMonths,
monthFormat: monthFormat,
renderMonthText: renderMonthText,
withPortal: withPortal,
hidden: !focusedInput,
initialVisibleMonth: function () {
function initialVisibleMonth() {
return currentMonth;
}
return initialVisibleMonth;
}(),
daySize: daySize,
onOutsideClick: onOutsideClick,
navPrev: navPrev,
navNext: navNext,
noNavButtons: noNavButtons,
renderCalendarDay: renderCalendarDay,
renderDayContents: renderDayContents,
renderCalendarInfo: renderCalendarInfo,
renderMonthElement: renderMonthElement,
calendarInfoPosition: calendarInfoPosition,
firstDayOfWeek: firstDayOfWeek,
hideKeyboardShortcutsPanel: hideKeyboardShortcutsPanel,
isFocused: isFocused,
getFirstFocusableDay: this.getFirstFocusableDay,
onBlur: onBlur,
showKeyboardShortcuts: showKeyboardShortcuts,
phrases: phrases,
isRTL: isRTL,
weekDayFormat: weekDayFormat,
dayAriaLabelFormat: dayAriaLabelFormat,
verticalHeight: verticalHeight,
verticalBorderSpacing: verticalBorderSpacing,
noBorder: noBorder,
transitionDuration: transitionDuration,
horizontalMonthPadding: horizontalMonthPadding
});
}
return render;
}()
}]);
return DayPickerRangeController;
}(_react2['default'].Component);
exports['default'] = DayPickerRangeController;
DayPickerRangeController.propTypes = propTypes;
DayPickerRangeController.defaultProps = defaultProps;
/***/ }),
/***/ "./node_modules/react-dates/lib/components/DayPickerSingleDateController.js":
/*!**********************************************************************************!*\
!*** ./node_modules/react-dates/lib/components/DayPickerSingleDateController.js ***!
\**********************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _slicedToArray = function () {
function sliceIterator(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"]) _i["return"]();
} finally {
if (_d) throw _e;
}
}
return _arr;
}
return function (arr, i) {
if (Array.isArray(arr)) {
return arr;
} else if (Symbol.iterator in Object(arr)) {
return sliceIterator(arr, i);
} else {
throw new TypeError("Invalid attempt to destructure non-iterable instance");
}
};
}();
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 _object = __webpack_require__(/*! object.assign */ "./node_modules/object.assign/index.js");
var _object2 = _interopRequireDefault(_object);
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 _reactMomentProptypes = __webpack_require__(/*! react-moment-proptypes */ "./node_modules/react-moment-proptypes/src/index.js");
var _reactMomentProptypes2 = _interopRequireDefault(_reactMomentProptypes);
var _airbnbPropTypes = __webpack_require__(/*! airbnb-prop-types */ "./node_modules/airbnb-prop-types/index.js");
var _moment = __webpack_require__(/*! moment */ "./node_modules/moment/moment.js");
var _moment2 = _interopRequireDefault(_moment);
var _object3 = __webpack_require__(/*! object.values */ "./node_modules/object.values/index.js");
var _object4 = _interopRequireDefault(_object3);
var _isTouchDevice = __webpack_require__(/*! is-touch-device */ "./node_modules/is-touch-device/build/index.js");
var _isTouchDevice2 = _interopRequireDefault(_isTouchDevice);
var _defaultPhrases = __webpack_require__(/*! ../defaultPhrases */ "./node_modules/react-dates/lib/defaultPhrases.js");
var _getPhrasePropTypes = __webpack_require__(/*! ../utils/getPhrasePropTypes */ "./node_modules/react-dates/lib/utils/getPhrasePropTypes.js");
var _getPhrasePropTypes2 = _interopRequireDefault(_getPhrasePropTypes);
var _isSameDay = __webpack_require__(/*! ../utils/isSameDay */ "./node_modules/react-dates/lib/utils/isSameDay.js");
var _isSameDay2 = _interopRequireDefault(_isSameDay);
var _isAfterDay = __webpack_require__(/*! ../utils/isAfterDay */ "./node_modules/react-dates/lib/utils/isAfterDay.js");
var _isAfterDay2 = _interopRequireDefault(_isAfterDay);
var _getVisibleDays = __webpack_require__(/*! ../utils/getVisibleDays */ "./node_modules/react-dates/lib/utils/getVisibleDays.js");
var _getVisibleDays2 = _interopRequireDefault(_getVisibleDays);
var _isDayVisible = __webpack_require__(/*! ../utils/isDayVisible */ "./node_modules/react-dates/lib/utils/isDayVisible.js");
var _isDayVisible2 = _interopRequireDefault(_isDayVisible);
var _toISODateString = __webpack_require__(/*! ../utils/toISODateString */ "./node_modules/react-dates/lib/utils/toISODateString.js");
var _toISODateString2 = _interopRequireDefault(_toISODateString);
var _toISOMonthString = __webpack_require__(/*! ../utils/toISOMonthString */ "./node_modules/react-dates/lib/utils/toISOMonthString.js");
var _toISOMonthString2 = _interopRequireDefault(_toISOMonthString);
var _ScrollableOrientationShape = __webpack_require__(/*! ../shapes/ScrollableOrientationShape */ "./node_modules/react-dates/lib/shapes/ScrollableOrientationShape.js");
var _ScrollableOrientationShape2 = _interopRequireDefault(_ScrollableOrientationShape);
var _DayOfWeekShape = __webpack_require__(/*! ../shapes/DayOfWeekShape */ "./node_modules/react-dates/lib/shapes/DayOfWeekShape.js");
var _DayOfWeekShape2 = _interopRequireDefault(_DayOfWeekShape);
var _CalendarInfoPositionShape = __webpack_require__(/*! ../shapes/CalendarInfoPositionShape */ "./node_modules/react-dates/lib/shapes/CalendarInfoPositionShape.js");
var _CalendarInfoPositionShape2 = _interopRequireDefault(_CalendarInfoPositionShape);
var _constants = __webpack_require__(/*! ../constants */ "./node_modules/react-dates/lib/constants.js");
var _DayPicker = __webpack_require__(/*! ./DayPicker */ "./node_modules/react-dates/lib/components/DayPicker.js");
var _DayPicker2 = _interopRequireDefault(_DayPicker);
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 propTypes = (0, _airbnbPropTypes.forbidExtraProps)({
date: _reactMomentProptypes2['default'].momentObj,
onDateChange: _propTypes2['default'].func,
focused: _propTypes2['default'].bool,
onFocusChange: _propTypes2['default'].func,
onClose: _propTypes2['default'].func,
keepOpenOnDateSelect: _propTypes2['default'].bool,
isOutsideRange: _propTypes2['default'].func,
isDayBlocked: _propTypes2['default'].func,
isDayHighlighted: _propTypes2['default'].func,
// DayPicker props
renderMonthText: (0, _airbnbPropTypes.mutuallyExclusiveProps)(_propTypes2['default'].func, 'renderMonthText', 'renderMonthElement'),
renderMonthElement: (0, _airbnbPropTypes.mutuallyExclusiveProps)(_propTypes2['default'].func, 'renderMonthText', 'renderMonthElement'),
enableOutsideDays: _propTypes2['default'].bool,
numberOfMonths: _propTypes2['default'].number,
orientation: _ScrollableOrientationShape2['default'],
withPortal: _propTypes2['default'].bool,
initialVisibleMonth: _propTypes2['default'].func,
firstDayOfWeek: _DayOfWeekShape2['default'],
hideKeyboardShortcutsPanel: _propTypes2['default'].bool,
daySize: _airbnbPropTypes.nonNegativeInteger,
verticalHeight: _airbnbPropTypes.nonNegativeInteger,
noBorder: _propTypes2['default'].bool,
verticalBorderSpacing: _airbnbPropTypes.nonNegativeInteger,
transitionDuration: _airbnbPropTypes.nonNegativeInteger,
horizontalMonthPadding: _airbnbPropTypes.nonNegativeInteger,
navPrev: _propTypes2['default'].node,
navNext: _propTypes2['default'].node,
onPrevMonthClick: _propTypes2['default'].func,
onNextMonthClick: _propTypes2['default'].func,
onOutsideClick: _propTypes2['default'].func,
renderCalendarDay: _propTypes2['default'].func,
renderDayContents: _propTypes2['default'].func,
renderCalendarInfo: _propTypes2['default'].func,
calendarInfoPosition: _CalendarInfoPositionShape2['default'],
// accessibility
onBlur: _propTypes2['default'].func,
isFocused: _propTypes2['default'].bool,
showKeyboardShortcuts: _propTypes2['default'].bool,
// i18n
monthFormat: _propTypes2['default'].string,
weekDayFormat: _propTypes2['default'].string,
phrases: _propTypes2['default'].shape((0, _getPhrasePropTypes2['default'])(_defaultPhrases.DayPickerPhrases)),
dayAriaLabelFormat: _propTypes2['default'].string,
isRTL: _propTypes2['default'].bool
});
var defaultProps = {
date: undefined,
// TODO: use null
onDateChange: function () {
function onDateChange() {}
return onDateChange;
}(),
focused: false,
onFocusChange: function () {
function onFocusChange() {}
return onFocusChange;
}(),
onClose: function () {
function onClose() {}
return onClose;
}(),
keepOpenOnDateSelect: false,
isOutsideRange: function () {
function isOutsideRange() {}
return isOutsideRange;
}(),
isDayBlocked: function () {
function isDayBlocked() {}
return isDayBlocked;
}(),
isDayHighlighted: function () {
function isDayHighlighted() {}
return isDayHighlighted;
}(),
// DayPicker props
renderMonthText: null,
enableOutsideDays: false,
numberOfMonths: 1,
orientation: _constants.HORIZONTAL_ORIENTATION,
withPortal: false,
hideKeyboardShortcutsPanel: false,
initialVisibleMonth: null,
firstDayOfWeek: null,
daySize: _constants.DAY_SIZE,
verticalHeight: null,
noBorder: false,
verticalBorderSpacing: undefined,
transitionDuration: undefined,
horizontalMonthPadding: 13,
navPrev: null,
navNext: null,
onPrevMonthClick: function () {
function onPrevMonthClick() {}
return onPrevMonthClick;
}(),
onNextMonthClick: function () {
function onNextMonthClick() {}
return onNextMonthClick;
}(),
onOutsideClick: function () {
function onOutsideClick() {}
return onOutsideClick;
}(),
renderCalendarDay: undefined,
renderDayContents: null,
renderCalendarInfo: null,
renderMonthElement: null,
calendarInfoPosition: _constants.INFO_POSITION_BOTTOM,
// accessibility
onBlur: function () {
function onBlur() {}
return onBlur;
}(),
isFocused: false,
showKeyboardShortcuts: false,
// i18n
monthFormat: 'MMMM YYYY',
weekDayFormat: 'dd',
phrases: _defaultPhrases.DayPickerPhrases,
dayAriaLabelFormat: undefined,
isRTL: false
};
var DayPickerSingleDateController = function (_React$Component) {
_inherits(DayPickerSingleDateController, _React$Component);
function DayPickerSingleDateController(props) {
_classCallCheck(this, DayPickerSingleDateController);
var _this = _possibleConstructorReturn(this, (DayPickerSingleDateController.__proto__ || Object.getPrototypeOf(DayPickerSingleDateController)).call(this, props));
_this.isTouchDevice = false;
_this.today = (0, _moment2['default'])();
_this.modifiers = {
today: function () {
function today(day) {
return _this.isToday(day);
}
return today;
}(),
blocked: function () {
function blocked(day) {
return _this.isBlocked(day);
}
return blocked;
}(),
'blocked-calendar': function () {
function blockedCalendar(day) {
return props.isDayBlocked(day);
}
return blockedCalendar;
}(),
'blocked-out-of-range': function () {
function blockedOutOfRange(day) {
return props.isOutsideRange(day);
}
return blockedOutOfRange;
}(),
'highlighted-calendar': function () {
function highlightedCalendar(day) {
return props.isDayHighlighted(day);
}
return highlightedCalendar;
}(),
valid: function () {
function valid(day) {
return !_this.isBlocked(day);
}
return valid;
}(),
hovered: function () {
function hovered(day) {
return _this.isHovered(day);
}
return hovered;
}(),
selected: function () {
function selected(day) {
return _this.isSelected(day);
}
return selected;
}(),
'first-day-of-week': function () {
function firstDayOfWeek(day) {
return _this.isFirstDayOfWeek(day);
}
return firstDayOfWeek;
}(),
'last-day-of-week': function () {
function lastDayOfWeek(day) {
return _this.isLastDayOfWeek(day);
}
return lastDayOfWeek;
}()
};
var _this$getStateForNewM = _this.getStateForNewMonth(props),
currentMonth = _this$getStateForNewM.currentMonth,
visibleDays = _this$getStateForNewM.visibleDays;
_this.state = {
hoverDate: null,
currentMonth: currentMonth,
visibleDays: visibleDays
};
_this.onDayMouseEnter = _this.onDayMouseEnter.bind(_this);
_this.onDayMouseLeave = _this.onDayMouseLeave.bind(_this);
_this.onDayClick = _this.onDayClick.bind(_this);
_this.onPrevMonthClick = _this.onPrevMonthClick.bind(_this);
_this.onNextMonthClick = _this.onNextMonthClick.bind(_this);
_this.onMonthChange = _this.onMonthChange.bind(_this);
_this.onYearChange = _this.onYearChange.bind(_this);
_this.getFirstFocusableDay = _this.getFirstFocusableDay.bind(_this);
return _this;
}
_createClass(DayPickerSingleDateController, [{
key: 'componentDidMount',
value: function () {
function componentDidMount() {
this.isTouchDevice = (0, _isTouchDevice2['default'])();
}
return componentDidMount;
}()
}, {
key: 'componentWillReceiveProps',
value: function () {
function componentWillReceiveProps(nextProps) {
var _this2 = this;
var date = nextProps.date,
focused = nextProps.focused,
isOutsideRange = nextProps.isOutsideRange,
isDayBlocked = nextProps.isDayBlocked,
isDayHighlighted = nextProps.isDayHighlighted,
initialVisibleMonth = nextProps.initialVisibleMonth,
numberOfMonths = nextProps.numberOfMonths,
enableOutsideDays = nextProps.enableOutsideDays;
var _props = this.props,
prevIsOutsideRange = _props.isOutsideRange,
prevIsDayBlocked = _props.isDayBlocked,
prevIsDayHighlighted = _props.isDayHighlighted,
prevNumberOfMonths = _props.numberOfMonths,
prevEnableOutsideDays = _props.enableOutsideDays,
prevInitialVisibleMonth = _props.initialVisibleMonth,
prevFocused = _props.focused,
prevDate = _props.date;
var visibleDays = this.state.visibleDays;
var recomputeOutsideRange = false;
var recomputeDayBlocked = false;
var recomputeDayHighlighted = false;
if (isOutsideRange !== prevIsOutsideRange) {
this.modifiers['blocked-out-of-range'] = function (day) {
return isOutsideRange(day);
};
recomputeOutsideRange = true;
}
if (isDayBlocked !== prevIsDayBlocked) {
this.modifiers['blocked-calendar'] = function (day) {
return isDayBlocked(day);
};
recomputeDayBlocked = true;
}
if (isDayHighlighted !== prevIsDayHighlighted) {
this.modifiers['highlighted-calendar'] = function (day) {
return isDayHighlighted(day);
};
recomputeDayHighlighted = true;
}
var recomputePropModifiers = recomputeOutsideRange || recomputeDayBlocked || recomputeDayHighlighted;
if (numberOfMonths !== prevNumberOfMonths || enableOutsideDays !== prevEnableOutsideDays || initialVisibleMonth !== prevInitialVisibleMonth && !prevFocused && focused) {
var newMonthState = this.getStateForNewMonth(nextProps);
var currentMonth = newMonthState.currentMonth;
visibleDays = newMonthState.visibleDays;
this.setState({
currentMonth: currentMonth,
visibleDays: visibleDays
});
}
var didDateChange = date !== prevDate;
var didFocusChange = focused !== prevFocused;
var modifiers = {};
if (didDateChange) {
modifiers = this.deleteModifier(modifiers, prevDate, 'selected');
modifiers = this.addModifier(modifiers, date, 'selected');
}
if (didFocusChange || recomputePropModifiers) {
(0, _object4['default'])(visibleDays).forEach(function (days) {
Object.keys(days).forEach(function (day) {
var momentObj = (0, _moment2['default'])(day);
if (_this2.isBlocked(momentObj)) {
modifiers = _this2.addModifier(modifiers, momentObj, 'blocked');
} else {
modifiers = _this2.deleteModifier(modifiers, momentObj, 'blocked');
}
if (didFocusChange || recomputeOutsideRange) {
if (isOutsideRange(momentObj)) {
modifiers = _this2.addModifier(modifiers, momentObj, 'blocked-out-of-range');
} else {
modifiers = _this2.deleteModifier(modifiers, momentObj, 'blocked-out-of-range');
}
}
if (didFocusChange || recomputeDayBlocked) {
if (isDayBlocked(momentObj)) {
modifiers = _this2.addModifier(modifiers, momentObj, 'blocked-calendar');
} else {
modifiers = _this2.deleteModifier(modifiers, momentObj, 'blocked-calendar');
}
}
if (didFocusChange || recomputeDayHighlighted) {
if (isDayHighlighted(momentObj)) {
modifiers = _this2.addModifier(modifiers, momentObj, 'highlighted-calendar');
} else {
modifiers = _this2.deleteModifier(modifiers, momentObj, 'highlighted-calendar');
}
}
});
});
}
var today = (0, _moment2['default'])();
if (!(0, _isSameDay2['default'])(this.today, today)) {
modifiers = this.deleteModifier(modifiers, this.today, 'today');
modifiers = this.addModifier(modifiers, today, 'today');
this.today = today;
}
if (Object.keys(modifiers).length > 0) {
this.setState({
visibleDays: (0, _object2['default'])({}, visibleDays, modifiers)
});
}
}
return componentWillReceiveProps;
}()
}, {
key: 'componentWillUpdate',
value: function () {
function componentWillUpdate() {
this.today = (0, _moment2['default'])();
}
return componentWillUpdate;
}()
}, {
key: 'onDayClick',
value: function () {
function onDayClick(day, e) {
if (e) e.preventDefault();
if (this.isBlocked(day)) return;
var _props2 = this.props,
onDateChange = _props2.onDateChange,
keepOpenOnDateSelect = _props2.keepOpenOnDateSelect,
onFocusChange = _props2.onFocusChange,
onClose = _props2.onClose;
onDateChange(day);
if (!keepOpenOnDateSelect) {
onFocusChange({
focused: false
});
onClose({
date: day
});
}
}
return onDayClick;
}()
}, {
key: 'onDayMouseEnter',
value: function () {
function onDayMouseEnter(day) {
if (this.isTouchDevice) return;
var _state = this.state,
hoverDate = _state.hoverDate,
visibleDays = _state.visibleDays;
var modifiers = this.deleteModifier({}, hoverDate, 'hovered');
modifiers = this.addModifier(modifiers, day, 'hovered');
this.setState({
hoverDate: day,
visibleDays: (0, _object2['default'])({}, visibleDays, modifiers)
});
}
return onDayMouseEnter;
}()
}, {
key: 'onDayMouseLeave',
value: function () {
function onDayMouseLeave() {
var _state2 = this.state,
hoverDate = _state2.hoverDate,
visibleDays = _state2.visibleDays;
if (this.isTouchDevice || !hoverDate) return;
var modifiers = this.deleteModifier({}, hoverDate, 'hovered');
this.setState({
hoverDate: null,
visibleDays: (0, _object2['default'])({}, visibleDays, modifiers)
});
}
return onDayMouseLeave;
}()
}, {
key: 'onPrevMonthClick',
value: function () {
function onPrevMonthClick() {
var _props3 = this.props,
onPrevMonthClick = _props3.onPrevMonthClick,
numberOfMonths = _props3.numberOfMonths,
enableOutsideDays = _props3.enableOutsideDays;
var _state3 = this.state,
currentMonth = _state3.currentMonth,
visibleDays = _state3.visibleDays;
var newVisibleDays = {};
Object.keys(visibleDays).sort().slice(0, numberOfMonths + 1).forEach(function (month) {
newVisibleDays[month] = visibleDays[month];
});
var prevMonth = currentMonth.clone().subtract(1, 'month');
var prevMonthVisibleDays = (0, _getVisibleDays2['default'])(prevMonth, 1, enableOutsideDays);
this.setState({
currentMonth: prevMonth,
visibleDays: (0, _object2['default'])({}, newVisibleDays, this.getModifiers(prevMonthVisibleDays))
}, function () {
onPrevMonthClick(prevMonth.clone());
});
}
return onPrevMonthClick;
}()
}, {
key: 'onNextMonthClick',
value: function () {
function onNextMonthClick() {
var _props4 = this.props,
onNextMonthClick = _props4.onNextMonthClick,
numberOfMonths = _props4.numberOfMonths,
enableOutsideDays = _props4.enableOutsideDays;
var _state4 = this.state,
currentMonth = _state4.currentMonth,
visibleDays = _state4.visibleDays;
var newVisibleDays = {};
Object.keys(visibleDays).sort().slice(1).forEach(function (month) {
newVisibleDays[month] = visibleDays[month];
});
var nextMonth = currentMonth.clone().add(numberOfMonths, 'month');
var nextMonthVisibleDays = (0, _getVisibleDays2['default'])(nextMonth, 1, enableOutsideDays);
var newCurrentMonth = currentMonth.clone().add(1, 'month');
this.setState({
currentMonth: newCurrentMonth,
visibleDays: (0, _object2['default'])({}, newVisibleDays, this.getModifiers(nextMonthVisibleDays))
}, function () {
onNextMonthClick(newCurrentMonth.clone());
});
}
return onNextMonthClick;
}()
}, {
key: 'onMonthChange',
value: function () {
function onMonthChange(newMonth) {
var _props5 = this.props,
numberOfMonths = _props5.numberOfMonths,
enableOutsideDays = _props5.enableOutsideDays,
orientation = _props5.orientation;
var withoutTransitionMonths = orientation === _constants.VERTICAL_SCROLLABLE;
var newVisibleDays = (0, _getVisibleDays2['default'])(newMonth, numberOfMonths, enableOutsideDays, withoutTransitionMonths);
this.setState({
currentMonth: newMonth.clone(),
visibleDays: this.getModifiers(newVisibleDays)
});
}
return onMonthChange;
}()
}, {
key: 'onYearChange',
value: function () {
function onYearChange(newMonth) {
var _props6 = this.props,
numberOfMonths = _props6.numberOfMonths,
enableOutsideDays = _props6.enableOutsideDays,
orientation = _props6.orientation;
var withoutTransitionMonths = orientation === _constants.VERTICAL_SCROLLABLE;
var newVisibleDays = (0, _getVisibleDays2['default'])(newMonth, numberOfMonths, enableOutsideDays, withoutTransitionMonths);
this.setState({
currentMonth: newMonth.clone(),
visibleDays: this.getModifiers(newVisibleDays)
});
}
return onYearChange;
}()
}, {
key: 'getFirstFocusableDay',
value: function () {
function getFirstFocusableDay(newMonth) {
var _this3 = this;
var _props7 = this.props,
date = _props7.date,
numberOfMonths = _props7.numberOfMonths;
var focusedDate = newMonth.clone().startOf('month');
if (date) {
focusedDate = date.clone();
}
if (this.isBlocked(focusedDate)) {
var days = [];
var lastVisibleDay = newMonth.clone().add(numberOfMonths - 1, 'months').endOf('month');
var currentDay = focusedDate.clone();
while (!(0, _isAfterDay2['default'])(currentDay, lastVisibleDay)) {
currentDay = currentDay.clone().add(1, 'day');
days.push(currentDay);
}
var viableDays = days.filter(function (day) {
return !_this3.isBlocked(day) && (0, _isAfterDay2['default'])(day, focusedDate);
});
if (viableDays.length > 0) {
var _viableDays = _slicedToArray(viableDays, 1);
focusedDate = _viableDays[0];
}
}
return focusedDate;
}
return getFirstFocusableDay;
}()
}, {
key: 'getModifiers',
value: function () {
function getModifiers(visibleDays) {
var _this4 = this;
var modifiers = {};
Object.keys(visibleDays).forEach(function (month) {
modifiers[month] = {};
visibleDays[month].forEach(function (day) {
modifiers[month][(0, _toISODateString2['default'])(day)] = _this4.getModifiersForDay(day);
});
});
return modifiers;
}
return getModifiers;
}()
}, {
key: 'getModifiersForDay',
value: function () {
function getModifiersForDay(day) {
var _this5 = this;
return new Set(Object.keys(this.modifiers).filter(function (modifier) {
return _this5.modifiers[modifier](day);
}));
}
return getModifiersForDay;
}()
}, {
key: 'getStateForNewMonth',
value: function () {
function getStateForNewMonth(nextProps) {
var _this6 = this;
var initialVisibleMonth = nextProps.initialVisibleMonth,
date = nextProps.date,
numberOfMonths = nextProps.numberOfMonths,
enableOutsideDays = nextProps.enableOutsideDays;
var initialVisibleMonthThunk = initialVisibleMonth || (date ? function () {
return date;
} : function () {
return _this6.today;
});
var currentMonth = initialVisibleMonthThunk();
var visibleDays = this.getModifiers((0, _getVisibleDays2['default'])(currentMonth, numberOfMonths, enableOutsideDays));
return {
currentMonth: currentMonth,
visibleDays: visibleDays
};
}
return getStateForNewMonth;
}()
}, {
key: 'addModifier',
value: function () {
function addModifier(updatedDays, day, modifier) {
var _props8 = this.props,
numberOfVisibleMonths = _props8.numberOfMonths,
enableOutsideDays = _props8.enableOutsideDays,
orientation = _props8.orientation;
var _state5 = this.state,
firstVisibleMonth = _state5.currentMonth,
visibleDays = _state5.visibleDays;
var currentMonth = firstVisibleMonth;
var numberOfMonths = numberOfVisibleMonths;
if (orientation === _constants.VERTICAL_SCROLLABLE) {
numberOfMonths = Object.keys(visibleDays).length;
} else {
currentMonth = currentMonth.clone().subtract(1, 'month');
numberOfMonths += 2;
}
if (!day || !(0, _isDayVisible2['default'])(day, currentMonth, numberOfMonths, enableOutsideDays)) {
return updatedDays;
}
var iso = (0, _toISODateString2['default'])(day);
var updatedDaysAfterAddition = (0, _object2['default'])({}, updatedDays);
if (enableOutsideDays) {
var monthsToUpdate = Object.keys(visibleDays).filter(function (monthKey) {
return Object.keys(visibleDays[monthKey]).indexOf(iso) > -1;
});
updatedDaysAfterAddition = monthsToUpdate.reduce(function (days, monthIso) {
var month = updatedDays[monthIso] || visibleDays[monthIso];
var modifiers = new Set(month[iso]);
modifiers.add(modifier);
return (0, _object2['default'])({}, days, _defineProperty({}, monthIso, (0, _object2['default'])({}, month, _defineProperty({}, iso, modifiers))));
}, updatedDaysAfterAddition);
} else {
var monthIso = (0, _toISOMonthString2['default'])(day);
var month = updatedDays[monthIso] || visibleDays[monthIso];
var modifiers = new Set(month[iso]);
modifiers.add(modifier);
updatedDaysAfterAddition = (0, _object2['default'])({}, updatedDaysAfterAddition, _defineProperty({}, monthIso, (0, _object2['default'])({}, month, _defineProperty({}, iso, modifiers))));
}
return updatedDaysAfterAddition;
}
return addModifier;
}()
}, {
key: 'deleteModifier',
value: function () {
function deleteModifier(updatedDays, day, modifier) {
var _props9 = this.props,
numberOfVisibleMonths = _props9.numberOfMonths,
enableOutsideDays = _props9.enableOutsideDays,
orientation = _props9.orientation;
var _state6 = this.state,
firstVisibleMonth = _state6.currentMonth,
visibleDays = _state6.visibleDays;
var currentMonth = firstVisibleMonth;
var numberOfMonths = numberOfVisibleMonths;
if (orientation === _constants.VERTICAL_SCROLLABLE) {
numberOfMonths = Object.keys(visibleDays).length;
} else {
currentMonth = currentMonth.clone().subtract(1, 'month');
numberOfMonths += 2;
}
if (!day || !(0, _isDayVisible2['default'])(day, currentMonth, numberOfMonths, enableOutsideDays)) {
return updatedDays;
}
var iso = (0, _toISODateString2['default'])(day);
var updatedDaysAfterDeletion = (0, _object2['default'])({}, updatedDays);
if (enableOutsideDays) {
var monthsToUpdate = Object.keys(visibleDays).filter(function (monthKey) {
return Object.keys(visibleDays[monthKey]).indexOf(iso) > -1;
});
updatedDaysAfterDeletion = monthsToUpdate.reduce(function (days, monthIso) {
var month = updatedDays[monthIso] || visibleDays[monthIso];
var modifiers = new Set(month[iso]);
modifiers['delete'](modifier);
return (0, _object2['default'])({}, days, _defineProperty({}, monthIso, (0, _object2['default'])({}, month, _defineProperty({}, iso, modifiers))));
}, updatedDaysAfterDeletion);
} else {
var monthIso = (0, _toISOMonthString2['default'])(day);
var month = updatedDays[monthIso] || visibleDays[monthIso];
var modifiers = new Set(month[iso]);
modifiers['delete'](modifier);
updatedDaysAfterDeletion = (0, _object2['default'])({}, updatedDaysAfterDeletion, _defineProperty({}, monthIso, (0, _object2['default'])({}, month, _defineProperty({}, iso, modifiers))));
}
return updatedDaysAfterDeletion;
}
return deleteModifier;
}()
}, {
key: 'isBlocked',
value: function () {
function isBlocked(day) {
var _props10 = this.props,
isDayBlocked = _props10.isDayBlocked,
isOutsideRange = _props10.isOutsideRange;
return isDayBlocked(day) || isOutsideRange(day);
}
return isBlocked;
}()
}, {
key: 'isHovered',
value: function () {
function isHovered(day) {
var _ref = this.state || {},
hoverDate = _ref.hoverDate;
return (0, _isSameDay2['default'])(day, hoverDate);
}
return isHovered;
}()
}, {
key: 'isSelected',
value: function () {
function isSelected(day) {
var date = this.props.date;
return (0, _isSameDay2['default'])(day, date);
}
return isSelected;
}()
}, {
key: 'isToday',
value: function () {
function isToday(day) {
return (0, _isSameDay2['default'])(day, this.today);
}
return isToday;
}()
}, {
key: 'isFirstDayOfWeek',
value: function () {
function isFirstDayOfWeek(day) {
var firstDayOfWeek = this.props.firstDayOfWeek;
return day.day() === (firstDayOfWeek || _moment2['default'].localeData().firstDayOfWeek());
}
return isFirstDayOfWeek;
}()
}, {
key: 'isLastDayOfWeek',
value: function () {
function isLastDayOfWeek(day) {
var firstDayOfWeek = this.props.firstDayOfWeek;
return day.day() === ((firstDayOfWeek || _moment2['default'].localeData().firstDayOfWeek()) + 6) % 7;
}
return isLastDayOfWeek;
}()
}, {
key: 'render',
value: function () {
function render() {
var _props11 = this.props,
numberOfMonths = _props11.numberOfMonths,
orientation = _props11.orientation,
monthFormat = _props11.monthFormat,
renderMonthText = _props11.renderMonthText,
navPrev = _props11.navPrev,
navNext = _props11.navNext,
onOutsideClick = _props11.onOutsideClick,
withPortal = _props11.withPortal,
focused = _props11.focused,
enableOutsideDays = _props11.enableOutsideDays,
hideKeyboardShortcutsPanel = _props11.hideKeyboardShortcutsPanel,
daySize = _props11.daySize,
firstDayOfWeek = _props11.firstDayOfWeek,
renderCalendarDay = _props11.renderCalendarDay,
renderDayContents = _props11.renderDayContents,
renderCalendarInfo = _props11.renderCalendarInfo,
renderMonthElement = _props11.renderMonthElement,
calendarInfoPosition = _props11.calendarInfoPosition,
isFocused = _props11.isFocused,
isRTL = _props11.isRTL,
phrases = _props11.phrases,
dayAriaLabelFormat = _props11.dayAriaLabelFormat,
onBlur = _props11.onBlur,
showKeyboardShortcuts = _props11.showKeyboardShortcuts,
weekDayFormat = _props11.weekDayFormat,
verticalHeight = _props11.verticalHeight,
noBorder = _props11.noBorder,
transitionDuration = _props11.transitionDuration,
verticalBorderSpacing = _props11.verticalBorderSpacing,
horizontalMonthPadding = _props11.horizontalMonthPadding;
var _state7 = this.state,
currentMonth = _state7.currentMonth,
visibleDays = _state7.visibleDays;
return _react2['default'].createElement(_DayPicker2['default'], {
orientation: orientation,
enableOutsideDays: enableOutsideDays,
modifiers: visibleDays,
numberOfMonths: numberOfMonths,
onDayClick: this.onDayClick,
onDayMouseEnter: this.onDayMouseEnter,
onDayMouseLeave: this.onDayMouseLeave,
onPrevMonthClick: this.onPrevMonthClick,
onNextMonthClick: this.onNextMonthClick,
onMonthChange: this.onMonthChange,
onYearChange: this.onYearChange,
monthFormat: monthFormat,
withPortal: withPortal,
hidden: !focused,
hideKeyboardShortcutsPanel: hideKeyboardShortcutsPanel,
initialVisibleMonth: function () {
function initialVisibleMonth() {
return currentMonth;
}
return initialVisibleMonth;
}(),
firstDayOfWeek: firstDayOfWeek,
onOutsideClick: onOutsideClick,
navPrev: navPrev,
navNext: navNext,
renderMonthText: renderMonthText,
renderCalendarDay: renderCalendarDay,
renderDayContents: renderDayContents,
renderCalendarInfo: renderCalendarInfo,
renderMonthElement: renderMonthElement,
calendarInfoPosition: calendarInfoPosition,
isFocused: isFocused,
getFirstFocusableDay: this.getFirstFocusableDay,
onBlur: onBlur,
phrases: phrases,
daySize: daySize,
isRTL: isRTL,
showKeyboardShortcuts: showKeyboardShortcuts,
weekDayFormat: weekDayFormat,
dayAriaLabelFormat: dayAriaLabelFormat,
verticalHeight: verticalHeight,
noBorder: noBorder,
transitionDuration: transitionDuration,
verticalBorderSpacing: verticalBorderSpacing,
horizontalMonthPadding: horizontalMonthPadding
});
}
return render;
}()
}]);
return DayPickerSingleDateController;
}(_react2['default'].Component);
exports['default'] = DayPickerSingleDateController;
DayPickerSingleDateController.propTypes = propTypes;
DayPickerSingleDateController.defaultProps = defaultProps;
/***/ }),
/***/ "./node_modules/react-dates/lib/components/KeyboardShortcutRow.js":
/*!************************************************************************!*\
!*** ./node_modules/react-dates/lib/components/KeyboardShortcutRow.js ***!
\************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
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 _object = __webpack_require__(/*! object.assign */ "./node_modules/object.assign/index.js");
var _object2 = _interopRequireDefault(_object);
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 _airbnbPropTypes = __webpack_require__(/*! airbnb-prop-types */ "./node_modules/airbnb-prop-types/index.js");
var _reactWithStyles = __webpack_require__(/*! react-with-styles */ "./node_modules/react-with-styles/lib/withStyles.js");
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
'default': obj
};
}
var propTypes = (0, _airbnbPropTypes.forbidExtraProps)((0, _object2['default'])({}, _reactWithStyles.withStylesPropTypes, {
unicode: _propTypes2['default'].string.isRequired,
label: _propTypes2['default'].string.isRequired,
action: _propTypes2['default'].string.isRequired,
block: _propTypes2['default'].bool
}));
var defaultProps = {
block: false
};
function KeyboardShortcutRow(_ref) {
var unicode = _ref.unicode,
label = _ref.label,
action = _ref.action,
block = _ref.block,
styles = _ref.styles;
return _react2['default'].createElement('li', (0, _reactWithStyles.css)(styles.KeyboardShortcutRow, block && styles.KeyboardShortcutRow__block), _react2['default'].createElement('div', (0, _reactWithStyles.css)(styles.KeyboardShortcutRow_keyContainer, block && styles.KeyboardShortcutRow_keyContainer__block), _react2['default'].createElement('span', _extends({}, (0, _reactWithStyles.css)(styles.KeyboardShortcutRow_key), {
role: 'img',
'aria-label': String(label) + ',' // add comma so screen readers will pause before reading action
}), unicode)), _react2['default'].createElement('div', (0, _reactWithStyles.css)(styles.KeyboardShortcutRow_action), action));
}
KeyboardShortcutRow.propTypes = propTypes;
KeyboardShortcutRow.defaultProps = defaultProps;
exports['default'] = (0, _reactWithStyles.withStyles)(function (_ref2) {
var color = _ref2.reactDates.color;
return {
KeyboardShortcutRow: {
listStyle: 'none',
margin: '6px 0'
},
KeyboardShortcutRow__block: {
marginBottom: 16
},
KeyboardShortcutRow_keyContainer: {
display: 'inline-block',
whiteSpace: 'nowrap',
textAlign: 'right',
marginRight: 6
},
KeyboardShortcutRow_keyContainer__block: {
textAlign: 'left',
display: 'inline'
},
KeyboardShortcutRow_key: {
fontFamily: 'monospace',
fontSize: 12,
textTransform: 'uppercase',
background: color.core.grayLightest,
padding: '2px 6px'
},
KeyboardShortcutRow_action: {
display: 'inline',
wordBreak: 'break-word',
marginLeft: 8
}
};
})(KeyboardShortcutRow);
/***/ }),
/***/ "./node_modules/react-dates/lib/components/LeftArrow.js":
/*!**************************************************************!*\
!*** ./node_modules/react-dates/lib/components/LeftArrow.js ***!
\**************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _react = __webpack_require__(/*! react */ "react");
var _react2 = _interopRequireDefault(_react);
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
'default': obj
};
}
var LeftArrow = function () {
function LeftArrow(props) {
return _react2['default'].createElement('svg', props, _react2['default'].createElement('path', {
d: 'M336.2 274.5l-210.1 210h805.4c13 0 23 10 23 23s-10 23-23 23H126.1l210.1 210.1c11 11 11 21 0 32-5 5-10 7-16 7s-11-2-16-7l-249.1-249c-11-11-11-21 0-32l249.1-249.1c21-21.1 53 10.9 32 32z'
}));
}
return LeftArrow;
}();
LeftArrow.defaultProps = {
viewBox: '0 0 1000 1000'
};
exports['default'] = LeftArrow;
/***/ }),
/***/ "./node_modules/react-dates/lib/components/RightArrow.js":
/*!***************************************************************!*\
!*** ./node_modules/react-dates/lib/components/RightArrow.js ***!
\***************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _react = __webpack_require__(/*! react */ "react");
var _react2 = _interopRequireDefault(_react);
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
'default': obj
};
}
var RightArrow = function () {
function RightArrow(props) {
return _react2['default'].createElement('svg', props, _react2['default'].createElement('path', {
d: 'M694.4 242.4l249.1 249.1c11 11 11 21 0 32L694.4 772.7c-5 5-10 7-16 7s-11-2-16-7c-11-11-11-21 0-32l210.1-210.1H67.1c-13 0-23-10-23-23s10-23 23-23h805.4L662.4 274.5c-21-21.1 11-53.1 32-32.1z'
}));
}
return RightArrow;
}();
RightArrow.defaultProps = {
viewBox: '0 0 1000 1000'
};
exports['default'] = RightArrow;
/***/ }),
/***/ "./node_modules/react-dates/lib/components/SingleDatePicker.js":
/*!*********************************************************************!*\
!*** ./node_modules/react-dates/lib/components/SingleDatePicker.js ***!
\*********************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.PureSingleDatePicker = 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 _object = __webpack_require__(/*! object.assign */ "./node_modules/object.assign/index.js");
var _object2 = _interopRequireDefault(_object);
var _react = __webpack_require__(/*! react */ "react");
var _react2 = _interopRequireDefault(_react);
var _moment = __webpack_require__(/*! moment */ "./node_modules/moment/moment.js");
var _moment2 = _interopRequireDefault(_moment);
var _reactWithStyles = __webpack_require__(/*! react-with-styles */ "./node_modules/react-with-styles/lib/withStyles.js");
var _reactPortal = __webpack_require__(/*! react-portal */ "./node_modules/react-portal/es/index.js");
var _airbnbPropTypes = __webpack_require__(/*! airbnb-prop-types */ "./node_modules/airbnb-prop-types/index.js");
var _consolidatedEvents = __webpack_require__(/*! consolidated-events */ "./node_modules/consolidated-events/lib/index.esm.js");
var _isTouchDevice = __webpack_require__(/*! is-touch-device */ "./node_modules/is-touch-device/build/index.js");
var _isTouchDevice2 = _interopRequireDefault(_isTouchDevice);
var _reactOutsideClickHandler = __webpack_require__(/*! react-outside-click-handler */ "./node_modules/react-outside-click-handler/index.js");
var _reactOutsideClickHandler2 = _interopRequireDefault(_reactOutsideClickHandler);
var _SingleDatePickerShape = __webpack_require__(/*! ../shapes/SingleDatePickerShape */ "./node_modules/react-dates/lib/shapes/SingleDatePickerShape.js");
var _SingleDatePickerShape2 = _interopRequireDefault(_SingleDatePickerShape);
var _defaultPhrases = __webpack_require__(/*! ../defaultPhrases */ "./node_modules/react-dates/lib/defaultPhrases.js");
var _toMomentObject = __webpack_require__(/*! ../utils/toMomentObject */ "./node_modules/react-dates/lib/utils/toMomentObject.js");
var _toMomentObject2 = _interopRequireDefault(_toMomentObject);
var _toLocalizedDateString = __webpack_require__(/*! ../utils/toLocalizedDateString */ "./node_modules/react-dates/lib/utils/toLocalizedDateString.js");
var _toLocalizedDateString2 = _interopRequireDefault(_toLocalizedDateString);
var _getResponsiveContainerStyles = __webpack_require__(/*! ../utils/getResponsiveContainerStyles */ "./node_modules/react-dates/lib/utils/getResponsiveContainerStyles.js");
var _getResponsiveContainerStyles2 = _interopRequireDefault(_getResponsiveContainerStyles);
var _getDetachedContainerStyles = __webpack_require__(/*! ../utils/getDetachedContainerStyles */ "./node_modules/react-dates/lib/utils/getDetachedContainerStyles.js");
var _getDetachedContainerStyles2 = _interopRequireDefault(_getDetachedContainerStyles);
var _getInputHeight = __webpack_require__(/*! ../utils/getInputHeight */ "./node_modules/react-dates/lib/utils/getInputHeight.js");
var _getInputHeight2 = _interopRequireDefault(_getInputHeight);
var _isInclusivelyAfterDay = __webpack_require__(/*! ../utils/isInclusivelyAfterDay */ "./node_modules/react-dates/lib/utils/isInclusivelyAfterDay.js");
var _isInclusivelyAfterDay2 = _interopRequireDefault(_isInclusivelyAfterDay);
var _disableScroll2 = __webpack_require__(/*! ../utils/disableScroll */ "./node_modules/react-dates/lib/utils/disableScroll.js");
var _disableScroll3 = _interopRequireDefault(_disableScroll2);
var _SingleDatePickerInput = __webpack_require__(/*! ./SingleDatePickerInput */ "./node_modules/react-dates/lib/components/SingleDatePickerInput.js");
var _SingleDatePickerInput2 = _interopRequireDefault(_SingleDatePickerInput);
var _DayPickerSingleDateController = __webpack_require__(/*! ./DayPickerSingleDateController */ "./node_modules/react-dates/lib/components/DayPickerSingleDateController.js");
var _DayPickerSingleDateController2 = _interopRequireDefault(_DayPickerSingleDateController);
var _CloseButton = __webpack_require__(/*! ./CloseButton */ "./node_modules/react-dates/lib/components/CloseButton.js");
var _CloseButton2 = _interopRequireDefault(_CloseButton);
var _constants = __webpack_require__(/*! ../constants */ "./node_modules/react-dates/lib/constants.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;
}
var propTypes = (0, _airbnbPropTypes.forbidExtraProps)((0, _object2['default'])({}, _reactWithStyles.withStylesPropTypes, _SingleDatePickerShape2['default']));
var defaultProps = {
// required props for a functional interactive SingleDatePicker
date: null,
focused: false,
// input related props
id: 'date',
placeholder: 'Date',
disabled: false,
required: false,
readOnly: false,
screenReaderInputMessage: '',
showClearDate: false,
showDefaultInputIcon: false,
inputIconPosition: _constants.ICON_BEFORE_POSITION,
customInputIcon: null,
customCloseIcon: null,
noBorder: false,
block: false,
small: false,
regular: false,
verticalSpacing: _constants.DEFAULT_VERTICAL_SPACING,
keepFocusOnInput: false,
// calendar presentation and interaction related props
orientation: _constants.HORIZONTAL_ORIENTATION,
anchorDirection: _constants.ANCHOR_LEFT,
openDirection: _constants.OPEN_DOWN,
horizontalMargin: 0,
withPortal: false,
withFullScreenPortal: false,
appendToBody: false,
disableScroll: false,
initialVisibleMonth: null,
firstDayOfWeek: null,
numberOfMonths: 2,
keepOpenOnDateSelect: false,
reopenPickerOnClearDate: false,
renderCalendarInfo: null,
calendarInfoPosition: _constants.INFO_POSITION_BOTTOM,
hideKeyboardShortcutsPanel: false,
daySize: _constants.DAY_SIZE,
isRTL: false,
verticalHeight: null,
transitionDuration: undefined,
horizontalMonthPadding: 13,
// navigation related props
navPrev: null,
navNext: null,
onPrevMonthClick: function () {
function onPrevMonthClick() {}
return onPrevMonthClick;
}(),
onNextMonthClick: function () {
function onNextMonthClick() {}
return onNextMonthClick;
}(),
onClose: function () {
function onClose() {}
return onClose;
}(),
// month presentation and interaction related props
renderMonthText: null,
// day presentation and interaction related props
renderCalendarDay: undefined,
renderDayContents: null,
renderMonthElement: null,
enableOutsideDays: false,
isDayBlocked: function () {
function isDayBlocked() {
return false;
}
return isDayBlocked;
}(),
isOutsideRange: function () {
function isOutsideRange(day) {
return !(0, _isInclusivelyAfterDay2['default'])(day, (0, _moment2['default'])());
}
return isOutsideRange;
}(),
isDayHighlighted: function () {
function isDayHighlighted() {}
return isDayHighlighted;
}(),
// internationalization props
displayFormat: function () {
function displayFormat() {
return _moment2['default'].localeData().longDateFormat('L');
}
return displayFormat;
}(),
monthFormat: 'MMMM YYYY',
weekDayFormat: 'dd',
phrases: _defaultPhrases.SingleDatePickerPhrases,
dayAriaLabelFormat: undefined
};
var SingleDatePicker = function (_React$Component) {
_inherits(SingleDatePicker, _React$Component);
function SingleDatePicker(props) {
_classCallCheck(this, SingleDatePicker);
var _this = _possibleConstructorReturn(this, (SingleDatePicker.__proto__ || Object.getPrototypeOf(SingleDatePicker)).call(this, props));
_this.isTouchDevice = false;
_this.state = {
dayPickerContainerStyles: {},
isDayPickerFocused: false,
isInputFocused: false,
showKeyboardShortcuts: false
};
_this.onDayPickerFocus = _this.onDayPickerFocus.bind(_this);
_this.onDayPickerBlur = _this.onDayPickerBlur.bind(_this);
_this.showKeyboardShortcutsPanel = _this.showKeyboardShortcutsPanel.bind(_this);
_this.onChange = _this.onChange.bind(_this);
_this.onFocus = _this.onFocus.bind(_this);
_this.onClearFocus = _this.onClearFocus.bind(_this);
_this.clearDate = _this.clearDate.bind(_this);
_this.responsivizePickerPosition = _this.responsivizePickerPosition.bind(_this);
_this.disableScroll = _this.disableScroll.bind(_this);
_this.setDayPickerContainerRef = _this.setDayPickerContainerRef.bind(_this);
_this.setContainerRef = _this.setContainerRef.bind(_this);
return _this;
}
/* istanbul ignore next */
_createClass(SingleDatePicker, [{
key: 'componentDidMount',
value: function () {
function componentDidMount() {
this.removeEventListener = (0, _consolidatedEvents.addEventListener)(window, 'resize', this.responsivizePickerPosition, {
passive: true
});
this.responsivizePickerPosition();
this.disableScroll();
var focused = this.props.focused;
if (focused) {
this.setState({
isInputFocused: true
});
}
this.isTouchDevice = (0, _isTouchDevice2['default'])();
}
return componentDidMount;
}()
}, {
key: 'componentDidUpdate',
value: function () {
function componentDidUpdate(prevProps) {
var focused = this.props.focused;
if (!prevProps.focused && focused) {
this.responsivizePickerPosition();
this.disableScroll();
} else if (prevProps.focused && !focused) {
if (this.enableScroll) this.enableScroll();
}
}
return componentDidUpdate;
}()
/* istanbul ignore next */
}, {
key: 'componentWillUnmount',
value: function () {
function componentWillUnmount() {
if (this.removeEventListener) this.removeEventListener();
if (this.enableScroll) this.enableScroll();
}
return componentWillUnmount;
}()
}, {
key: 'onChange',
value: function () {
function onChange(dateString) {
var _props = this.props,
isOutsideRange = _props.isOutsideRange,
keepOpenOnDateSelect = _props.keepOpenOnDateSelect,
onDateChange = _props.onDateChange,
onFocusChange = _props.onFocusChange,
onClose = _props.onClose;
var newDate = (0, _toMomentObject2['default'])(dateString, this.getDisplayFormat());
var isValid = newDate && !isOutsideRange(newDate);
if (isValid) {
onDateChange(newDate);
if (!keepOpenOnDateSelect) {
onFocusChange({
focused: false
});
onClose({
date: newDate
});
}
} else {
onDateChange(null);
}
}
return onChange;
}()
}, {
key: 'onFocus',
value: function () {
function onFocus() {
var _props2 = this.props,
disabled = _props2.disabled,
onFocusChange = _props2.onFocusChange,
readOnly = _props2.readOnly,
withPortal = _props2.withPortal,
withFullScreenPortal = _props2.withFullScreenPortal,
keepFocusOnInput = _props2.keepFocusOnInput;
var withAnyPortal = withPortal || withFullScreenPortal;
var moveFocusToDayPicker = withAnyPortal || readOnly && !keepFocusOnInput || this.isTouchDevice && !keepFocusOnInput;
if (moveFocusToDayPicker) {
this.onDayPickerFocus();
} else {
this.onDayPickerBlur();
}
if (!disabled) {
onFocusChange({
focused: true
});
}
}
return onFocus;
}()
}, {
key: 'onClearFocus',
value: function () {
function onClearFocus(event) {
var _props3 = this.props,
date = _props3.date,
focused = _props3.focused,
onFocusChange = _props3.onFocusChange,
onClose = _props3.onClose,
appendToBody = _props3.appendToBody;
if (!focused) return;
if (appendToBody && this.dayPickerContainer.contains(event.target)) return;
this.setState({
isInputFocused: false,
isDayPickerFocused: false
});
onFocusChange({
focused: false
});
onClose({
date: date
});
}
return onClearFocus;
}()
}, {
key: 'onDayPickerFocus',
value: function () {
function onDayPickerFocus() {
this.setState({
isInputFocused: false,
isDayPickerFocused: true,
showKeyboardShortcuts: false
});
}
return onDayPickerFocus;
}()
}, {
key: 'onDayPickerBlur',
value: function () {
function onDayPickerBlur() {
this.setState({
isInputFocused: true,
isDayPickerFocused: false,
showKeyboardShortcuts: false
});
}
return onDayPickerBlur;
}()
}, {
key: 'getDateString',
value: function () {
function getDateString(date) {
var displayFormat = this.getDisplayFormat();
if (date && displayFormat) {
return date && date.format(displayFormat);
}
return (0, _toLocalizedDateString2['default'])(date);
}
return getDateString;
}()
}, {
key: 'getDisplayFormat',
value: function () {
function getDisplayFormat() {
var displayFormat = this.props.displayFormat;
return typeof displayFormat === 'string' ? displayFormat : displayFormat();
}
return getDisplayFormat;
}()
}, {
key: 'setDayPickerContainerRef',
value: function () {
function setDayPickerContainerRef(ref) {
this.dayPickerContainer = ref;
}
return setDayPickerContainerRef;
}()
}, {
key: 'setContainerRef',
value: function () {
function setContainerRef(ref) {
this.container = ref;
}
return setContainerRef;
}()
}, {
key: 'clearDate',
value: function () {
function clearDate() {
var _props4 = this.props,
onDateChange = _props4.onDateChange,
reopenPickerOnClearDate = _props4.reopenPickerOnClearDate,
onFocusChange = _props4.onFocusChange;
onDateChange(null);
if (reopenPickerOnClearDate) {
onFocusChange({
focused: true
});
}
}
return clearDate;
}()
}, {
key: 'disableScroll',
value: function () {
function disableScroll() {
var _props5 = this.props,
appendToBody = _props5.appendToBody,
propDisableScroll = _props5.disableScroll,
focused = _props5.focused;
if (!appendToBody && !propDisableScroll) return;
if (!focused) return; // Disable scroll for every ancestor of this <SingleDatePicker> up to the
// document level. This ensures the input and the picker never move. Other
// sibling elements or the picker itself can scroll.
this.enableScroll = (0, _disableScroll3['default'])(this.container);
}
return disableScroll;
}()
/* istanbul ignore next */
}, {
key: 'responsivizePickerPosition',
value: function () {
function responsivizePickerPosition() {
// It's possible the portal props have been changed in response to window resizes
// So let's ensure we reset this back to the base state each time
this.setState({
dayPickerContainerStyles: {}
});
var _props6 = this.props,
openDirection = _props6.openDirection,
anchorDirection = _props6.anchorDirection,
horizontalMargin = _props6.horizontalMargin,
withPortal = _props6.withPortal,
withFullScreenPortal = _props6.withFullScreenPortal,
appendToBody = _props6.appendToBody,
focused = _props6.focused;
var dayPickerContainerStyles = this.state.dayPickerContainerStyles;
if (!focused) {
return;
}
var isAnchoredLeft = anchorDirection === _constants.ANCHOR_LEFT;
if (!withPortal && !withFullScreenPortal) {
var containerRect = this.dayPickerContainer.getBoundingClientRect();
var currentOffset = dayPickerContainerStyles[anchorDirection] || 0;
var containerEdge = isAnchoredLeft ? containerRect[_constants.ANCHOR_RIGHT] : containerRect[_constants.ANCHOR_LEFT];
this.setState({
dayPickerContainerStyles: (0, _object2['default'])({}, (0, _getResponsiveContainerStyles2['default'])(anchorDirection, currentOffset, containerEdge, horizontalMargin), appendToBody && (0, _getDetachedContainerStyles2['default'])(openDirection, anchorDirection, this.container))
});
}
}
return responsivizePickerPosition;
}()
}, {
key: 'showKeyboardShortcutsPanel',
value: function () {
function showKeyboardShortcutsPanel() {
this.setState({
isInputFocused: false,
isDayPickerFocused: true,
showKeyboardShortcuts: true
});
}
return showKeyboardShortcutsPanel;
}()
}, {
key: 'maybeRenderDayPickerWithPortal',
value: function () {
function maybeRenderDayPickerWithPortal() {
var _props7 = this.props,
focused = _props7.focused,
withPortal = _props7.withPortal,
withFullScreenPortal = _props7.withFullScreenPortal,
appendToBody = _props7.appendToBody;
if (!focused) {
return null;
}
if (withPortal || withFullScreenPortal || appendToBody) {
return _react2['default'].createElement(_reactPortal.Portal, null, this.renderDayPicker());
}
return this.renderDayPicker();
}
return maybeRenderDayPickerWithPortal;
}()
}, {
key: 'renderDayPicker',
value: function () {
function renderDayPicker() {
var _props8 = this.props,
anchorDirection = _props8.anchorDirection,
openDirection = _props8.openDirection,
onDateChange = _props8.onDateChange,
date = _props8.date,
onFocusChange = _props8.onFocusChange,
focused = _props8.focused,
enableOutsideDays = _props8.enableOutsideDays,
numberOfMonths = _props8.numberOfMonths,
orientation = _props8.orientation,
monthFormat = _props8.monthFormat,
navPrev = _props8.navPrev,
navNext = _props8.navNext,
onPrevMonthClick = _props8.onPrevMonthClick,
onNextMonthClick = _props8.onNextMonthClick,
onClose = _props8.onClose,
withPortal = _props8.withPortal,
withFullScreenPortal = _props8.withFullScreenPortal,
keepOpenOnDateSelect = _props8.keepOpenOnDateSelect,
initialVisibleMonth = _props8.initialVisibleMonth,
renderMonthText = _props8.renderMonthText,
renderCalendarDay = _props8.renderCalendarDay,
renderDayContents = _props8.renderDayContents,
renderCalendarInfo = _props8.renderCalendarInfo,
renderMonthElement = _props8.renderMonthElement,
calendarInfoPosition = _props8.calendarInfoPosition,
hideKeyboardShortcutsPanel = _props8.hideKeyboardShortcutsPanel,
firstDayOfWeek = _props8.firstDayOfWeek,
customCloseIcon = _props8.customCloseIcon,
phrases = _props8.phrases,
dayAriaLabelFormat = _props8.dayAriaLabelFormat,
daySize = _props8.daySize,
isRTL = _props8.isRTL,
isOutsideRange = _props8.isOutsideRange,
isDayBlocked = _props8.isDayBlocked,
isDayHighlighted = _props8.isDayHighlighted,
weekDayFormat = _props8.weekDayFormat,
styles = _props8.styles,
verticalHeight = _props8.verticalHeight,
transitionDuration = _props8.transitionDuration,
verticalSpacing = _props8.verticalSpacing,
horizontalMonthPadding = _props8.horizontalMonthPadding,
small = _props8.small,
reactDates = _props8.theme.reactDates;
var _state = this.state,
dayPickerContainerStyles = _state.dayPickerContainerStyles,
isDayPickerFocused = _state.isDayPickerFocused,
showKeyboardShortcuts = _state.showKeyboardShortcuts;
var onOutsideClick = !withFullScreenPortal && withPortal ? this.onClearFocus : undefined;
var closeIcon = customCloseIcon || _react2['default'].createElement(_CloseButton2['default'], null);
var inputHeight = (0, _getInputHeight2['default'])(reactDates, small);
var withAnyPortal = withPortal || withFullScreenPortal;
return _react2['default'].createElement('div', _extends({
// eslint-disable-line jsx-a11y/no-static-element-interactions
ref: this.setDayPickerContainerRef
}, (0, _reactWithStyles.css)(styles.SingleDatePicker_picker, anchorDirection === _constants.ANCHOR_LEFT && styles.SingleDatePicker_picker__directionLeft, anchorDirection === _constants.ANCHOR_RIGHT && styles.SingleDatePicker_picker__directionRight, openDirection === _constants.OPEN_DOWN && styles.SingleDatePicker_picker__openDown, openDirection === _constants.OPEN_UP && styles.SingleDatePicker_picker__openUp, !withAnyPortal && openDirection === _constants.OPEN_DOWN && {
top: inputHeight + verticalSpacing
}, !withAnyPortal && openDirection === _constants.OPEN_UP && {
bottom: inputHeight + verticalSpacing
}, orientation === _constants.HORIZONTAL_ORIENTATION && styles.SingleDatePicker_picker__horizontal, orientation === _constants.VERTICAL_ORIENTATION && styles.SingleDatePicker_picker__vertical, withAnyPortal && styles.SingleDatePicker_picker__portal, withFullScreenPortal && styles.SingleDatePicker_picker__fullScreenPortal, isRTL && styles.SingleDatePicker_picker__rtl, dayPickerContainerStyles), {
onClick: onOutsideClick
}), _react2['default'].createElement(_DayPickerSingleDateController2['default'], {
date: date,
onDateChange: onDateChange,
onFocusChange: onFocusChange,
orientation: orientation,
enableOutsideDays: enableOutsideDays,
numberOfMonths: numberOfMonths,
monthFormat: monthFormat,
withPortal: withAnyPortal,
focused: focused,
keepOpenOnDateSelect: keepOpenOnDateSelect,
hideKeyboardShortcutsPanel: hideKeyboardShortcutsPanel,
initialVisibleMonth: initialVisibleMonth,
navPrev: navPrev,
navNext: navNext,
onPrevMonthClick: onPrevMonthClick,
onNextMonthClick: onNextMonthClick,
onClose: onClose,
renderMonthText: renderMonthText,
renderCalendarDay: renderCalendarDay,
renderDayContents: renderDayContents,
renderCalendarInfo: renderCalendarInfo,
renderMonthElement: renderMonthElement,
calendarInfoPosition: calendarInfoPosition,
isFocused: isDayPickerFocused,
showKeyboardShortcuts: showKeyboardShortcuts,
onBlur: this.onDayPickerBlur,
phrases: phrases,
dayAriaLabelFormat: dayAriaLabelFormat,
daySize: daySize,
isRTL: isRTL,
isOutsideRange: isOutsideRange,
isDayBlocked: isDayBlocked,
isDayHighlighted: isDayHighlighted,
firstDayOfWeek: firstDayOfWeek,
weekDayFormat: weekDayFormat,
verticalHeight: verticalHeight,
transitionDuration: transitionDuration,
horizontalMonthPadding: horizontalMonthPadding
}), withFullScreenPortal && _react2['default'].createElement('button', _extends({}, (0, _reactWithStyles.css)(styles.SingleDatePicker_closeButton), {
'aria-label': phrases.closeDatePicker,
type: 'button',
onClick: this.onClearFocus
}), _react2['default'].createElement('div', (0, _reactWithStyles.css)(styles.SingleDatePicker_closeButton_svg), closeIcon)));
}
return renderDayPicker;
}()
}, {
key: 'render',
value: function () {
function render() {
var _props9 = this.props,
id = _props9.id,
placeholder = _props9.placeholder,
disabled = _props9.disabled,
focused = _props9.focused,
required = _props9.required,
readOnly = _props9.readOnly,
openDirection = _props9.openDirection,
showClearDate = _props9.showClearDate,
showDefaultInputIcon = _props9.showDefaultInputIcon,
inputIconPosition = _props9.inputIconPosition,
customCloseIcon = _props9.customCloseIcon,
customInputIcon = _props9.customInputIcon,
date = _props9.date,
phrases = _props9.phrases,
withPortal = _props9.withPortal,
withFullScreenPortal = _props9.withFullScreenPortal,
screenReaderInputMessage = _props9.screenReaderInputMessage,
isRTL = _props9.isRTL,
noBorder = _props9.noBorder,
block = _props9.block,
small = _props9.small,
regular = _props9.regular,
verticalSpacing = _props9.verticalSpacing,
styles = _props9.styles;
var isInputFocused = this.state.isInputFocused;
var displayValue = this.getDateString(date);
var enableOutsideClick = !withPortal && !withFullScreenPortal;
var hideFang = verticalSpacing < _constants.FANG_HEIGHT_PX;
var input = _react2['default'].createElement(_SingleDatePickerInput2['default'], {
id: id,
placeholder: placeholder,
focused: focused,
isFocused: isInputFocused,
disabled: disabled,
required: required,
readOnly: readOnly,
openDirection: openDirection,
showCaret: !withPortal && !withFullScreenPortal && !hideFang,
onClearDate: this.clearDate,
showClearDate: showClearDate,
showDefaultInputIcon: showDefaultInputIcon,
inputIconPosition: inputIconPosition,
customCloseIcon: customCloseIcon,
customInputIcon: customInputIcon,
displayValue: displayValue,
onChange: this.onChange,
onFocus: this.onFocus,
onKeyDownShiftTab: this.onClearFocus,
onKeyDownTab: this.onClearFocus,
onKeyDownArrowDown: this.onDayPickerFocus,
onKeyDownQuestionMark: this.showKeyboardShortcutsPanel,
screenReaderMessage: screenReaderInputMessage,
phrases: phrases,
isRTL: isRTL,
noBorder: noBorder,
block: block,
small: small,
regular: regular,
verticalSpacing: verticalSpacing
});
return _react2['default'].createElement('div', _extends({
ref: this.setContainerRef
}, (0, _reactWithStyles.css)(styles.SingleDatePicker, block && styles.SingleDatePicker__block)), enableOutsideClick && _react2['default'].createElement(_reactOutsideClickHandler2['default'], {
onOutsideClick: this.onClearFocus
}, input, this.maybeRenderDayPickerWithPortal()), !enableOutsideClick && input, !enableOutsideClick && this.maybeRenderDayPickerWithPortal());
}
return render;
}()
}]);
return SingleDatePicker;
}(_react2['default'].Component);
SingleDatePicker.propTypes = propTypes;
SingleDatePicker.defaultProps = defaultProps;
exports.PureSingleDatePicker = SingleDatePicker;
exports['default'] = (0, _reactWithStyles.withStyles)(function (_ref) {
var _ref$reactDates = _ref.reactDates,
color = _ref$reactDates.color,
zIndex = _ref$reactDates.zIndex;
return {
SingleDatePicker: {
position: 'relative',
display: 'inline-block'
},
SingleDatePicker__block: {
display: 'block'
},
SingleDatePicker_picker: {
zIndex: zIndex + 1,
backgroundColor: color.background,
position: 'absolute'
},
SingleDatePicker_picker__rtl: {
direction: 'rtl'
},
SingleDatePicker_picker__directionLeft: {
left: 0
},
SingleDatePicker_picker__directionRight: {
right: 0
},
SingleDatePicker_picker__portal: {
backgroundColor: 'rgba(0, 0, 0, 0.3)',
position: 'fixed',
top: 0,
left: 0,
height: '100%',
width: '100%'
},
SingleDatePicker_picker__fullScreenPortal: {
backgroundColor: color.background
},
SingleDatePicker_closeButton: {
background: 'none',
border: 0,
color: 'inherit',
font: 'inherit',
lineHeight: 'normal',
overflow: 'visible',
cursor: 'pointer',
position: 'absolute',
top: 0,
right: 0,
padding: 15,
zIndex: zIndex + 2,
':hover': {
color: 'darken(' + String(color.core.grayLighter) + ', 10%)',
textDecoration: 'none'
},
':focus': {
color: 'darken(' + String(color.core.grayLighter) + ', 10%)',
textDecoration: 'none'
}
},
SingleDatePicker_closeButton_svg: {
height: 15,
width: 15,
fill: color.core.grayLighter
}
};
})(SingleDatePicker);
/***/ }),
/***/ "./node_modules/react-dates/lib/components/SingleDatePickerInput.js":
/*!**************************************************************************!*\
!*** ./node_modules/react-dates/lib/components/SingleDatePickerInput.js ***!
\**************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
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 _object = __webpack_require__(/*! object.assign */ "./node_modules/object.assign/index.js");
var _object2 = _interopRequireDefault(_object);
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 _airbnbPropTypes = __webpack_require__(/*! airbnb-prop-types */ "./node_modules/airbnb-prop-types/index.js");
var _reactWithStyles = __webpack_require__(/*! react-with-styles */ "./node_modules/react-with-styles/lib/withStyles.js");
var _defaultPhrases = __webpack_require__(/*! ../defaultPhrases */ "./node_modules/react-dates/lib/defaultPhrases.js");
var _getPhrasePropTypes = __webpack_require__(/*! ../utils/getPhrasePropTypes */ "./node_modules/react-dates/lib/utils/getPhrasePropTypes.js");
var _getPhrasePropTypes2 = _interopRequireDefault(_getPhrasePropTypes);
var _DateInput = __webpack_require__(/*! ./DateInput */ "./node_modules/react-dates/lib/components/DateInput.js");
var _DateInput2 = _interopRequireDefault(_DateInput);
var _IconPositionShape = __webpack_require__(/*! ../shapes/IconPositionShape */ "./node_modules/react-dates/lib/shapes/IconPositionShape.js");
var _IconPositionShape2 = _interopRequireDefault(_IconPositionShape);
var _CloseButton = __webpack_require__(/*! ./CloseButton */ "./node_modules/react-dates/lib/components/CloseButton.js");
var _CloseButton2 = _interopRequireDefault(_CloseButton);
var _CalendarIcon = __webpack_require__(/*! ./CalendarIcon */ "./node_modules/react-dates/lib/components/CalendarIcon.js");
var _CalendarIcon2 = _interopRequireDefault(_CalendarIcon);
var _OpenDirectionShape = __webpack_require__(/*! ../shapes/OpenDirectionShape */ "./node_modules/react-dates/lib/shapes/OpenDirectionShape.js");
var _OpenDirectionShape2 = _interopRequireDefault(_OpenDirectionShape);
var _constants = __webpack_require__(/*! ../constants */ "./node_modules/react-dates/lib/constants.js");
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
'default': obj
};
}
var propTypes = (0, _airbnbPropTypes.forbidExtraProps)((0, _object2['default'])({}, _reactWithStyles.withStylesPropTypes, {
id: _propTypes2['default'].string.isRequired,
placeholder: _propTypes2['default'].string,
// also used as label
displayValue: _propTypes2['default'].string,
screenReaderMessage: _propTypes2['default'].string,
focused: _propTypes2['default'].bool,
isFocused: _propTypes2['default'].bool,
// describes actual DOM focus
disabled: _propTypes2['default'].bool,
required: _propTypes2['default'].bool,
readOnly: _propTypes2['default'].bool,
openDirection: _OpenDirectionShape2['default'],
showCaret: _propTypes2['default'].bool,
showClearDate: _propTypes2['default'].bool,
customCloseIcon: _propTypes2['default'].node,
showDefaultInputIcon: _propTypes2['default'].bool,
inputIconPosition: _IconPositionShape2['default'],
customInputIcon: _propTypes2['default'].node,
isRTL: _propTypes2['default'].bool,
noBorder: _propTypes2['default'].bool,
block: _propTypes2['default'].bool,
small: _propTypes2['default'].bool,
regular: _propTypes2['default'].bool,
verticalSpacing: _airbnbPropTypes.nonNegativeInteger,
onChange: _propTypes2['default'].func,
onClearDate: _propTypes2['default'].func,
onFocus: _propTypes2['default'].func,
onKeyDownShiftTab: _propTypes2['default'].func,
onKeyDownTab: _propTypes2['default'].func,
onKeyDownArrowDown: _propTypes2['default'].func,
onKeyDownQuestionMark: _propTypes2['default'].func,
// i18n
phrases: _propTypes2['default'].shape((0, _getPhrasePropTypes2['default'])(_defaultPhrases.SingleDatePickerInputPhrases))
}));
var defaultProps = {
placeholder: 'Select Date',
displayValue: '',
screenReaderMessage: '',
focused: false,
isFocused: false,
disabled: false,
required: false,
readOnly: false,
openDirection: _constants.OPEN_DOWN,
showCaret: false,
showClearDate: false,
showDefaultInputIcon: false,
inputIconPosition: _constants.ICON_BEFORE_POSITION,
customCloseIcon: null,
customInputIcon: null,
isRTL: false,
noBorder: false,
block: false,
small: false,
regular: false,
verticalSpacing: undefined,
onChange: function () {
function onChange() {}
return onChange;
}(),
onClearDate: function () {
function onClearDate() {}
return onClearDate;
}(),
onFocus: function () {
function onFocus() {}
return onFocus;
}(),
onKeyDownShiftTab: function () {
function onKeyDownShiftTab() {}
return onKeyDownShiftTab;
}(),
onKeyDownTab: function () {
function onKeyDownTab() {}
return onKeyDownTab;
}(),
onKeyDownArrowDown: function () {
function onKeyDownArrowDown() {}
return onKeyDownArrowDown;
}(),
onKeyDownQuestionMark: function () {
function onKeyDownQuestionMark() {}
return onKeyDownQuestionMark;
}(),
// i18n
phrases: _defaultPhrases.SingleDatePickerInputPhrases
};
/* eslint react/no-this-in-sfc: 1 */
function SingleDatePickerInput(_ref) {
var id = _ref.id,
placeholder = _ref.placeholder,
displayValue = _ref.displayValue,
focused = _ref.focused,
isFocused = _ref.isFocused,
disabled = _ref.disabled,
required = _ref.required,
readOnly = _ref.readOnly,
showCaret = _ref.showCaret,
showClearDate = _ref.showClearDate,
showDefaultInputIcon = _ref.showDefaultInputIcon,
inputIconPosition = _ref.inputIconPosition,
phrases = _ref.phrases,
onClearDate = _ref.onClearDate,
onChange = _ref.onChange,
onFocus = _ref.onFocus,
onKeyDownShiftTab = _ref.onKeyDownShiftTab,
onKeyDownTab = _ref.onKeyDownTab,
onKeyDownArrowDown = _ref.onKeyDownArrowDown,
onKeyDownQuestionMark = _ref.onKeyDownQuestionMark,
screenReaderMessage = _ref.screenReaderMessage,
customCloseIcon = _ref.customCloseIcon,
customInputIcon = _ref.customInputIcon,
openDirection = _ref.openDirection,
isRTL = _ref.isRTL,
noBorder = _ref.noBorder,
block = _ref.block,
small = _ref.small,
regular = _ref.regular,
verticalSpacing = _ref.verticalSpacing,
styles = _ref.styles;
var calendarIcon = customInputIcon || _react2['default'].createElement(_CalendarIcon2['default'], (0, _reactWithStyles.css)(styles.SingleDatePickerInput_calendarIcon_svg));
var closeIcon = customCloseIcon || _react2['default'].createElement(_CloseButton2['default'], (0, _reactWithStyles.css)(styles.SingleDatePickerInput_clearDate_svg, small && styles.SingleDatePickerInput_clearDate_svg__small));
var screenReaderText = screenReaderMessage || phrases.keyboardNavigationInstructions;
var inputIcon = (showDefaultInputIcon || customInputIcon !== null) && _react2['default'].createElement('button', _extends({}, (0, _reactWithStyles.css)(styles.SingleDatePickerInput_calendarIcon), {
type: 'button',
disabled: disabled,
'aria-label': phrases.focusStartDate,
onClick: onFocus
}), calendarIcon);
return _react2['default'].createElement('div', (0, _reactWithStyles.css)(styles.SingleDatePickerInput, disabled && styles.SingleDatePickerInput__disabled, isRTL && styles.SingleDatePickerInput__rtl, !noBorder && styles.SingleDatePickerInput__withBorder, block && styles.SingleDatePickerInput__block, showClearDate && styles.SingleDatePickerInput__showClearDate), inputIconPosition === _constants.ICON_BEFORE_POSITION && inputIcon, _react2['default'].createElement(_DateInput2['default'], {
id: id,
placeholder: placeholder // also used as label
,
displayValue: displayValue,
screenReaderMessage: screenReaderText,
focused: focused,
isFocused: isFocused,
disabled: disabled,
required: required,
readOnly: readOnly,
showCaret: showCaret,
onChange: onChange,
onFocus: onFocus,
onKeyDownShiftTab: onKeyDownShiftTab,
onKeyDownTab: onKeyDownTab,
onKeyDownArrowDown: onKeyDownArrowDown,
onKeyDownQuestionMark: onKeyDownQuestionMark,
openDirection: openDirection,
verticalSpacing: verticalSpacing,
small: small,
regular: regular,
block: block
}), showClearDate && _react2['default'].createElement('button', _extends({}, (0, _reactWithStyles.css)(styles.SingleDatePickerInput_clearDate, small && styles.SingleDatePickerInput_clearDate__small, !customCloseIcon && styles.SingleDatePickerInput_clearDate__default, !displayValue && styles.SingleDatePickerInput_clearDate__hide), {
type: 'button',
'aria-label': phrases.clearDate,
disabled: disabled,
onMouseEnter: this && this.onClearDateMouseEnter,
onMouseLeave: this && this.onClearDateMouseLeave,
onClick: onClearDate
}), closeIcon), inputIconPosition === _constants.ICON_AFTER_POSITION && inputIcon);
}
SingleDatePickerInput.propTypes = propTypes;
SingleDatePickerInput.defaultProps = defaultProps;
exports['default'] = (0, _reactWithStyles.withStyles)(function (_ref2) {
var _ref2$reactDates = _ref2.reactDates,
border = _ref2$reactDates.border,
color = _ref2$reactDates.color;
return {
SingleDatePickerInput: {
display: 'inline-block',
backgroundColor: color.background
},
SingleDatePickerInput__withBorder: {
borderColor: color.border,
borderWidth: border.pickerInput.borderWidth,
borderStyle: border.pickerInput.borderStyle,
borderRadius: border.pickerInput.borderRadius
},
SingleDatePickerInput__rtl: {
direction: 'rtl'
},
SingleDatePickerInput__disabled: {
backgroundColor: color.disabled
},
SingleDatePickerInput__block: {
display: 'block'
},
SingleDatePickerInput__showClearDate: {
paddingRight: 30
},
SingleDatePickerInput_clearDate: {
background: 'none',
border: 0,
color: 'inherit',
font: 'inherit',
lineHeight: 'normal',
overflow: 'visible',
cursor: 'pointer',
padding: 10,
margin: '0 10px 0 5px',
position: 'absolute',
right: 0,
top: '50%',
transform: 'translateY(-50%)'
},
SingleDatePickerInput_clearDate__default: {
':focus': {
background: color.core.border,
borderRadius: '50%'
},
':hover': {
background: color.core.border,
borderRadius: '50%'
}
},
SingleDatePickerInput_clearDate__small: {
padding: 6
},
SingleDatePickerInput_clearDate__hide: {
visibility: 'hidden'
},
SingleDatePickerInput_clearDate_svg: {
fill: color.core.grayLight,
height: 12,
width: 15,
verticalAlign: 'middle'
},
SingleDatePickerInput_clearDate_svg__small: {
height: 9
},
SingleDatePickerInput_calendarIcon: {
background: 'none',
border: 0,
color: 'inherit',
font: 'inherit',
lineHeight: 'normal',
overflow: 'visible',
cursor: 'pointer',
display: 'inline-block',
verticalAlign: 'middle',
padding: 10,
margin: '0 5px 0 10px'
},
SingleDatePickerInput_calendarIcon_svg: {
fill: color.core.grayLight,
height: 15,
width: 14,
verticalAlign: 'middle'
}
};
})(SingleDatePickerInput);
/***/ }),
/***/ "./node_modules/react-dates/lib/constants.js":
/*!***************************************************!*\
!*** ./node_modules/react-dates/lib/constants.js ***!
\***************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var DISPLAY_FORMAT = exports.DISPLAY_FORMAT = 'L';
var ISO_FORMAT = exports.ISO_FORMAT = 'YYYY-MM-DD';
var ISO_MONTH_FORMAT = exports.ISO_MONTH_FORMAT = 'YYYY-MM';
var START_DATE = exports.START_DATE = 'startDate';
var END_DATE = exports.END_DATE = 'endDate';
var HORIZONTAL_ORIENTATION = exports.HORIZONTAL_ORIENTATION = 'horizontal';
var VERTICAL_ORIENTATION = exports.VERTICAL_ORIENTATION = 'vertical';
var VERTICAL_SCROLLABLE = exports.VERTICAL_SCROLLABLE = 'verticalScrollable';
var ICON_BEFORE_POSITION = exports.ICON_BEFORE_POSITION = 'before';
var ICON_AFTER_POSITION = exports.ICON_AFTER_POSITION = 'after';
var INFO_POSITION_TOP = exports.INFO_POSITION_TOP = 'top';
var INFO_POSITION_BOTTOM = exports.INFO_POSITION_BOTTOM = 'bottom';
var INFO_POSITION_BEFORE = exports.INFO_POSITION_BEFORE = 'before';
var INFO_POSITION_AFTER = exports.INFO_POSITION_AFTER = 'after';
var ANCHOR_LEFT = exports.ANCHOR_LEFT = 'left';
var ANCHOR_RIGHT = exports.ANCHOR_RIGHT = 'right';
var OPEN_DOWN = exports.OPEN_DOWN = 'down';
var OPEN_UP = exports.OPEN_UP = 'up';
var DAY_SIZE = exports.DAY_SIZE = 39;
var BLOCKED_MODIFIER = exports.BLOCKED_MODIFIER = 'blocked';
var WEEKDAYS = exports.WEEKDAYS = [0, 1, 2, 3, 4, 5, 6];
var FANG_WIDTH_PX = exports.FANG_WIDTH_PX = 20;
var FANG_HEIGHT_PX = exports.FANG_HEIGHT_PX = 10;
var DEFAULT_VERTICAL_SPACING = exports.DEFAULT_VERTICAL_SPACING = 22;
var MODIFIER_KEY_NAMES = exports.MODIFIER_KEY_NAMES = new Set(['Shift', 'Control', 'Alt', 'Meta']);
/***/ }),
/***/ "./node_modules/react-dates/lib/defaultPhrases.js":
/*!********************************************************!*\
!*** ./node_modules/react-dates/lib/defaultPhrases.js ***!
\********************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var calendarLabel = 'Calendar';
var closeDatePicker = 'Close';
var focusStartDate = 'Interact with the calendar and add the check-in date for your trip.';
var clearDate = 'Clear Date';
var clearDates = 'Clear Dates';
var jumpToPrevMonth = 'Move backward to switch to the previous month.';
var jumpToNextMonth = 'Move forward to switch to the next month.';
var keyboardShortcuts = 'Keyboard Shortcuts';
var showKeyboardShortcutsPanel = 'Open the keyboard shortcuts panel.';
var hideKeyboardShortcutsPanel = 'Close the shortcuts panel.';
var openThisPanel = 'Open this panel.';
var enterKey = 'Enter key';
var leftArrowRightArrow = 'Right and left arrow keys';
var upArrowDownArrow = 'up and down arrow keys';
var pageUpPageDown = 'page up and page down keys';
var homeEnd = 'Home and end keys';
var escape = 'Escape key';
var questionMark = 'Question mark';
var selectFocusedDate = 'Select the date in focus.';
var moveFocusByOneDay = 'Move backward (left) and forward (right) by one day.';
var moveFocusByOneWeek = 'Move backward (up) and forward (down) by one week.';
var moveFocusByOneMonth = 'Switch months.';
var moveFocustoStartAndEndOfWeek = 'Go to the first or last day of a week.';
var returnFocusToInput = 'Return to the date input field.';
var keyboardNavigationInstructions = 'Press the down arrow key to interact with the calendar and\n select a date. Press the question mark key to get the keyboard shortcuts for changing dates.';
var chooseAvailableStartDate = function chooseAvailableStartDate(_ref) {
var date = _ref.date;
return 'Choose ' + String(date) + ' as your check-in date. It\u2019s available.';
};
var chooseAvailableEndDate = function chooseAvailableEndDate(_ref2) {
var date = _ref2.date;
return 'Choose ' + String(date) + ' as your check-out date. It\u2019s available.';
};
var chooseAvailableDate = function chooseAvailableDate(_ref3) {
var date = _ref3.date;
return date;
};
var dateIsUnavailable = function dateIsUnavailable(_ref4) {
var date = _ref4.date;
return 'Not available. ' + String(date);
};
var dateIsSelected = function dateIsSelected(_ref5) {
var date = _ref5.date;
return 'Selected. ' + String(date);
};
exports['default'] = {
calendarLabel: calendarLabel,
closeDatePicker: closeDatePicker,
focusStartDate: focusStartDate,
clearDate: clearDate,
clearDates: clearDates,
jumpToPrevMonth: jumpToPrevMonth,
jumpToNextMonth: jumpToNextMonth,
keyboardShortcuts: keyboardShortcuts,
showKeyboardShortcutsPanel: showKeyboardShortcutsPanel,
hideKeyboardShortcutsPanel: hideKeyboardShortcutsPanel,
openThisPanel: openThisPanel,
enterKey: enterKey,
leftArrowRightArrow: leftArrowRightArrow,
upArrowDownArrow: upArrowDownArrow,
pageUpPageDown: pageUpPageDown,
homeEnd: homeEnd,
escape: escape,
questionMark: questionMark,
selectFocusedDate: selectFocusedDate,
moveFocusByOneDay: moveFocusByOneDay,
moveFocusByOneWeek: moveFocusByOneWeek,
moveFocusByOneMonth: moveFocusByOneMonth,
moveFocustoStartAndEndOfWeek: moveFocustoStartAndEndOfWeek,
returnFocusToInput: returnFocusToInput,
keyboardNavigationInstructions: keyboardNavigationInstructions,
chooseAvailableStartDate: chooseAvailableStartDate,
chooseAvailableEndDate: chooseAvailableEndDate,
dateIsUnavailable: dateIsUnavailable,
dateIsSelected: dateIsSelected
};
var DateRangePickerPhrases = exports.DateRangePickerPhrases = {
calendarLabel: calendarLabel,
closeDatePicker: closeDatePicker,
clearDates: clearDates,
focusStartDate: focusStartDate,
jumpToPrevMonth: jumpToPrevMonth,
jumpToNextMonth: jumpToNextMonth,
keyboardShortcuts: keyboardShortcuts,
showKeyboardShortcutsPanel: showKeyboardShortcutsPanel,
hideKeyboardShortcutsPanel: hideKeyboardShortcutsPanel,
openThisPanel: openThisPanel,
enterKey: enterKey,
leftArrowRightArrow: leftArrowRightArrow,
upArrowDownArrow: upArrowDownArrow,
pageUpPageDown: pageUpPageDown,
homeEnd: homeEnd,
escape: escape,
questionMark: questionMark,
selectFocusedDate: selectFocusedDate,
moveFocusByOneDay: moveFocusByOneDay,
moveFocusByOneWeek: moveFocusByOneWeek,
moveFocusByOneMonth: moveFocusByOneMonth,
moveFocustoStartAndEndOfWeek: moveFocustoStartAndEndOfWeek,
returnFocusToInput: returnFocusToInput,
keyboardNavigationInstructions: keyboardNavigationInstructions,
chooseAvailableStartDate: chooseAvailableStartDate,
chooseAvailableEndDate: chooseAvailableEndDate,
dateIsUnavailable: dateIsUnavailable,
dateIsSelected: dateIsSelected
};
var DateRangePickerInputPhrases = exports.DateRangePickerInputPhrases = {
focusStartDate: focusStartDate,
clearDates: clearDates,
keyboardNavigationInstructions: keyboardNavigationInstructions
};
var SingleDatePickerPhrases = exports.SingleDatePickerPhrases = {
calendarLabel: calendarLabel,
closeDatePicker: closeDatePicker,
clearDate: clearDate,
jumpToPrevMonth: jumpToPrevMonth,
jumpToNextMonth: jumpToNextMonth,
keyboardShortcuts: keyboardShortcuts,
showKeyboardShortcutsPanel: showKeyboardShortcutsPanel,
hideKeyboardShortcutsPanel: hideKeyboardShortcutsPanel,
openThisPanel: openThisPanel,
enterKey: enterKey,
leftArrowRightArrow: leftArrowRightArrow,
upArrowDownArrow: upArrowDownArrow,
pageUpPageDown: pageUpPageDown,
homeEnd: homeEnd,
escape: escape,
questionMark: questionMark,
selectFocusedDate: selectFocusedDate,
moveFocusByOneDay: moveFocusByOneDay,
moveFocusByOneWeek: moveFocusByOneWeek,
moveFocusByOneMonth: moveFocusByOneMonth,
moveFocustoStartAndEndOfWeek: moveFocustoStartAndEndOfWeek,
returnFocusToInput: returnFocusToInput,
keyboardNavigationInstructions: keyboardNavigationInstructions,
chooseAvailableDate: chooseAvailableDate,
dateIsUnavailable: dateIsUnavailable,
dateIsSelected: dateIsSelected
};
var SingleDatePickerInputPhrases = exports.SingleDatePickerInputPhrases = {
clearDate: clearDate,
keyboardNavigationInstructions: keyboardNavigationInstructions
};
var DayPickerPhrases = exports.DayPickerPhrases = {
calendarLabel: calendarLabel,
jumpToPrevMonth: jumpToPrevMonth,
jumpToNextMonth: jumpToNextMonth,
keyboardShortcuts: keyboardShortcuts,
showKeyboardShortcutsPanel: showKeyboardShortcutsPanel,
hideKeyboardShortcutsPanel: hideKeyboardShortcutsPanel,
openThisPanel: openThisPanel,
enterKey: enterKey,
leftArrowRightArrow: leftArrowRightArrow,
upArrowDownArrow: upArrowDownArrow,
pageUpPageDown: pageUpPageDown,
homeEnd: homeEnd,
escape: escape,
questionMark: questionMark,
selectFocusedDate: selectFocusedDate,
moveFocusByOneDay: moveFocusByOneDay,
moveFocusByOneWeek: moveFocusByOneWeek,
moveFocusByOneMonth: moveFocusByOneMonth,
moveFocustoStartAndEndOfWeek: moveFocustoStartAndEndOfWeek,
returnFocusToInput: returnFocusToInput,
chooseAvailableStartDate: chooseAvailableStartDate,
chooseAvailableEndDate: chooseAvailableEndDate,
chooseAvailableDate: chooseAvailableDate,
dateIsUnavailable: dateIsUnavailable,
dateIsSelected: dateIsSelected
};
var DayPickerKeyboardShortcutsPhrases = exports.DayPickerKeyboardShortcutsPhrases = {
keyboardShortcuts: keyboardShortcuts,
showKeyboardShortcutsPanel: showKeyboardShortcutsPanel,
hideKeyboardShortcutsPanel: hideKeyboardShortcutsPanel,
openThisPanel: openThisPanel,
enterKey: enterKey,
leftArrowRightArrow: leftArrowRightArrow,
upArrowDownArrow: upArrowDownArrow,
pageUpPageDown: pageUpPageDown,
homeEnd: homeEnd,
escape: escape,
questionMark: questionMark,
selectFocusedDate: selectFocusedDate,
moveFocusByOneDay: moveFocusByOneDay,
moveFocusByOneWeek: moveFocusByOneWeek,
moveFocusByOneMonth: moveFocusByOneMonth,
moveFocustoStartAndEndOfWeek: moveFocustoStartAndEndOfWeek,
returnFocusToInput: returnFocusToInput
};
var DayPickerNavigationPhrases = exports.DayPickerNavigationPhrases = {
jumpToPrevMonth: jumpToPrevMonth,
jumpToNextMonth: jumpToNextMonth
};
var CalendarDayPhrases = exports.CalendarDayPhrases = {
chooseAvailableDate: chooseAvailableDate,
dateIsUnavailable: dateIsUnavailable,
dateIsSelected: dateIsSelected
};
/***/ }),
/***/ "./node_modules/react-dates/lib/index.js":
/*!***********************************************!*\
!*** ./node_modules/react-dates/lib/index.js ***!
\***********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _CalendarDay = __webpack_require__(/*! ./components/CalendarDay */ "./node_modules/react-dates/lib/components/CalendarDay.js");
Object.defineProperty(exports, 'CalendarDay', {
enumerable: true,
get: function () {
function get() {
return _interopRequireDefault(_CalendarDay)['default'];
}
return get;
}()
});
var _CalendarMonth = __webpack_require__(/*! ./components/CalendarMonth */ "./node_modules/react-dates/lib/components/CalendarMonth.js");
Object.defineProperty(exports, 'CalendarMonth', {
enumerable: true,
get: function () {
function get() {
return _interopRequireDefault(_CalendarMonth)['default'];
}
return get;
}()
});
var _CalendarMonthGrid = __webpack_require__(/*! ./components/CalendarMonthGrid */ "./node_modules/react-dates/lib/components/CalendarMonthGrid.js");
Object.defineProperty(exports, 'CalendarMonthGrid', {
enumerable: true,
get: function () {
function get() {
return _interopRequireDefault(_CalendarMonthGrid)['default'];
}
return get;
}()
});
var _DateRangePicker = __webpack_require__(/*! ./components/DateRangePicker */ "./node_modules/react-dates/lib/components/DateRangePicker.js");
Object.defineProperty(exports, 'DateRangePicker', {
enumerable: true,
get: function () {
function get() {
return _interopRequireDefault(_DateRangePicker)['default'];
}
return get;
}()
});
var _DateRangePickerInput = __webpack_require__(/*! ./components/DateRangePickerInput */ "./node_modules/react-dates/lib/components/DateRangePickerInput.js");
Object.defineProperty(exports, 'DateRangePickerInput', {
enumerable: true,
get: function () {
function get() {
return _interopRequireDefault(_DateRangePickerInput)['default'];
}
return get;
}()
});
var _DateRangePickerInputController = __webpack_require__(/*! ./components/DateRangePickerInputController */ "./node_modules/react-dates/lib/components/DateRangePickerInputController.js");
Object.defineProperty(exports, 'DateRangePickerInputController', {
enumerable: true,
get: function () {
function get() {
return _interopRequireDefault(_DateRangePickerInputController)['default'];
}
return get;
}()
});
var _DateRangePickerShape = __webpack_require__(/*! ./shapes/DateRangePickerShape */ "./node_modules/react-dates/lib/shapes/DateRangePickerShape.js");
Object.defineProperty(exports, 'DateRangePickerShape', {
enumerable: true,
get: function () {
function get() {
return _interopRequireDefault(_DateRangePickerShape)['default'];
}
return get;
}()
});
var _DayPicker = __webpack_require__(/*! ./components/DayPicker */ "./node_modules/react-dates/lib/components/DayPicker.js");
Object.defineProperty(exports, 'DayPicker', {
enumerable: true,
get: function () {
function get() {
return _interopRequireDefault(_DayPicker)['default'];
}
return get;
}()
});
var _DayPickerRangeController = __webpack_require__(/*! ./components/DayPickerRangeController */ "./node_modules/react-dates/lib/components/DayPickerRangeController.js");
Object.defineProperty(exports, 'DayPickerRangeController', {
enumerable: true,
get: function () {
function get() {
return _interopRequireDefault(_DayPickerRangeController)['default'];
}
return get;
}()
});
var _DayPickerSingleDateController = __webpack_require__(/*! ./components/DayPickerSingleDateController */ "./node_modules/react-dates/lib/components/DayPickerSingleDateController.js");
Object.defineProperty(exports, 'DayPickerSingleDateController', {
enumerable: true,
get: function () {
function get() {
return _interopRequireDefault(_DayPickerSingleDateController)['default'];
}
return get;
}()
});
var _SingleDatePicker = __webpack_require__(/*! ./components/SingleDatePicker */ "./node_modules/react-dates/lib/components/SingleDatePicker.js");
Object.defineProperty(exports, 'SingleDatePicker', {
enumerable: true,
get: function () {
function get() {
return _interopRequireDefault(_SingleDatePicker)['default'];
}
return get;
}()
});
var _SingleDatePickerInput = __webpack_require__(/*! ./components/SingleDatePickerInput */ "./node_modules/react-dates/lib/components/SingleDatePickerInput.js");
Object.defineProperty(exports, 'SingleDatePickerInput', {
enumerable: true,
get: function () {
function get() {
return _interopRequireDefault(_SingleDatePickerInput)['default'];
}
return get;
}()
});
var _SingleDatePickerShape = __webpack_require__(/*! ./shapes/SingleDatePickerShape */ "./node_modules/react-dates/lib/shapes/SingleDatePickerShape.js");
Object.defineProperty(exports, 'SingleDatePickerShape', {
enumerable: true,
get: function () {
function get() {
return _interopRequireDefault(_SingleDatePickerShape)['default'];
}
return get;
}()
});
var _isInclusivelyAfterDay = __webpack_require__(/*! ./utils/isInclusivelyAfterDay */ "./node_modules/react-dates/lib/utils/isInclusivelyAfterDay.js");
Object.defineProperty(exports, 'isInclusivelyAfterDay', {
enumerable: true,
get: function () {
function get() {
return _interopRequireDefault(_isInclusivelyAfterDay)['default'];
}
return get;
}()
});
var _isInclusivelyBeforeDay = __webpack_require__(/*! ./utils/isInclusivelyBeforeDay */ "./node_modules/react-dates/lib/utils/isInclusivelyBeforeDay.js");
Object.defineProperty(exports, 'isInclusivelyBeforeDay', {
enumerable: true,
get: function () {
function get() {
return _interopRequireDefault(_isInclusivelyBeforeDay)['default'];
}
return get;
}()
});
var _isNextDay = __webpack_require__(/*! ./utils/isNextDay */ "./node_modules/react-dates/lib/utils/isNextDay.js");
Object.defineProperty(exports, 'isNextDay', {
enumerable: true,
get: function () {
function get() {
return _interopRequireDefault(_isNextDay)['default'];
}
return get;
}()
});
var _isSameDay = __webpack_require__(/*! ./utils/isSameDay */ "./node_modules/react-dates/lib/utils/isSameDay.js");
Object.defineProperty(exports, 'isSameDay', {
enumerable: true,
get: function () {
function get() {
return _interopRequireDefault(_isSameDay)['default'];
}
return get;
}()
});
var _toISODateString = __webpack_require__(/*! ./utils/toISODateString */ "./node_modules/react-dates/lib/utils/toISODateString.js");
Object.defineProperty(exports, 'toISODateString', {
enumerable: true,
get: function () {
function get() {
return _interopRequireDefault(_toISODateString)['default'];
}
return get;
}()
});
var _toLocalizedDateString = __webpack_require__(/*! ./utils/toLocalizedDateString */ "./node_modules/react-dates/lib/utils/toLocalizedDateString.js");
Object.defineProperty(exports, 'toLocalizedDateString', {
enumerable: true,
get: function () {
function get() {
return _interopRequireDefault(_toLocalizedDateString)['default'];
}
return get;
}()
});
var _toMomentObject = __webpack_require__(/*! ./utils/toMomentObject */ "./node_modules/react-dates/lib/utils/toMomentObject.js");
Object.defineProperty(exports, 'toMomentObject', {
enumerable: true,
get: function () {
function get() {
return _interopRequireDefault(_toMomentObject)['default'];
}
return get;
}()
});
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
'default': obj
};
}
/***/ }),
/***/ "./node_modules/react-dates/lib/initialize.js":
/*!****************************************************!*\
!*** ./node_modules/react-dates/lib/initialize.js ***!
\****************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var _registerCSSInterfaceWithDefaultTheme = __webpack_require__(/*! ./utils/registerCSSInterfaceWithDefaultTheme */ "./node_modules/react-dates/lib/utils/registerCSSInterfaceWithDefaultTheme.js");
var _registerCSSInterfaceWithDefaultTheme2 = _interopRequireDefault(_registerCSSInterfaceWithDefaultTheme);
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
'default': obj
};
}
(0, _registerCSSInterfaceWithDefaultTheme2['default'])();
/***/ }),
/***/ "./node_modules/react-dates/lib/shapes/AnchorDirectionShape.js":
/*!*********************************************************************!*\
!*** ./node_modules/react-dates/lib/shapes/AnchorDirectionShape.js ***!
\*********************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _propTypes = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js");
var _propTypes2 = _interopRequireDefault(_propTypes);
var _constants = __webpack_require__(/*! ../constants */ "./node_modules/react-dates/lib/constants.js");
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
'default': obj
};
}
exports['default'] = _propTypes2['default'].oneOf([_constants.ANCHOR_LEFT, _constants.ANCHOR_RIGHT]);
/***/ }),
/***/ "./node_modules/react-dates/lib/shapes/CalendarInfoPositionShape.js":
/*!**************************************************************************!*\
!*** ./node_modules/react-dates/lib/shapes/CalendarInfoPositionShape.js ***!
\**************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _propTypes = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js");
var _propTypes2 = _interopRequireDefault(_propTypes);
var _constants = __webpack_require__(/*! ../constants */ "./node_modules/react-dates/lib/constants.js");
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
'default': obj
};
}
exports['default'] = _propTypes2['default'].oneOf([_constants.INFO_POSITION_TOP, _constants.INFO_POSITION_BOTTOM, _constants.INFO_POSITION_BEFORE, _constants.INFO_POSITION_AFTER]);
/***/ }),
/***/ "./node_modules/react-dates/lib/shapes/DateRangePickerShape.js":
/*!*********************************************************************!*\
!*** ./node_modules/react-dates/lib/shapes/DateRangePickerShape.js ***!
\*********************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _propTypes = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js");
var _propTypes2 = _interopRequireDefault(_propTypes);
var _reactMomentProptypes = __webpack_require__(/*! react-moment-proptypes */ "./node_modules/react-moment-proptypes/src/index.js");
var _reactMomentProptypes2 = _interopRequireDefault(_reactMomentProptypes);
var _airbnbPropTypes = __webpack_require__(/*! airbnb-prop-types */ "./node_modules/airbnb-prop-types/index.js");
var _defaultPhrases = __webpack_require__(/*! ../defaultPhrases */ "./node_modules/react-dates/lib/defaultPhrases.js");
var _getPhrasePropTypes = __webpack_require__(/*! ../utils/getPhrasePropTypes */ "./node_modules/react-dates/lib/utils/getPhrasePropTypes.js");
var _getPhrasePropTypes2 = _interopRequireDefault(_getPhrasePropTypes);
var _FocusedInputShape = __webpack_require__(/*! ./FocusedInputShape */ "./node_modules/react-dates/lib/shapes/FocusedInputShape.js");
var _FocusedInputShape2 = _interopRequireDefault(_FocusedInputShape);
var _IconPositionShape = __webpack_require__(/*! ./IconPositionShape */ "./node_modules/react-dates/lib/shapes/IconPositionShape.js");
var _IconPositionShape2 = _interopRequireDefault(_IconPositionShape);
var _OrientationShape = __webpack_require__(/*! ./OrientationShape */ "./node_modules/react-dates/lib/shapes/OrientationShape.js");
var _OrientationShape2 = _interopRequireDefault(_OrientationShape);
var _DisabledShape = __webpack_require__(/*! ./DisabledShape */ "./node_modules/react-dates/lib/shapes/DisabledShape.js");
var _DisabledShape2 = _interopRequireDefault(_DisabledShape);
var _AnchorDirectionShape = __webpack_require__(/*! ./AnchorDirectionShape */ "./node_modules/react-dates/lib/shapes/AnchorDirectionShape.js");
var _AnchorDirectionShape2 = _interopRequireDefault(_AnchorDirectionShape);
var _OpenDirectionShape = __webpack_require__(/*! ./OpenDirectionShape */ "./node_modules/react-dates/lib/shapes/OpenDirectionShape.js");
var _OpenDirectionShape2 = _interopRequireDefault(_OpenDirectionShape);
var _DayOfWeekShape = __webpack_require__(/*! ./DayOfWeekShape */ "./node_modules/react-dates/lib/shapes/DayOfWeekShape.js");
var _DayOfWeekShape2 = _interopRequireDefault(_DayOfWeekShape);
var _CalendarInfoPositionShape = __webpack_require__(/*! ./CalendarInfoPositionShape */ "./node_modules/react-dates/lib/shapes/CalendarInfoPositionShape.js");
var _CalendarInfoPositionShape2 = _interopRequireDefault(_CalendarInfoPositionShape);
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
'default': obj
};
}
exports['default'] = {
// required props for a functional interactive DateRangePicker
startDate: _reactMomentProptypes2['default'].momentObj,
endDate: _reactMomentProptypes2['default'].momentObj,
onDatesChange: _propTypes2['default'].func.isRequired,
focusedInput: _FocusedInputShape2['default'],
onFocusChange: _propTypes2['default'].func.isRequired,
onClose: _propTypes2['default'].func,
// input related props
startDateId: _propTypes2['default'].string.isRequired,
startDatePlaceholderText: _propTypes2['default'].string,
endDateId: _propTypes2['default'].string.isRequired,
endDatePlaceholderText: _propTypes2['default'].string,
disabled: _DisabledShape2['default'],
required: _propTypes2['default'].bool,
readOnly: _propTypes2['default'].bool,
screenReaderInputMessage: _propTypes2['default'].string,
showClearDates: _propTypes2['default'].bool,
showDefaultInputIcon: _propTypes2['default'].bool,
inputIconPosition: _IconPositionShape2['default'],
customInputIcon: _propTypes2['default'].node,
customArrowIcon: _propTypes2['default'].node,
customCloseIcon: _propTypes2['default'].node,
noBorder: _propTypes2['default'].bool,
block: _propTypes2['default'].bool,
small: _propTypes2['default'].bool,
regular: _propTypes2['default'].bool,
keepFocusOnInput: _propTypes2['default'].bool,
// calendar presentation and interaction related props
renderMonthText: (0, _airbnbPropTypes.mutuallyExclusiveProps)(_propTypes2['default'].func, 'renderMonthText', 'renderMonthElement'),
renderMonthElement: (0, _airbnbPropTypes.mutuallyExclusiveProps)(_propTypes2['default'].func, 'renderMonthText', 'renderMonthElement'),
orientation: _OrientationShape2['default'],
anchorDirection: _AnchorDirectionShape2['default'],
openDirection: _OpenDirectionShape2['default'],
horizontalMargin: _propTypes2['default'].number,
withPortal: _propTypes2['default'].bool,
withFullScreenPortal: _propTypes2['default'].bool,
appendToBody: _propTypes2['default'].bool,
disableScroll: _propTypes2['default'].bool,
daySize: _airbnbPropTypes.nonNegativeInteger,
isRTL: _propTypes2['default'].bool,
firstDayOfWeek: _DayOfWeekShape2['default'],
initialVisibleMonth: _propTypes2['default'].func,
numberOfMonths: _propTypes2['default'].number,
keepOpenOnDateSelect: _propTypes2['default'].bool,
reopenPickerOnClearDates: _propTypes2['default'].bool,
renderCalendarInfo: _propTypes2['default'].func,
calendarInfoPosition: _CalendarInfoPositionShape2['default'],
hideKeyboardShortcutsPanel: _propTypes2['default'].bool,
verticalHeight: _airbnbPropTypes.nonNegativeInteger,
transitionDuration: _airbnbPropTypes.nonNegativeInteger,
verticalSpacing: _airbnbPropTypes.nonNegativeInteger,
// navigation related props
navPrev: _propTypes2['default'].node,
navNext: _propTypes2['default'].node,
onPrevMonthClick: _propTypes2['default'].func,
onNextMonthClick: _propTypes2['default'].func,
// day presentation and interaction related props
renderCalendarDay: _propTypes2['default'].func,
renderDayContents: _propTypes2['default'].func,
minimumNights: _propTypes2['default'].number,
enableOutsideDays: _propTypes2['default'].bool,
isDayBlocked: _propTypes2['default'].func,
isOutsideRange: _propTypes2['default'].func,
isDayHighlighted: _propTypes2['default'].func,
// internationalization props
displayFormat: _propTypes2['default'].oneOfType([_propTypes2['default'].string, _propTypes2['default'].func]),
monthFormat: _propTypes2['default'].string,
weekDayFormat: _propTypes2['default'].string,
phrases: _propTypes2['default'].shape((0, _getPhrasePropTypes2['default'])(_defaultPhrases.DateRangePickerPhrases)),
dayAriaLabelFormat: _propTypes2['default'].string
};
/***/ }),
/***/ "./node_modules/react-dates/lib/shapes/DayOfWeekShape.js":
/*!***************************************************************!*\
!*** ./node_modules/react-dates/lib/shapes/DayOfWeekShape.js ***!
\***************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _propTypes = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js");
var _propTypes2 = _interopRequireDefault(_propTypes);
var _constants = __webpack_require__(/*! ../constants */ "./node_modules/react-dates/lib/constants.js");
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
'default': obj
};
}
exports['default'] = _propTypes2['default'].oneOf(_constants.WEEKDAYS);
/***/ }),
/***/ "./node_modules/react-dates/lib/shapes/DisabledShape.js":
/*!**************************************************************!*\
!*** ./node_modules/react-dates/lib/shapes/DisabledShape.js ***!
\**************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _propTypes = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js");
var _propTypes2 = _interopRequireDefault(_propTypes);
var _constants = __webpack_require__(/*! ../constants */ "./node_modules/react-dates/lib/constants.js");
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
'default': obj
};
}
exports['default'] = _propTypes2['default'].oneOfType([_propTypes2['default'].bool, _propTypes2['default'].oneOf([_constants.START_DATE, _constants.END_DATE])]);
/***/ }),
/***/ "./node_modules/react-dates/lib/shapes/FocusedInputShape.js":
/*!******************************************************************!*\
!*** ./node_modules/react-dates/lib/shapes/FocusedInputShape.js ***!
\******************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _propTypes = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js");
var _propTypes2 = _interopRequireDefault(_propTypes);
var _constants = __webpack_require__(/*! ../constants */ "./node_modules/react-dates/lib/constants.js");
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
'default': obj
};
}
exports['default'] = _propTypes2['default'].oneOf([_constants.START_DATE, _constants.END_DATE]);
/***/ }),
/***/ "./node_modules/react-dates/lib/shapes/IconPositionShape.js":
/*!******************************************************************!*\
!*** ./node_modules/react-dates/lib/shapes/IconPositionShape.js ***!
\******************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _propTypes = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js");
var _propTypes2 = _interopRequireDefault(_propTypes);
var _constants = __webpack_require__(/*! ../constants */ "./node_modules/react-dates/lib/constants.js");
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
'default': obj
};
}
exports['default'] = _propTypes2['default'].oneOf([_constants.ICON_BEFORE_POSITION, _constants.ICON_AFTER_POSITION]);
/***/ }),
/***/ "./node_modules/react-dates/lib/shapes/ModifiersShape.js":
/*!***************************************************************!*\
!*** ./node_modules/react-dates/lib/shapes/ModifiersShape.js ***!
\***************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _propTypes = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js");
var _propTypes2 = _interopRequireDefault(_propTypes);
var _airbnbPropTypes = __webpack_require__(/*! airbnb-prop-types */ "./node_modules/airbnb-prop-types/index.js");
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 _toConsumableArray(arr) {
if (Array.isArray(arr)) {
for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) {
arr2[i] = arr[i];
}
return arr2;
} else {
return Array.from(arr);
}
}
exports['default'] = (0, _airbnbPropTypes.and)([_propTypes2['default'].instanceOf(Set), function () {
function modifiers(props, propName) {
for (var _len = arguments.length, rest = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
rest[_key - 2] = arguments[_key];
}
var propValue = props[propName];
var firstError = void 0;
[].concat(_toConsumableArray(propValue)).some(function (v, i) {
var _PropTypes$string;
var fakePropName = String(propName) + ': index ' + String(i);
firstError = (_PropTypes$string = _propTypes2['default'].string).isRequired.apply(_PropTypes$string, [_defineProperty({}, fakePropName, v), fakePropName].concat(rest));
return firstError != null;
});
return firstError == null ? null : firstError;
}
return modifiers;
}()], 'Modifiers (Set of Strings)');
/***/ }),
/***/ "./node_modules/react-dates/lib/shapes/OpenDirectionShape.js":
/*!*******************************************************************!*\
!*** ./node_modules/react-dates/lib/shapes/OpenDirectionShape.js ***!
\*******************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _propTypes = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js");
var _propTypes2 = _interopRequireDefault(_propTypes);
var _constants = __webpack_require__(/*! ../constants */ "./node_modules/react-dates/lib/constants.js");
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
'default': obj
};
}
exports['default'] = _propTypes2['default'].oneOf([_constants.OPEN_DOWN, _constants.OPEN_UP]);
/***/ }),
/***/ "./node_modules/react-dates/lib/shapes/OrientationShape.js":
/*!*****************************************************************!*\
!*** ./node_modules/react-dates/lib/shapes/OrientationShape.js ***!
\*****************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _propTypes = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js");
var _propTypes2 = _interopRequireDefault(_propTypes);
var _constants = __webpack_require__(/*! ../constants */ "./node_modules/react-dates/lib/constants.js");
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
'default': obj
};
}
exports['default'] = _propTypes2['default'].oneOf([_constants.HORIZONTAL_ORIENTATION, _constants.VERTICAL_ORIENTATION]);
/***/ }),
/***/ "./node_modules/react-dates/lib/shapes/ScrollableOrientationShape.js":
/*!***************************************************************************!*\
!*** ./node_modules/react-dates/lib/shapes/ScrollableOrientationShape.js ***!
\***************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _propTypes = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js");
var _propTypes2 = _interopRequireDefault(_propTypes);
var _constants = __webpack_require__(/*! ../constants */ "./node_modules/react-dates/lib/constants.js");
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
'default': obj
};
}
exports['default'] = _propTypes2['default'].oneOf([_constants.HORIZONTAL_ORIENTATION, _constants.VERTICAL_ORIENTATION, _constants.VERTICAL_SCROLLABLE]);
/***/ }),
/***/ "./node_modules/react-dates/lib/shapes/SingleDatePickerShape.js":
/*!**********************************************************************!*\
!*** ./node_modules/react-dates/lib/shapes/SingleDatePickerShape.js ***!
\**********************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _propTypes = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js");
var _propTypes2 = _interopRequireDefault(_propTypes);
var _reactMomentProptypes = __webpack_require__(/*! react-moment-proptypes */ "./node_modules/react-moment-proptypes/src/index.js");
var _reactMomentProptypes2 = _interopRequireDefault(_reactMomentProptypes);
var _airbnbPropTypes = __webpack_require__(/*! airbnb-prop-types */ "./node_modules/airbnb-prop-types/index.js");
var _defaultPhrases = __webpack_require__(/*! ../defaultPhrases */ "./node_modules/react-dates/lib/defaultPhrases.js");
var _getPhrasePropTypes = __webpack_require__(/*! ../utils/getPhrasePropTypes */ "./node_modules/react-dates/lib/utils/getPhrasePropTypes.js");
var _getPhrasePropTypes2 = _interopRequireDefault(_getPhrasePropTypes);
var _IconPositionShape = __webpack_require__(/*! ./IconPositionShape */ "./node_modules/react-dates/lib/shapes/IconPositionShape.js");
var _IconPositionShape2 = _interopRequireDefault(_IconPositionShape);
var _OrientationShape = __webpack_require__(/*! ./OrientationShape */ "./node_modules/react-dates/lib/shapes/OrientationShape.js");
var _OrientationShape2 = _interopRequireDefault(_OrientationShape);
var _AnchorDirectionShape = __webpack_require__(/*! ./AnchorDirectionShape */ "./node_modules/react-dates/lib/shapes/AnchorDirectionShape.js");
var _AnchorDirectionShape2 = _interopRequireDefault(_AnchorDirectionShape);
var _OpenDirectionShape = __webpack_require__(/*! ./OpenDirectionShape */ "./node_modules/react-dates/lib/shapes/OpenDirectionShape.js");
var _OpenDirectionShape2 = _interopRequireDefault(_OpenDirectionShape);
var _DayOfWeekShape = __webpack_require__(/*! ./DayOfWeekShape */ "./node_modules/react-dates/lib/shapes/DayOfWeekShape.js");
var _DayOfWeekShape2 = _interopRequireDefault(_DayOfWeekShape);
var _CalendarInfoPositionShape = __webpack_require__(/*! ./CalendarInfoPositionShape */ "./node_modules/react-dates/lib/shapes/CalendarInfoPositionShape.js");
var _CalendarInfoPositionShape2 = _interopRequireDefault(_CalendarInfoPositionShape);
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
'default': obj
};
}
exports['default'] = {
// required props for a functional interactive SingleDatePicker
date: _reactMomentProptypes2['default'].momentObj,
onDateChange: _propTypes2['default'].func.isRequired,
focused: _propTypes2['default'].bool,
onFocusChange: _propTypes2['default'].func.isRequired,
// input related props
id: _propTypes2['default'].string.isRequired,
placeholder: _propTypes2['default'].string,
disabled: _propTypes2['default'].bool,
required: _propTypes2['default'].bool,
readOnly: _propTypes2['default'].bool,
screenReaderInputMessage: _propTypes2['default'].string,
showClearDate: _propTypes2['default'].bool,
customCloseIcon: _propTypes2['default'].node,
showDefaultInputIcon: _propTypes2['default'].bool,
inputIconPosition: _IconPositionShape2['default'],
customInputIcon: _propTypes2['default'].node,
noBorder: _propTypes2['default'].bool,
block: _propTypes2['default'].bool,
small: _propTypes2['default'].bool,
regular: _propTypes2['default'].bool,
verticalSpacing: _airbnbPropTypes.nonNegativeInteger,
keepFocusOnInput: _propTypes2['default'].bool,
// calendar presentation and interaction related props
renderMonthText: (0, _airbnbPropTypes.mutuallyExclusiveProps)(_propTypes2['default'].func, 'renderMonthText', 'renderMonthElement'),
renderMonthElement: (0, _airbnbPropTypes.mutuallyExclusiveProps)(_propTypes2['default'].func, 'renderMonthText', 'renderMonthElement'),
orientation: _OrientationShape2['default'],
anchorDirection: _AnchorDirectionShape2['default'],
openDirection: _OpenDirectionShape2['default'],
horizontalMargin: _propTypes2['default'].number,
withPortal: _propTypes2['default'].bool,
withFullScreenPortal: _propTypes2['default'].bool,
appendToBody: _propTypes2['default'].bool,
disableScroll: _propTypes2['default'].bool,
initialVisibleMonth: _propTypes2['default'].func,
firstDayOfWeek: _DayOfWeekShape2['default'],
numberOfMonths: _propTypes2['default'].number,
keepOpenOnDateSelect: _propTypes2['default'].bool,
reopenPickerOnClearDate: _propTypes2['default'].bool,
renderCalendarInfo: _propTypes2['default'].func,
calendarInfoPosition: _CalendarInfoPositionShape2['default'],
hideKeyboardShortcutsPanel: _propTypes2['default'].bool,
daySize: _airbnbPropTypes.nonNegativeInteger,
isRTL: _propTypes2['default'].bool,
verticalHeight: _airbnbPropTypes.nonNegativeInteger,
transitionDuration: _airbnbPropTypes.nonNegativeInteger,
horizontalMonthPadding: _airbnbPropTypes.nonNegativeInteger,
// navigation related props
navPrev: _propTypes2['default'].node,
navNext: _propTypes2['default'].node,
onPrevMonthClick: _propTypes2['default'].func,
onNextMonthClick: _propTypes2['default'].func,
onClose: _propTypes2['default'].func,
// day presentation and interaction related props
renderCalendarDay: _propTypes2['default'].func,
renderDayContents: _propTypes2['default'].func,
enableOutsideDays: _propTypes2['default'].bool,
isDayBlocked: _propTypes2['default'].func,
isOutsideRange: _propTypes2['default'].func,
isDayHighlighted: _propTypes2['default'].func,
// internationalization props
displayFormat: _propTypes2['default'].oneOfType([_propTypes2['default'].string, _propTypes2['default'].func]),
monthFormat: _propTypes2['default'].string,
weekDayFormat: _propTypes2['default'].string,
phrases: _propTypes2['default'].shape((0, _getPhrasePropTypes2['default'])(_defaultPhrases.SingleDatePickerPhrases)),
dayAriaLabelFormat: _propTypes2['default'].string
};
/***/ }),
/***/ "./node_modules/react-dates/lib/theme/DefaultTheme.js":
/*!************************************************************!*\
!*** ./node_modules/react-dates/lib/theme/DefaultTheme.js ***!
\************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var core = {
white: '#fff',
gray: '#484848',
grayLight: '#82888a',
grayLighter: '#cacccd',
grayLightest: '#f2f2f2',
borderMedium: '#c4c4c4',
border: '#dbdbdb',
borderLight: '#e4e7e7',
borderLighter: '#eceeee',
borderBright: '#f4f5f5',
primary: '#00a699',
primaryShade_1: '#33dacd',
primaryShade_2: '#66e2da',
primaryShade_3: '#80e8e0',
primaryShade_4: '#b2f1ec',
primary_dark: '#008489',
secondary: '#007a87',
yellow: '#ffe8bc',
yellow_dark: '#ffce71'
};
exports['default'] = {
reactDates: {
zIndex: 0,
border: {
input: {
border: 0,
borderTop: 0,
borderRight: 0,
borderBottom: '2px solid transparent',
borderLeft: 0,
outlineFocused: 0,
borderFocused: 0,
borderTopFocused: 0,
borderLeftFocused: 0,
borderBottomFocused: '2px solid ' + String(core.primary_dark),
borderRightFocused: 0,
borderRadius: 0
},
pickerInput: {
borderWidth: 1,
borderStyle: 'solid',
borderRadius: 2
}
},
color: {
core: core,
disabled: core.grayLightest,
background: core.white,
backgroundDark: '#f2f2f2',
backgroundFocused: core.white,
border: 'rgb(219, 219, 219)',
text: core.gray,
textDisabled: core.border,
textFocused: '#007a87',
placeholderText: '#757575',
outside: {
backgroundColor: core.white,
backgroundColor_active: core.white,
backgroundColor_hover: core.white,
color: core.gray,
color_active: core.gray,
color_hover: core.gray
},
highlighted: {
backgroundColor: core.yellow,
backgroundColor_active: core.yellow_dark,
backgroundColor_hover: core.yellow_dark,
color: core.gray,
color_active: core.gray,
color_hover: core.gray
},
minimumNights: {
backgroundColor: core.white,
backgroundColor_active: core.white,
backgroundColor_hover: core.white,
borderColor: core.borderLighter,
color: core.grayLighter,
color_active: core.grayLighter,
color_hover: core.grayLighter
},
hoveredSpan: {
backgroundColor: core.primaryShade_4,
backgroundColor_active: core.primaryShade_3,
backgroundColor_hover: core.primaryShade_4,
borderColor: core.primaryShade_3,
borderColor_active: core.primaryShade_3,
borderColor_hover: core.primaryShade_3,
color: core.secondary,
color_active: core.secondary,
color_hover: core.secondary
},
selectedSpan: {
backgroundColor: core.primaryShade_2,
backgroundColor_active: core.primaryShade_1,
backgroundColor_hover: core.primaryShade_1,
borderColor: core.primaryShade_1,
borderColor_active: core.primary,
borderColor_hover: core.primary,
color: core.white,
color_active: core.white,
color_hover: core.white
},
selected: {
backgroundColor: core.primary,
backgroundColor_active: core.primary,
backgroundColor_hover: core.primary,
borderColor: core.primary,
borderColor_active: core.primary,
borderColor_hover: core.primary,
color: core.white,
color_active: core.white,
color_hover: core.white
},
blocked_calendar: {
backgroundColor: core.grayLighter,
backgroundColor_active: core.grayLighter,
backgroundColor_hover: core.grayLighter,
borderColor: core.grayLighter,
borderColor_active: core.grayLighter,
borderColor_hover: core.grayLighter,
color: core.grayLight,
color_active: core.grayLight,
color_hover: core.grayLight
},
blocked_out_of_range: {
backgroundColor: core.white,
backgroundColor_active: core.white,
backgroundColor_hover: core.white,
borderColor: core.borderLight,
borderColor_active: core.borderLight,
borderColor_hover: core.borderLight,
color: core.grayLighter,
color_active: core.grayLighter,
color_hover: core.grayLighter
}
},
spacing: {
dayPickerHorizontalPadding: 9,
captionPaddingTop: 22,
captionPaddingBottom: 37,
inputPadding: 0,
displayTextPaddingVertical: undefined,
displayTextPaddingTop: 11,
displayTextPaddingBottom: 9,
displayTextPaddingHorizontal: undefined,
displayTextPaddingLeft: 11,
displayTextPaddingRight: 11,
displayTextPaddingVertical_small: undefined,
displayTextPaddingTop_small: 7,
displayTextPaddingBottom_small: 5,
displayTextPaddingHorizontal_small: undefined,
displayTextPaddingLeft_small: 7,
displayTextPaddingRight_small: 7
},
sizing: {
inputWidth: 130,
inputWidth_small: 97,
arrowWidth: 24
},
noScrollBarOnVerticalScrollable: false,
font: {
size: 14,
captionSize: 18,
input: {
size: 19,
lineHeight: '24px',
size_small: 15,
lineHeight_small: '18px',
letterSpacing_small: '0.2px',
styleDisabled: 'italic'
}
}
}
};
/***/ }),
/***/ "./node_modules/react-dates/lib/utils/calculateDimension.js":
/*!******************************************************************!*\
!*** ./node_modules/react-dates/lib/utils/calculateDimension.js ***!
\******************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports['default'] = calculateDimension;
function calculateDimension(el, axis) {
var borderBox = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
var withMargin = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
if (!el) {
return 0;
}
var axisStart = axis === 'width' ? 'Left' : 'Top';
var axisEnd = axis === 'width' ? 'Right' : 'Bottom'; // Only read styles if we need to
var style = !borderBox || withMargin ? window.getComputedStyle(el) : null; // Offset includes border and padding
var offsetWidth = el.offsetWidth,
offsetHeight = el.offsetHeight;
var size = axis === 'width' ? offsetWidth : offsetHeight; // Get the inner size
if (!borderBox) {
size -= parseFloat(style['padding' + axisStart]) + parseFloat(style['padding' + axisEnd]) + parseFloat(style['border' + axisStart + 'Width']) + parseFloat(style['border' + axisEnd + 'Width']);
} // Apply margin
if (withMargin) {
size += parseFloat(style['margin' + axisStart]) + parseFloat(style['margin' + axisEnd]);
}
return size;
}
/***/ }),
/***/ "./node_modules/react-dates/lib/utils/disableScroll.js":
/*!*************************************************************!*\
!*** ./node_modules/react-dates/lib/utils/disableScroll.js ***!
\*************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.getScrollParent = getScrollParent;
exports.getScrollAncestorsOverflowY = getScrollAncestorsOverflowY;
exports['default'] = disableScroll;
var getScrollingRoot = function getScrollingRoot() {
return document.scrollingElement || document.documentElement;
};
/**
* Recursively finds the scroll parent of a node. The scroll parrent of a node
* is the closest node that is scrollable. A node is scrollable if:
* - it is allowed to scroll via CSS ('overflow-y' not visible or hidden);
* - and its children/content are "bigger" than the node's box height.
*
* The root of the document always scrolls by default.
*
* @param {HTMLElement} node Any DOM element.
* @return {HTMLElement} The scroll parent element.
*/
function getScrollParent(node) {
var parent = node.parentElement;
if (parent == null) return getScrollingRoot();
var _window$getComputedSt = window.getComputedStyle(parent),
overflowY = _window$getComputedSt.overflowY;
var canScroll = overflowY !== 'visible' && overflowY !== 'hidden';
if (canScroll && parent.scrollHeight > parent.clientHeight) {
return parent;
}
return getScrollParent(parent);
}
/**
* Recursively traverses the tree upwards from the given node, capturing all
* ancestor nodes that scroll along with their current 'overflow-y' CSS
* property.
*
* @param {HTMLElement} node Any DOM element.
* @param {Map<HTMLElement,string>} [acc] Accumulator map.
* @return {Map<HTMLElement,string>} Map of ancestors with their 'overflow-y' value.
*/
function getScrollAncestorsOverflowY(node) {
var acc = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : new Map();
var scrollingRoot = getScrollingRoot();
var scrollParent = getScrollParent(node);
acc.set(scrollParent, scrollParent.style.overflowY);
if (scrollParent === scrollingRoot) return acc;
return getScrollAncestorsOverflowY(scrollParent, acc);
}
/**
* Disabling the scroll on a node involves finding all the scrollable ancestors
* and set their 'overflow-y' CSS property to 'hidden'. When all ancestors have
* 'overflow-y: hidden' (up to the document element) there is no scroll
* container, thus all the scroll outside of the node is disabled. In order to
* enable scroll again, we store the previous value of the 'overflow-y' for
* every ancestor in a closure and reset it back.
*
* @param {HTMLElement} node Any DOM element.
*/
function disableScroll(node) {
var scrollAncestorsOverflowY = getScrollAncestorsOverflowY(node);
var toggle = function toggle(on) {
return scrollAncestorsOverflowY.forEach(function (overflowY, ancestor) {
ancestor.style.setProperty('overflow-y', on ? 'hidden' : overflowY);
});
};
toggle(true);
return function () {
return toggle(false);
};
}
/***/ }),
/***/ "./node_modules/react-dates/lib/utils/getActiveElement.js":
/*!****************************************************************!*\
!*** ./node_modules/react-dates/lib/utils/getActiveElement.js ***!
\****************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports['default'] = getActiveElement;
function getActiveElement() {
return typeof document !== 'undefined' && document.activeElement;
}
/***/ }),
/***/ "./node_modules/react-dates/lib/utils/getCalendarDaySettings.js":
/*!**********************************************************************!*\
!*** ./node_modules/react-dates/lib/utils/getCalendarDaySettings.js ***!
\**********************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports['default'] = getCalendarDaySettings;
var _getPhrase = __webpack_require__(/*! ./getPhrase */ "./node_modules/react-dates/lib/utils/getPhrase.js");
var _getPhrase2 = _interopRequireDefault(_getPhrase);
var _constants = __webpack_require__(/*! ../constants */ "./node_modules/react-dates/lib/constants.js");
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
'default': obj
};
}
function getCalendarDaySettings(day, ariaLabelFormat, daySize, modifiers, phrases) {
var chooseAvailableDate = phrases.chooseAvailableDate,
dateIsUnavailable = phrases.dateIsUnavailable,
dateIsSelected = phrases.dateIsSelected;
var daySizeStyles = {
width: daySize,
height: daySize - 1
};
var useDefaultCursor = modifiers.has('blocked-minimum-nights') || modifiers.has('blocked-calendar') || modifiers.has('blocked-out-of-range');
var selected = modifiers.has('selected') || modifiers.has('selected-start') || modifiers.has('selected-end');
var hoveredSpan = !selected && (modifiers.has('hovered-span') || modifiers.has('after-hovered-start'));
var isOutsideRange = modifiers.has('blocked-out-of-range');
var formattedDate = {
date: day.format(ariaLabelFormat)
};
var ariaLabel = (0, _getPhrase2['default'])(chooseAvailableDate, formattedDate);
if (modifiers.has(_constants.BLOCKED_MODIFIER)) {
ariaLabel = (0, _getPhrase2['default'])(dateIsUnavailable, formattedDate);
} else if (selected) {
ariaLabel = (0, _getPhrase2['default'])(dateIsSelected, formattedDate);
}
return {
daySizeStyles: daySizeStyles,
useDefaultCursor: useDefaultCursor,
selected: selected,
hoveredSpan: hoveredSpan,
isOutsideRange: isOutsideRange,
ariaLabel: ariaLabel
};
}
/***/ }),
/***/ "./node_modules/react-dates/lib/utils/getCalendarMonthWeeks.js":
/*!*********************************************************************!*\
!*** ./node_modules/react-dates/lib/utils/getCalendarMonthWeeks.js ***!
\*********************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports['default'] = getCalendarMonthWeeks;
var _moment = __webpack_require__(/*! moment */ "./node_modules/moment/moment.js");
var _moment2 = _interopRequireDefault(_moment);
var _constants = __webpack_require__(/*! ../constants */ "./node_modules/react-dates/lib/constants.js");
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
'default': obj
};
}
function getCalendarMonthWeeks(month, enableOutsideDays) {
var firstDayOfWeek = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : _moment2['default'].localeData().firstDayOfWeek();
if (!_moment2['default'].isMoment(month) || !month.isValid()) {
throw new TypeError('`month` must be a valid moment object');
}
if (_constants.WEEKDAYS.indexOf(firstDayOfWeek) === -1) {
throw new TypeError('`firstDayOfWeek` must be an integer between 0 and 6');
} // set utc offset to get correct dates in future (when timezone changes)
var firstOfMonth = month.clone().startOf('month').hour(12);
var lastOfMonth = month.clone().endOf('month').hour(12); // calculate the exact first and last days to fill the entire matrix
// (considering days outside month)
var prevDays = (firstOfMonth.day() + 7 - firstDayOfWeek) % 7;
var nextDays = (firstDayOfWeek + 6 - lastOfMonth.day()) % 7;
var firstDay = firstOfMonth.clone().subtract(prevDays, 'day');
var lastDay = lastOfMonth.clone().add(nextDays, 'day');
var totalDays = lastDay.diff(firstDay, 'days') + 1;
var currentDay = firstDay.clone();
var weeksInMonth = [];
for (var i = 0; i < totalDays; i += 1) {
if (i % 7 === 0) {
weeksInMonth.push([]);
}
var day = null;
if (i >= prevDays && i < totalDays - nextDays || enableOutsideDays) {
day = currentDay.clone();
}
weeksInMonth[weeksInMonth.length - 1].push(day);
currentDay.add(1, 'day');
}
return weeksInMonth;
}
/***/ }),
/***/ "./node_modules/react-dates/lib/utils/getCalendarMonthWidth.js":
/*!*********************************************************************!*\
!*** ./node_modules/react-dates/lib/utils/getCalendarMonthWidth.js ***!
\*********************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = getCalendarMonthWidth;
function getCalendarMonthWidth(daySize, calendarMonthPadding) {
return 7 * daySize + 2 * calendarMonthPadding + 1;
}
/***/ }),
/***/ "./node_modules/react-dates/lib/utils/getDetachedContainerStyles.js":
/*!**************************************************************************!*\
!*** ./node_modules/react-dates/lib/utils/getDetachedContainerStyles.js ***!
\**************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports['default'] = getDetachedContainerStyles;
var _constants = __webpack_require__(/*! ../constants */ "./node_modules/react-dates/lib/constants.js");
/**
* Calculate and return a CSS transform style to position a detached element
* next to a reference element. The open and anchor direction indicate wether
* it should be positioned above/below and/or to the left/right of the
* reference element.
*
* Assuming r(0,0), r(1,1), d(0,0), d(1,1) for the bottom-left and top-right
* corners of the reference and detached elements, respectively:
* - openDirection = DOWN, anchorDirection = LEFT => d(0,1) == r(0,1)
* - openDirection = UP, anchorDirection = LEFT => d(0,0) == r(0,0)
* - openDirection = DOWN, anchorDirection = RIGHT => d(1,1) == r(1,1)
* - openDirection = UP, anchorDirection = RIGHT => d(1,0) == r(1,0)
*
* By using a CSS transform, we allow to further position it using
* top/bottom CSS properties for the anchor gutter.
*
* @param {string} openDirection The vertical positioning of the popup
* @param {string} anchorDirection The horizontal position of the popup
* @param {HTMLElement} referenceEl The reference element
*/
function getDetachedContainerStyles(openDirection, anchorDirection, referenceEl) {
var referenceRect = referenceEl.getBoundingClientRect();
var offsetX = referenceRect.left;
var offsetY = referenceRect.top;
if (openDirection === _constants.OPEN_UP) {
offsetY = -(window.innerHeight - referenceRect.bottom);
}
if (anchorDirection === _constants.ANCHOR_RIGHT) {
offsetX = -(window.innerWidth - referenceRect.right);
}
return {
transform: 'translate3d(' + String(Math.round(offsetX)) + 'px, ' + String(Math.round(offsetY)) + 'px, 0)'
};
}
/***/ }),
/***/ "./node_modules/react-dates/lib/utils/getInputHeight.js":
/*!**************************************************************!*\
!*** ./node_modules/react-dates/lib/utils/getInputHeight.js ***!
\**************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports['default'] = getInputHeight;
/* eslint-disable camelcase */
function getPadding(vertical, top, bottom) {
var isTopDefined = typeof top === 'number';
var isBottomDefined = typeof bottom === 'number';
var isVerticalDefined = typeof vertical === 'number';
if (isTopDefined && isBottomDefined) {
return top + bottom;
}
if (isTopDefined && isVerticalDefined) {
return top + vertical;
}
if (isTopDefined) {
return top;
}
if (isBottomDefined && isVerticalDefined) {
return bottom + vertical;
}
if (isBottomDefined) {
return bottom;
}
if (isVerticalDefined) {
return 2 * vertical;
}
return 0;
}
function getInputHeight(_ref, small) {
var _ref$font$input = _ref.font.input,
lineHeight = _ref$font$input.lineHeight,
lineHeight_small = _ref$font$input.lineHeight_small,
_ref$spacing = _ref.spacing,
inputPadding = _ref$spacing.inputPadding,
displayTextPaddingVertical = _ref$spacing.displayTextPaddingVertical,
displayTextPaddingTop = _ref$spacing.displayTextPaddingTop,
displayTextPaddingBottom = _ref$spacing.displayTextPaddingBottom,
displayTextPaddingVertical_small = _ref$spacing.displayTextPaddingVertical_small,
displayTextPaddingTop_small = _ref$spacing.displayTextPaddingTop_small,
displayTextPaddingBottom_small = _ref$spacing.displayTextPaddingBottom_small;
var calcLineHeight = small ? lineHeight_small : lineHeight;
var padding = small ? getPadding(displayTextPaddingVertical_small, displayTextPaddingTop_small, displayTextPaddingBottom_small) : getPadding(displayTextPaddingVertical, displayTextPaddingTop, displayTextPaddingBottom);
return parseInt(calcLineHeight, 10) + 2 * inputPadding + padding;
}
/***/ }),
/***/ "./node_modules/react-dates/lib/utils/getNumberOfCalendarMonthWeeks.js":
/*!*****************************************************************************!*\
!*** ./node_modules/react-dates/lib/utils/getNumberOfCalendarMonthWeeks.js ***!
\*****************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports['default'] = getNumberOfCalendarMonthWeeks;
var _moment = __webpack_require__(/*! moment */ "./node_modules/moment/moment.js");
var _moment2 = _interopRequireDefault(_moment);
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
'default': obj
};
}
function getBlankDaysBeforeFirstDay(firstDayOfMonth, firstDayOfWeek) {
var weekDayDiff = firstDayOfMonth.day() - firstDayOfWeek;
return (weekDayDiff + 7) % 7;
}
function getNumberOfCalendarMonthWeeks(month) {
var firstDayOfWeek = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _moment2['default'].localeData().firstDayOfWeek();
var firstDayOfMonth = month.clone().startOf('month');
var numBlankDays = getBlankDaysBeforeFirstDay(firstDayOfMonth, firstDayOfWeek);
return Math.ceil((numBlankDays + month.daysInMonth()) / 7);
}
/***/ }),
/***/ "./node_modules/react-dates/lib/utils/getPhrase.js":
/*!*********************************************************!*\
!*** ./node_modules/react-dates/lib/utils/getPhrase.js ***!
\*********************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports['default'] = getPhrase;
function getPhrase(phrase, args) {
if (typeof phrase === 'string') return phrase;
if (typeof phrase === 'function') {
return phrase(args);
}
return '';
}
/***/ }),
/***/ "./node_modules/react-dates/lib/utils/getPhrasePropTypes.js":
/*!******************************************************************!*\
!*** ./node_modules/react-dates/lib/utils/getPhrasePropTypes.js ***!
\******************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports['default'] = getPhrasePropTypes;
var _object = __webpack_require__(/*! object.assign */ "./node_modules/object.assign/index.js");
var _object2 = _interopRequireDefault(_object);
var _propTypes = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js");
var _propTypes2 = _interopRequireDefault(_propTypes);
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 getPhrasePropTypes(defaultPhrases) {
return Object.keys(defaultPhrases).reduce(function (phrases, key) {
return (0, _object2['default'])({}, phrases, _defineProperty({}, key, _propTypes2['default'].oneOfType([_propTypes2['default'].string, _propTypes2['default'].func, _propTypes2['default'].node])));
}, {});
}
/***/ }),
/***/ "./node_modules/react-dates/lib/utils/getResponsiveContainerStyles.js":
/*!****************************************************************************!*\
!*** ./node_modules/react-dates/lib/utils/getResponsiveContainerStyles.js ***!
\****************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports['default'] = getResponsiveContainerStyles;
var _constants = __webpack_require__(/*! ../constants */ "./node_modules/react-dates/lib/constants.js");
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 getResponsiveContainerStyles(anchorDirection, currentOffset, containerEdge, margin) {
var windowWidth = typeof window !== 'undefined' ? window.innerWidth : 0;
var calculatedOffset = anchorDirection === _constants.ANCHOR_LEFT ? windowWidth - containerEdge : containerEdge;
var calculatedMargin = margin || 0;
return _defineProperty({}, anchorDirection, Math.min(currentOffset + calculatedOffset - calculatedMargin, 0));
}
/***/ }),
/***/ "./node_modules/react-dates/lib/utils/getSelectedDateOffset.js":
/*!*********************************************************************!*\
!*** ./node_modules/react-dates/lib/utils/getSelectedDateOffset.js ***!
\*********************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = getSelectedDateOffset;
var defaultModifier = function defaultModifier(day) {
return day;
};
function getSelectedDateOffset(fn, day) {
var modifier = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : defaultModifier;
if (!fn) return day;
return modifier(fn(day.clone()));
}
/***/ }),
/***/ "./node_modules/react-dates/lib/utils/getTransformStyles.js":
/*!******************************************************************!*\
!*** ./node_modules/react-dates/lib/utils/getTransformStyles.js ***!
\******************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = getTransformStyles;
function getTransformStyles(transformValue) {
return {
transform: transformValue,
msTransform: transformValue,
MozTransform: transformValue,
WebkitTransform: transformValue
};
}
/***/ }),
/***/ "./node_modules/react-dates/lib/utils/getVisibleDays.js":
/*!**************************************************************!*\
!*** ./node_modules/react-dates/lib/utils/getVisibleDays.js ***!
\**************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports['default'] = getVisibleDays;
var _moment = __webpack_require__(/*! moment */ "./node_modules/moment/moment.js");
var _moment2 = _interopRequireDefault(_moment);
var _toISOMonthString = __webpack_require__(/*! ./toISOMonthString */ "./node_modules/react-dates/lib/utils/toISOMonthString.js");
var _toISOMonthString2 = _interopRequireDefault(_toISOMonthString);
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
'default': obj
};
}
function getVisibleDays(month, numberOfMonths, enableOutsideDays, withoutTransitionMonths) {
if (!_moment2['default'].isMoment(month)) return {};
var visibleDaysByMonth = {};
var currentMonth = withoutTransitionMonths ? month.clone() : month.clone().subtract(1, 'month');
for (var i = 0; i < (withoutTransitionMonths ? numberOfMonths : numberOfMonths + 2); i += 1) {
var visibleDays = []; // set utc offset to get correct dates in future (when timezone changes)
var baseDate = currentMonth.clone();
var firstOfMonth = baseDate.clone().startOf('month').hour(12);
var lastOfMonth = baseDate.clone().endOf('month').hour(12);
var currentDay = firstOfMonth.clone(); // days belonging to the previous month
if (enableOutsideDays) {
for (var j = 0; j < currentDay.weekday(); j += 1) {
var prevDay = currentDay.clone().subtract(j + 1, 'day');
visibleDays.unshift(prevDay);
}
}
while (currentDay < lastOfMonth) {
visibleDays.push(currentDay.clone());
currentDay.add(1, 'day');
}
if (enableOutsideDays) {
// weekday() returns the index of the day of the week according to the locale
// this means if the week starts on Monday, weekday() will return 0 for a Monday date, not 1
if (currentDay.weekday() !== 0) {
// days belonging to the next month
for (var k = currentDay.weekday(), count = 0; k < 7; k += 1, count += 1) {
var nextDay = currentDay.clone().add(count, 'day');
visibleDays.push(nextDay);
}
}
}
visibleDaysByMonth[(0, _toISOMonthString2['default'])(currentMonth)] = visibleDays;
currentMonth = currentMonth.clone().add(1, 'month');
}
return visibleDaysByMonth;
}
/***/ }),
/***/ "./node_modules/react-dates/lib/utils/isAfterDay.js":
/*!**********************************************************!*\
!*** ./node_modules/react-dates/lib/utils/isAfterDay.js ***!
\**********************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports['default'] = isAfterDay;
var _moment = __webpack_require__(/*! moment */ "./node_modules/moment/moment.js");
var _moment2 = _interopRequireDefault(_moment);
var _isBeforeDay = __webpack_require__(/*! ./isBeforeDay */ "./node_modules/react-dates/lib/utils/isBeforeDay.js");
var _isBeforeDay2 = _interopRequireDefault(_isBeforeDay);
var _isSameDay = __webpack_require__(/*! ./isSameDay */ "./node_modules/react-dates/lib/utils/isSameDay.js");
var _isSameDay2 = _interopRequireDefault(_isSameDay);
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
'default': obj
};
}
function isAfterDay(a, b) {
if (!_moment2['default'].isMoment(a) || !_moment2['default'].isMoment(b)) return false;
return !(0, _isBeforeDay2['default'])(a, b) && !(0, _isSameDay2['default'])(a, b);
}
/***/ }),
/***/ "./node_modules/react-dates/lib/utils/isBeforeDay.js":
/*!***********************************************************!*\
!*** ./node_modules/react-dates/lib/utils/isBeforeDay.js ***!
\***********************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports['default'] = isBeforeDay;
var _moment = __webpack_require__(/*! moment */ "./node_modules/moment/moment.js");
var _moment2 = _interopRequireDefault(_moment);
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
'default': obj
};
}
function isBeforeDay(a, b) {
if (!_moment2['default'].isMoment(a) || !_moment2['default'].isMoment(b)) return false;
var aYear = a.year();
var aMonth = a.month();
var bYear = b.year();
var bMonth = b.month();
var isSameYear = aYear === bYear;
var isSameMonth = aMonth === bMonth;
if (isSameYear && isSameMonth) return a.date() < b.date();
if (isSameYear) return aMonth < bMonth;
return aYear < bYear;
}
/***/ }),
/***/ "./node_modules/react-dates/lib/utils/isDayVisible.js":
/*!************************************************************!*\
!*** ./node_modules/react-dates/lib/utils/isDayVisible.js ***!
\************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports['default'] = isDayVisible;
var _isBeforeDay = __webpack_require__(/*! ./isBeforeDay */ "./node_modules/react-dates/lib/utils/isBeforeDay.js");
var _isBeforeDay2 = _interopRequireDefault(_isBeforeDay);
var _isAfterDay = __webpack_require__(/*! ./isAfterDay */ "./node_modules/react-dates/lib/utils/isAfterDay.js");
var _isAfterDay2 = _interopRequireDefault(_isAfterDay);
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
'default': obj
};
}
function isDayVisible(day, month, numberOfMonths, enableOutsideDays) {
var firstDayOfFirstMonth = month.clone().startOf('month');
if (enableOutsideDays) firstDayOfFirstMonth = firstDayOfFirstMonth.startOf('week');
if ((0, _isBeforeDay2['default'])(day, firstDayOfFirstMonth)) return false;
var lastDayOfLastMonth = month.clone().add(numberOfMonths - 1, 'months').endOf('month');
if (enableOutsideDays) lastDayOfLastMonth = lastDayOfLastMonth.endOf('week');
return !(0, _isAfterDay2['default'])(day, lastDayOfLastMonth);
}
/***/ }),
/***/ "./node_modules/react-dates/lib/utils/isInclusivelyAfterDay.js":
/*!*********************************************************************!*\
!*** ./node_modules/react-dates/lib/utils/isInclusivelyAfterDay.js ***!
\*********************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports['default'] = isInclusivelyAfterDay;
var _moment = __webpack_require__(/*! moment */ "./node_modules/moment/moment.js");
var _moment2 = _interopRequireDefault(_moment);
var _isBeforeDay = __webpack_require__(/*! ./isBeforeDay */ "./node_modules/react-dates/lib/utils/isBeforeDay.js");
var _isBeforeDay2 = _interopRequireDefault(_isBeforeDay);
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
'default': obj
};
}
function isInclusivelyAfterDay(a, b) {
if (!_moment2['default'].isMoment(a) || !_moment2['default'].isMoment(b)) return false;
return !(0, _isBeforeDay2['default'])(a, b);
}
/***/ }),
/***/ "./node_modules/react-dates/lib/utils/isInclusivelyBeforeDay.js":
/*!**********************************************************************!*\
!*** ./node_modules/react-dates/lib/utils/isInclusivelyBeforeDay.js ***!
\**********************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports['default'] = isInclusivelyBeforeDay;
var _moment = __webpack_require__(/*! moment */ "./node_modules/moment/moment.js");
var _moment2 = _interopRequireDefault(_moment);
var _isAfterDay = __webpack_require__(/*! ./isAfterDay */ "./node_modules/react-dates/lib/utils/isAfterDay.js");
var _isAfterDay2 = _interopRequireDefault(_isAfterDay);
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
'default': obj
};
}
function isInclusivelyBeforeDay(a, b) {
if (!_moment2['default'].isMoment(a) || !_moment2['default'].isMoment(b)) return false;
return !(0, _isAfterDay2['default'])(a, b);
}
/***/ }),
/***/ "./node_modules/react-dates/lib/utils/isNextDay.js":
/*!*********************************************************!*\
!*** ./node_modules/react-dates/lib/utils/isNextDay.js ***!
\*********************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports['default'] = isNextDay;
var _moment = __webpack_require__(/*! moment */ "./node_modules/moment/moment.js");
var _moment2 = _interopRequireDefault(_moment);
var _isSameDay = __webpack_require__(/*! ./isSameDay */ "./node_modules/react-dates/lib/utils/isSameDay.js");
var _isSameDay2 = _interopRequireDefault(_isSameDay);
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
'default': obj
};
}
function isNextDay(a, b) {
if (!_moment2['default'].isMoment(a) || !_moment2['default'].isMoment(b)) return false;
var nextDay = (0, _moment2['default'])(a).add(1, 'day');
return (0, _isSameDay2['default'])(nextDay, b);
}
/***/ }),
/***/ "./node_modules/react-dates/lib/utils/isNextMonth.js":
/*!***********************************************************!*\
!*** ./node_modules/react-dates/lib/utils/isNextMonth.js ***!
\***********************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports['default'] = isNextMonth;
var _moment = __webpack_require__(/*! moment */ "./node_modules/moment/moment.js");
var _moment2 = _interopRequireDefault(_moment);
var _isSameMonth = __webpack_require__(/*! ./isSameMonth */ "./node_modules/react-dates/lib/utils/isSameMonth.js");
var _isSameMonth2 = _interopRequireDefault(_isSameMonth);
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
'default': obj
};
}
function isNextMonth(a, b) {
if (!_moment2['default'].isMoment(a) || !_moment2['default'].isMoment(b)) return false;
return (0, _isSameMonth2['default'])(a.clone().add(1, 'month'), b);
}
/***/ }),
/***/ "./node_modules/react-dates/lib/utils/isPrevMonth.js":
/*!***********************************************************!*\
!*** ./node_modules/react-dates/lib/utils/isPrevMonth.js ***!
\***********************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports['default'] = isPrevMonth;
var _moment = __webpack_require__(/*! moment */ "./node_modules/moment/moment.js");
var _moment2 = _interopRequireDefault(_moment);
var _isSameMonth = __webpack_require__(/*! ./isSameMonth */ "./node_modules/react-dates/lib/utils/isSameMonth.js");
var _isSameMonth2 = _interopRequireDefault(_isSameMonth);
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
'default': obj
};
}
function isPrevMonth(a, b) {
if (!_moment2['default'].isMoment(a) || !_moment2['default'].isMoment(b)) return false;
return (0, _isSameMonth2['default'])(a.clone().subtract(1, 'month'), b);
}
/***/ }),
/***/ "./node_modules/react-dates/lib/utils/isSameDay.js":
/*!*********************************************************!*\
!*** ./node_modules/react-dates/lib/utils/isSameDay.js ***!
\*********************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports['default'] = isSameDay;
var _moment = __webpack_require__(/*! moment */ "./node_modules/moment/moment.js");
var _moment2 = _interopRequireDefault(_moment);
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
'default': obj
};
}
function isSameDay(a, b) {
if (!_moment2['default'].isMoment(a) || !_moment2['default'].isMoment(b)) return false; // Compare least significant, most likely to change units first
// Moment's isSame clones moment inputs and is a tad slow
return a.date() === b.date() && a.month() === b.month() && a.year() === b.year();
}
/***/ }),
/***/ "./node_modules/react-dates/lib/utils/isSameMonth.js":
/*!***********************************************************!*\
!*** ./node_modules/react-dates/lib/utils/isSameMonth.js ***!
\***********************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports['default'] = isSameMonth;
var _moment = __webpack_require__(/*! moment */ "./node_modules/moment/moment.js");
var _moment2 = _interopRequireDefault(_moment);
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
'default': obj
};
}
function isSameMonth(a, b) {
if (!_moment2['default'].isMoment(a) || !_moment2['default'].isMoment(b)) return false; // Compare least significant, most likely to change units first
// Moment's isSame clones moment inputs and is a tad slow
return a.month() === b.month() && a.year() === b.year();
}
/***/ }),
/***/ "./node_modules/react-dates/lib/utils/isTransitionEndSupported.js":
/*!************************************************************************!*\
!*** ./node_modules/react-dates/lib/utils/isTransitionEndSupported.js ***!
\************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports['default'] = isTransitionEndSupported;
function isTransitionEndSupported() {
return !!(typeof window !== 'undefined' && 'TransitionEvent' in window);
}
/***/ }),
/***/ "./node_modules/react-dates/lib/utils/registerCSSInterfaceWithDefaultTheme.js":
/*!************************************************************************************!*\
!*** ./node_modules/react-dates/lib/utils/registerCSSInterfaceWithDefaultTheme.js ***!
\************************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports['default'] = registerCSSInterfaceWithDefaultTheme;
var _reactWithStylesInterfaceCss = __webpack_require__(/*! react-with-styles-interface-css */ "./node_modules/react-with-styles-interface-css/index.js");
var _reactWithStylesInterfaceCss2 = _interopRequireDefault(_reactWithStylesInterfaceCss);
var _registerInterfaceWithDefaultTheme = __webpack_require__(/*! ./registerInterfaceWithDefaultTheme */ "./node_modules/react-dates/lib/utils/registerInterfaceWithDefaultTheme.js");
var _registerInterfaceWithDefaultTheme2 = _interopRequireDefault(_registerInterfaceWithDefaultTheme);
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
'default': obj
};
}
function registerCSSInterfaceWithDefaultTheme() {
(0, _registerInterfaceWithDefaultTheme2['default'])(_reactWithStylesInterfaceCss2['default']);
}
/***/ }),
/***/ "./node_modules/react-dates/lib/utils/registerInterfaceWithDefaultTheme.js":
/*!*********************************************************************************!*\
!*** ./node_modules/react-dates/lib/utils/registerInterfaceWithDefaultTheme.js ***!
\*********************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports['default'] = registerInterfaceWithDefaultTheme;
var _ThemedStyleSheet = __webpack_require__(/*! react-with-styles/lib/ThemedStyleSheet */ "./node_modules/react-with-styles/lib/ThemedStyleSheet.js");
var _ThemedStyleSheet2 = _interopRequireDefault(_ThemedStyleSheet);
var _DefaultTheme = __webpack_require__(/*! ../theme/DefaultTheme */ "./node_modules/react-dates/lib/theme/DefaultTheme.js");
var _DefaultTheme2 = _interopRequireDefault(_DefaultTheme);
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
'default': obj
};
}
function registerInterfaceWithDefaultTheme(reactWithStylesInterface) {
_ThemedStyleSheet2['default'].registerInterface(reactWithStylesInterface);
_ThemedStyleSheet2['default'].registerTheme(_DefaultTheme2['default']);
}
/***/ }),
/***/ "./node_modules/react-dates/lib/utils/toISODateString.js":
/*!***************************************************************!*\
!*** ./node_modules/react-dates/lib/utils/toISODateString.js ***!
\***************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports['default'] = toISODateString;
var _moment = __webpack_require__(/*! moment */ "./node_modules/moment/moment.js");
var _moment2 = _interopRequireDefault(_moment);
var _toMomentObject = __webpack_require__(/*! ./toMomentObject */ "./node_modules/react-dates/lib/utils/toMomentObject.js");
var _toMomentObject2 = _interopRequireDefault(_toMomentObject);
var _constants = __webpack_require__(/*! ../constants */ "./node_modules/react-dates/lib/constants.js");
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
'default': obj
};
}
function toISODateString(date, currentFormat) {
var dateObj = _moment2['default'].isMoment(date) ? date : (0, _toMomentObject2['default'])(date, currentFormat);
if (!dateObj) return null;
return dateObj.format(_constants.ISO_FORMAT);
}
/***/ }),
/***/ "./node_modules/react-dates/lib/utils/toISOMonthString.js":
/*!****************************************************************!*\
!*** ./node_modules/react-dates/lib/utils/toISOMonthString.js ***!
\****************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports['default'] = toISOMonthString;
var _moment = __webpack_require__(/*! moment */ "./node_modules/moment/moment.js");
var _moment2 = _interopRequireDefault(_moment);
var _toMomentObject = __webpack_require__(/*! ./toMomentObject */ "./node_modules/react-dates/lib/utils/toMomentObject.js");
var _toMomentObject2 = _interopRequireDefault(_toMomentObject);
var _constants = __webpack_require__(/*! ../constants */ "./node_modules/react-dates/lib/constants.js");
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
'default': obj
};
}
function toISOMonthString(date, currentFormat) {
var dateObj = _moment2['default'].isMoment(date) ? date : (0, _toMomentObject2['default'])(date, currentFormat);
if (!dateObj) return null;
return dateObj.format(_constants.ISO_MONTH_FORMAT);
}
/***/ }),
/***/ "./node_modules/react-dates/lib/utils/toLocalizedDateString.js":
/*!*********************************************************************!*\
!*** ./node_modules/react-dates/lib/utils/toLocalizedDateString.js ***!
\*********************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports['default'] = toLocalizedDateString;
var _moment = __webpack_require__(/*! moment */ "./node_modules/moment/moment.js");
var _moment2 = _interopRequireDefault(_moment);
var _toMomentObject = __webpack_require__(/*! ./toMomentObject */ "./node_modules/react-dates/lib/utils/toMomentObject.js");
var _toMomentObject2 = _interopRequireDefault(_toMomentObject);
var _constants = __webpack_require__(/*! ../constants */ "./node_modules/react-dates/lib/constants.js");
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
'default': obj
};
}
function toLocalizedDateString(date, currentFormat) {
var dateObj = _moment2['default'].isMoment(date) ? date : (0, _toMomentObject2['default'])(date, currentFormat);
if (!dateObj) return null;
return dateObj.format(_constants.DISPLAY_FORMAT);
}
/***/ }),
/***/ "./node_modules/react-dates/lib/utils/toMomentObject.js":
/*!**************************************************************!*\
!*** ./node_modules/react-dates/lib/utils/toMomentObject.js ***!
\**************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports['default'] = toMomentObject;
var _moment = __webpack_require__(/*! moment */ "./node_modules/moment/moment.js");
var _moment2 = _interopRequireDefault(_moment);
var _constants = __webpack_require__(/*! ../constants */ "./node_modules/react-dates/lib/constants.js");
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
'default': obj
};
}
function toMomentObject(dateString, customFormat) {
var dateFormats = customFormat ? [customFormat, _constants.DISPLAY_FORMAT, _constants.ISO_FORMAT] : [_constants.DISPLAY_FORMAT, _constants.ISO_FORMAT];
var date = (0, _moment2['default'])(dateString, dateFormats, true);
return date.isValid() ? date.hour(12) : null;
}
/***/ }),
/***/ "./node_modules/react-is/cjs/react-is.development.js":
/*!***********************************************************!*\
!*** ./node_modules/react-is/cjs/react-is.development.js ***!
\***********************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/** @license React v16.9.0
* react-is.development.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
if (true) {
(function () {
'use strict';
Object.defineProperty(exports, '__esModule', {
value: true
}); // The Symbol used to tag the ReactElement-like types. If there is no native Symbol
// nor polyfill, then a plain number is used for performance.
var hasSymbol = typeof Symbol === 'function' && Symbol.for;
var REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for('react.element') : 0xeac7;
var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for('react.portal') : 0xeaca;
var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for('react.fragment') : 0xeacb;
var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for('react.strict_mode') : 0xeacc;
var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2;
var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd;
var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace; // TODO: We don't use AsyncMode or ConcurrentMode anymore. They were temporary
// (unstable) APIs that have been removed. Can we remove the symbols?
var REACT_ASYNC_MODE_TYPE = hasSymbol ? Symbol.for('react.async_mode') : 0xeacf;
var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for('react.concurrent_mode') : 0xeacf;
var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0;
var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for('react.suspense') : 0xead1;
var REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for('react.suspense_list') : 0xead8;
var REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3;
var REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4;
var REACT_FUNDAMENTAL_TYPE = hasSymbol ? Symbol.for('react.fundamental') : 0xead5;
var REACT_RESPONDER_TYPE = hasSymbol ? Symbol.for('react.responder') : 0xead6;
function isValidElementType(type) {
return typeof type === 'string' || typeof type === 'function' || // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill.
type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || typeof type === 'object' && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_RESPONDER_TYPE);
}
/**
* Forked from fbjs/warning:
* https://github.com/facebook/fbjs/blob/e66ba20ad5be433eb54423f2b097d829324d9de6/packages/fbjs/src/__forks__/warning.js
*
* Only change is we use console.warn instead of console.error,
* and do nothing when 'console' is not supported.
* This really simplifies the code.
* ---
* 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 lowPriorityWarning = function () {};
{
var printWarning = function (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.warn(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) {}
};
lowPriorityWarning = function (condition, format) {
if (format === undefined) {
throw new Error('`lowPriorityWarning(condition, format, ...args)` requires a warning ' + 'message argument');
}
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));
}
};
}
var lowPriorityWarning$1 = lowPriorityWarning;
function typeOf(object) {
if (typeof object === 'object' && object !== null) {
var $$typeof = object.$$typeof;
switch ($$typeof) {
case REACT_ELEMENT_TYPE:
var type = object.type;
switch (type) {
case REACT_ASYNC_MODE_TYPE:
case REACT_CONCURRENT_MODE_TYPE:
case REACT_FRAGMENT_TYPE:
case REACT_PROFILER_TYPE:
case REACT_STRICT_MODE_TYPE:
case REACT_SUSPENSE_TYPE:
return type;
default:
var $$typeofType = type && type.$$typeof;
switch ($$typeofType) {
case REACT_CONTEXT_TYPE:
case REACT_FORWARD_REF_TYPE:
case REACT_PROVIDER_TYPE:
return $$typeofType;
default:
return $$typeof;
}
}
case REACT_LAZY_TYPE:
case REACT_MEMO_TYPE:
case REACT_PORTAL_TYPE:
return $$typeof;
}
}
return undefined;
} // AsyncMode is deprecated along with isAsyncMode
var AsyncMode = REACT_ASYNC_MODE_TYPE;
var ConcurrentMode = REACT_CONCURRENT_MODE_TYPE;
var ContextConsumer = REACT_CONTEXT_TYPE;
var ContextProvider = REACT_PROVIDER_TYPE;
var Element = REACT_ELEMENT_TYPE;
var ForwardRef = REACT_FORWARD_REF_TYPE;
var Fragment = REACT_FRAGMENT_TYPE;
var Lazy = REACT_LAZY_TYPE;
var Memo = REACT_MEMO_TYPE;
var Portal = REACT_PORTAL_TYPE;
var Profiler = REACT_PROFILER_TYPE;
var StrictMode = REACT_STRICT_MODE_TYPE;
var Suspense = REACT_SUSPENSE_TYPE;
var hasWarnedAboutDeprecatedIsAsyncMode = false; // AsyncMode should be deprecated
function isAsyncMode(object) {
{
if (!hasWarnedAboutDeprecatedIsAsyncMode) {
hasWarnedAboutDeprecatedIsAsyncMode = true;
lowPriorityWarning$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');
}
}
return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;
}
function isConcurrentMode(object) {
return typeOf(object) === REACT_CONCURRENT_MODE_TYPE;
}
function isContextConsumer(object) {
return typeOf(object) === REACT_CONTEXT_TYPE;
}
function isContextProvider(object) {
return typeOf(object) === REACT_PROVIDER_TYPE;
}
function isElement(object) {
return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
}
function isForwardRef(object) {
return typeOf(object) === REACT_FORWARD_REF_TYPE;
}
function isFragment(object) {
return typeOf(object) === REACT_FRAGMENT_TYPE;
}
function isLazy(object) {
return typeOf(object) === REACT_LAZY_TYPE;
}
function isMemo(object) {
return typeOf(object) === REACT_MEMO_TYPE;
}
function isPortal(object) {
return typeOf(object) === REACT_PORTAL_TYPE;
}
function isProfiler(object) {
return typeOf(object) === REACT_PROFILER_TYPE;
}
function isStrictMode(object) {
return typeOf(object) === REACT_STRICT_MODE_TYPE;
}
function isSuspense(object) {
return typeOf(object) === REACT_SUSPENSE_TYPE;
}
exports.typeOf = typeOf;
exports.AsyncMode = AsyncMode;
exports.ConcurrentMode = ConcurrentMode;
exports.ContextConsumer = ContextConsumer;
exports.ContextProvider = ContextProvider;
exports.Element = Element;
exports.ForwardRef = ForwardRef;
exports.Fragment = Fragment;
exports.Lazy = Lazy;
exports.Memo = Memo;
exports.Portal = Portal;
exports.Profiler = Profiler;
exports.StrictMode = StrictMode;
exports.Suspense = Suspense;
exports.isValidElementType = isValidElementType;
exports.isAsyncMode = isAsyncMode;
exports.isConcurrentMode = isConcurrentMode;
exports.isContextConsumer = isContextConsumer;
exports.isContextProvider = isContextProvider;
exports.isElement = isElement;
exports.isForwardRef = isForwardRef;
exports.isFragment = isFragment;
exports.isLazy = isLazy;
exports.isMemo = isMemo;
exports.isPortal = isPortal;
exports.isProfiler = isProfiler;
exports.isStrictMode = isStrictMode;
exports.isSuspense = isSuspense;
})();
}
/***/ }),
/***/ "./node_modules/react-is/index.js":
/*!****************************************!*\
!*** ./node_modules/react-is/index.js ***!
\****************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
if (false) {} else {
module.exports = __webpack_require__(/*! ./cjs/react-is.development.js */ "./node_modules/react-is/cjs/react-is.development.js");
}
/***/ }),
/***/ "./node_modules/react-moment-proptypes/src/core.js":
/*!*********************************************************!*\
!*** ./node_modules/react-moment-proptypes/src/core.js ***!
\*********************************************************/
/*! no static exports found */
/***/ (function(module, exports) {
var messages = {
invalidPredicate: '`predicate` must be a function',
invalidPropValidator: '`propValidator` must be a function',
requiredCore: 'is marked as required',
invalidTypeCore: 'Invalid input type',
predicateFailureCore: 'Failed to succeed with predicate',
anonymousMessage: '<<anonymous>>',
baseInvalidMessage: 'Invalid '
};
function constructPropValidatorVariations(propValidator) {
if (typeof propValidator !== 'function') {
throw new Error(messages.invalidPropValidator);
}
var requiredPropValidator = propValidator.bind(null, false, null);
requiredPropValidator.isRequired = propValidator.bind(null, true, null);
requiredPropValidator.withPredicate = function predicateApplication(predicate) {
if (typeof predicate !== 'function') {
throw new Error(messages.invalidPredicate);
}
var basePropValidator = propValidator.bind(null, false, predicate);
basePropValidator.isRequired = propValidator.bind(null, true, predicate);
return basePropValidator;
};
return requiredPropValidator;
}
function createInvalidRequiredErrorMessage(propName, componentName, value) {
return new Error('The prop `' + propName + '` ' + messages.requiredCore + ' in `' + componentName + '`, but its value is `' + value + '`.');
}
var independentGuardianValue = -1;
function preValidationRequireCheck(isRequired, componentName, propFullName, propValue) {
var isPropValueUndefined = typeof propValue === 'undefined';
var isPropValueNull = propValue === null;
if (isRequired) {
if (isPropValueUndefined) {
return createInvalidRequiredErrorMessage(propFullName, componentName, 'undefined');
} else if (isPropValueNull) {
return createInvalidRequiredErrorMessage(propFullName, componentName, 'null');
}
}
if (isPropValueUndefined || isPropValueNull) {
return null;
}
return independentGuardianValue;
}
function createMomentChecker(type, typeValidator, validator, momentType) {
function propValidator(isRequired, // Bound parameter to indicate with the propType is required
predicate, // Bound parameter to allow user to add dynamic validation
props, propName, componentName, location, propFullName) {
var propValue = props[propName];
var propType = typeof propValue;
componentName = componentName || messages.anonymousMessage;
propFullName = propFullName || propName;
var preValidationRequireCheckValue = preValidationRequireCheck(isRequired, componentName, propFullName, propValue);
if (preValidationRequireCheckValue !== independentGuardianValue) {
return preValidationRequireCheckValue;
}
if (typeValidator && !typeValidator(propValue)) {
return new Error(messages.invalidTypeCore + ': `' + propName + '` of type `' + propType + '` ' + 'supplied to `' + componentName + '`, expected `' + type + '`.');
}
if (!validator(propValue)) {
return new Error(messages.baseInvalidMessage + location + ' `' + propName + '` of type `' + propType + '` ' + 'supplied to `' + componentName + '`, expected `' + momentType + '`.');
}
if (predicate && !predicate(propValue)) {
var predicateName = predicate.name || messages.anonymousMessage;
return new Error(messages.baseInvalidMessage + location + ' `' + propName + '` of type `' + propType + '` ' + 'supplied to `' + componentName + '`. ' + messages.predicateFailureCore + ' `' + predicateName + '`.');
}
return null;
}
return constructPropValidatorVariations(propValidator);
}
module.exports = {
constructPropValidatorVariations: constructPropValidatorVariations,
createMomentChecker: createMomentChecker,
messages: messages
};
/***/ }),
/***/ "./node_modules/react-moment-proptypes/src/index.js":
/*!**********************************************************!*\
!*** ./node_modules/react-moment-proptypes/src/index.js ***!
\**********************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var moment = __webpack_require__(/*! moment */ "./node_modules/moment/moment.js");
var momentValidationWrapper = __webpack_require__(/*! ./moment-validation-wrapper */ "./node_modules/react-moment-proptypes/src/moment-validation-wrapper.js");
var core = __webpack_require__(/*! ./core */ "./node_modules/react-moment-proptypes/src/core.js");
module.exports = {
momentObj: core.createMomentChecker('object', function (obj) {
return typeof obj === 'object';
}, function isValid(value) {
return momentValidationWrapper.isValidMoment(value);
}, 'Moment'),
momentString: core.createMomentChecker('string', function (str) {
return typeof str === 'string';
}, function isValid(value) {
return momentValidationWrapper.isValidMoment(moment(value));
}, 'Moment'),
momentDurationObj: core.createMomentChecker('object', function (obj) {
return typeof obj === 'object';
}, function isValid(value) {
return moment.isDuration(value);
}, 'Duration')
};
/***/ }),
/***/ "./node_modules/react-moment-proptypes/src/moment-validation-wrapper.js":
/*!******************************************************************************!*\
!*** ./node_modules/react-moment-proptypes/src/moment-validation-wrapper.js ***!
\******************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var moment = __webpack_require__(/*! moment */ "./node_modules/moment/moment.js");
function isValidMoment(testMoment) {
if (typeof moment.isMoment === 'function' && !moment.isMoment(testMoment)) {
return false;
}
/* istanbul ignore else */
if (typeof testMoment.isValid === 'function') {
// moment 1.7.0+
return testMoment.isValid();
}
/* istanbul ignore next */
return !isNaN(testMoment);
}
module.exports = {
isValidMoment: isValidMoment
};
/***/ }),
/***/ "./node_modules/react-outside-click-handler/build/OutsideClickHandler.js":
/*!*******************************************************************************!*\
!*** ./node_modules/react-outside-click-handler/build/OutsideClickHandler.js ***!
\*******************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
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 _airbnbPropTypes = __webpack_require__(/*! airbnb-prop-types */ "./node_modules/airbnb-prop-types/index.js");
var _consolidatedEvents = __webpack_require__(/*! consolidated-events */ "./node_modules/consolidated-events/lib/index.esm.js");
var _object = __webpack_require__(/*! object.values */ "./node_modules/object.values/index.js");
var _object2 = _interopRequireDefault(_object);
var _document = __webpack_require__(/*! document.contains */ "./node_modules/document.contains/index.js");
var _document2 = _interopRequireDefault(_document);
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 DISPLAY = {
BLOCK: 'block',
FLEX: 'flex',
INLINE_BLOCK: 'inline-block'
};
var propTypes = (0, _airbnbPropTypes.forbidExtraProps)({
children: _propTypes2['default'].node.isRequired,
onOutsideClick: _propTypes2['default'].func.isRequired,
disabled: _propTypes2['default'].bool,
useCapture: _propTypes2['default'].bool,
display: _propTypes2['default'].oneOf((0, _object2['default'])(DISPLAY))
});
var defaultProps = {
disabled: false,
// `useCapture` is set to true by default so that a `stopPropagation` in the
// children will not prevent all outside click handlers from firing - maja
useCapture: true,
display: DISPLAY.BLOCK
};
var OutsideClickHandler = function (_React$Component) {
_inherits(OutsideClickHandler, _React$Component);
function OutsideClickHandler() {
var _ref;
_classCallCheck(this, OutsideClickHandler);
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
var _this = _possibleConstructorReturn(this, (_ref = OutsideClickHandler.__proto__ || Object.getPrototypeOf(OutsideClickHandler)).call.apply(_ref, [this].concat(args)));
_this.onMouseDown = _this.onMouseDown.bind(_this);
_this.onMouseUp = _this.onMouseUp.bind(_this);
_this.setChildNodeRef = _this.setChildNodeRef.bind(_this);
return _this;
}
_createClass(OutsideClickHandler, [{
key: 'componentDidMount',
value: function () {
function componentDidMount() {
var _props = this.props,
disabled = _props.disabled,
useCapture = _props.useCapture;
if (!disabled) this.addMouseDownEventListener(useCapture);
}
return componentDidMount;
}()
}, {
key: 'componentWillReceiveProps',
value: function () {
function componentWillReceiveProps(_ref2) {
var disabled = _ref2.disabled,
useCapture = _ref2.useCapture;
var prevDisabled = this.props.disabled;
if (prevDisabled !== disabled) {
if (disabled) {
this.removeEventListeners();
} else {
this.addMouseDownEventListener(useCapture);
}
}
}
return componentWillReceiveProps;
}()
}, {
key: 'componentWillUnmount',
value: function () {
function componentWillUnmount() {
this.removeEventListeners();
}
return componentWillUnmount;
}() // Use mousedown/mouseup to enforce that clicks remain outside the root's
// descendant tree, even when dragged. This should also get triggered on
// touch devices.
}, {
key: 'onMouseDown',
value: function () {
function onMouseDown(e) {
var useCapture = this.props.useCapture;
var isDescendantOfRoot = this.childNode && (0, _document2['default'])(this.childNode, e.target);
if (!isDescendantOfRoot) {
if (this.removeMouseUp) {
this.removeMouseUp();
this.removeMouseUp = null;
}
this.removeMouseUp = (0, _consolidatedEvents.addEventListener)(document, 'mouseup', this.onMouseUp, {
capture: useCapture
});
}
}
return onMouseDown;
}() // Use mousedown/mouseup to enforce that clicks remain outside the root's
// descendant tree, even when dragged. This should also get triggered on
// touch devices.
}, {
key: 'onMouseUp',
value: function () {
function onMouseUp(e) {
var onOutsideClick = this.props.onOutsideClick;
var isDescendantOfRoot = this.childNode && (0, _document2['default'])(this.childNode, e.target);
if (this.removeMouseUp) {
this.removeMouseUp();
this.removeMouseUp = null;
}
if (!isDescendantOfRoot) {
onOutsideClick(e);
}
}
return onMouseUp;
}()
}, {
key: 'setChildNodeRef',
value: function () {
function setChildNodeRef(ref) {
this.childNode = ref;
}
return setChildNodeRef;
}()
}, {
key: 'addMouseDownEventListener',
value: function () {
function addMouseDownEventListener(useCapture) {
this.removeMouseDown = (0, _consolidatedEvents.addEventListener)(document, 'mousedown', this.onMouseDown, {
capture: useCapture
});
}
return addMouseDownEventListener;
}()
}, {
key: 'removeEventListeners',
value: function () {
function removeEventListeners() {
if (this.removeMouseDown) this.removeMouseDown();
if (this.removeMouseUp) this.removeMouseUp();
}
return removeEventListeners;
}()
}, {
key: 'render',
value: function () {
function render() {
var _props2 = this.props,
children = _props2.children,
display = _props2.display;
return _react2['default'].createElement('div', {
ref: this.setChildNodeRef,
style: display !== DISPLAY.BLOCK && (0, _object2['default'])(DISPLAY).includes(display) ? {
display: display
} : undefined
}, children);
}
return render;
}()
}]);
return OutsideClickHandler;
}(_react2['default'].Component);
exports['default'] = OutsideClickHandler;
OutsideClickHandler.propTypes = propTypes;
OutsideClickHandler.defaultProps = defaultProps;
/***/ }),
/***/ "./node_modules/react-outside-click-handler/index.js":
/*!***********************************************************!*\
!*** ./node_modules/react-outside-click-handler/index.js ***!
\***********************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
// eslint-disable-next-line import/no-unresolved
module.exports = __webpack_require__(/*! ./build/OutsideClickHandler */ "./node_modules/react-outside-click-handler/build/OutsideClickHandler.js");
/***/ }),
/***/ "./node_modules/react-portal/es/LegacyPortal.js":
/*!******************************************************!*\
!*** ./node_modules/react-portal/es/LegacyPortal.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__);
/* 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__);
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js");
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_2__);
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;
} // This file is a fallback for a consumer who is not yet on React 16
// as createPortal was introduced in React 16
var Portal = function (_React$Component) {
_inherits(Portal, _React$Component);
function Portal() {
_classCallCheck(this, Portal);
return _possibleConstructorReturn(this, (Portal.__proto__ || Object.getPrototypeOf(Portal)).apply(this, arguments));
}
_createClass(Portal, [{
key: 'componentDidMount',
value: function componentDidMount() {
this.renderPortal();
}
}, {
key: 'componentDidUpdate',
value: function componentDidUpdate(props) {
this.renderPortal();
}
}, {
key: 'componentWillUnmount',
value: function componentWillUnmount() {
react_dom__WEBPACK_IMPORTED_MODULE_1___default.a.unmountComponentAtNode(this.defaultNode || this.props.node);
if (this.defaultNode) {
document.body.removeChild(this.defaultNode);
}
this.defaultNode = null;
this.portal = null;
}
}, {
key: 'renderPortal',
value: function renderPortal(props) {
if (!this.props.node && !this.defaultNode) {
this.defaultNode = document.createElement('div');
document.body.appendChild(this.defaultNode);
}
var children = this.props.children; // https://gist.github.com/jimfb/d99e0678e9da715ccf6454961ef04d1b
if (typeof this.props.children.type === 'function') {
children = react__WEBPACK_IMPORTED_MODULE_0___default.a.cloneElement(this.props.children);
}
this.portal = react_dom__WEBPACK_IMPORTED_MODULE_1___default.a.unstable_renderSubtreeIntoContainer(this, children, this.props.node || this.defaultNode);
}
}, {
key: 'render',
value: function render() {
return null;
}
}]);
return Portal;
}(react__WEBPACK_IMPORTED_MODULE_0___default.a.Component);
/* harmony default export */ __webpack_exports__["default"] = (Portal);
Portal.propTypes = {
children: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.node.isRequired,
node: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.any
};
/***/ }),
/***/ "./node_modules/react-portal/es/Portal.js":
/*!************************************************!*\
!*** ./node_modules/react-portal/es/Portal.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__);
/* 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 react_dom__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react-dom */ "react-dom");
/* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react_dom__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./utils */ "./node_modules/react-portal/es/utils.js");
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 Portal = function (_React$Component) {
_inherits(Portal, _React$Component);
function Portal() {
_classCallCheck(this, Portal);
return _possibleConstructorReturn(this, (Portal.__proto__ || Object.getPrototypeOf(Portal)).apply(this, arguments));
}
_createClass(Portal, [{
key: 'componentWillUnmount',
value: function componentWillUnmount() {
if (this.defaultNode) {
document.body.removeChild(this.defaultNode);
}
this.defaultNode = null;
}
}, {
key: 'render',
value: function render() {
if (!_utils__WEBPACK_IMPORTED_MODULE_3__["canUseDOM"]) {
return null;
}
if (!this.props.node && !this.defaultNode) {
this.defaultNode = document.createElement('div');
document.body.appendChild(this.defaultNode);
}
return react_dom__WEBPACK_IMPORTED_MODULE_2___default.a.createPortal(this.props.children, this.props.node || this.defaultNode);
}
}]);
return Portal;
}(react__WEBPACK_IMPORTED_MODULE_0___default.a.Component);
Portal.propTypes = {
children: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.node.isRequired,
node: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.any
};
/* harmony default export */ __webpack_exports__["default"] = (Portal);
/***/ }),
/***/ "./node_modules/react-portal/es/PortalCompat.js":
/*!******************************************************!*\
!*** ./node_modules/react-portal/es/PortalCompat.js ***!
\******************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react-dom */ "react-dom");
/* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_dom__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _Portal__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Portal */ "./node_modules/react-portal/es/Portal.js");
/* harmony import */ var _LegacyPortal__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./LegacyPortal */ "./node_modules/react-portal/es/LegacyPortal.js");
var Portal = void 0;
if (react_dom__WEBPACK_IMPORTED_MODULE_0___default.a.createPortal) {
Portal = _Portal__WEBPACK_IMPORTED_MODULE_1__["default"];
} else {
Portal = _LegacyPortal__WEBPACK_IMPORTED_MODULE_2__["default"];
}
/* harmony default export */ __webpack_exports__["default"] = (Portal);
/***/ }),
/***/ "./node_modules/react-portal/es/PortalWithState.js":
/*!*********************************************************!*\
!*** ./node_modules/react-portal/es/PortalWithState.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__);
/* 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 _PortalCompat__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./PortalCompat */ "./node_modules/react-portal/es/PortalCompat.js");
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 KEYCODES = {
ESCAPE: 27
};
var PortalWithState = function (_React$Component) {
_inherits(PortalWithState, _React$Component);
function PortalWithState(props) {
_classCallCheck(this, PortalWithState);
var _this = _possibleConstructorReturn(this, (PortalWithState.__proto__ || Object.getPrototypeOf(PortalWithState)).call(this, props));
_this.portalNode = null;
_this.state = {
active: !!props.defaultOpen
};
_this.openPortal = _this.openPortal.bind(_this);
_this.closePortal = _this.closePortal.bind(_this);
_this.wrapWithPortal = _this.wrapWithPortal.bind(_this);
_this.handleOutsideMouseClick = _this.handleOutsideMouseClick.bind(_this);
_this.handleKeydown = _this.handleKeydown.bind(_this);
return _this;
}
_createClass(PortalWithState, [{
key: 'componentDidMount',
value: function componentDidMount() {
if (this.props.closeOnEsc) {
document.addEventListener('keydown', this.handleKeydown);
}
if (this.props.closeOnOutsideClick) {
document.addEventListener('click', this.handleOutsideMouseClick);
}
}
}, {
key: 'componentWillUnmount',
value: function componentWillUnmount() {
if (this.props.closeOnEsc) {
document.removeEventListener('keydown', this.handleKeydown);
}
if (this.props.closeOnOutsideClick) {
document.removeEventListener('click', this.handleOutsideMouseClick);
}
}
}, {
key: 'openPortal',
value: function openPortal(e) {
if (this.state.active) {
return;
}
if (e && e.nativeEvent) {
e.nativeEvent.stopImmediatePropagation();
}
this.setState({
active: true
}, this.props.onOpen);
}
}, {
key: 'closePortal',
value: function closePortal() {
if (!this.state.active) {
return;
}
this.setState({
active: false
}, this.props.onClose);
}
}, {
key: 'wrapWithPortal',
value: function wrapWithPortal(children) {
var _this2 = this;
if (!this.state.active) {
return null;
}
return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_PortalCompat__WEBPACK_IMPORTED_MODULE_2__["default"], {
node: this.props.node,
key: 'react-portal',
ref: function ref(portalNode) {
return _this2.portalNode = portalNode;
}
}, children);
}
}, {
key: 'handleOutsideMouseClick',
value: function handleOutsideMouseClick(e) {
if (!this.state.active) {
return;
}
var root = this.portalNode.props.node || this.portalNode.defaultNode;
if (!root || root.contains(e.target) || e.button && e.button !== 0) {
return;
}
this.closePortal();
}
}, {
key: 'handleKeydown',
value: function handleKeydown(e) {
if (e.keyCode === KEYCODES.ESCAPE && this.state.active) {
this.closePortal();
}
}
}, {
key: 'render',
value: function render() {
return this.props.children({
openPortal: this.openPortal,
closePortal: this.closePortal,
portal: this.wrapWithPortal,
isOpen: this.state.active
});
}
}]);
return PortalWithState;
}(react__WEBPACK_IMPORTED_MODULE_0___default.a.Component);
PortalWithState.propTypes = {
children: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func.isRequired,
defaultOpen: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool,
node: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.any,
closeOnEsc: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool,
closeOnOutsideClick: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool,
onOpen: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func,
onClose: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func
};
PortalWithState.defaultProps = {
onOpen: function onOpen() {},
onClose: function onClose() {}
};
/* harmony default export */ __webpack_exports__["default"] = (PortalWithState);
/***/ }),
/***/ "./node_modules/react-portal/es/index.js":
/*!***********************************************!*\
!*** ./node_modules/react-portal/es/index.js ***!
\***********************************************/
/*! exports provided: Portal, PortalWithState */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _PortalCompat__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./PortalCompat */ "./node_modules/react-portal/es/PortalCompat.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Portal", function() { return _PortalCompat__WEBPACK_IMPORTED_MODULE_0__["default"]; });
/* harmony import */ var _PortalWithState__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./PortalWithState */ "./node_modules/react-portal/es/PortalWithState.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PortalWithState", function() { return _PortalWithState__WEBPACK_IMPORTED_MODULE_1__["default"]; });
/***/ }),
/***/ "./node_modules/react-portal/es/utils.js":
/*!***********************************************!*\
!*** ./node_modules/react-portal/es/utils.js ***!
\***********************************************/
/*! exports provided: canUseDOM */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "canUseDOM", function() { return canUseDOM; });
var canUseDOM = !!(typeof window !== 'undefined' && window.document && window.document.createElement);
/***/ }),
/***/ "./node_modules/react-spring/web.cjs.js":
/*!**********************************************!*\
!*** ./node_modules/react-spring/web.cjs.js ***!
\**********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, '__esModule', {
value: true
});
function _interopDefault(ex) {
return ex && typeof ex === 'object' && 'default' in ex ? ex['default'] : ex;
}
var _extends = _interopDefault(__webpack_require__(/*! @babel/runtime/helpers/extends */ "./node_modules/@babel/runtime/helpers/extends.js"));
var _objectWithoutPropertiesLoose = _interopDefault(__webpack_require__(/*! @babel/runtime/helpers/objectWithoutPropertiesLoose */ "./node_modules/@babel/runtime/helpers/objectWithoutPropertiesLoose.js"));
var React = __webpack_require__(/*! react */ "react");
var React__default = _interopDefault(React);
var _inheritsLoose = _interopDefault(__webpack_require__(/*! @babel/runtime/helpers/inheritsLoose */ "./node_modules/@babel/runtime/helpers/inheritsLoose.js"));
var _assertThisInitialized = _interopDefault(__webpack_require__(/*! @babel/runtime/helpers/assertThisInitialized */ "./node_modules/@babel/runtime/helpers/assertThisInitialized.js"));
var is = {
arr: Array.isArray,
obj: function obj(a) {
return Object.prototype.toString.call(a) === '[object Object]';
},
fun: function fun(a) {
return typeof a === 'function';
},
str: function str(a) {
return typeof a === 'string';
},
num: function num(a) {
return typeof a === 'number';
},
und: function und(a) {
return a === void 0;
},
nul: function nul(a) {
return a === null;
},
set: function set(a) {
return a instanceof Set;
},
map: function map(a) {
return a instanceof Map;
},
equ: function equ(a, b) {
if (typeof a !== typeof b) return false;
if (is.str(a) || is.num(a)) return a === b;
if (is.obj(a) && is.obj(b) && Object.keys(a).length + Object.keys(b).length === 0) return true;
var i;
for (i in a) {
if (!(i in b)) return false;
}
for (i in b) {
if (a[i] !== b[i]) return false;
}
return is.und(i) ? a === b : true;
}
};
function merge(target, lowercase) {
if (lowercase === void 0) {
lowercase = true;
}
return function (object) {
return (is.arr(object) ? object : Object.keys(object)).reduce(function (acc, element) {
var key = lowercase ? element[0].toLowerCase() + element.substring(1) : element;
acc[key] = target(key);
return acc;
}, target);
};
}
function useForceUpdate() {
var _useState = React.useState(false),
f = _useState[1];
var forceUpdate = React.useCallback(function () {
return f(function (v) {
return !v;
});
}, []);
return forceUpdate;
}
function withDefault(value, defaultValue) {
return is.und(value) || is.nul(value) ? defaultValue : value;
}
function toArray(a) {
return !is.und(a) ? is.arr(a) ? a : [a] : [];
}
function callProp(obj) {
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
args[_key - 1] = arguments[_key];
}
return is.fun(obj) ? obj.apply(void 0, args) : obj;
}
function getForwardProps(props) {
var to = props.to,
from = props.from,
config = props.config,
onStart = props.onStart,
onRest = props.onRest,
onFrame = props.onFrame,
children = props.children,
reset = props.reset,
reverse = props.reverse,
force = props.force,
immediate = props.immediate,
delay = props.delay,
attach = props.attach,
destroyed = props.destroyed,
interpolateTo = props.interpolateTo,
ref = props.ref,
lazy = props.lazy,
forward = _objectWithoutPropertiesLoose(props, ["to", "from", "config", "onStart", "onRest", "onFrame", "children", "reset", "reverse", "force", "immediate", "delay", "attach", "destroyed", "interpolateTo", "ref", "lazy"]);
return forward;
}
function interpolateTo(props) {
var forward = getForwardProps(props);
if (is.und(forward)) return _extends({
to: forward
}, props);
var rest = Object.keys(props).reduce(function (a, k) {
var _extends2;
return !is.und(forward[k]) ? a : _extends({}, a, (_extends2 = {}, _extends2[k] = props[k], _extends2));
}, {});
return _extends({
to: forward
}, rest);
}
function handleRef(ref, forward) {
if (forward) {
// If it's a function, assume it's a ref callback
if (is.fun(forward)) forward(ref);else if (is.obj(forward)) {
forward.current = ref;
}
}
return ref;
}
var Animated =
/*#__PURE__*/
function () {
function Animated() {
this.payload = void 0;
this.children = [];
}
var _proto = Animated.prototype;
_proto.getAnimatedValue = function getAnimatedValue() {
return this.getValue();
};
_proto.getPayload = function getPayload() {
return this.payload || this;
};
_proto.attach = function attach() {};
_proto.detach = function detach() {};
_proto.getChildren = function getChildren() {
return this.children;
};
_proto.addChild = function addChild(child) {
if (this.children.length === 0) this.attach();
this.children.push(child);
};
_proto.removeChild = function removeChild(child) {
var index = this.children.indexOf(child);
this.children.splice(index, 1);
if (this.children.length === 0) this.detach();
};
return Animated;
}();
var AnimatedArray =
/*#__PURE__*/
function (_Animated) {
_inheritsLoose(AnimatedArray, _Animated);
function AnimatedArray() {
var _this;
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
_this = _Animated.call.apply(_Animated, [this].concat(args)) || this;
_this.payload = [];
_this.attach = function () {
return _this.payload.forEach(function (p) {
return p instanceof Animated && p.addChild(_assertThisInitialized(_this));
});
};
_this.detach = function () {
return _this.payload.forEach(function (p) {
return p instanceof Animated && p.removeChild(_assertThisInitialized(_this));
});
};
return _this;
}
return AnimatedArray;
}(Animated);
var AnimatedObject =
/*#__PURE__*/
function (_Animated2) {
_inheritsLoose(AnimatedObject, _Animated2);
function AnimatedObject() {
var _this2;
for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
args[_key3] = arguments[_key3];
}
_this2 = _Animated2.call.apply(_Animated2, [this].concat(args)) || this;
_this2.payload = {};
_this2.attach = function () {
return Object.values(_this2.payload).forEach(function (s) {
return s instanceof Animated && s.addChild(_assertThisInitialized(_this2));
});
};
_this2.detach = function () {
return Object.values(_this2.payload).forEach(function (s) {
return s instanceof Animated && s.removeChild(_assertThisInitialized(_this2));
});
};
return _this2;
}
var _proto2 = AnimatedObject.prototype;
_proto2.getValue = function getValue(animated) {
if (animated === void 0) {
animated = false;
}
var payload = {};
for (var _key4 in this.payload) {
var value = this.payload[_key4];
if (animated && !(value instanceof Animated)) continue;
payload[_key4] = value instanceof Animated ? value[animated ? 'getAnimatedValue' : 'getValue']() : value;
}
return payload;
};
_proto2.getAnimatedValue = function getAnimatedValue() {
return this.getValue(true);
};
return AnimatedObject;
}(Animated);
var applyAnimatedValues;
function injectApplyAnimatedValues(fn, transform) {
applyAnimatedValues = {
fn: fn,
transform: transform
};
}
var colorNames;
function injectColorNames(names) {
colorNames = names;
}
var requestFrame = function requestFrame(cb) {
return typeof window !== 'undefined' ? window.requestAnimationFrame(cb) : -1;
};
var cancelFrame = function cancelFrame(id) {
typeof window !== 'undefined' && window.cancelAnimationFrame(id);
};
function injectFrame(raf, caf) {
requestFrame = raf;
cancelFrame = caf;
}
var interpolation;
function injectStringInterpolator(fn) {
interpolation = fn;
}
var now = function now() {
return Date.now();
};
function injectNow(nowFn) {
now = nowFn;
}
var defaultElement;
function injectDefaultElement(el) {
defaultElement = el;
}
var animatedApi = function animatedApi(node) {
return node.current;
};
function injectAnimatedApi(fn) {
animatedApi = fn;
}
var createAnimatedStyle;
function injectCreateAnimatedStyle(factory) {
createAnimatedStyle = factory;
}
var manualFrameloop;
function injectManualFrameloop(callback) {
manualFrameloop = callback;
}
var Globals =
/*#__PURE__*/
Object.freeze({
get applyAnimatedValues() {
return applyAnimatedValues;
},
injectApplyAnimatedValues: injectApplyAnimatedValues,
get colorNames() {
return colorNames;
},
injectColorNames: injectColorNames,
get requestFrame() {
return requestFrame;
},
get cancelFrame() {
return cancelFrame;
},
injectFrame: injectFrame,
get interpolation() {
return interpolation;
},
injectStringInterpolator: injectStringInterpolator,
get now() {
return now;
},
injectNow: injectNow,
get defaultElement() {
return defaultElement;
},
injectDefaultElement: injectDefaultElement,
get animatedApi() {
return animatedApi;
},
injectAnimatedApi: injectAnimatedApi,
get createAnimatedStyle() {
return createAnimatedStyle;
},
injectCreateAnimatedStyle: injectCreateAnimatedStyle,
get manualFrameloop() {
return manualFrameloop;
},
injectManualFrameloop: injectManualFrameloop
});
/**
* Wraps the `style` property with `AnimatedStyle`.
*/
var AnimatedProps =
/*#__PURE__*/
function (_AnimatedObject) {
_inheritsLoose(AnimatedProps, _AnimatedObject);
function AnimatedProps(props, callback) {
var _this;
_this = _AnimatedObject.call(this) || this;
_this.update = void 0;
_this.payload = !props.style ? props : _extends({}, props, {
style: createAnimatedStyle(props.style)
});
_this.update = callback;
_this.attach();
return _this;
}
return AnimatedProps;
}(AnimatedObject);
var isFunctionComponent = function isFunctionComponent(val) {
return is.fun(val) && !(val.prototype instanceof React__default.Component);
};
var createAnimatedComponent = function createAnimatedComponent(Component) {
var AnimatedComponent = React.forwardRef(function (props, ref) {
var forceUpdate = useForceUpdate();
var mounted = React.useRef(true);
var propsAnimated = React.useRef(null);
var node = React.useRef(null);
var attachProps = React.useCallback(function (props) {
var oldPropsAnimated = propsAnimated.current;
var callback = function callback() {
var didUpdate = false;
if (node.current) {
didUpdate = applyAnimatedValues.fn(node.current, propsAnimated.current.getAnimatedValue());
}
if (!node.current || didUpdate === false) {
// If no referenced node has been found, or the update target didn't have a
// native-responder, then forceUpdate the animation ...
forceUpdate();
}
};
propsAnimated.current = new AnimatedProps(props, callback);
oldPropsAnimated && oldPropsAnimated.detach();
}, []);
React.useEffect(function () {
return function () {
mounted.current = false;
propsAnimated.current && propsAnimated.current.detach();
};
}, []);
React.useImperativeHandle(ref, function () {
return animatedApi(node, mounted, forceUpdate);
});
attachProps(props);
var _getValue = propsAnimated.current.getValue(),
scrollTop = _getValue.scrollTop,
scrollLeft = _getValue.scrollLeft,
animatedProps = _objectWithoutPropertiesLoose(_getValue, ["scrollTop", "scrollLeft"]); // Functions cannot have refs, see:
// See: https://github.com/react-spring/react-spring/issues/569
var refFn = isFunctionComponent(Component) ? undefined : function (childRef) {
return node.current = handleRef(childRef, ref);
};
return React__default.createElement(Component, _extends({}, animatedProps, {
ref: refFn
}));
});
return AnimatedComponent;
};
var active = false;
var controllers = new Set();
var update = function update() {
if (!active) return false;
var time = now();
for (var _iterator = controllers, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
var _ref;
if (_isArray) {
if (_i >= _iterator.length) break;
_ref = _iterator[_i++];
} else {
_i = _iterator.next();
if (_i.done) break;
_ref = _i.value;
}
var controller = _ref;
var isActive = false;
for (var configIdx = 0; configIdx < controller.configs.length; configIdx++) {
var config = controller.configs[configIdx];
var endOfAnimation = void 0,
lastTime = void 0;
for (var valIdx = 0; valIdx < config.animatedValues.length; valIdx++) {
var animation = config.animatedValues[valIdx]; // If an animation is done, skip, until all of them conclude
if (animation.done) continue;
var from = config.fromValues[valIdx];
var to = config.toValues[valIdx];
var position = animation.lastPosition;
var isAnimated = to instanceof Animated;
var velocity = Array.isArray(config.initialVelocity) ? config.initialVelocity[valIdx] : config.initialVelocity;
if (isAnimated) to = to.getValue(); // Conclude animation if it's either immediate, or from-values match end-state
if (config.immediate) {
animation.setValue(to);
animation.done = true;
continue;
} // Break animation when string values are involved
if (typeof from === 'string' || typeof to === 'string') {
animation.setValue(to);
animation.done = true;
continue;
}
if (config.duration !== void 0) {
/** Duration easing */
position = from + config.easing((time - animation.startTime) / config.duration) * (to - from);
endOfAnimation = time >= animation.startTime + config.duration;
} else if (config.decay) {
/** Decay easing */
position = from + velocity / (1 - 0.998) * (1 - Math.exp(-(1 - 0.998) * (time - animation.startTime)));
endOfAnimation = Math.abs(animation.lastPosition - position) < 0.1;
if (endOfAnimation) to = position;
} else {
/** Spring easing */
lastTime = animation.lastTime !== void 0 ? animation.lastTime : time;
velocity = animation.lastVelocity !== void 0 ? animation.lastVelocity : config.initialVelocity; // If we lost a lot of frames just jump to the end.
if (time > lastTime + 64) lastTime = time; // http://gafferongames.com/game-physics/fix-your-timestep/
var numSteps = Math.floor(time - lastTime);
for (var i = 0; i < numSteps; ++i) {
var force = -config.tension * (position - to);
var damping = -config.friction * velocity;
var acceleration = (force + damping) / config.mass;
velocity = velocity + acceleration * 1 / 1000;
position = position + velocity * 1 / 1000;
} // Conditions for stopping the spring animation
var isOvershooting = config.clamp && config.tension !== 0 ? from < to ? position > to : position < to : false;
var isVelocity = Math.abs(velocity) <= config.precision;
var isDisplacement = config.tension !== 0 ? Math.abs(to - position) <= config.precision : true;
endOfAnimation = isOvershooting || isVelocity && isDisplacement;
animation.lastVelocity = velocity;
animation.lastTime = time;
} // Trails aren't done until their parents conclude
if (isAnimated && !config.toValues[valIdx].done) endOfAnimation = false;
if (endOfAnimation) {
// Ensure that we end up with a round value
if (animation.value !== to) position = to;
animation.done = true;
} else isActive = true;
animation.setValue(position);
animation.lastPosition = position;
} // Keep track of updated values only when necessary
if (controller.props.onFrame) controller.values[config.name] = config.interpolation.getValue();
} // Update callbacks in the end of the frame
if (controller.props.onFrame) controller.props.onFrame(controller.values); // Either call onEnd or next frame
if (!isActive) {
controllers.delete(controller);
controller.stop(true);
}
} // Loop over as long as there are controllers ...
if (controllers.size) {
if (manualFrameloop) manualFrameloop();else requestFrame(update);
} else {
active = false;
}
return active;
};
var start = function start(controller) {
if (!controllers.has(controller)) controllers.add(controller);
if (!active) {
active = true;
if (manualFrameloop) requestFrame(manualFrameloop);else requestFrame(update);
}
};
var stop = function stop(controller) {
if (controllers.has(controller)) controllers.delete(controller);
};
function createInterpolator(range, output, extrapolate) {
if (typeof range === 'function') {
return range;
}
if (Array.isArray(range)) {
return createInterpolator({
range: range,
output: output,
extrapolate: extrapolate
});
}
if (interpolation && typeof range.output[0] === 'string') {
return interpolation(range);
}
var config = range;
var outputRange = config.output;
var inputRange = config.range || [0, 1];
var extrapolateLeft = config.extrapolateLeft || config.extrapolate || 'extend';
var extrapolateRight = config.extrapolateRight || config.extrapolate || 'extend';
var easing = config.easing || function (t) {
return t;
};
return function (input) {
var range = findRange(input, inputRange);
return interpolate(input, inputRange[range], inputRange[range + 1], outputRange[range], outputRange[range + 1], easing, extrapolateLeft, extrapolateRight, config.map);
};
}
function interpolate(input, inputMin, inputMax, outputMin, outputMax, easing, extrapolateLeft, extrapolateRight, map) {
var result = map ? map(input) : input; // Extrapolate
if (result < inputMin) {
if (extrapolateLeft === 'identity') return result;else if (extrapolateLeft === 'clamp') result = inputMin;
}
if (result > inputMax) {
if (extrapolateRight === 'identity') return result;else if (extrapolateRight === 'clamp') result = inputMax;
}
if (outputMin === outputMax) return outputMin;
if (inputMin === inputMax) return input <= inputMin ? outputMin : outputMax; // Input Range
if (inputMin === -Infinity) result = -result;else if (inputMax === Infinity) result = result - inputMin;else result = (result - inputMin) / (inputMax - inputMin); // Easing
result = easing(result); // Output Range
if (outputMin === -Infinity) result = -result;else if (outputMax === Infinity) result = result + outputMin;else result = result * (outputMax - outputMin) + outputMin;
return result;
}
function findRange(input, inputRange) {
for (var i = 1; i < inputRange.length - 1; ++i) {
if (inputRange[i] >= input) break;
}
return i - 1;
}
var AnimatedInterpolation =
/*#__PURE__*/
function (_AnimatedArray) {
_inheritsLoose(AnimatedInterpolation, _AnimatedArray);
function AnimatedInterpolation(parents, range, output, extrapolate) {
var _this;
_this = _AnimatedArray.call(this) || this;
_this.calc = void 0;
_this.payload = parents instanceof AnimatedArray && !(parents instanceof AnimatedInterpolation) ? parents.getPayload() : Array.isArray(parents) ? parents : [parents];
_this.calc = createInterpolator(range, output, extrapolate);
return _this;
}
var _proto = AnimatedInterpolation.prototype;
_proto.getValue = function getValue() {
return this.calc.apply(this, this.payload.map(function (value) {
return value.getValue();
}));
};
_proto.updateConfig = function updateConfig(range, output, extrapolate) {
this.calc = createInterpolator(range, output, extrapolate);
};
_proto.interpolate = function interpolate(range, output, extrapolate) {
return new AnimatedInterpolation(this, range, output, extrapolate);
};
return AnimatedInterpolation;
}(AnimatedArray);
var interpolate$1 = function interpolate(parents, range, output) {
return parents && new AnimatedInterpolation(parents, range, output);
};
var config = {
default: {
tension: 170,
friction: 26
},
gentle: {
tension: 120,
friction: 14
},
wobbly: {
tension: 180,
friction: 12
},
stiff: {
tension: 210,
friction: 20
},
slow: {
tension: 280,
friction: 60
},
molasses: {
tension: 280,
friction: 120
}
};
/** API
* useChain(references, timeSteps, timeFrame)
*/
function useChain(refs, timeSteps, timeFrame) {
if (timeFrame === void 0) {
timeFrame = 1000;
}
var previous = React.useRef();
React.useEffect(function () {
if (is.equ(refs, previous.current)) refs.forEach(function (_ref) {
var current = _ref.current;
return current && current.start();
});else if (timeSteps) {
refs.forEach(function (_ref2, index) {
var current = _ref2.current;
if (current) {
var ctrls = current.controllers;
if (ctrls.length) {
var t = timeFrame * timeSteps[index];
ctrls.forEach(function (ctrl) {
ctrl.queue = ctrl.queue.map(function (e) {
return _extends({}, e, {
delay: e.delay + t
});
});
ctrl.start();
});
}
}
});
} else refs.reduce(function (q, _ref3, rI) {
var current = _ref3.current;
return q = q.then(function () {
return current.start();
});
}, Promise.resolve());
previous.current = refs;
});
}
/**
* Animated works by building a directed acyclic graph of dependencies
* transparently when you render your Animated components.
*
* new Animated.Value(0)
* .interpolate() .interpolate() new Animated.Value(1)
* opacity translateY scale
* style transform
* View#234 style
* View#123
*
* A) Top Down phase
* When an AnimatedValue is updated, we recursively go down through this
* graph in order to find leaf nodes: the views that we flag as needing
* an update.
*
* B) Bottom Up phase
* When a view is flagged as needing an update, we recursively go back up
* in order to build the new value that it needs. The reason why we need
* this two-phases process is to deal with composite props such as
* transform which can receive values from multiple parents.
*/
function addAnimatedStyles(node, styles) {
if ('update' in node) {
styles.add(node);
} else {
node.getChildren().forEach(function (child) {
return addAnimatedStyles(child, styles);
});
}
}
var AnimatedValue =
/*#__PURE__*/
function (_Animated) {
_inheritsLoose(AnimatedValue, _Animated);
function AnimatedValue(_value) {
var _this;
_this = _Animated.call(this) || this;
_this.animatedStyles = new Set();
_this.value = void 0;
_this.startPosition = void 0;
_this.lastPosition = void 0;
_this.lastVelocity = void 0;
_this.startTime = void 0;
_this.lastTime = void 0;
_this.done = false;
_this.setValue = function (value, flush) {
if (flush === void 0) {
flush = true;
}
_this.value = value;
if (flush) _this.flush();
};
_this.value = _value;
_this.startPosition = _value;
_this.lastPosition = _value;
return _this;
}
var _proto = AnimatedValue.prototype;
_proto.flush = function flush() {
if (this.animatedStyles.size === 0) {
addAnimatedStyles(this, this.animatedStyles);
}
this.animatedStyles.forEach(function (animatedStyle) {
return animatedStyle.update();
});
};
_proto.clearStyles = function clearStyles() {
this.animatedStyles.clear();
};
_proto.getValue = function getValue() {
return this.value;
};
_proto.interpolate = function interpolate(range, output, extrapolate) {
return new AnimatedInterpolation(this, range, output, extrapolate);
};
return AnimatedValue;
}(Animated);
var AnimatedValueArray =
/*#__PURE__*/
function (_AnimatedArray) {
_inheritsLoose(AnimatedValueArray, _AnimatedArray);
function AnimatedValueArray(values) {
var _this;
_this = _AnimatedArray.call(this) || this;
_this.payload = values.map(function (n) {
return new AnimatedValue(n);
});
return _this;
}
var _proto = AnimatedValueArray.prototype;
_proto.setValue = function setValue(value, flush) {
var _this2 = this;
if (flush === void 0) {
flush = true;
}
if (Array.isArray(value)) {
if (value.length === this.payload.length) {
value.forEach(function (v, i) {
return _this2.payload[i].setValue(v, flush);
});
}
} else {
this.payload.forEach(function (p) {
return p.setValue(value, flush);
});
}
};
_proto.getValue = function getValue() {
return this.payload.map(function (v) {
return v.getValue();
});
};
_proto.interpolate = function interpolate(range, output) {
return new AnimatedInterpolation(this, range, output);
};
return AnimatedValueArray;
}(AnimatedArray);
var G = 0;
var Controller =
/*#__PURE__*/
function () {
function Controller() {
var _this = this;
this.id = void 0;
this.idle = true;
this.hasChanged = false;
this.guid = 0;
this.local = 0;
this.props = {};
this.merged = {};
this.animations = {};
this.interpolations = {};
this.values = {};
this.configs = [];
this.listeners = [];
this.queue = [];
this.localQueue = void 0;
this.getValues = function () {
return _this.interpolations;
};
this.id = G++;
}
/** update(props)
* This function filters input props and creates an array of tasks which are executed in .start()
* Each task is allowed to carry a delay, which means it can execute asnychroneously */
var _proto = Controller.prototype;
_proto.update = function update$$1(args) {
//this._id = n + this.id
if (!args) return this; // Extract delay and the to-prop from props
var _ref = interpolateTo(args),
_ref$delay = _ref.delay,
delay = _ref$delay === void 0 ? 0 : _ref$delay,
to = _ref.to,
props = _objectWithoutPropertiesLoose(_ref, ["delay", "to"]);
if (is.arr(to) || is.fun(to)) {
// If config is either a function or an array queue it up as is
this.queue.push(_extends({}, props, {
delay: delay,
to: to
}));
} else if (to) {
// Otherwise go through each key since it could be delayed individually
var ops = {};
Object.entries(to).forEach(function (_ref2) {
var _to;
var k = _ref2[0],
v = _ref2[1]; // Fetch delay and create an entry, consisting of the to-props, the delay, and basic props
var entry = _extends({
to: (_to = {}, _to[k] = v, _to),
delay: callProp(delay, k)
}, props);
var previous = ops[entry.delay] && ops[entry.delay].to;
ops[entry.delay] = _extends({}, ops[entry.delay], entry, {
to: _extends({}, previous, entry.to)
});
});
this.queue = Object.values(ops);
} // Sort queue, so that async calls go last
this.queue = this.queue.sort(function (a, b) {
return a.delay - b.delay;
}); // Diff the reduced props immediately (they'll contain the from-prop and some config)
this.diff(props);
return this;
}
/** start(onEnd)
* This function either executes a queue, if present, or starts the frameloop, which animates */
;
_proto.start = function start$$1(onEnd) {
var _this2 = this; // If a queue is present we must excecute it
if (this.queue.length) {
this.idle = false; // Updates can interrupt trailing queues, in that case we just merge values
if (this.localQueue) {
this.localQueue.forEach(function (_ref3) {
var _ref3$from = _ref3.from,
from = _ref3$from === void 0 ? {} : _ref3$from,
_ref3$to = _ref3.to,
to = _ref3$to === void 0 ? {} : _ref3$to;
if (is.obj(from)) _this2.merged = _extends({}, from, _this2.merged);
if (is.obj(to)) _this2.merged = _extends({}, _this2.merged, to);
});
} // The guid helps us tracking frames, a new queue over an old one means an override
// We discard async calls in that caseÍ
var local = this.local = ++this.guid;
var queue = this.localQueue = this.queue;
this.queue = []; // Go through each entry and execute it
queue.forEach(function (_ref4, index) {
var delay = _ref4.delay,
props = _objectWithoutPropertiesLoose(_ref4, ["delay"]);
var cb = function cb(finished) {
if (index === queue.length - 1 && local === _this2.guid && finished) {
_this2.idle = true;
if (_this2.props.onRest) _this2.props.onRest(_this2.merged);
}
if (onEnd) onEnd();
}; // Entries can be delayed, ansyc or immediate
var async = is.arr(props.to) || is.fun(props.to);
if (delay) {
setTimeout(function () {
if (local === _this2.guid) {
if (async) _this2.runAsync(props, cb);else _this2.diff(props).start(cb);
}
}, delay);
} else if (async) _this2.runAsync(props, cb);else _this2.diff(props).start(cb);
});
} // Otherwise we kick of the frameloop
else {
if (is.fun(onEnd)) this.listeners.push(onEnd);
if (this.props.onStart) this.props.onStart();
start(this);
}
return this;
};
_proto.stop = function stop$$1(finished) {
this.listeners.forEach(function (onEnd) {
return onEnd(finished);
});
this.listeners = [];
return this;
}
/** Pause sets onEnd listeners free, but also removes the controller from the frameloop */
;
_proto.pause = function pause(finished) {
this.stop(true);
if (finished) stop(this);
return this;
};
_proto.runAsync = function runAsync(_ref5, onEnd) {
var _this3 = this;
var delay = _ref5.delay,
props = _objectWithoutPropertiesLoose(_ref5, ["delay"]);
var local = this.local; // If "to" is either a function or an array it will be processed async, therefor "to" should be empty right now
// If the view relies on certain values "from" has to be present
var queue = Promise.resolve(undefined);
if (is.arr(props.to)) {
var _loop = function _loop(i) {
var index = i;
var fresh = _extends({}, props, interpolateTo(props.to[index]));
if (is.arr(fresh.config)) fresh.config = fresh.config[index];
queue = queue.then(function () {
//this.stop()
if (local === _this3.guid) return new Promise(function (r) {
return _this3.diff(fresh).start(r);
});
});
};
for (var i = 0; i < props.to.length; i++) {
_loop(i);
}
} else if (is.fun(props.to)) {
var index = 0;
var last;
queue = queue.then(function () {
return props.to( // next(props)
function (p) {
var fresh = _extends({}, props, interpolateTo(p));
if (is.arr(fresh.config)) fresh.config = fresh.config[index];
index++; //this.stop()
if (local === _this3.guid) return last = new Promise(function (r) {
return _this3.diff(fresh).start(r);
});
return;
}, // cancel()
function (finished) {
if (finished === void 0) {
finished = true;
}
return _this3.stop(finished);
}).then(function () {
return last;
});
});
}
queue.then(onEnd);
};
_proto.diff = function diff(props) {
var _this4 = this;
this.props = _extends({}, this.props, props);
var _this$props = this.props,
_this$props$from = _this$props.from,
from = _this$props$from === void 0 ? {} : _this$props$from,
_this$props$to = _this$props.to,
to = _this$props$to === void 0 ? {} : _this$props$to,
_this$props$config = _this$props.config,
config = _this$props$config === void 0 ? {} : _this$props$config,
reverse = _this$props.reverse,
attach = _this$props.attach,
reset = _this$props.reset,
immediate = _this$props.immediate; // Reverse values when requested
if (reverse) {
var _ref6 = [to, from];
from = _ref6[0];
to = _ref6[1];
} // This will collect all props that were ever set, reset merged props when necessary
this.merged = _extends({}, from, this.merged, to);
this.hasChanged = false; // Attachment handling, trailed springs can "attach" themselves to a previous spring
var target = attach && attach(this); // Reduces input { name: value } pairs into animated values
this.animations = Object.entries(this.merged).reduce(function (acc, _ref7) {
var name = _ref7[0],
value = _ref7[1]; // Issue cached entries, except on reset
var entry = acc[name] || {}; // Figure out what the value is supposed to be
var isNumber = is.num(value);
var isString = is.str(value) && !value.startsWith('#') && !/\d/.test(value) && !colorNames[value];
var isArray = is.arr(value);
var isInterpolation = !isNumber && !isArray && !isString;
var fromValue = !is.und(from[name]) ? from[name] : value;
var toValue = isNumber || isArray ? value : isString ? value : 1;
var toConfig = callProp(config, name);
if (target) toValue = target.animations[name].parent;
var parent = entry.parent,
interpolation$$1 = entry.interpolation,
toValues = toArray(target ? toValue.getPayload() : toValue),
animatedValues;
var newValue = value;
if (isInterpolation) newValue = interpolation({
range: [0, 1],
output: [value, value]
})(1);
var currentValue = interpolation$$1 && interpolation$$1.getValue(); // Change detection flags
var isFirst = is.und(parent);
var isActive = !isFirst && entry.animatedValues.some(function (v) {
return !v.done;
});
var currentValueDiffersFromGoal = !is.equ(newValue, currentValue);
var hasNewGoal = !is.equ(newValue, entry.previous);
var hasNewConfig = !is.equ(toConfig, entry.config); // Change animation props when props indicate a new goal (new value differs from previous one)
// and current values differ from it. Config changes trigger a new update as well (though probably shouldn't?)
if (reset || hasNewGoal && currentValueDiffersFromGoal || hasNewConfig) {
var _extends2; // Convert regular values into animated values, ALWAYS re-use if possible
if (isNumber || isString) parent = interpolation$$1 = entry.parent || new AnimatedValue(fromValue);else if (isArray) parent = interpolation$$1 = entry.parent || new AnimatedValueArray(fromValue);else if (isInterpolation) {
var prev = entry.interpolation && entry.interpolation.calc(entry.parent.value);
prev = prev !== void 0 && !reset ? prev : fromValue;
if (entry.parent) {
parent = entry.parent;
parent.setValue(0, false);
} else parent = new AnimatedValue(0);
var range = {
output: [prev, value]
};
if (entry.interpolation) {
interpolation$$1 = entry.interpolation;
entry.interpolation.updateConfig(range);
} else interpolation$$1 = parent.interpolate(range);
}
toValues = toArray(target ? toValue.getPayload() : toValue);
animatedValues = toArray(parent.getPayload());
if (reset && !isInterpolation) parent.setValue(fromValue, false);
_this4.hasChanged = true; // Reset animated values
animatedValues.forEach(function (value) {
value.startPosition = value.value;
value.lastPosition = value.value;
value.lastVelocity = isActive ? value.lastVelocity : undefined;
value.lastTime = isActive ? value.lastTime : undefined;
value.startTime = now();
value.done = false;
value.animatedStyles.clear();
}); // Set immediate values
if (callProp(immediate, name)) {
parent.setValue(isInterpolation ? toValue : value, false);
}
return _extends({}, acc, (_extends2 = {}, _extends2[name] = _extends({}, entry, {
name: name,
parent: parent,
interpolation: interpolation$$1,
animatedValues: animatedValues,
toValues: toValues,
previous: newValue,
config: toConfig,
fromValues: toArray(parent.getValue()),
immediate: callProp(immediate, name),
initialVelocity: withDefault(toConfig.velocity, 0),
clamp: withDefault(toConfig.clamp, false),
precision: withDefault(toConfig.precision, 0.01),
tension: withDefault(toConfig.tension, 170),
friction: withDefault(toConfig.friction, 26),
mass: withDefault(toConfig.mass, 1),
duration: toConfig.duration,
easing: withDefault(toConfig.easing, function (t) {
return t;
}),
decay: toConfig.decay
}), _extends2));
} else {
if (!currentValueDiffersFromGoal) {
var _extends3; // So ... the current target value (newValue) appears to be different from the previous value,
// which normally constitutes an update, but the actual value (currentValue) matches the target!
// In order to resolve this without causing an animation update we silently flag the animation as done,
// which it technically is. Interpolations also needs a config update with their target set to 1.
if (isInterpolation) {
parent.setValue(1, false);
interpolation$$1.updateConfig({
output: [newValue, newValue]
});
}
parent.done = true;
_this4.hasChanged = true;
return _extends({}, acc, (_extends3 = {}, _extends3[name] = _extends({}, acc[name], {
previous: newValue
}), _extends3));
}
return acc;
}
}, this.animations);
if (this.hasChanged) {
// Make animations available to frameloop
this.configs = Object.values(this.animations);
this.values = {};
this.interpolations = {};
for (var key in this.animations) {
this.interpolations[key] = this.animations[key].interpolation;
this.values[key] = this.animations[key].interpolation.getValue();
}
}
return this;
};
_proto.destroy = function destroy() {
this.stop();
this.props = {};
this.merged = {};
this.animations = {};
this.interpolations = {};
this.values = {};
this.configs = [];
this.local = 0;
};
return Controller;
}();
/** API
* const props = useSprings(number, [{ ... }, { ... }, ...])
* const [props, set] = useSprings(number, (i, controller) => ({ ... }))
*/
var useSprings = function useSprings(length, props) {
var mounted = React.useRef(false);
var ctrl = React.useRef();
var isFn = is.fun(props); // The controller maintains the animation values, starts and stops animations
var _useMemo = React.useMemo(function () {
// Remove old controllers
if (ctrl.current) {
ctrl.current.map(function (c) {
return c.destroy();
});
ctrl.current = undefined;
}
var ref;
return [new Array(length).fill().map(function (_, i) {
var ctrl = new Controller();
var newProps = isFn ? callProp(props, i, ctrl) : props[i];
if (i === 0) ref = newProps.ref;
ctrl.update(newProps);
if (!ref) ctrl.start();
return ctrl;
}), ref];
}, [length]),
controllers = _useMemo[0],
ref = _useMemo[1];
ctrl.current = controllers; // The hooks reference api gets defined here ...
var api = React.useImperativeHandle(ref, function () {
return {
start: function start() {
return Promise.all(ctrl.current.map(function (c) {
return new Promise(function (r) {
return c.start(r);
});
}));
},
stop: function stop(finished) {
return ctrl.current.forEach(function (c) {
return c.stop(finished);
});
},
get controllers() {
return ctrl.current;
}
};
}); // This function updates the controllers
var updateCtrl = React.useMemo(function () {
return function (updateProps) {
return ctrl.current.map(function (c, i) {
c.update(isFn ? callProp(updateProps, i, c) : updateProps[i]);
if (!ref) c.start();
});
};
}, [length]); // Update controller if props aren't functional
React.useEffect(function () {
if (mounted.current) {
if (!isFn) updateCtrl(props);
} else if (!ref) ctrl.current.forEach(function (c) {
return c.start();
});
}); // Update mounted flag and destroy controller on unmount
React.useEffect(function () {
return mounted.current = true, function () {
return ctrl.current.forEach(function (c) {
return c.destroy();
});
};
}, []); // Return animated props, or, anim-props + the update-setter above
var propValues = ctrl.current.map(function (c) {
return c.getValues();
});
return isFn ? [propValues, updateCtrl, function (finished) {
return ctrl.current.forEach(function (c) {
return c.pause(finished);
});
}] : propValues;
};
/** API
* const props = useSpring({ ... })
* const [props, set] = useSpring(() => ({ ... }))
*/
var useSpring = function useSpring(props) {
var isFn = is.fun(props);
var _useSprings = useSprings(1, isFn ? props : [props]),
result = _useSprings[0],
set = _useSprings[1],
pause = _useSprings[2];
return isFn ? [result[0], set, pause] : result;
};
/** API
* const trails = useTrail(number, { ... })
* const [trails, set] = useTrail(number, () => ({ ... }))
*/
var useTrail = function useTrail(length, props) {
var mounted = React.useRef(false);
var isFn = is.fun(props);
var updateProps = callProp(props);
var instances = React.useRef();
var _useSprings = useSprings(length, function (i, ctrl) {
if (i === 0) instances.current = [];
instances.current.push(ctrl);
return _extends({}, updateProps, {
config: callProp(updateProps.config, i),
attach: i > 0 && function () {
return instances.current[i - 1];
}
});
}),
result = _useSprings[0],
set = _useSprings[1],
pause = _useSprings[2]; // Set up function to update controller
var updateCtrl = React.useMemo(function () {
return function (props) {
return set(function (i, ctrl) {
var last = props.reverse ? i === 0 : length - 1 === i;
var attachIdx = props.reverse ? i + 1 : i - 1;
var attachController = instances.current[attachIdx];
return _extends({}, props, {
config: callProp(props.config || updateProps.config, i),
attach: attachController && function () {
return attachController;
}
});
});
};
}, [length, updateProps.reverse]); // Update controller if props aren't functional
React.useEffect(function () {
return void (mounted.current && !isFn && updateCtrl(props));
}); // Update mounted flag and destroy controller on unmount
React.useEffect(function () {
return void (mounted.current = true);
}, []);
return isFn ? [result, updateCtrl, pause] : result;
};
/** API
* const transitions = useTransition(items, itemKeys, { ... })
* const [transitions, update] = useTransition(items, itemKeys, () => ({ ... }))
*/
var guid = 0;
var ENTER = 'enter';
var LEAVE = 'leave';
var UPDATE = 'update';
var mapKeys = function mapKeys(items, keys) {
return (typeof keys === 'function' ? items.map(keys) : toArray(keys)).map(String);
};
var get = function get(props) {
var items = props.items,
_props$keys = props.keys,
keys = _props$keys === void 0 ? function (item) {
return item;
} : _props$keys,
rest = _objectWithoutPropertiesLoose(props, ["items", "keys"]);
items = toArray(items !== void 0 ? items : null);
return _extends({
items: items,
keys: mapKeys(items, keys)
}, rest);
};
function useTransition(input, keyTransform, config) {
var props = _extends({
items: input,
keys: keyTransform || function (i) {
return i;
}
}, config);
var _get = get(props),
_get$lazy = _get.lazy,
lazy = _get$lazy === void 0 ? false : _get$lazy,
_get$unique = _get.unique,
_get$reset = _get.reset,
reset = _get$reset === void 0 ? false : _get$reset,
enter = _get.enter,
leave = _get.leave,
update = _get.update,
onDestroyed = _get.onDestroyed,
keys = _get.keys,
items = _get.items,
onFrame = _get.onFrame,
_onRest = _get.onRest,
onStart = _get.onStart,
ref = _get.ref,
extra = _objectWithoutPropertiesLoose(_get, ["lazy", "unique", "reset", "enter", "leave", "update", "onDestroyed", "keys", "items", "onFrame", "onRest", "onStart", "ref"]);
var forceUpdate = useForceUpdate();
var mounted = React.useRef(false);
var state = React.useRef({
mounted: false,
first: true,
deleted: [],
current: {},
transitions: [],
prevProps: {},
paused: !!props.ref,
instances: !mounted.current && new Map(),
forceUpdate: forceUpdate
});
React.useImperativeHandle(props.ref, function () {
return {
start: function start() {
return Promise.all(Array.from(state.current.instances).map(function (_ref) {
var c = _ref[1];
return new Promise(function (r) {
return c.start(r);
});
}));
},
stop: function stop(finished) {
return Array.from(state.current.instances).forEach(function (_ref2) {
var c = _ref2[1];
return c.stop(finished);
});
},
get controllers() {
return Array.from(state.current.instances).map(function (_ref3) {
var c = _ref3[1];
return c;
});
}
};
}); // Update state
state.current = diffItems(state.current, props);
if (state.current.changed) {
// Update state
state.current.transitions.forEach(function (transition) {
var slot = transition.slot,
from = transition.from,
to = transition.to,
config = transition.config,
trail = transition.trail,
key = transition.key,
item = transition.item;
if (!state.current.instances.has(key)) state.current.instances.set(key, new Controller()); // update the map object
var ctrl = state.current.instances.get(key);
var newProps = _extends({}, extra, {
to: to,
from: from,
config: config,
ref: ref,
onRest: function onRest(values) {
if (state.current.mounted) {
if (transition.destroyed) {
// If no ref is given delete destroyed items immediately
if (!ref && !lazy) cleanUp(state, key);
if (onDestroyed) onDestroyed(item);
} // A transition comes to rest once all its springs conclude
var curInstances = Array.from(state.current.instances);
var active = curInstances.some(function (_ref4) {
var c = _ref4[1];
return !c.idle;
});
if (!active && (ref || lazy) && state.current.deleted.length > 0) cleanUp(state);
if (_onRest) _onRest(item, slot, values);
}
},
onStart: onStart && function () {
return onStart(item, slot);
},
onFrame: onFrame && function (values) {
return onFrame(item, slot, values);
},
delay: trail,
reset: reset && slot === ENTER // Update controller
});
ctrl.update(newProps);
if (!state.current.paused) ctrl.start();
});
}
React.useEffect(function () {
state.current.mounted = mounted.current = true;
return function () {
state.current.mounted = mounted.current = false;
Array.from(state.current.instances).map(function (_ref5) {
var c = _ref5[1];
return c.destroy();
});
state.current.instances.clear();
};
}, []);
return state.current.transitions.map(function (_ref6) {
var item = _ref6.item,
slot = _ref6.slot,
key = _ref6.key;
return {
item: item,
key: key,
state: slot,
props: state.current.instances.get(key).getValues()
};
});
}
function cleanUp(state, filterKey) {
var deleted = state.current.deleted;
var _loop = function _loop() {
if (_isArray) {
if (_i >= _iterator.length) return "break";
_ref8 = _iterator[_i++];
} else {
_i = _iterator.next();
if (_i.done) return "break";
_ref8 = _i.value;
}
var _ref7 = _ref8;
var key = _ref7.key;
var filter = function filter(t) {
return t.key !== key;
};
if (is.und(filterKey) || filterKey === key) {
state.current.instances.delete(key);
state.current.transitions = state.current.transitions.filter(filter);
state.current.deleted = state.current.deleted.filter(filter);
}
};
for (var _iterator = deleted, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
var _ref8;
var _ret = _loop();
if (_ret === "break") break;
}
state.current.forceUpdate();
}
function diffItems(_ref9, props) {
var first = _ref9.first,
prevProps = _ref9.prevProps,
state = _objectWithoutPropertiesLoose(_ref9, ["first", "prevProps"]);
var _get2 = get(props),
items = _get2.items,
keys = _get2.keys,
initial = _get2.initial,
from = _get2.from,
enter = _get2.enter,
leave = _get2.leave,
update = _get2.update,
_get2$trail = _get2.trail,
trail = _get2$trail === void 0 ? 0 : _get2$trail,
unique = _get2.unique,
config = _get2.config,
_get2$order = _get2.order,
order = _get2$order === void 0 ? [ENTER, LEAVE, UPDATE] : _get2$order;
var _get3 = get(prevProps),
_keys = _get3.keys,
_items = _get3.items;
var current = _extends({}, state.current);
var deleted = [].concat(state.deleted); // Compare next keys with current keys
var currentKeys = Object.keys(current);
var currentSet = new Set(currentKeys);
var nextSet = new Set(keys);
var added = keys.filter(function (item) {
return !currentSet.has(item);
});
var removed = state.transitions.filter(function (item) {
return !item.destroyed && !nextSet.has(item.originalKey);
}).map(function (i) {
return i.originalKey;
});
var updated = keys.filter(function (item) {
return currentSet.has(item);
});
var delay = -trail;
while (order.length) {
var changeType = order.shift();
switch (changeType) {
case ENTER:
{
added.forEach(function (key, index) {
// In unique mode, remove fading out transitions if their key comes in again
if (unique && deleted.find(function (d) {
return d.originalKey === key;
})) deleted = deleted.filter(function (t) {
return t.originalKey !== key;
});
var keyIndex = keys.indexOf(key);
var item = items[keyIndex];
var slot = first && initial !== void 0 ? 'initial' : ENTER;
current[key] = {
slot: slot,
originalKey: key,
key: unique ? String(key) : guid++,
item: item,
trail: delay = delay + trail,
config: callProp(config, item, slot),
from: callProp(first ? initial !== void 0 ? initial || {} : from : from, item),
to: callProp(enter, item)
};
});
break;
}
case LEAVE:
{
removed.forEach(function (key) {
var keyIndex = _keys.indexOf(key);
var item = _items[keyIndex];
var slot = LEAVE;
deleted.unshift(_extends({}, current[key], {
slot: slot,
destroyed: true,
left: _keys[Math.max(0, keyIndex - 1)],
right: _keys[Math.min(_keys.length, keyIndex + 1)],
trail: delay = delay + trail,
config: callProp(config, item, slot),
to: callProp(leave, item)
}));
delete current[key];
});
break;
}
case UPDATE:
{
updated.forEach(function (key) {
var keyIndex = keys.indexOf(key);
var item = items[keyIndex];
var slot = UPDATE;
current[key] = _extends({}, current[key], {
item: item,
slot: slot,
trail: delay = delay + trail,
config: callProp(config, item, slot),
to: callProp(update, item)
});
});
break;
}
}
}
var out = keys.map(function (key) {
return current[key];
}); // This tries to restore order for deleted items by finding their last known siblings
// only using the left sibling to keep order placement consistent for all deleted items
deleted.forEach(function (_ref10) {
var left = _ref10.left,
right = _ref10.right,
item = _objectWithoutPropertiesLoose(_ref10, ["left", "right"]);
var pos; // Was it the element on the left, if yes, move there ...
if ((pos = out.findIndex(function (t) {
return t.originalKey === left;
})) !== -1) pos += 1; // And if nothing else helps, move it to the start ¯\_(ツ)_/¯
pos = Math.max(0, pos);
out = [].concat(out.slice(0, pos), [item], out.slice(pos));
});
return _extends({}, state, {
changed: added.length || removed.length || updated.length,
first: first && added.length === 0,
transitions: out,
current: current,
deleted: deleted,
prevProps: props
});
}
var AnimatedStyle =
/*#__PURE__*/
function (_AnimatedObject) {
_inheritsLoose(AnimatedStyle, _AnimatedObject);
function AnimatedStyle(style) {
var _this;
if (style === void 0) {
style = {};
}
_this = _AnimatedObject.call(this) || this;
if (style.transform && !(style.transform instanceof Animated)) {
style = applyAnimatedValues.transform(style);
}
_this.payload = style;
return _this;
}
return AnimatedStyle;
}(AnimatedObject); // http://www.w3.org/TR/css3-color/#svg-color
var colors = {
transparent: 0x00000000,
aliceblue: 0xf0f8ffff,
antiquewhite: 0xfaebd7ff,
aqua: 0x00ffffff,
aquamarine: 0x7fffd4ff,
azure: 0xf0ffffff,
beige: 0xf5f5dcff,
bisque: 0xffe4c4ff,
black: 0x000000ff,
blanchedalmond: 0xffebcdff,
blue: 0x0000ffff,
blueviolet: 0x8a2be2ff,
brown: 0xa52a2aff,
burlywood: 0xdeb887ff,
burntsienna: 0xea7e5dff,
cadetblue: 0x5f9ea0ff,
chartreuse: 0x7fff00ff,
chocolate: 0xd2691eff,
coral: 0xff7f50ff,
cornflowerblue: 0x6495edff,
cornsilk: 0xfff8dcff,
crimson: 0xdc143cff,
cyan: 0x00ffffff,
darkblue: 0x00008bff,
darkcyan: 0x008b8bff,
darkgoldenrod: 0xb8860bff,
darkgray: 0xa9a9a9ff,
darkgreen: 0x006400ff,
darkgrey: 0xa9a9a9ff,
darkkhaki: 0xbdb76bff,
darkmagenta: 0x8b008bff,
darkolivegreen: 0x556b2fff,
darkorange: 0xff8c00ff,
darkorchid: 0x9932ccff,
darkred: 0x8b0000ff,
darksalmon: 0xe9967aff,
darkseagreen: 0x8fbc8fff,
darkslateblue: 0x483d8bff,
darkslategray: 0x2f4f4fff,
darkslategrey: 0x2f4f4fff,
darkturquoise: 0x00ced1ff,
darkviolet: 0x9400d3ff,
deeppink: 0xff1493ff,
deepskyblue: 0x00bfffff,
dimgray: 0x696969ff,
dimgrey: 0x696969ff,
dodgerblue: 0x1e90ffff,
firebrick: 0xb22222ff,
floralwhite: 0xfffaf0ff,
forestgreen: 0x228b22ff,
fuchsia: 0xff00ffff,
gainsboro: 0xdcdcdcff,
ghostwhite: 0xf8f8ffff,
gold: 0xffd700ff,
goldenrod: 0xdaa520ff,
gray: 0x808080ff,
green: 0x008000ff,
greenyellow: 0xadff2fff,
grey: 0x808080ff,
honeydew: 0xf0fff0ff,
hotpink: 0xff69b4ff,
indianred: 0xcd5c5cff,
indigo: 0x4b0082ff,
ivory: 0xfffff0ff,
khaki: 0xf0e68cff,
lavender: 0xe6e6faff,
lavenderblush: 0xfff0f5ff,
lawngreen: 0x7cfc00ff,
lemonchiffon: 0xfffacdff,
lightblue: 0xadd8e6ff,
lightcoral: 0xf08080ff,
lightcyan: 0xe0ffffff,
lightgoldenrodyellow: 0xfafad2ff,
lightgray: 0xd3d3d3ff,
lightgreen: 0x90ee90ff,
lightgrey: 0xd3d3d3ff,
lightpink: 0xffb6c1ff,
lightsalmon: 0xffa07aff,
lightseagreen: 0x20b2aaff,
lightskyblue: 0x87cefaff,
lightslategray: 0x778899ff,
lightslategrey: 0x778899ff,
lightsteelblue: 0xb0c4deff,
lightyellow: 0xffffe0ff,
lime: 0x00ff00ff,
limegreen: 0x32cd32ff,
linen: 0xfaf0e6ff,
magenta: 0xff00ffff,
maroon: 0x800000ff,
mediumaquamarine: 0x66cdaaff,
mediumblue: 0x0000cdff,
mediumorchid: 0xba55d3ff,
mediumpurple: 0x9370dbff,
mediumseagreen: 0x3cb371ff,
mediumslateblue: 0x7b68eeff,
mediumspringgreen: 0x00fa9aff,
mediumturquoise: 0x48d1ccff,
mediumvioletred: 0xc71585ff,
midnightblue: 0x191970ff,
mintcream: 0xf5fffaff,
mistyrose: 0xffe4e1ff,
moccasin: 0xffe4b5ff,
navajowhite: 0xffdeadff,
navy: 0x000080ff,
oldlace: 0xfdf5e6ff,
olive: 0x808000ff,
olivedrab: 0x6b8e23ff,
orange: 0xffa500ff,
orangered: 0xff4500ff,
orchid: 0xda70d6ff,
palegoldenrod: 0xeee8aaff,
palegreen: 0x98fb98ff,
paleturquoise: 0xafeeeeff,
palevioletred: 0xdb7093ff,
papayawhip: 0xffefd5ff,
peachpuff: 0xffdab9ff,
peru: 0xcd853fff,
pink: 0xffc0cbff,
plum: 0xdda0ddff,
powderblue: 0xb0e0e6ff,
purple: 0x800080ff,
rebeccapurple: 0x663399ff,
red: 0xff0000ff,
rosybrown: 0xbc8f8fff,
royalblue: 0x4169e1ff,
saddlebrown: 0x8b4513ff,
salmon: 0xfa8072ff,
sandybrown: 0xf4a460ff,
seagreen: 0x2e8b57ff,
seashell: 0xfff5eeff,
sienna: 0xa0522dff,
silver: 0xc0c0c0ff,
skyblue: 0x87ceebff,
slateblue: 0x6a5acdff,
slategray: 0x708090ff,
slategrey: 0x708090ff,
snow: 0xfffafaff,
springgreen: 0x00ff7fff,
steelblue: 0x4682b4ff,
tan: 0xd2b48cff,
teal: 0x008080ff,
thistle: 0xd8bfd8ff,
tomato: 0xff6347ff,
turquoise: 0x40e0d0ff,
violet: 0xee82eeff,
wheat: 0xf5deb3ff,
white: 0xffffffff,
whitesmoke: 0xf5f5f5ff,
yellow: 0xffff00ff,
yellowgreen: 0x9acd32ff
}; // const INTEGER = '[-+]?\\d+';
var NUMBER = '[-+]?\\d*\\.?\\d+';
var PERCENTAGE = NUMBER + '%';
function call() {
for (var _len = arguments.length, parts = new Array(_len), _key = 0; _key < _len; _key++) {
parts[_key] = arguments[_key];
}
return '\\(\\s*(' + parts.join(')\\s*,\\s*(') + ')\\s*\\)';
}
var rgb = new RegExp('rgb' + call(NUMBER, NUMBER, NUMBER));
var rgba = new RegExp('rgba' + call(NUMBER, NUMBER, NUMBER, NUMBER));
var hsl = new RegExp('hsl' + call(NUMBER, PERCENTAGE, PERCENTAGE));
var hsla = new RegExp('hsla' + call(NUMBER, PERCENTAGE, PERCENTAGE, NUMBER));
var hex3 = /^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/;
var hex4 = /^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/;
var hex6 = /^#([0-9a-fA-F]{6})$/;
var hex8 = /^#([0-9a-fA-F]{8})$/;
/*
https://github.com/react-community/normalize-css-color
BSD 3-Clause License
Copyright (c) 2016, React Community
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of the copyright holder nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
function normalizeColor(color) {
var match;
if (typeof color === 'number') {
return color >>> 0 === color && color >= 0 && color <= 0xffffffff ? color : null;
} // Ordered based on occurrences on Facebook codebase
if (match = hex6.exec(color)) return parseInt(match[1] + 'ff', 16) >>> 0;
if (colors.hasOwnProperty(color)) return colors[color];
if (match = rgb.exec(color)) {
return (parse255(match[1]) << 24 | // r
parse255(match[2]) << 16 | // g
parse255(match[3]) << 8 | // b
0x000000ff) >>> // a
0;
}
if (match = rgba.exec(color)) {
return (parse255(match[1]) << 24 | // r
parse255(match[2]) << 16 | // g
parse255(match[3]) << 8 | // b
parse1(match[4])) >>> // a
0;
}
if (match = hex3.exec(color)) {
return parseInt(match[1] + match[1] + // r
match[2] + match[2] + // g
match[3] + match[3] + // b
'ff', // a
16) >>> 0;
} // https://drafts.csswg.org/css-color-4/#hex-notation
if (match = hex8.exec(color)) return parseInt(match[1], 16) >>> 0;
if (match = hex4.exec(color)) {
return parseInt(match[1] + match[1] + // r
match[2] + match[2] + // g
match[3] + match[3] + // b
match[4] + match[4], // a
16) >>> 0;
}
if (match = hsl.exec(color)) {
return (hslToRgb(parse360(match[1]), // h
parsePercentage(match[2]), // s
parsePercentage(match[3]) // l
) | 0x000000ff) >>> // a
0;
}
if (match = hsla.exec(color)) {
return (hslToRgb(parse360(match[1]), // h
parsePercentage(match[2]), // s
parsePercentage(match[3]) // l
) | parse1(match[4])) >>> // a
0;
}
return null;
}
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;
}
function hslToRgb(h, s, l) {
var q = l < 0.5 ? l * (1 + s) : l + s - l * s;
var p = 2 * l - q;
var r = hue2rgb(p, q, h + 1 / 3);
var g = hue2rgb(p, q, h);
var b = hue2rgb(p, q, h - 1 / 3);
return Math.round(r * 255) << 24 | Math.round(g * 255) << 16 | Math.round(b * 255) << 8;
}
function parse255(str) {
var int = parseInt(str, 10);
if (int < 0) return 0;
if (int > 255) return 255;
return int;
}
function parse360(str) {
var int = parseFloat(str);
return (int % 360 + 360) % 360 / 360;
}
function parse1(str) {
var num = parseFloat(str);
if (num < 0) return 0;
if (num > 1) return 255;
return Math.round(num * 255);
}
function parsePercentage(str) {
// parseFloat conveniently ignores the final %
var int = parseFloat(str);
if (int < 0) return 0;
if (int > 100) return 1;
return int / 100;
}
function colorToRgba(input) {
var int32Color = normalizeColor(input);
if (int32Color === null) return input;
int32Color = int32Color || 0;
var r = (int32Color & 0xff000000) >>> 24;
var g = (int32Color & 0x00ff0000) >>> 16;
var b = (int32Color & 0x0000ff00) >>> 8;
var a = (int32Color & 0x000000ff) / 255;
return "rgba(" + r + ", " + g + ", " + b + ", " + a + ")";
} // Problem: https://github.com/animatedjs/animated/pull/102
// Solution: https://stackoverflow.com/questions/638565/parsing-scientific-notation-sensibly/658662
var stringShapeRegex = /[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?/g; // Covers rgb, rgba, hsl, hsla
// Taken from https://gist.github.com/olmokramer/82ccce673f86db7cda5e
var colorRegex = /(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi; // Covers color names (transparent, blue, etc.)
var colorNamesRegex = new RegExp("(" + Object.keys(colors).join('|') + ")", 'g');
/**
* Supports string shapes by extracting numbers so new values can be computed,
* and recombines those values into new strings of the same shape. Supports
* things like:
*
* rgba(123, 42, 99, 0.36) // colors
* -45deg // values with units
* 0 2px 2px 0px rgba(0, 0, 0, 0.12) // box shadows
*/
var createStringInterpolator = function createStringInterpolator(config) {
// Replace colors with rgba
var outputRange = config.output.map(function (rangeValue) {
return rangeValue.replace(colorRegex, colorToRgba);
}).map(function (rangeValue) {
return rangeValue.replace(colorNamesRegex, colorToRgba);
});
var outputRanges = outputRange[0].match(stringShapeRegex).map(function () {
return [];
});
outputRange.forEach(function (value) {
value.match(stringShapeRegex).forEach(function (number, i) {
return outputRanges[i].push(+number);
});
});
var interpolations = outputRange[0].match(stringShapeRegex).map(function (_value, i) {
return createInterpolator(_extends({}, config, {
output: outputRanges[i]
}));
});
return function (input) {
var i = 0;
return outputRange[0] // 'rgba(0, 100, 200, 0)'
// ->
// 'rgba(${interpolations[0](input)}, ${interpolations[1](input)}, ...'
.replace(stringShapeRegex, function () {
return interpolations[i++](input);
}) // rgba requires that the r,g,b are integers.... so we want to round them, but we *dont* want to
// round the opacity (4th column).
.replace(/rgba\(([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+)\)/gi, function (_, p1, p2, p3, p4) {
return "rgba(" + Math.round(p1) + ", " + Math.round(p2) + ", " + Math.round(p3) + ", " + p4 + ")";
});
};
};
var isUnitlessNumber = {
animationIterationCount: true,
borderImageOutset: true,
borderImageSlice: true,
borderImageWidth: true,
boxFlex: true,
boxFlexGroup: true,
boxOrdinalGroup: true,
columnCount: true,
columns: true,
flex: true,
flexGrow: true,
flexPositive: true,
flexShrink: true,
flexNegative: true,
flexOrder: true,
gridRow: true,
gridRowEnd: true,
gridRowSpan: true,
gridRowStart: true,
gridColumn: true,
gridColumnEnd: true,
gridColumnSpan: true,
gridColumnStart: true,
fontWeight: true,
lineClamp: true,
lineHeight: true,
opacity: true,
order: true,
orphans: true,
tabSize: true,
widows: true,
zIndex: true,
zoom: true,
// SVG-related properties
fillOpacity: true,
floodOpacity: true,
stopOpacity: true,
strokeDasharray: true,
strokeDashoffset: true,
strokeMiterlimit: true,
strokeOpacity: true,
strokeWidth: true
};
var prefixKey = function prefixKey(prefix, key) {
return prefix + key.charAt(0).toUpperCase() + key.substring(1);
};
var prefixes = ['Webkit', 'Ms', 'Moz', 'O'];
isUnitlessNumber = Object.keys(isUnitlessNumber).reduce(function (acc, prop) {
prefixes.forEach(function (prefix) {
return acc[prefixKey(prefix, prop)] = acc[prop];
});
return acc;
}, isUnitlessNumber);
function dangerousStyleValue(name, value, isCustomProperty) {
if (value == null || typeof value === 'boolean' || value === '') return '';
if (!isCustomProperty && typeof value === 'number' && value !== 0 && !(isUnitlessNumber.hasOwnProperty(name) && isUnitlessNumber[name])) return value + 'px'; // Presumes implicit 'px' suffix for unitless numbers
return ('' + value).trim();
}
var attributeCache = {};
injectCreateAnimatedStyle(function (style) {
return new AnimatedStyle(style);
});
injectDefaultElement('div');
injectStringInterpolator(createStringInterpolator);
injectColorNames(colors);
injectApplyAnimatedValues(function (instance, props) {
if (instance.nodeType && instance.setAttribute !== undefined) {
var style = props.style,
children = props.children,
scrollTop = props.scrollTop,
scrollLeft = props.scrollLeft,
attributes = _objectWithoutPropertiesLoose(props, ["style", "children", "scrollTop", "scrollLeft"]);
var filter = instance.nodeName === 'filter' || instance.parentNode && instance.parentNode.nodeName === 'filter';
if (scrollTop !== void 0) instance.scrollTop = scrollTop;
if (scrollLeft !== void 0) instance.scrollLeft = scrollLeft; // Set textContent, if children is an animatable value
if (children !== void 0) instance.textContent = children; // Set styles ...
for (var styleName in style) {
if (!style.hasOwnProperty(styleName)) continue;
var isCustomProperty = styleName.indexOf('--') === 0;
var styleValue = dangerousStyleValue(styleName, style[styleName], isCustomProperty);
if (styleName === 'float') styleName = 'cssFloat';
if (isCustomProperty) instance.style.setProperty(styleName, styleValue);else instance.style[styleName] = styleValue;
} // Set attributes ...
for (var name in attributes) {
// Attributes are written in dash case
var dashCase = filter ? name : attributeCache[name] || (attributeCache[name] = name.replace(/([A-Z])/g, function (n) {
return '-' + n.toLowerCase();
}));
if (typeof instance.getAttribute(dashCase) !== 'undefined') instance.setAttribute(dashCase, attributes[name]);
}
return;
} else return false;
}, function (style) {
return style;
});
var domElements = ['a', 'abbr', 'address', 'area', 'article', 'aside', 'audio', 'b', 'base', 'bdi', 'bdo', 'big', 'blockquote', 'body', 'br', 'button', 'canvas', 'caption', 'cite', 'code', 'col', 'colgroup', 'data', 'datalist', 'dd', 'del', 'details', 'dfn', 'dialog', 'div', 'dl', 'dt', 'em', 'embed', 'fieldset', 'figcaption', 'figure', 'footer', 'form', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'header', 'hgroup', 'hr', 'html', 'i', 'iframe', 'img', 'input', 'ins', 'kbd', 'keygen', 'label', 'legend', 'li', 'link', 'main', 'map', 'mark', 'menu', 'menuitem', 'meta', 'meter', 'nav', 'noscript', 'object', 'ol', 'optgroup', 'option', 'output', 'p', 'param', 'picture', 'pre', 'progress', 'q', 'rp', 'rt', 'ruby', 's', 'samp', 'script', 'section', 'select', 'small', 'source', 'span', 'strong', 'style', 'sub', 'summary', 'sup', 'table', 'tbody', 'td', 'textarea', 'tfoot', 'th', 'thead', 'time', 'title', 'tr', 'track', 'u', 'ul', 'var', 'video', 'wbr', // SVG
'circle', 'clipPath', 'defs', 'ellipse', 'foreignObject', 'g', 'image', 'line', 'linearGradient', 'mask', 'path', 'pattern', 'polygon', 'polyline', 'radialGradient', 'rect', 'stop', 'svg', 'text', 'tspan']; // Extend animated with all the available THREE elements
var apply = merge(createAnimatedComponent, false);
var extendedAnimated = apply(domElements);
exports.apply = apply;
exports.config = config;
exports.update = update;
exports.animated = extendedAnimated;
exports.a = extendedAnimated;
exports.interpolate = interpolate$1;
exports.Globals = Globals;
exports.useSpring = useSpring;
exports.useTrail = useTrail;
exports.useTransition = useTransition;
exports.useChain = useChain;
exports.useSprings = useSprings;
/***/ }),
/***/ "./node_modules/react-with-direction/dist/constants.js":
/*!*************************************************************!*\
!*** ./node_modules/react-with-direction/dist/constants.js ***!
\*************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var CHANNEL = exports.CHANNEL = '__direction__';
var DIRECTIONS = exports.DIRECTIONS = {
LTR: 'ltr',
RTL: 'rtl'
};
/***/ }),
/***/ "./node_modules/react-with-direction/dist/proptypes/brcast.js":
/*!********************************************************************!*\
!*** ./node_modules/react-with-direction/dist/proptypes/brcast.js ***!
\********************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _propTypes = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js");
var _propTypes2 = _interopRequireDefault(_propTypes);
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
'default': obj
};
}
exports['default'] = _propTypes2['default'].shape({
getState: _propTypes2['default'].func,
setState: _propTypes2['default'].func,
subscribe: _propTypes2['default'].func
});
/***/ }),
/***/ "./node_modules/react-with-styles-interface-css/dist/index.js":
/*!********************************************************************!*\
!*** ./node_modules/react-with-styles-interface-css/dist/index.js ***!
\********************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
var _arrayPrototype = __webpack_require__(/*! array.prototype.flat */ "./node_modules/array.prototype.flat/index.js");
var _arrayPrototype2 = _interopRequireDefault(_arrayPrototype);
var _globalCache = __webpack_require__(/*! global-cache */ "./node_modules/global-cache/index.js");
var _globalCache2 = _interopRequireDefault(_globalCache);
var _constants = __webpack_require__(/*! ./utils/constants */ "./node_modules/react-with-styles-interface-css/dist/utils/constants.js");
var _getClassName = __webpack_require__(/*! ./utils/getClassName */ "./node_modules/react-with-styles-interface-css/dist/utils/getClassName.js");
var _getClassName2 = _interopRequireDefault(_getClassName);
var _separateStyles2 = __webpack_require__(/*! ./utils/separateStyles */ "./node_modules/react-with-styles-interface-css/dist/utils/separateStyles.js");
var _separateStyles3 = _interopRequireDefault(_separateStyles2);
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
'default': obj
};
}
/**
* Function required as part of the react-with-styles interface. Parses the styles provided by
* react-with-styles to produce class names based on the style name and optionally the namespace if
* available.
*
* stylesObject {Object} The styles object passed to withStyles.
*
* Return an object mapping style names to class names.
*/
function create(stylesObject) {
var stylesToClasses = {};
var styleNames = Object.keys(stylesObject);
var sharedState = _globalCache2['default'].get(_constants.GLOBAL_CACHE_KEY) || {};
var _sharedState$namespac = sharedState.namespace,
namespace = _sharedState$namespac === undefined ? '' : _sharedState$namespac;
styleNames.forEach(function (styleName) {
var className = (0, _getClassName2['default'])(namespace, styleName);
stylesToClasses[styleName] = className;
});
return stylesToClasses;
}
/**
* Process styles to be consumed by a component.
*
* stylesArray {Array} Array of the following: values returned by create, plain JavaScript objects
* representing inline styles, or arrays thereof.
*
* Return an object with optional className and style properties to be spread on a component.
*/
function resolve(stylesArray) {
var flattenedStyles = (0, _arrayPrototype2['default'])(stylesArray, Infinity);
var _separateStyles = (0, _separateStyles3['default'])(flattenedStyles),
classNames = _separateStyles.classNames,
hasInlineStyles = _separateStyles.hasInlineStyles,
inlineStyles = _separateStyles.inlineStyles;
var specificClassNames = classNames.map(function (name, index) {
return String(name) + ' ' + String(name) + '_' + String(index + 1);
});
var className = specificClassNames.join(' ');
var result = {
className: className
};
if (hasInlineStyles) result.style = inlineStyles;
return result;
}
exports['default'] = {
create: create,
resolve: resolve
};
/***/ }),
/***/ "./node_modules/react-with-styles-interface-css/dist/utils/constants.js":
/*!******************************************************************************!*\
!*** ./node_modules/react-with-styles-interface-css/dist/utils/constants.js ***!
\******************************************************************************/
/*! no static exports found */
/***/ (function(module, exports) {
Object.defineProperty(exports, "__esModule", {
value: true
});
var GLOBAL_CACHE_KEY = 'reactWithStylesInterfaceCSS';
var MAX_SPECIFICITY = 20;
exports.GLOBAL_CACHE_KEY = GLOBAL_CACHE_KEY;
exports.MAX_SPECIFICITY = MAX_SPECIFICITY;
/***/ }),
/***/ "./node_modules/react-with-styles-interface-css/dist/utils/getClassName.js":
/*!*********************************************************************************!*\
!*** ./node_modules/react-with-styles-interface-css/dist/utils/getClassName.js ***!
\*********************************************************************************/
/*! no static exports found */
/***/ (function(module, exports) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports['default'] = getClassName;
/**
* Construct a class name.
*
* namespace {String} Used to construct unique class names.
* styleName {String} Name identifying the specific style.
*
* Return the class name.
*/
function getClassName(namespace, styleName) {
var namespaceSegment = namespace.length > 0 ? String(namespace) + '__' : '';
return '' + namespaceSegment + String(styleName);
}
/***/ }),
/***/ "./node_modules/react-with-styles-interface-css/dist/utils/separateStyles.js":
/*!***********************************************************************************!*\
!*** ./node_modules/react-with-styles-interface-css/dist/utils/separateStyles.js ***!
\***********************************************************************************/
/*! no static exports found */
/***/ (function(module, exports) {
Object.defineProperty(exports, "__esModule", {
value: true
}); // This function takes an array of styles and separates them into styles that
// are handled by Aphrodite and inline styles.
function separateStyles(stylesArray) {
var classNames = []; // Since determining if an Object is empty requires collecting all of its
// keys, and we want the best performance in this code because we are in the
// render path, we are going to do a little bookkeeping ourselves.
var hasInlineStyles = false;
var inlineStyles = {}; // This is run on potentially every node in the tree when rendering, where
// performance is critical. Normally we would prefer using `forEach`, but
// old-fashioned for loops are faster so that's what we have chosen here.
for (var i = 0; i < stylesArray.length; i++) {
// eslint-disable-line no-plusplus
var style = stylesArray[i]; // If this style is falsy, we just want to disregard it. This allows for
// syntax like:
//
// css(isFoo && styles.foo)
if (style) {
if (typeof style === 'string') {
classNames.push(style);
} else {
Object.assign(inlineStyles, style);
hasInlineStyles = true;
}
}
}
return {
classNames: classNames,
hasInlineStyles: hasInlineStyles,
inlineStyles: inlineStyles
};
}
exports['default'] = separateStyles;
/***/ }),
/***/ "./node_modules/react-with-styles-interface-css/index.js":
/*!***************************************************************!*\
!*** ./node_modules/react-with-styles-interface-css/index.js ***!
\***************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
// eslint-disable-next-line import/no-unresolved
module.exports = __webpack_require__(/*! ./dist/index.js */ "./node_modules/react-with-styles-interface-css/dist/index.js").default;
/***/ }),
/***/ "./node_modules/react-with-styles/lib/ThemedStyleSheet.js":
/*!****************************************************************!*\
!*** ./node_modules/react-with-styles/lib/ThemedStyleSheet.js ***!
\****************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var styleInterface = void 0;
var styleTheme = void 0;
var START_MARK = 'react-with-styles.resolve.start';
var END_MARK = 'react-with-styles.resolve.end';
var MEASURE_MARK = '\uD83D\uDC69\u200D\uD83C\uDFA8 [resolve]';
function registerTheme(theme) {
styleTheme = theme;
}
function registerInterface(interfaceToRegister) {
styleInterface = interfaceToRegister;
}
function create(makeFromTheme, createWithDirection) {
var styles = createWithDirection(makeFromTheme(styleTheme));
return function () {
return styles;
};
}
function createLTR(makeFromTheme) {
return create(makeFromTheme, styleInterface.createLTR || styleInterface.create);
}
function createRTL(makeFromTheme) {
return create(makeFromTheme, styleInterface.createRTL || styleInterface.create);
}
function get() {
return styleTheme;
}
function resolve() {
if ( true && typeof performance !== 'undefined' && performance.mark !== undefined && typeof performance.clearMarks === 'function') {
performance.clearMarks(START_MARK);
performance.mark(START_MARK);
}
for (var _len = arguments.length, styles = Array(_len), _key = 0; _key < _len; _key++) {
styles[_key] = arguments[_key];
}
var result = styleInterface.resolve(styles);
if ( true && typeof performance !== 'undefined' && performance.mark !== undefined && typeof performance.clearMarks === 'function') {
performance.clearMarks(END_MARK);
performance.mark(END_MARK);
performance.measure(MEASURE_MARK, START_MARK, END_MARK);
performance.clearMarks(MEASURE_MARK);
}
return result;
}
function resolveLTR() {
for (var _len2 = arguments.length, styles = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
styles[_key2] = arguments[_key2];
}
if (styleInterface.resolveLTR) {
return styleInterface.resolveLTR(styles);
}
return resolve(styles);
}
function resolveRTL() {
for (var _len3 = arguments.length, styles = Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
styles[_key3] = arguments[_key3];
}
if (styleInterface.resolveRTL) {
return styleInterface.resolveRTL(styles);
}
return resolve(styles);
}
function flush() {
if (styleInterface.flush) {
styleInterface.flush();
}
}
exports['default'] = {
registerTheme: registerTheme,
registerInterface: registerInterface,
create: createLTR,
createLTR: createLTR,
createRTL: createRTL,
get: get,
resolve: resolveLTR,
resolveLTR: resolveLTR,
resolveRTL: resolveRTL,
flush: flush
};
/***/ }),
/***/ "./node_modules/react-with-styles/lib/withStyles.js":
/*!**********************************************************!*\
!*** ./node_modules/react-with-styles/lib/withStyles.js ***!
\**********************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.withStylesPropTypes = exports.css = 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;
};
}();
exports.withStyles = withStyles;
var _object = __webpack_require__(/*! object.assign */ "./node_modules/object.assign/index.js");
var _object2 = _interopRequireDefault(_object);
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 _hoistNonReactStatics = __webpack_require__(/*! hoist-non-react-statics */ "./node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js");
var _hoistNonReactStatics2 = _interopRequireDefault(_hoistNonReactStatics);
var _constants = __webpack_require__(/*! react-with-direction/dist/constants */ "./node_modules/react-with-direction/dist/constants.js");
var _brcast = __webpack_require__(/*! react-with-direction/dist/proptypes/brcast */ "./node_modules/react-with-direction/dist/proptypes/brcast.js");
var _brcast2 = _interopRequireDefault(_brcast);
var _ThemedStyleSheet = __webpack_require__(/*! ./ThemedStyleSheet */ "./node_modules/react-with-styles/lib/ThemedStyleSheet.js");
var _ThemedStyleSheet2 = _interopRequireDefault(_ThemedStyleSheet);
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;
}
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;
}
/* eslint react/forbid-foreign-prop-types: off */
// Add some named exports to assist in upgrading and for convenience
var css = exports.css = _ThemedStyleSheet2['default'].resolveLTR;
var withStylesPropTypes = exports.withStylesPropTypes = {
styles: _propTypes2['default'].object.isRequired,
// eslint-disable-line react/forbid-prop-types
theme: _propTypes2['default'].object.isRequired,
// eslint-disable-line react/forbid-prop-types
css: _propTypes2['default'].func.isRequired
};
var EMPTY_STYLES = {};
var EMPTY_STYLES_FN = function EMPTY_STYLES_FN() {
return EMPTY_STYLES;
};
var START_MARK = 'react-with-styles.createStyles.start';
var END_MARK = 'react-with-styles.createStyles.end';
function baseClass(pureComponent) {
if (pureComponent) {
if (!_react2['default'].PureComponent) {
throw new ReferenceError('withStyles() pureComponent option requires React 15.3.0 or later');
}
return _react2['default'].PureComponent;
}
return _react2['default'].Component;
}
var contextTypes = _defineProperty({}, _constants.CHANNEL, _brcast2['default']);
var defaultDirection = _constants.DIRECTIONS.LTR;
function withStyles(styleFn) {
var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
_ref$stylesPropName = _ref.stylesPropName,
stylesPropName = _ref$stylesPropName === undefined ? 'styles' : _ref$stylesPropName,
_ref$themePropName = _ref.themePropName,
themePropName = _ref$themePropName === undefined ? 'theme' : _ref$themePropName,
_ref$cssPropName = _ref.cssPropName,
cssPropName = _ref$cssPropName === undefined ? 'css' : _ref$cssPropName,
_ref$flushBefore = _ref.flushBefore,
flushBefore = _ref$flushBefore === undefined ? false : _ref$flushBefore,
_ref$pureComponent = _ref.pureComponent,
pureComponent = _ref$pureComponent === undefined ? false : _ref$pureComponent;
var styleDefLTR = void 0;
var styleDefRTL = void 0;
var currentThemeLTR = void 0;
var currentThemeRTL = void 0;
var BaseClass = baseClass(pureComponent);
function getResolveMethod(direction) {
return direction === _constants.DIRECTIONS.LTR ? _ThemedStyleSheet2['default'].resolveLTR : _ThemedStyleSheet2['default'].resolveRTL;
}
function getCurrentTheme(direction) {
return direction === _constants.DIRECTIONS.LTR ? currentThemeLTR : currentThemeRTL;
}
function getStyleDef(direction, wrappedComponentName) {
var currentTheme = getCurrentTheme(direction);
var styleDef = direction === _constants.DIRECTIONS.LTR ? styleDefLTR : styleDefRTL;
var registeredTheme = _ThemedStyleSheet2['default'].get(); // Return the existing styles if they've already been defined
// and if the theme used to create them corresponds to the theme
// registered with ThemedStyleSheet
if (styleDef && currentTheme === registeredTheme) {
return styleDef;
}
if ( true && typeof performance !== 'undefined' && performance.mark !== undefined && typeof performance.clearMarks === 'function') {
performance.clearMarks(START_MARK);
performance.mark(START_MARK);
}
var isRTL = direction === _constants.DIRECTIONS.RTL;
if (isRTL) {
styleDefRTL = styleFn ? _ThemedStyleSheet2['default'].createRTL(styleFn) : EMPTY_STYLES_FN;
currentThemeRTL = registeredTheme;
styleDef = styleDefRTL;
} else {
styleDefLTR = styleFn ? _ThemedStyleSheet2['default'].createLTR(styleFn) : EMPTY_STYLES_FN;
currentThemeLTR = registeredTheme;
styleDef = styleDefLTR;
}
if ( true && typeof performance !== 'undefined' && performance.mark !== undefined && typeof performance.clearMarks === 'function') {
performance.clearMarks(END_MARK);
performance.mark(END_MARK);
var measureName = '\uD83D\uDC69\u200D\uD83C\uDFA8 withStyles(' + String(wrappedComponentName) + ') [create styles]';
performance.measure(measureName, START_MARK, END_MARK);
performance.clearMarks(measureName);
}
return styleDef;
}
function getState(direction, wrappedComponentName) {
return {
resolveMethod: getResolveMethod(direction),
styleDef: getStyleDef(direction, wrappedComponentName)
};
}
return function () {
function withStylesHOC(WrappedComponent) {
var wrappedComponentName = WrappedComponent.displayName || WrappedComponent.name || 'Component'; // NOTE: Use a class here so components are ref-able if need be:
// eslint-disable-next-line react/prefer-stateless-function
var WithStyles = function (_BaseClass) {
_inherits(WithStyles, _BaseClass);
function WithStyles(props, context) {
_classCallCheck(this, WithStyles);
var _this = _possibleConstructorReturn(this, (WithStyles.__proto__ || Object.getPrototypeOf(WithStyles)).call(this, props, context));
var direction = _this.context[_constants.CHANNEL] ? _this.context[_constants.CHANNEL].getState() : defaultDirection;
_this.state = getState(direction, wrappedComponentName);
return _this;
}
_createClass(WithStyles, [{
key: 'componentDidMount',
value: function () {
function componentDidMount() {
var _this2 = this;
if (this.context[_constants.CHANNEL]) {
// subscribe to future direction changes
this.channelUnsubscribe = this.context[_constants.CHANNEL].subscribe(function (direction) {
_this2.setState(getState(direction, wrappedComponentName));
});
}
}
return componentDidMount;
}()
}, {
key: 'componentWillUnmount',
value: function () {
function componentWillUnmount() {
if (this.channelUnsubscribe) {
this.channelUnsubscribe();
}
}
return componentWillUnmount;
}()
}, {
key: 'render',
value: function () {
function render() {
var _ref2; // As some components will depend on previous styles in
// the component tree, we provide the option of flushing the
// buffered styles (i.e. to a style tag) **before** the rendering
// cycle begins.
//
// The interfaces provide the optional "flush" method which
// is run in turn by ThemedStyleSheet.flush.
if (flushBefore) {
_ThemedStyleSheet2['default'].flush();
}
var _state = this.state,
resolveMethod = _state.resolveMethod,
styleDef = _state.styleDef;
return _react2['default'].createElement(WrappedComponent, _extends({}, this.props, (_ref2 = {}, _defineProperty(_ref2, themePropName, _ThemedStyleSheet2['default'].get()), _defineProperty(_ref2, stylesPropName, styleDef()), _defineProperty(_ref2, cssPropName, resolveMethod), _ref2)));
}
return render;
}()
}]);
return WithStyles;
}(BaseClass);
WithStyles.WrappedComponent = WrappedComponent;
WithStyles.displayName = 'withStyles(' + String(wrappedComponentName) + ')';
WithStyles.contextTypes = contextTypes;
if (WrappedComponent.propTypes) {
WithStyles.propTypes = (0, _object2['default'])({}, WrappedComponent.propTypes);
delete WithStyles.propTypes[stylesPropName];
delete WithStyles.propTypes[themePropName];
delete WithStyles.propTypes[cssPropName];
}
if (WrappedComponent.defaultProps) {
WithStyles.defaultProps = (0, _object2['default'])({}, WrappedComponent.defaultProps);
}
return (0, _hoistNonReactStatics2['default'])(WithStyles, WrappedComponent);
}
return withStylesHOC;
}();
}
/***/ }),
/***/ "./node_modules/redux/es/redux.js":
/*!****************************************!*\
!*** ./node_modules/redux/es/redux.js ***!
\****************************************/
/*! exports provided: __DO_NOT_USE__ActionTypes, applyMiddleware, bindActionCreators, combineReducers, compose, createStore */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__DO_NOT_USE__ActionTypes", function() { return ActionTypes; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "applyMiddleware", function() { return applyMiddleware; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "bindActionCreators", function() { return bindActionCreators; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "combineReducers", function() { return combineReducers; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "compose", function() { return compose; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createStore", function() { return createStore; });
/* harmony import */ var symbol_observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! symbol-observable */ "./node_modules/symbol-observable/es/index.js");
/**
* These are private action types reserved by Redux.
* For any unknown actions, you must return the current state.
* If the current state is undefined, you must return the initial state.
* Do not reference these action types directly in your code.
*/
var randomString = function randomString() {
return Math.random().toString(36).substring(7).split('').join('.');
};
var ActionTypes = {
INIT: "@@redux/INIT" + randomString(),
REPLACE: "@@redux/REPLACE" + randomString(),
PROBE_UNKNOWN_ACTION: function PROBE_UNKNOWN_ACTION() {
return "@@redux/PROBE_UNKNOWN_ACTION" + randomString();
}
};
/**
* @param {any} obj The object to inspect.
* @returns {boolean} True if the argument appears to be a plain object.
*/
function isPlainObject(obj) {
if (typeof obj !== 'object' || obj === null) return false;
var proto = obj;
while (Object.getPrototypeOf(proto) !== null) {
proto = Object.getPrototypeOf(proto);
}
return Object.getPrototypeOf(obj) === proto;
}
/**
* Creates a Redux store that holds the state tree.
* The only way to change the data in the store is to call `dispatch()` on it.
*
* There should only be a single store in your app. To specify how different
* parts of the state tree respond to actions, you may combine several reducers
* into a single reducer function by using `combineReducers`.
*
* @param {Function} reducer A function that returns the next state tree, given
* the current state tree and the action to handle.
*
* @param {any} [preloadedState] The initial state. You may optionally specify it
* to hydrate the state from the server in universal apps, or to restore a
* previously serialized user session.
* If you use `combineReducers` to produce the root reducer function, this must be
* an object with the same shape as `combineReducers` keys.
*
* @param {Function} [enhancer] The store enhancer. You may optionally specify it
* to enhance the store with third-party capabilities such as middleware,
* time travel, persistence, etc. The only store enhancer that ships with Redux
* is `applyMiddleware()`.
*
* @returns {Store} A Redux store that lets you read the state, dispatch actions
* and subscribe to changes.
*/
function createStore(reducer, preloadedState, enhancer) {
var _ref2;
if (typeof preloadedState === 'function' && typeof enhancer === 'function' || typeof enhancer === 'function' && typeof arguments[3] === 'function') {
throw new Error('It looks like you are passing several store enhancers to ' + 'createStore(). This is not supported. Instead, compose them ' + 'together to a single function.');
}
if (typeof preloadedState === 'function' && typeof enhancer === 'undefined') {
enhancer = preloadedState;
preloadedState = undefined;
}
if (typeof enhancer !== 'undefined') {
if (typeof enhancer !== 'function') {
throw new Error('Expected the enhancer to be a function.');
}
return enhancer(createStore)(reducer, preloadedState);
}
if (typeof reducer !== 'function') {
throw new Error('Expected the reducer to be a function.');
}
var currentReducer = reducer;
var currentState = preloadedState;
var currentListeners = [];
var nextListeners = currentListeners;
var isDispatching = false;
/**
* This makes a shallow copy of currentListeners so we can use
* nextListeners as a temporary list while dispatching.
*
* This prevents any bugs around consumers calling
* subscribe/unsubscribe in the middle of a dispatch.
*/
function ensureCanMutateNextListeners() {
if (nextListeners === currentListeners) {
nextListeners = currentListeners.slice();
}
}
/**
* Reads the state tree managed by the store.
*
* @returns {any} The current state tree of your application.
*/
function getState() {
if (isDispatching) {
throw new Error('You may not call store.getState() while the reducer is executing. ' + 'The reducer has already received the state as an argument. ' + 'Pass it down from the top reducer instead of reading it from the store.');
}
return currentState;
}
/**
* Adds a change listener. It will be called any time an action is dispatched,
* and some part of the state tree may potentially have changed. You may then
* call `getState()` to read the current state tree inside the callback.
*
* You may call `dispatch()` from a change listener, with the following
* caveats:
*
* 1. The subscriptions are snapshotted just before every `dispatch()` call.
* If you subscribe or unsubscribe while the listeners are being invoked, this
* will not have any effect on the `dispatch()` that is currently in progress.
* However, the next `dispatch()` call, whether nested or not, will use a more
* recent snapshot of the subscription list.
*
* 2. The listener should not expect to see all state changes, as the state
* might have been updated multiple times during a nested `dispatch()` before
* the listener is called. It is, however, guaranteed that all subscribers
* registered before the `dispatch()` started will be called with the latest
* state by the time it exits.
*
* @param {Function} listener A callback to be invoked on every dispatch.
* @returns {Function} A function to remove this change listener.
*/
function subscribe(listener) {
if (typeof listener !== 'function') {
throw new Error('Expected the listener to be a function.');
}
if (isDispatching) {
throw new Error('You may not call store.subscribe() while the reducer is executing. ' + 'If you would like to be notified after the store has been updated, subscribe from a ' + 'component and invoke store.getState() in the callback to access the latest state. ' + 'See https://redux.js.org/api-reference/store#subscribe(listener) for more details.');
}
var isSubscribed = true;
ensureCanMutateNextListeners();
nextListeners.push(listener);
return function unsubscribe() {
if (!isSubscribed) {
return;
}
if (isDispatching) {
throw new Error('You may not unsubscribe from a store listener while the reducer is executing. ' + 'See https://redux.js.org/api-reference/store#subscribe(listener) for more details.');
}
isSubscribed = false;
ensureCanMutateNextListeners();
var index = nextListeners.indexOf(listener);
nextListeners.splice(index, 1);
};
}
/**
* Dispatches an action. It is the only way to trigger a state change.
*
* The `reducer` function, used to create the store, will be called with the
* current state tree and the given `action`. Its return value will
* be considered the **next** state of the tree, and the change listeners
* will be notified.
*
* The base implementation only supports plain object actions. If you want to
* dispatch a Promise, an Observable, a thunk, or something else, you need to
* wrap your store creating function into the corresponding middleware. For
* example, see the documentation for the `redux-thunk` package. Even the
* middleware will eventually dispatch plain object actions using this method.
*
* @param {Object} action A plain object representing “what changed”. It is
* a good idea to keep actions serializable so you can record and replay user
* sessions, or use the time travelling `redux-devtools`. An action must have
* a `type` property which may not be `undefined`. It is a good idea to use
* string constants for action types.
*
* @returns {Object} For convenience, the same action object you dispatched.
*
* Note that, if you use a custom middleware, it may wrap `dispatch()` to
* return something else (for example, a Promise you can await).
*/
function dispatch(action) {
if (!isPlainObject(action)) {
throw new Error('Actions must be plain objects. ' + 'Use custom middleware for async actions.');
}
if (typeof action.type === 'undefined') {
throw new Error('Actions may not have an undefined "type" property. ' + 'Have you misspelled a constant?');
}
if (isDispatching) {
throw new Error('Reducers may not dispatch actions.');
}
try {
isDispatching = true;
currentState = currentReducer(currentState, action);
} finally {
isDispatching = false;
}
var listeners = currentListeners = nextListeners;
for (var i = 0; i < listeners.length; i++) {
var listener = listeners[i];
listener();
}
return action;
}
/**
* Replaces the reducer currently used by the store to calculate the state.
*
* You might need this if your app implements code splitting and you want to
* load some of the reducers dynamically. You might also need this if you
* implement a hot reloading mechanism for Redux.
*
* @param {Function} nextReducer The reducer for the store to use instead.
* @returns {void}
*/
function replaceReducer(nextReducer) {
if (typeof nextReducer !== 'function') {
throw new Error('Expected the nextReducer to be a function.');
}
currentReducer = nextReducer; // This action has a similiar effect to ActionTypes.INIT.
// Any reducers that existed in both the new and old rootReducer
// will receive the previous state. This effectively populates
// the new state tree with any relevant data from the old one.
dispatch({
type: ActionTypes.REPLACE
});
}
/**
* Interoperability point for observable/reactive libraries.
* @returns {observable} A minimal observable of state changes.
* For more information, see the observable proposal:
* https://github.com/tc39/proposal-observable
*/
function observable() {
var _ref;
var outerSubscribe = subscribe;
return _ref = {
/**
* The minimal observable subscription method.
* @param {Object} observer Any object that can be used as an observer.
* The observer object should have a `next` method.
* @returns {subscription} An object with an `unsubscribe` method that can
* be used to unsubscribe the observable from the store, and prevent further
* emission of values from the observable.
*/
subscribe: function subscribe(observer) {
if (typeof observer !== 'object' || observer === null) {
throw new TypeError('Expected the observer to be an object.');
}
function observeState() {
if (observer.next) {
observer.next(getState());
}
}
observeState();
var unsubscribe = outerSubscribe(observeState);
return {
unsubscribe: unsubscribe
};
}
}, _ref[symbol_observable__WEBPACK_IMPORTED_MODULE_0__["default"]] = function () {
return this;
}, _ref;
} // When a store is created, an "INIT" action is dispatched so that every
// reducer returns their initial state. This effectively populates
// the initial state tree.
dispatch({
type: ActionTypes.INIT
});
return _ref2 = {
dispatch: dispatch,
subscribe: subscribe,
getState: getState,
replaceReducer: replaceReducer
}, _ref2[symbol_observable__WEBPACK_IMPORTED_MODULE_0__["default"]] = observable, _ref2;
}
/**
* Prints a warning in the console if it exists.
*
* @param {String} message The warning message.
* @returns {void}
*/
function warning(message) {
/* eslint-disable no-console */
if (typeof console !== 'undefined' && typeof console.error === 'function') {
console.error(message);
}
/* eslint-enable no-console */
try {
// This error was thrown as a convenience so that if you enable
// "break on all exceptions" in your console,
// it would pause the execution at this line.
throw new Error(message);
} catch (e) {} // eslint-disable-line no-empty
}
function getUndefinedStateErrorMessage(key, action) {
var actionType = action && action.type;
var actionDescription = actionType && "action \"" + String(actionType) + "\"" || 'an action';
return "Given " + actionDescription + ", reducer \"" + key + "\" returned undefined. " + "To ignore an action, you must explicitly return the previous state. " + "If you want this reducer to hold no value, you can return null instead of undefined.";
}
function getUnexpectedStateShapeWarningMessage(inputState, reducers, action, unexpectedKeyCache) {
var reducerKeys = Object.keys(reducers);
var argumentName = action && action.type === ActionTypes.INIT ? 'preloadedState argument passed to createStore' : 'previous state received by the reducer';
if (reducerKeys.length === 0) {
return 'Store does not have a valid reducer. Make sure the argument passed ' + 'to combineReducers is an object whose values are reducers.';
}
if (!isPlainObject(inputState)) {
return "The " + argumentName + " has unexpected type of \"" + {}.toString.call(inputState).match(/\s([a-z|A-Z]+)/)[1] + "\". Expected argument to be an object with the following " + ("keys: \"" + reducerKeys.join('", "') + "\"");
}
var unexpectedKeys = Object.keys(inputState).filter(function (key) {
return !reducers.hasOwnProperty(key) && !unexpectedKeyCache[key];
});
unexpectedKeys.forEach(function (key) {
unexpectedKeyCache[key] = true;
});
if (action && action.type === ActionTypes.REPLACE) return;
if (unexpectedKeys.length > 0) {
return "Unexpected " + (unexpectedKeys.length > 1 ? 'keys' : 'key') + " " + ("\"" + unexpectedKeys.join('", "') + "\" found in " + argumentName + ". ") + "Expected to find one of the known reducer keys instead: " + ("\"" + reducerKeys.join('", "') + "\". Unexpected keys will be ignored.");
}
}
function assertReducerShape(reducers) {
Object.keys(reducers).forEach(function (key) {
var reducer = reducers[key];
var initialState = reducer(undefined, {
type: ActionTypes.INIT
});
if (typeof initialState === 'undefined') {
throw new Error("Reducer \"" + key + "\" returned undefined during initialization. " + "If the state passed to the reducer is undefined, you must " + "explicitly return the initial state. The initial state may " + "not be undefined. If you don't want to set a value for this reducer, " + "you can use null instead of undefined.");
}
if (typeof reducer(undefined, {
type: ActionTypes.PROBE_UNKNOWN_ACTION()
}) === 'undefined') {
throw new Error("Reducer \"" + key + "\" returned undefined when probed with a random type. " + ("Don't try to handle " + ActionTypes.INIT + " or other actions in \"redux/*\" ") + "namespace. They are considered private. Instead, you must return the " + "current state for any unknown actions, unless it is undefined, " + "in which case you must return the initial state, regardless of the " + "action type. The initial state may not be undefined, but can be null.");
}
});
}
/**
* Turns an object whose values are different reducer functions, into a single
* reducer function. It will call every child reducer, and gather their results
* into a single state object, whose keys correspond to the keys of the passed
* reducer functions.
*
* @param {Object} reducers An object whose values correspond to different
* reducer functions that need to be combined into one. One handy way to obtain
* it is to use ES6 `import * as reducers` syntax. The reducers may never return
* undefined for any action. Instead, they should return their initial state
* if the state passed to them was undefined, and the current state for any
* unrecognized action.
*
* @returns {Function} A reducer function that invokes every reducer inside the
* passed object, and builds a state object with the same shape.
*/
function combineReducers(reducers) {
var reducerKeys = Object.keys(reducers);
var finalReducers = {};
for (var i = 0; i < reducerKeys.length; i++) {
var key = reducerKeys[i];
if (true) {
if (typeof reducers[key] === 'undefined') {
warning("No reducer provided for key \"" + key + "\"");
}
}
if (typeof reducers[key] === 'function') {
finalReducers[key] = reducers[key];
}
}
var finalReducerKeys = Object.keys(finalReducers); // This is used to make sure we don't warn about the same
// keys multiple times.
var unexpectedKeyCache;
if (true) {
unexpectedKeyCache = {};
}
var shapeAssertionError;
try {
assertReducerShape(finalReducers);
} catch (e) {
shapeAssertionError = e;
}
return function combination(state, action) {
if (state === void 0) {
state = {};
}
if (shapeAssertionError) {
throw shapeAssertionError;
}
if (true) {
var warningMessage = getUnexpectedStateShapeWarningMessage(state, finalReducers, action, unexpectedKeyCache);
if (warningMessage) {
warning(warningMessage);
}
}
var hasChanged = false;
var nextState = {};
for (var _i = 0; _i < finalReducerKeys.length; _i++) {
var _key = finalReducerKeys[_i];
var reducer = finalReducers[_key];
var previousStateForKey = state[_key];
var nextStateForKey = reducer(previousStateForKey, action);
if (typeof nextStateForKey === 'undefined') {
var errorMessage = getUndefinedStateErrorMessage(_key, action);
throw new Error(errorMessage);
}
nextState[_key] = nextStateForKey;
hasChanged = hasChanged || nextStateForKey !== previousStateForKey;
}
return hasChanged ? nextState : state;
};
}
function bindActionCreator(actionCreator, dispatch) {
return function () {
return dispatch(actionCreator.apply(this, arguments));
};
}
/**
* Turns an object whose values are action creators, into an object with the
* same keys, but with every function wrapped into a `dispatch` call so they
* may be invoked directly. This is just a convenience method, as you can call
* `store.dispatch(MyActionCreators.doSomething())` yourself just fine.
*
* For convenience, you can also pass an action creator as the first argument,
* and get a dispatch wrapped function in return.
*
* @param {Function|Object} actionCreators An object whose values are action
* creator functions. One handy way to obtain it is to use ES6 `import * as`
* syntax. You may also pass a single function.
*
* @param {Function} dispatch The `dispatch` function available on your Redux
* store.
*
* @returns {Function|Object} The object mimicking the original object, but with
* every action creator wrapped into the `dispatch` call. If you passed a
* function as `actionCreators`, the return value will also be a single
* function.
*/
function bindActionCreators(actionCreators, dispatch) {
if (typeof actionCreators === 'function') {
return bindActionCreator(actionCreators, dispatch);
}
if (typeof actionCreators !== 'object' || actionCreators === null) {
throw new Error("bindActionCreators expected an object or a function, instead received " + (actionCreators === null ? 'null' : typeof actionCreators) + ". " + "Did you write \"import ActionCreators from\" instead of \"import * as ActionCreators from\"?");
}
var boundActionCreators = {};
for (var key in actionCreators) {
var actionCreator = actionCreators[key];
if (typeof actionCreator === 'function') {
boundActionCreators[key] = bindActionCreator(actionCreator, dispatch);
}
}
return boundActionCreators;
}
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 ownKeys(object, enumerableOnly) {
var keys = Object.keys(object);
if (Object.getOwnPropertySymbols) {
keys.push.apply(keys, Object.getOwnPropertySymbols(object));
}
if (enumerableOnly) keys = keys.filter(function (sym) {
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
});
return keys;
}
function _objectSpread2(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i] != null ? arguments[i] : {};
if (i % 2) {
ownKeys(source, true).forEach(function (key) {
_defineProperty(target, key, source[key]);
});
} else if (Object.getOwnPropertyDescriptors) {
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
} else {
ownKeys(source).forEach(function (key) {
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
});
}
}
return target;
}
/**
* Composes single-argument functions from right to left. The rightmost
* function can take multiple arguments as it provides the signature for
* the resulting composite function.
*
* @param {...Function} funcs The functions to compose.
* @returns {Function} A function obtained by composing the argument functions
* from right to left. For example, compose(f, g, h) is identical to doing
* (...args) => f(g(h(...args))).
*/
function compose() {
for (var _len = arguments.length, funcs = new Array(_len), _key = 0; _key < _len; _key++) {
funcs[_key] = arguments[_key];
}
if (funcs.length === 0) {
return function (arg) {
return arg;
};
}
if (funcs.length === 1) {
return funcs[0];
}
return funcs.reduce(function (a, b) {
return function () {
return a(b.apply(void 0, arguments));
};
});
}
/**
* Creates a store enhancer that applies middleware to the dispatch method
* of the Redux store. This is handy for a variety of tasks, such as expressing
* asynchronous actions in a concise manner, or logging every action payload.
*
* See `redux-thunk` package as an example of the Redux middleware.
*
* Because middleware is potentially asynchronous, this should be the first
* store enhancer in the composition chain.
*
* Note that each middleware will be given the `dispatch` and `getState` functions
* as named arguments.
*
* @param {...Function} middlewares The middleware chain to be applied.
* @returns {Function} A store enhancer applying the middleware.
*/
function applyMiddleware() {
for (var _len = arguments.length, middlewares = new Array(_len), _key = 0; _key < _len; _key++) {
middlewares[_key] = arguments[_key];
}
return function (createStore) {
return function () {
var store = createStore.apply(void 0, arguments);
var _dispatch = function dispatch() {
throw new Error('Dispatching while constructing your middleware is not allowed. ' + 'Other middleware would not be applied to this dispatch.');
};
var middlewareAPI = {
getState: store.getState,
dispatch: function dispatch() {
return _dispatch.apply(void 0, arguments);
}
};
var chain = middlewares.map(function (middleware) {
return middleware(middlewareAPI);
});
_dispatch = compose.apply(void 0, chain)(store.dispatch);
return _objectSpread2({}, store, {
dispatch: _dispatch
});
};
};
}
/*
* This is a dummy function to check if the function name has been altered by minification.
* If the function has been minified and NODE_ENV !== 'production', warn the user.
*/
function isCrushed() {}
if ( true && typeof isCrushed.name === 'string' && isCrushed.name !== 'isCrushed') {
warning('You are currently using minified code outside of NODE_ENV === "production". ' + 'This means that you are running a slower development build of Redux. ' + 'You can use loose-envify (https://github.com/zertosh/loose-envify) for browserify ' + 'or setting mode to production in webpack (https://webpack.js.org/concepts/mode/) ' + 'to ensure you have the correct code for your production build.');
}
/***/ }),
/***/ "./node_modules/regenerator-runtime/runtime.js":
/*!*****************************************************!*\
!*** ./node_modules/regenerator-runtime/runtime.js ***!
\*****************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
/**
* 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 runtime = function (exports) {
"use strict";
var Op = Object.prototype;
var hasOwn = Op.hasOwnProperty;
var undefined; // More compressible than void 0.
var $Symbol = typeof Symbol === "function" ? Symbol : {};
var iteratorSymbol = $Symbol.iterator || "@@iterator";
var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator";
var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
function wrap(innerFn, outerFn, self, tryLocsList) {
// If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.
var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;
var generator = Object.create(protoGenerator.prototype);
var context = new Context(tryLocsList || []); // The ._invoke method unifies the implementations of the .next,
// .throw, and .return methods.
generator._invoke = makeInvokeMethod(innerFn, self, context);
return generator;
}
exports.wrap = wrap; // Try/catch helper to minimize deoptimizations. Returns a completion
// record like context.tryEntries[i].completion. This interface could
// have been (and was previously) designed to take a closure to be
// invoked without arguments, but in all the cases we care about we
// already have an existing method we want to call, so there's no need
// to create a new function object. We can even get away with assuming
// the method takes exactly one argument, since that happens to be true
// in every case, so we don't have to touch the arguments object. The
// only additional allocation required is the completion record, which
// has a stable shape and so hopefully should be cheap to allocate.
function tryCatch(fn, obj, arg) {
try {
return {
type: "normal",
arg: fn.call(obj, arg)
};
} catch (err) {
return {
type: "throw",
arg: err
};
}
}
var GenStateSuspendedStart = "suspendedStart";
var GenStateSuspendedYield = "suspendedYield";
var GenStateExecuting = "executing";
var GenStateCompleted = "completed"; // Returning this object from the innerFn has the same effect as
// breaking out of the dispatch switch statement.
var ContinueSentinel = {}; // Dummy constructor functions that we use as the .constructor and
// .constructor.prototype properties for functions that return Generator
// objects. For full spec compliance, you may wish to configure your
// minifier not to mangle the names of these two functions.
function Generator() {}
function GeneratorFunction() {}
function GeneratorFunctionPrototype() {} // This is a polyfill for %IteratorPrototype% for environments that
// don't natively support it.
var IteratorPrototype = {};
IteratorPrototype[iteratorSymbol] = function () {
return this;
};
var getProto = Object.getPrototypeOf;
var NativeIteratorPrototype = getProto && getProto(getProto(values([])));
if (NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {
// This environment has a native %IteratorPrototype%; use it instead
// of the polyfill.
IteratorPrototype = NativeIteratorPrototype;
}
var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);
GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype;
GeneratorFunctionPrototype.constructor = GeneratorFunction;
GeneratorFunctionPrototype[toStringTagSymbol] = GeneratorFunction.displayName = "GeneratorFunction"; // Helper for defining the .next, .throw, and .return methods of the
// Iterator interface in terms of a single ._invoke method.
function defineIteratorMethods(prototype) {
["next", "throw", "return"].forEach(function (method) {
prototype[method] = function (arg) {
return this._invoke(method, arg);
};
});
}
exports.isGeneratorFunction = function (genFun) {
var ctor = typeof genFun === "function" && genFun.constructor;
return ctor ? ctor === GeneratorFunction || // For the native GeneratorFunction constructor, the best we can
// do is to check its .name property.
(ctor.displayName || ctor.name) === "GeneratorFunction" : false;
};
exports.mark = function (genFun) {
if (Object.setPrototypeOf) {
Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);
} else {
genFun.__proto__ = GeneratorFunctionPrototype;
if (!(toStringTagSymbol in genFun)) {
genFun[toStringTagSymbol] = "GeneratorFunction";
}
}
genFun.prototype = Object.create(Gp);
return genFun;
}; // Within the body of any async function, `await x` is transformed to
// `yield regeneratorRuntime.awrap(x)`, so that the runtime can test
// `hasOwn.call(value, "__await")` to determine if the yielded value is
// meant to be awaited.
exports.awrap = function (arg) {
return {
__await: arg
};
};
function AsyncIterator(generator) {
function invoke(method, arg, resolve, reject) {
var record = tryCatch(generator[method], generator, arg);
if (record.type === "throw") {
reject(record.arg);
} else {
var result = record.arg;
var value = result.value;
if (value && typeof value === "object" && hasOwn.call(value, "__await")) {
return Promise.resolve(value.__await).then(function (value) {
invoke("next", value, resolve, reject);
}, function (err) {
invoke("throw", err, resolve, reject);
});
}
return Promise.resolve(value).then(function (unwrapped) {
// When a yielded Promise is resolved, its final value becomes
// the .value of the Promise<{value,done}> result for the
// current iteration.
result.value = unwrapped;
resolve(result);
}, function (error) {
// If a rejected Promise was yielded, throw the rejection back
// into the async generator function so it can be handled there.
return invoke("throw", error, resolve, reject);
});
}
}
var previousPromise;
function enqueue(method, arg) {
function callInvokeWithMethodAndArg() {
return new Promise(function (resolve, reject) {
invoke(method, arg, resolve, reject);
});
}
return previousPromise = // If enqueue has been called before, then we want to wait until
// all previous Promises have been resolved before calling invoke,
// so that results are always delivered in the correct order. If
// enqueue has not been called before, then it is important to
// call invoke immediately, without waiting on a callback to fire,
// so that the async generator function has the opportunity to do
// any necessary setup in a predictable way. This predictability
// is why the Promise constructor synchronously invokes its
// executor callback, and why async functions synchronously
// execute code before the first await. Since we implement simple
// async functions in terms of async generators, it is especially
// important to get this right, even though it requires care.
previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, // Avoid propagating failures to Promises returned by later
// invocations of the iterator.
callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
} // Define the unified helper method that is used to implement .next,
// .throw, and .return (see defineIteratorMethods).
this._invoke = enqueue;
}
defineIteratorMethods(AsyncIterator.prototype);
AsyncIterator.prototype[asyncIteratorSymbol] = function () {
return this;
};
exports.AsyncIterator = AsyncIterator; // Note that simple async functions are implemented on top of
// AsyncIterator objects; they just return a Promise for the value of
// the final result produced by the iterator.
exports.async = function (innerFn, outerFn, self, tryLocsList) {
var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList));
return exports.isGeneratorFunction(outerFn) ? iter // If outerFn is a generator, return the full iterator.
: iter.next().then(function (result) {
return result.done ? result.value : iter.next();
});
};
function makeInvokeMethod(innerFn, self, context) {
var state = GenStateSuspendedStart;
return function invoke(method, arg) {
if (state === GenStateExecuting) {
throw new Error("Generator is already running");
}
if (state === GenStateCompleted) {
if (method === "throw") {
throw arg;
} // Be forgiving, per 25.3.3.3.3 of the spec:
// https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume
return doneResult();
}
context.method = method;
context.arg = arg;
while (true) {
var delegate = context.delegate;
if (delegate) {
var delegateResult = maybeInvokeDelegate(delegate, context);
if (delegateResult) {
if (delegateResult === ContinueSentinel) continue;
return delegateResult;
}
}
if (context.method === "next") {
// Setting context._sent for legacy support of Babel's
// function.sent implementation.
context.sent = context._sent = context.arg;
} else if (context.method === "throw") {
if (state === GenStateSuspendedStart) {
state = GenStateCompleted;
throw context.arg;
}
context.dispatchException(context.arg);
} else if (context.method === "return") {
context.abrupt("return", context.arg);
}
state = GenStateExecuting;
var record = tryCatch(innerFn, self, context);
if (record.type === "normal") {
// If an exception is thrown from innerFn, we leave state ===
// GenStateExecuting and loop back for another invocation.
state = context.done ? GenStateCompleted : GenStateSuspendedYield;
if (record.arg === ContinueSentinel) {
continue;
}
return {
value: record.arg,
done: context.done
};
} else if (record.type === "throw") {
state = GenStateCompleted; // Dispatch the exception by looping back around to the
// context.dispatchException(context.arg) call above.
context.method = "throw";
context.arg = record.arg;
}
}
};
} // Call delegate.iterator[context.method](context.arg) and handle the
// result, either by returning a { value, done } result from the
// delegate iterator, or by modifying context.method and context.arg,
// setting context.delegate to null, and returning the ContinueSentinel.
function maybeInvokeDelegate(delegate, context) {
var method = delegate.iterator[context.method];
if (method === undefined) {
// A .throw or .return when the delegate iterator has no .throw
// method always terminates the yield* loop.
context.delegate = null;
if (context.method === "throw") {
// Note: ["return"] must be used for ES3 parsing compatibility.
if (delegate.iterator["return"]) {
// If the delegate iterator has a return method, give it a
// chance to clean up.
context.method = "return";
context.arg = undefined;
maybeInvokeDelegate(delegate, context);
if (context.method === "throw") {
// If maybeInvokeDelegate(context) changed context.method from
// "return" to "throw", let that override the TypeError below.
return ContinueSentinel;
}
}
context.method = "throw";
context.arg = new TypeError("The iterator does not provide a 'throw' method");
}
return ContinueSentinel;
}
var record = tryCatch(method, delegate.iterator, context.arg);
if (record.type === "throw") {
context.method = "throw";
context.arg = record.arg;
context.delegate = null;
return ContinueSentinel;
}
var info = record.arg;
if (!info) {
context.method = "throw";
context.arg = new TypeError("iterator result is not an object");
context.delegate = null;
return ContinueSentinel;
}
if (info.done) {
// Assign the result of the finished delegate to the temporary
// variable specified by delegate.resultName (see delegateYield).
context[delegate.resultName] = info.value; // Resume execution at the desired location (see delegateYield).
context.next = delegate.nextLoc; // If context.method was "throw" but the delegate handled the
// exception, let the outer generator proceed normally. If
// context.method was "next", forget context.arg since it has been
// "consumed" by the delegate iterator. If context.method was
// "return", allow the original .return call to continue in the
// outer generator.
if (context.method !== "return") {
context.method = "next";
context.arg = undefined;
}
} else {
// Re-yield the result returned by the delegate method.
return info;
} // The delegate iterator is finished, so forget it and continue with
// the outer generator.
context.delegate = null;
return ContinueSentinel;
} // Define Generator.prototype.{next,throw,return} in terms of the
// unified ._invoke helper method.
defineIteratorMethods(Gp);
Gp[toStringTagSymbol] = "Generator"; // A Generator should always return itself as the iterator object when the
// @@iterator function is called on it. Some browsers' implementations of the
// iterator prototype chain incorrectly implement this, causing the Generator
// object to not be returned from this call. This ensures that doesn't happen.
// See https://github.com/facebook/regenerator/issues/274 for more details.
Gp[iteratorSymbol] = function () {
return this;
};
Gp.toString = function () {
return "[object Generator]";
};
function pushTryEntry(locs) {
var entry = {
tryLoc: locs[0]
};
if (1 in locs) {
entry.catchLoc = locs[1];
}
if (2 in locs) {
entry.finallyLoc = locs[2];
entry.afterLoc = locs[3];
}
this.tryEntries.push(entry);
}
function resetTryEntry(entry) {
var record = entry.completion || {};
record.type = "normal";
delete record.arg;
entry.completion = record;
}
function Context(tryLocsList) {
// The root entry object (effectively a try statement without a catch
// or a finally block) gives us a place to store values thrown from
// locations where there is no enclosing try statement.
this.tryEntries = [{
tryLoc: "root"
}];
tryLocsList.forEach(pushTryEntry, this);
this.reset(true);
}
exports.keys = function (object) {
var keys = [];
for (var key in object) {
keys.push(key);
}
keys.reverse(); // Rather than returning an object with a next method, we keep
// things simple and return the next function itself.
return function next() {
while (keys.length) {
var key = keys.pop();
if (key in object) {
next.value = key;
next.done = false;
return next;
}
} // To avoid creating an additional object, we just hang the .value
// and .done properties off the next function object itself. This
// also ensures that the minifier will not anonymize the function.
next.done = true;
return next;
};
};
function values(iterable) {
if (iterable) {
var iteratorMethod = iterable[iteratorSymbol];
if (iteratorMethod) {
return iteratorMethod.call(iterable);
}
if (typeof iterable.next === "function") {
return iterable;
}
if (!isNaN(iterable.length)) {
var i = -1,
next = function next() {
while (++i < iterable.length) {
if (hasOwn.call(iterable, i)) {
next.value = iterable[i];
next.done = false;
return next;
}
}
next.value = undefined;
next.done = true;
return next;
};
return next.next = next;
}
} // Return an iterator with no values.
return {
next: doneResult
};
}
exports.values = values;
function doneResult() {
return {
value: undefined,
done: true
};
}
Context.prototype = {
constructor: Context,
reset: function (skipTempReset) {
this.prev = 0;
this.next = 0; // Resetting context._sent for legacy support of Babel's
// function.sent implementation.
this.sent = this._sent = undefined;
this.done = false;
this.delegate = null;
this.method = "next";
this.arg = undefined;
this.tryEntries.forEach(resetTryEntry);
if (!skipTempReset) {
for (var name in this) {
// Not sure about the optimal order of these conditions:
if (name.charAt(0) === "t" && hasOwn.call(this, name) && !isNaN(+name.slice(1))) {
this[name] = undefined;
}
}
}
},
stop: function () {
this.done = true;
var rootEntry = this.tryEntries[0];
var rootRecord = rootEntry.completion;
if (rootRecord.type === "throw") {
throw rootRecord.arg;
}
return this.rval;
},
dispatchException: function (exception) {
if (this.done) {
throw exception;
}
var context = this;
function handle(loc, caught) {
record.type = "throw";
record.arg = exception;
context.next = loc;
if (caught) {
// If the dispatched exception was caught by a catch block,
// then let that catch block handle the exception normally.
context.method = "next";
context.arg = undefined;
}
return !!caught;
}
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
var entry = this.tryEntries[i];
var record = entry.completion;
if (entry.tryLoc === "root") {
// Exception thrown outside of any try block that could handle
// it, so set the completion value of the entire function to
// throw the exception.
return handle("end");
}
if (entry.tryLoc <= this.prev) {
var hasCatch = hasOwn.call(entry, "catchLoc");
var hasFinally = hasOwn.call(entry, "finallyLoc");
if (hasCatch && hasFinally) {
if (this.prev < entry.catchLoc) {
return handle(entry.catchLoc, true);
} else if (this.prev < entry.finallyLoc) {
return handle(entry.finallyLoc);
}
} else if (hasCatch) {
if (this.prev < entry.catchLoc) {
return handle(entry.catchLoc, true);
}
} else if (hasFinally) {
if (this.prev < entry.finallyLoc) {
return handle(entry.finallyLoc);
}
} else {
throw new Error("try statement without catch or finally");
}
}
}
},
abrupt: function (type, arg) {
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
var entry = this.tryEntries[i];
if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) {
var finallyEntry = entry;
break;
}
}
if (finallyEntry && (type === "break" || type === "continue") && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc) {
// Ignore the finally entry if control is not jumping to a
// location outside the try/catch block.
finallyEntry = null;
}
var record = finallyEntry ? finallyEntry.completion : {};
record.type = type;
record.arg = arg;
if (finallyEntry) {
this.method = "next";
this.next = finallyEntry.finallyLoc;
return ContinueSentinel;
}
return this.complete(record);
},
complete: function (record, afterLoc) {
if (record.type === "throw") {
throw record.arg;
}
if (record.type === "break" || record.type === "continue") {
this.next = record.arg;
} else if (record.type === "return") {
this.rval = this.arg = record.arg;
this.method = "return";
this.next = "end";
} else if (record.type === "normal" && afterLoc) {
this.next = afterLoc;
}
return ContinueSentinel;
},
finish: function (finallyLoc) {
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
var entry = this.tryEntries[i];
if (entry.finallyLoc === finallyLoc) {
this.complete(entry.completion, entry.afterLoc);
resetTryEntry(entry);
return ContinueSentinel;
}
}
},
"catch": function (tryLoc) {
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
var entry = this.tryEntries[i];
if (entry.tryLoc === tryLoc) {
var record = entry.completion;
if (record.type === "throw") {
var thrown = record.arg;
resetTryEntry(entry);
}
return thrown;
}
} // The context.catch method must only be called with a location
// argument that corresponds to a known catch block.
throw new Error("illegal catch attempt");
},
delegateYield: function (iterable, resultName, nextLoc) {
this.delegate = {
iterator: values(iterable),
resultName: resultName,
nextLoc: nextLoc
};
if (this.method === "next") {
// Deliberately forget the last sent value so that we don't
// accidentally pass it on to the delegate.
this.arg = undefined;
}
return ContinueSentinel;
}
}; // Regardless of whether this script is executing as a CommonJS module
// or not, return the runtime object so that we can declare the variable
// regeneratorRuntime in the outer scope, which allows this module to be
// injected easily by `bin/regenerator --include-runtime script.js`.
return exports;
}( // If this script is executing as a CommonJS module, use module.exports
// as the regeneratorRuntime namespace. Otherwise create a new empty
// object. Either way, the resulting object will be used to initialize
// the regeneratorRuntime variable at the top of this file.
true ? module.exports : undefined);
try {
regeneratorRuntime = runtime;
} catch (accidentalStrictMode) {
// This module should not be running in strict mode, so the above
// assignment should always work unless something is misconfigured. Just
// in case runtime.js accidentally runs in strict mode, we can escape
// strict mode using a global Function call. This could conceivably fail
// if a Content Security Policy forbids using Function, but in that case
// the proper solution is to fix the accidental strict mode problem. If
// you've misconfigured your bundler to force strict mode and applied a
// CSP to forbid Function, and you're not willing to fix either of those
// problems, please detail your unique predicament in a GitHub issue.
Function("r", "regeneratorRuntime = r")(runtime);
}
/***/ }),
/***/ "./node_modules/rememo/es/rememo.js":
/*!******************************************!*\
!*** ./node_modules/rememo/es/rememo.js ***!
\******************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
var LEAF_KEY, hasWeakMap;
/**
* Arbitrary value used as key for referencing cache object in WeakMap tree.
*
* @type {Object}
*/
LEAF_KEY = {};
/**
* Whether environment supports WeakMap.
*
* @type {boolean}
*/
hasWeakMap = typeof WeakMap !== 'undefined';
/**
* Returns the first argument as the sole entry in an array.
*
* @param {*} value Value to return.
*
* @return {Array} Value returned as entry in array.
*/
function arrayOf(value) {
return [value];
}
/**
* Returns true if the value passed is object-like, or false otherwise. A value
* is object-like if it can support property assignment, e.g. object or array.
*
* @param {*} value Value to test.
*
* @return {boolean} Whether value is object-like.
*/
function isObjectLike(value) {
return !!value && 'object' === typeof value;
}
/**
* Creates and returns a new cache object.
*
* @return {Object} Cache object.
*/
function createCache() {
var cache = {
clear: function () {
cache.head = null;
}
};
return cache;
}
/**
* Returns true if entries within the two arrays are strictly equal by
* reference from a starting index.
*
* @param {Array} a First array.
* @param {Array} b Second array.
* @param {number} fromIndex Index from which to start comparison.
*
* @return {boolean} Whether arrays are shallowly equal.
*/
function isShallowEqual(a, b, fromIndex) {
var i;
if (a.length !== b.length) {
return false;
}
for (i = fromIndex; i < a.length; i++) {
if (a[i] !== b[i]) {
return false;
}
}
return true;
}
/**
* Returns a memoized selector function. The getDependants function argument is
* called before the memoized selector and is expected to return an immutable
* reference or array of references on which the selector depends for computing
* its own return value. The memoize cache is preserved only as long as those
* dependant references remain the same. If getDependants returns a different
* reference(s), the cache is cleared and the selector value regenerated.
*
* @param {Function} selector Selector function.
* @param {Function} getDependants Dependant getter returning an immutable
* reference or array of reference used in
* cache bust consideration.
*
* @return {Function} Memoized selector.
*/
/* harmony default export */ __webpack_exports__["default"] = (function (selector, getDependants) {
var rootCache, getCache; // Use object source as dependant if getter not provided
if (!getDependants) {
getDependants = arrayOf;
}
/**
* Returns the root cache. If WeakMap is supported, this is assigned to the
* root WeakMap cache set, otherwise it is a shared instance of the default
* cache object.
*
* @return {(WeakMap|Object)} Root cache object.
*/
function getRootCache() {
return rootCache;
}
/**
* Returns the cache for a given dependants array. When possible, a WeakMap
* will be used to create a unique cache for each set of dependants. This
* is feasible due to the nature of WeakMap in allowing garbage collection
* to occur on entries where the key object is no longer referenced. Since
* WeakMap requires the key to be an object, this is only possible when the
* dependant is object-like. The root cache is created as a hierarchy where
* each top-level key is the first entry in a dependants set, the value a
* WeakMap where each key is the next dependant, and so on. This continues
* so long as the dependants are object-like. If no dependants are object-
* like, then the cache is shared across all invocations.
*
* @see isObjectLike
*
* @param {Array} dependants Selector dependants.
*
* @return {Object} Cache object.
*/
function getWeakMapCache(dependants) {
var caches = rootCache,
isUniqueByDependants = true,
i,
dependant,
map,
cache;
for (i = 0; i < dependants.length; i++) {
dependant = dependants[i]; // Can only compose WeakMap from object-like key.
if (!isObjectLike(dependant)) {
isUniqueByDependants = false;
break;
} // Does current segment of cache already have a WeakMap?
if (caches.has(dependant)) {
// Traverse into nested WeakMap.
caches = caches.get(dependant);
} else {
// Create, set, and traverse into a new one.
map = new WeakMap();
caches.set(dependant, map);
caches = map;
}
} // We use an arbitrary (but consistent) object as key for the last item
// in the WeakMap to serve as our running cache.
if (!caches.has(LEAF_KEY)) {
cache = createCache();
cache.isUniqueByDependants = isUniqueByDependants;
caches.set(LEAF_KEY, cache);
}
return caches.get(LEAF_KEY);
} // Assign cache handler by availability of WeakMap
getCache = hasWeakMap ? getWeakMapCache : getRootCache;
/**
* Resets root memoization cache.
*/
function clear() {
rootCache = hasWeakMap ? new WeakMap() : createCache();
} // eslint-disable-next-line jsdoc/check-param-names
/**
* The augmented selector call, considering first whether dependants have
* changed before passing it to underlying memoize function.
*
* @param {Object} source Source object for derivation.
* @param {...*} extraArgs Additional arguments to pass to selector.
*
* @return {*} Selector result.
*/
function callSelector()
/* source, ...extraArgs */
{
var len = arguments.length,
cache,
node,
i,
args,
dependants; // Create copy of arguments (avoid leaking deoptimization).
args = new Array(len);
for (i = 0; i < len; i++) {
args[i] = arguments[i];
}
dependants = getDependants.apply(null, args);
cache = getCache(dependants); // If not guaranteed uniqueness by dependants (primitive type or lack
// of WeakMap support), shallow compare against last dependants and, if
// references have changed, destroy cache to recalculate result.
if (!cache.isUniqueByDependants) {
if (cache.lastDependants && !isShallowEqual(dependants, cache.lastDependants, 0)) {
cache.clear();
}
cache.lastDependants = dependants;
}
node = cache.head;
while (node) {
// Check whether node arguments match arguments
if (!isShallowEqual(node.args, args, 1)) {
node = node.next;
continue;
} // At this point we can assume we've found a match
// Surface matched node to head if not already
if (node !== cache.head) {
// Adjust siblings to point to each other.
node.prev.next = node.next;
if (node.next) {
node.next.prev = node.prev;
}
node.next = cache.head;
node.prev = null;
cache.head.prev = node;
cache.head = node;
} // Return immediately
return node.val;
} // No cached value found. Continue to insertion phase:
node = {
// Generate the result from original function
val: selector.apply(null, args)
}; // Avoid including the source object in the cache.
args[0] = null;
node.args = args; // Don't need to check whether node is already head, since it would
// have been returned above already if it was
// Shift existing head down list
if (cache.head) {
cache.head.prev = node;
node.next = cache.head;
}
cache.head = node;
return node.val;
}
callSelector.getDependants = getDependants;
callSelector.clear = clear;
clear();
return callSelector;
});
/***/ }),
/***/ "./node_modules/rungen/dist/controls/async.js":
/*!****************************************************!*\
!*** ./node_modules/rungen/dist/controls/async.js ***!
\****************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.race = exports.join = exports.fork = exports.promise = undefined;
var _is = __webpack_require__(/*! ../utils/is */ "./node_modules/rungen/dist/utils/is.js");
var _is2 = _interopRequireDefault(_is);
var _helpers = __webpack_require__(/*! ../utils/helpers */ "./node_modules/rungen/dist/utils/helpers.js");
var _dispatcher = __webpack_require__(/*! ../utils/dispatcher */ "./node_modules/rungen/dist/utils/dispatcher.js");
var _dispatcher2 = _interopRequireDefault(_dispatcher);
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
default: obj
};
}
var promise = exports.promise = function promise(value, next, rungen, yieldNext, raiseNext) {
if (!_is2.default.promise(value)) return false;
value.then(next, raiseNext);
return true;
};
var forkedTasks = new Map();
var fork = exports.fork = function fork(value, next, rungen) {
if (!_is2.default.fork(value)) return false;
var task = Symbol('fork');
var dispatcher = (0, _dispatcher2.default)();
forkedTasks.set(task, dispatcher);
rungen(value.iterator.apply(null, value.args), function (result) {
return dispatcher.dispatch(result);
}, function (err) {
return dispatcher.dispatch((0, _helpers.error)(err));
});
var unsubscribe = dispatcher.subscribe(function () {
unsubscribe();
forkedTasks.delete(task);
});
next(task);
return true;
};
var join = exports.join = function join(value, next, rungen, yieldNext, raiseNext) {
if (!_is2.default.join(value)) return false;
var dispatcher = forkedTasks.get(value.task);
if (!dispatcher) {
raiseNext('join error : task not found');
} else {
(function () {
var unsubscribe = dispatcher.subscribe(function (result) {
unsubscribe();
next(result);
});
})();
}
return true;
};
var race = exports.race = function race(value, next, rungen, yieldNext, raiseNext) {
if (!_is2.default.race(value)) return false;
var finished = false;
var success = function success(result, k, v) {
if (finished) return;
finished = true;
result[k] = v;
next(result);
};
var fail = function fail(err) {
if (finished) return;
raiseNext(err);
};
if (_is2.default.array(value.competitors)) {
(function () {
var result = value.competitors.map(function () {
return false;
});
value.competitors.forEach(function (competitor, index) {
rungen(competitor, function (output) {
return success(result, index, output);
}, fail);
});
})();
} else {
(function () {
var result = Object.keys(value.competitors).reduce(function (p, c) {
p[c] = false;
return p;
}, {});
Object.keys(value.competitors).forEach(function (index) {
rungen(value.competitors[index], function (output) {
return success(result, index, output);
}, fail);
});
})();
}
return true;
};
var subscribe = function subscribe(value, next) {
if (!_is2.default.subscribe(value)) return false;
if (!_is2.default.channel(value.channel)) {
throw new Error('the first argument of "subscribe" must be a valid channel');
}
var unsubscribe = value.channel.subscribe(function (ret) {
unsubscribe && unsubscribe();
next(ret);
});
return true;
};
exports.default = [promise, fork, join, race, subscribe];
/***/ }),
/***/ "./node_modules/rungen/dist/controls/builtin.js":
/*!******************************************************!*\
!*** ./node_modules/rungen/dist/controls/builtin.js ***!
\******************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.iterator = exports.array = exports.object = exports.error = exports.any = undefined;
var _is = __webpack_require__(/*! ../utils/is */ "./node_modules/rungen/dist/utils/is.js");
var _is2 = _interopRequireDefault(_is);
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
default: obj
};
}
var any = exports.any = function any(value, next, rungen, yieldNext) {
yieldNext(value);
return true;
};
var error = exports.error = function error(value, next, rungen, yieldNext, raiseNext) {
if (!_is2.default.error(value)) return false;
raiseNext(value.error);
return true;
};
var object = exports.object = function object(value, next, rungen, yieldNext, raiseNext) {
if (!_is2.default.all(value) || !_is2.default.obj(value.value)) return false;
var result = {};
var keys = Object.keys(value.value);
var count = 0;
var hasError = false;
var gotResultSuccess = function gotResultSuccess(key, ret) {
if (hasError) return;
result[key] = ret;
count++;
if (count === keys.length) {
yieldNext(result);
}
};
var gotResultError = function gotResultError(key, error) {
if (hasError) return;
hasError = true;
raiseNext(error);
};
keys.map(function (key) {
rungen(value.value[key], function (ret) {
return gotResultSuccess(key, ret);
}, function (err) {
return gotResultError(key, err);
});
});
return true;
};
var array = exports.array = function array(value, next, rungen, yieldNext, raiseNext) {
if (!_is2.default.all(value) || !_is2.default.array(value.value)) return false;
var result = [];
var count = 0;
var hasError = false;
var gotResultSuccess = function gotResultSuccess(key, ret) {
if (hasError) return;
result[key] = ret;
count++;
if (count === value.value.length) {
yieldNext(result);
}
};
var gotResultError = function gotResultError(key, error) {
if (hasError) return;
hasError = true;
raiseNext(error);
};
value.value.map(function (v, key) {
rungen(v, function (ret) {
return gotResultSuccess(key, ret);
}, function (err) {
return gotResultError(key, err);
});
});
return true;
};
var iterator = exports.iterator = function iterator(value, next, rungen, yieldNext, raiseNext) {
if (!_is2.default.iterator(value)) return false;
rungen(value, next, raiseNext);
return true;
};
exports.default = [error, iterator, array, object, any];
/***/ }),
/***/ "./node_modules/rungen/dist/controls/wrap.js":
/*!***************************************************!*\
!*** ./node_modules/rungen/dist/controls/wrap.js ***!
\***************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.cps = exports.call = undefined;
var _is = __webpack_require__(/*! ../utils/is */ "./node_modules/rungen/dist/utils/is.js");
var _is2 = _interopRequireDefault(_is);
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
default: obj
};
}
function _toConsumableArray(arr) {
if (Array.isArray(arr)) {
for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) {
arr2[i] = arr[i];
}
return arr2;
} else {
return Array.from(arr);
}
}
var call = exports.call = function call(value, next, rungen, yieldNext, raiseNext) {
if (!_is2.default.call(value)) return false;
try {
next(value.func.apply(value.context, value.args));
} catch (err) {
raiseNext(err);
}
return true;
};
var cps = exports.cps = function cps(value, next, rungen, yieldNext, raiseNext) {
var _value$func;
if (!_is2.default.cps(value)) return false;
(_value$func = value.func).call.apply(_value$func, [null].concat(_toConsumableArray(value.args), [function (err, result) {
if (err) raiseNext(err);else next(result);
}]));
return true;
};
exports.default = [call, cps];
/***/ }),
/***/ "./node_modules/rungen/dist/create.js":
/*!********************************************!*\
!*** ./node_modules/rungen/dist/create.js ***!
\********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _builtin = __webpack_require__(/*! ./controls/builtin */ "./node_modules/rungen/dist/controls/builtin.js");
var _builtin2 = _interopRequireDefault(_builtin);
var _is = __webpack_require__(/*! ./utils/is */ "./node_modules/rungen/dist/utils/is.js");
var _is2 = _interopRequireDefault(_is);
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
default: obj
};
}
function _toConsumableArray(arr) {
if (Array.isArray(arr)) {
for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) {
arr2[i] = arr[i];
}
return arr2;
} else {
return Array.from(arr);
}
}
var create = function create() {
var userControls = arguments.length <= 0 || arguments[0] === undefined ? [] : arguments[0];
var controls = [].concat(_toConsumableArray(userControls), _toConsumableArray(_builtin2.default));
var runtime = function runtime(input) {
var success = arguments.length <= 1 || arguments[1] === undefined ? function () {} : arguments[1];
var error = arguments.length <= 2 || arguments[2] === undefined ? function () {} : arguments[2];
var iterate = function iterate(gen) {
var yieldValue = function yieldValue(isError) {
return function (ret) {
try {
var _ref = isError ? gen.throw(ret) : gen.next(ret);
var value = _ref.value;
var done = _ref.done;
if (done) return success(value);
next(value);
} catch (e) {
return error(e);
}
};
};
var next = function next(ret) {
controls.some(function (control) {
return control(ret, next, runtime, yieldValue(false), yieldValue(true));
});
};
yieldValue(false)();
};
var iterator = _is2.default.iterator(input) ? input : regeneratorRuntime.mark(function _callee() {
return regeneratorRuntime.wrap(function _callee$(_context) {
while (1) {
switch (_context.prev = _context.next) {
case 0:
_context.next = 2;
return input;
case 2:
return _context.abrupt('return', _context.sent);
case 3:
case 'end':
return _context.stop();
}
}
}, _callee, this);
})();
iterate(iterator, success, error);
};
return runtime;
};
exports.default = create;
/***/ }),
/***/ "./node_modules/rungen/dist/index.js":
/*!*******************************************!*\
!*** ./node_modules/rungen/dist/index.js ***!
\*******************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.wrapControls = exports.asyncControls = exports.create = undefined;
var _helpers = __webpack_require__(/*! ./utils/helpers */ "./node_modules/rungen/dist/utils/helpers.js");
Object.keys(_helpers).forEach(function (key) {
if (key === "default") return;
Object.defineProperty(exports, key, {
enumerable: true,
get: function get() {
return _helpers[key];
}
});
});
var _create = __webpack_require__(/*! ./create */ "./node_modules/rungen/dist/create.js");
var _create2 = _interopRequireDefault(_create);
var _async = __webpack_require__(/*! ./controls/async */ "./node_modules/rungen/dist/controls/async.js");
var _async2 = _interopRequireDefault(_async);
var _wrap = __webpack_require__(/*! ./controls/wrap */ "./node_modules/rungen/dist/controls/wrap.js");
var _wrap2 = _interopRequireDefault(_wrap);
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
default: obj
};
}
exports.create = _create2.default;
exports.asyncControls = _async2.default;
exports.wrapControls = _wrap2.default;
/***/ }),
/***/ "./node_modules/rungen/dist/utils/dispatcher.js":
/*!******************************************************!*\
!*** ./node_modules/rungen/dist/utils/dispatcher.js ***!
\******************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var createDispatcher = function createDispatcher() {
var listeners = [];
return {
subscribe: function subscribe(listener) {
listeners.push(listener);
return function () {
listeners = listeners.filter(function (l) {
return l !== listener;
});
};
},
dispatch: function dispatch(action) {
listeners.slice().forEach(function (listener) {
return listener(action);
});
}
};
};
exports.default = createDispatcher;
/***/ }),
/***/ "./node_modules/rungen/dist/utils/helpers.js":
/*!***************************************************!*\
!*** ./node_modules/rungen/dist/utils/helpers.js ***!
\***************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.createChannel = exports.subscribe = exports.cps = exports.apply = exports.call = exports.invoke = exports.delay = exports.race = exports.join = exports.fork = exports.error = exports.all = undefined;
var _keys = __webpack_require__(/*! ./keys */ "./node_modules/rungen/dist/utils/keys.js");
var _keys2 = _interopRequireDefault(_keys);
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
default: obj
};
}
var all = exports.all = function all(value) {
return {
type: _keys2.default.all,
value: value
};
};
var error = exports.error = function error(err) {
return {
type: _keys2.default.error,
error: err
};
};
var fork = exports.fork = function fork(iterator) {
for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
args[_key - 1] = arguments[_key];
}
return {
type: _keys2.default.fork,
iterator: iterator,
args: args
};
};
var join = exports.join = function join(task) {
return {
type: _keys2.default.join,
task: task
};
};
var race = exports.race = function race(competitors) {
return {
type: _keys2.default.race,
competitors: competitors
};
};
var delay = exports.delay = function delay(timeout) {
return new Promise(function (resolve) {
setTimeout(function () {
return resolve(true);
}, timeout);
});
};
var invoke = exports.invoke = function invoke(func) {
for (var _len2 = arguments.length, args = Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
args[_key2 - 1] = arguments[_key2];
}
return {
type: _keys2.default.call,
func: func,
context: null,
args: args
};
};
var call = exports.call = function call(func, context) {
for (var _len3 = arguments.length, args = Array(_len3 > 2 ? _len3 - 2 : 0), _key3 = 2; _key3 < _len3; _key3++) {
args[_key3 - 2] = arguments[_key3];
}
return {
type: _keys2.default.call,
func: func,
context: context,
args: args
};
};
var apply = exports.apply = function apply(func, context, args) {
return {
type: _keys2.default.call,
func: func,
context: context,
args: args
};
};
var cps = exports.cps = function cps(func) {
for (var _len4 = arguments.length, args = Array(_len4 > 1 ? _len4 - 1 : 0), _key4 = 1; _key4 < _len4; _key4++) {
args[_key4 - 1] = arguments[_key4];
}
return {
type: _keys2.default.cps,
func: func,
args: args
};
};
var subscribe = exports.subscribe = function subscribe(channel) {
return {
type: _keys2.default.subscribe,
channel: channel
};
};
var createChannel = exports.createChannel = function createChannel(callback) {
var listeners = [];
var subscribe = function subscribe(l) {
listeners.push(l);
return function () {
return listeners.splice(listeners.indexOf(l), 1);
};
};
var next = function next(val) {
return listeners.forEach(function (l) {
return l(val);
});
};
callback(next);
return {
subscribe: subscribe
};
};
/***/ }),
/***/ "./node_modules/rungen/dist/utils/is.js":
/*!**********************************************!*\
!*** ./node_modules/rungen/dist/utils/is.js ***!
\**********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
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 _keys = __webpack_require__(/*! ./keys */ "./node_modules/rungen/dist/utils/keys.js");
var _keys2 = _interopRequireDefault(_keys);
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
default: obj
};
}
var is = {
obj: function obj(value) {
return (typeof value === 'undefined' ? 'undefined' : _typeof(value)) === 'object' && !!value;
},
all: function all(value) {
return is.obj(value) && value.type === _keys2.default.all;
},
error: function error(value) {
return is.obj(value) && value.type === _keys2.default.error;
},
array: Array.isArray,
func: function func(value) {
return typeof value === 'function';
},
promise: function promise(value) {
return value && is.func(value.then);
},
iterator: function iterator(value) {
return value && is.func(value.next) && is.func(value.throw);
},
fork: function fork(value) {
return is.obj(value) && value.type === _keys2.default.fork;
},
join: function join(value) {
return is.obj(value) && value.type === _keys2.default.join;
},
race: function race(value) {
return is.obj(value) && value.type === _keys2.default.race;
},
call: function call(value) {
return is.obj(value) && value.type === _keys2.default.call;
},
cps: function cps(value) {
return is.obj(value) && value.type === _keys2.default.cps;
},
subscribe: function subscribe(value) {
return is.obj(value) && value.type === _keys2.default.subscribe;
},
channel: function channel(value) {
return is.obj(value) && is.func(value.subscribe);
}
};
exports.default = is;
/***/ }),
/***/ "./node_modules/rungen/dist/utils/keys.js":
/*!************************************************!*\
!*** ./node_modules/rungen/dist/utils/keys.js ***!
\************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var keys = {
all: Symbol('all'),
error: Symbol('error'),
fork: Symbol('fork'),
join: Symbol('join'),
race: Symbol('race'),
call: Symbol('call'),
cps: Symbol('cps'),
subscribe: Symbol('subscribe')
};
exports.default = keys;
/***/ }),
/***/ "./node_modules/sprintf-js/src/sprintf.js":
/*!************************************************!*\
!*** ./node_modules/sprintf-js/src/sprintf.js ***!
\************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var __WEBPACK_AMD_DEFINE_RESULT__;/* global window, exports, define */
!function () {
'use strict';
var re = {
not_string: /[^s]/,
not_bool: /[^t]/,
not_type: /[^T]/,
not_primitive: /[^v]/,
number: /[diefg]/,
numeric_arg: /[bcdiefguxX]/,
json: /[j]/,
not_json: /[^j]/,
text: /^[^\x25]+/,
modulo: /^\x25{2}/,
placeholder: /^\x25(?:([1-9]\d*)\$|\(([^)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijostTuvxX])/,
key: /^([a-z_][a-z_\d]*)/i,
key_access: /^\.([a-z_][a-z_\d]*)/i,
index_access: /^\[(\d+)\]/,
sign: /^[+-]/
};
function sprintf(key) {
// `arguments` is not an array, but should be fine for this call
return sprintf_format(sprintf_parse(key), arguments);
}
function vsprintf(fmt, argv) {
return sprintf.apply(null, [fmt].concat(argv || []));
}
function sprintf_format(parse_tree, argv) {
var cursor = 1,
tree_length = parse_tree.length,
arg,
output = '',
i,
k,
ph,
pad,
pad_character,
pad_length,
is_positive,
sign;
for (i = 0; i < tree_length; i++) {
if (typeof parse_tree[i] === 'string') {
output += parse_tree[i];
} else if (typeof parse_tree[i] === 'object') {
ph = parse_tree[i]; // convenience purposes only
if (ph.keys) {
// keyword argument
arg = argv[cursor];
for (k = 0; k < ph.keys.length; k++) {
if (arg == undefined) {
throw new Error(sprintf('[sprintf] Cannot access property "%s" of undefined value "%s"', ph.keys[k], ph.keys[k - 1]));
}
arg = arg[ph.keys[k]];
}
} else if (ph.param_no) {
// positional argument (explicit)
arg = argv[ph.param_no];
} else {
// positional argument (implicit)
arg = argv[cursor++];
}
if (re.not_type.test(ph.type) && re.not_primitive.test(ph.type) && arg instanceof Function) {
arg = arg();
}
if (re.numeric_arg.test(ph.type) && typeof arg !== 'number' && isNaN(arg)) {
throw new TypeError(sprintf('[sprintf] expecting number but found %T', arg));
}
if (re.number.test(ph.type)) {
is_positive = arg >= 0;
}
switch (ph.type) {
case 'b':
arg = parseInt(arg, 10).toString(2);
break;
case 'c':
arg = String.fromCharCode(parseInt(arg, 10));
break;
case 'd':
case 'i':
arg = parseInt(arg, 10);
break;
case 'j':
arg = JSON.stringify(arg, null, ph.width ? parseInt(ph.width) : 0);
break;
case 'e':
arg = ph.precision ? parseFloat(arg).toExponential(ph.precision) : parseFloat(arg).toExponential();
break;
case 'f':
arg = ph.precision ? parseFloat(arg).toFixed(ph.precision) : parseFloat(arg);
break;
case 'g':
arg = ph.precision ? String(Number(arg.toPrecision(ph.precision))) : parseFloat(arg);
break;
case 'o':
arg = (parseInt(arg, 10) >>> 0).toString(8);
break;
case 's':
arg = String(arg);
arg = ph.precision ? arg.substring(0, ph.precision) : arg;
break;
case 't':
arg = String(!!arg);
arg = ph.precision ? arg.substring(0, ph.precision) : arg;
break;
case 'T':
arg = Object.prototype.toString.call(arg).slice(8, -1).toLowerCase();
arg = ph.precision ? arg.substring(0, ph.precision) : arg;
break;
case 'u':
arg = parseInt(arg, 10) >>> 0;
break;
case 'v':
arg = arg.valueOf();
arg = ph.precision ? arg.substring(0, ph.precision) : arg;
break;
case 'x':
arg = (parseInt(arg, 10) >>> 0).toString(16);
break;
case 'X':
arg = (parseInt(arg, 10) >>> 0).toString(16).toUpperCase();
break;
}
if (re.json.test(ph.type)) {
output += arg;
} else {
if (re.number.test(ph.type) && (!is_positive || ph.sign)) {
sign = is_positive ? '+' : '-';
arg = arg.toString().replace(re.sign, '');
} else {
sign = '';
}
pad_character = ph.pad_char ? ph.pad_char === '0' ? '0' : ph.pad_char.charAt(1) : ' ';
pad_length = ph.width - (sign + arg).length;
pad = ph.width ? pad_length > 0 ? pad_character.repeat(pad_length) : '' : '';
output += ph.align ? sign + arg + pad : pad_character === '0' ? sign + pad + arg : pad + sign + arg;
}
}
}
return output;
}
var sprintf_cache = Object.create(null);
function sprintf_parse(fmt) {
if (sprintf_cache[fmt]) {
return sprintf_cache[fmt];
}
var _fmt = fmt,
match,
parse_tree = [],
arg_names = 0;
while (_fmt) {
if ((match = re.text.exec(_fmt)) !== null) {
parse_tree.push(match[0]);
} else if ((match = re.modulo.exec(_fmt)) !== null) {
parse_tree.push('%');
} else if ((match = re.placeholder.exec(_fmt)) !== null) {
if (match[2]) {
arg_names |= 1;
var field_list = [],
replacement_field = match[2],
field_match = [];
if ((field_match = re.key.exec(replacement_field)) !== null) {
field_list.push(field_match[1]);
while ((replacement_field = replacement_field.substring(field_match[0].length)) !== '') {
if ((field_match = re.key_access.exec(replacement_field)) !== null) {
field_list.push(field_match[1]);
} else if ((field_match = re.index_access.exec(replacement_field)) !== null) {
field_list.push(field_match[1]);
} else {
throw new SyntaxError('[sprintf] failed to parse named argument key');
}
}
} else {
throw new SyntaxError('[sprintf] failed to parse named argument key');
}
match[2] = field_list;
} else {
arg_names |= 2;
}
if (arg_names === 3) {
throw new Error('[sprintf] mixing positional and named placeholders is not (yet) supported');
}
parse_tree.push({
placeholder: match[0],
param_no: match[1],
keys: match[2],
sign: match[3],
pad_char: match[4],
align: match[5],
width: match[6],
precision: match[7],
type: match[8]
});
} else {
throw new SyntaxError('[sprintf] unexpected placeholder');
}
_fmt = _fmt.substring(match[0].length);
}
return sprintf_cache[fmt] = parse_tree;
}
/**
* export to either browser or node.js
*/
/* eslint-disable quote-props */
if (true) {
exports['sprintf'] = sprintf;
exports['vsprintf'] = vsprintf;
}
if (typeof window !== 'undefined') {
window['sprintf'] = sprintf;
window['vsprintf'] = vsprintf;
if (true) {
!(__WEBPACK_AMD_DEFINE_RESULT__ = (function () {
return {
'sprintf': sprintf,
'vsprintf': vsprintf
};
}).call(exports, __webpack_require__, exports, module),
__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
}
}
/* eslint-enable quote-props */
}(); // eslint-disable-line
/***/ }),
/***/ "./node_modules/symbol-observable/es/index.js":
/*!****************************************************!*\
!*** ./node_modules/symbol-observable/es/index.js ***!
\****************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* WEBPACK VAR INJECTION */(function(global, module) {/* harmony import */ var _ponyfill_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./ponyfill.js */ "./node_modules/symbol-observable/es/ponyfill.js");
/* global window */
var root;
if (typeof self !== 'undefined') {
root = self;
} else if (typeof window !== 'undefined') {
root = window;
} else if (typeof global !== 'undefined') {
root = global;
} else if (true) {
root = module;
} else {}
var result = Object(_ponyfill_js__WEBPACK_IMPORTED_MODULE_0__["default"])(root);
/* harmony default export */ __webpack_exports__["default"] = (result);
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js"), __webpack_require__(/*! ./../../webpack/buildin/harmony-module.js */ "./node_modules/webpack/buildin/harmony-module.js")(module)))
/***/ }),
/***/ "./node_modules/symbol-observable/es/ponyfill.js":
/*!*******************************************************!*\
!*** ./node_modules/symbol-observable/es/ponyfill.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 symbolObservablePonyfill; });
function symbolObservablePonyfill(root) {
var result;
var Symbol = root.Symbol;
if (typeof Symbol === 'function') {
if (Symbol.observable) {
result = Symbol.observable;
} else {
result = Symbol('observable');
Symbol.observable = result;
}
} else {
result = '@@observable';
}
return result;
}
;
/***/ }),
/***/ "./node_modules/tannin/index.js":
/*!**************************************!*\
!*** ./node_modules/tannin/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 Tannin; });
/* harmony import */ var _tannin_plural_forms__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tannin/plural-forms */ "./node_modules/@tannin/plural-forms/index.js");
/**
* Tannin constructor options.
*
* @property {?string} contextDelimiter Joiner in string lookup with context.
* @property {?Function} onMissingKey Callback to invoke when key missing.
*
* @type {Object}
*
* @typedef {TanninOptions}
*/
/**
* Default Tannin constructor options.
*
* @type {TanninOptions}
*/
var DEFAULT_OPTIONS = {
contextDelimiter: '\u0004',
onMissingKey: null
};
/**
* Given a specific locale data's config `plural_forms` value, returns the
* expression.
*
* @example
*
* ```
* getPluralExpression( 'nplurals=2; plural=(n != 1);' ) === '(n != 1)'
* ```
*
* @param {string} pf Locale data plural forms.
*
* @return {string} Plural forms expression.
*/
function getPluralExpression(pf) {
var parts, i, part;
parts = pf.split(';');
for (i = 0; i < parts.length; i++) {
part = parts[i].trim();
if (part.indexOf('plural=') === 0) {
return part.substr(7);
}
}
}
/**
* Tannin constructor.
*
* @param {Object} data Jed-formatted locale data.
* @param {TanninOptions} options Tannin options.
*/
function Tannin(data, options) {
var key;
this.data = data;
this.pluralForms = {};
options = options || {};
this.options = {};
for (key in DEFAULT_OPTIONS) {
this.options[key] = options[key] || DEFAULT_OPTIONS[key];
}
}
/**
* Returns the plural form index for the given domain and value.
*
* @param {string} domain Domain on which to calculate plural form.
* @param {number} n Value for which plural form is to be calculated.
*
* @return {number} Plural form index.
*/
Tannin.prototype.getPluralForm = function (domain, n) {
var getPluralForm = this.pluralForms[domain],
config,
plural,
pf;
if (!getPluralForm) {
config = this.data[domain][''];
pf = config['Plural-Forms'] || config['plural-forms'] || config.plural_forms;
if (typeof pf !== 'function') {
plural = getPluralExpression(config['Plural-Forms'] || config['plural-forms'] || config.plural_forms);
pf = Object(_tannin_plural_forms__WEBPACK_IMPORTED_MODULE_0__["default"])(plural);
}
getPluralForm = this.pluralForms[domain] = pf;
}
return getPluralForm(n);
};
/**
* Translate a string.
*
* @param {string} domain Translation domain.
* @param {string} context Context distinguishing terms of the same name.
* @param {string} singular Primary key for translation lookup.
* @param {string} plural Fallback value used for non-zero plural form index.
* @param {number} n Value to use in calculating plural form.
*
* @return {string} Translated string.
*/
Tannin.prototype.dcnpgettext = function (domain, context, singular, plural, n) {
var index, key, entry;
if (n === undefined) {
// Default to singular.
index = 0;
} else {
// Find index by evaluating plural form for value.
index = this.getPluralForm(domain, n);
}
key = singular; // If provided, context is prepended to key with delimiter.
if (context) {
key = context + this.options.contextDelimiter + singular;
}
entry = this.data[domain][key]; // Verify not only that entry exists, but that the intended index is within
// range and non-empty.
if (entry && entry[index]) {
return entry[index];
}
if (this.options.onMissingKey) {
this.options.onMissingKey(singular, domain);
} // If entry not found, fall back to singular vs. plural with zero index
// representing the singular value.
return index === 0 ? singular : plural;
};
/***/ }),
/***/ "./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/turbo-combine-reducers/index.js":
/*!******************************************************!*\
!*** ./node_modules/turbo-combine-reducers/index.js ***!
\******************************************************/
/*! no static exports found */
/***/ (function(module, exports) {
function combineReducers(reducers) {
var keys = Object.keys(reducers),
getNextState;
getNextState = function () {
var fn, i, key;
fn = 'return {';
for (i = 0; i < keys.length; i++) {
// Rely on Quoted escaping of JSON.stringify with guarantee that
// each member of Object.keys is a string.
//
// "If Type(value) is String, then return the result of calling the
// abstract operation Quote with argument value. [...] The abstract
// operation Quote(value) wraps a String value in double quotes and
// escapes characters within it."
//
// https://www.ecma-international.org/ecma-262/5.1/#sec-15.12.3
key = JSON.stringify(keys[i]);
fn += key + ':r[' + key + '](s[' + key + '],a),';
}
fn += '}';
return new Function('r,s,a', fn);
}();
return function combinedReducer(state, action) {
var nextState, i, key; // Assumed changed if initial state.
if (state === undefined) {
return getNextState(reducers, {}, action);
}
nextState = getNextState(reducers, state, action); // Determine whether state has changed.
i = keys.length;
while (i--) {
key = keys[i];
if (state[key] !== nextState[key]) {
// Return immediately if a changed value is encountered.
return nextState;
}
}
return state;
};
}
module.exports = combineReducers;
/***/ }),
/***/ "./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/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/harmony-module.js":
/*!*******************************************!*\
!*** (webpack)/buildin/harmony-module.js ***!
\*******************************************/
/*! no static exports found */
/***/ (function(module, exports) {
module.exports = function (originalModule) {
if (!originalModule.webpackPolyfill) {
var module = Object.create(originalModule); // 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;
}
});
Object.defineProperty(module, "exports", {
enumerable: true
});
module.webpackPolyfill = 1;
}
return module;
};
/***/ }),
/***/ "./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;
};
/***/ }),
/***/ 0:
/*!********************************!*\
!*** ./util.inspect (ignored) ***!
\********************************/
/*! no static exports found */
/***/ (function(module, exports) {
/* (ignored) */
/***/ }),
/***/ "lodash":
/*!*************************!*\
!*** external "lodash" ***!
\*************************/
/*! no static exports found */
/***/ (function(module, exports) {
module.exports = lodash;
/***/ }),
/***/ "react":
/*!************************!*\
!*** external "React" ***!
\************************/
/*! no static exports found */
/***/ (function(module, exports) {
module.exports = React;
/***/ }),
/***/ "react-dom":
/*!***************************!*\
!*** external "ReactDOM" ***!
\***************************/
/*! no static exports found */
/***/ (function(module, exports) {
module.exports = ReactDOM;
/***/ })
/******/ });
//# sourceMappingURL=license-field.js.map