}, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["cloneElement"])(eventCatcher, eventHandlers), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["cloneElement"])(child, {
children: childrenWithPopover
}), ","), eventHandlers);
var getRegularElement = function getRegularElement(_ref2) {
eventHandlers = _ref2.eventHandlers,
childrenWithPopover = _ref2.childrenWithPopover;
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["cloneElement"])(child, _objectSpread(_objectSpread({}, eventHandlers), {}, {
children: childrenWithPopover
var addPopoverToGrandchildren = function addPopoverToGrandchildren(_ref3) {
var grandchildren = _ref3.grandchildren,
position = _ref3.position,
shortcut = _ref3.shortcut;
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["concatChildren"])(grandchildren, isOver && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["createElement"])(_popover__WEBPACK_IMPORTED_MODULE_4__[/* default */ "a"], {
className: "components-tooltip",
}, text, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["createElement"])(_shortcut__WEBPACK_IMPORTED_MODULE_5__[/* default */ "a"], {
className: "components-tooltip__shortcut",
var emitToChild = function emitToChild(children, eventName, event) {
if (_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["Children"].count(children) !== 1) {
var child = _wordpress_element__WEBPACK_IMPORTED_MODULE_2__["Children"].only(children);
if (typeof child.props[eventName] === 'function') {
child.props[eventName](event);
function Tooltip(_ref4) {
var children = _ref4.children,
position = _ref4.position,
shortcut = _ref4.shortcut;
* Whether a mouse is currently pressed, used in determining whether
* to handle a focus event as displaying the tooltip immediately.
var _useState = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["useState"])(false),
_useState2 = Object(_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])(_useState, 2),
isMouseDown = _useState2[0],
setIsMouseDown = _useState2[1];
var _useState3 = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["useState"])(false),
_useState4 = Object(_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])(_useState3, 2),
setIsOver = _useState4[1];
var delayedSetIsOver = Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_6__["useDebounce"])(setIsOver, TOOLTIP_DELAY);
var createMouseDown = function createMouseDown(event) {
// Preserve original child callback behavior
emitToChild(children, 'onMouseDown', 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.addEventListener('mouseup', cancelIsMouseDown);
var createMouseUp = function createMouseUp(event) {
emitToChild(children, 'onMouseUp', event);
document.removeEventListener('mouseup', cancelIsMouseDown);
var createMouseEvent = function createMouseEvent(type) {
if (type === 'mouseUp') return createMouseUp;
if (type === 'mouseDown') return createMouseDown;
* Prebound `isInMouseDown` handler, created as a constant reference to
* assure ability to remove in component unmount.
var cancelIsMouseDown = createMouseEvent('mouseUp');
var createToggleIsOver = function createToggleIsOver(eventName, isDelayed) {
return function (event) {
// Preserve original child callback behavior
emitToChild(children, 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) {
} // 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 && isMouseDown) {
} // Needed in case unsetting is over while delayed set pending, i.e.
// quickly blur/mouseleave before delayedSetIsOver is called
delayedSetIsOver.cancel();
var _isOver = Object(lodash__WEBPACK_IMPORTED_MODULE_3__["includes"])(['focus', 'mouseenter'], event.type);
if (_isOver === isOver) {
delayedSetIsOver(_isOver);
var clearOnUnmount = function clearOnUnmount() {
delayedSetIsOver.cancel();
Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["useEffect"])(function () {
if (_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["Children"].count(children) !== 1) {
onMouseEnter: createToggleIsOver('onMouseEnter', true),
onMouseLeave: createToggleIsOver('onMouseLeave'),
onClick: createToggleIsOver('onClick'),
onFocus: createToggleIsOver('onFocus'),
onBlur: createToggleIsOver('onBlur'),
onMouseDown: createMouseEvent('mouseDown')
var child = _wordpress_element__WEBPACK_IMPORTED_MODULE_2__["Children"].only(children);
var _child$props = child.props,
grandchildren = _child$props.children,
disabled = _child$props.disabled;
var getElementWithPopover = disabled ? getDisabledElement : getRegularElement;
var childrenWithPopover = addPopoverToGrandchildren(_objectSpread({
grandchildren: grandchildren
return getElementWithPopover({
eventHandlers: eventHandlers,
childrenWithPopover: childrenWithPopover
/* harmony default export */ __webpack_exports__["a"] = (Tooltip);
/***/ (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__("yLpj")))
/***/ (function(module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
exports['default'] = registerInterfaceWithDefaultTheme;
var _ThemedStyleSheet = __webpack_require__("030x");
var _ThemedStyleSheet2 = _interopRequireDefault(_ThemedStyleSheet);
var _DefaultTheme = __webpack_require__("xOhs");
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']);
/***/ (function(module, exports, __webpack_require__) {
var hasSymbols = typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol';
var isPrimitive = __webpack_require__("Teho");
var isCallable = __webpack_require__("IdCN");
var isDate = __webpack_require__("DmXP");
var isSymbol = __webpack_require__("/sVA");
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'];
for (i = 0; i < methodNames.length; ++i) {
method = O[methodNames[i]];
if (isCallable(method)) {
if (isPrimitive(result)) {
throw new TypeError('No default value');
var GetMethod = function GetMethod(O, P) {
if (func !== null && typeof func !== 'undefined') {
throw new TypeError(func + ' returned for property ' + P + ' of object ' + O + ' is not a function');
// http://www.ecma-international.org/ecma-262/6.0/#sec-toprimitive
module.exports = function ToPrimitive(input) {
if (isPrimitive(input)) {
if (arguments.length > 1) {
if (arguments[1] === String) {
} else if (arguments[1] === Number) {
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)) {
throw new TypeError('unable to convert exotic object to primitive');
if (hint === 'default' && (isDate(input) || isSymbol(input))) {
return ordinaryToPrimitive(input, hint === 'default' ? 'number' : hint);
/***/ (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.
var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
module.exports = ReactPropTypesSecret;
/***/ (function(module, exports, __webpack_require__) {
var abs = __webpack_require__("nKkb");
var floor = __webpack_require__("UFhG");
var ToNumber = __webpack_require__("Pjai");
var $isNaN = __webpack_require__("HwJD");
var $isFinite = __webpack_require__("ald4");
var $sign = __webpack_require__("6I5v");
// http://ecma-international.org/ecma-262/5.1/#sec-9.4
module.exports = function ToInteger(value) {
var number = ToNumber(value);
if ($isNaN(number)) { return 0; }
if (number === 0 || !$isFinite(number)) { return number; }
return $sign(number) * floor(abs(number));
/***/ (function(module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
exports['default'] = toMomentObject;
var _moment = __webpack_require__("wy2R");
var _moment2 = _interopRequireDefault(_moment);
var _constants = __webpack_require__("Fv1B");
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;
/***/ (function(module, exports, __webpack_require__) {
var GetIntrinsic = __webpack_require__("AM7I");
var $TypeError = GetIntrinsic('%TypeError%');
var CreateDataProperty = __webpack_require__("DvWQ");
var IsPropertyKey = __webpack_require__("i10q");
var Type = __webpack_require__("V1cy");
// // https://ecma-international.org/ecma-262/6.0/#sec-createdatapropertyorthrow
module.exports = function CreateDataPropertyOrThrow(O, P, V) {
if (Type(O) !== 'Object') {
throw new $TypeError('Assertion failed: Type(O) is not Object');
throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true');
var success = CreateDataProperty(O, P, V);
throw new $TypeError('unable to create data property');
/***/ (function(module, exports, __webpack_require__) {
var moment = __webpack_require__("wy2R");
var momentValidationWrapper = __webpack_require__("c6aN");
var core = __webpack_require__("iNdV");
momentObj : core.createMomentChecker(
return typeof obj === 'object';
function isValid(value) {
return momentValidationWrapper.isValidMoment(value);
momentString : core.createMomentChecker(
return typeof str === 'string';
function isValid(value) {
return momentValidationWrapper.isValidMoment(moment(value));
momentDurationObj : core.createMomentChecker(
return typeof obj === 'object';
function isValid(value) {
return moment.isDuration(value);
/***/ (function(module, __webpack_exports__, __webpack_require__) {
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("GRId");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("Tqx9");
/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__);
var chevronUp = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["SVG"], {
xmlns: "http://www.w3.org/2000/svg"
}, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["Path"], {
d: "M6.5 12.4L12 8l5.5 4.4-.9 1.2L12 10l-4.5 3.6-1-1.2z"
/* harmony default export */ __webpack_exports__["a"] = (chevronUp);
/***/ (function(module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
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"); } }; }();