Version Description
12/22/2020 ==
- Fix: Completed tasks tracking causing infinite loop #5941
- Fix: Remove Navigation access #5940
=
Download this release
Release Info
Developer | psealock |
Plugin | WooCommerce Admin |
Version | 1.8.2 |
Comparing to | |
See all releases |
Code changes from version 1.7.2 to 1.8.2
- dist/app/index.js +11945 -12729
dist/app/index.js
CHANGED
@@ -35,7 +35,7 @@ this["wc"] = this["wc"] || {}; this["wc"]["app"] =
|
|
35 |
/******/
|
36 |
/******/ // object to store loaded CSS chunks
|
37 |
/******/ var installedCssChunks = {
|
38 |
-
/******/
|
39 |
/******/ }
|
40 |
/******/ var isCssRtlEnabled = function() {
|
41 |
/******/ return document.dir === 'rtl';
|
@@ -45,14 +45,14 @@ this["wc"] = this["wc"] || {}; this["wc"]["app"] =
|
|
45 |
/******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched
|
46 |
/******/ // Promise = chunk loading, 0 = chunk loaded
|
47 |
/******/ var installedChunks = {
|
48 |
-
/******/
|
49 |
/******/ };
|
50 |
/******/
|
51 |
/******/
|
52 |
/******/
|
53 |
/******/ // script path function
|
54 |
/******/ function webpackJsonpScriptSrc(chunkId) {
|
55 |
-
/******/ return __webpack_require__.p + "chunks/" + ({"10":"activity-panels-help","11":"activity-panels-inbox","12":"
|
56 |
/******/ }
|
57 |
/******/
|
58 |
/******/ function jsonpScriptSrc(chunkId) {
|
@@ -95,7 +95,7 @@ this["wc"] = this["wc"] || {}; this["wc"]["app"] =
|
|
95 |
/******/
|
96 |
/******/
|
97 |
/******/ // mini-css-extract-plugin CSS loading
|
98 |
-
/******/ var cssChunks = {"0":1,"
|
99 |
/******/ if(installedCssChunks[chunkId]) promises.push(installedCssChunks[chunkId]);
|
100 |
/******/ else if(installedCssChunks[chunkId] !== 0 && cssChunks[chunkId]) {
|
101 |
/******/ promises.push(installedCssChunks[chunkId] = new Promise(function(resolve, reject) {
|
@@ -259,19 +259,17 @@ this["wc"] = this["wc"] || {}; this["wc"]["app"] =
|
|
259 |
/******/
|
260 |
/******/
|
261 |
/******/ // Load entry module and return exports
|
262 |
-
/******/ return __webpack_require__(__webpack_require__.s =
|
263 |
/******/ })
|
264 |
/************************************************************************/
|
265 |
-
/******/ (
|
266 |
-
|
267 |
-
/***/ 0:
|
268 |
/***/ (function(module, exports) {
|
269 |
|
270 |
(function() { module.exports = this["wp"]["element"]; }());
|
271 |
|
272 |
/***/ }),
|
273 |
-
|
274 |
-
/***/ 1:
|
275 |
/***/ (function(module, exports, __webpack_require__) {
|
276 |
|
277 |
/**
|
@@ -284,117 +282,221 @@ this["wc"] = this["wc"] || {}; this["wc"]["app"] =
|
|
284 |
if (false) { var throwOnDirectAccess, ReactIs; } else {
|
285 |
// By explicitly using `prop-types` you are opting into new production behavior.
|
286 |
// http://fb.me/prop-types-in-prod
|
287 |
-
module.exports = __webpack_require__(
|
288 |
}
|
289 |
|
290 |
|
291 |
/***/ }),
|
|
|
|
|
292 |
|
293 |
-
|
294 |
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
295 |
-
|
296 |
-
"use strict";
|
297 |
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _getPrototypeOf; });
|
298 |
-
function _getPrototypeOf(o) {
|
299 |
-
_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
|
300 |
-
return o.__proto__ || Object.getPrototypeOf(o);
|
301 |
-
};
|
302 |
-
return _getPrototypeOf(o);
|
303 |
-
}
|
304 |
|
305 |
/***/ }),
|
306 |
-
|
307 |
-
/***/ 100:
|
308 |
/***/ (function(module, exports) {
|
309 |
|
310 |
-
(function() { module.exports = this["
|
311 |
|
312 |
/***/ }),
|
|
|
|
|
313 |
|
314 |
-
|
315 |
-
|
|
|
|
|
|
|
|
|
316 |
|
317 |
-
|
|
|
318 |
|
319 |
-
|
320 |
-
__webpack_require__.d(__webpack_exports__, "a", function() { return /* binding */ get_get; });
|
321 |
|
322 |
-
|
323 |
-
var
|
324 |
|
325 |
-
|
|
|
|
|
326 |
|
327 |
-
|
328 |
-
|
329 |
-
|
330 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
331 |
}
|
332 |
|
333 |
-
return
|
334 |
}
|
335 |
-
// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/get.js
|
336 |
|
337 |
-
|
338 |
-
|
339 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
340 |
} else {
|
341 |
-
|
342 |
-
|
343 |
-
if (!base) return;
|
344 |
-
var desc = Object.getOwnPropertyDescriptor(base, property);
|
345 |
|
346 |
-
|
347 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
348 |
}
|
|
|
349 |
|
350 |
-
|
351 |
-
|
352 |
-
}
|
353 |
|
354 |
-
return
|
355 |
}
|
356 |
|
357 |
/***/ }),
|
|
|
|
|
|
|
|
|
358 |
|
359 |
-
/***/
|
|
|
360 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
361 |
|
362 |
"use strict";
|
363 |
-
|
364 |
-
|
365 |
-
|
366 |
-
|
367 |
-
return cache[arg];
|
368 |
};
|
|
|
369 |
}
|
370 |
|
371 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
372 |
|
|
|
373 |
|
374 |
/***/ }),
|
375 |
-
|
376 |
-
/***/ 103:
|
377 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
378 |
|
379 |
"use strict";
|
380 |
-
|
381 |
-
var
|
382 |
-
|
383 |
-
|
384 |
-
|
385 |
-
|
386 |
-
|
387 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
388 |
}
|
389 |
-
|
|
|
|
|
390 |
}
|
391 |
|
392 |
-
|
|
|
|
|
393 |
|
|
|
|
|
|
|
|
|
|
|
|
|
394 |
|
395 |
-
|
|
|
396 |
|
397 |
-
/***/
|
|
|
398 |
/***/ (function(module, exports) {
|
399 |
|
400 |
function _assertThisInitialized(self) {
|
@@ -408,3092 +510,2892 @@ function _assertThisInitialized(self) {
|
|
408 |
module.exports = _assertThisInitialized;
|
409 |
|
410 |
/***/ }),
|
|
|
|
|
411 |
|
412 |
-
|
413 |
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
414 |
|
415 |
-
"use strict";
|
416 |
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return useMediaQuery; });
|
417 |
-
/* harmony import */ var _babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(26);
|
418 |
-
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(0);
|
419 |
-
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__);
|
420 |
|
|
|
|
|
|
|
421 |
|
422 |
-
|
423 |
-
|
424 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
425 |
|
426 |
-
|
427 |
-
|
428 |
-
|
429 |
-
|
430 |
-
|
431 |
-
*/
|
432 |
|
433 |
-
|
434 |
-
var _useState = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["useState"])(query && window.matchMedia(query).matches),
|
435 |
-
_useState2 = Object(_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])(_useState, 2),
|
436 |
-
match = _useState2[0],
|
437 |
-
setMatch = _useState2[1];
|
438 |
|
439 |
-
|
440 |
-
|
441 |
-
|
442 |
-
}
|
443 |
|
444 |
-
|
445 |
-
|
446 |
-
|
447 |
-
|
448 |
-
|
449 |
-
|
450 |
-
list.addListener(updateMatch);
|
451 |
-
return function () {
|
452 |
-
list.removeListener(updateMatch);
|
453 |
-
};
|
454 |
-
}, [query]);
|
455 |
-
return query && match;
|
456 |
}
|
457 |
-
//# sourceMappingURL=index.js.map
|
458 |
|
459 |
/***/ }),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
460 |
|
461 |
-
/***/
|
|
|
462 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
463 |
|
464 |
"use strict";
|
465 |
|
466 |
// EXPORTS
|
467 |
-
__webpack_require__.d(__webpack_exports__, "
|
468 |
-
__webpack_require__.d(__webpack_exports__, "a", function() { return /* binding */ slot_fill_Fill; });
|
469 |
|
470 |
-
//
|
|
|
|
|
|
|
|
|
|
|
471 |
|
472 |
-
|
473 |
-
|
|
|
474 |
|
475 |
-
|
476 |
-
|
|
|
|
|
477 |
|
478 |
-
|
479 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
480 |
|
481 |
-
|
482 |
-
|
|
|
483 |
|
484 |
-
|
485 |
-
var createClass = __webpack_require__(22);
|
486 |
|
487 |
-
|
488 |
-
|
|
|
489 |
|
490 |
-
|
491 |
-
|
|
|
|
|
|
|
492 |
|
493 |
-
|
494 |
-
var inherits = __webpack_require__(23);
|
495 |
|
496 |
-
|
497 |
-
|
|
|
498 |
|
499 |
-
|
500 |
-
|
|
|
|
|
501 |
|
502 |
-
// EXTERNAL MODULE: external "lodash"
|
503 |
-
var external_lodash_ = __webpack_require__(2);
|
504 |
|
505 |
-
|
506 |
-
|
|
|
|
|
507 |
|
508 |
-
|
|
|
509 |
|
|
|
|
|
|
|
510 |
|
|
|
511 |
|
|
|
|
|
|
|
|
|
512 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
513 |
|
|
|
514 |
|
|
|
|
|
|
|
515 |
|
|
|
516 |
|
|
|
517 |
|
|
|
|
|
|
|
|
|
518 |
|
519 |
-
|
|
|
520 |
|
521 |
-
|
522 |
|
523 |
-
|
524 |
-
|
525 |
-
|
526 |
|
527 |
-
|
528 |
-
* WordPress dependencies
|
529 |
-
*/
|
530 |
|
|
|
|
|
531 |
|
532 |
-
|
533 |
-
|
534 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
535 |
|
|
|
|
|
|
|
536 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
537 |
|
538 |
-
|
539 |
-
|
|
|
|
|
540 |
|
541 |
-
|
|
|
|
|
|
|
|
|
542 |
|
543 |
-
function SlotComponent() {
|
544 |
-
var _this;
|
545 |
|
546 |
-
Object(classCallCheck["a" /* default */])(this, SlotComponent);
|
547 |
|
548 |
-
_this = _super.apply(this, arguments);
|
549 |
-
_this.isUnmounted = false;
|
550 |
-
_this.bindNode = _this.bindNode.bind(Object(assertThisInitialized["a" /* default */])(_this));
|
551 |
-
return _this;
|
552 |
-
}
|
553 |
|
554 |
-
|
555 |
-
|
556 |
-
|
557 |
-
var registerSlot = this.props.registerSlot;
|
558 |
-
registerSlot(this.props.name, this);
|
559 |
-
}
|
560 |
-
}, {
|
561 |
-
key: "componentWillUnmount",
|
562 |
-
value: function componentWillUnmount() {
|
563 |
-
var unregisterSlot = this.props.unregisterSlot;
|
564 |
-
this.isUnmounted = true;
|
565 |
-
unregisterSlot(this.props.name, this);
|
566 |
-
}
|
567 |
-
}, {
|
568 |
-
key: "componentDidUpdate",
|
569 |
-
value: function componentDidUpdate(prevProps) {
|
570 |
-
var _this$props = this.props,
|
571 |
-
name = _this$props.name,
|
572 |
-
unregisterSlot = _this$props.unregisterSlot,
|
573 |
-
registerSlot = _this$props.registerSlot;
|
574 |
|
575 |
-
|
576 |
-
|
577 |
-
|
578 |
-
}
|
579 |
-
}
|
580 |
-
}, {
|
581 |
-
key: "bindNode",
|
582 |
-
value: function bindNode(node) {
|
583 |
-
this.node = node;
|
584 |
-
}
|
585 |
-
}, {
|
586 |
-
key: "forceUpdate",
|
587 |
-
value: function forceUpdate() {
|
588 |
-
if (this.isUnmounted) {
|
589 |
-
return;
|
590 |
-
}
|
591 |
|
592 |
-
|
593 |
-
}
|
594 |
-
}, {
|
595 |
-
key: "render",
|
596 |
-
value: function render() {
|
597 |
-
var _this$props2 = this.props,
|
598 |
-
children = _this$props2.children,
|
599 |
-
name = _this$props2.name,
|
600 |
-
_this$props2$fillProp = _this$props2.fillProps,
|
601 |
-
fillProps = _this$props2$fillProp === void 0 ? {} : _this$props2$fillProp,
|
602 |
-
getFills = _this$props2.getFills;
|
603 |
-
var fills = Object(external_lodash_["map"])(getFills(name, this), function (fill) {
|
604 |
-
var fillKey = fill.occurrence;
|
605 |
-
var fillChildren = Object(external_lodash_["isFunction"])(fill.children) ? fill.children(fillProps) : fill.children;
|
606 |
-
return external_this_wp_element_["Children"].map(fillChildren, function (child, childIndex) {
|
607 |
-
if (!child || Object(external_lodash_["isString"])(child)) {
|
608 |
-
return child;
|
609 |
-
}
|
610 |
|
611 |
-
|
612 |
-
|
613 |
-
|
614 |
-
});
|
615 |
-
});
|
616 |
-
}).filter( // In some cases fills are rendered only when some conditions apply.
|
617 |
-
// This ensures that we only use non-empty fills when rendering, i.e.,
|
618 |
-
// it allows us to render wrappers only when the fills are actually present.
|
619 |
-
Object(external_lodash_["negate"])(external_this_wp_element_["isEmptyElement"]));
|
620 |
-
return Object(external_this_wp_element_["createElement"])(external_this_wp_element_["Fragment"], null, Object(external_lodash_["isFunction"])(children) ? children(fills) : fills);
|
621 |
-
}
|
622 |
-
}]);
|
623 |
-
|
624 |
-
return SlotComponent;
|
625 |
-
}(external_this_wp_element_["Component"]);
|
626 |
-
|
627 |
-
var slot_Slot = function Slot(props) {
|
628 |
-
return Object(external_this_wp_element_["createElement"])(context["a" /* Consumer */], null, function (_ref) {
|
629 |
-
var registerSlot = _ref.registerSlot,
|
630 |
-
unregisterSlot = _ref.unregisterSlot,
|
631 |
-
getFills = _ref.getFills;
|
632 |
-
return Object(external_this_wp_element_["createElement"])(slot_SlotComponent, Object(esm_extends["a" /* default */])({}, props, {
|
633 |
-
registerSlot: registerSlot,
|
634 |
-
unregisterSlot: unregisterSlot,
|
635 |
-
getFills: getFills
|
636 |
-
}));
|
637 |
-
});
|
638 |
-
};
|
639 |
|
640 |
-
|
641 |
-
//# sourceMappingURL=slot.js.map
|
642 |
-
// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/slot-fill/fill.js
|
643 |
|
|
|
|
|
644 |
|
|
|
|
|
645 |
|
646 |
-
|
647 |
-
* External dependencies
|
648 |
-
*/
|
649 |
|
650 |
-
|
651 |
-
|
652 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
653 |
|
|
|
|
|
|
|
|
|
|
|
654 |
|
655 |
-
/**
|
656 |
-
* Internal dependencies
|
657 |
-
*/
|
658 |
|
659 |
|
660 |
-
var occurrences = 0;
|
661 |
|
662 |
-
function
|
663 |
-
|
664 |
-
|
665 |
-
registerFill = _ref.registerFill,
|
666 |
-
unregisterFill = _ref.unregisterFill;
|
667 |
-
var slot = Object(context["c" /* useSlot */])(name);
|
668 |
-
var ref = Object(external_this_wp_element_["useRef"])({
|
669 |
-
name: name,
|
670 |
-
children: children
|
671 |
-
});
|
672 |
|
673 |
-
|
674 |
-
|
675 |
-
|
676 |
|
677 |
-
|
678 |
-
registerFill(name, ref.current);
|
679 |
-
return function () {
|
680 |
-
return unregisterFill(name, ref.current);
|
681 |
-
};
|
682 |
-
}, []);
|
683 |
-
Object(external_this_wp_element_["useLayoutEffect"])(function () {
|
684 |
-
ref.current.children = children;
|
685 |
|
686 |
-
|
687 |
-
|
688 |
-
|
689 |
-
}, [children]);
|
690 |
-
Object(external_this_wp_element_["useLayoutEffect"])(function () {
|
691 |
-
if (name === ref.current.name) {
|
692 |
-
// ignore initial effect
|
693 |
-
return;
|
694 |
-
}
|
695 |
|
696 |
-
|
697 |
-
ref.current.name = name;
|
698 |
-
registerFill(name, ref.current);
|
699 |
-
}, [name]);
|
700 |
|
701 |
-
|
702 |
-
return null;
|
703 |
-
} // If a function is passed as a child, provide it with the fillProps.
|
704 |
|
|
|
705 |
|
706 |
-
|
707 |
-
children = children(slot.props.fillProps);
|
708 |
-
}
|
709 |
|
710 |
-
|
|
|
711 |
}
|
712 |
|
713 |
-
|
714 |
-
return Object(external_this_wp_element_["createElement"])(context["a" /* Consumer */], null, function (_ref2) {
|
715 |
-
var registerFill = _ref2.registerFill,
|
716 |
-
unregisterFill = _ref2.unregisterFill;
|
717 |
-
return Object(external_this_wp_element_["createElement"])(fill_FillComponent, Object(esm_extends["a" /* default */])({}, props, {
|
718 |
-
registerFill: registerFill,
|
719 |
-
unregisterFill: unregisterFill
|
720 |
-
}));
|
721 |
-
});
|
722 |
-
};
|
723 |
-
|
724 |
-
/* harmony default export */ var slot_fill_fill = (fill_Fill);
|
725 |
-
//# sourceMappingURL=fill.js.map
|
726 |
-
// EXTERNAL MODULE: ./node_modules/@wordpress/components/build-module/slot-fill/bubbles-virtually/slot-fill-context.js
|
727 |
-
var slot_fill_context = __webpack_require__(63);
|
728 |
-
|
729 |
-
// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/slot-fill/bubbles-virtually/slot.js
|
730 |
|
|
|
|
|
|
|
731 |
|
|
|
732 |
|
|
|
|
|
|
|
733 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
734 |
/**
|
735 |
-
*
|
736 |
*/
|
737 |
|
|
|
738 |
/**
|
739 |
* Internal dependencies
|
740 |
*/
|
741 |
|
742 |
|
743 |
-
|
744 |
-
|
745 |
-
|
746 |
-
|
747 |
-
|
748 |
-
|
749 |
-
|
|
|
|
|
|
|
|
|
750 |
|
751 |
-
|
752 |
-
var
|
753 |
-
|
754 |
-
registry.registerSlot(name, ref, fillProps);
|
755 |
-
return function () {
|
756 |
-
registry.unregisterSlot(name, ref);
|
757 |
-
}; // We are not including fillProps in the deps because we don't want to
|
758 |
-
// unregister and register the slot whenever fillProps change, which would
|
759 |
-
// cause the fill to be re-mounted. We are only considering the initial value
|
760 |
-
// of fillProps.
|
761 |
-
}, [registry.registerSlot, registry.unregisterSlot, name]); // fillProps may be an update that interacts with the layout, so we
|
762 |
-
// useLayoutEffect
|
763 |
|
764 |
-
|
765 |
-
|
766 |
-
|
767 |
-
|
768 |
-
|
769 |
-
|
770 |
}
|
771 |
-
|
772 |
-
|
773 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
774 |
|
775 |
-
|
776 |
-
var
|
|
|
|
|
|
|
777 |
|
778 |
-
|
|
|
|
|
779 |
|
|
|
780 |
|
781 |
-
|
782 |
-
* WordPress dependencies
|
783 |
-
*/
|
784 |
|
785 |
-
|
786 |
-
* Internal dependencies
|
787 |
-
*/
|
788 |
|
|
|
789 |
|
|
|
|
|
|
|
790 |
|
791 |
-
|
792 |
-
var _useState = Object(external_this_wp_element_["useState"])({}),
|
793 |
-
_useState2 = Object(slicedToArray["a" /* default */])(_useState, 2),
|
794 |
-
setState = _useState2[1];
|
795 |
|
796 |
-
|
797 |
-
|
798 |
-
|
799 |
-
}
|
800 |
|
801 |
-
|
802 |
-
var name = _ref.name,
|
803 |
-
children = _ref.children;
|
804 |
-
var slot = Object(use_slot["a" /* default */])(name);
|
805 |
-
var ref = Object(external_this_wp_element_["useRef"])({
|
806 |
-
rerender: useForceUpdate()
|
807 |
-
});
|
808 |
-
Object(external_this_wp_element_["useEffect"])(function () {
|
809 |
-
// We register fills so we can keep track of their existance.
|
810 |
-
// Some Slot implementations need to know if there're already fills
|
811 |
-
// registered so they can choose to render themselves or not.
|
812 |
-
slot.registerFill(ref);
|
813 |
-
return function () {
|
814 |
-
slot.unregisterFill(ref);
|
815 |
-
};
|
816 |
-
}, [slot.registerFill, slot.unregisterFill]);
|
817 |
|
818 |
-
|
819 |
-
|
820 |
-
|
821 |
|
822 |
-
|
823 |
-
|
824 |
-
}
|
825 |
|
826 |
-
|
827 |
-
|
828 |
-
//# sourceMappingURL=fill.js.map
|
829 |
-
// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/slot-fill/index.js
|
830 |
|
|
|
831 |
|
832 |
|
|
|
833 |
|
834 |
-
|
835 |
-
|
836 |
-
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
837 |
|
|
|
838 |
|
|
|
|
|
839 |
|
|
|
|
|
840 |
|
|
|
|
|
841 |
|
|
|
842 |
|
843 |
-
function slot_fill_Slot(_ref) {
|
844 |
-
var bubblesVirtually = _ref.bubblesVirtually,
|
845 |
-
props = Object(objectWithoutProperties["a" /* default */])(_ref, ["bubblesVirtually"]);
|
846 |
|
847 |
-
if (bubblesVirtually) {
|
848 |
-
return Object(external_this_wp_element_["createElement"])(bubbles_virtually_slot_Slot, props);
|
849 |
-
}
|
850 |
|
851 |
-
return Object(external_this_wp_element_["createElement"])(slot_fill_slot, props);
|
852 |
-
}
|
853 |
-
function slot_fill_Fill(props) {
|
854 |
-
// We're adding both Fills here so they can register themselves before
|
855 |
-
// their respective slot has been registered. Only the Fill that has a slot
|
856 |
-
// will render. The other one will return null.
|
857 |
-
return Object(external_this_wp_element_["createElement"])(external_this_wp_element_["Fragment"], null, Object(external_this_wp_element_["createElement"])(slot_fill_fill, props), Object(external_this_wp_element_["createElement"])(bubbles_virtually_fill_Fill, props));
|
858 |
-
}
|
859 |
-
function createSlotFill(name) {
|
860 |
-
var FillComponent = function FillComponent(props) {
|
861 |
-
return Object(external_this_wp_element_["createElement"])(slot_fill_Fill, Object(esm_extends["a" /* default */])({
|
862 |
-
name: name
|
863 |
-
}, props));
|
864 |
-
};
|
865 |
|
866 |
-
FillComponent.displayName = name + 'Fill';
|
867 |
|
868 |
-
var SlotComponent = function SlotComponent(props) {
|
869 |
-
return Object(external_this_wp_element_["createElement"])(slot_fill_Slot, Object(esm_extends["a" /* default */])({
|
870 |
-
name: name
|
871 |
-
}, props));
|
872 |
-
};
|
873 |
|
874 |
-
SlotComponent.displayName = name + 'Slot';
|
875 |
-
return {
|
876 |
-
Fill: FillComponent,
|
877 |
-
Slot: SlotComponent
|
878 |
-
};
|
879 |
-
}
|
880 |
|
881 |
-
|
882 |
|
883 |
-
|
|
|
|
|
884 |
|
885 |
-
|
886 |
-
|
|
|
|
|
|
|
|
|
887 |
|
888 |
-
|
889 |
|
|
|
|
|
890 |
|
891 |
-
var
|
892 |
-
|
893 |
|
894 |
-
var
|
|
|
|
|
895 |
|
896 |
-
|
897 |
-
|
898 |
-
|
899 |
-
|
|
|
|
|
|
|
|
|
900 |
|
901 |
-
|
902 |
-
|
903 |
-
'default': Format.RFC3986,
|
904 |
-
formatters: {
|
905 |
-
RFC1738: function (value) {
|
906 |
-
return replace.call(value, percentTwenties, '+');
|
907 |
-
},
|
908 |
-
RFC3986: function (value) {
|
909 |
-
return String(value);
|
910 |
-
}
|
911 |
-
}
|
912 |
-
},
|
913 |
-
Format
|
914 |
-
);
|
915 |
|
|
|
|
|
|
|
916 |
|
917 |
-
|
|
|
|
|
|
|
|
|
918 |
|
919 |
-
|
920 |
-
|
|
|
921 |
|
922 |
-
|
923 |
-
|
924 |
-
}
|
|
|
925 |
|
926 |
-
|
|
|
|
|
927 |
|
928 |
-
|
|
|
929 |
|
930 |
-
|
931 |
-
|
|
|
932 |
|
933 |
-
function _iterableToArrayLimit(arr, i) {
|
934 |
-
if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return;
|
935 |
-
var _arr = [];
|
936 |
-
var _n = true;
|
937 |
-
var _d = false;
|
938 |
-
var _e = undefined;
|
939 |
|
940 |
-
|
941 |
-
|
942 |
-
|
|
|
|
|
|
|
943 |
|
944 |
-
|
945 |
-
|
946 |
-
} catch (err) {
|
947 |
-
_d = true;
|
948 |
-
_e = err;
|
949 |
-
} finally {
|
950 |
-
try {
|
951 |
-
if (!_n && _i["return"] != null) _i["return"]();
|
952 |
-
} finally {
|
953 |
-
if (_d) throw _e;
|
954 |
-
}
|
955 |
-
}
|
956 |
|
957 |
-
|
958 |
-
|
|
|
959 |
|
960 |
-
|
|
|
961 |
|
962 |
-
|
|
|
|
|
|
|
|
|
963 |
|
964 |
-
|
965 |
-
|
|
|
966 |
|
967 |
-
|
968 |
-
|
969 |
-
}
|
970 |
|
971 |
-
|
|
|
972 |
|
973 |
-
|
|
|
974 |
|
975 |
-
|
976 |
-
|
|
|
|
|
|
|
977 |
|
978 |
-
|
979 |
-
|
980 |
-
/* harmony import */ var _babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(58);
|
981 |
|
982 |
-
|
983 |
-
if (source == null) return {};
|
984 |
-
var target = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])(source, excluded);
|
985 |
-
var key, i;
|
986 |
|
987 |
-
|
988 |
-
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
989 |
|
990 |
-
|
991 |
-
|
992 |
-
|
993 |
-
|
994 |
-
|
995 |
-
|
996 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
997 |
|
998 |
-
return target;
|
999 |
-
}
|
1000 |
|
1001 |
-
|
|
|
|
|
1002 |
|
1003 |
-
|
1004 |
-
|
|
|
1005 |
|
1006 |
-
|
1007 |
-
|
|
|
|
|
|
|
1008 |
|
1009 |
|
1010 |
/***/ }),
|
|
|
|
|
1011 |
|
1012 |
-
|
1013 |
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
1014 |
|
1015 |
-
|
1016 |
-
/*
|
1017 |
-
|
1018 |
-
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(0);
|
1019 |
-
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__);
|
1020 |
|
1021 |
-
|
1022 |
-
|
1023 |
-
|
1024 |
-
function Dashicon(_ref) {
|
1025 |
-
var icon = _ref.icon,
|
1026 |
-
_ref$size = _ref.size,
|
1027 |
-
size = _ref$size === void 0 ? 20 : _ref$size,
|
1028 |
-
className = _ref.className,
|
1029 |
-
extraProps = Object(_babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"])(_ref, ["icon", "size", "className"]);
|
1030 |
-
|
1031 |
-
var iconClass = ['dashicon', 'dashicons', 'dashicons-' + icon, className].filter(Boolean).join(' ');
|
1032 |
-
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["createElement"])("span", Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])({
|
1033 |
-
className: iconClass,
|
1034 |
-
width: size,
|
1035 |
-
height: size
|
1036 |
-
}, extraProps));
|
1037 |
-
}
|
1038 |
-
|
1039 |
-
/* harmony default export */ __webpack_exports__["a"] = (Dashicon);
|
1040 |
-
//# sourceMappingURL=index.js.map
|
1041 |
|
1042 |
/***/ }),
|
1043 |
-
|
1044 |
-
/***/ 127:
|
1045 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
1046 |
|
1047 |
"use strict";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1048 |
|
1049 |
-
// EXPORTS
|
1050 |
-
__webpack_require__.d(__webpack_exports__, "a", function() { return /* binding */ createBrowserHistory; });
|
1051 |
-
__webpack_require__.d(__webpack_exports__, "c", function() { return /* binding */ createMemoryHistory; });
|
1052 |
-
__webpack_require__.d(__webpack_exports__, "b", function() { return /* binding */ createLocation; });
|
1053 |
-
__webpack_require__.d(__webpack_exports__, "e", function() { return /* binding */ locationsAreEqual; });
|
1054 |
-
__webpack_require__.d(__webpack_exports__, "d", function() { return /* binding */ createPath; });
|
1055 |
-
|
1056 |
-
// UNUSED EXPORTS: createHashHistory, parsePath
|
1057 |
-
|
1058 |
-
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/extends.js
|
1059 |
-
var esm_extends = __webpack_require__(7);
|
1060 |
|
1061 |
-
|
1062 |
-
|
1063 |
-
|
1064 |
-
|
1065 |
|
1066 |
-
|
1067 |
-
|
1068 |
-
|
1069 |
-
|
|
|
1070 |
}
|
1071 |
|
1072 |
-
|
1073 |
-
}
|
1074 |
-
|
1075 |
-
|
1076 |
-
|
1077 |
-
|
1078 |
-
|
1079 |
-
|
1080 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1081 |
|
1082 |
-
|
1083 |
-
var
|
1084 |
-
var
|
|
|
|
|
1085 |
|
1086 |
-
if (
|
1087 |
-
|
1088 |
-
fromParts = toParts;
|
1089 |
-
} else if (toParts.length) {
|
1090 |
-
// to is relative, drop the filename
|
1091 |
-
fromParts.pop();
|
1092 |
-
fromParts = fromParts.concat(toParts);
|
1093 |
}
|
1094 |
|
1095 |
-
|
1096 |
-
|
1097 |
-
|
1098 |
-
|
1099 |
-
|
1100 |
-
|
1101 |
-
|
1102 |
-
|
1103 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1104 |
|
1105 |
-
|
1106 |
-
|
1107 |
-
|
|
|
1108 |
|
1109 |
-
|
1110 |
-
|
1111 |
-
} else if (part === '..') {
|
1112 |
-
spliceOne(fromParts, i);
|
1113 |
-
up++;
|
1114 |
-
} else if (up) {
|
1115 |
-
spliceOne(fromParts, i);
|
1116 |
-
up--;
|
1117 |
-
}
|
1118 |
}
|
1119 |
|
1120 |
-
|
1121 |
-
|
1122 |
-
if (
|
1123 |
-
mustEndAbs &&
|
1124 |
-
fromParts[0] !== '' &&
|
1125 |
-
(!fromParts[0] || !isAbsolute(fromParts[0]))
|
1126 |
-
)
|
1127 |
-
fromParts.unshift('');
|
1128 |
-
|
1129 |
-
var result = fromParts.join('/');
|
1130 |
-
|
1131 |
-
if (hasTrailingSlash && result.substr(-1) !== '/') result += '/';
|
1132 |
-
|
1133 |
-
return result;
|
1134 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
1135 |
|
1136 |
-
|
1137 |
-
|
1138 |
-
// CONCATENATED MODULE: ./node_modules/value-equal/esm/value-equal.js
|
1139 |
-
function value_equal_valueOf(obj) {
|
1140 |
-
return obj.valueOf ? obj.valueOf() : Object.prototype.valueOf.call(obj);
|
1141 |
}
|
1142 |
|
1143 |
-
|
1144 |
-
|
1145 |
-
|
1146 |
-
|
1147 |
-
// Otherwise, if either of them == null they are not equal.
|
1148 |
-
if (a == null || b == null) return false;
|
1149 |
-
|
1150 |
-
if (Array.isArray(a)) {
|
1151 |
-
return (
|
1152 |
-
Array.isArray(b) &&
|
1153 |
-
a.length === b.length &&
|
1154 |
-
a.every(function(item, index) {
|
1155 |
-
return valueEqual(item, b[index]);
|
1156 |
-
})
|
1157 |
-
);
|
1158 |
-
}
|
1159 |
|
1160 |
-
|
1161 |
-
|
1162 |
-
var
|
|
|
1163 |
|
1164 |
-
|
|
|
|
|
|
|
|
|
|
|
1165 |
|
1166 |
-
return
|
1167 |
-
|
1168 |
-
});
|
1169 |
-
}
|
1170 |
|
1171 |
-
return
|
1172 |
}
|
1173 |
|
1174 |
-
|
1175 |
-
|
1176 |
-
// EXTERNAL MODULE: ./node_modules/tiny-invariant/dist/tiny-invariant.esm.js
|
1177 |
-
var tiny_invariant_esm = __webpack_require__(103);
|
1178 |
-
|
1179 |
-
// CONCATENATED MODULE: ./node_modules/history/esm/history.js
|
1180 |
|
|
|
|
|
|
|
1181 |
|
|
|
1182 |
|
|
|
|
|
1183 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1184 |
|
|
|
|
|
|
|
1185 |
|
1186 |
-
|
1187 |
-
|
1188 |
-
|
1189 |
-
|
1190 |
-
|
1191 |
-
|
1192 |
-
|
1193 |
-
|
1194 |
-
|
1195 |
-
|
1196 |
-
|
1197 |
-
|
1198 |
-
|
1199 |
-
|
1200 |
-
}
|
1201 |
-
function parsePath(path) {
|
1202 |
-
var pathname = path || '/';
|
1203 |
-
var search = '';
|
1204 |
-
var hash = '';
|
1205 |
-
var hashIndex = pathname.indexOf('#');
|
1206 |
|
1207 |
-
if (hashIndex !== -1) {
|
1208 |
-
hash = pathname.substr(hashIndex);
|
1209 |
-
pathname = pathname.substr(0, hashIndex);
|
1210 |
-
}
|
1211 |
|
1212 |
-
|
|
|
|
|
1213 |
|
1214 |
-
|
1215 |
-
|
1216 |
-
pathname = pathname.substr(0, searchIndex);
|
1217 |
-
}
|
1218 |
|
1219 |
-
|
1220 |
-
|
1221 |
-
|
1222 |
-
|
1223 |
-
|
1224 |
-
}
|
1225 |
-
|
1226 |
-
|
1227 |
-
|
1228 |
-
|
1229 |
-
|
1230 |
-
|
1231 |
-
|
1232 |
-
return
|
1233 |
}
|
1234 |
|
1235 |
-
|
1236 |
-
var location;
|
1237 |
|
1238 |
-
|
1239 |
-
|
1240 |
-
|
1241 |
-
|
1242 |
-
|
1243 |
-
|
1244 |
-
|
1245 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1246 |
|
1247 |
-
|
1248 |
-
if (location.search.charAt(0) !== '?') location.search = '?' + location.search;
|
1249 |
-
} else {
|
1250 |
-
location.search = '';
|
1251 |
-
}
|
1252 |
|
1253 |
-
|
1254 |
-
|
1255 |
-
} else {
|
1256 |
-
location.hash = '';
|
1257 |
-
}
|
1258 |
|
1259 |
-
|
1260 |
-
}
|
1261 |
|
1262 |
-
try {
|
1263 |
-
location.pathname = decodeURI(location.pathname);
|
1264 |
-
} catch (e) {
|
1265 |
-
if (e instanceof URIError) {
|
1266 |
-
throw new URIError('Pathname "' + location.pathname + '" could not be decoded. ' + 'This is likely caused by an invalid percent-encoding.');
|
1267 |
-
} else {
|
1268 |
-
throw e;
|
1269 |
-
}
|
1270 |
-
}
|
1271 |
|
1272 |
-
if (key) location.key = key;
|
1273 |
|
1274 |
-
if (currentLocation) {
|
1275 |
-
// Resolve incomplete/relative pathname relative to current location.
|
1276 |
-
if (!location.pathname) {
|
1277 |
-
location.pathname = currentLocation.pathname;
|
1278 |
-
} else if (location.pathname.charAt(0) !== '/') {
|
1279 |
-
location.pathname = resolve_pathname(location.pathname, currentLocation.pathname);
|
1280 |
-
}
|
1281 |
-
} else {
|
1282 |
-
// When there is no prior location and pathname is empty, set it to /
|
1283 |
-
if (!location.pathname) {
|
1284 |
-
location.pathname = '/';
|
1285 |
-
}
|
1286 |
-
}
|
1287 |
|
1288 |
-
|
1289 |
-
|
1290 |
-
|
1291 |
-
|
1292 |
-
}
|
1293 |
|
1294 |
-
function
|
1295 |
-
|
|
|
1296 |
|
1297 |
-
|
1298 |
-
|
1299 |
-
|
1300 |
-
return function () {
|
1301 |
-
if (prompt === nextPrompt) prompt = null;
|
1302 |
-
};
|
1303 |
-
}
|
1304 |
|
1305 |
-
|
1306 |
-
|
1307 |
-
|
1308 |
-
// best way to handle this.
|
1309 |
-
if (prompt != null) {
|
1310 |
-
var result = typeof prompt === 'function' ? prompt(location, action) : prompt;
|
1311 |
|
1312 |
-
|
1313 |
-
|
1314 |
-
|
1315 |
-
|
1316 |
-
|
1317 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1318 |
}
|
1319 |
-
} else {
|
1320 |
-
// Return false from a transition hook to cancel the transition.
|
1321 |
-
callback(result !== false);
|
1322 |
}
|
1323 |
-
} else {
|
1324 |
-
callback(true);
|
1325 |
-
}
|
1326 |
}
|
1327 |
|
1328 |
-
|
|
|
|
|
1329 |
|
1330 |
-
|
1331 |
-
|
1332 |
|
1333 |
-
|
1334 |
-
if (isActive) fn.apply(void 0, arguments);
|
1335 |
-
}
|
1336 |
|
1337 |
-
|
1338 |
-
|
1339 |
-
|
1340 |
-
|
1341 |
-
|
1342 |
-
});
|
1343 |
-
};
|
1344 |
}
|
1345 |
|
1346 |
-
|
1347 |
-
|
1348 |
-
args[_key] = arguments[_key];
|
1349 |
-
}
|
1350 |
|
1351 |
-
|
1352 |
-
return listener.apply(void 0, args);
|
1353 |
-
});
|
1354 |
}
|
1355 |
|
1356 |
-
|
1357 |
-
|
1358 |
-
|
1359 |
-
|
1360 |
-
|
1361 |
-
};
|
1362 |
-
}
|
1363 |
|
1364 |
-
|
1365 |
-
|
1366 |
-
|
1367 |
-
|
1368 |
-
|
1369 |
-
|
1370 |
-
|
1371 |
-
|
1372 |
-
|
1373 |
-
|
1374 |
-
*/
|
1375 |
|
1376 |
-
|
1377 |
-
|
1378 |
-
if ((ua.indexOf('Android 2.') !== -1 || ua.indexOf('Android 4.0') !== -1) && ua.indexOf('Mobile Safari') !== -1 && ua.indexOf('Chrome') === -1 && ua.indexOf('Windows Phone') === -1) return false;
|
1379 |
-
return window.history && 'pushState' in window.history;
|
1380 |
-
}
|
1381 |
-
/**
|
1382 |
-
* Returns true if browser fires popstate on hash change.
|
1383 |
-
* IE10 and IE11 do not.
|
1384 |
-
*/
|
1385 |
|
1386 |
-
|
1387 |
-
|
1388 |
-
|
1389 |
-
|
1390 |
-
|
1391 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
1392 |
|
1393 |
-
|
1394 |
-
return window.navigator.userAgent.indexOf('Firefox') === -1;
|
1395 |
-
}
|
1396 |
-
/**
|
1397 |
-
* Returns true if a given popstate event is an extraneous WebKit event.
|
1398 |
-
* Accounts for the fact that Chrome on iOS fires real popstate events
|
1399 |
-
* containing undefined state when pressing the back button.
|
1400 |
-
*/
|
1401 |
|
1402 |
-
|
1403 |
-
return event.state === undefined && navigator.userAgent.indexOf('CriOS') === -1;
|
1404 |
-
}
|
1405 |
|
1406 |
-
|
1407 |
-
|
1408 |
|
1409 |
-
|
1410 |
-
|
1411 |
-
return window.history.state || {};
|
1412 |
-
} catch (e) {
|
1413 |
-
// IE 11 sometimes throws when accessing window.history.state
|
1414 |
-
// See https://github.com/ReactTraining/history/pull/289
|
1415 |
-
return {};
|
1416 |
-
}
|
1417 |
-
}
|
1418 |
-
/**
|
1419 |
-
* Creates a history object that uses the HTML5 history API including
|
1420 |
-
* pushState, replaceState, and the popstate event.
|
1421 |
-
*/
|
1422 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1423 |
|
1424 |
-
|
1425 |
-
|
1426 |
-
props = {};
|
1427 |
-
}
|
1428 |
|
1429 |
-
|
1430 |
-
|
1431 |
-
var canUseHistory = supportsHistory();
|
1432 |
-
var needsHashChangeListener = !supportsPopStateOnHashChange();
|
1433 |
-
var _props = props,
|
1434 |
-
_props$forceRefresh = _props.forceRefresh,
|
1435 |
-
forceRefresh = _props$forceRefresh === void 0 ? false : _props$forceRefresh,
|
1436 |
-
_props$getUserConfirm = _props.getUserConfirmation,
|
1437 |
-
getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation : _props$getUserConfirm,
|
1438 |
-
_props$keyLength = _props.keyLength,
|
1439 |
-
keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;
|
1440 |
-
var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : '';
|
1441 |
|
1442 |
-
|
1443 |
-
|
1444 |
-
key = _ref.key,
|
1445 |
-
state = _ref.state;
|
1446 |
|
1447 |
-
var _window$location = window.location,
|
1448 |
-
pathname = _window$location.pathname,
|
1449 |
-
search = _window$location.search,
|
1450 |
-
hash = _window$location.hash;
|
1451 |
-
var path = pathname + search + hash;
|
1452 |
-
false ? undefined : void 0;
|
1453 |
-
if (basename) path = stripBasename(path, basename);
|
1454 |
-
return createLocation(path, state, key);
|
1455 |
-
}
|
1456 |
|
1457 |
-
|
1458 |
-
return
|
1459 |
}
|
1460 |
|
1461 |
-
var
|
1462 |
|
1463 |
-
|
1464 |
-
Object(esm_extends["a" /* default */])(history, nextState);
|
1465 |
|
1466 |
-
|
1467 |
-
|
1468 |
-
}
|
1469 |
|
1470 |
-
|
1471 |
-
|
1472 |
-
if (isExtraneousPopstateEvent(event)) return;
|
1473 |
-
handlePop(getDOMLocation(event.state));
|
1474 |
-
}
|
1475 |
|
1476 |
-
|
1477 |
-
|
1478 |
-
|
|
|
|
|
|
|
|
|
1479 |
|
1480 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1481 |
|
1482 |
-
|
1483 |
-
|
1484 |
-
|
1485 |
-
|
1486 |
-
|
1487 |
-
|
1488 |
-
transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {
|
1489 |
-
if (ok) {
|
1490 |
-
setState({
|
1491 |
-
action: action,
|
1492 |
-
location: location
|
1493 |
-
});
|
1494 |
} else {
|
1495 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1496 |
}
|
1497 |
-
}
|
1498 |
}
|
1499 |
}
|
1500 |
|
1501 |
-
|
1502 |
-
|
1503 |
-
// keeping a list of keys we've seen in sessionStorage.
|
1504 |
-
// Instead, we just default to 0 for keys we don't know.
|
1505 |
|
1506 |
-
|
1507 |
-
|
1508 |
-
var fromIndex = allKeys.indexOf(fromLocation.key);
|
1509 |
-
if (fromIndex === -1) fromIndex = 0;
|
1510 |
-
var delta = toIndex - fromIndex;
|
1511 |
|
1512 |
-
|
1513 |
-
|
1514 |
-
go(delta);
|
1515 |
-
}
|
1516 |
-
}
|
1517 |
|
1518 |
-
var initialLocation = getDOMLocation(getHistoryState());
|
1519 |
-
var allKeys = [initialLocation.key]; // Public interface
|
1520 |
|
1521 |
-
|
1522 |
-
|
|
|
|
|
1523 |
}
|
1524 |
|
1525 |
-
|
1526 |
-
|
1527 |
-
|
1528 |
-
|
1529 |
-
transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {
|
1530 |
-
if (!ok) return;
|
1531 |
-
var href = createHref(location);
|
1532 |
-
var key = location.key,
|
1533 |
-
state = location.state;
|
1534 |
|
1535 |
-
|
1536 |
-
|
1537 |
-
|
1538 |
-
|
1539 |
-
|
1540 |
|
1541 |
-
|
1542 |
-
|
1543 |
-
} else {
|
1544 |
-
var prevIndex = allKeys.indexOf(history.location.key);
|
1545 |
-
var nextKeys = allKeys.slice(0, prevIndex + 1);
|
1546 |
-
nextKeys.push(location.key);
|
1547 |
-
allKeys = nextKeys;
|
1548 |
-
setState({
|
1549 |
-
action: action,
|
1550 |
-
location: location
|
1551 |
-
});
|
1552 |
-
}
|
1553 |
-
} else {
|
1554 |
-
false ? undefined : void 0;
|
1555 |
-
window.location.href = href;
|
1556 |
-
}
|
1557 |
-
});
|
1558 |
-
}
|
1559 |
|
1560 |
-
function replace(path, state) {
|
1561 |
-
false ? undefined : void 0;
|
1562 |
-
var action = 'REPLACE';
|
1563 |
-
var location = createLocation(path, state, createKey(), history.location);
|
1564 |
-
transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {
|
1565 |
-
if (!ok) return;
|
1566 |
-
var href = createHref(location);
|
1567 |
-
var key = location.key,
|
1568 |
-
state = location.state;
|
1569 |
|
1570 |
-
|
1571 |
-
|
1572 |
-
key: key,
|
1573 |
-
state: state
|
1574 |
-
}, null, href);
|
1575 |
|
1576 |
-
|
1577 |
-
|
1578 |
-
} else {
|
1579 |
-
var prevIndex = allKeys.indexOf(history.location.key);
|
1580 |
-
if (prevIndex !== -1) allKeys[prevIndex] = location.key;
|
1581 |
-
setState({
|
1582 |
-
action: action,
|
1583 |
-
location: location
|
1584 |
-
});
|
1585 |
-
}
|
1586 |
-
} else {
|
1587 |
-
false ? undefined : void 0;
|
1588 |
-
window.location.replace(href);
|
1589 |
-
}
|
1590 |
-
});
|
1591 |
-
}
|
1592 |
|
1593 |
-
|
1594 |
-
|
1595 |
}
|
1596 |
|
1597 |
-
|
1598 |
-
go(-1);
|
1599 |
-
}
|
1600 |
|
1601 |
-
|
1602 |
-
go(1);
|
1603 |
-
}
|
1604 |
|
1605 |
-
var listenerCount = 0;
|
1606 |
|
1607 |
-
|
1608 |
-
|
|
|
1609 |
|
1610 |
-
|
1611 |
-
|
1612 |
-
|
1613 |
-
} else if (listenerCount === 0) {
|
1614 |
-
window.removeEventListener(PopStateEvent, handlePopState);
|
1615 |
-
if (needsHashChangeListener) window.removeEventListener(HashChangeEvent, handleHashChange);
|
1616 |
-
}
|
1617 |
}
|
1618 |
|
1619 |
-
var
|
1620 |
-
|
1621 |
-
function block(prompt) {
|
1622 |
-
if (prompt === void 0) {
|
1623 |
-
prompt = false;
|
1624 |
-
}
|
1625 |
|
1626 |
-
|
1627 |
|
1628 |
-
|
1629 |
-
|
1630 |
-
|
1631 |
-
|
|
|
|
|
1632 |
|
1633 |
-
return function () {
|
1634 |
-
if (isBlocked) {
|
1635 |
-
isBlocked = false;
|
1636 |
-
checkDOMListeners(-1);
|
1637 |
-
}
|
1638 |
|
1639 |
-
return unblock();
|
1640 |
-
};
|
1641 |
-
}
|
1642 |
|
1643 |
-
function listen(listener) {
|
1644 |
-
var unlisten = transitionManager.appendListener(listener);
|
1645 |
-
checkDOMListeners(1);
|
1646 |
-
return function () {
|
1647 |
-
checkDOMListeners(-1);
|
1648 |
-
unlisten();
|
1649 |
-
};
|
1650 |
-
}
|
1651 |
|
1652 |
-
|
1653 |
-
|
1654 |
-
|
1655 |
-
location: initialLocation,
|
1656 |
-
createHref: createHref,
|
1657 |
-
push: push,
|
1658 |
-
replace: replace,
|
1659 |
-
go: go,
|
1660 |
-
goBack: goBack,
|
1661 |
-
goForward: goForward,
|
1662 |
-
block: block,
|
1663 |
-
listen: listen
|
1664 |
-
};
|
1665 |
-
return history;
|
1666 |
-
}
|
1667 |
|
1668 |
-
|
1669 |
-
|
1670 |
-
|
1671 |
-
|
1672 |
-
|
1673 |
-
|
1674 |
-
|
1675 |
-
|
|
|
|
|
|
|
1676 |
}
|
1677 |
-
}
|
1678 |
-
|
1679 |
-
encodePath: stripLeadingSlash,
|
1680 |
-
decodePath: addLeadingSlash
|
1681 |
-
},
|
1682 |
-
slash: {
|
1683 |
-
encodePath: addLeadingSlash,
|
1684 |
-
decodePath: addLeadingSlash
|
1685 |
-
}
|
1686 |
-
};
|
1687 |
-
|
1688 |
-
function stripHash(url) {
|
1689 |
-
var hashIndex = url.indexOf('#');
|
1690 |
-
return hashIndex === -1 ? url : url.slice(0, hashIndex);
|
1691 |
}
|
|
|
|
|
1692 |
|
1693 |
-
|
1694 |
-
//
|
1695 |
-
//
|
1696 |
-
|
1697 |
-
|
1698 |
-
|
1699 |
-
|
|
|
|
|
|
|
|
|
|
|
1700 |
|
1701 |
-
|
1702 |
-
|
1703 |
-
}
|
1704 |
|
1705 |
-
|
1706 |
-
|
1707 |
-
}
|
1708 |
|
1709 |
-
|
1710 |
-
|
1711 |
-
props = {};
|
1712 |
}
|
|
|
1713 |
|
1714 |
-
!canUseDOM ? false ? undefined : Object(tiny_invariant_esm["a" /* default */])(false) : void 0;
|
1715 |
-
var globalHistory = window.history;
|
1716 |
-
var canGoWithoutReload = supportsGoWithoutReloadUsingHash();
|
1717 |
-
var _props = props,
|
1718 |
-
_props$getUserConfirm = _props.getUserConfirmation,
|
1719 |
-
getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation : _props$getUserConfirm,
|
1720 |
-
_props$hashType = _props.hashType,
|
1721 |
-
hashType = _props$hashType === void 0 ? 'slash' : _props$hashType;
|
1722 |
-
var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : '';
|
1723 |
-
var _HashPathCoders$hashT = HashPathCoders[hashType],
|
1724 |
-
encodePath = _HashPathCoders$hashT.encodePath,
|
1725 |
-
decodePath = _HashPathCoders$hashT.decodePath;
|
1726 |
|
1727 |
-
function getDOMLocation() {
|
1728 |
-
var path = decodePath(getHashPath());
|
1729 |
-
false ? undefined : void 0;
|
1730 |
-
if (basename) path = stripBasename(path, basename);
|
1731 |
-
return createLocation(path);
|
1732 |
-
}
|
1733 |
|
1734 |
-
var transitionManager = createTransitionManager();
|
1735 |
|
1736 |
-
|
1737 |
-
|
|
|
1738 |
|
1739 |
-
|
1740 |
-
|
|
|
|
|
|
|
1741 |
}
|
1742 |
|
1743 |
-
|
1744 |
-
|
1745 |
-
|
1746 |
-
|
1747 |
-
|
1748 |
-
|
1749 |
-
|
1750 |
-
function handleHashChange() {
|
1751 |
-
var path = getHashPath();
|
1752 |
-
var encodedPath = encodePath(path);
|
1753 |
|
1754 |
-
|
1755 |
-
|
1756 |
-
|
1757 |
-
|
1758 |
-
var location = getDOMLocation();
|
1759 |
-
var prevLocation = history.location;
|
1760 |
-
if (!forceNextPop && locationsAreEqual$$1(prevLocation, location)) return; // A hashchange doesn't always == location change.
|
1761 |
|
1762 |
-
|
|
|
|
|
|
|
1763 |
|
1764 |
-
|
1765 |
-
|
1766 |
-
|
|
|
|
|
|
|
|
|
|
|
1767 |
}
|
1768 |
|
1769 |
-
|
1770 |
-
|
1771 |
-
forceNextPop = false;
|
1772 |
-
setState();
|
1773 |
-
} else {
|
1774 |
-
var action = 'POP';
|
1775 |
-
transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {
|
1776 |
-
if (ok) {
|
1777 |
-
setState({
|
1778 |
-
action: action,
|
1779 |
-
location: location
|
1780 |
-
});
|
1781 |
-
} else {
|
1782 |
-
revertPop(location);
|
1783 |
-
}
|
1784 |
-
});
|
1785 |
-
}
|
1786 |
-
}
|
1787 |
|
1788 |
-
|
1789 |
-
|
1790 |
-
|
1791 |
-
// Instead, we just default to 0 for paths we don't know.
|
1792 |
|
1793 |
-
|
1794 |
-
if (toIndex === -1) toIndex = 0;
|
1795 |
-
var fromIndex = allPaths.lastIndexOf(createPath(fromLocation));
|
1796 |
-
if (fromIndex === -1) fromIndex = 0;
|
1797 |
-
var delta = toIndex - fromIndex;
|
1798 |
|
1799 |
-
|
1800 |
-
|
1801 |
-
|
1802 |
-
|
1803 |
-
} // Ensure the hash is encoded properly before doing anything else.
|
1804 |
|
|
|
1805 |
|
1806 |
-
|
1807 |
-
|
1808 |
-
|
1809 |
-
|
1810 |
-
|
1811 |
|
1812 |
-
|
1813 |
-
|
1814 |
-
|
|
|
|
|
|
|
|
|
|
|
1815 |
|
1816 |
-
|
1817 |
-
|
1818 |
-
|
|
|
|
|
|
|
1819 |
|
1820 |
-
|
1821 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1822 |
|
1823 |
-
|
1824 |
-
|
1825 |
-
|
1826 |
-
|
1827 |
-
|
1828 |
-
|
1829 |
-
|
1830 |
-
|
1831 |
-
|
|
|
|
|
|
|
|
|
1832 |
|
1833 |
-
|
1834 |
-
|
1835 |
-
// rather setState here and ignore the hashchange. The caveat here
|
1836 |
-
// is that other hash histories in the page will consider it a POP.
|
1837 |
-
ignorePath = path;
|
1838 |
-
pushHashPath(encodedPath);
|
1839 |
-
var prevIndex = allPaths.lastIndexOf(createPath(history.location));
|
1840 |
-
var nextPaths = allPaths.slice(0, prevIndex + 1);
|
1841 |
-
nextPaths.push(path);
|
1842 |
-
allPaths = nextPaths;
|
1843 |
-
setState({
|
1844 |
-
action: action,
|
1845 |
-
location: location
|
1846 |
-
});
|
1847 |
-
} else {
|
1848 |
-
false ? undefined : void 0;
|
1849 |
-
setState();
|
1850 |
-
}
|
1851 |
-
});
|
1852 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1853 |
|
1854 |
-
function replace(path, state) {
|
1855 |
-
false ? undefined : void 0;
|
1856 |
-
var action = 'REPLACE';
|
1857 |
-
var location = createLocation(path, undefined, undefined, history.location);
|
1858 |
-
transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {
|
1859 |
-
if (!ok) return;
|
1860 |
-
var path = createPath(location);
|
1861 |
-
var encodedPath = encodePath(basename + path);
|
1862 |
-
var hashChanged = getHashPath() !== encodedPath;
|
1863 |
|
1864 |
-
|
1865 |
-
// We cannot tell if a hashchange was caused by a REPLACE, so we'd
|
1866 |
-
// rather setState here and ignore the hashchange. The caveat here
|
1867 |
-
// is that other hash histories in the page will consider it a POP.
|
1868 |
-
ignorePath = path;
|
1869 |
-
replaceHashPath(encodedPath);
|
1870 |
-
}
|
1871 |
|
1872 |
-
|
1873 |
-
|
1874 |
-
|
1875 |
-
|
1876 |
-
location: location
|
1877 |
-
});
|
1878 |
-
});
|
1879 |
-
}
|
1880 |
|
1881 |
-
|
1882 |
-
|
1883 |
-
|
1884 |
-
}
|
1885 |
|
1886 |
-
|
1887 |
-
go(-1);
|
1888 |
-
}
|
1889 |
|
1890 |
-
|
1891 |
-
|
1892 |
-
|
|
|
1893 |
|
1894 |
-
|
1895 |
|
1896 |
-
|
1897 |
-
|
1898 |
|
1899 |
-
|
1900 |
-
|
1901 |
-
} else if (listenerCount === 0) {
|
1902 |
-
window.removeEventListener(HashChangeEvent$1, handleHashChange);
|
1903 |
-
}
|
1904 |
-
}
|
1905 |
|
1906 |
-
|
|
|
1907 |
|
1908 |
-
|
1909 |
-
if (prompt === void 0) {
|
1910 |
-
prompt = false;
|
1911 |
-
}
|
1912 |
|
1913 |
-
|
1914 |
|
1915 |
-
|
1916 |
-
|
1917 |
-
isBlocked = true;
|
1918 |
-
}
|
1919 |
-
|
1920 |
-
return function () {
|
1921 |
-
if (isBlocked) {
|
1922 |
-
isBlocked = false;
|
1923 |
-
checkDOMListeners(-1);
|
1924 |
-
}
|
1925 |
|
1926 |
-
|
1927 |
-
};
|
1928 |
-
}
|
1929 |
|
1930 |
-
|
1931 |
-
var unlisten = transitionManager.appendListener(listener);
|
1932 |
-
checkDOMListeners(1);
|
1933 |
-
return function () {
|
1934 |
-
checkDOMListeners(-1);
|
1935 |
-
unlisten();
|
1936 |
-
};
|
1937 |
-
}
|
1938 |
|
1939 |
-
|
1940 |
-
length: globalHistory.length,
|
1941 |
-
action: 'POP',
|
1942 |
-
location: initialLocation,
|
1943 |
-
createHref: createHref,
|
1944 |
-
push: push,
|
1945 |
-
replace: replace,
|
1946 |
-
go: go,
|
1947 |
-
goBack: goBack,
|
1948 |
-
goForward: goForward,
|
1949 |
-
block: block,
|
1950 |
-
listen: listen
|
1951 |
-
};
|
1952 |
-
return history;
|
1953 |
-
}
|
1954 |
|
1955 |
-
|
1956 |
-
|
1957 |
-
}
|
1958 |
-
/**
|
1959 |
-
* Creates a history object that stores locations in memory.
|
1960 |
-
*/
|
1961 |
|
|
|
|
|
1962 |
|
1963 |
-
|
1964 |
-
|
1965 |
-
|
1966 |
-
|
|
|
|
|
|
|
1967 |
|
1968 |
-
|
1969 |
-
getUserConfirmation = _props.getUserConfirmation,
|
1970 |
-
_props$initialEntries = _props.initialEntries,
|
1971 |
-
initialEntries = _props$initialEntries === void 0 ? ['/'] : _props$initialEntries,
|
1972 |
-
_props$initialIndex = _props.initialIndex,
|
1973 |
-
initialIndex = _props$initialIndex === void 0 ? 0 : _props$initialIndex,
|
1974 |
-
_props$keyLength = _props.keyLength,
|
1975 |
-
keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;
|
1976 |
-
var transitionManager = createTransitionManager();
|
1977 |
|
1978 |
-
function setState(nextState) {
|
1979 |
-
Object(esm_extends["a" /* default */])(history, nextState);
|
1980 |
|
1981 |
-
|
1982 |
-
|
|
|
|
|
|
|
1983 |
}
|
|
|
1984 |
|
1985 |
-
|
1986 |
-
|
|
|
|
|
|
|
|
|
1987 |
}
|
1988 |
|
1989 |
-
|
1990 |
-
|
1991 |
-
|
1992 |
-
}); // Public interface
|
1993 |
|
1994 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1995 |
|
1996 |
-
|
1997 |
-
|
1998 |
-
|
1999 |
-
|
2000 |
-
transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {
|
2001 |
-
if (!ok) return;
|
2002 |
-
var prevIndex = history.index;
|
2003 |
-
var nextIndex = prevIndex + 1;
|
2004 |
-
var nextEntries = history.entries.slice(0);
|
2005 |
|
2006 |
-
|
2007 |
-
nextEntries.splice(nextIndex, nextEntries.length - nextIndex, location);
|
2008 |
-
} else {
|
2009 |
-
nextEntries.push(location);
|
2010 |
-
}
|
2011 |
|
2012 |
-
|
2013 |
-
|
2014 |
-
|
2015 |
-
|
2016 |
-
|
2017 |
-
|
2018 |
-
});
|
2019 |
-
}
|
2020 |
|
2021 |
-
|
2022 |
-
false ? undefined : void 0;
|
2023 |
-
var action = 'REPLACE';
|
2024 |
-
var location = createLocation(path, state, createKey(), history.location);
|
2025 |
-
transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {
|
2026 |
-
if (!ok) return;
|
2027 |
-
history.entries[history.index] = location;
|
2028 |
-
setState({
|
2029 |
-
action: action,
|
2030 |
-
location: location
|
2031 |
-
});
|
2032 |
-
});
|
2033 |
-
}
|
2034 |
|
2035 |
-
|
2036 |
-
|
2037 |
-
var action = 'POP';
|
2038 |
-
var location = history.entries[nextIndex];
|
2039 |
-
transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {
|
2040 |
-
if (ok) {
|
2041 |
-
setState({
|
2042 |
-
action: action,
|
2043 |
-
location: location,
|
2044 |
-
index: nextIndex
|
2045 |
-
});
|
2046 |
} else {
|
2047 |
-
|
2048 |
-
// causing a render after a cancelled POP.
|
2049 |
-
setState();
|
2050 |
}
|
2051 |
-
});
|
2052 |
-
}
|
2053 |
|
2054 |
-
|
2055 |
-
|
2056 |
-
|
2057 |
|
2058 |
-
|
2059 |
-
go(1);
|
2060 |
-
}
|
2061 |
|
2062 |
-
|
2063 |
-
|
2064 |
-
return nextIndex >= 0 && nextIndex < history.entries.length;
|
2065 |
-
}
|
2066 |
|
2067 |
-
|
2068 |
-
|
2069 |
-
|
2070 |
-
|
|
|
|
|
|
|
2071 |
|
2072 |
-
|
2073 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2074 |
|
2075 |
-
|
2076 |
-
|
2077 |
-
}
|
2078 |
|
2079 |
-
|
2080 |
-
|
2081 |
-
|
2082 |
-
|
2083 |
-
|
2084 |
-
|
2085 |
-
|
2086 |
-
push: push,
|
2087 |
-
replace: replace,
|
2088 |
-
go: go,
|
2089 |
-
goBack: goBack,
|
2090 |
-
goForward: goForward,
|
2091 |
-
canGo: canGo,
|
2092 |
-
block: block,
|
2093 |
-
listen: listen
|
2094 |
};
|
2095 |
-
return history;
|
2096 |
-
}
|
2097 |
|
|
|
|
|
2098 |
|
2099 |
|
2100 |
|
2101 |
-
|
2102 |
-
|
2103 |
-
|
2104 |
-
|
2105 |
-
|
2106 |
-
|
2107 |
-
/* harmony import */ var _babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(21);
|
2108 |
-
/* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(22);
|
2109 |
-
/* harmony import */ var _babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(13);
|
2110 |
-
/* harmony import */ var _babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(23);
|
2111 |
-
/* harmony import */ var _babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(24);
|
2112 |
-
/* harmony import */ var _babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(10);
|
2113 |
-
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(0);
|
2114 |
-
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__);
|
2115 |
-
/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(96);
|
2116 |
-
/* harmony import */ var _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(54);
|
2117 |
-
/* harmony import */ var _wordpress_dom__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(73);
|
2118 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2119 |
|
|
|
|
|
|
|
2120 |
|
|
|
|
|
2121 |
|
|
|
|
|
|
|
|
|
|
|
2122 |
|
|
|
|
|
|
|
|
|
|
|
2123 |
|
|
|
|
|
|
|
2124 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2125 |
|
2126 |
-
|
2127 |
|
2128 |
-
|
|
|
|
|
|
|
|
|
2129 |
|
2130 |
-
|
2131 |
-
|
2132 |
-
*/
|
2133 |
|
|
|
|
|
2134 |
|
|
|
2135 |
|
|
|
2136 |
|
2137 |
-
|
2138 |
-
|
2139 |
-
Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_3__[/* default */ "a"])(_class, _Component);
|
2140 |
|
2141 |
-
|
|
|
2142 |
|
2143 |
-
|
2144 |
-
|
|
|
|
|
2145 |
|
2146 |
-
|
2147 |
|
2148 |
-
|
2149 |
-
|
2150 |
-
|
2151 |
-
return _this;
|
2152 |
-
}
|
2153 |
|
2154 |
-
|
2155 |
-
|
2156 |
-
value: function handleTabBehaviour(event) {
|
2157 |
-
if (event.keyCode !== _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_8__[/* TAB */ "e"]) {
|
2158 |
-
return;
|
2159 |
-
}
|
2160 |
|
2161 |
-
|
|
|
|
|
|
|
2162 |
|
2163 |
-
|
2164 |
-
|
2165 |
-
|
|
|
|
|
|
|
|
|
2166 |
|
2167 |
-
|
2168 |
-
|
|
|
2169 |
|
2170 |
-
|
2171 |
-
|
2172 |
-
|
2173 |
-
|
2174 |
-
|
2175 |
-
|
2176 |
-
/*
|
2177 |
-
* When pressing Tab and none of the tabbables has focus, the keydown
|
2178 |
-
* event happens on the wrapper div: move focus on the first tabbable.
|
2179 |
-
*/
|
2180 |
-
} else if (!tabbables.includes(event.target)) {
|
2181 |
-
event.preventDefault();
|
2182 |
-
firstTabbable.focus();
|
2183 |
-
}
|
2184 |
-
}
|
2185 |
-
}, {
|
2186 |
-
key: "render",
|
2187 |
-
value: function render() {
|
2188 |
-
// Disable reason: this component is non-interactive, but must capture
|
2189 |
-
// events from the wrapped component to determine when the Tab key is used.
|
2190 |
|
2191 |
-
|
2192 |
-
|
2193 |
-
|
2194 |
-
|
2195 |
-
|
2196 |
-
}, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(WrappedComponent, this.props));
|
2197 |
-
/* eslint-enable jsx-a11y/no-static-element-interactions */
|
2198 |
-
}
|
2199 |
-
}]);
|
2200 |
|
2201 |
-
|
2202 |
-
|
2203 |
-
|
2204 |
-
|
2205 |
-
|
2206 |
|
2207 |
-
|
|
|
|
|
|
|
2208 |
|
2209 |
-
|
2210 |
-
|
|
|
2211 |
|
2212 |
-
|
2213 |
-
|
2214 |
-
|
2215 |
-
|
2216 |
-
|
2217 |
-
}
|
2218 |
|
2219 |
-
|
2220 |
-
|
|
|
|
|
|
|
|
|
2221 |
|
2222 |
-
|
|
|
|
|
|
|
|
|
2223 |
|
2224 |
-
|
2225 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
2226 |
|
2227 |
-
|
2228 |
-
|
2229 |
-
|
2230 |
-
|
2231 |
-
|
2232 |
-
|
2233 |
-
|
2234 |
-
|
2235 |
-
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(0);
|
2236 |
-
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__);
|
2237 |
-
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(2);
|
2238 |
-
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_8__);
|
2239 |
-
/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(96);
|
2240 |
|
|
|
|
|
|
|
|
|
|
|
|
|
2241 |
|
|
|
|
|
|
|
2242 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2243 |
|
|
|
|
|
|
|
|
|
2244 |
|
|
|
|
|
|
|
2245 |
|
|
|
|
|
|
|
2246 |
|
|
|
|
|
|
|
2247 |
|
|
|
|
|
|
|
2248 |
|
2249 |
-
|
|
|
|
|
|
|
2250 |
|
2251 |
-
|
|
|
|
|
|
|
2252 |
|
2253 |
-
|
2254 |
-
|
2255 |
-
|
2256 |
|
2257 |
-
|
2258 |
-
|
2259 |
-
|
2260 |
|
|
|
|
|
|
|
|
|
2261 |
|
|
|
|
|
|
|
2262 |
|
2263 |
-
|
2264 |
-
|
2265 |
-
|
2266 |
-
*
|
2267 |
-
* @type {string[]}
|
2268 |
-
*/
|
2269 |
|
2270 |
-
|
2271 |
-
|
2272 |
-
|
2273 |
-
* normalization, or false otherwise.
|
2274 |
-
*
|
2275 |
-
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#Clicking_and_focus
|
2276 |
-
*
|
2277 |
-
* @param {Element} element Element to test.
|
2278 |
-
*
|
2279 |
-
* @return {boolean} Whether element is a button.
|
2280 |
-
*/
|
2281 |
|
2282 |
-
|
2283 |
-
|
2284 |
-
|
2285 |
-
|
2286 |
-
|
2287 |
|
2288 |
-
|
2289 |
-
|
2290 |
-
|
|
|
|
|
2291 |
|
2292 |
-
|
2293 |
-
}
|
2294 |
|
2295 |
-
|
2296 |
-
|
2297 |
-
|
2298 |
|
2299 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2300 |
|
2301 |
-
|
2302 |
-
|
|
|
2303 |
|
2304 |
-
|
2305 |
|
2306 |
-
|
2307 |
-
|
2308 |
-
|
2309 |
-
|
2310 |
-
_this.normalizeButtonFocus = _this.normalizeButtonFocus.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_3__[/* default */ "a"])(_this));
|
2311 |
-
return _this;
|
2312 |
-
}
|
2313 |
|
2314 |
-
|
2315 |
-
key: "componentWillUnmount",
|
2316 |
-
value: function componentWillUnmount() {
|
2317 |
-
this.cancelBlurCheck();
|
2318 |
-
}
|
2319 |
-
}, {
|
2320 |
-
key: "bindNode",
|
2321 |
-
value: function bindNode(node) {
|
2322 |
-
if (node) {
|
2323 |
-
this.node = node;
|
2324 |
-
} else {
|
2325 |
-
delete this.node;
|
2326 |
-
this.cancelBlurCheck();
|
2327 |
-
}
|
2328 |
}
|
2329 |
-
}, {
|
2330 |
-
key: "queueBlurCheck",
|
2331 |
-
value: function queueBlurCheck(event) {
|
2332 |
-
var _this2 = this;
|
2333 |
|
2334 |
-
|
2335 |
-
|
2336 |
-
|
|
|
2337 |
|
2338 |
-
|
2339 |
-
return;
|
2340 |
-
}
|
2341 |
|
2342 |
-
|
2343 |
-
|
2344 |
-
|
2345 |
-
|
2346 |
-
// https://developer.mozilla.org/en-US/docs/Web/API/Document/hasFocus.
|
2347 |
-
if (!document.hasFocus()) {
|
2348 |
-
event.preventDefault();
|
2349 |
-
return;
|
2350 |
-
}
|
2351 |
|
2352 |
-
|
2353 |
-
|
2354 |
-
}
|
2355 |
-
}, 0);
|
2356 |
-
}
|
2357 |
-
}, {
|
2358 |
-
key: "cancelBlurCheck",
|
2359 |
-
value: function cancelBlurCheck() {
|
2360 |
-
clearTimeout(this.blurCheckTimeout);
|
2361 |
-
}
|
2362 |
-
/**
|
2363 |
-
* Handles a mousedown or mouseup event to respectively assign and
|
2364 |
-
* unassign a flag for preventing blur check on button elements. Some
|
2365 |
-
* browsers, namely Firefox and Safari, do not emit a focus event on
|
2366 |
-
* button elements when clicked, while others do. The logic here
|
2367 |
-
* intends to normalize this as treating click on buttons as focus.
|
2368 |
-
*
|
2369 |
-
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#Clicking_and_focus
|
2370 |
-
*
|
2371 |
-
* @param {MouseEvent} event Event for mousedown or mouseup.
|
2372 |
-
*/
|
2373 |
|
2374 |
-
|
2375 |
-
|
2376 |
-
|
2377 |
-
|
2378 |
-
target = event.target;
|
2379 |
-
var isInteractionEnd = Object(lodash__WEBPACK_IMPORTED_MODULE_8__["includes"])(['mouseup', 'touchend'], type);
|
2380 |
|
2381 |
-
|
2382 |
-
|
2383 |
-
} else if (isFocusNormalizedButton(target)) {
|
2384 |
-
this.preventBlurCheck = true;
|
2385 |
}
|
2386 |
-
}
|
2387 |
-
}, {
|
2388 |
-
key: "render",
|
2389 |
-
value: function render() {
|
2390 |
-
// Disable reason: See `normalizeButtonFocus` for browser-specific
|
2391 |
-
// focus event normalization.
|
2392 |
|
2393 |
-
|
2394 |
-
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["createElement"])("div", {
|
2395 |
-
onFocus: this.cancelBlurCheck,
|
2396 |
-
onMouseDown: this.normalizeButtonFocus,
|
2397 |
-
onMouseUp: this.normalizeButtonFocus,
|
2398 |
-
onTouchStart: this.normalizeButtonFocus,
|
2399 |
-
onTouchEnd: this.normalizeButtonFocus,
|
2400 |
-
onBlur: this.queueBlurCheck
|
2401 |
-
}, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["createElement"])(WrappedComponent, Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])({
|
2402 |
-
ref: this.bindNode
|
2403 |
-
}, this.props)));
|
2404 |
-
/* eslint-enable jsx-a11y/no-static-element-interactions */
|
2405 |
}
|
2406 |
-
}
|
2407 |
-
|
2408 |
-
return _class;
|
2409 |
-
}(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["Component"]);
|
2410 |
-
}, 'withFocusOutside'));
|
2411 |
-
//# sourceMappingURL=index.js.map
|
2412 |
|
2413 |
-
|
|
|
2414 |
|
2415 |
-
|
2416 |
-
|
|
|
|
|
|
|
2417 |
|
2418 |
-
|
2419 |
-
|
2420 |
-
|
2421 |
-
|
2422 |
-
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__);
|
2423 |
|
|
|
|
|
|
|
2424 |
|
|
|
2425 |
|
|
|
|
|
2426 |
|
2427 |
-
|
2428 |
-
|
2429 |
-
|
|
|
|
|
2430 |
|
|
|
2431 |
|
2432 |
-
|
2433 |
-
|
2434 |
-
}
|
2435 |
|
2436 |
-
|
2437 |
-
|
2438 |
-
|
2439 |
|
2440 |
-
|
2441 |
-
|
2442 |
-
|
2443 |
-
/* eslint-disable jsx-a11y/no-static-element-interactions */
|
2444 |
-
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["createElement"])("div", Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])({}, props, {
|
2445 |
-
ref: ref,
|
2446 |
-
onMouseDown: stopPropagation
|
2447 |
-
}), children);
|
2448 |
-
/* eslint-enable jsx-a11y/no-static-element-interactions */
|
2449 |
-
}));
|
2450 |
-
//# sourceMappingURL=index.js.map
|
2451 |
-
|
2452 |
-
/***/ }),
|
2453 |
|
2454 |
-
|
2455 |
-
|
2456 |
|
2457 |
-
|
|
|
|
|
2458 |
|
2459 |
-
|
|
|
2460 |
|
2461 |
-
|
2462 |
-
var
|
|
|
2463 |
|
2464 |
-
|
2465 |
-
|
|
|
|
|
|
|
|
|
2466 |
|
2467 |
-
|
2468 |
-
var createClass = __webpack_require__(22);
|
2469 |
|
2470 |
-
|
2471 |
-
|
|
|
2472 |
|
2473 |
-
|
2474 |
-
|
2475 |
|
2476 |
-
|
2477 |
-
|
2478 |
|
2479 |
-
|
2480 |
-
|
2481 |
|
2482 |
-
|
2483 |
-
|
|
|
2484 |
|
2485 |
-
|
2486 |
-
|
2487 |
|
2488 |
-
|
2489 |
-
|
|
|
2490 |
|
2491 |
-
|
|
|
|
|
|
|
2492 |
|
|
|
|
|
|
|
|
|
2493 |
|
|
|
|
|
2494 |
|
|
|
|
|
|
|
|
|
2495 |
|
|
|
|
|
2496 |
|
|
|
|
|
|
|
|
|
2497 |
|
|
|
|
|
2498 |
|
|
|
|
|
|
|
2499 |
|
|
|
|
|
|
|
|
|
2500 |
|
2501 |
-
|
|
|
|
|
2502 |
|
2503 |
-
|
|
|
|
|
2504 |
|
2505 |
-
|
2506 |
-
|
2507 |
-
|
2508 |
|
2509 |
-
|
2510 |
-
* WordPress dependencies
|
2511 |
-
*/
|
2512 |
|
|
|
|
|
2513 |
|
|
|
|
|
|
|
2514 |
|
2515 |
-
|
2516 |
-
|
2517 |
-
|
2518 |
-
Provider = _createContext.Provider,
|
2519 |
-
Consumer = _createContext.Consumer;
|
2520 |
|
2521 |
-
|
2522 |
-
|
2523 |
-
|
2524 |
-
* The maximum history length to capture for the focus stack. When exceeded,
|
2525 |
-
* items should be shifted from the stack for each consecutive push.
|
2526 |
-
*
|
2527 |
-
* @type {number}
|
2528 |
-
*/
|
2529 |
|
2530 |
-
|
|
|
|
|
|
|
2531 |
|
2532 |
-
|
2533 |
-
Object(inherits["a" /* default */])(FocusReturnProvider, _Component);
|
2534 |
|
2535 |
-
|
|
|
|
|
|
|
2536 |
|
2537 |
-
|
2538 |
-
|
2539 |
|
2540 |
-
|
|
|
|
|
|
|
2541 |
|
2542 |
-
|
2543 |
-
|
2544 |
-
|
2545 |
-
focusHistory: []
|
2546 |
-
};
|
2547 |
-
return _this;
|
2548 |
-
}
|
2549 |
|
2550 |
-
|
2551 |
-
|
2552 |
-
|
2553 |
-
|
2554 |
-
// members but preferring the _last_ occurrence of any duplicates.
|
2555 |
-
// Lodash's `uniq` behavior favors the first occurrence, so the array
|
2556 |
-
// is temporarily reversed prior to it being called upon. Uniqueness
|
2557 |
-
// helps avoid situations where, such as in a constrained tabbing area,
|
2558 |
-
// the user changes focus enough within a transient element that the
|
2559 |
-
// stack may otherwise only consist of members pending destruction, at
|
2560 |
-
// which point focus might have been lost.
|
2561 |
|
2562 |
-
|
2563 |
-
|
2564 |
-
focusHistory: nextFocusHistory
|
2565 |
-
});
|
2566 |
-
}
|
2567 |
-
}, {
|
2568 |
-
key: "render",
|
2569 |
-
value: function render() {
|
2570 |
-
var _this$props = this.props,
|
2571 |
-
children = _this$props.children,
|
2572 |
-
className = _this$props.className;
|
2573 |
-
return Object(external_this_wp_element_["createElement"])(Provider, {
|
2574 |
-
value: this.state
|
2575 |
-
}, Object(external_this_wp_element_["createElement"])("div", {
|
2576 |
-
onFocus: this.onFocus,
|
2577 |
-
className: className
|
2578 |
-
}, children));
|
2579 |
}
|
2580 |
-
}]);
|
2581 |
|
2582 |
-
|
2583 |
-
}
|
2584 |
|
2585 |
-
|
|
|
|
|
|
|
|
|
|
|
2586 |
|
2587 |
-
|
2588 |
-
|
|
|
|
|
2589 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2590 |
|
|
|
|
|
|
|
|
|
2591 |
|
|
|
|
|
2592 |
|
|
|
|
|
|
|
|
|
|
|
|
|
2593 |
|
|
|
|
|
|
|
|
|
|
|
2594 |
|
|
|
|
|
2595 |
|
|
|
|
|
|
|
|
|
|
|
2596 |
|
2597 |
-
function
|
|
|
|
|
|
|
|
|
2598 |
|
2599 |
-
|
|
|
|
|
|
|
2600 |
|
2601 |
-
|
2602 |
-
|
2603 |
-
|
|
|
|
|
|
|
|
|
2604 |
|
2605 |
-
|
2606 |
-
|
2607 |
-
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2608 |
|
|
|
2609 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2610 |
|
2611 |
-
|
2612 |
-
|
2613 |
-
|
|
|
|
|
2614 |
|
|
|
2615 |
|
2616 |
-
|
2617 |
-
* Returns true if the given object is component-like. An object is component-
|
2618 |
-
* like if it is an instance of wp.element.Component, or is a function.
|
2619 |
-
*
|
2620 |
-
* @param {*} object Object to test.
|
2621 |
-
*
|
2622 |
-
* @return {boolean} Whether object is component-like.
|
2623 |
-
*/
|
2624 |
|
2625 |
-
function isComponentLike(object) {
|
2626 |
-
return object instanceof external_this_wp_element_["Component"] || typeof object === 'function';
|
2627 |
-
}
|
2628 |
-
/**
|
2629 |
-
* Higher Order Component used to be used to wrap disposable elements like
|
2630 |
-
* sidebars, modals, dropdowns. When mounting the wrapped component, we track a
|
2631 |
-
* reference to the current active element so we know where to restore focus
|
2632 |
-
* when the component is unmounted.
|
2633 |
-
*
|
2634 |
-
* @param {(WPComponent|Object)} options The component to be enhanced with
|
2635 |
-
* focus return behavior, or an object
|
2636 |
-
* describing the component and the
|
2637 |
-
* focus return characteristics.
|
2638 |
-
*
|
2639 |
-
* @return {WPComponent} Component with the focus restauration behaviour.
|
2640 |
-
*/
|
2641 |
|
2642 |
|
2643 |
-
function withFocusReturn(options) {
|
2644 |
-
// Normalize as overloaded form `withFocusReturn( options )( Component )`
|
2645 |
-
// or as `withFocusReturn( Component )`.
|
2646 |
-
if (isComponentLike(options)) {
|
2647 |
-
var WrappedComponent = options;
|
2648 |
-
return withFocusReturn({})(WrappedComponent);
|
2649 |
-
}
|
2650 |
|
2651 |
-
|
2652 |
-
|
2653 |
-
|
2654 |
-
|
2655 |
-
|
2656 |
|
2657 |
-
|
|
|
|
|
|
|
|
|
2658 |
|
2659 |
-
|
2660 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2661 |
|
2662 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2663 |
|
2664 |
-
|
2665 |
-
|
2666 |
-
|
2667 |
|
2668 |
-
|
2669 |
-
|
2670 |
-
|
|
|
|
|
|
|
2671 |
|
2672 |
-
|
2673 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2674 |
|
2675 |
-
|
2676 |
-
|
|
|
|
|
|
|
|
|
2677 |
|
2678 |
-
|
|
|
|
|
2679 |
}
|
|
|
|
|
2680 |
|
2681 |
-
|
2682 |
-
|
2683 |
-
|
2684 |
-
|
2685 |
-
isFocused = this.isFocused,
|
2686 |
-
ownFocusedElements = this.ownFocusedElements;
|
2687 |
|
2688 |
-
|
2689 |
-
|
2690 |
-
|
2691 |
-
|
2692 |
-
|
2693 |
-
// for support that the `onFocusReturn` decides to allow the
|
2694 |
-
// default behavior to occur under some conditions.
|
2695 |
|
|
|
2696 |
|
2697 |
-
|
2698 |
-
return;
|
2699 |
-
}
|
2700 |
|
2701 |
-
|
2702 |
-
var candidate;
|
2703 |
|
2704 |
-
|
2705 |
-
if (document.body.contains(candidate)) {
|
2706 |
-
candidate.focus();
|
2707 |
-
return;
|
2708 |
-
}
|
2709 |
-
}
|
2710 |
-
}
|
2711 |
-
}, {
|
2712 |
-
key: "render",
|
2713 |
-
value: function render() {
|
2714 |
-
return Object(external_this_wp_element_["createElement"])("div", {
|
2715 |
-
onFocus: this.setIsFocusedTrue,
|
2716 |
-
onBlur: this.setIsFocusedFalse
|
2717 |
-
}, Object(external_this_wp_element_["createElement"])(WrappedComponent, this.props.childProps));
|
2718 |
-
}
|
2719 |
-
}]);
|
2720 |
|
2721 |
-
|
2722 |
-
|
|
|
|
|
|
|
2723 |
|
2724 |
-
|
2725 |
-
|
2726 |
-
return Object(external_this_wp_element_["createElement"])(FocusReturn, {
|
2727 |
-
childProps: props,
|
2728 |
-
focus: context
|
2729 |
-
});
|
2730 |
});
|
2731 |
-
};
|
2732 |
-
};
|
2733 |
-
}
|
2734 |
|
2735 |
-
|
|
|
|
|
|
|
|
|
2736 |
|
2737 |
-
|
2738 |
|
2739 |
-
|
|
|
2740 |
|
2741 |
-
|
2742 |
-
|
|
|
2743 |
|
2744 |
-
|
2745 |
-
/* harmony import */ var _babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(8);
|
2746 |
-
/* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7);
|
2747 |
-
/* harmony import */ var _babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(12);
|
2748 |
-
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(0);
|
2749 |
-
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__);
|
2750 |
-
/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(88);
|
2751 |
-
/* harmony import */ var _dashicon__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(126);
|
2752 |
|
|
|
2753 |
|
|
|
|
|
|
|
|
|
|
|
2754 |
|
|
|
2755 |
|
2756 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2757 |
|
2758 |
-
|
2759 |
|
2760 |
-
|
2761 |
-
|
2762 |
-
*/
|
2763 |
|
|
|
|
|
2764 |
|
2765 |
-
|
2766 |
-
|
2767 |
-
*/
|
2768 |
|
|
|
2769 |
|
2770 |
|
2771 |
-
function Icon(_ref) {
|
2772 |
-
var _ref$icon = _ref.icon,
|
2773 |
-
icon = _ref$icon === void 0 ? null : _ref$icon,
|
2774 |
-
size = _ref.size,
|
2775 |
-
additionalProps = Object(_babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_2__[/* default */ "a"])(_ref, ["icon", "size"]);
|
2776 |
|
2777 |
-
// Dashicons should be 20x20 by default.
|
2778 |
-
var dashiconSize = size || 20;
|
2779 |
|
2780 |
-
if ('string' === typeof icon) {
|
2781 |
-
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__["createElement"])(_dashicon__WEBPACK_IMPORTED_MODULE_5__[/* default */ "a"], Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"])({
|
2782 |
-
icon: icon,
|
2783 |
-
size: dashiconSize
|
2784 |
-
}, additionalProps));
|
2785 |
-
}
|
2786 |
|
2787 |
-
if (icon && _dashicon__WEBPACK_IMPORTED_MODULE_5__[/* default */ "a"] === icon.type) {
|
2788 |
-
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__["cloneElement"])(icon, _objectSpread({
|
2789 |
-
size: dashiconSize
|
2790 |
-
}, additionalProps));
|
2791 |
-
} // Icons should be 24x24 by default.
|
2792 |
|
|
|
2793 |
|
2794 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2795 |
|
2796 |
-
|
2797 |
-
|
2798 |
-
|
2799 |
-
|
2800 |
-
|
2801 |
-
|
2802 |
|
2803 |
-
return icon(_objectSpread({
|
2804 |
-
size: iconSize
|
2805 |
-
}, additionalProps));
|
2806 |
-
}
|
2807 |
|
2808 |
-
|
2809 |
-
|
2810 |
-
width: iconSize,
|
2811 |
-
height: iconSize
|
2812 |
-
}, icon.props), additionalProps);
|
2813 |
|
2814 |
-
|
2815 |
-
}
|
2816 |
|
2817 |
-
|
2818 |
-
|
2819 |
-
|
2820 |
-
}, additionalProps));
|
2821 |
-
}
|
2822 |
|
2823 |
-
|
2824 |
-
|
|
|
|
|
2825 |
|
2826 |
-
|
2827 |
-
//# sourceMappingURL=index.js.map
|
2828 |
|
2829 |
-
|
|
|
|
|
|
|
|
|
2830 |
|
2831 |
-
|
2832 |
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
2833 |
|
2834 |
-
|
2835 |
-
/* harmony import */ var _babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(8);
|
2836 |
-
/* harmony import */ var _babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(26);
|
2837 |
-
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(4);
|
2838 |
-
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_2__);
|
2839 |
|
|
|
|
|
2840 |
|
|
|
|
|
|
|
|
|
2841 |
|
2842 |
-
|
2843 |
-
|
2844 |
-
|
2845 |
|
|
|
|
|
|
|
2846 |
|
2847 |
-
|
2848 |
-
|
2849 |
-
|
2850 |
-
|
2851 |
-
|
2852 |
|
2853 |
-
|
2854 |
-
var _classnames;
|
2855 |
|
2856 |
-
|
2857 |
-
origin = _options$origin === void 0 ? 'top' : _options$origin;
|
2858 |
|
2859 |
-
|
2860 |
-
|
2861 |
-
|
2862 |
-
_origin$split2$ = _origin$split2[1],
|
2863 |
-
xAxis = _origin$split2$ === void 0 ? 'center' : _origin$split2$;
|
2864 |
|
2865 |
-
|
2866 |
-
|
2867 |
-
|
|
|
2868 |
}
|
2869 |
|
2870 |
-
|
2871 |
-
|
2872 |
-
|
2873 |
|
2874 |
-
|
2875 |
-
|
2876 |
-
});
|
2877 |
-
}
|
2878 |
|
2879 |
-
|
2880 |
-
|
2881 |
-
|
|
|
|
|
2882 |
});
|
2883 |
}
|
2884 |
|
2885 |
-
return
|
2886 |
-
}
|
2887 |
|
2888 |
-
|
2889 |
-
//# sourceMappingURL=index.js.map
|
2890 |
|
2891 |
-
/***/ }),
|
2892 |
|
2893 |
-
/***/ 135:
|
2894 |
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
2895 |
|
2896 |
-
|
2897 |
-
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0);
|
2898 |
-
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
|
2899 |
-
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(2);
|
2900 |
-
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_1__);
|
2901 |
|
2902 |
|
2903 |
-
|
2904 |
-
|
2905 |
-
|
|
|
2906 |
|
|
|
|
|
2907 |
|
2908 |
-
|
2909 |
-
var shortcut = _ref.shortcut,
|
2910 |
-
className = _ref.className;
|
2911 |
|
2912 |
-
|
2913 |
-
return null;
|
2914 |
-
}
|
2915 |
|
2916 |
-
var displayText;
|
2917 |
-
var ariaLabel;
|
2918 |
|
2919 |
-
if (Object(lodash__WEBPACK_IMPORTED_MODULE_1__["isString"])(shortcut)) {
|
2920 |
-
displayText = shortcut;
|
2921 |
-
}
|
2922 |
|
2923 |
-
if (Object(lodash__WEBPACK_IMPORTED_MODULE_1__["isObject"])(shortcut)) {
|
2924 |
-
displayText = shortcut.display;
|
2925 |
-
ariaLabel = shortcut.ariaLabel;
|
2926 |
-
}
|
2927 |
|
2928 |
-
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("span", {
|
2929 |
-
className: className,
|
2930 |
-
"aria-label": ariaLabel
|
2931 |
-
}, displayText);
|
2932 |
-
}
|
2933 |
|
2934 |
-
/* harmony default export */ __webpack_exports__["a"] = (Shortcut);
|
2935 |
-
//# sourceMappingURL=index.js.map
|
2936 |
|
2937 |
-
/***/ }),
|
2938 |
|
2939 |
-
/***/ 136:
|
2940 |
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
2941 |
|
2942 |
-
"use strict";
|
2943 |
|
2944 |
-
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/extends.js
|
2945 |
-
var esm_extends = __webpack_require__(7);
|
2946 |
|
2947 |
-
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/slicedToArray.js + 3 modules
|
2948 |
-
var slicedToArray = __webpack_require__(26);
|
2949 |
|
2950 |
-
|
2951 |
-
var
|
2952 |
|
2953 |
-
|
2954 |
-
|
|
|
|
|
2955 |
|
2956 |
-
|
2957 |
-
var
|
2958 |
-
|
|
|
2959 |
|
2960 |
-
|
2961 |
-
|
|
|
2962 |
|
2963 |
-
// EXTERNAL MODULE: ./node_modules/@wordpress/components/node_modules/@wordpress/dom/build-module/index.js + 2 modules
|
2964 |
-
var build_module = __webpack_require__(73);
|
2965 |
|
2966 |
-
|
2967 |
-
|
2968 |
|
2969 |
-
|
2970 |
-
var
|
|
|
2971 |
|
2972 |
-
|
2973 |
-
var use_viewport_match = __webpack_require__(306);
|
2974 |
|
2975 |
-
|
2976 |
-
|
2977 |
-
var
|
|
|
|
|
|
|
|
|
|
|
|
|
2978 |
|
2979 |
-
|
2980 |
-
|
2981 |
-
|
2982 |
-
|
|
|
|
|
2983 |
|
2984 |
-
|
2985 |
-
|
2986 |
-
|
2987 |
-
|
2988 |
-
|
2989 |
-
*
|
2990 |
-
* @example
|
2991 |
-
*
|
2992 |
-
* ```js
|
2993 |
-
* const App = () => {
|
2994 |
-
* const [ resizeListener, sizes ] = useResizeObserver();
|
2995 |
-
*
|
2996 |
-
* return (
|
2997 |
-
* <div>
|
2998 |
-
* { resizeListener }
|
2999 |
-
* Your content here
|
3000 |
-
* </div>
|
3001 |
-
* );
|
3002 |
-
* };
|
3003 |
-
* ```
|
3004 |
-
*
|
3005 |
-
*/
|
3006 |
|
3007 |
-
|
3008 |
-
|
3009 |
-
|
3010 |
-
var library_close = __webpack_require__(451);
|
3011 |
|
3012 |
-
|
3013 |
-
var defineProperty = __webpack_require__(8);
|
3014 |
|
3015 |
-
|
|
|
|
|
|
|
|
|
|
|
3016 |
|
|
|
3017 |
|
|
|
|
|
|
|
3018 |
|
3019 |
-
|
|
|
|
|
3020 |
|
3021 |
-
|
|
|
3022 |
|
3023 |
-
|
3024 |
-
|
3025 |
-
|
|
|
|
|
3026 |
|
3027 |
-
|
3028 |
-
|
3029 |
-
|
|
|
|
|
3030 |
|
3031 |
-
|
|
|
|
|
|
|
|
|
|
|
3032 |
|
3033 |
-
|
3034 |
-
|
3035 |
-
*
|
3036 |
-
* @param {Object} anchorRect Anchor Rect.
|
3037 |
-
* @param {Object} contentSize Content Size.
|
3038 |
-
* @param {string} xAxis Desired xAxis.
|
3039 |
-
* @param {string} corner Desired corner.
|
3040 |
-
* @param {boolean} sticky Whether or not to stick the popover to the
|
3041 |
-
* scroll container edge when part of the anchor
|
3042 |
-
* leaves view.
|
3043 |
-
* @param {string} chosenYAxis yAxis to be used.
|
3044 |
-
* @param {Element} boundaryElement Boundary element.
|
3045 |
-
*
|
3046 |
-
* @return {Object} Popover xAxis position and constraints.
|
3047 |
-
*/
|
3048 |
|
3049 |
-
function
|
3050 |
-
|
3051 |
-
|
3052 |
|
3053 |
-
|
3054 |
-
xAxis = 'right';
|
3055 |
-
} else if (xAxis === 'right' && isRTL) {
|
3056 |
-
xAxis = 'left';
|
3057 |
-
}
|
3058 |
|
3059 |
-
|
3060 |
-
|
3061 |
-
} else if (corner === 'right' && isRTL) {
|
3062 |
-
corner = 'left';
|
3063 |
-
} // x axis alignment choices
|
3064 |
|
|
|
|
|
3065 |
|
3066 |
-
|
3067 |
-
var
|
3068 |
-
|
3069 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3070 |
};
|
3071 |
-
|
3072 |
|
3073 |
-
|
3074 |
-
|
3075 |
-
|
3076 |
-
|
3077 |
-
}
|
3078 |
|
3079 |
-
|
|
|
|
|
|
|
3080 |
|
3081 |
-
|
3082 |
-
|
3083 |
-
|
3084 |
-
rightAlignmentX = anchorMidPoint;
|
3085 |
-
}
|
3086 |
|
3087 |
-
|
3088 |
-
|
3089 |
-
|
3090 |
-
|
3091 |
-
|
3092 |
-
|
3093 |
-
contentWidth: rightAlignmentX + width > window.innerWidth ? window.innerWidth - rightAlignmentX : width
|
3094 |
-
}; // Choosing the x axis
|
3095 |
|
3096 |
-
|
3097 |
-
|
|
|
|
|
|
|
|
|
|
|
3098 |
|
3099 |
-
|
3100 |
-
|
3101 |
-
|
3102 |
-
|
3103 |
-
|
3104 |
-
|
3105 |
-
|
3106 |
-
}
|
3107 |
-
|
3108 |
-
|
3109 |
-
|
|
|
3110 |
}
|
3111 |
}
|
3112 |
|
3113 |
-
|
|
|
3114 |
|
3115 |
-
|
3116 |
-
|
3117 |
-
|
3118 |
-
popoverLeft = leftAlignment.popoverLeft;
|
3119 |
-
} else {
|
3120 |
-
popoverLeft = rightAlignment.popoverLeft;
|
3121 |
-
}
|
3122 |
|
3123 |
-
if (
|
3124 |
-
|
3125 |
-
popoverLeft = Math.min(popoverLeft, boundaryRect.right - width);
|
3126 |
}
|
3127 |
|
3128 |
-
return
|
3129 |
-
xAxis: chosenXAxis,
|
3130 |
-
popoverLeft: popoverLeft,
|
3131 |
-
contentWidth: contentWidth
|
3132 |
-
};
|
3133 |
}
|
3134 |
-
/**
|
3135 |
-
* Utility used to compute the popover position over the yAxis
|
3136 |
-
*
|
3137 |
-
* @param {Object} anchorRect Anchor Rect.
|
3138 |
-
* @param {Object} contentSize Content Size.
|
3139 |
-
* @param {string} yAxis Desired yAxis.
|
3140 |
-
* @param {string} corner Desired corner.
|
3141 |
-
* @param {boolean} sticky Whether or not to stick the popover to the
|
3142 |
-
* scroll container edge when part of the
|
3143 |
-
* anchor leaves view.
|
3144 |
-
* @param {Element} anchorRef The anchor element.
|
3145 |
-
* @param {Element} relativeOffsetTop If applicable, top offset of the relative
|
3146 |
-
* positioned parent container.
|
3147 |
-
*
|
3148 |
-
* @return {Object} Popover xAxis position and constraints.
|
3149 |
-
*/
|
3150 |
|
3151 |
-
|
3152 |
-
|
|
|
3153 |
|
3154 |
-
|
3155 |
-
|
3156 |
-
|
3157 |
-
|
3158 |
|
3159 |
-
|
3160 |
-
|
3161 |
-
|
3162 |
-
popoverTop: Math.min(anchorRect.bottom, stickyPosition)
|
3163 |
-
};
|
3164 |
-
}
|
3165 |
-
} // y axis alignment choices
|
3166 |
|
|
|
3167 |
|
3168 |
-
|
|
|
|
|
3169 |
|
3170 |
-
|
3171 |
-
|
3172 |
-
} else if (corner === 'top') {
|
3173 |
-
anchorMidPoint = anchorRect.top;
|
3174 |
-
}
|
3175 |
|
3176 |
-
|
3177 |
-
|
3178 |
-
|
3179 |
-
|
3180 |
-
var topAlignment = {
|
3181 |
-
popoverTop: anchorRect.top,
|
3182 |
-
contentHeight: anchorRect.top - HEIGHT_OFFSET - height > 0 ? height : anchorRect.top - HEIGHT_OFFSET
|
3183 |
-
};
|
3184 |
-
var bottomAlignment = {
|
3185 |
-
popoverTop: anchorRect.bottom,
|
3186 |
-
contentHeight: anchorRect.bottom + HEIGHT_OFFSET + height > window.innerHeight ? window.innerHeight - HEIGHT_OFFSET - anchorRect.bottom : height
|
3187 |
-
}; // Choosing the y axis
|
3188 |
|
3189 |
-
|
3190 |
-
|
|
|
3191 |
|
3192 |
-
|
3193 |
-
|
3194 |
-
chosenYAxis = 'middle';
|
3195 |
-
} else if (yAxis === 'top' && topAlignment.contentHeight === height) {
|
3196 |
-
chosenYAxis = 'top';
|
3197 |
-
} else if (yAxis === 'bottom' && bottomAlignment.contentHeight === height) {
|
3198 |
-
chosenYAxis = 'bottom';
|
3199 |
-
} else {
|
3200 |
-
chosenYAxis = topAlignment.contentHeight > bottomAlignment.contentHeight ? 'top' : 'bottom';
|
3201 |
-
var chosenHeight = chosenYAxis === 'top' ? topAlignment.contentHeight : bottomAlignment.contentHeight;
|
3202 |
-
contentHeight = chosenHeight !== height ? chosenHeight : null;
|
3203 |
-
}
|
3204 |
-
}
|
3205 |
|
3206 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
3207 |
|
3208 |
-
|
3209 |
-
|
3210 |
-
|
3211 |
-
popoverTop = topAlignment.popoverTop;
|
3212 |
-
} else {
|
3213 |
-
popoverTop = bottomAlignment.popoverTop;
|
3214 |
-
}
|
3215 |
|
3216 |
-
return {
|
3217 |
-
yAxis: chosenYAxis,
|
3218 |
-
popoverTop: popoverTop,
|
3219 |
-
contentHeight: contentHeight
|
3220 |
-
};
|
3221 |
-
}
|
3222 |
-
/**
|
3223 |
-
* Utility used to compute the popover position and the content max width/height
|
3224 |
-
* for a popover given its anchor rect and its content size.
|
3225 |
-
*
|
3226 |
-
* @param {Object} anchorRect Anchor Rect.
|
3227 |
-
* @param {Object} contentSize Content Size.
|
3228 |
-
* @param {string} position Position.
|
3229 |
-
* @param {boolean} sticky Whether or not to stick the popover to the
|
3230 |
-
* scroll container edge when part of the
|
3231 |
-
* anchor leaves view.
|
3232 |
-
* @param {Element} anchorRef The anchor element.
|
3233 |
-
* @param {number} relativeOffsetTop If applicable, top offset of the relative
|
3234 |
-
* positioned parent container.
|
3235 |
-
* @param {Element} boundaryElement Boundary element.
|
3236 |
-
*
|
3237 |
-
* @return {Object} Popover position and constraints.
|
3238 |
-
*/
|
3239 |
|
3240 |
-
function computePopoverPosition(anchorRect, contentSize) {
|
3241 |
-
var position = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'top';
|
3242 |
-
var sticky = arguments.length > 3 ? arguments[3] : undefined;
|
3243 |
-
var anchorRef = arguments.length > 4 ? arguments[4] : undefined;
|
3244 |
-
var relativeOffsetTop = arguments.length > 5 ? arguments[5] : undefined;
|
3245 |
-
var boundaryElement = arguments.length > 6 ? arguments[6] : undefined;
|
3246 |
|
3247 |
-
var _position$split = position.split(' '),
|
3248 |
-
_position$split2 = Object(slicedToArray["a" /* default */])(_position$split, 3),
|
3249 |
-
yAxis = _position$split2[0],
|
3250 |
-
_position$split2$ = _position$split2[1],
|
3251 |
-
xAxis = _position$split2$ === void 0 ? 'center' : _position$split2$,
|
3252 |
-
corner = _position$split2[2];
|
3253 |
|
3254 |
-
|
3255 |
-
|
3256 |
-
|
3257 |
-
}
|
3258 |
-
//# sourceMappingURL=utils.js.map
|
3259 |
-
// EXTERNAL MODULE: ./node_modules/@wordpress/components/build-module/higher-order/with-focus-return/index.js + 1 modules
|
3260 |
-
var with_focus_return = __webpack_require__(132);
|
3261 |
|
3262 |
-
|
3263 |
-
|
|
|
|
|
3264 |
|
3265 |
-
|
3266 |
-
|
|
|
3267 |
|
3268 |
-
|
3269 |
-
|
3270 |
|
3271 |
-
|
3272 |
-
|
|
|
3273 |
|
3274 |
-
|
3275 |
-
var possibleConstructorReturn = __webpack_require__(24);
|
3276 |
|
3277 |
-
|
3278 |
-
|
|
|
3279 |
|
3280 |
-
|
3281 |
-
var with_focus_outside = __webpack_require__(130);
|
3282 |
|
3283 |
-
|
|
|
|
|
3284 |
|
|
|
|
|
3285 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3286 |
|
|
|
|
|
3287 |
|
|
|
3288 |
|
|
|
|
|
|
|
3289 |
|
3290 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
3291 |
|
3292 |
-
|
|
|
|
|
3293 |
|
3294 |
-
|
3295 |
-
|
3296 |
-
|
|
|
|
|
|
|
|
|
3297 |
|
3298 |
-
|
3299 |
-
|
3300 |
-
|
|
|
|
|
3301 |
|
|
|
|
|
3302 |
|
|
|
|
|
|
|
|
|
3303 |
|
3304 |
-
|
3305 |
-
Object(inherits["a" /* default */])(PopoverDetectOutside, _Component);
|
3306 |
|
3307 |
-
|
|
|
|
|
3308 |
|
3309 |
-
|
3310 |
-
|
3311 |
|
3312 |
-
|
3313 |
-
|
3314 |
|
3315 |
-
|
3316 |
-
|
3317 |
-
value: function handleFocusOutside(event) {
|
3318 |
-
this.props.onFocusOutside(event);
|
3319 |
-
}
|
3320 |
-
}, {
|
3321 |
-
key: "render",
|
3322 |
-
value: function render() {
|
3323 |
-
return this.props.children;
|
3324 |
-
}
|
3325 |
-
}]);
|
3326 |
|
3327 |
-
|
3328 |
-
|
3329 |
|
3330 |
-
|
3331 |
-
|
3332 |
-
// EXTERNAL MODULE: ./node_modules/@wordpress/components/build-module/button/index.js
|
3333 |
-
var build_module_button = __webpack_require__(72);
|
3334 |
|
3335 |
-
//
|
|
|
3336 |
|
|
|
|
|
3337 |
|
|
|
|
|
3338 |
|
|
|
|
|
3339 |
|
|
|
|
|
3340 |
|
|
|
|
|
3341 |
|
3342 |
-
|
|
|
3343 |
|
3344 |
-
|
|
|
3345 |
|
3346 |
-
|
3347 |
-
|
3348 |
-
*/
|
3349 |
|
3350 |
-
|
3351 |
-
|
3352 |
-
*
|
3353 |
-
* This function creates a ScrollLock component for the specified document
|
3354 |
-
* and is exposed so we can create an isolated component for unit testing.
|
3355 |
-
*
|
3356 |
-
* @param {Object} args Keyword args.
|
3357 |
-
* @param {HTMLDocument} args.htmlDocument The document to lock the scroll for.
|
3358 |
-
* @param {string} args.className The name of the class used to lock scrolling.
|
3359 |
-
* @return {WPComponent} The bound ScrollLock component.
|
3360 |
-
*/
|
3361 |
|
3362 |
-
|
3363 |
-
var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
3364 |
-
_ref$htmlDocument = _ref.htmlDocument,
|
3365 |
-
htmlDocument = _ref$htmlDocument === void 0 ? document : _ref$htmlDocument,
|
3366 |
-
_ref$className = _ref.className,
|
3367 |
-
className = _ref$className === void 0 ? 'lockscroll' : _ref$className;
|
3368 |
|
3369 |
-
var lockCounter = 0;
|
3370 |
-
/*
|
3371 |
-
* Setting `overflow: hidden` on html and body elements resets body scroll in iOS.
|
3372 |
-
* Save scroll top so we can restore it after locking scroll.
|
3373 |
-
*
|
3374 |
-
* NOTE: It would be cleaner and possibly safer to find a localized solution such
|
3375 |
-
* as preventing default on certain touchmove events.
|
3376 |
-
*/
|
3377 |
|
3378 |
-
var previousScrollTop = 0;
|
3379 |
-
/**
|
3380 |
-
* Locks and unlocks scroll depending on the boolean argument.
|
3381 |
-
*
|
3382 |
-
* @param {boolean} locked Whether or not scroll should be locked.
|
3383 |
-
*/
|
3384 |
|
3385 |
-
function setLocked(locked) {
|
3386 |
-
var scrollingElement = htmlDocument.scrollingElement || htmlDocument.body;
|
3387 |
|
3388 |
-
if (locked) {
|
3389 |
-
previousScrollTop = scrollingElement.scrollTop;
|
3390 |
-
}
|
3391 |
|
3392 |
-
var methodName = locked ? 'add' : 'remove';
|
3393 |
-
scrollingElement.classList[methodName](className); // Adding the class to the document element seems to be necessary in iOS.
|
3394 |
|
3395 |
-
htmlDocument.documentElement.classList[methodName](className);
|
3396 |
|
3397 |
-
|
3398 |
-
scrollingElement.scrollTop = previousScrollTop;
|
3399 |
-
}
|
3400 |
-
}
|
3401 |
-
/**
|
3402 |
-
* Requests scroll lock.
|
3403 |
-
*
|
3404 |
-
* This function tracks requests for scroll lock. It locks scroll on the first
|
3405 |
-
* request and counts each request so `releaseLock` can unlock scroll when
|
3406 |
-
* all requests have been released.
|
3407 |
-
*/
|
3408 |
|
|
|
3409 |
|
3410 |
-
|
3411 |
-
if (lockCounter === 0) {
|
3412 |
-
setLocked(true);
|
3413 |
-
}
|
3414 |
|
3415 |
-
|
3416 |
-
}
|
3417 |
-
/**
|
3418 |
-
* Releases a request for scroll lock.
|
3419 |
-
*
|
3420 |
-
* This function tracks released requests for scroll lock. When all requests
|
3421 |
-
* have been released, it unlocks scroll.
|
3422 |
-
*/
|
3423 |
|
|
|
|
|
|
|
3424 |
|
3425 |
-
function releaseLock() {
|
3426 |
-
if (lockCounter === 1) {
|
3427 |
-
setLocked(false);
|
3428 |
-
}
|
3429 |
|
3430 |
-
|
3431 |
-
|
|
|
3432 |
|
3433 |
-
return /*#__PURE__*/function (_Component) {
|
3434 |
-
Object(inherits["a" /* default */])(ScrollLock, _Component);
|
3435 |
|
3436 |
-
var _super = scroll_lock_createSuper(ScrollLock);
|
3437 |
|
3438 |
-
|
3439 |
-
|
|
|
|
|
|
|
3440 |
|
3441 |
-
|
3442 |
-
|
|
|
|
|
3443 |
|
3444 |
-
|
3445 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3446 |
|
3447 |
-
/**
|
3448 |
-
* Requests scroll lock on mount.
|
3449 |
-
*/
|
3450 |
-
value: function componentDidMount() {
|
3451 |
-
requestLock();
|
3452 |
-
}
|
3453 |
-
/**
|
3454 |
-
* Releases scroll lock before unmount.
|
3455 |
-
*/
|
3456 |
|
3457 |
-
|
3458 |
-
|
3459 |
-
value: function componentWillUnmount() {
|
3460 |
-
releaseLock();
|
3461 |
}
|
3462 |
-
/**
|
3463 |
-
* Render nothing as this component is merely a way to declare scroll lock.
|
3464 |
-
*
|
3465 |
-
* @return {null} Render nothing by returning `null`.
|
3466 |
-
*/
|
3467 |
|
3468 |
-
|
3469 |
-
|
3470 |
-
|
3471 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3472 |
}
|
3473 |
-
}]);
|
3474 |
|
3475 |
-
|
3476 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3477 |
}
|
3478 |
-
/* harmony default export */ var scroll_lock = (createScrollLockComponent());
|
3479 |
-
//# sourceMappingURL=index.js.map
|
3480 |
-
// EXTERNAL MODULE: ./node_modules/@wordpress/components/build-module/isolated-event-container/index.js
|
3481 |
-
var isolated_event_container = __webpack_require__(131);
|
3482 |
|
3483 |
-
|
3484 |
-
var
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3485 |
|
3486 |
-
// EXTERNAL MODULE: ./node_modules/@wordpress/components/build-module/slot-fill/index.js + 4 modules
|
3487 |
-
var slot_fill = __webpack_require__(114);
|
3488 |
|
3489 |
-
// EXTERNAL MODULE: ./node_modules/@wordpress/components/build-module/animate/index.js
|
3490 |
-
var build_module_animate = __webpack_require__(134);
|
3491 |
|
3492 |
-
// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/popover/index.js
|
3493 |
|
3494 |
|
3495 |
|
3496 |
|
|
|
|
|
|
|
3497 |
|
3498 |
/**
|
3499 |
* External dependencies
|
@@ -3504,1580 +3406,1547 @@ var build_module_animate = __webpack_require__(134);
|
|
3504 |
*/
|
3505 |
|
3506 |
|
3507 |
-
|
3508 |
-
|
3509 |
-
|
3510 |
-
|
3511 |
-
|
3512 |
/**
|
3513 |
* Internal dependencies
|
3514 |
*/
|
3515 |
|
3516 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3517 |
|
|
|
|
|
3518 |
|
|
|
3519 |
|
|
|
|
|
3520 |
|
|
|
3521 |
|
3522 |
-
|
3523 |
-
|
3524 |
-
|
3525 |
-
|
3526 |
-
|
3527 |
-
|
3528 |
-
|
3529 |
-
|
3530 |
-
|
3531 |
-
|
3532 |
-
|
3533 |
-
|
3534 |
-
|
3535 |
-
|
3536 |
-
|
3537 |
-
|
3538 |
-
|
3539 |
-
|
3540 |
-
|
3541 |
-
|
3542 |
-
|
|
|
|
|
3543 |
}
|
3544 |
|
3545 |
-
|
3546 |
-
|
3547 |
-
|
3548 |
-
|
|
|
|
|
|
|
3549 |
|
3550 |
-
|
3551 |
-
|
|
|
|
|
3552 |
|
3553 |
-
|
3554 |
-
|
3555 |
-
|
3556 |
}
|
3557 |
-
|
3558 |
-
|
3559 |
-
|
|
|
|
|
3560 |
}
|
3561 |
-
|
3562 |
-
|
3563 |
-
|
3564 |
-
|
3565 |
-
|
3566 |
-
|
|
|
|
|
3567 |
}
|
3568 |
|
3569 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3570 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3571 |
|
3572 |
-
|
3573 |
-
|
3574 |
-
|
3575 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3576 |
|
3577 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3578 |
|
3579 |
-
|
3580 |
-
return
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3581 |
}
|
|
|
3582 |
|
3583 |
-
|
3584 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
3585 |
|
3586 |
-
if (!anchorRefFallback.current) {
|
3587 |
-
return;
|
3588 |
-
}
|
3589 |
|
3590 |
-
|
3591 |
-
var
|
|
|
|
|
3592 |
|
3593 |
-
|
3594 |
-
|
3595 |
-
|
|
|
3596 |
|
3597 |
-
|
3598 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3599 |
|
3600 |
-
|
3601 |
-
return node.ownerDocument.defaultView.getComputedStyle(node);
|
3602 |
-
}
|
3603 |
|
3604 |
-
|
3605 |
-
|
3606 |
-
|
3607 |
-
paddingBottom = _getComputedStyle.paddingBottom,
|
3608 |
-
paddingLeft = _getComputedStyle.paddingLeft,
|
3609 |
-
paddingRight = _getComputedStyle.paddingRight;
|
3610 |
|
3611 |
-
|
3612 |
-
var bottom = paddingBottom ? parseInt(paddingBottom, 10) : 0;
|
3613 |
-
var left = paddingLeft ? parseInt(paddingLeft, 10) : 0;
|
3614 |
-
var right = paddingRight ? parseInt(paddingRight, 10) : 0;
|
3615 |
-
return {
|
3616 |
-
x: rect.left + left,
|
3617 |
-
y: rect.top + top,
|
3618 |
-
width: rect.width - left - right,
|
3619 |
-
height: rect.height - top - bottom,
|
3620 |
-
left: rect.left + left,
|
3621 |
-
right: rect.right - right,
|
3622 |
-
top: rect.top + top,
|
3623 |
-
bottom: rect.bottom - bottom
|
3624 |
-
};
|
3625 |
-
}
|
3626 |
-
/**
|
3627 |
-
* Hook used to focus the first tabbable element on mount.
|
3628 |
-
*
|
3629 |
-
* @param {boolean|string} focusOnMount Focus on mount mode.
|
3630 |
-
* @param {Object} contentRef Reference to the popover content element.
|
3631 |
-
*/
|
3632 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3633 |
|
3634 |
-
|
3635 |
-
// Focus handling
|
3636 |
-
Object(external_this_wp_element_["useEffect"])(function () {
|
3637 |
-
/*
|
3638 |
-
* Without the setTimeout, the dom node is not being focused. Related:
|
3639 |
-
* https://stackoverflow.com/questions/35522220/react-ref-with-focus-doesnt-work-without-settimeout-my-example
|
3640 |
-
*
|
3641 |
-
* TODO: Treat the cause, not the symptom.
|
3642 |
-
*/
|
3643 |
-
var focusTimeout = setTimeout(function () {
|
3644 |
-
if (!focusOnMount || !contentRef.current) {
|
3645 |
-
return;
|
3646 |
-
}
|
3647 |
|
3648 |
-
|
3649 |
-
|
3650 |
-
// back to the popover panel itself.
|
3651 |
-
var firstTabbable = build_module["a" /* focus */].tabbable.find(contentRef.current)[0];
|
3652 |
|
3653 |
-
|
3654 |
-
|
3655 |
-
} else {
|
3656 |
-
contentRef.current.focus();
|
3657 |
-
}
|
3658 |
|
3659 |
-
|
3660 |
-
|
3661 |
|
3662 |
-
|
3663 |
-
|
3664 |
-
|
3665 |
-
|
3666 |
-
}
|
3667 |
-
}, 0);
|
3668 |
-
return function () {
|
3669 |
-
return clearTimeout(focusTimeout);
|
3670 |
-
};
|
3671 |
-
}, []);
|
3672 |
-
}
|
3673 |
/**
|
3674 |
-
*
|
3675 |
-
*
|
3676 |
-
* @param {Element} element The element to modify.
|
3677 |
-
* @param {string} name The attribute name to set or remove.
|
3678 |
-
* @param {?string} value The value to set. A falsy value will remove the
|
3679 |
-
* attribute.
|
3680 |
*/
|
3681 |
|
3682 |
-
|
3683 |
-
function setAttribute(element, name, value) {
|
3684 |
-
if (!value) {
|
3685 |
-
if (element.hasAttribute(name)) {
|
3686 |
-
element.removeAttribute(name);
|
3687 |
-
}
|
3688 |
-
} else if (element.getAttribute(name) !== value) {
|
3689 |
-
element.setAttribute(name, value);
|
3690 |
-
}
|
3691 |
-
}
|
3692 |
/**
|
3693 |
-
*
|
3694 |
*
|
3695 |
-
* @param {
|
3696 |
-
*
|
3697 |
-
* @
|
3698 |
-
* property.
|
3699 |
*/
|
3700 |
|
|
|
|
|
3701 |
|
3702 |
-
|
3703 |
-
|
3704 |
-
|
3705 |
-
if (element.style[property] !== value) {
|
3706 |
-
element.style[property] = value;
|
3707 |
-
}
|
3708 |
}
|
|
|
|
|
|
|
|
|
|
|
3709 |
/**
|
3710 |
-
*
|
|
|
|
|
|
|
3711 |
*
|
3712 |
-
*
|
3713 |
-
*
|
3714 |
-
*
|
3715 |
*/
|
3716 |
|
|
|
|
|
|
|
3717 |
|
3718 |
-
|
3719 |
-
|
3720 |
-
|
3721 |
-
element.classList.add(name);
|
3722 |
-
}
|
3723 |
-
} else if (element.classList.contains(name)) {
|
3724 |
-
element.classList.remove(name);
|
3725 |
-
}
|
3726 |
-
}
|
3727 |
|
3728 |
-
var popover_Popover = function Popover(_ref2) {
|
3729 |
-
var headerTitle = _ref2.headerTitle,
|
3730 |
-
onClose = _ref2.onClose,
|
3731 |
-
onKeyDown = _ref2.onKeyDown,
|
3732 |
-
children = _ref2.children,
|
3733 |
-
className = _ref2.className,
|
3734 |
-
_ref2$noArrow = _ref2.noArrow,
|
3735 |
-
noArrow = _ref2$noArrow === void 0 ? true : _ref2$noArrow,
|
3736 |
-
isAlternate = _ref2.isAlternate,
|
3737 |
-
_ref2$position = _ref2.position,
|
3738 |
-
position = _ref2$position === void 0 ? 'bottom right' : _ref2$position,
|
3739 |
-
range = _ref2.range,
|
3740 |
-
_ref2$focusOnMount = _ref2.focusOnMount,
|
3741 |
-
focusOnMount = _ref2$focusOnMount === void 0 ? 'firstElement' : _ref2$focusOnMount,
|
3742 |
-
anchorRef = _ref2.anchorRef,
|
3743 |
-
shouldAnchorIncludePadding = _ref2.shouldAnchorIncludePadding,
|
3744 |
-
anchorRect = _ref2.anchorRect,
|
3745 |
-
getAnchorRect = _ref2.getAnchorRect,
|
3746 |
-
expandOnMobile = _ref2.expandOnMobile,
|
3747 |
-
_ref2$animate = _ref2.animate,
|
3748 |
-
animate = _ref2$animate === void 0 ? true : _ref2$animate,
|
3749 |
-
onClickOutside = _ref2.onClickOutside,
|
3750 |
-
onFocusOutside = _ref2.onFocusOutside,
|
3751 |
-
__unstableSticky = _ref2.__unstableSticky,
|
3752 |
-
_ref2$__unstableSlotN = _ref2.__unstableSlotName,
|
3753 |
-
__unstableSlotName = _ref2$__unstableSlotN === void 0 ? SLOT_NAME : _ref2$__unstableSlotN,
|
3754 |
-
__unstableObserveElement = _ref2.__unstableObserveElement,
|
3755 |
-
__unstableBoundaryParent = _ref2.__unstableBoundaryParent,
|
3756 |
-
contentProps = Object(objectWithoutProperties["a" /* default */])(_ref2, ["headerTitle", "onClose", "onKeyDown", "children", "className", "noArrow", "isAlternate", "position", "range", "focusOnMount", "anchorRef", "shouldAnchorIncludePadding", "anchorRect", "getAnchorRect", "expandOnMobile", "animate", "onClickOutside", "onFocusOutside", "__unstableSticky", "__unstableSlotName", "__unstableObserveElement", "__unstableBoundaryParent"]);
|
3757 |
|
3758 |
-
|
3759 |
-
|
3760 |
-
|
3761 |
-
var isMobileViewport = Object(use_viewport_match["a" /* default */])('medium', '<');
|
3762 |
|
3763 |
-
var _useState = Object(external_this_wp_element_["useState"])(),
|
3764 |
-
_useState2 = Object(slicedToArray["a" /* default */])(_useState, 2),
|
3765 |
-
animateOrigin = _useState2[0],
|
3766 |
-
setAnimateOrigin = _useState2[1];
|
3767 |
|
3768 |
-
|
3769 |
-
|
|
|
3770 |
|
3771 |
-
|
3772 |
-
|
3773 |
-
|
3774 |
-
|
|
|
|
|
3775 |
|
3776 |
-
|
3777 |
-
|
3778 |
-
|
3779 |
-
setClass(containerRef.current, 'is-without-arrow', noArrow);
|
3780 |
-
setClass(containerRef.current, 'is-alternate', isAlternate);
|
3781 |
-
setAttribute(containerRef.current, 'data-x-axis');
|
3782 |
-
setAttribute(containerRef.current, 'data-y-axis');
|
3783 |
-
setStyle(containerRef.current, 'top');
|
3784 |
-
setStyle(containerRef.current, 'left');
|
3785 |
-
setStyle(contentRef.current, 'maxHeight');
|
3786 |
-
setStyle(contentRef.current, 'maxWidth');
|
3787 |
-
return;
|
3788 |
-
}
|
3789 |
|
3790 |
-
|
3791 |
-
|
3792 |
-
|
3793 |
-
|
3794 |
|
3795 |
-
|
|
|
|
|
|
|
3796 |
|
3797 |
-
|
3798 |
-
|
3799 |
-
|
|
|
3800 |
|
3801 |
-
|
3802 |
-
|
3803 |
-
|
3804 |
-
|
3805 |
-
// subtract the position from the anchor rect. If the position of
|
3806 |
-
// the popover is fixed, the offset parent is null or the body
|
3807 |
-
// element, in which case the position is relative to the viewport.
|
3808 |
-
// See https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/offsetParent
|
3809 |
|
3810 |
-
|
3811 |
-
|
3812 |
-
|
3813 |
-
|
3814 |
-
}
|
3815 |
|
3816 |
-
|
|
|
|
|
|
|
3817 |
|
3818 |
-
|
3819 |
-
|
|
|
|
|
3820 |
|
3821 |
-
|
3822 |
-
|
|
|
|
|
3823 |
|
3824 |
-
|
|
|
|
|
|
|
3825 |
|
3826 |
-
|
3827 |
-
|
3828 |
-
|
3829 |
-
|
3830 |
-
yAxis = _computePopoverPositi.yAxis,
|
3831 |
-
contentHeight = _computePopoverPositi.contentHeight,
|
3832 |
-
contentWidth = _computePopoverPositi.contentWidth;
|
3833 |
|
3834 |
-
|
3835 |
-
|
3836 |
-
|
3837 |
-
|
3838 |
|
3839 |
-
|
3840 |
-
|
3841 |
-
|
3842 |
-
|
3843 |
-
setStyle(contentRef.current, 'maxHeight', typeof contentHeight === 'number' ? contentHeight + 'px' : '');
|
3844 |
-
setStyle(contentRef.current, 'maxWidth', typeof contentWidth === 'number' ? contentWidth + 'px' : ''); // Compute the animation position
|
3845 |
|
3846 |
-
|
3847 |
-
|
3848 |
-
|
3849 |
-
|
3850 |
-
var xAxisMapping = {
|
3851 |
-
left: 'right',
|
3852 |
-
right: 'left'
|
3853 |
-
};
|
3854 |
-
var animateYAxis = yAxisMapping[yAxis] || 'middle';
|
3855 |
-
var animateXAxis = xAxisMapping[xAxis] || 'center';
|
3856 |
-
setAnimateOrigin(animateXAxis + ' ' + animateYAxis);
|
3857 |
-
};
|
3858 |
|
3859 |
-
|
3860 |
-
|
3861 |
-
|
3862 |
-
|
3863 |
-
* in the layout that changes the position of the anchor).
|
3864 |
-
*
|
3865 |
-
* For these situations, we refresh the popover every 0.5s
|
3866 |
-
*/
|
3867 |
|
3868 |
-
|
3869 |
-
|
|
|
|
|
3870 |
|
3871 |
-
|
3872 |
-
|
3873 |
-
|
3874 |
-
|
3875 |
-
|
3876 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3877 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3878 |
|
3879 |
-
|
3880 |
-
|
3881 |
-
|
3882 |
-
var observer;
|
3883 |
|
3884 |
-
|
3885 |
-
|
3886 |
-
|
3887 |
-
|
3888 |
-
|
3889 |
-
|
|
|
|
|
|
|
|
|
3890 |
|
3891 |
-
|
3892 |
-
|
3893 |
-
|
3894 |
-
window.removeEventListener('scroll', refresh, true);
|
3895 |
-
window.removeEventListener('click', refreshOnAnimationFrame);
|
3896 |
-
window.cancelAnimationFrame(rafId);
|
3897 |
|
3898 |
-
|
3899 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3900 |
}
|
3901 |
-
};
|
3902 |
-
}, [isExpanded, anchorRect, getAnchorRect, anchorRef, shouldAnchorIncludePadding, position, contentSize, __unstableSticky, __unstableObserveElement, __unstableBoundaryParent]);
|
3903 |
-
useFocusContentOnMount(focusOnMount, contentRef); // Event handlers
|
3904 |
|
3905 |
-
|
3906 |
-
|
3907 |
-
|
3908 |
-
|
3909 |
-
|
3910 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3911 |
|
|
|
|
|
|
|
3912 |
|
3913 |
-
|
3914 |
-
onKeyDown(event);
|
3915 |
-
}
|
3916 |
};
|
3917 |
-
|
3918 |
-
|
3919 |
-
|
3920 |
-
|
3921 |
-
|
3922 |
-
|
|
|
|
|
3923 |
|
|
|
|
|
|
|
3924 |
|
3925 |
-
|
3926 |
-
// Defer to given `onFocusOutside` if specified. Call `onClose` only if
|
3927 |
-
// both `onFocusOutside` and `onClickOutside` are unspecified. Doing so
|
3928 |
-
// assures backwards-compatibility for prior `onClickOutside` default.
|
3929 |
-
if (onFocusOutside) {
|
3930 |
-
onFocusOutside(event);
|
3931 |
-
return;
|
3932 |
-
} else if (!onClickOutside) {
|
3933 |
-
if (onClose) {
|
3934 |
-
onClose();
|
3935 |
-
}
|
3936 |
|
3937 |
-
|
3938 |
-
} // Simulate MouseEvent using FocusEvent#relatedTarget as emulated click
|
3939 |
-
// target. MouseEvent constructor is unsupported in Internet Explorer.
|
3940 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3941 |
|
3942 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3943 |
|
3944 |
-
try {
|
3945 |
-
clickEvent = new window.MouseEvent('click');
|
3946 |
-
} catch (error) {
|
3947 |
-
clickEvent = document.createEvent('MouseEvent');
|
3948 |
-
clickEvent.initMouseEvent('click', true, true, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);
|
3949 |
-
}
|
3950 |
|
3951 |
-
|
3952 |
-
|
3953 |
-
|
3954 |
-
}
|
3955 |
-
});
|
3956 |
-
Object(deprecated_build_module["a" /* default */])('Popover onClickOutside prop', {
|
3957 |
-
alternative: 'onFocusOutside'
|
3958 |
-
});
|
3959 |
-
onClickOutside(clickEvent);
|
3960 |
-
} // Disable reason: We care to capture the _bubbled_ events from inputs
|
3961 |
-
// within popover as inferring close intent.
|
3962 |
|
|
|
|
|
3963 |
|
3964 |
-
|
3965 |
-
|
3966 |
-
}, Object(external_this_wp_element_["createElement"])(build_module_animate["a" /* default */], {
|
3967 |
-
type: animate && animateOrigin ? 'appear' : null,
|
3968 |
-
options: {
|
3969 |
-
origin: animateOrigin
|
3970 |
}
|
3971 |
-
}, function (_ref3) {
|
3972 |
-
var animateClassName = _ref3.className;
|
3973 |
-
return Object(external_this_wp_element_["createElement"])(isolated_event_container["a" /* default */], Object(esm_extends["a" /* default */])({
|
3974 |
-
className: classnames_default()('components-popover', className, animateClassName, {
|
3975 |
-
'is-expanded': isExpanded,
|
3976 |
-
'is-without-arrow': noArrow,
|
3977 |
-
'is-alternate': isAlternate
|
3978 |
-
})
|
3979 |
-
}, contentProps, {
|
3980 |
-
onKeyDown: maybeClose,
|
3981 |
-
ref: containerRef
|
3982 |
-
}), isExpanded && Object(external_this_wp_element_["createElement"])(scroll_lock, null), isExpanded && Object(external_this_wp_element_["createElement"])("div", {
|
3983 |
-
className: "components-popover__header"
|
3984 |
-
}, Object(external_this_wp_element_["createElement"])("span", {
|
3985 |
-
className: "components-popover__header-title"
|
3986 |
-
}, headerTitle), Object(external_this_wp_element_["createElement"])(build_module_button["a" /* default */], {
|
3987 |
-
className: "components-popover__close",
|
3988 |
-
icon: library_close["a" /* default */],
|
3989 |
-
onClick: onClose
|
3990 |
-
})), Object(external_this_wp_element_["createElement"])("div", {
|
3991 |
-
ref: contentRef,
|
3992 |
-
className: "components-popover__content",
|
3993 |
-
tabIndex: "-1"
|
3994 |
-
}, Object(external_this_wp_element_["createElement"])("div", {
|
3995 |
-
style: {
|
3996 |
-
position: 'relative'
|
3997 |
-
}
|
3998 |
-
}, containerResizeListener, children)));
|
3999 |
-
})); // Apply focus to element as long as focusOnMount is truthy; false is
|
4000 |
-
// the only "disabled" value.
|
4001 |
|
4002 |
-
|
4003 |
-
|
4004 |
-
|
4005 |
|
4006 |
-
|
4007 |
-
|
4008 |
-
|
4009 |
-
|
4010 |
-
}
|
4011 |
|
4012 |
-
|
4013 |
-
|
4014 |
-
|
4015 |
|
4016 |
-
|
4017 |
-
ref: anchorRefFallback
|
4018 |
-
}, content);
|
4019 |
-
};
|
4020 |
|
4021 |
-
|
|
|
|
|
|
|
4022 |
|
4023 |
-
|
4024 |
-
|
4025 |
-
name = _ref4$name === void 0 ? SLOT_NAME : _ref4$name;
|
4026 |
-
return Object(external_this_wp_element_["createElement"])(slot_fill["b" /* Slot */], {
|
4027 |
-
bubblesVirtually: true,
|
4028 |
-
name: name,
|
4029 |
-
className: "popover-slot"
|
4030 |
-
});
|
4031 |
-
};
|
4032 |
|
4033 |
-
|
4034 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4035 |
|
4036 |
/***/ }),
|
|
|
|
|
4037 |
|
4038 |
-
|
4039 |
-
|
|
|
4040 |
|
4041 |
-
|
4042 |
-
|
4043 |
-
|
4044 |
-
|
4045 |
-
|
4046 |
-
|
|
|
|
|
4047 |
|
4048 |
-
|
4049 |
-
|
|
|
|
|
4050 |
|
4051 |
-
|
4052 |
-
|
4053 |
-
|
4054 |
-
|
4055 |
-
|
4056 |
-
|
4057 |
-
|
4058 |
|
4059 |
-
function define(obj, key, value) {
|
4060 |
-
Object.defineProperty(obj, key, {
|
4061 |
-
value: value,
|
4062 |
-
enumerable: true,
|
4063 |
-
configurable: true,
|
4064 |
-
writable: true
|
4065 |
-
});
|
4066 |
-
return obj[key];
|
4067 |
-
}
|
4068 |
-
try {
|
4069 |
-
// IE 8 has a broken Object.defineProperty that only works on DOM objects.
|
4070 |
-
define({}, "");
|
4071 |
-
} catch (err) {
|
4072 |
-
define = function(obj, key, value) {
|
4073 |
-
return obj[key] = value;
|
4074 |
-
};
|
4075 |
-
}
|
4076 |
|
4077 |
-
|
4078 |
-
|
4079 |
-
|
4080 |
-
|
4081 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4082 |
|
4083 |
-
|
4084 |
-
|
4085 |
-
|
4086 |
|
4087 |
-
|
4088 |
-
|
4089 |
-
exports.wrap = wrap;
|
4090 |
|
4091 |
-
|
4092 |
-
|
4093 |
-
// have been (and was previously) designed to take a closure to be
|
4094 |
-
// invoked without arguments, but in all the cases we care about we
|
4095 |
-
// already have an existing method we want to call, so there's no need
|
4096 |
-
// to create a new function object. We can even get away with assuming
|
4097 |
-
// the method takes exactly one argument, since that happens to be true
|
4098 |
-
// in every case, so we don't have to touch the arguments object. The
|
4099 |
-
// only additional allocation required is the completion record, which
|
4100 |
-
// has a stable shape and so hopefully should be cheap to allocate.
|
4101 |
-
function tryCatch(fn, obj, arg) {
|
4102 |
-
try {
|
4103 |
-
return { type: "normal", arg: fn.call(obj, arg) };
|
4104 |
-
} catch (err) {
|
4105 |
-
return { type: "throw", arg: err };
|
4106 |
-
}
|
4107 |
}
|
4108 |
|
4109 |
-
|
4110 |
-
|
4111 |
-
var GenStateExecuting = "executing";
|
4112 |
-
var GenStateCompleted = "completed";
|
4113 |
|
4114 |
-
|
4115 |
-
// breaking out of the dispatch switch statement.
|
4116 |
-
var ContinueSentinel = {};
|
4117 |
|
4118 |
-
|
4119 |
-
|
4120 |
-
|
4121 |
-
// minifier not to mangle the names of these two functions.
|
4122 |
-
function Generator() {}
|
4123 |
-
function GeneratorFunction() {}
|
4124 |
-
function GeneratorFunctionPrototype() {}
|
4125 |
|
4126 |
-
|
4127 |
-
|
4128 |
-
var IteratorPrototype = {};
|
4129 |
-
IteratorPrototype[iteratorSymbol] = function () {
|
4130 |
-
return this;
|
4131 |
-
};
|
4132 |
|
4133 |
-
|
4134 |
-
|
4135 |
-
|
4136 |
-
|
4137 |
-
hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {
|
4138 |
-
// This environment has a native %IteratorPrototype%; use it instead
|
4139 |
-
// of the polyfill.
|
4140 |
-
IteratorPrototype = NativeIteratorPrototype;
|
4141 |
-
}
|
4142 |
|
4143 |
-
|
4144 |
-
|
4145 |
-
GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype;
|
4146 |
-
GeneratorFunctionPrototype.constructor = GeneratorFunction;
|
4147 |
-
GeneratorFunction.displayName = define(
|
4148 |
-
GeneratorFunctionPrototype,
|
4149 |
-
toStringTagSymbol,
|
4150 |
-
"GeneratorFunction"
|
4151 |
-
);
|
4152 |
|
4153 |
-
|
4154 |
-
|
4155 |
-
|
4156 |
-
|
4157 |
-
|
4158 |
-
|
4159 |
-
|
4160 |
-
|
4161 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4162 |
|
4163 |
-
exports.isGeneratorFunction = function(genFun) {
|
4164 |
-
var ctor = typeof genFun === "function" && genFun.constructor;
|
4165 |
-
return ctor
|
4166 |
-
? ctor === GeneratorFunction ||
|
4167 |
-
// For the native GeneratorFunction constructor, the best we can
|
4168 |
-
// do is to check its .name property.
|
4169 |
-
(ctor.displayName || ctor.name) === "GeneratorFunction"
|
4170 |
-
: false;
|
4171 |
-
};
|
4172 |
|
4173 |
-
|
4174 |
-
|
4175 |
-
|
4176 |
-
|
4177 |
-
|
4178 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4179 |
}
|
4180 |
-
genFun.prototype = Object.create(Gp);
|
4181 |
-
return genFun;
|
4182 |
-
};
|
4183 |
|
4184 |
-
// Within the body of any async function, `await x` is transformed to
|
4185 |
-
// `yield regeneratorRuntime.awrap(x)`, so that the runtime can test
|
4186 |
-
// `hasOwn.call(value, "__await")` to determine if the yielded value is
|
4187 |
-
// meant to be awaited.
|
4188 |
-
exports.awrap = function(arg) {
|
4189 |
-
return { __await: arg };
|
4190 |
-
};
|
4191 |
|
4192 |
-
function AsyncIterator(generator, PromiseImpl) {
|
4193 |
-
function invoke(method, arg, resolve, reject) {
|
4194 |
-
var record = tryCatch(generator[method], generator, arg);
|
4195 |
-
if (record.type === "throw") {
|
4196 |
-
reject(record.arg);
|
4197 |
-
} else {
|
4198 |
-
var result = record.arg;
|
4199 |
-
var value = result.value;
|
4200 |
-
if (value &&
|
4201 |
-
typeof value === "object" &&
|
4202 |
-
hasOwn.call(value, "__await")) {
|
4203 |
-
return PromiseImpl.resolve(value.__await).then(function(value) {
|
4204 |
-
invoke("next", value, resolve, reject);
|
4205 |
-
}, function(err) {
|
4206 |
-
invoke("throw", err, resolve, reject);
|
4207 |
-
});
|
4208 |
-
}
|
4209 |
|
4210 |
-
|
4211 |
-
|
4212 |
-
|
4213 |
-
|
4214 |
-
|
4215 |
-
|
4216 |
-
|
4217 |
-
|
4218 |
-
|
4219 |
-
|
4220 |
-
|
4221 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
4222 |
}
|
|
|
4223 |
|
4224 |
-
|
|
|
|
|
|
|
|
|
|
|
4225 |
|
4226 |
-
|
4227 |
-
|
4228 |
-
|
4229 |
-
|
4230 |
-
|
4231 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4232 |
|
4233 |
-
|
4234 |
-
|
4235 |
-
|
4236 |
-
|
4237 |
-
|
4238 |
-
|
4239 |
-
|
4240 |
-
|
4241 |
-
|
4242 |
-
|
4243 |
-
// execute code before the first await. Since we implement simple
|
4244 |
-
// async functions in terms of async generators, it is especially
|
4245 |
-
// important to get this right, even though it requires care.
|
4246 |
-
previousPromise ? previousPromise.then(
|
4247 |
-
callInvokeWithMethodAndArg,
|
4248 |
-
// Avoid propagating failures to Promises returned by later
|
4249 |
-
// invocations of the iterator.
|
4250 |
-
callInvokeWithMethodAndArg
|
4251 |
-
) : callInvokeWithMethodAndArg();
|
4252 |
}
|
|
|
4253 |
|
4254 |
-
|
4255 |
-
|
4256 |
-
this.
|
4257 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4258 |
|
4259 |
-
|
4260 |
-
AsyncIterator.prototype[asyncIteratorSymbol] = function () {
|
4261 |
-
return this;
|
4262 |
-
};
|
4263 |
-
exports.AsyncIterator = AsyncIterator;
|
4264 |
|
4265 |
-
|
4266 |
-
|
4267 |
-
|
4268 |
-
|
4269 |
-
|
|
|
|
|
|
|
|
|
4270 |
|
4271 |
-
|
4272 |
-
wrap(innerFn, outerFn, self, tryLocsList),
|
4273 |
-
PromiseImpl
|
4274 |
-
);
|
4275 |
|
4276 |
-
|
4277 |
-
|
4278 |
-
|
4279 |
-
return result.done ? result.value : iter.next();
|
4280 |
-
});
|
4281 |
-
};
|
4282 |
|
4283 |
-
|
4284 |
-
|
|
|
|
|
|
|
4285 |
|
4286 |
-
return function invoke(method, arg) {
|
4287 |
-
if (state === GenStateExecuting) {
|
4288 |
-
throw new Error("Generator is already running");
|
4289 |
-
}
|
4290 |
|
4291 |
-
|
4292 |
-
|
4293 |
-
|
4294 |
-
|
4295 |
|
4296 |
-
|
4297 |
-
// https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume
|
4298 |
-
return doneResult();
|
4299 |
-
}
|
4300 |
|
4301 |
-
context.method = method;
|
4302 |
-
context.arg = arg;
|
4303 |
|
4304 |
-
|
4305 |
-
|
4306 |
-
|
4307 |
-
|
4308 |
-
|
4309 |
-
if (delegateResult === ContinueSentinel) continue;
|
4310 |
-
return delegateResult;
|
4311 |
-
}
|
4312 |
-
}
|
4313 |
|
4314 |
-
|
4315 |
-
// Setting context._sent for legacy support of Babel's
|
4316 |
-
// function.sent implementation.
|
4317 |
-
context.sent = context._sent = context.arg;
|
4318 |
|
4319 |
-
|
4320 |
-
|
4321 |
-
|
4322 |
-
throw context.arg;
|
4323 |
-
}
|
4324 |
|
4325 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4326 |
|
4327 |
-
|
4328 |
-
|
4329 |
-
}
|
4330 |
|
4331 |
-
|
|
|
|
|
4332 |
|
4333 |
-
var record = tryCatch(innerFn, self, context);
|
4334 |
-
if (record.type === "normal") {
|
4335 |
-
// If an exception is thrown from innerFn, we leave state ===
|
4336 |
-
// GenStateExecuting and loop back for another invocation.
|
4337 |
-
state = context.done
|
4338 |
-
? GenStateCompleted
|
4339 |
-
: GenStateSuspendedYield;
|
4340 |
|
4341 |
-
|
4342 |
-
|
4343 |
-
|
|
|
4344 |
|
4345 |
-
|
4346 |
-
|
4347 |
-
|
4348 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4349 |
|
4350 |
-
} else if (record.type === "throw") {
|
4351 |
-
state = GenStateCompleted;
|
4352 |
-
// Dispatch the exception by looping back around to the
|
4353 |
-
// context.dispatchException(context.arg) call above.
|
4354 |
-
context.method = "throw";
|
4355 |
-
context.arg = record.arg;
|
4356 |
-
}
|
4357 |
-
}
|
4358 |
-
};
|
4359 |
-
}
|
4360 |
|
4361 |
-
// Call delegate.iterator[context.method](context.arg) and handle the
|
4362 |
-
// result, either by returning a { value, done } result from the
|
4363 |
-
// delegate iterator, or by modifying context.method and context.arg,
|
4364 |
-
// setting context.delegate to null, and returning the ContinueSentinel.
|
4365 |
-
function maybeInvokeDelegate(delegate, context) {
|
4366 |
-
var method = delegate.iterator[context.method];
|
4367 |
-
if (method === undefined) {
|
4368 |
-
// A .throw or .return when the delegate iterator has no .throw
|
4369 |
-
// method always terminates the yield* loop.
|
4370 |
-
context.delegate = null;
|
4371 |
|
4372 |
-
if (context.method === "throw") {
|
4373 |
-
// Note: ["return"] must be used for ES3 parsing compatibility.
|
4374 |
-
if (delegate.iterator["return"]) {
|
4375 |
-
// If the delegate iterator has a return method, give it a
|
4376 |
-
// chance to clean up.
|
4377 |
-
context.method = "return";
|
4378 |
-
context.arg = undefined;
|
4379 |
-
maybeInvokeDelegate(delegate, context);
|
4380 |
|
4381 |
-
|
4382 |
-
// If maybeInvokeDelegate(context) changed context.method from
|
4383 |
-
// "return" to "throw", let that override the TypeError below.
|
4384 |
-
return ContinueSentinel;
|
4385 |
-
}
|
4386 |
-
}
|
4387 |
|
4388 |
-
|
4389 |
-
context.arg = new TypeError(
|
4390 |
-
"The iterator does not provide a 'throw' method");
|
4391 |
-
}
|
4392 |
|
4393 |
-
|
4394 |
-
}
|
4395 |
|
4396 |
-
|
|
|
|
|
4397 |
|
4398 |
-
if (record.type === "throw") {
|
4399 |
-
context.method = "throw";
|
4400 |
-
context.arg = record.arg;
|
4401 |
-
context.delegate = null;
|
4402 |
-
return ContinueSentinel;
|
4403 |
-
}
|
4404 |
|
4405 |
-
|
|
|
|
|
4406 |
|
4407 |
-
if (! info) {
|
4408 |
-
context.method = "throw";
|
4409 |
-
context.arg = new TypeError("iterator result is not an object");
|
4410 |
-
context.delegate = null;
|
4411 |
-
return ContinueSentinel;
|
4412 |
-
}
|
4413 |
|
4414 |
-
if (info.done) {
|
4415 |
-
// Assign the result of the finished delegate to the temporary
|
4416 |
-
// variable specified by delegate.resultName (see delegateYield).
|
4417 |
-
context[delegate.resultName] = info.value;
|
4418 |
|
4419 |
-
|
4420 |
-
|
|
|
4421 |
|
4422 |
-
// If context.method was "throw" but the delegate handled the
|
4423 |
-
// exception, let the outer generator proceed normally. If
|
4424 |
-
// context.method was "next", forget context.arg since it has been
|
4425 |
-
// "consumed" by the delegate iterator. If context.method was
|
4426 |
-
// "return", allow the original .return call to continue in the
|
4427 |
-
// outer generator.
|
4428 |
-
if (context.method !== "return") {
|
4429 |
-
context.method = "next";
|
4430 |
-
context.arg = undefined;
|
4431 |
-
}
|
4432 |
|
4433 |
-
} else {
|
4434 |
-
// Re-yield the result returned by the delegate method.
|
4435 |
-
return info;
|
4436 |
-
}
|
4437 |
|
4438 |
-
|
4439 |
-
|
4440 |
-
|
4441 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4442 |
}
|
4443 |
|
4444 |
-
|
4445 |
-
|
4446 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4447 |
|
4448 |
-
|
|
|
|
|
|
|
4449 |
|
4450 |
-
|
4451 |
-
|
4452 |
-
// iterator prototype chain incorrectly implement this, causing the Generator
|
4453 |
-
// object to not be returned from this call. This ensures that doesn't happen.
|
4454 |
-
// See https://github.com/facebook/regenerator/issues/274 for more details.
|
4455 |
-
Gp[iteratorSymbol] = function() {
|
4456 |
-
return this;
|
4457 |
-
};
|
4458 |
-
|
4459 |
-
Gp.toString = function() {
|
4460 |
-
return "[object Generator]";
|
4461 |
-
};
|
4462 |
-
|
4463 |
-
function pushTryEntry(locs) {
|
4464 |
-
var entry = { tryLoc: locs[0] };
|
4465 |
|
4466 |
-
|
4467 |
-
|
4468 |
-
|
4469 |
|
4470 |
-
|
4471 |
-
|
4472 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
4473 |
}
|
|
|
4474 |
|
4475 |
-
this.tryEntries.push(entry);
|
4476 |
-
}
|
4477 |
|
4478 |
-
|
4479 |
-
|
4480 |
-
|
4481 |
-
|
4482 |
-
|
4483 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4484 |
|
4485 |
-
|
4486 |
-
|
4487 |
-
// or a finally block) gives us a place to store values thrown from
|
4488 |
-
// locations where there is no enclosing try statement.
|
4489 |
-
this.tryEntries = [{ tryLoc: "root" }];
|
4490 |
-
tryLocsList.forEach(pushTryEntry, this);
|
4491 |
-
this.reset(true);
|
4492 |
}
|
4493 |
|
4494 |
-
|
4495 |
-
|
4496 |
-
|
4497 |
-
|
4498 |
-
|
4499 |
-
|
|
|
|
|
4500 |
|
4501 |
-
|
4502 |
-
|
4503 |
-
|
4504 |
-
while (keys.length) {
|
4505 |
-
var key = keys.pop();
|
4506 |
-
if (key in object) {
|
4507 |
-
next.value = key;
|
4508 |
-
next.done = false;
|
4509 |
-
return next;
|
4510 |
-
}
|
4511 |
-
}
|
4512 |
|
4513 |
-
|
4514 |
-
// and .done properties off the next function object itself. This
|
4515 |
-
// also ensures that the minifier will not anonymize the function.
|
4516 |
-
next.done = true;
|
4517 |
-
return next;
|
4518 |
-
};
|
4519 |
-
};
|
4520 |
|
4521 |
-
|
4522 |
-
|
4523 |
-
var iteratorMethod = iterable[iteratorSymbol];
|
4524 |
-
if (iteratorMethod) {
|
4525 |
-
return iteratorMethod.call(iterable);
|
4526 |
-
}
|
4527 |
|
4528 |
-
|
4529 |
-
return iterable;
|
4530 |
-
}
|
4531 |
|
4532 |
-
|
4533 |
-
|
4534 |
-
|
4535 |
-
|
4536 |
-
next.value = iterable[i];
|
4537 |
-
next.done = false;
|
4538 |
-
return next;
|
4539 |
-
}
|
4540 |
-
}
|
4541 |
|
4542 |
-
|
4543 |
-
|
|
|
|
|
|
|
|
|
|
|
4544 |
|
4545 |
-
|
4546 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4547 |
|
4548 |
-
|
4549 |
-
|
4550 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4551 |
|
4552 |
-
// Return an iterator with no values.
|
4553 |
-
return { next: doneResult };
|
4554 |
-
}
|
4555 |
-
exports.values = values;
|
4556 |
|
4557 |
-
|
4558 |
-
|
4559 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4560 |
|
4561 |
-
Context.prototype = {
|
4562 |
-
constructor: Context,
|
4563 |
|
4564 |
-
|
4565 |
-
|
4566 |
-
this.next = 0;
|
4567 |
-
// Resetting context._sent for legacy support of Babel's
|
4568 |
-
// function.sent implementation.
|
4569 |
-
this.sent = this._sent = undefined;
|
4570 |
-
this.done = false;
|
4571 |
-
this.delegate = null;
|
4572 |
|
4573 |
-
|
4574 |
-
|
|
|
4575 |
|
4576 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4577 |
|
4578 |
-
if (!skipTempReset) {
|
4579 |
-
for (var name in this) {
|
4580 |
-
// Not sure about the optimal order of these conditions:
|
4581 |
-
if (name.charAt(0) === "t" &&
|
4582 |
-
hasOwn.call(this, name) &&
|
4583 |
-
!isNaN(+name.slice(1))) {
|
4584 |
-
this[name] = undefined;
|
4585 |
-
}
|
4586 |
-
}
|
4587 |
-
}
|
4588 |
-
},
|
4589 |
|
4590 |
-
|
4591 |
-
|
|
|
|
|
|
|
|
|
4592 |
|
4593 |
-
|
4594 |
-
var rootRecord = rootEntry.completion;
|
4595 |
-
if (rootRecord.type === "throw") {
|
4596 |
-
throw rootRecord.arg;
|
4597 |
-
}
|
4598 |
|
4599 |
-
|
4600 |
-
|
|
|
4601 |
|
4602 |
-
|
4603 |
-
|
4604 |
-
|
4605 |
-
|
|
|
|
|
4606 |
|
4607 |
-
|
4608 |
-
|
4609 |
-
|
4610 |
-
|
4611 |
-
context.next = loc;
|
4612 |
|
4613 |
-
|
4614 |
-
|
4615 |
-
|
4616 |
-
context.method = "next";
|
4617 |
-
context.arg = undefined;
|
4618 |
-
}
|
4619 |
|
4620 |
-
return !! caught;
|
4621 |
-
}
|
4622 |
|
4623 |
-
|
4624 |
-
|
4625 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4626 |
|
4627 |
-
|
4628 |
-
|
4629 |
-
|
4630 |
-
|
4631 |
-
|
4632 |
-
|
|
|
|
|
|
|
|
|
|
|
4633 |
|
4634 |
-
if (entry.tryLoc <= this.prev) {
|
4635 |
-
var hasCatch = hasOwn.call(entry, "catchLoc");
|
4636 |
-
var hasFinally = hasOwn.call(entry, "finallyLoc");
|
4637 |
|
4638 |
-
|
4639 |
-
|
4640 |
-
|
4641 |
-
|
4642 |
-
|
4643 |
-
|
|
|
|
|
|
|
|
|
|
|
4644 |
|
4645 |
-
|
4646 |
-
|
4647 |
-
|
4648 |
-
|
|
|
|
|
|
|
4649 |
|
4650 |
-
|
4651 |
-
|
4652 |
-
|
4653 |
-
}
|
4654 |
|
4655 |
-
|
4656 |
-
throw new Error("try statement without catch or finally");
|
4657 |
-
}
|
4658 |
-
}
|
4659 |
-
}
|
4660 |
-
},
|
4661 |
|
4662 |
-
|
4663 |
-
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
4664 |
-
var entry = this.tryEntries[i];
|
4665 |
-
if (entry.tryLoc <= this.prev &&
|
4666 |
-
hasOwn.call(entry, "finallyLoc") &&
|
4667 |
-
this.prev < entry.finallyLoc) {
|
4668 |
-
var finallyEntry = entry;
|
4669 |
-
break;
|
4670 |
-
}
|
4671 |
-
}
|
4672 |
|
4673 |
-
|
4674 |
-
|
4675 |
-
|
4676 |
-
|
4677 |
-
|
4678 |
-
// Ignore the finally entry if control is not jumping to a
|
4679 |
-
// location outside the try/catch block.
|
4680 |
-
finallyEntry = null;
|
4681 |
-
}
|
4682 |
|
4683 |
-
var record = finallyEntry ? finallyEntry.completion : {};
|
4684 |
-
record.type = type;
|
4685 |
-
record.arg = arg;
|
4686 |
|
4687 |
-
|
4688 |
-
|
4689 |
-
|
4690 |
-
|
4691 |
-
}
|
4692 |
|
4693 |
-
|
4694 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4695 |
|
4696 |
-
complete: function(record, afterLoc) {
|
4697 |
-
if (record.type === "throw") {
|
4698 |
-
throw record.arg;
|
4699 |
-
}
|
4700 |
|
4701 |
-
|
4702 |
-
|
4703 |
-
|
4704 |
-
|
4705 |
-
|
4706 |
-
|
4707 |
-
|
4708 |
-
|
4709 |
-
|
4710 |
-
|
|
|
|
|
|
|
|
|
4711 |
|
4712 |
-
return ContinueSentinel;
|
4713 |
-
},
|
4714 |
|
4715 |
-
|
4716 |
-
|
4717 |
-
|
4718 |
-
|
4719 |
-
|
4720 |
-
|
4721 |
-
|
4722 |
-
|
4723 |
-
|
4724 |
-
|
|
|
|
|
|
|
4725 |
|
4726 |
-
"catch": function(tryLoc) {
|
4727 |
-
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
4728 |
-
var entry = this.tryEntries[i];
|
4729 |
-
if (entry.tryLoc === tryLoc) {
|
4730 |
-
var record = entry.completion;
|
4731 |
-
if (record.type === "throw") {
|
4732 |
-
var thrown = record.arg;
|
4733 |
-
resetTryEntry(entry);
|
4734 |
-
}
|
4735 |
-
return thrown;
|
4736 |
-
}
|
4737 |
-
}
|
4738 |
|
4739 |
-
|
4740 |
-
|
4741 |
-
|
4742 |
-
},
|
4743 |
|
4744 |
-
|
4745 |
-
|
4746 |
-
|
4747 |
-
resultName: resultName,
|
4748 |
-
nextLoc: nextLoc
|
4749 |
-
};
|
4750 |
|
4751 |
-
|
4752 |
-
|
4753 |
-
|
4754 |
-
|
4755 |
-
|
|
|
|
|
|
|
|
|
4756 |
|
4757 |
-
return ContinueSentinel;
|
4758 |
-
}
|
4759 |
-
};
|
4760 |
-
|
4761 |
-
// Regardless of whether this script is executing as a CommonJS module
|
4762 |
-
// or not, return the runtime object so that we can declare the variable
|
4763 |
-
// regeneratorRuntime in the outer scope, which allows this module to be
|
4764 |
-
// injected easily by `bin/regenerator --include-runtime script.js`.
|
4765 |
-
return exports;
|
4766 |
-
|
4767 |
-
}(
|
4768 |
-
// If this script is executing as a CommonJS module, use module.exports
|
4769 |
-
// as the regeneratorRuntime namespace. Otherwise create a new empty
|
4770 |
-
// object. Either way, the resulting object will be used to initialize
|
4771 |
-
// the regeneratorRuntime variable at the top of this file.
|
4772 |
-
true ? module.exports : undefined
|
4773 |
-
));
|
4774 |
|
4775 |
-
|
4776 |
-
|
4777 |
-
} catch (accidentalStrictMode) {
|
4778 |
-
// This module should not be running in strict mode, so the above
|
4779 |
-
// assignment should always work unless something is misconfigured. Just
|
4780 |
-
// in case runtime.js accidentally runs in strict mode, we can escape
|
4781 |
-
// strict mode using a global Function call. This could conceivably fail
|
4782 |
-
// if a Content Security Policy forbids using Function, but in that case
|
4783 |
-
// the proper solution is to fix the accidental strict mode problem. If
|
4784 |
-
// you've misconfigured your bundler to force strict mode and applied a
|
4785 |
-
// CSP to forbid Function, and you're not willing to fix either of those
|
4786 |
-
// problems, please detail your unique predicament in a GitHub issue.
|
4787 |
-
Function("r", "regeneratorRuntime = r")(runtime);
|
4788 |
}
|
4789 |
|
4790 |
-
|
4791 |
-
|
4792 |
-
|
4793 |
-
/***/ 138:
|
4794 |
-
/***/ (function(module, exports, __webpack_require__) {
|
4795 |
-
|
4796 |
-
"use strict";
|
4797 |
/**
|
4798 |
-
*
|
4799 |
*
|
4800 |
-
*
|
4801 |
-
*
|
4802 |
*/
|
4803 |
|
|
|
|
|
|
|
4804 |
|
4805 |
-
|
4806 |
-
|
4807 |
-
|
4808 |
-
function emptyFunction() {}
|
4809 |
-
function emptyFunctionWithReset() {}
|
4810 |
-
emptyFunctionWithReset.resetWarningCache = emptyFunction;
|
4811 |
-
|
4812 |
-
module.exports = function() {
|
4813 |
-
function shim(props, propName, componentName, location, propFullName, secret) {
|
4814 |
-
if (secret === ReactPropTypesSecret) {
|
4815 |
-
// It is still safe when called from React.
|
4816 |
-
return;
|
4817 |
-
}
|
4818 |
-
var err = new Error(
|
4819 |
-
'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +
|
4820 |
-
'Use PropTypes.checkPropTypes() to call them. ' +
|
4821 |
-
'Read more at http://fb.me/use-check-prop-types'
|
4822 |
-
);
|
4823 |
-
err.name = 'Invariant Violation';
|
4824 |
-
throw err;
|
4825 |
-
};
|
4826 |
-
shim.isRequired = shim;
|
4827 |
-
function getShim() {
|
4828 |
-
return shim;
|
4829 |
-
};
|
4830 |
-
// Important!
|
4831 |
-
// Keep this list in sync with production version in `./factoryWithTypeCheckers.js`.
|
4832 |
-
var ReactPropTypes = {
|
4833 |
-
array: shim,
|
4834 |
-
bool: shim,
|
4835 |
-
func: shim,
|
4836 |
-
number: shim,
|
4837 |
-
object: shim,
|
4838 |
-
string: shim,
|
4839 |
-
symbol: shim,
|
4840 |
-
|
4841 |
-
any: shim,
|
4842 |
-
arrayOf: getShim,
|
4843 |
-
element: shim,
|
4844 |
-
elementType: shim,
|
4845 |
-
instanceOf: getShim,
|
4846 |
-
node: shim,
|
4847 |
-
objectOf: getShim,
|
4848 |
-
oneOf: getShim,
|
4849 |
-
oneOfType: getShim,
|
4850 |
-
shape: getShim,
|
4851 |
-
exact: getShim,
|
4852 |
-
|
4853 |
-
checkPropTypes: emptyFunctionWithReset,
|
4854 |
-
resetWarningCache: emptyFunction
|
4855 |
-
};
|
4856 |
-
|
4857 |
-
ReactPropTypes.PropTypes = ReactPropTypes;
|
4858 |
-
|
4859 |
-
return ReactPropTypes;
|
4860 |
-
};
|
4861 |
-
|
4862 |
-
|
4863 |
-
/***/ }),
|
4864 |
-
|
4865 |
-
/***/ 139:
|
4866 |
-
/***/ (function(module, exports, __webpack_require__) {
|
4867 |
-
|
4868 |
-
"use strict";
|
4869 |
/**
|
4870 |
-
*
|
4871 |
*
|
4872 |
-
*
|
4873 |
-
*
|
4874 |
*/
|
4875 |
|
|
|
|
|
|
|
4876 |
|
4877 |
-
|
4878 |
-
|
4879 |
-
|
4880 |
-
|
4881 |
-
|
4882 |
-
|
4883 |
-
/***/ }),
|
4884 |
-
|
4885 |
-
/***/ 14:
|
4886 |
-
/***/ (function(module, exports, __webpack_require__) {
|
4887 |
-
|
4888 |
-
module.exports = __webpack_require__(137);
|
4889 |
-
|
4890 |
-
|
4891 |
-
/***/ }),
|
4892 |
-
|
4893 |
-
/***/ 140:
|
4894 |
-
/***/ (function(module, exports, __webpack_require__) {
|
4895 |
-
|
4896 |
-
var arrayLikeToArray = __webpack_require__(79);
|
4897 |
-
|
4898 |
-
function _arrayWithoutHoles(arr) {
|
4899 |
-
if (Array.isArray(arr)) return arrayLikeToArray(arr);
|
4900 |
}
|
|
|
|
|
|
|
|
|
|
|
4901 |
|
4902 |
-
module.exports = _arrayWithoutHoles;
|
4903 |
|
4904 |
-
|
|
|
|
|
|
|
4905 |
|
4906 |
-
|
4907 |
-
|
|
|
|
|
4908 |
|
4909 |
-
function _iterableToArray(iter) {
|
4910 |
-
if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter);
|
4911 |
-
}
|
4912 |
|
4913 |
-
|
4914 |
|
4915 |
/***/ }),
|
|
|
|
|
4916 |
|
4917 |
-
|
4918 |
-
|
4919 |
-
|
4920 |
-
|
4921 |
-
|
4922 |
-
|
4923 |
-
|
4924 |
-
module.exports = _nonIterableSpread;
|
4925 |
-
|
4926 |
-
/***/ }),
|
4927 |
|
4928 |
-
/***/ 143:
|
4929 |
-
/***/ (function(module, exports, __webpack_require__) {
|
4930 |
|
4931 |
-
|
4932 |
|
|
|
4933 |
|
4934 |
-
|
|
|
|
|
4935 |
|
4936 |
/**
|
4937 |
-
*
|
4938 |
-
*
|
4939 |
-
* @param {import('.').ComparableObject} a First object to compare.
|
4940 |
-
* @param {import('.').ComparableObject} b Second object to compare.
|
4941 |
*
|
4942 |
-
* @
|
4943 |
*/
|
4944 |
-
function isShallowEqualObjects( a, b ) {
|
4945 |
-
var aKeys, bKeys, i, key, aValue;
|
4946 |
-
|
4947 |
-
if ( a === b ) {
|
4948 |
-
return true;
|
4949 |
-
}
|
4950 |
-
|
4951 |
-
aKeys = keys( a );
|
4952 |
-
bKeys = keys( b );
|
4953 |
-
|
4954 |
-
if ( aKeys.length !== bKeys.length ) {
|
4955 |
-
return false;
|
4956 |
-
}
|
4957 |
-
|
4958 |
-
i = 0;
|
4959 |
-
|
4960 |
-
while ( i < aKeys.length ) {
|
4961 |
-
key = aKeys[ i ];
|
4962 |
-
aValue = a[ key ];
|
4963 |
-
|
4964 |
-
if (
|
4965 |
-
// In iterating only the keys of the first object after verifying
|
4966 |
-
// equal lengths, account for the case that an explicit `undefined`
|
4967 |
-
// value in the first is implicitly undefined in the second.
|
4968 |
-
//
|
4969 |
-
// Example: isShallowEqualObjects( { a: undefined }, { b: 5 } )
|
4970 |
-
( aValue === undefined && ! b.hasOwnProperty( key ) ) ||
|
4971 |
-
aValue !== b[ key ]
|
4972 |
-
) {
|
4973 |
-
return false;
|
4974 |
-
}
|
4975 |
-
|
4976 |
-
i++;
|
4977 |
-
}
|
4978 |
-
|
4979 |
-
return true;
|
4980 |
-
}
|
4981 |
-
|
4982 |
-
module.exports = isShallowEqualObjects;
|
4983 |
-
|
4984 |
-
|
4985 |
-
/***/ }),
|
4986 |
-
|
4987 |
-
/***/ 144:
|
4988 |
-
/***/ (function(module, exports, __webpack_require__) {
|
4989 |
-
|
4990 |
-
"use strict";
|
4991 |
-
|
4992 |
|
4993 |
/**
|
4994 |
-
*
|
4995 |
-
*
|
4996 |
-
* @param {any[]} a First array to compare.
|
4997 |
-
* @param {any[]} b Second array to compare.
|
4998 |
*
|
4999 |
-
* @
|
5000 |
*/
|
5001 |
-
function isShallowEqualArrays( a, b ) {
|
5002 |
-
var i;
|
5003 |
|
5004 |
-
|
5005 |
-
|
5006 |
-
|
5007 |
-
|
5008 |
-
|
5009 |
-
|
5010 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5011 |
|
5012 |
-
|
5013 |
-
|
5014 |
-
|
5015 |
-
|
5016 |
-
|
|
|
|
|
|
|
5017 |
|
5018 |
-
|
5019 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5020 |
|
5021 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5022 |
|
5023 |
|
5024 |
-
|
|
|
|
|
|
|
5025 |
|
5026 |
-
|
5027 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5028 |
|
5029 |
-
function
|
5030 |
-
|
5031 |
-
|
5032 |
-
|
5033 |
-
|
5034 |
-
|
5035 |
-
|
5036 |
-
}
|
5037 |
}
|
|
|
5038 |
|
5039 |
-
|
5040 |
-
|
5041 |
-
|
5042 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5043 |
}
|
5044 |
|
5045 |
-
module.exports =
|
5046 |
|
5047 |
/***/ }),
|
5048 |
-
|
5049 |
-
/***/ 156:
|
5050 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
5051 |
|
5052 |
"use strict";
|
5053 |
-
/*
|
5054 |
-
/*
|
5055 |
-
/* harmony
|
5056 |
-
/*
|
5057 |
-
/*
|
5058 |
-
|
5059 |
-
|
5060 |
-
|
5061 |
-
|
5062 |
-
/*
|
5063 |
-
|
5064 |
-
/* unused harmony export isEntirelySelected */
|
5065 |
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return getScrollContainer; });
|
5066 |
-
/* unused harmony export getOffsetParent */
|
5067 |
-
/* unused harmony export replace */
|
5068 |
-
/* unused harmony export remove */
|
5069 |
-
/* unused harmony export insertAfter */
|
5070 |
-
/* unused harmony export unwrap */
|
5071 |
-
/* unused harmony export replaceTag */
|
5072 |
-
/* unused harmony export wrap */
|
5073 |
-
/* unused harmony export __unstableStripHTML */
|
5074 |
-
/* unused harmony export isEmpty */
|
5075 |
-
/* unused harmony export removeInvalidHTML */
|
5076 |
-
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2);
|
5077 |
-
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_0__);
|
5078 |
-
/* harmony import */ var _phrasing_content__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(74);
|
5079 |
/**
|
5080 |
-
*
|
5081 |
*/
|
5082 |
|
5083 |
/**
|
@@ -5085,4874 +4954,4291 @@ module.exports = _createClass;
|
|
5085 |
*/
|
5086 |
|
5087 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5088 |
|
5089 |
-
|
5090 |
-
|
|
|
|
|
5091 |
}
|
5092 |
/**
|
5093 |
-
*
|
5094 |
-
* false otherwise.
|
5095 |
*
|
5096 |
-
* @
|
5097 |
*
|
5098 |
-
* @
|
|
|
|
|
5099 |
*
|
5100 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
5101 |
*/
|
5102 |
|
5103 |
|
5104 |
-
function
|
5105 |
-
|
5106 |
-
|
5107 |
-
|
5108 |
-
focusOffset = selection.focusOffset;
|
5109 |
-
var position = anchorNode.compareDocumentPosition(focusNode); // Disable reason: `Node#compareDocumentPosition` returns a bitmask value,
|
5110 |
-
// so bitwise operators are intended.
|
5111 |
|
5112 |
-
/* eslint-disable no-bitwise */
|
5113 |
-
// Compare whether anchor node precedes focus node. If focus node (where
|
5114 |
-
// end of selection occurs) is after the anchor node, it is forward.
|
5115 |
|
5116 |
-
|
5117 |
-
|
5118 |
-
|
5119 |
|
5120 |
-
|
5121 |
-
|
|
|
5122 |
}
|
5123 |
-
|
5124 |
-
|
5125 |
-
|
5126 |
|
|
|
|
|
|
|
5127 |
|
5128 |
-
|
5129 |
-
|
5130 |
-
|
|
|
|
|
|
|
|
|
|
|
5131 |
|
|
|
5132 |
|
5133 |
-
return true;
|
5134 |
-
}
|
5135 |
-
/**
|
5136 |
-
* Check whether the selection is at the edge of the container. Checks for
|
5137 |
-
* horizontal position by default. Set `onlyVertical` to true to check only
|
5138 |
-
* vertically.
|
5139 |
-
*
|
5140 |
-
* @param {Element} container Focusable element.
|
5141 |
-
* @param {boolean} isReverse Set to true to check left, false to check right.
|
5142 |
-
* @param {boolean} onlyVertical Set to true to check only vertical position.
|
5143 |
-
*
|
5144 |
-
* @return {boolean} True if at the edge, false if not.
|
5145 |
-
*/
|
5146 |
|
|
|
|
|
|
|
5147 |
|
5148 |
-
function
|
5149 |
-
if (Object(lodash__WEBPACK_IMPORTED_MODULE_0__["includes"])(['INPUT', 'TEXTAREA'], container.tagName)) {
|
5150 |
-
if (container.selectionStart !== container.selectionEnd) {
|
5151 |
-
return false;
|
5152 |
-
}
|
5153 |
|
5154 |
-
|
5155 |
-
|
5156 |
-
|
5157 |
|
5158 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
5159 |
}
|
5160 |
|
5161 |
-
if (
|
5162 |
-
|
|
|
|
|
5163 |
}
|
|
|
5164 |
|
5165 |
-
|
5166 |
-
|
5167 |
-
|
|
|
|
|
|
|
5168 |
|
5169 |
-
|
5170 |
-
|
5171 |
-
|
5172 |
|
5173 |
-
|
5174 |
-
|
5175 |
-
|
5176 |
-
var isCollapsed = selection.isCollapsed; // Collapse in direction of selection.
|
5177 |
|
5178 |
-
|
5179 |
-
|
5180 |
-
}
|
|
|
5181 |
|
5182 |
-
|
5183 |
|
5184 |
-
|
5185 |
-
|
5186 |
-
|
5187 |
|
5188 |
-
|
5189 |
-
var lineHeight = parseInt(computedStyle.lineHeight, 10) || 0; // Only consider the multiline selection at the edge if the direction is
|
5190 |
-
// towards the edge.
|
5191 |
|
5192 |
-
|
5193 |
-
|
5194 |
-
|
5195 |
|
5196 |
-
|
5197 |
-
|
5198 |
-
|
5199 |
-
|
|
|
|
|
5200 |
|
5201 |
-
|
5202 |
-
|
5203 |
-
|
5204 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5205 |
|
5206 |
-
|
5207 |
-
|
5208 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
5209 |
|
5210 |
-
|
5211 |
-
|
5212 |
-
} // In the case of RTL scripts, the horizontal edge is at the opposite side.
|
5213 |
|
|
|
|
|
|
|
5214 |
|
5215 |
-
|
5216 |
-
|
5217 |
-
|
5218 |
-
|
5219 |
-
|
5220 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5221 |
|
5222 |
-
var x = isReverseDir ? containerRect.left + 1 : containerRect.right - 1;
|
5223 |
-
var y = isReverse ? containerRect.top + buffer : containerRect.bottom - buffer;
|
5224 |
-
var testRange = hiddenCaretRangeFromPoint(ownerDocument, x, y, container);
|
5225 |
|
5226 |
-
if (!testRange) {
|
5227 |
-
return false;
|
5228 |
-
}
|
5229 |
|
5230 |
-
|
5231 |
-
|
|
|
5232 |
|
5233 |
-
return Math.abs(testRect[side] - rangeRect[side]) <= 1;
|
5234 |
-
}
|
5235 |
/**
|
5236 |
-
*
|
5237 |
-
|
5238 |
-
|
5239 |
-
|
5240 |
-
*
|
5241 |
-
* @return {boolean} True if at the horizontal edge, false if not.
|
5242 |
*/
|
5243 |
|
5244 |
|
5245 |
-
|
5246 |
-
|
5247 |
-
}
|
5248 |
/**
|
5249 |
-
*
|
5250 |
-
*
|
5251 |
-
* @param {Element} container Focusable element.
|
5252 |
-
* @param {boolean} isReverse Set to true to check top, false for bottom.
|
5253 |
*
|
5254 |
-
* @return {
|
5255 |
*/
|
5256 |
|
5257 |
-
function
|
5258 |
-
return
|
5259 |
-
}
|
5260 |
/**
|
5261 |
-
*
|
5262 |
-
*
|
5263 |
-
* @param {Range} range The range.
|
5264 |
*
|
5265 |
-
* @return {
|
5266 |
*/
|
5267 |
|
5268 |
-
function
|
5269 |
-
|
5270 |
-
|
5271 |
-
// for all the elements in the range.
|
5272 |
-
if (!range.collapsed) {
|
5273 |
-
return range.getBoundingClientRect();
|
5274 |
-
}
|
5275 |
-
|
5276 |
-
var _range = range,
|
5277 |
-
startContainer = _range.startContainer;
|
5278 |
-
var ownerDocument = startContainer.ownerDocument; // Correct invalid "BR" ranges. The cannot contain any children.
|
5279 |
-
|
5280 |
-
if (startContainer.nodeName === 'BR') {
|
5281 |
-
var parentNode = startContainer.parentNode;
|
5282 |
-
var index = Array.from(parentNode.childNodes).indexOf(startContainer);
|
5283 |
-
range = ownerDocument.createRange();
|
5284 |
-
range.setStart(parentNode, index);
|
5285 |
-
range.setEnd(parentNode, index);
|
5286 |
-
}
|
5287 |
-
|
5288 |
-
var rect = range.getClientRects()[0]; // If the collapsed range starts (and therefore ends) at an element node,
|
5289 |
-
// `getClientRects` can be empty in some browsers. This can be resolved
|
5290 |
-
// by adding a temporary text node with zero-width space to the range.
|
5291 |
-
//
|
5292 |
-
// See: https://stackoverflow.com/a/6847328/995445
|
5293 |
-
|
5294 |
-
if (!rect) {
|
5295 |
-
var padNode = ownerDocument.createTextNode("\u200B"); // Do not modify the live range.
|
5296 |
-
|
5297 |
-
range = range.cloneRange();
|
5298 |
-
range.insertNode(padNode);
|
5299 |
-
rect = range.getClientRects()[0];
|
5300 |
-
padNode.parentNode.removeChild(padNode);
|
5301 |
-
}
|
5302 |
-
|
5303 |
-
return rect;
|
5304 |
-
}
|
5305 |
/**
|
5306 |
-
*
|
5307 |
-
*
|
5308 |
-
* @param {Window} win The window of the selection.
|
5309 |
*
|
5310 |
-
* @return {
|
5311 |
*/
|
5312 |
|
5313 |
-
function
|
5314 |
-
|
5315 |
-
|
|
|
|
|
|
|
|
|
|
|
5316 |
|
5317 |
-
|
5318 |
-
|
5319 |
-
|
|
|
|
|
|
|
|
|
|
|
5320 |
|
5321 |
-
|
5322 |
-
|
|
|
5323 |
/**
|
5324 |
-
*
|
5325 |
*
|
5326 |
-
* @
|
5327 |
-
* @param {boolean} isReverse True for end, false for start.
|
5328 |
*/
|
5329 |
|
5330 |
-
function
|
5331 |
-
|
5332 |
-
|
5333 |
-
|
|
|
|
|
|
|
|
|
5334 |
|
5335 |
-
|
5336 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
5337 |
|
5338 |
-
|
5339 |
-
|
5340 |
-
|
5341 |
-
|
5342 |
-
|
5343 |
-
|
5344 |
-
|
|
|
5345 |
|
5346 |
-
|
5347 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5348 |
|
5349 |
-
|
|
|
|
|
|
|
5350 |
|
5351 |
-
|
5352 |
-
|
5353 |
-
|
5354 |
-
|
5355 |
-
|
|
|
|
|
|
|
|
|
5356 |
|
5357 |
|
5358 |
-
|
5359 |
-
|
|
|
5360 |
|
5361 |
-
|
5362 |
-
|
5363 |
-
|
|
|
|
|
5364 |
|
5365 |
-
|
5366 |
-
|
5367 |
-
var selection = defaultView.getSelection();
|
5368 |
-
var range = ownerDocument.createRange();
|
5369 |
-
range.selectNodeContents(rangeTarget);
|
5370 |
-
range.collapse(!isReverse);
|
5371 |
-
selection.removeAllRanges();
|
5372 |
-
selection.addRange(range);
|
5373 |
-
}
|
5374 |
/**
|
5375 |
-
*
|
5376 |
-
* Get a collapsed range for a given point.
|
5377 |
*
|
5378 |
-
*
|
5379 |
*
|
5380 |
-
*
|
5381 |
-
*
|
5382 |
-
* @param {number} y Vertical position within the current viewport.
|
5383 |
*
|
5384 |
-
*
|
|
|
|
|
|
|
5385 |
*/
|
5386 |
|
5387 |
-
function caretRangeFromPoint(doc, x, y) {
|
5388 |
-
if (doc.caretRangeFromPoint) {
|
5389 |
-
return doc.caretRangeFromPoint(x, y);
|
5390 |
-
}
|
5391 |
-
|
5392 |
-
if (!doc.caretPositionFromPoint) {
|
5393 |
-
return null;
|
5394 |
-
}
|
5395 |
-
|
5396 |
-
var point = doc.caretPositionFromPoint(x, y); // If x or y are negative, outside viewport, or there is no text entry node.
|
5397 |
-
// https://developer.mozilla.org/en-US/docs/Web/API/Document/caretRangeFromPoint
|
5398 |
-
|
5399 |
-
if (!point) {
|
5400 |
-
return null;
|
5401 |
-
}
|
5402 |
-
|
5403 |
-
var range = doc.createRange();
|
5404 |
-
range.setStart(point.offsetNode, point.offset);
|
5405 |
-
range.collapse(true);
|
5406 |
-
return range;
|
5407 |
-
}
|
5408 |
/**
|
5409 |
-
*
|
5410 |
-
* Gives the container a temporary high z-index (above any UI).
|
5411 |
-
* This is preferred over getting the UI nodes and set styles there.
|
5412 |
*
|
5413 |
-
* @param {
|
5414 |
-
* @param {number} x Horizontal position within the current viewport.
|
5415 |
-
* @param {number} y Vertical position within the current viewport.
|
5416 |
-
* @param {Element} container Container in which the range is expected to be found.
|
5417 |
*
|
5418 |
-
* @
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5419 |
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
5420 |
|
5421 |
|
5422 |
-
|
5423 |
-
var originalZIndex = container.style.zIndex;
|
5424 |
-
var originalPosition = container.style.position; // A z-index only works if the element position is not static.
|
5425 |
-
|
5426 |
-
container.style.zIndex = '10000';
|
5427 |
-
container.style.position = 'relative';
|
5428 |
-
var range = caretRangeFromPoint(doc, x, y);
|
5429 |
-
container.style.zIndex = originalZIndex;
|
5430 |
-
container.style.position = originalPosition;
|
5431 |
-
return range;
|
5432 |
}
|
5433 |
-
|
5434 |
-
* Places the caret at the top or bottom of a given element.
|
5435 |
-
*
|
5436 |
-
* @param {Element} container Focusable element.
|
5437 |
-
* @param {boolean} isReverse True for bottom, false for top.
|
5438 |
-
* @param {DOMRect} [rect] The rectangle to position the caret with.
|
5439 |
-
* @param {boolean} [mayUseScroll=true] True to allow scrolling, false to disallow.
|
5440 |
-
*/
|
5441 |
|
|
|
|
|
|
|
5442 |
|
5443 |
-
|
5444 |
-
var mayUseScroll = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true;
|
5445 |
|
5446 |
-
if (!container) {
|
5447 |
-
return;
|
5448 |
-
}
|
5449 |
|
5450 |
-
|
5451 |
-
|
5452 |
-
|
5453 |
-
} // Offset by a buffer half the height of the caret rect. This is needed
|
5454 |
-
// because caretRangeFromPoint may default to the end of the selection if
|
5455 |
-
// offset is too close to the edge. It's unclear how to precisely calculate
|
5456 |
-
// this threshold; it may be the padded area of some combination of line
|
5457 |
-
// height, caret height, and font size. The buffer offset is effectively
|
5458 |
-
// equivalent to a point at half the height of a line of text.
|
5459 |
-
|
5460 |
-
|
5461 |
-
var buffer = rect.height / 2;
|
5462 |
-
var editableRect = container.getBoundingClientRect();
|
5463 |
-
var x = rect.left;
|
5464 |
-
var y = isReverse ? editableRect.bottom - buffer : editableRect.top + buffer;
|
5465 |
-
var ownerDocument = container.ownerDocument;
|
5466 |
-
var defaultView = ownerDocument.defaultView;
|
5467 |
-
var range = hiddenCaretRangeFromPoint(ownerDocument, x, y, container);
|
5468 |
|
5469 |
-
|
5470 |
-
|
5471 |
-
|
5472 |
-
|
5473 |
-
|
5474 |
-
placeCaretAtVerticalEdge(container, isReverse, rect, false);
|
5475 |
-
return;
|
5476 |
-
}
|
5477 |
|
5478 |
-
placeCaretAtHorizontalEdge(container, isReverse);
|
5479 |
-
return;
|
5480 |
-
}
|
5481 |
|
5482 |
-
|
5483 |
-
|
5484 |
-
|
5485 |
-
container.focus(); // Editable was already focussed, it goes back to old range...
|
5486 |
-
// This fixes it.
|
5487 |
|
5488 |
-
|
5489 |
-
selection.addRange(range);
|
5490 |
-
}
|
5491 |
-
/**
|
5492 |
-
* Check whether the given element is a text field, where text field is defined
|
5493 |
-
* by the ability to select within the input, or that it is contenteditable.
|
5494 |
-
*
|
5495 |
-
* See: https://html.spec.whatwg.org/#textFieldSelection
|
5496 |
-
*
|
5497 |
-
* @param {HTMLElement} element The HTML element.
|
5498 |
-
*
|
5499 |
-
* @return {boolean} True if the element is an text field, false if not.
|
5500 |
-
*/
|
5501 |
|
5502 |
-
|
5503 |
-
|
5504 |
-
contentEditable = element.contentEditable;
|
5505 |
-
var nonTextInputs = ['button', 'checkbox', 'hidden', 'file', 'radio', 'image', 'range', 'reset', 'submit', 'number'];
|
5506 |
-
return nodeName === 'INPUT' && !nonTextInputs.includes(element.type) || nodeName === 'TEXTAREA' || contentEditable === 'true';
|
5507 |
-
}
|
5508 |
-
/**
|
5509 |
-
* Check whether the given element is an input field of type number
|
5510 |
-
* and has a valueAsNumber
|
5511 |
-
*
|
5512 |
-
* @param {HTMLElement} element The HTML element.
|
5513 |
-
*
|
5514 |
-
* @return {boolean} True if the element is input and holds a number.
|
5515 |
-
*/
|
5516 |
|
5517 |
-
|
5518 |
-
|
5519 |
-
type = element.type,
|
5520 |
-
valueAsNumber = element.valueAsNumber;
|
5521 |
-
return nodeName === 'INPUT' && type === 'number' && !!valueAsNumber;
|
5522 |
-
}
|
5523 |
-
/**
|
5524 |
-
* Check whether the current document has selected text. This applies to ranges
|
5525 |
-
* of text in the document, and not selection inside <input> and <textarea>
|
5526 |
-
* elements.
|
5527 |
-
*
|
5528 |
-
* See: https://developer.mozilla.org/en-US/docs/Web/API/Window/getSelection#Related_objects.
|
5529 |
-
*
|
5530 |
-
* @param {Document} doc The document to check.
|
5531 |
-
*
|
5532 |
-
* @return {boolean} True if there is selection, false if not.
|
5533 |
-
*/
|
5534 |
|
5535 |
-
|
5536 |
-
var selection = doc.defaultView.getSelection();
|
5537 |
-
var range = selection.rangeCount ? selection.getRangeAt(0) : null;
|
5538 |
-
return range && !range.collapsed;
|
5539 |
-
}
|
5540 |
-
/**
|
5541 |
-
* Check whether the given element, assumed an input field or textarea,
|
5542 |
-
* contains a (uncollapsed) selection of text.
|
5543 |
-
*
|
5544 |
-
* Note: this is perhaps an abuse of the term "selection", since these elements
|
5545 |
-
* manage selection differently and aren't covered by Selection#collapsed.
|
5546 |
-
*
|
5547 |
-
* See: https://developer.mozilla.org/en-US/docs/Web/API/Window/getSelection#Related_objects.
|
5548 |
-
*
|
5549 |
-
* @param {HTMLElement} element The HTML element.
|
5550 |
-
*
|
5551 |
-
* @return {boolean} Whether the input/textareaa element has some "selection".
|
5552 |
-
*/
|
5553 |
|
5554 |
-
function
|
5555 |
-
|
5556 |
-
|
|
|
5557 |
}
|
5558 |
|
5559 |
-
|
5560 |
-
var selectionStart = element.selectionStart,
|
5561 |
-
selectionEnd = element.selectionEnd;
|
5562 |
-
return selectionStart !== null && selectionStart !== selectionEnd;
|
5563 |
-
} catch (error) {
|
5564 |
-
// Safari throws an exception when trying to get `selectionStart`
|
5565 |
-
// on non-text <input> elements (which, understandably, don't
|
5566 |
-
// have the text selection API). We catch this via a try/catch
|
5567 |
-
// block, as opposed to a more explicit check of the element's
|
5568 |
-
// input types, because of Safari's non-standard behavior. This
|
5569 |
-
// also means we don't have to worry about the list of input
|
5570 |
-
// types that support `selectionStart` changing as the HTML spec
|
5571 |
-
// evolves over time.
|
5572 |
-
return false;
|
5573 |
-
}
|
5574 |
}
|
5575 |
-
|
5576 |
-
* Check whether the current document has any sort of selection. This includes
|
5577 |
-
* ranges of text across elements and any selection inside <input> and
|
5578 |
-
* <textarea> elements.
|
5579 |
-
*
|
5580 |
-
* @param {Document} doc The document to check.
|
5581 |
-
*
|
5582 |
-
* @return {boolean} Whether there is any sort of "selection" in the document.
|
5583 |
-
*/
|
5584 |
-
|
5585 |
|
5586 |
-
function
|
5587 |
-
|
5588 |
-
|
5589 |
-
|
5590 |
-
|
5591 |
-
|
5592 |
-
|
5593 |
-
|
5594 |
-
*
|
5595 |
-
* @return {boolean} True if there is selection, false if not.
|
5596 |
-
*/
|
5597 |
|
5598 |
-
|
5599 |
-
|
5600 |
-
}
|
5601 |
-
/**
|
5602 |
-
* Check whether the contents of the element have been entirely selected.
|
5603 |
-
* Returns true if there is no possibility of selection.
|
5604 |
-
*
|
5605 |
-
* @param {Element} element The element to check.
|
5606 |
-
*
|
5607 |
-
* @return {boolean} True if entirely selected, false if not.
|
5608 |
-
*/
|
5609 |
|
5610 |
-
|
5611 |
-
|
5612 |
-
return element.selectionStart === 0 && element.value.length === element.selectionEnd;
|
5613 |
}
|
5614 |
|
5615 |
-
|
5616 |
-
|
5617 |
-
}
|
5618 |
|
5619 |
-
|
5620 |
-
|
5621 |
-
|
5622 |
-
|
5623 |
|
5624 |
-
|
5625 |
-
|
5626 |
-
|
|
|
|
|
5627 |
|
5628 |
-
var startContainer = range.startContainer,
|
5629 |
-
endContainer = range.endContainer,
|
5630 |
-
startOffset = range.startOffset,
|
5631 |
-
endOffset = range.endOffset;
|
5632 |
|
5633 |
-
|
5634 |
-
|
5635 |
-
|
5636 |
|
5637 |
-
var lastChild = element.lastChild;
|
5638 |
-
var lastChildContentLength = lastChild.nodeType === lastChild.TEXT_NODE ? lastChild.data.length : lastChild.childNodes.length;
|
5639 |
-
return startContainer === element.firstChild && endContainer === element.lastChild && startOffset === 0 && endOffset === lastChildContentLength;
|
5640 |
-
}
|
5641 |
/**
|
5642 |
-
*
|
5643 |
-
*
|
5644 |
-
* @param {Element} node Node from which to start.
|
5645 |
*
|
5646 |
-
* @
|
|
|
5647 |
*/
|
5648 |
|
5649 |
-
function
|
5650 |
-
|
5651 |
-
|
5652 |
-
|
5653 |
-
|
5654 |
-
|
5655 |
-
if (node.scrollHeight > node.clientHeight) {
|
5656 |
-
// ...except when overflow is defined to be hidden or visible
|
5657 |
-
var _getComputedStyle = getComputedStyle(node),
|
5658 |
-
overflowY = _getComputedStyle.overflowY;
|
5659 |
|
5660 |
-
|
5661 |
-
|
|
|
5662 |
}
|
5663 |
-
} // Continue traversing
|
5664 |
|
|
|
|
|
|
|
5665 |
|
5666 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5667 |
}
|
5668 |
-
|
5669 |
-
* Returns the closest positioned element, or null under any of the conditions
|
5670 |
-
* of the offsetParent specification. Unlike offsetParent, this function is not
|
5671 |
-
* limited to HTMLElement and accepts any Node (e.g. Node.TEXT_NODE).
|
5672 |
-
*
|
5673 |
-
* @see https://drafts.csswg.org/cssom-view/#dom-htmlelement-offsetparent
|
5674 |
-
*
|
5675 |
-
* @param {Node} node Node from which to find offset parent.
|
5676 |
-
*
|
5677 |
-
* @return {?Node} Offset parent.
|
5678 |
-
*/
|
5679 |
|
5680 |
-
|
5681 |
-
|
5682 |
-
|
5683 |
-
var closestElement;
|
5684 |
|
5685 |
-
|
5686 |
-
|
5687 |
-
|
5688 |
-
|
5689 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5690 |
|
5691 |
-
if (!closestElement) {
|
5692 |
-
return null;
|
5693 |
-
} // If the closest element is already positioned, return it, as offsetParent
|
5694 |
-
// does not otherwise consider the node itself.
|
5695 |
|
|
|
5696 |
|
5697 |
-
|
5698 |
-
return closestElement;
|
5699 |
-
}
|
5700 |
|
5701 |
-
return closestElement.offsetParent;
|
5702 |
-
}
|
5703 |
/**
|
5704 |
-
*
|
5705 |
-
*
|
5706 |
-
* @param {Element} processedNode Node to be removed.
|
5707 |
-
* @param {Element} newNode Node to be inserted in its place.
|
5708 |
-
* @return {void}
|
5709 |
*/
|
5710 |
|
5711 |
-
function replace(processedNode, newNode) {
|
5712 |
-
insertAfter(newNode, processedNode.parentNode);
|
5713 |
-
remove(processedNode);
|
5714 |
-
}
|
5715 |
/**
|
5716 |
-
*
|
5717 |
-
*
|
5718 |
-
* @param {Element} node Node to be removed.
|
5719 |
-
* @return {void}
|
5720 |
*/
|
5721 |
|
5722 |
-
function remove(node) {
|
5723 |
-
node.parentNode.removeChild(node);
|
5724 |
-
}
|
5725 |
-
/**
|
5726 |
-
* Given two DOM nodes, inserts the former in the DOM as the next sibling of
|
5727 |
-
* the latter.
|
5728 |
-
*
|
5729 |
-
* @param {Element} newNode Node to be inserted.
|
5730 |
-
* @param {Element} referenceNode Node after which to perform the insertion.
|
5731 |
-
* @return {void}
|
5732 |
-
*/
|
5733 |
|
5734 |
-
|
5735 |
-
|
5736 |
-
|
|
|
5737 |
/**
|
5738 |
-
*
|
5739 |
-
*
|
5740 |
-
* @param {Node} node The node to unwrap.
|
5741 |
*
|
5742 |
-
*
|
|
|
5743 |
*/
|
5744 |
|
5745 |
-
|
5746 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5747 |
|
5748 |
-
|
5749 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5750 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5751 |
|
5752 |
-
|
5753 |
-
|
5754 |
-
|
5755 |
-
|
5756 |
-
|
5757 |
-
|
5758 |
-
|
5759 |
-
|
5760 |
-
|
5761 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5762 |
|
5763 |
-
|
5764 |
-
|
|
|
5765 |
|
5766 |
-
|
5767 |
-
newNode.appendChild(node.firstChild);
|
5768 |
-
}
|
5769 |
|
5770 |
-
node.parentNode.replaceChild(newNode, node);
|
5771 |
-
return newNode;
|
5772 |
-
}
|
5773 |
-
/**
|
5774 |
-
* Wraps the given node with a new node with the given tag name.
|
5775 |
-
*
|
5776 |
-
* @param {Element} newNode The node to insert.
|
5777 |
-
* @param {Element} referenceNode The node to wrap.
|
5778 |
-
*/
|
5779 |
|
5780 |
-
|
5781 |
-
|
5782 |
-
newNode.appendChild(referenceNode);
|
5783 |
-
}
|
5784 |
-
/**
|
5785 |
-
* Removes any HTML tags from the provided string.
|
5786 |
-
*
|
5787 |
-
* @param {string} html The string containing html.
|
5788 |
-
*
|
5789 |
-
* @return {string} The text content with any html removed.
|
5790 |
-
*/
|
5791 |
|
5792 |
-
function
|
5793 |
-
|
5794 |
-
|
5795 |
-
|
5796 |
-
|
5797 |
-
* Given a schema, unwraps or removes nodes, attributes and classes on a node
|
5798 |
-
* list.
|
5799 |
-
*
|
5800 |
-
* @param {NodeList} nodeList The nodeList to filter.
|
5801 |
-
* @param {Document} doc The document of the nodeList.
|
5802 |
-
* @param {Object} schema An array of functions that can mutate with the provided node.
|
5803 |
-
* @param {Object} inline Whether to clean for inline mode.
|
5804 |
-
*/
|
5805 |
|
5806 |
-
|
5807 |
-
|
5808 |
-
var tag = node.nodeName.toLowerCase(); // It's a valid child, if the tag exists in the schema without an isMatch
|
5809 |
-
// function, or with an isMatch function that matches the node.
|
5810 |
|
5811 |
-
|
5812 |
-
|
5813 |
-
var
|
5814 |
-
|
5815 |
-
|
5816 |
-
|
5817 |
-
|
5818 |
-
children = _schema$tag.children,
|
5819 |
-
_schema$tag$require = _schema$tag.require,
|
5820 |
-
require = _schema$tag$require === void 0 ? [] : _schema$tag$require,
|
5821 |
-
allowEmpty = _schema$tag.allowEmpty; // If the node is empty and it's supposed to have children,
|
5822 |
-
// remove the node.
|
5823 |
|
|
|
|
|
|
|
|
|
|
|
5824 |
|
5825 |
-
|
5826 |
-
remove(node);
|
5827 |
-
return;
|
5828 |
}
|
|
|
|
|
5829 |
|
5830 |
-
|
5831 |
-
|
5832 |
-
|
5833 |
-
|
5834 |
-
|
5835 |
-
|
5836 |
-
|
5837 |
-
}
|
5838 |
-
}); // Strip invalid classes.
|
5839 |
-
// In jsdom-jscore, 'node.classList' can be undefined.
|
5840 |
-
// TODO: Explore patching this in jsdom-jscore.
|
5841 |
|
5842 |
-
|
5843 |
-
|
5844 |
-
if (typeof item === 'string') {
|
5845 |
-
return function (className) {
|
5846 |
-
return className === item;
|
5847 |
-
};
|
5848 |
-
} else if (item instanceof RegExp) {
|
5849 |
-
return function (className) {
|
5850 |
-
return item.test(className);
|
5851 |
-
};
|
5852 |
-
}
|
5853 |
|
5854 |
-
|
5855 |
-
|
5856 |
-
|
5857 |
-
|
5858 |
-
|
5859 |
-
})) {
|
5860 |
-
node.classList.remove(name);
|
5861 |
-
}
|
5862 |
-
});
|
5863 |
|
5864 |
-
|
5865 |
-
|
|
|
|
|
|
|
|
|
5866 |
}
|
5867 |
-
|
|
|
5868 |
}
|
5869 |
|
5870 |
-
|
5871 |
-
|
5872 |
-
if (children === '*') {
|
5873 |
-
return;
|
5874 |
-
} // Continue if the node is supposed to have children.
|
5875 |
|
|
|
|
|
|
|
5876 |
|
5877 |
-
|
5878 |
-
|
5879 |
-
|
5880 |
-
|
5881 |
-
cleanNodeList(node.childNodes, doc, schema, inline);
|
5882 |
-
unwrap(node); // If the node is at the top, phrasing content, and
|
5883 |
-
// contains children that are block content, unwrap
|
5884 |
-
// the node because it is invalid.
|
5885 |
-
} else if (node.parentNode.nodeName === 'BODY' && Object(_phrasing_content__WEBPACK_IMPORTED_MODULE_1__[/* isPhrasingContent */ "a"])(node)) {
|
5886 |
-
cleanNodeList(node.childNodes, doc, schema, inline);
|
5887 |
|
5888 |
-
|
5889 |
-
|
5890 |
-
|
5891 |
-
|
5892 |
-
|
|
|
|
|
|
|
|
|
5893 |
} else {
|
5894 |
-
|
5895 |
-
} // Remove children if the node is not supposed to have any.
|
5896 |
-
|
5897 |
-
} else {
|
5898 |
-
while (node.firstChild) {
|
5899 |
-
remove(node.firstChild);
|
5900 |
}
|
5901 |
-
|
5902 |
-
|
5903 |
-
} // Invalid child. Continue with schema at the same place and unwrap.
|
5904 |
-
|
5905 |
-
} else {
|
5906 |
-
cleanNodeList(node.childNodes, doc, schema, inline); // For inline mode, insert a line break when unwrapping nodes that
|
5907 |
-
// are not phrasing content.
|
5908 |
-
|
5909 |
-
if (inline && !Object(_phrasing_content__WEBPACK_IMPORTED_MODULE_1__[/* isPhrasingContent */ "a"])(node) && node.nextElementSibling) {
|
5910 |
-
insertAfter(doc.createElement('br'), node);
|
5911 |
-
}
|
5912 |
-
|
5913 |
-
unwrap(node);
|
5914 |
}
|
5915 |
-
});
|
5916 |
-
}
|
5917 |
-
/**
|
5918 |
-
* Recursively checks if an element is empty. An element is not empty if it
|
5919 |
-
* contains text or contains elements with attributes such as images.
|
5920 |
-
*
|
5921 |
-
* @param {Element} element The element to check.
|
5922 |
-
*
|
5923 |
-
* @return {boolean} Wether or not the element is empty.
|
5924 |
-
*/
|
5925 |
|
|
|
|
|
5926 |
|
5927 |
-
|
5928 |
-
|
5929 |
-
|
5930 |
-
|
|
|
|
|
|
|
|
|
5931 |
|
5932 |
-
|
5933 |
-
|
5934 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5935 |
}
|
|
|
5936 |
|
5937 |
-
|
5938 |
-
|
5939 |
-
|
5940 |
-
|
5941 |
-
return
|
5942 |
-
|
5943 |
|
5944 |
-
|
|
|
|
|
|
|
|
|
5945 |
}
|
5946 |
|
5947 |
-
|
5948 |
-
|
5949 |
-
|
5950 |
-
|
5951 |
-
|
5952 |
-
*
|
5953 |
-
* @param {string} HTML The HTML to clean up.
|
5954 |
-
* @param {Object} schema Schema for the HTML.
|
5955 |
-
* @param {Object} inline Whether to clean for inline mode.
|
5956 |
-
*
|
5957 |
-
* @return {string} The cleaned up HTML.
|
5958 |
-
*/
|
5959 |
|
5960 |
-
|
5961 |
-
|
5962 |
-
|
5963 |
-
cleanNodeList(doc.body.childNodes, doc, schema, inline);
|
5964 |
-
return doc.body.innerHTML;
|
5965 |
-
}
|
5966 |
-
//# sourceMappingURL=dom.js.map
|
5967 |
|
5968 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5969 |
|
5970 |
-
|
5971 |
-
|
|
|
|
|
5972 |
|
5973 |
-
|
5974 |
-
|
5975 |
-
|
5976 |
-
|
5977 |
-
/* harmony import */ var _babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(24);
|
5978 |
-
/* harmony import */ var _babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(10);
|
5979 |
-
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(0);
|
5980 |
-
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_5__);
|
5981 |
-
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(2);
|
5982 |
-
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_6__);
|
5983 |
-
/* harmony import */ var _popover__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(136);
|
5984 |
-
/* harmony import */ var _shortcut__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(135);
|
5985 |
|
|
|
|
|
|
|
|
|
5986 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5987 |
|
|
|
|
|
5988 |
|
|
|
|
|
|
|
5989 |
|
|
|
|
|
|
|
5990 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5991 |
|
5992 |
-
|
5993 |
|
5994 |
-
|
|
|
5995 |
|
5996 |
-
|
5997 |
-
|
5998 |
-
|
5999 |
|
6000 |
-
|
6001 |
-
|
6002 |
-
|
|
|
6003 |
|
|
|
|
|
6004 |
|
6005 |
-
|
6006 |
-
|
6007 |
-
|
6008 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6009 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6010 |
|
6011 |
-
/**
|
6012 |
-
* Time over children to wait before showing tooltip
|
6013 |
-
*
|
6014 |
-
* @type {number}
|
6015 |
-
*/
|
6016 |
|
6017 |
-
|
|
|
|
|
|
|
|
|
6018 |
|
6019 |
-
|
6020 |
-
Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_2__[/* default */ "a"])(Tooltip, _Component);
|
6021 |
|
6022 |
-
|
|
|
|
|
6023 |
|
6024 |
-
|
6025 |
-
|
6026 |
|
6027 |
-
Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])(this, Tooltip);
|
6028 |
|
6029 |
-
|
6030 |
-
|
6031 |
-
|
6032 |
-
isOver: isOver
|
6033 |
-
});
|
6034 |
-
}, TOOLTIP_DELAY);
|
6035 |
-
/**
|
6036 |
-
* Prebound `isInMouseDown` handler, created as a constant reference to
|
6037 |
-
* assure ability to remove in component unmount.
|
6038 |
-
*
|
6039 |
-
* @type {Function}
|
6040 |
-
*/
|
6041 |
|
6042 |
-
|
6043 |
-
|
6044 |
-
|
6045 |
-
|
6046 |
-
|
6047 |
-
|
6048 |
-
|
|
|
|
|
|
|
|
|
|
|
6049 |
|
6050 |
-
|
6051 |
-
_this.state = {
|
6052 |
-
isOver: false
|
6053 |
-
};
|
6054 |
-
return _this;
|
6055 |
-
}
|
6056 |
|
6057 |
-
Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"])(Tooltip, [{
|
6058 |
-
key: "componentWillUnmount",
|
6059 |
-
value: function componentWillUnmount() {
|
6060 |
-
this.delayedSetIsOver.cancel();
|
6061 |
-
document.removeEventListener('mouseup', this.cancelIsMouseDown);
|
6062 |
-
}
|
6063 |
-
}, {
|
6064 |
-
key: "emitToChild",
|
6065 |
-
value: function emitToChild(eventName, event) {
|
6066 |
-
var children = this.props.children;
|
6067 |
|
6068 |
-
|
6069 |
-
|
6070 |
-
|
|
|
|
|
6071 |
|
6072 |
-
|
6073 |
|
6074 |
-
|
6075 |
-
|
6076 |
-
|
6077 |
-
}
|
6078 |
-
}, {
|
6079 |
-
key: "createToggleIsOver",
|
6080 |
-
value: function createToggleIsOver(eventName, isDelayed) {
|
6081 |
-
var _this2 = this;
|
6082 |
|
6083 |
-
|
6084 |
-
// Preserve original child callback behavior
|
6085 |
-
_this2.emitToChild(eventName, event); // Mouse events behave unreliably in React for disabled elements,
|
6086 |
-
// firing on mouseenter but not mouseleave. Further, the default
|
6087 |
-
// behavior for disabled elements in some browsers is to ignore
|
6088 |
-
// mouse events. Don't bother trying to to handle them.
|
6089 |
-
//
|
6090 |
-
// See: https://github.com/facebook/react/issues/4251
|
6091 |
|
|
|
|
|
6092 |
|
6093 |
-
|
6094 |
-
|
6095 |
-
} // A focus event will occur as a result of a mouse click, but it
|
6096 |
-
// should be disambiguated between interacting with the button and
|
6097 |
-
// using an explicit focus shift as a cue to display the tooltip.
|
6098 |
|
|
|
|
|
6099 |
|
6100 |
-
|
6101 |
-
|
6102 |
-
} // Needed in case unsetting is over while delayed set pending, i.e.
|
6103 |
-
// quickly blur/mouseleave before delayedSetIsOver is called
|
6104 |
|
|
|
|
|
6105 |
|
6106 |
-
|
|
|
6107 |
|
6108 |
-
|
|
|
6109 |
|
6110 |
-
|
6111 |
-
|
6112 |
-
}
|
6113 |
|
6114 |
-
|
6115 |
-
|
6116 |
-
} else {
|
6117 |
-
_this2.setState({
|
6118 |
-
isOver: isOver
|
6119 |
-
});
|
6120 |
-
}
|
6121 |
-
};
|
6122 |
-
}
|
6123 |
-
/**
|
6124 |
-
* Creates an event callback to handle assignment of the `isInMouseDown`
|
6125 |
-
* instance property in response to a `mousedown` or `mouseup` event.
|
6126 |
-
*
|
6127 |
-
* @param {boolean} isMouseDown Whether handler is to be created for the
|
6128 |
-
* `mousedown` event, as opposed to `mouseup`.
|
6129 |
-
*
|
6130 |
-
* @return {Function} Event callback handler.
|
6131 |
-
*/
|
6132 |
|
6133 |
-
|
6134 |
-
|
6135 |
-
value: function createSetIsMouseDown(isMouseDown) {
|
6136 |
-
var _this3 = this;
|
6137 |
|
6138 |
-
|
6139 |
-
|
6140 |
-
_this3.emitToChild(isMouseDown ? 'onMouseDown' : 'onMouseUp', event); // On mouse down, the next `mouseup` should revert the value of the
|
6141 |
-
// instance property and remove its own event handler. The bind is
|
6142 |
-
// made on the document since the `mouseup` might not occur within
|
6143 |
-
// the bounds of the element.
|
6144 |
|
|
|
|
|
6145 |
|
6146 |
-
|
6147 |
-
|
6148 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6149 |
}
|
6150 |
}, {
|
6151 |
-
key: "
|
6152 |
-
value: function
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6153 |
var _this$props = this.props,
|
6154 |
-
|
6155 |
-
|
6156 |
-
|
6157 |
-
shortcut = _this$props.shortcut;
|
6158 |
-
|
6159 |
-
if (_wordpress_element__WEBPACK_IMPORTED_MODULE_5__["Children"].count(children) !== 1) {
|
6160 |
-
if (false) {}
|
6161 |
|
6162 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6163 |
}
|
6164 |
|
6165 |
-
|
6166 |
-
|
6167 |
-
|
6168 |
-
|
6169 |
-
|
6170 |
-
|
6171 |
-
|
6172 |
-
|
6173 |
-
|
6174 |
-
|
6175 |
-
|
6176 |
-
|
6177 |
-
|
6178 |
-
|
6179 |
-
|
6180 |
-
|
6181 |
-
|
6182 |
-
|
6183 |
-
|
6184 |
-
|
6185 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6186 |
}
|
6187 |
}]);
|
6188 |
|
6189 |
-
return
|
6190 |
-
}(
|
6191 |
|
6192 |
-
|
6193 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6194 |
|
6195 |
-
|
|
|
|
|
6196 |
|
6197 |
-
/***/ 16:
|
6198 |
-
/***/ (function(module, exports) {
|
6199 |
|
6200 |
-
(function() { module.exports = this["moment"]; }());
|
6201 |
|
6202 |
-
|
|
|
|
|
6203 |
|
6204 |
-
|
6205 |
-
|
|
|
6206 |
|
6207 |
-
// TinyColor v1.4.2
|
6208 |
-
// https://github.com/bgrins/TinyColor
|
6209 |
-
// Brian Grinstead, MIT License
|
6210 |
|
6211 |
-
|
|
|
|
|
6212 |
|
6213 |
-
var trimLeft = /^\s+/,
|
6214 |
-
trimRight = /\s+$/,
|
6215 |
-
tinyCounter = 0,
|
6216 |
-
mathRound = Math.round,
|
6217 |
-
mathMin = Math.min,
|
6218 |
-
mathMax = Math.max,
|
6219 |
-
mathRandom = Math.random;
|
6220 |
|
6221 |
-
|
6222 |
|
6223 |
-
|
6224 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6225 |
|
6226 |
-
|
6227 |
-
|
6228 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6229 |
}
|
6230 |
-
|
6231 |
-
|
6232 |
-
|
|
|
|
|
6233 |
}
|
6234 |
|
6235 |
-
|
6236 |
-
|
6237 |
-
|
6238 |
-
|
6239 |
-
this._b = rgb.b,
|
6240 |
-
this._a = rgb.a,
|
6241 |
-
this._roundA = mathRound(100*this._a) / 100,
|
6242 |
-
this._format = opts.format || rgb.format;
|
6243 |
-
this._gradientType = opts.gradientType;
|
6244 |
|
6245 |
-
|
6246 |
-
|
6247 |
-
|
6248 |
-
// If it was supposed to be 128, this was already taken care of by `inputToRgb`
|
6249 |
-
if (this._r < 1) { this._r = mathRound(this._r); }
|
6250 |
-
if (this._g < 1) { this._g = mathRound(this._g); }
|
6251 |
-
if (this._b < 1) { this._b = mathRound(this._b); }
|
6252 |
|
6253 |
-
|
6254 |
-
|
|
|
|
|
|
|
|
|
6255 |
}
|
6256 |
|
6257 |
-
|
6258 |
-
|
6259 |
-
|
6260 |
-
|
6261 |
-
|
6262 |
-
|
6263 |
-
|
6264 |
-
|
6265 |
-
|
6266 |
-
|
6267 |
-
getOriginalInput: function() {
|
6268 |
-
return this._originalInput;
|
6269 |
-
},
|
6270 |
-
getFormat: function() {
|
6271 |
-
return this._format;
|
6272 |
-
},
|
6273 |
-
getAlpha: function() {
|
6274 |
-
return this._a;
|
6275 |
-
},
|
6276 |
-
getBrightness: function() {
|
6277 |
-
//http://www.w3.org/TR/AERT#color-contrast
|
6278 |
-
var rgb = this.toRgb();
|
6279 |
-
return (rgb.r * 299 + rgb.g * 587 + rgb.b * 114) / 1000;
|
6280 |
-
},
|
6281 |
-
getLuminance: function() {
|
6282 |
-
//http://www.w3.org/TR/2008/REC-WCAG20-20081211/#relativeluminancedef
|
6283 |
-
var rgb = this.toRgb();
|
6284 |
-
var RsRGB, GsRGB, BsRGB, R, G, B;
|
6285 |
-
RsRGB = rgb.r/255;
|
6286 |
-
GsRGB = rgb.g/255;
|
6287 |
-
BsRGB = rgb.b/255;
|
6288 |
|
6289 |
-
|
6290 |
-
|
6291 |
-
|
6292 |
-
|
6293 |
-
},
|
6294 |
-
setAlpha: function(value) {
|
6295 |
-
this._a = boundAlpha(value);
|
6296 |
-
this._roundA = mathRound(100*this._a) / 100;
|
6297 |
-
return this;
|
6298 |
-
},
|
6299 |
-
toHsv: function() {
|
6300 |
-
var hsv = rgbToHsv(this._r, this._g, this._b);
|
6301 |
-
return { h: hsv.h * 360, s: hsv.s, v: hsv.v, a: this._a };
|
6302 |
-
},
|
6303 |
-
toHsvString: function() {
|
6304 |
-
var hsv = rgbToHsv(this._r, this._g, this._b);
|
6305 |
-
var h = mathRound(hsv.h * 360), s = mathRound(hsv.s * 100), v = mathRound(hsv.v * 100);
|
6306 |
-
return (this._a == 1) ?
|
6307 |
-
"hsv(" + h + ", " + s + "%, " + v + "%)" :
|
6308 |
-
"hsva(" + h + ", " + s + "%, " + v + "%, "+ this._roundA + ")";
|
6309 |
-
},
|
6310 |
-
toHsl: function() {
|
6311 |
-
var hsl = rgbToHsl(this._r, this._g, this._b);
|
6312 |
-
return { h: hsl.h * 360, s: hsl.s, l: hsl.l, a: this._a };
|
6313 |
-
},
|
6314 |
-
toHslString: function() {
|
6315 |
-
var hsl = rgbToHsl(this._r, this._g, this._b);
|
6316 |
-
var h = mathRound(hsl.h * 360), s = mathRound(hsl.s * 100), l = mathRound(hsl.l * 100);
|
6317 |
-
return (this._a == 1) ?
|
6318 |
-
"hsl(" + h + ", " + s + "%, " + l + "%)" :
|
6319 |
-
"hsla(" + h + ", " + s + "%, " + l + "%, "+ this._roundA + ")";
|
6320 |
-
},
|
6321 |
-
toHex: function(allow3Char) {
|
6322 |
-
return rgbToHex(this._r, this._g, this._b, allow3Char);
|
6323 |
-
},
|
6324 |
-
toHexString: function(allow3Char) {
|
6325 |
-
return '#' + this.toHex(allow3Char);
|
6326 |
-
},
|
6327 |
-
toHex8: function(allow4Char) {
|
6328 |
-
return rgbaToHex(this._r, this._g, this._b, this._a, allow4Char);
|
6329 |
-
},
|
6330 |
-
toHex8String: function(allow4Char) {
|
6331 |
-
return '#' + this.toHex8(allow4Char);
|
6332 |
-
},
|
6333 |
-
toRgb: function() {
|
6334 |
-
return { r: mathRound(this._r), g: mathRound(this._g), b: mathRound(this._b), a: this._a };
|
6335 |
-
},
|
6336 |
-
toRgbString: function() {
|
6337 |
-
return (this._a == 1) ?
|
6338 |
-
"rgb(" + mathRound(this._r) + ", " + mathRound(this._g) + ", " + mathRound(this._b) + ")" :
|
6339 |
-
"rgba(" + mathRound(this._r) + ", " + mathRound(this._g) + ", " + mathRound(this._b) + ", " + this._roundA + ")";
|
6340 |
-
},
|
6341 |
-
toPercentageRgb: function() {
|
6342 |
-
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 };
|
6343 |
-
},
|
6344 |
-
toPercentageRgbString: function() {
|
6345 |
-
return (this._a == 1) ?
|
6346 |
-
"rgb(" + mathRound(bound01(this._r, 255) * 100) + "%, " + mathRound(bound01(this._g, 255) * 100) + "%, " + mathRound(bound01(this._b, 255) * 100) + "%)" :
|
6347 |
-
"rgba(" + mathRound(bound01(this._r, 255) * 100) + "%, " + mathRound(bound01(this._g, 255) * 100) + "%, " + mathRound(bound01(this._b, 255) * 100) + "%, " + this._roundA + ")";
|
6348 |
-
},
|
6349 |
-
toName: function() {
|
6350 |
-
if (this._a === 0) {
|
6351 |
-
return "transparent";
|
6352 |
-
}
|
6353 |
|
6354 |
-
|
6355 |
-
return false;
|
6356 |
-
}
|
6357 |
|
6358 |
-
return hexNames[rgbToHex(this._r, this._g, this._b, true)] || false;
|
6359 |
-
},
|
6360 |
-
toFilter: function(secondColor) {
|
6361 |
-
var hex8String = '#' + rgbaToArgbHex(this._r, this._g, this._b, this._a);
|
6362 |
-
var secondHex8String = hex8String;
|
6363 |
-
var gradientType = this._gradientType ? "GradientType = 1, " : "";
|
6364 |
|
6365 |
-
if (secondColor) {
|
6366 |
-
var s = tinycolor(secondColor);
|
6367 |
-
secondHex8String = '#' + rgbaToArgbHex(s._r, s._g, s._b, s._a);
|
6368 |
-
}
|
6369 |
|
6370 |
-
return "progid:DXImageTransform.Microsoft.gradient("+gradientType+"startColorstr="+hex8String+",endColorstr="+secondHex8String+")";
|
6371 |
-
},
|
6372 |
-
toString: function(format) {
|
6373 |
-
var formatSet = !!format;
|
6374 |
-
format = format || this._format;
|
6375 |
|
6376 |
-
|
6377 |
-
|
6378 |
-
|
6379 |
|
6380 |
-
|
6381 |
-
|
6382 |
-
|
6383 |
-
if (format === "name" && this._a === 0) {
|
6384 |
-
return this.toName();
|
6385 |
-
}
|
6386 |
-
return this.toRgbString();
|
6387 |
-
}
|
6388 |
-
if (format === "rgb") {
|
6389 |
-
formattedString = this.toRgbString();
|
6390 |
-
}
|
6391 |
-
if (format === "prgb") {
|
6392 |
-
formattedString = this.toPercentageRgbString();
|
6393 |
-
}
|
6394 |
-
if (format === "hex" || format === "hex6") {
|
6395 |
-
formattedString = this.toHexString();
|
6396 |
-
}
|
6397 |
-
if (format === "hex3") {
|
6398 |
-
formattedString = this.toHexString(true);
|
6399 |
-
}
|
6400 |
-
if (format === "hex4") {
|
6401 |
-
formattedString = this.toHex8String(true);
|
6402 |
-
}
|
6403 |
-
if (format === "hex8") {
|
6404 |
-
formattedString = this.toHex8String();
|
6405 |
-
}
|
6406 |
-
if (format === "name") {
|
6407 |
-
formattedString = this.toName();
|
6408 |
-
}
|
6409 |
-
if (format === "hsl") {
|
6410 |
-
formattedString = this.toHslString();
|
6411 |
-
}
|
6412 |
-
if (format === "hsv") {
|
6413 |
-
formattedString = this.toHsvString();
|
6414 |
-
}
|
6415 |
|
6416 |
-
return formattedString || this.toHexString();
|
6417 |
-
},
|
6418 |
-
clone: function() {
|
6419 |
-
return tinycolor(this.toString());
|
6420 |
-
},
|
6421 |
|
6422 |
-
|
6423 |
-
|
6424 |
-
|
6425 |
-
|
6426 |
-
|
6427 |
-
|
6428 |
-
|
6429 |
-
},
|
6430 |
-
lighten: function() {
|
6431 |
-
return this._applyModification(lighten, arguments);
|
6432 |
-
},
|
6433 |
-
brighten: function() {
|
6434 |
-
return this._applyModification(brighten, arguments);
|
6435 |
-
},
|
6436 |
-
darken: function() {
|
6437 |
-
return this._applyModification(darken, arguments);
|
6438 |
-
},
|
6439 |
-
desaturate: function() {
|
6440 |
-
return this._applyModification(desaturate, arguments);
|
6441 |
-
},
|
6442 |
-
saturate: function() {
|
6443 |
-
return this._applyModification(saturate, arguments);
|
6444 |
-
},
|
6445 |
-
greyscale: function() {
|
6446 |
-
return this._applyModification(greyscale, arguments);
|
6447 |
-
},
|
6448 |
-
spin: function() {
|
6449 |
-
return this._applyModification(spin, arguments);
|
6450 |
-
},
|
6451 |
|
6452 |
-
|
6453 |
-
|
6454 |
-
|
6455 |
-
|
6456 |
-
|
6457 |
-
|
6458 |
-
|
6459 |
-
|
6460 |
-
|
6461 |
-
|
6462 |
-
|
6463 |
-
|
6464 |
-
splitcomplement: function() {
|
6465 |
-
return this._applyCombination(splitcomplement, arguments);
|
6466 |
-
},
|
6467 |
-
triad: function() {
|
6468 |
-
return this._applyCombination(triad, arguments);
|
6469 |
-
},
|
6470 |
-
tetrad: function() {
|
6471 |
-
return this._applyCombination(tetrad, arguments);
|
6472 |
-
}
|
6473 |
-
};
|
6474 |
|
6475 |
-
|
6476 |
-
|
6477 |
-
|
6478 |
-
|
6479 |
-
|
6480 |
-
|
6481 |
-
|
6482 |
-
|
6483 |
-
|
6484 |
-
|
6485 |
-
else {
|
6486 |
-
newColor[i] = convertToPercentage(color[i]);
|
6487 |
-
}
|
6488 |
-
}
|
6489 |
-
}
|
6490 |
-
color = newColor;
|
6491 |
-
}
|
6492 |
|
6493 |
-
|
6494 |
-
|
6495 |
|
6496 |
-
//
|
6497 |
-
// Possible string inputs:
|
6498 |
-
//
|
6499 |
-
// "red"
|
6500 |
-
// "#f00" or "f00"
|
6501 |
-
// "#ff0000" or "ff0000"
|
6502 |
-
// "#ff000000" or "ff000000"
|
6503 |
-
// "rgb 255 0 0" or "rgb (255, 0, 0)"
|
6504 |
-
// "rgb 1.0 0 0" or "rgb (1, 0, 0)"
|
6505 |
-
// "rgba (255, 0, 0, 1)" or "rgba 255, 0, 0, 1"
|
6506 |
-
// "rgba (1.0, 0, 0, 1)" or "rgba 1.0, 0, 0, 1"
|
6507 |
-
// "hsl(0, 100%, 50%)" or "hsl 0 100% 50%"
|
6508 |
-
// "hsla(0, 100%, 50%, 1)" or "hsla 0 100% 50%, 1"
|
6509 |
-
// "hsv(0, 100%, 100%)" or "hsv 0 100% 100%"
|
6510 |
-
//
|
6511 |
-
function inputToRGB(color) {
|
6512 |
|
6513 |
-
var rgb = { r: 0, g: 0, b: 0 };
|
6514 |
-
var a = 1;
|
6515 |
-
var s = null;
|
6516 |
-
var v = null;
|
6517 |
-
var l = null;
|
6518 |
-
var ok = false;
|
6519 |
-
var format = false;
|
6520 |
|
6521 |
-
|
6522 |
-
|
6523 |
-
|
6524 |
|
6525 |
-
|
6526 |
-
|
6527 |
-
|
6528 |
-
ok = true;
|
6529 |
-
format = String(color.r).substr(-1) === "%" ? "prgb" : "rgb";
|
6530 |
-
}
|
6531 |
-
else if (isValidCSSUnit(color.h) && isValidCSSUnit(color.s) && isValidCSSUnit(color.v)) {
|
6532 |
-
s = convertToPercentage(color.s);
|
6533 |
-
v = convertToPercentage(color.v);
|
6534 |
-
rgb = hsvToRgb(color.h, s, v);
|
6535 |
-
ok = true;
|
6536 |
-
format = "hsv";
|
6537 |
-
}
|
6538 |
-
else if (isValidCSSUnit(color.h) && isValidCSSUnit(color.s) && isValidCSSUnit(color.l)) {
|
6539 |
-
s = convertToPercentage(color.s);
|
6540 |
-
l = convertToPercentage(color.l);
|
6541 |
-
rgb = hslToRgb(color.h, s, l);
|
6542 |
-
ok = true;
|
6543 |
-
format = "hsl";
|
6544 |
-
}
|
6545 |
|
6546 |
-
if (color.hasOwnProperty("a")) {
|
6547 |
-
a = color.a;
|
6548 |
-
}
|
6549 |
-
}
|
6550 |
|
6551 |
-
a = boundAlpha(a);
|
6552 |
|
6553 |
-
|
6554 |
-
|
6555 |
-
|
6556 |
-
|
6557 |
-
|
6558 |
-
|
6559 |
-
|
6560 |
-
|
6561 |
}
|
6562 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6563 |
|
6564 |
-
|
6565 |
-
|
|
|
6566 |
|
6567 |
-
|
6568 |
-
|
|
|
6569 |
|
6570 |
-
|
6571 |
-
// Handle bounds / percentage checking to conform to CSS color spec
|
6572 |
-
// <http://www.w3.org/TR/css3-color/>
|
6573 |
-
// *Assumes:* r, g, b in [0, 255] or [0, 1]
|
6574 |
-
// *Returns:* { r, g, b } in [0, 255]
|
6575 |
-
function rgbToRgb(r, g, b){
|
6576 |
-
return {
|
6577 |
-
r: bound01(r, 255) * 255,
|
6578 |
-
g: bound01(g, 255) * 255,
|
6579 |
-
b: bound01(b, 255) * 255
|
6580 |
-
};
|
6581 |
}
|
|
|
|
|
6582 |
|
6583 |
-
// `rgbToHsl`
|
6584 |
-
// Converts an RGB color value to HSL.
|
6585 |
-
// *Assumes:* r, g, and b are contained in [0, 255] or [0, 1]
|
6586 |
-
// *Returns:* { h, s, l } in [0,1]
|
6587 |
-
function rgbToHsl(r, g, b) {
|
6588 |
|
6589 |
-
r = bound01(r, 255);
|
6590 |
-
g = bound01(g, 255);
|
6591 |
-
b = bound01(b, 255);
|
6592 |
|
6593 |
-
var max = mathMax(r, g, b), min = mathMin(r, g, b);
|
6594 |
-
var h, s, l = (max + min) / 2;
|
6595 |
|
6596 |
-
|
6597 |
-
|
6598 |
-
|
6599 |
-
else {
|
6600 |
-
var d = max - min;
|
6601 |
-
s = l > 0.5 ? d / (2 - max - min) : d / (max + min);
|
6602 |
-
switch(max) {
|
6603 |
-
case r: h = (g - b) / d + (g < b ? 6 : 0); break;
|
6604 |
-
case g: h = (b - r) / d + 2; break;
|
6605 |
-
case b: h = (r - g) / d + 4; break;
|
6606 |
-
}
|
6607 |
|
6608 |
-
h /= 6;
|
6609 |
-
}
|
6610 |
|
6611 |
-
return { h: h, s: s, l: l };
|
6612 |
-
}
|
6613 |
|
6614 |
-
// `hslToRgb`
|
6615 |
-
// Converts an HSL color value to RGB.
|
6616 |
-
// *Assumes:* h is contained in [0, 1] or [0, 360] and s and l are contained [0, 1] or [0, 100]
|
6617 |
-
// *Returns:* { r, g, b } in the set [0, 255]
|
6618 |
-
function hslToRgb(h, s, l) {
|
6619 |
-
var r, g, b;
|
6620 |
|
6621 |
-
h = bound01(h, 360);
|
6622 |
-
s = bound01(s, 100);
|
6623 |
-
l = bound01(l, 100);
|
6624 |
|
6625 |
-
function hue2rgb(p, q, t) {
|
6626 |
-
if(t < 0) t += 1;
|
6627 |
-
if(t > 1) t -= 1;
|
6628 |
-
if(t < 1/6) return p + (q - p) * 6 * t;
|
6629 |
-
if(t < 1/2) return q;
|
6630 |
-
if(t < 2/3) return p + (q - p) * (2/3 - t) * 6;
|
6631 |
-
return p;
|
6632 |
-
}
|
6633 |
|
6634 |
-
|
6635 |
-
|
6636 |
-
|
6637 |
-
else {
|
6638 |
-
var q = l < 0.5 ? l * (1 + s) : l + s - l * s;
|
6639 |
-
var p = 2 * l - q;
|
6640 |
-
r = hue2rgb(p, q, h + 1/3);
|
6641 |
-
g = hue2rgb(p, q, h);
|
6642 |
-
b = hue2rgb(p, q, h - 1/3);
|
6643 |
-
}
|
6644 |
|
6645 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6646 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
6647 |
|
6648 |
-
|
6649 |
-
// Converts an RGB color value to HSV
|
6650 |
-
// *Assumes:* r, g, and b are contained in the set [0, 255] or [0, 1]
|
6651 |
-
// *Returns:* { h, s, v } in [0,1]
|
6652 |
-
function rgbToHsv(r, g, b) {
|
6653 |
|
6654 |
-
|
6655 |
-
|
6656 |
-
|
|
|
|
|
6657 |
|
6658 |
-
|
6659 |
-
|
6660 |
-
|
6661 |
-
|
6662 |
-
|
6663 |
-
|
6664 |
-
if(max == min) {
|
6665 |
-
h = 0; // achromatic
|
6666 |
-
}
|
6667 |
-
else {
|
6668 |
-
switch(max) {
|
6669 |
-
case r: h = (g - b) / d + (g < b ? 6 : 0); break;
|
6670 |
-
case g: h = (b - r) / d + 2; break;
|
6671 |
-
case b: h = (r - g) / d + 4; break;
|
6672 |
-
}
|
6673 |
-
h /= 6;
|
6674 |
-
}
|
6675 |
-
return { h: h, s: s, v: v };
|
6676 |
}
|
6677 |
|
6678 |
-
|
6679 |
-
// Converts an HSV color value to RGB.
|
6680 |
-
// *Assumes:* h is contained in [0, 1] or [0, 360] and s and v are contained in [0, 1] or [0, 100]
|
6681 |
-
// *Returns:* { r, g, b } in the set [0, 255]
|
6682 |
-
function hsvToRgb(h, s, v) {
|
6683 |
|
6684 |
-
|
6685 |
-
|
6686 |
-
|
6687 |
|
6688 |
-
|
6689 |
-
f = h - i,
|
6690 |
-
p = v * (1 - s),
|
6691 |
-
q = v * (1 - f * s),
|
6692 |
-
t = v * (1 - (1 - f) * s),
|
6693 |
-
mod = i % 6,
|
6694 |
-
r = [v, q, p, p, t, v][mod],
|
6695 |
-
g = [t, v, v, q, p, p][mod],
|
6696 |
-
b = [p, p, t, v, v, q][mod];
|
6697 |
|
6698 |
-
return { r: r * 255, g: g * 255, b: b * 255 };
|
6699 |
-
}
|
6700 |
|
6701 |
-
|
6702 |
-
|
6703 |
-
// Assumes r, g, and b are contained in the set [0, 255]
|
6704 |
-
// Returns a 3 or 6 character hex
|
6705 |
-
function rgbToHex(r, g, b, allow3Char) {
|
6706 |
|
6707 |
-
|
6708 |
-
pad2(mathRound(r).toString(16)),
|
6709 |
-
pad2(mathRound(g).toString(16)),
|
6710 |
-
pad2(mathRound(b).toString(16))
|
6711 |
-
];
|
6712 |
|
6713 |
-
|
6714 |
-
|
6715 |
-
|
6716 |
-
|
6717 |
|
6718 |
-
|
6719 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6720 |
|
6721 |
-
// `rgbaToHex`
|
6722 |
-
// Converts an RGBA color plus alpha transparency to hex
|
6723 |
-
// Assumes r, g, b are contained in the set [0, 255] and
|
6724 |
-
// a in [0, 1]. Returns a 4 or 8 character rgba hex
|
6725 |
-
function rgbaToHex(r, g, b, a, allow4Char) {
|
6726 |
|
6727 |
-
|
6728 |
-
|
6729 |
-
|
6730 |
-
pad2(mathRound(b).toString(16)),
|
6731 |
-
pad2(convertDecimalToHex(a))
|
6732 |
-
];
|
6733 |
|
6734 |
-
|
6735 |
-
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)) {
|
6736 |
-
return hex[0].charAt(0) + hex[1].charAt(0) + hex[2].charAt(0) + hex[3].charAt(0);
|
6737 |
-
}
|
6738 |
|
6739 |
-
|
|
|
6740 |
}
|
6741 |
|
6742 |
-
|
6743 |
-
// Converts an RGBA color to an ARGB Hex8 string
|
6744 |
-
// Rarely used, but required for "toFilter()"
|
6745 |
-
function rgbaToArgbHex(r, g, b, a) {
|
6746 |
|
6747 |
-
|
6748 |
-
|
6749 |
-
|
6750 |
-
pad2(mathRound(g).toString(16)),
|
6751 |
-
pad2(mathRound(b).toString(16))
|
6752 |
-
];
|
6753 |
|
6754 |
-
|
|
|
6755 |
}
|
6756 |
|
6757 |
-
|
6758 |
-
// Can be called with any tinycolor input
|
6759 |
-
tinycolor.equals = function (color1, color2) {
|
6760 |
-
if (!color1 || !color2) { return false; }
|
6761 |
-
return tinycolor(color1).toRgbString() == tinycolor(color2).toRgbString();
|
6762 |
-
};
|
6763 |
-
|
6764 |
-
tinycolor.random = function() {
|
6765 |
-
return tinycolor.fromRatio({
|
6766 |
-
r: mathRandom(),
|
6767 |
-
g: mathRandom(),
|
6768 |
-
b: mathRandom()
|
6769 |
-
});
|
6770 |
-
};
|
6771 |
-
|
6772 |
|
6773 |
-
|
6774 |
-
|
6775 |
-
|
6776 |
-
// <https://github.com/cloudhead/less.js/blob/master/lib/less/functions.js>
|
6777 |
|
6778 |
-
function
|
6779 |
-
|
6780 |
-
var hsl = tinycolor(color).toHsl();
|
6781 |
-
hsl.s -= amount / 100;
|
6782 |
-
hsl.s = clamp01(hsl.s);
|
6783 |
-
return tinycolor(hsl);
|
6784 |
}
|
6785 |
|
6786 |
-
|
6787 |
-
amount = (amount === 0) ? 0 : (amount || 10);
|
6788 |
-
var hsl = tinycolor(color).toHsl();
|
6789 |
-
hsl.s += amount / 100;
|
6790 |
-
hsl.s = clamp01(hsl.s);
|
6791 |
-
return tinycolor(hsl);
|
6792 |
-
}
|
6793 |
|
6794 |
-
|
6795 |
-
|
6796 |
-
|
6797 |
|
6798 |
-
function
|
6799 |
-
|
6800 |
-
var hsl = tinycolor(color).toHsl();
|
6801 |
-
hsl.l += amount / 100;
|
6802 |
-
hsl.l = clamp01(hsl.l);
|
6803 |
-
return tinycolor(hsl);
|
6804 |
}
|
6805 |
|
6806 |
-
|
6807 |
-
amount = (amount === 0) ? 0 : (amount || 10);
|
6808 |
-
var rgb = tinycolor(color).toRgb();
|
6809 |
-
rgb.r = mathMax(0, mathMin(255, rgb.r - mathRound(255 * - (amount / 100))));
|
6810 |
-
rgb.g = mathMax(0, mathMin(255, rgb.g - mathRound(255 * - (amount / 100))));
|
6811 |
-
rgb.b = mathMax(0, mathMin(255, rgb.b - mathRound(255 * - (amount / 100))));
|
6812 |
-
return tinycolor(rgb);
|
6813 |
-
}
|
6814 |
|
6815 |
-
|
6816 |
-
|
6817 |
-
|
6818 |
-
hsl.l -= amount / 100;
|
6819 |
-
hsl.l = clamp01(hsl.l);
|
6820 |
-
return tinycolor(hsl);
|
6821 |
-
}
|
6822 |
|
6823 |
-
|
6824 |
-
|
6825 |
-
|
6826 |
-
|
6827 |
-
|
6828 |
-
|
6829 |
-
return tinycolor(hsl);
|
6830 |
-
}
|
6831 |
|
6832 |
-
|
6833 |
-
|
6834 |
-
|
6835 |
-
// <https://github.com/infusion/jQuery-xcolor/blob/master/jquery.xcolor.js>
|
6836 |
|
6837 |
-
|
6838 |
-
|
6839 |
-
|
6840 |
-
|
6841 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6842 |
|
6843 |
-
|
6844 |
-
var hsl = tinycolor(color).toHsl();
|
6845 |
-
var h = hsl.h;
|
6846 |
-
return [
|
6847 |
-
tinycolor(color),
|
6848 |
-
tinycolor({ h: (h + 120) % 360, s: hsl.s, l: hsl.l }),
|
6849 |
-
tinycolor({ h: (h + 240) % 360, s: hsl.s, l: hsl.l })
|
6850 |
-
];
|
6851 |
}
|
6852 |
|
6853 |
-
|
6854 |
-
var hsl = tinycolor(color).toHsl();
|
6855 |
-
var h = hsl.h;
|
6856 |
-
return [
|
6857 |
-
tinycolor(color),
|
6858 |
-
tinycolor({ h: (h + 90) % 360, s: hsl.s, l: hsl.l }),
|
6859 |
-
tinycolor({ h: (h + 180) % 360, s: hsl.s, l: hsl.l }),
|
6860 |
-
tinycolor({ h: (h + 270) % 360, s: hsl.s, l: hsl.l })
|
6861 |
-
];
|
6862 |
-
}
|
6863 |
|
6864 |
-
|
6865 |
-
|
6866 |
-
|
6867 |
-
|
6868 |
-
|
6869 |
-
|
6870 |
-
tinycolor({ h: (h + 216) % 360, s: hsl.s, l: hsl.l})
|
6871 |
-
];
|
6872 |
}
|
6873 |
|
6874 |
-
|
6875 |
-
results = results || 6;
|
6876 |
-
slices = slices || 30;
|
6877 |
|
6878 |
-
|
6879 |
-
|
6880 |
-
|
6881 |
|
6882 |
-
|
6883 |
-
hsl.h = (hsl.h + part) % 360;
|
6884 |
-
ret.push(tinycolor(hsl));
|
6885 |
-
}
|
6886 |
-
return ret;
|
6887 |
-
}
|
6888 |
|
6889 |
-
function monochromatic(color, results) {
|
6890 |
-
results = results || 6;
|
6891 |
-
var hsv = tinycolor(color).toHsv();
|
6892 |
-
var h = hsv.h, s = hsv.s, v = hsv.v;
|
6893 |
-
var ret = [];
|
6894 |
-
var modification = 1 / results;
|
6895 |
|
6896 |
-
|
6897 |
-
ret.push(tinycolor({ h: h, s: s, v: v}));
|
6898 |
-
v = (v + modification) % 1;
|
6899 |
-
}
|
6900 |
|
6901 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6902 |
}
|
6903 |
|
6904 |
-
|
6905 |
-
// ---------------------
|
6906 |
|
6907 |
-
tinycolor.mix = function(color1, color2, amount) {
|
6908 |
-
amount = (amount === 0) ? 0 : (amount || 50);
|
6909 |
|
6910 |
-
|
6911 |
-
|
|
|
6912 |
|
6913 |
-
|
6914 |
|
6915 |
-
var rgba = {
|
6916 |
-
r: ((rgb2.r - rgb1.r) * p) + rgb1.r,
|
6917 |
-
g: ((rgb2.g - rgb1.g) * p) + rgb1.g,
|
6918 |
-
b: ((rgb2.b - rgb1.b) * p) + rgb1.b,
|
6919 |
-
a: ((rgb2.a - rgb1.a) * p) + rgb1.a
|
6920 |
-
};
|
6921 |
|
6922 |
-
|
6923 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6924 |
|
|
|
|
|
|
|
6925 |
|
6926 |
-
|
6927 |
-
|
6928 |
-
|
6929 |
|
6930 |
-
|
6931 |
-
|
6932 |
-
|
6933 |
-
|
6934 |
-
|
6935 |
-
return (Math.max(c1.getLuminance(),c2.getLuminance())+0.05) / (Math.min(c1.getLuminance(),c2.getLuminance())+0.05);
|
6936 |
-
};
|
6937 |
|
6938 |
-
|
6939 |
-
|
6940 |
-
// The third argument is an optional Object.
|
6941 |
-
// the 'level' property states 'AA' or 'AAA' - if missing or invalid, it defaults to 'AA';
|
6942 |
-
// the 'size' property states 'large' or 'small' - if missing or invalid, it defaults to 'small'.
|
6943 |
-
// If the entire object is absent, isReadable defaults to {level:"AA",size:"small"}.
|
6944 |
|
6945 |
-
|
6946 |
-
// tinycolor.isReadable("#000", "#111") => false
|
6947 |
-
// tinycolor.isReadable("#000", "#111",{level:"AA",size:"large"}) => false
|
6948 |
-
tinycolor.isReadable = function(color1, color2, wcag2) {
|
6949 |
-
var readability = tinycolor.readability(color1, color2);
|
6950 |
-
var wcag2Parms, out;
|
6951 |
|
6952 |
-
out = false;
|
6953 |
|
6954 |
-
|
6955 |
-
|
6956 |
-
|
6957 |
-
|
6958 |
-
out = readability >= 4.5;
|
6959 |
-
break;
|
6960 |
-
case "AAlarge":
|
6961 |
-
out = readability >= 3;
|
6962 |
-
break;
|
6963 |
-
case "AAAsmall":
|
6964 |
-
out = readability >= 7;
|
6965 |
-
break;
|
6966 |
-
}
|
6967 |
-
return out;
|
6968 |
|
6969 |
-
|
|
|
|
|
6970 |
|
6971 |
-
|
6972 |
-
// Given a base color and a list of possible foreground or background
|
6973 |
-
// colors for that base, returns the most readable color.
|
6974 |
-
// Optionally returns Black or White if the most readable color is unreadable.
|
6975 |
-
// *Example*
|
6976 |
-
// tinycolor.mostReadable(tinycolor.mostReadable("#123", ["#124", "#125"],{includeFallbackColors:false}).toHexString(); // "#112255"
|
6977 |
-
// tinycolor.mostReadable(tinycolor.mostReadable("#123", ["#124", "#125"],{includeFallbackColors:true}).toHexString(); // "#ffffff"
|
6978 |
-
// tinycolor.mostReadable("#a8015a", ["#faf3f3"],{includeFallbackColors:true,level:"AAA",size:"large"}).toHexString(); // "#faf3f3"
|
6979 |
-
// tinycolor.mostReadable("#a8015a", ["#faf3f3"],{includeFallbackColors:true,level:"AAA",size:"small"}).toHexString(); // "#ffffff"
|
6980 |
-
tinycolor.mostReadable = function(baseColor, colorList, args) {
|
6981 |
-
var bestColor = null;
|
6982 |
-
var bestScore = 0;
|
6983 |
-
var readability;
|
6984 |
-
var includeFallbackColors, level, size ;
|
6985 |
-
args = args || {};
|
6986 |
-
includeFallbackColors = args.includeFallbackColors ;
|
6987 |
-
level = args.level;
|
6988 |
-
size = args.size;
|
6989 |
|
6990 |
-
|
6991 |
-
|
6992 |
-
|
6993 |
-
|
6994 |
-
|
6995 |
-
|
6996 |
-
|
6997 |
|
6998 |
-
|
6999 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
7000 |
}
|
7001 |
-
|
7002 |
-
|
7003 |
-
return tinycolor
|
7004 |
}
|
7005 |
-
};
|
7006 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7007 |
|
7008 |
-
//
|
7009 |
-
//
|
7010 |
-
//
|
7011 |
-
|
7012 |
-
|
7013 |
-
|
7014 |
-
|
7015 |
-
aquamarine: "7fffd4",
|
7016 |
-
azure: "f0ffff",
|
7017 |
-
beige: "f5f5dc",
|
7018 |
-
bisque: "ffe4c4",
|
7019 |
-
black: "000",
|
7020 |
-
blanchedalmond: "ffebcd",
|
7021 |
-
blue: "00f",
|
7022 |
-
blueviolet: "8a2be2",
|
7023 |
-
brown: "a52a2a",
|
7024 |
-
burlywood: "deb887",
|
7025 |
-
burntsienna: "ea7e5d",
|
7026 |
-
cadetblue: "5f9ea0",
|
7027 |
-
chartreuse: "7fff00",
|
7028 |
-
chocolate: "d2691e",
|
7029 |
-
coral: "ff7f50",
|
7030 |
-
cornflowerblue: "6495ed",
|
7031 |
-
cornsilk: "fff8dc",
|
7032 |
-
crimson: "dc143c",
|
7033 |
-
cyan: "0ff",
|
7034 |
-
darkblue: "00008b",
|
7035 |
-
darkcyan: "008b8b",
|
7036 |
-
darkgoldenrod: "b8860b",
|
7037 |
-
darkgray: "a9a9a9",
|
7038 |
-
darkgreen: "006400",
|
7039 |
-
darkgrey: "a9a9a9",
|
7040 |
-
darkkhaki: "bdb76b",
|
7041 |
-
darkmagenta: "8b008b",
|
7042 |
-
darkolivegreen: "556b2f",
|
7043 |
-
darkorange: "ff8c00",
|
7044 |
-
darkorchid: "9932cc",
|
7045 |
-
darkred: "8b0000",
|
7046 |
-
darksalmon: "e9967a",
|
7047 |
-
darkseagreen: "8fbc8f",
|
7048 |
-
darkslateblue: "483d8b",
|
7049 |
-
darkslategray: "2f4f4f",
|
7050 |
-
darkslategrey: "2f4f4f",
|
7051 |
-
darkturquoise: "00ced1",
|
7052 |
-
darkviolet: "9400d3",
|
7053 |
-
deeppink: "ff1493",
|
7054 |
-
deepskyblue: "00bfff",
|
7055 |
-
dimgray: "696969",
|
7056 |
-
dimgrey: "696969",
|
7057 |
-
dodgerblue: "1e90ff",
|
7058 |
-
firebrick: "b22222",
|
7059 |
-
floralwhite: "fffaf0",
|
7060 |
-
forestgreen: "228b22",
|
7061 |
-
fuchsia: "f0f",
|
7062 |
-
gainsboro: "dcdcdc",
|
7063 |
-
ghostwhite: "f8f8ff",
|
7064 |
-
gold: "ffd700",
|
7065 |
-
goldenrod: "daa520",
|
7066 |
-
gray: "808080",
|
7067 |
-
green: "008000",
|
7068 |
-
greenyellow: "adff2f",
|
7069 |
-
grey: "808080",
|
7070 |
-
honeydew: "f0fff0",
|
7071 |
-
hotpink: "ff69b4",
|
7072 |
-
indianred: "cd5c5c",
|
7073 |
-
indigo: "4b0082",
|
7074 |
-
ivory: "fffff0",
|
7075 |
-
khaki: "f0e68c",
|
7076 |
-
lavender: "e6e6fa",
|
7077 |
-
lavenderblush: "fff0f5",
|
7078 |
-
lawngreen: "7cfc00",
|
7079 |
-
lemonchiffon: "fffacd",
|
7080 |
-
lightblue: "add8e6",
|
7081 |
-
lightcoral: "f08080",
|
7082 |
-
lightcyan: "e0ffff",
|
7083 |
-
lightgoldenrodyellow: "fafad2",
|
7084 |
-
lightgray: "d3d3d3",
|
7085 |
-
lightgreen: "90ee90",
|
7086 |
-
lightgrey: "d3d3d3",
|
7087 |
-
lightpink: "ffb6c1",
|
7088 |
-
lightsalmon: "ffa07a",
|
7089 |
-
lightseagreen: "20b2aa",
|
7090 |
-
lightskyblue: "87cefa",
|
7091 |
-
lightslategray: "789",
|
7092 |
-
lightslategrey: "789",
|
7093 |
-
lightsteelblue: "b0c4de",
|
7094 |
-
lightyellow: "ffffe0",
|
7095 |
-
lime: "0f0",
|
7096 |
-
limegreen: "32cd32",
|
7097 |
-
linen: "faf0e6",
|
7098 |
-
magenta: "f0f",
|
7099 |
-
maroon: "800000",
|
7100 |
-
mediumaquamarine: "66cdaa",
|
7101 |
-
mediumblue: "0000cd",
|
7102 |
-
mediumorchid: "ba55d3",
|
7103 |
-
mediumpurple: "9370db",
|
7104 |
-
mediumseagreen: "3cb371",
|
7105 |
-
mediumslateblue: "7b68ee",
|
7106 |
-
mediumspringgreen: "00fa9a",
|
7107 |
-
mediumturquoise: "48d1cc",
|
7108 |
-
mediumvioletred: "c71585",
|
7109 |
-
midnightblue: "191970",
|
7110 |
-
mintcream: "f5fffa",
|
7111 |
-
mistyrose: "ffe4e1",
|
7112 |
-
moccasin: "ffe4b5",
|
7113 |
-
navajowhite: "ffdead",
|
7114 |
-
navy: "000080",
|
7115 |
-
oldlace: "fdf5e6",
|
7116 |
-
olive: "808000",
|
7117 |
-
olivedrab: "6b8e23",
|
7118 |
-
orange: "ffa500",
|
7119 |
-
orangered: "ff4500",
|
7120 |
-
orchid: "da70d6",
|
7121 |
-
palegoldenrod: "eee8aa",
|
7122 |
-
palegreen: "98fb98",
|
7123 |
-
paleturquoise: "afeeee",
|
7124 |
-
palevioletred: "db7093",
|
7125 |
-
papayawhip: "ffefd5",
|
7126 |
-
peachpuff: "ffdab9",
|
7127 |
-
peru: "cd853f",
|
7128 |
-
pink: "ffc0cb",
|
7129 |
-
plum: "dda0dd",
|
7130 |
-
powderblue: "b0e0e6",
|
7131 |
-
purple: "800080",
|
7132 |
-
rebeccapurple: "663399",
|
7133 |
-
red: "f00",
|
7134 |
-
rosybrown: "bc8f8f",
|
7135 |
-
royalblue: "4169e1",
|
7136 |
-
saddlebrown: "8b4513",
|
7137 |
-
salmon: "fa8072",
|
7138 |
-
sandybrown: "f4a460",
|
7139 |
-
seagreen: "2e8b57",
|
7140 |
-
seashell: "fff5ee",
|
7141 |
-
sienna: "a0522d",
|
7142 |
-
silver: "c0c0c0",
|
7143 |
-
skyblue: "87ceeb",
|
7144 |
-
slateblue: "6a5acd",
|
7145 |
-
slategray: "708090",
|
7146 |
-
slategrey: "708090",
|
7147 |
-
snow: "fffafa",
|
7148 |
-
springgreen: "00ff7f",
|
7149 |
-
steelblue: "4682b4",
|
7150 |
-
tan: "d2b48c",
|
7151 |
-
teal: "008080",
|
7152 |
-
thistle: "d8bfd8",
|
7153 |
-
tomato: "ff6347",
|
7154 |
-
turquoise: "40e0d0",
|
7155 |
-
violet: "ee82ee",
|
7156 |
-
wheat: "f5deb3",
|
7157 |
-
white: "fff",
|
7158 |
-
whitesmoke: "f5f5f5",
|
7159 |
-
yellow: "ff0",
|
7160 |
-
yellowgreen: "9acd32"
|
7161 |
-
};
|
7162 |
-
|
7163 |
-
// Make it easy to access colors via `hexNames[hex]`
|
7164 |
-
var hexNames = tinycolor.hexNames = flip(names);
|
7165 |
-
|
7166 |
-
|
7167 |
-
// Utilities
|
7168 |
-
// ---------
|
7169 |
-
|
7170 |
-
// `{ 'name1': 'val1' }` becomes `{ 'val1': 'name1' }`
|
7171 |
-
function flip(o) {
|
7172 |
-
var flipped = { };
|
7173 |
-
for (var i in o) {
|
7174 |
-
if (o.hasOwnProperty(i)) {
|
7175 |
-
flipped[o[i]] = i;
|
7176 |
-
}
|
7177 |
-
}
|
7178 |
-
return flipped;
|
7179 |
-
}
|
7180 |
-
|
7181 |
-
// Return a valid alpha value [0,1] with all invalid values being set to 1
|
7182 |
-
function boundAlpha(a) {
|
7183 |
-
a = parseFloat(a);
|
7184 |
-
|
7185 |
-
if (isNaN(a) || a < 0 || a > 1) {
|
7186 |
-
a = 1;
|
7187 |
-
}
|
7188 |
-
|
7189 |
-
return a;
|
7190 |
-
}
|
7191 |
-
|
7192 |
-
// Take input from [0, n] and return it as [0, 1]
|
7193 |
-
function bound01(n, max) {
|
7194 |
-
if (isOnePointZero(n)) { n = "100%"; }
|
7195 |
-
|
7196 |
-
var processPercent = isPercentage(n);
|
7197 |
-
n = mathMin(max, mathMax(0, parseFloat(n)));
|
7198 |
-
|
7199 |
-
// Automatically convert percentage into number
|
7200 |
-
if (processPercent) {
|
7201 |
-
n = parseInt(n * max, 10) / 100;
|
7202 |
-
}
|
7203 |
-
|
7204 |
-
// Handle floating point rounding errors
|
7205 |
-
if ((Math.abs(n - max) < 0.000001)) {
|
7206 |
-
return 1;
|
7207 |
-
}
|
7208 |
-
|
7209 |
-
// Convert into [0, 1] range if it isn't already
|
7210 |
-
return (n % max) / parseFloat(max);
|
7211 |
-
}
|
7212 |
-
|
7213 |
-
// Force a number between 0 and 1
|
7214 |
-
function clamp01(val) {
|
7215 |
-
return mathMin(1, mathMax(0, val));
|
7216 |
-
}
|
7217 |
-
|
7218 |
-
// Parse a base-16 hex value into a base-10 integer
|
7219 |
-
function parseIntFromHex(val) {
|
7220 |
-
return parseInt(val, 16);
|
7221 |
-
}
|
7222 |
-
|
7223 |
-
// Need to handle 1.0 as 100%, since once it is a number, there is no difference between it and 1
|
7224 |
-
// <http://stackoverflow.com/questions/7422072/javascript-how-to-detect-number-as-a-decimal-including-1-0>
|
7225 |
-
function isOnePointZero(n) {
|
7226 |
-
return typeof n == "string" && n.indexOf('.') != -1 && parseFloat(n) === 1;
|
7227 |
-
}
|
7228 |
-
|
7229 |
-
// Check to see if string passed in is a percentage
|
7230 |
-
function isPercentage(n) {
|
7231 |
-
return typeof n === "string" && n.indexOf('%') != -1;
|
7232 |
-
}
|
7233 |
-
|
7234 |
-
// Force a hex value to have 2 characters
|
7235 |
-
function pad2(c) {
|
7236 |
-
return c.length == 1 ? '0' + c : '' + c;
|
7237 |
-
}
|
7238 |
-
|
7239 |
-
// Replace a decimal with it's percentage value
|
7240 |
-
function convertToPercentage(n) {
|
7241 |
-
if (n <= 1) {
|
7242 |
-
n = (n * 100) + "%";
|
7243 |
-
}
|
7244 |
-
|
7245 |
-
return n;
|
7246 |
-
}
|
7247 |
-
|
7248 |
-
// Converts a decimal to a hex value
|
7249 |
-
function convertDecimalToHex(d) {
|
7250 |
-
return Math.round(parseFloat(d) * 255).toString(16);
|
7251 |
-
}
|
7252 |
-
// Converts a hex value to a decimal
|
7253 |
-
function convertHexToDecimal(h) {
|
7254 |
-
return (parseIntFromHex(h) / 255);
|
7255 |
-
}
|
7256 |
-
|
7257 |
-
var matchers = (function() {
|
7258 |
-
|
7259 |
-
// <http://www.w3.org/TR/css3-values/#integers>
|
7260 |
-
var CSS_INTEGER = "[-\\+]?\\d+%?";
|
7261 |
-
|
7262 |
-
// <http://www.w3.org/TR/css3-values/#number-value>
|
7263 |
-
var CSS_NUMBER = "[-\\+]?\\d*\\.\\d+%?";
|
7264 |
-
|
7265 |
-
// Allow positive/negative integer/number. Don't capture the either/or, just the entire outcome.
|
7266 |
-
var CSS_UNIT = "(?:" + CSS_NUMBER + ")|(?:" + CSS_INTEGER + ")";
|
7267 |
-
|
7268 |
-
// Actual matching.
|
7269 |
-
// Parentheses and commas are optional, but not required.
|
7270 |
-
// Whitespace can take the place of commas or opening paren
|
7271 |
-
var PERMISSIVE_MATCH3 = "[\\s|\\(]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")\\s*\\)?";
|
7272 |
-
var PERMISSIVE_MATCH4 = "[\\s|\\(]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")\\s*\\)?";
|
7273 |
-
|
7274 |
-
return {
|
7275 |
-
CSS_UNIT: new RegExp(CSS_UNIT),
|
7276 |
-
rgb: new RegExp("rgb" + PERMISSIVE_MATCH3),
|
7277 |
-
rgba: new RegExp("rgba" + PERMISSIVE_MATCH4),
|
7278 |
-
hsl: new RegExp("hsl" + PERMISSIVE_MATCH3),
|
7279 |
-
hsla: new RegExp("hsla" + PERMISSIVE_MATCH4),
|
7280 |
-
hsv: new RegExp("hsv" + PERMISSIVE_MATCH3),
|
7281 |
-
hsva: new RegExp("hsva" + PERMISSIVE_MATCH4),
|
7282 |
-
hex3: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
|
7283 |
-
hex6: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,
|
7284 |
-
hex4: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
|
7285 |
-
hex8: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/
|
7286 |
-
};
|
7287 |
-
})();
|
7288 |
-
|
7289 |
-
// `isValidCSSUnit`
|
7290 |
-
// Take in a single string / number and check to see if it looks like a CSS unit
|
7291 |
-
// (see `matchers` above for definition).
|
7292 |
-
function isValidCSSUnit(color) {
|
7293 |
-
return !!matchers.CSS_UNIT.exec(color);
|
7294 |
-
}
|
7295 |
-
|
7296 |
-
// `stringInputToObject`
|
7297 |
-
// Permissive string parsing. Take in a number of formats, and output an object
|
7298 |
-
// based on detected format. Returns `{ r, g, b }` or `{ h, s, l }` or `{ h, s, v}`
|
7299 |
-
function stringInputToObject(color) {
|
7300 |
-
|
7301 |
-
color = color.replace(trimLeft,'').replace(trimRight, '').toLowerCase();
|
7302 |
-
var named = false;
|
7303 |
-
if (names[color]) {
|
7304 |
-
color = names[color];
|
7305 |
-
named = true;
|
7306 |
-
}
|
7307 |
-
else if (color == 'transparent') {
|
7308 |
-
return { r: 0, g: 0, b: 0, a: 0, format: "name" };
|
7309 |
-
}
|
7310 |
-
|
7311 |
-
// Try to match string input using regular expressions.
|
7312 |
-
// Keep most of the number bounding out of this function - don't worry about [0,1] or [0,100] or [0,360]
|
7313 |
-
// Just return an object and let the conversion functions handle that.
|
7314 |
-
// This way the result will be the same whether the tinycolor is initialized with string or object.
|
7315 |
-
var match;
|
7316 |
-
if ((match = matchers.rgb.exec(color))) {
|
7317 |
-
return { r: match[1], g: match[2], b: match[3] };
|
7318 |
-
}
|
7319 |
-
if ((match = matchers.rgba.exec(color))) {
|
7320 |
-
return { r: match[1], g: match[2], b: match[3], a: match[4] };
|
7321 |
-
}
|
7322 |
-
if ((match = matchers.hsl.exec(color))) {
|
7323 |
-
return { h: match[1], s: match[2], l: match[3] };
|
7324 |
-
}
|
7325 |
-
if ((match = matchers.hsla.exec(color))) {
|
7326 |
-
return { h: match[1], s: match[2], l: match[3], a: match[4] };
|
7327 |
-
}
|
7328 |
-
if ((match = matchers.hsv.exec(color))) {
|
7329 |
-
return { h: match[1], s: match[2], v: match[3] };
|
7330 |
-
}
|
7331 |
-
if ((match = matchers.hsva.exec(color))) {
|
7332 |
-
return { h: match[1], s: match[2], v: match[3], a: match[4] };
|
7333 |
-
}
|
7334 |
-
if ((match = matchers.hex8.exec(color))) {
|
7335 |
-
return {
|
7336 |
-
r: parseIntFromHex(match[1]),
|
7337 |
-
g: parseIntFromHex(match[2]),
|
7338 |
-
b: parseIntFromHex(match[3]),
|
7339 |
-
a: convertHexToDecimal(match[4]),
|
7340 |
-
format: named ? "name" : "hex8"
|
7341 |
-
};
|
7342 |
-
}
|
7343 |
-
if ((match = matchers.hex6.exec(color))) {
|
7344 |
-
return {
|
7345 |
-
r: parseIntFromHex(match[1]),
|
7346 |
-
g: parseIntFromHex(match[2]),
|
7347 |
-
b: parseIntFromHex(match[3]),
|
7348 |
-
format: named ? "name" : "hex"
|
7349 |
-
};
|
7350 |
-
}
|
7351 |
-
if ((match = matchers.hex4.exec(color))) {
|
7352 |
-
return {
|
7353 |
-
r: parseIntFromHex(match[1] + '' + match[1]),
|
7354 |
-
g: parseIntFromHex(match[2] + '' + match[2]),
|
7355 |
-
b: parseIntFromHex(match[3] + '' + match[3]),
|
7356 |
-
a: convertHexToDecimal(match[4] + '' + match[4]),
|
7357 |
-
format: named ? "name" : "hex8"
|
7358 |
-
};
|
7359 |
-
}
|
7360 |
-
if ((match = matchers.hex3.exec(color))) {
|
7361 |
-
return {
|
7362 |
-
r: parseIntFromHex(match[1] + '' + match[1]),
|
7363 |
-
g: parseIntFromHex(match[2] + '' + match[2]),
|
7364 |
-
b: parseIntFromHex(match[3] + '' + match[3]),
|
7365 |
-
format: named ? "name" : "hex"
|
7366 |
-
};
|
7367 |
-
}
|
7368 |
-
|
7369 |
-
return false;
|
7370 |
-
}
|
7371 |
-
|
7372 |
-
function validateWCAG2Parms(parms) {
|
7373 |
-
// return valid WCAG2 parms for isReadable.
|
7374 |
-
// If input parms are invalid, return {"level":"AA", "size":"small"}
|
7375 |
-
var level, size;
|
7376 |
-
parms = parms || {"level":"AA", "size":"small"};
|
7377 |
-
level = (parms.level || "AA").toUpperCase();
|
7378 |
-
size = (parms.size || "small").toLowerCase();
|
7379 |
-
if (level !== "AA" && level !== "AAA") {
|
7380 |
-
level = "AA";
|
7381 |
-
}
|
7382 |
-
if (size !== "small" && size !== "large") {
|
7383 |
-
size = "small";
|
7384 |
-
}
|
7385 |
-
return {"level":level, "size":size};
|
7386 |
-
}
|
7387 |
-
|
7388 |
-
// Node: Export function
|
7389 |
-
if ( true && module.exports) {
|
7390 |
-
module.exports = tinycolor;
|
7391 |
-
}
|
7392 |
-
// AMD/requirejs: Define the module
|
7393 |
-
else if (typeof define === 'function' && define.amd) {
|
7394 |
-
define(function () {return tinycolor;});
|
7395 |
-
}
|
7396 |
-
// Browser: Expose to window
|
7397 |
-
else {
|
7398 |
-
window.tinycolor = tinycolor;
|
7399 |
-
}
|
7400 |
-
|
7401 |
-
})(Math);
|
7402 |
-
|
7403 |
-
|
7404 |
-
/***/ }),
|
7405 |
-
|
7406 |
-
/***/ 162:
|
7407 |
-
/***/ (function(module, exports) {
|
7408 |
-
|
7409 |
-
function _setPrototypeOf(o, p) {
|
7410 |
-
module.exports = _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
|
7411 |
-
o.__proto__ = p;
|
7412 |
-
return o;
|
7413 |
-
};
|
7414 |
-
|
7415 |
-
return _setPrototypeOf(o, p);
|
7416 |
-
}
|
7417 |
-
|
7418 |
-
module.exports = _setPrototypeOf;
|
7419 |
-
|
7420 |
-
/***/ }),
|
7421 |
-
|
7422 |
-
/***/ 163:
|
7423 |
-
/***/ (function(module, exports, __webpack_require__) {
|
7424 |
-
|
7425 |
-
"use strict";
|
7426 |
-
|
7427 |
-
|
7428 |
-
var utils = __webpack_require__(92);
|
7429 |
-
var formats = __webpack_require__(115);
|
7430 |
-
var has = Object.prototype.hasOwnProperty;
|
7431 |
-
|
7432 |
-
var arrayPrefixGenerators = {
|
7433 |
-
brackets: function brackets(prefix) {
|
7434 |
-
return prefix + '[]';
|
7435 |
-
},
|
7436 |
-
comma: 'comma',
|
7437 |
-
indices: function indices(prefix, key) {
|
7438 |
-
return prefix + '[' + key + ']';
|
7439 |
-
},
|
7440 |
-
repeat: function repeat(prefix) {
|
7441 |
-
return prefix;
|
7442 |
-
}
|
7443 |
-
};
|
7444 |
-
|
7445 |
-
var isArray = Array.isArray;
|
7446 |
-
var push = Array.prototype.push;
|
7447 |
-
var pushToArray = function (arr, valueOrArray) {
|
7448 |
-
push.apply(arr, isArray(valueOrArray) ? valueOrArray : [valueOrArray]);
|
7449 |
-
};
|
7450 |
-
|
7451 |
-
var toISO = Date.prototype.toISOString;
|
7452 |
-
|
7453 |
-
var defaultFormat = formats['default'];
|
7454 |
-
var defaults = {
|
7455 |
-
addQueryPrefix: false,
|
7456 |
-
allowDots: false,
|
7457 |
-
charset: 'utf-8',
|
7458 |
-
charsetSentinel: false,
|
7459 |
-
delimiter: '&',
|
7460 |
-
encode: true,
|
7461 |
-
encoder: utils.encode,
|
7462 |
-
encodeValuesOnly: false,
|
7463 |
-
format: defaultFormat,
|
7464 |
-
formatter: formats.formatters[defaultFormat],
|
7465 |
-
// deprecated
|
7466 |
-
indices: false,
|
7467 |
-
serializeDate: function serializeDate(date) {
|
7468 |
-
return toISO.call(date);
|
7469 |
-
},
|
7470 |
-
skipNulls: false,
|
7471 |
-
strictNullHandling: false
|
7472 |
-
};
|
7473 |
-
|
7474 |
-
var isNonNullishPrimitive = function isNonNullishPrimitive(v) {
|
7475 |
-
return typeof v === 'string'
|
7476 |
-
|| typeof v === 'number'
|
7477 |
-
|| typeof v === 'boolean'
|
7478 |
-
|| typeof v === 'symbol'
|
7479 |
-
|| typeof v === 'bigint';
|
7480 |
-
};
|
7481 |
-
|
7482 |
-
var stringify = function stringify(
|
7483 |
-
object,
|
7484 |
-
prefix,
|
7485 |
-
generateArrayPrefix,
|
7486 |
-
strictNullHandling,
|
7487 |
-
skipNulls,
|
7488 |
-
encoder,
|
7489 |
-
filter,
|
7490 |
-
sort,
|
7491 |
-
allowDots,
|
7492 |
-
serializeDate,
|
7493 |
-
formatter,
|
7494 |
-
encodeValuesOnly,
|
7495 |
-
charset
|
7496 |
-
) {
|
7497 |
-
var obj = object;
|
7498 |
-
if (typeof filter === 'function') {
|
7499 |
-
obj = filter(prefix, obj);
|
7500 |
-
} else if (obj instanceof Date) {
|
7501 |
-
obj = serializeDate(obj);
|
7502 |
-
} else if (generateArrayPrefix === 'comma' && isArray(obj)) {
|
7503 |
-
obj = utils.maybeMap(obj, function (value) {
|
7504 |
-
if (value instanceof Date) {
|
7505 |
-
return serializeDate(value);
|
7506 |
-
}
|
7507 |
-
return value;
|
7508 |
-
}).join(',');
|
7509 |
-
}
|
7510 |
-
|
7511 |
-
if (obj === null) {
|
7512 |
-
if (strictNullHandling) {
|
7513 |
-
return encoder && !encodeValuesOnly ? encoder(prefix, defaults.encoder, charset, 'key') : prefix;
|
7514 |
-
}
|
7515 |
-
|
7516 |
-
obj = '';
|
7517 |
-
}
|
7518 |
-
|
7519 |
-
if (isNonNullishPrimitive(obj) || utils.isBuffer(obj)) {
|
7520 |
-
if (encoder) {
|
7521 |
-
var keyValue = encodeValuesOnly ? prefix : encoder(prefix, defaults.encoder, charset, 'key');
|
7522 |
-
return [formatter(keyValue) + '=' + formatter(encoder(obj, defaults.encoder, charset, 'value'))];
|
7523 |
-
}
|
7524 |
-
return [formatter(prefix) + '=' + formatter(String(obj))];
|
7525 |
-
}
|
7526 |
-
|
7527 |
-
var values = [];
|
7528 |
-
|
7529 |
-
if (typeof obj === 'undefined') {
|
7530 |
-
return values;
|
7531 |
-
}
|
7532 |
-
|
7533 |
-
var objKeys;
|
7534 |
-
if (isArray(filter)) {
|
7535 |
-
objKeys = filter;
|
7536 |
-
} else {
|
7537 |
-
var keys = Object.keys(obj);
|
7538 |
-
objKeys = sort ? keys.sort(sort) : keys;
|
7539 |
-
}
|
7540 |
-
|
7541 |
-
for (var i = 0; i < objKeys.length; ++i) {
|
7542 |
-
var key = objKeys[i];
|
7543 |
-
var value = obj[key];
|
7544 |
-
|
7545 |
-
if (skipNulls && value === null) {
|
7546 |
-
continue;
|
7547 |
-
}
|
7548 |
-
|
7549 |
-
var keyPrefix = isArray(obj)
|
7550 |
-
? typeof generateArrayPrefix === 'function' ? generateArrayPrefix(prefix, key) : prefix
|
7551 |
-
: prefix + (allowDots ? '.' + key : '[' + key + ']');
|
7552 |
-
|
7553 |
-
pushToArray(values, stringify(
|
7554 |
-
value,
|
7555 |
-
keyPrefix,
|
7556 |
-
generateArrayPrefix,
|
7557 |
-
strictNullHandling,
|
7558 |
-
skipNulls,
|
7559 |
-
encoder,
|
7560 |
-
filter,
|
7561 |
-
sort,
|
7562 |
-
allowDots,
|
7563 |
-
serializeDate,
|
7564 |
-
formatter,
|
7565 |
-
encodeValuesOnly,
|
7566 |
-
charset
|
7567 |
-
));
|
7568 |
-
}
|
7569 |
-
|
7570 |
-
return values;
|
7571 |
-
};
|
7572 |
-
|
7573 |
-
var normalizeStringifyOptions = function normalizeStringifyOptions(opts) {
|
7574 |
-
if (!opts) {
|
7575 |
-
return defaults;
|
7576 |
-
}
|
7577 |
-
|
7578 |
-
if (opts.encoder !== null && opts.encoder !== undefined && typeof opts.encoder !== 'function') {
|
7579 |
-
throw new TypeError('Encoder has to be a function.');
|
7580 |
-
}
|
7581 |
-
|
7582 |
-
var charset = opts.charset || defaults.charset;
|
7583 |
-
if (typeof opts.charset !== 'undefined' && opts.charset !== 'utf-8' && opts.charset !== 'iso-8859-1') {
|
7584 |
-
throw new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined');
|
7585 |
-
}
|
7586 |
-
|
7587 |
-
var format = formats['default'];
|
7588 |
-
if (typeof opts.format !== 'undefined') {
|
7589 |
-
if (!has.call(formats.formatters, opts.format)) {
|
7590 |
-
throw new TypeError('Unknown format option provided.');
|
7591 |
-
}
|
7592 |
-
format = opts.format;
|
7593 |
-
}
|
7594 |
-
var formatter = formats.formatters[format];
|
7595 |
-
|
7596 |
-
var filter = defaults.filter;
|
7597 |
-
if (typeof opts.filter === 'function' || isArray(opts.filter)) {
|
7598 |
-
filter = opts.filter;
|
7599 |
-
}
|
7600 |
-
|
7601 |
-
return {
|
7602 |
-
addQueryPrefix: typeof opts.addQueryPrefix === 'boolean' ? opts.addQueryPrefix : defaults.addQueryPrefix,
|
7603 |
-
allowDots: typeof opts.allowDots === 'undefined' ? defaults.allowDots : !!opts.allowDots,
|
7604 |
-
charset: charset,
|
7605 |
-
charsetSentinel: typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults.charsetSentinel,
|
7606 |
-
delimiter: typeof opts.delimiter === 'undefined' ? defaults.delimiter : opts.delimiter,
|
7607 |
-
encode: typeof opts.encode === 'boolean' ? opts.encode : defaults.encode,
|
7608 |
-
encoder: typeof opts.encoder === 'function' ? opts.encoder : defaults.encoder,
|
7609 |
-
encodeValuesOnly: typeof opts.encodeValuesOnly === 'boolean' ? opts.encodeValuesOnly : defaults.encodeValuesOnly,
|
7610 |
-
filter: filter,
|
7611 |
-
formatter: formatter,
|
7612 |
-
serializeDate: typeof opts.serializeDate === 'function' ? opts.serializeDate : defaults.serializeDate,
|
7613 |
-
skipNulls: typeof opts.skipNulls === 'boolean' ? opts.skipNulls : defaults.skipNulls,
|
7614 |
-
sort: typeof opts.sort === 'function' ? opts.sort : null,
|
7615 |
-
strictNullHandling: typeof opts.strictNullHandling === 'boolean' ? opts.strictNullHandling : defaults.strictNullHandling
|
7616 |
-
};
|
7617 |
-
};
|
7618 |
-
|
7619 |
-
module.exports = function (object, opts) {
|
7620 |
-
var obj = object;
|
7621 |
-
var options = normalizeStringifyOptions(opts);
|
7622 |
-
|
7623 |
-
var objKeys;
|
7624 |
-
var filter;
|
7625 |
-
|
7626 |
-
if (typeof options.filter === 'function') {
|
7627 |
-
filter = options.filter;
|
7628 |
-
obj = filter('', obj);
|
7629 |
-
} else if (isArray(options.filter)) {
|
7630 |
-
filter = options.filter;
|
7631 |
-
objKeys = filter;
|
7632 |
-
}
|
7633 |
-
|
7634 |
-
var keys = [];
|
7635 |
-
|
7636 |
-
if (typeof obj !== 'object' || obj === null) {
|
7637 |
-
return '';
|
7638 |
-
}
|
7639 |
-
|
7640 |
-
var arrayFormat;
|
7641 |
-
if (opts && opts.arrayFormat in arrayPrefixGenerators) {
|
7642 |
-
arrayFormat = opts.arrayFormat;
|
7643 |
-
} else if (opts && 'indices' in opts) {
|
7644 |
-
arrayFormat = opts.indices ? 'indices' : 'repeat';
|
7645 |
-
} else {
|
7646 |
-
arrayFormat = 'indices';
|
7647 |
-
}
|
7648 |
-
|
7649 |
-
var generateArrayPrefix = arrayPrefixGenerators[arrayFormat];
|
7650 |
-
|
7651 |
-
if (!objKeys) {
|
7652 |
-
objKeys = Object.keys(obj);
|
7653 |
-
}
|
7654 |
-
|
7655 |
-
if (options.sort) {
|
7656 |
-
objKeys.sort(options.sort);
|
7657 |
-
}
|
7658 |
-
|
7659 |
-
for (var i = 0; i < objKeys.length; ++i) {
|
7660 |
-
var key = objKeys[i];
|
7661 |
-
|
7662 |
-
if (options.skipNulls && obj[key] === null) {
|
7663 |
-
continue;
|
7664 |
-
}
|
7665 |
-
pushToArray(keys, stringify(
|
7666 |
-
obj[key],
|
7667 |
-
key,
|
7668 |
-
generateArrayPrefix,
|
7669 |
-
options.strictNullHandling,
|
7670 |
-
options.skipNulls,
|
7671 |
-
options.encode ? options.encoder : null,
|
7672 |
-
options.filter,
|
7673 |
-
options.sort,
|
7674 |
-
options.allowDots,
|
7675 |
-
options.serializeDate,
|
7676 |
-
options.formatter,
|
7677 |
-
options.encodeValuesOnly,
|
7678 |
-
options.charset
|
7679 |
-
));
|
7680 |
-
}
|
7681 |
-
|
7682 |
-
var joined = keys.join(options.delimiter);
|
7683 |
-
var prefix = options.addQueryPrefix === true ? '?' : '';
|
7684 |
-
|
7685 |
-
if (options.charsetSentinel) {
|
7686 |
-
if (options.charset === 'iso-8859-1') {
|
7687 |
-
// encodeURIComponent('✓'), the "numeric entity" representation of a checkmark
|
7688 |
-
prefix += 'utf8=%26%2310003%3B&';
|
7689 |
-
} else {
|
7690 |
-
// encodeURIComponent('✓')
|
7691 |
-
prefix += 'utf8=%E2%9C%93&';
|
7692 |
-
}
|
7693 |
-
}
|
7694 |
-
|
7695 |
-
return joined.length > 0 ? prefix + joined : '';
|
7696 |
-
};
|
7697 |
-
|
7698 |
-
|
7699 |
-
/***/ }),
|
7700 |
-
|
7701 |
-
/***/ 164:
|
7702 |
-
/***/ (function(module, exports, __webpack_require__) {
|
7703 |
-
|
7704 |
-
"use strict";
|
7705 |
-
|
7706 |
-
|
7707 |
-
var utils = __webpack_require__(92);
|
7708 |
-
|
7709 |
-
var has = Object.prototype.hasOwnProperty;
|
7710 |
-
var isArray = Array.isArray;
|
7711 |
-
|
7712 |
-
var defaults = {
|
7713 |
-
allowDots: false,
|
7714 |
-
allowPrototypes: false,
|
7715 |
-
arrayLimit: 20,
|
7716 |
-
charset: 'utf-8',
|
7717 |
-
charsetSentinel: false,
|
7718 |
-
comma: false,
|
7719 |
-
decoder: utils.decode,
|
7720 |
-
delimiter: '&',
|
7721 |
-
depth: 5,
|
7722 |
-
ignoreQueryPrefix: false,
|
7723 |
-
interpretNumericEntities: false,
|
7724 |
-
parameterLimit: 1000,
|
7725 |
-
parseArrays: true,
|
7726 |
-
plainObjects: false,
|
7727 |
-
strictNullHandling: false
|
7728 |
-
};
|
7729 |
-
|
7730 |
-
var interpretNumericEntities = function (str) {
|
7731 |
-
return str.replace(/&#(\d+);/g, function ($0, numberStr) {
|
7732 |
-
return String.fromCharCode(parseInt(numberStr, 10));
|
7733 |
-
});
|
7734 |
-
};
|
7735 |
-
|
7736 |
-
var parseArrayValue = function (val, options) {
|
7737 |
-
if (val && typeof val === 'string' && options.comma && val.indexOf(',') > -1) {
|
7738 |
-
return val.split(',');
|
7739 |
-
}
|
7740 |
-
|
7741 |
-
return val;
|
7742 |
-
};
|
7743 |
-
|
7744 |
-
// This is what browsers will submit when the ✓ character occurs in an
|
7745 |
-
// application/x-www-form-urlencoded body and the encoding of the page containing
|
7746 |
-
// the form is iso-8859-1, or when the submitted form has an accept-charset
|
7747 |
-
// attribute of iso-8859-1. Presumably also with other charsets that do not contain
|
7748 |
-
// the ✓ character, such as us-ascii.
|
7749 |
-
var isoSentinel = 'utf8=%26%2310003%3B'; // encodeURIComponent('✓')
|
7750 |
-
|
7751 |
-
// These are the percent-encoded utf-8 octets representing a checkmark, indicating that the request actually is utf-8 encoded.
|
7752 |
-
var charsetSentinel = 'utf8=%E2%9C%93'; // encodeURIComponent('✓')
|
7753 |
-
|
7754 |
-
var parseValues = function parseQueryStringValues(str, options) {
|
7755 |
-
var obj = {};
|
7756 |
-
var cleanStr = options.ignoreQueryPrefix ? str.replace(/^\?/, '') : str;
|
7757 |
-
var limit = options.parameterLimit === Infinity ? undefined : options.parameterLimit;
|
7758 |
-
var parts = cleanStr.split(options.delimiter, limit);
|
7759 |
-
var skipIndex = -1; // Keep track of where the utf8 sentinel was found
|
7760 |
-
var i;
|
7761 |
-
|
7762 |
-
var charset = options.charset;
|
7763 |
-
if (options.charsetSentinel) {
|
7764 |
-
for (i = 0; i < parts.length; ++i) {
|
7765 |
-
if (parts[i].indexOf('utf8=') === 0) {
|
7766 |
-
if (parts[i] === charsetSentinel) {
|
7767 |
-
charset = 'utf-8';
|
7768 |
-
} else if (parts[i] === isoSentinel) {
|
7769 |
-
charset = 'iso-8859-1';
|
7770 |
-
}
|
7771 |
-
skipIndex = i;
|
7772 |
-
i = parts.length; // The eslint settings do not allow break;
|
7773 |
-
}
|
7774 |
-
}
|
7775 |
-
}
|
7776 |
-
|
7777 |
-
for (i = 0; i < parts.length; ++i) {
|
7778 |
-
if (i === skipIndex) {
|
7779 |
-
continue;
|
7780 |
-
}
|
7781 |
-
var part = parts[i];
|
7782 |
-
|
7783 |
-
var bracketEqualsPos = part.indexOf(']=');
|
7784 |
-
var pos = bracketEqualsPos === -1 ? part.indexOf('=') : bracketEqualsPos + 1;
|
7785 |
-
|
7786 |
-
var key, val;
|
7787 |
-
if (pos === -1) {
|
7788 |
-
key = options.decoder(part, defaults.decoder, charset, 'key');
|
7789 |
-
val = options.strictNullHandling ? null : '';
|
7790 |
-
} else {
|
7791 |
-
key = options.decoder(part.slice(0, pos), defaults.decoder, charset, 'key');
|
7792 |
-
val = utils.maybeMap(
|
7793 |
-
parseArrayValue(part.slice(pos + 1), options),
|
7794 |
-
function (encodedVal) {
|
7795 |
-
return options.decoder(encodedVal, defaults.decoder, charset, 'value');
|
7796 |
-
}
|
7797 |
-
);
|
7798 |
-
}
|
7799 |
-
|
7800 |
-
if (val && options.interpretNumericEntities && charset === 'iso-8859-1') {
|
7801 |
-
val = interpretNumericEntities(val);
|
7802 |
-
}
|
7803 |
-
|
7804 |
-
if (part.indexOf('[]=') > -1) {
|
7805 |
-
val = isArray(val) ? [val] : val;
|
7806 |
-
}
|
7807 |
-
|
7808 |
-
if (has.call(obj, key)) {
|
7809 |
-
obj[key] = utils.combine(obj[key], val);
|
7810 |
-
} else {
|
7811 |
-
obj[key] = val;
|
7812 |
-
}
|
7813 |
-
}
|
7814 |
-
|
7815 |
-
return obj;
|
7816 |
-
};
|
7817 |
-
|
7818 |
-
var parseObject = function (chain, val, options, valuesParsed) {
|
7819 |
-
var leaf = valuesParsed ? val : parseArrayValue(val, options);
|
7820 |
-
|
7821 |
-
for (var i = chain.length - 1; i >= 0; --i) {
|
7822 |
-
var obj;
|
7823 |
-
var root = chain[i];
|
7824 |
-
|
7825 |
-
if (root === '[]' && options.parseArrays) {
|
7826 |
-
obj = [].concat(leaf);
|
7827 |
-
} else {
|
7828 |
-
obj = options.plainObjects ? Object.create(null) : {};
|
7829 |
-
var cleanRoot = root.charAt(0) === '[' && root.charAt(root.length - 1) === ']' ? root.slice(1, -1) : root;
|
7830 |
-
var index = parseInt(cleanRoot, 10);
|
7831 |
-
if (!options.parseArrays && cleanRoot === '') {
|
7832 |
-
obj = { 0: leaf };
|
7833 |
-
} else if (
|
7834 |
-
!isNaN(index)
|
7835 |
-
&& root !== cleanRoot
|
7836 |
-
&& String(index) === cleanRoot
|
7837 |
-
&& index >= 0
|
7838 |
-
&& (options.parseArrays && index <= options.arrayLimit)
|
7839 |
-
) {
|
7840 |
-
obj = [];
|
7841 |
-
obj[index] = leaf;
|
7842 |
-
} else {
|
7843 |
-
obj[cleanRoot] = leaf;
|
7844 |
-
}
|
7845 |
-
}
|
7846 |
-
|
7847 |
-
leaf = obj; // eslint-disable-line no-param-reassign
|
7848 |
-
}
|
7849 |
-
|
7850 |
-
return leaf;
|
7851 |
-
};
|
7852 |
-
|
7853 |
-
var parseKeys = function parseQueryStringKeys(givenKey, val, options, valuesParsed) {
|
7854 |
-
if (!givenKey) {
|
7855 |
-
return;
|
7856 |
-
}
|
7857 |
-
|
7858 |
-
// Transform dot notation to bracket notation
|
7859 |
-
var key = options.allowDots ? givenKey.replace(/\.([^.[]+)/g, '[$1]') : givenKey;
|
7860 |
-
|
7861 |
-
// The regex chunks
|
7862 |
-
|
7863 |
-
var brackets = /(\[[^[\]]*])/;
|
7864 |
-
var child = /(\[[^[\]]*])/g;
|
7865 |
-
|
7866 |
-
// Get the parent
|
7867 |
-
|
7868 |
-
var segment = options.depth > 0 && brackets.exec(key);
|
7869 |
-
var parent = segment ? key.slice(0, segment.index) : key;
|
7870 |
-
|
7871 |
-
// Stash the parent if it exists
|
7872 |
-
|
7873 |
-
var keys = [];
|
7874 |
-
if (parent) {
|
7875 |
-
// If we aren't using plain objects, optionally prefix keys that would overwrite object prototype properties
|
7876 |
-
if (!options.plainObjects && has.call(Object.prototype, parent)) {
|
7877 |
-
if (!options.allowPrototypes) {
|
7878 |
-
return;
|
7879 |
-
}
|
7880 |
-
}
|
7881 |
-
|
7882 |
-
keys.push(parent);
|
7883 |
-
}
|
7884 |
-
|
7885 |
-
// Loop through children appending to the array until we hit depth
|
7886 |
-
|
7887 |
-
var i = 0;
|
7888 |
-
while (options.depth > 0 && (segment = child.exec(key)) !== null && i < options.depth) {
|
7889 |
-
i += 1;
|
7890 |
-
if (!options.plainObjects && has.call(Object.prototype, segment[1].slice(1, -1))) {
|
7891 |
-
if (!options.allowPrototypes) {
|
7892 |
-
return;
|
7893 |
-
}
|
7894 |
-
}
|
7895 |
-
keys.push(segment[1]);
|
7896 |
-
}
|
7897 |
-
|
7898 |
-
// If there's a remainder, just add whatever is left
|
7899 |
-
|
7900 |
-
if (segment) {
|
7901 |
-
keys.push('[' + key.slice(segment.index) + ']');
|
7902 |
-
}
|
7903 |
-
|
7904 |
-
return parseObject(keys, val, options, valuesParsed);
|
7905 |
-
};
|
7906 |
-
|
7907 |
-
var normalizeParseOptions = function normalizeParseOptions(opts) {
|
7908 |
-
if (!opts) {
|
7909 |
-
return defaults;
|
7910 |
-
}
|
7911 |
-
|
7912 |
-
if (opts.decoder !== null && opts.decoder !== undefined && typeof opts.decoder !== 'function') {
|
7913 |
-
throw new TypeError('Decoder has to be a function.');
|
7914 |
-
}
|
7915 |
-
|
7916 |
-
if (typeof opts.charset !== 'undefined' && opts.charset !== 'utf-8' && opts.charset !== 'iso-8859-1') {
|
7917 |
-
throw new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined');
|
7918 |
-
}
|
7919 |
-
var charset = typeof opts.charset === 'undefined' ? defaults.charset : opts.charset;
|
7920 |
-
|
7921 |
-
return {
|
7922 |
-
allowDots: typeof opts.allowDots === 'undefined' ? defaults.allowDots : !!opts.allowDots,
|
7923 |
-
allowPrototypes: typeof opts.allowPrototypes === 'boolean' ? opts.allowPrototypes : defaults.allowPrototypes,
|
7924 |
-
arrayLimit: typeof opts.arrayLimit === 'number' ? opts.arrayLimit : defaults.arrayLimit,
|
7925 |
-
charset: charset,
|
7926 |
-
charsetSentinel: typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults.charsetSentinel,
|
7927 |
-
comma: typeof opts.comma === 'boolean' ? opts.comma : defaults.comma,
|
7928 |
-
decoder: typeof opts.decoder === 'function' ? opts.decoder : defaults.decoder,
|
7929 |
-
delimiter: typeof opts.delimiter === 'string' || utils.isRegExp(opts.delimiter) ? opts.delimiter : defaults.delimiter,
|
7930 |
-
// eslint-disable-next-line no-implicit-coercion, no-extra-parens
|
7931 |
-
depth: (typeof opts.depth === 'number' || opts.depth === false) ? +opts.depth : defaults.depth,
|
7932 |
-
ignoreQueryPrefix: opts.ignoreQueryPrefix === true,
|
7933 |
-
interpretNumericEntities: typeof opts.interpretNumericEntities === 'boolean' ? opts.interpretNumericEntities : defaults.interpretNumericEntities,
|
7934 |
-
parameterLimit: typeof opts.parameterLimit === 'number' ? opts.parameterLimit : defaults.parameterLimit,
|
7935 |
-
parseArrays: opts.parseArrays !== false,
|
7936 |
-
plainObjects: typeof opts.plainObjects === 'boolean' ? opts.plainObjects : defaults.plainObjects,
|
7937 |
-
strictNullHandling: typeof opts.strictNullHandling === 'boolean' ? opts.strictNullHandling : defaults.strictNullHandling
|
7938 |
-
};
|
7939 |
-
};
|
7940 |
-
|
7941 |
-
module.exports = function (str, opts) {
|
7942 |
-
var options = normalizeParseOptions(opts);
|
7943 |
-
|
7944 |
-
if (str === '' || str === null || typeof str === 'undefined') {
|
7945 |
-
return options.plainObjects ? Object.create(null) : {};
|
7946 |
-
}
|
7947 |
-
|
7948 |
-
var tempObj = typeof str === 'string' ? parseValues(str, options) : str;
|
7949 |
-
var obj = options.plainObjects ? Object.create(null) : {};
|
7950 |
-
|
7951 |
-
// Iterate over the keys and setup the new object
|
7952 |
-
|
7953 |
-
var keys = Object.keys(tempObj);
|
7954 |
-
for (var i = 0; i < keys.length; ++i) {
|
7955 |
-
var key = keys[i];
|
7956 |
-
var newObj = parseKeys(key, tempObj[key], options, typeof str === 'string');
|
7957 |
-
obj = utils.merge(obj, newObj, options);
|
7958 |
-
}
|
7959 |
-
|
7960 |
-
return utils.compact(obj);
|
7961 |
-
};
|
7962 |
-
|
7963 |
-
|
7964 |
-
/***/ }),
|
7965 |
-
|
7966 |
-
/***/ 17:
|
7967 |
-
/***/ (function(module, exports) {
|
7968 |
-
|
7969 |
-
function _classCallCheck(instance, Constructor) {
|
7970 |
-
if (!(instance instanceof Constructor)) {
|
7971 |
-
throw new TypeError("Cannot call a class as a function");
|
7972 |
-
}
|
7973 |
-
}
|
7974 |
-
|
7975 |
-
module.exports = _classCallCheck;
|
7976 |
-
|
7977 |
-
/***/ }),
|
7978 |
-
|
7979 |
-
/***/ 18:
|
7980 |
-
/***/ (function(module, exports, __webpack_require__) {
|
7981 |
-
|
7982 |
-
var setPrototypeOf = __webpack_require__(162);
|
7983 |
-
|
7984 |
-
function _inherits(subClass, superClass) {
|
7985 |
-
if (typeof superClass !== "function" && superClass !== null) {
|
7986 |
-
throw new TypeError("Super expression must either be null or a function");
|
7987 |
-
}
|
7988 |
-
|
7989 |
-
subClass.prototype = Object.create(superClass && superClass.prototype, {
|
7990 |
-
constructor: {
|
7991 |
-
value: subClass,
|
7992 |
-
writable: true,
|
7993 |
-
configurable: true
|
7994 |
-
}
|
7995 |
-
});
|
7996 |
-
if (superClass) setPrototypeOf(subClass, superClass);
|
7997 |
-
}
|
7998 |
-
|
7999 |
-
module.exports = _inherits;
|
8000 |
-
|
8001 |
-
/***/ }),
|
8002 |
-
|
8003 |
-
/***/ 189:
|
8004 |
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
8005 |
-
|
8006 |
-
"use strict";
|
8007 |
-
|
8008 |
-
// EXPORTS
|
8009 |
-
__webpack_require__.d(__webpack_exports__, "a", function() { return /* binding */ speak; });
|
8010 |
-
|
8011 |
-
// UNUSED EXPORTS: setup
|
8012 |
-
|
8013 |
-
// EXTERNAL MODULE: ./node_modules/@wordpress/dom-ready/build-module/index.js
|
8014 |
-
var build_module = __webpack_require__(86);
|
8015 |
-
|
8016 |
-
// EXTERNAL MODULE: external {"this":["wp","i18n"]}
|
8017 |
-
var external_this_wp_i18n_ = __webpack_require__(3);
|
8018 |
-
|
8019 |
-
// CONCATENATED MODULE: ./node_modules/@wordpress/a11y/build-module/add-intro-text.js
|
8020 |
-
/**
|
8021 |
-
* WordPress dependencies
|
8022 |
-
*/
|
8023 |
-
|
8024 |
-
/**
|
8025 |
-
* Build the explanatory text to be placed before the aria live regions.
|
8026 |
-
*
|
8027 |
-
* This text is initially hidden from assistive technologies by using a `hidden`
|
8028 |
-
* HTML attribute which is then removed once a message fills the aria-live regions.
|
8029 |
-
*
|
8030 |
-
* @return {HTMLParagraphElement} The explanatory text HTML element.
|
8031 |
-
*/
|
8032 |
-
|
8033 |
-
function addIntroText() {
|
8034 |
-
var introText = document.createElement('p');
|
8035 |
-
introText.id = 'a11y-speak-intro-text';
|
8036 |
-
introText.className = 'a11y-speak-intro-text';
|
8037 |
-
introText.textContent = Object(external_this_wp_i18n_["__"])('Notifications');
|
8038 |
-
introText.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;');
|
8039 |
-
introText.setAttribute('hidden', 'hidden');
|
8040 |
-
var _document = document,
|
8041 |
-
body = _document.body;
|
8042 |
-
|
8043 |
-
if (body) {
|
8044 |
-
body.appendChild(introText);
|
8045 |
-
}
|
8046 |
-
|
8047 |
-
return introText;
|
8048 |
-
}
|
8049 |
-
//# sourceMappingURL=add-intro-text.js.map
|
8050 |
-
// CONCATENATED MODULE: ./node_modules/@wordpress/a11y/build-module/add-container.js
|
8051 |
-
/**
|
8052 |
-
* Build the live regions markup.
|
8053 |
-
*
|
8054 |
-
* @param {string} [ariaLive] Value for the 'aria-live' attribute; default: 'polite'.
|
8055 |
-
*
|
8056 |
-
* @return {HTMLDivElement} The ARIA live region HTML element.
|
8057 |
-
*/
|
8058 |
-
function addContainer() {
|
8059 |
-
var ariaLive = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'polite';
|
8060 |
-
var container = document.createElement('div');
|
8061 |
-
container.id = "a11y-speak-".concat(ariaLive);
|
8062 |
-
container.className = 'a11y-speak-region';
|
8063 |
-
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;');
|
8064 |
-
container.setAttribute('aria-live', ariaLive);
|
8065 |
-
container.setAttribute('aria-relevant', 'additions text');
|
8066 |
-
container.setAttribute('aria-atomic', 'true');
|
8067 |
-
var _document = document,
|
8068 |
-
body = _document.body;
|
8069 |
-
|
8070 |
-
if (body) {
|
8071 |
-
body.appendChild(container);
|
8072 |
-
}
|
8073 |
-
|
8074 |
-
return container;
|
8075 |
-
}
|
8076 |
-
//# sourceMappingURL=add-container.js.map
|
8077 |
-
// CONCATENATED MODULE: ./node_modules/@wordpress/a11y/build-module/clear.js
|
8078 |
-
/**
|
8079 |
-
* Clears the a11y-speak-region elements and hides the explanatory text.
|
8080 |
-
*/
|
8081 |
-
function clear() {
|
8082 |
-
var regions = document.getElementsByClassName('a11y-speak-region');
|
8083 |
-
var introText = document.getElementById('a11y-speak-intro-text');
|
8084 |
-
|
8085 |
-
for (var i = 0; i < regions.length; i++) {
|
8086 |
-
regions[i].textContent = '';
|
8087 |
-
} // Make sure the explanatory text is hidden from assistive technologies.
|
8088 |
-
|
8089 |
-
|
8090 |
-
if (introText) {
|
8091 |
-
introText.setAttribute('hidden', 'hidden');
|
8092 |
-
}
|
8093 |
-
}
|
8094 |
-
//# sourceMappingURL=clear.js.map
|
8095 |
-
// CONCATENATED MODULE: ./node_modules/@wordpress/a11y/build-module/filter-message.js
|
8096 |
-
var previousMessage = '';
|
8097 |
-
/**
|
8098 |
-
* Filter the message to be announced to the screenreader.
|
8099 |
-
*
|
8100 |
-
* @param {string} message The message to be announced.
|
8101 |
-
*
|
8102 |
-
* @return {string} The filtered message.
|
8103 |
-
*/
|
8104 |
-
|
8105 |
-
function filterMessage(message) {
|
8106 |
-
/*
|
8107 |
-
* Strip HTML tags (if any) from the message string. Ideally, messages should
|
8108 |
-
* be simple strings, carefully crafted for specific use with A11ySpeak.
|
8109 |
-
* When re-using already existing strings this will ensure simple HTML to be
|
8110 |
-
* stripped out and replaced with a space. Browsers will collapse multiple
|
8111 |
-
* spaces natively.
|
8112 |
-
*/
|
8113 |
-
message = message.replace(/<[^<>]+>/g, ' ');
|
8114 |
-
/*
|
8115 |
-
* Safari + VoiceOver don't announce repeated, identical strings. We use
|
8116 |
-
* a `no-break space` to force them to think identical strings are different.
|
8117 |
-
*/
|
8118 |
-
|
8119 |
-
if (previousMessage === message) {
|
8120 |
-
message += "\xA0";
|
8121 |
-
}
|
8122 |
-
|
8123 |
-
previousMessage = message;
|
8124 |
-
return message;
|
8125 |
-
}
|
8126 |
-
//# sourceMappingURL=filter-message.js.map
|
8127 |
-
// CONCATENATED MODULE: ./node_modules/@wordpress/a11y/build-module/index.js
|
8128 |
-
/**
|
8129 |
-
* WordPress dependencies
|
8130 |
-
*/
|
8131 |
-
|
8132 |
-
/**
|
8133 |
-
* Internal dependencies
|
8134 |
-
*/
|
8135 |
-
|
8136 |
-
|
8137 |
-
|
8138 |
-
|
8139 |
-
|
8140 |
-
/**
|
8141 |
-
* Create the live regions.
|
8142 |
-
*/
|
8143 |
-
|
8144 |
-
function setup() {
|
8145 |
-
var introText = document.getElementById('a11y-speak-intro-text');
|
8146 |
-
var containerAssertive = document.getElementById('a11y-speak-assertive');
|
8147 |
-
var containerPolite = document.getElementById('a11y-speak-polite');
|
8148 |
-
|
8149 |
-
if (introText === null) {
|
8150 |
-
addIntroText();
|
8151 |
-
}
|
8152 |
-
|
8153 |
-
if (containerAssertive === null) {
|
8154 |
-
addContainer('assertive');
|
8155 |
-
}
|
8156 |
|
8157 |
-
|
8158 |
-
|
8159 |
-
}
|
8160 |
}
|
8161 |
-
/**
|
8162 |
-
* Run setup on domReady.
|
8163 |
-
*/
|
8164 |
|
8165 |
-
|
8166 |
-
|
8167 |
-
|
8168 |
-
|
8169 |
-
|
8170 |
-
|
8171 |
-
|
8172 |
-
|
8173 |
-
|
8174 |
-
|
8175 |
-
|
8176 |
-
|
8177 |
-
|
8178 |
-
|
8179 |
-
|
8180 |
-
|
8181 |
-
|
8182 |
-
|
8183 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8184 |
|
8185 |
-
|
8186 |
-
|
8187 |
-
|
8188 |
-
|
8189 |
-
|
8190 |
-
|
8191 |
-
|
8192 |
-
|
8193 |
-
|
8194 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8195 |
|
8196 |
-
|
8197 |
-
|
8198 |
-
|
8199 |
-
containerPolite.textContent = message;
|
8200 |
-
}
|
8201 |
-
/*
|
8202 |
-
* Make the explanatory text available to assistive technologies by removing
|
8203 |
-
* the 'hidden' HTML attribute.
|
8204 |
-
*/
|
8205 |
|
|
|
|
|
|
|
|
|
|
|
|
|
8206 |
|
8207 |
-
|
8208 |
-
|
8209 |
-
|
8210 |
-
}
|
8211 |
-
//# sourceMappingURL=index.js.map
|
8212 |
|
8213 |
-
|
|
|
|
|
|
|
|
|
8214 |
|
8215 |
-
|
8216 |
-
|
|
|
8217 |
|
8218 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8219 |
|
8220 |
-
|
|
|
|
|
|
|
|
|
8221 |
|
8222 |
-
function
|
8223 |
-
|
8224 |
-
|
8225 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8226 |
|
8227 |
-
|
8228 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8229 |
|
8230 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8231 |
|
8232 |
-
|
|
|
8233 |
|
8234 |
-
|
8235 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8236 |
|
8237 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
8238 |
|
8239 |
-
|
8240 |
-
|
|
|
8241 |
|
8242 |
-
|
8243 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8244 |
|
8245 |
-
|
8246 |
-
|
8247 |
-
|
8248 |
-
|
8249 |
-
var core_browser_esm = __webpack_require__(67);
|
8250 |
|
8251 |
-
|
8252 |
-
/**
|
8253 |
-
* External dependencies
|
8254 |
-
*/
|
8255 |
|
8256 |
-
|
8257 |
-
|
8258 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
8259 |
|
8260 |
|
8261 |
-
|
8262 |
-
|
8263 |
|
8264 |
-
|
8265 |
-
|
8266 |
-
};
|
8267 |
|
8268 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8269 |
}
|
8270 |
|
8271 |
-
|
8272 |
-
|
|
|
|
|
|
|
8273 |
|
8274 |
-
|
8275 |
-
|
8276 |
-
|
8277 |
|
8278 |
-
|
8279 |
-
|
8280 |
|
8281 |
-
|
8282 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8283 |
|
8284 |
-
|
8285 |
-
|
8286 |
-
};
|
8287 |
|
8288 |
-
|
8289 |
}
|
8290 |
|
8291 |
-
|
8292 |
-
|
8293 |
-
|
8294 |
-
|
8295 |
-
|
8296 |
-
|
8297 |
|
8298 |
-
|
8299 |
-
|
|
|
8300 |
|
8301 |
-
function
|
8302 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
8303 |
|
8304 |
-
|
8305 |
-
|
8306 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8307 |
|
8308 |
-
|
8309 |
}
|
8310 |
|
8311 |
-
|
8312 |
-
|
8313 |
-
|
8314 |
-
|
8315 |
-
|
8316 |
-
};
|
8317 |
|
8318 |
-
|
8319 |
-
|
|
|
8320 |
|
8321 |
-
|
8322 |
-
|
8323 |
|
8324 |
-
|
8325 |
-
|
8326 |
-
};
|
8327 |
|
8328 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8329 |
}
|
8330 |
|
8331 |
-
|
8332 |
-
|
|
|
|
|
|
|
8333 |
|
8334 |
-
|
8335 |
-
|
8336 |
-
|
8337 |
|
8338 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8339 |
}
|
8340 |
|
8341 |
-
|
8342 |
-
|
|
|
|
|
|
|
8343 |
|
8344 |
-
|
8345 |
-
|
8346 |
-
|
|
|
|
|
8347 |
|
8348 |
-
|
8349 |
-
|
|
|
|
|
8350 |
|
8351 |
-
|
8352 |
-
|
8353 |
-
*/
|
8354 |
|
|
|
|
|
|
|
|
|
|
|
8355 |
|
8356 |
-
var
|
8357 |
-
|
8358 |
-
|
8359 |
-
|
8360 |
-
|
8361 |
-
|
8362 |
-
var subtitle = "\n\t".concat(fontWeightSemibold, "\n\tfont-size: 14px;\n\tline-height: 20px;\n");
|
8363 |
-
var subtitleLarge = "\n\tfont-size: 16px;\n\tline-height: 24px;\n";
|
8364 |
-
var subtitleSmall = "\n\tfont-size: 14px;\n\tline-height: 20px;\n";
|
8365 |
-
var body = "\n\t".concat(fontWeightNormal, "\n");
|
8366 |
-
var bodyLarge = "\n\tfont-size: 16px;\n\tline-height: 24px;\n";
|
8367 |
-
var bodySmall = "\n\tfont-size: 14px;\n\tline-height: 20px;\n";
|
8368 |
-
var text_mixins_button = "\n ".concat(fontWeightSemibold, "\n font-size: 14px;\n line-height: 20px;\n");
|
8369 |
-
var caption = "\n\t".concat(fontWeightNormal, "\n\tfont-size: 12px;\n\tline-height: 16px;\n");
|
8370 |
-
var label = "\n\t".concat(fontWeightSemibold, "\n\tfont-size: 12px;\n\tline-height: 16px;\n");
|
8371 |
-
/**
|
8372 |
-
* @typedef {'title.large'|'title.medium'|'title.small'|'subtitle'|'subtitle.small'|'body'|'body.large'|'body.small'|'button'|'caption'|'label'} TextVariant
|
8373 |
-
*/
|
8374 |
|
8375 |
-
|
8376 |
-
|
8377 |
-
|
|
|
8378 |
|
8379 |
-
|
8380 |
-
|
8381 |
|
8382 |
-
|
8383 |
-
|
8384 |
-
|
|
|
8385 |
|
8386 |
-
|
8387 |
-
|
|
|
|
|
|
|
|
|
8388 |
|
8389 |
-
|
8390 |
-
|
8391 |
|
8392 |
-
|
8393 |
-
|
|
|
|
|
|
|
|
|
8394 |
|
8395 |
-
|
8396 |
-
|
|
|
|
|
|
|
|
|
|
|
8397 |
|
8398 |
-
case 'body':
|
8399 |
-
return emotion_css(_templateObject6(), body);
|
8400 |
|
8401 |
-
|
8402 |
-
|
|
|
|
|
8403 |
|
8404 |
-
|
8405 |
-
|
|
|
|
|
|
|
|
|
|
|
8406 |
|
8407 |
-
|
8408 |
-
|
|
|
|
|
|
|
|
|
|
|
8409 |
|
8410 |
-
|
8411 |
-
|
|
|
8412 |
|
8413 |
-
|
8414 |
-
|
8415 |
-
|
8416 |
-
|
8417 |
-
|
8418 |
-
|
8419 |
-
|
8420 |
-
*/
|
8421 |
|
8422 |
-
|
8423 |
-
|
8424 |
-
|
|
|
|
|
|
|
|
|
|
|
8425 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8426 |
|
8427 |
-
|
8428 |
-
|
8429 |
-
|
8430 |
-
|
8431 |
-
|
|
|
|
|
|
|
8432 |
|
|
|
|
|
|
|
|
|
8433 |
|
8434 |
-
|
8435 |
-
|
8436 |
-
|
|
|
|
|
8437 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8438 |
|
8439 |
-
|
8440 |
-
|
8441 |
-
|
8442 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
8443 |
|
8444 |
-
|
8445 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8446 |
|
8447 |
-
|
|
|
|
|
8448 |
|
8449 |
-
|
8450 |
-
|
|
|
8451 |
|
8452 |
-
|
8453 |
-
|
8454 |
-
|
8455 |
-
|
8456 |
-
|
8457 |
-
|
8458 |
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return getPriceValue; });
|
8459 |
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return isWCAdmin; });
|
8460 |
-
/* harmony import */ var _babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(30);
|
8461 |
-
/* harmony import */ var _babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_0__);
|
8462 |
-
/* harmony import */ var _wordpress_html_entities__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(81);
|
8463 |
-
/* harmony import */ var _wordpress_html_entities__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_html_entities__WEBPACK_IMPORTED_MODULE_1__);
|
8464 |
-
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(2);
|
8465 |
-
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_2__);
|
8466 |
-
/* harmony import */ var _woocommerce_wc_admin_settings__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(36);
|
8467 |
|
|
|
|
|
|
|
|
|
|
|
|
|
8468 |
|
8469 |
-
|
8470 |
-
|
8471 |
-
|
|
|
8472 |
|
|
|
|
|
8473 |
|
|
|
|
|
8474 |
|
8475 |
-
|
8476 |
-
|
8477 |
-
*
|
8478 |
-
* @param {string} countryState Country state string, e.g. US:GA.
|
8479 |
-
* @return {string} Country string.
|
8480 |
-
*/
|
8481 |
|
8482 |
-
|
8483 |
-
|
8484 |
-
return null;
|
8485 |
-
}
|
8486 |
|
8487 |
-
|
8488 |
-
}
|
8489 |
-
function getCurrencyRegion(countryState) {
|
8490 |
-
var region = getCountryCode(countryState);
|
8491 |
-
var euCountries = Object(lodash__WEBPACK_IMPORTED_MODULE_2__["without"])(Object(_woocommerce_wc_admin_settings__WEBPACK_IMPORTED_MODULE_3__[/* getSetting */ "g"])('onboarding', {
|
8492 |
-
euCountries: []
|
8493 |
-
}).euCountries, 'GB');
|
8494 |
|
8495 |
-
|
8496 |
-
|
8497 |
-
|
|
|
|
|
|
|
8498 |
|
8499 |
-
|
8500 |
-
}
|
8501 |
-
/**
|
8502 |
-
* Gets the product IDs for items based on the product types and theme selected in the onboarding profiler.
|
8503 |
-
*
|
8504 |
-
* @param {Object} profileItems Onboarding profile.
|
8505 |
-
* @param {boolean} includeInstalledItems Include installed items in returned product IDs.
|
8506 |
-
* @param {Array} installedPlugins Installed plugins.
|
8507 |
-
* @return {Array} Product Ids.
|
8508 |
-
*/
|
8509 |
|
8510 |
-
function getProductIdsForCart(profileItems) {
|
8511 |
-
var includeInstalledItems = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
8512 |
-
var installedPlugins = arguments.length > 2 ? arguments[2] : undefined;
|
8513 |
-
var productList = getProductList(profileItems, includeInstalledItems, installedPlugins);
|
8514 |
-
var productIds = productList.map(function (product) {
|
8515 |
-
return product.id || product.product;
|
8516 |
-
});
|
8517 |
-
return productIds;
|
8518 |
-
}
|
8519 |
-
/**
|
8520 |
-
* Gets the labeled/categorized product names and types for items based on the product types and theme selected in the onboarding profiler.
|
8521 |
-
*
|
8522 |
-
* @param {Object} profileItems Onboarding profile.
|
8523 |
-
* @param {Array} installedPlugins Installed plugins.
|
8524 |
-
* @return {Array} Objects with labeled/categorized product names and types.
|
8525 |
-
*/
|
8526 |
|
8527 |
-
|
8528 |
-
|
8529 |
-
|
8530 |
-
productList.remainingProducts = getProductList(profileItems, false, installedPlugins);
|
8531 |
|
8532 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
8533 |
|
8534 |
-
|
8535 |
-
|
|
|
|
|
|
|
|
|
8536 |
|
8537 |
-
|
8538 |
-
|
8539 |
-
|
8540 |
-
|
8541 |
-
|
8542 |
-
|
8543 |
-
cleanedProduct = {
|
8544 |
-
type: 'theme',
|
8545 |
-
name: product.title
|
8546 |
-
};
|
8547 |
-
}
|
8548 |
|
8549 |
-
|
8550 |
-
});
|
8551 |
-
return productList;
|
8552 |
-
}
|
8553 |
-
/**
|
8554 |
-
* Gets a product list for items based on the product types and theme selected in the onboarding profiler.
|
8555 |
-
*
|
8556 |
-
* @param {Object} profileItems Onboarding profile.
|
8557 |
-
* @param {boolean} includeInstalledItems Include installed items in returned product list.
|
8558 |
-
* @param {Array} installedPlugins Installed plugins.
|
8559 |
-
* @return {Array} Products.
|
8560 |
-
*/
|
8561 |
|
8562 |
-
|
8563 |
-
|
8564 |
-
|
8565 |
-
|
8566 |
-
|
8567 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8568 |
|
8569 |
-
|
8570 |
-
return productList;
|
8571 |
-
}
|
8572 |
|
8573 |
-
|
8574 |
-
|
8575 |
-
|
8576 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8577 |
}
|
8578 |
-
});
|
8579 |
-
var theme = onboarding.themes.find(function (themeData) {
|
8580 |
-
return themeData.slug === profileItems.theme;
|
8581 |
-
});
|
8582 |
|
8583 |
-
|
8584 |
-
|
8585 |
-
|
|
|
|
|
|
|
|
|
|
|
8586 |
|
8587 |
-
return productList;
|
8588 |
-
}
|
8589 |
-
/**
|
8590 |
-
* Get the value of a price from a string, removing any non-numeric characters.
|
8591 |
-
*
|
8592 |
-
* @param {string} string Price string.
|
8593 |
-
* @return {number} Number value.
|
8594 |
-
*/
|
8595 |
|
8596 |
-
|
8597 |
-
|
8598 |
-
|
8599 |
-
|
8600 |
-
|
8601 |
-
|
8602 |
-
|
8603 |
-
|
8604 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8605 |
|
8606 |
-
|
8607 |
-
|
8608 |
-
}
|
8609 |
|
8610 |
-
/***/ }),
|
8611 |
|
8612 |
-
|
8613 |
-
|
8614 |
|
8615 |
-
|
8616 |
-
|
8617 |
-
|
8618 |
-
|
|
|
|
|
|
|
|
|
|
|
8619 |
}
|
8620 |
|
8621 |
-
|
8622 |
-
|
8623 |
-
|
8624 |
|
8625 |
-
|
8626 |
-
|
|
|
8627 |
|
8628 |
-
|
|
|
8629 |
|
8630 |
-
|
|
|
|
|
8631 |
|
8632 |
-
|
8633 |
-
|
8634 |
|
8635 |
-
|
|
|
|
|
|
|
8636 |
|
8637 |
-
|
|
|
|
|
|
|
8638 |
|
8639 |
-
|
8640 |
-
|
|
|
8641 |
|
8642 |
-
|
8643 |
-
|
8644 |
-
|
8645 |
-
if (!(instance instanceof Constructor)) {
|
8646 |
-
throw new TypeError("Cannot call a class as a function");
|
8647 |
-
}
|
8648 |
}
|
8649 |
|
8650 |
-
|
|
|
|
|
|
|
8651 |
|
8652 |
-
|
8653 |
-
|
|
|
|
|
|
|
8654 |
|
8655 |
-
|
|
|
|
|
|
|
8656 |
|
8657 |
-
|
|
|
|
|
|
|
8658 |
|
8659 |
-
|
8660 |
-
|
|
|
|
|
|
|
8661 |
|
8662 |
-
|
8663 |
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _createClass; });
|
8664 |
-
function _defineProperties(target, props) {
|
8665 |
-
for (var i = 0; i < props.length; i++) {
|
8666 |
-
var descriptor = props[i];
|
8667 |
-
descriptor.enumerable = descriptor.enumerable || false;
|
8668 |
-
descriptor.configurable = true;
|
8669 |
-
if ("value" in descriptor) descriptor.writable = true;
|
8670 |
-
Object.defineProperty(target, descriptor.key, descriptor);
|
8671 |
-
}
|
8672 |
}
|
8673 |
|
8674 |
-
|
8675 |
-
|
8676 |
-
|
8677 |
-
|
|
|
|
|
|
|
8678 |
}
|
8679 |
|
8680 |
-
|
8681 |
|
8682 |
-
|
8683 |
-
|
8684 |
|
8685 |
-
|
|
|
8686 |
|
8687 |
-
//
|
8688 |
-
|
8689 |
|
8690 |
-
//
|
8691 |
-
|
8692 |
-
|
8693 |
-
|
8694 |
-
|
8695 |
-
};
|
8696 |
|
8697 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8698 |
}
|
8699 |
-
// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/inherits.js
|
8700 |
|
8701 |
-
|
8702 |
-
|
8703 |
-
|
8704 |
-
|
8705 |
|
8706 |
-
|
8707 |
-
|
8708 |
-
|
8709 |
-
|
8710 |
-
|
8711 |
}
|
8712 |
-
|
8713 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8714 |
}
|
8715 |
|
8716 |
-
|
8717 |
-
|
8718 |
-
|
8719 |
-
|
8720 |
-
|
8721 |
-
|
8722 |
-
|
8723 |
-
|
8724 |
-
|
8725 |
-
|
|
|
|
|
8726 |
|
8727 |
-
|
8728 |
-
if (call && (Object(_babel_runtime_helpers_esm_typeof__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])(call) === "object" || typeof call === "function")) {
|
8729 |
-
return call;
|
8730 |
-
}
|
8731 |
|
8732 |
-
return Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"])(self);
|
8733 |
-
}
|
8734 |
|
8735 |
/***/ }),
|
8736 |
-
|
8737 |
-
/***/ 26:
|
8738 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
8739 |
|
8740 |
"use strict";
|
|
|
|
|
|
|
|
|
8741 |
|
8742 |
-
// EXPORTS
|
8743 |
-
__webpack_require__.d(__webpack_exports__, "a", function() { return /* binding */ _slicedToArray; });
|
8744 |
-
|
8745 |
-
// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js
|
8746 |
-
function _arrayWithHoles(arr) {
|
8747 |
-
if (Array.isArray(arr)) return arr;
|
8748 |
-
}
|
8749 |
-
// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js
|
8750 |
-
function _iterableToArrayLimit(arr, i) {
|
8751 |
-
if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return;
|
8752 |
-
var _arr = [];
|
8753 |
-
var _n = true;
|
8754 |
-
var _d = false;
|
8755 |
-
var _e = undefined;
|
8756 |
|
8757 |
-
try {
|
8758 |
-
for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
|
8759 |
-
_arr.push(_s.value);
|
8760 |
|
8761 |
-
if (i && _arr.length === i) break;
|
8762 |
-
}
|
8763 |
-
} catch (err) {
|
8764 |
-
_d = true;
|
8765 |
-
_e = err;
|
8766 |
-
} finally {
|
8767 |
-
try {
|
8768 |
-
if (!_n && _i["return"] != null) _i["return"]();
|
8769 |
-
} finally {
|
8770 |
-
if (_d) throw _e;
|
8771 |
-
}
|
8772 |
-
}
|
8773 |
|
8774 |
-
|
8775 |
-
|
8776 |
-
|
8777 |
-
|
|
|
|
|
8778 |
|
8779 |
-
|
8780 |
-
|
8781 |
-
|
|
|
|
|
|
|
8782 |
}
|
8783 |
-
// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/slicedToArray.js
|
8784 |
|
8785 |
-
|
8786 |
-
|
8787 |
-
|
8788 |
-
function _slicedToArray(arr, i) {
|
8789 |
-
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || Object(unsupportedIterableToArray["a" /* default */])(arr, i) || _nonIterableRest();
|
8790 |
-
}
|
8791 |
|
8792 |
/***/ }),
|
8793 |
-
|
8794 |
-
/***/ 27:
|
8795 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
8796 |
|
8797 |
"use strict";
|
8798 |
|
8799 |
// EXPORTS
|
8800 |
-
__webpack_require__.d(__webpack_exports__, "a", function() { return /* binding */
|
|
|
|
|
|
|
|
|
8801 |
|
8802 |
-
//
|
8803 |
-
var arrayLikeToArray = __webpack_require__(59);
|
8804 |
|
8805 |
-
//
|
|
|
8806 |
|
8807 |
-
|
8808 |
-
|
8809 |
-
|
8810 |
-
// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/iterableToArray.js
|
8811 |
-
function _iterableToArray(iter) {
|
8812 |
-
if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter);
|
8813 |
}
|
8814 |
-
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js
|
8815 |
-
var unsupportedIterableToArray = __webpack_require__(68);
|
8816 |
|
8817 |
-
//
|
8818 |
-
function
|
8819 |
-
|
8820 |
-
|
8821 |
-
|
8822 |
|
|
|
|
|
8823 |
|
|
|
|
|
|
|
8824 |
|
|
|
|
|
8825 |
|
8826 |
-
|
8827 |
-
|
8828 |
-
|
8829 |
|
8830 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8831 |
|
8832 |
-
|
8833 |
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
8834 |
|
8835 |
-
|
8836 |
-
|
8837 |
-
|
8838 |
-
|
8839 |
-
|
8840 |
-
|
|
|
8841 |
|
8842 |
-
|
8843 |
-
|
8844 |
-
|
8845 |
-
*
|
8846 |
-
* @param {...Function} hocs The HOC functions to invoke.
|
8847 |
-
*
|
8848 |
-
* @return {Function} Returns the new composite function.
|
8849 |
-
*/
|
8850 |
|
8851 |
-
|
8852 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8853 |
|
8854 |
-
|
8855 |
|
8856 |
-
|
8857 |
-
|
|
|
|
|
|
|
|
|
8858 |
|
8859 |
-
|
8860 |
-
if (source == null) return {};
|
8861 |
-
var target = {};
|
8862 |
-
var sourceKeys = Object.keys(source);
|
8863 |
-
var key, i;
|
8864 |
|
8865 |
-
|
8866 |
-
key = sourceKeys[i];
|
8867 |
-
if (excluded.indexOf(key) >= 0) continue;
|
8868 |
-
target[key] = source[key];
|
8869 |
-
}
|
8870 |
|
8871 |
-
return
|
8872 |
}
|
8873 |
|
8874 |
-
|
8875 |
|
8876 |
-
|
|
|
|
|
|
|
8877 |
|
8878 |
-
|
8879 |
-
|
|
|
8880 |
|
8881 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8882 |
|
|
|
|
|
|
|
8883 |
|
8884 |
-
if (
|
8885 |
-
module.exports = __webpack_require__(307);
|
8886 |
-
} else {}
|
8887 |
|
|
|
|
|
|
|
|
|
8888 |
|
8889 |
-
|
|
|
8890 |
|
8891 |
-
|
8892 |
-
/***/ (function(module, exports) {
|
8893 |
|
8894 |
-
|
|
|
8895 |
|
8896 |
-
|
8897 |
|
8898 |
-
/***/ 292:
|
8899 |
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
8900 |
|
8901 |
-
"use strict";
|
8902 |
-
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(3);
|
8903 |
-
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__);
|
8904 |
-
/* harmony import */ var _wordpress_hooks__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(55);
|
8905 |
-
/* harmony import */ var _wordpress_hooks__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_hooks__WEBPACK_IMPORTED_MODULE_1__);
|
8906 |
-
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(0);
|
8907 |
-
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__);
|
8908 |
-
/* harmony import */ var _settings__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(36);
|
8909 |
-
/**
|
8910 |
-
* External dependencies
|
8911 |
-
*/
|
8912 |
|
8913 |
|
8914 |
|
8915 |
-
/**
|
8916 |
-
* Internal dependencies
|
8917 |
-
*/
|
8918 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8919 |
|
8920 |
-
|
8921 |
-
|
8922 |
-
|
8923 |
-
|
8924 |
-
*/
|
8925 |
|
8926 |
-
var
|
8927 |
-
return Promise.all(/* import() | analytics-report-revenue */[__webpack_require__.e(1), __webpack_require__.e(0), __webpack_require__.e(20)]).then(__webpack_require__.bind(null, 745));
|
8928 |
-
});
|
8929 |
-
var ProductsReport = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["lazy"])(function () {
|
8930 |
-
return Promise.all(/* import() | analytics-report-products */[__webpack_require__.e(1), __webpack_require__.e(0), __webpack_require__.e(7), __webpack_require__.e(19)]).then(__webpack_require__.bind(null, 741));
|
8931 |
-
});
|
8932 |
-
var VariationsReport = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["lazy"])(function () {
|
8933 |
-
return Promise.all(/* import() | analytics-report-variations */[__webpack_require__.e(1), __webpack_require__.e(0), __webpack_require__.e(23)]).then(__webpack_require__.bind(null, 746));
|
8934 |
-
});
|
8935 |
-
var OrdersReport = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["lazy"])(function () {
|
8936 |
-
return Promise.all(/* import() | analytics-report-orders */[__webpack_require__.e(1), __webpack_require__.e(0), __webpack_require__.e(8), __webpack_require__.e(18)]).then(__webpack_require__.bind(null, 747));
|
8937 |
-
});
|
8938 |
-
var CategoriesReport = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["lazy"])(function () {
|
8939 |
-
return Promise.all(/* import() | analytics-report-categories */[__webpack_require__.e(1), __webpack_require__.e(0), __webpack_require__.e(7), __webpack_require__.e(14)]).then(__webpack_require__.bind(null, 743));
|
8940 |
-
});
|
8941 |
-
var CouponsReport = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["lazy"])(function () {
|
8942 |
-
return Promise.all(/* import() | analytics-report-coupons */[__webpack_require__.e(1), __webpack_require__.e(0), __webpack_require__.e(15)]).then(__webpack_require__.bind(null, 748));
|
8943 |
-
});
|
8944 |
-
var TaxesReport = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["lazy"])(function () {
|
8945 |
-
return Promise.all(/* import() | analytics-report-taxes */[__webpack_require__.e(1), __webpack_require__.e(0), __webpack_require__.e(22)]).then(__webpack_require__.bind(null, 749));
|
8946 |
-
});
|
8947 |
-
var DownloadsReport = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["lazy"])(function () {
|
8948 |
-
return Promise.all(/* import() | analytics-report-downloads */[__webpack_require__.e(1), __webpack_require__.e(0), __webpack_require__.e(17)]).then(__webpack_require__.bind(null, 750));
|
8949 |
-
});
|
8950 |
-
var StockReport = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["lazy"])(function () {
|
8951 |
-
return Promise.all(/* import() | analytics-report-stock */[__webpack_require__.e(0), __webpack_require__.e(21)]).then(__webpack_require__.bind(null, 742));
|
8952 |
-
});
|
8953 |
-
var CustomersReport = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["lazy"])(function () {
|
8954 |
-
return Promise.all(/* import() | analytics-report-customers */[__webpack_require__.e(0), __webpack_require__.e(16)]).then(__webpack_require__.bind(null, 744));
|
8955 |
-
});
|
8956 |
-
/* harmony default export */ __webpack_exports__["a"] = (function () {
|
8957 |
-
var reports = [{
|
8958 |
-
report: 'revenue',
|
8959 |
-
title: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__["__"])('Revenue', 'woocommerce-admin'),
|
8960 |
-
component: RevenueReport,
|
8961 |
-
id: 'woocommerce-analytics-revenue'
|
8962 |
-
}, {
|
8963 |
-
report: 'products',
|
8964 |
-
title: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__["__"])('Products', 'woocommerce-admin'),
|
8965 |
-
component: ProductsReport,
|
8966 |
-
id: 'woocommerce-analytics-products'
|
8967 |
-
}, {
|
8968 |
-
report: 'variations',
|
8969 |
-
title: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__["__"])('Variations', 'woocommerce-admin'),
|
8970 |
-
component: VariationsReport,
|
8971 |
-
id: 'woocommerce-analytics-variations'
|
8972 |
-
}, {
|
8973 |
-
report: 'orders',
|
8974 |
-
title: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__["__"])('Orders', 'woocommerce-admin'),
|
8975 |
-
component: OrdersReport,
|
8976 |
-
id: 'woocommerce-analytics-orders'
|
8977 |
-
}, {
|
8978 |
-
report: 'categories',
|
8979 |
-
title: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__["__"])('Categories', 'woocommerce-admin'),
|
8980 |
-
component: CategoriesReport,
|
8981 |
-
id: 'woocommerce-analytics-categories'
|
8982 |
-
}, {
|
8983 |
-
report: 'coupons',
|
8984 |
-
title: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__["__"])('Coupons', 'woocommerce-admin'),
|
8985 |
-
component: CouponsReport,
|
8986 |
-
id: 'woocommerce-analytics-coupons'
|
8987 |
-
}, {
|
8988 |
-
report: 'taxes',
|
8989 |
-
title: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__["__"])('Taxes', 'woocommerce-admin'),
|
8990 |
-
component: TaxesReport,
|
8991 |
-
id: 'woocommerce-analytics-taxes'
|
8992 |
-
}, manageStock === 'yes' ? {
|
8993 |
-
report: 'stock',
|
8994 |
-
title: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__["__"])('Stock', 'woocommerce-admin'),
|
8995 |
-
component: StockReport,
|
8996 |
-
id: 'woocommerce-analytics-stock'
|
8997 |
-
} : null, {
|
8998 |
-
report: 'customers',
|
8999 |
-
title: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__["__"])('Customers', 'woocommerce-admin'),
|
9000 |
-
component: CustomersReport,
|
9001 |
-
id: null
|
9002 |
-
}, {
|
9003 |
-
report: 'downloads',
|
9004 |
-
title: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__["__"])('Downloads', 'woocommerce-admin'),
|
9005 |
-
component: DownloadsReport,
|
9006 |
-
id: 'woocommerce-analytics-downloads'
|
9007 |
-
}].filter(Boolean);
|
9008 |
-
return Object(_wordpress_hooks__WEBPACK_IMPORTED_MODULE_1__["applyFilters"])(REPORTS_FILTER, reports);
|
9009 |
-
});
|
9010 |
|
9011 |
-
|
|
|
|
|
|
|
9012 |
|
9013 |
-
|
9014 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9015 |
|
9016 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9017 |
|
|
|
|
|
|
|
|
|
|
|
9018 |
|
9019 |
-
|
|
|
|
|
|
|
|
|
9020 |
|
9021 |
-
|
9022 |
-
|
9023 |
-
* Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.
|
9024 |
-
*/
|
9025 |
-
var REACT_STATICS = {
|
9026 |
-
childContextTypes: true,
|
9027 |
-
contextType: true,
|
9028 |
-
contextTypes: true,
|
9029 |
-
defaultProps: true,
|
9030 |
-
displayName: true,
|
9031 |
-
getDefaultProps: true,
|
9032 |
-
getDerivedStateFromError: true,
|
9033 |
-
getDerivedStateFromProps: true,
|
9034 |
-
mixins: true,
|
9035 |
-
propTypes: true,
|
9036 |
-
type: true
|
9037 |
-
};
|
9038 |
-
var KNOWN_STATICS = {
|
9039 |
-
name: true,
|
9040 |
-
length: true,
|
9041 |
-
prototype: true,
|
9042 |
-
caller: true,
|
9043 |
-
callee: true,
|
9044 |
-
arguments: true,
|
9045 |
-
arity: true
|
9046 |
-
};
|
9047 |
-
var FORWARD_REF_STATICS = {
|
9048 |
-
'$$typeof': true,
|
9049 |
-
render: true,
|
9050 |
-
defaultProps: true,
|
9051 |
-
displayName: true,
|
9052 |
-
propTypes: true
|
9053 |
-
};
|
9054 |
-
var MEMO_STATICS = {
|
9055 |
-
'$$typeof': true,
|
9056 |
-
compare: true,
|
9057 |
-
defaultProps: true,
|
9058 |
-
displayName: true,
|
9059 |
-
propTypes: true,
|
9060 |
-
type: true
|
9061 |
-
};
|
9062 |
-
var TYPE_STATICS = {};
|
9063 |
-
TYPE_STATICS[reactIs.ForwardRef] = FORWARD_REF_STATICS;
|
9064 |
-
TYPE_STATICS[reactIs.Memo] = MEMO_STATICS;
|
9065 |
|
9066 |
-
|
9067 |
-
|
9068 |
-
|
9069 |
-
|
9070 |
-
|
|
|
|
|
|
|
|
|
9071 |
|
|
|
9072 |
|
9073 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9074 |
}
|
9075 |
|
9076 |
-
|
9077 |
-
var
|
9078 |
-
var getOwnPropertySymbols = Object.getOwnPropertySymbols;
|
9079 |
-
var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
|
9080 |
-
var getPrototypeOf = Object.getPrototypeOf;
|
9081 |
-
var objectPrototype = Object.prototype;
|
9082 |
-
function hoistNonReactStatics(targetComponent, sourceComponent, blacklist) {
|
9083 |
-
if (typeof sourceComponent !== 'string') {
|
9084 |
-
// don't hoist over string (html) components
|
9085 |
-
if (objectPrototype) {
|
9086 |
-
var inheritedComponent = getPrototypeOf(sourceComponent);
|
9087 |
|
9088 |
-
|
9089 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9090 |
}
|
|
|
|
|
9091 |
}
|
|
|
9092 |
|
9093 |
-
|
9094 |
-
|
9095 |
-
if (getOwnPropertySymbols) {
|
9096 |
-
keys = keys.concat(getOwnPropertySymbols(sourceComponent));
|
9097 |
-
}
|
9098 |
|
9099 |
-
|
9100 |
-
var
|
9101 |
|
9102 |
-
|
9103 |
-
|
|
|
9104 |
|
9105 |
-
|
9106 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
9107 |
|
9108 |
-
|
9109 |
-
|
9110 |
-
|
9111 |
-
} catch (e) {}
|
9112 |
-
}
|
9113 |
}
|
|
|
|
|
|
|
|
|
9114 |
}
|
9115 |
|
9116 |
-
return
|
|
|
|
|
|
|
|
|
|
|
9117 |
}
|
9118 |
|
9119 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9120 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9121 |
|
9122 |
-
|
|
|
|
|
|
|
|
|
|
|
9123 |
|
9124 |
-
|
9125 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
9126 |
|
9127 |
-
|
9128 |
-
|
9129 |
-
|
9130 |
-
/* harmony import */ var _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_0__);
|
9131 |
-
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(0);
|
9132 |
-
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__);
|
9133 |
|
|
|
|
|
9134 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9135 |
/**
|
9136 |
-
*
|
|
|
9137 |
*/
|
9138 |
|
9139 |
-
function useIsScrolled() {
|
9140 |
-
var _useState = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["useState"])(false),
|
9141 |
-
_useState2 = _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_0___default()(_useState, 2),
|
9142 |
-
isScrolled = _useState2[0],
|
9143 |
-
setIsScrolled = _useState2[1];
|
9144 |
-
|
9145 |
-
var rafHandle = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["useRef"])(null);
|
9146 |
-
Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["useEffect"])(function () {
|
9147 |
-
var updateIsScrolled = function updateIsScrolled() {
|
9148 |
-
setIsScrolled(window.pageYOffset > 20);
|
9149 |
-
};
|
9150 |
|
9151 |
-
|
9152 |
-
|
9153 |
-
};
|
|
|
9154 |
|
9155 |
-
|
9156 |
-
|
9157 |
-
|
9158 |
-
|
9159 |
-
|
9160 |
-
|
9161 |
-
|
9162 |
-
|
|
|
|
|
|
|
|
|
9163 |
|
9164 |
-
|
|
|
|
|
|
|
9165 |
|
9166 |
-
|
9167 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9168 |
|
9169 |
-
|
|
|
|
|
9170 |
|
9171 |
-
|
9172 |
|
9173 |
-
|
9174 |
-
|
9175 |
|
9176 |
-
|
|
|
|
|
9177 |
|
9178 |
-
|
9179 |
-
|
9180 |
-
|
9181 |
-
|
|
|
9182 |
|
9183 |
-
|
9184 |
-
|
9185 |
-
|
9186 |
|
9187 |
-
|
9188 |
-
var objectWithoutProperties = __webpack_require__(62);
|
9189 |
-
var objectWithoutProperties_default = /*#__PURE__*/__webpack_require__.n(objectWithoutProperties);
|
9190 |
|
9191 |
-
|
9192 |
-
|
9193 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9194 |
|
9195 |
-
|
9196 |
-
var
|
9197 |
-
|
|
|
9198 |
|
9199 |
-
|
9200 |
-
|
9201 |
-
var
|
|
|
|
|
9202 |
|
9203 |
-
|
9204 |
-
|
9205 |
-
|
|
|
|
|
9206 |
|
9207 |
-
|
9208 |
-
var
|
9209 |
-
var possibleConstructorReturn_default = /*#__PURE__*/__webpack_require__.n(possibleConstructorReturn);
|
9210 |
|
9211 |
-
|
9212 |
-
|
9213 |
-
|
9214 |
|
9215 |
-
|
9216 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9217 |
|
9218 |
-
|
9219 |
-
|
|
|
|
|
|
|
9220 |
|
9221 |
-
|
9222 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9223 |
|
9224 |
-
|
9225 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9226 |
|
9227 |
-
|
9228 |
-
|
9229 |
-
|
|
|
|
|
9230 |
|
9231 |
-
|
9232 |
-
|
9233 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9234 |
|
9235 |
-
|
9236 |
-
|
|
|
9237 |
|
9238 |
-
|
9239 |
-
|
|
|
9240 |
|
9241 |
-
|
9242 |
-
|
|
|
9243 |
|
9244 |
-
|
9245 |
-
var esm_extends = __webpack_require__(7);
|
9246 |
|
9247 |
-
|
9248 |
-
|
9249 |
-
var path_to_regexp_default = /*#__PURE__*/__webpack_require__.n(path_to_regexp);
|
9250 |
|
9251 |
-
|
9252 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
9253 |
|
9254 |
-
|
9255 |
-
var objectWithoutPropertiesLoose = __webpack_require__(58);
|
9256 |
|
9257 |
-
|
9258 |
-
|
9259 |
-
|
|
|
9260 |
|
9261 |
-
|
9262 |
|
|
|
|
|
|
|
|
|
9263 |
|
|
|
|
|
|
|
|
|
|
|
9264 |
|
|
|
|
|
|
|
9265 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9266 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9267 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9268 |
|
|
|
|
|
|
|
|
|
9269 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9270 |
|
|
|
|
|
|
|
9271 |
|
|
|
|
|
|
|
9272 |
|
|
|
|
|
|
|
|
|
9273 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9274 |
|
9275 |
-
|
|
|
|
|
|
|
|
|
|
|
9276 |
|
9277 |
-
var
|
9278 |
-
var context = Object(esm["a" /* default */])();
|
9279 |
-
context.displayName = name;
|
9280 |
-
return context;
|
9281 |
-
};
|
9282 |
|
9283 |
-
|
9284 |
-
|
9285 |
-
react_router_createNamedContext("Router");
|
9286 |
|
9287 |
-
|
9288 |
-
|
9289 |
-
|
9290 |
|
9291 |
-
var
|
9292 |
-
|
9293 |
-
function (_React$Component) {
|
9294 |
-
Object(inheritsLoose["a" /* default */])(Router, _React$Component);
|
9295 |
|
9296 |
-
|
9297 |
-
return
|
9298 |
-
|
9299 |
-
url: "/",
|
9300 |
-
params: {},
|
9301 |
-
isExact: pathname === "/"
|
9302 |
-
};
|
9303 |
-
};
|
9304 |
|
9305 |
-
function
|
9306 |
-
var
|
|
|
9307 |
|
9308 |
-
|
9309 |
-
|
9310 |
-
|
9311 |
-
}
|
9312 |
-
|
9313 |
-
|
9314 |
-
|
9315 |
-
// get a new location before the <Router> is mounted.
|
9316 |
|
9317 |
-
|
9318 |
-
_this._pendingLocation = null;
|
9319 |
|
9320 |
-
|
9321 |
-
|
9322 |
-
|
9323 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9324 |
location: location
|
9325 |
});
|
9326 |
} else {
|
9327 |
-
|
9328 |
}
|
9329 |
});
|
9330 |
}
|
9331 |
-
|
9332 |
-
return _this;
|
9333 |
}
|
9334 |
|
9335 |
-
|
|
|
|
|
|
|
9336 |
|
9337 |
-
|
9338 |
-
|
|
|
|
|
|
|
9339 |
|
9340 |
-
if (
|
9341 |
-
|
9342 |
-
|
9343 |
-
});
|
9344 |
}
|
9345 |
-
}
|
9346 |
-
|
9347 |
-
_proto.componentWillUnmount = function componentWillUnmount() {
|
9348 |
-
if (this.unlisten) this.unlisten();
|
9349 |
-
};
|
9350 |
-
|
9351 |
-
_proto.render = function render() {
|
9352 |
-
return external_React_default.a.createElement(react_router_context.Provider, {
|
9353 |
-
children: this.props.children || null,
|
9354 |
-
value: {
|
9355 |
-
history: this.props.history,
|
9356 |
-
location: this.state.location,
|
9357 |
-
match: Router.computeRootMatch(this.state.location.pathname),
|
9358 |
-
staticContext: this.props.staticContext
|
9359 |
-
}
|
9360 |
-
});
|
9361 |
-
};
|
9362 |
-
|
9363 |
-
return Router;
|
9364 |
-
}(external_React_default.a.Component);
|
9365 |
-
|
9366 |
-
if (false) {}
|
9367 |
|
9368 |
-
/**
|
9369 |
-
* The public API for a <Router> that stores location in memory.
|
9370 |
-
*/
|
9371 |
|
9372 |
-
var
|
9373 |
-
|
9374 |
-
|
9375 |
-
|
|
|
9376 |
|
9377 |
-
function
|
9378 |
-
var
|
|
|
9379 |
|
9380 |
-
|
9381 |
-
|
9382 |
}
|
9383 |
|
9384 |
-
|
9385 |
-
_this.history = Object(esm_history["c" /* createMemoryHistory */])(_this.props);
|
9386 |
-
return _this;
|
9387 |
}
|
9388 |
|
9389 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9390 |
|
9391 |
-
|
9392 |
-
|
9393 |
-
|
9394 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9395 |
});
|
9396 |
-
}
|
9397 |
|
9398 |
-
|
9399 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9400 |
|
9401 |
-
if (
|
|
|
|
|
|
|
|
|
|
|
|
|
9402 |
|
9403 |
-
var
|
9404 |
-
|
9405 |
-
|
9406 |
-
|
|
|
|
|
|
|
|
|
9407 |
|
9408 |
-
function
|
9409 |
-
|
|
|
9410 |
}
|
9411 |
|
9412 |
-
|
|
|
|
|
9413 |
|
9414 |
-
|
9415 |
-
|
9416 |
-
}
|
9417 |
|
9418 |
-
|
9419 |
-
if (this.props.onUpdate) this.props.onUpdate.call(this, this, prevProps);
|
9420 |
-
};
|
9421 |
|
9422 |
-
|
9423 |
-
|
9424 |
-
};
|
9425 |
|
9426 |
-
|
9427 |
-
|
9428 |
-
|
|
|
|
|
|
|
9429 |
|
9430 |
-
|
9431 |
-
}(external_React_default.a.Component);
|
9432 |
|
9433 |
-
|
9434 |
-
|
9435 |
-
|
|
|
9436 |
|
9437 |
-
|
9438 |
-
var message = _ref.message,
|
9439 |
-
_ref$when = _ref.when,
|
9440 |
-
when = _ref$when === void 0 ? true : _ref$when;
|
9441 |
-
return external_React_default.a.createElement(react_router_context.Consumer, null, function (context) {
|
9442 |
-
!context ? false ? undefined : Object(tiny_invariant_esm["a" /* default */])(false) : void 0;
|
9443 |
-
if (!when || context.staticContext) return null;
|
9444 |
-
var method = context.history.block;
|
9445 |
-
return external_React_default.a.createElement(react_router_Lifecycle, {
|
9446 |
-
onMount: function onMount(self) {
|
9447 |
-
self.release = method(message);
|
9448 |
-
},
|
9449 |
-
onUpdate: function onUpdate(self, prevProps) {
|
9450 |
-
if (prevProps.message !== message) {
|
9451 |
-
self.release();
|
9452 |
-
self.release = method(message);
|
9453 |
-
}
|
9454 |
-
},
|
9455 |
-
onUnmount: function onUnmount(self) {
|
9456 |
-
self.release();
|
9457 |
-
},
|
9458 |
-
message: message
|
9459 |
-
});
|
9460 |
-
});
|
9461 |
-
}
|
9462 |
|
9463 |
-
if (
|
|
|
|
|
|
|
9464 |
|
9465 |
-
|
9466 |
-
|
9467 |
-
|
|
|
|
|
9468 |
|
9469 |
-
|
9470 |
-
|
9471 |
-
|
9472 |
|
9473 |
-
|
9474 |
-
|
9475 |
-
|
|
|
|
|
|
|
|
|
9476 |
}
|
9477 |
|
9478 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9479 |
}
|
9480 |
/**
|
9481 |
-
*
|
9482 |
*/
|
9483 |
|
9484 |
|
9485 |
-
function
|
9486 |
-
if (
|
9487 |
-
|
9488 |
}
|
9489 |
|
9490 |
-
|
9491 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9492 |
}
|
9493 |
|
9494 |
-
|
9495 |
-
|
9496 |
-
}
|
9497 |
-
}
|
9498 |
|
9499 |
-
|
9500 |
-
|
9501 |
-
|
|
|
9502 |
|
9503 |
-
|
9504 |
-
var computedMatch = _ref.computedMatch,
|
9505 |
-
to = _ref.to,
|
9506 |
-
_ref$push = _ref.push,
|
9507 |
-
push = _ref$push === void 0 ? false : _ref$push;
|
9508 |
-
return external_React_default.a.createElement(react_router_context.Consumer, null, function (context) {
|
9509 |
-
!context ? false ? undefined : Object(tiny_invariant_esm["a" /* default */])(false) : void 0;
|
9510 |
-
var history = context.history,
|
9511 |
-
staticContext = context.staticContext;
|
9512 |
-
var method = push ? history.push : history.replace;
|
9513 |
-
var location = Object(esm_history["b" /* createLocation */])(computedMatch ? typeof to === "string" ? generatePath(to, computedMatch.params) : Object(esm_extends["a" /* default */])({}, to, {
|
9514 |
-
pathname: generatePath(to.pathname, computedMatch.params)
|
9515 |
-
}) : to); // When rendering in a static context,
|
9516 |
-
// set the new location immediately.
|
9517 |
|
9518 |
-
|
9519 |
-
|
9520 |
-
|
9521 |
-
|
|
|
|
|
|
|
|
|
|
|
9522 |
|
9523 |
-
|
9524 |
-
|
9525 |
-
|
9526 |
-
|
9527 |
-
|
9528 |
-
var prevLocation = Object(esm_history["b" /* createLocation */])(prevProps.to);
|
9529 |
|
9530 |
-
|
9531 |
-
|
9532 |
-
|
9533 |
-
|
9534 |
-
|
9535 |
-
}
|
9536 |
-
to: to
|
9537 |
});
|
9538 |
-
}
|
9539 |
-
}
|
9540 |
|
9541 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9542 |
|
9543 |
-
|
9544 |
-
var
|
9545 |
-
var
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9546 |
|
9547 |
-
function
|
9548 |
-
|
9549 |
-
|
9550 |
-
if (pathCache[path]) return pathCache[path];
|
9551 |
-
var keys = [];
|
9552 |
-
var regexp = path_to_regexp_default()(path, keys, options);
|
9553 |
-
var result = {
|
9554 |
-
regexp: regexp,
|
9555 |
-
keys: keys
|
9556 |
-
};
|
9557 |
|
9558 |
-
|
9559 |
-
|
9560 |
-
cacheCount$1++;
|
9561 |
}
|
9562 |
|
9563 |
-
|
9564 |
-
|
9565 |
-
|
9566 |
-
|
9567 |
-
*/
|
9568 |
|
|
|
|
|
|
|
|
|
9569 |
|
9570 |
-
|
9571 |
-
if (options === void 0) {
|
9572 |
-
options = {};
|
9573 |
}
|
9574 |
|
9575 |
-
|
9576 |
-
|
9577 |
-
path: options
|
9578 |
-
};
|
9579 |
}
|
9580 |
|
9581 |
-
var
|
9582 |
-
|
9583 |
-
|
9584 |
-
|
9585 |
-
|
9586 |
-
|
9587 |
-
|
9588 |
-
|
9589 |
-
|
9590 |
-
|
9591 |
-
|
9592 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
9593 |
|
9594 |
-
var _compilePath = compilePath$1(path, {
|
9595 |
-
end: exact,
|
9596 |
-
strict: strict,
|
9597 |
-
sensitive: sensitive
|
9598 |
-
}),
|
9599 |
-
regexp = _compilePath.regexp,
|
9600 |
-
keys = _compilePath.keys;
|
9601 |
|
9602 |
-
var match = regexp.exec(pathname);
|
9603 |
-
if (!match) return null;
|
9604 |
-
var url = match[0],
|
9605 |
-
values = match.slice(1);
|
9606 |
-
var isExact = pathname === url;
|
9607 |
-
if (exact && !isExact) return null;
|
9608 |
-
return {
|
9609 |
-
path: path,
|
9610 |
-
// the path used to match
|
9611 |
-
url: path === "/" && url === "" ? "/" : url,
|
9612 |
-
// the matched portion of the URL
|
9613 |
-
isExact: isExact,
|
9614 |
-
// whether or not we matched exactly
|
9615 |
-
params: keys.reduce(function (memo, key, index) {
|
9616 |
-
memo[key.name] = values[index];
|
9617 |
-
return memo;
|
9618 |
-
}, {})
|
9619 |
-
};
|
9620 |
-
}, null);
|
9621 |
-
}
|
9622 |
|
9623 |
-
function isEmptyChildren(children) {
|
9624 |
-
return external_React_default.a.Children.count(children) === 0;
|
9625 |
-
}
|
9626 |
|
9627 |
-
|
9628 |
-
|
9629 |
-
|
9630 |
-
|
9631 |
-
|
9632 |
-
|
9633 |
-
|
9634 |
-
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9635 |
|
9636 |
|
9637 |
-
var react_router_Route =
|
9638 |
-
/*#__PURE__*/
|
9639 |
-
function (_React$Component) {
|
9640 |
-
Object(inheritsLoose["a" /* default */])(Route, _React$Component);
|
9641 |
|
9642 |
-
function Route() {
|
9643 |
-
return _React$Component.apply(this, arguments) || this;
|
9644 |
-
}
|
9645 |
|
9646 |
-
var _proto = Route.prototype;
|
9647 |
|
9648 |
-
_proto.render = function render() {
|
9649 |
-
var _this = this;
|
9650 |
|
9651 |
-
|
9652 |
-
!context$1 ? false ? undefined : Object(tiny_invariant_esm["a" /* default */])(false) : void 0;
|
9653 |
-
var location = _this.props.location || context$1.location;
|
9654 |
-
var match = _this.props.computedMatch ? _this.props.computedMatch // <Switch> already computed the match for us
|
9655 |
-
: _this.props.path ? matchPath(location.pathname, _this.props) : context$1.match;
|
9656 |
|
9657 |
-
|
9658 |
-
location: location,
|
9659 |
-
match: match
|
9660 |
-
});
|
9661 |
|
9662 |
-
|
9663 |
-
|
9664 |
-
|
9665 |
-
render = _this$props.render; // Preact uses an empty array as children by
|
9666 |
-
// default, so use null if that's the case.
|
9667 |
|
9668 |
-
if (Array.isArray(children) && children.length === 0) {
|
9669 |
-
children = null;
|
9670 |
-
}
|
9671 |
|
9672 |
-
return external_React_default.a.createElement(react_router_context.Provider, {
|
9673 |
-
value: props
|
9674 |
-
}, props.match ? children ? typeof children === "function" ? false ? undefined : children(props) : children : component ? external_React_default.a.createElement(component, props) : render ? render(props) : null : typeof children === "function" ? false ? undefined : children(props) : null);
|
9675 |
-
});
|
9676 |
-
};
|
9677 |
|
9678 |
-
return Route;
|
9679 |
-
}(external_React_default.a.Component);
|
9680 |
|
9681 |
-
|
|
|
|
|
9682 |
|
9683 |
-
|
9684 |
-
return path.charAt(0) === "/" ? path : "/" + path;
|
9685 |
-
}
|
9686 |
|
9687 |
-
function
|
9688 |
-
|
9689 |
-
return Object(esm_extends["a" /* default */])({}, location, {
|
9690 |
-
pathname: addLeadingSlash(basename) + location.pathname
|
9691 |
-
});
|
9692 |
-
}
|
9693 |
|
9694 |
-
|
9695 |
-
if (!basename) return location;
|
9696 |
-
var base = addLeadingSlash(basename);
|
9697 |
-
if (location.pathname.indexOf(base) !== 0) return location;
|
9698 |
-
return Object(esm_extends["a" /* default */])({}, location, {
|
9699 |
-
pathname: location.pathname.substr(base.length)
|
9700 |
-
});
|
9701 |
-
}
|
9702 |
|
9703 |
-
|
9704 |
-
|
9705 |
-
|
|
|
|
|
9706 |
|
9707 |
-
|
9708 |
-
|
9709 |
-
|
9710 |
-
|
9711 |
-
|
|
|
9712 |
|
9713 |
-
|
9714 |
-
/**
|
9715 |
-
* The public top-level API for a "static" <Router>, so-called because it
|
9716 |
-
* can't actually change the current location. Instead, it just records
|
9717 |
-
* location changes in a context object. Useful mainly in testing and
|
9718 |
-
* server-rendering scenarios.
|
9719 |
-
*/
|
9720 |
|
|
|
|
|
|
|
9721 |
|
9722 |
-
var
|
9723 |
-
|
9724 |
-
function (_React$Component) {
|
9725 |
-
Object(inheritsLoose["a" /* default */])(StaticRouter, _React$Component);
|
9726 |
|
9727 |
-
|
9728 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9729 |
|
9730 |
-
|
9731 |
-
|
9732 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
9733 |
|
9734 |
-
|
|
|
|
|
|
|
|
|
9735 |
|
9736 |
-
|
9737 |
-
|
9738 |
-
|
9739 |
|
9740 |
-
|
9741 |
-
|
9742 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9743 |
|
9744 |
-
_this.handleListen = function () {
|
9745 |
-
return noop;
|
9746 |
-
};
|
9747 |
|
9748 |
-
_this.handleBlock = function () {
|
9749 |
-
return noop;
|
9750 |
-
};
|
9751 |
|
9752 |
-
return _this;
|
9753 |
-
}
|
9754 |
|
9755 |
-
var _proto = StaticRouter.prototype;
|
9756 |
|
9757 |
-
_proto.navigateTo = function navigateTo(location, action) {
|
9758 |
-
var _this$props = this.props,
|
9759 |
-
_this$props$basename = _this$props.basename,
|
9760 |
-
basename = _this$props$basename === void 0 ? "" : _this$props$basename,
|
9761 |
-
_this$props$context = _this$props.context,
|
9762 |
-
context = _this$props$context === void 0 ? {} : _this$props$context;
|
9763 |
-
context.action = action;
|
9764 |
-
context.location = addBasename(basename, Object(esm_history["b" /* createLocation */])(location));
|
9765 |
-
context.url = createURL(context.location);
|
9766 |
-
};
|
9767 |
|
9768 |
-
_proto.render = function render() {
|
9769 |
-
var _this$props2 = this.props,
|
9770 |
-
_this$props2$basename = _this$props2.basename,
|
9771 |
-
basename = _this$props2$basename === void 0 ? "" : _this$props2$basename,
|
9772 |
-
_this$props2$context = _this$props2.context,
|
9773 |
-
context = _this$props2$context === void 0 ? {} : _this$props2$context,
|
9774 |
-
_this$props2$location = _this$props2.location,
|
9775 |
-
location = _this$props2$location === void 0 ? "/" : _this$props2$location,
|
9776 |
-
rest = Object(objectWithoutPropertiesLoose["a" /* default */])(_this$props2, ["basename", "context", "location"]);
|
9777 |
|
9778 |
-
var history = {
|
9779 |
-
createHref: function createHref(path) {
|
9780 |
-
return addLeadingSlash(basename + createURL(path));
|
9781 |
-
},
|
9782 |
-
action: "POP",
|
9783 |
-
location: stripBasename(basename, Object(esm_history["b" /* createLocation */])(location)),
|
9784 |
-
push: this.handlePush,
|
9785 |
-
replace: this.handleReplace,
|
9786 |
-
go: staticHandler("go"),
|
9787 |
-
goBack: staticHandler("goBack"),
|
9788 |
-
goForward: staticHandler("goForward"),
|
9789 |
-
listen: this.handleListen,
|
9790 |
-
block: this.handleBlock
|
9791 |
-
};
|
9792 |
-
return external_React_default.a.createElement(react_router_Router, Object(esm_extends["a" /* default */])({}, rest, {
|
9793 |
-
history: history,
|
9794 |
-
staticContext: context
|
9795 |
-
}));
|
9796 |
-
};
|
9797 |
|
9798 |
-
return StaticRouter;
|
9799 |
-
}(external_React_default.a.Component);
|
9800 |
|
9801 |
-
if (
|
|
|
|
|
9802 |
|
9803 |
/**
|
9804 |
-
*
|
9805 |
*/
|
9806 |
|
9807 |
-
|
9808 |
-
|
9809 |
-
|
9810 |
-
Object(inheritsLoose["a" /* default */])(Switch, _React$Component);
|
9811 |
|
9812 |
-
function Switch() {
|
9813 |
-
return _React$Component.apply(this, arguments) || this;
|
9814 |
-
}
|
9815 |
|
9816 |
-
var _proto = Switch.prototype;
|
9817 |
|
9818 |
-
|
9819 |
-
|
|
|
|
|
|
|
|
|
9820 |
|
9821 |
-
|
9822 |
-
|
9823 |
-
|
9824 |
-
|
9825 |
-
|
9826 |
-
|
9827 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9828 |
|
9829 |
-
|
9830 |
-
|
9831 |
-
element = child;
|
9832 |
-
var path = child.props.path || child.props.from;
|
9833 |
-
match = path ? matchPath(location.pathname, Object(esm_extends["a" /* default */])({}, child.props, {
|
9834 |
-
path: path
|
9835 |
-
})) : context.match;
|
9836 |
-
}
|
9837 |
-
});
|
9838 |
-
return match ? external_React_default.a.cloneElement(element, {
|
9839 |
-
location: location,
|
9840 |
-
computedMatch: match
|
9841 |
-
}) : null;
|
9842 |
-
});
|
9843 |
-
};
|
9844 |
|
9845 |
-
|
9846 |
-
|
|
|
9847 |
|
9848 |
-
|
9849 |
|
9850 |
-
|
9851 |
-
|
9852 |
-
*/
|
9853 |
|
9854 |
-
|
9855 |
-
var displayName = "withRouter(" + (Component.displayName || Component.name) + ")";
|
9856 |
|
9857 |
-
|
9858 |
-
|
9859 |
-
|
|
|
|
|
|
|
|
|
9860 |
|
9861 |
-
|
9862 |
-
|
9863 |
-
|
9864 |
-
|
9865 |
-
}
|
9866 |
-
}
|
9867 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9868 |
|
9869 |
-
|
9870 |
-
|
|
|
9871 |
|
9872 |
-
|
|
|
|
|
9873 |
|
9874 |
-
|
9875 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9876 |
|
9877 |
-
|
9878 |
-
|
9879 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9880 |
|
9881 |
-
|
9882 |
-
|
9883 |
-
function
|
9884 |
-
|
|
|
|
|
9885 |
|
9886 |
-
|
9887 |
-
|
9888 |
-
|
9889 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9890 |
|
9891 |
-
|
9892 |
-
|
9893 |
-
|
9894 |
-
|
9895 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9896 |
|
9897 |
-
|
9898 |
-
}
|
|
|
|
|
9899 |
|
9900 |
-
|
|
|
|
|
9901 |
|
|
|
|
|
|
|
|
|
|
|
9902 |
|
9903 |
-
//# sourceMappingURL=react-router.js.map
|
9904 |
|
9905 |
-
// EXTERNAL MODULE: external "lodash"
|
9906 |
-
var external_lodash_ = __webpack_require__(2);
|
9907 |
|
9908 |
-
// EXTERNAL MODULE: ./node_modules/qs/lib/index.js
|
9909 |
-
var lib = __webpack_require__(87);
|
9910 |
|
9911 |
-
|
9912 |
-
|
|
|
9913 |
|
9914 |
-
// EXTERNAL MODULE: external {"this":["wc","navigation"]}
|
9915 |
-
var external_this_wc_navigation_ = __webpack_require__(32);
|
9916 |
|
9917 |
-
|
9918 |
-
|
|
|
9919 |
|
9920 |
-
|
9921 |
-
var
|
|
|
9922 |
|
9923 |
-
//
|
9924 |
-
|
9925 |
|
9926 |
-
|
9927 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
9928 |
|
9929 |
-
|
9930 |
-
|
|
|
|
|
9931 |
|
9932 |
-
|
9933 |
-
var external_this_wp_i18n_ = __webpack_require__(3);
|
9934 |
|
9935 |
-
//
|
9936 |
-
var get_reports = __webpack_require__(292);
|
9937 |
|
9938 |
-
// EXTERNAL MODULE: ./
|
9939 |
-
var
|
9940 |
|
9941 |
-
//
|
|
|
9942 |
|
|
|
|
|
9943 |
|
|
|
|
|
9944 |
|
|
|
|
|
9945 |
|
|
|
|
|
9946 |
|
|
|
|
|
9947 |
|
|
|
|
|
9948 |
|
9949 |
-
|
|
|
9950 |
|
9951 |
-
|
|
|
9952 |
|
9953 |
-
|
9954 |
-
* External dependencies
|
9955 |
-
*/
|
9956 |
|
9957 |
|
9958 |
|
@@ -9960,6678 +9246,6805 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
|
|
9960 |
|
9961 |
|
9962 |
|
9963 |
-
/**
|
9964 |
-
* Internal dependencies
|
9965 |
-
*/
|
9966 |
|
9967 |
|
|
|
9968 |
|
9969 |
-
|
9970 |
-
return __webpack_require__.e(/* import() | analytics-report */ 13).then(__webpack_require__.bind(null, 840));
|
9971 |
-
});
|
9972 |
-
var AnalyticsSettings = Object(external_this_wp_element_["lazy"])(function () {
|
9973 |
-
return Promise.all(/* import() | analytics-settings */[__webpack_require__.e(3), __webpack_require__.e(24)]).then(__webpack_require__.bind(null, 850));
|
9974 |
-
});
|
9975 |
-
var Dashboard = Object(external_this_wp_element_["lazy"])(function () {
|
9976 |
-
return __webpack_require__.e(/* import() | dashboard */ 31).then(__webpack_require__.bind(null, 841));
|
9977 |
-
});
|
9978 |
-
var Homescreen = Object(external_this_wp_element_["lazy"])(function () {
|
9979 |
-
return Promise.all(/* import() | homescreen */[__webpack_require__.e(2), __webpack_require__.e(4), __webpack_require__.e(5), __webpack_require__.e(6), __webpack_require__.e(35)]).then(__webpack_require__.bind(null, 847));
|
9980 |
-
});
|
9981 |
-
var MarketingOverview = Object(external_this_wp_element_["lazy"])(function () {
|
9982 |
-
return Promise.all(/* import() | marketing-overview */[__webpack_require__.e(2), __webpack_require__.e(5), __webpack_require__.e(6), __webpack_require__.e(39)]).then(__webpack_require__.bind(null, 852));
|
9983 |
-
});
|
9984 |
-
var ProfileWizard = Object(external_this_wp_element_["lazy"])(function () {
|
9985 |
-
return Promise.all(/* import() | profile-wizard */[__webpack_require__.e(2), __webpack_require__.e(5), __webpack_require__.e(53), __webpack_require__.e(47)]).then(__webpack_require__.bind(null, 848));
|
9986 |
-
});
|
9987 |
-
var TIME_EXCLUDED_SCREENS_FILTER = 'woocommerce_admin_time_excluded_screens';
|
9988 |
-
var PAGES_FILTER = 'woocommerce_admin_pages_list';
|
9989 |
-
var controller_getPages = function getPages() {
|
9990 |
-
var pages = [];
|
9991 |
-
var initialBreadcrumbs = [['', wcSettings.woocommerceTranslation]];
|
9992 |
-
pages.push({
|
9993 |
-
container: Homescreen,
|
9994 |
-
path: '/',
|
9995 |
-
breadcrumbs: [].concat(initialBreadcrumbs, [Object(external_this_wp_i18n_["__"])('Home', 'woocommerce-admin')]),
|
9996 |
-
wpOpenMenu: 'toplevel_page_woocommerce',
|
9997 |
-
id: 'home'
|
9998 |
-
});
|
9999 |
|
10000 |
-
|
10001 |
-
|
10002 |
-
|
10003 |
-
path: '/analytics/overview',
|
10004 |
-
breadcrumbs: [].concat(initialBreadcrumbs, [['/analytics/overview', Object(external_this_wp_i18n_["__"])('Analytics', 'woocommerce-admin')], Object(external_this_wp_i18n_["__"])('Overview', 'woocommerce-admin')]),
|
10005 |
-
wpOpenMenu: 'toplevel_page_wc-admin-path--analytics-overview',
|
10006 |
-
id: 'woocommerce-analytics-overview'
|
10007 |
-
});
|
10008 |
-
pages.push({
|
10009 |
-
container: AnalyticsSettings,
|
10010 |
-
path: '/analytics/settings',
|
10011 |
-
breadcrumbs: [].concat(initialBreadcrumbs, [['/analytics/revenue', Object(external_this_wp_i18n_["__"])('Analytics', 'woocommerce-admin')], Object(external_this_wp_i18n_["__"])('Settings', 'woocommerce-admin')]),
|
10012 |
-
wpOpenMenu: 'toplevel_page_wc-admin-path--analytics-overview',
|
10013 |
-
id: 'woocommerce-analytics-settings'
|
10014 |
-
});
|
10015 |
-
pages.push({
|
10016 |
-
container: AnalyticsReport,
|
10017 |
-
path: '/customers',
|
10018 |
-
breadcrumbs: [].concat(initialBreadcrumbs, [Object(external_this_wp_i18n_["__"])('Customers', 'woocommerce-admin')]),
|
10019 |
-
wpOpenMenu: 'toplevel_page_woocommerce',
|
10020 |
-
id: 'woocommerce-analytics-customers'
|
10021 |
-
});
|
10022 |
-
pages.push({
|
10023 |
-
container: AnalyticsReport,
|
10024 |
-
path: '/analytics/:report',
|
10025 |
-
breadcrumbs: function breadcrumbs(_ref) {
|
10026 |
-
var match = _ref.match;
|
10027 |
-
var report = Object(external_lodash_["find"])(Object(get_reports["a" /* default */])(), {
|
10028 |
-
report: match.params.report
|
10029 |
-
});
|
10030 |
|
10031 |
-
|
10032 |
-
|
10033 |
-
|
10034 |
|
10035 |
-
return [].concat(initialBreadcrumbs, [['/analytics/revenue', Object(external_this_wp_i18n_["__"])('Analytics', 'woocommerce-admin')], report.title]);
|
10036 |
-
},
|
10037 |
-
wpOpenMenu: 'toplevel_page_wc-admin-path--analytics-overview'
|
10038 |
-
});
|
10039 |
-
}
|
10040 |
|
10041 |
-
if (window.wcAdminFeatures.marketing) {
|
10042 |
-
pages.push({
|
10043 |
-
container: MarketingOverview,
|
10044 |
-
path: '/marketing',
|
10045 |
-
breadcrumbs: [].concat(initialBreadcrumbs, [['/marketing', Object(external_this_wp_i18n_["__"])('Marketing', 'woocommerce-admin')], Object(external_this_wp_i18n_["__"])('Overview', 'woocommerce-admin')]),
|
10046 |
-
wpOpenMenu: 'toplevel_page_woocommerce-marketing',
|
10047 |
-
id: 'woocommerce-marketing'
|
10048 |
-
});
|
10049 |
-
}
|
10050 |
|
10051 |
-
|
10052 |
-
|
10053 |
-
|
10054 |
-
|
10055 |
-
|
10056 |
-
});
|
10057 |
-
}
|
10058 |
|
10059 |
-
|
10060 |
-
|
10061 |
-
|
10062 |
-
|
|
|
|
|
|
|
|
|
10063 |
|
10064 |
-
|
10065 |
|
10066 |
-
|
10067 |
-
|
10068 |
|
10069 |
-
|
10070 |
-
}
|
10071 |
|
10072 |
-
|
10073 |
-
|
10074 |
-
value: function componentDidMount() {
|
10075 |
-
window.document.documentElement.scrollTop = 0;
|
10076 |
-
window.document.body.classList.remove('woocommerce-admin-is-loading');
|
10077 |
-
}
|
10078 |
-
}, {
|
10079 |
-
key: "componentDidUpdate",
|
10080 |
-
value: function componentDidUpdate(prevProps) {
|
10081 |
-
var prevBaseQuery = Object(external_lodash_["omit"])(prevProps.query, 'chartType', 'filter', 'paged');
|
10082 |
-
var baseQuery = Object(external_lodash_["omit"])(this.props.query, 'chartType', 'filter', 'paged');
|
10083 |
|
10084 |
-
|
10085 |
-
Object(external_this_wc_navigation_["getHistory"])().replace(Object(external_this_wc_navigation_["getNewPath"])({
|
10086 |
-
paged: 1
|
10087 |
-
}));
|
10088 |
-
}
|
10089 |
|
10090 |
-
|
10091 |
-
|
10092 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10093 |
}
|
10094 |
}, {
|
10095 |
key: "render",
|
10096 |
value: function render() {
|
10097 |
var _this$props = this.props,
|
10098 |
-
|
10099 |
-
|
10100 |
-
|
10101 |
-
|
10102 |
-
|
10103 |
-
|
10104 |
-
|
10105 |
-
|
10106 |
-
fallback: Object(external_this_wp_element_["createElement"])(external_this_wc_components_["Spinner"], null)
|
10107 |
-
}, Object(external_this_wp_element_["createElement"])(page.container, {
|
10108 |
-
params: params,
|
10109 |
-
path: url,
|
10110 |
-
pathMatch: page.path,
|
10111 |
-
query: query
|
10112 |
-
}));
|
10113 |
}
|
10114 |
}]);
|
10115 |
|
10116 |
-
return
|
10117 |
}(external_this_wp_element_["Component"]);
|
10118 |
-
/**
|
10119 |
-
* Update an anchor's link in sidebar to include persisted queries. Leave excluded screens
|
10120 |
-
* as is.
|
10121 |
-
*
|
10122 |
-
* @param {HTMLElement} item - Sidebar anchor link.
|
10123 |
-
* @param {Object} nextQuery - A query object to be added to updated hrefs.
|
10124 |
-
* @param {Array} excludedScreens - wc-admin screens to avoid updating.
|
10125 |
-
*/
|
10126 |
|
10127 |
-
|
10128 |
-
if (Object(utils["f" /* isWCAdmin */])(item.href)) {
|
10129 |
-
var search = Object(external_lodash_["last"])(item.href.split('?'));
|
10130 |
-
var query = Object(lib["parse"])(search);
|
10131 |
-
var path = query.path || 'homescreen';
|
10132 |
-
var screen = path.replace('/analytics', '').replace('/', '');
|
10133 |
-
var isExcludedScreen = excludedScreens.includes(screen);
|
10134 |
-
var href = 'admin.php?' + Object(lib["stringify"])(Object.assign(query, isExcludedScreen ? {} : nextQuery)); // Replace the href so you can see the url on hover.
|
10135 |
|
10136 |
-
|
|
|
10137 |
|
10138 |
-
item.onclick = function (e) {
|
10139 |
-
e.preventDefault();
|
10140 |
-
Object(external_this_wc_navigation_["getHistory"])().push(href);
|
10141 |
-
};
|
10142 |
-
}
|
10143 |
-
} // Update's wc-admin links in wp-admin menu
|
10144 |
|
10145 |
-
window.wpNavMenuUrlUpdate = function (query) {
|
10146 |
-
var excludedScreens = Object(external_this_wp_hooks_["applyFilters"])(TIME_EXCLUDED_SCREENS_FILTER, ['stock', 'settings', 'customers', 'homescreen']);
|
10147 |
-
var nextQuery = Object(external_this_wc_navigation_["getPersistedQuery"])(query);
|
10148 |
-
Array.from(document.querySelectorAll('#adminmenu a')).forEach(function (item) {
|
10149 |
-
return updateLinkHref(item, nextQuery, excludedScreens);
|
10150 |
-
});
|
10151 |
-
}; // When the route changes, we need to update wp-admin's menu with the correct section & current link
|
10152 |
|
10153 |
|
10154 |
-
window.wpNavMenuClassChange = function (page, url) {
|
10155 |
-
Array.from(document.getElementsByClassName('current')).forEach(function (item) {
|
10156 |
-
item.classList.remove('current');
|
10157 |
-
});
|
10158 |
-
var submenu = Array.from(document.querySelectorAll('.wp-has-current-submenu'));
|
10159 |
-
submenu.forEach(function (element) {
|
10160 |
-
element.classList.remove('wp-has-current-submenu');
|
10161 |
-
element.classList.remove('wp-menu-open');
|
10162 |
-
element.classList.remove('selected');
|
10163 |
-
element.classList.add('wp-not-current-submenu');
|
10164 |
-
element.classList.add('menu-top');
|
10165 |
-
});
|
10166 |
-
var pageUrl = url === '/' ? 'admin.php?page=wc-admin' : 'admin.php?page=wc-admin&path=' + encodeURIComponent(url);
|
10167 |
-
var currentItemsSelector = url === '/' ? "li > a[href$=\"".concat(pageUrl, "\"], li > a[href*=\"").concat(pageUrl, "?\"]") : "li > a[href*=\"".concat(pageUrl, "\"]");
|
10168 |
-
var currentItems = document.querySelectorAll(currentItemsSelector);
|
10169 |
-
Array.from(currentItems).forEach(function (item) {
|
10170 |
-
item.parentElement.classList.add('current');
|
10171 |
-
});
|
10172 |
|
10173 |
-
if (page.wpOpenMenu) {
|
10174 |
-
var currentMenu = document.querySelector('#' + page.wpOpenMenu);
|
10175 |
|
10176 |
-
if (currentMenu) {
|
10177 |
-
currentMenu.classList.remove('wp-not-current-submenu');
|
10178 |
-
currentMenu.classList.add('wp-has-current-submenu');
|
10179 |
-
currentMenu.classList.add('wp-menu-open');
|
10180 |
-
currentMenu.classList.add('current');
|
10181 |
-
}
|
10182 |
-
}
|
10183 |
|
10184 |
-
var wpWrap = document.querySelector('#wpwrap');
|
10185 |
-
wpWrap.classList.remove('wp-responsive-open');
|
10186 |
-
};
|
10187 |
-
// EXTERNAL MODULE: ./node_modules/classnames/index.js
|
10188 |
-
var classnames = __webpack_require__(4);
|
10189 |
-
var classnames_default = /*#__PURE__*/__webpack_require__.n(classnames);
|
10190 |
|
10191 |
-
|
10192 |
-
var external_this_wp_htmlEntities_ = __webpack_require__(81);
|
10193 |
|
10194 |
-
|
10195 |
-
var build_module_text = __webpack_require__(190);
|
10196 |
|
10197 |
-
|
10198 |
-
|
|
|
10199 |
|
10200 |
-
|
10201 |
-
|
10202 |
-
|
10203 |
|
10204 |
-
// EXTERNAL MODULE: ./node_modules/react-click-outside/dist/index.js
|
10205 |
-
var dist = __webpack_require__(533);
|
10206 |
-
var dist_default = /*#__PURE__*/__webpack_require__.n(dist);
|
10207 |
|
10208 |
-
// EXTERNAL MODULE: ./node_modules/@wordpress/components/build-module/button/index.js
|
10209 |
-
var build_module_button = __webpack_require__(72);
|
10210 |
|
10211 |
-
|
10212 |
-
|
10213 |
-
|
10214 |
|
10215 |
-
// EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/icon/index.js
|
10216 |
-
var build_module_icon = __webpack_require__(570);
|
10217 |
|
10218 |
-
|
10219 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10220 |
|
10221 |
-
// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/lifesaver.js
|
10222 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10223 |
|
10224 |
-
|
10225 |
-
|
10226 |
-
|
|
|
|
|
10227 |
|
10228 |
-
var
|
10229 |
-
xmlns: "http://www.w3.org/2000/svg",
|
10230 |
-
viewBox: "0 0 24 24"
|
10231 |
-
}, Object(external_this_wp_element_["createElement"])(svg["b" /* Path */], {
|
10232 |
-
fillRule: "evenodd",
|
10233 |
-
d: "M17.375 15.656A6.47 6.47 0 0018.5 12a6.47 6.47 0 00-.943-3.374l-1.262.813c.448.749.705 1.625.705 2.561a4.977 4.977 0 01-.887 2.844l1.262.813zm-1.951 1.87l-.813-1.261A4.976 4.976 0 0112 17c-.958 0-1.852-.27-2.613-.736l-.812 1.261A6.47 6.47 0 0012 18.5a6.47 6.47 0 003.424-.974zm-8.8-1.87A6.47 6.47 0 015.5 12c0-1.235.344-2.39.943-3.373l1.261.812A4.977 4.977 0 007 12c0 1.056.328 2.036.887 2.843l-1.262.813zm2.581-7.803A4.977 4.977 0 0112 7c1.035 0 1.996.314 2.794.853l.812-1.262A6.47 6.47 0 0012 5.5a6.47 6.47 0 00-3.607 1.092l.812 1.261zM12 20a8 8 0 100-16 8 8 0 000 16zm0-4.5a3.5 3.5 0 100-7 3.5 3.5 0 000 7z",
|
10234 |
-
clipRule: "evenodd"
|
10235 |
-
}));
|
10236 |
-
/* harmony default export */ var library_lifesaver = (lifesaver);
|
10237 |
-
//# sourceMappingURL=lifesaver.js.map
|
10238 |
-
// EXTERNAL MODULE: ./client/header/activity-panel/style.scss
|
10239 |
-
var activity_panel_style = __webpack_require__(569);
|
10240 |
|
10241 |
-
|
|
|
10242 |
|
|
|
10243 |
|
10244 |
-
|
10245 |
-
|
10246 |
-
|
10247 |
|
|
|
|
|
|
|
10248 |
|
|
|
|
|
10249 |
|
10250 |
-
|
10251 |
-
|
10252 |
-
height = _ref$height === void 0 ? 24 : _ref$height,
|
10253 |
-
_ref$width = _ref.width,
|
10254 |
-
width = _ref$width === void 0 ? 24 : _ref$width,
|
10255 |
-
_ref$hasUnread = _ref.hasUnread,
|
10256 |
-
hasUnread = _ref$hasUnread === void 0 ? false : _ref$hasUnread;
|
10257 |
-
var classes = classnames_default()('woocommerce-layout__activity-panel-toggle-bubble', {
|
10258 |
-
'has-unread': hasUnread
|
10259 |
-
});
|
10260 |
-
/* eslint-disable max-len */
|
10261 |
|
10262 |
-
|
10263 |
-
|
10264 |
-
}, Object(external_this_wp_element_["createElement"])("svg", {
|
10265 |
-
height: height,
|
10266 |
-
width: width,
|
10267 |
-
viewBox: "0 0 24 24"
|
10268 |
-
}, Object(external_this_wp_element_["createElement"])("path", {
|
10269 |
-
d: "M18.9 2H5.1C3.4 2 2 3.4 2 5.1v10.7C2 17.6 3.4 19 5.1 19H9l6 3-1-3h4.9c1.7 0 3.1-1.4 3.1-3.1V5.1C22 3.4 20.6 2 18.9 2zm-1.5 4.5c-.4.8-.8 2.1-1 3.9-.3 1.8-.4 3.1-.3 4.1 0 .3 0 .5-.1.7-.1.2-.3.4-.6.4s-.6-.1-.9-.4c-1-1-1.8-2.6-2.4-4.6-.7 1.4-1.2 2.4-1.6 3.1-.6 1.2-1.2 1.8-1.6 1.9-.3 0-.5-.2-.8-.7-.5-1.4-1.1-4.2-1.7-8.2 0-.3 0-.5.2-.7.1-.2.4-.3.7-.4.5 0 .9.2.9.8.3 2.3.7 4.2 1.1 5.7l2.4-4.5c.2-.4.4-.6.8-.6.5 0 .8.3.9.9.3 1.4.6 2.6 1 3.7.3-2.7.8-4.7 1.4-5.9.2-.3.4-.5.7-.5.2 0 .5.1.7.2.2.2.3.4.3.6 0 .2 0 .4-.1.5z"
|
10270 |
-
})));
|
10271 |
-
/* eslint-enable max-len */
|
10272 |
-
};
|
10273 |
|
10274 |
-
|
10275 |
-
|
10276 |
-
|
10277 |
-
|
10278 |
-
|
10279 |
-
|
10280 |
-
// EXTERNAL MODULE: ./client/inbox-panel/utils.js
|
10281 |
-
var inbox_panel_utils = __webpack_require__(446);
|
10282 |
|
10283 |
-
|
10284 |
-
|
10285 |
-
|
10286 |
-
|
|
|
|
|
|
|
10287 |
|
10288 |
|
10289 |
-
|
10290 |
-
|
10291 |
-
|
10292 |
|
|
|
|
|
10293 |
|
10294 |
-
|
10295 |
-
|
10296 |
-
|
10297 |
-
|
10298 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10299 |
|
10300 |
-
|
10301 |
-
|
10302 |
|
10303 |
-
|
10304 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10305 |
|
10306 |
-
|
10307 |
-
return null;
|
10308 |
-
} // @todo This method would be more performant if we ask only for 1 item per page with status "unactioned".
|
10309 |
-
// This change should be applied after having pagination implemented.
|
10310 |
|
|
|
10311 |
|
10312 |
-
|
10313 |
-
|
10314 |
-
|
10315 |
-
status: 'unactioned',
|
10316 |
-
type: external_this_wc_data_["QUERY_DEFAULTS"].noteTypes,
|
10317 |
-
orderby: 'date',
|
10318 |
-
order: 'desc'
|
10319 |
-
}; // Disable eslint rule requiring `latestNotes` to be defined below because the next two statements
|
10320 |
-
// depend on `getNotes` to have been called.
|
10321 |
-
// eslint-disable-next-line @wordpress/no-unused-vars-before-return
|
10322 |
|
10323 |
-
|
10324 |
-
|
10325 |
-
|
|
|
|
|
|
|
|
|
|
|
10326 |
|
10327 |
-
if (isError || isRequesting) {
|
10328 |
-
return null;
|
10329 |
-
}
|
10330 |
|
10331 |
-
var unreadNotesCount = Object(inbox_panel_utils["a" /* getUnreadNotesCount */])(latestNotes, lastRead);
|
10332 |
-
return unreadNotesCount > 0;
|
10333 |
-
}
|
10334 |
-
function getUnapprovedReviews(select) {
|
10335 |
-
var _select3 = select(external_this_wc_data_["REVIEWS_STORE_NAME"]),
|
10336 |
-
getReviewsTotalCount = _select3.getReviewsTotalCount,
|
10337 |
-
getReviewsError = _select3.getReviewsError,
|
10338 |
-
isResolving = _select3.isResolving;
|
10339 |
-
|
10340 |
-
var reviewsEnabled = Object(settings["g" /* getSetting */])('reviewsEnabled');
|
10341 |
-
|
10342 |
-
if (reviewsEnabled === 'yes') {
|
10343 |
-
var actionableReviewsQuery = {
|
10344 |
-
page: 1,
|
10345 |
-
// @todo we are not using this review, so when the endpoint supports it,
|
10346 |
-
// it could be replaced with `per_page: 0`
|
10347 |
-
per_page: 1,
|
10348 |
-
status: 'hold'
|
10349 |
-
};
|
10350 |
-
var totalActionableReviews = getReviewsTotalCount(actionableReviewsQuery);
|
10351 |
-
var isActionableReviewsError = Boolean(getReviewsError(actionableReviewsQuery));
|
10352 |
-
var isActionableReviewsRequesting = isResolving('getReviewsTotalCount', [actionableReviewsQuery]);
|
10353 |
|
10354 |
-
if (!isActionableReviewsError && !isActionableReviewsRequesting) {
|
10355 |
-
return totalActionableReviews > 0;
|
10356 |
-
}
|
10357 |
-
}
|
10358 |
|
10359 |
-
|
10360 |
-
}
|
10361 |
-
function getUnreadStock() {
|
10362 |
-
return Object(settings["g" /* getSetting */])('hasLowStock', false);
|
10363 |
-
}
|
10364 |
-
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/slicedToArray.js
|
10365 |
-
var slicedToArray = __webpack_require__(34);
|
10366 |
-
var slicedToArray_default = /*#__PURE__*/__webpack_require__.n(slicedToArray);
|
10367 |
|
10368 |
-
|
10369 |
-
var menu = __webpack_require__(761);
|
10370 |
|
10371 |
-
|
|
|
|
|
10372 |
|
10373 |
|
10374 |
/**
|
10375 |
-
*
|
10376 |
*/
|
10377 |
|
10378 |
|
10379 |
|
10380 |
-
|
10381 |
-
var icon = _ref.icon,
|
10382 |
-
|
10383 |
-
|
10384 |
-
|
10385 |
-
selected = _ref.selected,
|
10386 |
-
isPanelOpen = _ref.isPanelOpen,
|
10387 |
-
onTabClick = _ref.onTabClick,
|
10388 |
-
index = _ref.index;
|
10389 |
-
var className = classnames_default()('woocommerce-layout__activity-panel-tab', {
|
10390 |
-
'is-active': isPanelOpen && selected,
|
10391 |
-
'has-unread': unread
|
10392 |
-
});
|
10393 |
-
var tabIndex = -1; // Only make this item tabbable if it is the currently selected item, or the panel is closed and the item is the first item.
|
10394 |
|
10395 |
-
|
10396 |
-
|
10397 |
-
}
|
10398 |
|
10399 |
-
|
10400 |
-
|
10401 |
-
|
10402 |
-
|
10403 |
-
|
10404 |
-
|
10405 |
-
"aria-controls": "activity-panel-".concat(name),
|
10406 |
-
key: tabKey,
|
10407 |
-
id: tabKey,
|
10408 |
-
onClick: function onClick() {
|
10409 |
-
onTabClick(name);
|
10410 |
-
}
|
10411 |
-
}, icon, title, ' ', unread && Object(external_this_wp_element_["createElement"])("span", {
|
10412 |
-
className: "screen-reader-text"
|
10413 |
-
}, Object(external_this_wp_i18n_["__"])('unread activity', 'woocommerce-admin')));
|
10414 |
-
};
|
10415 |
-
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/defineProperty.js
|
10416 |
-
var esm_defineProperty = __webpack_require__(8);
|
10417 |
|
10418 |
-
|
10419 |
-
|
|
|
|
|
|
|
10420 |
|
10421 |
-
// EXTERNAL MODULE: ./node_modules/@wordpress/deprecated/build-module/index.js
|
10422 |
-
var deprecated_build_module = __webpack_require__(57);
|
10423 |
|
10424 |
-
|
10425 |
-
var dropdown = __webpack_require__(535);
|
10426 |
|
10427 |
-
|
|
|
|
|
|
|
|
|
|
|
10428 |
|
|
|
|
|
|
|
|
|
10429 |
|
|
|
|
|
|
|
|
|
|
|
10430 |
|
|
|
|
|
10431 |
|
10432 |
-
|
|
|
|
|
|
|
|
|
10433 |
|
10434 |
-
|
|
|
10435 |
|
10436 |
-
|
10437 |
-
|
10438 |
-
*/
|
10439 |
|
|
|
|
|
|
|
10440 |
|
10441 |
-
|
10442 |
-
|
10443 |
-
*/
|
|
|
|
|
10444 |
|
10445 |
|
10446 |
|
10447 |
/**
|
10448 |
-
*
|
10449 |
*/
|
10450 |
|
10451 |
|
|
|
|
|
|
|
|
|
|
|
10452 |
|
|
|
|
|
10453 |
|
|
|
|
|
10454 |
|
10455 |
-
|
10456 |
-
|
10457 |
-
|
10458 |
-
|
10459 |
-
|
10460 |
|
10461 |
-
|
10462 |
-
|
|
|
10463 |
}
|
10464 |
|
10465 |
-
|
10466 |
-
|
10467 |
-
|
10468 |
-
function DropdownMenu(_ref) {
|
10469 |
-
var children = _ref.children,
|
10470 |
-
className = _ref.className,
|
10471 |
-
controls = _ref.controls,
|
10472 |
-
_ref$icon = _ref.icon,
|
10473 |
-
icon = _ref$icon === void 0 ? 'menu' : _ref$icon,
|
10474 |
-
label = _ref.label,
|
10475 |
-
popoverProps = _ref.popoverProps,
|
10476 |
-
toggleProps = _ref.toggleProps,
|
10477 |
-
menuProps = _ref.menuProps,
|
10478 |
-
_ref$disableOpenOnArr = _ref.disableOpenOnArrowDown,
|
10479 |
-
disableOpenOnArrowDown = _ref$disableOpenOnArr === void 0 ? false : _ref$disableOpenOnArr,
|
10480 |
-
menuLabel = _ref.menuLabel,
|
10481 |
-
position = _ref.position,
|
10482 |
-
noIcons = _ref.noIcons;
|
10483 |
|
10484 |
-
|
10485 |
-
|
10486 |
-
alternative: '`menuProps` object and its `aria-label` property',
|
10487 |
-
plugin: 'Gutenberg'
|
10488 |
});
|
10489 |
}
|
10490 |
|
10491 |
-
if (
|
10492 |
-
|
10493 |
-
|
10494 |
-
plugin: 'Gutenberg'
|
10495 |
});
|
10496 |
}
|
10497 |
|
10498 |
-
|
10499 |
-
|
10500 |
-
} // Normalize controls to nested array of objects (sets of controls)
|
10501 |
|
|
|
|
|
10502 |
|
10503 |
-
|
|
|
|
|
10504 |
|
10505 |
-
|
10506 |
-
|
|
|
|
|
|
|
10507 |
|
10508 |
-
if (!Array.isArray(controlSets[0])) {
|
10509 |
-
controlSets = [controlSets];
|
10510 |
-
}
|
10511 |
-
}
|
10512 |
|
10513 |
-
|
10514 |
-
|
10515 |
-
|
10516 |
-
}, popoverProps);
|
10517 |
-
return Object(external_this_wp_element_["createElement"])(dropdown["a" /* default */], {
|
10518 |
-
className: classnames_default()('components-dropdown-menu', className),
|
10519 |
-
popoverProps: mergedPopoverProps,
|
10520 |
-
renderToggle: function renderToggle(_ref2) {
|
10521 |
-
var _toggleProps$showTool;
|
10522 |
|
10523 |
-
var isOpen = _ref2.isOpen,
|
10524 |
-
onToggle = _ref2.onToggle;
|
10525 |
|
10526 |
-
|
10527 |
-
|
10528 |
-
|
10529 |
-
}
|
10530 |
|
10531 |
-
|
10532 |
-
|
10533 |
-
|
10534 |
-
onToggle();
|
10535 |
-
}
|
10536 |
-
};
|
10537 |
|
10538 |
-
|
10539 |
-
|
10540 |
-
'is-opened': isOpen
|
10541 |
-
})
|
10542 |
-
}, toggleProps);
|
10543 |
-
return Object(external_this_wp_element_["createElement"])(build_module_button["a" /* default */], Object(esm_extends["a" /* default */])({}, mergedToggleProps, {
|
10544 |
-
icon: icon,
|
10545 |
-
onClick: function onClick(event) {
|
10546 |
-
onToggle(event);
|
10547 |
|
10548 |
-
|
10549 |
-
|
10550 |
-
|
10551 |
-
},
|
10552 |
-
onKeyDown: function onKeyDown(event) {
|
10553 |
-
openOnArrowDown(event);
|
10554 |
|
10555 |
-
|
10556 |
-
|
10557 |
-
|
10558 |
-
|
10559 |
-
"aria-haspopup": "true",
|
10560 |
-
"aria-expanded": isOpen,
|
10561 |
-
label: label,
|
10562 |
-
showTooltip: (_toggleProps$showTool = toggleProps === null || toggleProps === void 0 ? void 0 : toggleProps.showTooltip) !== null && _toggleProps$showTool !== void 0 ? _toggleProps$showTool : true
|
10563 |
-
}), mergedToggleProps.children);
|
10564 |
-
},
|
10565 |
-
renderContent: function renderContent(props) {
|
10566 |
-
var mergedMenuProps = mergeProps({
|
10567 |
-
'aria-label': menuLabel || label,
|
10568 |
-
className: classnames_default()('components-dropdown-menu__menu', {
|
10569 |
-
'no-icons': noIcons
|
10570 |
-
})
|
10571 |
-
}, menuProps);
|
10572 |
-
return Object(external_this_wp_element_["createElement"])(menu["a" /* default */], Object(esm_extends["a" /* default */])({}, mergedMenuProps, {
|
10573 |
-
role: "menu"
|
10574 |
-
}), Object(external_lodash_["isFunction"])(children) ? children(props) : null, Object(external_lodash_["flatMap"])(controlSets, function (controlSet, indexOfSet) {
|
10575 |
-
return controlSet.map(function (control, indexOfControl) {
|
10576 |
-
return Object(external_this_wp_element_["createElement"])(build_module_button["a" /* default */], {
|
10577 |
-
key: [indexOfSet, indexOfControl].join(),
|
10578 |
-
onClick: function onClick(event) {
|
10579 |
-
event.stopPropagation();
|
10580 |
-
props.onClose();
|
10581 |
|
10582 |
-
|
10583 |
-
|
10584 |
-
|
10585 |
-
|
10586 |
-
className: classnames_default()('components-dropdown-menu__menu-item', {
|
10587 |
-
'has-separator': indexOfSet > 0 && indexOfControl === 0,
|
10588 |
-
'is-active': control.isActive
|
10589 |
-
}),
|
10590 |
-
icon: control.icon,
|
10591 |
-
"aria-checked": control.role === 'menuitemcheckbox' || control.role === 'menuitemradio' ? control.isActive : undefined,
|
10592 |
-
role: control.role === 'menuitemcheckbox' || control.role === 'menuitemradio' ? control.role : 'menuitem',
|
10593 |
-
disabled: control.isDisabled
|
10594 |
-
}, control.title);
|
10595 |
-
});
|
10596 |
-
}));
|
10597 |
-
}
|
10598 |
-
});
|
10599 |
}
|
10600 |
|
10601 |
-
/* harmony default export */
|
10602 |
//# sourceMappingURL=index.js.map
|
10603 |
-
// EXTERNAL MODULE: ./node_modules/@wordpress/compose/build-module/hooks/use-instance-id/index.js
|
10604 |
-
var use_instance_id = __webpack_require__(300);
|
10605 |
|
10606 |
-
|
|
|
|
|
10607 |
|
|
|
10608 |
|
10609 |
-
|
10610 |
-
|
10611 |
-
*/
|
10612 |
|
10613 |
-
|
10614 |
-
|
10615 |
-
|
|
|
|
|
10616 |
|
|
|
|
|
10617 |
|
|
|
|
|
|
|
10618 |
|
10619 |
-
|
10620 |
-
|
10621 |
-
_ref$className = _ref.className,
|
10622 |
-
className = _ref$className === void 0 ? '' : _ref$className,
|
10623 |
-
label = _ref.label;
|
10624 |
-
var instanceId = Object(use_instance_id["a" /* default */])(MenuGroup);
|
10625 |
|
10626 |
-
|
10627 |
-
|
10628 |
-
}
|
10629 |
|
10630 |
-
|
10631 |
-
|
10632 |
-
return Object(external_this_wp_element_["createElement"])("div", {
|
10633 |
-
className: classNames
|
10634 |
-
}, label && Object(external_this_wp_element_["createElement"])("div", {
|
10635 |
-
className: "components-menu-group__label",
|
10636 |
-
id: labelId,
|
10637 |
-
"aria-hidden": "true"
|
10638 |
-
}, label), Object(external_this_wp_element_["createElement"])("div", {
|
10639 |
-
role: "group",
|
10640 |
-
"aria-labelledby": label ? labelId : null
|
10641 |
-
}, children));
|
10642 |
-
}
|
10643 |
-
/* harmony default export */ var menu_group = (MenuGroup);
|
10644 |
-
//# sourceMappingURL=index.js.map
|
10645 |
-
// EXTERNAL MODULE: ./node_modules/@wordpress/components/node_modules/@wordpress/icons/build-module/library/check.js
|
10646 |
-
var check = __webpack_require__(759);
|
10647 |
|
10648 |
-
// EXTERNAL MODULE: ./node_modules/@
|
10649 |
-
var
|
10650 |
|
10651 |
-
// EXTERNAL MODULE: ./node_modules/@wordpress/
|
10652 |
-
var
|
10653 |
|
10654 |
-
// EXTERNAL MODULE: ./node_modules/@wordpress/
|
10655 |
-
var
|
10656 |
|
10657 |
-
//
|
|
|
10658 |
|
|
|
|
|
10659 |
|
|
|
10660 |
|
10661 |
|
10662 |
-
/**
|
10663 |
-
* External dependencies
|
10664 |
-
*/
|
10665 |
|
|
|
|
|
|
|
10666 |
|
10667 |
/**
|
10668 |
* WordPress dependencies
|
10669 |
*/
|
10670 |
|
10671 |
-
|
10672 |
/**
|
10673 |
-
*
|
10674 |
*/
|
10675 |
|
10676 |
-
|
10677 |
-
|
10678 |
|
10679 |
/**
|
10680 |
-
*
|
10681 |
*
|
10682 |
-
* @param {Object}
|
10683 |
-
* @param {
|
10684 |
-
* @param {string}
|
10685 |
-
* @param {string}
|
10686 |
-
* @param {
|
10687 |
-
*
|
10688 |
-
*
|
10689 |
-
* @param {string}
|
10690 |
-
* @param {
|
10691 |
*
|
10692 |
-
* @return {
|
10693 |
*/
|
10694 |
|
10695 |
-
function
|
10696 |
-
var
|
10697 |
-
|
10698 |
-
className = _ref.className,
|
10699 |
-
icon = _ref.icon,
|
10700 |
-
shortcut = _ref.shortcut,
|
10701 |
-
isSelected = _ref.isSelected,
|
10702 |
-
_ref$role = _ref.role,
|
10703 |
-
role = _ref$role === void 0 ? 'menuitem' : _ref$role,
|
10704 |
-
props = Object(esm_objectWithoutProperties["a" /* default */])(_ref, ["children", "info", "className", "icon", "shortcut", "isSelected", "role"]);
|
10705 |
|
10706 |
-
|
|
|
|
|
|
|
|
|
10707 |
|
10708 |
-
if (
|
10709 |
-
|
10710 |
-
|
10711 |
-
|
10712 |
-
|
10713 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10714 |
}
|
10715 |
|
10716 |
-
|
10717 |
-
|
10718 |
-
|
10719 |
-
|
|
|
|
|
10720 |
}
|
10721 |
|
10722 |
-
|
10723 |
-
|
10724 |
-
|
10725 |
-
|
10726 |
-
|
10727 |
-
|
10728 |
-
|
10729 |
-
|
10730 |
-
shortcut: shortcut
|
10731 |
-
}), icon && Object(external_this_wp_element_["createElement"])(components_build_module_icon["a" /* default */], {
|
10732 |
-
icon: icon
|
10733 |
-
}));
|
10734 |
-
}
|
10735 |
-
/* harmony default export */ var menu_item = (Object(external_this_wp_element_["forwardRef"])(MenuItem));
|
10736 |
-
//# sourceMappingURL=index.js.map
|
10737 |
-
// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/menu-items-choice/index.js
|
10738 |
|
|
|
|
|
10739 |
|
10740 |
-
|
10741 |
-
|
10742 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10743 |
|
10744 |
-
|
10745 |
-
|
10746 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
10747 |
|
|
|
|
|
|
|
|
|
10748 |
|
|
|
|
|
|
|
|
|
|
|
|
|
10749 |
/**
|
10750 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10751 |
*/
|
10752 |
|
|
|
|
|
10753 |
|
10754 |
-
|
10755 |
-
|
10756 |
-
|
10757 |
-
|
10758 |
-
|
10759 |
-
|
10760 |
-
|
10761 |
-
|
10762 |
-
|
10763 |
-
|
10764 |
-
|
10765 |
-
|
10766 |
-
|
10767 |
-
|
10768 |
-
|
10769 |
-
|
10770 |
-
|
10771 |
-
|
10772 |
-
|
10773 |
-
|
10774 |
-
|
10775 |
-
|
10776 |
-
|
10777 |
-
|
10778 |
-
|
10779 |
-
|
10780 |
-
|
10781 |
-
|
10782 |
-
|
10783 |
-
}
|
10784 |
-
|
10785 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10786 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10787 |
|
|
|
|
|
|
|
|
|
|
|
|
|
10788 |
/**
|
10789 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10790 |
*/
|
10791 |
|
10792 |
-
|
10793 |
-
|
10794 |
-
|
10795 |
-
|
10796 |
-
|
10797 |
-
|
10798 |
-
fill: "none",
|
10799 |
-
xmlns: "http://www.w3.org/2000/svg"
|
10800 |
-
}, Object(external_this_wp_element_["createElement"])("path", {
|
10801 |
-
d: "M13.8053 15.3982C13.8053 15.7965 13.4867 16.1947 13.0089 16.1947H6.79646C6.55752 16.1947 6.39823 16.115 6.23894 15.9558C6.07965 15.7965 6 15.6372 6 15.3982V6.79646C6 6.63717 6.15929 6.39823 6.23894 6.23894C6.39823 6.07965 6.55752 6 6.79646 6H13.0089C13.4071 6 13.8053 6.31858 13.8053 6.79646V15.3982Z",
|
10802 |
-
strokeWidth: "1.5",
|
10803 |
-
strokeLinecap: "round",
|
10804 |
-
strokeLinejoin: "round"
|
10805 |
-
}), Object(external_this_wp_element_["createElement"])("path", {
|
10806 |
-
d: "M23.9203 10.6195C23.9203 11.0177 23.6017 11.4159 23.1238 11.4159H16.9115C16.6725 11.4159 16.5132 11.3363 16.3539 11.177C16.1946 11.0177 16.115 10.8584 16.115 10.6195V6.79646C16.115 6.39823 16.4336 6 16.9115 6H23.1238C23.5221 6 23.9203 6.31858 23.9203 6.79646V10.6195Z",
|
10807 |
-
strokeWidth: "1.5",
|
10808 |
-
strokeLinecap: "round",
|
10809 |
-
strokeLinejoin: "round"
|
10810 |
-
}), Object(external_this_wp_element_["createElement"])("path", {
|
10811 |
-
d: "M13.8053 23.2035C13.8053 23.4424 13.7257 23.6017 13.5664 23.761C13.4071 23.9203 13.2478 23.9999 13.0089 23.9999H6.79646C6.39823 23.9999 6 23.6813 6 23.2035V19.3804C6 19.1415 6.07965 18.9822 6.23894 18.8229C6.39823 18.6636 6.55752 18.584 6.79646 18.584H13.0089C13.4071 18.584 13.8053 18.9026 13.8053 19.3804V23.2035Z",
|
10812 |
-
strokeWidth: "1.5",
|
10813 |
-
strokeLinecap: "round",
|
10814 |
-
strokeLinejoin: "round"
|
10815 |
-
}), Object(external_this_wp_element_["createElement"])("path", {
|
10816 |
-
d: "M16.9912 23.9999C16.7522 23.9999 16.5929 23.9202 16.4336 23.7609C16.2743 23.6016 16.1947 23.4423 16.1947 23.2034V14.6016C16.1947 14.3627 16.2743 14.2034 16.4336 14.0441C16.5929 13.8848 16.7522 13.8052 16.9912 13.8052H23.2036C23.4425 13.8052 23.6018 13.8848 23.7611 14.0441C23.9204 14.2034 24 14.3627 24 14.6016V23.2034C24 23.6016 23.6814 23.9999 23.2036 23.9999H16.9912Z",
|
10817 |
-
strokeWidth: "1.5",
|
10818 |
-
strokeLinecap: "round",
|
10819 |
-
strokeLinejoin: "round"
|
10820 |
-
})), Object(external_this_wp_i18n_["__"])('Display', 'woocommerce-admin'));
|
10821 |
-
};
|
10822 |
-
// CONCATENATED MODULE: ./client/header/activity-panel/display-options/icons/single-column.js
|
10823 |
-
|
10824 |
-
var single_column_SingleColumnIcon = function SingleColumnIcon() {
|
10825 |
-
return Object(external_this_wp_element_["createElement"])("svg", {
|
10826 |
-
className: "woocommerce-layout__activity-panel-tab-icon",
|
10827 |
-
width: "12",
|
10828 |
-
height: "14",
|
10829 |
-
viewBox: "0 0 12 14",
|
10830 |
-
fill: "none",
|
10831 |
-
xmlns: "http://www.w3.org/2000/svg"
|
10832 |
-
}, Object(external_this_wp_element_["createElement"])("rect", {
|
10833 |
-
x: "0.5",
|
10834 |
-
y: "0.5",
|
10835 |
-
width: "11",
|
10836 |
-
height: "13",
|
10837 |
-
strokeWidth: "1"
|
10838 |
-
}));
|
10839 |
-
};
|
10840 |
-
// CONCATENATED MODULE: ./client/header/activity-panel/display-options/icons/two-columns.js
|
10841 |
-
|
10842 |
-
var two_columns_TwoColumnsIcon = function TwoColumnsIcon() {
|
10843 |
-
return Object(external_this_wp_element_["createElement"])("svg", {
|
10844 |
-
className: "woocommerce-layout__activity-panel-tab-icon",
|
10845 |
-
width: "18",
|
10846 |
-
height: "14",
|
10847 |
-
viewBox: "0 0 18 14",
|
10848 |
-
fill: "none",
|
10849 |
-
xmlns: "http://www.w3.org/2000/svg"
|
10850 |
-
}, Object(external_this_wp_element_["createElement"])("rect", {
|
10851 |
-
x: "0.5",
|
10852 |
-
y: "0.5",
|
10853 |
-
width: "7",
|
10854 |
-
height: "13",
|
10855 |
-
strokeWidth: "1"
|
10856 |
-
}), Object(external_this_wp_element_["createElement"])("rect", {
|
10857 |
-
x: "9.5",
|
10858 |
-
y: "0.5",
|
10859 |
-
width: "7",
|
10860 |
-
height: "13",
|
10861 |
-
strokeWidth: "1"
|
10862 |
-
}));
|
10863 |
-
};
|
10864 |
-
// CONCATENATED MODULE: ./client/header/activity-panel/display-options/index.js
|
10865 |
|
|
|
|
|
|
|
|
|
|
|
|
|
10866 |
|
10867 |
-
|
10868 |
-
|
10869 |
-
|
|
|
|
|
|
|
|
|
10870 |
|
|
|
|
|
10871 |
|
|
|
|
|
10872 |
|
|
|
|
|
10873 |
|
|
|
|
|
10874 |
|
10875 |
-
|
10876 |
-
|
10877 |
-
*/
|
10878 |
|
|
|
|
|
10879 |
|
|
|
|
|
10880 |
|
|
|
10881 |
|
10882 |
-
var LAYOUTS = [{
|
10883 |
-
value: 'single_column',
|
10884 |
-
label: Object(external_this_wp_element_["createElement"])(external_this_wp_element_["Fragment"], null, Object(external_this_wp_element_["createElement"])(single_column_SingleColumnIcon, null), Object(external_this_wp_i18n_["__"])('Single column', 'woocommerce-admin'))
|
10885 |
-
}, {
|
10886 |
-
value: 'two_columns',
|
10887 |
-
label: Object(external_this_wp_element_["createElement"])(external_this_wp_element_["Fragment"], null, Object(external_this_wp_element_["createElement"])(two_columns_TwoColumnsIcon, null), Object(external_this_wp_i18n_["__"])('Two columns', 'woocommerce-admin'))
|
10888 |
-
}];
|
10889 |
-
var display_options_DisplayOptions = function DisplayOptions() {
|
10890 |
-
var defaultHomescreenLayout = Object(external_this_wp_data_["useSelect"])(function (select) {
|
10891 |
-
var _select = select(external_this_wc_data_["OPTIONS_STORE_NAME"]),
|
10892 |
-
getOption = _select.getOption;
|
10893 |
|
10894 |
-
return getOption('woocommerce_default_homepage_layout') || 'single_column';
|
10895 |
-
});
|
10896 |
|
10897 |
-
var _useUserPreferences = Object(external_this_wc_data_["useUserPreferences"])(),
|
10898 |
-
updateUserPreferences = _useUserPreferences.updateUserPreferences,
|
10899 |
-
layout = _useUserPreferences.homepage_layout;
|
10900 |
|
10901 |
-
return Object(external_this_wp_element_["createElement"])(dropdown_menu, {
|
10902 |
-
icon: Object(external_this_wp_element_["createElement"])(display_DisplayIcon, null)
|
10903 |
-
/* translators: button label text should, if possible, be under 16 characters. */
|
10904 |
-
,
|
10905 |
-
label: Object(external_this_wp_i18n_["__"])('Display options', 'woocommerce-admin'),
|
10906 |
-
toggleProps: {
|
10907 |
-
className: 'woocommerce-layout__activity-panel-tab display-options',
|
10908 |
-
onClick: function onClick() {
|
10909 |
-
return Object(external_this_wc_tracks_["recordEvent"])('homescreen_display_click');
|
10910 |
-
}
|
10911 |
-
},
|
10912 |
-
popoverProps: {
|
10913 |
-
className: 'woocommerce-layout__activity-panel-popover'
|
10914 |
-
}
|
10915 |
-
}, function (_ref) {
|
10916 |
-
var onClose = _ref.onClose;
|
10917 |
-
return Object(external_this_wp_element_["createElement"])(menu_group, {
|
10918 |
-
className: "woocommerce-layout__homescreen-display-options",
|
10919 |
-
label: Object(external_this_wp_i18n_["__"])('Layout', 'woocommerce-admin')
|
10920 |
-
}, Object(external_this_wp_element_["createElement"])(MenuItemsChoice, {
|
10921 |
-
choices: LAYOUTS,
|
10922 |
-
onSelect: function onSelect(newLayout) {
|
10923 |
-
updateUserPreferences({
|
10924 |
-
homepage_layout: newLayout
|
10925 |
-
});
|
10926 |
-
onClose();
|
10927 |
-
Object(external_this_wc_tracks_["recordEvent"])('homescreen_display_option', {
|
10928 |
-
display_option: newLayout
|
10929 |
-
});
|
10930 |
-
},
|
10931 |
-
value: layout || defaultHomescreenLayout
|
10932 |
-
}));
|
10933 |
-
});
|
10934 |
-
};
|
10935 |
-
// CONCATENATED MODULE: ./client/header/activity-panel/tabs/index.js
|
10936 |
|
10937 |
|
|
|
10938 |
|
|
|
10939 |
|
10940 |
/**
|
10941 |
-
*
|
10942 |
*/
|
10943 |
|
10944 |
-
|
10945 |
-
|
10946 |
/**
|
10947 |
* Internal dependencies
|
10948 |
*/
|
10949 |
|
10950 |
|
10951 |
|
10952 |
-
var
|
10953 |
-
|
10954 |
-
_onTabClick = _ref.onTabClick,
|
10955 |
-
selectedTabName = _ref.selectedTab,
|
10956 |
-
showDisplayOptions = _ref.showDisplayOptions,
|
10957 |
-
_ref$tabOpen = _ref.tabOpen,
|
10958 |
-
tabOpen = _ref$tabOpen === void 0 ? false : _ref$tabOpen;
|
10959 |
-
|
10960 |
-
var _useState = Object(external_this_wp_element_["useState"])({
|
10961 |
-
tabOpen: tabOpen,
|
10962 |
-
currentTab: selectedTabName
|
10963 |
-
}),
|
10964 |
-
_useState2 = slicedToArray_default()(_useState, 2),
|
10965 |
-
_useState2$ = _useState2[0],
|
10966 |
-
tabIsOpenState = _useState2$.tabOpen,
|
10967 |
-
currentTab = _useState2$.currentTab,
|
10968 |
-
setTabState = _useState2[1]; // Keep state synced with props
|
10969 |
|
|
|
10970 |
|
10971 |
-
|
10972 |
-
|
10973 |
-
tabOpen: tabOpen,
|
10974 |
-
currentTab: selectedTabName
|
10975 |
-
});
|
10976 |
-
}, [tabOpen, selectedTabName]);
|
10977 |
-
return Object(external_this_wp_element_["createElement"])(menu["a" /* default */], {
|
10978 |
-
role: "tablist",
|
10979 |
-
orientation: "horizontal",
|
10980 |
-
className: "woocommerce-layout__activity-panel-tabs"
|
10981 |
-
}, tabs && tabs.map(function (tab, i) {
|
10982 |
-
return Object(external_this_wp_element_["createElement"])(tab_Tab, extends_default()({
|
10983 |
-
key: i,
|
10984 |
-
index: i,
|
10985 |
-
isPanelOpen: tabIsOpenState,
|
10986 |
-
selected: currentTab === tab.name
|
10987 |
-
}, tab, {
|
10988 |
-
onTabClick: function onTabClick() {
|
10989 |
-
var isTabOpen = currentTab === tab.name || currentTab === '' ? !tabIsOpenState : true; // If a panel is being opened, or if an existing panel is already open and a different one is being opened, record a track.
|
10990 |
|
10991 |
-
|
10992 |
-
|
10993 |
-
tab: tab.name
|
10994 |
-
});
|
10995 |
-
}
|
10996 |
|
10997 |
-
|
10998 |
-
|
10999 |
-
|
11000 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11001 |
|
11002 |
-
|
11003 |
-
|
11004 |
-
}));
|
11005 |
-
}), showDisplayOptions && Object(external_this_wp_element_["createElement"])(display_options_DisplayOptions, null));
|
11006 |
-
};
|
11007 |
-
// CONCATENATED MODULE: ./client/header/activity-panel/setup-progress.js
|
11008 |
|
11009 |
-
var
|
11010 |
-
|
11011 |
-
|
11012 |
-
|
11013 |
-
height: "18",
|
11014 |
-
viewBox: "0 0 24 24",
|
11015 |
-
fill: "none",
|
11016 |
-
xmlns: "http://www.w3.org/2000/svg"
|
11017 |
-
}, Object(external_this_wp_element_["createElement"])("path", {
|
11018 |
-
d: "M12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4C7.58172 4 4 7.58172 4 12C4 16.4183 7.58172 20 12 20Z",
|
11019 |
-
stroke: "#DCDCDE",
|
11020 |
-
strokeWidth: "2"
|
11021 |
-
}), Object(external_this_wp_element_["createElement"])("path", {
|
11022 |
-
d: "M4 12V12C4 16.4183 7.58172 20 12 20V20C16.4183 20 20 16.4183 20 12V12C20 7.58172 16.4183 4 12 4V4",
|
11023 |
-
strokeWidth: "2",
|
11024 |
-
strokeLinecap: "round"
|
11025 |
-
}));
|
11026 |
-
};
|
11027 |
-
// CONCATENATED MODULE: ./client/header/activity-panel/index.js
|
11028 |
|
|
|
11029 |
|
11030 |
|
11031 |
|
11032 |
|
11033 |
|
11034 |
|
|
|
11035 |
|
11036 |
-
function
|
11037 |
|
11038 |
-
|
|
|
|
|
11039 |
|
11040 |
/**
|
11041 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11042 |
*/
|
11043 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11044 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11045 |
|
11046 |
|
|
|
|
|
|
|
|
|
11047 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11048 |
|
11049 |
|
|
|
|
|
|
|
|
|
11050 |
|
|
|
|
|
11051 |
|
|
|
|
|
11052 |
|
|
|
11053 |
|
|
|
|
|
11054 |
|
|
|
|
|
11055 |
|
|
|
|
|
11056 |
|
11057 |
-
/**
|
11058 |
-
|
11059 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
11060 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11061 |
|
|
|
|
|
|
|
|
|
|
|
|
|
11062 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11063 |
|
|
|
|
|
11064 |
|
|
|
|
|
11065 |
|
|
|
|
|
11066 |
|
11067 |
-
|
11068 |
-
return Promise.all(/* import() | activity-panels-help */[__webpack_require__.e(52), __webpack_require__.e(9), __webpack_require__.e(10)]).then(__webpack_require__.bind(null, 843));
|
11069 |
-
});
|
11070 |
-
var InboxPanel = Object(external_this_wp_element_["lazy"])(function () {
|
11071 |
-
return Promise.all(/* import() | activity-panels-inbox */[__webpack_require__.e(2), __webpack_require__.e(4), __webpack_require__.e(6), __webpack_require__.e(54), __webpack_require__.e(11)]).then(__webpack_require__.bind(null, 798));
|
11072 |
-
});
|
11073 |
-
var StockPanel = Object(external_this_wp_element_["lazy"])(function () {
|
11074 |
-
return Promise.all(/* import() | activity-panels-stock */[__webpack_require__.e(2), __webpack_require__.e(12)]).then(__webpack_require__.bind(null, 856));
|
11075 |
-
});
|
11076 |
-
var ReviewsPanel = Object(external_this_wp_element_["lazy"])(function () {
|
11077 |
-
return Promise.all(/* import() | activity-panels-inbox */[__webpack_require__.e(2), __webpack_require__.e(4), __webpack_require__.e(6), __webpack_require__.e(54), __webpack_require__.e(11)]).then(__webpack_require__.bind(null, 845));
|
11078 |
-
});
|
11079 |
-
var manageStock = Object(settings["g" /* getSetting */])('manageStock', 'no');
|
11080 |
-
var activity_panel_reviewsEnabled = Object(settings["g" /* getSetting */])('reviewsEnabled', 'no');
|
11081 |
-
var activity_panel_ActivityPanel = /*#__PURE__*/function (_Component) {
|
11082 |
-
inherits_default()(ActivityPanel, _Component);
|
11083 |
|
11084 |
-
var _super = activity_panel_createSuper(ActivityPanel);
|
11085 |
|
11086 |
-
function ActivityPanel(props) {
|
11087 |
-
var _this;
|
11088 |
|
11089 |
-
classCallCheck_default()(this, ActivityPanel);
|
11090 |
|
11091 |
-
_this = _super.call(this, props);
|
11092 |
-
_this.state = {
|
11093 |
-
isPanelOpen: false,
|
11094 |
-
mobileOpen: false,
|
11095 |
-
currentTab: '',
|
11096 |
-
isPanelSwitching: false
|
11097 |
-
};
|
11098 |
-
return _this;
|
11099 |
-
}
|
11100 |
|
11101 |
-
|
11102 |
-
|
11103 |
-
|
11104 |
-
var tabName = _ref.name;
|
11105 |
-
this.setState(function (state) {
|
11106 |
-
var isPanelSwitching = tabName !== state.currentTab && state.currentTab !== '' && isTabOpen && state.isPanelOpen;
|
11107 |
-
return {
|
11108 |
-
isPanelOpen: isTabOpen,
|
11109 |
-
mobileOpen: isTabOpen,
|
11110 |
-
currentTab: tabName,
|
11111 |
-
isPanelSwitching: isPanelSwitching
|
11112 |
-
};
|
11113 |
-
});
|
11114 |
-
}
|
11115 |
-
}, {
|
11116 |
-
key: "closePanel",
|
11117 |
-
value: function closePanel() {
|
11118 |
-
this.setState(function () {
|
11119 |
-
return {
|
11120 |
-
isPanelOpen: false,
|
11121 |
-
currentTab: ''
|
11122 |
-
};
|
11123 |
-
});
|
11124 |
-
}
|
11125 |
-
}, {
|
11126 |
-
key: "clearPanel",
|
11127 |
-
value: function clearPanel() {
|
11128 |
-
this.setState(function () {
|
11129 |
-
return {
|
11130 |
-
isPanelSwitching: false
|
11131 |
-
};
|
11132 |
-
});
|
11133 |
-
} // On smaller screen, the panel buttons are hidden behind a toggle.
|
11134 |
|
11135 |
-
|
11136 |
-
|
11137 |
-
|
11138 |
-
var tabs = this.getTabs();
|
11139 |
-
this.setState(function (state) {
|
11140 |
-
return {
|
11141 |
-
mobileOpen: !state.mobileOpen,
|
11142 |
-
currentTab: state.mobileOpen ? '' : tabs[0].name,
|
11143 |
-
isPanelOpen: !state.mobileOpen
|
11144 |
-
};
|
11145 |
-
});
|
11146 |
-
}
|
11147 |
-
}, {
|
11148 |
-
key: "handleClickOutside",
|
11149 |
-
value: function handleClickOutside(event) {
|
11150 |
-
var isPanelOpen = this.state.isPanelOpen;
|
11151 |
-
var isClickOnModalOrSnackbar = event.target.closest('.woocommerce-inbox-dismiss-confirmation_modal') || event.target.closest('.components-snackbar__action');
|
11152 |
|
11153 |
-
if (isPanelOpen && !isClickOnModalOrSnackbar) {
|
11154 |
-
this.closePanel();
|
11155 |
-
}
|
11156 |
-
}
|
11157 |
-
}, {
|
11158 |
-
key: "isHomescreen",
|
11159 |
-
value: function isHomescreen() {
|
11160 |
-
var _this$props$getHistor = this.props.getHistory(),
|
11161 |
-
location = _this$props$getHistor.location;
|
11162 |
|
11163 |
-
return location.pathname === '/';
|
11164 |
-
}
|
11165 |
-
}, {
|
11166 |
-
key: "isPerformingSetupTask",
|
11167 |
-
value: function isPerformingSetupTask() {
|
11168 |
-
var _this$props = this.props,
|
11169 |
-
requestingTaskListOptions = _this$props.requestingTaskListOptions,
|
11170 |
-
taskListComplete = _this$props.taskListComplete,
|
11171 |
-
taskListHidden = _this$props.taskListHidden,
|
11172 |
-
query = _this$props.query;
|
11173 |
-
var isPerformingSetupTask = query.task && !query.path && (requestingTaskListOptions === true || taskListHidden === false && taskListComplete === false);
|
11174 |
-
return isPerformingSetupTask;
|
11175 |
-
} // @todo Pull in dynamic unread status/count
|
11176 |
|
11177 |
-
}, {
|
11178 |
-
key: "getTabs",
|
11179 |
-
value: function getTabs() {
|
11180 |
-
var _this$props2 = this.props,
|
11181 |
-
hasUnreadNotes = _this$props2.hasUnreadNotes,
|
11182 |
-
hasUnapprovedReviews = _this$props2.hasUnapprovedReviews,
|
11183 |
-
hasUnreadStock = _this$props2.hasUnreadStock,
|
11184 |
-
isEmbedded = _this$props2.isEmbedded,
|
11185 |
-
taskListComplete = _this$props2.taskListComplete,
|
11186 |
-
taskListHidden = _this$props2.taskListHidden;
|
11187 |
-
var isPerformingSetupTask = this.isPerformingSetupTask(); // Don't show the inbox on the Home screen.
|
11188 |
|
11189 |
-
var showInbox = (isEmbedded || !this.isHomescreen()) && !isPerformingSetupTask;
|
11190 |
-
var showStockAndReviews = (taskListComplete || taskListHidden) && !isPerformingSetupTask;
|
11191 |
-
var showStoreSetup = !taskListComplete && !taskListHidden && !isPerformingSetupTask;
|
11192 |
-
var inbox = showInbox ? {
|
11193 |
-
name: 'inbox',
|
11194 |
-
title: Object(external_this_wp_i18n_["__"])('Inbox', 'woocommerce-admin'),
|
11195 |
-
icon: Object(external_this_wp_element_["createElement"])("i", {
|
11196 |
-
className: "material-icons-outlined"
|
11197 |
-
}, "inbox"),
|
11198 |
-
unread: hasUnreadNotes
|
11199 |
-
} : null;
|
11200 |
-
var setup = showStoreSetup ? {
|
11201 |
-
name: 'setup',
|
11202 |
-
title: Object(external_this_wp_i18n_["__"])('Store Setup', 'woocommerce-admin'),
|
11203 |
-
icon: Object(external_this_wp_element_["createElement"])(setup_progress_SetupProgress, null)
|
11204 |
-
} : null;
|
11205 |
-
var stockAndReviews = showStockAndReviews ? [manageStock === 'yes' && {
|
11206 |
-
name: 'stock',
|
11207 |
-
title: Object(external_this_wp_i18n_["__"])('Stock', 'woocommerce-admin'),
|
11208 |
-
icon: Object(external_this_wp_element_["createElement"])("i", {
|
11209 |
-
className: "material-icons-outlined"
|
11210 |
-
}, "widgets"),
|
11211 |
-
unread: hasUnreadStock
|
11212 |
-
}, activity_panel_reviewsEnabled === 'yes' && {
|
11213 |
-
name: 'reviews',
|
11214 |
-
title: Object(external_this_wp_i18n_["__"])('Reviews', 'woocommerce-admin'),
|
11215 |
-
icon: Object(external_this_wp_element_["createElement"])("i", {
|
11216 |
-
className: "material-icons-outlined"
|
11217 |
-
}, "star_border"),
|
11218 |
-
unread: hasUnapprovedReviews
|
11219 |
-
}].filter(Boolean) : [];
|
11220 |
-
var help = isPerformingSetupTask ? {
|
11221 |
-
name: 'help',
|
11222 |
-
title: Object(external_this_wp_i18n_["__"])('Help', 'woocommerce-admin'),
|
11223 |
-
icon: Object(external_this_wp_element_["createElement"])(build_module_icon["a" /* default */], {
|
11224 |
-
icon: library_lifesaver
|
11225 |
-
})
|
11226 |
-
} : null;
|
11227 |
-
return [inbox].concat(toConsumableArray_default()(stockAndReviews), [setup, help]).filter(Boolean);
|
11228 |
-
}
|
11229 |
-
}, {
|
11230 |
-
key: "getPanelContent",
|
11231 |
-
value: function getPanelContent(tab) {
|
11232 |
-
var _this$props3 = this.props,
|
11233 |
-
query = _this$props3.query,
|
11234 |
-
hasUnapprovedReviews = _this$props3.hasUnapprovedReviews;
|
11235 |
-
var task = query.task;
|
11236 |
|
11237 |
-
switch (tab) {
|
11238 |
-
case 'inbox':
|
11239 |
-
return Object(external_this_wp_element_["createElement"])(InboxPanel, null);
|
11240 |
|
11241 |
-
case 'stock':
|
11242 |
-
return Object(external_this_wp_element_["createElement"])(StockPanel, null);
|
11243 |
|
11244 |
-
|
11245 |
-
|
11246 |
-
|
11247 |
-
|
|
|
|
|
|
|
|
|
|
|
11248 |
|
11249 |
-
case 'help':
|
11250 |
-
return Object(external_this_wp_element_["createElement"])(HelpPanel, {
|
11251 |
-
taskName: task
|
11252 |
-
});
|
11253 |
|
11254 |
-
default:
|
11255 |
-
return null;
|
11256 |
-
}
|
11257 |
-
}
|
11258 |
-
}, {
|
11259 |
-
key: "renderPanel",
|
11260 |
-
value: function renderPanel() {
|
11261 |
-
var _this2 = this;
|
11262 |
|
11263 |
-
var _this$props4 = this.props,
|
11264 |
-
updateOptions = _this$props4.updateOptions,
|
11265 |
-
taskListHidden = _this$props4.taskListHidden;
|
11266 |
-
var _this$state = this.state,
|
11267 |
-
isPanelOpen = _this$state.isPanelOpen,
|
11268 |
-
currentTab = _this$state.currentTab,
|
11269 |
-
isPanelSwitching = _this$state.isPanelSwitching;
|
11270 |
-
var tab = Object(external_lodash_["find"])(this.getTabs(), {
|
11271 |
-
name: currentTab
|
11272 |
-
});
|
11273 |
|
11274 |
-
|
11275 |
-
|
11276 |
-
|
11277 |
-
|
11278 |
-
|
|
|
|
|
|
|
|
|
11279 |
|
11280 |
-
|
11281 |
-
_this2.clearPanel();
|
11282 |
-
};
|
11283 |
|
11284 |
-
|
11285 |
-
|
11286 |
-
|
11287 |
|
11288 |
-
|
11289 |
-
|
11290 |
-
|
11291 |
|
11292 |
-
|
11293 |
-
|
11294 |
-
|
11295 |
-
|
11296 |
-
this.redirectToHomeScreen();
|
11297 |
-
} else {
|
11298 |
-
updateOptions({
|
11299 |
-
woocommerce_task_list_hidden: 'no'
|
11300 |
-
}).then(this.redirectToHomeScreen);
|
11301 |
-
}
|
11302 |
-
}
|
11303 |
|
11304 |
-
|
11305 |
-
|
11306 |
|
11307 |
-
|
11308 |
-
|
11309 |
-
|
11310 |
-
});
|
11311 |
-
return Object(external_this_wp_element_["createElement"])("div", {
|
11312 |
-
className: classNames,
|
11313 |
-
tabIndex: 0,
|
11314 |
-
role: "tabpanel",
|
11315 |
-
"aria-label": tab.title,
|
11316 |
-
onTransitionEnd: clearPanel,
|
11317 |
-
onAnimationEnd: clearPanel
|
11318 |
-
}, Object(external_this_wp_element_["createElement"])("div", {
|
11319 |
-
className: "woocommerce-layout__activity-panel-content",
|
11320 |
-
key: 'activity-panel-' + currentTab,
|
11321 |
-
id: 'activity-panel-' + currentTab
|
11322 |
-
}, Object(external_this_wp_element_["createElement"])(external_this_wp_element_["Suspense"], {
|
11323 |
-
fallback: Object(external_this_wp_element_["createElement"])(external_this_wc_components_["Spinner"], null)
|
11324 |
-
}, this.getPanelContent(currentTab))));
|
11325 |
}
|
11326 |
-
|
11327 |
-
|
11328 |
-
|
11329 |
-
|
11330 |
-
|
11331 |
-
|
11332 |
-
|
|
|
|
|
|
|
11333 |
}
|
|
|
|
|
11334 |
}
|
11335 |
-
}, {
|
11336 |
-
key: "render",
|
11337 |
-
value: function render() {
|
11338 |
-
var _this3 = this;
|
11339 |
|
11340 |
-
|
11341 |
-
|
11342 |
-
|
11343 |
-
|
11344 |
-
|
11345 |
-
|
11346 |
-
|
11347 |
-
|
11348 |
-
|
11349 |
-
});
|
11350 |
-
var hasUnread = tabs.some(function (tab) {
|
11351 |
-
return tab.unread;
|
11352 |
-
});
|
11353 |
-
var viewLabel = hasUnread ? Object(external_this_wp_i18n_["__"])('View Activity Panel, you have unread activity', 'woocommerce-admin') : Object(external_this_wp_i18n_["__"])('View Activity Panel', 'woocommerce-admin');
|
11354 |
-
var isPerformingSetupTask = this.isPerformingSetupTask();
|
11355 |
-
var showDisplayOptions = !isEmbedded && this.isHomescreen() && !isPerformingSetupTask;
|
11356 |
-
return Object(external_this_wp_element_["createElement"])("div", null, Object(external_this_wp_element_["createElement"])(external_this_wc_components_["H"], {
|
11357 |
-
id: headerId,
|
11358 |
-
className: "screen-reader-text"
|
11359 |
-
}, Object(external_this_wp_i18n_["__"])('Store Activity', 'woocommerce-admin')), Object(external_this_wp_element_["createElement"])(external_this_wc_components_["Section"], {
|
11360 |
-
component: "aside",
|
11361 |
-
id: "woocommerce-activity-panel",
|
11362 |
-
"aria-labelledby": headerId
|
11363 |
-
}, Object(external_this_wp_element_["createElement"])(build_module_button["a" /* default */], {
|
11364 |
-
onClick: function onClick() {
|
11365 |
-
_this3.toggleMobile();
|
11366 |
-
},
|
11367 |
-
label: mobileOpen ? Object(external_this_wp_i18n_["__"])('Close Activity Panel', 'woocommerce-admin') : viewLabel,
|
11368 |
-
"aria-expanded": mobileOpen,
|
11369 |
-
className: "woocommerce-layout__activity-panel-mobile-toggle"
|
11370 |
-
}, mobileOpen ? Object(external_this_wp_element_["createElement"])(cross_small_default.a, null) : Object(external_this_wp_element_["createElement"])(toggle_bubble, {
|
11371 |
-
hasUnread: hasUnread
|
11372 |
-
})), Object(external_this_wp_element_["createElement"])("div", {
|
11373 |
-
className: panelClasses
|
11374 |
-
}, Object(external_this_wp_element_["createElement"])(tabs_Tabs, {
|
11375 |
-
tabs: tabs,
|
11376 |
-
tabOpen: isPanelOpen,
|
11377 |
-
selectedTab: currentTab,
|
11378 |
-
onTabClick: function onTabClick(tab, tabOpen) {
|
11379 |
-
_this3.togglePanel(tab, tabOpen);
|
11380 |
-
},
|
11381 |
-
showDisplayOptions: showDisplayOptions
|
11382 |
-
}), this.renderPanel())));
|
11383 |
}
|
11384 |
-
}]);
|
11385 |
|
11386 |
-
|
11387 |
-
}
|
11388 |
-
activity_panel_ActivityPanel.defaultProps = {
|
11389 |
-
getHistory: external_this_wc_navigation_["getHistory"]
|
11390 |
-
};
|
11391 |
-
/* harmony default export */ var activity_panel = (Object(compose["a" /* default */])(Object(external_this_wp_data_["withSelect"])(function (select) {
|
11392 |
-
var hasUnreadNotes = getUnreadNotes(select);
|
11393 |
-
var hasUnreadStock = getUnreadStock();
|
11394 |
-
var hasUnapprovedReviews = getUnapprovedReviews(select);
|
11395 |
|
11396 |
-
|
11397 |
-
|
11398 |
-
|
11399 |
|
11400 |
-
var
|
11401 |
-
var
|
11402 |
-
|
11403 |
-
|
11404 |
-
|
11405 |
-
|
11406 |
-
|
11407 |
-
|
11408 |
-
|
11409 |
-
|
11410 |
-
|
11411 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11412 |
return {
|
11413 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11414 |
};
|
11415 |
-
}
|
11416 |
-
// CONCATENATED MODULE: ./client/lib/platform/index.js
|
11417 |
-
var ANDROID_PLATFORM = 'android';
|
11418 |
-
var IOS_PLATFORM = 'ios';
|
11419 |
-
var UNKNOWN_PLATFORM = 'unknown';
|
11420 |
/**
|
11421 |
-
*
|
11422 |
-
*
|
11423 |
-
*
|
|
|
11424 |
*/
|
11425 |
|
11426 |
-
var platform = function platform() {
|
11427 |
-
if (/iPhone|iPad|iPod/i.test(window.navigator.userAgent)) {
|
11428 |
-
return IOS_PLATFORM;
|
11429 |
-
} else if (/Android/i.test(window.navigator.userAgent)) {
|
11430 |
-
return ANDROID_PLATFORM;
|
11431 |
-
}
|
11432 |
-
|
11433 |
-
return UNKNOWN_PLATFORM;
|
11434 |
-
};
|
11435 |
-
// CONCATENATED MODULE: ./client/mobile-banner/app-icon.js
|
11436 |
|
11437 |
-
|
11438 |
-
|
11439 |
-
|
11440 |
-
|
11441 |
-
|
11442 |
-
|
11443 |
-
|
11444 |
-
|
11445 |
-
|
11446 |
-
|
11447 |
-
|
11448 |
-
|
11449 |
-
|
11450 |
-
fillRule: "evenodd",
|
11451 |
-
clipRule: "evenodd",
|
11452 |
-
d: "M72.5937 28.043H19.8094C16.4781 28.0459 13.7783 30.7705 13.7754 34.1324V54.4501C13.7783 57.812 16.4781 60.5366 19.8094 60.5395H44.8229L56.2573 66.9607L53.6672 60.5395H72.599C74.2009 60.5402 75.7374 59.8983 76.8702 58.7552C78.0029 57.612 78.639 56.0614 78.6383 54.4447V34.1324C78.6376 32.5157 78.0002 30.9657 76.8664 29.8235C75.7327 28.6814 74.1956 28.0408 72.5937 28.043ZM19.1057 32.4208C18.4658 32.4324 17.8646 32.7359 17.467 33.2482C17.0888 33.7635 16.9404 34.4175 17.058 35.0502C18.5962 45.0986 20.0338 51.8757 21.371 55.3816C21.8779 56.658 22.4896 57.2703 23.2063 57.2185C24.3075 57.1489 25.6263 55.5968 27.1627 52.5621C27.9964 50.8412 29.2602 48.2662 30.9539 44.837C32.3785 49.88 34.309 53.6787 36.7456 56.2331C37.4291 56.9436 38.1204 57.2748 38.8195 57.2266C39.4185 57.1931 39.953 56.8315 40.217 56.2813C40.4753 55.7358 40.5806 55.1278 40.5211 54.5248C40.3516 52.0703 40.5919 48.667 41.2421 44.3149C41.9081 39.8057 42.7523 36.5818 43.7749 34.6432C43.9822 34.2526 44.0733 33.8087 44.037 33.366C44.0039 32.7587 43.7116 32.1969 43.2374 31.829C42.7745 31.4367 42.1799 31.2446 41.5803 31.2935C40.8334 31.3325 40.1682 31.7885 39.8499 32.4797C38.2331 35.5019 37.0812 40.4109 36.3943 47.2068C35.2823 44.2394 34.4509 41.1703 33.9114 38.0412C33.623 36.4613 32.9037 35.7125 31.7536 35.7946C30.9592 35.8589 30.3063 36.3944 29.7819 37.4012L24.0348 48.5643C23.0997 44.6692 22.2205 39.9289 21.3972 34.3433C21.1997 32.9652 20.4358 32.3244 19.1057 32.4208ZM69.9089 34.6877C71.6969 35.0381 73.2407 36.2 74.1186 37.8559C74.9693 39.3247 75.3946 41.1161 75.3946 43.23C75.4148 45.9567 74.7062 48.6357 73.3477 50.9687C71.7778 53.7023 69.7195 55.0691 67.1727 55.0691C66.6933 55.0668 66.2153 55.0128 65.7467 54.9078C63.9584 54.5581 62.4143 53.396 61.5371 51.7396C60.6864 50.2452 60.261 48.4411 60.261 46.3272C60.2357 43.6127 60.945 40.9454 62.3079 38.6295C63.9023 35.8959 65.9607 34.5291 68.4829 34.5291C68.9623 34.5304 69.4402 34.5836 69.9089 34.6877ZM68.7937 49.4848C69.7707 48.5773 70.4399 47.2269 70.8012 45.4337V45.4419C70.9315 44.7826 70.9959 44.1112 70.9933 43.4382C70.986 42.5849 70.8291 41.74 70.5302 40.9452C70.1443 39.901 69.6304 39.3124 68.9884 39.1793C68.0378 38.9643 67.1239 39.5256 66.2469 40.8632C65.5812 41.8393 65.109 42.9432 64.8577 44.1106C64.7276 44.7708 64.6632 45.4432 64.6657 46.1171C64.6739 46.9677 64.8308 47.8096 65.1287 48.6019C65.5146 49.6388 66.0294 50.2274 66.6731 50.3678C67.3169 50.5081 68.0237 50.2138 68.7937 49.4848ZM57.9079 37.8559C57.0291 36.2008 55.4854 35.0392 53.6976 34.6877C53.2279 34.5837 52.749 34.5306 52.2687 34.5291C49.7443 34.5291 47.6856 35.8959 46.0927 38.6295C44.7295 40.9454 44.0201 43.6127 44.0454 46.3272C44.0454 48.4411 44.4699 50.2452 45.319 51.7396C46.1976 53.3949 47.7414 54.5566 49.5294 54.9078C49.999 55.0126 50.4779 55.0667 50.9582 55.0691C53.5055 55.0691 55.5642 53.7023 57.1343 50.9687C58.4922 48.6355 59.2001 45.9565 59.1789 43.23C59.1789 41.1161 58.7544 39.3247 57.9053 37.8559H57.9079ZM54.5903 45.4337C54.2307 47.2269 53.5614 48.5773 52.5825 49.4848C51.8115 50.2065 51.101 50.5017 50.4589 50.3678C49.8169 50.2338 49.3011 49.6461 48.9169 48.6019C48.6181 47.8097 48.4603 46.9678 48.4511 46.1171C48.4495 45.4431 48.5148 44.7707 48.6459 44.1106C48.8971 42.9432 49.3694 41.8393 50.0353 40.8632C50.9124 39.5256 51.8264 38.9643 52.7773 39.1793C53.4193 39.3124 53.9333 39.901 54.3193 40.9452C54.617 41.7404 54.7739 42.585 54.7824 43.4382C54.785 44.1112 54.7207 44.7826 54.5903 45.4419V45.4337Z",
|
11453 |
-
fill: "white"
|
11454 |
-
}));
|
11455 |
-
};
|
11456 |
-
// EXTERNAL MODULE: ./client/mobile-banner/style.scss
|
11457 |
-
var mobile_banner_style = __webpack_require__(571);
|
11458 |
|
11459 |
-
|
11460 |
-
//
|
11461 |
-
//
|
11462 |
-
|
11463 |
-
var PLAY_STORE_LINK = 'https://play.google.com/store/apps/details?id=com.woocommerce.android';
|
11464 |
-
var TRACKING_EVENT_NAME = 'wcadmin_mobile_android_banner_click';
|
11465 |
-
// CONCATENATED MODULE: ./client/mobile-banner/index.js
|
11466 |
|
|
|
|
|
|
|
|
|
|
|
11467 |
|
|
|
|
|
11468 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11469 |
/**
|
11470 |
-
*
|
|
|
|
|
|
|
|
|
|
|
11471 |
*/
|
11472 |
|
11473 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11474 |
|
|
|
|
|
11475 |
|
|
|
|
|
|
|
|
|
11476 |
/**
|
11477 |
-
*
|
|
|
|
|
|
|
|
|
11478 |
*/
|
11479 |
|
11480 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11481 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11482 |
|
|
|
|
|
|
|
|
|
11483 |
|
11484 |
-
var
|
11485 |
-
|
11486 |
-
|
11487 |
-
|
11488 |
-
Object(external_this_wp_element_["useEffect"])(function () {
|
11489 |
-
var layout = document.getElementsByClassName('woocommerce-layout')[0];
|
11490 |
|
11491 |
-
|
11492 |
-
|
11493 |
-
|
11494 |
-
|
11495 |
-
|
11496 |
-
|
11497 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11498 |
}
|
11499 |
|
11500 |
-
|
11501 |
-
if (
|
11502 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11503 |
}
|
11504 |
-
};
|
11505 |
-
}, []);
|
11506 |
|
11507 |
-
|
11508 |
-
_useState2 = slicedToArray_default()(_useState, 2),
|
11509 |
-
isDismissed = _useState2[0],
|
11510 |
-
setDismissed = _useState2[1]; // On iOS the "Smart App Banner" meta tag is used so only display this on Android.
|
11511 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11512 |
|
11513 |
-
|
11514 |
-
|
11515 |
-
|
11516 |
-
}, Object(external_this_wp_element_["createElement"])(components_build_module_icon["a" /* default */], {
|
11517 |
-
icon: "no-alt",
|
11518 |
-
"data-testid": "dismiss-btn",
|
11519 |
-
onClick: function onClick() {
|
11520 |
-
onDismiss();
|
11521 |
-
setDismissed(true);
|
11522 |
-
Object(external_this_wc_tracks_["recordEvent"])(TRACKING_EVENT_NAME, {
|
11523 |
-
action: 'dismiss'
|
11524 |
-
});
|
11525 |
-
}
|
11526 |
-
}), Object(external_this_wp_element_["createElement"])(app_icon_AppIcon, null), Object(external_this_wp_element_["createElement"])("div", {
|
11527 |
-
className: "woocommerce-mobile-app-banner__description"
|
11528 |
-
}, Object(external_this_wp_element_["createElement"])("p", {
|
11529 |
-
className: "woocommerce-mobile-app-banner__description__text"
|
11530 |
-
}, Object(external_this_wp_i18n_["__"])('Run your store from anywhere', 'woocommerce-admin')), Object(external_this_wp_element_["createElement"])("p", {
|
11531 |
-
className: "woocommerce-mobile-app-banner__description__text"
|
11532 |
-
}, Object(external_this_wp_i18n_["__"])('Download the WooCommerce app', 'woocommerce-admin'))), Object(external_this_wp_element_["createElement"])(build_module_button["a" /* default */], {
|
11533 |
-
href: PLAY_STORE_LINK,
|
11534 |
-
isSecondary: true,
|
11535 |
-
onClick: function onClick() {
|
11536 |
-
onInstall();
|
11537 |
-
setDismissed(true);
|
11538 |
-
Object(external_this_wc_tracks_["recordEvent"])(TRACKING_EVENT_NAME, {
|
11539 |
-
action: 'install'
|
11540 |
-
});
|
11541 |
}
|
11542 |
-
}, Object(external_this_wp_i18n_["__"])('Install', 'woocommerce-admin')));
|
11543 |
-
}
|
11544 |
|
11545 |
-
|
11546 |
-
|
11547 |
-
|
11548 |
-
|
|
|
|
|
11549 |
|
11550 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11551 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11552 |
|
|
|
|
|
11553 |
|
11554 |
-
|
11555 |
-
|
11556 |
-
|
|
|
|
|
|
|
11557 |
|
11558 |
|
|
|
|
|
|
|
|
|
11559 |
|
|
|
|
|
|
|
|
|
|
|
|
|
11560 |
|
|
|
|
|
|
|
|
|
|
|
|
|
11561 |
|
|
|
|
|
|
|
|
|
|
|
|
|
11562 |
|
|
|
|
|
|
|
|
|
|
|
|
|
11563 |
|
11564 |
-
/**
|
11565 |
-
* Internal dependencies
|
11566 |
-
*/
|
11567 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11568 |
|
11569 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11570 |
|
|
|
|
|
|
|
11571 |
|
11572 |
-
var header_Header = function Header(_ref) {
|
11573 |
-
var sections = _ref.sections,
|
11574 |
-
_ref$isEmbedded = _ref.isEmbedded,
|
11575 |
-
isEmbedded = _ref$isEmbedded === void 0 ? false : _ref$isEmbedded,
|
11576 |
-
query = _ref.query;
|
11577 |
-
var headerElement = Object(external_this_wp_element_["useRef"])(null);
|
11578 |
-
var siteTitle = Object(settings["g" /* getSetting */])('siteTitle', '');
|
11579 |
-
var pageTitle = sections.slice(-1)[0];
|
11580 |
-
var isScrolled = Object(useIsScrolled["a" /* default */])();
|
11581 |
|
11582 |
-
|
11583 |
-
updateUserPreferences = _useUserPreferences.updateUserPreferences,
|
11584 |
-
userData = objectWithoutProperties_default()(_useUserPreferences, ["updateUserPreferences"]);
|
11585 |
|
11586 |
-
|
11587 |
-
|
11588 |
-
|
11589 |
-
|
11590 |
-
|
11591 |
-
|
11592 |
-
var documentTitle = sections.map(function (section) {
|
11593 |
-
return Array.isArray(section) ? section[1] : section;
|
11594 |
-
}).reverse().join(' ‹ ');
|
11595 |
-
var decodedTitle = Object(external_this_wp_htmlEntities_["decodeEntities"])(Object(external_this_wp_i18n_["sprintf"])(
|
11596 |
-
/* translators: 1: document title. 2: page title */
|
11597 |
-
Object(external_this_wp_i18n_["__"])('%1$s ‹ %2$s — WooCommerce', 'woocommerce-admin'), documentTitle, siteTitle));
|
11598 |
|
11599 |
-
|
11600 |
-
|
|
|
11601 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11602 |
}
|
11603 |
-
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11604 |
|
11605 |
-
|
11606 |
-
|
11607 |
-
|
11608 |
-
});
|
11609 |
-
};
|
11610 |
|
11611 |
-
|
11612 |
-
|
11613 |
-
|
11614 |
-
|
11615 |
-
|
11616 |
-
onInstall: dismissHandler
|
11617 |
-
}), Object(external_this_wp_element_["createElement"])(build_module_text["a" /* default */], {
|
11618 |
-
className: "woocommerce-layout__header-heading",
|
11619 |
-
as: "h1",
|
11620 |
-
variant: "subtitle.small"
|
11621 |
-
}, Object(external_this_wp_htmlEntities_["decodeEntities"])(pageTitle)), window.wcAdminFeatures['activity-panels'] && Object(external_this_wp_element_["createElement"])(activity_panel, {
|
11622 |
-
isEmbedded: isEmbedded,
|
11623 |
-
query: query
|
11624 |
-
}));
|
11625 |
-
};
|
11626 |
-
// CONCATENATED MODULE: ./client/layout/notices.js
|
11627 |
|
|
|
|
|
|
|
11628 |
|
|
|
|
|
|
|
|
|
11629 |
|
|
|
11630 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11631 |
|
|
|
|
|
11632 |
|
|
|
|
|
|
|
11633 |
|
11634 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
11635 |
|
11636 |
-
|
|
|
|
|
11637 |
|
11638 |
/**
|
11639 |
-
*
|
|
|
|
|
|
|
11640 |
*/
|
11641 |
|
|
|
|
|
11642 |
|
11643 |
-
var
|
11644 |
-
|
|
|
|
|
|
|
|
|
|
|
11645 |
|
11646 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11647 |
|
11648 |
-
function
|
11649 |
-
|
|
|
|
|
|
|
11650 |
|
11651 |
-
|
|
|
|
|
|
|
|
|
11652 |
}
|
|
|
11653 |
|
11654 |
-
|
11655 |
-
|
11656 |
-
|
11657 |
-
|
11658 |
-
|
11659 |
-
|
11660 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11661 |
}
|
11662 |
-
}
|
11663 |
-
|
11664 |
-
return Notices;
|
11665 |
-
}(external_this_wp_element_["Component"]);
|
11666 |
|
11667 |
-
|
11668 |
-
|
11669 |
-
var
|
11670 |
-
var
|
11671 |
|
11672 |
-
//
|
11673 |
-
|
11674 |
-
|
11675 |
-
var info = gen[key](arg);
|
11676 |
-
var value = info.value;
|
11677 |
-
} catch (error) {
|
11678 |
-
reject(error);
|
11679 |
-
return;
|
11680 |
-
}
|
11681 |
|
11682 |
-
|
11683 |
-
|
11684 |
-
|
11685 |
-
|
11686 |
-
}
|
11687 |
-
}
|
|
|
11688 |
|
11689 |
-
|
11690 |
-
|
11691 |
-
|
11692 |
-
|
11693 |
-
return
|
11694 |
-
|
11695 |
|
11696 |
-
|
11697 |
-
|
11698 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
11699 |
|
11700 |
-
|
11701 |
-
|
11702 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
11703 |
|
11704 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
11705 |
});
|
11706 |
-
}
|
11707 |
-
}
|
11708 |
-
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/slicedToArray.js + 3 modules
|
11709 |
-
var esm_slicedToArray = __webpack_require__(26);
|
11710 |
|
11711 |
-
|
11712 |
-
var
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11713 |
|
11714 |
-
|
11715 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11716 |
|
11717 |
-
//
|
11718 |
-
|
|
|
|
|
|
|
|
|
|
|
11719 |
|
11720 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11721 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11722 |
|
|
|
11723 |
|
|
|
|
|
|
|
|
|
|
|
|
|
11724 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11725 |
|
|
|
|
|
|
|
|
|
11726 |
|
11727 |
-
|
11728 |
-
|
11729 |
-
|
|
|
|
|
11730 |
|
|
|
|
|
|
|
|
|
|
|
11731 |
|
|
|
|
|
|
|
|
|
11732 |
|
11733 |
-
|
11734 |
-
|
11735 |
-
|
|
|
|
|
|
|
11736 |
|
|
|
|
|
11737 |
|
|
|
|
|
|
|
|
|
11738 |
|
11739 |
-
|
11740 |
-
|
11741 |
-
|
|
|
11742 |
|
|
|
|
|
|
|
|
|
11743 |
|
11744 |
-
|
11745 |
-
|
11746 |
-
*
|
11747 |
-
* @param {Object} $0 Props passed to the component.
|
11748 |
-
* @param {Array} $0.notices Array of notices to render.
|
11749 |
-
* @param {Function} $0.onRemove Function called when a notice should be removed / dismissed.
|
11750 |
-
* @param {Object} $0.className Name of the class used by the component.
|
11751 |
-
* @param {Object} $0.children Array of children to be rendered inside the notice list.
|
11752 |
-
* @return {Object} The rendered notices list.
|
11753 |
-
*/
|
11754 |
|
11755 |
-
|
11756 |
-
|
11757 |
-
|
11758 |
-
|
11759 |
-
|
11760 |
-
|
11761 |
-
|
|
|
|
|
11762 |
|
11763 |
-
|
11764 |
-
|
11765 |
-
|
11766 |
-
|
11767 |
-
refMap = _useState2[0];
|
11768 |
|
11769 |
-
|
11770 |
-
|
11771 |
-
|
11772 |
-
|
11773 |
-
|
11774 |
-
height: 0
|
11775 |
-
},
|
11776 |
-
enter: function enter(item) {
|
11777 |
-
return /*#__PURE__*/function () {
|
11778 |
-
var _ref2 = _asyncToGenerator( /*#__PURE__*/regenerator_default.a.mark(function _callee(next) {
|
11779 |
-
return regenerator_default.a.wrap(function _callee$(_context) {
|
11780 |
-
while (1) {
|
11781 |
-
switch (_context.prev = _context.next) {
|
11782 |
-
case 0:
|
11783 |
-
_context.next = 2;
|
11784 |
-
return next({
|
11785 |
-
opacity: 1,
|
11786 |
-
height: refMap.get(item).offsetHeight
|
11787 |
-
});
|
11788 |
|
11789 |
-
|
11790 |
-
return _context.abrupt("return", _context.sent);
|
11791 |
|
11792 |
-
|
11793 |
-
|
11794 |
-
|
11795 |
-
}
|
11796 |
-
}
|
11797 |
-
}, _callee);
|
11798 |
-
}));
|
11799 |
|
11800 |
-
|
11801 |
-
return _ref2.apply(this, arguments);
|
11802 |
-
};
|
11803 |
-
}();
|
11804 |
-
},
|
11805 |
-
leave: function leave() {
|
11806 |
-
return /*#__PURE__*/function () {
|
11807 |
-
var _ref3 = _asyncToGenerator( /*#__PURE__*/regenerator_default.a.mark(function _callee2(next) {
|
11808 |
-
return regenerator_default.a.wrap(function _callee2$(_context2) {
|
11809 |
-
while (1) {
|
11810 |
-
switch (_context2.prev = _context2.next) {
|
11811 |
-
case 0:
|
11812 |
-
_context2.next = 2;
|
11813 |
-
return next({
|
11814 |
-
opacity: 0
|
11815 |
-
});
|
11816 |
|
11817 |
-
|
11818 |
-
|
11819 |
-
|
11820 |
-
|
11821 |
-
|
|
|
|
|
11822 |
|
11823 |
-
|
11824 |
-
|
11825 |
-
|
11826 |
-
}
|
11827 |
-
}
|
11828 |
-
}, _callee2);
|
11829 |
-
}));
|
11830 |
|
11831 |
-
|
11832 |
-
|
11833 |
-
|
11834 |
-
|
11835 |
-
},
|
11836 |
-
immediate: isReducedMotion
|
11837 |
-
});
|
11838 |
-
className = classnames_default()('components-snackbar-list', className);
|
11839 |
|
11840 |
-
|
11841 |
-
|
11842 |
-
|
|
|
|
|
|
|
|
|
|
|
11843 |
};
|
11844 |
-
}
|
11845 |
|
11846 |
-
|
11847 |
-
|
11848 |
-
|
11849 |
-
|
11850 |
-
|
11851 |
-
|
11852 |
-
|
11853 |
-
|
11854 |
-
|
11855 |
-
|
11856 |
-
className: "components-snackbar-list__notice-container",
|
11857 |
-
ref: function ref(_ref5) {
|
11858 |
-
return _ref5 && refMap.set(notice, _ref5);
|
11859 |
-
}
|
11860 |
-
}, Object(external_this_wp_element_["createElement"])(snackbar["a" /* default */], Object(esm_extends["a" /* default */])({}, Object(external_lodash_["omit"])(notice, ['content']), {
|
11861 |
-
onRemove: removeNotice(notice)
|
11862 |
-
}), notice.content)));
|
11863 |
-
}));
|
11864 |
-
}
|
11865 |
|
11866 |
-
|
11867 |
-
|
11868 |
-
|
11869 |
-
|
|
|
|
|
|
|
|
|
11870 |
|
11871 |
-
|
|
|
|
|
|
|
|
|
|
|
11872 |
|
|
|
|
|
|
|
|
|
11873 |
|
|
|
|
|
11874 |
|
|
|
11875 |
|
|
|
|
|
|
|
|
|
|
|
|
|
11876 |
|
|
|
11877 |
|
|
|
|
|
|
|
|
|
|
|
|
|
11878 |
|
11879 |
-
|
|
|
|
|
|
|
11880 |
|
11881 |
-
|
|
|
11882 |
|
11883 |
-
|
11884 |
-
|
11885 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11886 |
|
|
|
|
|
|
|
|
|
11887 |
|
|
|
|
|
|
|
|
|
|
|
11888 |
|
|
|
|
|
|
|
11889 |
|
|
|
11890 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11891 |
|
11892 |
-
|
11893 |
-
|
11894 |
-
|
11895 |
|
|
|
|
|
11896 |
|
|
|
|
|
|
|
11897 |
|
11898 |
-
|
11899 |
-
|
|
|
|
|
11900 |
|
11901 |
-
|
|
|
11902 |
|
11903 |
-
function
|
11904 |
-
|
|
|
|
|
|
|
|
|
11905 |
|
11906 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
11907 |
}
|
11908 |
|
11909 |
-
|
11910 |
-
|
11911 |
-
|
11912 |
-
|
11913 |
-
className = _this$props.className,
|
11914 |
-
notices = _this$props.notices,
|
11915 |
-
onRemove = _this$props.onRemove;
|
11916 |
-
var classes = classnames_default()('woocommerce-transient-notices', 'components-notices__snackbar', className);
|
11917 |
-
return Object(external_this_wp_element_["createElement"])(list, {
|
11918 |
-
notices: notices,
|
11919 |
-
className: classes,
|
11920 |
-
onRemove: onRemove
|
11921 |
-
});
|
11922 |
}
|
11923 |
-
|
11924 |
-
|
11925 |
-
return TransientNotices;
|
11926 |
-
}(external_this_wp_element_["Component"]);
|
11927 |
|
11928 |
-
|
11929 |
-
|
11930 |
-
|
11931 |
-
|
11932 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
11933 |
|
11934 |
-
|
11935 |
-
|
11936 |
-
|
11937 |
-
|
11938 |
-
|
11939 |
-
|
11940 |
-
var notices = select('core/notices').getNotices();
|
11941 |
-
return {
|
11942 |
-
notices: notices
|
11943 |
-
};
|
11944 |
-
}), Object(external_this_wp_data_["withDispatch"])(function (dispatch) {
|
11945 |
-
return {
|
11946 |
-
onRemove: dispatch('core/notices').removeNotice
|
11947 |
};
|
11948 |
-
}))(transient_notices_TransientNotices));
|
11949 |
-
// EXTERNAL MODULE: external {"this":["wp","plugins"]}
|
11950 |
-
var external_this_wp_plugins_ = __webpack_require__(296);
|
11951 |
|
11952 |
-
|
|
|
|
|
|
|
|
|
|
|
11953 |
|
|
|
|
|
|
|
11954 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11955 |
|
11956 |
-
|
|
|
11957 |
|
11958 |
-
|
|
|
11959 |
|
11960 |
-
|
11961 |
-
|
11962 |
-
|
11963 |
|
|
|
|
|
|
|
|
|
11964 |
|
|
|
|
|
|
|
11965 |
|
|
|
|
|
11966 |
|
11967 |
-
|
11968 |
-
|
11969 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11970 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11971 |
|
|
|
|
|
11972 |
|
|
|
|
|
|
|
|
|
|
|
11973 |
|
|
|
|
|
11974 |
|
11975 |
-
|
11976 |
-
|
11977 |
-
|
11978 |
-
|
11979 |
-
* respond to <Link /> component's manipulation of the url.
|
11980 |
-
*/
|
11981 |
-
if (!Object(utils["f" /* isWCAdmin */])(window.location.href)) {
|
11982 |
-
return null;
|
11983 |
-
}
|
11984 |
|
11985 |
-
|
11986 |
-
|
11987 |
-
|
11988 |
-
|
11989 |
-
|
11990 |
-
return navigation_objectSpread(navigation_objectSpread({}, page), {}, {
|
11991 |
-
breadcrumbs: [Object(external_this_wp_i18n_["__"])('Analytics', 'woocommerce-admin')]
|
11992 |
-
});
|
11993 |
-
}
|
11994 |
|
11995 |
-
|
11996 |
-
|
11997 |
-
|
11998 |
-
|
11999 |
-
|
12000 |
-
|
12001 |
-
key: page.id
|
12002 |
-
}, Object(external_this_wp_element_["createElement"])(external_this_wc_components_["Link"], {
|
12003 |
-
className: "components-button",
|
12004 |
-
href: Object(external_this_wc_navigation_["getNewPath"])(persistedQuery, page.path, {}),
|
12005 |
-
type: "wc-admin"
|
12006 |
-
}, page.breadcrumbs[page.breadcrumbs.length - 1]));
|
12007 |
-
}), reports.map(function (item) {
|
12008 |
-
return Object(external_this_wp_element_["createElement"])(external_this_wc_navigation_["WooNavigationItem"], {
|
12009 |
-
item: item.id,
|
12010 |
-
key: item.report
|
12011 |
-
}, Object(external_this_wp_element_["createElement"])(external_this_wc_components_["Link"], {
|
12012 |
-
className: "components-button",
|
12013 |
-
href: Object(external_this_wc_navigation_["getNewPath"])(persistedQuery, "/analytics/".concat(item.report), {}),
|
12014 |
-
type: "wc-admin"
|
12015 |
-
}, item.title));
|
12016 |
-
}));
|
12017 |
-
};
|
12018 |
|
12019 |
-
|
12020 |
-
|
12021 |
-
});
|
12022 |
-
// CONCATENATED MODULE: ./client/layout/index.js
|
12023 |
|
|
|
|
|
|
|
12024 |
|
|
|
|
|
|
|
|
|
|
|
|
|
12025 |
|
|
|
|
|
|
|
12026 |
|
|
|
|
|
|
|
|
|
|
|
|
|
12027 |
|
|
|
|
|
|
|
|
|
12028 |
|
|
|
|
|
|
|
|
|
12029 |
|
|
|
|
|
|
|
|
|
|
|
|
|
12030 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12031 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12032 |
|
12033 |
-
|
|
|
|
|
12034 |
|
12035 |
-
|
|
|
|
|
|
|
|
|
12036 |
|
12037 |
-
|
|
|
12038 |
|
12039 |
-
|
|
|
|
|
|
|
12040 |
|
12041 |
-
|
12042 |
-
|
12043 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12044 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12045 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12046 |
|
|
|
|
|
|
|
|
|
12047 |
|
|
|
|
|
|
|
|
|
|
|
|
|
12048 |
|
|
|
|
|
|
|
|
|
|
|
12049 |
|
|
|
|
|
|
|
12050 |
|
|
|
|
|
|
|
|
|
|
|
12051 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12052 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12053 |
|
12054 |
|
|
|
|
|
|
|
12055 |
|
|
|
12056 |
/**
|
12057 |
-
*
|
|
|
|
|
|
|
12058 |
*/
|
12059 |
|
12060 |
|
12061 |
|
|
|
12062 |
|
|
|
|
|
|
|
12063 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12064 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12065 |
|
12066 |
-
|
12067 |
-
|
12068 |
-
}
|
12069 |
-
var layout_PrimaryLayout = /*#__PURE__*/function (_Component) {
|
12070 |
-
inherits_default()(PrimaryLayout, _Component);
|
12071 |
-
|
12072 |
-
var _super = layout_createSuper(PrimaryLayout);
|
12073 |
-
|
12074 |
-
function PrimaryLayout() {
|
12075 |
-
classCallCheck_default()(this, PrimaryLayout);
|
12076 |
-
|
12077 |
-
return _super.apply(this, arguments);
|
12078 |
-
}
|
12079 |
-
|
12080 |
-
createClass_default()(PrimaryLayout, [{
|
12081 |
-
key: "render",
|
12082 |
-
value: function render() {
|
12083 |
-
var children = this.props.children;
|
12084 |
-
return Object(external_this_wp_element_["createElement"])("div", {
|
12085 |
-
className: "woocommerce-layout__primary",
|
12086 |
-
id: "woocommerce-layout__primary"
|
12087 |
-
}, window.wcAdminFeatures['store-alerts'] && Object(external_this_wp_element_["createElement"])(external_this_wp_element_["Suspense"], {
|
12088 |
-
fallback: Object(external_this_wp_element_["createElement"])(external_this_wc_components_["Spinner"], null)
|
12089 |
-
}, Object(external_this_wp_element_["createElement"])(StoreAlerts, null)), Object(external_this_wp_element_["createElement"])(layout_notices, null), children);
|
12090 |
-
}
|
12091 |
-
}]);
|
12092 |
|
12093 |
-
|
12094 |
-
}(external_this_wp_element_["Component"]);
|
12095 |
|
12096 |
-
|
12097 |
-
|
12098 |
|
12099 |
-
var _super2 = layout_createSuper(_Layout);
|
12100 |
|
12101 |
-
|
12102 |
-
|
|
|
12103 |
|
12104 |
-
|
12105 |
-
|
|
|
|
|
|
|
|
|
|
|
12106 |
|
12107 |
-
createClass_default()(_Layout, [{
|
12108 |
-
key: "componentDidMount",
|
12109 |
-
value: function componentDidMount() {
|
12110 |
-
this.recordPageViewTrack();
|
12111 |
-
}
|
12112 |
-
}, {
|
12113 |
-
key: "componentDidUpdate",
|
12114 |
-
value: function componentDidUpdate(prevProps) {
|
12115 |
-
var previousPath = Object(external_lodash_["get"])(prevProps, 'location.pathname');
|
12116 |
-
var currentPath = Object(external_lodash_["get"])(this.props, 'location.pathname');
|
12117 |
|
12118 |
-
if (!previousPath || !currentPath) {
|
12119 |
-
return;
|
12120 |
-
}
|
12121 |
|
12122 |
-
|
12123 |
-
this.recordPageViewTrack();
|
12124 |
-
}
|
12125 |
-
}
|
12126 |
-
}, {
|
12127 |
-
key: "recordPageViewTrack",
|
12128 |
-
value: function recordPageViewTrack() {
|
12129 |
-
var _this$props = this.props,
|
12130 |
-
activePlugins = _this$props.activePlugins,
|
12131 |
-
installedPlugins = _this$props.installedPlugins,
|
12132 |
-
isEmbedded = _this$props.isEmbedded,
|
12133 |
-
isJetpackConnected = _this$props.isJetpackConnected;
|
12134 |
-
var navigationFlag = {
|
12135 |
-
has_navigation: !!window.wcNavigation
|
12136 |
-
};
|
12137 |
|
12138 |
-
|
12139 |
-
var _path = document.location.pathname + document.location.search;
|
12140 |
|
12141 |
-
Object(external_this_wc_tracks_["recordPageView"])(_path, layout_objectSpread({
|
12142 |
-
is_embedded: true
|
12143 |
-
}, navigationFlag));
|
12144 |
-
return;
|
12145 |
-
}
|
12146 |
|
12147 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12148 |
|
12149 |
-
|
12150 |
-
return;
|
12151 |
-
} // Remove leading slash, and camel case remaining pathname
|
12152 |
|
|
|
|
|
|
|
|
|
12153 |
|
12154 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
12155 |
|
12156 |
-
|
12157 |
-
|
12158 |
-
|
12159 |
|
12160 |
-
|
12161 |
-
jetpack_installed: installedPlugins.includes('jetpack'),
|
12162 |
-
jetpack_active: activePlugins.includes('jetpack'),
|
12163 |
-
jetpack_connected: isJetpackConnected
|
12164 |
-
}, navigationFlag));
|
12165 |
-
}
|
12166 |
-
}, {
|
12167 |
-
key: "getQuery",
|
12168 |
-
value: function getQuery(searchString) {
|
12169 |
-
if (!searchString) {
|
12170 |
-
return {};
|
12171 |
-
}
|
12172 |
|
12173 |
-
var search = searchString.substring(1);
|
12174 |
-
return Object(lib["parse"])(search);
|
12175 |
-
}
|
12176 |
-
}, {
|
12177 |
-
key: "render",
|
12178 |
-
value: function render() {
|
12179 |
-
var _this$props2 = this.props,
|
12180 |
-
isEmbedded = _this$props2.isEmbedded,
|
12181 |
-
restProps = objectWithoutProperties_default()(_this$props2, ["isEmbedded"]);
|
12182 |
|
12183 |
-
|
12184 |
-
|
12185 |
-
|
12186 |
-
|
12187 |
-
var query = this.getQuery(location && location.search);
|
12188 |
-
return Object(external_this_wp_element_["createElement"])("div", {
|
12189 |
-
className: "woocommerce-layout"
|
12190 |
-
}, Object(external_this_wp_element_["createElement"])(header_Header, {
|
12191 |
-
sections: Object(external_lodash_["isFunction"])(breadcrumbs) ? breadcrumbs(this.props) : breadcrumbs,
|
12192 |
-
isEmbedded: isEmbedded,
|
12193 |
-
query: query
|
12194 |
-
}), Object(external_this_wp_element_["createElement"])(transient_notices, null), !isEmbedded && Object(external_this_wp_element_["createElement"])(layout_PrimaryLayout, null, Object(external_this_wp_element_["createElement"])("div", {
|
12195 |
-
className: "woocommerce-layout__main"
|
12196 |
-
}, Object(external_this_wp_element_["createElement"])(controller_Controller, extends_default()({}, restProps, {
|
12197 |
-
query: query
|
12198 |
-
})))));
|
12199 |
-
}
|
12200 |
-
}]);
|
12201 |
|
12202 |
-
|
12203 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12204 |
|
12205 |
-
|
12206 |
-
|
12207 |
-
|
12208 |
-
container: prop_types_default.a.oneOfType([prop_types_default.a.func, prop_types_default.a.object // Support React.lazy
|
12209 |
-
]),
|
12210 |
-
path: prop_types_default.a.string,
|
12211 |
-
breadcrumbs: prop_types_default.a.oneOfType([prop_types_default.a.func, prop_types_default.a.arrayOf(prop_types_default.a.oneOfType([prop_types_default.a.arrayOf(prop_types_default.a.string), prop_types_default.a.string]))]).isRequired,
|
12212 |
-
wpOpenMenu: prop_types_default.a.string
|
12213 |
-
}).isRequired
|
12214 |
-
};
|
12215 |
-
var Layout = Object(compose["a" /* default */])(Object(external_this_wc_data_["withPluginsHydration"])(layout_objectSpread(layout_objectSpread({}, window.wcSettings.plugins || {}), {}, {
|
12216 |
-
jetpackStatus: window.wcSettings.dataEndpoints && window.wcSettings.dataEndpoints.jetpackStatus || false
|
12217 |
-
})), Object(external_this_wp_data_["withSelect"])(function (select, _ref) {
|
12218 |
-
var isEmbedded = _ref.isEmbedded;
|
12219 |
|
12220 |
-
// Embedded pages don't send plugin info to Tracks.
|
12221 |
-
if (isEmbedded) {
|
12222 |
-
return;
|
12223 |
-
}
|
12224 |
|
12225 |
-
var _select = select(external_this_wc_data_["PLUGINS_STORE_NAME"]),
|
12226 |
-
getActivePlugins = _select.getActivePlugins,
|
12227 |
-
getInstalledPlugins = _select.getInstalledPlugins,
|
12228 |
-
isJetpackConnected = _select.isJetpackConnected;
|
12229 |
|
12230 |
-
|
12231 |
-
|
12232 |
-
|
12233 |
-
|
12234 |
-
|
12235 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12236 |
|
12237 |
-
var layout_PageLayout = /*#__PURE__*/function (_Component3) {
|
12238 |
-
inherits_default()(_PageLayout, _Component3);
|
12239 |
|
12240 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
12241 |
|
12242 |
-
|
12243 |
-
|
|
|
12244 |
|
12245 |
-
|
|
|
12246 |
}
|
12247 |
|
12248 |
-
|
12249 |
-
|
12250 |
-
|
12251 |
-
|
12252 |
-
|
12253 |
-
|
12254 |
-
return Object(external_this_wp_element_["createElement"])(react_router_Route, {
|
12255 |
-
key: page.path,
|
12256 |
-
path: page.path,
|
12257 |
-
exact: true,
|
12258 |
-
render: function render(props) {
|
12259 |
-
return Object(external_this_wp_element_["createElement"])(Layout, extends_default()({
|
12260 |
-
page: page
|
12261 |
-
}, props));
|
12262 |
-
}
|
12263 |
-
});
|
12264 |
-
})));
|
12265 |
-
}
|
12266 |
-
}]);
|
12267 |
|
12268 |
-
return _PageLayout;
|
12269 |
-
}(external_this_wp_element_["Component"]);
|
12270 |
|
12271 |
-
|
|
|
|
|
12272 |
|
12273 |
-
var layout_EmbedLayout = function _EmbedLayout() {
|
12274 |
-
return Object(external_this_wp_element_["createElement"])(Layout, {
|
12275 |
-
page: {
|
12276 |
-
breadcrumbs: Object(settings["g" /* getSetting */])('embedBreadcrumbs', [])
|
12277 |
-
},
|
12278 |
-
isEmbedded: true
|
12279 |
-
});
|
12280 |
-
};
|
12281 |
|
12282 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12283 |
|
12284 |
-
|
|
|
12285 |
|
12286 |
-
|
12287 |
-
|
|
|
12288 |
|
12289 |
-
|
|
|
|
|
12290 |
|
12291 |
-
|
|
|
|
|
12292 |
|
12293 |
-
|
12294 |
-
|
|
|
|
|
12295 |
|
12296 |
-
(
|
|
|
|
|
12297 |
|
12298 |
-
|
12299 |
|
12300 |
-
|
12301 |
-
|
|
|
12302 |
|
12303 |
-
var
|
|
|
|
|
12304 |
|
12305 |
-
|
|
|
|
|
12306 |
|
12307 |
-
var
|
|
|
|
|
|
|
12308 |
|
12309 |
-
var
|
|
|
|
|
|
|
12310 |
|
12311 |
-
|
12312 |
-
|
12313 |
-
}
|
12314 |
|
12315 |
-
|
|
|
|
|
12316 |
|
12317 |
-
/***/ }),
|
12318 |
|
12319 |
-
|
12320 |
-
|
|
|
|
|
|
|
|
|
12321 |
|
12322 |
-
|
12323 |
-
|
12324 |
-
|
12325 |
-
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
|
12326 |
-
/**
|
12327 |
-
* WordPress dependencies
|
12328 |
-
*/
|
12329 |
|
12330 |
-
|
12331 |
-
|
12332 |
-
|
12333 |
-
*
|
12334 |
-
* @param {Object} object Object reference to create an id for.
|
12335 |
-
*/
|
12336 |
|
12337 |
-
|
12338 |
-
var
|
12339 |
-
|
12340 |
-
return
|
12341 |
}
|
12342 |
/**
|
12343 |
-
*
|
12344 |
*
|
12345 |
-
* @param {
|
12346 |
-
* @param {
|
|
|
|
|
12347 |
*/
|
12348 |
|
12349 |
|
12350 |
-
function
|
12351 |
-
return
|
12352 |
-
var id = createId(object);
|
12353 |
-
return prefix ? "".concat(prefix, "-").concat(id) : id;
|
12354 |
-
}, [object]);
|
12355 |
}
|
12356 |
-
//# sourceMappingURL=index.js.map
|
12357 |
-
|
12358 |
-
/***/ }),
|
12359 |
-
|
12360 |
-
/***/ 306:
|
12361 |
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
12362 |
-
|
12363 |
-
"use strict";
|
12364 |
-
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0);
|
12365 |
-
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
|
12366 |
-
/* harmony import */ var _use_media_query__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(112);
|
12367 |
-
/**
|
12368 |
-
* WordPress dependencies
|
12369 |
-
*/
|
12370 |
-
|
12371 |
-
/**
|
12372 |
-
* Internal dependencies
|
12373 |
-
*/
|
12374 |
-
|
12375 |
-
|
12376 |
/**
|
12377 |
-
*
|
|
|
|
|
|
|
|
|
|
|
12378 |
*/
|
12379 |
|
|
|
|
|
|
|
12380 |
/**
|
12381 |
-
*
|
12382 |
*
|
12383 |
-
* @
|
12384 |
*
|
12385 |
-
* @
|
12386 |
*/
|
12387 |
|
12388 |
-
|
12389 |
-
|
12390 |
-
|
12391 |
-
|
12392 |
-
|
12393 |
-
|
12394 |
-
|
12395 |
-
};
|
12396 |
-
/**
|
12397 |
-
* @typedef {">="|"<"} WPViewportOperator
|
12398 |
-
*/
|
12399 |
|
12400 |
-
|
12401 |
-
|
12402 |
-
|
12403 |
-
* @type {Object<WPViewportOperator,string>}
|
12404 |
-
*/
|
12405 |
|
12406 |
-
|
12407 |
-
|
12408 |
-
|
12409 |
-
|
12410 |
-
|
12411 |
-
|
12412 |
-
|
12413 |
-
* @type {Object<WPViewportOperator,Function>}
|
12414 |
-
*/
|
12415 |
|
12416 |
-
var
|
12417 |
-
|
12418 |
-
|
12419 |
-
|
12420 |
-
|
12421 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12422 |
}
|
12423 |
-
|
12424 |
-
|
|
|
12425 |
/**
|
12426 |
-
*
|
12427 |
-
*
|
12428 |
-
* @param {WPBreakpoint} breakpoint Breakpoint size name.
|
12429 |
-
* @param {WPViewportOperator} [operator=">="] Viewport operator.
|
12430 |
-
*
|
12431 |
-
* @example
|
12432 |
*
|
12433 |
-
*
|
12434 |
-
* useViewportMatch( 'huge', '<' );
|
12435 |
-
* useViewportMatch( 'medium' );
|
12436 |
-
* ```
|
12437 |
*
|
12438 |
-
* @return {
|
12439 |
*/
|
12440 |
|
12441 |
-
|
12442 |
-
var
|
12443 |
-
var
|
12444 |
-
var mediaQuery = !simulatedWidth && "(".concat(CONDITIONS[operator], ": ").concat(BREAKPOINTS[breakpoint], "px)");
|
12445 |
-
var mediaQueryResult = Object(_use_media_query__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"])(mediaQuery);
|
12446 |
|
12447 |
-
if (
|
12448 |
-
return
|
12449 |
}
|
12450 |
|
12451 |
-
return
|
12452 |
-
}
|
12453 |
-
|
12454 |
-
|
12455 |
-
/* harmony default export */ __webpack_exports__["a"] = (useViewportMatch);
|
12456 |
-
//# sourceMappingURL=index.js.map
|
12457 |
-
|
12458 |
-
/***/ }),
|
12459 |
-
|
12460 |
-
/***/ 307:
|
12461 |
-
/***/ (function(module, exports, __webpack_require__) {
|
12462 |
-
|
12463 |
-
"use strict";
|
12464 |
-
/** @license React v16.13.1
|
12465 |
-
* react-is.production.min.js
|
12466 |
-
*
|
12467 |
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
12468 |
*
|
12469 |
-
*
|
12470 |
-
*
|
12471 |
*/
|
12472 |
|
12473 |
-
|
12474 |
-
|
12475 |
-
|
12476 |
-
|
12477 |
-
exports.isMemo=function(a){return z(a)===r};exports.isPortal=function(a){return z(a)===d};exports.isProfiler=function(a){return z(a)===g};exports.isStrictMode=function(a){return z(a)===f};exports.isSuspense=function(a){return z(a)===p};
|
12478 |
-
exports.isValidElementType=function(a){return"string"===typeof a||"function"===typeof a||a===e||a===m||a===g||a===f||a===p||a===q||"object"===typeof a&&null!==a&&(a.$$typeof===t||a.$$typeof===r||a.$$typeof===h||a.$$typeof===k||a.$$typeof===n||a.$$typeof===w||a.$$typeof===x||a.$$typeof===y||a.$$typeof===v)};exports.typeOf=z;
|
12479 |
|
|
|
|
|
12480 |
|
12481 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
12482 |
|
12483 |
-
|
12484 |
-
|
12485 |
|
12486 |
-
|
12487 |
-
|
12488 |
-
|
12489 |
-
|
12490 |
-
|
12491 |
-
|
12492 |
-
|
12493 |
-
/* harmony import */ var _colors_values__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(91);
|
12494 |
-
/**
|
12495 |
-
* External dependencies
|
12496 |
-
*/
|
12497 |
|
12498 |
|
12499 |
-
|
12500 |
-
|
12501 |
-
*/
|
12502 |
|
|
|
|
|
|
|
12503 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12504 |
/**
|
12505 |
-
*
|
|
|
12506 |
*
|
12507 |
-
* @
|
12508 |
-
* @param {number} alpha The alpha value for opacity.
|
12509 |
-
* @return {string} The converted rgba() color value.
|
12510 |
*
|
12511 |
-
* @
|
12512 |
-
*
|
12513 |
-
*
|
|
|
|
|
12514 |
*/
|
12515 |
|
12516 |
-
function
|
12517 |
-
|
12518 |
-
|
|
|
12519 |
|
12520 |
-
|
12521 |
-
|
12522 |
-
|
12523 |
-
b = _tinycolor$toRgb.b;
|
12524 |
|
12525 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12526 |
}
|
12527 |
/**
|
12528 |
-
*
|
|
|
|
|
12529 |
*
|
12530 |
-
* @param {
|
12531 |
-
* @
|
|
|
|
|
12532 |
*
|
12533 |
-
* @
|
12534 |
-
* color( 'blue.wordpress.700' )
|
12535 |
-
* // #00669b
|
12536 |
*/
|
12537 |
|
12538 |
-
function color(value) {
|
12539 |
-
var fallbackColor = '#000';
|
12540 |
-
return Object(lodash__WEBPACK_IMPORTED_MODULE_0__["get"])(_colors_values__WEBPACK_IMPORTED_MODULE_2__[/* COLORS */ "a"], value, fallbackColor);
|
12541 |
-
}
|
12542 |
-
//# sourceMappingURL=colors.js.map
|
12543 |
|
12544 |
-
|
|
|
|
|
12545 |
|
12546 |
-
|
12547 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12548 |
|
12549 |
-
(function() { module.exports = this["wc"]["navigation"]; }());
|
12550 |
|
12551 |
-
|
|
|
12552 |
|
12553 |
-
|
12554 |
-
|
|
|
12555 |
|
12556 |
-
|
12557 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12558 |
|
12559 |
-
// cached from whatever global is present so that test runners that stub it
|
12560 |
-
// don't break things. But we need to wrap it in a try catch in case it is
|
12561 |
-
// wrapped in strict mode code which doesn't define any globals. It's inside a
|
12562 |
-
// function because try/catches deoptimize in certain engines.
|
12563 |
|
12564 |
-
var
|
12565 |
-
var
|
|
|
|
|
|
|
|
|
|
|
12566 |
|
12567 |
-
|
12568 |
-
|
12569 |
-
|
12570 |
-
|
12571 |
-
|
12572 |
-
|
12573 |
-
|
12574 |
-
try {
|
12575 |
-
if (typeof setTimeout === 'function') {
|
12576 |
-
cachedSetTimeout = setTimeout;
|
12577 |
-
} else {
|
12578 |
-
cachedSetTimeout = defaultSetTimout;
|
12579 |
-
}
|
12580 |
-
} catch (e) {
|
12581 |
-
cachedSetTimeout = defaultSetTimout;
|
12582 |
-
}
|
12583 |
-
try {
|
12584 |
-
if (typeof clearTimeout === 'function') {
|
12585 |
-
cachedClearTimeout = clearTimeout;
|
12586 |
-
} else {
|
12587 |
-
cachedClearTimeout = defaultClearTimeout;
|
12588 |
-
}
|
12589 |
-
} catch (e) {
|
12590 |
-
cachedClearTimeout = defaultClearTimeout;
|
12591 |
-
}
|
12592 |
-
} ())
|
12593 |
-
function runTimeout(fun) {
|
12594 |
-
if (cachedSetTimeout === setTimeout) {
|
12595 |
-
//normal enviroments in sane situations
|
12596 |
-
return setTimeout(fun, 0);
|
12597 |
-
}
|
12598 |
-
// if setTimeout wasn't available but was latter defined
|
12599 |
-
if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
|
12600 |
-
cachedSetTimeout = setTimeout;
|
12601 |
-
return setTimeout(fun, 0);
|
12602 |
-
}
|
12603 |
-
try {
|
12604 |
-
// when when somebody has screwed with setTimeout but no I.E. maddness
|
12605 |
-
return cachedSetTimeout(fun, 0);
|
12606 |
-
} catch(e){
|
12607 |
-
try {
|
12608 |
-
// When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
|
12609 |
-
return cachedSetTimeout.call(null, fun, 0);
|
12610 |
-
} catch(e){
|
12611 |
-
// 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
|
12612 |
-
return cachedSetTimeout.call(this, fun, 0);
|
12613 |
-
}
|
12614 |
}
|
12615 |
|
|
|
|
|
|
|
12616 |
|
12617 |
-
|
12618 |
-
|
12619 |
-
|
12620 |
-
|
12621 |
-
|
12622 |
-
}
|
12623 |
-
// if clearTimeout wasn't available but was latter defined
|
12624 |
-
if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {
|
12625 |
-
cachedClearTimeout = clearTimeout;
|
12626 |
-
return clearTimeout(marker);
|
12627 |
-
}
|
12628 |
-
try {
|
12629 |
-
// when when somebody has screwed with setTimeout but no I.E. maddness
|
12630 |
-
return cachedClearTimeout(marker);
|
12631 |
-
} catch (e){
|
12632 |
-
try {
|
12633 |
-
// When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
|
12634 |
-
return cachedClearTimeout.call(null, marker);
|
12635 |
-
} catch (e){
|
12636 |
-
// 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.
|
12637 |
-
// Some versions of I.E. have different rules for clearTimeout vs setTimeout
|
12638 |
-
return cachedClearTimeout.call(this, marker);
|
12639 |
-
}
|
12640 |
-
}
|
12641 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12642 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12643 |
|
|
|
|
|
|
|
|
|
|
|
12644 |
}
|
12645 |
-
|
12646 |
-
|
12647 |
-
|
12648 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12649 |
|
12650 |
-
function
|
12651 |
-
|
12652 |
-
|
12653 |
-
|
12654 |
-
draining = false;
|
12655 |
-
if (currentQueue.length) {
|
12656 |
-
queue = currentQueue.concat(queue);
|
12657 |
-
} else {
|
12658 |
-
queueIndex = -1;
|
12659 |
-
}
|
12660 |
-
if (queue.length) {
|
12661 |
-
drainQueue();
|
12662 |
-
}
|
12663 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12664 |
|
12665 |
-
function
|
12666 |
-
|
12667 |
-
|
12668 |
-
|
12669 |
-
var timeout = runTimeout(cleanUpNextTick);
|
12670 |
-
draining = true;
|
12671 |
|
12672 |
-
|
12673 |
-
|
12674 |
-
|
12675 |
-
|
12676 |
-
|
12677 |
-
|
12678 |
-
|
12679 |
-
|
12680 |
-
|
12681 |
-
|
12682 |
-
|
12683 |
-
|
12684 |
-
|
12685 |
-
|
12686 |
-
|
12687 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12688 |
|
12689 |
-
process.nextTick = function (fun) {
|
12690 |
-
var args = new Array(arguments.length - 1);
|
12691 |
-
if (arguments.length > 1) {
|
12692 |
-
for (var i = 1; i < arguments.length; i++) {
|
12693 |
-
args[i - 1] = arguments[i];
|
12694 |
-
}
|
12695 |
-
}
|
12696 |
-
queue.push(new Item(fun, args));
|
12697 |
-
if (queue.length === 1 && !draining) {
|
12698 |
-
runTimeout(drainQueue);
|
12699 |
-
}
|
12700 |
-
};
|
12701 |
|
12702 |
-
|
12703 |
-
|
12704 |
-
this.fun = fun;
|
12705 |
-
this.array = array;
|
12706 |
}
|
12707 |
-
|
12708 |
-
|
12709 |
-
|
12710 |
-
|
12711 |
-
|
12712 |
-
|
12713 |
-
|
12714 |
-
|
12715 |
-
process.versions = {};
|
12716 |
-
|
12717 |
-
function noop() {}
|
12718 |
|
12719 |
-
|
12720 |
-
|
12721 |
-
|
12722 |
-
|
12723 |
-
|
12724 |
-
|
12725 |
-
|
12726 |
-
|
12727 |
-
|
|
|
|
|
12728 |
|
12729 |
-
|
|
|
|
|
|
|
12730 |
|
12731 |
-
|
12732 |
-
|
12733 |
-
}
|
12734 |
|
12735 |
-
|
12736 |
-
|
12737 |
-
|
12738 |
-
|
12739 |
-
process.umask = function() { return 0; };
|
12740 |
|
|
|
|
|
|
|
12741 |
|
12742 |
-
|
|
|
|
|
|
|
12743 |
|
12744 |
-
|
12745 |
-
|
|
|
12746 |
|
12747 |
-
var
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12748 |
|
12749 |
-
|
|
|
|
|
|
|
12750 |
|
12751 |
-
var unsupportedIterableToArray = __webpack_require__(83);
|
12752 |
|
12753 |
-
|
|
|
|
|
|
|
12754 |
|
12755 |
-
|
12756 |
-
|
12757 |
-
}
|
|
|
12758 |
|
12759 |
-
module.exports = _slicedToArray;
|
12760 |
|
12761 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12762 |
|
12763 |
-
|
12764 |
-
|
|
|
|
|
12765 |
|
12766 |
-
(
|
|
|
|
|
|
|
|
|
12767 |
|
12768 |
-
|
|
|
|
|
|
|
12769 |
|
12770 |
-
/***/ 36:
|
12771 |
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
12772 |
|
12773 |
-
|
12774 |
-
|
12775 |
-
|
12776 |
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return CURRENCY; });
|
12777 |
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return LOCALE; });
|
12778 |
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return ORDER_STATUSES; });
|
12779 |
-
/* unused harmony export SITE_TITLE */
|
12780 |
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return WC_ASSET_URL; });
|
12781 |
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "g", function() { return getSetting; });
|
12782 |
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "h", function() { return setSetting; });
|
12783 |
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return getAdminLink; });
|
12784 |
-
/* harmony import */ var _babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(48);
|
12785 |
-
/* harmony import */ var _babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_0__);
|
12786 |
-
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(3);
|
12787 |
-
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__);
|
12788 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12789 |
|
|
|
|
|
|
|
|
|
12790 |
/**
|
12791 |
-
*
|
|
|
|
|
|
|
12792 |
*/
|
12793 |
-
// Remove mutable data from settings object to prevent access. Data stores should be used instead.
|
12794 |
|
12795 |
-
|
12796 |
-
|
12797 |
-
|
12798 |
-
|
12799 |
-
|
12800 |
-
|
|
|
|
|
|
|
|
|
|
|
12801 |
|
12802 |
-
|
12803 |
-
|
12804 |
-
|
12805 |
-
var COUNTRIES = SOURCE.countries;
|
12806 |
-
var CURRENCY = SOURCE.currency;
|
12807 |
-
var LOCALE = SOURCE.locale;
|
12808 |
-
var ORDER_STATUSES = SOURCE.orderStatuses;
|
12809 |
-
var SITE_TITLE = SOURCE.siteTitle;
|
12810 |
-
var WC_ASSET_URL = SOURCE.wcAssetUrl;
|
12811 |
/**
|
12812 |
-
*
|
12813 |
*
|
12814 |
-
* @param {
|
12815 |
-
* @param {*} [fallback=false] The value to use as a fallback
|
12816 |
-
* if the setting is not in the
|
12817 |
-
* state.
|
12818 |
-
* @param {Function} [filter=( val ) => val] A callback for filtering the
|
12819 |
-
* value before it's returned.
|
12820 |
-
* Receives both the found value
|
12821 |
-
* (if it exists for the key) and
|
12822 |
-
* the provided fallback arg.
|
12823 |
*
|
12824 |
-
* @return {
|
12825 |
-
* name.
|
12826 |
*/
|
12827 |
|
12828 |
-
function
|
12829 |
-
var
|
12830 |
-
var filter = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : function (val) {
|
12831 |
-
return val;
|
12832 |
-
};
|
12833 |
|
12834 |
-
|
12835 |
-
|
12836 |
}
|
12837 |
|
12838 |
-
|
12839 |
-
return filter(value, fallback);
|
12840 |
}
|
12841 |
/**
|
12842 |
-
*
|
12843 |
-
*
|
12844 |
-
* NOTE: This feature is to be removed in favour of data stores when a full migration
|
12845 |
-
* is complete.
|
12846 |
*
|
12847 |
-
* @
|
|
|
12848 |
*
|
12849 |
-
* @
|
12850 |
-
* setting being mutated.
|
12851 |
-
* @param {*} value The value to set.
|
12852 |
-
* @param {Function} [filter=( val ) => val] Allows for providing a callback
|
12853 |
-
* to sanitize the setting (eg.
|
12854 |
-
* ensure it's a number)
|
12855 |
*/
|
12856 |
|
12857 |
-
function
|
12858 |
-
var
|
12859 |
-
return val;
|
12860 |
-
};
|
12861 |
|
12862 |
-
|
12863 |
-
|
12864 |
}
|
12865 |
|
12866 |
-
|
|
|
12867 |
}
|
12868 |
/**
|
12869 |
-
*
|
12870 |
*
|
12871 |
-
* @param {
|
12872 |
-
* @
|
12873 |
*/
|
12874 |
|
12875 |
-
function
|
12876 |
-
|
|
|
12877 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12878 |
|
12879 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12880 |
|
12881 |
-
|
12882 |
-
|
|
|
|
|
12883 |
|
12884 |
-
(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12885 |
|
12886 |
-
/***/ }),
|
12887 |
|
12888 |
-
|
12889 |
-
|
|
|
|
|
12890 |
|
12891 |
-
|
12892 |
-
|
12893 |
-
|
12894 |
-
|
12895 |
|
12896 |
-
|
12897 |
-
|
12898 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12899 |
}
|
12900 |
-
}
|
12901 |
-
}
|
12902 |
|
12903 |
-
|
12904 |
-
|
|
|
|
|
|
|
12905 |
|
12906 |
-
return _extends.apply(this, arguments);
|
12907 |
-
}
|
12908 |
|
12909 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12910 |
|
12911 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12912 |
|
12913 |
-
|
12914 |
-
|
|
|
|
|
|
|
|
|
|
|
12915 |
|
12916 |
-
|
12917 |
-
|
12918 |
-
|
12919 |
-
http://jedwatson.github.io/classnames
|
12920 |
-
*/
|
12921 |
-
/* global define */
|
12922 |
|
12923 |
-
(
|
12924 |
-
|
|
|
12925 |
|
12926 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12927 |
|
12928 |
-
function classNames () {
|
12929 |
-
var classes = [];
|
12930 |
|
12931 |
-
|
12932 |
-
|
12933 |
-
|
|
|
12934 |
|
12935 |
-
|
|
|
|
|
|
|
12936 |
|
12937 |
-
|
12938 |
-
|
12939 |
-
|
12940 |
-
|
12941 |
-
|
12942 |
-
|
12943 |
-
}
|
12944 |
-
} else if (argType === 'object') {
|
12945 |
-
for (var key in arg) {
|
12946 |
-
if (hasOwn.call(arg, key) && arg[key]) {
|
12947 |
-
classes.push(key);
|
12948 |
-
}
|
12949 |
-
}
|
12950 |
-
}
|
12951 |
-
}
|
12952 |
|
12953 |
-
|
12954 |
-
|
12955 |
|
12956 |
-
|
12957 |
-
|
12958 |
-
|
12959 |
-
|
12960 |
-
|
12961 |
-
|
12962 |
-
|
12963 |
-
|
12964 |
-
|
12965 |
-
|
12966 |
-
|
12967 |
-
|
12968 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12969 |
|
12970 |
/***/ }),
|
12971 |
-
|
12972 |
-
/***/ 40:
|
12973 |
/***/ (function(module, exports) {
|
12974 |
|
12975 |
-
|
|
|
|
|
|
|
|
|
12976 |
|
12977 |
-
|
12978 |
|
12979 |
-
/***/
|
|
|
|
|
|
|
12980 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
12981 |
|
12982 |
"use strict";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12983 |
|
12984 |
-
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/defineProperty.js
|
12985 |
-
var defineProperty = __webpack_require__(5);
|
12986 |
-
var defineProperty_default = /*#__PURE__*/__webpack_require__.n(defineProperty);
|
12987 |
-
|
12988 |
-
// EXTERNAL MODULE: external "React"
|
12989 |
-
var external_React_ = __webpack_require__(6);
|
12990 |
-
|
12991 |
-
// EXTERNAL MODULE: ./node_modules/@emotion/memoize/dist/memoize.browser.esm.js
|
12992 |
-
var memoize_browser_esm = __webpack_require__(102);
|
12993 |
-
|
12994 |
-
// CONCATENATED MODULE: ./node_modules/@emotion/is-prop-valid/dist/is-prop-valid.browser.esm.js
|
12995 |
|
12996 |
|
12997 |
-
var reactPropsRegex = /^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|inert|itemProp|itemScope|itemType|itemID|itemRef|on|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/; // https://esbench.com/bench/5bfee68a4cd7e6009ef61d23
|
12998 |
|
12999 |
-
var index = Object(memoize_browser_esm["a" /* default */])(function (prop) {
|
13000 |
-
return reactPropsRegex.test(prop) || prop.charCodeAt(0) === 111
|
13001 |
-
/* o */
|
13002 |
-
&& prop.charCodeAt(1) === 110
|
13003 |
-
/* n */
|
13004 |
-
&& prop.charCodeAt(2) < 91;
|
13005 |
-
}
|
13006 |
-
/* Z+1 */
|
13007 |
-
);
|
13008 |
|
13009 |
-
/* harmony default export */ var is_prop_valid_browser_esm = (index);
|
13010 |
|
13011 |
-
// EXTERNAL MODULE: ./node_modules/@emotion/core/dist/core.browser.esm.js + 6 modules
|
13012 |
-
var core_browser_esm = __webpack_require__(67);
|
13013 |
|
13014 |
-
|
13015 |
-
var utils_browser_esm = __webpack_require__(50);
|
13016 |
|
13017 |
-
|
13018 |
-
var serialize_browser_esm = __webpack_require__(49);
|
13019 |
|
13020 |
-
|
|
|
|
|
13021 |
|
|
|
|
|
|
|
13022 |
|
13023 |
|
|
|
|
|
|
|
13024 |
|
13025 |
|
13026 |
|
|
|
|
|
|
|
|
|
|
|
13027 |
|
13028 |
-
var
|
13029 |
|
13030 |
-
var
|
13031 |
-
|
13032 |
-
};
|
13033 |
|
13034 |
-
var
|
13035 |
-
return typeof tag === 'string' && // 96 is one less than the char code
|
13036 |
-
// for "a" so this is checking that
|
13037 |
-
// it's a lowercase character
|
13038 |
-
tag.charCodeAt(0) > 96 ? testOmitPropsOnStringTag : testOmitPropsOnComponent;
|
13039 |
-
};
|
13040 |
|
13041 |
-
function
|
|
|
13042 |
|
13043 |
-
|
13044 |
-
var ILLEGAL_ESCAPE_SEQUENCE_ERROR = "You have illegal escape sequence in your template literal, most likely inside content's property value.\nBecause you write your CSS inside a JavaScript string you actually have to do double escaping, so for example \"content: '\\00d7';\" should become \"content: '\\\\00d7';\".\nYou can read more about this here:\nhttps://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals#ES2018_revision_of_illegal_escape_sequences";
|
13045 |
|
13046 |
-
|
13047 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13048 |
|
13049 |
-
|
13050 |
-
|
13051 |
-
|
|
|
|
|
|
|
|
|
13052 |
|
13053 |
-
|
13054 |
-
|
13055 |
-
|
13056 |
-
|
13057 |
-
|
13058 |
-
options.shouldForwardProp(propName);
|
13059 |
-
} : options.shouldForwardProp;
|
13060 |
}
|
13061 |
|
13062 |
-
|
13063 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13064 |
|
13065 |
-
|
13066 |
-
|
13067 |
-
|
13068 |
|
13069 |
-
|
13070 |
-
var shouldUseAs = !defaultShouldForwardProp('as');
|
13071 |
-
return function () {
|
13072 |
-
var args = arguments;
|
13073 |
-
var styles = isReal && tag.__emotion_styles !== undefined ? tag.__emotion_styles.slice(0) : [];
|
13074 |
|
13075 |
-
|
13076 |
-
|
|
|
13077 |
}
|
|
|
|
|
|
|
|
|
13078 |
|
13079 |
-
|
13080 |
-
|
13081 |
-
|
13082 |
-
|
13083 |
-
|
13084 |
-
|
13085 |
-
|
13086 |
-
|
13087 |
|
13088 |
-
for (; i < len; i++) {
|
13089 |
-
if (false) {}
|
13090 |
|
13091 |
-
|
13092 |
-
|
13093 |
-
|
|
|
|
|
13094 |
|
13095 |
|
13096 |
-
|
13097 |
-
|
13098 |
-
|
13099 |
-
|
13100 |
-
var classInterpolations = [];
|
13101 |
-
var mergedProps = props;
|
13102 |
|
13103 |
-
if (props.theme == null) {
|
13104 |
-
mergedProps = {};
|
13105 |
|
13106 |
-
|
13107 |
-
mergedProps[key] = props[key];
|
13108 |
-
}
|
13109 |
|
13110 |
-
|
13111 |
-
}
|
13112 |
|
13113 |
-
if (
|
13114 |
-
|
13115 |
-
} else if (props.className != null) {
|
13116 |
-
className = props.className + " ";
|
13117 |
}
|
13118 |
|
13119 |
-
|
13120 |
-
|
13121 |
-
|
13122 |
-
|
13123 |
-
|
13124 |
-
|
13125 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13126 |
|
13127 |
-
|
13128 |
-
|
|
|
|
|
13129 |
|
13130 |
-
|
13131 |
-
|
|
|
|
|
|
|
|
|
13132 |
|
13133 |
-
if ( // $FlowFixMe
|
13134 |
-
finalShouldForwardProp(_key)) {
|
13135 |
-
newProps[_key] = props[_key];
|
13136 |
-
}
|
13137 |
-
}
|
13138 |
|
13139 |
-
|
13140 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13141 |
|
|
|
13142 |
if (false) {}
|
13143 |
|
13144 |
-
|
|
|
13145 |
|
13146 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13147 |
});
|
13148 |
-
}
|
13149 |
-
|
13150 |
-
Styled.defaultProps = tag.defaultProps;
|
13151 |
-
Styled.__emotion_real = Styled;
|
13152 |
-
Styled.__emotion_base = baseTag;
|
13153 |
-
Styled.__emotion_styles = styles;
|
13154 |
-
Styled.__emotion_forwardProp = shouldForwardProp;
|
13155 |
-
Object.defineProperty(Styled, 'toString', {
|
13156 |
-
value: function value() {
|
13157 |
-
if (targetClassName === undefined && "production" !== 'production') {
|
13158 |
-
return 'NO_COMPONENT_SELECTOR';
|
13159 |
-
} // $FlowFixMe: coerce undefined to string
|
13160 |
|
|
|
|
|
13161 |
|
13162 |
-
|
13163 |
-
|
13164 |
-
});
|
13165 |
|
13166 |
-
|
13167 |
-
|
13168 |
-
|
|
|
13169 |
|
13170 |
-
|
|
|
|
|
|
|
13171 |
};
|
13172 |
-
};
|
13173 |
-
|
13174 |
-
/* harmony default export */ var styled_base_browser_esm = __webpack_exports__["a"] = (styled_base_browser_esm_createStyled);
|
13175 |
|
|
|
|
|
13176 |
|
13177 |
-
|
13178 |
-
|
13179 |
-
/***/ 43:
|
13180 |
-
/***/ (function(module, exports) {
|
13181 |
-
|
13182 |
-
(function() { module.exports = this["wp"]["apiFetch"]; }());
|
13183 |
|
13184 |
/***/ }),
|
13185 |
-
|
13186 |
-
/***/ 436:
|
13187 |
/***/ (function(module, exports, __webpack_require__) {
|
13188 |
|
13189 |
"use strict";
|
13190 |
|
13191 |
|
13192 |
-
|
13193 |
-
|
13194 |
-
|
13195 |
-
|
13196 |
-
var _extends = _interopDefault(__webpack_require__(38));
|
13197 |
-
var _objectWithoutPropertiesLoose = _interopDefault(__webpack_require__(280));
|
13198 |
-
var React = __webpack_require__(6);
|
13199 |
-
var React__default = _interopDefault(React);
|
13200 |
-
var _inheritsLoose = _interopDefault(__webpack_require__(197));
|
13201 |
-
var _assertThisInitialized = _interopDefault(__webpack_require__(11));
|
13202 |
-
|
13203 |
-
var is = {
|
13204 |
-
arr: Array.isArray,
|
13205 |
-
obj: function obj(a) {
|
13206 |
-
return Object.prototype.toString.call(a) === '[object Object]';
|
13207 |
-
},
|
13208 |
-
fun: function fun(a) {
|
13209 |
-
return typeof a === 'function';
|
13210 |
-
},
|
13211 |
-
str: function str(a) {
|
13212 |
-
return typeof a === 'string';
|
13213 |
-
},
|
13214 |
-
num: function num(a) {
|
13215 |
-
return typeof a === 'number';
|
13216 |
-
},
|
13217 |
-
und: function und(a) {
|
13218 |
-
return a === void 0;
|
13219 |
-
},
|
13220 |
-
nul: function nul(a) {
|
13221 |
-
return a === null;
|
13222 |
-
},
|
13223 |
-
set: function set(a) {
|
13224 |
-
return a instanceof Set;
|
13225 |
-
},
|
13226 |
-
map: function map(a) {
|
13227 |
-
return a instanceof Map;
|
13228 |
-
},
|
13229 |
-
equ: function equ(a, b) {
|
13230 |
-
if (typeof a !== typeof b) return false;
|
13231 |
-
if (is.str(a) || is.num(a)) return a === b;
|
13232 |
-
if (is.obj(a) && is.obj(b) && Object.keys(a).length + Object.keys(b).length === 0) return true;
|
13233 |
-
var i;
|
13234 |
-
|
13235 |
-
for (i in a) {
|
13236 |
-
if (!(i in b)) return false;
|
13237 |
-
}
|
13238 |
|
13239 |
-
|
13240 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13241 |
}
|
13242 |
-
|
13243 |
-
return is.und(i) ? a === b : true;
|
13244 |
-
}
|
13245 |
};
|
13246 |
-
function merge(target, lowercase) {
|
13247 |
-
if (lowercase === void 0) {
|
13248 |
-
lowercase = true;
|
13249 |
-
}
|
13250 |
|
13251 |
-
|
13252 |
-
|
13253 |
-
|
13254 |
-
|
13255 |
-
|
13256 |
-
}, target);
|
13257 |
-
};
|
13258 |
-
}
|
13259 |
-
function useForceUpdate() {
|
13260 |
-
var _useState = React.useState(false),
|
13261 |
-
f = _useState[1];
|
13262 |
|
13263 |
-
|
13264 |
-
return f(function (v) {
|
13265 |
-
return !v;
|
13266 |
-
});
|
13267 |
-
}, []);
|
13268 |
-
return forceUpdate;
|
13269 |
-
}
|
13270 |
-
function withDefault(value, defaultValue) {
|
13271 |
-
return is.und(value) || is.nul(value) ? defaultValue : value;
|
13272 |
-
}
|
13273 |
-
function toArray(a) {
|
13274 |
-
return !is.und(a) ? is.arr(a) ? a : [a] : [];
|
13275 |
-
}
|
13276 |
-
function callProp(obj) {
|
13277 |
-
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
13278 |
-
args[_key - 1] = arguments[_key];
|
13279 |
-
}
|
13280 |
|
13281 |
-
|
13282 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13283 |
|
13284 |
-
function
|
13285 |
-
|
13286 |
-
|
13287 |
-
|
13288 |
-
|
13289 |
-
|
13290 |
-
|
13291 |
-
children = props.children,
|
13292 |
-
reset = props.reset,
|
13293 |
-
reverse = props.reverse,
|
13294 |
-
force = props.force,
|
13295 |
-
immediate = props.immediate,
|
13296 |
-
delay = props.delay,
|
13297 |
-
attach = props.attach,
|
13298 |
-
destroyed = props.destroyed,
|
13299 |
-
interpolateTo = props.interpolateTo,
|
13300 |
-
ref = props.ref,
|
13301 |
-
lazy = props.lazy,
|
13302 |
-
forward = _objectWithoutPropertiesLoose(props, ["to", "from", "config", "onStart", "onRest", "onFrame", "children", "reset", "reverse", "force", "immediate", "delay", "attach", "destroyed", "interpolateTo", "ref", "lazy"]);
|
13303 |
|
13304 |
-
|
13305 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13306 |
|
13307 |
-
|
13308 |
-
|
13309 |
-
|
13310 |
-
|
13311 |
-
}, props);
|
13312 |
-
var rest = Object.keys(props).reduce(function (a, k) {
|
13313 |
-
var _extends2;
|
13314 |
|
13315 |
-
|
13316 |
-
}, {});
|
13317 |
-
return _extends({
|
13318 |
-
to: forward
|
13319 |
-
}, rest);
|
13320 |
-
}
|
13321 |
-
function handleRef(ref, forward) {
|
13322 |
-
if (forward) {
|
13323 |
-
// If it's a function, assume it's a ref callback
|
13324 |
-
if (is.fun(forward)) forward(ref);else if (is.obj(forward)) {
|
13325 |
-
forward.current = ref;
|
13326 |
}
|
13327 |
-
}
|
13328 |
|
13329 |
-
|
13330 |
-
|
|
|
|
|
|
|
|
|
|
|
13331 |
|
13332 |
-
var
|
13333 |
-
/*#__PURE__*/
|
13334 |
-
function () {
|
13335 |
-
function Animated() {
|
13336 |
-
this.payload = void 0;
|
13337 |
-
this.children = [];
|
13338 |
-
}
|
13339 |
|
13340 |
-
|
|
|
|
|
13341 |
|
13342 |
-
|
13343 |
-
|
13344 |
-
|
|
|
|
|
|
|
|
|
13345 |
|
13346 |
-
|
13347 |
-
|
13348 |
-
|
13349 |
|
13350 |
-
|
|
|
|
|
13351 |
|
13352 |
-
|
|
|
|
|
13353 |
|
13354 |
-
|
13355 |
-
|
13356 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13357 |
|
13358 |
-
|
13359 |
-
|
13360 |
-
this.children.push(child);
|
13361 |
-
};
|
13362 |
|
13363 |
-
|
13364 |
-
|
13365 |
-
|
13366 |
-
|
13367 |
-
};
|
13368 |
|
13369 |
-
|
13370 |
-
|
13371 |
-
|
13372 |
-
/*#__PURE__*/
|
13373 |
-
function (_Animated) {
|
13374 |
-
_inheritsLoose(AnimatedArray, _Animated);
|
13375 |
|
13376 |
-
|
13377 |
-
|
|
|
|
|
13378 |
|
13379 |
-
|
13380 |
-
|
|
|
|
|
|
|
|
|
13381 |
}
|
|
|
13382 |
|
13383 |
-
|
13384 |
-
|
|
|
|
|
13385 |
|
13386 |
-
|
13387 |
-
|
13388 |
-
|
13389 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13390 |
};
|
|
|
13391 |
|
13392 |
-
|
13393 |
-
|
13394 |
-
|
13395 |
-
});
|
13396 |
-
};
|
13397 |
|
13398 |
-
|
13399 |
-
|
13400 |
|
13401 |
-
|
13402 |
-
|
13403 |
-
|
13404 |
-
|
13405 |
-
|
13406 |
-
|
|
|
13407 |
|
13408 |
-
|
13409 |
-
var _this2;
|
13410 |
|
13411 |
-
|
13412 |
-
|
13413 |
}
|
13414 |
|
13415 |
-
|
13416 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
13417 |
|
13418 |
-
|
13419 |
-
return Object.values(_this2.payload).forEach(function (s) {
|
13420 |
-
return s instanceof Animated && s.addChild(_assertThisInitialized(_this2));
|
13421 |
-
});
|
13422 |
-
};
|
13423 |
|
13424 |
-
|
13425 |
-
|
13426 |
-
|
13427 |
-
});
|
13428 |
-
};
|
13429 |
|
13430 |
-
|
13431 |
-
|
|
|
13432 |
|
13433 |
-
|
|
|
13434 |
|
13435 |
-
|
13436 |
-
|
13437 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13438 |
}
|
13439 |
|
13440 |
-
var
|
|
|
13441 |
|
13442 |
-
|
13443 |
-
|
13444 |
-
|
13445 |
-
|
|
|
|
|
|
|
|
|
13446 |
}
|
13447 |
|
13448 |
-
return
|
13449 |
-
|
13450 |
|
13451 |
-
_proto2.getAnimatedValue = function getAnimatedValue() {
|
13452 |
-
return this.getValue(true);
|
13453 |
-
};
|
13454 |
|
13455 |
-
|
13456 |
-
|
|
|
13457 |
|
13458 |
-
|
13459 |
-
function injectApplyAnimatedValues(fn, transform) {
|
13460 |
-
applyAnimatedValues = {
|
13461 |
-
fn: fn,
|
13462 |
-
transform: transform
|
13463 |
-
};
|
13464 |
-
}
|
13465 |
-
var colorNames;
|
13466 |
-
function injectColorNames(names) {
|
13467 |
-
colorNames = names;
|
13468 |
-
}
|
13469 |
-
var requestFrame = function requestFrame(cb) {
|
13470 |
-
return typeof window !== 'undefined' ? window.requestAnimationFrame(cb) : -1;
|
13471 |
-
};
|
13472 |
-
var cancelFrame = function cancelFrame(id) {
|
13473 |
-
typeof window !== 'undefined' && window.cancelAnimationFrame(id);
|
13474 |
-
};
|
13475 |
-
function injectFrame(raf, caf) {
|
13476 |
-
requestFrame = raf;
|
13477 |
-
cancelFrame = caf;
|
13478 |
-
}
|
13479 |
-
var interpolation;
|
13480 |
-
function injectStringInterpolator(fn) {
|
13481 |
-
interpolation = fn;
|
13482 |
-
}
|
13483 |
-
var now = function now() {
|
13484 |
-
return Date.now();
|
13485 |
-
};
|
13486 |
-
function injectNow(nowFn) {
|
13487 |
-
now = nowFn;
|
13488 |
-
}
|
13489 |
-
var defaultElement;
|
13490 |
-
function injectDefaultElement(el) {
|
13491 |
-
defaultElement = el;
|
13492 |
-
}
|
13493 |
-
var animatedApi = function animatedApi(node) {
|
13494 |
-
return node.current;
|
13495 |
-
};
|
13496 |
-
function injectAnimatedApi(fn) {
|
13497 |
-
animatedApi = fn;
|
13498 |
-
}
|
13499 |
-
var createAnimatedStyle;
|
13500 |
-
function injectCreateAnimatedStyle(factory) {
|
13501 |
-
createAnimatedStyle = factory;
|
13502 |
-
}
|
13503 |
-
var manualFrameloop;
|
13504 |
-
function injectManualFrameloop(callback) {
|
13505 |
-
manualFrameloop = callback;
|
13506 |
-
}
|
13507 |
|
13508 |
-
var Globals = /*#__PURE__*/Object.freeze({
|
13509 |
-
get applyAnimatedValues () { return applyAnimatedValues; },
|
13510 |
-
injectApplyAnimatedValues: injectApplyAnimatedValues,
|
13511 |
-
get colorNames () { return colorNames; },
|
13512 |
-
injectColorNames: injectColorNames,
|
13513 |
-
get requestFrame () { return requestFrame; },
|
13514 |
-
get cancelFrame () { return cancelFrame; },
|
13515 |
-
injectFrame: injectFrame,
|
13516 |
-
get interpolation () { return interpolation; },
|
13517 |
-
injectStringInterpolator: injectStringInterpolator,
|
13518 |
-
get now () { return now; },
|
13519 |
-
injectNow: injectNow,
|
13520 |
-
get defaultElement () { return defaultElement; },
|
13521 |
-
injectDefaultElement: injectDefaultElement,
|
13522 |
-
get animatedApi () { return animatedApi; },
|
13523 |
-
injectAnimatedApi: injectAnimatedApi,
|
13524 |
-
get createAnimatedStyle () { return createAnimatedStyle; },
|
13525 |
-
injectCreateAnimatedStyle: injectCreateAnimatedStyle,
|
13526 |
-
get manualFrameloop () { return manualFrameloop; },
|
13527 |
-
injectManualFrameloop: injectManualFrameloop
|
13528 |
-
});
|
13529 |
|
13530 |
-
|
13531 |
-
* Wraps the `style` property with `AnimatedStyle`.
|
13532 |
-
*/
|
13533 |
|
13534 |
-
var
|
13535 |
-
|
13536 |
-
function (_AnimatedObject) {
|
13537 |
-
_inheritsLoose(AnimatedProps, _AnimatedObject);
|
13538 |
|
13539 |
-
|
13540 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13541 |
|
13542 |
-
|
13543 |
-
|
13544 |
-
|
13545 |
-
style: createAnimatedStyle(props.style)
|
13546 |
});
|
13547 |
-
|
13548 |
|
13549 |
-
|
|
|
|
|
|
|
13550 |
|
13551 |
-
return
|
13552 |
-
|
13553 |
|
13554 |
-
|
13555 |
-
|
|
|
|
|
|
|
|
|
13556 |
|
13557 |
-
|
13558 |
-
|
13559 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13560 |
|
13561 |
-
|
13562 |
-
|
13563 |
-
|
13564 |
-
|
13565 |
-
|
13566 |
-
var node = React.useRef(null);
|
13567 |
-
var attachProps = React.useCallback(function (props) {
|
13568 |
-
var oldPropsAnimated = propsAnimated.current;
|
13569 |
|
13570 |
-
|
13571 |
-
var
|
13572 |
|
13573 |
-
|
13574 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13575 |
}
|
13576 |
|
13577 |
-
if (
|
13578 |
-
|
13579 |
-
// native-responder, then forceUpdate the animation ...
|
13580 |
-
forceUpdate();
|
13581 |
}
|
13582 |
-
};
|
13583 |
-
|
13584 |
-
propsAnimated.current = new AnimatedProps(props, callback);
|
13585 |
-
oldPropsAnimated && oldPropsAnimated.detach();
|
13586 |
-
}, []);
|
13587 |
-
React.useEffect(function () {
|
13588 |
-
return function () {
|
13589 |
-
mounted.current = false;
|
13590 |
-
propsAnimated.current && propsAnimated.current.detach();
|
13591 |
-
};
|
13592 |
-
}, []);
|
13593 |
-
React.useImperativeHandle(ref, function () {
|
13594 |
-
return animatedApi(node, mounted, forceUpdate);
|
13595 |
-
});
|
13596 |
-
attachProps(props);
|
13597 |
|
13598 |
-
|
13599 |
-
|
13600 |
-
|
13601 |
-
animatedProps = _objectWithoutPropertiesLoose(_getValue, ["scrollTop", "scrollLeft"]); // Functions cannot have refs, see:
|
13602 |
-
// See: https://github.com/react-spring/react-spring/issues/569
|
13603 |
|
|
|
|
|
|
|
|
|
|
|
|
|
13604 |
|
13605 |
-
|
13606 |
-
return node.current = handleRef(childRef, ref);
|
13607 |
-
};
|
13608 |
-
return React__default.createElement(Component, _extends({}, animatedProps, {
|
13609 |
-
ref: refFn
|
13610 |
-
}));
|
13611 |
-
});
|
13612 |
-
return AnimatedComponent;
|
13613 |
};
|
13614 |
|
13615 |
-
var
|
13616 |
-
var
|
13617 |
|
13618 |
-
var
|
13619 |
-
|
13620 |
-
|
13621 |
|
13622 |
-
|
13623 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13624 |
|
13625 |
-
|
13626 |
-
if (_i >= _iterator.length) break;
|
13627 |
-
_ref = _iterator[_i++];
|
13628 |
-
} else {
|
13629 |
-
_i = _iterator.next();
|
13630 |
-
if (_i.done) break;
|
13631 |
-
_ref = _i.value;
|
13632 |
}
|
13633 |
|
13634 |
-
|
13635 |
-
|
13636 |
-
|
13637 |
-
for (var configIdx = 0; configIdx < controller.configs.length; configIdx++) {
|
13638 |
-
var config = controller.configs[configIdx];
|
13639 |
-
var endOfAnimation = void 0,
|
13640 |
-
lastTime = void 0;
|
13641 |
|
13642 |
-
|
13643 |
-
|
|
|
|
|
13644 |
|
13645 |
-
|
13646 |
-
|
13647 |
-
var to = config.toValues[valIdx];
|
13648 |
-
var position = animation.lastPosition;
|
13649 |
-
var isAnimated = to instanceof Animated;
|
13650 |
-
var velocity = Array.isArray(config.initialVelocity) ? config.initialVelocity[valIdx] : config.initialVelocity;
|
13651 |
-
if (isAnimated) to = to.getValue(); // Conclude animation if it's either immediate, or from-values match end-state
|
13652 |
|
13653 |
-
|
13654 |
-
animation.setValue(to);
|
13655 |
-
animation.done = true;
|
13656 |
-
continue;
|
13657 |
-
} // Break animation when string values are involved
|
13658 |
|
|
|
|
|
13659 |
|
13660 |
-
|
13661 |
-
animation.setValue(to);
|
13662 |
-
animation.done = true;
|
13663 |
-
continue;
|
13664 |
-
}
|
13665 |
|
13666 |
-
|
13667 |
-
|
13668 |
-
position = from + config.easing((time - animation.startTime) / config.duration) * (to - from);
|
13669 |
-
endOfAnimation = time >= animation.startTime + config.duration;
|
13670 |
-
} else if (config.decay) {
|
13671 |
-
/** Decay easing */
|
13672 |
-
position = from + velocity / (1 - 0.998) * (1 - Math.exp(-(1 - 0.998) * (time - animation.startTime)));
|
13673 |
-
endOfAnimation = Math.abs(animation.lastPosition - position) < 0.1;
|
13674 |
-
if (endOfAnimation) to = position;
|
13675 |
-
} else {
|
13676 |
-
/** Spring easing */
|
13677 |
-
lastTime = animation.lastTime !== void 0 ? animation.lastTime : time;
|
13678 |
-
velocity = animation.lastVelocity !== void 0 ? animation.lastVelocity : config.initialVelocity; // If we lost a lot of frames just jump to the end.
|
13679 |
|
13680 |
-
|
13681 |
|
13682 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13683 |
|
13684 |
-
|
13685 |
-
|
13686 |
-
var damping = -config.friction * velocity;
|
13687 |
-
var acceleration = (force + damping) / config.mass;
|
13688 |
-
velocity = velocity + acceleration * 1 / 1000;
|
13689 |
-
position = position + velocity * 1 / 1000;
|
13690 |
-
} // Conditions for stopping the spring animation
|
13691 |
|
|
|
13692 |
|
13693 |
-
|
13694 |
-
|
13695 |
-
|
13696 |
-
|
13697 |
-
|
13698 |
-
|
13699 |
-
|
|
|
|
|
|
|
13700 |
|
|
|
13701 |
|
13702 |
-
|
|
|
|
|
13703 |
|
13704 |
-
|
13705 |
-
|
13706 |
-
if (animation.value !== to) position = to;
|
13707 |
-
animation.done = true;
|
13708 |
-
} else isActive = true;
|
13709 |
|
13710 |
-
|
13711 |
-
|
13712 |
-
|
|
|
13713 |
|
|
|
|
|
|
|
13714 |
|
13715 |
-
|
13716 |
-
|
|
|
|
|
13717 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13718 |
|
13719 |
-
|
|
|
13720 |
|
13721 |
-
if (
|
13722 |
-
|
13723 |
-
controller.stop(true);
|
13724 |
}
|
13725 |
-
} // Loop over as long as there are controllers ...
|
13726 |
-
|
13727 |
-
|
13728 |
-
if (controllers.size) {
|
13729 |
-
if (manualFrameloop) manualFrameloop();else requestFrame(update);
|
13730 |
-
} else {
|
13731 |
-
active = false;
|
13732 |
-
}
|
13733 |
|
13734 |
-
|
13735 |
-
};
|
13736 |
|
13737 |
-
|
13738 |
-
if (!controllers.has(controller)) controllers.add(controller);
|
13739 |
|
13740 |
-
|
13741 |
-
|
13742 |
-
|
13743 |
-
|
13744 |
-
|
|
|
13745 |
|
13746 |
-
|
13747 |
-
if (controllers.has(controller)) controllers.delete(controller);
|
13748 |
};
|
13749 |
|
13750 |
-
function createInterpolator(range, output, extrapolate) {
|
13751 |
-
if (typeof range === 'function') {
|
13752 |
-
return range;
|
13753 |
-
}
|
13754 |
-
|
13755 |
-
if (Array.isArray(range)) {
|
13756 |
-
return createInterpolator({
|
13757 |
-
range: range,
|
13758 |
-
output: output,
|
13759 |
-
extrapolate: extrapolate
|
13760 |
-
});
|
13761 |
-
}
|
13762 |
|
13763 |
-
|
13764 |
-
|
13765 |
-
|
|
|
|
|
|
|
13766 |
|
13767 |
-
|
13768 |
-
var outputRange = config.output;
|
13769 |
-
var inputRange = config.range || [0, 1];
|
13770 |
-
var extrapolateLeft = config.extrapolateLeft || config.extrapolate || 'extend';
|
13771 |
-
var extrapolateRight = config.extrapolateRight || config.extrapolate || 'extend';
|
13772 |
|
13773 |
-
|
13774 |
-
|
13775 |
-
};
|
13776 |
|
13777 |
-
|
13778 |
-
var range = findRange(input, inputRange);
|
13779 |
-
return interpolate(input, inputRange[range], inputRange[range + 1], outputRange[range], outputRange[range + 1], easing, extrapolateLeft, extrapolateRight, config.map);
|
13780 |
-
};
|
13781 |
-
}
|
13782 |
|
13783 |
-
|
13784 |
-
|
13785 |
|
13786 |
-
|
13787 |
-
|
13788 |
-
}
|
13789 |
|
13790 |
-
|
13791 |
-
|
13792 |
-
|
|
|
13793 |
|
13794 |
-
|
13795 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
13796 |
|
13797 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13798 |
|
13799 |
-
|
|
|
|
|
13800 |
|
13801 |
-
|
13802 |
-
return result;
|
13803 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13804 |
|
13805 |
-
|
13806 |
-
|
13807 |
-
if (inputRange[i] >= input) break;
|
13808 |
}
|
13809 |
|
13810 |
-
return
|
13811 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13812 |
|
13813 |
-
var
|
13814 |
-
|
13815 |
-
|
13816 |
-
_inheritsLoose(AnimatedInterpolation, _AnimatedArray);
|
13817 |
|
13818 |
-
function AnimatedInterpolation(parents, range, output, extrapolate) {
|
13819 |
-
var _this;
|
13820 |
|
13821 |
-
|
13822 |
-
|
13823 |
-
_this.payload = parents instanceof AnimatedArray && !(parents instanceof AnimatedInterpolation) ? parents.getPayload() : Array.isArray(parents) ? parents : [parents];
|
13824 |
-
_this.calc = createInterpolator(range, output, extrapolate);
|
13825 |
-
return _this;
|
13826 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13827 |
|
13828 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13829 |
|
13830 |
-
|
13831 |
-
|
13832 |
-
|
13833 |
-
}));
|
13834 |
-
};
|
13835 |
|
13836 |
-
|
13837 |
-
|
13838 |
-
|
|
|
|
|
|
|
|
|
|
|
13839 |
|
13840 |
-
|
13841 |
-
|
13842 |
-
|
13843 |
|
13844 |
-
return AnimatedInterpolation;
|
13845 |
-
}(AnimatedArray);
|
13846 |
|
13847 |
-
var interpolate$1 = function interpolate(parents, range, output) {
|
13848 |
-
return parents && new AnimatedInterpolation(parents, range, output);
|
13849 |
-
};
|
13850 |
|
13851 |
-
var config = {
|
13852 |
-
default: {
|
13853 |
-
tension: 170,
|
13854 |
-
friction: 26
|
13855 |
-
},
|
13856 |
-
gentle: {
|
13857 |
-
tension: 120,
|
13858 |
-
friction: 14
|
13859 |
-
},
|
13860 |
-
wobbly: {
|
13861 |
-
tension: 180,
|
13862 |
-
friction: 12
|
13863 |
-
},
|
13864 |
-
stiff: {
|
13865 |
-
tension: 210,
|
13866 |
-
friction: 20
|
13867 |
-
},
|
13868 |
-
slow: {
|
13869 |
-
tension: 280,
|
13870 |
-
friction: 60
|
13871 |
-
},
|
13872 |
-
molasses: {
|
13873 |
-
tension: 280,
|
13874 |
-
friction: 120
|
13875 |
-
}
|
13876 |
-
};
|
13877 |
|
13878 |
-
|
13879 |
-
|
|
|
13880 |
*/
|
13881 |
|
13882 |
-
function
|
13883 |
-
|
13884 |
-
|
|
|
|
|
|
|
|
|
13885 |
}
|
13886 |
|
13887 |
-
|
13888 |
-
|
13889 |
-
|
13890 |
-
var current = _ref.current;
|
13891 |
-
return current && current.start();
|
13892 |
-
});else if (timeSteps) {
|
13893 |
-
refs.forEach(function (_ref2, index) {
|
13894 |
-
var current = _ref2.current;
|
13895 |
-
|
13896 |
-
if (current) {
|
13897 |
-
var ctrls = current.controllers;
|
13898 |
|
13899 |
-
|
13900 |
-
|
13901 |
-
|
13902 |
-
ctrl.queue = ctrl.queue.map(function (e) {
|
13903 |
-
return _extends({}, e, {
|
13904 |
-
delay: e.delay + t
|
13905 |
-
});
|
13906 |
-
});
|
13907 |
-
ctrl.start();
|
13908 |
-
});
|
13909 |
-
}
|
13910 |
-
}
|
13911 |
-
});
|
13912 |
-
} else refs.reduce(function (q, _ref3, rI) {
|
13913 |
-
var current = _ref3.current;
|
13914 |
-
return q = q.then(function () {
|
13915 |
-
return current.start();
|
13916 |
-
});
|
13917 |
-
}, Promise.resolve());
|
13918 |
-
previous.current = refs;
|
13919 |
-
});
|
13920 |
}
|
|
|
|
|
|
|
13921 |
|
|
|
13922 |
/**
|
13923 |
-
*
|
13924 |
-
*
|
13925 |
*
|
13926 |
-
*
|
13927 |
-
*
|
13928 |
-
* opacity translateY scale
|
13929 |
-
* style transform
|
13930 |
-
* View#234 style
|
13931 |
-
* View#123
|
13932 |
*
|
13933 |
-
*
|
13934 |
-
*
|
13935 |
-
*
|
13936 |
-
* an update.
|
13937 |
*
|
13938 |
-
*
|
13939 |
-
*
|
13940 |
-
*
|
13941 |
-
*
|
13942 |
-
*
|
|
|
13943 |
*/
|
13944 |
-
function addAnimatedStyles(node, styles) {
|
13945 |
-
if ('update' in node) {
|
13946 |
-
styles.add(node);
|
13947 |
-
} else {
|
13948 |
-
node.getChildren().forEach(function (child) {
|
13949 |
-
return addAnimatedStyles(child, styles);
|
13950 |
-
});
|
13951 |
-
}
|
13952 |
-
}
|
13953 |
-
|
13954 |
-
var AnimatedValue =
|
13955 |
-
/*#__PURE__*/
|
13956 |
-
function (_Animated) {
|
13957 |
-
_inheritsLoose(AnimatedValue, _Animated);
|
13958 |
-
|
13959 |
-
function AnimatedValue(_value) {
|
13960 |
-
var _this;
|
13961 |
|
13962 |
-
|
13963 |
-
|
13964 |
-
|
13965 |
-
|
13966 |
-
|
13967 |
-
|
13968 |
-
|
13969 |
-
|
13970 |
-
|
|
|
13971 |
|
13972 |
-
|
13973 |
-
|
13974 |
-
|
13975 |
-
|
|
|
|
|
|
|
|
|
|
|
13976 |
|
13977 |
-
_this.value = value;
|
13978 |
-
if (flush) _this.flush();
|
13979 |
-
};
|
13980 |
|
13981 |
-
|
13982 |
-
|
13983 |
-
_this.lastPosition = _value;
|
13984 |
-
return _this;
|
13985 |
}
|
|
|
|
|
13986 |
|
13987 |
-
|
13988 |
-
|
13989 |
-
|
13990 |
-
if (this.animatedStyles.size === 0) {
|
13991 |
-
addAnimatedStyles(this, this.animatedStyles);
|
13992 |
-
}
|
13993 |
|
13994 |
-
|
13995 |
-
return animatedStyle.update();
|
13996 |
-
});
|
13997 |
-
};
|
13998 |
|
13999 |
-
|
14000 |
-
|
14001 |
-
};
|
14002 |
|
14003 |
-
|
14004 |
-
|
14005 |
-
};
|
14006 |
|
14007 |
-
|
14008 |
-
|
14009 |
-
|
|
|
|
|
14010 |
|
14011 |
-
|
14012 |
-
|
|
|
|
|
14013 |
|
14014 |
-
var
|
14015 |
-
|
14016 |
-
|
14017 |
-
_inheritsLoose(AnimatedValueArray, _AnimatedArray);
|
14018 |
|
14019 |
-
function AnimatedValueArray(values) {
|
14020 |
-
var _this;
|
14021 |
|
14022 |
-
|
14023 |
-
|
14024 |
-
return new AnimatedValue(n);
|
14025 |
-
});
|
14026 |
-
return _this;
|
14027 |
-
}
|
14028 |
|
14029 |
-
|
|
|
|
|
14030 |
|
14031 |
-
|
14032 |
-
|
14033 |
|
14034 |
-
|
14035 |
-
|
14036 |
-
}
|
14037 |
|
14038 |
-
|
14039 |
-
|
14040 |
-
value.forEach(function (v, i) {
|
14041 |
-
return _this2.payload[i].setValue(v, flush);
|
14042 |
-
});
|
14043 |
-
}
|
14044 |
-
} else {
|
14045 |
-
this.payload.forEach(function (p) {
|
14046 |
-
return p.setValue(value, flush);
|
14047 |
-
});
|
14048 |
-
}
|
14049 |
};
|
14050 |
|
14051 |
-
|
14052 |
-
|
14053 |
-
return v.getValue();
|
14054 |
-
});
|
14055 |
-
};
|
14056 |
|
14057 |
-
|
14058 |
-
|
14059 |
-
};
|
14060 |
|
14061 |
-
|
14062 |
-
|
|
|
14063 |
|
14064 |
-
|
|
|
14065 |
|
14066 |
-
|
14067 |
-
|
14068 |
-
function () {
|
14069 |
-
function Controller() {
|
14070 |
-
var _this = this;
|
14071 |
|
14072 |
-
|
14073 |
-
|
14074 |
-
|
14075 |
-
this.guid = 0;
|
14076 |
-
this.local = 0;
|
14077 |
-
this.props = {};
|
14078 |
-
this.merged = {};
|
14079 |
-
this.animations = {};
|
14080 |
-
this.interpolations = {};
|
14081 |
-
this.values = {};
|
14082 |
-
this.configs = [];
|
14083 |
-
this.listeners = [];
|
14084 |
-
this.queue = [];
|
14085 |
-
this.localQueue = void 0;
|
14086 |
|
14087 |
-
|
14088 |
-
|
14089 |
-
};
|
14090 |
|
14091 |
-
|
14092 |
-
|
14093 |
-
/** update(props)
|
14094 |
-
* This function filters input props and creates an array of tasks which are executed in .start()
|
14095 |
-
* Each task is allowed to carry a delay, which means it can execute asnychroneously */
|
14096 |
|
|
|
|
|
|
|
14097 |
|
14098 |
-
|
|
|
14099 |
|
14100 |
-
|
14101 |
-
|
14102 |
-
if (!args) return this; // Extract delay and the to-prop from props
|
14103 |
|
14104 |
-
|
14105 |
-
|
14106 |
-
|
14107 |
-
to = _ref.to,
|
14108 |
-
props = _objectWithoutPropertiesLoose(_ref, ["delay", "to"]);
|
14109 |
|
14110 |
-
|
14111 |
-
|
14112 |
-
this.queue.push(_extends({}, props, {
|
14113 |
-
delay: delay,
|
14114 |
-
to: to
|
14115 |
-
}));
|
14116 |
-
} else if (to) {
|
14117 |
-
// Otherwise go through each key since it could be delayed individually
|
14118 |
-
var ops = {};
|
14119 |
-
Object.entries(to).forEach(function (_ref2) {
|
14120 |
-
var _to;
|
14121 |
|
14122 |
-
|
14123 |
-
|
14124 |
|
14125 |
-
|
14126 |
-
|
14127 |
-
|
14128 |
-
delay: callProp(delay, k)
|
14129 |
-
}, props);
|
14130 |
|
14131 |
-
|
14132 |
-
|
14133 |
-
to: _extends({}, previous, entry.to)
|
14134 |
-
});
|
14135 |
-
});
|
14136 |
-
this.queue = Object.values(ops);
|
14137 |
-
} // Sort queue, so that async calls go last
|
14138 |
|
|
|
|
|
14139 |
|
14140 |
-
|
14141 |
-
|
14142 |
-
|
14143 |
|
14144 |
-
|
14145 |
-
|
14146 |
-
}
|
14147 |
-
/** start(onEnd)
|
14148 |
-
* This function either executes a queue, if present, or starts the frameloop, which animates */
|
14149 |
-
;
|
14150 |
|
14151 |
-
|
14152 |
-
|
14153 |
|
14154 |
-
|
14155 |
-
|
14156 |
-
|
14157 |
|
14158 |
-
|
14159 |
-
|
14160 |
-
var _ref3$from = _ref3.from,
|
14161 |
-
from = _ref3$from === void 0 ? {} : _ref3$from,
|
14162 |
-
_ref3$to = _ref3.to,
|
14163 |
-
to = _ref3$to === void 0 ? {} : _ref3$to;
|
14164 |
-
if (is.obj(from)) _this2.merged = _extends({}, from, _this2.merged);
|
14165 |
-
if (is.obj(to)) _this2.merged = _extends({}, _this2.merged, to);
|
14166 |
-
});
|
14167 |
-
} // The guid helps us tracking frames, a new queue over an old one means an override
|
14168 |
-
// We discard async calls in that caseÍ
|
14169 |
|
|
|
|
|
|
|
14170 |
|
14171 |
-
var local = this.local = ++this.guid;
|
14172 |
-
var queue = this.localQueue = this.queue;
|
14173 |
-
this.queue = []; // Go through each entry and execute it
|
14174 |
|
14175 |
-
|
14176 |
-
|
14177 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14178 |
|
14179 |
-
|
14180 |
-
|
14181 |
-
|
14182 |
-
if (_this2.props.onRest) _this2.props.onRest(_this2.merged);
|
14183 |
-
}
|
14184 |
|
14185 |
-
|
14186 |
-
|
14187 |
|
|
|
|
|
|
|
14188 |
|
14189 |
-
|
|
|
14190 |
|
14191 |
-
|
14192 |
-
|
14193 |
-
if (local === _this2.guid) {
|
14194 |
-
if (async) _this2.runAsync(props, cb);else _this2.diff(props).start(cb);
|
14195 |
-
}
|
14196 |
-
}, delay);
|
14197 |
-
} else if (async) _this2.runAsync(props, cb);else _this2.diff(props).start(cb);
|
14198 |
-
});
|
14199 |
-
} // Otherwise we kick of the frameloop
|
14200 |
-
else {
|
14201 |
-
if (is.fun(onEnd)) this.listeners.push(onEnd);
|
14202 |
-
if (this.props.onStart) this.props.onStart();
|
14203 |
|
14204 |
-
|
14205 |
-
|
14206 |
|
14207 |
-
|
14208 |
-
|
14209 |
|
14210 |
-
|
14211 |
-
|
14212 |
-
return onEnd(finished);
|
14213 |
-
});
|
14214 |
-
this.listeners = [];
|
14215 |
-
return this;
|
14216 |
-
}
|
14217 |
-
/** Pause sets onEnd listeners free, but also removes the controller from the frameloop */
|
14218 |
-
;
|
14219 |
|
14220 |
-
|
14221 |
-
|
14222 |
-
if (finished) stop(this);
|
14223 |
-
return this;
|
14224 |
-
};
|
14225 |
|
14226 |
-
|
14227 |
-
|
14228 |
|
14229 |
-
|
14230 |
-
|
14231 |
|
14232 |
-
|
14233 |
-
|
14234 |
|
14235 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14236 |
|
14237 |
-
|
14238 |
-
|
14239 |
-
|
14240 |
|
14241 |
-
var fresh = _extends({}, props, interpolateTo(props.to[index]));
|
14242 |
|
14243 |
-
|
14244 |
-
|
14245 |
-
|
14246 |
-
|
14247 |
-
|
14248 |
-
});
|
14249 |
-
});
|
14250 |
-
};
|
14251 |
|
14252 |
-
for (var i = 0; i < props.to.length; i++) {
|
14253 |
-
_loop(i);
|
14254 |
-
}
|
14255 |
-
} else if (is.fun(props.to)) {
|
14256 |
-
var index = 0;
|
14257 |
-
var last;
|
14258 |
-
queue = queue.then(function () {
|
14259 |
-
return props.to( // next(props)
|
14260 |
-
function (p) {
|
14261 |
-
var fresh = _extends({}, props, interpolateTo(p));
|
14262 |
|
14263 |
-
|
14264 |
-
|
|
|
14265 |
|
14266 |
-
if (local === _this3.guid) return last = new Promise(function (r) {
|
14267 |
-
return _this3.diff(fresh).start(r);
|
14268 |
-
});
|
14269 |
-
return;
|
14270 |
-
}, // cancel()
|
14271 |
-
function (finished) {
|
14272 |
-
if (finished === void 0) {
|
14273 |
-
finished = true;
|
14274 |
-
}
|
14275 |
|
14276 |
-
|
14277 |
-
|
14278 |
-
|
14279 |
-
|
14280 |
-
});
|
14281 |
-
}
|
14282 |
|
14283 |
-
|
14284 |
-
|
14285 |
|
14286 |
-
|
14287 |
-
|
|
|
14288 |
|
14289 |
-
|
14290 |
-
|
14291 |
-
|
14292 |
-
|
14293 |
-
|
14294 |
-
|
14295 |
-
|
14296 |
-
|
14297 |
-
|
14298 |
-
|
14299 |
-
|
14300 |
-
|
|
|
|
|
|
|
14301 |
|
14302 |
-
if (reverse) {
|
14303 |
-
var _ref6 = [to, from];
|
14304 |
-
from = _ref6[0];
|
14305 |
-
to = _ref6[1];
|
14306 |
-
} // This will collect all props that were ever set, reset merged props when necessary
|
14307 |
|
|
|
|
|
|
|
14308 |
|
14309 |
-
this.merged = _extends({}, from, this.merged, to);
|
14310 |
-
this.hasChanged = false; // Attachment handling, trailed springs can "attach" themselves to a previous spring
|
14311 |
|
14312 |
-
var target = attach && attach(this); // Reduces input { name: value } pairs into animated values
|
14313 |
|
14314 |
-
|
14315 |
-
|
14316 |
-
|
14317 |
-
|
14318 |
-
|
|
|
14319 |
|
14320 |
-
|
14321 |
-
|
14322 |
-
|
14323 |
-
|
14324 |
-
var fromValue = !is.und(from[name]) ? from[name] : value;
|
14325 |
-
var toValue = isNumber || isArray ? value : isString ? value : 1;
|
14326 |
-
var toConfig = callProp(config, name);
|
14327 |
-
if (target) toValue = target.animations[name].parent;
|
14328 |
-
var parent = entry.parent,
|
14329 |
-
interpolation$$1 = entry.interpolation,
|
14330 |
-
toValues = toArray(target ? toValue.getPayload() : toValue),
|
14331 |
-
animatedValues;
|
14332 |
-
var newValue = value;
|
14333 |
-
if (isInterpolation) newValue = interpolation({
|
14334 |
-
range: [0, 1],
|
14335 |
-
output: [value, value]
|
14336 |
-
})(1);
|
14337 |
-
var currentValue = interpolation$$1 && interpolation$$1.getValue(); // Change detection flags
|
14338 |
|
14339 |
-
|
14340 |
-
|
14341 |
-
|
14342 |
-
|
14343 |
-
|
14344 |
-
|
14345 |
-
|
14346 |
-
// and current values differ from it. Config changes trigger a new update as well (though probably shouldn't?)
|
14347 |
|
14348 |
-
|
14349 |
-
|
|
|
14350 |
|
14351 |
-
|
14352 |
-
|
14353 |
-
|
14354 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
14355 |
|
14356 |
-
|
14357 |
-
|
14358 |
-
|
14359 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14360 |
|
14361 |
-
|
14362 |
-
|
14363 |
-
|
|
|
14364 |
|
14365 |
-
|
14366 |
-
interpolation$$1 = entry.interpolation;
|
14367 |
-
entry.interpolation.updateConfig(range);
|
14368 |
-
} else interpolation$$1 = parent.interpolate(range);
|
14369 |
-
}
|
14370 |
-
toValues = toArray(target ? toValue.getPayload() : toValue);
|
14371 |
-
animatedValues = toArray(parent.getPayload());
|
14372 |
-
if (reset && !isInterpolation) parent.setValue(fromValue, false);
|
14373 |
-
_this4.hasChanged = true; // Reset animated values
|
14374 |
|
14375 |
-
|
14376 |
-
|
14377 |
-
value.lastPosition = value.value;
|
14378 |
-
value.lastVelocity = isActive ? value.lastVelocity : undefined;
|
14379 |
-
value.lastTime = isActive ? value.lastTime : undefined;
|
14380 |
-
value.startTime = now();
|
14381 |
-
value.done = false;
|
14382 |
-
value.animatedStyles.clear();
|
14383 |
-
}); // Set immediate values
|
14384 |
|
14385 |
-
|
14386 |
-
|
14387 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14388 |
|
14389 |
-
|
14390 |
-
|
14391 |
-
|
14392 |
-
|
14393 |
-
|
14394 |
-
|
14395 |
-
|
14396 |
-
|
14397 |
-
|
14398 |
-
|
14399 |
-
|
14400 |
-
|
14401 |
-
precision: withDefault(toConfig.precision, 0.01),
|
14402 |
-
tension: withDefault(toConfig.tension, 170),
|
14403 |
-
friction: withDefault(toConfig.friction, 26),
|
14404 |
-
mass: withDefault(toConfig.mass, 1),
|
14405 |
-
duration: toConfig.duration,
|
14406 |
-
easing: withDefault(toConfig.easing, function (t) {
|
14407 |
-
return t;
|
14408 |
-
}),
|
14409 |
-
decay: toConfig.decay
|
14410 |
-
}), _extends2));
|
14411 |
-
} else {
|
14412 |
-
if (!currentValueDiffersFromGoal) {
|
14413 |
-
var _extends3;
|
14414 |
|
14415 |
-
|
14416 |
-
|
14417 |
-
|
14418 |
-
|
14419 |
-
|
14420 |
-
|
14421 |
-
interpolation$$1.updateConfig({
|
14422 |
-
output: [newValue, newValue]
|
14423 |
-
});
|
14424 |
-
}
|
14425 |
|
14426 |
-
|
14427 |
-
|
14428 |
-
|
14429 |
-
previous: newValue
|
14430 |
-
}), _extends3));
|
14431 |
-
}
|
14432 |
|
14433 |
-
|
14434 |
-
|
14435 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
14436 |
|
14437 |
-
|
14438 |
-
|
14439 |
-
|
14440 |
-
this.values = {};
|
14441 |
-
this.interpolations = {};
|
14442 |
|
14443 |
-
|
14444 |
-
|
14445 |
-
|
14446 |
-
|
14447 |
-
|
|
|
|
|
|
|
14448 |
|
14449 |
-
|
14450 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14451 |
|
14452 |
-
|
14453 |
-
|
14454 |
-
|
14455 |
-
this.merged = {};
|
14456 |
-
this.animations = {};
|
14457 |
-
this.interpolations = {};
|
14458 |
-
this.values = {};
|
14459 |
-
this.configs = [];
|
14460 |
-
this.local = 0;
|
14461 |
-
};
|
14462 |
|
14463 |
-
|
14464 |
-
|
|
|
|
|
|
|
|
|
14465 |
|
14466 |
-
|
14467 |
-
|
14468 |
-
|
|
|
|
|
|
|
14469 |
*/
|
14470 |
|
14471 |
-
var
|
14472 |
-
|
14473 |
-
|
14474 |
-
|
|
|
|
|
14475 |
|
14476 |
-
|
14477 |
-
|
14478 |
-
|
14479 |
-
|
14480 |
-
|
14481 |
-
|
14482 |
-
|
14483 |
-
|
|
|
|
|
|
|
14484 |
|
14485 |
-
var ref;
|
14486 |
-
return [new Array(length).fill().map(function (_, i) {
|
14487 |
-
var ctrl = new Controller();
|
14488 |
-
var newProps = isFn ? callProp(props, i, ctrl) : props[i];
|
14489 |
-
if (i === 0) ref = newProps.ref;
|
14490 |
-
ctrl.update(newProps);
|
14491 |
-
if (!ref) ctrl.start();
|
14492 |
-
return ctrl;
|
14493 |
-
}), ref];
|
14494 |
-
}, [length]),
|
14495 |
-
controllers = _useMemo[0],
|
14496 |
-
ref = _useMemo[1];
|
14497 |
|
14498 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
14499 |
|
14500 |
-
|
14501 |
-
|
14502 |
-
|
14503 |
-
|
14504 |
-
|
14505 |
-
return c.start(r);
|
14506 |
-
});
|
14507 |
-
}));
|
14508 |
-
},
|
14509 |
-
stop: function stop(finished) {
|
14510 |
-
return ctrl.current.forEach(function (c) {
|
14511 |
-
return c.stop(finished);
|
14512 |
-
});
|
14513 |
-
},
|
14514 |
|
14515 |
-
|
14516 |
-
|
14517 |
-
|
|
|
|
|
14518 |
|
14519 |
-
|
14520 |
-
|
|
|
|
|
|
|
14521 |
|
14522 |
-
|
14523 |
-
|
14524 |
-
return ctrl.current.map(function (c, i) {
|
14525 |
-
c.update(isFn ? callProp(updateProps, i, c) : updateProps[i]);
|
14526 |
-
if (!ref) c.start();
|
14527 |
-
});
|
14528 |
-
};
|
14529 |
-
}, [length]); // Update controller if props aren't functional
|
14530 |
|
14531 |
-
|
14532 |
-
if (mounted.current) {
|
14533 |
-
if (!isFn) updateCtrl(props);
|
14534 |
-
} else if (!ref) ctrl.current.forEach(function (c) {
|
14535 |
-
return c.start();
|
14536 |
-
});
|
14537 |
-
}); // Update mounted flag and destroy controller on unmount
|
14538 |
|
14539 |
-
|
14540 |
-
|
14541 |
-
|
14542 |
-
|
14543 |
-
|
14544 |
-
|
14545 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14546 |
|
14547 |
-
|
14548 |
-
return c.getValues();
|
14549 |
-
});
|
14550 |
-
return isFn ? [propValues, updateCtrl, function (finished) {
|
14551 |
-
return ctrl.current.forEach(function (c) {
|
14552 |
-
return c.pause(finished);
|
14553 |
-
});
|
14554 |
-
}] : propValues;
|
14555 |
-
};
|
14556 |
|
14557 |
-
|
14558 |
-
|
14559 |
-
|
14560 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14561 |
|
14562 |
-
|
14563 |
-
|
14564 |
|
14565 |
-
var _useSprings = useSprings(1, isFn ? props : [props]),
|
14566 |
-
result = _useSprings[0],
|
14567 |
-
set = _useSprings[1],
|
14568 |
-
pause = _useSprings[2];
|
14569 |
|
14570 |
-
|
14571 |
-
|
|
|
|
|
|
|
14572 |
|
14573 |
-
|
14574 |
-
|
14575 |
-
|
|
|
|
|
|
|
14576 |
*/
|
14577 |
|
14578 |
-
|
14579 |
-
|
14580 |
-
|
14581 |
-
var updateProps = callProp(props);
|
14582 |
-
var instances = React.useRef();
|
14583 |
-
|
14584 |
-
var _useSprings = useSprings(length, function (i, ctrl) {
|
14585 |
-
if (i === 0) instances.current = [];
|
14586 |
-
instances.current.push(ctrl);
|
14587 |
-
return _extends({}, updateProps, {
|
14588 |
-
config: callProp(updateProps.config, i),
|
14589 |
-
attach: i > 0 && function () {
|
14590 |
-
return instances.current[i - 1];
|
14591 |
-
}
|
14592 |
-
});
|
14593 |
-
}),
|
14594 |
-
result = _useSprings[0],
|
14595 |
-
set = _useSprings[1],
|
14596 |
-
pause = _useSprings[2]; // Set up function to update controller
|
14597 |
|
14598 |
|
14599 |
-
|
14600 |
-
|
14601 |
-
|
14602 |
-
var last = props.reverse ? i === 0 : length - 1 === i;
|
14603 |
-
var attachIdx = props.reverse ? i + 1 : i - 1;
|
14604 |
-
var attachController = instances.current[attachIdx];
|
14605 |
-
return _extends({}, props, {
|
14606 |
-
config: callProp(props.config || updateProps.config, i),
|
14607 |
-
attach: attachController && function () {
|
14608 |
-
return attachController;
|
14609 |
-
}
|
14610 |
-
});
|
14611 |
-
});
|
14612 |
-
};
|
14613 |
-
}, [length, updateProps.reverse]); // Update controller if props aren't functional
|
14614 |
|
14615 |
-
|
14616 |
-
|
14617 |
-
|
|
|
|
|
|
|
|
|
14618 |
|
14619 |
-
|
14620 |
-
|
14621 |
-
|
14622 |
-
|
|
|
|
|
|
|
14623 |
};
|
|
|
|
|
|
|
14624 |
|
14625 |
-
/**
|
14626 |
-
*
|
14627 |
-
*
|
|
|
14628 |
*/
|
14629 |
|
14630 |
-
var
|
14631 |
-
|
14632 |
-
|
14633 |
-
|
|
|
|
|
|
|
|
|
|
|
14634 |
|
14635 |
-
var
|
14636 |
-
|
|
|
|
|
|
|
|
|
|
|
14637 |
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14638 |
|
14639 |
-
var
|
14640 |
-
var
|
14641 |
-
|
14642 |
-
|
14643 |
-
|
14644 |
-
} : _props$keys,
|
14645 |
-
rest = _objectWithoutPropertiesLoose(props, ["items", "keys"]);
|
14646 |
|
14647 |
-
|
14648 |
-
|
14649 |
-
|
14650 |
-
keys: mapKeys(items, keys)
|
14651 |
-
}, rest);
|
14652 |
-
};
|
14653 |
|
14654 |
-
|
14655 |
-
|
14656 |
-
items: input,
|
14657 |
-
keys: keyTransform || function (i) {
|
14658 |
-
return i;
|
14659 |
-
}
|
14660 |
-
}, config);
|
14661 |
|
14662 |
-
|
14663 |
-
|
14664 |
-
|
14665 |
-
_get$unique = _get.unique,
|
14666 |
-
_get$reset = _get.reset,
|
14667 |
-
reset = _get$reset === void 0 ? false : _get$reset,
|
14668 |
-
enter = _get.enter,
|
14669 |
-
leave = _get.leave,
|
14670 |
-
update = _get.update,
|
14671 |
-
onDestroyed = _get.onDestroyed,
|
14672 |
-
keys = _get.keys,
|
14673 |
-
items = _get.items,
|
14674 |
-
onFrame = _get.onFrame,
|
14675 |
-
_onRest = _get.onRest,
|
14676 |
-
onStart = _get.onStart,
|
14677 |
-
ref = _get.ref,
|
14678 |
-
extra = _objectWithoutPropertiesLoose(_get, ["lazy", "unique", "reset", "enter", "leave", "update", "onDestroyed", "keys", "items", "onFrame", "onRest", "onStart", "ref"]);
|
14679 |
|
14680 |
-
|
14681 |
-
|
14682 |
-
|
14683 |
-
mounted: false,
|
14684 |
-
first: true,
|
14685 |
-
deleted: [],
|
14686 |
-
current: {},
|
14687 |
-
transitions: [],
|
14688 |
-
prevProps: {},
|
14689 |
-
paused: !!props.ref,
|
14690 |
-
instances: !mounted.current && new Map(),
|
14691 |
-
forceUpdate: forceUpdate
|
14692 |
-
});
|
14693 |
-
React.useImperativeHandle(props.ref, function () {
|
14694 |
-
return {
|
14695 |
-
start: function start() {
|
14696 |
-
return Promise.all(Array.from(state.current.instances).map(function (_ref) {
|
14697 |
-
var c = _ref[1];
|
14698 |
-
return new Promise(function (r) {
|
14699 |
-
return c.start(r);
|
14700 |
-
});
|
14701 |
-
}));
|
14702 |
-
},
|
14703 |
-
stop: function stop(finished) {
|
14704 |
-
return Array.from(state.current.instances).forEach(function (_ref2) {
|
14705 |
-
var c = _ref2[1];
|
14706 |
-
return c.stop(finished);
|
14707 |
-
});
|
14708 |
-
},
|
14709 |
|
14710 |
-
|
14711 |
-
|
14712 |
-
|
14713 |
-
|
14714 |
-
|
14715 |
-
|
14716 |
|
14717 |
-
|
14718 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
14719 |
|
14720 |
-
|
|
|
14721 |
|
14722 |
-
|
14723 |
-
|
14724 |
-
|
14725 |
-
var slot = transition.slot,
|
14726 |
-
from = transition.from,
|
14727 |
-
to = transition.to,
|
14728 |
-
config = transition.config,
|
14729 |
-
trail = transition.trail,
|
14730 |
-
key = transition.key,
|
14731 |
-
item = transition.item;
|
14732 |
-
if (!state.current.instances.has(key)) state.current.instances.set(key, new Controller()); // update the map object
|
14733 |
|
14734 |
-
|
14735 |
|
14736 |
-
var newProps = _extends({}, extra, {
|
14737 |
-
to: to,
|
14738 |
-
from: from,
|
14739 |
-
config: config,
|
14740 |
-
ref: ref,
|
14741 |
-
onRest: function onRest(values) {
|
14742 |
-
if (state.current.mounted) {
|
14743 |
-
if (transition.destroyed) {
|
14744 |
-
// If no ref is given delete destroyed items immediately
|
14745 |
-
if (!ref && !lazy) cleanUp(state, key);
|
14746 |
-
if (onDestroyed) onDestroyed(item);
|
14747 |
-
} // A transition comes to rest once all its springs conclude
|
14748 |
|
|
|
|
|
|
|
14749 |
|
14750 |
-
var curInstances = Array.from(state.current.instances);
|
14751 |
-
var active = curInstances.some(function (_ref4) {
|
14752 |
-
var c = _ref4[1];
|
14753 |
-
return !c.idle;
|
14754 |
-
});
|
14755 |
-
if (!active && (ref || lazy) && state.current.deleted.length > 0) cleanUp(state);
|
14756 |
-
if (_onRest) _onRest(item, slot, values);
|
14757 |
-
}
|
14758 |
-
},
|
14759 |
-
onStart: onStart && function () {
|
14760 |
-
return onStart(item, slot);
|
14761 |
-
},
|
14762 |
-
onFrame: onFrame && function (values) {
|
14763 |
-
return onFrame(item, slot, values);
|
14764 |
-
},
|
14765 |
-
delay: trail,
|
14766 |
-
reset: reset && slot === ENTER // Update controller
|
14767 |
|
14768 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14769 |
|
14770 |
-
|
14771 |
-
|
14772 |
-
|
14773 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14774 |
|
14775 |
-
React.useEffect(function () {
|
14776 |
-
state.current.mounted = mounted.current = true;
|
14777 |
-
return function () {
|
14778 |
-
state.current.mounted = mounted.current = false;
|
14779 |
-
Array.from(state.current.instances).map(function (_ref5) {
|
14780 |
-
var c = _ref5[1];
|
14781 |
-
return c.destroy();
|
14782 |
-
});
|
14783 |
-
state.current.instances.clear();
|
14784 |
-
};
|
14785 |
-
}, []);
|
14786 |
-
return state.current.transitions.map(function (_ref6) {
|
14787 |
-
var item = _ref6.item,
|
14788 |
-
slot = _ref6.slot,
|
14789 |
-
key = _ref6.key;
|
14790 |
-
return {
|
14791 |
-
item: item,
|
14792 |
-
key: key,
|
14793 |
-
state: slot,
|
14794 |
-
props: state.current.instances.get(key).getValues()
|
14795 |
-
};
|
14796 |
-
});
|
14797 |
-
}
|
14798 |
|
14799 |
-
function cleanUp(state, filterKey) {
|
14800 |
-
var deleted = state.current.deleted;
|
14801 |
|
14802 |
-
|
14803 |
-
|
14804 |
-
|
14805 |
-
_ref8 = _iterator[_i++];
|
14806 |
-
} else {
|
14807 |
-
_i = _iterator.next();
|
14808 |
-
if (_i.done) return "break";
|
14809 |
-
_ref8 = _i.value;
|
14810 |
-
}
|
14811 |
|
14812 |
-
var _ref7 = _ref8;
|
14813 |
-
var key = _ref7.key;
|
14814 |
|
14815 |
-
|
14816 |
-
|
14817 |
-
|
|
|
|
|
14818 |
|
14819 |
-
|
14820 |
-
|
14821 |
-
|
14822 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14823 |
}
|
14824 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14825 |
|
14826 |
-
|
14827 |
-
|
|
|
14828 |
|
14829 |
-
|
14830 |
|
14831 |
-
if (_ret === "break") break;
|
14832 |
-
}
|
14833 |
|
14834 |
-
|
14835 |
-
}
|
14836 |
|
14837 |
-
|
14838 |
-
|
14839 |
-
|
14840 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14841 |
|
14842 |
-
|
14843 |
-
|
14844 |
-
|
14845 |
-
|
14846 |
-
|
14847 |
-
enter = _get2.enter,
|
14848 |
-
leave = _get2.leave,
|
14849 |
-
update = _get2.update,
|
14850 |
-
_get2$trail = _get2.trail,
|
14851 |
-
trail = _get2$trail === void 0 ? 0 : _get2$trail,
|
14852 |
-
unique = _get2.unique,
|
14853 |
-
config = _get2.config,
|
14854 |
-
_get2$order = _get2.order,
|
14855 |
-
order = _get2$order === void 0 ? [ENTER, LEAVE, UPDATE] : _get2$order;
|
14856 |
|
14857 |
-
var _get3 = get(prevProps),
|
14858 |
-
_keys = _get3.keys,
|
14859 |
-
_items = _get3.items;
|
14860 |
|
14861 |
-
|
|
|
14862 |
|
14863 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14864 |
|
14865 |
-
|
14866 |
-
|
14867 |
-
|
14868 |
-
|
14869 |
-
return !currentSet.has(item);
|
14870 |
-
});
|
14871 |
-
var removed = state.transitions.filter(function (item) {
|
14872 |
-
return !item.destroyed && !nextSet.has(item.originalKey);
|
14873 |
-
}).map(function (i) {
|
14874 |
-
return i.originalKey;
|
14875 |
-
});
|
14876 |
-
var updated = keys.filter(function (item) {
|
14877 |
-
return currentSet.has(item);
|
14878 |
-
});
|
14879 |
-
var delay = -trail;
|
14880 |
|
14881 |
-
|
14882 |
-
var changeType = order.shift();
|
14883 |
|
14884 |
-
|
14885 |
-
|
14886 |
-
|
14887 |
-
added.forEach(function (key, index) {
|
14888 |
-
// In unique mode, remove fading out transitions if their key comes in again
|
14889 |
-
if (unique && deleted.find(function (d) {
|
14890 |
-
return d.originalKey === key;
|
14891 |
-
})) deleted = deleted.filter(function (t) {
|
14892 |
-
return t.originalKey !== key;
|
14893 |
-
});
|
14894 |
-
var keyIndex = keys.indexOf(key);
|
14895 |
-
var item = items[keyIndex];
|
14896 |
-
var slot = first && initial !== void 0 ? 'initial' : ENTER;
|
14897 |
-
current[key] = {
|
14898 |
-
slot: slot,
|
14899 |
-
originalKey: key,
|
14900 |
-
key: unique ? String(key) : guid++,
|
14901 |
-
item: item,
|
14902 |
-
trail: delay = delay + trail,
|
14903 |
-
config: callProp(config, item, slot),
|
14904 |
-
from: callProp(first ? initial !== void 0 ? initial || {} : from : from, item),
|
14905 |
-
to: callProp(enter, item)
|
14906 |
-
};
|
14907 |
-
});
|
14908 |
-
break;
|
14909 |
-
}
|
14910 |
|
14911 |
-
|
14912 |
-
|
14913 |
-
removed.forEach(function (key) {
|
14914 |
-
var keyIndex = _keys.indexOf(key);
|
14915 |
|
14916 |
-
|
14917 |
-
|
14918 |
-
deleted.unshift(_extends({}, current[key], {
|
14919 |
-
slot: slot,
|
14920 |
-
destroyed: true,
|
14921 |
-
left: _keys[Math.max(0, keyIndex - 1)],
|
14922 |
-
right: _keys[Math.min(_keys.length, keyIndex + 1)],
|
14923 |
-
trail: delay = delay + trail,
|
14924 |
-
config: callProp(config, item, slot),
|
14925 |
-
to: callProp(leave, item)
|
14926 |
-
}));
|
14927 |
-
delete current[key];
|
14928 |
-
});
|
14929 |
-
break;
|
14930 |
-
}
|
14931 |
|
14932 |
-
|
14933 |
-
|
14934 |
-
|
14935 |
-
|
14936 |
-
|
14937 |
-
|
14938 |
-
|
14939 |
-
|
14940 |
-
slot: slot,
|
14941 |
-
trail: delay = delay + trail,
|
14942 |
-
config: callProp(config, item, slot),
|
14943 |
-
to: callProp(update, item)
|
14944 |
-
});
|
14945 |
-
});
|
14946 |
-
break;
|
14947 |
-
}
|
14948 |
}
|
14949 |
}
|
14950 |
|
14951 |
-
|
14952 |
-
|
14953 |
-
}); // This tries to restore order for deleted items by finding their last known siblings
|
14954 |
-
// only using the left sibling to keep order placement consistent for all deleted items
|
14955 |
|
14956 |
-
|
14957 |
-
var left = _ref10.left,
|
14958 |
-
right = _ref10.right,
|
14959 |
-
item = _objectWithoutPropertiesLoose(_ref10, ["left", "right"]);
|
14960 |
|
14961 |
-
var pos; // Was it the element on the left, if yes, move there ...
|
14962 |
|
14963 |
-
|
14964 |
-
|
14965 |
-
|
|
|
14966 |
|
14967 |
-
|
14968 |
-
|
14969 |
-
|
14970 |
-
|
14971 |
-
|
14972 |
-
|
14973 |
-
transitions: out,
|
14974 |
-
current: current,
|
14975 |
-
deleted: deleted,
|
14976 |
-
prevProps: props
|
14977 |
-
});
|
14978 |
-
}
|
14979 |
|
14980 |
-
var AnimatedStyle =
|
14981 |
-
/*#__PURE__*/
|
14982 |
-
function (_AnimatedObject) {
|
14983 |
-
_inheritsLoose(AnimatedStyle, _AnimatedObject);
|
14984 |
|
14985 |
-
|
14986 |
-
|
|
|
14987 |
|
14988 |
-
|
14989 |
-
|
14990 |
-
|
|
|
|
|
14991 |
|
14992 |
-
|
|
|
|
|
|
|
|
|
14993 |
|
14994 |
-
|
14995 |
-
|
14996 |
-
}
|
14997 |
|
14998 |
-
|
14999 |
-
return
|
15000 |
-
|
|
|
|
|
|
|
|
|
|
|
15001 |
|
15002 |
-
|
15003 |
-
|
|
|
15004 |
|
15005 |
-
|
15006 |
-
var colors = {
|
15007 |
-
transparent: 0x00000000,
|
15008 |
-
aliceblue: 0xf0f8ffff,
|
15009 |
-
antiquewhite: 0xfaebd7ff,
|
15010 |
-
aqua: 0x00ffffff,
|
15011 |
-
aquamarine: 0x7fffd4ff,
|
15012 |
-
azure: 0xf0ffffff,
|
15013 |
-
beige: 0xf5f5dcff,
|
15014 |
-
bisque: 0xffe4c4ff,
|
15015 |
-
black: 0x000000ff,
|
15016 |
-
blanchedalmond: 0xffebcdff,
|
15017 |
-
blue: 0x0000ffff,
|
15018 |
-
blueviolet: 0x8a2be2ff,
|
15019 |
-
brown: 0xa52a2aff,
|
15020 |
-
burlywood: 0xdeb887ff,
|
15021 |
-
burntsienna: 0xea7e5dff,
|
15022 |
-
cadetblue: 0x5f9ea0ff,
|
15023 |
-
chartreuse: 0x7fff00ff,
|
15024 |
-
chocolate: 0xd2691eff,
|
15025 |
-
coral: 0xff7f50ff,
|
15026 |
-
cornflowerblue: 0x6495edff,
|
15027 |
-
cornsilk: 0xfff8dcff,
|
15028 |
-
crimson: 0xdc143cff,
|
15029 |
-
cyan: 0x00ffffff,
|
15030 |
-
darkblue: 0x00008bff,
|
15031 |
-
darkcyan: 0x008b8bff,
|
15032 |
-
darkgoldenrod: 0xb8860bff,
|
15033 |
-
darkgray: 0xa9a9a9ff,
|
15034 |
-
darkgreen: 0x006400ff,
|
15035 |
-
darkgrey: 0xa9a9a9ff,
|
15036 |
-
darkkhaki: 0xbdb76bff,
|
15037 |
-
darkmagenta: 0x8b008bff,
|
15038 |
-
darkolivegreen: 0x556b2fff,
|
15039 |
-
darkorange: 0xff8c00ff,
|
15040 |
-
darkorchid: 0x9932ccff,
|
15041 |
-
darkred: 0x8b0000ff,
|
15042 |
-
darksalmon: 0xe9967aff,
|
15043 |
-
darkseagreen: 0x8fbc8fff,
|
15044 |
-
darkslateblue: 0x483d8bff,
|
15045 |
-
darkslategray: 0x2f4f4fff,
|
15046 |
-
darkslategrey: 0x2f4f4fff,
|
15047 |
-
darkturquoise: 0x00ced1ff,
|
15048 |
-
darkviolet: 0x9400d3ff,
|
15049 |
-
deeppink: 0xff1493ff,
|
15050 |
-
deepskyblue: 0x00bfffff,
|
15051 |
-
dimgray: 0x696969ff,
|
15052 |
-
dimgrey: 0x696969ff,
|
15053 |
-
dodgerblue: 0x1e90ffff,
|
15054 |
-
firebrick: 0xb22222ff,
|
15055 |
-
floralwhite: 0xfffaf0ff,
|
15056 |
-
forestgreen: 0x228b22ff,
|
15057 |
-
fuchsia: 0xff00ffff,
|
15058 |
-
gainsboro: 0xdcdcdcff,
|
15059 |
-
ghostwhite: 0xf8f8ffff,
|
15060 |
-
gold: 0xffd700ff,
|
15061 |
-
goldenrod: 0xdaa520ff,
|
15062 |
-
gray: 0x808080ff,
|
15063 |
-
green: 0x008000ff,
|
15064 |
-
greenyellow: 0xadff2fff,
|
15065 |
-
grey: 0x808080ff,
|
15066 |
-
honeydew: 0xf0fff0ff,
|
15067 |
-
hotpink: 0xff69b4ff,
|
15068 |
-
indianred: 0xcd5c5cff,
|
15069 |
-
indigo: 0x4b0082ff,
|
15070 |
-
ivory: 0xfffff0ff,
|
15071 |
-
khaki: 0xf0e68cff,
|
15072 |
-
lavender: 0xe6e6faff,
|
15073 |
-
lavenderblush: 0xfff0f5ff,
|
15074 |
-
lawngreen: 0x7cfc00ff,
|
15075 |
-
lemonchiffon: 0xfffacdff,
|
15076 |
-
lightblue: 0xadd8e6ff,
|
15077 |
-
lightcoral: 0xf08080ff,
|
15078 |
-
lightcyan: 0xe0ffffff,
|
15079 |
-
lightgoldenrodyellow: 0xfafad2ff,
|
15080 |
-
lightgray: 0xd3d3d3ff,
|
15081 |
-
lightgreen: 0x90ee90ff,
|
15082 |
-
lightgrey: 0xd3d3d3ff,
|
15083 |
-
lightpink: 0xffb6c1ff,
|
15084 |
-
lightsalmon: 0xffa07aff,
|
15085 |
-
lightseagreen: 0x20b2aaff,
|
15086 |
-
lightskyblue: 0x87cefaff,
|
15087 |
-
lightslategray: 0x778899ff,
|
15088 |
-
lightslategrey: 0x778899ff,
|
15089 |
-
lightsteelblue: 0xb0c4deff,
|
15090 |
-
lightyellow: 0xffffe0ff,
|
15091 |
-
lime: 0x00ff00ff,
|
15092 |
-
limegreen: 0x32cd32ff,
|
15093 |
-
linen: 0xfaf0e6ff,
|
15094 |
-
magenta: 0xff00ffff,
|
15095 |
-
maroon: 0x800000ff,
|
15096 |
-
mediumaquamarine: 0x66cdaaff,
|
15097 |
-
mediumblue: 0x0000cdff,
|
15098 |
-
mediumorchid: 0xba55d3ff,
|
15099 |
-
mediumpurple: 0x9370dbff,
|
15100 |
-
mediumseagreen: 0x3cb371ff,
|
15101 |
-
mediumslateblue: 0x7b68eeff,
|
15102 |
-
mediumspringgreen: 0x00fa9aff,
|
15103 |
-
mediumturquoise: 0x48d1ccff,
|
15104 |
-
mediumvioletred: 0xc71585ff,
|
15105 |
-
midnightblue: 0x191970ff,
|
15106 |
-
mintcream: 0xf5fffaff,
|
15107 |
-
mistyrose: 0xffe4e1ff,
|
15108 |
-
moccasin: 0xffe4b5ff,
|
15109 |
-
navajowhite: 0xffdeadff,
|
15110 |
-
navy: 0x000080ff,
|
15111 |
-
oldlace: 0xfdf5e6ff,
|
15112 |
-
olive: 0x808000ff,
|
15113 |
-
olivedrab: 0x6b8e23ff,
|
15114 |
-
orange: 0xffa500ff,
|
15115 |
-
orangered: 0xff4500ff,
|
15116 |
-
orchid: 0xda70d6ff,
|
15117 |
-
palegoldenrod: 0xeee8aaff,
|
15118 |
-
palegreen: 0x98fb98ff,
|
15119 |
-
paleturquoise: 0xafeeeeff,
|
15120 |
-
palevioletred: 0xdb7093ff,
|
15121 |
-
papayawhip: 0xffefd5ff,
|
15122 |
-
peachpuff: 0xffdab9ff,
|
15123 |
-
peru: 0xcd853fff,
|
15124 |
-
pink: 0xffc0cbff,
|
15125 |
-
plum: 0xdda0ddff,
|
15126 |
-
powderblue: 0xb0e0e6ff,
|
15127 |
-
purple: 0x800080ff,
|
15128 |
-
rebeccapurple: 0x663399ff,
|
15129 |
-
red: 0xff0000ff,
|
15130 |
-
rosybrown: 0xbc8f8fff,
|
15131 |
-
royalblue: 0x4169e1ff,
|
15132 |
-
saddlebrown: 0x8b4513ff,
|
15133 |
-
salmon: 0xfa8072ff,
|
15134 |
-
sandybrown: 0xf4a460ff,
|
15135 |
-
seagreen: 0x2e8b57ff,
|
15136 |
-
seashell: 0xfff5eeff,
|
15137 |
-
sienna: 0xa0522dff,
|
15138 |
-
silver: 0xc0c0c0ff,
|
15139 |
-
skyblue: 0x87ceebff,
|
15140 |
-
slateblue: 0x6a5acdff,
|
15141 |
-
slategray: 0x708090ff,
|
15142 |
-
slategrey: 0x708090ff,
|
15143 |
-
snow: 0xfffafaff,
|
15144 |
-
springgreen: 0x00ff7fff,
|
15145 |
-
steelblue: 0x4682b4ff,
|
15146 |
-
tan: 0xd2b48cff,
|
15147 |
-
teal: 0x008080ff,
|
15148 |
-
thistle: 0xd8bfd8ff,
|
15149 |
-
tomato: 0xff6347ff,
|
15150 |
-
turquoise: 0x40e0d0ff,
|
15151 |
-
violet: 0xee82eeff,
|
15152 |
-
wheat: 0xf5deb3ff,
|
15153 |
-
white: 0xffffffff,
|
15154 |
-
whitesmoke: 0xf5f5f5ff,
|
15155 |
-
yellow: 0xffff00ff,
|
15156 |
-
yellowgreen: 0x9acd32ff
|
15157 |
-
};
|
15158 |
|
15159 |
-
|
15160 |
-
|
15161 |
-
|
15162 |
|
15163 |
-
|
15164 |
-
for (var _len = arguments.length, parts = new Array(_len), _key = 0; _key < _len; _key++) {
|
15165 |
-
parts[_key] = arguments[_key];
|
15166 |
-
}
|
15167 |
|
15168 |
-
|
15169 |
-
}
|
|
|
|
|
15170 |
|
15171 |
-
|
15172 |
-
var
|
15173 |
-
var
|
15174 |
-
var hsla = new RegExp('hsla' + call(NUMBER, PERCENTAGE, PERCENTAGE, NUMBER));
|
15175 |
-
var hex3 = /^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/;
|
15176 |
-
var hex4 = /^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/;
|
15177 |
-
var hex6 = /^#([0-9a-fA-F]{6})$/;
|
15178 |
-
var hex8 = /^#([0-9a-fA-F]{8})$/;
|
15179 |
|
15180 |
-
|
15181 |
-
|
|
|
15182 |
|
15183 |
-
|
|
|
|
|
15184 |
|
15185 |
-
|
15186 |
-
|
|
|
15187 |
|
15188 |
-
|
15189 |
-
|
|
|
15190 |
|
15191 |
-
|
15192 |
-
|
|
|
15193 |
|
15194 |
-
|
15195 |
-
|
15196 |
-
|
15197 |
|
15198 |
-
|
15199 |
-
|
15200 |
-
|
15201 |
|
15202 |
-
|
15203 |
-
|
15204 |
-
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
15205 |
-
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
15206 |
-
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
15207 |
-
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
15208 |
-
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
15209 |
-
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
15210 |
-
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
15211 |
-
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
15212 |
-
*/
|
15213 |
-
function normalizeColor(color) {
|
15214 |
-
var match;
|
15215 |
|
15216 |
-
|
15217 |
-
|
15218 |
-
} // Ordered based on occurrences on Facebook codebase
|
15219 |
|
|
|
|
|
15220 |
|
15221 |
-
|
15222 |
-
|
15223 |
|
15224 |
-
|
15225 |
-
|
15226 |
-
|
15227 |
-
parse255(match[3]) << 8 | // b
|
15228 |
-
0x000000ff) >>> // a
|
15229 |
-
0;
|
15230 |
-
}
|
15231 |
|
15232 |
-
|
15233 |
-
|
15234 |
-
|
15235 |
-
parse255(match[3]) << 8 | // b
|
15236 |
-
parse1(match[4])) >>> // a
|
15237 |
-
0;
|
15238 |
-
}
|
15239 |
|
15240 |
-
|
15241 |
-
|
15242 |
-
match[2] + match[2] + // g
|
15243 |
-
match[3] + match[3] + // b
|
15244 |
-
'ff', // a
|
15245 |
-
16) >>> 0;
|
15246 |
-
} // https://drafts.csswg.org/css-color-4/#hex-notation
|
15247 |
|
|
|
|
|
15248 |
|
15249 |
-
|
|
|
15250 |
|
15251 |
-
|
15252 |
-
|
15253 |
-
match[2] + match[2] + // g
|
15254 |
-
match[3] + match[3] + // b
|
15255 |
-
match[4] + match[4], // a
|
15256 |
-
16) >>> 0;
|
15257 |
-
}
|
15258 |
|
15259 |
-
|
15260 |
-
|
15261 |
-
|
15262 |
-
parsePercentage(match[3]) // l
|
15263 |
-
) | 0x000000ff) >>> // a
|
15264 |
-
0;
|
15265 |
-
}
|
15266 |
|
15267 |
-
|
15268 |
-
|
15269 |
-
|
15270 |
-
|
15271 |
-
|
15272 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15273 |
}
|
15274 |
|
15275 |
-
|
15276 |
-
}
|
15277 |
|
15278 |
-
function
|
15279 |
-
|
15280 |
-
if (t > 1) t -= 1;
|
15281 |
-
if (t < 1 / 6) return p + (q - p) * 6 * t;
|
15282 |
-
if (t < 1 / 2) return q;
|
15283 |
-
if (t < 2 / 3) return p + (q - p) * (2 / 3 - t) * 6;
|
15284 |
-
return p;
|
15285 |
-
}
|
15286 |
|
15287 |
-
|
15288 |
-
|
15289 |
-
|
15290 |
-
|
15291 |
-
|
15292 |
-
|
15293 |
-
return Math.round(r * 255) << 24 | Math.round(g * 255) << 16 | Math.round(b * 255) << 8;
|
15294 |
-
}
|
15295 |
|
15296 |
-
function
|
15297 |
-
|
15298 |
-
|
15299 |
-
|
15300 |
-
|
15301 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15302 |
|
15303 |
-
|
15304 |
-
|
15305 |
-
return (int % 360 + 360) % 360 / 360;
|
15306 |
-
}
|
15307 |
|
15308 |
-
|
15309 |
-
var num = parseFloat(str);
|
15310 |
-
if (num < 0) return 0;
|
15311 |
-
if (num > 1) return 255;
|
15312 |
-
return Math.round(num * 255);
|
15313 |
-
}
|
15314 |
|
15315 |
-
|
15316 |
-
|
15317 |
-
|
15318 |
-
if (int < 0) return 0;
|
15319 |
-
if (int > 100) return 1;
|
15320 |
-
return int / 100;
|
15321 |
-
}
|
15322 |
|
15323 |
-
|
15324 |
-
|
15325 |
-
|
15326 |
-
|
15327 |
-
var r = (int32Color & 0xff000000) >>> 24;
|
15328 |
-
var g = (int32Color & 0x00ff0000) >>> 16;
|
15329 |
-
var b = (int32Color & 0x0000ff00) >>> 8;
|
15330 |
-
var a = (int32Color & 0x000000ff) / 255;
|
15331 |
-
return "rgba(" + r + ", " + g + ", " + b + ", " + a + ")";
|
15332 |
-
} // Problem: https://github.com/animatedjs/animated/pull/102
|
15333 |
-
// Solution: https://stackoverflow.com/questions/638565/parsing-scientific-notation-sensibly/658662
|
15334 |
|
|
|
|
|
15335 |
|
15336 |
-
var
|
15337 |
-
|
|
|
15338 |
|
15339 |
-
|
|
|
|
|
|
|
15340 |
|
15341 |
-
var
|
15342 |
-
/**
|
15343 |
-
* Supports string shapes by extracting numbers so new values can be computed,
|
15344 |
-
* and recombines those values into new strings of the same shape. Supports
|
15345 |
-
* things like:
|
15346 |
-
*
|
15347 |
-
* rgba(123, 42, 99, 0.36) // colors
|
15348 |
-
* -45deg // values with units
|
15349 |
-
* 0 2px 2px 0px rgba(0, 0, 0, 0.12) // box shadows
|
15350 |
-
*/
|
15351 |
|
15352 |
-
|
15353 |
-
|
15354 |
-
|
15355 |
-
|
15356 |
-
}).map(function (rangeValue) {
|
15357 |
-
return rangeValue.replace(colorNamesRegex, colorToRgba);
|
15358 |
-
});
|
15359 |
-
var outputRanges = outputRange[0].match(stringShapeRegex).map(function () {
|
15360 |
-
return [];
|
15361 |
-
});
|
15362 |
-
outputRange.forEach(function (value) {
|
15363 |
-
value.match(stringShapeRegex).forEach(function (number, i) {
|
15364 |
-
return outputRanges[i].push(+number);
|
15365 |
-
});
|
15366 |
-
});
|
15367 |
-
var interpolations = outputRange[0].match(stringShapeRegex).map(function (_value, i) {
|
15368 |
-
return createInterpolator(_extends({}, config, {
|
15369 |
-
output: outputRanges[i]
|
15370 |
-
}));
|
15371 |
-
});
|
15372 |
-
return function (input) {
|
15373 |
-
var i = 0;
|
15374 |
-
return outputRange[0] // 'rgba(0, 100, 200, 0)'
|
15375 |
-
// ->
|
15376 |
-
// 'rgba(${interpolations[0](input)}, ${interpolations[1](input)}, ...'
|
15377 |
-
.replace(stringShapeRegex, function () {
|
15378 |
-
return interpolations[i++](input);
|
15379 |
-
}) // rgba requires that the r,g,b are integers.... so we want to round them, but we *dont* want to
|
15380 |
-
// round the opacity (4th column).
|
15381 |
-
.replace(/rgba\(([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+)\)/gi, function (_, p1, p2, p3, p4) {
|
15382 |
-
return "rgba(" + Math.round(p1) + ", " + Math.round(p2) + ", " + Math.round(p3) + ", " + p4 + ")";
|
15383 |
});
|
15384 |
};
|
15385 |
-
};
|
15386 |
-
|
15387 |
-
var isUnitlessNumber = {
|
15388 |
-
animationIterationCount: true,
|
15389 |
-
borderImageOutset: true,
|
15390 |
-
borderImageSlice: true,
|
15391 |
-
borderImageWidth: true,
|
15392 |
-
boxFlex: true,
|
15393 |
-
boxFlexGroup: true,
|
15394 |
-
boxOrdinalGroup: true,
|
15395 |
-
columnCount: true,
|
15396 |
-
columns: true,
|
15397 |
-
flex: true,
|
15398 |
-
flexGrow: true,
|
15399 |
-
flexPositive: true,
|
15400 |
-
flexShrink: true,
|
15401 |
-
flexNegative: true,
|
15402 |
-
flexOrder: true,
|
15403 |
-
gridRow: true,
|
15404 |
-
gridRowEnd: true,
|
15405 |
-
gridRowSpan: true,
|
15406 |
-
gridRowStart: true,
|
15407 |
-
gridColumn: true,
|
15408 |
-
gridColumnEnd: true,
|
15409 |
-
gridColumnSpan: true,
|
15410 |
-
gridColumnStart: true,
|
15411 |
-
fontWeight: true,
|
15412 |
-
lineClamp: true,
|
15413 |
-
lineHeight: true,
|
15414 |
-
opacity: true,
|
15415 |
-
order: true,
|
15416 |
-
orphans: true,
|
15417 |
-
tabSize: true,
|
15418 |
-
widows: true,
|
15419 |
-
zIndex: true,
|
15420 |
-
zoom: true,
|
15421 |
-
// SVG-related properties
|
15422 |
-
fillOpacity: true,
|
15423 |
-
floodOpacity: true,
|
15424 |
-
stopOpacity: true,
|
15425 |
-
strokeDasharray: true,
|
15426 |
-
strokeDashoffset: true,
|
15427 |
-
strokeMiterlimit: true,
|
15428 |
-
strokeOpacity: true,
|
15429 |
-
strokeWidth: true
|
15430 |
-
};
|
15431 |
-
|
15432 |
-
var prefixKey = function prefixKey(prefix, key) {
|
15433 |
-
return prefix + key.charAt(0).toUpperCase() + key.substring(1);
|
15434 |
-
};
|
15435 |
|
15436 |
-
|
15437 |
-
|
15438 |
-
prefixes.forEach(function (prefix) {
|
15439 |
-
return acc[prefixKey(prefix, prop)] = acc[prop];
|
15440 |
-
});
|
15441 |
-
return acc;
|
15442 |
-
}, isUnitlessNumber);
|
15443 |
|
15444 |
-
|
15445 |
-
if (value == null || typeof value === 'boolean' || value === '') return '';
|
15446 |
-
if (!isCustomProperty && typeof value === 'number' && value !== 0 && !(isUnitlessNumber.hasOwnProperty(name) && isUnitlessNumber[name])) return value + 'px'; // Presumes implicit 'px' suffix for unitless numbers
|
15447 |
|
15448 |
-
|
15449 |
-
|
|
|
|
|
15450 |
|
15451 |
-
|
15452 |
-
|
15453 |
-
|
15454 |
-
});
|
15455 |
-
injectDefaultElement('div');
|
15456 |
-
injectStringInterpolator(createStringInterpolator);
|
15457 |
-
injectColorNames(colors);
|
15458 |
-
injectApplyAnimatedValues(function (instance, props) {
|
15459 |
-
if (instance.nodeType && instance.setAttribute !== undefined) {
|
15460 |
-
var style = props.style,
|
15461 |
-
children = props.children,
|
15462 |
-
scrollTop = props.scrollTop,
|
15463 |
-
scrollLeft = props.scrollLeft,
|
15464 |
-
attributes = _objectWithoutPropertiesLoose(props, ["style", "children", "scrollTop", "scrollLeft"]);
|
15465 |
|
15466 |
-
|
15467 |
-
if (scrollTop !== void 0) instance.scrollTop = scrollTop;
|
15468 |
-
if (scrollLeft !== void 0) instance.scrollLeft = scrollLeft; // Set textContent, if children is an animatable value
|
15469 |
|
15470 |
-
|
|
|
|
|
15471 |
|
15472 |
-
|
15473 |
-
|
15474 |
-
|
15475 |
-
var styleValue = dangerousStyleValue(styleName, style[styleName], isCustomProperty);
|
15476 |
-
if (styleName === 'float') styleName = 'cssFloat';
|
15477 |
-
if (isCustomProperty) instance.style.setProperty(styleName, styleValue);else instance.style[styleName] = styleValue;
|
15478 |
-
} // Set attributes ...
|
15479 |
|
|
|
|
|
|
|
15480 |
|
15481 |
-
|
15482 |
-
|
15483 |
-
|
15484 |
-
return '-' + n.toLowerCase();
|
15485 |
-
}));
|
15486 |
-
if (typeof instance.getAttribute(dashCase) !== 'undefined') instance.setAttribute(dashCase, attributes[name]);
|
15487 |
-
}
|
15488 |
|
15489 |
-
|
15490 |
-
|
15491 |
-
}, function (style) {
|
15492 |
-
return style;
|
15493 |
-
});
|
15494 |
|
15495 |
-
|
15496 |
-
|
15497 |
-
|
15498 |
-
var apply = merge(createAnimatedComponent, false);
|
15499 |
-
var extendedAnimated = apply(domElements);
|
15500 |
|
15501 |
-
|
15502 |
-
|
15503 |
-
|
15504 |
-
|
15505 |
-
|
15506 |
-
|
15507 |
-
|
15508 |
-
|
15509 |
-
|
15510 |
-
|
15511 |
-
|
15512 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15513 |
|
|
|
15514 |
|
15515 |
-
|
|
|
|
|
15516 |
|
15517 |
-
|
15518 |
-
|
|
|
15519 |
|
15520 |
-
|
|
|
|
|
|
|
15521 |
|
|
|
|
|
15522 |
/**
|
15523 |
-
*
|
15524 |
*/
|
15525 |
-
module.exports = pathToRegexp
|
15526 |
-
module.exports.parse = parse
|
15527 |
-
module.exports.compile = compile
|
15528 |
-
module.exports.tokensToFunction = tokensToFunction
|
15529 |
-
module.exports.tokensToRegExp = tokensToRegExp
|
15530 |
|
15531 |
-
|
15532 |
-
|
15533 |
-
|
15534 |
-
|
15535 |
-
|
15536 |
-
|
15537 |
-
|
15538 |
-
|
15539 |
-
|
15540 |
-
|
15541 |
-
|
15542 |
-
|
15543 |
-
|
15544 |
-
|
15545 |
-
// "/*" => ["/", undefined, undefined, undefined, undefined, "*"]
|
15546 |
-
'([\\/.])?(?:(?:\\:(\\w+)(?:\\(((?:\\\\.|[^\\\\()])+)\\))?|\\(((?:\\\\.|[^\\\\()])+)\\))([+*?])?|(\\*))'
|
15547 |
-
].join('|'), 'g')
|
15548 |
|
15549 |
/**
|
15550 |
-
*
|
15551 |
-
*
|
15552 |
-
* @param {string} str
|
15553 |
-
* @param {Object=} options
|
15554 |
-
* @return {!Array}
|
15555 |
*/
|
15556 |
-
function parse (str, options) {
|
15557 |
-
var tokens = []
|
15558 |
-
var key = 0
|
15559 |
-
var index = 0
|
15560 |
-
var path = ''
|
15561 |
-
var defaultDelimiter = options && options.delimiter || '/'
|
15562 |
-
var res
|
15563 |
|
15564 |
-
|
15565 |
-
|
15566 |
-
|
15567 |
-
|
15568 |
-
|
15569 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15570 |
|
15571 |
-
|
15572 |
-
|
15573 |
-
|
15574 |
-
continue
|
15575 |
}
|
15576 |
|
15577 |
-
|
15578 |
-
|
15579 |
-
|
15580 |
-
|
15581 |
-
|
15582 |
-
|
15583 |
-
var asterisk = res[7]
|
15584 |
|
15585 |
-
|
15586 |
-
|
15587 |
-
|
15588 |
-
|
15589 |
-
|
|
|
|
|
|
|
|
|
|
|
15590 |
|
15591 |
-
|
15592 |
-
var repeat = modifier === '+' || modifier === '*'
|
15593 |
-
var optional = modifier === '?' || modifier === '*'
|
15594 |
-
var delimiter = res[2] || defaultDelimiter
|
15595 |
-
var pattern = capture || group
|
15596 |
|
15597 |
-
|
15598 |
-
|
15599 |
-
|
15600 |
-
delimiter: delimiter,
|
15601 |
-
optional: optional,
|
15602 |
-
repeat: repeat,
|
15603 |
-
partial: partial,
|
15604 |
-
asterisk: !!asterisk,
|
15605 |
-
pattern: pattern ? escapeGroup(pattern) : (asterisk ? '.*' : '[^' + escapeString(delimiter) + ']+?')
|
15606 |
-
})
|
15607 |
-
}
|
15608 |
|
15609 |
-
|
15610 |
-
|
15611 |
-
|
15612 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
15613 |
|
15614 |
-
|
15615 |
-
|
15616 |
-
|
15617 |
}
|
15618 |
|
15619 |
-
return
|
15620 |
}
|
15621 |
-
|
15622 |
/**
|
15623 |
-
*
|
15624 |
-
*
|
15625 |
-
* @param {string} str
|
15626 |
-
* @param {Object=} options
|
15627 |
-
* @return {!function(Object=, Object=)}
|
15628 |
*/
|
15629 |
-
function compile (str, options) {
|
15630 |
-
return tokensToFunction(parse(str, options), options)
|
15631 |
-
}
|
15632 |
|
15633 |
-
/**
|
15634 |
-
* Prettier encoding of URI path segments.
|
15635 |
-
*
|
15636 |
-
* @param {string}
|
15637 |
-
* @return {string}
|
15638 |
-
*/
|
15639 |
-
function encodeURIComponentPretty (str) {
|
15640 |
-
return encodeURI(str).replace(/[\/?#]/g, function (c) {
|
15641 |
-
return '%' + c.charCodeAt(0).toString(16).toUpperCase()
|
15642 |
-
})
|
15643 |
-
}
|
15644 |
|
15645 |
-
|
15646 |
-
|
15647 |
-
|
15648 |
-
|
15649 |
-
|
15650 |
-
|
15651 |
-
|
15652 |
-
|
15653 |
-
|
15654 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15655 |
}
|
15656 |
|
|
|
|
|
|
|
|
|
|
|
15657 |
/**
|
15658 |
-
*
|
15659 |
*/
|
15660 |
-
function tokensToFunction (tokens, options) {
|
15661 |
-
// Compile all the tokens into regexps.
|
15662 |
-
var matches = new Array(tokens.length)
|
15663 |
-
|
15664 |
-
// Compile all the patterns before compilation.
|
15665 |
-
for (var i = 0; i < tokens.length; i++) {
|
15666 |
-
if (typeof tokens[i] === 'object') {
|
15667 |
-
matches[i] = new RegExp('^(?:' + tokens[i].pattern + ')$', flags(options))
|
15668 |
-
}
|
15669 |
-
}
|
15670 |
-
|
15671 |
-
return function (obj, opts) {
|
15672 |
-
var path = ''
|
15673 |
-
var data = obj || {}
|
15674 |
-
var options = opts || {}
|
15675 |
-
var encode = options.pretty ? encodeURIComponentPretty : encodeURIComponent
|
15676 |
|
15677 |
-
for (var i = 0; i < tokens.length; i++) {
|
15678 |
-
var token = tokens[i]
|
15679 |
-
|
15680 |
-
if (typeof token === 'string') {
|
15681 |
-
path += token
|
15682 |
-
|
15683 |
-
continue
|
15684 |
-
}
|
15685 |
|
15686 |
-
|
15687 |
-
|
15688 |
-
|
15689 |
-
|
15690 |
-
if (token.optional) {
|
15691 |
-
// Prepend partial segment prefixes.
|
15692 |
-
if (token.partial) {
|
15693 |
-
path += token.prefix
|
15694 |
-
}
|
15695 |
|
15696 |
-
|
15697 |
-
|
15698 |
-
|
15699 |
-
}
|
15700 |
-
}
|
15701 |
|
15702 |
-
|
15703 |
-
if (!token.repeat) {
|
15704 |
-
throw new TypeError('Expected "' + token.name + '" to not repeat, but received `' + JSON.stringify(value) + '`')
|
15705 |
-
}
|
15706 |
|
15707 |
-
|
15708 |
-
|
15709 |
-
continue
|
15710 |
-
} else {
|
15711 |
-
throw new TypeError('Expected "' + token.name + '" to not be empty')
|
15712 |
-
}
|
15713 |
-
}
|
15714 |
|
15715 |
-
|
15716 |
-
|
|
|
|
|
|
|
15717 |
|
15718 |
-
|
15719 |
-
|
15720 |
-
|
|
|
15721 |
|
15722 |
-
|
15723 |
-
|
|
|
|
|
|
|
15724 |
|
15725 |
-
|
|
|
15726 |
}
|
15727 |
|
15728 |
-
|
|
|
|
|
|
|
|
|
15729 |
|
15730 |
-
|
15731 |
-
|
15732 |
-
}
|
15733 |
|
15734 |
-
|
15735 |
-
}
|
15736 |
|
15737 |
-
|
15738 |
-
|
15739 |
}
|
15740 |
|
15741 |
-
|
15742 |
-
|
15743 |
-
|
15744 |
-
|
15745 |
-
|
15746 |
-
*/
|
15747 |
-
function escapeString (str) {
|
15748 |
-
return str.replace(/([.+*?=^!:${}()[\]|\/\\])/g, '\\$1')
|
15749 |
}
|
15750 |
|
15751 |
-
|
15752 |
-
|
15753 |
-
|
15754 |
-
|
15755 |
-
|
15756 |
-
|
15757 |
-
|
15758 |
-
return group.replace(/([=!:$\/()])/g, '\\$1')
|
15759 |
}
|
15760 |
|
15761 |
-
|
15762 |
-
|
15763 |
-
*
|
15764 |
-
* @param {!RegExp} re
|
15765 |
-
* @param {Array} keys
|
15766 |
-
* @return {!RegExp}
|
15767 |
-
*/
|
15768 |
-
function attachKeys (re, keys) {
|
15769 |
-
re.keys = keys
|
15770 |
-
return re
|
15771 |
}
|
15772 |
|
15773 |
-
|
15774 |
-
|
15775 |
-
|
15776 |
-
|
15777 |
-
* @return {string}
|
15778 |
-
*/
|
15779 |
-
function flags (options) {
|
15780 |
-
return options && options.sensitive ? '' : 'i'
|
15781 |
}
|
15782 |
|
|
|
15783 |
/**
|
15784 |
-
*
|
15785 |
-
*
|
15786 |
-
*
|
15787 |
-
*
|
15788 |
-
* @return {!RegExp}
|
15789 |
*/
|
15790 |
-
function regexpToRegexp (path, keys) {
|
15791 |
-
// Use a negative lookahead to match only capturing groups.
|
15792 |
-
var groups = path.source.match(/\((?!\?)/g)
|
15793 |
|
15794 |
-
if (groups) {
|
15795 |
-
for (var i = 0; i < groups.length; i++) {
|
15796 |
-
keys.push({
|
15797 |
-
name: i,
|
15798 |
-
prefix: null,
|
15799 |
-
delimiter: null,
|
15800 |
-
optional: false,
|
15801 |
-
repeat: false,
|
15802 |
-
partial: false,
|
15803 |
-
asterisk: false,
|
15804 |
-
pattern: null
|
15805 |
-
})
|
15806 |
-
}
|
15807 |
-
}
|
15808 |
|
15809 |
-
|
15810 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15811 |
|
15812 |
/**
|
15813 |
-
*
|
15814 |
-
*
|
15815 |
-
* @param {!Array} path
|
15816 |
-
* @param {Array} keys
|
15817 |
-
* @param {!Object} options
|
15818 |
-
* @return {!RegExp}
|
15819 |
*/
|
15820 |
-
function arrayToRegexp (path, keys, options) {
|
15821 |
-
var parts = []
|
15822 |
|
15823 |
-
|
15824 |
-
|
|
|
|
|
|
|
|
|
|
|
15825 |
}
|
15826 |
|
15827 |
-
var
|
15828 |
|
15829 |
-
|
15830 |
-
|
15831 |
|
15832 |
-
|
15833 |
-
|
15834 |
-
|
15835 |
-
|
15836 |
-
|
15837 |
-
|
15838 |
-
|
15839 |
-
|
15840 |
-
|
15841 |
-
|
15842 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15843 |
|
15844 |
/**
|
15845 |
-
*
|
15846 |
-
*
|
15847 |
-
* @param {!Array} tokens
|
15848 |
-
* @param {(Array|Object)=} keys
|
15849 |
-
* @param {Object=} options
|
15850 |
-
* @return {!RegExp}
|
15851 |
*/
|
15852 |
-
function tokensToRegExp (tokens, keys, options) {
|
15853 |
-
if (!isarray(keys)) {
|
15854 |
-
options = /** @type {!Object} */ (keys || options)
|
15855 |
-
keys = []
|
15856 |
-
}
|
15857 |
-
|
15858 |
-
options = options || {}
|
15859 |
|
15860 |
-
|
15861 |
-
var
|
15862 |
-
var route = ''
|
15863 |
|
15864 |
-
|
15865 |
-
|
15866 |
-
|
15867 |
|
15868 |
-
|
15869 |
-
|
15870 |
-
|
15871 |
-
|
15872 |
-
|
|
|
|
|
15873 |
|
15874 |
-
|
|
|
15875 |
|
15876 |
-
|
15877 |
-
capture += '(?:' + prefix + capture + ')*'
|
15878 |
-
}
|
15879 |
|
15880 |
-
|
15881 |
-
|
15882 |
-
capture = '(?:' + prefix + '(' + capture + '))?'
|
15883 |
-
} else {
|
15884 |
-
capture = prefix + '(' + capture + ')?'
|
15885 |
-
}
|
15886 |
-
} else {
|
15887 |
-
capture = prefix + '(' + capture + ')'
|
15888 |
-
}
|
15889 |
|
15890 |
-
|
15891 |
-
|
15892 |
-
}
|
15893 |
|
15894 |
-
|
15895 |
-
|
|
|
|
|
15896 |
|
15897 |
-
|
15898 |
-
|
15899 |
-
|
15900 |
-
|
15901 |
-
if (!strict) {
|
15902 |
-
route = (endsWithDelimiter ? route.slice(0, -delimiter.length) : route) + '(?:' + delimiter + '(?=$))?'
|
15903 |
-
}
|
15904 |
|
15905 |
-
|
15906 |
-
|
15907 |
-
|
15908 |
-
|
15909 |
-
|
15910 |
-
route += strict && endsWithDelimiter ? '' : '(?=' + delimiter + '|$)'
|
15911 |
-
}
|
15912 |
|
15913 |
-
return
|
15914 |
}
|
15915 |
|
15916 |
-
|
15917 |
-
* Normalize the given path string, returning a regular expression.
|
15918 |
-
*
|
15919 |
-
* An empty array can be passed in for the keys, which will hold the
|
15920 |
-
* placeholder key descriptions. For example, using `/user/:id`, `keys` will
|
15921 |
-
* contain `[{ name: 'id', delimiter: '/', optional: false, repeat: false }]`.
|
15922 |
-
*
|
15923 |
-
* @param {(string|RegExp|Array)} path
|
15924 |
-
* @param {(Array|Object)=} keys
|
15925 |
-
* @param {Object=} options
|
15926 |
-
* @return {!RegExp}
|
15927 |
-
*/
|
15928 |
-
function pathToRegexp (path, keys, options) {
|
15929 |
-
if (!isarray(keys)) {
|
15930 |
-
options = /** @type {!Object} */ (keys || options)
|
15931 |
-
keys = []
|
15932 |
-
}
|
15933 |
|
15934 |
-
options = options || {}
|
15935 |
|
15936 |
-
|
15937 |
-
return regexpToRegexp(path, /** @type {!Array} */ (keys))
|
15938 |
-
}
|
15939 |
|
15940 |
-
|
15941 |
-
|
15942 |
-
}
|
15943 |
|
15944 |
-
|
15945 |
-
|
15946 |
|
|
|
|
|
15947 |
|
15948 |
-
|
|
|
15949 |
|
15950 |
-
|
15951 |
-
|
15952 |
|
15953 |
-
|
15954 |
-
|
15955 |
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return hasValidNotes; });
|
15956 |
-
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2);
|
15957 |
-
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_0__);
|
15958 |
-
/**
|
15959 |
-
* External dependencies
|
15960 |
-
*/
|
15961 |
|
15962 |
-
|
15963 |
-
|
15964 |
-
*
|
15965 |
-
* @param {Array} notes - List of notes, contains read and unread notes.
|
15966 |
-
* @param {number} lastRead - The timestamp that the user read a note.
|
15967 |
-
* @return {number} - Unread notes count.
|
15968 |
-
*/
|
15969 |
|
15970 |
-
|
15971 |
-
|
15972 |
-
var isDeleted = note.is_deleted,
|
15973 |
-
dateCreatedGmt = note.date_created_gmt,
|
15974 |
-
status = note.status;
|
15975 |
|
15976 |
-
|
15977 |
-
|
15978 |
-
|
15979 |
-
|
15980 |
-
|
15981 |
-
|
15982 |
-
|
15983 |
-
|
15984 |
-
* Verifies if there are any valid notes in the list.
|
15985 |
-
*
|
15986 |
-
* @param {Array} notes - List of notes, contains read and unread notes.
|
15987 |
-
* @return {boolean} - Whether there are valid notes or not.
|
15988 |
-
*/
|
15989 |
|
15990 |
-
|
15991 |
-
|
15992 |
-
var isDeleted = note.is_deleted;
|
15993 |
-
return !isDeleted;
|
15994 |
-
});
|
15995 |
-
return validNotes.length > 0;
|
15996 |
-
}
|
15997 |
|
15998 |
-
|
15999 |
|
16000 |
-
/***/ 451:
|
16001 |
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
16002 |
|
16003 |
-
"use strict";
|
16004 |
-
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0);
|
16005 |
-
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
|
16006 |
-
/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(88);
|
16007 |
|
16008 |
|
16009 |
-
/**
|
16010 |
-
* WordPress dependencies
|
16011 |
-
*/
|
16012 |
|
16013 |
-
var close = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__[/* SVG */ "c"], {
|
16014 |
-
xmlns: "http://www.w3.org/2000/svg",
|
16015 |
-
viewBox: "0 0 24 24"
|
16016 |
-
}, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__[/* Path */ "b"], {
|
16017 |
-
d: "M13 11.8l6.1-6.3-1-1-6.1 6.2-6.1-6.2-1 1 6.1 6.3-6.5 6.7 1 1 6.5-6.6 6.5 6.6 1-1z"
|
16018 |
-
}));
|
16019 |
-
/* harmony default export */ __webpack_exports__["a"] = (close);
|
16020 |
-
//# sourceMappingURL=close.js.map
|
16021 |
|
16022 |
-
/***/ }),
|
16023 |
|
16024 |
-
|
16025 |
-
/***/ (function(module, exports) {
|
16026 |
|
16027 |
-
|
16028 |
|
16029 |
-
|
16030 |
-
|
16031 |
-
|
16032 |
-
})();
|
16033 |
|
16034 |
-
try {
|
16035 |
-
// This works if eval is allowed (see CSP)
|
16036 |
-
g = g || new Function("return this")();
|
16037 |
-
} catch (e) {
|
16038 |
-
// This works if the window reference is available
|
16039 |
-
if (typeof window === "object") g = window;
|
16040 |
-
}
|
16041 |
|
16042 |
-
// g can still be undefined, but nothing to do about it...
|
16043 |
-
// We return undefined, instead of nothing here, so it's
|
16044 |
-
// easier to handle this case. if(!global) { ...}
|
16045 |
|
16046 |
-
module.exports = g;
|
16047 |
|
16048 |
|
16049 |
-
/***/ }),
|
16050 |
|
16051 |
-
/***/ 47:
|
16052 |
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
16053 |
|
16054 |
-
|
16055 |
-
|
16056 |
-
|
16057 |
-
"@babel/helpers - typeof";
|
16058 |
|
16059 |
-
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
|
16060 |
-
_typeof = function _typeof(obj) {
|
16061 |
-
return typeof obj;
|
16062 |
-
};
|
16063 |
-
} else {
|
16064 |
-
_typeof = function _typeof(obj) {
|
16065 |
-
return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
16066 |
-
};
|
16067 |
-
}
|
16068 |
|
16069 |
-
return _typeof(obj);
|
16070 |
-
}
|
16071 |
|
16072 |
-
|
|
|
|
|
|
|
|
35 |
/******/
|
36 |
/******/ // object to store loaded CSS chunks
|
37 |
/******/ var installedCssChunks = {
|
38 |
+
/******/ 24: 0
|
39 |
/******/ }
|
40 |
/******/ var isCssRtlEnabled = function() {
|
41 |
/******/ return document.dir === 'rtl';
|
45 |
/******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched
|
46 |
/******/ // Promise = chunk loading, 0 = chunk loaded
|
47 |
/******/ var installedChunks = {
|
48 |
+
/******/ 24: 0
|
49 |
/******/ };
|
50 |
/******/
|
51 |
/******/
|
52 |
/******/
|
53 |
/******/ // script path function
|
54 |
/******/ function webpackJsonpScriptSrc(chunkId) {
|
55 |
+
/******/ return __webpack_require__.p + "chunks/" + ({"10":"activity-panels-help","11":"activity-panels-inbox","12":"analytics-report","13":"analytics-report-categories","14":"analytics-report-coupons","15":"analytics-report-customers","16":"analytics-report-downloads","17":"analytics-report-orders","18":"analytics-report-products","19":"analytics-report-revenue","20":"analytics-report-stock","21":"analytics-report-taxes","22":"analytics-report-variations","23":"analytics-settings","29":"customizable-dashboard","30":"dashboard","31":"dashboard-charts","34":"homescreen","36":"leaderboards","38":"marketing-overview","47":"profile-wizard","48":"store-alerts","49":"store-performance","50":"task-list","52":"wcpay-usage-modal"}[chunkId]||chunkId) + ".js"
|
56 |
/******/ }
|
57 |
/******/
|
58 |
/******/ function jsonpScriptSrc(chunkId) {
|
95 |
/******/
|
96 |
/******/
|
97 |
/******/ // mini-css-extract-plugin CSS loading
|
98 |
+
/******/ var cssChunks = {"0":1,"6":1,"10":1,"11":1,"12":1,"17":1,"23":1,"30":1,"31":1,"34":1,"36":1,"38":1,"47":1,"48":1,"49":1};
|
99 |
/******/ if(installedCssChunks[chunkId]) promises.push(installedCssChunks[chunkId]);
|
100 |
/******/ else if(installedCssChunks[chunkId] !== 0 && cssChunks[chunkId]) {
|
101 |
/******/ promises.push(installedCssChunks[chunkId] = new Promise(function(resolve, reject) {
|
259 |
/******/
|
260 |
/******/
|
261 |
/******/ // Load entry module and return exports
|
262 |
+
/******/ return __webpack_require__(__webpack_require__.s = 367);
|
263 |
/******/ })
|
264 |
/************************************************************************/
|
265 |
+
/******/ ([
|
266 |
+
/* 0 */
|
|
|
267 |
/***/ (function(module, exports) {
|
268 |
|
269 |
(function() { module.exports = this["wp"]["element"]; }());
|
270 |
|
271 |
/***/ }),
|
272 |
+
/* 1 */
|
|
|
273 |
/***/ (function(module, exports, __webpack_require__) {
|
274 |
|
275 |
/**
|
282 |
if (false) { var throwOnDirectAccess, ReactIs; } else {
|
283 |
// By explicitly using `prop-types` you are opting into new production behavior.
|
284 |
// http://fb.me/prop-types-in-prod
|
285 |
+
module.exports = __webpack_require__(120)();
|
286 |
}
|
287 |
|
288 |
|
289 |
/***/ }),
|
290 |
+
/* 2 */
|
291 |
+
/***/ (function(module, exports) {
|
292 |
|
293 |
+
(function() { module.exports = this["lodash"]; }());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
294 |
|
295 |
/***/ }),
|
296 |
+
/* 3 */
|
|
|
297 |
/***/ (function(module, exports) {
|
298 |
|
299 |
+
(function() { module.exports = this["wp"]["i18n"]; }());
|
300 |
|
301 |
/***/ }),
|
302 |
+
/* 4 */
|
303 |
+
/***/ (function(module, exports, __webpack_require__) {
|
304 |
|
305 |
+
/*!
|
306 |
+
Copyright (c) 2017 Jed Watson.
|
307 |
+
Licensed under the MIT License (MIT), see
|
308 |
+
http://jedwatson.github.io/classnames
|
309 |
+
*/
|
310 |
+
/* global define */
|
311 |
|
312 |
+
(function () {
|
313 |
+
'use strict';
|
314 |
|
315 |
+
var hasOwn = {}.hasOwnProperty;
|
|
|
316 |
|
317 |
+
function classNames () {
|
318 |
+
var classes = [];
|
319 |
|
320 |
+
for (var i = 0; i < arguments.length; i++) {
|
321 |
+
var arg = arguments[i];
|
322 |
+
if (!arg) continue;
|
323 |
|
324 |
+
var argType = typeof arg;
|
325 |
+
|
326 |
+
if (argType === 'string' || argType === 'number') {
|
327 |
+
classes.push(arg);
|
328 |
+
} else if (Array.isArray(arg) && arg.length) {
|
329 |
+
var inner = classNames.apply(null, arg);
|
330 |
+
if (inner) {
|
331 |
+
classes.push(inner);
|
332 |
+
}
|
333 |
+
} else if (argType === 'object') {
|
334 |
+
for (var key in arg) {
|
335 |
+
if (hasOwn.call(arg, key) && arg[key]) {
|
336 |
+
classes.push(key);
|
337 |
+
}
|
338 |
+
}
|
339 |
+
}
|
340 |
+
}
|
341 |
+
|
342 |
+
return classes.join(' ');
|
343 |
+
}
|
344 |
+
|
345 |
+
if ( true && module.exports) {
|
346 |
+
classNames.default = classNames;
|
347 |
+
module.exports = classNames;
|
348 |
+
} else if (typeof define === 'function' && typeof define.amd === 'object' && define.amd) {
|
349 |
+
// register as 'classnames', consistent with npm package name
|
350 |
+
define('classnames', [], function () {
|
351 |
+
return classNames;
|
352 |
+
});
|
353 |
+
} else {
|
354 |
+
window.classNames = classNames;
|
355 |
+
}
|
356 |
+
}());
|
357 |
+
|
358 |
+
|
359 |
+
/***/ }),
|
360 |
+
/* 5 */
|
361 |
+
/***/ (function(module, exports) {
|
362 |
+
|
363 |
+
function _defineProperty(obj, key, value) {
|
364 |
+
if (key in obj) {
|
365 |
+
Object.defineProperty(obj, key, {
|
366 |
+
value: value,
|
367 |
+
enumerable: true,
|
368 |
+
configurable: true,
|
369 |
+
writable: true
|
370 |
+
});
|
371 |
+
} else {
|
372 |
+
obj[key] = value;
|
373 |
}
|
374 |
|
375 |
+
return obj;
|
376 |
}
|
|
|
377 |
|
378 |
+
module.exports = _defineProperty;
|
379 |
+
|
380 |
+
/***/ }),
|
381 |
+
/* 6 */
|
382 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
383 |
+
|
384 |
+
"use strict";
|
385 |
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _defineProperty; });
|
386 |
+
function _defineProperty(obj, key, value) {
|
387 |
+
if (key in obj) {
|
388 |
+
Object.defineProperty(obj, key, {
|
389 |
+
value: value,
|
390 |
+
enumerable: true,
|
391 |
+
configurable: true,
|
392 |
+
writable: true
|
393 |
+
});
|
394 |
} else {
|
395 |
+
obj[key] = value;
|
396 |
+
}
|
|
|
|
|
397 |
|
398 |
+
return obj;
|
399 |
+
}
|
400 |
+
|
401 |
+
/***/ }),
|
402 |
+
/* 7 */
|
403 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
404 |
+
|
405 |
+
"use strict";
|
406 |
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _extends; });
|
407 |
+
function _extends() {
|
408 |
+
_extends = Object.assign || function (target) {
|
409 |
+
for (var i = 1; i < arguments.length; i++) {
|
410 |
+
var source = arguments[i];
|
411 |
+
|
412 |
+
for (var key in source) {
|
413 |
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
414 |
+
target[key] = source[key];
|
415 |
+
}
|
416 |
}
|
417 |
+
}
|
418 |
|
419 |
+
return target;
|
420 |
+
};
|
|
|
421 |
|
422 |
+
return _extends.apply(this, arguments);
|
423 |
}
|
424 |
|
425 |
/***/ }),
|
426 |
+
/* 8 */
|
427 |
+
/***/ (function(module, exports) {
|
428 |
+
|
429 |
+
(function() { module.exports = this["React"]; }());
|
430 |
|
431 |
+
/***/ }),
|
432 |
+
/* 9 */
|
433 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
434 |
|
435 |
"use strict";
|
436 |
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _getPrototypeOf; });
|
437 |
+
function _getPrototypeOf(o) {
|
438 |
+
_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
|
439 |
+
return o.__proto__ || Object.getPrototypeOf(o);
|
|
|
440 |
};
|
441 |
+
return _getPrototypeOf(o);
|
442 |
}
|
443 |
|
444 |
+
/***/ }),
|
445 |
+
/* 10 */
|
446 |
+
/***/ (function(module, exports) {
|
447 |
+
|
448 |
+
function _getPrototypeOf(o) {
|
449 |
+
module.exports = _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
|
450 |
+
return o.__proto__ || Object.getPrototypeOf(o);
|
451 |
+
};
|
452 |
+
return _getPrototypeOf(o);
|
453 |
+
}
|
454 |
|
455 |
+
module.exports = _getPrototypeOf;
|
456 |
|
457 |
/***/ }),
|
458 |
+
/* 11 */
|
|
|
459 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
460 |
|
461 |
"use strict";
|
462 |
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _objectWithoutProperties; });
|
463 |
+
/* harmony import */ var _babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(54);
|
464 |
+
|
465 |
+
function _objectWithoutProperties(source, excluded) {
|
466 |
+
if (source == null) return {};
|
467 |
+
var target = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])(source, excluded);
|
468 |
+
var key, i;
|
469 |
+
|
470 |
+
if (Object.getOwnPropertySymbols) {
|
471 |
+
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
472 |
+
|
473 |
+
for (i = 0; i < sourceSymbolKeys.length; i++) {
|
474 |
+
key = sourceSymbolKeys[i];
|
475 |
+
if (excluded.indexOf(key) >= 0) continue;
|
476 |
+
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
477 |
+
target[key] = source[key];
|
478 |
}
|
479 |
+
}
|
480 |
+
|
481 |
+
return target;
|
482 |
}
|
483 |
|
484 |
+
/***/ }),
|
485 |
+
/* 12 */
|
486 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
487 |
|
488 |
+
"use strict";
|
489 |
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _assertThisInitialized; });
|
490 |
+
function _assertThisInitialized(self) {
|
491 |
+
if (self === void 0) {
|
492 |
+
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
493 |
+
}
|
494 |
|
495 |
+
return self;
|
496 |
+
}
|
497 |
|
498 |
+
/***/ }),
|
499 |
+
/* 13 */
|
500 |
/***/ (function(module, exports) {
|
501 |
|
502 |
function _assertThisInitialized(self) {
|
510 |
module.exports = _assertThisInitialized;
|
511 |
|
512 |
/***/ }),
|
513 |
+
/* 14 */
|
514 |
+
/***/ (function(module, exports, __webpack_require__) {
|
515 |
|
516 |
+
module.exports = __webpack_require__(119);
|
|
|
517 |
|
|
|
|
|
|
|
|
|
|
|
518 |
|
519 |
+
/***/ }),
|
520 |
+
/* 15 */
|
521 |
+
/***/ (function(module, exports) {
|
522 |
|
523 |
+
function _defineProperties(target, props) {
|
524 |
+
for (var i = 0; i < props.length; i++) {
|
525 |
+
var descriptor = props[i];
|
526 |
+
descriptor.enumerable = descriptor.enumerable || false;
|
527 |
+
descriptor.configurable = true;
|
528 |
+
if ("value" in descriptor) descriptor.writable = true;
|
529 |
+
Object.defineProperty(target, descriptor.key, descriptor);
|
530 |
+
}
|
531 |
+
}
|
532 |
|
533 |
+
function _createClass(Constructor, protoProps, staticProps) {
|
534 |
+
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
535 |
+
if (staticProps) _defineProperties(Constructor, staticProps);
|
536 |
+
return Constructor;
|
537 |
+
}
|
|
|
538 |
|
539 |
+
module.exports = _createClass;
|
|
|
|
|
|
|
|
|
540 |
|
541 |
+
/***/ }),
|
542 |
+
/* 16 */
|
543 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
|
544 |
|
545 |
+
"use strict";
|
546 |
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _classCallCheck; });
|
547 |
+
function _classCallCheck(instance, Constructor) {
|
548 |
+
if (!(instance instanceof Constructor)) {
|
549 |
+
throw new TypeError("Cannot call a class as a function");
|
550 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
551 |
}
|
|
|
552 |
|
553 |
/***/ }),
|
554 |
+
/* 17 */
|
555 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
556 |
+
|
557 |
+
"use strict";
|
558 |
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _createClass; });
|
559 |
+
function _defineProperties(target, props) {
|
560 |
+
for (var i = 0; i < props.length; i++) {
|
561 |
+
var descriptor = props[i];
|
562 |
+
descriptor.enumerable = descriptor.enumerable || false;
|
563 |
+
descriptor.configurable = true;
|
564 |
+
if ("value" in descriptor) descriptor.writable = true;
|
565 |
+
Object.defineProperty(target, descriptor.key, descriptor);
|
566 |
+
}
|
567 |
+
}
|
568 |
+
|
569 |
+
function _createClass(Constructor, protoProps, staticProps) {
|
570 |
+
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
571 |
+
if (staticProps) _defineProperties(Constructor, staticProps);
|
572 |
+
return Constructor;
|
573 |
+
}
|
574 |
|
575 |
+
/***/ }),
|
576 |
+
/* 18 */
|
577 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
578 |
|
579 |
"use strict";
|
580 |
|
581 |
// EXPORTS
|
582 |
+
__webpack_require__.d(__webpack_exports__, "a", function() { return /* binding */ _inherits; });
|
|
|
583 |
|
584 |
+
// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js
|
585 |
+
function _setPrototypeOf(o, p) {
|
586 |
+
_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
|
587 |
+
o.__proto__ = p;
|
588 |
+
return o;
|
589 |
+
};
|
590 |
|
591 |
+
return _setPrototypeOf(o, p);
|
592 |
+
}
|
593 |
+
// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/inherits.js
|
594 |
|
595 |
+
function _inherits(subClass, superClass) {
|
596 |
+
if (typeof superClass !== "function" && superClass !== null) {
|
597 |
+
throw new TypeError("Super expression must either be null or a function");
|
598 |
+
}
|
599 |
|
600 |
+
subClass.prototype = Object.create(superClass && superClass.prototype, {
|
601 |
+
constructor: {
|
602 |
+
value: subClass,
|
603 |
+
writable: true,
|
604 |
+
configurable: true
|
605 |
+
}
|
606 |
+
});
|
607 |
+
if (superClass) _setPrototypeOf(subClass, superClass);
|
608 |
+
}
|
609 |
|
610 |
+
/***/ }),
|
611 |
+
/* 19 */
|
612 |
+
/***/ (function(module, exports) {
|
613 |
|
614 |
+
(function() { module.exports = this["moment"]; }());
|
|
|
615 |
|
616 |
+
/***/ }),
|
617 |
+
/* 20 */
|
618 |
+
/***/ (function(module, exports) {
|
619 |
|
620 |
+
function _classCallCheck(instance, Constructor) {
|
621 |
+
if (!(instance instanceof Constructor)) {
|
622 |
+
throw new TypeError("Cannot call a class as a function");
|
623 |
+
}
|
624 |
+
}
|
625 |
|
626 |
+
module.exports = _classCallCheck;
|
|
|
627 |
|
628 |
+
/***/ }),
|
629 |
+
/* 21 */
|
630 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
631 |
|
632 |
+
"use strict";
|
633 |
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _possibleConstructorReturn; });
|
634 |
+
/* harmony import */ var _babel_runtime_helpers_esm_typeof__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(41);
|
635 |
+
/* harmony import */ var _babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(12);
|
636 |
|
|
|
|
|
637 |
|
638 |
+
function _possibleConstructorReturn(self, call) {
|
639 |
+
if (call && (Object(_babel_runtime_helpers_esm_typeof__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])(call) === "object" || typeof call === "function")) {
|
640 |
+
return call;
|
641 |
+
}
|
642 |
|
643 |
+
return Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"])(self);
|
644 |
+
}
|
645 |
|
646 |
+
/***/ }),
|
647 |
+
/* 22 */
|
648 |
+
/***/ (function(module, exports, __webpack_require__) {
|
649 |
|
650 |
+
var setPrototypeOf = __webpack_require__(135);
|
651 |
|
652 |
+
function _inherits(subClass, superClass) {
|
653 |
+
if (typeof superClass !== "function" && superClass !== null) {
|
654 |
+
throw new TypeError("Super expression must either be null or a function");
|
655 |
+
}
|
656 |
|
657 |
+
subClass.prototype = Object.create(superClass && superClass.prototype, {
|
658 |
+
constructor: {
|
659 |
+
value: subClass,
|
660 |
+
writable: true,
|
661 |
+
configurable: true
|
662 |
+
}
|
663 |
+
});
|
664 |
+
if (superClass) setPrototypeOf(subClass, superClass);
|
665 |
+
}
|
666 |
|
667 |
+
module.exports = _inherits;
|
668 |
|
669 |
+
/***/ }),
|
670 |
+
/* 23 */
|
671 |
+
/***/ (function(module, exports, __webpack_require__) {
|
672 |
|
673 |
+
var _typeof = __webpack_require__(52);
|
674 |
|
675 |
+
var assertThisInitialized = __webpack_require__(13);
|
676 |
|
677 |
+
function _possibleConstructorReturn(self, call) {
|
678 |
+
if (call && (_typeof(call) === "object" || typeof call === "function")) {
|
679 |
+
return call;
|
680 |
+
}
|
681 |
|
682 |
+
return assertThisInitialized(self);
|
683 |
+
}
|
684 |
|
685 |
+
module.exports = _possibleConstructorReturn;
|
686 |
|
687 |
+
/***/ }),
|
688 |
+
/* 24 */
|
689 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
690 |
|
691 |
+
"use strict";
|
|
|
|
|
692 |
|
693 |
+
// EXPORTS
|
694 |
+
__webpack_require__.d(__webpack_exports__, "a", function() { return /* binding */ _slicedToArray; });
|
695 |
|
696 |
+
// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js
|
697 |
+
function _arrayWithHoles(arr) {
|
698 |
+
if (Array.isArray(arr)) return arr;
|
699 |
+
}
|
700 |
+
// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js
|
701 |
+
function _iterableToArrayLimit(arr, i) {
|
702 |
+
if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return;
|
703 |
+
var _arr = [];
|
704 |
+
var _n = true;
|
705 |
+
var _d = false;
|
706 |
+
var _e = undefined;
|
707 |
|
708 |
+
try {
|
709 |
+
for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
|
710 |
+
_arr.push(_s.value);
|
711 |
|
712 |
+
if (i && _arr.length === i) break;
|
713 |
+
}
|
714 |
+
} catch (err) {
|
715 |
+
_d = true;
|
716 |
+
_e = err;
|
717 |
+
} finally {
|
718 |
+
try {
|
719 |
+
if (!_n && _i["return"] != null) _i["return"]();
|
720 |
+
} finally {
|
721 |
+
if (_d) throw _e;
|
722 |
+
}
|
723 |
+
}
|
724 |
|
725 |
+
return _arr;
|
726 |
+
}
|
727 |
+
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js
|
728 |
+
var unsupportedIterableToArray = __webpack_require__(59);
|
729 |
|
730 |
+
// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/nonIterableRest.js
|
731 |
+
function _nonIterableRest() {
|
732 |
+
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
733 |
+
}
|
734 |
+
// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/slicedToArray.js
|
735 |
|
|
|
|
|
736 |
|
|
|
737 |
|
|
|
|
|
|
|
|
|
|
|
738 |
|
739 |
+
function _slicedToArray(arr, i) {
|
740 |
+
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || Object(unsupportedIterableToArray["a" /* default */])(arr, i) || _nonIterableRest();
|
741 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
742 |
|
743 |
+
/***/ }),
|
744 |
+
/* 25 */
|
745 |
+
/***/ (function(module, exports) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
746 |
|
747 |
+
(function() { module.exports = this["wp"]["data"]; }());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
748 |
|
749 |
+
/***/ }),
|
750 |
+
/* 26 */
|
751 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
752 |
|
753 |
+
"use strict";
|
|
|
|
|
754 |
|
755 |
+
// EXPORTS
|
756 |
+
__webpack_require__.d(__webpack_exports__, "a", function() { return /* binding */ _toConsumableArray; });
|
757 |
|
758 |
+
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js
|
759 |
+
var arrayLikeToArray = __webpack_require__(49);
|
760 |
|
761 |
+
// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.js
|
|
|
|
|
762 |
|
763 |
+
function _arrayWithoutHoles(arr) {
|
764 |
+
if (Array.isArray(arr)) return Object(arrayLikeToArray["a" /* default */])(arr);
|
765 |
+
}
|
766 |
+
// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/iterableToArray.js
|
767 |
+
function _iterableToArray(iter) {
|
768 |
+
if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter);
|
769 |
+
}
|
770 |
+
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js
|
771 |
+
var unsupportedIterableToArray = __webpack_require__(59);
|
772 |
|
773 |
+
// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/nonIterableSpread.js
|
774 |
+
function _nonIterableSpread() {
|
775 |
+
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
776 |
+
}
|
777 |
+
// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js
|
778 |
|
|
|
|
|
|
|
779 |
|
780 |
|
|
|
781 |
|
782 |
+
function _toConsumableArray(arr) {
|
783 |
+
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || Object(unsupportedIterableToArray["a" /* default */])(arr) || _nonIterableSpread();
|
784 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
785 |
|
786 |
+
/***/ }),
|
787 |
+
/* 27 */
|
788 |
+
/***/ (function(module, exports) {
|
789 |
|
790 |
+
(function() { module.exports = this["wp"]["dataControls"]; }());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
791 |
|
792 |
+
/***/ }),
|
793 |
+
/* 28 */
|
794 |
+
/***/ (function(module, exports, __webpack_require__) {
|
|
|
|
|
|
|
|
|
|
|
|
|
795 |
|
796 |
+
var arrayWithoutHoles = __webpack_require__(97);
|
|
|
|
|
|
|
797 |
|
798 |
+
var iterableToArray = __webpack_require__(98);
|
|
|
|
|
799 |
|
800 |
+
var unsupportedIterableToArray = __webpack_require__(70);
|
801 |
|
802 |
+
var nonIterableSpread = __webpack_require__(99);
|
|
|
|
|
803 |
|
804 |
+
function _toConsumableArray(arr) {
|
805 |
+
return arrayWithoutHoles(arr) || iterableToArray(arr) || unsupportedIterableToArray(arr) || nonIterableSpread();
|
806 |
}
|
807 |
|
808 |
+
module.exports = _toConsumableArray;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
809 |
|
810 |
+
/***/ }),
|
811 |
+
/* 29 */
|
812 |
+
/***/ (function(module, exports) {
|
813 |
|
814 |
+
(function() { module.exports = this["wc"]["navigation"]; }());
|
815 |
|
816 |
+
/***/ }),
|
817 |
+
/* 30 */
|
818 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
819 |
|
820 |
+
"use strict";
|
821 |
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return rgba; });
|
822 |
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return color; });
|
823 |
+
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2);
|
824 |
+
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_0__);
|
825 |
+
/* harmony import */ var tinycolor2__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(106);
|
826 |
+
/* harmony import */ var tinycolor2__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(tinycolor2__WEBPACK_IMPORTED_MODULE_1__);
|
827 |
+
/* harmony import */ var _colors_values__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(86);
|
828 |
/**
|
829 |
+
* External dependencies
|
830 |
*/
|
831 |
|
832 |
+
|
833 |
/**
|
834 |
* Internal dependencies
|
835 |
*/
|
836 |
|
837 |
|
838 |
+
/**
|
839 |
+
* Generating a CSS complient rgba() color value.
|
840 |
+
*
|
841 |
+
* @param {string} hexValue The hex value to convert to rgba().
|
842 |
+
* @param {number} alpha The alpha value for opacity.
|
843 |
+
* @return {string} The converted rgba() color value.
|
844 |
+
*
|
845 |
+
* @example
|
846 |
+
* rgba( '#000000', 0.5 )
|
847 |
+
* // rgba(0, 0, 0, 0.5)
|
848 |
+
*/
|
849 |
|
850 |
+
function rgba() {
|
851 |
+
var hexValue = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
852 |
+
var alpha = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
853 |
|
854 |
+
var _tinycolor$toRgb = tinycolor2__WEBPACK_IMPORTED_MODULE_1___default()(hexValue).toRgb(),
|
855 |
+
r = _tinycolor$toRgb.r,
|
856 |
+
g = _tinycolor$toRgb.g,
|
857 |
+
b = _tinycolor$toRgb.b;
|
858 |
+
|
859 |
+
return "rgba(".concat(r, ", ").concat(g, ", ").concat(b, ", ").concat(alpha, ")");
|
860 |
}
|
861 |
+
/**
|
862 |
+
* Retrieves a color from the color palette.
|
863 |
+
*
|
864 |
+
* @param {string} value The value to retrieve.
|
865 |
+
* @return {string} The color (or fallback, if not found).
|
866 |
+
*
|
867 |
+
* @example
|
868 |
+
* color( 'blue.wordpress.700' )
|
869 |
+
* // #00669b
|
870 |
+
*/
|
871 |
|
872 |
+
function color(value) {
|
873 |
+
var fallbackColor = '#000';
|
874 |
+
return Object(lodash__WEBPACK_IMPORTED_MODULE_0__["get"])(_colors_values__WEBPACK_IMPORTED_MODULE_2__[/* COLORS */ "a"], value, fallbackColor);
|
875 |
+
}
|
876 |
+
//# sourceMappingURL=colors.js.map
|
877 |
|
878 |
+
/***/ }),
|
879 |
+
/* 31 */
|
880 |
+
/***/ (function(module, exports, __webpack_require__) {
|
881 |
|
882 |
+
var arrayWithHoles = __webpack_require__(100);
|
883 |
|
884 |
+
var iterableToArrayLimit = __webpack_require__(101);
|
|
|
|
|
885 |
|
886 |
+
var unsupportedIterableToArray = __webpack_require__(70);
|
|
|
|
|
887 |
|
888 |
+
var nonIterableRest = __webpack_require__(102);
|
889 |
|
890 |
+
function _slicedToArray(arr, i) {
|
891 |
+
return arrayWithHoles(arr) || iterableToArrayLimit(arr, i) || unsupportedIterableToArray(arr, i) || nonIterableRest();
|
892 |
+
}
|
893 |
|
894 |
+
module.exports = _slicedToArray;
|
|
|
|
|
|
|
895 |
|
896 |
+
/***/ }),
|
897 |
+
/* 32 */
|
898 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
|
899 |
|
900 |
+
"use strict";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
901 |
|
902 |
+
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/defineProperty.js
|
903 |
+
var defineProperty = __webpack_require__(5);
|
904 |
+
var defineProperty_default = /*#__PURE__*/__webpack_require__.n(defineProperty);
|
905 |
|
906 |
+
// EXTERNAL MODULE: external "React"
|
907 |
+
var external_React_ = __webpack_require__(8);
|
|
|
908 |
|
909 |
+
// EXTERNAL MODULE: ./node_modules/@emotion/memoize/dist/memoize.browser.esm.js
|
910 |
+
var memoize_browser_esm = __webpack_require__(73);
|
|
|
|
|
911 |
|
912 |
+
// CONCATENATED MODULE: ./node_modules/@emotion/is-prop-valid/dist/is-prop-valid.browser.esm.js
|
913 |
|
914 |
|
915 |
+
var reactPropsRegex = /^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|inert|itemProp|itemScope|itemType|itemID|itemRef|on|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/; // https://esbench.com/bench/5bfee68a4cd7e6009ef61d23
|
916 |
|
917 |
+
var index = Object(memoize_browser_esm["a" /* default */])(function (prop) {
|
918 |
+
return reactPropsRegex.test(prop) || prop.charCodeAt(0) === 111
|
919 |
+
/* o */
|
920 |
+
&& prop.charCodeAt(1) === 110
|
921 |
+
/* n */
|
922 |
+
&& prop.charCodeAt(2) < 91;
|
923 |
+
}
|
924 |
+
/* Z+1 */
|
925 |
+
);
|
926 |
|
927 |
+
/* harmony default export */ var is_prop_valid_browser_esm = (index);
|
928 |
|
929 |
+
// EXTERNAL MODULE: ./node_modules/@emotion/core/dist/core.browser.esm.js + 6 modules
|
930 |
+
var core_browser_esm = __webpack_require__(48);
|
931 |
|
932 |
+
// EXTERNAL MODULE: ./node_modules/@emotion/utils/dist/utils.browser.esm.js
|
933 |
+
var utils_browser_esm = __webpack_require__(38);
|
934 |
|
935 |
+
// EXTERNAL MODULE: ./node_modules/@emotion/serialize/dist/serialize.browser.esm.js + 2 modules
|
936 |
+
var serialize_browser_esm = __webpack_require__(37);
|
937 |
|
938 |
+
// CONCATENATED MODULE: ./node_modules/@emotion/styled-base/dist/styled-base.browser.esm.js
|
939 |
|
|
|
|
|
|
|
940 |
|
|
|
|
|
|
|
941 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
942 |
|
|
|
943 |
|
|
|
|
|
|
|
|
|
|
|
944 |
|
|
|
|
|
|
|
|
|
|
|
|
|
945 |
|
946 |
+
var testOmitPropsOnStringTag = is_prop_valid_browser_esm;
|
947 |
|
948 |
+
var testOmitPropsOnComponent = function testOmitPropsOnComponent(key) {
|
949 |
+
return key !== 'theme' && key !== 'innerRef';
|
950 |
+
};
|
951 |
|
952 |
+
var getDefaultShouldForwardProp = function getDefaultShouldForwardProp(tag) {
|
953 |
+
return typeof tag === 'string' && // 96 is one less than the char code
|
954 |
+
// for "a" so this is checking that
|
955 |
+
// it's a lowercase character
|
956 |
+
tag.charCodeAt(0) > 96 ? testOmitPropsOnStringTag : testOmitPropsOnComponent;
|
957 |
+
};
|
958 |
|
959 |
+
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; }
|
960 |
|
961 |
+
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_default()(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; }
|
962 |
+
var ILLEGAL_ESCAPE_SEQUENCE_ERROR = "You have illegal escape sequence in your template literal, most likely inside content's property value.\nBecause you write your CSS inside a JavaScript string you actually have to do double escaping, so for example \"content: '\\00d7';\" should become \"content: '\\\\00d7';\".\nYou can read more about this here:\nhttps://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals#ES2018_revision_of_illegal_escape_sequences";
|
963 |
|
964 |
+
var styled_base_browser_esm_createStyled = function createStyled(tag, options) {
|
965 |
+
if (false) {}
|
966 |
|
967 |
+
var identifierName;
|
968 |
+
var shouldForwardProp;
|
969 |
+
var targetClassName;
|
970 |
|
971 |
+
if (options !== undefined) {
|
972 |
+
identifierName = options.label;
|
973 |
+
targetClassName = options.target;
|
974 |
+
shouldForwardProp = tag.__emotion_forwardProp && options.shouldForwardProp ? function (propName) {
|
975 |
+
return tag.__emotion_forwardProp(propName) && // $FlowFixMe
|
976 |
+
options.shouldForwardProp(propName);
|
977 |
+
} : options.shouldForwardProp;
|
978 |
+
}
|
979 |
|
980 |
+
var isReal = tag.__emotion_real === tag;
|
981 |
+
var baseTag = isReal && tag.__emotion_base || tag;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
982 |
|
983 |
+
if (typeof shouldForwardProp !== 'function' && isReal) {
|
984 |
+
shouldForwardProp = tag.__emotion_forwardProp;
|
985 |
+
}
|
986 |
|
987 |
+
var defaultShouldForwardProp = shouldForwardProp || getDefaultShouldForwardProp(baseTag);
|
988 |
+
var shouldUseAs = !defaultShouldForwardProp('as');
|
989 |
+
return function () {
|
990 |
+
var args = arguments;
|
991 |
+
var styles = isReal && tag.__emotion_styles !== undefined ? tag.__emotion_styles.slice(0) : [];
|
992 |
|
993 |
+
if (identifierName !== undefined) {
|
994 |
+
styles.push("label:" + identifierName + ";");
|
995 |
+
}
|
996 |
|
997 |
+
if (args[0] == null || args[0].raw === undefined) {
|
998 |
+
styles.push.apply(styles, args);
|
999 |
+
} else {
|
1000 |
+
if (false) {}
|
1001 |
|
1002 |
+
styles.push(args[0][0]);
|
1003 |
+
var len = args.length;
|
1004 |
+
var i = 1;
|
1005 |
|
1006 |
+
for (; i < len; i++) {
|
1007 |
+
if (false) {}
|
1008 |
|
1009 |
+
styles.push(args[i], args[0][i]);
|
1010 |
+
}
|
1011 |
+
} // $FlowFixMe: we need to cast StatelessFunctionalComponent to our PrivateStyledComponent class
|
1012 |
|
|
|
|
|
|
|
|
|
|
|
|
|
1013 |
|
1014 |
+
var Styled = Object(core_browser_esm["c" /* withEmotionCache */])(function (props, context, ref) {
|
1015 |
+
return Object(external_React_["createElement"])(core_browser_esm["a" /* ThemeContext */].Consumer, null, function (theme) {
|
1016 |
+
var finalTag = shouldUseAs && props.as || baseTag;
|
1017 |
+
var className = '';
|
1018 |
+
var classInterpolations = [];
|
1019 |
+
var mergedProps = props;
|
1020 |
|
1021 |
+
if (props.theme == null) {
|
1022 |
+
mergedProps = {};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1023 |
|
1024 |
+
for (var key in props) {
|
1025 |
+
mergedProps[key] = props[key];
|
1026 |
+
}
|
1027 |
|
1028 |
+
mergedProps.theme = theme;
|
1029 |
+
}
|
1030 |
|
1031 |
+
if (typeof props.className === 'string') {
|
1032 |
+
className = Object(utils_browser_esm["a" /* getRegisteredStyles */])(context.registered, classInterpolations, props.className);
|
1033 |
+
} else if (props.className != null) {
|
1034 |
+
className = props.className + " ";
|
1035 |
+
}
|
1036 |
|
1037 |
+
var serialized = Object(serialize_browser_esm["a" /* serializeStyles */])(styles.concat(classInterpolations), context.registered, mergedProps);
|
1038 |
+
var rules = Object(utils_browser_esm["b" /* insertStyles */])(context, serialized, typeof finalTag === 'string');
|
1039 |
+
className += context.key + "-" + serialized.name;
|
1040 |
|
1041 |
+
if (targetClassName !== undefined) {
|
1042 |
+
className += " " + targetClassName;
|
1043 |
+
}
|
1044 |
|
1045 |
+
var finalShouldForwardProp = shouldUseAs && shouldForwardProp === undefined ? getDefaultShouldForwardProp(finalTag) : defaultShouldForwardProp;
|
1046 |
+
var newProps = {};
|
1047 |
|
1048 |
+
for (var _key in props) {
|
1049 |
+
if (shouldUseAs && _key === 'as') continue;
|
1050 |
|
1051 |
+
if ( // $FlowFixMe
|
1052 |
+
finalShouldForwardProp(_key)) {
|
1053 |
+
newProps[_key] = props[_key];
|
1054 |
+
}
|
1055 |
+
}
|
1056 |
|
1057 |
+
newProps.className = className;
|
1058 |
+
newProps.ref = ref || props.innerRef;
|
|
|
1059 |
|
1060 |
+
if (false) {}
|
|
|
|
|
|
|
1061 |
|
1062 |
+
var ele = Object(external_React_["createElement"])(finalTag, newProps);
|
|
|
1063 |
|
1064 |
+
return ele;
|
1065 |
+
});
|
1066 |
+
});
|
1067 |
+
Styled.displayName = identifierName !== undefined ? identifierName : "Styled(" + (typeof baseTag === 'string' ? baseTag : baseTag.displayName || baseTag.name || 'Component') + ")";
|
1068 |
+
Styled.defaultProps = tag.defaultProps;
|
1069 |
+
Styled.__emotion_real = Styled;
|
1070 |
+
Styled.__emotion_base = baseTag;
|
1071 |
+
Styled.__emotion_styles = styles;
|
1072 |
+
Styled.__emotion_forwardProp = shouldForwardProp;
|
1073 |
+
Object.defineProperty(Styled, 'toString', {
|
1074 |
+
value: function value() {
|
1075 |
+
if (targetClassName === undefined && "production" !== 'production') {
|
1076 |
+
return 'NO_COMPONENT_SELECTOR';
|
1077 |
+
} // $FlowFixMe: coerce undefined to string
|
1078 |
|
|
|
|
|
1079 |
|
1080 |
+
return "." + targetClassName;
|
1081 |
+
}
|
1082 |
+
});
|
1083 |
|
1084 |
+
Styled.withComponent = function (nextTag, nextOptions) {
|
1085 |
+
return createStyled(nextTag, nextOptions !== undefined ? _objectSpread({}, options || {}, {}, nextOptions) : options).apply(void 0, styles);
|
1086 |
+
};
|
1087 |
|
1088 |
+
return Styled;
|
1089 |
+
};
|
1090 |
+
};
|
1091 |
+
|
1092 |
+
/* harmony default export */ var styled_base_browser_esm = __webpack_exports__["a"] = (styled_base_browser_esm_createStyled);
|
1093 |
|
1094 |
|
1095 |
/***/ }),
|
1096 |
+
/* 33 */
|
1097 |
+
/***/ (function(module, exports) {
|
1098 |
|
1099 |
+
(function() { module.exports = this["wp"]["url"]; }());
|
|
|
1100 |
|
1101 |
+
/***/ }),
|
1102 |
+
/* 34 */
|
1103 |
+
/***/ (function(module, exports) {
|
|
|
|
|
1104 |
|
1105 |
+
(function() { module.exports = this["wc"]["data"]; }());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1106 |
|
1107 |
/***/ }),
|
1108 |
+
/* 35 */
|
|
|
1109 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
1110 |
|
1111 |
"use strict";
|
1112 |
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ADMIN_URL; });
|
1113 |
+
/* unused harmony export COUNTRIES */
|
1114 |
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return CURRENCY; });
|
1115 |
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return LOCALE; });
|
1116 |
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return ORDER_STATUSES; });
|
1117 |
+
/* unused harmony export SITE_TITLE */
|
1118 |
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return WC_ASSET_URL; });
|
1119 |
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "g", function() { return getSetting; });
|
1120 |
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "h", function() { return setSetting; });
|
1121 |
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return getAdminLink; });
|
1122 |
+
/* harmony import */ var _babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(52);
|
1123 |
+
/* harmony import */ var _babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_0__);
|
1124 |
+
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(3);
|
1125 |
+
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__);
|
1126 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1127 |
|
1128 |
+
/**
|
1129 |
+
* External dependencies
|
1130 |
+
*/
|
1131 |
+
// Remove mutable data from settings object to prevent access. Data stores should be used instead.
|
1132 |
|
1133 |
+
var mutableSources = ['wcAdminSettings', 'preloadSettings'];
|
1134 |
+
var settings = (typeof wcSettings === "undefined" ? "undefined" : _babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_0___default()(wcSettings)) === 'object' ? wcSettings : {};
|
1135 |
+
var SOURCE = Object.keys(settings).reduce(function (source, key) {
|
1136 |
+
if (!mutableSources.includes(key)) {
|
1137 |
+
source[key] = settings[key];
|
1138 |
}
|
1139 |
|
1140 |
+
return source;
|
1141 |
+
}, {});
|
1142 |
+
var ADMIN_URL = SOURCE.adminUrl;
|
1143 |
+
var COUNTRIES = SOURCE.countries;
|
1144 |
+
var CURRENCY = SOURCE.currency;
|
1145 |
+
var LOCALE = SOURCE.locale;
|
1146 |
+
var ORDER_STATUSES = SOURCE.orderStatuses;
|
1147 |
+
var SITE_TITLE = SOURCE.siteTitle;
|
1148 |
+
var WC_ASSET_URL = SOURCE.wcAssetUrl;
|
1149 |
+
/**
|
1150 |
+
* Retrieves a setting value from the setting state.
|
1151 |
+
*
|
1152 |
+
* @param {string} name The identifier for the setting.
|
1153 |
+
* @param {*} [fallback=false] The value to use as a fallback
|
1154 |
+
* if the setting is not in the
|
1155 |
+
* state.
|
1156 |
+
* @param {Function} [filter=( val ) => val] A callback for filtering the
|
1157 |
+
* value before it's returned.
|
1158 |
+
* Receives both the found value
|
1159 |
+
* (if it exists for the key) and
|
1160 |
+
* the provided fallback arg.
|
1161 |
+
*
|
1162 |
+
* @return {*} The value present in the settings state for the given
|
1163 |
+
* name.
|
1164 |
+
*/
|
1165 |
|
1166 |
+
function getSetting(name) {
|
1167 |
+
var fallback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
1168 |
+
var filter = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : function (val) {
|
1169 |
+
return val;
|
1170 |
+
};
|
1171 |
|
1172 |
+
if (mutableSources.includes(name)) {
|
1173 |
+
throw new Error(Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__["__"])('Mutable settings should be accessed via data store.'));
|
|
|
|
|
|
|
|
|
|
|
1174 |
}
|
1175 |
|
1176 |
+
var value = SOURCE.hasOwnProperty(name) ? SOURCE[name] : fallback;
|
1177 |
+
return filter(value, fallback);
|
1178 |
+
}
|
1179 |
+
/**
|
1180 |
+
* Sets a value to a property on the settings state.
|
1181 |
+
*
|
1182 |
+
* NOTE: This feature is to be removed in favour of data stores when a full migration
|
1183 |
+
* is complete.
|
1184 |
+
*
|
1185 |
+
* @deprecated
|
1186 |
+
*
|
1187 |
+
* @param {string} name The setting property key for the
|
1188 |
+
* setting being mutated.
|
1189 |
+
* @param {*} value The value to set.
|
1190 |
+
* @param {Function} [filter=( val ) => val] Allows for providing a callback
|
1191 |
+
* to sanitize the setting (eg.
|
1192 |
+
* ensure it's a number)
|
1193 |
+
*/
|
1194 |
|
1195 |
+
function setSetting(name, value) {
|
1196 |
+
var filter = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : function (val) {
|
1197 |
+
return val;
|
1198 |
+
};
|
1199 |
|
1200 |
+
if (mutableSources.includes(name)) {
|
1201 |
+
throw new Error(Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__["__"])('Mutable settings should be mutated via data store.'));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1202 |
}
|
1203 |
|
1204 |
+
SOURCE[name] = filter(value);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1205 |
}
|
1206 |
+
/**
|
1207 |
+
* Returns a string with the site's wp-admin URL appended. JS version of `admin_url`.
|
1208 |
+
*
|
1209 |
+
* @param {string} path Relative path.
|
1210 |
+
* @return {string} Full admin URL.
|
1211 |
+
*/
|
1212 |
|
1213 |
+
function getAdminLink(path) {
|
1214 |
+
return (ADMIN_URL || '') + path;
|
|
|
|
|
|
|
1215 |
}
|
1216 |
|
1217 |
+
/***/ }),
|
1218 |
+
/* 36 */
|
1219 |
+
/***/ (function(module, exports) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1220 |
|
1221 |
+
function _extends() {
|
1222 |
+
module.exports = _extends = Object.assign || function (target) {
|
1223 |
+
for (var i = 1; i < arguments.length; i++) {
|
1224 |
+
var source = arguments[i];
|
1225 |
|
1226 |
+
for (var key in source) {
|
1227 |
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
1228 |
+
target[key] = source[key];
|
1229 |
+
}
|
1230 |
+
}
|
1231 |
+
}
|
1232 |
|
1233 |
+
return target;
|
1234 |
+
};
|
|
|
|
|
1235 |
|
1236 |
+
return _extends.apply(this, arguments);
|
1237 |
}
|
1238 |
|
1239 |
+
module.exports = _extends;
|
|
|
|
|
|
|
|
|
|
|
1240 |
|
1241 |
+
/***/ }),
|
1242 |
+
/* 37 */
|
1243 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
1244 |
|
1245 |
+
"use strict";
|
1246 |
|
1247 |
+
// EXPORTS
|
1248 |
+
__webpack_require__.d(__webpack_exports__, "a", function() { return /* binding */ serialize_browser_esm_serializeStyles; });
|
1249 |
|
1250 |
+
// CONCATENATED MODULE: ./node_modules/@emotion/hash/dist/hash.browser.esm.js
|
1251 |
+
/* eslint-disable */
|
1252 |
+
// Inspired by https://github.com/garycourt/murmurhash-js
|
1253 |
+
// Ported from https://github.com/aappleby/smhasher/blob/61a0530f28277f2e850bfc39600ce61d02b518de/src/MurmurHash2.cpp#L37-L86
|
1254 |
+
function murmur2(str) {
|
1255 |
+
// 'm' and 'r' are mixing constants generated offline.
|
1256 |
+
// They're not really 'magic', they just happen to work well.
|
1257 |
+
// const m = 0x5bd1e995;
|
1258 |
+
// const r = 24;
|
1259 |
+
// Initialize the hash
|
1260 |
+
var h = 0; // Mix 4 bytes at a time into the hash
|
1261 |
|
1262 |
+
var k,
|
1263 |
+
i = 0,
|
1264 |
+
len = str.length;
|
1265 |
|
1266 |
+
for (; len >= 4; ++i, len -= 4) {
|
1267 |
+
k = str.charCodeAt(i) & 0xff | (str.charCodeAt(++i) & 0xff) << 8 | (str.charCodeAt(++i) & 0xff) << 16 | (str.charCodeAt(++i) & 0xff) << 24;
|
1268 |
+
k =
|
1269 |
+
/* Math.imul(k, m): */
|
1270 |
+
(k & 0xffff) * 0x5bd1e995 + ((k >>> 16) * 0xe995 << 16);
|
1271 |
+
k ^=
|
1272 |
+
/* k >>> r: */
|
1273 |
+
k >>> 24;
|
1274 |
+
h =
|
1275 |
+
/* Math.imul(k, m): */
|
1276 |
+
(k & 0xffff) * 0x5bd1e995 + ((k >>> 16) * 0xe995 << 16) ^
|
1277 |
+
/* Math.imul(h, m): */
|
1278 |
+
(h & 0xffff) * 0x5bd1e995 + ((h >>> 16) * 0xe995 << 16);
|
1279 |
+
} // Handle the last few bytes of the input array
|
|
|
|
|
|
|
|
|
|
|
|
|
1280 |
|
|
|
|
|
|
|
|
|
1281 |
|
1282 |
+
switch (len) {
|
1283 |
+
case 3:
|
1284 |
+
h ^= (str.charCodeAt(i + 2) & 0xff) << 16;
|
1285 |
|
1286 |
+
case 2:
|
1287 |
+
h ^= (str.charCodeAt(i + 1) & 0xff) << 8;
|
|
|
|
|
1288 |
|
1289 |
+
case 1:
|
1290 |
+
h ^= str.charCodeAt(i) & 0xff;
|
1291 |
+
h =
|
1292 |
+
/* Math.imul(h, m): */
|
1293 |
+
(h & 0xffff) * 0x5bd1e995 + ((h >>> 16) * 0xe995 << 16);
|
1294 |
+
} // Do a few final mixes of the hash to ensure the last few
|
1295 |
+
// bytes are well-incorporated.
|
1296 |
+
|
1297 |
+
|
1298 |
+
h ^= h >>> 13;
|
1299 |
+
h =
|
1300 |
+
/* Math.imul(h, m): */
|
1301 |
+
(h & 0xffff) * 0x5bd1e995 + ((h >>> 16) * 0xe995 << 16);
|
1302 |
+
return ((h ^ h >>> 15) >>> 0).toString(36);
|
1303 |
}
|
1304 |
|
1305 |
+
/* harmony default export */ var hash_browser_esm = (murmur2);
|
|
|
1306 |
|
1307 |
+
// CONCATENATED MODULE: ./node_modules/@emotion/unitless/dist/unitless.browser.esm.js
|
1308 |
+
var unitlessKeys = {
|
1309 |
+
animationIterationCount: 1,
|
1310 |
+
borderImageOutset: 1,
|
1311 |
+
borderImageSlice: 1,
|
1312 |
+
borderImageWidth: 1,
|
1313 |
+
boxFlex: 1,
|
1314 |
+
boxFlexGroup: 1,
|
1315 |
+
boxOrdinalGroup: 1,
|
1316 |
+
columnCount: 1,
|
1317 |
+
columns: 1,
|
1318 |
+
flex: 1,
|
1319 |
+
flexGrow: 1,
|
1320 |
+
flexPositive: 1,
|
1321 |
+
flexShrink: 1,
|
1322 |
+
flexNegative: 1,
|
1323 |
+
flexOrder: 1,
|
1324 |
+
gridRow: 1,
|
1325 |
+
gridRowEnd: 1,
|
1326 |
+
gridRowSpan: 1,
|
1327 |
+
gridRowStart: 1,
|
1328 |
+
gridColumn: 1,
|
1329 |
+
gridColumnEnd: 1,
|
1330 |
+
gridColumnSpan: 1,
|
1331 |
+
gridColumnStart: 1,
|
1332 |
+
msGridRow: 1,
|
1333 |
+
msGridRowSpan: 1,
|
1334 |
+
msGridColumn: 1,
|
1335 |
+
msGridColumnSpan: 1,
|
1336 |
+
fontWeight: 1,
|
1337 |
+
lineHeight: 1,
|
1338 |
+
opacity: 1,
|
1339 |
+
order: 1,
|
1340 |
+
orphans: 1,
|
1341 |
+
tabSize: 1,
|
1342 |
+
widows: 1,
|
1343 |
+
zIndex: 1,
|
1344 |
+
zoom: 1,
|
1345 |
+
WebkitLineClamp: 1,
|
1346 |
+
// SVG-related properties
|
1347 |
+
fillOpacity: 1,
|
1348 |
+
floodOpacity: 1,
|
1349 |
+
stopOpacity: 1,
|
1350 |
+
strokeDasharray: 1,
|
1351 |
+
strokeDashoffset: 1,
|
1352 |
+
strokeMiterlimit: 1,
|
1353 |
+
strokeOpacity: 1,
|
1354 |
+
strokeWidth: 1
|
1355 |
+
};
|
1356 |
|
1357 |
+
/* harmony default export */ var unitless_browser_esm = (unitlessKeys);
|
|
|
|
|
|
|
|
|
1358 |
|
1359 |
+
// EXTERNAL MODULE: ./node_modules/@emotion/memoize/dist/memoize.browser.esm.js
|
1360 |
+
var memoize_browser_esm = __webpack_require__(73);
|
|
|
|
|
|
|
1361 |
|
1362 |
+
// CONCATENATED MODULE: ./node_modules/@emotion/serialize/dist/serialize.browser.esm.js
|
|
|
1363 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1364 |
|
|
|
1365 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1366 |
|
1367 |
+
var ILLEGAL_ESCAPE_SEQUENCE_ERROR = "You have illegal escape sequence in your template literal, most likely inside content's property value.\nBecause you write your CSS inside a JavaScript string you actually have to do double escaping, so for example \"content: '\\00d7';\" should become \"content: '\\\\00d7';\".\nYou can read more about this here:\nhttps://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals#ES2018_revision_of_illegal_escape_sequences";
|
1368 |
+
var UNDEFINED_AS_OBJECT_KEY_ERROR = "You have passed in falsy value as style object's key (can happen when in example you pass unexported component as computed key).";
|
1369 |
+
var hyphenateRegex = /[A-Z]|^ms/g;
|
1370 |
+
var animationRegex = /_EMO_([^_]+?)_([^]*?)_EMO_/g;
|
|
|
1371 |
|
1372 |
+
var isCustomProperty = function isCustomProperty(property) {
|
1373 |
+
return property.charCodeAt(1) === 45;
|
1374 |
+
};
|
1375 |
|
1376 |
+
var isProcessableValue = function isProcessableValue(value) {
|
1377 |
+
return value != null && typeof value !== 'boolean';
|
1378 |
+
};
|
|
|
|
|
|
|
|
|
1379 |
|
1380 |
+
var processStyleName = Object(memoize_browser_esm["a" /* default */])(function (styleName) {
|
1381 |
+
return isCustomProperty(styleName) ? styleName : styleName.replace(hyphenateRegex, '-$&').toLowerCase();
|
1382 |
+
});
|
|
|
|
|
|
|
1383 |
|
1384 |
+
var serialize_browser_esm_processStyleValue = function processStyleValue(key, value) {
|
1385 |
+
switch (key) {
|
1386 |
+
case 'animation':
|
1387 |
+
case 'animationName':
|
1388 |
+
{
|
1389 |
+
if (typeof value === 'string') {
|
1390 |
+
return value.replace(animationRegex, function (match, p1, p2) {
|
1391 |
+
cursor = {
|
1392 |
+
name: p1,
|
1393 |
+
styles: p2,
|
1394 |
+
next: cursor
|
1395 |
+
};
|
1396 |
+
return p1;
|
1397 |
+
});
|
1398 |
}
|
|
|
|
|
|
|
1399 |
}
|
|
|
|
|
|
|
1400 |
}
|
1401 |
|
1402 |
+
if (unitless_browser_esm[key] !== 1 && !isCustomProperty(key) && typeof value === 'number' && value !== 0) {
|
1403 |
+
return value + 'px';
|
1404 |
+
}
|
1405 |
|
1406 |
+
return value;
|
1407 |
+
};
|
1408 |
|
1409 |
+
if (false) { var hyphenatedCache, hyphenPattern, msPattern, oldProcessStyleValue, contentValues, contentValuePattern; }
|
|
|
|
|
1410 |
|
1411 |
+
var shouldWarnAboutInterpolatingClassNameFromCss = true;
|
1412 |
+
|
1413 |
+
function handleInterpolation(mergedProps, registered, interpolation, couldBeSelectorInterpolation) {
|
1414 |
+
if (interpolation == null) {
|
1415 |
+
return '';
|
|
|
|
|
1416 |
}
|
1417 |
|
1418 |
+
if (interpolation.__emotion_styles !== undefined) {
|
1419 |
+
if (false) {}
|
|
|
|
|
1420 |
|
1421 |
+
return interpolation;
|
|
|
|
|
1422 |
}
|
1423 |
|
1424 |
+
switch (typeof interpolation) {
|
1425 |
+
case 'boolean':
|
1426 |
+
{
|
1427 |
+
return '';
|
1428 |
+
}
|
|
|
|
|
1429 |
|
1430 |
+
case 'object':
|
1431 |
+
{
|
1432 |
+
if (interpolation.anim === 1) {
|
1433 |
+
cursor = {
|
1434 |
+
name: interpolation.name,
|
1435 |
+
styles: interpolation.styles,
|
1436 |
+
next: cursor
|
1437 |
+
};
|
1438 |
+
return interpolation.name;
|
1439 |
+
}
|
|
|
1440 |
|
1441 |
+
if (interpolation.styles !== undefined) {
|
1442 |
+
var next = interpolation.next;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1443 |
|
1444 |
+
if (next !== undefined) {
|
1445 |
+
// not the most efficient thing ever but this is a pretty rare case
|
1446 |
+
// and there will be very few iterations of this generally
|
1447 |
+
while (next !== undefined) {
|
1448 |
+
cursor = {
|
1449 |
+
name: next.name,
|
1450 |
+
styles: next.styles,
|
1451 |
+
next: cursor
|
1452 |
+
};
|
1453 |
+
next = next.next;
|
1454 |
+
}
|
1455 |
+
}
|
1456 |
|
1457 |
+
var styles = interpolation.styles + ";";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1458 |
|
1459 |
+
if (false) {}
|
|
|
|
|
1460 |
|
1461 |
+
return styles;
|
1462 |
+
}
|
1463 |
|
1464 |
+
return createStringFromObject(mergedProps, registered, interpolation);
|
1465 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1466 |
|
1467 |
+
case 'function':
|
1468 |
+
{
|
1469 |
+
if (mergedProps !== undefined) {
|
1470 |
+
var previousCursor = cursor;
|
1471 |
+
var result = interpolation(mergedProps);
|
1472 |
+
cursor = previousCursor;
|
1473 |
+
return handleInterpolation(mergedProps, registered, result, couldBeSelectorInterpolation);
|
1474 |
+
} else if (false) {}
|
1475 |
|
1476 |
+
break;
|
1477 |
+
}
|
|
|
|
|
1478 |
|
1479 |
+
case 'string':
|
1480 |
+
if (false) { var replaced, matched; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1481 |
|
1482 |
+
break;
|
1483 |
+
} // finalize string values (regular strings and functions interpolated into css calls)
|
|
|
|
|
1484 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1485 |
|
1486 |
+
if (registered == null) {
|
1487 |
+
return interpolation;
|
1488 |
}
|
1489 |
|
1490 |
+
var cached = registered[interpolation];
|
1491 |
|
1492 |
+
if (false) {}
|
|
|
1493 |
|
1494 |
+
return cached !== undefined && !couldBeSelectorInterpolation ? cached : interpolation;
|
1495 |
+
}
|
|
|
1496 |
|
1497 |
+
function createStringFromObject(mergedProps, registered, obj) {
|
1498 |
+
var string = '';
|
|
|
|
|
|
|
1499 |
|
1500 |
+
if (Array.isArray(obj)) {
|
1501 |
+
for (var i = 0; i < obj.length; i++) {
|
1502 |
+
string += handleInterpolation(mergedProps, registered, obj[i], false);
|
1503 |
+
}
|
1504 |
+
} else {
|
1505 |
+
for (var _key in obj) {
|
1506 |
+
var value = obj[_key];
|
1507 |
|
1508 |
+
if (typeof value !== 'object') {
|
1509 |
+
if (registered != null && registered[value] !== undefined) {
|
1510 |
+
string += _key + "{" + registered[value] + "}";
|
1511 |
+
} else if (isProcessableValue(value)) {
|
1512 |
+
string += processStyleName(_key) + ":" + serialize_browser_esm_processStyleValue(_key, value) + ";";
|
1513 |
+
}
|
1514 |
+
} else {
|
1515 |
+
if (_key === 'NO_COMPONENT_SELECTOR' && "production" !== 'production') {
|
1516 |
+
throw new Error('Component selectors can only be used in conjunction with babel-plugin-emotion.');
|
1517 |
+
}
|
1518 |
|
1519 |
+
if (Array.isArray(value) && typeof value[0] === 'string' && (registered == null || registered[value[0]] === undefined)) {
|
1520 |
+
for (var _i = 0; _i < value.length; _i++) {
|
1521 |
+
if (isProcessableValue(value[_i])) {
|
1522 |
+
string += processStyleName(_key) + ":" + serialize_browser_esm_processStyleValue(_key, value[_i]) + ";";
|
1523 |
+
}
|
1524 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
1525 |
} else {
|
1526 |
+
var interpolated = handleInterpolation(mergedProps, registered, value, false);
|
1527 |
+
|
1528 |
+
switch (_key) {
|
1529 |
+
case 'animation':
|
1530 |
+
case 'animationName':
|
1531 |
+
{
|
1532 |
+
string += processStyleName(_key) + ":" + interpolated + ";";
|
1533 |
+
break;
|
1534 |
+
}
|
1535 |
+
|
1536 |
+
default:
|
1537 |
+
{
|
1538 |
+
if (false) {}
|
1539 |
+
|
1540 |
+
string += _key + "{" + interpolated + "}";
|
1541 |
+
}
|
1542 |
+
}
|
1543 |
}
|
1544 |
+
}
|
1545 |
}
|
1546 |
}
|
1547 |
|
1548 |
+
return string;
|
1549 |
+
}
|
|
|
|
|
1550 |
|
1551 |
+
var labelPattern = /label:\s*([^\s;\n{]+)\s*;/g;
|
1552 |
+
var sourceMapPattern;
|
|
|
|
|
|
|
1553 |
|
1554 |
+
if (false) {} // this is the cursor for keyframes
|
1555 |
+
// keyframes are stored on the SerializedStyles object as a linked list
|
|
|
|
|
|
|
1556 |
|
|
|
|
|
1557 |
|
1558 |
+
var cursor;
|
1559 |
+
var serialize_browser_esm_serializeStyles = function serializeStyles(args, registered, mergedProps) {
|
1560 |
+
if (args.length === 1 && typeof args[0] === 'object' && args[0] !== null && args[0].styles !== undefined) {
|
1561 |
+
return args[0];
|
1562 |
}
|
1563 |
|
1564 |
+
var stringMode = true;
|
1565 |
+
var styles = '';
|
1566 |
+
cursor = undefined;
|
1567 |
+
var strings = args[0];
|
|
|
|
|
|
|
|
|
|
|
1568 |
|
1569 |
+
if (strings == null || strings.raw === undefined) {
|
1570 |
+
stringMode = false;
|
1571 |
+
styles += handleInterpolation(mergedProps, registered, strings, false);
|
1572 |
+
} else {
|
1573 |
+
if (false) {}
|
1574 |
|
1575 |
+
styles += strings[0];
|
1576 |
+
} // we start at 1 since we've already handled the first arg
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1577 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1578 |
|
1579 |
+
for (var i = 1; i < args.length; i++) {
|
1580 |
+
styles += handleInterpolation(mergedProps, registered, args[i], styles.charCodeAt(styles.length - 1) === 46);
|
|
|
|
|
|
|
1581 |
|
1582 |
+
if (stringMode) {
|
1583 |
+
if (false) {}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1584 |
|
1585 |
+
styles += strings[i];
|
1586 |
+
}
|
1587 |
}
|
1588 |
|
1589 |
+
var sourceMap;
|
|
|
|
|
1590 |
|
1591 |
+
if (false) {} // using a global regex with .exec is stateful so lastIndex has to be reset each time
|
|
|
|
|
1592 |
|
|
|
1593 |
|
1594 |
+
labelPattern.lastIndex = 0;
|
1595 |
+
var identifierName = '';
|
1596 |
+
var match; // https://esbench.com/bench/5b809c2cf2949800a0f61fb5
|
1597 |
|
1598 |
+
while ((match = labelPattern.exec(styles)) !== null) {
|
1599 |
+
identifierName += '-' + // $FlowFixMe we know it's not null
|
1600 |
+
match[1];
|
|
|
|
|
|
|
|
|
1601 |
}
|
1602 |
|
1603 |
+
var name = hash_browser_esm(styles) + identifierName;
|
|
|
|
|
|
|
|
|
|
|
1604 |
|
1605 |
+
if (false) {}
|
1606 |
|
1607 |
+
return {
|
1608 |
+
name: name,
|
1609 |
+
styles: styles,
|
1610 |
+
next: cursor
|
1611 |
+
};
|
1612 |
+
};
|
1613 |
|
|
|
|
|
|
|
|
|
|
|
1614 |
|
|
|
|
|
|
|
1615 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1616 |
|
1617 |
+
/***/ }),
|
1618 |
+
/* 38 */
|
1619 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1620 |
|
1621 |
+
"use strict";
|
1622 |
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return getRegisteredStyles; });
|
1623 |
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return insertStyles; });
|
1624 |
+
var isBrowser = "object" !== 'undefined';
|
1625 |
+
function getRegisteredStyles(registered, registeredStyles, classNames) {
|
1626 |
+
var rawClassName = '';
|
1627 |
+
classNames.split(' ').forEach(function (className) {
|
1628 |
+
if (registered[className] !== undefined) {
|
1629 |
+
registeredStyles.push(registered[className]);
|
1630 |
+
} else {
|
1631 |
+
rawClassName += className + " ";
|
1632 |
}
|
1633 |
+
});
|
1634 |
+
return rawClassName;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1635 |
}
|
1636 |
+
var insertStyles = function insertStyles(cache, serialized, isStringTag) {
|
1637 |
+
var className = cache.key + "-" + serialized.name;
|
1638 |
|
1639 |
+
if ( // we only need to add the styles to the registered cache if the
|
1640 |
+
// class name could be used further down
|
1641 |
+
// the tree but if it's a string tag, we know it won't
|
1642 |
+
// so we don't have to add it to registered cache.
|
1643 |
+
// this improves memory usage since we can avoid storing the whole style string
|
1644 |
+
(isStringTag === false || // we need to always store it if we're in compat mode and
|
1645 |
+
// in node since emotion-server relies on whether a style is in
|
1646 |
+
// the registered cache to know whether a style is global or not
|
1647 |
+
// also, note that this check will be dead code eliminated in the browser
|
1648 |
+
isBrowser === false && cache.compat !== undefined) && cache.registered[className] === undefined) {
|
1649 |
+
cache.registered[className] = serialized.styles;
|
1650 |
+
}
|
1651 |
|
1652 |
+
if (cache.inserted[serialized.name] === undefined) {
|
1653 |
+
var current = serialized;
|
|
|
1654 |
|
1655 |
+
do {
|
1656 |
+
var maybeStyles = cache.insert("." + className, current, cache.sheet, true);
|
|
|
1657 |
|
1658 |
+
current = current.next;
|
1659 |
+
} while (current !== undefined);
|
|
|
1660 |
}
|
1661 |
+
};
|
1662 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1663 |
|
|
|
|
|
|
|
|
|
|
|
|
|
1664 |
|
|
|
1665 |
|
1666 |
+
/***/ }),
|
1667 |
+
/* 39 */
|
1668 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
1669 |
|
1670 |
+
"use strict";
|
1671 |
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _taggedTemplateLiteral; });
|
1672 |
+
function _taggedTemplateLiteral(strings, raw) {
|
1673 |
+
if (!raw) {
|
1674 |
+
raw = strings.slice(0);
|
1675 |
}
|
1676 |
|
1677 |
+
return Object.freeze(Object.defineProperties(strings, {
|
1678 |
+
raw: {
|
1679 |
+
value: Object.freeze(raw)
|
1680 |
+
}
|
1681 |
+
}));
|
1682 |
+
}
|
|
|
|
|
|
|
|
|
1683 |
|
1684 |
+
/***/ }),
|
1685 |
+
/* 40 */,
|
1686 |
+
/* 41 */
|
1687 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
|
1688 |
|
1689 |
+
"use strict";
|
1690 |
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _typeof; });
|
1691 |
+
function _typeof(obj) {
|
1692 |
+
"@babel/helpers - typeof";
|
1693 |
|
1694 |
+
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
|
1695 |
+
_typeof = function _typeof(obj) {
|
1696 |
+
return typeof obj;
|
1697 |
+
};
|
1698 |
+
} else {
|
1699 |
+
_typeof = function _typeof(obj) {
|
1700 |
+
return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
1701 |
+
};
|
1702 |
}
|
1703 |
|
1704 |
+
return _typeof(obj);
|
1705 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1706 |
|
1707 |
+
/***/ }),
|
1708 |
+
/* 42 */
|
1709 |
+
/***/ (function(module, exports) {
|
|
|
1710 |
|
1711 |
+
(function() { module.exports = this["wc"]["date"]; }());
|
|
|
|
|
|
|
|
|
1712 |
|
1713 |
+
/***/ }),
|
1714 |
+
/* 43 */,
|
1715 |
+
/* 44 */
|
1716 |
+
/***/ (function(module, exports) {
|
|
|
1717 |
|
1718 |
+
(function() { module.exports = this["wp"]["apiFetch"]; }());
|
1719 |
|
1720 |
+
/***/ }),
|
1721 |
+
/* 45 */,
|
1722 |
+
/* 46 */,
|
1723 |
+
/* 47 */
|
1724 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
1725 |
|
1726 |
+
"use strict";
|
1727 |
+
/* unused harmony export logged */
|
1728 |
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return deprecated; });
|
1729 |
+
/* harmony import */ var _wordpress_hooks__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(51);
|
1730 |
+
/* harmony import */ var _wordpress_hooks__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_hooks__WEBPACK_IMPORTED_MODULE_0__);
|
1731 |
+
/**
|
1732 |
+
* WordPress dependencies
|
1733 |
+
*/
|
1734 |
|
1735 |
+
/**
|
1736 |
+
* Object map tracking messages which have been logged, for use in ensuring a
|
1737 |
+
* message is only logged once.
|
1738 |
+
*
|
1739 |
+
* @type {Object}
|
1740 |
+
*/
|
1741 |
|
1742 |
+
var logged = Object.create(null);
|
1743 |
+
/**
|
1744 |
+
* Logs a message to notify developers about a deprecated feature.
|
1745 |
+
*
|
1746 |
+
* @param {string} feature Name of the deprecated feature.
|
1747 |
+
* @param {?Object} options Personalisation options
|
1748 |
+
* @param {?string} options.version Version in which the feature will be removed.
|
1749 |
+
* @param {?string} options.alternative Feature to use instead
|
1750 |
+
* @param {?string} options.plugin Plugin name if it's a plugin feature
|
1751 |
+
* @param {?string} options.link Link to documentation
|
1752 |
+
* @param {?string} options.hint Additional message to help transition away from the deprecated feature.
|
1753 |
+
*
|
1754 |
+
* @example
|
1755 |
+
* ```js
|
1756 |
+
* import deprecated from '@wordpress/deprecated';
|
1757 |
+
*
|
1758 |
+
* deprecated( 'Eating meat', {
|
1759 |
+
* version: 'the future',
|
1760 |
+
* alternative: 'vegetables',
|
1761 |
+
* plugin: 'the earth',
|
1762 |
+
* hint: 'You may find it beneficial to transition gradually.',
|
1763 |
+
* } );
|
1764 |
+
*
|
1765 |
+
* // 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.'
|
1766 |
+
* ```
|
1767 |
+
*/
|
1768 |
|
1769 |
+
function deprecated(feature) {
|
1770 |
+
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
1771 |
+
var version = options.version,
|
1772 |
+
alternative = options.alternative,
|
1773 |
+
plugin = options.plugin,
|
1774 |
+
link = options.link,
|
1775 |
+
hint = options.hint;
|
1776 |
+
var pluginMessage = plugin ? " from ".concat(plugin) : '';
|
1777 |
+
var versionMessage = version ? " and will be removed".concat(pluginMessage, " in version ").concat(version) : '';
|
1778 |
+
var useInsteadMessage = alternative ? " Please use ".concat(alternative, " instead.") : '';
|
1779 |
+
var linkMessage = link ? " See: ".concat(link) : '';
|
1780 |
+
var hintMessage = hint ? " Note: ".concat(hint) : '';
|
1781 |
+
var message = "".concat(feature, " is deprecated").concat(versionMessage, ".").concat(useInsteadMessage).concat(linkMessage).concat(hintMessage); // Skip if already logged.
|
1782 |
|
1783 |
+
if (message in logged) {
|
1784 |
+
return;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1785 |
}
|
1786 |
+
/**
|
1787 |
+
* Fires whenever a deprecated feature is encountered
|
1788 |
+
*
|
1789 |
+
* @param {string} feature Name of the deprecated feature.
|
1790 |
+
* @param {?Object} options Personalisation options
|
1791 |
+
* @param {?string} options.version Version in which the feature will be removed.
|
1792 |
+
* @param {?string} options.alternative Feature to use instead
|
1793 |
+
* @param {?string} options.plugin Plugin name if it's a plugin feature
|
1794 |
+
* @param {?string} options.link Link to documentation
|
1795 |
+
* @param {?string} options.hint Additional message to help transition away from the deprecated feature.
|
1796 |
+
* @param {?string} message Message sent to console.warn
|
1797 |
+
*/
|
1798 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1799 |
|
1800 |
+
Object(_wordpress_hooks__WEBPACK_IMPORTED_MODULE_0__["doAction"])('deprecated', feature, options, message); // eslint-disable-next-line no-console
|
|
|
|
|
|
|
|
|
|
|
|
|
1801 |
|
1802 |
+
console.warn(message);
|
1803 |
+
logged[message] = true;
|
1804 |
+
}
|
1805 |
+
//# sourceMappingURL=index.js.map
|
|
|
|
|
|
|
|
|
1806 |
|
1807 |
+
/***/ }),
|
1808 |
+
/* 48 */
|
1809 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
|
1810 |
|
1811 |
+
"use strict";
|
|
|
|
|
1812 |
|
1813 |
+
// EXPORTS
|
1814 |
+
__webpack_require__.d(__webpack_exports__, "a", function() { return /* reexport */ ThemeContext; });
|
1815 |
+
__webpack_require__.d(__webpack_exports__, "c", function() { return /* reexport */ emotion_element_57a3a7a3_browser_esm_withEmotionCache; });
|
1816 |
+
__webpack_require__.d(__webpack_exports__, "b", function() { return /* reexport */ css_browser_esm; });
|
1817 |
|
1818 |
+
// UNUSED EXPORTS: CacheProvider, ClassNames, Global, createElement, jsx, keyframes
|
1819 |
|
1820 |
+
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js
|
1821 |
+
var inheritsLoose = __webpack_require__(53);
|
1822 |
|
1823 |
+
// EXTERNAL MODULE: external "React"
|
1824 |
+
var external_React_ = __webpack_require__(8);
|
|
|
|
|
|
|
|
|
1825 |
|
1826 |
+
// CONCATENATED MODULE: ./node_modules/@emotion/sheet/dist/sheet.browser.esm.js
|
1827 |
+
/*
|
1828 |
|
1829 |
+
Based off glamor's StyleSheet, thanks Sunil ❤️
|
|
|
|
|
|
|
1830 |
|
1831 |
+
high performance StyleSheet for css-in-js systems
|
1832 |
|
1833 |
+
- uses multiple style tags behind the scenes for millions of rules
|
1834 |
+
- uses `insertRule` for appending in production for *much* faster performance
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1835 |
|
1836 |
+
// usage
|
|
|
|
|
1837 |
|
1838 |
+
import { StyleSheet } from '@emotion/sheet'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1839 |
|
1840 |
+
let styleSheet = new StyleSheet({ key: '', container: document.head })
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1841 |
|
1842 |
+
styleSheet.insert('#box { border: 1px solid red; }')
|
1843 |
+
- appends a css rule into the stylesheet
|
|
|
|
|
|
|
|
|
1844 |
|
1845 |
+
styleSheet.flush()
|
1846 |
+
- empties the stylesheet of all its contents
|
1847 |
|
1848 |
+
*/
|
1849 |
+
// $FlowFixMe
|
1850 |
+
function sheetForTag(tag) {
|
1851 |
+
if (tag.sheet) {
|
1852 |
+
// $FlowFixMe
|
1853 |
+
return tag.sheet;
|
1854 |
+
} // this weirdness brought to you by firefox
|
1855 |
|
1856 |
+
/* istanbul ignore next */
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1857 |
|
|
|
|
|
1858 |
|
1859 |
+
for (var i = 0; i < document.styleSheets.length; i++) {
|
1860 |
+
if (document.styleSheets[i].ownerNode === tag) {
|
1861 |
+
// $FlowFixMe
|
1862 |
+
return document.styleSheets[i];
|
1863 |
+
}
|
1864 |
}
|
1865 |
+
}
|
1866 |
|
1867 |
+
function createStyleElement(options) {
|
1868 |
+
var tag = document.createElement('style');
|
1869 |
+
tag.setAttribute('data-emotion', options.key);
|
1870 |
+
|
1871 |
+
if (options.nonce !== undefined) {
|
1872 |
+
tag.setAttribute('nonce', options.nonce);
|
1873 |
}
|
1874 |
|
1875 |
+
tag.appendChild(document.createTextNode(''));
|
1876 |
+
return tag;
|
1877 |
+
}
|
|
|
1878 |
|
1879 |
+
var StyleSheet =
|
1880 |
+
/*#__PURE__*/
|
1881 |
+
function () {
|
1882 |
+
function StyleSheet(options) {
|
1883 |
+
this.isSpeedy = options.speedy === undefined ? "production" === 'production' : options.speedy;
|
1884 |
+
this.tags = [];
|
1885 |
+
this.ctr = 0;
|
1886 |
+
this.nonce = options.nonce; // key is the value of the data-emotion attribute, it's used to identify different sheets
|
1887 |
|
1888 |
+
this.key = options.key;
|
1889 |
+
this.container = options.container;
|
1890 |
+
this.before = null;
|
1891 |
+
}
|
|
|
|
|
|
|
|
|
|
|
1892 |
|
1893 |
+
var _proto = StyleSheet.prototype;
|
|
|
|
|
|
|
|
|
1894 |
|
1895 |
+
_proto.insert = function insert(rule) {
|
1896 |
+
// the max length is how many rules we have per style tag, it's 65000 in speedy mode
|
1897 |
+
// it's 1 in dev because we insert source maps that map a single rule to a location
|
1898 |
+
// and you can only have one source map per style tag
|
1899 |
+
if (this.ctr % (this.isSpeedy ? 65000 : 1) === 0) {
|
1900 |
+
var _tag = createStyleElement(this);
|
|
|
|
|
1901 |
|
1902 |
+
var before;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1903 |
|
1904 |
+
if (this.tags.length === 0) {
|
1905 |
+
before = this.before;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1906 |
} else {
|
1907 |
+
before = this.tags[this.tags.length - 1].nextSibling;
|
|
|
|
|
1908 |
}
|
|
|
|
|
1909 |
|
1910 |
+
this.container.insertBefore(_tag, before);
|
1911 |
+
this.tags.push(_tag);
|
1912 |
+
}
|
1913 |
|
1914 |
+
var tag = this.tags[this.tags.length - 1];
|
|
|
|
|
1915 |
|
1916 |
+
if (this.isSpeedy) {
|
1917 |
+
var sheet = sheetForTag(tag);
|
|
|
|
|
1918 |
|
1919 |
+
try {
|
1920 |
+
// this is a really hot path
|
1921 |
+
// we check the second character first because having "i"
|
1922 |
+
// as the second character will happen less often than
|
1923 |
+
// having "@" as the first character
|
1924 |
+
var isImportRule = rule.charCodeAt(1) === 105 && rule.charCodeAt(0) === 64; // this is the ultrafast version, works across browsers
|
1925 |
+
// the big drawback is that the css won't be editable in devtools
|
1926 |
|
1927 |
+
sheet.insertRule(rule, // we need to insert @import rules before anything else
|
1928 |
+
// otherwise there will be an error
|
1929 |
+
// technically this means that the @import rules will
|
1930 |
+
// _usually_(not always since there could be multiple style tags)
|
1931 |
+
// be the first ones in prod and generally later in dev
|
1932 |
+
// this shouldn't really matter in the real world though
|
1933 |
+
// @import is generally only used for font faces from google fonts and etc.
|
1934 |
+
// so while this could be technically correct then it would be slower and larger
|
1935 |
+
// for a tiny bit of correctness that won't matter in the real world
|
1936 |
+
isImportRule ? 0 : sheet.cssRules.length);
|
1937 |
+
} catch (e) {
|
1938 |
+
if (false) {}
|
1939 |
+
}
|
1940 |
+
} else {
|
1941 |
+
tag.appendChild(document.createTextNode(rule));
|
1942 |
+
}
|
1943 |
|
1944 |
+
this.ctr++;
|
1945 |
+
};
|
|
|
1946 |
|
1947 |
+
_proto.flush = function flush() {
|
1948 |
+
// $FlowFixMe
|
1949 |
+
this.tags.forEach(function (tag) {
|
1950 |
+
return tag.parentNode.removeChild(tag);
|
1951 |
+
});
|
1952 |
+
this.tags = [];
|
1953 |
+
this.ctr = 0;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1954 |
};
|
|
|
|
|
1955 |
|
1956 |
+
return StyleSheet;
|
1957 |
+
}();
|
1958 |
|
1959 |
|
1960 |
|
1961 |
+
// CONCATENATED MODULE: ./node_modules/@emotion/stylis/dist/stylis.browser.esm.js
|
1962 |
+
function stylis_min (W) {
|
1963 |
+
function M(d, c, e, h, a) {
|
1964 |
+
for (var m = 0, b = 0, v = 0, n = 0, q, g, x = 0, K = 0, k, u = k = q = 0, l = 0, r = 0, I = 0, t = 0, B = e.length, J = B - 1, y, f = '', p = '', F = '', G = '', C; l < B;) {
|
1965 |
+
g = e.charCodeAt(l);
|
1966 |
+
l === J && 0 !== b + n + v + m && (0 !== b && (g = 47 === b ? 10 : 47), n = v = m = 0, B++, J++);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1967 |
|
1968 |
+
if (0 === b + n + v + m) {
|
1969 |
+
if (l === J && (0 < r && (f = f.replace(N, '')), 0 < f.trim().length)) {
|
1970 |
+
switch (g) {
|
1971 |
+
case 32:
|
1972 |
+
case 9:
|
1973 |
+
case 59:
|
1974 |
+
case 13:
|
1975 |
+
case 10:
|
1976 |
+
break;
|
1977 |
|
1978 |
+
default:
|
1979 |
+
f += e.charAt(l);
|
1980 |
+
}
|
1981 |
|
1982 |
+
g = 59;
|
1983 |
+
}
|
1984 |
|
1985 |
+
switch (g) {
|
1986 |
+
case 123:
|
1987 |
+
f = f.trim();
|
1988 |
+
q = f.charCodeAt(0);
|
1989 |
+
k = 1;
|
1990 |
|
1991 |
+
for (t = ++l; l < B;) {
|
1992 |
+
switch (g = e.charCodeAt(l)) {
|
1993 |
+
case 123:
|
1994 |
+
k++;
|
1995 |
+
break;
|
1996 |
|
1997 |
+
case 125:
|
1998 |
+
k--;
|
1999 |
+
break;
|
2000 |
|
2001 |
+
case 47:
|
2002 |
+
switch (g = e.charCodeAt(l + 1)) {
|
2003 |
+
case 42:
|
2004 |
+
case 47:
|
2005 |
+
a: {
|
2006 |
+
for (u = l + 1; u < J; ++u) {
|
2007 |
+
switch (e.charCodeAt(u)) {
|
2008 |
+
case 47:
|
2009 |
+
if (42 === g && 42 === e.charCodeAt(u - 1) && l + 2 !== u) {
|
2010 |
+
l = u + 1;
|
2011 |
+
break a;
|
2012 |
+
}
|
2013 |
|
2014 |
+
break;
|
2015 |
|
2016 |
+
case 10:
|
2017 |
+
if (47 === g) {
|
2018 |
+
l = u + 1;
|
2019 |
+
break a;
|
2020 |
+
}
|
2021 |
|
2022 |
+
}
|
2023 |
+
}
|
|
|
2024 |
|
2025 |
+
l = u;
|
2026 |
+
}
|
2027 |
|
2028 |
+
}
|
2029 |
|
2030 |
+
break;
|
2031 |
|
2032 |
+
case 91:
|
2033 |
+
g++;
|
|
|
2034 |
|
2035 |
+
case 40:
|
2036 |
+
g++;
|
2037 |
|
2038 |
+
case 34:
|
2039 |
+
case 39:
|
2040 |
+
for (; l++ < J && e.charCodeAt(l) !== g;) {
|
2041 |
+
}
|
2042 |
|
2043 |
+
}
|
2044 |
|
2045 |
+
if (0 === k) break;
|
2046 |
+
l++;
|
2047 |
+
}
|
|
|
|
|
2048 |
|
2049 |
+
k = e.substring(t, l);
|
2050 |
+
0 === q && (q = (f = f.replace(ca, '').trim()).charCodeAt(0));
|
|
|
|
|
|
|
|
|
2051 |
|
2052 |
+
switch (q) {
|
2053 |
+
case 64:
|
2054 |
+
0 < r && (f = f.replace(N, ''));
|
2055 |
+
g = f.charCodeAt(1);
|
2056 |
|
2057 |
+
switch (g) {
|
2058 |
+
case 100:
|
2059 |
+
case 109:
|
2060 |
+
case 115:
|
2061 |
+
case 45:
|
2062 |
+
r = c;
|
2063 |
+
break;
|
2064 |
|
2065 |
+
default:
|
2066 |
+
r = O;
|
2067 |
+
}
|
2068 |
|
2069 |
+
k = M(c, r, k, g, a + 1);
|
2070 |
+
t = k.length;
|
2071 |
+
0 < A && (r = X(O, f, I), C = H(3, k, r, c, D, z, t, g, a, h), f = r.join(''), void 0 !== C && 0 === (t = (k = C.trim()).length) && (g = 0, k = ''));
|
2072 |
+
if (0 < t) switch (g) {
|
2073 |
+
case 115:
|
2074 |
+
f = f.replace(da, ea);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2075 |
|
2076 |
+
case 100:
|
2077 |
+
case 109:
|
2078 |
+
case 45:
|
2079 |
+
k = f + '{' + k + '}';
|
2080 |
+
break;
|
|
|
|
|
|
|
|
|
2081 |
|
2082 |
+
case 107:
|
2083 |
+
f = f.replace(fa, '$1 $2');
|
2084 |
+
k = f + '{' + k + '}';
|
2085 |
+
k = 1 === w || 2 === w && L('@' + k, 3) ? '@-webkit-' + k + '@' + k : '@' + k;
|
2086 |
+
break;
|
2087 |
|
2088 |
+
default:
|
2089 |
+
k = f + k, 112 === h && (k = (p += k, ''));
|
2090 |
+
} else k = '';
|
2091 |
+
break;
|
2092 |
|
2093 |
+
default:
|
2094 |
+
k = M(c, X(c, f, I), k, h, a + 1);
|
2095 |
+
}
|
2096 |
|
2097 |
+
F += k;
|
2098 |
+
k = I = r = u = q = 0;
|
2099 |
+
f = '';
|
2100 |
+
g = e.charCodeAt(++l);
|
2101 |
+
break;
|
|
|
2102 |
|
2103 |
+
case 125:
|
2104 |
+
case 59:
|
2105 |
+
f = (0 < r ? f.replace(N, '') : f).trim();
|
2106 |
+
if (1 < (t = f.length)) switch (0 === u && (q = f.charCodeAt(0), 45 === q || 96 < q && 123 > q) && (t = (f = f.replace(' ', ':')).length), 0 < A && void 0 !== (C = H(1, f, c, d, D, z, p.length, h, a, h)) && 0 === (t = (f = C.trim()).length) && (f = '\x00\x00'), q = f.charCodeAt(0), g = f.charCodeAt(1), q) {
|
2107 |
+
case 0:
|
2108 |
+
break;
|
2109 |
|
2110 |
+
case 64:
|
2111 |
+
if (105 === g || 99 === g) {
|
2112 |
+
G += f + e.charAt(l);
|
2113 |
+
break;
|
2114 |
+
}
|
2115 |
|
2116 |
+
default:
|
2117 |
+
58 !== f.charCodeAt(t - 1) && (p += P(f, q, g, f.charCodeAt(2)));
|
2118 |
+
}
|
2119 |
+
I = r = u = q = 0;
|
2120 |
+
f = '';
|
2121 |
+
g = e.charCodeAt(++l);
|
2122 |
+
}
|
2123 |
+
}
|
2124 |
|
2125 |
+
switch (g) {
|
2126 |
+
case 13:
|
2127 |
+
case 10:
|
2128 |
+
47 === b ? b = 0 : 0 === 1 + q && 107 !== h && 0 < f.length && (r = 1, f += '\x00');
|
2129 |
+
0 < A * Y && H(0, f, c, d, D, z, p.length, h, a, h);
|
2130 |
+
z = 1;
|
2131 |
+
D++;
|
2132 |
+
break;
|
|
|
|
|
|
|
|
|
|
|
2133 |
|
2134 |
+
case 59:
|
2135 |
+
case 125:
|
2136 |
+
if (0 === b + n + v + m) {
|
2137 |
+
z++;
|
2138 |
+
break;
|
2139 |
+
}
|
2140 |
|
2141 |
+
default:
|
2142 |
+
z++;
|
2143 |
+
y = e.charAt(l);
|
2144 |
|
2145 |
+
switch (g) {
|
2146 |
+
case 9:
|
2147 |
+
case 32:
|
2148 |
+
if (0 === n + m + b) switch (x) {
|
2149 |
+
case 44:
|
2150 |
+
case 58:
|
2151 |
+
case 9:
|
2152 |
+
case 32:
|
2153 |
+
y = '';
|
2154 |
+
break;
|
2155 |
|
2156 |
+
default:
|
2157 |
+
32 !== g && (y = ' ');
|
2158 |
+
}
|
2159 |
+
break;
|
2160 |
|
2161 |
+
case 0:
|
2162 |
+
y = '\\0';
|
2163 |
+
break;
|
2164 |
|
2165 |
+
case 12:
|
2166 |
+
y = '\\f';
|
2167 |
+
break;
|
2168 |
|
2169 |
+
case 11:
|
2170 |
+
y = '\\v';
|
2171 |
+
break;
|
2172 |
|
2173 |
+
case 38:
|
2174 |
+
0 === n + b + m && (r = I = 1, y = '\f' + y);
|
2175 |
+
break;
|
2176 |
|
2177 |
+
case 108:
|
2178 |
+
if (0 === n + b + m + E && 0 < u) switch (l - u) {
|
2179 |
+
case 2:
|
2180 |
+
112 === x && 58 === e.charCodeAt(l - 3) && (E = x);
|
2181 |
|
2182 |
+
case 8:
|
2183 |
+
111 === K && (E = K);
|
2184 |
+
}
|
2185 |
+
break;
|
2186 |
|
2187 |
+
case 58:
|
2188 |
+
0 === n + b + m && (u = l);
|
2189 |
+
break;
|
2190 |
|
2191 |
+
case 44:
|
2192 |
+
0 === b + v + n + m && (r = 1, y += '\r');
|
2193 |
+
break;
|
2194 |
|
2195 |
+
case 34:
|
2196 |
+
case 39:
|
2197 |
+
0 === b && (n = n === g ? 0 : 0 === n ? g : n);
|
2198 |
+
break;
|
2199 |
|
2200 |
+
case 91:
|
2201 |
+
0 === n + b + v && m++;
|
2202 |
+
break;
|
2203 |
|
2204 |
+
case 93:
|
2205 |
+
0 === n + b + v && m--;
|
2206 |
+
break;
|
|
|
|
|
|
|
2207 |
|
2208 |
+
case 41:
|
2209 |
+
0 === n + b + m && v--;
|
2210 |
+
break;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2211 |
|
2212 |
+
case 40:
|
2213 |
+
if (0 === n + b + m) {
|
2214 |
+
if (0 === q) switch (2 * x + 3 * K) {
|
2215 |
+
case 533:
|
2216 |
+
break;
|
2217 |
|
2218 |
+
default:
|
2219 |
+
q = 1;
|
2220 |
+
}
|
2221 |
+
v++;
|
2222 |
+
}
|
2223 |
|
2224 |
+
break;
|
|
|
2225 |
|
2226 |
+
case 64:
|
2227 |
+
0 === b + v + n + m + u + k && (k = 1);
|
2228 |
+
break;
|
2229 |
|
2230 |
+
case 42:
|
2231 |
+
case 47:
|
2232 |
+
if (!(0 < n + m + v)) switch (b) {
|
2233 |
+
case 0:
|
2234 |
+
switch (2 * g + 3 * e.charCodeAt(l + 1)) {
|
2235 |
+
case 235:
|
2236 |
+
b = 47;
|
2237 |
+
break;
|
2238 |
|
2239 |
+
case 220:
|
2240 |
+
t = l, b = 42;
|
2241 |
+
}
|
2242 |
|
2243 |
+
break;
|
2244 |
|
2245 |
+
case 42:
|
2246 |
+
47 === g && 42 === x && t + 2 !== l && (33 === e.charCodeAt(t + 2) && (p += e.substring(t, l + 1)), y = '', b = 0);
|
2247 |
+
}
|
2248 |
+
}
|
|
|
|
|
|
|
2249 |
|
2250 |
+
0 === b && (f += y);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2251 |
}
|
|
|
|
|
|
|
|
|
2252 |
|
2253 |
+
K = x;
|
2254 |
+
x = g;
|
2255 |
+
l++;
|
2256 |
+
}
|
2257 |
|
2258 |
+
t = p.length;
|
|
|
|
|
2259 |
|
2260 |
+
if (0 < t) {
|
2261 |
+
r = c;
|
2262 |
+
if (0 < A && (C = H(2, p, r, d, D, z, t, h, a, h), void 0 !== C && 0 === (p = C).length)) return G + p + F;
|
2263 |
+
p = r.join(',') + '{' + p + '}';
|
|
|
|
|
|
|
|
|
|
|
2264 |
|
2265 |
+
if (0 !== w * E) {
|
2266 |
+
2 !== w || L(p, 2) || (E = 0);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2267 |
|
2268 |
+
switch (E) {
|
2269 |
+
case 111:
|
2270 |
+
p = p.replace(ha, ':-moz-$1') + p;
|
2271 |
+
break;
|
|
|
|
|
2272 |
|
2273 |
+
case 112:
|
2274 |
+
p = p.replace(Q, '::-webkit-input-$1') + p.replace(Q, '::-moz-$1') + p.replace(Q, ':-ms-input-$1') + p;
|
|
|
|
|
2275 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
2276 |
|
2277 |
+
E = 0;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2278 |
}
|
2279 |
+
}
|
|
|
|
|
|
|
|
|
|
|
2280 |
|
2281 |
+
return G + p + F;
|
2282 |
+
}
|
2283 |
|
2284 |
+
function X(d, c, e) {
|
2285 |
+
var h = c.trim().split(ia);
|
2286 |
+
c = h;
|
2287 |
+
var a = h.length,
|
2288 |
+
m = d.length;
|
2289 |
|
2290 |
+
switch (m) {
|
2291 |
+
case 0:
|
2292 |
+
case 1:
|
2293 |
+
var b = 0;
|
|
|
2294 |
|
2295 |
+
for (d = 0 === m ? '' : d[0] + ' '; b < a; ++b) {
|
2296 |
+
c[b] = Z(d, c[b], e).trim();
|
2297 |
+
}
|
2298 |
|
2299 |
+
break;
|
2300 |
|
2301 |
+
default:
|
2302 |
+
var v = b = 0;
|
2303 |
|
2304 |
+
for (c = []; b < a; ++b) {
|
2305 |
+
for (var n = 0; n < m; ++n) {
|
2306 |
+
c[v++] = Z(d[n] + ' ', h[b], e).trim();
|
2307 |
+
}
|
2308 |
+
}
|
2309 |
|
2310 |
+
}
|
2311 |
|
2312 |
+
return c;
|
2313 |
+
}
|
|
|
2314 |
|
2315 |
+
function Z(d, c, e) {
|
2316 |
+
var h = c.charCodeAt(0);
|
2317 |
+
33 > h && (h = (c = c.trim()).charCodeAt(0));
|
2318 |
|
2319 |
+
switch (h) {
|
2320 |
+
case 38:
|
2321 |
+
return c.replace(F, '$1' + d.trim());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2322 |
|
2323 |
+
case 58:
|
2324 |
+
return d.trim() + c.replace(F, '$1' + d.trim());
|
2325 |
|
2326 |
+
default:
|
2327 |
+
if (0 < 1 * e && 0 < c.indexOf('\f')) return c.replace(F, (58 === d.charCodeAt(0) ? '' : '$1') + d.trim());
|
2328 |
+
}
|
2329 |
|
2330 |
+
return d + c;
|
2331 |
+
}
|
2332 |
|
2333 |
+
function P(d, c, e, h) {
|
2334 |
+
var a = d + ';',
|
2335 |
+
m = 2 * c + 3 * e + 4 * h;
|
2336 |
|
2337 |
+
if (944 === m) {
|
2338 |
+
d = a.indexOf(':', 9) + 1;
|
2339 |
+
var b = a.substring(d, a.length - 1).trim();
|
2340 |
+
b = a.substring(0, d).trim() + b + ';';
|
2341 |
+
return 1 === w || 2 === w && L(b, 1) ? '-webkit-' + b + b : b;
|
2342 |
+
}
|
2343 |
|
2344 |
+
if (0 === w || 2 === w && !L(a, 1)) return a;
|
|
|
2345 |
|
2346 |
+
switch (m) {
|
2347 |
+
case 1015:
|
2348 |
+
return 97 === a.charCodeAt(10) ? '-webkit-' + a + a : a;
|
2349 |
|
2350 |
+
case 951:
|
2351 |
+
return 116 === a.charCodeAt(3) ? '-webkit-' + a + a : a;
|
2352 |
|
2353 |
+
case 963:
|
2354 |
+
return 110 === a.charCodeAt(5) ? '-webkit-' + a + a : a;
|
2355 |
|
2356 |
+
case 1009:
|
2357 |
+
if (100 !== a.charCodeAt(4)) break;
|
2358 |
|
2359 |
+
case 969:
|
2360 |
+
case 942:
|
2361 |
+
return '-webkit-' + a + a;
|
2362 |
|
2363 |
+
case 978:
|
2364 |
+
return '-webkit-' + a + '-moz-' + a + a;
|
2365 |
|
2366 |
+
case 1019:
|
2367 |
+
case 983:
|
2368 |
+
return '-webkit-' + a + '-moz-' + a + '-ms-' + a + a;
|
2369 |
|
2370 |
+
case 883:
|
2371 |
+
if (45 === a.charCodeAt(8)) return '-webkit-' + a + a;
|
2372 |
+
if (0 < a.indexOf('image-set(', 11)) return a.replace(ja, '$1-webkit-$2') + a;
|
2373 |
+
break;
|
2374 |
|
2375 |
+
case 932:
|
2376 |
+
if (45 === a.charCodeAt(4)) switch (a.charCodeAt(5)) {
|
2377 |
+
case 103:
|
2378 |
+
return '-webkit-box-' + a.replace('-grow', '') + '-webkit-' + a + '-ms-' + a.replace('grow', 'positive') + a;
|
2379 |
|
2380 |
+
case 115:
|
2381 |
+
return '-webkit-' + a + '-ms-' + a.replace('shrink', 'negative') + a;
|
2382 |
|
2383 |
+
case 98:
|
2384 |
+
return '-webkit-' + a + '-ms-' + a.replace('basis', 'preferred-size') + a;
|
2385 |
+
}
|
2386 |
+
return '-webkit-' + a + '-ms-' + a + a;
|
2387 |
|
2388 |
+
case 964:
|
2389 |
+
return '-webkit-' + a + '-ms-flex-' + a + a;
|
2390 |
|
2391 |
+
case 1023:
|
2392 |
+
if (99 !== a.charCodeAt(8)) break;
|
2393 |
+
b = a.substring(a.indexOf(':', 15)).replace('flex-', '').replace('space-between', 'justify');
|
2394 |
+
return '-webkit-box-pack' + b + '-webkit-' + a + '-ms-flex-pack' + b + a;
|
2395 |
|
2396 |
+
case 1005:
|
2397 |
+
return ka.test(a) ? a.replace(aa, ':-webkit-') + a.replace(aa, ':-moz-') + a : a;
|
2398 |
|
2399 |
+
case 1e3:
|
2400 |
+
b = a.substring(13).trim();
|
2401 |
+
c = b.indexOf('-') + 1;
|
2402 |
|
2403 |
+
switch (b.charCodeAt(0) + b.charCodeAt(c)) {
|
2404 |
+
case 226:
|
2405 |
+
b = a.replace(G, 'tb');
|
2406 |
+
break;
|
2407 |
|
2408 |
+
case 232:
|
2409 |
+
b = a.replace(G, 'tb-rl');
|
2410 |
+
break;
|
2411 |
|
2412 |
+
case 220:
|
2413 |
+
b = a.replace(G, 'lr');
|
2414 |
+
break;
|
2415 |
|
2416 |
+
default:
|
2417 |
+
return a;
|
2418 |
+
}
|
2419 |
|
2420 |
+
return '-webkit-' + a + '-ms-' + b + a;
|
|
|
|
|
2421 |
|
2422 |
+
case 1017:
|
2423 |
+
if (-1 === a.indexOf('sticky', 9)) break;
|
2424 |
|
2425 |
+
case 975:
|
2426 |
+
c = (a = d).length - 10;
|
2427 |
+
b = (33 === a.charCodeAt(c) ? a.substring(0, c) : a).substring(d.indexOf(':', 7) + 1).trim();
|
2428 |
|
2429 |
+
switch (m = b.charCodeAt(0) + (b.charCodeAt(7) | 0)) {
|
2430 |
+
case 203:
|
2431 |
+
if (111 > b.charCodeAt(8)) break;
|
|
|
|
|
2432 |
|
2433 |
+
case 115:
|
2434 |
+
a = a.replace(b, '-webkit-' + b) + ';' + a;
|
2435 |
+
break;
|
|
|
|
|
|
|
|
|
|
|
2436 |
|
2437 |
+
case 207:
|
2438 |
+
case 102:
|
2439 |
+
a = a.replace(b, '-webkit-' + (102 < m ? 'inline-' : '') + 'box') + ';' + a.replace(b, '-webkit-' + b) + ';' + a.replace(b, '-ms-' + b + 'box') + ';' + a;
|
2440 |
+
}
|
2441 |
|
2442 |
+
return a + ';';
|
|
|
2443 |
|
2444 |
+
case 938:
|
2445 |
+
if (45 === a.charCodeAt(5)) switch (a.charCodeAt(6)) {
|
2446 |
+
case 105:
|
2447 |
+
return b = a.replace('-items', ''), '-webkit-' + a + '-webkit-box-' + b + '-ms-flex-' + b + a;
|
2448 |
|
2449 |
+
case 115:
|
2450 |
+
return '-webkit-' + a + '-ms-flex-item-' + a.replace(ba, '') + a;
|
2451 |
|
2452 |
+
default:
|
2453 |
+
return '-webkit-' + a + '-ms-flex-line-pack' + a.replace('align-content', '').replace(ba, '') + a;
|
2454 |
+
}
|
2455 |
+
break;
|
2456 |
|
2457 |
+
case 973:
|
2458 |
+
case 989:
|
2459 |
+
if (45 !== a.charCodeAt(3) || 122 === a.charCodeAt(4)) break;
|
|
|
|
|
|
|
|
|
2460 |
|
2461 |
+
case 931:
|
2462 |
+
case 953:
|
2463 |
+
if (!0 === la.test(d)) return 115 === (b = d.substring(d.indexOf(':') + 1)).charCodeAt(0) ? P(d.replace('stretch', 'fill-available'), c, e, h).replace(':fill-available', ':stretch') : a.replace(b, '-webkit-' + b) + a.replace(b, '-moz-' + b.replace('fill-', '')) + a;
|
2464 |
+
break;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2465 |
|
2466 |
+
case 962:
|
2467 |
+
if (a = '-webkit-' + a + (102 === a.charCodeAt(5) ? '-ms-' + a : '') + a, 211 === e + h && 105 === a.charCodeAt(13) && 0 < a.indexOf('transform', 10)) return a.substring(0, a.indexOf(';', 27) + 1).replace(ma, '$1-webkit-$2') + a;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2468 |
}
|
|
|
2469 |
|
2470 |
+
return a;
|
2471 |
+
}
|
2472 |
|
2473 |
+
function L(d, c) {
|
2474 |
+
var e = d.indexOf(1 === c ? ':' : '{'),
|
2475 |
+
h = d.substring(0, 3 !== c ? e : 10);
|
2476 |
+
e = d.substring(e + 1, d.length - 1);
|
2477 |
+
return R(2 !== c ? h : h.replace(na, '$1'), e, c);
|
2478 |
+
}
|
2479 |
|
2480 |
+
function ea(d, c) {
|
2481 |
+
var e = P(c, c.charCodeAt(0), c.charCodeAt(1), c.charCodeAt(2));
|
2482 |
+
return e !== c + ';' ? e.replace(oa, ' or ($1)').substring(4) : '(' + c + ')';
|
2483 |
+
}
|
2484 |
|
2485 |
+
function H(d, c, e, h, a, m, b, v, n, q) {
|
2486 |
+
for (var g = 0, x = c, w; g < A; ++g) {
|
2487 |
+
switch (w = S[g].call(B, d, x, e, h, a, m, b, v, n, q)) {
|
2488 |
+
case void 0:
|
2489 |
+
case !1:
|
2490 |
+
case !0:
|
2491 |
+
case null:
|
2492 |
+
break;
|
2493 |
|
2494 |
+
default:
|
2495 |
+
x = w;
|
2496 |
+
}
|
2497 |
+
}
|
2498 |
|
2499 |
+
if (x !== c) return x;
|
2500 |
+
}
|
2501 |
|
2502 |
+
function T(d) {
|
2503 |
+
switch (d) {
|
2504 |
+
case void 0:
|
2505 |
+
case null:
|
2506 |
+
A = S.length = 0;
|
2507 |
+
break;
|
2508 |
|
2509 |
+
default:
|
2510 |
+
if ('function' === typeof d) S[A++] = d;else if ('object' === typeof d) for (var c = 0, e = d.length; c < e; ++c) {
|
2511 |
+
T(d[c]);
|
2512 |
+
} else Y = !!d | 0;
|
2513 |
+
}
|
2514 |
|
2515 |
+
return T;
|
2516 |
+
}
|
2517 |
|
2518 |
+
function U(d) {
|
2519 |
+
d = d.prefix;
|
2520 |
+
void 0 !== d && (R = null, d ? 'function' !== typeof d ? w = 1 : (w = 2, R = d) : w = 0);
|
2521 |
+
return U;
|
2522 |
+
}
|
2523 |
|
2524 |
+
function B(d, c) {
|
2525 |
+
var e = d;
|
2526 |
+
33 > e.charCodeAt(0) && (e = e.trim());
|
2527 |
+
V = e;
|
2528 |
+
e = [V];
|
2529 |
|
2530 |
+
if (0 < A) {
|
2531 |
+
var h = H(-1, c, e, e, D, z, 0, 0, 0, 0);
|
2532 |
+
void 0 !== h && 'string' === typeof h && (c = h);
|
2533 |
+
}
|
2534 |
|
2535 |
+
var a = M(O, e, c, 0, 0);
|
2536 |
+
0 < A && (h = H(-2, a, e, e, D, z, a.length, 0, 0, 0), void 0 !== h && (a = h));
|
2537 |
+
V = '';
|
2538 |
+
E = 0;
|
2539 |
+
z = D = 1;
|
2540 |
+
return a;
|
2541 |
+
}
|
2542 |
|
2543 |
+
var ca = /^\0+/g,
|
2544 |
+
N = /[\0\r\f]/g,
|
2545 |
+
aa = /: */g,
|
2546 |
+
ka = /zoo|gra/,
|
2547 |
+
ma = /([,: ])(transform)/g,
|
2548 |
+
ia = /,\r+?/g,
|
2549 |
+
F = /([\t\r\n ])*\f?&/g,
|
2550 |
+
fa = /@(k\w+)\s*(\S*)\s*/,
|
2551 |
+
Q = /::(place)/g,
|
2552 |
+
ha = /:(read-only)/g,
|
2553 |
+
G = /[svh]\w+-[tblr]{2}/,
|
2554 |
+
da = /\(\s*(.*)\s*\)/g,
|
2555 |
+
oa = /([\s\S]*?);/g,
|
2556 |
+
ba = /-self|flex-/g,
|
2557 |
+
na = /[^]*?(:[rp][el]a[\w-]+)[^]*/,
|
2558 |
+
la = /stretch|:\s*\w+\-(?:conte|avail)/,
|
2559 |
+
ja = /([^-])(image-set\()/,
|
2560 |
+
z = 1,
|
2561 |
+
D = 1,
|
2562 |
+
E = 0,
|
2563 |
+
w = 1,
|
2564 |
+
O = [],
|
2565 |
+
S = [],
|
2566 |
+
A = 0,
|
2567 |
+
R = null,
|
2568 |
+
Y = 0,
|
2569 |
+
V = '';
|
2570 |
+
B.use = T;
|
2571 |
+
B.set = U;
|
2572 |
+
void 0 !== W && U(W);
|
2573 |
+
return B;
|
2574 |
+
}
|
2575 |
|
2576 |
+
/* harmony default export */ var stylis_browser_esm = (stylis_min);
|
2577 |
|
2578 |
+
// CONCATENATED MODULE: ./node_modules/@emotion/weak-memoize/dist/weak-memoize.browser.esm.js
|
2579 |
+
var weakMemoize = function weakMemoize(func) {
|
2580 |
+
// $FlowFixMe flow doesn't include all non-primitive types as allowed for weakmaps
|
2581 |
+
var cache = new WeakMap();
|
2582 |
+
return function (arg) {
|
2583 |
+
if (cache.has(arg)) {
|
2584 |
+
// $FlowFixMe
|
2585 |
+
return cache.get(arg);
|
2586 |
+
}
|
2587 |
|
2588 |
+
var ret = func(arg);
|
2589 |
+
cache.set(arg, ret);
|
2590 |
+
return ret;
|
2591 |
+
};
|
2592 |
+
};
|
2593 |
|
2594 |
+
/* harmony default export */ var weak_memoize_browser_esm = (weakMemoize);
|
2595 |
|
2596 |
+
// CONCATENATED MODULE: ./node_modules/@emotion/cache/dist/cache.browser.esm.js
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2597 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2598 |
|
2599 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2600 |
|
2601 |
+
// https://github.com/thysultan/stylis.js/tree/master/plugins/rule-sheet
|
2602 |
+
// inlined to avoid umd wrapper and peerDep warnings/installing stylis
|
2603 |
+
// since we use stylis after closure compiler
|
2604 |
+
var delimiter = '/*|*/';
|
2605 |
+
var needle = delimiter + '}';
|
2606 |
|
2607 |
+
function toSheet(block) {
|
2608 |
+
if (block) {
|
2609 |
+
Sheet.current.insert(block + '}');
|
2610 |
+
}
|
2611 |
+
}
|
2612 |
|
2613 |
+
var Sheet = {
|
2614 |
+
current: null
|
2615 |
+
};
|
2616 |
+
var ruleSheet = function ruleSheet(context, content, selectors, parents, line, column, length, ns, depth, at) {
|
2617 |
+
switch (context) {
|
2618 |
+
// property
|
2619 |
+
case 1:
|
2620 |
+
{
|
2621 |
+
switch (content.charCodeAt(0)) {
|
2622 |
+
case 64:
|
2623 |
+
{
|
2624 |
+
// @import
|
2625 |
+
Sheet.current.insert(content + ';');
|
2626 |
+
return '';
|
2627 |
+
}
|
2628 |
+
// charcode for l
|
2629 |
|
2630 |
+
case 108:
|
2631 |
+
{
|
2632 |
+
// charcode for b
|
2633 |
+
// this ignores label
|
2634 |
+
if (content.charCodeAt(2) === 98) {
|
2635 |
+
return '';
|
2636 |
+
}
|
2637 |
+
}
|
2638 |
+
}
|
2639 |
|
2640 |
+
break;
|
2641 |
+
}
|
2642 |
+
// selector
|
2643 |
|
2644 |
+
case 2:
|
2645 |
+
{
|
2646 |
+
if (ns === 0) return content + delimiter;
|
2647 |
+
break;
|
2648 |
+
}
|
2649 |
+
// at-rule
|
2650 |
|
2651 |
+
case 3:
|
2652 |
+
{
|
2653 |
+
switch (ns) {
|
2654 |
+
// @font-face, @page
|
2655 |
+
case 102:
|
2656 |
+
case 112:
|
2657 |
+
{
|
2658 |
+
Sheet.current.insert(selectors[0] + content);
|
2659 |
+
return '';
|
2660 |
+
}
|
2661 |
|
2662 |
+
default:
|
2663 |
+
{
|
2664 |
+
return content + (at === 0 ? delimiter : '');
|
2665 |
+
}
|
2666 |
+
}
|
2667 |
+
}
|
2668 |
|
2669 |
+
case -2:
|
2670 |
+
{
|
2671 |
+
content.split(needle).forEach(toSheet);
|
2672 |
}
|
2673 |
+
}
|
2674 |
+
};
|
2675 |
|
2676 |
+
var cache_browser_esm_createCache = function createCache(options) {
|
2677 |
+
if (options === undefined) options = {};
|
2678 |
+
var key = options.key || 'css';
|
2679 |
+
var stylisOptions;
|
|
|
|
|
2680 |
|
2681 |
+
if (options.prefix !== undefined) {
|
2682 |
+
stylisOptions = {
|
2683 |
+
prefix: options.prefix
|
2684 |
+
};
|
2685 |
+
}
|
|
|
|
|
2686 |
|
2687 |
+
var stylis = new stylis_browser_esm(stylisOptions);
|
2688 |
|
2689 |
+
if (false) {}
|
|
|
|
|
2690 |
|
2691 |
+
var inserted = {}; // $FlowFixMe
|
|
|
2692 |
|
2693 |
+
var container;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2694 |
|
2695 |
+
{
|
2696 |
+
container = options.container || document.head;
|
2697 |
+
var nodes = document.querySelectorAll("style[data-emotion-" + key + "]");
|
2698 |
+
Array.prototype.forEach.call(nodes, function (node) {
|
2699 |
+
var attrib = node.getAttribute("data-emotion-" + key); // $FlowFixMe
|
2700 |
|
2701 |
+
attrib.split(' ').forEach(function (id) {
|
2702 |
+
inserted[id] = true;
|
|
|
|
|
|
|
|
|
2703 |
});
|
|
|
|
|
|
|
2704 |
|
2705 |
+
if (node.parentNode !== container) {
|
2706 |
+
container.appendChild(node);
|
2707 |
+
}
|
2708 |
+
});
|
2709 |
+
}
|
2710 |
|
2711 |
+
var _insert;
|
2712 |
|
2713 |
+
{
|
2714 |
+
stylis.use(options.stylisPlugins)(ruleSheet);
|
2715 |
|
2716 |
+
_insert = function insert(selector, serialized, sheet, shouldCache) {
|
2717 |
+
var name = serialized.name;
|
2718 |
+
Sheet.current = sheet;
|
2719 |
|
2720 |
+
if (false) { var map; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2721 |
|
2722 |
+
stylis(selector, serialized.styles);
|
2723 |
|
2724 |
+
if (shouldCache) {
|
2725 |
+
cache.inserted[name] = true;
|
2726 |
+
}
|
2727 |
+
};
|
2728 |
+
}
|
2729 |
|
2730 |
+
if (false) { var commentEnd, commentStart; }
|
2731 |
|
2732 |
+
var cache = {
|
2733 |
+
key: key,
|
2734 |
+
sheet: new StyleSheet({
|
2735 |
+
key: key,
|
2736 |
+
container: container,
|
2737 |
+
nonce: options.nonce,
|
2738 |
+
speedy: options.speedy
|
2739 |
+
}),
|
2740 |
+
nonce: options.nonce,
|
2741 |
+
inserted: inserted,
|
2742 |
+
registered: {},
|
2743 |
+
insert: _insert
|
2744 |
+
};
|
2745 |
+
return cache;
|
2746 |
+
};
|
2747 |
|
2748 |
+
/* harmony default export */ var cache_browser_esm = (cache_browser_esm_createCache);
|
2749 |
|
2750 |
+
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/inheritsLoose.js
|
2751 |
+
var helpers_inheritsLoose = __webpack_require__(130);
|
|
|
2752 |
|
2753 |
+
// EXTERNAL MODULE: ./node_modules/@emotion/utils/dist/utils.browser.esm.js
|
2754 |
+
var utils_browser_esm = __webpack_require__(38);
|
2755 |
|
2756 |
+
// EXTERNAL MODULE: ./node_modules/@emotion/serialize/dist/serialize.browser.esm.js + 2 modules
|
2757 |
+
var serialize_browser_esm = __webpack_require__(37);
|
|
|
2758 |
|
2759 |
+
// CONCATENATED MODULE: ./node_modules/@emotion/core/dist/emotion-element-57a3a7a3.browser.esm.js
|
2760 |
|
2761 |
|
|
|
|
|
|
|
|
|
|
|
2762 |
|
|
|
|
|
2763 |
|
|
|
|
|
|
|
|
|
|
|
|
|
2764 |
|
|
|
|
|
|
|
|
|
|
|
2765 |
|
2766 |
+
var emotion_element_57a3a7a3_browser_esm_hasOwnProperty = Object.prototype.hasOwnProperty;
|
2767 |
|
2768 |
+
var EmotionCacheContext = /*#__PURE__*/Object(external_React_["createContext"])( // we're doing this to avoid preconstruct's dead code elimination in this one case
|
2769 |
+
// because this module is primarily intended for the browser and node
|
2770 |
+
// but it's also required in react native and similar environments sometimes
|
2771 |
+
// and we could have a special build just for that
|
2772 |
+
// but this is much easier and the native packages
|
2773 |
+
// might use a different theme context in the future anyway
|
2774 |
+
typeof HTMLElement !== 'undefined' ? cache_browser_esm() : null);
|
2775 |
+
var ThemeContext = /*#__PURE__*/Object(external_React_["createContext"])({});
|
2776 |
+
var CacheProvider = EmotionCacheContext.Provider;
|
2777 |
|
2778 |
+
var emotion_element_57a3a7a3_browser_esm_withEmotionCache = function withEmotionCache(func) {
|
2779 |
+
var render = function render(props, ref) {
|
2780 |
+
return /*#__PURE__*/Object(external_React_["createElement"])(EmotionCacheContext.Consumer, null, function (cache) {
|
2781 |
+
return func(props, cache, ref);
|
2782 |
+
});
|
2783 |
+
}; // $FlowFixMe
|
2784 |
|
|
|
|
|
|
|
|
|
2785 |
|
2786 |
+
return /*#__PURE__*/Object(external_React_["forwardRef"])(render);
|
2787 |
+
};
|
|
|
|
|
|
|
2788 |
|
2789 |
+
// thus we only need to replace what is a valid character for JS, but not for CSS
|
|
|
2790 |
|
2791 |
+
var sanitizeIdentifier = function sanitizeIdentifier(identifier) {
|
2792 |
+
return identifier.replace(/\$/g, '-');
|
2793 |
+
};
|
|
|
|
|
2794 |
|
2795 |
+
var typePropName = '__EMOTION_TYPE_PLEASE_DO_NOT_USE__';
|
2796 |
+
var labelPropName = '__EMOTION_LABEL_PLEASE_DO_NOT_USE__';
|
2797 |
+
var createEmotionProps = function createEmotionProps(type, props) {
|
2798 |
+
if (false) {}
|
2799 |
|
2800 |
+
var newProps = {};
|
|
|
2801 |
|
2802 |
+
for (var key in props) {
|
2803 |
+
if (emotion_element_57a3a7a3_browser_esm_hasOwnProperty.call(props, key)) {
|
2804 |
+
newProps[key] = props[key];
|
2805 |
+
}
|
2806 |
+
}
|
2807 |
|
2808 |
+
newProps[typePropName] = type; // TODO: check if this still works with all of those different JSX functions
|
|
|
2809 |
|
2810 |
+
if (false) { var match, error; }
|
|
|
|
|
|
|
|
|
2811 |
|
2812 |
+
return newProps;
|
2813 |
+
};
|
2814 |
|
2815 |
+
var emotion_element_57a3a7a3_browser_esm_render = function render(cache, props, theme, ref) {
|
2816 |
+
var cssProp = theme === null ? props.css : props.css(theme); // so that using `css` from `emotion` and passing the result to the css prop works
|
2817 |
+
// not passing the registered cache to serializeStyles because it would
|
2818 |
+
// make certain babel optimisations not possible
|
2819 |
|
2820 |
+
if (typeof cssProp === 'string' && cache.registered[cssProp] !== undefined) {
|
2821 |
+
cssProp = cache.registered[cssProp];
|
2822 |
+
}
|
2823 |
|
2824 |
+
var type = props[typePropName];
|
2825 |
+
var registeredStyles = [cssProp];
|
2826 |
+
var className = '';
|
2827 |
|
2828 |
+
if (typeof props.className === 'string') {
|
2829 |
+
className = Object(utils_browser_esm["a" /* getRegisteredStyles */])(cache.registered, registeredStyles, props.className);
|
2830 |
+
} else if (props.className != null) {
|
2831 |
+
className = props.className + " ";
|
2832 |
+
}
|
2833 |
|
2834 |
+
var serialized = Object(serialize_browser_esm["a" /* serializeStyles */])(registeredStyles);
|
|
|
2835 |
|
2836 |
+
if (false) { var labelFromStack; }
|
|
|
2837 |
|
2838 |
+
var rules = Object(utils_browser_esm["b" /* insertStyles */])(cache, serialized, typeof type === 'string');
|
2839 |
+
className += cache.key + "-" + serialized.name;
|
2840 |
+
var newProps = {};
|
|
|
|
|
2841 |
|
2842 |
+
for (var key in props) {
|
2843 |
+
if (emotion_element_57a3a7a3_browser_esm_hasOwnProperty.call(props, key) && key !== 'css' && key !== typePropName && ( true || false)) {
|
2844 |
+
newProps[key] = props[key];
|
2845 |
+
}
|
2846 |
}
|
2847 |
|
2848 |
+
newProps.ref = ref;
|
2849 |
+
newProps.className = className;
|
2850 |
+
var ele = /*#__PURE__*/Object(external_React_["createElement"])(type, newProps);
|
2851 |
|
2852 |
+
return ele;
|
2853 |
+
}; // eslint-disable-next-line no-undef
|
|
|
|
|
2854 |
|
2855 |
+
|
2856 |
+
var Emotion = /* #__PURE__ */emotion_element_57a3a7a3_browser_esm_withEmotionCache(function (props, cache, ref) {
|
2857 |
+
if (typeof props.css === 'function') {
|
2858 |
+
return /*#__PURE__*/Object(external_React_["createElement"])(ThemeContext.Consumer, null, function (theme) {
|
2859 |
+
return emotion_element_57a3a7a3_browser_esm_render(cache, props, theme, ref);
|
2860 |
});
|
2861 |
}
|
2862 |
|
2863 |
+
return emotion_element_57a3a7a3_browser_esm_render(cache, props, null, ref);
|
2864 |
+
});
|
2865 |
|
2866 |
+
if (false) {}
|
|
|
2867 |
|
|
|
2868 |
|
|
|
|
|
2869 |
|
2870 |
+
// CONCATENATED MODULE: ./node_modules/@emotion/css/dist/css.browser.esm.js
|
|
|
|
|
|
|
|
|
2871 |
|
2872 |
|
2873 |
+
function css_browser_esm_css() {
|
2874 |
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
2875 |
+
args[_key] = arguments[_key];
|
2876 |
+
}
|
2877 |
|
2878 |
+
return Object(serialize_browser_esm["a" /* serializeStyles */])(args);
|
2879 |
+
}
|
2880 |
|
2881 |
+
/* harmony default export */ var css_browser_esm = (css_browser_esm_css);
|
|
|
|
|
2882 |
|
2883 |
+
// CONCATENATED MODULE: ./node_modules/@emotion/core/dist/core.browser.esm.js
|
|
|
|
|
2884 |
|
|
|
|
|
2885 |
|
|
|
|
|
|
|
2886 |
|
|
|
|
|
|
|
|
|
2887 |
|
|
|
|
|
|
|
|
|
|
|
2888 |
|
|
|
|
|
2889 |
|
|
|
2890 |
|
|
|
|
|
2891 |
|
|
|
2892 |
|
|
|
|
|
2893 |
|
|
|
|
|
2894 |
|
2895 |
+
var core_browser_esm_jsx = function jsx(type, props) {
|
2896 |
+
var args = arguments;
|
2897 |
|
2898 |
+
if (props == null || !emotion_element_57a3a7a3_browser_esm_hasOwnProperty.call(props, 'css')) {
|
2899 |
+
// $FlowFixMe
|
2900 |
+
return external_React_["createElement"].apply(undefined, args);
|
2901 |
+
}
|
2902 |
|
2903 |
+
var argsLength = args.length;
|
2904 |
+
var createElementArgArray = new Array(argsLength);
|
2905 |
+
createElementArgArray[0] = Emotion;
|
2906 |
+
createElementArgArray[1] = createEmotionProps(type, props);
|
2907 |
|
2908 |
+
for (var i = 2; i < argsLength; i++) {
|
2909 |
+
createElementArgArray[i] = args[i];
|
2910 |
+
} // $FlowFixMe
|
2911 |
|
|
|
|
|
2912 |
|
2913 |
+
return external_React_["createElement"].apply(null, createElementArgArray);
|
2914 |
+
};
|
2915 |
|
2916 |
+
var warnedAboutCssPropForGlobal = false;
|
2917 |
+
var Global = /* #__PURE__ */emotion_element_57a3a7a3_browser_esm_withEmotionCache(function (props, cache) {
|
2918 |
+
if (false) {}
|
2919 |
|
2920 |
+
var styles = props.styles;
|
|
|
2921 |
|
2922 |
+
if (typeof styles === 'function') {
|
2923 |
+
return /*#__PURE__*/Object(external_React_["createElement"])(ThemeContext.Consumer, null, function (theme) {
|
2924 |
+
var serialized = Object(serialize_browser_esm["a" /* serializeStyles */])([styles(theme)]);
|
2925 |
+
return /*#__PURE__*/Object(external_React_["createElement"])(core_browser_esm_InnerGlobal, {
|
2926 |
+
serialized: serialized,
|
2927 |
+
cache: cache
|
2928 |
+
});
|
2929 |
+
});
|
2930 |
+
}
|
2931 |
|
2932 |
+
var serialized = Object(serialize_browser_esm["a" /* serializeStyles */])([styles]);
|
2933 |
+
return /*#__PURE__*/Object(external_React_["createElement"])(core_browser_esm_InnerGlobal, {
|
2934 |
+
serialized: serialized,
|
2935 |
+
cache: cache
|
2936 |
+
});
|
2937 |
+
});
|
2938 |
|
2939 |
+
// maintain place over rerenders.
|
2940 |
+
// initial render from browser, insertBefore context.sheet.tags[0] or if a style hasn't been inserted there yet, appendChild
|
2941 |
+
// initial client-side render from SSR, use place of hydrating tag
|
2942 |
+
var core_browser_esm_InnerGlobal = /*#__PURE__*/function (_React$Component) {
|
2943 |
+
Object(inheritsLoose["a" /* default */])(InnerGlobal, _React$Component);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2944 |
|
2945 |
+
function InnerGlobal(props, context, updater) {
|
2946 |
+
return _React$Component.call(this, props, context, updater) || this;
|
2947 |
+
}
|
|
|
2948 |
|
2949 |
+
var _proto = InnerGlobal.prototype;
|
|
|
2950 |
|
2951 |
+
_proto.componentDidMount = function componentDidMount() {
|
2952 |
+
this.sheet = new StyleSheet({
|
2953 |
+
key: this.props.cache.key + "-global",
|
2954 |
+
nonce: this.props.cache.sheet.nonce,
|
2955 |
+
container: this.props.cache.sheet.container
|
2956 |
+
}); // $FlowFixMe
|
2957 |
|
2958 |
+
var node = document.querySelector("style[data-emotion-" + this.props.cache.key + "=\"" + this.props.serialized.name + "\"]");
|
2959 |
|
2960 |
+
if (node !== null) {
|
2961 |
+
this.sheet.tags.push(node);
|
2962 |
+
}
|
2963 |
|
2964 |
+
if (this.props.cache.sheet.tags.length) {
|
2965 |
+
this.sheet.before = this.props.cache.sheet.tags[0];
|
2966 |
+
}
|
2967 |
|
2968 |
+
this.insertStyles();
|
2969 |
+
};
|
2970 |
|
2971 |
+
_proto.componentDidUpdate = function componentDidUpdate(prevProps) {
|
2972 |
+
if (prevProps.serialized.name !== this.props.serialized.name) {
|
2973 |
+
this.insertStyles();
|
2974 |
+
}
|
2975 |
+
};
|
2976 |
|
2977 |
+
_proto.insertStyles = function insertStyles$1() {
|
2978 |
+
if (this.props.serialized.next !== undefined) {
|
2979 |
+
// insert keyframes
|
2980 |
+
Object(utils_browser_esm["b" /* insertStyles */])(this.props.cache, this.props.serialized.next, true);
|
2981 |
+
}
|
2982 |
|
2983 |
+
if (this.sheet.tags.length) {
|
2984 |
+
// if this doesn't exist then it will be null so the style element will be appended
|
2985 |
+
var element = this.sheet.tags[this.sheet.tags.length - 1].nextElementSibling;
|
2986 |
+
this.sheet.before = element;
|
2987 |
+
this.sheet.flush();
|
2988 |
+
}
|
2989 |
|
2990 |
+
this.props.cache.insert("", this.props.serialized, this.sheet, false);
|
2991 |
+
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2992 |
|
2993 |
+
_proto.componentWillUnmount = function componentWillUnmount() {
|
2994 |
+
this.sheet.flush();
|
2995 |
+
};
|
2996 |
|
2997 |
+
_proto.render = function render() {
|
|
|
|
|
|
|
|
|
2998 |
|
2999 |
+
return null;
|
3000 |
+
};
|
|
|
|
|
|
|
3001 |
|
3002 |
+
return InnerGlobal;
|
3003 |
+
}(external_React_["Component"]);
|
3004 |
|
3005 |
+
var core_browser_esm_keyframes = function keyframes() {
|
3006 |
+
var insertable = css_browser_esm.apply(void 0, arguments);
|
3007 |
+
var name = "animation-" + insertable.name; // $FlowFixMe
|
3008 |
+
|
3009 |
+
return {
|
3010 |
+
name: name,
|
3011 |
+
styles: "@keyframes " + name + "{" + insertable.styles + "}",
|
3012 |
+
anim: 1,
|
3013 |
+
toString: function toString() {
|
3014 |
+
return "_EMO_" + this.name + "_" + this.styles + "_EMO_";
|
3015 |
+
}
|
3016 |
};
|
3017 |
+
};
|
3018 |
|
3019 |
+
var classnames = function classnames(args) {
|
3020 |
+
var len = args.length;
|
3021 |
+
var i = 0;
|
3022 |
+
var cls = '';
|
|
|
3023 |
|
3024 |
+
for (; i < len; i++) {
|
3025 |
+
var arg = args[i];
|
3026 |
+
if (arg == null) continue;
|
3027 |
+
var toAdd = void 0;
|
3028 |
|
3029 |
+
switch (typeof arg) {
|
3030 |
+
case 'boolean':
|
3031 |
+
break;
|
|
|
|
|
3032 |
|
3033 |
+
case 'object':
|
3034 |
+
{
|
3035 |
+
if (Array.isArray(arg)) {
|
3036 |
+
toAdd = classnames(arg);
|
3037 |
+
} else {
|
3038 |
+
toAdd = '';
|
|
|
|
|
3039 |
|
3040 |
+
for (var k in arg) {
|
3041 |
+
if (arg[k] && k) {
|
3042 |
+
toAdd && (toAdd += ' ');
|
3043 |
+
toAdd += k;
|
3044 |
+
}
|
3045 |
+
}
|
3046 |
+
}
|
3047 |
|
3048 |
+
break;
|
3049 |
+
}
|
3050 |
+
|
3051 |
+
default:
|
3052 |
+
{
|
3053 |
+
toAdd = arg;
|
3054 |
+
}
|
3055 |
+
}
|
3056 |
+
|
3057 |
+
if (toAdd) {
|
3058 |
+
cls && (cls += ' ');
|
3059 |
+
cls += toAdd;
|
3060 |
}
|
3061 |
}
|
3062 |
|
3063 |
+
return cls;
|
3064 |
+
};
|
3065 |
|
3066 |
+
function merge(registered, css, className) {
|
3067 |
+
var registeredStyles = [];
|
3068 |
+
var rawClassName = Object(utils_browser_esm["a" /* getRegisteredStyles */])(registered, registeredStyles, className);
|
|
|
|
|
|
|
|
|
3069 |
|
3070 |
+
if (registeredStyles.length < 2) {
|
3071 |
+
return className;
|
|
|
3072 |
}
|
3073 |
|
3074 |
+
return rawClassName + css(registeredStyles);
|
|
|
|
|
|
|
|
|
3075 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3076 |
|
3077 |
+
var ClassNames = emotion_element_57a3a7a3_browser_esm_withEmotionCache(function (props, context) {
|
3078 |
+
return /*#__PURE__*/Object(external_React_["createElement"])(ThemeContext.Consumer, null, function (theme) {
|
3079 |
+
var hasRendered = false;
|
3080 |
|
3081 |
+
var css = function css() {
|
3082 |
+
if (hasRendered && "production" !== 'production') {
|
3083 |
+
throw new Error('css can only be used during render');
|
3084 |
+
}
|
3085 |
|
3086 |
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
3087 |
+
args[_key] = arguments[_key];
|
3088 |
+
}
|
|
|
|
|
|
|
|
|
3089 |
|
3090 |
+
var serialized = Object(serialize_browser_esm["a" /* serializeStyles */])(args, context.registered);
|
3091 |
|
3092 |
+
{
|
3093 |
+
Object(utils_browser_esm["b" /* insertStyles */])(context, serialized, false);
|
3094 |
+
}
|
3095 |
|
3096 |
+
return context.key + "-" + serialized.name;
|
3097 |
+
};
|
|
|
|
|
|
|
3098 |
|
3099 |
+
var cx = function cx() {
|
3100 |
+
if (hasRendered && "production" !== 'production') {
|
3101 |
+
throw new Error('cx can only be used during render');
|
3102 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3103 |
|
3104 |
+
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
3105 |
+
args[_key2] = arguments[_key2];
|
3106 |
+
}
|
3107 |
|
3108 |
+
return merge(context.registered, css, classnames(args));
|
3109 |
+
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3110 |
|
3111 |
+
var content = {
|
3112 |
+
css: css,
|
3113 |
+
cx: cx,
|
3114 |
+
theme: theme
|
3115 |
+
};
|
3116 |
+
var ele = props.children(content);
|
3117 |
+
hasRendered = true;
|
3118 |
|
3119 |
+
return ele;
|
3120 |
+
});
|
3121 |
+
});
|
|
|
|
|
|
|
|
|
3122 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3123 |
|
|
|
|
|
|
|
|
|
|
|
|
|
3124 |
|
|
|
|
|
|
|
|
|
|
|
|
|
3125 |
|
3126 |
+
/***/ }),
|
3127 |
+
/* 49 */
|
3128 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
|
|
|
3129 |
|
3130 |
+
"use strict";
|
3131 |
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _arrayLikeToArray; });
|
3132 |
+
function _arrayLikeToArray(arr, len) {
|
3133 |
+
if (len == null || len > arr.length) len = arr.length;
|
3134 |
|
3135 |
+
for (var i = 0, arr2 = new Array(len); i < len; i++) {
|
3136 |
+
arr2[i] = arr[i];
|
3137 |
+
}
|
3138 |
|
3139 |
+
return arr2;
|
3140 |
+
}
|
3141 |
|
3142 |
+
/***/ }),
|
3143 |
+
/* 50 */
|
3144 |
+
/***/ (function(module, exports) {
|
3145 |
|
3146 |
+
(function() { module.exports = this["wc"]["tracks"]; }());
|
|
|
3147 |
|
3148 |
+
/***/ }),
|
3149 |
+
/* 51 */
|
3150 |
+
/***/ (function(module, exports) {
|
3151 |
|
3152 |
+
(function() { module.exports = this["wp"]["hooks"]; }());
|
|
|
3153 |
|
3154 |
+
/***/ }),
|
3155 |
+
/* 52 */
|
3156 |
+
/***/ (function(module, exports) {
|
3157 |
|
3158 |
+
function _typeof(obj) {
|
3159 |
+
"@babel/helpers - typeof";
|
3160 |
|
3161 |
+
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
|
3162 |
+
module.exports = _typeof = function _typeof(obj) {
|
3163 |
+
return typeof obj;
|
3164 |
+
};
|
3165 |
+
} else {
|
3166 |
+
module.exports = _typeof = function _typeof(obj) {
|
3167 |
+
return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
3168 |
+
};
|
3169 |
+
}
|
3170 |
|
3171 |
+
return _typeof(obj);
|
3172 |
+
}
|
3173 |
|
3174 |
+
module.exports = _typeof;
|
3175 |
|
3176 |
+
/***/ }),
|
3177 |
+
/* 53 */
|
3178 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
3179 |
|
3180 |
+
"use strict";
|
3181 |
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _inheritsLoose; });
|
3182 |
+
function _inheritsLoose(subClass, superClass) {
|
3183 |
+
subClass.prototype = Object.create(superClass.prototype);
|
3184 |
+
subClass.prototype.constructor = subClass;
|
3185 |
+
subClass.__proto__ = superClass;
|
3186 |
+
}
|
3187 |
|
3188 |
+
/***/ }),
|
3189 |
+
/* 54 */
|
3190 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
3191 |
|
3192 |
+
"use strict";
|
3193 |
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _objectWithoutPropertiesLoose; });
|
3194 |
+
function _objectWithoutPropertiesLoose(source, excluded) {
|
3195 |
+
if (source == null) return {};
|
3196 |
+
var target = {};
|
3197 |
+
var sourceKeys = Object.keys(source);
|
3198 |
+
var key, i;
|
3199 |
|
3200 |
+
for (i = 0; i < sourceKeys.length; i++) {
|
3201 |
+
key = sourceKeys[i];
|
3202 |
+
if (excluded.indexOf(key) >= 0) continue;
|
3203 |
+
target[key] = source[key];
|
3204 |
+
}
|
3205 |
|
3206 |
+
return target;
|
3207 |
+
}
|
3208 |
|
3209 |
+
/***/ }),
|
3210 |
+
/* 55 */,
|
3211 |
+
/* 56 */
|
3212 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
3213 |
|
3214 |
+
"use strict";
|
|
|
3215 |
|
3216 |
+
// EXPORTS
|
3217 |
+
__webpack_require__.d(__webpack_exports__, "c", function() { return /* binding */ context_useSlot; });
|
3218 |
+
__webpack_require__.d(__webpack_exports__, "a", function() { return /* binding */ Consumer; });
|
3219 |
|
3220 |
+
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/slicedToArray.js + 3 modules
|
3221 |
+
var slicedToArray = __webpack_require__(24);
|
3222 |
|
3223 |
+
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js + 3 modules
|
3224 |
+
var toConsumableArray = __webpack_require__(26);
|
3225 |
|
3226 |
+
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/classCallCheck.js
|
3227 |
+
var classCallCheck = __webpack_require__(16);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3228 |
|
3229 |
+
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/createClass.js
|
3230 |
+
var createClass = __webpack_require__(17);
|
3231 |
|
3232 |
+
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js
|
3233 |
+
var assertThisInitialized = __webpack_require__(12);
|
|
|
|
|
3234 |
|
3235 |
+
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/inherits.js + 1 modules
|
3236 |
+
var inherits = __webpack_require__(18);
|
3237 |
|
3238 |
+
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js
|
3239 |
+
var possibleConstructorReturn = __webpack_require__(21);
|
3240 |
|
3241 |
+
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js
|
3242 |
+
var getPrototypeOf = __webpack_require__(9);
|
3243 |
|
3244 |
+
// EXTERNAL MODULE: external {"this":["wp","element"]}
|
3245 |
+
var external_this_wp_element_ = __webpack_require__(0);
|
3246 |
|
3247 |
+
// EXTERNAL MODULE: external "lodash"
|
3248 |
+
var external_lodash_ = __webpack_require__(2);
|
3249 |
|
3250 |
+
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/typeof.js
|
3251 |
+
var esm_typeof = __webpack_require__(41);
|
3252 |
|
3253 |
+
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js
|
3254 |
+
var objectWithoutProperties = __webpack_require__(11);
|
3255 |
|
3256 |
+
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/defineProperty.js
|
3257 |
+
var defineProperty = __webpack_require__(6);
|
3258 |
|
3259 |
+
// EXTERNAL MODULE: ./node_modules/@wordpress/is-shallow-equal/lib/index.js
|
3260 |
+
var lib = __webpack_require__(65);
|
3261 |
+
var lib_default = /*#__PURE__*/__webpack_require__.n(lib);
|
3262 |
|
3263 |
+
// EXTERNAL MODULE: ./node_modules/@wordpress/components/build-module/slot-fill/bubbles-virtually/slot-fill-context.js
|
3264 |
+
var slot_fill_context = __webpack_require__(61);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3265 |
|
3266 |
+
// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/slot-fill/bubbles-virtually/slot-fill-provider.js
|
|
|
|
|
|
|
|
|
|
|
3267 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3268 |
|
|
|
|
|
|
|
|
|
|
|
|
|
3269 |
|
|
|
|
|
3270 |
|
|
|
|
|
|
|
3271 |
|
|
|
|
|
3272 |
|
|
|
3273 |
|
3274 |
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return Object(esm_typeof["a" /* default */])(key) === "symbol" ? key : String(key); }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3275 |
|
3276 |
+
function _toPrimitive(input, hint) { if (Object(esm_typeof["a" /* default */])(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (Object(esm_typeof["a" /* default */])(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
3277 |
|
3278 |
+
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; }
|
|
|
|
|
|
|
3279 |
|
3280 |
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { Object(defineProperty["a" /* default */])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3281 |
|
3282 |
+
/**
|
3283 |
+
* WordPress dependencies
|
3284 |
+
*/
|
3285 |
|
|
|
|
|
|
|
|
|
3286 |
|
3287 |
+
/**
|
3288 |
+
* Internal dependencies
|
3289 |
+
*/
|
3290 |
|
|
|
|
|
3291 |
|
|
|
3292 |
|
3293 |
+
function useSlotRegistry() {
|
3294 |
+
var _useState = Object(external_this_wp_element_["useState"])({}),
|
3295 |
+
_useState2 = Object(slicedToArray["a" /* default */])(_useState, 2),
|
3296 |
+
slots = _useState2[0],
|
3297 |
+
setSlots = _useState2[1];
|
3298 |
|
3299 |
+
var _useState3 = Object(external_this_wp_element_["useState"])({}),
|
3300 |
+
_useState4 = Object(slicedToArray["a" /* default */])(_useState3, 2),
|
3301 |
+
fills = _useState4[0],
|
3302 |
+
setFills = _useState4[1];
|
3303 |
|
3304 |
+
var registerSlot = Object(external_this_wp_element_["useCallback"])(function (name, ref, fillProps) {
|
3305 |
+
setSlots(function (prevSlots) {
|
3306 |
+
var slot = prevSlots[name] || {};
|
3307 |
+
return _objectSpread(_objectSpread({}, prevSlots), {}, Object(defineProperty["a" /* default */])({}, name, _objectSpread(_objectSpread({}, slot), {}, {
|
3308 |
+
ref: ref || slot.ref,
|
3309 |
+
fillProps: fillProps || slot.fillProps || {}
|
3310 |
+
})));
|
3311 |
+
});
|
3312 |
+
}, []);
|
3313 |
+
var unregisterSlot = Object(external_this_wp_element_["useCallback"])(function (name, ref) {
|
3314 |
+
setSlots(function (prevSlots) {
|
3315 |
+
var slot = prevSlots[name],
|
3316 |
+
nextSlots = Object(objectWithoutProperties["a" /* default */])(prevSlots, [name].map(_toPropertyKey)); // Make sure we're not unregistering a slot registered by another element
|
3317 |
+
// See https://github.com/WordPress/gutenberg/pull/19242#issuecomment-590295412
|
3318 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3319 |
|
3320 |
+
if ((slot === null || slot === void 0 ? void 0 : slot.ref) === ref) {
|
3321 |
+
return nextSlots;
|
|
|
|
|
3322 |
}
|
|
|
|
|
|
|
|
|
|
|
3323 |
|
3324 |
+
return prevSlots;
|
3325 |
+
});
|
3326 |
+
}, []);
|
3327 |
+
var updateSlot = Object(external_this_wp_element_["useCallback"])(function (name, fillProps) {
|
3328 |
+
var slot = slots[name];
|
3329 |
+
|
3330 |
+
if (!slot) {
|
3331 |
+
return;
|
3332 |
+
}
|
3333 |
+
|
3334 |
+
if (!lib_default()(slot.fillProps, fillProps)) {
|
3335 |
+
slot.fillProps = fillProps;
|
3336 |
+
var slotFills = fills[name];
|
3337 |
+
|
3338 |
+
if (slotFills) {
|
3339 |
+
// Force update fills
|
3340 |
+
slotFills.map(function (fill) {
|
3341 |
+
return fill.current.rerender();
|
3342 |
+
});
|
3343 |
+
}
|
3344 |
+
}
|
3345 |
+
}, [slots, fills]);
|
3346 |
+
var registerFill = Object(external_this_wp_element_["useCallback"])(function (name, ref) {
|
3347 |
+
setFills(function (prevFills) {
|
3348 |
+
return _objectSpread(_objectSpread({}, prevFills), {}, Object(defineProperty["a" /* default */])({}, name, [].concat(Object(toConsumableArray["a" /* default */])(prevFills[name] || []), [ref])));
|
3349 |
+
});
|
3350 |
+
}, []);
|
3351 |
+
var unregisterFill = Object(external_this_wp_element_["useCallback"])(function (name, ref) {
|
3352 |
+
setFills(function (prevFills) {
|
3353 |
+
if (prevFills[name]) {
|
3354 |
+
return _objectSpread(_objectSpread({}, prevFills), {}, Object(defineProperty["a" /* default */])({}, name, prevFills[name].filter(function (fillRef) {
|
3355 |
+
return fillRef !== ref;
|
3356 |
+
})));
|
3357 |
}
|
|
|
3358 |
|
3359 |
+
return prevFills;
|
3360 |
+
});
|
3361 |
+
}, []); // Memoizing the return value so it can be directly passed to Provider value
|
3362 |
+
|
3363 |
+
var registry = Object(external_this_wp_element_["useMemo"])(function () {
|
3364 |
+
return {
|
3365 |
+
slots: slots,
|
3366 |
+
fills: fills,
|
3367 |
+
registerSlot: registerSlot,
|
3368 |
+
updateSlot: updateSlot,
|
3369 |
+
unregisterSlot: unregisterSlot,
|
3370 |
+
registerFill: registerFill,
|
3371 |
+
unregisterFill: unregisterFill
|
3372 |
+
};
|
3373 |
+
}, [slots, fills, registerSlot, updateSlot, unregisterSlot, registerFill, unregisterFill]);
|
3374 |
+
return registry;
|
3375 |
}
|
|
|
|
|
|
|
|
|
3376 |
|
3377 |
+
function slot_fill_provider_SlotFillProvider(_ref) {
|
3378 |
+
var children = _ref.children;
|
3379 |
+
var registry = useSlotRegistry();
|
3380 |
+
return Object(external_this_wp_element_["createElement"])(slot_fill_context["a" /* default */].Provider, {
|
3381 |
+
value: registry
|
3382 |
+
}, children);
|
3383 |
+
}
|
3384 |
+
//# sourceMappingURL=slot-fill-provider.js.map
|
3385 |
+
// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/slot-fill/context.js
|
3386 |
+
|
3387 |
+
|
3388 |
+
|
3389 |
|
|
|
|
|
3390 |
|
|
|
|
|
3391 |
|
|
|
3392 |
|
3393 |
|
3394 |
|
3395 |
|
3396 |
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = Object(getPrototypeOf["a" /* default */])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = Object(getPrototypeOf["a" /* default */])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return Object(possibleConstructorReturn["a" /* default */])(this, result); }; }
|
3397 |
+
|
3398 |
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
|
3399 |
|
3400 |
/**
|
3401 |
* External dependencies
|
3406 |
*/
|
3407 |
|
3408 |
|
|
|
|
|
|
|
|
|
|
|
3409 |
/**
|
3410 |
* Internal dependencies
|
3411 |
*/
|
3412 |
|
3413 |
|
3414 |
+
var SlotFillContext = Object(external_this_wp_element_["createContext"])({
|
3415 |
+
registerSlot: function registerSlot() {},
|
3416 |
+
unregisterSlot: function unregisterSlot() {},
|
3417 |
+
registerFill: function registerFill() {},
|
3418 |
+
unregisterFill: function unregisterFill() {},
|
3419 |
+
getSlot: function getSlot() {},
|
3420 |
+
getFills: function getFills() {},
|
3421 |
+
subscribe: function subscribe() {}
|
3422 |
+
});
|
3423 |
+
var Provider = SlotFillContext.Provider,
|
3424 |
+
Consumer = SlotFillContext.Consumer;
|
3425 |
|
3426 |
+
var context_SlotFillProvider = /*#__PURE__*/function (_Component) {
|
3427 |
+
Object(inherits["a" /* default */])(SlotFillProvider, _Component);
|
3428 |
|
3429 |
+
var _super = _createSuper(SlotFillProvider);
|
3430 |
|
3431 |
+
function SlotFillProvider() {
|
3432 |
+
var _this;
|
3433 |
|
3434 |
+
Object(classCallCheck["a" /* default */])(this, SlotFillProvider);
|
3435 |
|
3436 |
+
_this = _super.apply(this, arguments);
|
3437 |
+
_this.registerSlot = _this.registerSlot.bind(Object(assertThisInitialized["a" /* default */])(_this));
|
3438 |
+
_this.registerFill = _this.registerFill.bind(Object(assertThisInitialized["a" /* default */])(_this));
|
3439 |
+
_this.unregisterSlot = _this.unregisterSlot.bind(Object(assertThisInitialized["a" /* default */])(_this));
|
3440 |
+
_this.unregisterFill = _this.unregisterFill.bind(Object(assertThisInitialized["a" /* default */])(_this));
|
3441 |
+
_this.getSlot = _this.getSlot.bind(Object(assertThisInitialized["a" /* default */])(_this));
|
3442 |
+
_this.getFills = _this.getFills.bind(Object(assertThisInitialized["a" /* default */])(_this));
|
3443 |
+
_this.hasFills = _this.hasFills.bind(Object(assertThisInitialized["a" /* default */])(_this));
|
3444 |
+
_this.subscribe = _this.subscribe.bind(Object(assertThisInitialized["a" /* default */])(_this));
|
3445 |
+
_this.slots = {};
|
3446 |
+
_this.fills = {};
|
3447 |
+
_this.listeners = [];
|
3448 |
+
_this.contextValue = {
|
3449 |
+
registerSlot: _this.registerSlot,
|
3450 |
+
unregisterSlot: _this.unregisterSlot,
|
3451 |
+
registerFill: _this.registerFill,
|
3452 |
+
unregisterFill: _this.unregisterFill,
|
3453 |
+
getSlot: _this.getSlot,
|
3454 |
+
getFills: _this.getFills,
|
3455 |
+
hasFills: _this.hasFills,
|
3456 |
+
subscribe: _this.subscribe
|
3457 |
+
};
|
3458 |
+
return _this;
|
3459 |
}
|
3460 |
|
3461 |
+
Object(createClass["a" /* default */])(SlotFillProvider, [{
|
3462 |
+
key: "registerSlot",
|
3463 |
+
value: function registerSlot(name, slot) {
|
3464 |
+
var previousSlot = this.slots[name];
|
3465 |
+
this.slots[name] = slot;
|
3466 |
+
this.triggerListeners(); // Sometimes the fills are registered after the initial render of slot
|
3467 |
+
// But before the registerSlot call, we need to rerender the slot
|
3468 |
|
3469 |
+
this.forceUpdateSlot(name); // If a new instance of a slot is being mounted while another with the
|
3470 |
+
// same name exists, force its update _after_ the new slot has been
|
3471 |
+
// assigned into the instance, such that its own rendering of children
|
3472 |
+
// will be empty (the new Slot will subsume all fills for this name).
|
3473 |
|
3474 |
+
if (previousSlot) {
|
3475 |
+
previousSlot.forceUpdate();
|
3476 |
+
}
|
3477 |
}
|
3478 |
+
}, {
|
3479 |
+
key: "registerFill",
|
3480 |
+
value: function registerFill(name, instance) {
|
3481 |
+
this.fills[name] = [].concat(Object(toConsumableArray["a" /* default */])(this.fills[name] || []), [instance]);
|
3482 |
+
this.forceUpdateSlot(name);
|
3483 |
}
|
3484 |
+
}, {
|
3485 |
+
key: "unregisterSlot",
|
3486 |
+
value: function unregisterSlot(name, instance) {
|
3487 |
+
// If a previous instance of a Slot by this name unmounts, do nothing,
|
3488 |
+
// as the slot and its fills should only be removed for the current
|
3489 |
+
// known instance.
|
3490 |
+
if (this.slots[name] !== instance) {
|
3491 |
+
return;
|
3492 |
}
|
3493 |
|
3494 |
+
delete this.slots[name];
|
3495 |
+
this.triggerListeners();
|
3496 |
+
}
|
3497 |
+
}, {
|
3498 |
+
key: "unregisterFill",
|
3499 |
+
value: function unregisterFill(name, instance) {
|
3500 |
+
this.fills[name] = Object(external_lodash_["without"])(this.fills[name], instance);
|
3501 |
+
this.resetFillOccurrence(name);
|
3502 |
+
this.forceUpdateSlot(name);
|
3503 |
}
|
3504 |
+
}, {
|
3505 |
+
key: "getSlot",
|
3506 |
+
value: function getSlot(name) {
|
3507 |
+
return this.slots[name];
|
3508 |
+
}
|
3509 |
+
}, {
|
3510 |
+
key: "getFills",
|
3511 |
+
value: function getFills(name, slotInstance) {
|
3512 |
+
// Fills should only be returned for the current instance of the slot
|
3513 |
+
// in which they occupy.
|
3514 |
+
if (this.slots[name] !== slotInstance) {
|
3515 |
+
return [];
|
3516 |
+
}
|
3517 |
|
3518 |
+
return Object(external_lodash_["sortBy"])(this.fills[name], 'occurrence');
|
3519 |
+
}
|
3520 |
+
}, {
|
3521 |
+
key: "hasFills",
|
3522 |
+
value: function hasFills(name) {
|
3523 |
+
return this.fills[name] && !!this.fills[name].length;
|
3524 |
+
}
|
3525 |
+
}, {
|
3526 |
+
key: "resetFillOccurrence",
|
3527 |
+
value: function resetFillOccurrence(name) {
|
3528 |
+
Object(external_lodash_["forEach"])(this.fills[name], function (instance) {
|
3529 |
+
instance.occurrence = undefined;
|
3530 |
+
});
|
3531 |
+
}
|
3532 |
+
}, {
|
3533 |
+
key: "forceUpdateSlot",
|
3534 |
+
value: function forceUpdateSlot(name) {
|
3535 |
+
var slot = this.getSlot(name);
|
3536 |
|
3537 |
+
if (slot) {
|
3538 |
+
slot.forceUpdate();
|
3539 |
+
}
|
3540 |
+
}
|
3541 |
+
}, {
|
3542 |
+
key: "triggerListeners",
|
3543 |
+
value: function triggerListeners() {
|
3544 |
+
this.listeners.forEach(function (listener) {
|
3545 |
+
return listener();
|
3546 |
+
});
|
3547 |
+
}
|
3548 |
+
}, {
|
3549 |
+
key: "subscribe",
|
3550 |
+
value: function subscribe(listener) {
|
3551 |
+
var _this2 = this;
|
3552 |
|
3553 |
+
this.listeners.push(listener);
|
3554 |
+
return function () {
|
3555 |
+
_this2.listeners = Object(external_lodash_["without"])(_this2.listeners, listener);
|
3556 |
+
};
|
3557 |
+
}
|
3558 |
+
}, {
|
3559 |
+
key: "render",
|
3560 |
+
value: function render() {
|
3561 |
+
return Object(external_this_wp_element_["createElement"])(Provider, {
|
3562 |
+
value: this.contextValue
|
3563 |
+
}, Object(external_this_wp_element_["createElement"])(slot_fill_provider_SlotFillProvider, null, this.props.children));
|
3564 |
}
|
3565 |
+
}]);
|
3566 |
|
3567 |
+
return SlotFillProvider;
|
3568 |
+
}(external_this_wp_element_["Component"]);
|
3569 |
+
/**
|
3570 |
+
* React hook returning the active slot given a name.
|
3571 |
+
*
|
3572 |
+
* @param {string} name Slot name.
|
3573 |
+
* @return {Object} Slot object.
|
3574 |
+
*/
|
3575 |
|
|
|
|
|
|
|
3576 |
|
3577 |
+
var context_useSlot = function useSlot(name) {
|
3578 |
+
var _useContext = Object(external_this_wp_element_["useContext"])(SlotFillContext),
|
3579 |
+
getSlot = _useContext.getSlot,
|
3580 |
+
subscribe = _useContext.subscribe;
|
3581 |
|
3582 |
+
var _useState = Object(external_this_wp_element_["useState"])(getSlot(name)),
|
3583 |
+
_useState2 = Object(slicedToArray["a" /* default */])(_useState, 2),
|
3584 |
+
slot = _useState2[0],
|
3585 |
+
setSlot = _useState2[1];
|
3586 |
|
3587 |
+
Object(external_this_wp_element_["useEffect"])(function () {
|
3588 |
+
setSlot(getSlot(name));
|
3589 |
+
var unsubscribe = subscribe(function () {
|
3590 |
+
setSlot(getSlot(name));
|
3591 |
+
});
|
3592 |
+
return unsubscribe;
|
3593 |
+
}, [name]);
|
3594 |
+
return slot;
|
3595 |
+
};
|
3596 |
+
/* harmony default export */ var context = __webpack_exports__["b"] = (context_SlotFillProvider);
|
3597 |
|
3598 |
+
//# sourceMappingURL=context.js.map
|
|
|
|
|
3599 |
|
3600 |
+
/***/ }),
|
3601 |
+
/* 57 */
|
3602 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
|
3603 |
|
3604 |
+
"use strict";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3605 |
|
3606 |
+
// EXPORTS
|
3607 |
+
__webpack_require__.d(__webpack_exports__, "e", function() { return /* binding */ TAB; });
|
3608 |
+
__webpack_require__.d(__webpack_exports__, "b", function() { return /* binding */ ESCAPE; });
|
3609 |
+
__webpack_require__.d(__webpack_exports__, "c", function() { return /* binding */ LEFT; });
|
3610 |
+
__webpack_require__.d(__webpack_exports__, "f", function() { return /* binding */ UP; });
|
3611 |
+
__webpack_require__.d(__webpack_exports__, "d", function() { return /* binding */ RIGHT; });
|
3612 |
+
__webpack_require__.d(__webpack_exports__, "a", function() { return /* binding */ DOWN; });
|
3613 |
|
3614 |
+
// UNUSED EXPORTS: BACKSPACE, ENTER, SPACE, DELETE, F10, ALT, CTRL, COMMAND, SHIFT, ZERO, modifiers, rawShortcut, displayShortcutList, displayShortcut, shortcutAriaLabel, isKeyboardEvent
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3615 |
|
3616 |
+
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/defineProperty.js
|
3617 |
+
var defineProperty = __webpack_require__(6);
|
|
|
|
|
3618 |
|
3619 |
+
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js + 3 modules
|
3620 |
+
var toConsumableArray = __webpack_require__(26);
|
|
|
|
|
|
|
3621 |
|
3622 |
+
// EXTERNAL MODULE: external "lodash"
|
3623 |
+
var external_lodash_ = __webpack_require__(2);
|
3624 |
|
3625 |
+
// EXTERNAL MODULE: external {"this":["wp","i18n"]}
|
3626 |
+
var external_this_wp_i18n_ = __webpack_require__(3);
|
3627 |
+
|
3628 |
+
// CONCATENATED MODULE: ./node_modules/@wordpress/components/node_modules/@wordpress/keycodes/build-module/platform.js
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3629 |
/**
|
3630 |
+
* External dependencies
|
|
|
|
|
|
|
|
|
|
|
3631 |
*/
|
3632 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3633 |
/**
|
3634 |
+
* Return true if platform is MacOS.
|
3635 |
*
|
3636 |
+
* @param {Object} _window window object by default; used for DI testing.
|
3637 |
+
*
|
3638 |
+
* @return {boolean} True if MacOS; false otherwise.
|
|
|
3639 |
*/
|
3640 |
|
3641 |
+
function isAppleOS() {
|
3642 |
+
var _window = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : window;
|
3643 |
|
3644 |
+
var platform = _window.navigator.platform;
|
3645 |
+
return platform.indexOf('Mac') !== -1 || Object(external_lodash_["includes"])(['iPad', 'iPhone'], platform);
|
|
|
|
|
|
|
|
|
3646 |
}
|
3647 |
+
//# sourceMappingURL=platform.js.map
|
3648 |
+
// CONCATENATED MODULE: ./node_modules/@wordpress/components/node_modules/@wordpress/keycodes/build-module/index.js
|
3649 |
+
|
3650 |
+
|
3651 |
+
|
3652 |
/**
|
3653 |
+
* Note: The order of the modifier keys in many of the [foo]Shortcut()
|
3654 |
+
* functions in this file are intentional and should not be changed. They're
|
3655 |
+
* designed to fit with the standard menu keyboard shortcuts shown in the
|
3656 |
+
* user's platform.
|
3657 |
*
|
3658 |
+
* For example, on MacOS menu shortcuts will place Shift before Command, but
|
3659 |
+
* on Windows Control will usually come first. So don't provide your own
|
3660 |
+
* shortcut combos directly to keyboardShortcut().
|
3661 |
*/
|
3662 |
|
3663 |
+
/**
|
3664 |
+
* External dependencies
|
3665 |
+
*/
|
3666 |
|
3667 |
+
/**
|
3668 |
+
* WordPress dependencies
|
3669 |
+
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
3670 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3671 |
|
3672 |
+
/**
|
3673 |
+
* Internal dependencies
|
3674 |
+
*/
|
|
|
3675 |
|
|
|
|
|
|
|
|
|
3676 |
|
3677 |
+
/**
|
3678 |
+
* @typedef {'primary'|'primaryShift'|'primaryAlt'|'secondary'|'access'|'ctrl'|'alt'|'ctrlShift'|'shift'|'shiftAlt'} WPKeycodeModifier
|
3679 |
+
*/
|
3680 |
|
3681 |
+
/**
|
3682 |
+
* An object of handler functions for each of the possible modifier
|
3683 |
+
* combinations. A handler will return a value for a given key.
|
3684 |
+
*
|
3685 |
+
* @typedef {Record<WPKeycodeModifier, (key:string)=>any>} WPKeycodeHandlerByModifier
|
3686 |
+
*/
|
3687 |
|
3688 |
+
/**
|
3689 |
+
* Keycode for BACKSPACE key.
|
3690 |
+
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3691 |
|
3692 |
+
var BACKSPACE = 8;
|
3693 |
+
/**
|
3694 |
+
* Keycode for TAB key.
|
3695 |
+
*/
|
3696 |
|
3697 |
+
var TAB = 9;
|
3698 |
+
/**
|
3699 |
+
* Keycode for ENTER key.
|
3700 |
+
*/
|
3701 |
|
3702 |
+
var ENTER = 13;
|
3703 |
+
/**
|
3704 |
+
* Keycode for ESCAPE key.
|
3705 |
+
*/
|
3706 |
|
3707 |
+
var ESCAPE = 27;
|
3708 |
+
/**
|
3709 |
+
* Keycode for SPACE key.
|
3710 |
+
*/
|
|
|
|
|
|
|
|
|
3711 |
|
3712 |
+
var SPACE = 32;
|
3713 |
+
/**
|
3714 |
+
* Keycode for LEFT key.
|
3715 |
+
*/
|
|
|
3716 |
|
3717 |
+
var LEFT = 37;
|
3718 |
+
/**
|
3719 |
+
* Keycode for UP key.
|
3720 |
+
*/
|
3721 |
|
3722 |
+
var UP = 38;
|
3723 |
+
/**
|
3724 |
+
* Keycode for RIGHT key.
|
3725 |
+
*/
|
3726 |
|
3727 |
+
var RIGHT = 39;
|
3728 |
+
/**
|
3729 |
+
* Keycode for DOWN key.
|
3730 |
+
*/
|
3731 |
|
3732 |
+
var DOWN = 40;
|
3733 |
+
/**
|
3734 |
+
* Keycode for DELETE key.
|
3735 |
+
*/
|
3736 |
|
3737 |
+
var DELETE = 46;
|
3738 |
+
/**
|
3739 |
+
* Keycode for F10 key.
|
3740 |
+
*/
|
|
|
|
|
|
|
3741 |
|
3742 |
+
var F10 = 121;
|
3743 |
+
/**
|
3744 |
+
* Keycode for ALT key.
|
3745 |
+
*/
|
3746 |
|
3747 |
+
var ALT = 'alt';
|
3748 |
+
/**
|
3749 |
+
* Keycode for CTRL key.
|
3750 |
+
*/
|
|
|
|
|
3751 |
|
3752 |
+
var CTRL = 'ctrl';
|
3753 |
+
/**
|
3754 |
+
* Keycode for COMMAND/META key.
|
3755 |
+
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3756 |
|
3757 |
+
var COMMAND = 'meta';
|
3758 |
+
/**
|
3759 |
+
* Keycode for SHIFT key.
|
3760 |
+
*/
|
|
|
|
|
|
|
|
|
3761 |
|
3762 |
+
var SHIFT = 'shift';
|
3763 |
+
/**
|
3764 |
+
* Keycode for ZERO key.
|
3765 |
+
*/
|
3766 |
|
3767 |
+
var ZERO = 48;
|
3768 |
+
/**
|
3769 |
+
* Object that contains functions that return the available modifier
|
3770 |
+
* depending on platform.
|
3771 |
+
*
|
3772 |
+
* - `primary`: takes a isApple function as a parameter.
|
3773 |
+
* - `primaryShift`: takes a isApple function as a parameter.
|
3774 |
+
* - `primaryAlt`: takes a isApple function as a parameter.
|
3775 |
+
* - `secondary`: takes a isApple function as a parameter.
|
3776 |
+
* - `access`: takes a isApple function as a parameter.
|
3777 |
+
* - `ctrl`
|
3778 |
+
* - `alt`
|
3779 |
+
* - `ctrlShift`
|
3780 |
+
* - `shift`
|
3781 |
+
* - `shiftAlt`
|
3782 |
+
*/
|
3783 |
|
3784 |
+
var modifiers = {
|
3785 |
+
primary: function primary(_isApple) {
|
3786 |
+
return _isApple() ? [COMMAND] : [CTRL];
|
3787 |
+
},
|
3788 |
+
primaryShift: function primaryShift(_isApple) {
|
3789 |
+
return _isApple() ? [SHIFT, COMMAND] : [CTRL, SHIFT];
|
3790 |
+
},
|
3791 |
+
primaryAlt: function primaryAlt(_isApple) {
|
3792 |
+
return _isApple() ? [ALT, COMMAND] : [CTRL, ALT];
|
3793 |
+
},
|
3794 |
+
secondary: function secondary(_isApple) {
|
3795 |
+
return _isApple() ? [SHIFT, ALT, COMMAND] : [CTRL, SHIFT, ALT];
|
3796 |
+
},
|
3797 |
+
access: function access(_isApple) {
|
3798 |
+
return _isApple() ? [CTRL, ALT] : [SHIFT, ALT];
|
3799 |
+
},
|
3800 |
+
ctrl: function ctrl() {
|
3801 |
+
return [CTRL];
|
3802 |
+
},
|
3803 |
+
alt: function alt() {
|
3804 |
+
return [ALT];
|
3805 |
+
},
|
3806 |
+
ctrlShift: function ctrlShift() {
|
3807 |
+
return [CTRL, SHIFT];
|
3808 |
+
},
|
3809 |
+
shift: function shift() {
|
3810 |
+
return [SHIFT];
|
3811 |
+
},
|
3812 |
+
shiftAlt: function shiftAlt() {
|
3813 |
+
return [SHIFT, ALT];
|
3814 |
+
}
|
3815 |
+
};
|
3816 |
+
/**
|
3817 |
+
* An object that contains functions to get raw shortcuts.
|
3818 |
+
* E.g. rawShortcut.primary( 'm' ) will return 'meta+m' on Mac.
|
3819 |
+
* These are intended for user with the KeyboardShortcuts component or TinyMCE.
|
3820 |
+
*
|
3821 |
+
* @type {WPKeycodeHandlerByModifier} Keyed map of functions to raw shortcuts.
|
3822 |
+
*/
|
3823 |
|
3824 |
+
var rawShortcut = Object(external_lodash_["mapValues"])(modifiers, function (modifier) {
|
3825 |
+
return function (character) {
|
3826 |
+
var _isApple = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : isAppleOS;
|
|
|
3827 |
|
3828 |
+
return [].concat(Object(toConsumableArray["a" /* default */])(modifier(_isApple)), [character.toLowerCase()]).join('+');
|
3829 |
+
};
|
3830 |
+
});
|
3831 |
+
/**
|
3832 |
+
* Return an array of the parts of a keyboard shortcut chord for display
|
3833 |
+
* E.g displayShortcutList.primary( 'm' ) will return [ '⌘', 'M' ] on Mac.
|
3834 |
+
*
|
3835 |
+
* @type {WPKeycodeHandlerByModifier} Keyed map of functions to shortcut
|
3836 |
+
* sequences.
|
3837 |
+
*/
|
3838 |
|
3839 |
+
var displayShortcutList = Object(external_lodash_["mapValues"])(modifiers, function (modifier) {
|
3840 |
+
return function (character) {
|
3841 |
+
var _replacementKeyMap;
|
|
|
|
|
|
|
3842 |
|
3843 |
+
var _isApple = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : isAppleOS;
|
3844 |
+
|
3845 |
+
var isApple = _isApple();
|
3846 |
+
|
3847 |
+
var replacementKeyMap = (_replacementKeyMap = {}, Object(defineProperty["a" /* default */])(_replacementKeyMap, ALT, isApple ? '⌥' : 'Alt'), Object(defineProperty["a" /* default */])(_replacementKeyMap, CTRL, isApple ? '⌃' : 'Ctrl'), Object(defineProperty["a" /* default */])(_replacementKeyMap, COMMAND, '⌘'), Object(defineProperty["a" /* default */])(_replacementKeyMap, SHIFT, isApple ? '⇧' : 'Shift'), _replacementKeyMap);
|
3848 |
+
var modifierKeys = modifier(_isApple).reduce(function (accumulator, key) {
|
3849 |
+
var replacementKey = Object(external_lodash_["get"])(replacementKeyMap, key, key); // If on the Mac, adhere to platform convention and don't show plus between keys.
|
3850 |
+
|
3851 |
+
if (isApple) {
|
3852 |
+
return [].concat(Object(toConsumableArray["a" /* default */])(accumulator), [replacementKey]);
|
3853 |
}
|
|
|
|
|
|
|
3854 |
|
3855 |
+
return [].concat(Object(toConsumableArray["a" /* default */])(accumulator), [replacementKey, '+']);
|
3856 |
+
}, []);
|
3857 |
+
var capitalizedCharacter = Object(external_lodash_["capitalize"])(character);
|
3858 |
+
return [].concat(Object(toConsumableArray["a" /* default */])(modifierKeys), [capitalizedCharacter]);
|
3859 |
+
};
|
3860 |
+
});
|
3861 |
+
/**
|
3862 |
+
* An object that contains functions to display shortcuts.
|
3863 |
+
* E.g. displayShortcut.primary( 'm' ) will return '⌘M' on Mac.
|
3864 |
+
*
|
3865 |
+
* @type {WPKeycodeHandlerByModifier} Keyed map of functions to display
|
3866 |
+
* shortcuts.
|
3867 |
+
*/
|
3868 |
|
3869 |
+
var displayShortcut = Object(external_lodash_["mapValues"])(displayShortcutList, function (shortcutList) {
|
3870 |
+
return function (character) {
|
3871 |
+
var _isApple = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : isAppleOS;
|
3872 |
|
3873 |
+
return shortcutList(character, _isApple).join('');
|
|
|
|
|
3874 |
};
|
3875 |
+
});
|
3876 |
+
/**
|
3877 |
+
* An object that contains functions to return an aria label for a keyboard shortcut.
|
3878 |
+
* E.g. shortcutAriaLabel.primary( '.' ) will return 'Command + Period' on Mac.
|
3879 |
+
*
|
3880 |
+
* @type {WPKeycodeHandlerByModifier} Keyed map of functions to shortcut ARIA
|
3881 |
+
* labels.
|
3882 |
+
*/
|
3883 |
|
3884 |
+
var shortcutAriaLabel = Object(external_lodash_["mapValues"])(modifiers, function (modifier) {
|
3885 |
+
return function (character) {
|
3886 |
+
var _replacementKeyMap2;
|
3887 |
|
3888 |
+
var _isApple = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : isAppleOS;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3889 |
|
3890 |
+
var isApple = _isApple();
|
|
|
|
|
3891 |
|
3892 |
+
var replacementKeyMap = (_replacementKeyMap2 = {}, Object(defineProperty["a" /* default */])(_replacementKeyMap2, SHIFT, 'Shift'), Object(defineProperty["a" /* default */])(_replacementKeyMap2, COMMAND, isApple ? 'Command' : 'Control'), Object(defineProperty["a" /* default */])(_replacementKeyMap2, CTRL, 'Control'), Object(defineProperty["a" /* default */])(_replacementKeyMap2, ALT, isApple ? 'Option' : 'Alt'), Object(defineProperty["a" /* default */])(_replacementKeyMap2, ',', Object(external_this_wp_i18n_["__"])('Comma')), Object(defineProperty["a" /* default */])(_replacementKeyMap2, '.', Object(external_this_wp_i18n_["__"])('Period')), Object(defineProperty["a" /* default */])(_replacementKeyMap2, '`', Object(external_this_wp_i18n_["__"])('Backtick')), _replacementKeyMap2);
|
3893 |
+
return [].concat(Object(toConsumableArray["a" /* default */])(modifier(_isApple)), [character]).map(function (key) {
|
3894 |
+
return Object(external_lodash_["capitalize"])(Object(external_lodash_["get"])(replacementKeyMap, key, key));
|
3895 |
+
}).join(isApple ? ' ' : ' + ');
|
3896 |
+
};
|
3897 |
+
});
|
3898 |
+
/**
|
3899 |
+
* From a given KeyboardEvent, returns an array of active modifier constants for
|
3900 |
+
* the event.
|
3901 |
+
*
|
3902 |
+
* @param {KeyboardEvent} event Keyboard event.
|
3903 |
+
*
|
3904 |
+
* @return {Array<ALT|CTRL|COMMAND|SHIFT>} Active modifier constants.
|
3905 |
+
*/
|
3906 |
|
3907 |
+
function getEventModifiers(event) {
|
3908 |
+
return [ALT, CTRL, COMMAND, SHIFT].filter(function (key) {
|
3909 |
+
return event["".concat(key, "Key")];
|
3910 |
+
});
|
3911 |
+
}
|
3912 |
+
/**
|
3913 |
+
* An object that contains functions to check if a keyboard event matches a
|
3914 |
+
* predefined shortcut combination.
|
3915 |
+
* E.g. isKeyboardEvent.primary( event, 'm' ) will return true if the event
|
3916 |
+
* signals pressing ⌘M.
|
3917 |
+
*
|
3918 |
+
* @type {WPKeycodeHandlerByModifier} Keyed map of functions to match events.
|
3919 |
+
*/
|
3920 |
|
|
|
|
|
|
|
|
|
|
|
|
|
3921 |
|
3922 |
+
var isKeyboardEvent = Object(external_lodash_["mapValues"])(modifiers, function (getModifiers) {
|
3923 |
+
return function (event, character) {
|
3924 |
+
var _isApple = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : isAppleOS;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3925 |
|
3926 |
+
var mods = getModifiers(_isApple);
|
3927 |
+
var eventMods = getEventModifiers(event);
|
3928 |
|
3929 |
+
if (Object(external_lodash_["xor"])(mods, eventMods).length) {
|
3930 |
+
return false;
|
|
|
|
|
|
|
|
|
3931 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3932 |
|
3933 |
+
if (!character) {
|
3934 |
+
return Object(external_lodash_["includes"])(mods, event.key.toLowerCase());
|
3935 |
+
}
|
3936 |
|
3937 |
+
return event.key === character;
|
3938 |
+
};
|
3939 |
+
});
|
3940 |
+
//# sourceMappingURL=index.js.map
|
|
|
3941 |
|
3942 |
+
/***/ }),
|
3943 |
+
/* 58 */
|
3944 |
+
/***/ (function(module, exports, __webpack_require__) {
|
3945 |
|
3946 |
+
var objectWithoutPropertiesLoose = __webpack_require__(150);
|
|
|
|
|
|
|
3947 |
|
3948 |
+
function _objectWithoutProperties(source, excluded) {
|
3949 |
+
if (source == null) return {};
|
3950 |
+
var target = objectWithoutPropertiesLoose(source, excluded);
|
3951 |
+
var key, i;
|
3952 |
|
3953 |
+
if (Object.getOwnPropertySymbols) {
|
3954 |
+
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3955 |
|
3956 |
+
for (i = 0; i < sourceSymbolKeys.length; i++) {
|
3957 |
+
key = sourceSymbolKeys[i];
|
3958 |
+
if (excluded.indexOf(key) >= 0) continue;
|
3959 |
+
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
3960 |
+
target[key] = source[key];
|
3961 |
+
}
|
3962 |
+
}
|
3963 |
+
|
3964 |
+
return target;
|
3965 |
+
}
|
3966 |
+
|
3967 |
+
module.exports = _objectWithoutProperties;
|
3968 |
|
3969 |
/***/ }),
|
3970 |
+
/* 59 */
|
3971 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
3972 |
|
3973 |
+
"use strict";
|
3974 |
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _unsupportedIterableToArray; });
|
3975 |
+
/* harmony import */ var _babel_runtime_helpers_esm_arrayLikeToArray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(49);
|
3976 |
|
3977 |
+
function _unsupportedIterableToArray(o, minLen) {
|
3978 |
+
if (!o) return;
|
3979 |
+
if (typeof o === "string") return Object(_babel_runtime_helpers_esm_arrayLikeToArray__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])(o, minLen);
|
3980 |
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
3981 |
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
3982 |
+
if (n === "Map" || n === "Set") return Array.from(o);
|
3983 |
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return Object(_babel_runtime_helpers_esm_arrayLikeToArray__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])(o, minLen);
|
3984 |
+
}
|
3985 |
|
3986 |
+
/***/ }),
|
3987 |
+
/* 60 */,
|
3988 |
+
/* 61 */
|
3989 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
3990 |
|
3991 |
+
"use strict";
|
3992 |
+
/* WEBPACK VAR INJECTION */(function(process) {/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0);
|
3993 |
+
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
|
3994 |
+
/* harmony import */ var _wordpress_warning__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(72);
|
3995 |
+
/**
|
3996 |
+
* WordPress dependencies
|
3997 |
+
*/
|
3998 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3999 |
|
4000 |
+
var SlotFillContext = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createContext"])({
|
4001 |
+
slots: {},
|
4002 |
+
fills: {},
|
4003 |
+
registerSlot: function registerSlot() {
|
4004 |
+
typeof process !== "undefined" && process.env && "production" !== "production" ? Object(_wordpress_warning__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"])('Components must be wrapped within `SlotFillProvider`. ' + 'See https://developer.wordpress.org/block-editor/components/slot-fill/') : void 0;
|
4005 |
+
},
|
4006 |
+
updateSlot: function updateSlot() {},
|
4007 |
+
unregisterSlot: function unregisterSlot() {},
|
4008 |
+
registerFill: function registerFill() {},
|
4009 |
+
unregisterFill: function unregisterFill() {}
|
4010 |
+
});
|
4011 |
+
/* harmony default export */ __webpack_exports__["a"] = (SlotFillContext);
|
4012 |
+
//# sourceMappingURL=slot-fill-context.js.map
|
4013 |
+
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(63)))
|
4014 |
|
4015 |
+
/***/ }),
|
4016 |
+
/* 62 */
|
4017 |
+
/***/ (function(module, exports) {
|
4018 |
|
4019 |
+
function _arrayLikeToArray(arr, len) {
|
4020 |
+
if (len == null || len > arr.length) len = arr.length;
|
|
|
4021 |
|
4022 |
+
for (var i = 0, arr2 = new Array(len); i < len; i++) {
|
4023 |
+
arr2[i] = arr[i];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4024 |
}
|
4025 |
|
4026 |
+
return arr2;
|
4027 |
+
}
|
|
|
|
|
4028 |
|
4029 |
+
module.exports = _arrayLikeToArray;
|
|
|
|
|
4030 |
|
4031 |
+
/***/ }),
|
4032 |
+
/* 63 */
|
4033 |
+
/***/ (function(module, exports) {
|
|
|
|
|
|
|
|
|
4034 |
|
4035 |
+
// shim for using process in browser
|
4036 |
+
var process = module.exports = {};
|
|
|
|
|
|
|
|
|
4037 |
|
4038 |
+
// cached from whatever global is present so that test runners that stub it
|
4039 |
+
// don't break things. But we need to wrap it in a try catch in case it is
|
4040 |
+
// wrapped in strict mode code which doesn't define any globals. It's inside a
|
4041 |
+
// function because try/catches deoptimize in certain engines.
|
|
|
|
|
|
|
|
|
|
|
4042 |
|
4043 |
+
var cachedSetTimeout;
|
4044 |
+
var cachedClearTimeout;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4045 |
|
4046 |
+
function defaultSetTimout() {
|
4047 |
+
throw new Error('setTimeout has not been defined');
|
4048 |
+
}
|
4049 |
+
function defaultClearTimeout () {
|
4050 |
+
throw new Error('clearTimeout has not been defined');
|
4051 |
+
}
|
4052 |
+
(function () {
|
4053 |
+
try {
|
4054 |
+
if (typeof setTimeout === 'function') {
|
4055 |
+
cachedSetTimeout = setTimeout;
|
4056 |
+
} else {
|
4057 |
+
cachedSetTimeout = defaultSetTimout;
|
4058 |
+
}
|
4059 |
+
} catch (e) {
|
4060 |
+
cachedSetTimeout = defaultSetTimout;
|
4061 |
+
}
|
4062 |
+
try {
|
4063 |
+
if (typeof clearTimeout === 'function') {
|
4064 |
+
cachedClearTimeout = clearTimeout;
|
4065 |
+
} else {
|
4066 |
+
cachedClearTimeout = defaultClearTimeout;
|
4067 |
+
}
|
4068 |
+
} catch (e) {
|
4069 |
+
cachedClearTimeout = defaultClearTimeout;
|
4070 |
+
}
|
4071 |
+
} ())
|
4072 |
+
function runTimeout(fun) {
|
4073 |
+
if (cachedSetTimeout === setTimeout) {
|
4074 |
+
//normal enviroments in sane situations
|
4075 |
+
return setTimeout(fun, 0);
|
4076 |
+
}
|
4077 |
+
// if setTimeout wasn't available but was latter defined
|
4078 |
+
if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
|
4079 |
+
cachedSetTimeout = setTimeout;
|
4080 |
+
return setTimeout(fun, 0);
|
4081 |
+
}
|
4082 |
+
try {
|
4083 |
+
// when when somebody has screwed with setTimeout but no I.E. maddness
|
4084 |
+
return cachedSetTimeout(fun, 0);
|
4085 |
+
} catch(e){
|
4086 |
+
try {
|
4087 |
+
// When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
|
4088 |
+
return cachedSetTimeout.call(null, fun, 0);
|
4089 |
+
} catch(e){
|
4090 |
+
// 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
|
4091 |
+
return cachedSetTimeout.call(this, fun, 0);
|
4092 |
+
}
|
4093 |
+
}
|
4094 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4095 |
|
4096 |
+
}
|
4097 |
+
function runClearTimeout(marker) {
|
4098 |
+
if (cachedClearTimeout === clearTimeout) {
|
4099 |
+
//normal enviroments in sane situations
|
4100 |
+
return clearTimeout(marker);
|
4101 |
+
}
|
4102 |
+
// if clearTimeout wasn't available but was latter defined
|
4103 |
+
if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {
|
4104 |
+
cachedClearTimeout = clearTimeout;
|
4105 |
+
return clearTimeout(marker);
|
4106 |
+
}
|
4107 |
+
try {
|
4108 |
+
// when when somebody has screwed with setTimeout but no I.E. maddness
|
4109 |
+
return cachedClearTimeout(marker);
|
4110 |
+
} catch (e){
|
4111 |
+
try {
|
4112 |
+
// When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
|
4113 |
+
return cachedClearTimeout.call(null, marker);
|
4114 |
+
} catch (e){
|
4115 |
+
// 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.
|
4116 |
+
// Some versions of I.E. have different rules for clearTimeout vs setTimeout
|
4117 |
+
return cachedClearTimeout.call(this, marker);
|
4118 |
+
}
|
4119 |
}
|
|
|
|
|
|
|
4120 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4121 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4122 |
|
4123 |
+
}
|
4124 |
+
var queue = [];
|
4125 |
+
var draining = false;
|
4126 |
+
var currentQueue;
|
4127 |
+
var queueIndex = -1;
|
4128 |
+
|
4129 |
+
function cleanUpNextTick() {
|
4130 |
+
if (!draining || !currentQueue) {
|
4131 |
+
return;
|
4132 |
+
}
|
4133 |
+
draining = false;
|
4134 |
+
if (currentQueue.length) {
|
4135 |
+
queue = currentQueue.concat(queue);
|
4136 |
+
} else {
|
4137 |
+
queueIndex = -1;
|
4138 |
+
}
|
4139 |
+
if (queue.length) {
|
4140 |
+
drainQueue();
|
4141 |
}
|
4142 |
+
}
|
4143 |
|
4144 |
+
function drainQueue() {
|
4145 |
+
if (draining) {
|
4146 |
+
return;
|
4147 |
+
}
|
4148 |
+
var timeout = runTimeout(cleanUpNextTick);
|
4149 |
+
draining = true;
|
4150 |
|
4151 |
+
var len = queue.length;
|
4152 |
+
while(len) {
|
4153 |
+
currentQueue = queue;
|
4154 |
+
queue = [];
|
4155 |
+
while (++queueIndex < len) {
|
4156 |
+
if (currentQueue) {
|
4157 |
+
currentQueue[queueIndex].run();
|
4158 |
+
}
|
4159 |
+
}
|
4160 |
+
queueIndex = -1;
|
4161 |
+
len = queue.length;
|
4162 |
+
}
|
4163 |
+
currentQueue = null;
|
4164 |
+
draining = false;
|
4165 |
+
runClearTimeout(timeout);
|
4166 |
+
}
|
4167 |
|
4168 |
+
process.nextTick = function (fun) {
|
4169 |
+
var args = new Array(arguments.length - 1);
|
4170 |
+
if (arguments.length > 1) {
|
4171 |
+
for (var i = 1; i < arguments.length; i++) {
|
4172 |
+
args[i - 1] = arguments[i];
|
4173 |
+
}
|
4174 |
+
}
|
4175 |
+
queue.push(new Item(fun, args));
|
4176 |
+
if (queue.length === 1 && !draining) {
|
4177 |
+
runTimeout(drainQueue);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4178 |
}
|
4179 |
+
};
|
4180 |
|
4181 |
+
// v8 likes predictible objects
|
4182 |
+
function Item(fun, array) {
|
4183 |
+
this.fun = fun;
|
4184 |
+
this.array = array;
|
4185 |
+
}
|
4186 |
+
Item.prototype.run = function () {
|
4187 |
+
this.fun.apply(null, this.array);
|
4188 |
+
};
|
4189 |
+
process.title = 'browser';
|
4190 |
+
process.browser = true;
|
4191 |
+
process.env = {};
|
4192 |
+
process.argv = [];
|
4193 |
+
process.version = ''; // empty string to avoid regexp issues
|
4194 |
+
process.versions = {};
|
4195 |
|
4196 |
+
function noop() {}
|
|
|
|
|
|
|
|
|
4197 |
|
4198 |
+
process.on = noop;
|
4199 |
+
process.addListener = noop;
|
4200 |
+
process.once = noop;
|
4201 |
+
process.off = noop;
|
4202 |
+
process.removeListener = noop;
|
4203 |
+
process.removeAllListeners = noop;
|
4204 |
+
process.emit = noop;
|
4205 |
+
process.prependListener = noop;
|
4206 |
+
process.prependOnceListener = noop;
|
4207 |
|
4208 |
+
process.listeners = function (name) { return [] }
|
|
|
|
|
|
|
4209 |
|
4210 |
+
process.binding = function (name) {
|
4211 |
+
throw new Error('process.binding is not supported');
|
4212 |
+
};
|
|
|
|
|
|
|
4213 |
|
4214 |
+
process.cwd = function () { return '/' };
|
4215 |
+
process.chdir = function (dir) {
|
4216 |
+
throw new Error('process.chdir is not supported');
|
4217 |
+
};
|
4218 |
+
process.umask = function() { return 0; };
|
4219 |
|
|
|
|
|
|
|
|
|
4220 |
|
4221 |
+
/***/ }),
|
4222 |
+
/* 64 */,
|
4223 |
+
/* 65 */
|
4224 |
+
/***/ (function(module, exports, __webpack_require__) {
|
4225 |
|
4226 |
+
"use strict";
|
|
|
|
|
|
|
4227 |
|
|
|
|
|
4228 |
|
4229 |
+
/**
|
4230 |
+
* Internal dependencies;
|
4231 |
+
*/
|
4232 |
+
var isShallowEqualObjects = __webpack_require__( 103 );
|
4233 |
+
var isShallowEqualArrays = __webpack_require__( 104 );
|
|
|
|
|
|
|
|
|
4234 |
|
4235 |
+
var isArray = Array.isArray;
|
|
|
|
|
|
|
4236 |
|
4237 |
+
/**
|
4238 |
+
* @typedef {Record<string, any>} ComparableObject
|
4239 |
+
*/
|
|
|
|
|
4240 |
|
4241 |
+
/**
|
4242 |
+
* Returns true if the two arrays or objects are shallow equal, or false
|
4243 |
+
* otherwise.
|
4244 |
+
*
|
4245 |
+
* @param {any[]|ComparableObject} a First object or array to compare.
|
4246 |
+
* @param {any[]|ComparableObject} b Second object or array to compare.
|
4247 |
+
*
|
4248 |
+
* @return {boolean} Whether the two values are shallow equal.
|
4249 |
+
*/
|
4250 |
+
function isShallowEqual( a, b ) {
|
4251 |
+
if ( a && b ) {
|
4252 |
+
if ( a.constructor === Object && b.constructor === Object ) {
|
4253 |
+
return isShallowEqualObjects( a, b );
|
4254 |
+
} else if ( isArray( a ) && isArray( b ) ) {
|
4255 |
+
return isShallowEqualArrays( a, b );
|
4256 |
+
}
|
4257 |
+
}
|
4258 |
|
4259 |
+
return a === b;
|
4260 |
+
}
|
|
|
4261 |
|
4262 |
+
module.exports = isShallowEqual;
|
4263 |
+
module.exports.isShallowEqualObjects = isShallowEqualObjects;
|
4264 |
+
module.exports.isShallowEqualArrays = isShallowEqualArrays;
|
4265 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4266 |
|
4267 |
+
/***/ }),
|
4268 |
+
/* 66 */,
|
4269 |
+
/* 67 */
|
4270 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
4271 |
|
4272 |
+
"use strict";
|
4273 |
+
/* unused harmony export Button */
|
4274 |
+
/* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(7);
|
4275 |
+
/* harmony import */ var _babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(11);
|
4276 |
+
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(0);
|
4277 |
+
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__);
|
4278 |
+
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(4);
|
4279 |
+
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_3__);
|
4280 |
+
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(2);
|
4281 |
+
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_4__);
|
4282 |
+
/* harmony import */ var _wordpress_deprecated__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(47);
|
4283 |
+
/* harmony import */ var _tooltip__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(133);
|
4284 |
+
/* harmony import */ var _icon__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(114);
|
4285 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4286 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4287 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4288 |
|
4289 |
+
function _createForOfIteratorHelper(o, allowArrayLike) { var it; if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = o[Symbol.iterator](); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
|
|
|
|
|
|
|
|
|
|
4290 |
|
4291 |
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
|
|
|
|
|
4292 |
|
4293 |
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
|
4294 |
|
4295 |
+
/**
|
4296 |
+
* External dependencies
|
4297 |
+
*/
|
4298 |
|
|
|
|
|
|
|
|
|
|
|
|
|
4299 |
|
4300 |
+
/**
|
4301 |
+
* WordPress dependencies
|
4302 |
+
*/
|
4303 |
|
|
|
|
|
|
|
|
|
|
|
|
|
4304 |
|
|
|
|
|
|
|
|
|
4305 |
|
4306 |
+
/**
|
4307 |
+
* Internal dependencies
|
4308 |
+
*/
|
4309 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4310 |
|
|
|
|
|
|
|
|
|
4311 |
|
4312 |
+
var disabledEventsOnDisabledButton = ['onMouseDown', 'onClick'];
|
4313 |
+
function Button(props, ref) {
|
4314 |
+
var href = props.href,
|
4315 |
+
target = props.target,
|
4316 |
+
isPrimary = props.isPrimary,
|
4317 |
+
isSmall = props.isSmall,
|
4318 |
+
isTertiary = props.isTertiary,
|
4319 |
+
isPressed = props.isPressed,
|
4320 |
+
isBusy = props.isBusy,
|
4321 |
+
isDefault = props.isDefault,
|
4322 |
+
isSecondary = props.isSecondary,
|
4323 |
+
isLink = props.isLink,
|
4324 |
+
isDestructive = props.isDestructive,
|
4325 |
+
className = props.className,
|
4326 |
+
disabled = props.disabled,
|
4327 |
+
icon = props.icon,
|
4328 |
+
iconSize = props.iconSize,
|
4329 |
+
showTooltip = props.showTooltip,
|
4330 |
+
tooltipPosition = props.tooltipPosition,
|
4331 |
+
shortcut = props.shortcut,
|
4332 |
+
label = props.label,
|
4333 |
+
children = props.children,
|
4334 |
+
isFocusable = props.__experimentalIsFocusable,
|
4335 |
+
additionalProps = Object(_babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"])(props, ["href", "target", "isPrimary", "isSmall", "isTertiary", "isPressed", "isBusy", "isDefault", "isSecondary", "isLink", "isDestructive", "className", "disabled", "icon", "iconSize", "showTooltip", "tooltipPosition", "shortcut", "label", "children", "__experimentalIsFocusable"]);
|
4336 |
+
|
4337 |
+
if (isDefault) {
|
4338 |
+
Object(_wordpress_deprecated__WEBPACK_IMPORTED_MODULE_5__[/* default */ "a"])('Button isDefault prop', {
|
4339 |
+
alternative: 'isSecondary'
|
4340 |
+
});
|
4341 |
}
|
4342 |
|
4343 |
+
var classes = classnames__WEBPACK_IMPORTED_MODULE_3___default()('components-button', className, {
|
4344 |
+
'is-secondary': isDefault || isSecondary,
|
4345 |
+
'is-primary': isPrimary,
|
4346 |
+
'is-small': isSmall,
|
4347 |
+
'is-tertiary': isTertiary,
|
4348 |
+
'is-pressed': isPressed,
|
4349 |
+
'is-busy': isBusy,
|
4350 |
+
'is-link': isLink,
|
4351 |
+
'is-destructive': isDestructive,
|
4352 |
+
'has-text': !!icon && !!children,
|
4353 |
+
'has-icon': !!icon
|
4354 |
+
});
|
4355 |
+
var trulyDisabled = disabled && !isFocusable;
|
4356 |
+
var Tag = href !== undefined && !trulyDisabled ? 'a' : 'button';
|
4357 |
+
var tagProps = Tag === 'a' ? {
|
4358 |
+
href: href,
|
4359 |
+
target: target
|
4360 |
+
} : {
|
4361 |
+
type: 'button',
|
4362 |
+
disabled: trulyDisabled,
|
4363 |
+
'aria-pressed': isPressed
|
4364 |
+
};
|
4365 |
|
4366 |
+
if (disabled && isFocusable) {
|
4367 |
+
// In this case, the button will be disabled, but still focusable and
|
4368 |
+
// perceivable by screen reader users.
|
4369 |
+
tagProps['aria-disabled'] = true;
|
4370 |
|
4371 |
+
var _iterator = _createForOfIteratorHelper(disabledEventsOnDisabledButton),
|
4372 |
+
_step;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4373 |
|
4374 |
+
try {
|
4375 |
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
4376 |
+
var disabledEvent = _step.value;
|
4377 |
|
4378 |
+
additionalProps[disabledEvent] = function (event) {
|
4379 |
+
event.stopPropagation();
|
4380 |
+
event.preventDefault();
|
4381 |
+
};
|
4382 |
+
}
|
4383 |
+
} catch (err) {
|
4384 |
+
_iterator.e(err);
|
4385 |
+
} finally {
|
4386 |
+
_iterator.f();
|
4387 |
}
|
4388 |
+
} // Should show the tooltip if...
|
4389 |
|
|
|
|
|
4390 |
|
4391 |
+
var shouldShowTooltip = !trulyDisabled && ( // an explicit tooltip is passed or...
|
4392 |
+
showTooltip && label || // there's a shortcut or...
|
4393 |
+
shortcut || // there's a label and...
|
4394 |
+
!!label && ( // the children are empty and...
|
4395 |
+
!children || Object(lodash__WEBPACK_IMPORTED_MODULE_4__["isArray"])(children) && !children.length) && // the tooltip is not explicitly disabled.
|
4396 |
+
false !== showTooltip);
|
4397 |
+
var element = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["createElement"])(Tag, Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])({}, tagProps, additionalProps, {
|
4398 |
+
className: classes,
|
4399 |
+
"aria-label": additionalProps['aria-label'] || label,
|
4400 |
+
ref: ref
|
4401 |
+
}), icon && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["createElement"])(_icon__WEBPACK_IMPORTED_MODULE_7__[/* default */ "a"], {
|
4402 |
+
icon: icon,
|
4403 |
+
size: iconSize
|
4404 |
+
}), children);
|
4405 |
|
4406 |
+
if (!shouldShowTooltip) {
|
4407 |
+
return element;
|
|
|
|
|
|
|
|
|
|
|
4408 |
}
|
4409 |
|
4410 |
+
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["createElement"])(_tooltip__WEBPACK_IMPORTED_MODULE_6__[/* default */ "a"], {
|
4411 |
+
text: label,
|
4412 |
+
shortcut: shortcut,
|
4413 |
+
position: tooltipPosition
|
4414 |
+
}, element);
|
4415 |
+
}
|
4416 |
+
/* harmony default export */ __webpack_exports__["a"] = (Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["forwardRef"])(Button));
|
4417 |
+
//# sourceMappingURL=index.js.map
|
4418 |
|
4419 |
+
/***/ }),
|
4420 |
+
/* 68 */
|
4421 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4422 |
|
4423 |
+
"use strict";
|
|
|
|
|
|
|
|
|
|
|
|
|
4424 |
|
4425 |
+
// EXPORTS
|
4426 |
+
__webpack_require__.d(__webpack_exports__, "a", function() { return /* binding */ build_module_focus; });
|
|
|
|
|
|
|
|
|
4427 |
|
4428 |
+
// UNUSED EXPORTS: isHorizontalEdge, isVerticalEdge, getRectangleFromRange, computeCaretRect, placeCaretAtHorizontalEdge, placeCaretAtVerticalEdge, isTextField, isNumberInput, documentHasTextSelection, documentHasUncollapsedSelection, documentHasSelection, isEntirelySelected, getScrollContainer, getOffsetParent, replace, remove, insertAfter, unwrap, replaceTag, wrap, __unstableStripHTML, isEmpty, removeInvalidHTML, getPhrasingContentSchema, isPhrasingContent, isTextContent
|
|
|
|
|
4429 |
|
4430 |
+
// NAMESPACE OBJECT: ./node_modules/@wordpress/components/node_modules/@wordpress/dom/build-module/focusable.js
|
4431 |
+
var focusable_namespaceObject = {};
|
4432 |
+
__webpack_require__.r(focusable_namespaceObject);
|
4433 |
+
__webpack_require__.d(focusable_namespaceObject, "find", function() { return find; });
|
|
|
|
|
|
|
|
|
|
|
4434 |
|
4435 |
+
// NAMESPACE OBJECT: ./node_modules/@wordpress/components/node_modules/@wordpress/dom/build-module/tabbable.js
|
4436 |
+
var tabbable_namespaceObject = {};
|
4437 |
+
__webpack_require__.r(tabbable_namespaceObject);
|
4438 |
+
__webpack_require__.d(tabbable_namespaceObject, "isTabbableIndex", function() { return isTabbableIndex; });
|
4439 |
+
__webpack_require__.d(tabbable_namespaceObject, "find", function() { return tabbable_find; });
|
4440 |
+
__webpack_require__.d(tabbable_namespaceObject, "findPrevious", function() { return findPrevious; });
|
4441 |
+
__webpack_require__.d(tabbable_namespaceObject, "findNext", function() { return findNext; });
|
4442 |
|
4443 |
+
// CONCATENATED MODULE: ./node_modules/@wordpress/components/node_modules/@wordpress/dom/build-module/focusable.js
|
4444 |
+
/**
|
4445 |
+
* References:
|
4446 |
+
*
|
4447 |
+
* Focusable:
|
4448 |
+
* - https://www.w3.org/TR/html5/editing.html#focus-management
|
4449 |
+
*
|
4450 |
+
* Sequential focus navigation:
|
4451 |
+
* - https://www.w3.org/TR/html5/editing.html#sequential-focus-navigation-and-the-tabindex-attribute
|
4452 |
+
*
|
4453 |
+
* Disabled elements:
|
4454 |
+
* - https://www.w3.org/TR/html5/disabled-elements.html#disabled-elements
|
4455 |
+
*
|
4456 |
+
* getClientRects algorithm (requiring layout box):
|
4457 |
+
* - https://www.w3.org/TR/cssom-view-1/#extension-to-the-element-interface
|
4458 |
+
*
|
4459 |
+
* AREA elements associated with an IMG:
|
4460 |
+
* - https://w3c.github.io/html/editing.html#data-model
|
4461 |
+
*/
|
4462 |
+
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(',');
|
4463 |
+
/**
|
4464 |
+
* Returns true if the specified element is visible (i.e. neither display: none
|
4465 |
+
* nor visibility: hidden).
|
4466 |
+
*
|
4467 |
+
* @param {Element} element DOM element to test.
|
4468 |
+
*
|
4469 |
+
* @return {boolean} Whether element is visible.
|
4470 |
+
*/
|
4471 |
|
4472 |
+
function isVisible(element) {
|
4473 |
+
return element.offsetWidth > 0 || element.offsetHeight > 0 || element.getClientRects().length > 0;
|
4474 |
+
}
|
4475 |
+
/**
|
4476 |
+
* Returns true if the specified element should be skipped from focusable elements.
|
4477 |
+
* For now it rather specific for `iframes` and if tabindex attribute is set to -1.
|
4478 |
+
*
|
4479 |
+
* @param {Element} element DOM element to test.
|
4480 |
+
*
|
4481 |
+
* @return {boolean} Whether element should be skipped from focusable elements.
|
4482 |
+
*/
|
4483 |
|
|
|
|
|
|
|
|
|
4484 |
|
4485 |
+
function skipFocus(element) {
|
4486 |
+
return element.nodeName.toLowerCase() === 'iframe' && element.getAttribute('tabindex') === '-1';
|
4487 |
+
}
|
4488 |
+
/**
|
4489 |
+
* Returns true if the specified area element is a valid focusable element, or
|
4490 |
+
* false otherwise. Area is only focusable if within a map where a named map
|
4491 |
+
* referenced by an image somewhere in the document.
|
4492 |
+
*
|
4493 |
+
* @param {Element} element DOM area element to test.
|
4494 |
+
*
|
4495 |
+
* @return {boolean} Whether area element is valid for focus.
|
4496 |
+
*/
|
4497 |
|
|
|
|
|
4498 |
|
4499 |
+
function isValidFocusableArea(element) {
|
4500 |
+
var map = element.closest('map[name]');
|
|
|
|
|
|
|
|
|
|
|
|
|
4501 |
|
4502 |
+
if (!map) {
|
4503 |
+
return false;
|
4504 |
+
}
|
4505 |
|
4506 |
+
var img = element.ownerDocument.querySelector('img[usemap="#' + map.name + '"]');
|
4507 |
+
return !!img && isVisible(img);
|
4508 |
+
}
|
4509 |
+
/**
|
4510 |
+
* Returns all focusable elements within a given context.
|
4511 |
+
*
|
4512 |
+
* @param {Element} context Element in which to search.
|
4513 |
+
*
|
4514 |
+
* @return {Element[]} Focusable elements.
|
4515 |
+
*/
|
4516 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4517 |
|
4518 |
+
function find(context) {
|
4519 |
+
var elements = context.querySelectorAll(SELECTOR);
|
4520 |
+
return Array.from(elements).filter(function (element) {
|
4521 |
+
if (!isVisible(element) || skipFocus(element)) {
|
4522 |
+
return false;
|
4523 |
+
}
|
4524 |
|
4525 |
+
var nodeName = element.nodeName;
|
|
|
|
|
|
|
|
|
4526 |
|
4527 |
+
if ('AREA' === nodeName) {
|
4528 |
+
return isValidFocusableArea(element);
|
4529 |
+
}
|
4530 |
|
4531 |
+
return true;
|
4532 |
+
});
|
4533 |
+
}
|
4534 |
+
//# sourceMappingURL=focusable.js.map
|
4535 |
+
// EXTERNAL MODULE: external "lodash"
|
4536 |
+
var external_lodash_ = __webpack_require__(2);
|
4537 |
|
4538 |
+
// CONCATENATED MODULE: ./node_modules/@wordpress/components/node_modules/@wordpress/dom/build-module/tabbable.js
|
4539 |
+
/**
|
4540 |
+
* External dependencies
|
4541 |
+
*/
|
|
|
4542 |
|
4543 |
+
/**
|
4544 |
+
* Internal dependencies
|
4545 |
+
*/
|
|
|
|
|
|
|
4546 |
|
|
|
|
|
4547 |
|
4548 |
+
/**
|
4549 |
+
* Returns the tab index of the given element. In contrast with the tabIndex
|
4550 |
+
* property, this normalizes the default (0) to avoid browser inconsistencies,
|
4551 |
+
* operating under the assumption that this function is only ever called with a
|
4552 |
+
* focusable node.
|
4553 |
+
*
|
4554 |
+
* @see https://bugzilla.mozilla.org/show_bug.cgi?id=1190261
|
4555 |
+
*
|
4556 |
+
* @param {Element} element Element from which to retrieve.
|
4557 |
+
*
|
4558 |
+
* @return {?number} Tab index of element (default 0).
|
4559 |
+
*/
|
4560 |
|
4561 |
+
function getTabIndex(element) {
|
4562 |
+
var tabIndex = element.getAttribute('tabindex');
|
4563 |
+
return tabIndex === null ? 0 : parseInt(tabIndex, 10);
|
4564 |
+
}
|
4565 |
+
/**
|
4566 |
+
* Returns true if the specified element is tabbable, or false otherwise.
|
4567 |
+
*
|
4568 |
+
* @param {Element} element Element to test.
|
4569 |
+
*
|
4570 |
+
* @return {boolean} Whether element is tabbable.
|
4571 |
+
*/
|
4572 |
|
|
|
|
|
|
|
4573 |
|
4574 |
+
function isTabbableIndex(element) {
|
4575 |
+
return getTabIndex(element) !== -1;
|
4576 |
+
}
|
4577 |
+
/**
|
4578 |
+
* Returns a stateful reducer function which constructs a filtered array of
|
4579 |
+
* tabbable elements, where at most one radio input is selected for a given
|
4580 |
+
* name, giving priority to checked input, falling back to the first
|
4581 |
+
* encountered.
|
4582 |
+
*
|
4583 |
+
* @return {Function} Radio group collapse reducer.
|
4584 |
+
*/
|
4585 |
|
4586 |
+
function createStatefulCollapseRadioGroup() {
|
4587 |
+
var CHOSEN_RADIO_BY_NAME = {};
|
4588 |
+
return function collapseRadioGroup(result, element) {
|
4589 |
+
var nodeName = element.nodeName,
|
4590 |
+
type = element.type,
|
4591 |
+
checked = element.checked,
|
4592 |
+
name = element.name; // For all non-radio tabbables, construct to array by concatenating.
|
4593 |
|
4594 |
+
if (nodeName !== 'INPUT' || type !== 'radio' || !name) {
|
4595 |
+
return result.concat(element);
|
4596 |
+
}
|
|
|
4597 |
|
4598 |
+
var hasChosen = CHOSEN_RADIO_BY_NAME.hasOwnProperty(name); // Omit by skipping concatenation if the radio element is not chosen.
|
|
|
|
|
|
|
|
|
|
|
4599 |
|
4600 |
+
var isChosen = checked || !hasChosen;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4601 |
|
4602 |
+
if (!isChosen) {
|
4603 |
+
return result;
|
4604 |
+
} // At this point, if there had been a chosen element, the current
|
4605 |
+
// element is checked and should take priority. Retroactively remove
|
4606 |
+
// the element which had previously been considered the chosen one.
|
|
|
|
|
|
|
|
|
4607 |
|
|
|
|
|
|
|
4608 |
|
4609 |
+
if (hasChosen) {
|
4610 |
+
var hadChosenElement = CHOSEN_RADIO_BY_NAME[name];
|
4611 |
+
result = Object(external_lodash_["without"])(result, hadChosenElement);
|
4612 |
+
}
|
|
|
4613 |
|
4614 |
+
CHOSEN_RADIO_BY_NAME[name] = element;
|
4615 |
+
return result.concat(element);
|
4616 |
+
};
|
4617 |
+
}
|
4618 |
+
/**
|
4619 |
+
* An array map callback, returning an object with the element value and its
|
4620 |
+
* array index location as properties. This is used to emulate a proper stable
|
4621 |
+
* sort where equal tabIndex should be left in order of their occurrence in the
|
4622 |
+
* document.
|
4623 |
+
*
|
4624 |
+
* @param {Element} element Element.
|
4625 |
+
* @param {number} index Array index of element.
|
4626 |
+
*
|
4627 |
+
* @return {Object} Mapped object with element, index.
|
4628 |
+
*/
|
4629 |
|
|
|
|
|
|
|
|
|
4630 |
|
4631 |
+
function mapElementToObjectTabbable(element, index) {
|
4632 |
+
return {
|
4633 |
+
element: element,
|
4634 |
+
index: index
|
4635 |
+
};
|
4636 |
+
}
|
4637 |
+
/**
|
4638 |
+
* An array map callback, returning an element of the given mapped object's
|
4639 |
+
* element value.
|
4640 |
+
*
|
4641 |
+
* @param {Object} object Mapped object with index.
|
4642 |
+
*
|
4643 |
+
* @return {Element} Mapped object element.
|
4644 |
+
*/
|
4645 |
|
|
|
|
|
4646 |
|
4647 |
+
function mapObjectTabbableToElement(object) {
|
4648 |
+
return object.element;
|
4649 |
+
}
|
4650 |
+
/**
|
4651 |
+
* A sort comparator function used in comparing two objects of mapped elements.
|
4652 |
+
*
|
4653 |
+
* @see mapElementToObjectTabbable
|
4654 |
+
*
|
4655 |
+
* @param {Object} a First object to compare.
|
4656 |
+
* @param {Object} b Second object to compare.
|
4657 |
+
*
|
4658 |
+
* @return {number} Comparator result.
|
4659 |
+
*/
|
4660 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4661 |
|
4662 |
+
function compareObjectTabbables(a, b) {
|
4663 |
+
var aTabIndex = getTabIndex(a.element);
|
4664 |
+
var bTabIndex = getTabIndex(b.element);
|
|
|
4665 |
|
4666 |
+
if (aTabIndex === bTabIndex) {
|
4667 |
+
return a.index - b.index;
|
4668 |
+
}
|
|
|
|
|
|
|
4669 |
|
4670 |
+
return aTabIndex - bTabIndex;
|
4671 |
+
}
|
4672 |
+
/**
|
4673 |
+
* Givin focusable elements, filters out tabbable element.
|
4674 |
+
*
|
4675 |
+
* @param {Array} focusables Focusable elements to filter.
|
4676 |
+
*
|
4677 |
+
* @return {Array} Tabbable elements.
|
4678 |
+
*/
|
4679 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4680 |
|
4681 |
+
function filterTabbable(focusables) {
|
4682 |
+
return focusables.filter(isTabbableIndex).map(mapElementToObjectTabbable).sort(compareObjectTabbables).map(mapObjectTabbableToElement).reduce(createStatefulCollapseRadioGroup(), []);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4683 |
}
|
4684 |
|
4685 |
+
function tabbable_find(context) {
|
4686 |
+
return filterTabbable(find(context));
|
4687 |
+
}
|
|
|
|
|
|
|
|
|
4688 |
/**
|
4689 |
+
* Given a focusable element, find the preceding tabbable element.
|
4690 |
*
|
4691 |
+
* @param {Element} element The focusable element before which to look. Defaults
|
4692 |
+
* to the active element.
|
4693 |
*/
|
4694 |
|
4695 |
+
function findPrevious(element) {
|
4696 |
+
var focusables = find(element.ownerDocument.body);
|
4697 |
+
var index = focusables.indexOf(element); // Remove all focusables after and including `element`.
|
4698 |
|
4699 |
+
focusables.length = index;
|
4700 |
+
return Object(external_lodash_["last"])(filterTabbable(focusables));
|
4701 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4702 |
/**
|
4703 |
+
* Given a focusable element, find the next tabbable element.
|
4704 |
*
|
4705 |
+
* @param {Element} element The focusable element after which to look. Defaults
|
4706 |
+
* to the active element.
|
4707 |
*/
|
4708 |
|
4709 |
+
function findNext(element) {
|
4710 |
+
var focusables = find(element.ownerDocument.body);
|
4711 |
+
var index = focusables.indexOf(element); // Remove all focusables before and inside `element`.
|
4712 |
|
4713 |
+
var remaining = focusables.slice(index + 1).filter(function (node) {
|
4714 |
+
return !element.contains(node);
|
4715 |
+
});
|
4716 |
+
return Object(external_lodash_["first"])(filterTabbable(remaining));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4717 |
}
|
4718 |
+
//# sourceMappingURL=tabbable.js.map
|
4719 |
+
// CONCATENATED MODULE: ./node_modules/@wordpress/components/node_modules/@wordpress/dom/build-module/index.js
|
4720 |
+
/**
|
4721 |
+
* Internal dependencies
|
4722 |
+
*/
|
4723 |
|
|
|
4724 |
|
4725 |
+
/**
|
4726 |
+
* Object grouping `focusable` and `tabbable` utils
|
4727 |
+
* under the keys with the same name.
|
4728 |
+
*/
|
4729 |
|
4730 |
+
var build_module_focus = {
|
4731 |
+
focusable: focusable_namespaceObject,
|
4732 |
+
tabbable: tabbable_namespaceObject
|
4733 |
+
};
|
4734 |
|
|
|
|
|
|
|
4735 |
|
4736 |
+
//# sourceMappingURL=index.js.map
|
4737 |
|
4738 |
/***/ }),
|
4739 |
+
/* 69 */
|
4740 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
4741 |
|
4742 |
+
"use strict";
|
4743 |
+
/* unused harmony export getPhrasingContentSchema */
|
4744 |
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return isPhrasingContent; });
|
4745 |
+
/* unused harmony export isTextContent */
|
4746 |
+
/* harmony import */ var _babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6);
|
4747 |
+
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(2);
|
4748 |
+
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_1__);
|
|
|
|
|
|
|
4749 |
|
|
|
|
|
4750 |
|
4751 |
+
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; }
|
4752 |
|
4753 |
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
4754 |
|
4755 |
+
/**
|
4756 |
+
* External dependencies
|
4757 |
+
*/
|
4758 |
|
4759 |
/**
|
4760 |
+
* All phrasing content elements.
|
|
|
|
|
|
|
4761 |
*
|
4762 |
+
* @see https://www.w3.org/TR/2011/WD-html5-20110525/content-models.html#phrasing-content-0
|
4763 |
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4764 |
|
4765 |
/**
|
4766 |
+
* All text-level semantic elements.
|
|
|
|
|
|
|
4767 |
*
|
4768 |
+
* @see https://html.spec.whatwg.org/multipage/text-level-semantics.html
|
4769 |
*/
|
|
|
|
|
4770 |
|
4771 |
+
var textContentSchema = {
|
4772 |
+
strong: {},
|
4773 |
+
em: {},
|
4774 |
+
s: {},
|
4775 |
+
del: {},
|
4776 |
+
ins: {},
|
4777 |
+
a: {
|
4778 |
+
attributes: ['href', 'target', 'rel']
|
4779 |
+
},
|
4780 |
+
code: {},
|
4781 |
+
abbr: {
|
4782 |
+
attributes: ['title']
|
4783 |
+
},
|
4784 |
+
sub: {},
|
4785 |
+
sup: {},
|
4786 |
+
br: {},
|
4787 |
+
small: {},
|
4788 |
+
// To do: fix blockquote.
|
4789 |
+
// cite: {},
|
4790 |
+
q: {
|
4791 |
+
attributes: ['cite']
|
4792 |
+
},
|
4793 |
+
dfn: {
|
4794 |
+
attributes: ['title']
|
4795 |
+
},
|
4796 |
+
data: {
|
4797 |
+
attributes: ['value']
|
4798 |
+
},
|
4799 |
+
time: {
|
4800 |
+
attributes: ['datetime']
|
4801 |
+
},
|
4802 |
+
var: {},
|
4803 |
+
samp: {},
|
4804 |
+
kbd: {},
|
4805 |
+
i: {},
|
4806 |
+
b: {},
|
4807 |
+
u: {},
|
4808 |
+
mark: {},
|
4809 |
+
ruby: {},
|
4810 |
+
rt: {},
|
4811 |
+
rp: {},
|
4812 |
+
bdi: {
|
4813 |
+
attributes: ['dir']
|
4814 |
+
},
|
4815 |
+
bdo: {
|
4816 |
+
attributes: ['dir']
|
4817 |
+
},
|
4818 |
+
wbr: {},
|
4819 |
+
'#text': {}
|
4820 |
+
}; // Recursion is needed.
|
4821 |
+
// Possible: strong > em > strong.
|
4822 |
+
// Impossible: strong > strong.
|
4823 |
|
4824 |
+
Object(lodash__WEBPACK_IMPORTED_MODULE_1__["without"])(Object.keys(textContentSchema), '#text', 'br').forEach(function (tag) {
|
4825 |
+
textContentSchema[tag].children = Object(lodash__WEBPACK_IMPORTED_MODULE_1__["omit"])(textContentSchema, tag);
|
4826 |
+
});
|
4827 |
+
/**
|
4828 |
+
* Embedded content elements.
|
4829 |
+
*
|
4830 |
+
* @see https://www.w3.org/TR/2011/WD-html5-20110525/content-models.html#embedded-content-0
|
4831 |
+
*/
|
4832 |
|
4833 |
+
var embeddedContentSchema = {
|
4834 |
+
audio: {
|
4835 |
+
attributes: ['src', 'preload', 'autoplay', 'mediagroup', 'loop', 'muted']
|
4836 |
+
},
|
4837 |
+
canvas: {
|
4838 |
+
attributes: ['width', 'height']
|
4839 |
+
},
|
4840 |
+
embed: {
|
4841 |
+
attributes: ['src', 'type', 'width', 'height']
|
4842 |
+
},
|
4843 |
+
img: {
|
4844 |
+
attributes: ['alt', 'src', 'srcset', 'usemap', 'ismap', 'width', 'height']
|
4845 |
+
},
|
4846 |
+
object: {
|
4847 |
+
attributes: ['data', 'type', 'name', 'usemap', 'form', 'width', 'height']
|
4848 |
+
},
|
4849 |
+
video: {
|
4850 |
+
attributes: ['src', 'poster', 'preload', 'autoplay', 'mediagroup', 'loop', 'muted', 'controls', 'width', 'height']
|
4851 |
+
}
|
4852 |
+
};
|
4853 |
+
/**
|
4854 |
+
* Phrasing content elements.
|
4855 |
+
*
|
4856 |
+
* @see https://www.w3.org/TR/2011/WD-html5-20110525/content-models.html#phrasing-content-0
|
4857 |
+
*/
|
4858 |
|
4859 |
+
var phrasingContentSchema = _objectSpread(_objectSpread({}, textContentSchema), embeddedContentSchema);
|
4860 |
+
/**
|
4861 |
+
* Get schema of possible paths for phrasing content.
|
4862 |
+
*
|
4863 |
+
* @see https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Content_categories#Phrasing_content
|
4864 |
+
*
|
4865 |
+
* @param {string} context Set to "paste" to exclude invisible elements and
|
4866 |
+
* sensitive data.
|
4867 |
+
*
|
4868 |
+
* @return {Object} Schema.
|
4869 |
+
*/
|
4870 |
|
4871 |
|
4872 |
+
function getPhrasingContentSchema(context) {
|
4873 |
+
if (context !== 'paste') {
|
4874 |
+
return phrasingContentSchema;
|
4875 |
+
}
|
4876 |
|
4877 |
+
return Object(lodash__WEBPACK_IMPORTED_MODULE_1__["omit"])(_objectSpread(_objectSpread({}, phrasingContentSchema), {}, {
|
4878 |
+
// We shouldn't paste potentially sensitive information which is not
|
4879 |
+
// visible to the user when pasted, so strip the attributes.
|
4880 |
+
ins: {
|
4881 |
+
children: phrasingContentSchema.ins.children
|
4882 |
+
},
|
4883 |
+
del: {
|
4884 |
+
children: phrasingContentSchema.del.children
|
4885 |
+
}
|
4886 |
+
}), ['u', // Used to mark misspelling. Shouldn't be pasted.
|
4887 |
+
'abbr', // Invisible.
|
4888 |
+
'data', // Invisible.
|
4889 |
+
'time', // Invisible.
|
4890 |
+
'wbr', // Invisible.
|
4891 |
+
'bdi', // Invisible.
|
4892 |
+
'bdo' // Invisible.
|
4893 |
+
]);
|
4894 |
+
}
|
4895 |
+
/**
|
4896 |
+
* Find out whether or not the given node is phrasing content.
|
4897 |
+
*
|
4898 |
+
* @see https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Content_categories#Phrasing_content
|
4899 |
+
*
|
4900 |
+
* @param {Element} node The node to test.
|
4901 |
+
*
|
4902 |
+
* @return {boolean} True if phrasing content, false if not.
|
4903 |
+
*/
|
4904 |
|
4905 |
+
function isPhrasingContent(node) {
|
4906 |
+
var tag = node.nodeName.toLowerCase();
|
4907 |
+
return getPhrasingContentSchema().hasOwnProperty(tag) || tag === 'span';
|
4908 |
+
}
|
4909 |
+
function isTextContent(node) {
|
4910 |
+
var tag = node.nodeName.toLowerCase();
|
4911 |
+
return textContentSchema.hasOwnProperty(tag) || tag === 'span';
|
|
|
4912 |
}
|
4913 |
+
//# sourceMappingURL=phrasing-content.js.map
|
4914 |
|
4915 |
+
/***/ }),
|
4916 |
+
/* 70 */
|
4917 |
+
/***/ (function(module, exports, __webpack_require__) {
|
4918 |
+
|
4919 |
+
var arrayLikeToArray = __webpack_require__(62);
|
4920 |
+
|
4921 |
+
function _unsupportedIterableToArray(o, minLen) {
|
4922 |
+
if (!o) return;
|
4923 |
+
if (typeof o === "string") return arrayLikeToArray(o, minLen);
|
4924 |
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
4925 |
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
4926 |
+
if (n === "Map" || n === "Set") return Array.from(o);
|
4927 |
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return arrayLikeToArray(o, minLen);
|
4928 |
}
|
4929 |
|
4930 |
+
module.exports = _unsupportedIterableToArray;
|
4931 |
|
4932 |
/***/ }),
|
4933 |
+
/* 71 */
|
|
|
4934 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
4935 |
|
4936 |
"use strict";
|
4937 |
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return useSlot; });
|
4938 |
+
/* harmony import */ var _babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6);
|
4939 |
+
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(0);
|
4940 |
+
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__);
|
4941 |
+
/* harmony import */ var _slot_fill_context__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(61);
|
4942 |
+
|
4943 |
+
|
4944 |
+
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; }
|
4945 |
+
|
4946 |
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
4947 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4948 |
/**
|
4949 |
+
* WordPress dependencies
|
4950 |
*/
|
4951 |
|
4952 |
/**
|
4954 |
*/
|
4955 |
|
4956 |
|
4957 |
+
function useSlot(name) {
|
4958 |
+
var registry = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["useContext"])(_slot_fill_context__WEBPACK_IMPORTED_MODULE_2__[/* default */ "a"]);
|
4959 |
+
var slot = registry.slots[name] || {};
|
4960 |
+
var slotFills = registry.fills[name];
|
4961 |
+
var fills = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["useMemo"])(function () {
|
4962 |
+
return slotFills || [];
|
4963 |
+
}, [slotFills]);
|
4964 |
+
var updateSlot = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["useCallback"])(function (fillProps) {
|
4965 |
+
registry.updateSlot(name, fillProps);
|
4966 |
+
}, [name, registry.updateSlot]);
|
4967 |
+
var unregisterSlot = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["useCallback"])(function (slotRef) {
|
4968 |
+
registry.unregisterSlot(name, slotRef);
|
4969 |
+
}, [name, registry.unregisterSlot]);
|
4970 |
+
var registerFill = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["useCallback"])(function (fillRef) {
|
4971 |
+
registry.registerFill(name, fillRef);
|
4972 |
+
}, [name, registry.registerFill]);
|
4973 |
+
var unregisterFill = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["useCallback"])(function (fillRef) {
|
4974 |
+
registry.unregisterFill(name, fillRef);
|
4975 |
+
}, [name, registry.unregisterFill]);
|
4976 |
+
return _objectSpread(_objectSpread({}, slot), {}, {
|
4977 |
+
updateSlot: updateSlot,
|
4978 |
+
unregisterSlot: unregisterSlot,
|
4979 |
+
fills: fills,
|
4980 |
+
registerFill: registerFill,
|
4981 |
+
unregisterFill: unregisterFill
|
4982 |
+
});
|
4983 |
+
}
|
4984 |
+
//# sourceMappingURL=use-slot.js.map
|
4985 |
+
|
4986 |
+
/***/ }),
|
4987 |
+
/* 72 */
|
4988 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
4989 |
|
4990 |
+
"use strict";
|
4991 |
+
/* WEBPACK VAR INJECTION */(function(process) {/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return warning; });
|
4992 |
+
function isDev() {
|
4993 |
+
return typeof process !== 'undefined' && process.env && "production" !== 'production';
|
4994 |
}
|
4995 |
/**
|
4996 |
+
* Shows a warning with `message` if environment is not `production`.
|
|
|
4997 |
*
|
4998 |
+
* @param {string} message Message to show in the warning.
|
4999 |
*
|
5000 |
+
* @example
|
5001 |
+
* ```js
|
5002 |
+
* import warning from '@wordpress/warning';
|
5003 |
*
|
5004 |
+
* function MyComponent( props ) {
|
5005 |
+
* if ( ! props.title ) {
|
5006 |
+
* warning( '`props.title` was not passed' );
|
5007 |
+
* }
|
5008 |
+
* ...
|
5009 |
+
* }
|
5010 |
+
* ```
|
5011 |
*/
|
5012 |
|
5013 |
|
5014 |
+
function warning(message) {
|
5015 |
+
if (!isDev()) {
|
5016 |
+
return;
|
5017 |
+
} // eslint-disable-next-line no-console
|
|
|
|
|
|
|
5018 |
|
|
|
|
|
|
|
5019 |
|
5020 |
+
console.warn(message); // Throwing an error and catching it immediately to improve debugging
|
5021 |
+
// A consumer can use 'pause on caught exceptions'
|
5022 |
+
// https://github.com/facebook/react/issues/4216
|
5023 |
|
5024 |
+
try {
|
5025 |
+
throw Error(message);
|
5026 |
+
} catch (x) {// do nothing
|
5027 |
}
|
5028 |
+
}
|
5029 |
+
//# sourceMappingURL=index.js.map
|
5030 |
+
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(63)))
|
5031 |
|
5032 |
+
/***/ }),
|
5033 |
+
/* 73 */
|
5034 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
5035 |
|
5036 |
+
"use strict";
|
5037 |
+
function memoize(fn) {
|
5038 |
+
var cache = {};
|
5039 |
+
return function (arg) {
|
5040 |
+
if (cache[arg] === undefined) cache[arg] = fn(arg);
|
5041 |
+
return cache[arg];
|
5042 |
+
};
|
5043 |
+
}
|
5044 |
|
5045 |
+
/* harmony default export */ __webpack_exports__["a"] = (memoize);
|
5046 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5047 |
|
5048 |
+
/***/ }),
|
5049 |
+
/* 74 */
|
5050 |
+
/***/ (function(module, exports) {
|
5051 |
|
5052 |
+
(function() { module.exports = this["wc"]["components"]; }());
|
|
|
|
|
|
|
|
|
5053 |
|
5054 |
+
/***/ }),
|
5055 |
+
/* 75 */
|
5056 |
+
/***/ (function(module, exports) {
|
5057 |
|
5058 |
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
5059 |
+
try {
|
5060 |
+
var info = gen[key](arg);
|
5061 |
+
var value = info.value;
|
5062 |
+
} catch (error) {
|
5063 |
+
reject(error);
|
5064 |
+
return;
|
5065 |
}
|
5066 |
|
5067 |
+
if (info.done) {
|
5068 |
+
resolve(value);
|
5069 |
+
} else {
|
5070 |
+
Promise.resolve(value).then(_next, _throw);
|
5071 |
}
|
5072 |
+
}
|
5073 |
|
5074 |
+
function _asyncToGenerator(fn) {
|
5075 |
+
return function () {
|
5076 |
+
var self = this,
|
5077 |
+
args = arguments;
|
5078 |
+
return new Promise(function (resolve, reject) {
|
5079 |
+
var gen = fn.apply(self, args);
|
5080 |
|
5081 |
+
function _next(value) {
|
5082 |
+
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
|
5083 |
+
}
|
5084 |
|
5085 |
+
function _throw(err) {
|
5086 |
+
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
|
5087 |
+
}
|
|
|
5088 |
|
5089 |
+
_next(undefined);
|
5090 |
+
});
|
5091 |
+
};
|
5092 |
+
}
|
5093 |
|
5094 |
+
module.exports = _asyncToGenerator;
|
5095 |
|
5096 |
+
/***/ }),
|
5097 |
+
/* 76 */
|
5098 |
+
/***/ (function(module, exports) {
|
5099 |
|
5100 |
+
(function() { module.exports = this["wp"]["htmlEntities"]; }());
|
|
|
|
|
5101 |
|
5102 |
+
/***/ }),
|
5103 |
+
/* 77 */
|
5104 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
5105 |
|
5106 |
+
"use strict";
|
5107 |
+
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2);
|
5108 |
+
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_0__);
|
5109 |
+
/**
|
5110 |
+
* External dependencies
|
5111 |
+
*/
|
5112 |
|
5113 |
+
/**
|
5114 |
+
* Given a function mapping a component to an enhanced component and modifier
|
5115 |
+
* name, returns the enhanced component augmented with a generated displayName.
|
5116 |
+
*
|
5117 |
+
* @param {Function} mapComponentToEnhancedComponent Function mapping component
|
5118 |
+
* to enhanced component.
|
5119 |
+
* @param {string} modifierName Seed name from which to
|
5120 |
+
* generated display name.
|
5121 |
+
*
|
5122 |
+
* @return {WPComponent} Component class with generated display name assigned.
|
5123 |
+
*/
|
5124 |
|
5125 |
+
function createHigherOrderComponent(mapComponentToEnhancedComponent, modifierName) {
|
5126 |
+
return function (OriginalComponent) {
|
5127 |
+
var EnhancedComponent = mapComponentToEnhancedComponent(OriginalComponent);
|
5128 |
+
var _OriginalComponent$di = OriginalComponent.displayName,
|
5129 |
+
displayName = _OriginalComponent$di === void 0 ? OriginalComponent.name || 'Component' : _OriginalComponent$di;
|
5130 |
+
EnhancedComponent.displayName = "".concat(Object(lodash__WEBPACK_IMPORTED_MODULE_0__["upperFirst"])(Object(lodash__WEBPACK_IMPORTED_MODULE_0__["camelCase"])(modifierName)), "(").concat(displayName, ")");
|
5131 |
+
return EnhancedComponent;
|
5132 |
+
};
|
5133 |
+
}
|
5134 |
|
5135 |
+
/* harmony default export */ __webpack_exports__["a"] = (createHigherOrderComponent);
|
5136 |
+
//# sourceMappingURL=index.js.map
|
|
|
5137 |
|
5138 |
+
/***/ }),
|
5139 |
+
/* 78 */
|
5140 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
5141 |
|
5142 |
+
"use strict";
|
5143 |
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Circle; });
|
5144 |
+
/* unused harmony export G */
|
5145 |
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return Path; });
|
5146 |
+
/* unused harmony export Polygon */
|
5147 |
+
/* unused harmony export Rect */
|
5148 |
+
/* unused harmony export Defs */
|
5149 |
+
/* unused harmony export RadialGradient */
|
5150 |
+
/* unused harmony export LinearGradient */
|
5151 |
+
/* unused harmony export Stop */
|
5152 |
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return SVG; });
|
5153 |
+
/* harmony import */ var _babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6);
|
5154 |
+
/* harmony import */ var _babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(11);
|
5155 |
+
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(4);
|
5156 |
+
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_2__);
|
5157 |
+
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(0);
|
5158 |
+
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__);
|
5159 |
|
|
|
|
|
|
|
5160 |
|
|
|
|
|
|
|
5161 |
|
5162 |
+
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; }
|
5163 |
+
|
5164 |
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
5165 |
|
|
|
|
|
5166 |
/**
|
5167 |
+
* External dependencies
|
5168 |
+
*/
|
5169 |
+
|
5170 |
+
/**
|
5171 |
+
* WordPress dependencies
|
|
|
5172 |
*/
|
5173 |
|
5174 |
|
5175 |
+
/** @typedef {{isPressed?: boolean} & import('react').ComponentPropsWithoutRef<'svg'>} SVGProps */
|
5176 |
+
|
|
|
5177 |
/**
|
5178 |
+
* @param {import('react').ComponentPropsWithoutRef<'circle'>} props
|
|
|
|
|
|
|
5179 |
*
|
5180 |
+
* @return {JSX.Element} Circle component
|
5181 |
*/
|
5182 |
|
5183 |
+
var Circle = function Circle(props) {
|
5184 |
+
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__["createElement"])('circle', props);
|
5185 |
+
};
|
5186 |
/**
|
5187 |
+
* @param {import('react').ComponentPropsWithoutRef<'g'>} props
|
|
|
|
|
5188 |
*
|
5189 |
+
* @return {JSX.Element} G component
|
5190 |
*/
|
5191 |
|
5192 |
+
var G = function G(props) {
|
5193 |
+
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__["createElement"])('g', props);
|
5194 |
+
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5195 |
/**
|
5196 |
+
* @param {import('react').ComponentPropsWithoutRef<'path'>} props
|
|
|
|
|
5197 |
*
|
5198 |
+
* @return {JSX.Element} Path component
|
5199 |
*/
|
5200 |
|
5201 |
+
var Path = function Path(props) {
|
5202 |
+
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__["createElement"])('path', props);
|
5203 |
+
};
|
5204 |
+
/**
|
5205 |
+
* @param {import('react').ComponentPropsWithoutRef<'polygon'>} props
|
5206 |
+
*
|
5207 |
+
* @return {JSX.Element} Polygon component
|
5208 |
+
*/
|
5209 |
|
5210 |
+
var Polygon = function Polygon(props) {
|
5211 |
+
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__["createElement"])('polygon', props);
|
5212 |
+
};
|
5213 |
+
/**
|
5214 |
+
* @param {import('react').ComponentPropsWithoutRef<'rect'>} props
|
5215 |
+
*
|
5216 |
+
* @return {JSX.Element} Rect component
|
5217 |
+
*/
|
5218 |
|
5219 |
+
var Rect = function Rect(props) {
|
5220 |
+
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__["createElement"])('rect', props);
|
5221 |
+
};
|
5222 |
/**
|
5223 |
+
* @param {import('react').ComponentPropsWithoutRef<'defs'>} props
|
5224 |
*
|
5225 |
+
* @return {JSX.Element} Defs component
|
|
|
5226 |
*/
|
5227 |
|
5228 |
+
var Defs = function Defs(props) {
|
5229 |
+
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__["createElement"])('defs', props);
|
5230 |
+
};
|
5231 |
+
/**
|
5232 |
+
* @param {import('react').ComponentPropsWithoutRef<'radialGradient'>} props
|
5233 |
+
*
|
5234 |
+
* @return {JSX.Element} RadialGradient component
|
5235 |
+
*/
|
5236 |
|
5237 |
+
var RadialGradient = function RadialGradient(props) {
|
5238 |
+
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__["createElement"])('radialGradient', props);
|
5239 |
+
};
|
5240 |
+
/**
|
5241 |
+
* @param {import('react').ComponentPropsWithoutRef<'linearGradient'>} props
|
5242 |
+
*
|
5243 |
+
* @return {JSX.Element} LinearGradient component
|
5244 |
+
*/
|
5245 |
|
5246 |
+
var LinearGradient = function LinearGradient(props) {
|
5247 |
+
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__["createElement"])('linearGradient', props);
|
5248 |
+
};
|
5249 |
+
/**
|
5250 |
+
* @param {import('react').ComponentPropsWithoutRef<'stop'>} props
|
5251 |
+
*
|
5252 |
+
* @return {JSX.Element} Stop component
|
5253 |
+
*/
|
5254 |
|
5255 |
+
var Stop = function Stop(props) {
|
5256 |
+
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__["createElement"])('stop', props);
|
5257 |
+
};
|
5258 |
+
/**
|
5259 |
+
*
|
5260 |
+
* @param {SVGProps} props isPressed indicates whether the SVG should appear as pressed.
|
5261 |
+
* Other props will be passed through to svg component.
|
5262 |
+
*
|
5263 |
+
* @return {JSX.Element} Stop component
|
5264 |
+
*/
|
5265 |
|
5266 |
+
var SVG = function SVG(_ref) {
|
5267 |
+
var className = _ref.className,
|
5268 |
+
isPressed = _ref.isPressed,
|
5269 |
+
props = Object(_babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"])(_ref, ["className", "isPressed"]);
|
5270 |
|
5271 |
+
var appliedProps = _objectSpread(_objectSpread({}, props), {}, {
|
5272 |
+
className: classnames__WEBPACK_IMPORTED_MODULE_2___default()(className, {
|
5273 |
+
'is-pressed': isPressed
|
5274 |
+
}) || undefined,
|
5275 |
+
role: 'img',
|
5276 |
+
'aria-hidden': true,
|
5277 |
+
focusable: false
|
5278 |
+
}); // Disable reason: We need to have a way to render HTML tag for web.
|
5279 |
+
// eslint-disable-next-line react/forbid-elements
|
5280 |
|
5281 |
|
5282 |
+
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__["createElement"])("svg", appliedProps);
|
5283 |
+
};
|
5284 |
+
//# sourceMappingURL=index.js.map
|
5285 |
|
5286 |
+
/***/ }),
|
5287 |
+
/* 79 */,
|
5288 |
+
/* 80 */,
|
5289 |
+
/* 81 */
|
5290 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
5291 |
|
5292 |
+
"use strict";
|
5293 |
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return domReady; });
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5294 |
/**
|
5295 |
+
* @typedef {() => void} Callback
|
|
|
5296 |
*
|
5297 |
+
* TODO: Remove this typedef and inline `() => void` type.
|
5298 |
*
|
5299 |
+
* This typedef is used so that a descriptive type is provided in our
|
5300 |
+
* automatically generated documentation.
|
|
|
5301 |
*
|
5302 |
+
* An in-line type `() => void` would be preferable, but the generated
|
5303 |
+
* documentation is `null` in that case.
|
5304 |
+
*
|
5305 |
+
* @see https://github.com/WordPress/gutenberg/issues/18045
|
5306 |
*/
|
5307 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5308 |
/**
|
5309 |
+
* Specify a function to execute when the DOM is fully loaded.
|
|
|
|
|
5310 |
*
|
5311 |
+
* @param {Callback} callback A function to execute after the DOM is ready.
|
|
|
|
|
|
|
5312 |
*
|
5313 |
+
* @example
|
5314 |
+
* ```js
|
5315 |
+
* import domReady from '@wordpress/dom-ready';
|
5316 |
+
*
|
5317 |
+
* domReady( function() {
|
5318 |
+
* //do something after DOM loads.
|
5319 |
+
* } );
|
5320 |
+
* ```
|
5321 |
+
*
|
5322 |
+
* @return {void}
|
5323 |
*/
|
5324 |
+
function domReady(callback) {
|
5325 |
+
if (document.readyState === 'complete' || // DOMContentLoaded + Images/Styles/etc loaded, so we call directly.
|
5326 |
+
document.readyState === 'interactive' // DOMContentLoaded fires at this point, so we call directly.
|
5327 |
+
) {
|
5328 |
+
return void callback();
|
5329 |
+
} // DOMContentLoaded has not fired yet, delay callback until then.
|
5330 |
|
5331 |
|
5332 |
+
document.addEventListener('DOMContentLoaded', callback);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5333 |
}
|
5334 |
+
//# sourceMappingURL=index.js.map
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5335 |
|
5336 |
+
/***/ }),
|
5337 |
+
/* 82 */
|
5338 |
+
/***/ (function(module, exports, __webpack_require__) {
|
5339 |
|
5340 |
+
"use strict";
|
|
|
5341 |
|
|
|
|
|
|
|
5342 |
|
5343 |
+
var stringify = __webpack_require__(136);
|
5344 |
+
var parse = __webpack_require__(137);
|
5345 |
+
var formats = __webpack_require__(96);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5346 |
|
5347 |
+
module.exports = {
|
5348 |
+
formats: formats,
|
5349 |
+
parse: parse,
|
5350 |
+
stringify: stringify
|
5351 |
+
};
|
|
|
|
|
|
|
5352 |
|
|
|
|
|
|
|
5353 |
|
5354 |
+
/***/ }),
|
5355 |
+
/* 83 */
|
5356 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
5357 |
|
5358 |
+
"use strict";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5359 |
|
5360 |
+
// EXPORTS
|
5361 |
+
__webpack_require__.d(__webpack_exports__, "a", function() { return /* binding */ get_get; });
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5362 |
|
5363 |
+
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js
|
5364 |
+
var getPrototypeOf = __webpack_require__(9);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5365 |
|
5366 |
+
// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/superPropBase.js
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5367 |
|
5368 |
+
function _superPropBase(object, property) {
|
5369 |
+
while (!Object.prototype.hasOwnProperty.call(object, property)) {
|
5370 |
+
object = Object(getPrototypeOf["a" /* default */])(object);
|
5371 |
+
if (object === null) break;
|
5372 |
}
|
5373 |
|
5374 |
+
return object;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5375 |
}
|
5376 |
+
// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/get.js
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5377 |
|
5378 |
+
function get_get(target, property, receiver) {
|
5379 |
+
if (typeof Reflect !== "undefined" && Reflect.get) {
|
5380 |
+
get_get = Reflect.get;
|
5381 |
+
} else {
|
5382 |
+
get_get = function _get(target, property, receiver) {
|
5383 |
+
var base = _superPropBase(target, property);
|
5384 |
+
if (!base) return;
|
5385 |
+
var desc = Object.getOwnPropertyDescriptor(base, property);
|
|
|
|
|
|
|
5386 |
|
5387 |
+
if (desc.get) {
|
5388 |
+
return desc.get.call(receiver);
|
5389 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5390 |
|
5391 |
+
return desc.value;
|
5392 |
+
};
|
|
|
5393 |
}
|
5394 |
|
5395 |
+
return get_get(target, property, receiver || target);
|
5396 |
+
}
|
|
|
5397 |
|
5398 |
+
/***/ }),
|
5399 |
+
/* 84 */,
|
5400 |
+
/* 85 */
|
5401 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
5402 |
|
5403 |
+
"use strict";
|
5404 |
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return useMediaQuery; });
|
5405 |
+
/* harmony import */ var _babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(24);
|
5406 |
+
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(0);
|
5407 |
+
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__);
|
5408 |
|
|
|
|
|
|
|
|
|
5409 |
|
5410 |
+
/**
|
5411 |
+
* WordPress dependencies
|
5412 |
+
*/
|
5413 |
|
|
|
|
|
|
|
|
|
5414 |
/**
|
5415 |
+
* Runs a media query and returns its value when it changes.
|
|
|
|
|
5416 |
*
|
5417 |
+
* @param {string} [query] Media Query.
|
5418 |
+
* @return {boolean} return value of the media query.
|
5419 |
*/
|
5420 |
|
5421 |
+
function useMediaQuery(query) {
|
5422 |
+
var _useState = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["useState"])(query && window.matchMedia(query).matches),
|
5423 |
+
_useState2 = Object(_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])(_useState, 2),
|
5424 |
+
match = _useState2[0],
|
5425 |
+
setMatch = _useState2[1];
|
|
|
|
|
|
|
|
|
|
|
5426 |
|
5427 |
+
Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["useEffect"])(function () {
|
5428 |
+
if (!query) {
|
5429 |
+
return;
|
5430 |
}
|
|
|
5431 |
|
5432 |
+
var updateMatch = function updateMatch() {
|
5433 |
+
return setMatch(window.matchMedia(query).matches);
|
5434 |
+
};
|
5435 |
|
5436 |
+
updateMatch();
|
5437 |
+
var list = window.matchMedia(query);
|
5438 |
+
list.addListener(updateMatch);
|
5439 |
+
return function () {
|
5440 |
+
list.removeListener(updateMatch);
|
5441 |
+
};
|
5442 |
+
}, [query]);
|
5443 |
+
return query && match;
|
5444 |
}
|
5445 |
+
//# sourceMappingURL=index.js.map
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5446 |
|
5447 |
+
/***/ }),
|
5448 |
+
/* 86 */
|
5449 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
|
5450 |
|
5451 |
+
"use strict";
|
5452 |
+
/* unused harmony export BASE */
|
5453 |
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return G2; });
|
5454 |
+
/* unused harmony export DARK_GRAY */
|
5455 |
+
/* unused harmony export DARK_OPACITY */
|
5456 |
+
/* unused harmony export DARK_OPACITY_LIGHT */
|
5457 |
+
/* unused harmony export LIGHT_GRAY */
|
5458 |
+
/* unused harmony export LIGHT_OPACITY_LIGHT */
|
5459 |
+
/* unused harmony export BLUE */
|
5460 |
+
/* unused harmony export ALERT */
|
5461 |
+
/* unused harmony export ADMIN */
|
5462 |
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return UI; });
|
5463 |
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return COLORS; });
|
5464 |
+
/* harmony import */ var _babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6);
|
5465 |
+
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(2);
|
5466 |
+
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_1__);
|
5467 |
+
/* harmony import */ var _colors__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(30);
|
5468 |
|
|
|
|
|
|
|
|
|
5469 |
|
5470 |
+
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; }
|
5471 |
|
5472 |
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
|
|
|
5473 |
|
|
|
|
|
5474 |
/**
|
5475 |
+
* External dependencies
|
|
|
|
|
|
|
|
|
5476 |
*/
|
5477 |
|
|
|
|
|
|
|
|
|
5478 |
/**
|
5479 |
+
* Internal dependencies
|
|
|
|
|
|
|
5480 |
*/
|
5481 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5482 |
|
5483 |
+
var BASE = {
|
5484 |
+
black: '#000',
|
5485 |
+
white: '#fff'
|
5486 |
+
};
|
5487 |
/**
|
5488 |
+
* TODO: Continue to update values as "G2" design evolves.
|
|
|
|
|
5489 |
*
|
5490 |
+
* "G2" refers to the movement to advance the interface of the block editor.
|
5491 |
+
* https://github.com/WordPress/gutenberg/issues/18667
|
5492 |
*/
|
5493 |
|
5494 |
+
var G2 = {
|
5495 |
+
blue: {
|
5496 |
+
medium: {
|
5497 |
+
focus: '#007cba',
|
5498 |
+
focusDark: '#fff'
|
5499 |
+
}
|
5500 |
+
},
|
5501 |
+
gray: {
|
5502 |
+
900: '#1e1e1e',
|
5503 |
+
700: '#757575',
|
5504 |
+
// Meets 4.6:1 text contrast against white.
|
5505 |
+
600: '#949494',
|
5506 |
+
// Meets 3:1 UI or large text contrast against white.
|
5507 |
+
400: '#ccc',
|
5508 |
+
200: '#ddd',
|
5509 |
+
// Used for most borders.
|
5510 |
+
100: '#f0f0f0'
|
5511 |
+
},
|
5512 |
+
darkGray: {
|
5513 |
+
primary: '#1e1e1e'
|
5514 |
+
},
|
5515 |
+
mediumGray: {
|
5516 |
+
text: '#757575'
|
5517 |
+
},
|
5518 |
+
lightGray: {
|
5519 |
+
ui: '#949494',
|
5520 |
+
secondary: '#ccc',
|
5521 |
+
tertiary: '#e7e8e9'
|
5522 |
+
}
|
5523 |
+
};
|
5524 |
+
var DARK_GRAY = {
|
5525 |
+
900: '#191e23',
|
5526 |
+
800: '#23282d',
|
5527 |
+
700: '#32373c',
|
5528 |
+
600: '#40464d',
|
5529 |
+
500: '#555d66',
|
5530 |
+
// Use this most of the time for dark items.
|
5531 |
+
400: '#606a73',
|
5532 |
+
300: '#6c7781',
|
5533 |
+
// Lightest gray that can be used for AA text contrast.
|
5534 |
+
200: '#7e8993',
|
5535 |
+
150: '#8d96a0',
|
5536 |
+
// Lightest gray that can be used for AA non-text contrast.
|
5537 |
+
100: '#8f98a1'
|
5538 |
+
};
|
5539 |
+
var DARK_OPACITY = {
|
5540 |
+
900: Object(_colors__WEBPACK_IMPORTED_MODULE_2__[/* rgba */ "b"])('#000510', 0.9),
|
5541 |
+
800: Object(_colors__WEBPACK_IMPORTED_MODULE_2__[/* rgba */ "b"])('#00000a', 0.85),
|
5542 |
+
700: Object(_colors__WEBPACK_IMPORTED_MODULE_2__[/* rgba */ "b"])('#06060b', 0.8),
|
5543 |
+
600: Object(_colors__WEBPACK_IMPORTED_MODULE_2__[/* rgba */ "b"])('#000913', 0.75),
|
5544 |
+
500: Object(_colors__WEBPACK_IMPORTED_MODULE_2__[/* rgba */ "b"])('#0a1829', 0.7),
|
5545 |
+
400: Object(_colors__WEBPACK_IMPORTED_MODULE_2__[/* rgba */ "b"])('#0a1829', 0.65),
|
5546 |
+
300: Object(_colors__WEBPACK_IMPORTED_MODULE_2__[/* rgba */ "b"])('#0e1c2e', 0.62),
|
5547 |
+
200: Object(_colors__WEBPACK_IMPORTED_MODULE_2__[/* rgba */ "b"])('#162435', 0.55),
|
5548 |
+
100: Object(_colors__WEBPACK_IMPORTED_MODULE_2__[/* rgba */ "b"])('#223443', 0.5),
|
5549 |
+
backgroundFill: Object(_colors__WEBPACK_IMPORTED_MODULE_2__[/* rgba */ "b"])(DARK_GRAY[700], 0.7)
|
5550 |
+
};
|
5551 |
+
var DARK_OPACITY_LIGHT = {
|
5552 |
+
900: Object(_colors__WEBPACK_IMPORTED_MODULE_2__[/* rgba */ "b"])('#304455', 0.45),
|
5553 |
+
800: Object(_colors__WEBPACK_IMPORTED_MODULE_2__[/* rgba */ "b"])('#425863', 0.4),
|
5554 |
+
700: Object(_colors__WEBPACK_IMPORTED_MODULE_2__[/* rgba */ "b"])('#667886', 0.35),
|
5555 |
+
600: Object(_colors__WEBPACK_IMPORTED_MODULE_2__[/* rgba */ "b"])('#7b86a2', 0.3),
|
5556 |
+
500: Object(_colors__WEBPACK_IMPORTED_MODULE_2__[/* rgba */ "b"])('#9197a2', 0.25),
|
5557 |
+
400: Object(_colors__WEBPACK_IMPORTED_MODULE_2__[/* rgba */ "b"])('#95959c', 0.2),
|
5558 |
+
300: Object(_colors__WEBPACK_IMPORTED_MODULE_2__[/* rgba */ "b"])('#829493', 0.15),
|
5559 |
+
200: Object(_colors__WEBPACK_IMPORTED_MODULE_2__[/* rgba */ "b"])('#8b8b96', 0.1),
|
5560 |
+
100: Object(_colors__WEBPACK_IMPORTED_MODULE_2__[/* rgba */ "b"])('#747474', 0.05)
|
5561 |
+
};
|
5562 |
+
var LIGHT_GRAY = {
|
5563 |
+
900: '#a2aab2',
|
5564 |
+
800: '#b5bcc2',
|
5565 |
+
700: '#ccd0d4',
|
5566 |
+
600: '#d7dade',
|
5567 |
+
500: '#e2e4e7',
|
5568 |
+
// Good for "grayed" items and borders.
|
5569 |
+
400: '#e8eaeb',
|
5570 |
+
// Good for "readonly" input fields and special text selection.
|
5571 |
+
300: '#edeff0',
|
5572 |
+
200: '#f3f4f5',
|
5573 |
+
100: '#f8f9f9'
|
5574 |
+
};
|
5575 |
+
var LIGHT_OPACITY_LIGHT = {
|
5576 |
+
900: Object(_colors__WEBPACK_IMPORTED_MODULE_2__[/* rgba */ "b"])(BASE.white, 0.5),
|
5577 |
+
800: Object(_colors__WEBPACK_IMPORTED_MODULE_2__[/* rgba */ "b"])(BASE.white, 0.45),
|
5578 |
+
700: Object(_colors__WEBPACK_IMPORTED_MODULE_2__[/* rgba */ "b"])(BASE.white, 0.4),
|
5579 |
+
600: Object(_colors__WEBPACK_IMPORTED_MODULE_2__[/* rgba */ "b"])(BASE.white, 0.35),
|
5580 |
+
500: Object(_colors__WEBPACK_IMPORTED_MODULE_2__[/* rgba */ "b"])(BASE.white, 0.3),
|
5581 |
+
400: Object(_colors__WEBPACK_IMPORTED_MODULE_2__[/* rgba */ "b"])(BASE.white, 0.25),
|
5582 |
+
300: Object(_colors__WEBPACK_IMPORTED_MODULE_2__[/* rgba */ "b"])(BASE.white, 0.2),
|
5583 |
+
200: Object(_colors__WEBPACK_IMPORTED_MODULE_2__[/* rgba */ "b"])(BASE.white, 0.15),
|
5584 |
+
100: Object(_colors__WEBPACK_IMPORTED_MODULE_2__[/* rgba */ "b"])(BASE.white, 0.1),
|
5585 |
+
backgroundFill: Object(_colors__WEBPACK_IMPORTED_MODULE_2__[/* rgba */ "b"])(LIGHT_GRAY[300], 0.8)
|
5586 |
+
}; // Additional colors.
|
5587 |
+
// Some are from https://make.wordpress.org/design/handbook/foundations/colors/.
|
5588 |
|
5589 |
+
var BLUE = {
|
5590 |
+
wordpress: {
|
5591 |
+
700: '#00669b'
|
5592 |
+
},
|
5593 |
+
dark: {
|
5594 |
+
900: '#0071a1'
|
5595 |
+
},
|
5596 |
+
medium: {
|
5597 |
+
900: '#006589',
|
5598 |
+
800: '#00739c',
|
5599 |
+
700: '#007fac',
|
5600 |
+
600: '#008dbe',
|
5601 |
+
500: '#00a0d2',
|
5602 |
+
400: '#33b3db',
|
5603 |
+
300: '#66c6e4',
|
5604 |
+
200: '#bfe7f3',
|
5605 |
+
100: '#e5f5fa',
|
5606 |
+
highlight: '#b3e7fe',
|
5607 |
+
focus: '#007cba'
|
5608 |
}
|
5609 |
+
};
|
5610 |
+
var ALERT = {
|
5611 |
+
yellow: '#f0b849',
|
5612 |
+
red: '#d94f4f',
|
5613 |
+
green: '#4ab866'
|
5614 |
+
};
|
5615 |
+
var ADMIN = {
|
5616 |
+
theme: "var( --wp-admin-theme-color, ".concat(BLUE.wordpress[700], ")"),
|
5617 |
+
themeDark10: "var( --wp-admin-theme-color-darker-10, ".concat(BLUE.medium.focus, ")")
|
5618 |
+
}; // Namespaced values for raw colors hex codes
|
5619 |
|
5620 |
+
var UI = {
|
5621 |
+
theme: ADMIN.theme,
|
5622 |
+
background: BASE.white,
|
5623 |
+
backgroundDisabled: LIGHT_GRAY[200],
|
5624 |
+
border: G2.gray[700],
|
5625 |
+
borderFocus: ADMIN.themeDark10,
|
5626 |
+
borderDisabled: G2.gray[400],
|
5627 |
+
borderLight: G2.gray[200],
|
5628 |
+
label: DARK_GRAY[500],
|
5629 |
+
textDisabled: DARK_GRAY[150],
|
5630 |
+
textDark: BASE.white,
|
5631 |
+
textLight: BASE.black
|
5632 |
+
};
|
5633 |
+
var COLORS = _objectSpread(_objectSpread({}, BASE), {}, {
|
5634 |
+
darkGray: Object(lodash__WEBPACK_IMPORTED_MODULE_1__["merge"])({}, DARK_GRAY, G2.darkGray),
|
5635 |
+
darkOpacity: DARK_OPACITY,
|
5636 |
+
darkOpacityLight: DARK_OPACITY_LIGHT,
|
5637 |
+
mediumGray: G2.mediumGray,
|
5638 |
+
lightGray: Object(lodash__WEBPACK_IMPORTED_MODULE_1__["merge"])({}, LIGHT_GRAY, G2.lightGray),
|
5639 |
+
lightGrayLight: LIGHT_OPACITY_LIGHT,
|
5640 |
+
blue: Object(lodash__WEBPACK_IMPORTED_MODULE_1__["merge"])({}, BLUE, G2.blue),
|
5641 |
+
alert: ALERT,
|
5642 |
+
admin: ADMIN,
|
5643 |
+
ui: UI
|
5644 |
+
});
|
5645 |
+
/* unused harmony default export */ var _unused_webpack_default_export = (COLORS);
|
5646 |
+
//# sourceMappingURL=colors-values.js.map
|
5647 |
|
5648 |
+
/***/ }),
|
5649 |
+
/* 87 */
|
5650 |
+
/***/ (function(module, exports, __webpack_require__) {
|
5651 |
|
5652 |
+
"use strict";
|
|
|
|
|
5653 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5654 |
|
5655 |
+
var has = Object.prototype.hasOwnProperty;
|
5656 |
+
var isArray = Array.isArray;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5657 |
|
5658 |
+
var hexTable = (function () {
|
5659 |
+
var array = [];
|
5660 |
+
for (var i = 0; i < 256; ++i) {
|
5661 |
+
array.push('%' + ((i < 16 ? '0' : '') + i.toString(16)).toUpperCase());
|
5662 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5663 |
|
5664 |
+
return array;
|
5665 |
+
}());
|
|
|
|
|
5666 |
|
5667 |
+
var compactQueue = function compactQueue(queue) {
|
5668 |
+
while (queue.length > 1) {
|
5669 |
+
var item = queue.pop();
|
5670 |
+
var obj = item.obj[item.prop];
|
5671 |
+
|
5672 |
+
if (isArray(obj)) {
|
5673 |
+
var compacted = [];
|
|
|
|
|
|
|
|
|
|
|
5674 |
|
5675 |
+
for (var j = 0; j < obj.length; ++j) {
|
5676 |
+
if (typeof obj[j] !== 'undefined') {
|
5677 |
+
compacted.push(obj[j]);
|
5678 |
+
}
|
5679 |
+
}
|
5680 |
|
5681 |
+
item.obj[item.prop] = compacted;
|
|
|
|
|
5682 |
}
|
5683 |
+
}
|
5684 |
+
};
|
5685 |
|
5686 |
+
var arrayToObject = function arrayToObject(source, options) {
|
5687 |
+
var obj = options && options.plainObjects ? Object.create(null) : {};
|
5688 |
+
for (var i = 0; i < source.length; ++i) {
|
5689 |
+
if (typeof source[i] !== 'undefined') {
|
5690 |
+
obj[i] = source[i];
|
5691 |
+
}
|
5692 |
+
}
|
|
|
|
|
|
|
|
|
5693 |
|
5694 |
+
return obj;
|
5695 |
+
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5696 |
|
5697 |
+
var merge = function merge(target, source, options) {
|
5698 |
+
/* eslint no-param-reassign: 0 */
|
5699 |
+
if (!source) {
|
5700 |
+
return target;
|
5701 |
+
}
|
|
|
|
|
|
|
|
|
5702 |
|
5703 |
+
if (typeof source !== 'object') {
|
5704 |
+
if (isArray(target)) {
|
5705 |
+
target.push(source);
|
5706 |
+
} else if (target && typeof target === 'object') {
|
5707 |
+
if ((options && (options.plainObjects || options.allowPrototypes)) || !has.call(Object.prototype, source)) {
|
5708 |
+
target[source] = true;
|
5709 |
}
|
5710 |
+
} else {
|
5711 |
+
return [target, source];
|
5712 |
}
|
5713 |
|
5714 |
+
return target;
|
5715 |
+
}
|
|
|
|
|
|
|
5716 |
|
5717 |
+
if (!target || typeof target !== 'object') {
|
5718 |
+
return [target].concat(source);
|
5719 |
+
}
|
5720 |
|
5721 |
+
var mergeTarget = target;
|
5722 |
+
if (isArray(target) && !isArray(source)) {
|
5723 |
+
mergeTarget = arrayToObject(target, options);
|
5724 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
5725 |
|
5726 |
+
if (isArray(target) && isArray(source)) {
|
5727 |
+
source.forEach(function (item, i) {
|
5728 |
+
if (has.call(target, i)) {
|
5729 |
+
var targetItem = target[i];
|
5730 |
+
if (targetItem && typeof targetItem === 'object' && item && typeof item === 'object') {
|
5731 |
+
target[i] = merge(targetItem, item, options);
|
5732 |
+
} else {
|
5733 |
+
target.push(item);
|
5734 |
+
}
|
5735 |
} else {
|
5736 |
+
target[i] = item;
|
|
|
|
|
|
|
|
|
|
|
5737 |
}
|
5738 |
+
});
|
5739 |
+
return target;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5740 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5741 |
|
5742 |
+
return Object.keys(source).reduce(function (acc, key) {
|
5743 |
+
var value = source[key];
|
5744 |
|
5745 |
+
if (has.call(acc, key)) {
|
5746 |
+
acc[key] = merge(acc[key], value, options);
|
5747 |
+
} else {
|
5748 |
+
acc[key] = value;
|
5749 |
+
}
|
5750 |
+
return acc;
|
5751 |
+
}, mergeTarget);
|
5752 |
+
};
|
5753 |
|
5754 |
+
var assign = function assignSingleSource(target, source) {
|
5755 |
+
return Object.keys(source).reduce(function (acc, key) {
|
5756 |
+
acc[key] = source[key];
|
5757 |
+
return acc;
|
5758 |
+
}, target);
|
5759 |
+
};
|
5760 |
+
|
5761 |
+
var decode = function (str, decoder, charset) {
|
5762 |
+
var strWithoutPlus = str.replace(/\+/g, ' ');
|
5763 |
+
if (charset === 'iso-8859-1') {
|
5764 |
+
// unescape never throws, no try...catch needed:
|
5765 |
+
return strWithoutPlus.replace(/%[0-9a-f]{2}/gi, unescape);
|
5766 |
+
}
|
5767 |
+
// utf-8
|
5768 |
+
try {
|
5769 |
+
return decodeURIComponent(strWithoutPlus);
|
5770 |
+
} catch (e) {
|
5771 |
+
return strWithoutPlus;
|
5772 |
}
|
5773 |
+
};
|
5774 |
|
5775 |
+
var encode = function encode(str, defaultEncoder, charset) {
|
5776 |
+
// This code was originally written by Brian White (mscdex) for the io.js core querystring library.
|
5777 |
+
// It has been adapted here for stricter adherence to RFC 3986
|
5778 |
+
if (str.length === 0) {
|
5779 |
+
return str;
|
5780 |
+
}
|
5781 |
|
5782 |
+
var string = str;
|
5783 |
+
if (typeof str === 'symbol') {
|
5784 |
+
string = Symbol.prototype.toString.call(str);
|
5785 |
+
} else if (typeof str !== 'string') {
|
5786 |
+
string = String(str);
|
5787 |
}
|
5788 |
|
5789 |
+
if (charset === 'iso-8859-1') {
|
5790 |
+
return escape(string).replace(/%u[0-9a-f]{4}/gi, function ($0) {
|
5791 |
+
return '%26%23' + parseInt($0.slice(2), 16) + '%3B';
|
5792 |
+
});
|
5793 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5794 |
|
5795 |
+
var out = '';
|
5796 |
+
for (var i = 0; i < string.length; ++i) {
|
5797 |
+
var c = string.charCodeAt(i);
|
|
|
|
|
|
|
|
|
5798 |
|
5799 |
+
if (
|
5800 |
+
c === 0x2D // -
|
5801 |
+
|| c === 0x2E // .
|
5802 |
+
|| c === 0x5F // _
|
5803 |
+
|| c === 0x7E // ~
|
5804 |
+
|| (c >= 0x30 && c <= 0x39) // 0-9
|
5805 |
+
|| (c >= 0x41 && c <= 0x5A) // a-z
|
5806 |
+
|| (c >= 0x61 && c <= 0x7A) // A-Z
|
5807 |
+
) {
|
5808 |
+
out += string.charAt(i);
|
5809 |
+
continue;
|
5810 |
+
}
|
5811 |
|
5812 |
+
if (c < 0x80) {
|
5813 |
+
out = out + hexTable[c];
|
5814 |
+
continue;
|
5815 |
+
}
|
5816 |
|
5817 |
+
if (c < 0x800) {
|
5818 |
+
out = out + (hexTable[0xC0 | (c >> 6)] + hexTable[0x80 | (c & 0x3F)]);
|
5819 |
+
continue;
|
5820 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5821 |
|
5822 |
+
if (c < 0xD800 || c >= 0xE000) {
|
5823 |
+
out = out + (hexTable[0xE0 | (c >> 12)] + hexTable[0x80 | ((c >> 6) & 0x3F)] + hexTable[0x80 | (c & 0x3F)]);
|
5824 |
+
continue;
|
5825 |
+
}
|
5826 |
|
5827 |
+
i += 1;
|
5828 |
+
c = 0x10000 + (((c & 0x3FF) << 10) | (string.charCodeAt(i) & 0x3FF));
|
5829 |
+
out += hexTable[0xF0 | (c >> 18)]
|
5830 |
+
+ hexTable[0x80 | ((c >> 12) & 0x3F)]
|
5831 |
+
+ hexTable[0x80 | ((c >> 6) & 0x3F)]
|
5832 |
+
+ hexTable[0x80 | (c & 0x3F)];
|
5833 |
+
}
|
5834 |
|
5835 |
+
return out;
|
5836 |
+
};
|
5837 |
|
5838 |
+
var compact = function compact(value) {
|
5839 |
+
var queue = [{ obj: { o: value }, prop: 'o' }];
|
5840 |
+
var refs = [];
|
5841 |
|
5842 |
+
for (var i = 0; i < queue.length; ++i) {
|
5843 |
+
var item = queue[i];
|
5844 |
+
var obj = item.obj[item.prop];
|
5845 |
|
5846 |
+
var keys = Object.keys(obj);
|
5847 |
+
for (var j = 0; j < keys.length; ++j) {
|
5848 |
+
var key = keys[j];
|
5849 |
+
var val = obj[key];
|
5850 |
+
if (typeof val === 'object' && val !== null && refs.indexOf(val) === -1) {
|
5851 |
+
queue.push({ obj: obj, prop: key });
|
5852 |
+
refs.push(val);
|
5853 |
+
}
|
5854 |
+
}
|
5855 |
+
}
|
5856 |
|
5857 |
+
compactQueue(queue);
|
5858 |
|
5859 |
+
return value;
|
5860 |
+
};
|
5861 |
|
5862 |
+
var isRegExp = function isRegExp(obj) {
|
5863 |
+
return Object.prototype.toString.call(obj) === '[object RegExp]';
|
5864 |
+
};
|
5865 |
|
5866 |
+
var isBuffer = function isBuffer(obj) {
|
5867 |
+
if (!obj || typeof obj !== 'object') {
|
5868 |
+
return false;
|
5869 |
+
}
|
5870 |
|
5871 |
+
return !!(obj.constructor && obj.constructor.isBuffer && obj.constructor.isBuffer(obj));
|
5872 |
+
};
|
5873 |
|
5874 |
+
var combine = function combine(a, b) {
|
5875 |
+
return [].concat(a, b);
|
5876 |
+
};
|
5877 |
|
5878 |
+
var maybeMap = function maybeMap(val, fn) {
|
5879 |
+
if (isArray(val)) {
|
5880 |
+
var mapped = [];
|
5881 |
+
for (var i = 0; i < val.length; i += 1) {
|
5882 |
+
mapped.push(fn(val[i]));
|
5883 |
+
}
|
5884 |
+
return mapped;
|
5885 |
+
}
|
5886 |
+
return fn(val);
|
5887 |
+
};
|
5888 |
|
5889 |
+
module.exports = {
|
5890 |
+
arrayToObject: arrayToObject,
|
5891 |
+
assign: assign,
|
5892 |
+
combine: combine,
|
5893 |
+
compact: compact,
|
5894 |
+
decode: decode,
|
5895 |
+
encode: encode,
|
5896 |
+
isBuffer: isBuffer,
|
5897 |
+
isRegExp: isRegExp,
|
5898 |
+
maybeMap: maybeMap,
|
5899 |
+
merge: merge
|
5900 |
+
};
|
5901 |
|
|
|
|
|
|
|
|
|
|
|
5902 |
|
5903 |
+
/***/ }),
|
5904 |
+
/* 88 */,
|
5905 |
+
/* 89 */,
|
5906 |
+
/* 90 */
|
5907 |
+
/***/ (function(module, exports) {
|
5908 |
|
5909 |
+
(function() { module.exports = this["ReactDOM"]; }());
|
|
|
5910 |
|
5911 |
+
/***/ }),
|
5912 |
+
/* 91 */
|
5913 |
+
/***/ (function(module, exports, __webpack_require__) {
|
5914 |
|
5915 |
+
var e=__webpack_require__(8),n={display:"block",opacity:0,position:"absolute",top:0,left:0,height:"100%",width:"100%",overflow:"hidden",pointerEvents:"none",zIndex:-1},t=function(t){var r=t.onResize,u=e.useRef();return function(n,t){var r=function(){return n.current&&n.current.contentDocument&&n.current.contentDocument.defaultView};function u(){t();var e=r();e&&e.addEventListener("resize",t)}e.useEffect((function(){return r()?u():n.current&&n.current.addEventListener&&n.current.addEventListener("load",u),function(){var e=r();e&&"function"==typeof e.removeEventListener&&e.removeEventListener("resize",t)}}),[])}(u,(function(){return r(u)})),e.createElement("iframe",{style:n,src:"about:blank",ref:u,"aria-hidden":!0,tabIndex:-1,frameBorder:0})},r=function(e){return{width:null!=e?e.offsetWidth:null,height:null!=e?e.offsetHeight:null}};module.exports=function(n){void 0===n&&(n=r);var u=e.useState(n(null)),o=u[0],i=u[1],c=e.useCallback((function(e){return i(n(e.current))}),[n]);return[e.useMemo((function(){return e.createElement(t,{onResize:c})}),[c]),o]};
|
5916 |
+
//# sourceMappingURL=index.js.map
|
5917 |
|
|
|
5918 |
|
5919 |
+
/***/ }),
|
5920 |
+
/* 92 */
|
5921 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5922 |
|
5923 |
+
"use strict";
|
5924 |
+
var isProduction = "production" === 'production';
|
5925 |
+
var prefix = 'Invariant failed';
|
5926 |
+
function invariant(condition, message) {
|
5927 |
+
if (condition) {
|
5928 |
+
return;
|
5929 |
+
}
|
5930 |
+
if (isProduction) {
|
5931 |
+
throw new Error(prefix);
|
5932 |
+
}
|
5933 |
+
throw new Error(prefix + ": " + (message || ''));
|
5934 |
+
}
|
5935 |
|
5936 |
+
/* harmony default export */ __webpack_exports__["a"] = (invariant);
|
|
|
|
|
|
|
|
|
|
|
5937 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5938 |
|
5939 |
+
/***/ }),
|
5940 |
+
/* 93 */,
|
5941 |
+
/* 94 */,
|
5942 |
+
/* 95 */
|
5943 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
5944 |
|
5945 |
+
"use strict";
|
5946 |
|
5947 |
+
// EXPORTS
|
5948 |
+
__webpack_require__.d(__webpack_exports__, "b", function() { return /* binding */ slot_fill_Slot; });
|
5949 |
+
__webpack_require__.d(__webpack_exports__, "a", function() { return /* binding */ slot_fill_Fill; });
|
|
|
|
|
|
|
|
|
|
|
5950 |
|
5951 |
+
// UNUSED EXPORTS: createSlotFill, useSlot, Provider
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5952 |
|
5953 |
+
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/extends.js
|
5954 |
+
var esm_extends = __webpack_require__(7);
|
5955 |
|
5956 |
+
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js
|
5957 |
+
var objectWithoutProperties = __webpack_require__(11);
|
|
|
|
|
|
|
5958 |
|
5959 |
+
// EXTERNAL MODULE: external {"this":["wp","element"]}
|
5960 |
+
var external_this_wp_element_ = __webpack_require__(0);
|
5961 |
|
5962 |
+
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/classCallCheck.js
|
5963 |
+
var classCallCheck = __webpack_require__(16);
|
|
|
|
|
5964 |
|
5965 |
+
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/createClass.js
|
5966 |
+
var createClass = __webpack_require__(17);
|
5967 |
|
5968 |
+
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js
|
5969 |
+
var assertThisInitialized = __webpack_require__(12);
|
5970 |
|
5971 |
+
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/get.js + 1 modules
|
5972 |
+
var get = __webpack_require__(83);
|
5973 |
|
5974 |
+
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/inherits.js + 1 modules
|
5975 |
+
var inherits = __webpack_require__(18);
|
|
|
5976 |
|
5977 |
+
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js
|
5978 |
+
var possibleConstructorReturn = __webpack_require__(21);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5979 |
|
5980 |
+
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js
|
5981 |
+
var getPrototypeOf = __webpack_require__(9);
|
|
|
|
|
5982 |
|
5983 |
+
// EXTERNAL MODULE: external "lodash"
|
5984 |
+
var external_lodash_ = __webpack_require__(2);
|
|
|
|
|
|
|
|
|
5985 |
|
5986 |
+
// EXTERNAL MODULE: ./node_modules/@wordpress/components/build-module/slot-fill/context.js + 1 modules
|
5987 |
+
var context = __webpack_require__(56);
|
5988 |
|
5989 |
+
// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/slot-fill/slot.js
|
5990 |
+
|
5991 |
+
|
5992 |
+
|
5993 |
+
|
5994 |
+
|
5995 |
+
|
5996 |
+
|
5997 |
+
|
5998 |
+
|
5999 |
+
|
6000 |
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = Object(getPrototypeOf["a" /* default */])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = Object(getPrototypeOf["a" /* default */])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return Object(possibleConstructorReturn["a" /* default */])(this, result); }; }
|
6001 |
+
|
6002 |
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
|
6003 |
+
|
6004 |
+
/**
|
6005 |
+
* External dependencies
|
6006 |
+
*/
|
6007 |
+
|
6008 |
+
/**
|
6009 |
+
* WordPress dependencies
|
6010 |
+
*/
|
6011 |
+
|
6012 |
+
|
6013 |
+
/**
|
6014 |
+
* Internal dependencies
|
6015 |
+
*/
|
6016 |
+
|
6017 |
+
|
6018 |
+
|
6019 |
+
var slot_SlotComponent = /*#__PURE__*/function (_Component) {
|
6020 |
+
Object(inherits["a" /* default */])(SlotComponent, _Component);
|
6021 |
+
|
6022 |
+
var _super = _createSuper(SlotComponent);
|
6023 |
+
|
6024 |
+
function SlotComponent() {
|
6025 |
+
var _this;
|
6026 |
+
|
6027 |
+
Object(classCallCheck["a" /* default */])(this, SlotComponent);
|
6028 |
+
|
6029 |
+
_this = _super.apply(this, arguments);
|
6030 |
+
_this.isUnmounted = false;
|
6031 |
+
_this.bindNode = _this.bindNode.bind(Object(assertThisInitialized["a" /* default */])(_this));
|
6032 |
+
return _this;
|
6033 |
+
}
|
6034 |
+
|
6035 |
+
Object(createClass["a" /* default */])(SlotComponent, [{
|
6036 |
+
key: "componentDidMount",
|
6037 |
+
value: function componentDidMount() {
|
6038 |
+
var registerSlot = this.props.registerSlot;
|
6039 |
+
registerSlot(this.props.name, this);
|
6040 |
}
|
6041 |
}, {
|
6042 |
+
key: "componentWillUnmount",
|
6043 |
+
value: function componentWillUnmount() {
|
6044 |
+
var unregisterSlot = this.props.unregisterSlot;
|
6045 |
+
this.isUnmounted = true;
|
6046 |
+
unregisterSlot(this.props.name, this);
|
6047 |
+
}
|
6048 |
+
}, {
|
6049 |
+
key: "componentDidUpdate",
|
6050 |
+
value: function componentDidUpdate(prevProps) {
|
6051 |
var _this$props = this.props,
|
6052 |
+
name = _this$props.name,
|
6053 |
+
unregisterSlot = _this$props.unregisterSlot,
|
6054 |
+
registerSlot = _this$props.registerSlot;
|
|
|
|
|
|
|
|
|
6055 |
|
6056 |
+
if (prevProps.name !== name) {
|
6057 |
+
unregisterSlot(prevProps.name);
|
6058 |
+
registerSlot(name, this);
|
6059 |
+
}
|
6060 |
+
}
|
6061 |
+
}, {
|
6062 |
+
key: "bindNode",
|
6063 |
+
value: function bindNode(node) {
|
6064 |
+
this.node = node;
|
6065 |
+
}
|
6066 |
+
}, {
|
6067 |
+
key: "forceUpdate",
|
6068 |
+
value: function forceUpdate() {
|
6069 |
+
if (this.isUnmounted) {
|
6070 |
+
return;
|
6071 |
}
|
6072 |
|
6073 |
+
Object(get["a" /* default */])(Object(getPrototypeOf["a" /* default */])(SlotComponent.prototype), "forceUpdate", this).call(this);
|
6074 |
+
}
|
6075 |
+
}, {
|
6076 |
+
key: "render",
|
6077 |
+
value: function render() {
|
6078 |
+
var _this$props2 = this.props,
|
6079 |
+
children = _this$props2.children,
|
6080 |
+
name = _this$props2.name,
|
6081 |
+
_this$props2$fillProp = _this$props2.fillProps,
|
6082 |
+
fillProps = _this$props2$fillProp === void 0 ? {} : _this$props2$fillProp,
|
6083 |
+
getFills = _this$props2.getFills;
|
6084 |
+
var fills = Object(external_lodash_["map"])(getFills(name, this), function (fill) {
|
6085 |
+
var fillKey = fill.occurrence;
|
6086 |
+
var fillChildren = Object(external_lodash_["isFunction"])(fill.children) ? fill.children(fillProps) : fill.children;
|
6087 |
+
return external_this_wp_element_["Children"].map(fillChildren, function (child, childIndex) {
|
6088 |
+
if (!child || Object(external_lodash_["isString"])(child)) {
|
6089 |
+
return child;
|
6090 |
+
}
|
6091 |
+
|
6092 |
+
var childKey = "".concat(fillKey, "---").concat(child.key || childIndex);
|
6093 |
+
return Object(external_this_wp_element_["cloneElement"])(child, {
|
6094 |
+
key: childKey
|
6095 |
+
});
|
6096 |
+
});
|
6097 |
+
}).filter( // In some cases fills are rendered only when some conditions apply.
|
6098 |
+
// This ensures that we only use non-empty fills when rendering, i.e.,
|
6099 |
+
// it allows us to render wrappers only when the fills are actually present.
|
6100 |
+
Object(external_lodash_["negate"])(external_this_wp_element_["isEmptyElement"]));
|
6101 |
+
return Object(external_this_wp_element_["createElement"])(external_this_wp_element_["Fragment"], null, Object(external_lodash_["isFunction"])(children) ? children(fills) : fills);
|
6102 |
}
|
6103 |
}]);
|
6104 |
|
6105 |
+
return SlotComponent;
|
6106 |
+
}(external_this_wp_element_["Component"]);
|
6107 |
|
6108 |
+
var slot_Slot = function Slot(props) {
|
6109 |
+
return Object(external_this_wp_element_["createElement"])(context["a" /* Consumer */], null, function (_ref) {
|
6110 |
+
var registerSlot = _ref.registerSlot,
|
6111 |
+
unregisterSlot = _ref.unregisterSlot,
|
6112 |
+
getFills = _ref.getFills;
|
6113 |
+
return Object(external_this_wp_element_["createElement"])(slot_SlotComponent, Object(esm_extends["a" /* default */])({}, props, {
|
6114 |
+
registerSlot: registerSlot,
|
6115 |
+
unregisterSlot: unregisterSlot,
|
6116 |
+
getFills: getFills
|
6117 |
+
}));
|
6118 |
+
});
|
6119 |
+
};
|
6120 |
|
6121 |
+
/* harmony default export */ var slot_fill_slot = (slot_Slot);
|
6122 |
+
//# sourceMappingURL=slot.js.map
|
6123 |
+
// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/slot-fill/fill.js
|
6124 |
|
|
|
|
|
6125 |
|
|
|
6126 |
|
6127 |
+
/**
|
6128 |
+
* External dependencies
|
6129 |
+
*/
|
6130 |
|
6131 |
+
/**
|
6132 |
+
* WordPress dependencies
|
6133 |
+
*/
|
6134 |
|
|
|
|
|
|
|
6135 |
|
6136 |
+
/**
|
6137 |
+
* Internal dependencies
|
6138 |
+
*/
|
6139 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6140 |
|
6141 |
+
var occurrences = 0;
|
6142 |
|
6143 |
+
function fill_FillComponent(_ref) {
|
6144 |
+
var name = _ref.name,
|
6145 |
+
children = _ref.children,
|
6146 |
+
registerFill = _ref.registerFill,
|
6147 |
+
unregisterFill = _ref.unregisterFill;
|
6148 |
+
var slot = Object(context["c" /* useSlot */])(name);
|
6149 |
+
var ref = Object(external_this_wp_element_["useRef"])({
|
6150 |
+
name: name,
|
6151 |
+
children: children
|
6152 |
+
});
|
6153 |
|
6154 |
+
if (!ref.current.occurrence) {
|
6155 |
+
ref.current.occurrence = ++occurrences;
|
6156 |
+
}
|
6157 |
+
|
6158 |
+
Object(external_this_wp_element_["useLayoutEffect"])(function () {
|
6159 |
+
registerFill(name, ref.current);
|
6160 |
+
return function () {
|
6161 |
+
return unregisterFill(name, ref.current);
|
6162 |
+
};
|
6163 |
+
}, []);
|
6164 |
+
Object(external_this_wp_element_["useLayoutEffect"])(function () {
|
6165 |
+
ref.current.children = children;
|
6166 |
+
|
6167 |
+
if (slot) {
|
6168 |
+
slot.forceUpdate();
|
6169 |
}
|
6170 |
+
}, [children]);
|
6171 |
+
Object(external_this_wp_element_["useLayoutEffect"])(function () {
|
6172 |
+
if (name === ref.current.name) {
|
6173 |
+
// ignore initial effect
|
6174 |
+
return;
|
6175 |
}
|
6176 |
|
6177 |
+
unregisterFill(ref.current.name, ref.current);
|
6178 |
+
ref.current.name = name;
|
6179 |
+
registerFill(name, ref.current);
|
6180 |
+
}, [name]);
|
|
|
|
|
|
|
|
|
|
|
6181 |
|
6182 |
+
if (!slot || !slot.node) {
|
6183 |
+
return null;
|
6184 |
+
} // If a function is passed as a child, provide it with the fillProps.
|
|
|
|
|
|
|
|
|
6185 |
|
6186 |
+
|
6187 |
+
if (Object(external_lodash_["isFunction"])(children)) {
|
6188 |
+
children = children(slot.props.fillProps);
|
6189 |
+
}
|
6190 |
+
|
6191 |
+
return Object(external_this_wp_element_["createPortal"])(children, slot.node);
|
6192 |
}
|
6193 |
|
6194 |
+
var fill_Fill = function Fill(props) {
|
6195 |
+
return Object(external_this_wp_element_["createElement"])(context["a" /* Consumer */], null, function (_ref2) {
|
6196 |
+
var registerFill = _ref2.registerFill,
|
6197 |
+
unregisterFill = _ref2.unregisterFill;
|
6198 |
+
return Object(external_this_wp_element_["createElement"])(fill_FillComponent, Object(esm_extends["a" /* default */])({}, props, {
|
6199 |
+
registerFill: registerFill,
|
6200 |
+
unregisterFill: unregisterFill
|
6201 |
+
}));
|
6202 |
+
});
|
6203 |
+
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6204 |
|
6205 |
+
/* harmony default export */ var slot_fill_fill = (fill_Fill);
|
6206 |
+
//# sourceMappingURL=fill.js.map
|
6207 |
+
// EXTERNAL MODULE: ./node_modules/@wordpress/components/build-module/slot-fill/bubbles-virtually/slot-fill-context.js
|
6208 |
+
var slot_fill_context = __webpack_require__(61);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6209 |
|
6210 |
+
// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/slot-fill/bubbles-virtually/slot.js
|
|
|
|
|
6211 |
|
|
|
|
|
|
|
|
|
|
|
|
|
6212 |
|
|
|
|
|
|
|
|
|
6213 |
|
|
|
|
|
|
|
|
|
|
|
6214 |
|
6215 |
+
/**
|
6216 |
+
* WordPress dependencies
|
6217 |
+
*/
|
6218 |
|
6219 |
+
/**
|
6220 |
+
* Internal dependencies
|
6221 |
+
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6222 |
|
|
|
|
|
|
|
|
|
|
|
6223 |
|
6224 |
+
function bubbles_virtually_slot_Slot(_ref) {
|
6225 |
+
var name = _ref.name,
|
6226 |
+
_ref$fillProps = _ref.fillProps,
|
6227 |
+
fillProps = _ref$fillProps === void 0 ? {} : _ref$fillProps,
|
6228 |
+
_ref$as = _ref.as,
|
6229 |
+
Component = _ref$as === void 0 ? 'div' : _ref$as,
|
6230 |
+
props = Object(objectWithoutProperties["a" /* default */])(_ref, ["name", "fillProps", "as"]);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6231 |
|
6232 |
+
var registry = Object(external_this_wp_element_["useContext"])(slot_fill_context["a" /* default */]);
|
6233 |
+
var ref = Object(external_this_wp_element_["useRef"])();
|
6234 |
+
Object(external_this_wp_element_["useLayoutEffect"])(function () {
|
6235 |
+
registry.registerSlot(name, ref, fillProps);
|
6236 |
+
return function () {
|
6237 |
+
registry.unregisterSlot(name, ref);
|
6238 |
+
}; // We are not including fillProps in the deps because we don't want to
|
6239 |
+
// unregister and register the slot whenever fillProps change, which would
|
6240 |
+
// cause the fill to be re-mounted. We are only considering the initial value
|
6241 |
+
// of fillProps.
|
6242 |
+
}, [registry.registerSlot, registry.unregisterSlot, name]); // fillProps may be an update that interacts with the layout, so we
|
6243 |
+
// useLayoutEffect
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6244 |
|
6245 |
+
Object(external_this_wp_element_["useLayoutEffect"])(function () {
|
6246 |
+
registry.updateSlot(name, fillProps);
|
6247 |
+
});
|
6248 |
+
return Object(external_this_wp_element_["createElement"])(Component, Object(esm_extends["a" /* default */])({
|
6249 |
+
ref: ref
|
6250 |
+
}, props));
|
6251 |
+
}
|
6252 |
+
//# sourceMappingURL=slot.js.map
|
6253 |
+
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/slicedToArray.js + 3 modules
|
6254 |
+
var slicedToArray = __webpack_require__(24);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6255 |
|
6256 |
+
// EXTERNAL MODULE: ./node_modules/@wordpress/components/build-module/slot-fill/bubbles-virtually/use-slot.js
|
6257 |
+
var use_slot = __webpack_require__(71);
|
6258 |
|
6259 |
+
// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/slot-fill/bubbles-virtually/fill.js
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6260 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6261 |
|
6262 |
+
/**
|
6263 |
+
* WordPress dependencies
|
6264 |
+
*/
|
6265 |
|
6266 |
+
/**
|
6267 |
+
* Internal dependencies
|
6268 |
+
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6269 |
|
|
|
|
|
|
|
|
|
6270 |
|
|
|
6271 |
|
6272 |
+
function useForceUpdate() {
|
6273 |
+
var _useState = Object(external_this_wp_element_["useState"])({}),
|
6274 |
+
_useState2 = Object(slicedToArray["a" /* default */])(_useState, 2),
|
6275 |
+
setState = _useState2[1];
|
6276 |
+
|
6277 |
+
return function () {
|
6278 |
+
return setState({});
|
6279 |
+
};
|
6280 |
}
|
6281 |
|
6282 |
+
function bubbles_virtually_fill_Fill(_ref) {
|
6283 |
+
var name = _ref.name,
|
6284 |
+
children = _ref.children;
|
6285 |
+
var slot = Object(use_slot["a" /* default */])(name);
|
6286 |
+
var ref = Object(external_this_wp_element_["useRef"])({
|
6287 |
+
rerender: useForceUpdate()
|
6288 |
+
});
|
6289 |
+
Object(external_this_wp_element_["useEffect"])(function () {
|
6290 |
+
// We register fills so we can keep track of their existance.
|
6291 |
+
// Some Slot implementations need to know if there're already fills
|
6292 |
+
// registered so they can choose to render themselves or not.
|
6293 |
+
slot.registerFill(ref);
|
6294 |
+
return function () {
|
6295 |
+
slot.unregisterFill(ref);
|
6296 |
+
};
|
6297 |
+
}, [slot.registerFill, slot.unregisterFill]);
|
6298 |
|
6299 |
+
if (!slot.ref || !slot.ref.current) {
|
6300 |
+
return null;
|
6301 |
+
}
|
6302 |
|
6303 |
+
if (typeof children === 'function') {
|
6304 |
+
children = children(slot.fillProps);
|
6305 |
+
}
|
6306 |
|
6307 |
+
return Object(external_this_wp_element_["createPortal"])(children, slot.ref.current);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6308 |
}
|
6309 |
+
//# sourceMappingURL=fill.js.map
|
6310 |
+
// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/slot-fill/index.js
|
6311 |
|
|
|
|
|
|
|
|
|
|
|
6312 |
|
|
|
|
|
|
|
6313 |
|
|
|
|
|
6314 |
|
6315 |
+
/**
|
6316 |
+
* Internal dependencies
|
6317 |
+
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6318 |
|
|
|
|
|
6319 |
|
|
|
|
|
6320 |
|
|
|
|
|
|
|
|
|
|
|
|
|
6321 |
|
|
|
|
|
|
|
6322 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6323 |
|
6324 |
+
function slot_fill_Slot(_ref) {
|
6325 |
+
var bubblesVirtually = _ref.bubblesVirtually,
|
6326 |
+
props = Object(objectWithoutProperties["a" /* default */])(_ref, ["bubblesVirtually"]);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6327 |
|
6328 |
+
if (bubblesVirtually) {
|
6329 |
+
return Object(external_this_wp_element_["createElement"])(bubbles_virtually_slot_Slot, props);
|
6330 |
+
}
|
6331 |
+
|
6332 |
+
return Object(external_this_wp_element_["createElement"])(slot_fill_slot, props);
|
6333 |
+
}
|
6334 |
+
function slot_fill_Fill(props) {
|
6335 |
+
// We're adding both Fills here so they can register themselves before
|
6336 |
+
// their respective slot has been registered. Only the Fill that has a slot
|
6337 |
+
// will render. The other one will return null.
|
6338 |
+
return Object(external_this_wp_element_["createElement"])(external_this_wp_element_["Fragment"], null, Object(external_this_wp_element_["createElement"])(slot_fill_fill, props), Object(external_this_wp_element_["createElement"])(bubbles_virtually_fill_Fill, props));
|
6339 |
}
|
6340 |
+
function createSlotFill(name) {
|
6341 |
+
var FillComponent = function FillComponent(props) {
|
6342 |
+
return Object(external_this_wp_element_["createElement"])(slot_fill_Fill, Object(esm_extends["a" /* default */])({
|
6343 |
+
name: name
|
6344 |
+
}, props));
|
6345 |
+
};
|
6346 |
|
6347 |
+
FillComponent.displayName = name + 'Fill';
|
|
|
|
|
|
|
|
|
6348 |
|
6349 |
+
var SlotComponent = function SlotComponent(props) {
|
6350 |
+
return Object(external_this_wp_element_["createElement"])(slot_fill_Slot, Object(esm_extends["a" /* default */])({
|
6351 |
+
name: name
|
6352 |
+
}, props));
|
6353 |
+
};
|
6354 |
|
6355 |
+
SlotComponent.displayName = name + 'Slot';
|
6356 |
+
return {
|
6357 |
+
Fill: FillComponent,
|
6358 |
+
Slot: SlotComponent
|
6359 |
+
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6360 |
}
|
6361 |
|
6362 |
+
//# sourceMappingURL=index.js.map
|
|
|
|
|
|
|
|
|
6363 |
|
6364 |
+
/***/ }),
|
6365 |
+
/* 96 */
|
6366 |
+
/***/ (function(module, exports, __webpack_require__) {
|
6367 |
|
6368 |
+
"use strict";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6369 |
|
|
|
|
|
6370 |
|
6371 |
+
var replace = String.prototype.replace;
|
6372 |
+
var percentTwenties = /%20/g;
|
|
|
|
|
|
|
6373 |
|
6374 |
+
var util = __webpack_require__(87);
|
|
|
|
|
|
|
|
|
6375 |
|
6376 |
+
var Format = {
|
6377 |
+
RFC1738: 'RFC1738',
|
6378 |
+
RFC3986: 'RFC3986'
|
6379 |
+
};
|
6380 |
|
6381 |
+
module.exports = util.assign(
|
6382 |
+
{
|
6383 |
+
'default': Format.RFC3986,
|
6384 |
+
formatters: {
|
6385 |
+
RFC1738: function (value) {
|
6386 |
+
return replace.call(value, percentTwenties, '+');
|
6387 |
+
},
|
6388 |
+
RFC3986: function (value) {
|
6389 |
+
return String(value);
|
6390 |
+
}
|
6391 |
+
}
|
6392 |
+
},
|
6393 |
+
Format
|
6394 |
+
);
|
6395 |
|
|
|
|
|
|
|
|
|
|
|
6396 |
|
6397 |
+
/***/ }),
|
6398 |
+
/* 97 */
|
6399 |
+
/***/ (function(module, exports, __webpack_require__) {
|
|
|
|
|
|
|
6400 |
|
6401 |
+
var arrayLikeToArray = __webpack_require__(62);
|
|
|
|
|
|
|
6402 |
|
6403 |
+
function _arrayWithoutHoles(arr) {
|
6404 |
+
if (Array.isArray(arr)) return arrayLikeToArray(arr);
|
6405 |
}
|
6406 |
|
6407 |
+
module.exports = _arrayWithoutHoles;
|
|
|
|
|
|
|
6408 |
|
6409 |
+
/***/ }),
|
6410 |
+
/* 98 */
|
6411 |
+
/***/ (function(module, exports) {
|
|
|
|
|
|
|
6412 |
|
6413 |
+
function _iterableToArray(iter) {
|
6414 |
+
if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter);
|
6415 |
}
|
6416 |
|
6417 |
+
module.exports = _iterableToArray;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6418 |
|
6419 |
+
/***/ }),
|
6420 |
+
/* 99 */
|
6421 |
+
/***/ (function(module, exports) {
|
|
|
6422 |
|
6423 |
+
function _nonIterableSpread() {
|
6424 |
+
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
|
|
|
|
|
|
|
6425 |
}
|
6426 |
|
6427 |
+
module.exports = _nonIterableSpread;
|
|
|
|
|
|
|
|
|
|
|
|
|
6428 |
|
6429 |
+
/***/ }),
|
6430 |
+
/* 100 */
|
6431 |
+
/***/ (function(module, exports) {
|
6432 |
|
6433 |
+
function _arrayWithHoles(arr) {
|
6434 |
+
if (Array.isArray(arr)) return arr;
|
|
|
|
|
|
|
|
|
6435 |
}
|
6436 |
|
6437 |
+
module.exports = _arrayWithHoles;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6438 |
|
6439 |
+
/***/ }),
|
6440 |
+
/* 101 */
|
6441 |
+
/***/ (function(module, exports) {
|
|
|
|
|
|
|
|
|
6442 |
|
6443 |
+
function _iterableToArrayLimit(arr, i) {
|
6444 |
+
if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return;
|
6445 |
+
var _arr = [];
|
6446 |
+
var _n = true;
|
6447 |
+
var _d = false;
|
6448 |
+
var _e = undefined;
|
|
|
|
|
6449 |
|
6450 |
+
try {
|
6451 |
+
for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
|
6452 |
+
_arr.push(_s.value);
|
|
|
6453 |
|
6454 |
+
if (i && _arr.length === i) break;
|
6455 |
+
}
|
6456 |
+
} catch (err) {
|
6457 |
+
_d = true;
|
6458 |
+
_e = err;
|
6459 |
+
} finally {
|
6460 |
+
try {
|
6461 |
+
if (!_n && _i["return"] != null) _i["return"]();
|
6462 |
+
} finally {
|
6463 |
+
if (_d) throw _e;
|
6464 |
+
}
|
6465 |
+
}
|
6466 |
|
6467 |
+
return _arr;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6468 |
}
|
6469 |
|
6470 |
+
module.exports = _iterableToArrayLimit;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6471 |
|
6472 |
+
/***/ }),
|
6473 |
+
/* 102 */
|
6474 |
+
/***/ (function(module, exports) {
|
6475 |
+
|
6476 |
+
function _nonIterableRest() {
|
6477 |
+
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
|
|
|
6478 |
}
|
6479 |
|
6480 |
+
module.exports = _nonIterableRest;
|
|
|
|
|
6481 |
|
6482 |
+
/***/ }),
|
6483 |
+
/* 103 */
|
6484 |
+
/***/ (function(module, exports, __webpack_require__) {
|
6485 |
|
6486 |
+
"use strict";
|
|
|
|
|
|
|
|
|
|
|
6487 |
|
|
|
|
|
|
|
|
|
|
|
|
|
6488 |
|
6489 |
+
var keys = Object.keys;
|
|
|
|
|
|
|
6490 |
|
6491 |
+
/**
|
6492 |
+
* Returns true if the two objects are shallow equal, or false otherwise.
|
6493 |
+
*
|
6494 |
+
* @param {import('.').ComparableObject} a First object to compare.
|
6495 |
+
* @param {import('.').ComparableObject} b Second object to compare.
|
6496 |
+
*
|
6497 |
+
* @return {boolean} Whether the two objects are shallow equal.
|
6498 |
+
*/
|
6499 |
+
function isShallowEqualObjects( a, b ) {
|
6500 |
+
var aKeys, bKeys, i, key, aValue;
|
6501 |
+
|
6502 |
+
if ( a === b ) {
|
6503 |
+
return true;
|
6504 |
+
}
|
6505 |
+
|
6506 |
+
aKeys = keys( a );
|
6507 |
+
bKeys = keys( b );
|
6508 |
+
|
6509 |
+
if ( aKeys.length !== bKeys.length ) {
|
6510 |
+
return false;
|
6511 |
+
}
|
6512 |
+
|
6513 |
+
i = 0;
|
6514 |
+
|
6515 |
+
while ( i < aKeys.length ) {
|
6516 |
+
key = aKeys[ i ];
|
6517 |
+
aValue = a[ key ];
|
6518 |
+
|
6519 |
+
if (
|
6520 |
+
// In iterating only the keys of the first object after verifying
|
6521 |
+
// equal lengths, account for the case that an explicit `undefined`
|
6522 |
+
// value in the first is implicitly undefined in the second.
|
6523 |
+
//
|
6524 |
+
// Example: isShallowEqualObjects( { a: undefined }, { b: 5 } )
|
6525 |
+
( aValue === undefined && ! b.hasOwnProperty( key ) ) ||
|
6526 |
+
aValue !== b[ key ]
|
6527 |
+
) {
|
6528 |
+
return false;
|
6529 |
+
}
|
6530 |
+
|
6531 |
+
i++;
|
6532 |
+
}
|
6533 |
+
|
6534 |
+
return true;
|
6535 |
}
|
6536 |
|
6537 |
+
module.exports = isShallowEqualObjects;
|
|
|
6538 |
|
|
|
|
|
6539 |
|
6540 |
+
/***/ }),
|
6541 |
+
/* 104 */
|
6542 |
+
/***/ (function(module, exports, __webpack_require__) {
|
6543 |
|
6544 |
+
"use strict";
|
6545 |
|
|
|
|
|
|
|
|
|
|
|
|
|
6546 |
|
6547 |
+
/**
|
6548 |
+
* Returns true if the two arrays are shallow equal, or false otherwise.
|
6549 |
+
*
|
6550 |
+
* @param {any[]} a First array to compare.
|
6551 |
+
* @param {any[]} b Second array to compare.
|
6552 |
+
*
|
6553 |
+
* @return {boolean} Whether the two arrays are shallow equal.
|
6554 |
+
*/
|
6555 |
+
function isShallowEqualArrays( a, b ) {
|
6556 |
+
var i;
|
6557 |
|
6558 |
+
if ( a === b ) {
|
6559 |
+
return true;
|
6560 |
+
}
|
6561 |
|
6562 |
+
if ( a.length !== b.length ) {
|
6563 |
+
return false;
|
6564 |
+
}
|
6565 |
|
6566 |
+
for ( i = 0; i < a.length; i++ ) {
|
6567 |
+
if ( a[ i ] !== b[ i ] ) {
|
6568 |
+
return false;
|
6569 |
+
}
|
6570 |
+
}
|
|
|
|
|
6571 |
|
6572 |
+
return true;
|
6573 |
+
}
|
|
|
|
|
|
|
|
|
6574 |
|
6575 |
+
module.exports = isShallowEqualArrays;
|
|
|
|
|
|
|
|
|
|
|
6576 |
|
|
|
6577 |
|
6578 |
+
/***/ }),
|
6579 |
+
/* 105 */,
|
6580 |
+
/* 106 */
|
6581 |
+
/***/ (function(module, exports, __webpack_require__) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6582 |
|
6583 |
+
// TinyColor v1.4.2
|
6584 |
+
// https://github.com/bgrins/TinyColor
|
6585 |
+
// Brian Grinstead, MIT License
|
6586 |
|
6587 |
+
(function(Math) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6588 |
|
6589 |
+
var trimLeft = /^\s+/,
|
6590 |
+
trimRight = /\s+$/,
|
6591 |
+
tinyCounter = 0,
|
6592 |
+
mathRound = Math.round,
|
6593 |
+
mathMin = Math.min,
|
6594 |
+
mathMax = Math.max,
|
6595 |
+
mathRandom = Math.random;
|
6596 |
|
6597 |
+
function tinycolor (color, opts) {
|
6598 |
+
|
6599 |
+
color = (color) ? color : '';
|
6600 |
+
opts = opts || { };
|
6601 |
+
|
6602 |
+
// If input is already a tinycolor, return itself
|
6603 |
+
if (color instanceof tinycolor) {
|
6604 |
+
return color;
|
6605 |
}
|
6606 |
+
// If we are called as a function, call using new instead
|
6607 |
+
if (!(this instanceof tinycolor)) {
|
6608 |
+
return new tinycolor(color, opts);
|
6609 |
}
|
|
|
6610 |
|
6611 |
+
var rgb = inputToRGB(color);
|
6612 |
+
this._originalInput = color,
|
6613 |
+
this._r = rgb.r,
|
6614 |
+
this._g = rgb.g,
|
6615 |
+
this._b = rgb.b,
|
6616 |
+
this._a = rgb.a,
|
6617 |
+
this._roundA = mathRound(100*this._a) / 100,
|
6618 |
+
this._format = opts.format || rgb.format;
|
6619 |
+
this._gradientType = opts.gradientType;
|
6620 |
|
6621 |
+
// Don't let the range of [0,255] come back in [0,1].
|
6622 |
+
// Potentially lose a little bit of precision here, but will fix issues where
|
6623 |
+
// .5 gets interpreted as half of the total, instead of half of 1
|
6624 |
+
// If it was supposed to be 128, this was already taken care of by `inputToRgb`
|
6625 |
+
if (this._r < 1) { this._r = mathRound(this._r); }
|
6626 |
+
if (this._g < 1) { this._g = mathRound(this._g); }
|
6627 |
+
if (this._b < 1) { this._b = mathRound(this._b); }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6628 |
|
6629 |
+
this._ok = rgb.ok;
|
6630 |
+
this._tc_id = tinyCounter++;
|
|
|
6631 |
}
|
|
|
|
|
|
|
6632 |
|
6633 |
+
tinycolor.prototype = {
|
6634 |
+
isDark: function() {
|
6635 |
+
return this.getBrightness() < 128;
|
6636 |
+
},
|
6637 |
+
isLight: function() {
|
6638 |
+
return !this.isDark();
|
6639 |
+
},
|
6640 |
+
isValid: function() {
|
6641 |
+
return this._ok;
|
6642 |
+
},
|
6643 |
+
getOriginalInput: function() {
|
6644 |
+
return this._originalInput;
|
6645 |
+
},
|
6646 |
+
getFormat: function() {
|
6647 |
+
return this._format;
|
6648 |
+
},
|
6649 |
+
getAlpha: function() {
|
6650 |
+
return this._a;
|
6651 |
+
},
|
6652 |
+
getBrightness: function() {
|
6653 |
+
//http://www.w3.org/TR/AERT#color-contrast
|
6654 |
+
var rgb = this.toRgb();
|
6655 |
+
return (rgb.r * 299 + rgb.g * 587 + rgb.b * 114) / 1000;
|
6656 |
+
},
|
6657 |
+
getLuminance: function() {
|
6658 |
+
//http://www.w3.org/TR/2008/REC-WCAG20-20081211/#relativeluminancedef
|
6659 |
+
var rgb = this.toRgb();
|
6660 |
+
var RsRGB, GsRGB, BsRGB, R, G, B;
|
6661 |
+
RsRGB = rgb.r/255;
|
6662 |
+
GsRGB = rgb.g/255;
|
6663 |
+
BsRGB = rgb.b/255;
|
6664 |
|
6665 |
+
if (RsRGB <= 0.03928) {R = RsRGB / 12.92;} else {R = Math.pow(((RsRGB + 0.055) / 1.055), 2.4);}
|
6666 |
+
if (GsRGB <= 0.03928) {G = GsRGB / 12.92;} else {G = Math.pow(((GsRGB + 0.055) / 1.055), 2.4);}
|
6667 |
+
if (BsRGB <= 0.03928) {B = BsRGB / 12.92;} else {B = Math.pow(((BsRGB + 0.055) / 1.055), 2.4);}
|
6668 |
+
return (0.2126 * R) + (0.7152 * G) + (0.0722 * B);
|
6669 |
+
},
|
6670 |
+
setAlpha: function(value) {
|
6671 |
+
this._a = boundAlpha(value);
|
6672 |
+
this._roundA = mathRound(100*this._a) / 100;
|
6673 |
+
return this;
|
6674 |
+
},
|
6675 |
+
toHsv: function() {
|
6676 |
+
var hsv = rgbToHsv(this._r, this._g, this._b);
|
6677 |
+
return { h: hsv.h * 360, s: hsv.s, v: hsv.v, a: this._a };
|
6678 |
+
},
|
6679 |
+
toHsvString: function() {
|
6680 |
+
var hsv = rgbToHsv(this._r, this._g, this._b);
|
6681 |
+
var h = mathRound(hsv.h * 360), s = mathRound(hsv.s * 100), v = mathRound(hsv.v * 100);
|
6682 |
+
return (this._a == 1) ?
|
6683 |
+
"hsv(" + h + ", " + s + "%, " + v + "%)" :
|
6684 |
+
"hsva(" + h + ", " + s + "%, " + v + "%, "+ this._roundA + ")";
|
6685 |
+
},
|
6686 |
+
toHsl: function() {
|
6687 |
+
var hsl = rgbToHsl(this._r, this._g, this._b);
|
6688 |
+
return { h: hsl.h * 360, s: hsl.s, l: hsl.l, a: this._a };
|
6689 |
+
},
|
6690 |
+
toHslString: function() {
|
6691 |
+
var hsl = rgbToHsl(this._r, this._g, this._b);
|
6692 |
+
var h = mathRound(hsl.h * 360), s = mathRound(hsl.s * 100), l = mathRound(hsl.l * 100);
|
6693 |
+
return (this._a == 1) ?
|
6694 |
+
"hsl(" + h + ", " + s + "%, " + l + "%)" :
|
6695 |
+
"hsla(" + h + ", " + s + "%, " + l + "%, "+ this._roundA + ")";
|
6696 |
+
},
|
6697 |
+
toHex: function(allow3Char) {
|
6698 |
+
return rgbToHex(this._r, this._g, this._b, allow3Char);
|
6699 |
+
},
|
6700 |
+
toHexString: function(allow3Char) {
|
6701 |
+
return '#' + this.toHex(allow3Char);
|
6702 |
+
},
|
6703 |
+
toHex8: function(allow4Char) {
|
6704 |
+
return rgbaToHex(this._r, this._g, this._b, this._a, allow4Char);
|
6705 |
+
},
|
6706 |
+
toHex8String: function(allow4Char) {
|
6707 |
+
return '#' + this.toHex8(allow4Char);
|
6708 |
+
},
|
6709 |
+
toRgb: function() {
|
6710 |
+
return { r: mathRound(this._r), g: mathRound(this._g), b: mathRound(this._b), a: this._a };
|
6711 |
+
},
|
6712 |
+
toRgbString: function() {
|
6713 |
+
return (this._a == 1) ?
|
6714 |
+
"rgb(" + mathRound(this._r) + ", " + mathRound(this._g) + ", " + mathRound(this._b) + ")" :
|
6715 |
+
"rgba(" + mathRound(this._r) + ", " + mathRound(this._g) + ", " + mathRound(this._b) + ", " + this._roundA + ")";
|
6716 |
+
},
|
6717 |
+
toPercentageRgb: function() {
|
6718 |
+
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 };
|
6719 |
+
},
|
6720 |
+
toPercentageRgbString: function() {
|
6721 |
+
return (this._a == 1) ?
|
6722 |
+
"rgb(" + mathRound(bound01(this._r, 255) * 100) + "%, " + mathRound(bound01(this._g, 255) * 100) + "%, " + mathRound(bound01(this._b, 255) * 100) + "%)" :
|
6723 |
+
"rgba(" + mathRound(bound01(this._r, 255) * 100) + "%, " + mathRound(bound01(this._g, 255) * 100) + "%, " + mathRound(bound01(this._b, 255) * 100) + "%, " + this._roundA + ")";
|
6724 |
+
},
|
6725 |
+
toName: function() {
|
6726 |
+
if (this._a === 0) {
|
6727 |
+
return "transparent";
|
6728 |
+
}
|
6729 |
|
6730 |
+
if (this._a < 1) {
|
6731 |
+
return false;
|
6732 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
6733 |
|
6734 |
+
return hexNames[rgbToHex(this._r, this._g, this._b, true)] || false;
|
6735 |
+
},
|
6736 |
+
toFilter: function(secondColor) {
|
6737 |
+
var hex8String = '#' + rgbaToArgbHex(this._r, this._g, this._b, this._a);
|
6738 |
+
var secondHex8String = hex8String;
|
6739 |
+
var gradientType = this._gradientType ? "GradientType = 1, " : "";
|
6740 |
|
6741 |
+
if (secondColor) {
|
6742 |
+
var s = tinycolor(secondColor);
|
6743 |
+
secondHex8String = '#' + rgbaToArgbHex(s._r, s._g, s._b, s._a);
|
6744 |
+
}
|
|
|
6745 |
|
6746 |
+
return "progid:DXImageTransform.Microsoft.gradient("+gradientType+"startColorstr="+hex8String+",endColorstr="+secondHex8String+")";
|
6747 |
+
},
|
6748 |
+
toString: function(format) {
|
6749 |
+
var formatSet = !!format;
|
6750 |
+
format = format || this._format;
|
6751 |
|
6752 |
+
var formattedString = false;
|
6753 |
+
var hasAlpha = this._a < 1 && this._a >= 0;
|
6754 |
+
var needsAlphaFormat = !formatSet && hasAlpha && (format === "hex" || format === "hex6" || format === "hex3" || format === "hex4" || format === "hex8" || format === "name");
|
6755 |
|
6756 |
+
if (needsAlphaFormat) {
|
6757 |
+
// Special case for "transparent", all other non-alpha formats
|
6758 |
+
// will return rgba when there is transparency.
|
6759 |
+
if (format === "name" && this._a === 0) {
|
6760 |
+
return this.toName();
|
6761 |
+
}
|
6762 |
+
return this.toRgbString();
|
6763 |
+
}
|
6764 |
+
if (format === "rgb") {
|
6765 |
+
formattedString = this.toRgbString();
|
6766 |
+
}
|
6767 |
+
if (format === "prgb") {
|
6768 |
+
formattedString = this.toPercentageRgbString();
|
6769 |
+
}
|
6770 |
+
if (format === "hex" || format === "hex6") {
|
6771 |
+
formattedString = this.toHexString();
|
6772 |
+
}
|
6773 |
+
if (format === "hex3") {
|
6774 |
+
formattedString = this.toHexString(true);
|
6775 |
+
}
|
6776 |
+
if (format === "hex4") {
|
6777 |
+
formattedString = this.toHex8String(true);
|
6778 |
+
}
|
6779 |
+
if (format === "hex8") {
|
6780 |
+
formattedString = this.toHex8String();
|
6781 |
+
}
|
6782 |
+
if (format === "name") {
|
6783 |
+
formattedString = this.toName();
|
6784 |
+
}
|
6785 |
+
if (format === "hsl") {
|
6786 |
+
formattedString = this.toHslString();
|
6787 |
+
}
|
6788 |
+
if (format === "hsv") {
|
6789 |
+
formattedString = this.toHsvString();
|
6790 |
+
}
|
6791 |
|
6792 |
+
return formattedString || this.toHexString();
|
6793 |
+
},
|
6794 |
+
clone: function() {
|
6795 |
+
return tinycolor(this.toString());
|
6796 |
+
},
|
6797 |
|
6798 |
+
_applyModification: function(fn, args) {
|
6799 |
+
var color = fn.apply(null, [this].concat([].slice.call(args)));
|
6800 |
+
this._r = color._r;
|
6801 |
+
this._g = color._g;
|
6802 |
+
this._b = color._b;
|
6803 |
+
this.setAlpha(color._a);
|
6804 |
+
return this;
|
6805 |
+
},
|
6806 |
+
lighten: function() {
|
6807 |
+
return this._applyModification(lighten, arguments);
|
6808 |
+
},
|
6809 |
+
brighten: function() {
|
6810 |
+
return this._applyModification(brighten, arguments);
|
6811 |
+
},
|
6812 |
+
darken: function() {
|
6813 |
+
return this._applyModification(darken, arguments);
|
6814 |
+
},
|
6815 |
+
desaturate: function() {
|
6816 |
+
return this._applyModification(desaturate, arguments);
|
6817 |
+
},
|
6818 |
+
saturate: function() {
|
6819 |
+
return this._applyModification(saturate, arguments);
|
6820 |
+
},
|
6821 |
+
greyscale: function() {
|
6822 |
+
return this._applyModification(greyscale, arguments);
|
6823 |
+
},
|
6824 |
+
spin: function() {
|
6825 |
+
return this._applyModification(spin, arguments);
|
6826 |
+
},
|
6827 |
|
6828 |
+
_applyCombination: function(fn, args) {
|
6829 |
+
return fn.apply(null, [this].concat([].slice.call(args)));
|
6830 |
+
},
|
6831 |
+
analogous: function() {
|
6832 |
+
return this._applyCombination(analogous, arguments);
|
6833 |
+
},
|
6834 |
+
complement: function() {
|
6835 |
+
return this._applyCombination(complement, arguments);
|
6836 |
+
},
|
6837 |
+
monochromatic: function() {
|
6838 |
+
return this._applyCombination(monochromatic, arguments);
|
6839 |
+
},
|
6840 |
+
splitcomplement: function() {
|
6841 |
+
return this._applyCombination(splitcomplement, arguments);
|
6842 |
+
},
|
6843 |
+
triad: function() {
|
6844 |
+
return this._applyCombination(triad, arguments);
|
6845 |
+
},
|
6846 |
+
tetrad: function() {
|
6847 |
+
return this._applyCombination(tetrad, arguments);
|
6848 |
+
}
|
6849 |
+
};
|
6850 |
|
6851 |
+
// If input is an object, force 1 into "1.0" to handle ratios properly
|
6852 |
+
// String input requires "1.0" as input, so 1 will be treated as 1
|
6853 |
+
tinycolor.fromRatio = function(color, opts) {
|
6854 |
+
if (typeof color == "object") {
|
6855 |
+
var newColor = {};
|
6856 |
+
for (var i in color) {
|
6857 |
+
if (color.hasOwnProperty(i)) {
|
6858 |
+
if (i === "a") {
|
6859 |
+
newColor[i] = color[i];
|
6860 |
+
}
|
6861 |
+
else {
|
6862 |
+
newColor[i] = convertToPercentage(color[i]);
|
6863 |
+
}
|
6864 |
+
}
|
6865 |
+
}
|
6866 |
+
color = newColor;
|
6867 |
+
}
|
6868 |
|
6869 |
+
return tinycolor(color, opts);
|
6870 |
+
};
|
6871 |
|
6872 |
+
// Given a string or object, convert that input to RGB
|
6873 |
+
// Possible string inputs:
|
6874 |
+
//
|
6875 |
+
// "red"
|
6876 |
+
// "#f00" or "f00"
|
6877 |
+
// "#ff0000" or "ff0000"
|
6878 |
+
// "#ff000000" or "ff000000"
|
6879 |
+
// "rgb 255 0 0" or "rgb (255, 0, 0)"
|
6880 |
+
// "rgb 1.0 0 0" or "rgb (1, 0, 0)"
|
6881 |
+
// "rgba (255, 0, 0, 1)" or "rgba 255, 0, 0, 1"
|
6882 |
+
// "rgba (1.0, 0, 0, 1)" or "rgba 1.0, 0, 0, 1"
|
6883 |
+
// "hsl(0, 100%, 50%)" or "hsl 0 100% 50%"
|
6884 |
+
// "hsla(0, 100%, 50%, 1)" or "hsla 0 100% 50%, 1"
|
6885 |
+
// "hsv(0, 100%, 100%)" or "hsv 0 100% 100%"
|
6886 |
+
//
|
6887 |
+
function inputToRGB(color) {
|
6888 |
|
6889 |
+
var rgb = { r: 0, g: 0, b: 0 };
|
6890 |
+
var a = 1;
|
6891 |
+
var s = null;
|
6892 |
+
var v = null;
|
6893 |
+
var l = null;
|
6894 |
+
var ok = false;
|
6895 |
+
var format = false;
|
6896 |
|
6897 |
+
if (typeof color == "string") {
|
6898 |
+
color = stringInputToObject(color);
|
6899 |
+
}
|
6900 |
|
6901 |
+
if (typeof color == "object") {
|
6902 |
+
if (isValidCSSUnit(color.r) && isValidCSSUnit(color.g) && isValidCSSUnit(color.b)) {
|
6903 |
+
rgb = rgbToRgb(color.r, color.g, color.b);
|
6904 |
+
ok = true;
|
6905 |
+
format = String(color.r).substr(-1) === "%" ? "prgb" : "rgb";
|
6906 |
+
}
|
6907 |
+
else if (isValidCSSUnit(color.h) && isValidCSSUnit(color.s) && isValidCSSUnit(color.v)) {
|
6908 |
+
s = convertToPercentage(color.s);
|
6909 |
+
v = convertToPercentage(color.v);
|
6910 |
+
rgb = hsvToRgb(color.h, s, v);
|
6911 |
+
ok = true;
|
6912 |
+
format = "hsv";
|
6913 |
+
}
|
6914 |
+
else if (isValidCSSUnit(color.h) && isValidCSSUnit(color.s) && isValidCSSUnit(color.l)) {
|
6915 |
+
s = convertToPercentage(color.s);
|
6916 |
+
l = convertToPercentage(color.l);
|
6917 |
+
rgb = hslToRgb(color.h, s, l);
|
6918 |
+
ok = true;
|
6919 |
+
format = "hsl";
|
6920 |
+
}
|
6921 |
|
6922 |
+
if (color.hasOwnProperty("a")) {
|
6923 |
+
a = color.a;
|
6924 |
+
}
|
6925 |
+
}
|
|
|
6926 |
|
6927 |
+
a = boundAlpha(a);
|
|
|
|
|
|
|
6928 |
|
6929 |
+
return {
|
6930 |
+
ok: ok,
|
6931 |
+
format: color.format || format,
|
6932 |
+
r: mathMin(255, mathMax(rgb.r, 0)),
|
6933 |
+
g: mathMin(255, mathMax(rgb.g, 0)),
|
6934 |
+
b: mathMin(255, mathMax(rgb.b, 0)),
|
6935 |
+
a: a
|
6936 |
+
};
|
6937 |
+
}
|
6938 |
|
6939 |
|
6940 |
+
// Conversion Functions
|
6941 |
+
// --------------------
|
6942 |
|
6943 |
+
// `rgbToHsl`, `rgbToHsv`, `hslToRgb`, `hsvToRgb` modified from:
|
6944 |
+
// <http://mjijackson.com/2008/02/rgb-to-hsl-and-rgb-to-hsv-color-model-conversion-algorithms-in-javascript>
|
|
|
6945 |
|
6946 |
+
// `rgbToRgb`
|
6947 |
+
// Handle bounds / percentage checking to conform to CSS color spec
|
6948 |
+
// <http://www.w3.org/TR/css3-color/>
|
6949 |
+
// *Assumes:* r, g, b in [0, 255] or [0, 1]
|
6950 |
+
// *Returns:* { r, g, b } in [0, 255]
|
6951 |
+
function rgbToRgb(r, g, b){
|
6952 |
+
return {
|
6953 |
+
r: bound01(r, 255) * 255,
|
6954 |
+
g: bound01(g, 255) * 255,
|
6955 |
+
b: bound01(b, 255) * 255
|
6956 |
+
};
|
6957 |
}
|
6958 |
|
6959 |
+
// `rgbToHsl`
|
6960 |
+
// Converts an RGB color value to HSL.
|
6961 |
+
// *Assumes:* r, g, and b are contained in [0, 255] or [0, 1]
|
6962 |
+
// *Returns:* { h, s, l } in [0,1]
|
6963 |
+
function rgbToHsl(r, g, b) {
|
6964 |
|
6965 |
+
r = bound01(r, 255);
|
6966 |
+
g = bound01(g, 255);
|
6967 |
+
b = bound01(b, 255);
|
6968 |
|
6969 |
+
var max = mathMax(r, g, b), min = mathMin(r, g, b);
|
6970 |
+
var h, s, l = (max + min) / 2;
|
6971 |
|
6972 |
+
if(max == min) {
|
6973 |
+
h = s = 0; // achromatic
|
6974 |
+
}
|
6975 |
+
else {
|
6976 |
+
var d = max - min;
|
6977 |
+
s = l > 0.5 ? d / (2 - max - min) : d / (max + min);
|
6978 |
+
switch(max) {
|
6979 |
+
case r: h = (g - b) / d + (g < b ? 6 : 0); break;
|
6980 |
+
case g: h = (b - r) / d + 2; break;
|
6981 |
+
case b: h = (r - g) / d + 4; break;
|
6982 |
+
}
|
6983 |
|
6984 |
+
h /= 6;
|
6985 |
+
}
|
|
|
6986 |
|
6987 |
+
return { h: h, s: s, l: l };
|
6988 |
}
|
6989 |
|
6990 |
+
// `hslToRgb`
|
6991 |
+
// Converts an HSL color value to RGB.
|
6992 |
+
// *Assumes:* h is contained in [0, 1] or [0, 360] and s and l are contained [0, 1] or [0, 100]
|
6993 |
+
// *Returns:* { r, g, b } in the set [0, 255]
|
6994 |
+
function hslToRgb(h, s, l) {
|
6995 |
+
var r, g, b;
|
6996 |
|
6997 |
+
h = bound01(h, 360);
|
6998 |
+
s = bound01(s, 100);
|
6999 |
+
l = bound01(l, 100);
|
7000 |
|
7001 |
+
function hue2rgb(p, q, t) {
|
7002 |
+
if(t < 0) t += 1;
|
7003 |
+
if(t > 1) t -= 1;
|
7004 |
+
if(t < 1/6) return p + (q - p) * 6 * t;
|
7005 |
+
if(t < 1/2) return q;
|
7006 |
+
if(t < 2/3) return p + (q - p) * (2/3 - t) * 6;
|
7007 |
+
return p;
|
7008 |
+
}
|
7009 |
|
7010 |
+
if(s === 0) {
|
7011 |
+
r = g = b = l; // achromatic
|
7012 |
+
}
|
7013 |
+
else {
|
7014 |
+
var q = l < 0.5 ? l * (1 + s) : l + s - l * s;
|
7015 |
+
var p = 2 * l - q;
|
7016 |
+
r = hue2rgb(p, q, h + 1/3);
|
7017 |
+
g = hue2rgb(p, q, h);
|
7018 |
+
b = hue2rgb(p, q, h - 1/3);
|
7019 |
+
}
|
7020 |
|
7021 |
+
return { r: r * 255, g: g * 255, b: b * 255 };
|
7022 |
}
|
7023 |
|
7024 |
+
// `rgbToHsv`
|
7025 |
+
// Converts an RGB color value to HSV
|
7026 |
+
// *Assumes:* r, g, and b are contained in the set [0, 255] or [0, 1]
|
7027 |
+
// *Returns:* { h, s, v } in [0,1]
|
7028 |
+
function rgbToHsv(r, g, b) {
|
|
|
7029 |
|
7030 |
+
r = bound01(r, 255);
|
7031 |
+
g = bound01(g, 255);
|
7032 |
+
b = bound01(b, 255);
|
7033 |
|
7034 |
+
var max = mathMax(r, g, b), min = mathMin(r, g, b);
|
7035 |
+
var h, s, v = max;
|
7036 |
|
7037 |
+
var d = max - min;
|
7038 |
+
s = max === 0 ? 0 : d / max;
|
|
|
7039 |
|
7040 |
+
if(max == min) {
|
7041 |
+
h = 0; // achromatic
|
7042 |
+
}
|
7043 |
+
else {
|
7044 |
+
switch(max) {
|
7045 |
+
case r: h = (g - b) / d + (g < b ? 6 : 0); break;
|
7046 |
+
case g: h = (b - r) / d + 2; break;
|
7047 |
+
case b: h = (r - g) / d + 4; break;
|
7048 |
+
}
|
7049 |
+
h /= 6;
|
7050 |
+
}
|
7051 |
+
return { h: h, s: s, v: v };
|
7052 |
}
|
7053 |
|
7054 |
+
// `hsvToRgb`
|
7055 |
+
// Converts an HSV color value to RGB.
|
7056 |
+
// *Assumes:* h is contained in [0, 1] or [0, 360] and s and v are contained in [0, 1] or [0, 100]
|
7057 |
+
// *Returns:* { r, g, b } in the set [0, 255]
|
7058 |
+
function hsvToRgb(h, s, v) {
|
7059 |
|
7060 |
+
h = bound01(h, 360) * 6;
|
7061 |
+
s = bound01(s, 100);
|
7062 |
+
v = bound01(v, 100);
|
7063 |
|
7064 |
+
var i = Math.floor(h),
|
7065 |
+
f = h - i,
|
7066 |
+
p = v * (1 - s),
|
7067 |
+
q = v * (1 - f * s),
|
7068 |
+
t = v * (1 - (1 - f) * s),
|
7069 |
+
mod = i % 6,
|
7070 |
+
r = [v, q, p, p, t, v][mod],
|
7071 |
+
g = [t, v, v, q, p, p][mod],
|
7072 |
+
b = [p, p, t, v, v, q][mod];
|
7073 |
+
|
7074 |
+
return { r: r * 255, g: g * 255, b: b * 255 };
|
7075 |
}
|
7076 |
|
7077 |
+
// `rgbToHex`
|
7078 |
+
// Converts an RGB color to hex
|
7079 |
+
// Assumes r, g, and b are contained in the set [0, 255]
|
7080 |
+
// Returns a 3 or 6 character hex
|
7081 |
+
function rgbToHex(r, g, b, allow3Char) {
|
7082 |
|
7083 |
+
var hex = [
|
7084 |
+
pad2(mathRound(r).toString(16)),
|
7085 |
+
pad2(mathRound(g).toString(16)),
|
7086 |
+
pad2(mathRound(b).toString(16))
|
7087 |
+
];
|
7088 |
|
7089 |
+
// Return a 3 character hex if possible
|
7090 |
+
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)) {
|
7091 |
+
return hex[0].charAt(0) + hex[1].charAt(0) + hex[2].charAt(0);
|
7092 |
+
}
|
7093 |
|
7094 |
+
return hex.join("");
|
7095 |
+
}
|
|
|
7096 |
|
7097 |
+
// `rgbaToHex`
|
7098 |
+
// Converts an RGBA color plus alpha transparency to hex
|
7099 |
+
// Assumes r, g, b are contained in the set [0, 255] and
|
7100 |
+
// a in [0, 1]. Returns a 4 or 8 character rgba hex
|
7101 |
+
function rgbaToHex(r, g, b, a, allow4Char) {
|
7102 |
|
7103 |
+
var hex = [
|
7104 |
+
pad2(mathRound(r).toString(16)),
|
7105 |
+
pad2(mathRound(g).toString(16)),
|
7106 |
+
pad2(mathRound(b).toString(16)),
|
7107 |
+
pad2(convertDecimalToHex(a))
|
7108 |
+
];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7109 |
|
7110 |
+
// Return a 4 character hex if possible
|
7111 |
+
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)) {
|
7112 |
+
return hex[0].charAt(0) + hex[1].charAt(0) + hex[2].charAt(0) + hex[3].charAt(0);
|
7113 |
+
}
|
7114 |
|
7115 |
+
return hex.join("");
|
7116 |
+
}
|
7117 |
|
7118 |
+
// `rgbaToArgbHex`
|
7119 |
+
// Converts an RGBA color to an ARGB Hex8 string
|
7120 |
+
// Rarely used, but required for "toFilter()"
|
7121 |
+
function rgbaToArgbHex(r, g, b, a) {
|
7122 |
|
7123 |
+
var hex = [
|
7124 |
+
pad2(convertDecimalToHex(a)),
|
7125 |
+
pad2(mathRound(r).toString(16)),
|
7126 |
+
pad2(mathRound(g).toString(16)),
|
7127 |
+
pad2(mathRound(b).toString(16))
|
7128 |
+
];
|
7129 |
|
7130 |
+
return hex.join("");
|
7131 |
+
}
|
7132 |
|
7133 |
+
// `equals`
|
7134 |
+
// Can be called with any tinycolor input
|
7135 |
+
tinycolor.equals = function (color1, color2) {
|
7136 |
+
if (!color1 || !color2) { return false; }
|
7137 |
+
return tinycolor(color1).toRgbString() == tinycolor(color2).toRgbString();
|
7138 |
+
};
|
7139 |
|
7140 |
+
tinycolor.random = function() {
|
7141 |
+
return tinycolor.fromRatio({
|
7142 |
+
r: mathRandom(),
|
7143 |
+
g: mathRandom(),
|
7144 |
+
b: mathRandom()
|
7145 |
+
});
|
7146 |
+
};
|
7147 |
|
|
|
|
|
7148 |
|
7149 |
+
// Modification Functions
|
7150 |
+
// ----------------------
|
7151 |
+
// Thanks to less.js for some of the basics here
|
7152 |
+
// <https://github.com/cloudhead/less.js/blob/master/lib/less/functions.js>
|
7153 |
|
7154 |
+
function desaturate(color, amount) {
|
7155 |
+
amount = (amount === 0) ? 0 : (amount || 10);
|
7156 |
+
var hsl = tinycolor(color).toHsl();
|
7157 |
+
hsl.s -= amount / 100;
|
7158 |
+
hsl.s = clamp01(hsl.s);
|
7159 |
+
return tinycolor(hsl);
|
7160 |
+
}
|
7161 |
|
7162 |
+
function saturate(color, amount) {
|
7163 |
+
amount = (amount === 0) ? 0 : (amount || 10);
|
7164 |
+
var hsl = tinycolor(color).toHsl();
|
7165 |
+
hsl.s += amount / 100;
|
7166 |
+
hsl.s = clamp01(hsl.s);
|
7167 |
+
return tinycolor(hsl);
|
7168 |
+
}
|
7169 |
|
7170 |
+
function greyscale(color) {
|
7171 |
+
return tinycolor(color).desaturate(100);
|
7172 |
+
}
|
7173 |
|
7174 |
+
function lighten (color, amount) {
|
7175 |
+
amount = (amount === 0) ? 0 : (amount || 10);
|
7176 |
+
var hsl = tinycolor(color).toHsl();
|
7177 |
+
hsl.l += amount / 100;
|
7178 |
+
hsl.l = clamp01(hsl.l);
|
7179 |
+
return tinycolor(hsl);
|
7180 |
+
}
|
|
|
7181 |
|
7182 |
+
function brighten(color, amount) {
|
7183 |
+
amount = (amount === 0) ? 0 : (amount || 10);
|
7184 |
+
var rgb = tinycolor(color).toRgb();
|
7185 |
+
rgb.r = mathMax(0, mathMin(255, rgb.r - mathRound(255 * - (amount / 100))));
|
7186 |
+
rgb.g = mathMax(0, mathMin(255, rgb.g - mathRound(255 * - (amount / 100))));
|
7187 |
+
rgb.b = mathMax(0, mathMin(255, rgb.b - mathRound(255 * - (amount / 100))));
|
7188 |
+
return tinycolor(rgb);
|
7189 |
+
}
|
7190 |
|
7191 |
+
function darken (color, amount) {
|
7192 |
+
amount = (amount === 0) ? 0 : (amount || 10);
|
7193 |
+
var hsl = tinycolor(color).toHsl();
|
7194 |
+
hsl.l -= amount / 100;
|
7195 |
+
hsl.l = clamp01(hsl.l);
|
7196 |
+
return tinycolor(hsl);
|
7197 |
+
}
|
7198 |
|
7199 |
+
// Spin takes a positive or negative amount within [-360, 360] indicating the change of hue.
|
7200 |
+
// Values outside of this range will be wrapped into this range.
|
7201 |
+
function spin(color, amount) {
|
7202 |
+
var hsl = tinycolor(color).toHsl();
|
7203 |
+
var hue = (hsl.h + amount) % 360;
|
7204 |
+
hsl.h = hue < 0 ? 360 + hue : hue;
|
7205 |
+
return tinycolor(hsl);
|
7206 |
+
}
|
7207 |
|
7208 |
+
// Combination Functions
|
7209 |
+
// ---------------------
|
7210 |
+
// Thanks to jQuery xColor for some of the ideas behind these
|
7211 |
+
// <https://github.com/infusion/jQuery-xcolor/blob/master/jquery.xcolor.js>
|
7212 |
|
7213 |
+
function complement(color) {
|
7214 |
+
var hsl = tinycolor(color).toHsl();
|
7215 |
+
hsl.h = (hsl.h + 180) % 360;
|
7216 |
+
return tinycolor(hsl);
|
7217 |
+
}
|
7218 |
|
7219 |
+
function triad(color) {
|
7220 |
+
var hsl = tinycolor(color).toHsl();
|
7221 |
+
var h = hsl.h;
|
7222 |
+
return [
|
7223 |
+
tinycolor(color),
|
7224 |
+
tinycolor({ h: (h + 120) % 360, s: hsl.s, l: hsl.l }),
|
7225 |
+
tinycolor({ h: (h + 240) % 360, s: hsl.s, l: hsl.l })
|
7226 |
+
];
|
7227 |
+
}
|
7228 |
|
7229 |
+
function tetrad(color) {
|
7230 |
+
var hsl = tinycolor(color).toHsl();
|
7231 |
+
var h = hsl.h;
|
7232 |
+
return [
|
7233 |
+
tinycolor(color),
|
7234 |
+
tinycolor({ h: (h + 90) % 360, s: hsl.s, l: hsl.l }),
|
7235 |
+
tinycolor({ h: (h + 180) % 360, s: hsl.s, l: hsl.l }),
|
7236 |
+
tinycolor({ h: (h + 270) % 360, s: hsl.s, l: hsl.l })
|
7237 |
+
];
|
7238 |
+
}
|
7239 |
|
7240 |
+
function splitcomplement(color) {
|
7241 |
+
var hsl = tinycolor(color).toHsl();
|
7242 |
+
var h = hsl.h;
|
7243 |
+
return [
|
7244 |
+
tinycolor(color),
|
7245 |
+
tinycolor({ h: (h + 72) % 360, s: hsl.s, l: hsl.l}),
|
7246 |
+
tinycolor({ h: (h + 216) % 360, s: hsl.s, l: hsl.l})
|
7247 |
+
];
|
7248 |
+
}
|
7249 |
|
7250 |
+
function analogous(color, results, slices) {
|
7251 |
+
results = results || 6;
|
7252 |
+
slices = slices || 30;
|
7253 |
|
7254 |
+
var hsl = tinycolor(color).toHsl();
|
7255 |
+
var part = 360 / slices;
|
7256 |
+
var ret = [tinycolor(color)];
|
7257 |
|
7258 |
+
for (hsl.h = ((hsl.h - (part * results >> 1)) + 720) % 360; --results; ) {
|
7259 |
+
hsl.h = (hsl.h + part) % 360;
|
7260 |
+
ret.push(tinycolor(hsl));
|
7261 |
+
}
|
7262 |
+
return ret;
|
7263 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7264 |
|
7265 |
+
function monochromatic(color, results) {
|
7266 |
+
results = results || 6;
|
7267 |
+
var hsv = tinycolor(color).toHsv();
|
7268 |
+
var h = hsv.h, s = hsv.s, v = hsv.v;
|
7269 |
+
var ret = [];
|
7270 |
+
var modification = 1 / results;
|
7271 |
|
7272 |
+
while (results--) {
|
7273 |
+
ret.push(tinycolor({ h: h, s: s, v: v}));
|
7274 |
+
v = (v + modification) % 1;
|
7275 |
+
}
|
7276 |
|
7277 |
+
return ret;
|
7278 |
+
}
|
7279 |
|
7280 |
+
// Utility Functions
|
7281 |
+
// ---------------------
|
7282 |
|
7283 |
+
tinycolor.mix = function(color1, color2, amount) {
|
7284 |
+
amount = (amount === 0) ? 0 : (amount || 50);
|
|
|
|
|
|
|
|
|
7285 |
|
7286 |
+
var rgb1 = tinycolor(color1).toRgb();
|
7287 |
+
var rgb2 = tinycolor(color2).toRgb();
|
|
|
|
|
7288 |
|
7289 |
+
var p = amount / 100;
|
|
|
|
|
|
|
|
|
|
|
|
|
7290 |
|
7291 |
+
var rgba = {
|
7292 |
+
r: ((rgb2.r - rgb1.r) * p) + rgb1.r,
|
7293 |
+
g: ((rgb2.g - rgb1.g) * p) + rgb1.g,
|
7294 |
+
b: ((rgb2.b - rgb1.b) * p) + rgb1.b,
|
7295 |
+
a: ((rgb2.a - rgb1.a) * p) + rgb1.a
|
7296 |
+
};
|
7297 |
|
7298 |
+
return tinycolor(rgba);
|
7299 |
+
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7300 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7301 |
|
7302 |
+
// Readability Functions
|
7303 |
+
// ---------------------
|
7304 |
+
// <http://www.w3.org/TR/2008/REC-WCAG20-20081211/#contrast-ratiodef (WCAG Version 2)
|
|
|
7305 |
|
7306 |
+
// `contrast`
|
7307 |
+
// Analyze the 2 colors and returns the color contrast defined by (WCAG Version 2)
|
7308 |
+
tinycolor.readability = function(color1, color2) {
|
7309 |
+
var c1 = tinycolor(color1);
|
7310 |
+
var c2 = tinycolor(color2);
|
7311 |
+
return (Math.max(c1.getLuminance(),c2.getLuminance())+0.05) / (Math.min(c1.getLuminance(),c2.getLuminance())+0.05);
|
7312 |
+
};
|
7313 |
|
7314 |
+
// `isReadable`
|
7315 |
+
// Ensure that foreground and background color combinations meet WCAG2 guidelines.
|
7316 |
+
// The third argument is an optional Object.
|
7317 |
+
// the 'level' property states 'AA' or 'AAA' - if missing or invalid, it defaults to 'AA';
|
7318 |
+
// the 'size' property states 'large' or 'small' - if missing or invalid, it defaults to 'small'.
|
7319 |
+
// If the entire object is absent, isReadable defaults to {level:"AA",size:"small"}.
|
7320 |
|
7321 |
+
// *Example*
|
7322 |
+
// tinycolor.isReadable("#000", "#111") => false
|
7323 |
+
// tinycolor.isReadable("#000", "#111",{level:"AA",size:"large"}) => false
|
7324 |
+
tinycolor.isReadable = function(color1, color2, wcag2) {
|
7325 |
+
var readability = tinycolor.readability(color1, color2);
|
7326 |
+
var wcag2Parms, out;
|
|
|
|
|
|
|
|
|
|
|
7327 |
|
7328 |
+
out = false;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7329 |
|
7330 |
+
wcag2Parms = validateWCAG2Parms(wcag2);
|
7331 |
+
switch (wcag2Parms.level + wcag2Parms.size) {
|
7332 |
+
case "AAsmall":
|
7333 |
+
case "AAAlarge":
|
7334 |
+
out = readability >= 4.5;
|
7335 |
+
break;
|
7336 |
+
case "AAlarge":
|
7337 |
+
out = readability >= 3;
|
7338 |
+
break;
|
7339 |
+
case "AAAsmall":
|
7340 |
+
out = readability >= 7;
|
7341 |
+
break;
|
7342 |
+
}
|
7343 |
+
return out;
|
7344 |
|
7345 |
+
};
|
|
|
|
|
7346 |
|
7347 |
+
// `mostReadable`
|
7348 |
+
// Given a base color and a list of possible foreground or background
|
7349 |
+
// colors for that base, returns the most readable color.
|
7350 |
+
// Optionally returns Black or White if the most readable color is unreadable.
|
7351 |
+
// *Example*
|
7352 |
+
// tinycolor.mostReadable(tinycolor.mostReadable("#123", ["#124", "#125"],{includeFallbackColors:false}).toHexString(); // "#112255"
|
7353 |
+
// tinycolor.mostReadable(tinycolor.mostReadable("#123", ["#124", "#125"],{includeFallbackColors:true}).toHexString(); // "#ffffff"
|
7354 |
+
// tinycolor.mostReadable("#a8015a", ["#faf3f3"],{includeFallbackColors:true,level:"AAA",size:"large"}).toHexString(); // "#faf3f3"
|
7355 |
+
// tinycolor.mostReadable("#a8015a", ["#faf3f3"],{includeFallbackColors:true,level:"AAA",size:"small"}).toHexString(); // "#ffffff"
|
7356 |
+
tinycolor.mostReadable = function(baseColor, colorList, args) {
|
7357 |
+
var bestColor = null;
|
7358 |
+
var bestScore = 0;
|
7359 |
+
var readability;
|
7360 |
+
var includeFallbackColors, level, size ;
|
7361 |
+
args = args || {};
|
7362 |
+
includeFallbackColors = args.includeFallbackColors ;
|
7363 |
+
level = args.level;
|
7364 |
+
size = args.size;
|
7365 |
+
|
7366 |
+
for (var i= 0; i < colorList.length ; i++) {
|
7367 |
+
readability = tinycolor.readability(baseColor, colorList[i]);
|
7368 |
+
if (readability > bestScore) {
|
7369 |
+
bestScore = readability;
|
7370 |
+
bestColor = tinycolor(colorList[i]);
|
7371 |
+
}
|
7372 |
}
|
|
|
|
|
|
|
|
|
7373 |
|
7374 |
+
if (tinycolor.isReadable(baseColor, bestColor, {"level":level,"size":size}) || !includeFallbackColors) {
|
7375 |
+
return bestColor;
|
7376 |
+
}
|
7377 |
+
else {
|
7378 |
+
args.includeFallbackColors=false;
|
7379 |
+
return tinycolor.mostReadable(baseColor,["#fff", "#000"],args);
|
7380 |
+
}
|
7381 |
+
};
|
7382 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7383 |
|
7384 |
+
// Big List of Colors
|
7385 |
+
// ------------------
|
7386 |
+
// <http://www.w3.org/TR/css3-color/#svg-color>
|
7387 |
+
var names = tinycolor.names = {
|
7388 |
+
aliceblue: "f0f8ff",
|
7389 |
+
antiquewhite: "faebd7",
|
7390 |
+
aqua: "0ff",
|
7391 |
+
aquamarine: "7fffd4",
|
7392 |
+
azure: "f0ffff",
|
7393 |
+
beige: "f5f5dc",
|
7394 |
+
bisque: "ffe4c4",
|
7395 |
+
black: "000",
|
7396 |
+
blanchedalmond: "ffebcd",
|
7397 |
+
blue: "00f",
|
7398 |
+
blueviolet: "8a2be2",
|
7399 |
+
brown: "a52a2a",
|
7400 |
+
burlywood: "deb887",
|
7401 |
+
burntsienna: "ea7e5d",
|
7402 |
+
cadetblue: "5f9ea0",
|
7403 |
+
chartreuse: "7fff00",
|
7404 |
+
chocolate: "d2691e",
|
7405 |
+
coral: "ff7f50",
|
7406 |
+
cornflowerblue: "6495ed",
|
7407 |
+
cornsilk: "fff8dc",
|
7408 |
+
crimson: "dc143c",
|
7409 |
+
cyan: "0ff",
|
7410 |
+
darkblue: "00008b",
|
7411 |
+
darkcyan: "008b8b",
|
7412 |
+
darkgoldenrod: "b8860b",
|
7413 |
+
darkgray: "a9a9a9",
|
7414 |
+
darkgreen: "006400",
|
7415 |
+
darkgrey: "a9a9a9",
|
7416 |
+
darkkhaki: "bdb76b",
|
7417 |
+
darkmagenta: "8b008b",
|
7418 |
+
darkolivegreen: "556b2f",
|
7419 |
+
darkorange: "ff8c00",
|
7420 |
+
darkorchid: "9932cc",
|
7421 |
+
darkred: "8b0000",
|
7422 |
+
darksalmon: "e9967a",
|
7423 |
+
darkseagreen: "8fbc8f",
|
7424 |
+
darkslateblue: "483d8b",
|
7425 |
+
darkslategray: "2f4f4f",
|
7426 |
+
darkslategrey: "2f4f4f",
|
7427 |
+
darkturquoise: "00ced1",
|
7428 |
+
darkviolet: "9400d3",
|
7429 |
+
deeppink: "ff1493",
|
7430 |
+
deepskyblue: "00bfff",
|
7431 |
+
dimgray: "696969",
|
7432 |
+
dimgrey: "696969",
|
7433 |
+
dodgerblue: "1e90ff",
|
7434 |
+
firebrick: "b22222",
|
7435 |
+
floralwhite: "fffaf0",
|
7436 |
+
forestgreen: "228b22",
|
7437 |
+
fuchsia: "f0f",
|
7438 |
+
gainsboro: "dcdcdc",
|
7439 |
+
ghostwhite: "f8f8ff",
|
7440 |
+
gold: "ffd700",
|
7441 |
+
goldenrod: "daa520",
|
7442 |
+
gray: "808080",
|
7443 |
+
green: "008000",
|
7444 |
+
greenyellow: "adff2f",
|
7445 |
+
grey: "808080",
|
7446 |
+
honeydew: "f0fff0",
|
7447 |
+
hotpink: "ff69b4",
|
7448 |
+
indianred: "cd5c5c",
|
7449 |
+
indigo: "4b0082",
|
7450 |
+
ivory: "fffff0",
|
7451 |
+
khaki: "f0e68c",
|
7452 |
+
lavender: "e6e6fa",
|
7453 |
+
lavenderblush: "fff0f5",
|
7454 |
+
lawngreen: "7cfc00",
|
7455 |
+
lemonchiffon: "fffacd",
|
7456 |
+
lightblue: "add8e6",
|
7457 |
+
lightcoral: "f08080",
|
7458 |
+
lightcyan: "e0ffff",
|
7459 |
+
lightgoldenrodyellow: "fafad2",
|
7460 |
+
lightgray: "d3d3d3",
|
7461 |
+
lightgreen: "90ee90",
|
7462 |
+
lightgrey: "d3d3d3",
|
7463 |
+
lightpink: "ffb6c1",
|
7464 |
+
lightsalmon: "ffa07a",
|
7465 |
+
lightseagreen: "20b2aa",
|
7466 |
+
lightskyblue: "87cefa",
|
7467 |
+
lightslategray: "789",
|
7468 |
+
lightslategrey: "789",
|
7469 |
+
lightsteelblue: "b0c4de",
|
7470 |
+
lightyellow: "ffffe0",
|
7471 |
+
lime: "0f0",
|
7472 |
+
limegreen: "32cd32",
|
7473 |
+
linen: "faf0e6",
|
7474 |
+
magenta: "f0f",
|
7475 |
+
maroon: "800000",
|
7476 |
+
mediumaquamarine: "66cdaa",
|
7477 |
+
mediumblue: "0000cd",
|
7478 |
+
mediumorchid: "ba55d3",
|
7479 |
+
mediumpurple: "9370db",
|
7480 |
+
mediumseagreen: "3cb371",
|
7481 |
+
mediumslateblue: "7b68ee",
|
7482 |
+
mediumspringgreen: "00fa9a",
|
7483 |
+
mediumturquoise: "48d1cc",
|
7484 |
+
mediumvioletred: "c71585",
|
7485 |
+
midnightblue: "191970",
|
7486 |
+
mintcream: "f5fffa",
|
7487 |
+
mistyrose: "ffe4e1",
|
7488 |
+
moccasin: "ffe4b5",
|
7489 |
+
navajowhite: "ffdead",
|
7490 |
+
navy: "000080",
|
7491 |
+
oldlace: "fdf5e6",
|
7492 |
+
olive: "808000",
|
7493 |
+
olivedrab: "6b8e23",
|
7494 |
+
orange: "ffa500",
|
7495 |
+
orangered: "ff4500",
|
7496 |
+
orchid: "da70d6",
|
7497 |
+
palegoldenrod: "eee8aa",
|
7498 |
+
palegreen: "98fb98",
|
7499 |
+
paleturquoise: "afeeee",
|
7500 |
+
palevioletred: "db7093",
|
7501 |
+
papayawhip: "ffefd5",
|
7502 |
+
peachpuff: "ffdab9",
|
7503 |
+
peru: "cd853f",
|
7504 |
+
pink: "ffc0cb",
|
7505 |
+
plum: "dda0dd",
|
7506 |
+
powderblue: "b0e0e6",
|
7507 |
+
purple: "800080",
|
7508 |
+
rebeccapurple: "663399",
|
7509 |
+
red: "f00",
|
7510 |
+
rosybrown: "bc8f8f",
|
7511 |
+
royalblue: "4169e1",
|
7512 |
+
saddlebrown: "8b4513",
|
7513 |
+
salmon: "fa8072",
|
7514 |
+
sandybrown: "f4a460",
|
7515 |
+
seagreen: "2e8b57",
|
7516 |
+
seashell: "fff5ee",
|
7517 |
+
sienna: "a0522d",
|
7518 |
+
silver: "c0c0c0",
|
7519 |
+
skyblue: "87ceeb",
|
7520 |
+
slateblue: "6a5acd",
|
7521 |
+
slategray: "708090",
|
7522 |
+
slategrey: "708090",
|
7523 |
+
snow: "fffafa",
|
7524 |
+
springgreen: "00ff7f",
|
7525 |
+
steelblue: "4682b4",
|
7526 |
+
tan: "d2b48c",
|
7527 |
+
teal: "008080",
|
7528 |
+
thistle: "d8bfd8",
|
7529 |
+
tomato: "ff6347",
|
7530 |
+
turquoise: "40e0d0",
|
7531 |
+
violet: "ee82ee",
|
7532 |
+
wheat: "f5deb3",
|
7533 |
+
white: "fff",
|
7534 |
+
whitesmoke: "f5f5f5",
|
7535 |
+
yellow: "ff0",
|
7536 |
+
yellowgreen: "9acd32"
|
7537 |
+
};
|
7538 |
|
7539 |
+
// Make it easy to access colors via `hexNames[hex]`
|
7540 |
+
var hexNames = tinycolor.hexNames = flip(names);
|
|
|
7541 |
|
|
|
7542 |
|
7543 |
+
// Utilities
|
7544 |
+
// ---------
|
7545 |
|
7546 |
+
// `{ 'name1': 'val1' }` becomes `{ 'val1': 'name1' }`
|
7547 |
+
function flip(o) {
|
7548 |
+
var flipped = { };
|
7549 |
+
for (var i in o) {
|
7550 |
+
if (o.hasOwnProperty(i)) {
|
7551 |
+
flipped[o[i]] = i;
|
7552 |
+
}
|
7553 |
+
}
|
7554 |
+
return flipped;
|
7555 |
}
|
7556 |
|
7557 |
+
// Return a valid alpha value [0,1] with all invalid values being set to 1
|
7558 |
+
function boundAlpha(a) {
|
7559 |
+
a = parseFloat(a);
|
7560 |
|
7561 |
+
if (isNaN(a) || a < 0 || a > 1) {
|
7562 |
+
a = 1;
|
7563 |
+
}
|
7564 |
|
7565 |
+
return a;
|
7566 |
+
}
|
7567 |
|
7568 |
+
// Take input from [0, n] and return it as [0, 1]
|
7569 |
+
function bound01(n, max) {
|
7570 |
+
if (isOnePointZero(n)) { n = "100%"; }
|
7571 |
|
7572 |
+
var processPercent = isPercentage(n);
|
7573 |
+
n = mathMin(max, mathMax(0, parseFloat(n)));
|
7574 |
|
7575 |
+
// Automatically convert percentage into number
|
7576 |
+
if (processPercent) {
|
7577 |
+
n = parseInt(n * max, 10) / 100;
|
7578 |
+
}
|
7579 |
|
7580 |
+
// Handle floating point rounding errors
|
7581 |
+
if ((Math.abs(n - max) < 0.000001)) {
|
7582 |
+
return 1;
|
7583 |
+
}
|
7584 |
|
7585 |
+
// Convert into [0, 1] range if it isn't already
|
7586 |
+
return (n % max) / parseFloat(max);
|
7587 |
+
}
|
7588 |
|
7589 |
+
// Force a number between 0 and 1
|
7590 |
+
function clamp01(val) {
|
7591 |
+
return mathMin(1, mathMax(0, val));
|
|
|
|
|
|
|
7592 |
}
|
7593 |
|
7594 |
+
// Parse a base-16 hex value into a base-10 integer
|
7595 |
+
function parseIntFromHex(val) {
|
7596 |
+
return parseInt(val, 16);
|
7597 |
+
}
|
7598 |
|
7599 |
+
// Need to handle 1.0 as 100%, since once it is a number, there is no difference between it and 1
|
7600 |
+
// <http://stackoverflow.com/questions/7422072/javascript-how-to-detect-number-as-a-decimal-including-1-0>
|
7601 |
+
function isOnePointZero(n) {
|
7602 |
+
return typeof n == "string" && n.indexOf('.') != -1 && parseFloat(n) === 1;
|
7603 |
+
}
|
7604 |
|
7605 |
+
// Check to see if string passed in is a percentage
|
7606 |
+
function isPercentage(n) {
|
7607 |
+
return typeof n === "string" && n.indexOf('%') != -1;
|
7608 |
+
}
|
7609 |
|
7610 |
+
// Force a hex value to have 2 characters
|
7611 |
+
function pad2(c) {
|
7612 |
+
return c.length == 1 ? '0' + c : '' + c;
|
7613 |
+
}
|
7614 |
|
7615 |
+
// Replace a decimal with it's percentage value
|
7616 |
+
function convertToPercentage(n) {
|
7617 |
+
if (n <= 1) {
|
7618 |
+
n = (n * 100) + "%";
|
7619 |
+
}
|
7620 |
|
7621 |
+
return n;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7622 |
}
|
7623 |
|
7624 |
+
// Converts a decimal to a hex value
|
7625 |
+
function convertDecimalToHex(d) {
|
7626 |
+
return Math.round(parseFloat(d) * 255).toString(16);
|
7627 |
+
}
|
7628 |
+
// Converts a hex value to a decimal
|
7629 |
+
function convertHexToDecimal(h) {
|
7630 |
+
return (parseIntFromHex(h) / 255);
|
7631 |
}
|
7632 |
|
7633 |
+
var matchers = (function() {
|
7634 |
|
7635 |
+
// <http://www.w3.org/TR/css3-values/#integers>
|
7636 |
+
var CSS_INTEGER = "[-\\+]?\\d+%?";
|
7637 |
|
7638 |
+
// <http://www.w3.org/TR/css3-values/#number-value>
|
7639 |
+
var CSS_NUMBER = "[-\\+]?\\d*\\.\\d+%?";
|
7640 |
|
7641 |
+
// Allow positive/negative integer/number. Don't capture the either/or, just the entire outcome.
|
7642 |
+
var CSS_UNIT = "(?:" + CSS_NUMBER + ")|(?:" + CSS_INTEGER + ")";
|
7643 |
|
7644 |
+
// Actual matching.
|
7645 |
+
// Parentheses and commas are optional, but not required.
|
7646 |
+
// Whitespace can take the place of commas or opening paren
|
7647 |
+
var PERMISSIVE_MATCH3 = "[\\s|\\(]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")\\s*\\)?";
|
7648 |
+
var PERMISSIVE_MATCH4 = "[\\s|\\(]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")\\s*\\)?";
|
|
|
7649 |
|
7650 |
+
return {
|
7651 |
+
CSS_UNIT: new RegExp(CSS_UNIT),
|
7652 |
+
rgb: new RegExp("rgb" + PERMISSIVE_MATCH3),
|
7653 |
+
rgba: new RegExp("rgba" + PERMISSIVE_MATCH4),
|
7654 |
+
hsl: new RegExp("hsl" + PERMISSIVE_MATCH3),
|
7655 |
+
hsla: new RegExp("hsla" + PERMISSIVE_MATCH4),
|
7656 |
+
hsv: new RegExp("hsv" + PERMISSIVE_MATCH3),
|
7657 |
+
hsva: new RegExp("hsva" + PERMISSIVE_MATCH4),
|
7658 |
+
hex3: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
|
7659 |
+
hex6: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,
|
7660 |
+
hex4: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
|
7661 |
+
hex8: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/
|
7662 |
+
};
|
7663 |
+
})();
|
7664 |
+
|
7665 |
+
// `isValidCSSUnit`
|
7666 |
+
// Take in a single string / number and check to see if it looks like a CSS unit
|
7667 |
+
// (see `matchers` above for definition).
|
7668 |
+
function isValidCSSUnit(color) {
|
7669 |
+
return !!matchers.CSS_UNIT.exec(color);
|
7670 |
}
|
|
|
7671 |
|
7672 |
+
// `stringInputToObject`
|
7673 |
+
// Permissive string parsing. Take in a number of formats, and output an object
|
7674 |
+
// based on detected format. Returns `{ r, g, b }` or `{ h, s, l }` or `{ h, s, v}`
|
7675 |
+
function stringInputToObject(color) {
|
7676 |
|
7677 |
+
color = color.replace(trimLeft,'').replace(trimRight, '').toLowerCase();
|
7678 |
+
var named = false;
|
7679 |
+
if (names[color]) {
|
7680 |
+
color = names[color];
|
7681 |
+
named = true;
|
7682 |
}
|
7683 |
+
else if (color == 'transparent') {
|
7684 |
+
return { r: 0, g: 0, b: 0, a: 0, format: "name" };
|
7685 |
+
}
|
7686 |
+
|
7687 |
+
// Try to match string input using regular expressions.
|
7688 |
+
// Keep most of the number bounding out of this function - don't worry about [0,1] or [0,100] or [0,360]
|
7689 |
+
// Just return an object and let the conversion functions handle that.
|
7690 |
+
// This way the result will be the same whether the tinycolor is initialized with string or object.
|
7691 |
+
var match;
|
7692 |
+
if ((match = matchers.rgb.exec(color))) {
|
7693 |
+
return { r: match[1], g: match[2], b: match[3] };
|
7694 |
+
}
|
7695 |
+
if ((match = matchers.rgba.exec(color))) {
|
7696 |
+
return { r: match[1], g: match[2], b: match[3], a: match[4] };
|
7697 |
+
}
|
7698 |
+
if ((match = matchers.hsl.exec(color))) {
|
7699 |
+
return { h: match[1], s: match[2], l: match[3] };
|
7700 |
+
}
|
7701 |
+
if ((match = matchers.hsla.exec(color))) {
|
7702 |
+
return { h: match[1], s: match[2], l: match[3], a: match[4] };
|
7703 |
+
}
|
7704 |
+
if ((match = matchers.hsv.exec(color))) {
|
7705 |
+
return { h: match[1], s: match[2], v: match[3] };
|
7706 |
+
}
|
7707 |
+
if ((match = matchers.hsva.exec(color))) {
|
7708 |
+
return { h: match[1], s: match[2], v: match[3], a: match[4] };
|
7709 |
+
}
|
7710 |
+
if ((match = matchers.hex8.exec(color))) {
|
7711 |
+
return {
|
7712 |
+
r: parseIntFromHex(match[1]),
|
7713 |
+
g: parseIntFromHex(match[2]),
|
7714 |
+
b: parseIntFromHex(match[3]),
|
7715 |
+
a: convertHexToDecimal(match[4]),
|
7716 |
+
format: named ? "name" : "hex8"
|
7717 |
+
};
|
7718 |
+
}
|
7719 |
+
if ((match = matchers.hex6.exec(color))) {
|
7720 |
+
return {
|
7721 |
+
r: parseIntFromHex(match[1]),
|
7722 |
+
g: parseIntFromHex(match[2]),
|
7723 |
+
b: parseIntFromHex(match[3]),
|
7724 |
+
format: named ? "name" : "hex"
|
7725 |
+
};
|
7726 |
+
}
|
7727 |
+
if ((match = matchers.hex4.exec(color))) {
|
7728 |
+
return {
|
7729 |
+
r: parseIntFromHex(match[1] + '' + match[1]),
|
7730 |
+
g: parseIntFromHex(match[2] + '' + match[2]),
|
7731 |
+
b: parseIntFromHex(match[3] + '' + match[3]),
|
7732 |
+
a: convertHexToDecimal(match[4] + '' + match[4]),
|
7733 |
+
format: named ? "name" : "hex8"
|
7734 |
+
};
|
7735 |
+
}
|
7736 |
+
if ((match = matchers.hex3.exec(color))) {
|
7737 |
+
return {
|
7738 |
+
r: parseIntFromHex(match[1] + '' + match[1]),
|
7739 |
+
g: parseIntFromHex(match[2] + '' + match[2]),
|
7740 |
+
b: parseIntFromHex(match[3] + '' + match[3]),
|
7741 |
+
format: named ? "name" : "hex"
|
7742 |
+
};
|
7743 |
+
}
|
7744 |
+
|
7745 |
+
return false;
|
7746 |
+
}
|
7747 |
+
|
7748 |
+
function validateWCAG2Parms(parms) {
|
7749 |
+
// return valid WCAG2 parms for isReadable.
|
7750 |
+
// If input parms are invalid, return {"level":"AA", "size":"small"}
|
7751 |
+
var level, size;
|
7752 |
+
parms = parms || {"level":"AA", "size":"small"};
|
7753 |
+
level = (parms.level || "AA").toUpperCase();
|
7754 |
+
size = (parms.size || "small").toLowerCase();
|
7755 |
+
if (level !== "AA" && level !== "AAA") {
|
7756 |
+
level = "AA";
|
7757 |
+
}
|
7758 |
+
if (size !== "small" && size !== "large") {
|
7759 |
+
size = "small";
|
7760 |
+
}
|
7761 |
+
return {"level":level, "size":size};
|
7762 |
}
|
7763 |
|
7764 |
+
// Node: Export function
|
7765 |
+
if ( true && module.exports) {
|
7766 |
+
module.exports = tinycolor;
|
7767 |
+
}
|
7768 |
+
// AMD/requirejs: Define the module
|
7769 |
+
else if (typeof define === 'function' && define.amd) {
|
7770 |
+
define(function () {return tinycolor;});
|
7771 |
+
}
|
7772 |
+
// Browser: Expose to window
|
7773 |
+
else {
|
7774 |
+
window.tinycolor = tinycolor;
|
7775 |
+
}
|
7776 |
|
7777 |
+
})(Math);
|
|
|
|
|
|
|
7778 |
|
|
|
|
|
7779 |
|
7780 |
/***/ }),
|
7781 |
+
/* 107 */
|
|
|
7782 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
7783 |
|
7784 |
"use strict";
|
7785 |
+
/* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(7);
|
7786 |
+
/* harmony import */ var _babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(11);
|
7787 |
+
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(0);
|
7788 |
+
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__);
|
7789 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7790 |
|
|
|
|
|
|
|
7791 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7792 |
|
7793 |
+
function Dashicon(_ref) {
|
7794 |
+
var icon = _ref.icon,
|
7795 |
+
_ref$size = _ref.size,
|
7796 |
+
size = _ref$size === void 0 ? 20 : _ref$size,
|
7797 |
+
className = _ref.className,
|
7798 |
+
extraProps = Object(_babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"])(_ref, ["icon", "size", "className"]);
|
7799 |
|
7800 |
+
var iconClass = ['dashicon', 'dashicons', 'dashicons-' + icon, className].filter(Boolean).join(' ');
|
7801 |
+
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["createElement"])("span", Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])({
|
7802 |
+
className: iconClass,
|
7803 |
+
width: size,
|
7804 |
+
height: size
|
7805 |
+
}, extraProps));
|
7806 |
}
|
|
|
7807 |
|
7808 |
+
/* harmony default export */ __webpack_exports__["a"] = (Dashicon);
|
7809 |
+
//# sourceMappingURL=index.js.map
|
|
|
|
|
|
|
|
|
7810 |
|
7811 |
/***/ }),
|
7812 |
+
/* 108 */
|
|
|
7813 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
7814 |
|
7815 |
"use strict";
|
7816 |
|
7817 |
// EXPORTS
|
7818 |
+
__webpack_require__.d(__webpack_exports__, "a", function() { return /* binding */ createBrowserHistory; });
|
7819 |
+
__webpack_require__.d(__webpack_exports__, "c", function() { return /* binding */ createMemoryHistory; });
|
7820 |
+
__webpack_require__.d(__webpack_exports__, "b", function() { return /* binding */ createLocation; });
|
7821 |
+
__webpack_require__.d(__webpack_exports__, "e", function() { return /* binding */ locationsAreEqual; });
|
7822 |
+
__webpack_require__.d(__webpack_exports__, "d", function() { return /* binding */ createPath; });
|
7823 |
|
7824 |
+
// UNUSED EXPORTS: createHashHistory, parsePath
|
|
|
7825 |
|
7826 |
+
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/extends.js
|
7827 |
+
var esm_extends = __webpack_require__(7);
|
7828 |
|
7829 |
+
// CONCATENATED MODULE: ./node_modules/resolve-pathname/esm/resolve-pathname.js
|
7830 |
+
function isAbsolute(pathname) {
|
7831 |
+
return pathname.charAt(0) === '/';
|
|
|
|
|
|
|
7832 |
}
|
|
|
|
|
7833 |
|
7834 |
+
// About 1.5x faster than the two-arg version of Array#splice()
|
7835 |
+
function spliceOne(list, index) {
|
7836 |
+
for (var i = index, k = i + 1, n = list.length; k < n; i += 1, k += 1) {
|
7837 |
+
list[i] = list[k];
|
7838 |
+
}
|
7839 |
|
7840 |
+
list.pop();
|
7841 |
+
}
|
7842 |
|
7843 |
+
// This implementation is based heavily on node's url.parse
|
7844 |
+
function resolvePathname(to, from) {
|
7845 |
+
if (from === undefined) from = '';
|
7846 |
|
7847 |
+
var toParts = (to && to.split('/')) || [];
|
7848 |
+
var fromParts = (from && from.split('/')) || [];
|
7849 |
|
7850 |
+
var isToAbs = to && isAbsolute(to);
|
7851 |
+
var isFromAbs = from && isAbsolute(from);
|
7852 |
+
var mustEndAbs = isToAbs || isFromAbs;
|
7853 |
|
7854 |
+
if (to && isAbsolute(to)) {
|
7855 |
+
// to is absolute
|
7856 |
+
fromParts = toParts;
|
7857 |
+
} else if (toParts.length) {
|
7858 |
+
// to is relative, drop the filename
|
7859 |
+
fromParts.pop();
|
7860 |
+
fromParts = fromParts.concat(toParts);
|
7861 |
+
}
|
7862 |
|
7863 |
+
if (!fromParts.length) return '/';
|
|
|
7864 |
|
7865 |
+
var hasTrailingSlash;
|
7866 |
+
if (fromParts.length) {
|
7867 |
+
var last = fromParts[fromParts.length - 1];
|
7868 |
+
hasTrailingSlash = last === '.' || last === '..' || last === '';
|
7869 |
+
} else {
|
7870 |
+
hasTrailingSlash = false;
|
7871 |
+
}
|
7872 |
|
7873 |
+
var up = 0;
|
7874 |
+
for (var i = fromParts.length; i >= 0; i--) {
|
7875 |
+
var part = fromParts[i];
|
|
|
|
|
|
|
|
|
|
|
7876 |
|
7877 |
+
if (part === '.') {
|
7878 |
+
spliceOne(fromParts, i);
|
7879 |
+
} else if (part === '..') {
|
7880 |
+
spliceOne(fromParts, i);
|
7881 |
+
up++;
|
7882 |
+
} else if (up) {
|
7883 |
+
spliceOne(fromParts, i);
|
7884 |
+
up--;
|
7885 |
+
}
|
7886 |
+
}
|
7887 |
|
7888 |
+
if (!mustEndAbs) for (; up--; up) fromParts.unshift('..');
|
7889 |
|
7890 |
+
if (
|
7891 |
+
mustEndAbs &&
|
7892 |
+
fromParts[0] !== '' &&
|
7893 |
+
(!fromParts[0] || !isAbsolute(fromParts[0]))
|
7894 |
+
)
|
7895 |
+
fromParts.unshift('');
|
7896 |
|
7897 |
+
var result = fromParts.join('/');
|
|
|
|
|
|
|
|
|
7898 |
|
7899 |
+
if (hasTrailingSlash && result.substr(-1) !== '/') result += '/';
|
|
|
|
|
|
|
|
|
7900 |
|
7901 |
+
return result;
|
7902 |
}
|
7903 |
|
7904 |
+
/* harmony default export */ var resolve_pathname = (resolvePathname);
|
7905 |
|
7906 |
+
// CONCATENATED MODULE: ./node_modules/value-equal/esm/value-equal.js
|
7907 |
+
function value_equal_valueOf(obj) {
|
7908 |
+
return obj.valueOf ? obj.valueOf() : Object.prototype.valueOf.call(obj);
|
7909 |
+
}
|
7910 |
|
7911 |
+
function valueEqual(a, b) {
|
7912 |
+
// Test for strict equality first.
|
7913 |
+
if (a === b) return true;
|
7914 |
|
7915 |
+
// Otherwise, if either of them == null they are not equal.
|
7916 |
+
if (a == null || b == null) return false;
|
7917 |
+
|
7918 |
+
if (Array.isArray(a)) {
|
7919 |
+
return (
|
7920 |
+
Array.isArray(b) &&
|
7921 |
+
a.length === b.length &&
|
7922 |
+
a.every(function(item, index) {
|
7923 |
+
return valueEqual(item, b[index]);
|
7924 |
+
})
|
7925 |
+
);
|
7926 |
+
}
|
7927 |
|
7928 |
+
if (typeof a === 'object' || typeof b === 'object') {
|
7929 |
+
var aValue = value_equal_valueOf(a);
|
7930 |
+
var bValue = value_equal_valueOf(b);
|
7931 |
|
7932 |
+
if (aValue !== a || bValue !== b) return valueEqual(aValue, bValue);
|
|
|
|
|
7933 |
|
7934 |
+
return Object.keys(Object.assign({}, a, b)).every(function(key) {
|
7935 |
+
return valueEqual(a[key], b[key]);
|
7936 |
+
});
|
7937 |
+
}
|
7938 |
|
7939 |
+
return false;
|
7940 |
+
}
|
7941 |
|
7942 |
+
/* harmony default export */ var value_equal = (valueEqual);
|
|
|
7943 |
|
7944 |
+
// EXTERNAL MODULE: ./node_modules/tiny-invariant/dist/tiny-invariant.esm.js
|
7945 |
+
var tiny_invariant_esm = __webpack_require__(92);
|
7946 |
|
7947 |
+
// CONCATENATED MODULE: ./node_modules/history/esm/history.js
|
7948 |
|
|
|
|
|
7949 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7950 |
|
7951 |
|
7952 |
|
|
|
|
|
|
|
7953 |
|
7954 |
+
function addLeadingSlash(path) {
|
7955 |
+
return path.charAt(0) === '/' ? path : '/' + path;
|
7956 |
+
}
|
7957 |
+
function stripLeadingSlash(path) {
|
7958 |
+
return path.charAt(0) === '/' ? path.substr(1) : path;
|
7959 |
+
}
|
7960 |
+
function hasBasename(path, prefix) {
|
7961 |
+
return path.toLowerCase().indexOf(prefix.toLowerCase()) === 0 && '/?#'.indexOf(path.charAt(prefix.length)) !== -1;
|
7962 |
+
}
|
7963 |
+
function stripBasename(path, prefix) {
|
7964 |
+
return hasBasename(path, prefix) ? path.substr(prefix.length) : path;
|
7965 |
+
}
|
7966 |
+
function stripTrailingSlash(path) {
|
7967 |
+
return path.charAt(path.length - 1) === '/' ? path.slice(0, -1) : path;
|
7968 |
+
}
|
7969 |
+
function parsePath(path) {
|
7970 |
+
var pathname = path || '/';
|
7971 |
+
var search = '';
|
7972 |
+
var hash = '';
|
7973 |
+
var hashIndex = pathname.indexOf('#');
|
7974 |
|
7975 |
+
if (hashIndex !== -1) {
|
7976 |
+
hash = pathname.substr(hashIndex);
|
7977 |
+
pathname = pathname.substr(0, hashIndex);
|
7978 |
+
}
|
|
|
7979 |
|
7980 |
+
var searchIndex = pathname.indexOf('?');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7981 |
|
7982 |
+
if (searchIndex !== -1) {
|
7983 |
+
search = pathname.substr(searchIndex);
|
7984 |
+
pathname = pathname.substr(0, searchIndex);
|
7985 |
+
}
|
7986 |
|
7987 |
+
return {
|
7988 |
+
pathname: pathname,
|
7989 |
+
search: search === '?' ? '' : search,
|
7990 |
+
hash: hash === '#' ? '' : hash
|
7991 |
+
};
|
7992 |
+
}
|
7993 |
+
function createPath(location) {
|
7994 |
+
var pathname = location.pathname,
|
7995 |
+
search = location.search,
|
7996 |
+
hash = location.hash;
|
7997 |
+
var path = pathname || '/';
|
7998 |
+
if (search && search !== '?') path += search.charAt(0) === '?' ? search : "?" + search;
|
7999 |
+
if (hash && hash !== '#') path += hash.charAt(0) === '#' ? hash : "#" + hash;
|
8000 |
+
return path;
|
8001 |
+
}
|
8002 |
|
8003 |
+
function createLocation(path, state, key, currentLocation) {
|
8004 |
+
var location;
|
8005 |
+
|
8006 |
+
if (typeof path === 'string') {
|
8007 |
+
// Two-arg form: push(path, state)
|
8008 |
+
location = parsePath(path);
|
8009 |
+
location.state = state;
|
8010 |
+
} else {
|
8011 |
+
// One-arg form: push(location)
|
8012 |
+
location = Object(esm_extends["a" /* default */])({}, path);
|
8013 |
+
if (location.pathname === undefined) location.pathname = '';
|
8014 |
|
8015 |
+
if (location.search) {
|
8016 |
+
if (location.search.charAt(0) !== '?') location.search = '?' + location.search;
|
8017 |
+
} else {
|
8018 |
+
location.search = '';
|
8019 |
+
}
|
8020 |
|
8021 |
+
if (location.hash) {
|
8022 |
+
if (location.hash.charAt(0) !== '#') location.hash = '#' + location.hash;
|
8023 |
+
} else {
|
8024 |
+
location.hash = '';
|
8025 |
+
}
|
8026 |
|
8027 |
+
if (state !== undefined && location.state === undefined) location.state = state;
|
8028 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8029 |
|
8030 |
+
try {
|
8031 |
+
location.pathname = decodeURI(location.pathname);
|
8032 |
+
} catch (e) {
|
8033 |
+
if (e instanceof URIError) {
|
8034 |
+
throw new URIError('Pathname "' + location.pathname + '" could not be decoded. ' + 'This is likely caused by an invalid percent-encoding.');
|
8035 |
+
} else {
|
8036 |
+
throw e;
|
8037 |
+
}
|
8038 |
+
}
|
8039 |
|
8040 |
+
if (key) location.key = key;
|
8041 |
|
8042 |
+
if (currentLocation) {
|
8043 |
+
// Resolve incomplete/relative pathname relative to current location.
|
8044 |
+
if (!location.pathname) {
|
8045 |
+
location.pathname = currentLocation.pathname;
|
8046 |
+
} else if (location.pathname.charAt(0) !== '/') {
|
8047 |
+
location.pathname = resolve_pathname(location.pathname, currentLocation.pathname);
|
8048 |
+
}
|
8049 |
+
} else {
|
8050 |
+
// When there is no prior location and pathname is empty, set it to /
|
8051 |
+
if (!location.pathname) {
|
8052 |
+
location.pathname = '/';
|
8053 |
+
}
|
8054 |
+
}
|
8055 |
+
|
8056 |
+
return location;
|
8057 |
+
}
|
8058 |
+
function locationsAreEqual(a, b) {
|
8059 |
+
return a.pathname === b.pathname && a.search === b.search && a.hash === b.hash && a.key === b.key && value_equal(a.state, b.state);
|
8060 |
}
|
8061 |
|
8062 |
+
function createTransitionManager() {
|
8063 |
+
var prompt = null;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8064 |
|
8065 |
+
function setPrompt(nextPrompt) {
|
8066 |
+
false ? undefined : void 0;
|
8067 |
+
prompt = nextPrompt;
|
8068 |
+
return function () {
|
8069 |
+
if (prompt === nextPrompt) prompt = null;
|
8070 |
+
};
|
8071 |
+
}
|
8072 |
+
|
8073 |
+
function confirmTransitionTo(location, action, getUserConfirmation, callback) {
|
8074 |
+
// TODO: If another transition starts while we're still confirming
|
8075 |
+
// the previous one, we may end up in a weird state. Figure out the
|
8076 |
+
// best way to handle this.
|
8077 |
+
if (prompt != null) {
|
8078 |
+
var result = typeof prompt === 'function' ? prompt(location, action) : prompt;
|
8079 |
+
|
8080 |
+
if (typeof result === 'string') {
|
8081 |
+
if (typeof getUserConfirmation === 'function') {
|
8082 |
+
getUserConfirmation(result, callback);
|
8083 |
+
} else {
|
8084 |
+
false ? undefined : void 0;
|
8085 |
+
callback(true);
|
8086 |
+
}
|
8087 |
+
} else {
|
8088 |
+
// Return false from a transition hook to cancel the transition.
|
8089 |
+
callback(result !== false);
|
8090 |
}
|
8091 |
+
} else {
|
8092 |
+
callback(true);
|
8093 |
}
|
8094 |
+
}
|
8095 |
|
8096 |
+
var listeners = [];
|
|
|
|
|
|
|
|
|
8097 |
|
8098 |
+
function appendListener(fn) {
|
8099 |
+
var isActive = true;
|
8100 |
|
8101 |
+
function listener() {
|
8102 |
+
if (isActive) fn.apply(void 0, arguments);
|
8103 |
+
}
|
8104 |
|
8105 |
+
listeners.push(listener);
|
8106 |
+
return function () {
|
8107 |
+
isActive = false;
|
8108 |
+
listeners = listeners.filter(function (item) {
|
8109 |
+
return item !== listener;
|
8110 |
+
});
|
8111 |
+
};
|
8112 |
+
}
|
8113 |
|
8114 |
+
function notifyListeners() {
|
8115 |
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
8116 |
+
args[_key] = arguments[_key];
|
|
|
|
|
8117 |
}
|
8118 |
+
|
8119 |
+
listeners.forEach(function (listener) {
|
8120 |
+
return listener.apply(void 0, args);
|
8121 |
+
});
|
8122 |
}
|
8123 |
|
8124 |
+
return {
|
8125 |
+
setPrompt: setPrompt,
|
8126 |
+
confirmTransitionTo: confirmTransitionTo,
|
8127 |
+
appendListener: appendListener,
|
8128 |
+
notifyListeners: notifyListeners
|
8129 |
+
};
|
8130 |
}
|
8131 |
|
8132 |
+
var canUseDOM = !!(typeof window !== 'undefined' && window.document && window.document.createElement);
|
8133 |
+
function getConfirmation(message, callback) {
|
8134 |
+
callback(window.confirm(message)); // eslint-disable-line no-alert
|
8135 |
+
}
|
8136 |
+
/**
|
8137 |
+
* Returns true if the HTML5 history API is supported. Taken from Modernizr.
|
8138 |
+
*
|
8139 |
+
* https://github.com/Modernizr/Modernizr/blob/master/LICENSE
|
8140 |
+
* https://github.com/Modernizr/Modernizr/blob/master/feature-detects/history.js
|
8141 |
+
* changed to avoid false negatives for Windows Phones: https://github.com/reactjs/react-router/issues/586
|
8142 |
+
*/
|
8143 |
|
8144 |
+
function supportsHistory() {
|
8145 |
+
var ua = window.navigator.userAgent;
|
8146 |
+
if ((ua.indexOf('Android 2.') !== -1 || ua.indexOf('Android 4.0') !== -1) && ua.indexOf('Mobile Safari') !== -1 && ua.indexOf('Chrome') === -1 && ua.indexOf('Windows Phone') === -1) return false;
|
8147 |
+
return window.history && 'pushState' in window.history;
|
8148 |
+
}
|
8149 |
+
/**
|
8150 |
+
* Returns true if browser fires popstate on hash change.
|
8151 |
+
* IE10 and IE11 do not.
|
8152 |
+
*/
|
8153 |
|
8154 |
+
function supportsPopStateOnHashChange() {
|
8155 |
+
return window.navigator.userAgent.indexOf('Trident') === -1;
|
8156 |
+
}
|
8157 |
+
/**
|
8158 |
+
* Returns false if using go(n) with hash history causes a full page reload.
|
8159 |
+
*/
|
8160 |
|
8161 |
+
function supportsGoWithoutReloadUsingHash() {
|
8162 |
+
return window.navigator.userAgent.indexOf('Firefox') === -1;
|
8163 |
+
}
|
8164 |
+
/**
|
8165 |
+
* Returns true if a given popstate event is an extraneous WebKit event.
|
8166 |
+
* Accounts for the fact that Chrome on iOS fires real popstate events
|
8167 |
+
* containing undefined state when pressing the back button.
|
8168 |
+
*/
|
8169 |
|
8170 |
+
function isExtraneousPopstateEvent(event) {
|
8171 |
+
return event.state === undefined && navigator.userAgent.indexOf('CriOS') === -1;
|
8172 |
+
}
|
|
|
|
|
|
|
8173 |
|
8174 |
+
var PopStateEvent = 'popstate';
|
8175 |
+
var HashChangeEvent = 'hashchange';
|
8176 |
|
8177 |
+
function getHistoryState() {
|
8178 |
+
try {
|
8179 |
+
return window.history.state || {};
|
8180 |
+
} catch (e) {
|
8181 |
+
// IE 11 sometimes throws when accessing window.history.state
|
8182 |
+
// See https://github.com/ReactTraining/history/pull/289
|
8183 |
+
return {};
|
8184 |
+
}
|
8185 |
+
}
|
8186 |
/**
|
8187 |
+
* Creates a history object that uses the HTML5 history API including
|
8188 |
+
* pushState, replaceState, and the popstate event.
|
8189 |
*/
|
8190 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8191 |
|
8192 |
+
function createBrowserHistory(props) {
|
8193 |
+
if (props === void 0) {
|
8194 |
+
props = {};
|
8195 |
+
}
|
8196 |
|
8197 |
+
!canUseDOM ? false ? undefined : Object(tiny_invariant_esm["a" /* default */])(false) : void 0;
|
8198 |
+
var globalHistory = window.history;
|
8199 |
+
var canUseHistory = supportsHistory();
|
8200 |
+
var needsHashChangeListener = !supportsPopStateOnHashChange();
|
8201 |
+
var _props = props,
|
8202 |
+
_props$forceRefresh = _props.forceRefresh,
|
8203 |
+
forceRefresh = _props$forceRefresh === void 0 ? false : _props$forceRefresh,
|
8204 |
+
_props$getUserConfirm = _props.getUserConfirmation,
|
8205 |
+
getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation : _props$getUserConfirm,
|
8206 |
+
_props$keyLength = _props.keyLength,
|
8207 |
+
keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;
|
8208 |
+
var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : '';
|
8209 |
|
8210 |
+
function getDOMLocation(historyState) {
|
8211 |
+
var _ref = historyState || {},
|
8212 |
+
key = _ref.key,
|
8213 |
+
state = _ref.state;
|
8214 |
|
8215 |
+
var _window$location = window.location,
|
8216 |
+
pathname = _window$location.pathname,
|
8217 |
+
search = _window$location.search,
|
8218 |
+
hash = _window$location.hash;
|
8219 |
+
var path = pathname + search + hash;
|
8220 |
+
false ? undefined : void 0;
|
8221 |
+
if (basename) path = stripBasename(path, basename);
|
8222 |
+
return createLocation(path, state, key);
|
8223 |
+
}
|
8224 |
|
8225 |
+
function createKey() {
|
8226 |
+
return Math.random().toString(36).substr(2, keyLength);
|
8227 |
+
}
|
8228 |
|
8229 |
+
var transitionManager = createTransitionManager();
|
8230 |
|
8231 |
+
function setState(nextState) {
|
8232 |
+
Object(esm_extends["a" /* default */])(history, nextState);
|
8233 |
|
8234 |
+
history.length = globalHistory.length;
|
8235 |
+
transitionManager.notifyListeners(history.location, history.action);
|
8236 |
+
}
|
8237 |
|
8238 |
+
function handlePopState(event) {
|
8239 |
+
// Ignore extraneous popstate events in WebKit.
|
8240 |
+
if (isExtraneousPopstateEvent(event)) return;
|
8241 |
+
handlePop(getDOMLocation(event.state));
|
8242 |
+
}
|
8243 |
|
8244 |
+
function handleHashChange() {
|
8245 |
+
handlePop(getDOMLocation(getHistoryState()));
|
8246 |
+
}
|
8247 |
|
8248 |
+
var forceNextPop = false;
|
|
|
|
|
8249 |
|
8250 |
+
function handlePop(location) {
|
8251 |
+
if (forceNextPop) {
|
8252 |
+
forceNextPop = false;
|
8253 |
+
setState();
|
8254 |
+
} else {
|
8255 |
+
var action = 'POP';
|
8256 |
+
transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {
|
8257 |
+
if (ok) {
|
8258 |
+
setState({
|
8259 |
+
action: action,
|
8260 |
+
location: location
|
8261 |
+
});
|
8262 |
+
} else {
|
8263 |
+
revertPop(location);
|
8264 |
+
}
|
8265 |
+
});
|
8266 |
+
}
|
8267 |
+
}
|
8268 |
|
8269 |
+
function revertPop(fromLocation) {
|
8270 |
+
var toLocation = history.location; // TODO: We could probably make this more reliable by
|
8271 |
+
// keeping a list of keys we've seen in sessionStorage.
|
8272 |
+
// Instead, we just default to 0 for keys we don't know.
|
8273 |
|
8274 |
+
var toIndex = allKeys.indexOf(toLocation.key);
|
8275 |
+
if (toIndex === -1) toIndex = 0;
|
8276 |
+
var fromIndex = allKeys.indexOf(fromLocation.key);
|
8277 |
+
if (fromIndex === -1) fromIndex = 0;
|
8278 |
+
var delta = toIndex - fromIndex;
|
8279 |
|
8280 |
+
if (delta) {
|
8281 |
+
forceNextPop = true;
|
8282 |
+
go(delta);
|
8283 |
+
}
|
8284 |
+
}
|
8285 |
|
8286 |
+
var initialLocation = getDOMLocation(getHistoryState());
|
8287 |
+
var allKeys = [initialLocation.key]; // Public interface
|
|
|
8288 |
|
8289 |
+
function createHref(location) {
|
8290 |
+
return basename + createPath(location);
|
8291 |
+
}
|
8292 |
|
8293 |
+
function push(path, state) {
|
8294 |
+
false ? undefined : void 0;
|
8295 |
+
var action = 'PUSH';
|
8296 |
+
var location = createLocation(path, state, createKey(), history.location);
|
8297 |
+
transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {
|
8298 |
+
if (!ok) return;
|
8299 |
+
var href = createHref(location);
|
8300 |
+
var key = location.key,
|
8301 |
+
state = location.state;
|
8302 |
|
8303 |
+
if (canUseHistory) {
|
8304 |
+
globalHistory.pushState({
|
8305 |
+
key: key,
|
8306 |
+
state: state
|
8307 |
+
}, null, href);
|
8308 |
|
8309 |
+
if (forceRefresh) {
|
8310 |
+
window.location.href = href;
|
8311 |
+
} else {
|
8312 |
+
var prevIndex = allKeys.indexOf(history.location.key);
|
8313 |
+
var nextKeys = allKeys.slice(0, prevIndex + 1);
|
8314 |
+
nextKeys.push(location.key);
|
8315 |
+
allKeys = nextKeys;
|
8316 |
+
setState({
|
8317 |
+
action: action,
|
8318 |
+
location: location
|
8319 |
+
});
|
8320 |
+
}
|
8321 |
+
} else {
|
8322 |
+
false ? undefined : void 0;
|
8323 |
+
window.location.href = href;
|
8324 |
+
}
|
8325 |
+
});
|
8326 |
+
}
|
8327 |
|
8328 |
+
function replace(path, state) {
|
8329 |
+
false ? undefined : void 0;
|
8330 |
+
var action = 'REPLACE';
|
8331 |
+
var location = createLocation(path, state, createKey(), history.location);
|
8332 |
+
transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {
|
8333 |
+
if (!ok) return;
|
8334 |
+
var href = createHref(location);
|
8335 |
+
var key = location.key,
|
8336 |
+
state = location.state;
|
8337 |
|
8338 |
+
if (canUseHistory) {
|
8339 |
+
globalHistory.replaceState({
|
8340 |
+
key: key,
|
8341 |
+
state: state
|
8342 |
+
}, null, href);
|
8343 |
|
8344 |
+
if (forceRefresh) {
|
8345 |
+
window.location.replace(href);
|
8346 |
+
} else {
|
8347 |
+
var prevIndex = allKeys.indexOf(history.location.key);
|
8348 |
+
if (prevIndex !== -1) allKeys[prevIndex] = location.key;
|
8349 |
+
setState({
|
8350 |
+
action: action,
|
8351 |
+
location: location
|
8352 |
+
});
|
8353 |
+
}
|
8354 |
+
} else {
|
8355 |
+
false ? undefined : void 0;
|
8356 |
+
window.location.replace(href);
|
8357 |
+
}
|
8358 |
+
});
|
8359 |
+
}
|
8360 |
|
8361 |
+
function go(n) {
|
8362 |
+
globalHistory.go(n);
|
8363 |
+
}
|
8364 |
|
8365 |
+
function goBack() {
|
8366 |
+
go(-1);
|
8367 |
+
}
|
8368 |
|
8369 |
+
function goForward() {
|
8370 |
+
go(1);
|
8371 |
+
}
|
8372 |
|
8373 |
+
var listenerCount = 0;
|
|
|
8374 |
|
8375 |
+
function checkDOMListeners(delta) {
|
8376 |
+
listenerCount += delta;
|
|
|
8377 |
|
8378 |
+
if (listenerCount === 1 && delta === 1) {
|
8379 |
+
window.addEventListener(PopStateEvent, handlePopState);
|
8380 |
+
if (needsHashChangeListener) window.addEventListener(HashChangeEvent, handleHashChange);
|
8381 |
+
} else if (listenerCount === 0) {
|
8382 |
+
window.removeEventListener(PopStateEvent, handlePopState);
|
8383 |
+
if (needsHashChangeListener) window.removeEventListener(HashChangeEvent, handleHashChange);
|
8384 |
+
}
|
8385 |
+
}
|
8386 |
|
8387 |
+
var isBlocked = false;
|
|
|
8388 |
|
8389 |
+
function block(prompt) {
|
8390 |
+
if (prompt === void 0) {
|
8391 |
+
prompt = false;
|
8392 |
+
}
|
8393 |
|
8394 |
+
var unblock = transitionManager.setPrompt(prompt);
|
8395 |
|
8396 |
+
if (!isBlocked) {
|
8397 |
+
checkDOMListeners(1);
|
8398 |
+
isBlocked = true;
|
8399 |
+
}
|
8400 |
|
8401 |
+
return function () {
|
8402 |
+
if (isBlocked) {
|
8403 |
+
isBlocked = false;
|
8404 |
+
checkDOMListeners(-1);
|
8405 |
+
}
|
8406 |
|
8407 |
+
return unblock();
|
8408 |
+
};
|
8409 |
+
}
|
8410 |
|
8411 |
+
function listen(listener) {
|
8412 |
+
var unlisten = transitionManager.appendListener(listener);
|
8413 |
+
checkDOMListeners(1);
|
8414 |
+
return function () {
|
8415 |
+
checkDOMListeners(-1);
|
8416 |
+
unlisten();
|
8417 |
+
};
|
8418 |
+
}
|
8419 |
|
8420 |
+
var history = {
|
8421 |
+
length: globalHistory.length,
|
8422 |
+
action: 'POP',
|
8423 |
+
location: initialLocation,
|
8424 |
+
createHref: createHref,
|
8425 |
+
push: push,
|
8426 |
+
replace: replace,
|
8427 |
+
go: go,
|
8428 |
+
goBack: goBack,
|
8429 |
+
goForward: goForward,
|
8430 |
+
block: block,
|
8431 |
+
listen: listen
|
8432 |
+
};
|
8433 |
+
return history;
|
8434 |
+
}
|
8435 |
|
8436 |
+
var HashChangeEvent$1 = 'hashchange';
|
8437 |
+
var HashPathCoders = {
|
8438 |
+
hashbang: {
|
8439 |
+
encodePath: function encodePath(path) {
|
8440 |
+
return path.charAt(0) === '!' ? path : '!/' + stripLeadingSlash(path);
|
8441 |
+
},
|
8442 |
+
decodePath: function decodePath(path) {
|
8443 |
+
return path.charAt(0) === '!' ? path.substr(1) : path;
|
8444 |
+
}
|
8445 |
+
},
|
8446 |
+
noslash: {
|
8447 |
+
encodePath: stripLeadingSlash,
|
8448 |
+
decodePath: addLeadingSlash
|
8449 |
+
},
|
8450 |
+
slash: {
|
8451 |
+
encodePath: addLeadingSlash,
|
8452 |
+
decodePath: addLeadingSlash
|
8453 |
+
}
|
8454 |
+
};
|
8455 |
|
8456 |
+
function stripHash(url) {
|
8457 |
+
var hashIndex = url.indexOf('#');
|
8458 |
+
return hashIndex === -1 ? url : url.slice(0, hashIndex);
|
8459 |
+
}
|
8460 |
|
8461 |
+
function getHashPath() {
|
8462 |
+
// We can't use window.location.hash here because it's not
|
8463 |
+
// consistent across browsers - Firefox will pre-decode it!
|
8464 |
+
var href = window.location.href;
|
8465 |
+
var hashIndex = href.indexOf('#');
|
8466 |
+
return hashIndex === -1 ? '' : href.substring(hashIndex + 1);
|
8467 |
+
}
|
8468 |
|
8469 |
+
function pushHashPath(path) {
|
8470 |
+
window.location.hash = path;
|
8471 |
+
}
|
8472 |
|
8473 |
+
function replaceHashPath(path) {
|
8474 |
+
window.location.replace(stripHash(window.location.href) + '#' + path);
|
8475 |
+
}
|
8476 |
|
8477 |
+
function createHashHistory(props) {
|
8478 |
+
if (props === void 0) {
|
8479 |
+
props = {};
|
8480 |
+
}
|
8481 |
|
8482 |
+
!canUseDOM ? false ? undefined : Object(tiny_invariant_esm["a" /* default */])(false) : void 0;
|
8483 |
+
var globalHistory = window.history;
|
8484 |
+
var canGoWithoutReload = supportsGoWithoutReloadUsingHash();
|
8485 |
+
var _props = props,
|
8486 |
+
_props$getUserConfirm = _props.getUserConfirmation,
|
8487 |
+
getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation : _props$getUserConfirm,
|
8488 |
+
_props$hashType = _props.hashType,
|
8489 |
+
hashType = _props$hashType === void 0 ? 'slash' : _props$hashType;
|
8490 |
+
var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : '';
|
8491 |
+
var _HashPathCoders$hashT = HashPathCoders[hashType],
|
8492 |
+
encodePath = _HashPathCoders$hashT.encodePath,
|
8493 |
+
decodePath = _HashPathCoders$hashT.decodePath;
|
8494 |
|
8495 |
+
function getDOMLocation() {
|
8496 |
+
var path = decodePath(getHashPath());
|
8497 |
+
false ? undefined : void 0;
|
8498 |
+
if (basename) path = stripBasename(path, basename);
|
8499 |
+
return createLocation(path);
|
8500 |
+
}
|
8501 |
|
8502 |
+
var transitionManager = createTransitionManager();
|
|
|
|
|
|
|
|
|
8503 |
|
8504 |
+
function setState(nextState) {
|
8505 |
+
Object(esm_extends["a" /* default */])(history, nextState);
|
|
|
8506 |
|
8507 |
+
history.length = globalHistory.length;
|
8508 |
+
transitionManager.notifyListeners(history.location, history.action);
|
8509 |
+
}
|
8510 |
|
8511 |
+
var forceNextPop = false;
|
8512 |
+
var ignorePath = null;
|
|
|
|
|
8513 |
|
8514 |
+
function locationsAreEqual$$1(a, b) {
|
8515 |
+
return a.pathname === b.pathname && a.search === b.search && a.hash === b.hash;
|
8516 |
+
}
|
|
|
|
|
|
|
|
|
|
|
8517 |
|
8518 |
+
function handleHashChange() {
|
8519 |
+
var path = getHashPath();
|
8520 |
+
var encodedPath = encodePath(path);
|
8521 |
|
8522 |
+
if (path !== encodedPath) {
|
8523 |
+
// Ensure we always have a properly-encoded hash.
|
8524 |
+
replaceHashPath(encodedPath);
|
8525 |
+
} else {
|
8526 |
+
var location = getDOMLocation();
|
8527 |
+
var prevLocation = history.location;
|
8528 |
+
if (!forceNextPop && locationsAreEqual$$1(prevLocation, location)) return; // A hashchange doesn't always == location change.
|
|
|
8529 |
|
8530 |
+
if (ignorePath === createPath(location)) return; // Ignore this change; we already setState in push/replace.
|
|
|
8531 |
|
8532 |
+
ignorePath = null;
|
8533 |
+
handlePop(location);
|
8534 |
+
}
|
8535 |
+
}
|
8536 |
+
|
8537 |
+
function handlePop(location) {
|
8538 |
+
if (forceNextPop) {
|
8539 |
+
forceNextPop = false;
|
8540 |
+
setState();
|
8541 |
+
} else {
|
8542 |
+
var action = 'POP';
|
8543 |
+
transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {
|
8544 |
+
if (ok) {
|
8545 |
+
setState({
|
8546 |
+
action: action,
|
8547 |
location: location
|
8548 |
});
|
8549 |
} else {
|
8550 |
+
revertPop(location);
|
8551 |
}
|
8552 |
});
|
8553 |
}
|
|
|
|
|
8554 |
}
|
8555 |
|
8556 |
+
function revertPop(fromLocation) {
|
8557 |
+
var toLocation = history.location; // TODO: We could probably make this more reliable by
|
8558 |
+
// keeping a list of paths we've seen in sessionStorage.
|
8559 |
+
// Instead, we just default to 0 for paths we don't know.
|
8560 |
|
8561 |
+
var toIndex = allPaths.lastIndexOf(createPath(toLocation));
|
8562 |
+
if (toIndex === -1) toIndex = 0;
|
8563 |
+
var fromIndex = allPaths.lastIndexOf(createPath(fromLocation));
|
8564 |
+
if (fromIndex === -1) fromIndex = 0;
|
8565 |
+
var delta = toIndex - fromIndex;
|
8566 |
|
8567 |
+
if (delta) {
|
8568 |
+
forceNextPop = true;
|
8569 |
+
go(delta);
|
|
|
8570 |
}
|
8571 |
+
} // Ensure the hash is encoded properly before doing anything else.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8572 |
|
|
|
|
|
|
|
8573 |
|
8574 |
+
var path = getHashPath();
|
8575 |
+
var encodedPath = encodePath(path);
|
8576 |
+
if (path !== encodedPath) replaceHashPath(encodedPath);
|
8577 |
+
var initialLocation = getDOMLocation();
|
8578 |
+
var allPaths = [createPath(initialLocation)]; // Public interface
|
8579 |
|
8580 |
+
function createHref(location) {
|
8581 |
+
var baseTag = document.querySelector('base');
|
8582 |
+
var href = '';
|
8583 |
|
8584 |
+
if (baseTag && baseTag.getAttribute('href')) {
|
8585 |
+
href = stripHash(window.location.href);
|
8586 |
}
|
8587 |
|
8588 |
+
return href + '#' + encodePath(basename + createPath(location));
|
|
|
|
|
8589 |
}
|
8590 |
|
8591 |
+
function push(path, state) {
|
8592 |
+
false ? undefined : void 0;
|
8593 |
+
var action = 'PUSH';
|
8594 |
+
var location = createLocation(path, undefined, undefined, history.location);
|
8595 |
+
transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {
|
8596 |
+
if (!ok) return;
|
8597 |
+
var path = createPath(location);
|
8598 |
+
var encodedPath = encodePath(basename + path);
|
8599 |
+
var hashChanged = getHashPath() !== encodedPath;
|
8600 |
|
8601 |
+
if (hashChanged) {
|
8602 |
+
// We cannot tell if a hashchange was caused by a PUSH, so we'd
|
8603 |
+
// rather setState here and ignore the hashchange. The caveat here
|
8604 |
+
// is that other hash histories in the page will consider it a POP.
|
8605 |
+
ignorePath = path;
|
8606 |
+
pushHashPath(encodedPath);
|
8607 |
+
var prevIndex = allPaths.lastIndexOf(createPath(history.location));
|
8608 |
+
var nextPaths = allPaths.slice(0, prevIndex + 1);
|
8609 |
+
nextPaths.push(path);
|
8610 |
+
allPaths = nextPaths;
|
8611 |
+
setState({
|
8612 |
+
action: action,
|
8613 |
+
location: location
|
8614 |
+
});
|
8615 |
+
} else {
|
8616 |
+
false ? undefined : void 0;
|
8617 |
+
setState();
|
8618 |
+
}
|
8619 |
});
|
8620 |
+
}
|
8621 |
|
8622 |
+
function replace(path, state) {
|
8623 |
+
false ? undefined : void 0;
|
8624 |
+
var action = 'REPLACE';
|
8625 |
+
var location = createLocation(path, undefined, undefined, history.location);
|
8626 |
+
transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {
|
8627 |
+
if (!ok) return;
|
8628 |
+
var path = createPath(location);
|
8629 |
+
var encodedPath = encodePath(basename + path);
|
8630 |
+
var hashChanged = getHashPath() !== encodedPath;
|
8631 |
|
8632 |
+
if (hashChanged) {
|
8633 |
+
// We cannot tell if a hashchange was caused by a REPLACE, so we'd
|
8634 |
+
// rather setState here and ignore the hashchange. The caveat here
|
8635 |
+
// is that other hash histories in the page will consider it a POP.
|
8636 |
+
ignorePath = path;
|
8637 |
+
replaceHashPath(encodedPath);
|
8638 |
+
}
|
8639 |
|
8640 |
+
var prevIndex = allPaths.indexOf(createPath(history.location));
|
8641 |
+
if (prevIndex !== -1) allPaths[prevIndex] = path;
|
8642 |
+
setState({
|
8643 |
+
action: action,
|
8644 |
+
location: location
|
8645 |
+
});
|
8646 |
+
});
|
8647 |
+
}
|
8648 |
|
8649 |
+
function go(n) {
|
8650 |
+
false ? undefined : void 0;
|
8651 |
+
globalHistory.go(n);
|
8652 |
}
|
8653 |
|
8654 |
+
function goBack() {
|
8655 |
+
go(-1);
|
8656 |
+
}
|
8657 |
|
8658 |
+
function goForward() {
|
8659 |
+
go(1);
|
8660 |
+
}
|
8661 |
|
8662 |
+
var listenerCount = 0;
|
|
|
|
|
8663 |
|
8664 |
+
function checkDOMListeners(delta) {
|
8665 |
+
listenerCount += delta;
|
|
|
8666 |
|
8667 |
+
if (listenerCount === 1 && delta === 1) {
|
8668 |
+
window.addEventListener(HashChangeEvent$1, handleHashChange);
|
8669 |
+
} else if (listenerCount === 0) {
|
8670 |
+
window.removeEventListener(HashChangeEvent$1, handleHashChange);
|
8671 |
+
}
|
8672 |
+
}
|
8673 |
|
8674 |
+
var isBlocked = false;
|
|
|
8675 |
|
8676 |
+
function block(prompt) {
|
8677 |
+
if (prompt === void 0) {
|
8678 |
+
prompt = false;
|
8679 |
+
}
|
8680 |
|
8681 |
+
var unblock = transitionManager.setPrompt(prompt);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8682 |
|
8683 |
+
if (!isBlocked) {
|
8684 |
+
checkDOMListeners(1);
|
8685 |
+
isBlocked = true;
|
8686 |
+
}
|
8687 |
|
8688 |
+
return function () {
|
8689 |
+
if (isBlocked) {
|
8690 |
+
isBlocked = false;
|
8691 |
+
checkDOMListeners(-1);
|
8692 |
+
}
|
8693 |
|
8694 |
+
return unblock();
|
8695 |
+
};
|
8696 |
+
}
|
8697 |
|
8698 |
+
function listen(listener) {
|
8699 |
+
var unlisten = transitionManager.appendListener(listener);
|
8700 |
+
checkDOMListeners(1);
|
8701 |
+
return function () {
|
8702 |
+
checkDOMListeners(-1);
|
8703 |
+
unlisten();
|
8704 |
+
};
|
8705 |
}
|
8706 |
|
8707 |
+
var history = {
|
8708 |
+
length: globalHistory.length,
|
8709 |
+
action: 'POP',
|
8710 |
+
location: initialLocation,
|
8711 |
+
createHref: createHref,
|
8712 |
+
push: push,
|
8713 |
+
replace: replace,
|
8714 |
+
go: go,
|
8715 |
+
goBack: goBack,
|
8716 |
+
goForward: goForward,
|
8717 |
+
block: block,
|
8718 |
+
listen: listen
|
8719 |
+
};
|
8720 |
+
return history;
|
8721 |
+
}
|
8722 |
+
|
8723 |
+
function clamp(n, lowerBound, upperBound) {
|
8724 |
+
return Math.min(Math.max(n, lowerBound), upperBound);
|
8725 |
}
|
8726 |
/**
|
8727 |
+
* Creates a history object that stores locations in memory.
|
8728 |
*/
|
8729 |
|
8730 |
|
8731 |
+
function createMemoryHistory(props) {
|
8732 |
+
if (props === void 0) {
|
8733 |
+
props = {};
|
8734 |
}
|
8735 |
|
8736 |
+
var _props = props,
|
8737 |
+
getUserConfirmation = _props.getUserConfirmation,
|
8738 |
+
_props$initialEntries = _props.initialEntries,
|
8739 |
+
initialEntries = _props$initialEntries === void 0 ? ['/'] : _props$initialEntries,
|
8740 |
+
_props$initialIndex = _props.initialIndex,
|
8741 |
+
initialIndex = _props$initialIndex === void 0 ? 0 : _props$initialIndex,
|
8742 |
+
_props$keyLength = _props.keyLength,
|
8743 |
+
keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;
|
8744 |
+
var transitionManager = createTransitionManager();
|
8745 |
+
|
8746 |
+
function setState(nextState) {
|
8747 |
+
Object(esm_extends["a" /* default */])(history, nextState);
|
8748 |
+
|
8749 |
+
history.length = history.entries.length;
|
8750 |
+
transitionManager.notifyListeners(history.location, history.action);
|
8751 |
}
|
8752 |
|
8753 |
+
function createKey() {
|
8754 |
+
return Math.random().toString(36).substr(2, keyLength);
|
8755 |
+
}
|
|
|
8756 |
|
8757 |
+
var index = clamp(initialIndex, 0, initialEntries.length - 1);
|
8758 |
+
var entries = initialEntries.map(function (entry) {
|
8759 |
+
return typeof entry === 'string' ? createLocation(entry, undefined, createKey()) : createLocation(entry, undefined, entry.key || createKey());
|
8760 |
+
}); // Public interface
|
8761 |
|
8762 |
+
var createHref = createPath;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8763 |
|
8764 |
+
function push(path, state) {
|
8765 |
+
false ? undefined : void 0;
|
8766 |
+
var action = 'PUSH';
|
8767 |
+
var location = createLocation(path, state, createKey(), history.location);
|
8768 |
+
transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {
|
8769 |
+
if (!ok) return;
|
8770 |
+
var prevIndex = history.index;
|
8771 |
+
var nextIndex = prevIndex + 1;
|
8772 |
+
var nextEntries = history.entries.slice(0);
|
8773 |
|
8774 |
+
if (nextEntries.length > nextIndex) {
|
8775 |
+
nextEntries.splice(nextIndex, nextEntries.length - nextIndex, location);
|
8776 |
+
} else {
|
8777 |
+
nextEntries.push(location);
|
8778 |
+
}
|
|
|
8779 |
|
8780 |
+
setState({
|
8781 |
+
action: action,
|
8782 |
+
location: location,
|
8783 |
+
index: nextIndex,
|
8784 |
+
entries: nextEntries
|
8785 |
+
});
|
|
|
8786 |
});
|
8787 |
+
}
|
|
|
8788 |
|
8789 |
+
function replace(path, state) {
|
8790 |
+
false ? undefined : void 0;
|
8791 |
+
var action = 'REPLACE';
|
8792 |
+
var location = createLocation(path, state, createKey(), history.location);
|
8793 |
+
transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {
|
8794 |
+
if (!ok) return;
|
8795 |
+
history.entries[history.index] = location;
|
8796 |
+
setState({
|
8797 |
+
action: action,
|
8798 |
+
location: location
|
8799 |
+
});
|
8800 |
+
});
|
8801 |
+
}
|
8802 |
|
8803 |
+
function go(n) {
|
8804 |
+
var nextIndex = clamp(history.index + n, 0, history.entries.length - 1);
|
8805 |
+
var action = 'POP';
|
8806 |
+
var location = history.entries[nextIndex];
|
8807 |
+
transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {
|
8808 |
+
if (ok) {
|
8809 |
+
setState({
|
8810 |
+
action: action,
|
8811 |
+
location: location,
|
8812 |
+
index: nextIndex
|
8813 |
+
});
|
8814 |
+
} else {
|
8815 |
+
// Mimic the behavior of DOM histories by
|
8816 |
+
// causing a render after a cancelled POP.
|
8817 |
+
setState();
|
8818 |
+
}
|
8819 |
+
});
|
8820 |
+
}
|
8821 |
|
8822 |
+
function goBack() {
|
8823 |
+
go(-1);
|
8824 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8825 |
|
8826 |
+
function goForward() {
|
8827 |
+
go(1);
|
|
|
8828 |
}
|
8829 |
|
8830 |
+
function canGo(n) {
|
8831 |
+
var nextIndex = history.index + n;
|
8832 |
+
return nextIndex >= 0 && nextIndex < history.entries.length;
|
8833 |
+
}
|
|
|
8834 |
|
8835 |
+
function block(prompt) {
|
8836 |
+
if (prompt === void 0) {
|
8837 |
+
prompt = false;
|
8838 |
+
}
|
8839 |
|
8840 |
+
return transitionManager.setPrompt(prompt);
|
|
|
|
|
8841 |
}
|
8842 |
|
8843 |
+
function listen(listener) {
|
8844 |
+
return transitionManager.appendListener(listener);
|
|
|
|
|
8845 |
}
|
8846 |
|
8847 |
+
var history = {
|
8848 |
+
length: entries.length,
|
8849 |
+
action: 'POP',
|
8850 |
+
location: entries[index],
|
8851 |
+
index: index,
|
8852 |
+
entries: entries,
|
8853 |
+
createHref: createHref,
|
8854 |
+
push: push,
|
8855 |
+
replace: replace,
|
8856 |
+
go: go,
|
8857 |
+
goBack: goBack,
|
8858 |
+
goForward: goForward,
|
8859 |
+
canGo: canGo,
|
8860 |
+
block: block,
|
8861 |
+
listen: listen
|
8862 |
+
};
|
8863 |
+
return history;
|
8864 |
+
}
|
8865 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8866 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8867 |
|
|
|
|
|
|
|
8868 |
|
8869 |
+
/***/ }),
|
8870 |
+
/* 109 */
|
8871 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
8872 |
+
|
8873 |
+
"use strict";
|
8874 |
+
/* harmony import */ var _babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(16);
|
8875 |
+
/* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(17);
|
8876 |
+
/* harmony import */ var _babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(12);
|
8877 |
+
/* harmony import */ var _babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(18);
|
8878 |
+
/* harmony import */ var _babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(21);
|
8879 |
+
/* harmony import */ var _babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(9);
|
8880 |
+
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(0);
|
8881 |
+
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__);
|
8882 |
+
/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(77);
|
8883 |
+
/* harmony import */ var _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(57);
|
8884 |
+
/* harmony import */ var _wordpress_dom__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(68);
|
8885 |
+
|
8886 |
+
|
8887 |
|
8888 |
|
|
|
|
|
|
|
|
|
8889 |
|
|
|
|
|
|
|
8890 |
|
|
|
8891 |
|
|
|
|
|
8892 |
|
8893 |
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_5__[/* default */ "a"])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_5__[/* default */ "a"])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_4__[/* default */ "a"])(this, result); }; }
|
|
|
|
|
|
|
|
|
8894 |
|
8895 |
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
|
|
|
|
|
|
|
8896 |
|
8897 |
+
/**
|
8898 |
+
* WordPress dependencies
|
8899 |
+
*/
|
|
|
|
|
8900 |
|
|
|
|
|
|
|
8901 |
|
|
|
|
|
|
|
|
|
|
|
8902 |
|
|
|
|
|
8903 |
|
8904 |
+
var withConstrainedTabbing = Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_7__[/* default */ "a"])(function (WrappedComponent) {
|
8905 |
+
return /*#__PURE__*/function (_Component) {
|
8906 |
+
Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_3__[/* default */ "a"])(_class, _Component);
|
8907 |
|
8908 |
+
var _super = _createSuper(_class);
|
|
|
|
|
8909 |
|
8910 |
+
function _class() {
|
8911 |
+
var _this;
|
|
|
|
|
|
|
|
|
8912 |
|
8913 |
+
Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])(this, _class);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8914 |
|
8915 |
+
_this = _super.apply(this, arguments);
|
8916 |
+
_this.focusContainRef = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createRef"])();
|
8917 |
+
_this.handleTabBehaviour = _this.handleTabBehaviour.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_2__[/* default */ "a"])(_this));
|
8918 |
+
return _this;
|
8919 |
+
}
|
8920 |
|
8921 |
+
Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"])(_class, [{
|
8922 |
+
key: "handleTabBehaviour",
|
8923 |
+
value: function handleTabBehaviour(event) {
|
8924 |
+
if (event.keyCode !== _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_8__[/* TAB */ "e"]) {
|
8925 |
+
return;
|
8926 |
+
}
|
8927 |
|
8928 |
+
var tabbables = _wordpress_dom__WEBPACK_IMPORTED_MODULE_9__[/* focus */ "a"].tabbable.find(this.focusContainRef.current);
|
|
|
|
|
|
|
|
|
|
|
|
|
8929 |
|
8930 |
+
if (!tabbables.length) {
|
8931 |
+
return;
|
8932 |
+
}
|
8933 |
|
8934 |
+
var firstTabbable = tabbables[0];
|
8935 |
+
var lastTabbable = tabbables[tabbables.length - 1];
|
|
|
|
|
8936 |
|
8937 |
+
if (event.shiftKey && event.target === firstTabbable) {
|
8938 |
+
event.preventDefault();
|
8939 |
+
lastTabbable.focus();
|
8940 |
+
} else if (!event.shiftKey && event.target === lastTabbable) {
|
8941 |
+
event.preventDefault();
|
8942 |
+
firstTabbable.focus();
|
8943 |
+
/*
|
8944 |
+
* When pressing Tab and none of the tabbables has focus, the keydown
|
8945 |
+
* event happens on the wrapper div: move focus on the first tabbable.
|
8946 |
+
*/
|
8947 |
+
} else if (!tabbables.includes(event.target)) {
|
8948 |
+
event.preventDefault();
|
8949 |
+
firstTabbable.focus();
|
8950 |
+
}
|
8951 |
+
}
|
8952 |
+
}, {
|
8953 |
+
key: "render",
|
8954 |
+
value: function render() {
|
8955 |
+
// Disable reason: this component is non-interactive, but must capture
|
8956 |
+
// events from the wrapped component to determine when the Tab key is used.
|
8957 |
|
8958 |
+
/* eslint-disable jsx-a11y/no-static-element-interactions */
|
8959 |
+
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("div", {
|
8960 |
+
onKeyDown: this.handleTabBehaviour,
|
8961 |
+
ref: this.focusContainRef,
|
8962 |
+
tabIndex: "-1"
|
8963 |
+
}, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(WrappedComponent, this.props));
|
8964 |
+
/* eslint-enable jsx-a11y/no-static-element-interactions */
|
8965 |
+
}
|
8966 |
+
}]);
|
8967 |
|
8968 |
+
return _class;
|
8969 |
+
}(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["Component"]);
|
8970 |
+
}, 'withConstrainedTabbing');
|
8971 |
+
/* harmony default export */ __webpack_exports__["a"] = (withConstrainedTabbing);
|
8972 |
+
//# sourceMappingURL=index.js.map
|
8973 |
|
8974 |
+
/***/ }),
|
8975 |
+
/* 110 */
|
8976 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
8977 |
|
8978 |
+
"use strict";
|
8979 |
+
/* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(7);
|
8980 |
+
/* harmony import */ var _babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(16);
|
8981 |
+
/* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(17);
|
8982 |
+
/* harmony import */ var _babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(12);
|
8983 |
+
/* harmony import */ var _babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(18);
|
8984 |
+
/* harmony import */ var _babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(21);
|
8985 |
+
/* harmony import */ var _babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(9);
|
8986 |
+
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(0);
|
8987 |
+
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__);
|
8988 |
+
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(2);
|
8989 |
+
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_8__);
|
8990 |
+
/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(77);
|
8991 |
|
|
|
|
|
|
|
8992 |
|
|
|
|
|
|
|
8993 |
|
|
|
|
|
8994 |
|
|
|
8995 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8996 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8997 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8998 |
|
|
|
|
|
8999 |
|
9000 |
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_6__[/* default */ "a"])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_6__[/* default */ "a"])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_5__[/* default */ "a"])(this, result); }; }
|
9001 |
+
|
9002 |
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
|
9003 |
|
9004 |
/**
|
9005 |
+
* External dependencies
|
9006 |
*/
|
9007 |
|
9008 |
+
/**
|
9009 |
+
* WordPress dependencies
|
9010 |
+
*/
|
|
|
9011 |
|
|
|
|
|
|
|
9012 |
|
|
|
9013 |
|
9014 |
+
/**
|
9015 |
+
* Input types which are classified as button types, for use in considering
|
9016 |
+
* whether element is a (focus-normalized) button.
|
9017 |
+
*
|
9018 |
+
* @type {string[]}
|
9019 |
+
*/
|
9020 |
|
9021 |
+
var INPUT_BUTTON_TYPES = ['button', 'submit'];
|
9022 |
+
/**
|
9023 |
+
* Returns true if the given element is a button element subject to focus
|
9024 |
+
* normalization, or false otherwise.
|
9025 |
+
*
|
9026 |
+
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#Clicking_and_focus
|
9027 |
+
*
|
9028 |
+
* @param {Element} element Element to test.
|
9029 |
+
*
|
9030 |
+
* @return {boolean} Whether element is a button.
|
9031 |
+
*/
|
9032 |
+
|
9033 |
+
function isFocusNormalizedButton(element) {
|
9034 |
+
switch (element.nodeName) {
|
9035 |
+
case 'A':
|
9036 |
+
case 'BUTTON':
|
9037 |
+
return true;
|
9038 |
+
|
9039 |
+
case 'INPUT':
|
9040 |
+
return Object(lodash__WEBPACK_IMPORTED_MODULE_8__["includes"])(INPUT_BUTTON_TYPES, element.type);
|
9041 |
+
}
|
9042 |
|
9043 |
+
return false;
|
9044 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9045 |
|
9046 |
+
/* harmony default export */ __webpack_exports__["a"] = (Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_9__[/* default */ "a"])(function (WrappedComponent) {
|
9047 |
+
return /*#__PURE__*/function (_Component) {
|
9048 |
+
Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__[/* default */ "a"])(_class, _Component);
|
9049 |
|
9050 |
+
var _super = _createSuper(_class);
|
9051 |
|
9052 |
+
function _class() {
|
9053 |
+
var _this;
|
|
|
9054 |
|
9055 |
+
Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"])(this, _class);
|
|
|
9056 |
|
9057 |
+
_this = _super.apply(this, arguments);
|
9058 |
+
_this.bindNode = _this.bindNode.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_3__[/* default */ "a"])(_this));
|
9059 |
+
_this.cancelBlurCheck = _this.cancelBlurCheck.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_3__[/* default */ "a"])(_this));
|
9060 |
+
_this.queueBlurCheck = _this.queueBlurCheck.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_3__[/* default */ "a"])(_this));
|
9061 |
+
_this.normalizeButtonFocus = _this.normalizeButtonFocus.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_3__[/* default */ "a"])(_this));
|
9062 |
+
return _this;
|
9063 |
+
}
|
9064 |
|
9065 |
+
Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_2__[/* default */ "a"])(_class, [{
|
9066 |
+
key: "componentWillUnmount",
|
9067 |
+
value: function componentWillUnmount() {
|
9068 |
+
this.cancelBlurCheck();
|
9069 |
+
}
|
9070 |
+
}, {
|
9071 |
+
key: "bindNode",
|
9072 |
+
value: function bindNode(node) {
|
9073 |
+
if (node) {
|
9074 |
+
this.node = node;
|
9075 |
+
} else {
|
9076 |
+
delete this.node;
|
9077 |
+
this.cancelBlurCheck();
|
9078 |
+
}
|
9079 |
+
}
|
9080 |
+
}, {
|
9081 |
+
key: "queueBlurCheck",
|
9082 |
+
value: function queueBlurCheck(event) {
|
9083 |
+
var _this2 = this;
|
9084 |
|
9085 |
+
// React does not allow using an event reference asynchronously
|
9086 |
+
// due to recycling behavior, except when explicitly persisted.
|
9087 |
+
event.persist(); // Skip blur check if clicking button. See `normalizeButtonFocus`.
|
9088 |
|
9089 |
+
if (this.preventBlurCheck) {
|
9090 |
+
return;
|
9091 |
+
}
|
9092 |
|
9093 |
+
this.blurCheckTimeout = setTimeout(function () {
|
9094 |
+
// If document is not focused then focus should remain
|
9095 |
+
// inside the wrapped component and therefore we cancel
|
9096 |
+
// this blur event thereby leaving focus in place.
|
9097 |
+
// https://developer.mozilla.org/en-US/docs/Web/API/Document/hasFocus.
|
9098 |
+
if (!document.hasFocus()) {
|
9099 |
+
event.preventDefault();
|
9100 |
+
return;
|
9101 |
+
}
|
9102 |
|
9103 |
+
if ('function' === typeof _this2.node.handleFocusOutside) {
|
9104 |
+
_this2.node.handleFocusOutside(event);
|
9105 |
+
}
|
9106 |
+
}, 0);
|
9107 |
+
}
|
9108 |
+
}, {
|
9109 |
+
key: "cancelBlurCheck",
|
9110 |
+
value: function cancelBlurCheck() {
|
9111 |
+
clearTimeout(this.blurCheckTimeout);
|
9112 |
+
}
|
9113 |
+
/**
|
9114 |
+
* Handles a mousedown or mouseup event to respectively assign and
|
9115 |
+
* unassign a flag for preventing blur check on button elements. Some
|
9116 |
+
* browsers, namely Firefox and Safari, do not emit a focus event on
|
9117 |
+
* button elements when clicked, while others do. The logic here
|
9118 |
+
* intends to normalize this as treating click on buttons as focus.
|
9119 |
+
*
|
9120 |
+
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#Clicking_and_focus
|
9121 |
+
*
|
9122 |
+
* @param {MouseEvent} event Event for mousedown or mouseup.
|
9123 |
+
*/
|
9124 |
|
9125 |
+
}, {
|
9126 |
+
key: "normalizeButtonFocus",
|
9127 |
+
value: function normalizeButtonFocus(event) {
|
9128 |
+
var type = event.type,
|
9129 |
+
target = event.target;
|
9130 |
+
var isInteractionEnd = Object(lodash__WEBPACK_IMPORTED_MODULE_8__["includes"])(['mouseup', 'touchend'], type);
|
9131 |
|
9132 |
+
if (isInteractionEnd) {
|
9133 |
+
this.preventBlurCheck = false;
|
9134 |
+
} else if (isFocusNormalizedButton(target)) {
|
9135 |
+
this.preventBlurCheck = true;
|
9136 |
+
}
|
9137 |
+
}
|
9138 |
+
}, {
|
9139 |
+
key: "render",
|
9140 |
+
value: function render() {
|
9141 |
+
// Disable reason: See `normalizeButtonFocus` for browser-specific
|
9142 |
+
// focus event normalization.
|
9143 |
|
9144 |
+
/* eslint-disable jsx-a11y/no-static-element-interactions */
|
9145 |
+
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["createElement"])("div", {
|
9146 |
+
onFocus: this.cancelBlurCheck,
|
9147 |
+
onMouseDown: this.normalizeButtonFocus,
|
9148 |
+
onMouseUp: this.normalizeButtonFocus,
|
9149 |
+
onTouchStart: this.normalizeButtonFocus,
|
9150 |
+
onTouchEnd: this.normalizeButtonFocus,
|
9151 |
+
onBlur: this.queueBlurCheck
|
9152 |
+
}, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["createElement"])(WrappedComponent, Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])({
|
9153 |
+
ref: this.bindNode
|
9154 |
+
}, this.props)));
|
9155 |
+
/* eslint-enable jsx-a11y/no-static-element-interactions */
|
9156 |
+
}
|
9157 |
+
}]);
|
9158 |
|
9159 |
+
return _class;
|
9160 |
+
}(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["Component"]);
|
9161 |
+
}, 'withFocusOutside'));
|
9162 |
+
//# sourceMappingURL=index.js.map
|
9163 |
|
9164 |
+
/***/ }),
|
9165 |
+
/* 111 */
|
9166 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
9167 |
|
9168 |
+
"use strict";
|
9169 |
+
/* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(7);
|
9170 |
+
/* harmony import */ var _babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(11);
|
9171 |
+
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(0);
|
9172 |
+
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__);
|
9173 |
|
|
|
9174 |
|
|
|
|
|
9175 |
|
|
|
|
|
9176 |
|
9177 |
+
/**
|
9178 |
+
* WordPress dependencies
|
9179 |
+
*/
|
9180 |
|
|
|
|
|
9181 |
|
9182 |
+
function stopPropagation(event) {
|
9183 |
+
event.stopPropagation();
|
9184 |
+
}
|
9185 |
|
9186 |
+
/* harmony default export */ __webpack_exports__["a"] = (Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["forwardRef"])(function (_ref, ref) {
|
9187 |
+
var children = _ref.children,
|
9188 |
+
props = Object(_babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"])(_ref, ["children"]);
|
9189 |
|
9190 |
+
// Disable reason: this stops certain events from propagating outside of the component.
|
9191 |
+
// - onMouseDown is disabled as this can cause interactions with other DOM elements
|
9192 |
|
9193 |
+
/* eslint-disable jsx-a11y/no-static-element-interactions */
|
9194 |
+
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["createElement"])("div", Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])({}, props, {
|
9195 |
+
ref: ref,
|
9196 |
+
onMouseDown: stopPropagation
|
9197 |
+
}), children);
|
9198 |
+
/* eslint-enable jsx-a11y/no-static-element-interactions */
|
9199 |
+
}));
|
9200 |
+
//# sourceMappingURL=index.js.map
|
9201 |
|
9202 |
+
/***/ }),
|
9203 |
+
/* 112 */,
|
9204 |
+
/* 113 */
|
9205 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
9206 |
|
9207 |
+
"use strict";
|
|
|
9208 |
|
9209 |
+
// UNUSED EXPORTS: Provider
|
|
|
9210 |
|
9211 |
+
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js + 3 modules
|
9212 |
+
var toConsumableArray = __webpack_require__(26);
|
9213 |
|
9214 |
+
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/classCallCheck.js
|
9215 |
+
var classCallCheck = __webpack_require__(16);
|
9216 |
|
9217 |
+
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/createClass.js
|
9218 |
+
var createClass = __webpack_require__(17);
|
9219 |
|
9220 |
+
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/inherits.js + 1 modules
|
9221 |
+
var inherits = __webpack_require__(18);
|
9222 |
|
9223 |
+
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js
|
9224 |
+
var possibleConstructorReturn = __webpack_require__(21);
|
9225 |
|
9226 |
+
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js
|
9227 |
+
var getPrototypeOf = __webpack_require__(9);
|
9228 |
|
9229 |
+
// EXTERNAL MODULE: external {"this":["wp","element"]}
|
9230 |
+
var external_this_wp_element_ = __webpack_require__(0);
|
9231 |
|
9232 |
+
// EXTERNAL MODULE: external "lodash"
|
9233 |
+
var external_lodash_ = __webpack_require__(2);
|
9234 |
|
9235 |
+
// EXTERNAL MODULE: ./node_modules/@wordpress/compose/build-module/utils/create-higher-order-component/index.js
|
9236 |
+
var create_higher_order_component = __webpack_require__(77);
|
9237 |
|
9238 |
+
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js
|
9239 |
+
var assertThisInitialized = __webpack_require__(12);
|
9240 |
|
9241 |
+
// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/higher-order/with-focus-return/context.js
|
|
|
|
|
9242 |
|
9243 |
|
9244 |
|
9246 |
|
9247 |
|
9248 |
|
|
|
|
|
|
|
9249 |
|
9250 |
|
9251 |
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = Object(getPrototypeOf["a" /* default */])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = Object(getPrototypeOf["a" /* default */])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return Object(possibleConstructorReturn["a" /* default */])(this, result); }; }
|
9252 |
|
9253 |
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9254 |
|
9255 |
+
/**
|
9256 |
+
* External dependencies
|
9257 |
+
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9258 |
|
9259 |
+
/**
|
9260 |
+
* WordPress dependencies
|
9261 |
+
*/
|
9262 |
|
|
|
|
|
|
|
|
|
|
|
9263 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9264 |
|
9265 |
+
var _createContext = Object(external_this_wp_element_["createContext"])({
|
9266 |
+
focusHistory: []
|
9267 |
+
}),
|
9268 |
+
Provider = _createContext.Provider,
|
9269 |
+
Consumer = _createContext.Consumer;
|
|
|
|
|
9270 |
|
9271 |
+
Provider.displayName = 'FocusReturnProvider';
|
9272 |
+
Consumer.displayName = 'FocusReturnConsumer';
|
9273 |
+
/**
|
9274 |
+
* The maximum history length to capture for the focus stack. When exceeded,
|
9275 |
+
* items should be shifted from the stack for each consecutive push.
|
9276 |
+
*
|
9277 |
+
* @type {number}
|
9278 |
+
*/
|
9279 |
|
9280 |
+
var MAX_STACK_LENGTH = 100;
|
9281 |
|
9282 |
+
var context_FocusReturnProvider = /*#__PURE__*/function (_Component) {
|
9283 |
+
Object(inherits["a" /* default */])(FocusReturnProvider, _Component);
|
9284 |
|
9285 |
+
var _super = _createSuper(FocusReturnProvider);
|
|
|
9286 |
|
9287 |
+
function FocusReturnProvider() {
|
9288 |
+
var _this;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9289 |
|
9290 |
+
Object(classCallCheck["a" /* default */])(this, FocusReturnProvider);
|
|
|
|
|
|
|
|
|
9291 |
|
9292 |
+
_this = _super.apply(this, arguments);
|
9293 |
+
_this.onFocus = _this.onFocus.bind(Object(assertThisInitialized["a" /* default */])(_this));
|
9294 |
+
_this.state = {
|
9295 |
+
focusHistory: []
|
9296 |
+
};
|
9297 |
+
return _this;
|
9298 |
+
}
|
9299 |
+
|
9300 |
+
Object(createClass["a" /* default */])(FocusReturnProvider, [{
|
9301 |
+
key: "onFocus",
|
9302 |
+
value: function onFocus(event) {
|
9303 |
+
var focusHistory = this.state.focusHistory; // Push the focused element to the history stack, keeping only unique
|
9304 |
+
// members but preferring the _last_ occurrence of any duplicates.
|
9305 |
+
// Lodash's `uniq` behavior favors the first occurrence, so the array
|
9306 |
+
// is temporarily reversed prior to it being called upon. Uniqueness
|
9307 |
+
// helps avoid situations where, such as in a constrained tabbing area,
|
9308 |
+
// the user changes focus enough within a transient element that the
|
9309 |
+
// stack may otherwise only consist of members pending destruction, at
|
9310 |
+
// which point focus might have been lost.
|
9311 |
+
|
9312 |
+
var nextFocusHistory = Object(external_lodash_["uniq"])([].concat(Object(toConsumableArray["a" /* default */])(focusHistory), [event.target]).slice(-1 * MAX_STACK_LENGTH).reverse()).reverse();
|
9313 |
+
this.setState({
|
9314 |
+
focusHistory: nextFocusHistory
|
9315 |
+
});
|
9316 |
}
|
9317 |
}, {
|
9318 |
key: "render",
|
9319 |
value: function render() {
|
9320 |
var _this$props = this.props,
|
9321 |
+
children = _this$props.children,
|
9322 |
+
className = _this$props.className;
|
9323 |
+
return Object(external_this_wp_element_["createElement"])(Provider, {
|
9324 |
+
value: this.state
|
9325 |
+
}, Object(external_this_wp_element_["createElement"])("div", {
|
9326 |
+
onFocus: this.onFocus,
|
9327 |
+
className: className
|
9328 |
+
}, children));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9329 |
}
|
9330 |
}]);
|
9331 |
|
9332 |
+
return FocusReturnProvider;
|
9333 |
}(external_this_wp_element_["Component"]);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9334 |
|
9335 |
+
/* harmony default export */ var with_focus_return_context = (context_FocusReturnProvider);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9336 |
|
9337 |
+
//# sourceMappingURL=context.js.map
|
9338 |
+
// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/higher-order/with-focus-return/index.js
|
9339 |
|
|
|
|
|
|
|
|
|
|
|
|
|
9340 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9341 |
|
9342 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9343 |
|
|
|
|
|
9344 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9345 |
|
|
|
|
|
|
|
|
|
|
|
|
|
9346 |
|
9347 |
+
function with_focus_return_createSuper(Derived) { var hasNativeReflectConstruct = with_focus_return_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = Object(getPrototypeOf["a" /* default */])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = Object(getPrototypeOf["a" /* default */])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return Object(possibleConstructorReturn["a" /* default */])(this, result); }; }
|
|
|
9348 |
|
9349 |
+
function with_focus_return_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
|
|
|
9350 |
|
9351 |
+
/**
|
9352 |
+
* External dependencies
|
9353 |
+
*/
|
9354 |
|
9355 |
+
/**
|
9356 |
+
* WordPress dependencies
|
9357 |
+
*/
|
9358 |
|
|
|
|
|
|
|
9359 |
|
|
|
|
|
9360 |
|
9361 |
+
/**
|
9362 |
+
* Internal dependencies
|
9363 |
+
*/
|
9364 |
|
|
|
|
|
9365 |
|
9366 |
+
/**
|
9367 |
+
* Returns true if the given object is component-like. An object is component-
|
9368 |
+
* like if it is an instance of wp.element.Component, or is a function.
|
9369 |
+
*
|
9370 |
+
* @param {*} object Object to test.
|
9371 |
+
*
|
9372 |
+
* @return {boolean} Whether object is component-like.
|
9373 |
+
*/
|
9374 |
+
|
9375 |
+
function isComponentLike(object) {
|
9376 |
+
return object instanceof external_this_wp_element_["Component"] || typeof object === 'function';
|
9377 |
+
}
|
9378 |
+
/**
|
9379 |
+
* Higher Order Component used to be used to wrap disposable elements like
|
9380 |
+
* sidebars, modals, dropdowns. When mounting the wrapped component, we track a
|
9381 |
+
* reference to the current active element so we know where to restore focus
|
9382 |
+
* when the component is unmounted.
|
9383 |
+
*
|
9384 |
+
* @param {(WPComponent|Object)} options The component to be enhanced with
|
9385 |
+
* focus return behavior, or an object
|
9386 |
+
* describing the component and the
|
9387 |
+
* focus return characteristics.
|
9388 |
+
*
|
9389 |
+
* @return {WPComponent} Component with the focus restauration behaviour.
|
9390 |
+
*/
|
9391 |
|
|
|
9392 |
|
9393 |
+
function withFocusReturn(options) {
|
9394 |
+
// Normalize as overloaded form `withFocusReturn( options )( Component )`
|
9395 |
+
// or as `withFocusReturn( Component )`.
|
9396 |
+
if (isComponentLike(options)) {
|
9397 |
+
var WrappedComponent = options;
|
9398 |
+
return withFocusReturn({})(WrappedComponent);
|
9399 |
+
}
|
9400 |
|
9401 |
+
var _options$onFocusRetur = options.onFocusReturn,
|
9402 |
+
onFocusReturn = _options$onFocusRetur === void 0 ? external_lodash_["stubTrue"] : _options$onFocusRetur;
|
9403 |
+
return function (WrappedComponent) {
|
9404 |
+
var FocusReturn = /*#__PURE__*/function (_Component) {
|
9405 |
+
Object(inherits["a" /* default */])(FocusReturn, _Component);
|
9406 |
|
9407 |
+
var _super = with_focus_return_createSuper(FocusReturn);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9408 |
|
9409 |
+
function FocusReturn() {
|
9410 |
+
var _this;
|
9411 |
|
9412 |
+
Object(classCallCheck["a" /* default */])(this, FocusReturn);
|
9413 |
|
9414 |
+
_this = _super.apply(this, arguments);
|
9415 |
+
_this.ownFocusedElements = new Set();
|
9416 |
+
_this.activeElementOnMount = document.activeElement;
|
9417 |
|
9418 |
+
_this.setIsFocusedFalse = function () {
|
9419 |
+
return _this.isFocused = false;
|
9420 |
+
};
|
9421 |
|
9422 |
+
_this.setIsFocusedTrue = function (event) {
|
9423 |
+
_this.ownFocusedElements.add(event.target);
|
9424 |
|
9425 |
+
_this.isFocused = true;
|
9426 |
+
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9427 |
|
9428 |
+
return _this;
|
9429 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9430 |
|
9431 |
+
Object(createClass["a" /* default */])(FocusReturn, [{
|
9432 |
+
key: "componentWillUnmount",
|
9433 |
+
value: function componentWillUnmount() {
|
9434 |
+
var activeElementOnMount = this.activeElementOnMount,
|
9435 |
+
isFocused = this.isFocused,
|
9436 |
+
ownFocusedElements = this.ownFocusedElements;
|
|
|
|
|
9437 |
|
9438 |
+
if (!isFocused) {
|
9439 |
+
return;
|
9440 |
+
} // Defer to the component's own explicit focus return behavior,
|
9441 |
+
// if specified. The function should return `false` to prevent
|
9442 |
+
// the default behavior otherwise occurring here. This allows
|
9443 |
+
// for support that the `onFocusReturn` decides to allow the
|
9444 |
+
// default behavior to occur under some conditions.
|
9445 |
|
9446 |
|
9447 |
+
if (onFocusReturn() === false) {
|
9448 |
+
return;
|
9449 |
+
}
|
9450 |
|
9451 |
+
var stack = [].concat(Object(toConsumableArray["a" /* default */])(external_lodash_["without"].apply(void 0, [this.props.focus.focusHistory].concat(Object(toConsumableArray["a" /* default */])(ownFocusedElements)))), [activeElementOnMount]);
|
9452 |
+
var candidate;
|
9453 |
|
9454 |
+
while (candidate = stack.pop()) {
|
9455 |
+
if (document.body.contains(candidate)) {
|
9456 |
+
candidate.focus();
|
9457 |
+
return;
|
9458 |
+
}
|
9459 |
+
}
|
9460 |
+
}
|
9461 |
+
}, {
|
9462 |
+
key: "render",
|
9463 |
+
value: function render() {
|
9464 |
+
return Object(external_this_wp_element_["createElement"])("div", {
|
9465 |
+
onFocus: this.setIsFocusedTrue,
|
9466 |
+
onBlur: this.setIsFocusedFalse
|
9467 |
+
}, Object(external_this_wp_element_["createElement"])(WrappedComponent, this.props.childProps));
|
9468 |
+
}
|
9469 |
+
}]);
|
9470 |
|
9471 |
+
return FocusReturn;
|
9472 |
+
}(external_this_wp_element_["Component"]);
|
9473 |
|
9474 |
+
return function (props) {
|
9475 |
+
return Object(external_this_wp_element_["createElement"])(Consumer, null, function (context) {
|
9476 |
+
return Object(external_this_wp_element_["createElement"])(FocusReturn, {
|
9477 |
+
childProps: props,
|
9478 |
+
focus: context
|
9479 |
+
});
|
9480 |
+
});
|
9481 |
+
};
|
9482 |
+
};
|
9483 |
+
}
|
9484 |
|
9485 |
+
/* harmony default export */ var with_focus_return = __webpack_exports__["a"] = (Object(create_higher_order_component["a" /* default */])(withFocusReturn, 'withFocusReturn'));
|
|
|
|
|
|
|
9486 |
|
9487 |
+
//# sourceMappingURL=index.js.map
|
9488 |
|
9489 |
+
/***/ }),
|
9490 |
+
/* 114 */
|
9491 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9492 |
|
9493 |
+
"use strict";
|
9494 |
+
/* harmony import */ var _babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6);
|
9495 |
+
/* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7);
|
9496 |
+
/* harmony import */ var _babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(11);
|
9497 |
+
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(0);
|
9498 |
+
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__);
|
9499 |
+
/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(78);
|
9500 |
+
/* harmony import */ var _dashicon__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(107);
|
9501 |
|
|
|
|
|
|
|
9502 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9503 |
|
|
|
|
|
|
|
|
|
9504 |
|
9505 |
+
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; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9506 |
|
9507 |
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
|
9508 |
|
9509 |
+
/**
|
9510 |
+
* WordPress dependencies
|
9511 |
+
*/
|
9512 |
|
9513 |
|
9514 |
/**
|
9515 |
+
* Internal dependencies
|
9516 |
*/
|
9517 |
|
9518 |
|
9519 |
|
9520 |
+
function Icon(_ref) {
|
9521 |
+
var _ref$icon = _ref.icon,
|
9522 |
+
icon = _ref$icon === void 0 ? null : _ref$icon,
|
9523 |
+
size = _ref.size,
|
9524 |
+
additionalProps = Object(_babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_2__[/* default */ "a"])(_ref, ["icon", "size"]);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9525 |
|
9526 |
+
// Dashicons should be 20x20 by default.
|
9527 |
+
var dashiconSize = size || 20;
|
|
|
9528 |
|
9529 |
+
if ('string' === typeof icon) {
|
9530 |
+
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__["createElement"])(_dashicon__WEBPACK_IMPORTED_MODULE_5__[/* default */ "a"], Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"])({
|
9531 |
+
icon: icon,
|
9532 |
+
size: dashiconSize
|
9533 |
+
}, additionalProps));
|
9534 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9535 |
|
9536 |
+
if (icon && _dashicon__WEBPACK_IMPORTED_MODULE_5__[/* default */ "a"] === icon.type) {
|
9537 |
+
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__["cloneElement"])(icon, _objectSpread({
|
9538 |
+
size: dashiconSize
|
9539 |
+
}, additionalProps));
|
9540 |
+
} // Icons should be 24x24 by default.
|
9541 |
|
|
|
|
|
9542 |
|
9543 |
+
var iconSize = size || 24;
|
|
|
9544 |
|
9545 |
+
if ('function' === typeof icon) {
|
9546 |
+
if (icon.prototype instanceof _wordpress_element__WEBPACK_IMPORTED_MODULE_3__["Component"]) {
|
9547 |
+
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__["createElement"])(icon, _objectSpread({
|
9548 |
+
size: iconSize
|
9549 |
+
}, additionalProps));
|
9550 |
+
}
|
9551 |
|
9552 |
+
return icon(_objectSpread({
|
9553 |
+
size: iconSize
|
9554 |
+
}, additionalProps));
|
9555 |
+
}
|
9556 |
|
9557 |
+
if (icon && (icon.type === 'svg' || icon.type === _wordpress_primitives__WEBPACK_IMPORTED_MODULE_4__[/* SVG */ "c"])) {
|
9558 |
+
var appliedProps = _objectSpread(_objectSpread({
|
9559 |
+
width: iconSize,
|
9560 |
+
height: iconSize
|
9561 |
+
}, icon.props), additionalProps);
|
9562 |
|
9563 |
+
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_4__[/* SVG */ "c"], appliedProps);
|
9564 |
+
}
|
9565 |
|
9566 |
+
if (Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__["isValidElement"])(icon)) {
|
9567 |
+
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__["cloneElement"])(icon, _objectSpread({
|
9568 |
+
size: iconSize
|
9569 |
+
}, additionalProps));
|
9570 |
+
}
|
9571 |
|
9572 |
+
return icon;
|
9573 |
+
}
|
9574 |
|
9575 |
+
/* harmony default export */ __webpack_exports__["a"] = (Icon);
|
9576 |
+
//# sourceMappingURL=index.js.map
|
|
|
9577 |
|
9578 |
+
/***/ }),
|
9579 |
+
/* 115 */
|
9580 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
9581 |
|
9582 |
+
"use strict";
|
9583 |
+
/* harmony import */ var _babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6);
|
9584 |
+
/* harmony import */ var _babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(24);
|
9585 |
+
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(4);
|
9586 |
+
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_2__);
|
9587 |
|
9588 |
|
9589 |
|
9590 |
/**
|
9591 |
+
* External dependencies
|
9592 |
*/
|
9593 |
|
9594 |
|
9595 |
+
function Animate(_ref) {
|
9596 |
+
var type = _ref.type,
|
9597 |
+
_ref$options = _ref.options,
|
9598 |
+
options = _ref$options === void 0 ? {} : _ref$options,
|
9599 |
+
children = _ref.children;
|
9600 |
|
9601 |
+
if (type === 'appear') {
|
9602 |
+
var _classnames;
|
9603 |
|
9604 |
+
var _options$origin = options.origin,
|
9605 |
+
origin = _options$origin === void 0 ? 'top' : _options$origin;
|
9606 |
|
9607 |
+
var _origin$split = origin.split(' '),
|
9608 |
+
_origin$split2 = Object(_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"])(_origin$split, 2),
|
9609 |
+
yAxis = _origin$split2[0],
|
9610 |
+
_origin$split2$ = _origin$split2[1],
|
9611 |
+
xAxis = _origin$split2$ === void 0 ? 'center' : _origin$split2$;
|
9612 |
|
9613 |
+
return children({
|
9614 |
+
className: classnames__WEBPACK_IMPORTED_MODULE_2___default()('components-animate__appear', (_classnames = {}, Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])(_classnames, 'is-from-' + xAxis, xAxis !== 'center'), Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])(_classnames, 'is-from-' + yAxis, yAxis !== 'middle'), _classnames))
|
9615 |
+
});
|
9616 |
}
|
9617 |
|
9618 |
+
if (type === 'slide-in') {
|
9619 |
+
var _options$origin2 = options.origin,
|
9620 |
+
_origin = _options$origin2 === void 0 ? 'left' : _options$origin2;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9621 |
|
9622 |
+
return children({
|
9623 |
+
className: classnames__WEBPACK_IMPORTED_MODULE_2___default()('components-animate__slide-in', 'is-from-' + _origin)
|
|
|
|
|
9624 |
});
|
9625 |
}
|
9626 |
|
9627 |
+
if (type === 'loading') {
|
9628 |
+
return children({
|
9629 |
+
className: classnames__WEBPACK_IMPORTED_MODULE_2___default()('components-animate__loading')
|
|
|
9630 |
});
|
9631 |
}
|
9632 |
|
9633 |
+
return children({});
|
9634 |
+
}
|
|
|
9635 |
|
9636 |
+
/* harmony default export */ __webpack_exports__["a"] = (Animate);
|
9637 |
+
//# sourceMappingURL=index.js.map
|
9638 |
|
9639 |
+
/***/ }),
|
9640 |
+
/* 116 */
|
9641 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
9642 |
|
9643 |
+
"use strict";
|
9644 |
+
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0);
|
9645 |
+
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
|
9646 |
+
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(2);
|
9647 |
+
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_1__);
|
9648 |
|
|
|
|
|
|
|
|
|
9649 |
|
9650 |
+
/**
|
9651 |
+
* External dependencies
|
9652 |
+
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
9653 |
|
|
|
|
|
9654 |
|
9655 |
+
function Shortcut(_ref) {
|
9656 |
+
var shortcut = _ref.shortcut,
|
9657 |
+
className = _ref.className;
|
|
|
9658 |
|
9659 |
+
if (!shortcut) {
|
9660 |
+
return null;
|
9661 |
+
}
|
|
|
|
|
|
|
9662 |
|
9663 |
+
var displayText;
|
9664 |
+
var ariaLabel;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9665 |
|
9666 |
+
if (Object(lodash__WEBPACK_IMPORTED_MODULE_1__["isString"])(shortcut)) {
|
9667 |
+
displayText = shortcut;
|
9668 |
+
}
|
|
|
|
|
|
|
9669 |
|
9670 |
+
if (Object(lodash__WEBPACK_IMPORTED_MODULE_1__["isObject"])(shortcut)) {
|
9671 |
+
displayText = shortcut.display;
|
9672 |
+
ariaLabel = shortcut.ariaLabel;
|
9673 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9674 |
|
9675 |
+
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("span", {
|
9676 |
+
className: className,
|
9677 |
+
"aria-label": ariaLabel
|
9678 |
+
}, displayText);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9679 |
}
|
9680 |
|
9681 |
+
/* harmony default export */ __webpack_exports__["a"] = (Shortcut);
|
9682 |
//# sourceMappingURL=index.js.map
|
|
|
|
|
9683 |
|
9684 |
+
/***/ }),
|
9685 |
+
/* 117 */
|
9686 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
9687 |
|
9688 |
+
"use strict";
|
9689 |
|
9690 |
+
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/extends.js
|
9691 |
+
var esm_extends = __webpack_require__(7);
|
|
|
9692 |
|
9693 |
+
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/slicedToArray.js + 3 modules
|
9694 |
+
var slicedToArray = __webpack_require__(24);
|
9695 |
+
|
9696 |
+
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js
|
9697 |
+
var objectWithoutProperties = __webpack_require__(11);
|
9698 |
|
9699 |
+
// EXTERNAL MODULE: external {"this":["wp","element"]}
|
9700 |
+
var external_this_wp_element_ = __webpack_require__(0);
|
9701 |
|
9702 |
+
// EXTERNAL MODULE: ./node_modules/classnames/index.js
|
9703 |
+
var classnames = __webpack_require__(4);
|
9704 |
+
var classnames_default = /*#__PURE__*/__webpack_require__.n(classnames);
|
9705 |
|
9706 |
+
// EXTERNAL MODULE: ./node_modules/@wordpress/components/node_modules/@wordpress/dom/build-module/dom.js
|
9707 |
+
var dom = __webpack_require__(129);
|
|
|
|
|
|
|
|
|
9708 |
|
9709 |
+
// EXTERNAL MODULE: ./node_modules/@wordpress/components/node_modules/@wordpress/dom/build-module/index.js + 2 modules
|
9710 |
+
var build_module = __webpack_require__(68);
|
|
|
9711 |
|
9712 |
+
// EXTERNAL MODULE: ./node_modules/@wordpress/components/node_modules/@wordpress/keycodes/build-module/index.js + 1 modules
|
9713 |
+
var keycodes_build_module = __webpack_require__(57);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9714 |
|
9715 |
+
// EXTERNAL MODULE: ./node_modules/@wordpress/deprecated/build-module/index.js
|
9716 |
+
var deprecated_build_module = __webpack_require__(47);
|
9717 |
|
9718 |
+
// EXTERNAL MODULE: ./node_modules/@wordpress/compose/build-module/hooks/use-viewport-match/index.js
|
9719 |
+
var use_viewport_match = __webpack_require__(180);
|
9720 |
|
9721 |
+
// EXTERNAL MODULE: ./node_modules/@wordpress/compose/build-module/hooks/use-resize-observer/index.js
|
9722 |
+
var use_resize_observer = __webpack_require__(207);
|
9723 |
|
9724 |
+
// EXTERNAL MODULE: ./node_modules/@wordpress/components/node_modules/@wordpress/icons/build-module/library/close.js
|
9725 |
+
var library_close = __webpack_require__(257);
|
9726 |
|
9727 |
+
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/defineProperty.js
|
9728 |
+
var defineProperty = __webpack_require__(6);
|
9729 |
|
9730 |
+
// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/popover/utils.js
|
9731 |
|
9732 |
|
|
|
|
|
|
|
9733 |
|
9734 |
+
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; }
|
9735 |
+
|
9736 |
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { Object(defineProperty["a" /* default */])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
9737 |
|
9738 |
/**
|
9739 |
* WordPress dependencies
|
9740 |
*/
|
9741 |
|
|
|
9742 |
/**
|
9743 |
+
* Module constants
|
9744 |
*/
|
9745 |
|
9746 |
+
var HEIGHT_OFFSET = 10; // used by the arrow and a bit of empty space
|
|
|
9747 |
|
9748 |
/**
|
9749 |
+
* Utility used to compute the popover position over the xAxis
|
9750 |
*
|
9751 |
+
* @param {Object} anchorRect Anchor Rect.
|
9752 |
+
* @param {Object} contentSize Content Size.
|
9753 |
+
* @param {string} xAxis Desired xAxis.
|
9754 |
+
* @param {string} corner Desired corner.
|
9755 |
+
* @param {boolean} sticky Whether or not to stick the popover to the
|
9756 |
+
* scroll container edge when part of the anchor
|
9757 |
+
* leaves view.
|
9758 |
+
* @param {string} chosenYAxis yAxis to be used.
|
9759 |
+
* @param {Element} boundaryElement Boundary element.
|
9760 |
*
|
9761 |
+
* @return {Object} Popover xAxis position and constraints.
|
9762 |
*/
|
9763 |
|
9764 |
+
function computePopoverXAxisPosition(anchorRect, contentSize, xAxis, corner, sticky, chosenYAxis, boundaryElement) {
|
9765 |
+
var width = contentSize.width;
|
9766 |
+
var isRTL = document.documentElement.dir === 'rtl'; // Correct xAxis for RTL support
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9767 |
|
9768 |
+
if (xAxis === 'left' && isRTL) {
|
9769 |
+
xAxis = 'right';
|
9770 |
+
} else if (xAxis === 'right' && isRTL) {
|
9771 |
+
xAxis = 'left';
|
9772 |
+
}
|
9773 |
|
9774 |
+
if (corner === 'left' && isRTL) {
|
9775 |
+
corner = 'right';
|
9776 |
+
} else if (corner === 'right' && isRTL) {
|
9777 |
+
corner = 'left';
|
9778 |
+
} // x axis alignment choices
|
9779 |
+
|
9780 |
+
|
9781 |
+
var anchorMidPoint = Math.round(anchorRect.left + anchorRect.width / 2);
|
9782 |
+
var centerAlignment = {
|
9783 |
+
popoverLeft: anchorMidPoint,
|
9784 |
+
contentWidth: (anchorMidPoint - width / 2 > 0 ? width / 2 : anchorMidPoint) + (anchorMidPoint + width / 2 > window.innerWidth ? window.innerWidth - anchorMidPoint : width / 2)
|
9785 |
+
};
|
9786 |
+
var leftAlignmentX = anchorRect.left;
|
9787 |
+
|
9788 |
+
if (corner === 'right') {
|
9789 |
+
leftAlignmentX = anchorRect.right;
|
9790 |
+
} else if (chosenYAxis !== 'middle') {
|
9791 |
+
leftAlignmentX = anchorMidPoint;
|
9792 |
}
|
9793 |
|
9794 |
+
var rightAlignmentX = anchorRect.right;
|
9795 |
+
|
9796 |
+
if (corner === 'left') {
|
9797 |
+
rightAlignmentX = anchorRect.left;
|
9798 |
+
} else if (chosenYAxis !== 'middle') {
|
9799 |
+
rightAlignmentX = anchorMidPoint;
|
9800 |
}
|
9801 |
|
9802 |
+
var leftAlignment = {
|
9803 |
+
popoverLeft: leftAlignmentX,
|
9804 |
+
contentWidth: leftAlignmentX - width > 0 ? width : leftAlignmentX
|
9805 |
+
};
|
9806 |
+
var rightAlignment = {
|
9807 |
+
popoverLeft: rightAlignmentX,
|
9808 |
+
contentWidth: rightAlignmentX + width > window.innerWidth ? window.innerWidth - rightAlignmentX : width
|
9809 |
+
}; // Choosing the x axis
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9810 |
|
9811 |
+
var chosenXAxis = xAxis;
|
9812 |
+
var contentWidth = null;
|
9813 |
|
9814 |
+
if (!sticky) {
|
9815 |
+
if (xAxis === 'center' && centerAlignment.contentWidth === width) {
|
9816 |
+
chosenXAxis = 'center';
|
9817 |
+
} else if (xAxis === 'left' && leftAlignment.contentWidth === width) {
|
9818 |
+
chosenXAxis = 'left';
|
9819 |
+
} else if (xAxis === 'right' && rightAlignment.contentWidth === width) {
|
9820 |
+
chosenXAxis = 'right';
|
9821 |
+
} else {
|
9822 |
+
chosenXAxis = leftAlignment.contentWidth > rightAlignment.contentWidth ? 'left' : 'right';
|
9823 |
+
var chosenWidth = chosenXAxis === 'left' ? leftAlignment.contentWidth : rightAlignment.contentWidth;
|
9824 |
+
contentWidth = chosenWidth !== width ? chosenWidth : null;
|
9825 |
+
}
|
9826 |
+
}
|
9827 |
|
9828 |
+
var popoverLeft;
|
9829 |
+
|
9830 |
+
if (chosenXAxis === 'center') {
|
9831 |
+
popoverLeft = centerAlignment.popoverLeft;
|
9832 |
+
} else if (chosenXAxis === 'left') {
|
9833 |
+
popoverLeft = leftAlignment.popoverLeft;
|
9834 |
+
} else {
|
9835 |
+
popoverLeft = rightAlignment.popoverLeft;
|
9836 |
+
}
|
9837 |
|
9838 |
+
if (boundaryElement) {
|
9839 |
+
var boundaryRect = boundaryElement.getBoundingClientRect();
|
9840 |
+
popoverLeft = Math.min(popoverLeft, boundaryRect.right - width);
|
9841 |
+
}
|
9842 |
|
9843 |
+
return {
|
9844 |
+
xAxis: chosenXAxis,
|
9845 |
+
popoverLeft: popoverLeft,
|
9846 |
+
contentWidth: contentWidth
|
9847 |
+
};
|
9848 |
+
}
|
9849 |
/**
|
9850 |
+
* Utility used to compute the popover position over the yAxis
|
9851 |
+
*
|
9852 |
+
* @param {Object} anchorRect Anchor Rect.
|
9853 |
+
* @param {Object} contentSize Content Size.
|
9854 |
+
* @param {string} yAxis Desired yAxis.
|
9855 |
+
* @param {string} corner Desired corner.
|
9856 |
+
* @param {boolean} sticky Whether or not to stick the popover to the
|
9857 |
+
* scroll container edge when part of the
|
9858 |
+
* anchor leaves view.
|
9859 |
+
* @param {Element} anchorRef The anchor element.
|
9860 |
+
* @param {Element} relativeOffsetTop If applicable, top offset of the relative
|
9861 |
+
* positioned parent container.
|
9862 |
+
*
|
9863 |
+
* @return {Object} Popover xAxis position and constraints.
|
9864 |
*/
|
9865 |
|
9866 |
+
function computePopoverYAxisPosition(anchorRect, contentSize, yAxis, corner, sticky, anchorRef, relativeOffsetTop) {
|
9867 |
+
var height = contentSize.height;
|
9868 |
|
9869 |
+
if (sticky) {
|
9870 |
+
var scrollContainerEl = Object(dom["b" /* getScrollContainer */])(anchorRef) || document.body;
|
9871 |
+
var scrollRect = scrollContainerEl.getBoundingClientRect();
|
9872 |
+
var stickyPosition = scrollRect.top + height - relativeOffsetTop;
|
9873 |
+
|
9874 |
+
if (anchorRect.top <= stickyPosition) {
|
9875 |
+
return {
|
9876 |
+
yAxis: yAxis,
|
9877 |
+
popoverTop: Math.min(anchorRect.bottom, stickyPosition)
|
9878 |
+
};
|
9879 |
+
}
|
9880 |
+
} // y axis alignment choices
|
9881 |
+
|
9882 |
+
|
9883 |
+
var anchorMidPoint = anchorRect.top + anchorRect.height / 2;
|
9884 |
+
|
9885 |
+
if (corner === 'bottom') {
|
9886 |
+
anchorMidPoint = anchorRect.bottom;
|
9887 |
+
} else if (corner === 'top') {
|
9888 |
+
anchorMidPoint = anchorRect.top;
|
9889 |
+
}
|
9890 |
+
|
9891 |
+
var middleAlignment = {
|
9892 |
+
popoverTop: anchorMidPoint,
|
9893 |
+
contentHeight: (anchorMidPoint - height / 2 > 0 ? height / 2 : anchorMidPoint) + (anchorMidPoint + height / 2 > window.innerHeight ? window.innerHeight - anchorMidPoint : height / 2)
|
9894 |
+
};
|
9895 |
+
var topAlignment = {
|
9896 |
+
popoverTop: anchorRect.top,
|
9897 |
+
contentHeight: anchorRect.top - HEIGHT_OFFSET - height > 0 ? height : anchorRect.top - HEIGHT_OFFSET
|
9898 |
+
};
|
9899 |
+
var bottomAlignment = {
|
9900 |
+
popoverTop: anchorRect.bottom,
|
9901 |
+
contentHeight: anchorRect.bottom + HEIGHT_OFFSET + height > window.innerHeight ? window.innerHeight - HEIGHT_OFFSET - anchorRect.bottom : height
|
9902 |
+
}; // Choosing the y axis
|
9903 |
+
|
9904 |
+
var chosenYAxis = yAxis;
|
9905 |
+
var contentHeight = null;
|
9906 |
+
|
9907 |
+
if (!sticky) {
|
9908 |
+
if (yAxis === 'middle' && middleAlignment.contentHeight === height) {
|
9909 |
+
chosenYAxis = 'middle';
|
9910 |
+
} else if (yAxis === 'top' && topAlignment.contentHeight === height) {
|
9911 |
+
chosenYAxis = 'top';
|
9912 |
+
} else if (yAxis === 'bottom' && bottomAlignment.contentHeight === height) {
|
9913 |
+
chosenYAxis = 'bottom';
|
9914 |
+
} else {
|
9915 |
+
chosenYAxis = topAlignment.contentHeight > bottomAlignment.contentHeight ? 'top' : 'bottom';
|
9916 |
+
var chosenHeight = chosenYAxis === 'top' ? topAlignment.contentHeight : bottomAlignment.contentHeight;
|
9917 |
+
contentHeight = chosenHeight !== height ? chosenHeight : null;
|
9918 |
+
}
|
9919 |
+
}
|
9920 |
+
|
9921 |
+
var popoverTop;
|
9922 |
|
9923 |
+
if (chosenYAxis === 'middle') {
|
9924 |
+
popoverTop = middleAlignment.popoverTop;
|
9925 |
+
} else if (chosenYAxis === 'top') {
|
9926 |
+
popoverTop = topAlignment.popoverTop;
|
9927 |
+
} else {
|
9928 |
+
popoverTop = bottomAlignment.popoverTop;
|
9929 |
+
}
|
9930 |
|
9931 |
+
return {
|
9932 |
+
yAxis: chosenYAxis,
|
9933 |
+
popoverTop: popoverTop,
|
9934 |
+
contentHeight: contentHeight
|
9935 |
+
};
|
9936 |
+
}
|
9937 |
/**
|
9938 |
+
* Utility used to compute the popover position and the content max width/height
|
9939 |
+
* for a popover given its anchor rect and its content size.
|
9940 |
+
*
|
9941 |
+
* @param {Object} anchorRect Anchor Rect.
|
9942 |
+
* @param {Object} contentSize Content Size.
|
9943 |
+
* @param {string} position Position.
|
9944 |
+
* @param {boolean} sticky Whether or not to stick the popover to the
|
9945 |
+
* scroll container edge when part of the
|
9946 |
+
* anchor leaves view.
|
9947 |
+
* @param {Element} anchorRef The anchor element.
|
9948 |
+
* @param {number} relativeOffsetTop If applicable, top offset of the relative
|
9949 |
+
* positioned parent container.
|
9950 |
+
* @param {Element} boundaryElement Boundary element.
|
9951 |
+
*
|
9952 |
+
* @return {Object} Popover position and constraints.
|
9953 |
*/
|
9954 |
|
9955 |
+
function computePopoverPosition(anchorRect, contentSize) {
|
9956 |
+
var position = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'top';
|
9957 |
+
var sticky = arguments.length > 3 ? arguments[3] : undefined;
|
9958 |
+
var anchorRef = arguments.length > 4 ? arguments[4] : undefined;
|
9959 |
+
var relativeOffsetTop = arguments.length > 5 ? arguments[5] : undefined;
|
9960 |
+
var boundaryElement = arguments.length > 6 ? arguments[6] : undefined;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9961 |
|
9962 |
+
var _position$split = position.split(' '),
|
9963 |
+
_position$split2 = Object(slicedToArray["a" /* default */])(_position$split, 3),
|
9964 |
+
yAxis = _position$split2[0],
|
9965 |
+
_position$split2$ = _position$split2[1],
|
9966 |
+
xAxis = _position$split2$ === void 0 ? 'center' : _position$split2$,
|
9967 |
+
corner = _position$split2[2];
|
9968 |
|
9969 |
+
var yAxisPosition = computePopoverYAxisPosition(anchorRect, contentSize, yAxis, corner, sticky, anchorRef, relativeOffsetTop);
|
9970 |
+
var xAxisPosition = computePopoverXAxisPosition(anchorRect, contentSize, xAxis, corner, sticky, yAxisPosition.yAxis, boundaryElement);
|
9971 |
+
return _objectSpread(_objectSpread({}, xAxisPosition), yAxisPosition);
|
9972 |
+
}
|
9973 |
+
//# sourceMappingURL=utils.js.map
|
9974 |
+
// EXTERNAL MODULE: ./node_modules/@wordpress/components/build-module/higher-order/with-focus-return/index.js + 1 modules
|
9975 |
+
var with_focus_return = __webpack_require__(113);
|
9976 |
|
9977 |
+
// EXTERNAL MODULE: ./node_modules/@wordpress/components/build-module/higher-order/with-constrained-tabbing/index.js
|
9978 |
+
var with_constrained_tabbing = __webpack_require__(109);
|
9979 |
|
9980 |
+
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/classCallCheck.js
|
9981 |
+
var classCallCheck = __webpack_require__(16);
|
9982 |
|
9983 |
+
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/createClass.js
|
9984 |
+
var createClass = __webpack_require__(17);
|
9985 |
|
9986 |
+
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/inherits.js + 1 modules
|
9987 |
+
var inherits = __webpack_require__(18);
|
9988 |
|
9989 |
+
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js
|
9990 |
+
var possibleConstructorReturn = __webpack_require__(21);
|
|
|
9991 |
|
9992 |
+
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js
|
9993 |
+
var getPrototypeOf = __webpack_require__(9);
|
9994 |
|
9995 |
+
// EXTERNAL MODULE: ./node_modules/@wordpress/components/build-module/higher-order/with-focus-outside/index.js
|
9996 |
+
var with_focus_outside = __webpack_require__(110);
|
9997 |
|
9998 |
+
// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/popover/detect-outside.js
|
9999 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10000 |
|
|
|
|
|
10001 |
|
|
|
|
|
|
|
10002 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10003 |
|
10004 |
|
10005 |
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = Object(getPrototypeOf["a" /* default */])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = Object(getPrototypeOf["a" /* default */])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return Object(possibleConstructorReturn["a" /* default */])(this, result); }; }
|
10006 |
|
10007 |
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
|
10008 |
|
10009 |
/**
|
10010 |
+
* WordPress dependencies
|
10011 |
*/
|
10012 |
|
|
|
|
|
10013 |
/**
|
10014 |
* Internal dependencies
|
10015 |
*/
|
10016 |
|
10017 |
|
10018 |
|
10019 |
+
var detect_outside_PopoverDetectOutside = /*#__PURE__*/function (_Component) {
|
10020 |
+
Object(inherits["a" /* default */])(PopoverDetectOutside, _Component);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10021 |
|
10022 |
+
var _super = _createSuper(PopoverDetectOutside);
|
10023 |
|
10024 |
+
function PopoverDetectOutside() {
|
10025 |
+
Object(classCallCheck["a" /* default */])(this, PopoverDetectOutside);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10026 |
|
10027 |
+
return _super.apply(this, arguments);
|
10028 |
+
}
|
|
|
|
|
|
|
10029 |
|
10030 |
+
Object(createClass["a" /* default */])(PopoverDetectOutside, [{
|
10031 |
+
key: "handleFocusOutside",
|
10032 |
+
value: function handleFocusOutside(event) {
|
10033 |
+
this.props.onFocusOutside(event);
|
10034 |
+
}
|
10035 |
+
}, {
|
10036 |
+
key: "render",
|
10037 |
+
value: function render() {
|
10038 |
+
return this.props.children;
|
10039 |
+
}
|
10040 |
+
}]);
|
10041 |
|
10042 |
+
return PopoverDetectOutside;
|
10043 |
+
}(external_this_wp_element_["Component"]);
|
|
|
|
|
|
|
|
|
10044 |
|
10045 |
+
/* harmony default export */ var detect_outside = (Object(with_focus_outside["a" /* default */])(detect_outside_PopoverDetectOutside));
|
10046 |
+
//# sourceMappingURL=detect-outside.js.map
|
10047 |
+
// EXTERNAL MODULE: ./node_modules/@wordpress/components/build-module/button/index.js
|
10048 |
+
var build_module_button = __webpack_require__(67);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10049 |
|
10050 |
+
// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/scroll-lock/index.js
|
10051 |
|
10052 |
|
10053 |
|
10054 |
|
10055 |
|
10056 |
|
10057 |
+
function scroll_lock_createSuper(Derived) { var hasNativeReflectConstruct = scroll_lock_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = Object(getPrototypeOf["a" /* default */])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = Object(getPrototypeOf["a" /* default */])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return Object(possibleConstructorReturn["a" /* default */])(this, result); }; }
|
10058 |
|
10059 |
+
function scroll_lock_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
|
10060 |
|
10061 |
+
/**
|
10062 |
+
* WordPress dependencies
|
10063 |
+
*/
|
10064 |
|
10065 |
/**
|
10066 |
+
* Creates a ScrollLock component bound to the specified document.
|
10067 |
+
*
|
10068 |
+
* This function creates a ScrollLock component for the specified document
|
10069 |
+
* and is exposed so we can create an isolated component for unit testing.
|
10070 |
+
*
|
10071 |
+
* @param {Object} args Keyword args.
|
10072 |
+
* @param {HTMLDocument} args.htmlDocument The document to lock the scroll for.
|
10073 |
+
* @param {string} args.className The name of the class used to lock scrolling.
|
10074 |
+
* @return {WPComponent} The bound ScrollLock component.
|
10075 |
*/
|
10076 |
|
10077 |
+
function createScrollLockComponent() {
|
10078 |
+
var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
10079 |
+
_ref$htmlDocument = _ref.htmlDocument,
|
10080 |
+
htmlDocument = _ref$htmlDocument === void 0 ? document : _ref$htmlDocument,
|
10081 |
+
_ref$className = _ref.className,
|
10082 |
+
className = _ref$className === void 0 ? 'lockscroll' : _ref$className;
|
10083 |
+
|
10084 |
+
var lockCounter = 0;
|
10085 |
+
/*
|
10086 |
+
* Setting `overflow: hidden` on html and body elements resets body scroll in iOS.
|
10087 |
+
* Save scroll top so we can restore it after locking scroll.
|
10088 |
+
*
|
10089 |
+
* NOTE: It would be cleaner and possibly safer to find a localized solution such
|
10090 |
+
* as preventing default on certain touchmove events.
|
10091 |
+
*/
|
10092 |
+
|
10093 |
+
var previousScrollTop = 0;
|
10094 |
+
/**
|
10095 |
+
* Locks and unlocks scroll depending on the boolean argument.
|
10096 |
+
*
|
10097 |
+
* @param {boolean} locked Whether or not scroll should be locked.
|
10098 |
+
*/
|
10099 |
+
|
10100 |
+
function setLocked(locked) {
|
10101 |
+
var scrollingElement = htmlDocument.scrollingElement || htmlDocument.body;
|
10102 |
+
|
10103 |
+
if (locked) {
|
10104 |
+
previousScrollTop = scrollingElement.scrollTop;
|
10105 |
+
}
|
10106 |
+
|
10107 |
+
var methodName = locked ? 'add' : 'remove';
|
10108 |
+
scrollingElement.classList[methodName](className); // Adding the class to the document element seems to be necessary in iOS.
|
10109 |
+
|
10110 |
+
htmlDocument.documentElement.classList[methodName](className);
|
10111 |
|
10112 |
+
if (!locked) {
|
10113 |
+
scrollingElement.scrollTop = previousScrollTop;
|
10114 |
+
}
|
10115 |
+
}
|
10116 |
+
/**
|
10117 |
+
* Requests scroll lock.
|
10118 |
+
*
|
10119 |
+
* This function tracks requests for scroll lock. It locks scroll on the first
|
10120 |
+
* request and counts each request so `releaseLock` can unlock scroll when
|
10121 |
+
* all requests have been released.
|
10122 |
+
*/
|
10123 |
|
10124 |
|
10125 |
+
function requestLock() {
|
10126 |
+
if (lockCounter === 0) {
|
10127 |
+
setLocked(true);
|
10128 |
+
}
|
10129 |
|
10130 |
+
++lockCounter;
|
10131 |
+
}
|
10132 |
+
/**
|
10133 |
+
* Releases a request for scroll lock.
|
10134 |
+
*
|
10135 |
+
* This function tracks released requests for scroll lock. When all requests
|
10136 |
+
* have been released, it unlocks scroll.
|
10137 |
+
*/
|
10138 |
|
10139 |
|
10140 |
+
function releaseLock() {
|
10141 |
+
if (lockCounter === 1) {
|
10142 |
+
setLocked(false);
|
10143 |
+
}
|
10144 |
|
10145 |
+
--lockCounter;
|
10146 |
+
}
|
10147 |
|
10148 |
+
return /*#__PURE__*/function (_Component) {
|
10149 |
+
Object(inherits["a" /* default */])(ScrollLock, _Component);
|
10150 |
|
10151 |
+
var _super = scroll_lock_createSuper(ScrollLock);
|
10152 |
|
10153 |
+
function ScrollLock() {
|
10154 |
+
Object(classCallCheck["a" /* default */])(this, ScrollLock);
|
10155 |
|
10156 |
+
return _super.apply(this, arguments);
|
10157 |
+
}
|
10158 |
|
10159 |
+
Object(createClass["a" /* default */])(ScrollLock, [{
|
10160 |
+
key: "componentDidMount",
|
10161 |
|
10162 |
+
/**
|
10163 |
+
* Requests scroll lock on mount.
|
10164 |
+
*/
|
10165 |
+
value: function componentDidMount() {
|
10166 |
+
requestLock();
|
10167 |
+
}
|
10168 |
+
/**
|
10169 |
+
* Releases scroll lock before unmount.
|
10170 |
+
*/
|
10171 |
|
10172 |
+
}, {
|
10173 |
+
key: "componentWillUnmount",
|
10174 |
+
value: function componentWillUnmount() {
|
10175 |
+
releaseLock();
|
10176 |
+
}
|
10177 |
+
/**
|
10178 |
+
* Render nothing as this component is merely a way to declare scroll lock.
|
10179 |
+
*
|
10180 |
+
* @return {null} Render nothing by returning `null`.
|
10181 |
+
*/
|
10182 |
|
10183 |
+
}, {
|
10184 |
+
key: "render",
|
10185 |
+
value: function render() {
|
10186 |
+
return null;
|
10187 |
+
}
|
10188 |
+
}]);
|
10189 |
|
10190 |
+
return ScrollLock;
|
10191 |
+
}(external_this_wp_element_["Component"]);
|
10192 |
+
}
|
10193 |
+
/* harmony default export */ var scroll_lock = (createScrollLockComponent());
|
10194 |
+
//# sourceMappingURL=index.js.map
|
10195 |
+
// EXTERNAL MODULE: ./node_modules/@wordpress/components/build-module/isolated-event-container/index.js
|
10196 |
+
var isolated_event_container = __webpack_require__(111);
|
10197 |
|
10198 |
+
// EXTERNAL MODULE: ./node_modules/@wordpress/components/build-module/slot-fill/bubbles-virtually/use-slot.js
|
10199 |
+
var use_slot = __webpack_require__(71);
|
10200 |
|
10201 |
+
// EXTERNAL MODULE: ./node_modules/@wordpress/components/build-module/slot-fill/index.js + 4 modules
|
10202 |
+
var slot_fill = __webpack_require__(95);
|
10203 |
|
10204 |
+
// EXTERNAL MODULE: ./node_modules/@wordpress/components/build-module/animate/index.js
|
10205 |
+
var build_module_animate = __webpack_require__(115);
|
10206 |
|
10207 |
+
// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/popover/index.js
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10208 |
|
|
|
10209 |
|
|
|
|
|
10210 |
|
|
|
10211 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10212 |
|
10213 |
+
/**
|
10214 |
+
* External dependencies
|
10215 |
+
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10216 |
|
10217 |
+
/**
|
10218 |
+
* WordPress dependencies
|
10219 |
+
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10220 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10221 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10222 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10223 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10224 |
|
|
|
|
|
|
|
10225 |
|
|
|
|
|
10226 |
|
10227 |
+
/**
|
10228 |
+
* Internal dependencies
|
10229 |
+
*/
|
10230 |
+
|
10231 |
+
|
10232 |
+
|
10233 |
+
|
10234 |
+
|
10235 |
+
|
10236 |
|
|
|
|
|
|
|
|
|
10237 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10238 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10239 |
|
10240 |
+
var FocusManaged = Object(with_constrained_tabbing["a" /* default */])(Object(with_focus_return["a" /* default */])(function (_ref) {
|
10241 |
+
var children = _ref.children;
|
10242 |
+
return children;
|
10243 |
+
}));
|
10244 |
+
/**
|
10245 |
+
* Name of slot in which popover should fill.
|
10246 |
+
*
|
10247 |
+
* @type {string}
|
10248 |
+
*/
|
10249 |
|
10250 |
+
var SLOT_NAME = 'Popover';
|
|
|
|
|
10251 |
|
10252 |
+
function computeAnchorRect(anchorRefFallback, anchorRect, getAnchorRect) {
|
10253 |
+
var anchorRef = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
|
10254 |
+
var shouldAnchorIncludePadding = arguments.length > 4 ? arguments[4] : undefined;
|
10255 |
|
10256 |
+
if (anchorRect) {
|
10257 |
+
return anchorRect;
|
10258 |
+
}
|
10259 |
|
10260 |
+
if (getAnchorRect) {
|
10261 |
+
if (!anchorRefFallback.current) {
|
10262 |
+
return;
|
10263 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10264 |
|
10265 |
+
return getAnchorRect(anchorRefFallback.current);
|
10266 |
+
}
|
10267 |
|
10268 |
+
if (anchorRef !== false) {
|
10269 |
+
if (!anchorRef || !window.Range || !window.Element || !window.DOMRect) {
|
10270 |
+
return;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10271 |
}
|
10272 |
+
|
10273 |
+
if (anchorRef instanceof window.Range) {
|
10274 |
+
return Object(dom["a" /* getRectangleFromRange */])(anchorRef);
|
10275 |
+
}
|
10276 |
+
|
10277 |
+
if (anchorRef instanceof window.Element) {
|
10278 |
+
var _rect2 = anchorRef.getBoundingClientRect();
|
10279 |
+
|
10280 |
+
if (shouldAnchorIncludePadding) {
|
10281 |
+
return _rect2;
|
10282 |
}
|
10283 |
+
|
10284 |
+
return withoutPadding(_rect2, anchorRef);
|
10285 |
}
|
|
|
|
|
|
|
|
|
10286 |
|
10287 |
+
var top = anchorRef.top,
|
10288 |
+
bottom = anchorRef.bottom;
|
10289 |
+
var topRect = top.getBoundingClientRect();
|
10290 |
+
var bottomRect = bottom.getBoundingClientRect();
|
10291 |
+
|
10292 |
+
var _rect = new window.DOMRect(topRect.left, topRect.top, topRect.width, bottomRect.bottom - topRect.top);
|
10293 |
+
|
10294 |
+
if (shouldAnchorIncludePadding) {
|
10295 |
+
return _rect;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10296 |
}
|
|
|
10297 |
|
10298 |
+
return withoutPadding(_rect, anchorRef);
|
10299 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10300 |
|
10301 |
+
if (!anchorRefFallback.current) {
|
10302 |
+
return;
|
10303 |
+
}
|
10304 |
|
10305 |
+
var parentNode = anchorRefFallback.current.parentNode;
|
10306 |
+
var rect = parentNode.getBoundingClientRect();
|
10307 |
+
|
10308 |
+
if (shouldAnchorIncludePadding) {
|
10309 |
+
return rect;
|
10310 |
+
}
|
10311 |
+
|
10312 |
+
return withoutPadding(rect, parentNode);
|
10313 |
+
}
|
10314 |
+
|
10315 |
+
function getComputedStyle(node) {
|
10316 |
+
return node.ownerDocument.defaultView.getComputedStyle(node);
|
10317 |
+
}
|
10318 |
+
|
10319 |
+
function withoutPadding(rect, element) {
|
10320 |
+
var _getComputedStyle = getComputedStyle(element),
|
10321 |
+
paddingTop = _getComputedStyle.paddingTop,
|
10322 |
+
paddingBottom = _getComputedStyle.paddingBottom,
|
10323 |
+
paddingLeft = _getComputedStyle.paddingLeft,
|
10324 |
+
paddingRight = _getComputedStyle.paddingRight;
|
10325 |
+
|
10326 |
+
var top = paddingTop ? parseInt(paddingTop, 10) : 0;
|
10327 |
+
var bottom = paddingBottom ? parseInt(paddingBottom, 10) : 0;
|
10328 |
+
var left = paddingLeft ? parseInt(paddingLeft, 10) : 0;
|
10329 |
+
var right = paddingRight ? parseInt(paddingRight, 10) : 0;
|
10330 |
return {
|
10331 |
+
x: rect.left + left,
|
10332 |
+
y: rect.top + top,
|
10333 |
+
width: rect.width - left - right,
|
10334 |
+
height: rect.height - top - bottom,
|
10335 |
+
left: rect.left + left,
|
10336 |
+
right: rect.right - right,
|
10337 |
+
top: rect.top + top,
|
10338 |
+
bottom: rect.bottom - bottom
|
10339 |
};
|
10340 |
+
}
|
|
|
|
|
|
|
|
|
10341 |
/**
|
10342 |
+
* Hook used to focus the first tabbable element on mount.
|
10343 |
+
*
|
10344 |
+
* @param {boolean|string} focusOnMount Focus on mount mode.
|
10345 |
+
* @param {Object} contentRef Reference to the popover content element.
|
10346 |
*/
|
10347 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10348 |
|
10349 |
+
function useFocusContentOnMount(focusOnMount, contentRef) {
|
10350 |
+
// Focus handling
|
10351 |
+
Object(external_this_wp_element_["useEffect"])(function () {
|
10352 |
+
/*
|
10353 |
+
* Without the setTimeout, the dom node is not being focused. Related:
|
10354 |
+
* https://stackoverflow.com/questions/35522220/react-ref-with-focus-doesnt-work-without-settimeout-my-example
|
10355 |
+
*
|
10356 |
+
* TODO: Treat the cause, not the symptom.
|
10357 |
+
*/
|
10358 |
+
var focusTimeout = setTimeout(function () {
|
10359 |
+
if (!focusOnMount || !contentRef.current) {
|
10360 |
+
return;
|
10361 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10362 |
|
10363 |
+
if (focusOnMount === 'firstElement') {
|
10364 |
+
// Find first tabbable node within content and shift focus, falling
|
10365 |
+
// back to the popover panel itself.
|
10366 |
+
var firstTabbable = build_module["a" /* focus */].tabbable.find(contentRef.current)[0];
|
|
|
|
|
|
|
10367 |
|
10368 |
+
if (firstTabbable) {
|
10369 |
+
firstTabbable.focus();
|
10370 |
+
} else {
|
10371 |
+
contentRef.current.focus();
|
10372 |
+
}
|
10373 |
|
10374 |
+
return;
|
10375 |
+
}
|
10376 |
|
10377 |
+
if (focusOnMount === 'container') {
|
10378 |
+
// Focus the popover panel itself so items in the popover are easily
|
10379 |
+
// accessed via keyboard navigation.
|
10380 |
+
contentRef.current.focus();
|
10381 |
+
}
|
10382 |
+
}, 0);
|
10383 |
+
return function () {
|
10384 |
+
return clearTimeout(focusTimeout);
|
10385 |
+
};
|
10386 |
+
}, []);
|
10387 |
+
}
|
10388 |
/**
|
10389 |
+
* Sets or removes an element attribute.
|
10390 |
+
*
|
10391 |
+
* @param {Element} element The element to modify.
|
10392 |
+
* @param {string} name The attribute name to set or remove.
|
10393 |
+
* @param {?string} value The value to set. A falsy value will remove the
|
10394 |
+
* attribute.
|
10395 |
*/
|
10396 |
|
10397 |
|
10398 |
+
function setAttribute(element, name, value) {
|
10399 |
+
if (!value) {
|
10400 |
+
if (element.hasAttribute(name)) {
|
10401 |
+
element.removeAttribute(name);
|
10402 |
+
}
|
10403 |
+
} else if (element.getAttribute(name) !== value) {
|
10404 |
+
element.setAttribute(name, value);
|
10405 |
+
}
|
10406 |
+
}
|
10407 |
+
/**
|
10408 |
+
* Sets or removes an element style property.
|
10409 |
+
*
|
10410 |
+
* @param {Element} element The element to modify.
|
10411 |
+
* @param {string} property The property to set or remove.
|
10412 |
+
* @param {?string} value The value to set. A falsy value will remove the
|
10413 |
+
* property.
|
10414 |
+
*/
|
10415 |
+
|
10416 |
|
10417 |
+
function setStyle(element, property) {
|
10418 |
+
var value = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
|
10419 |
|
10420 |
+
if (element.style[property] !== value) {
|
10421 |
+
element.style[property] = value;
|
10422 |
+
}
|
10423 |
+
}
|
10424 |
/**
|
10425 |
+
* Sets or removes an element class.
|
10426 |
+
*
|
10427 |
+
* @param {Element} element The element to modify.
|
10428 |
+
* @param {string} name The class to set or remove.
|
10429 |
+
* @param {boolean} toggle True to set the class, false to remove.
|
10430 |
*/
|
10431 |
|
10432 |
|
10433 |
+
function setClass(element, name, toggle) {
|
10434 |
+
if (toggle) {
|
10435 |
+
if (!element.classList.contains(name)) {
|
10436 |
+
element.classList.add(name);
|
10437 |
+
}
|
10438 |
+
} else if (element.classList.contains(name)) {
|
10439 |
+
element.classList.remove(name);
|
10440 |
+
}
|
10441 |
+
}
|
10442 |
|
10443 |
+
var popover_Popover = function Popover(_ref2) {
|
10444 |
+
var headerTitle = _ref2.headerTitle,
|
10445 |
+
onClose = _ref2.onClose,
|
10446 |
+
onKeyDown = _ref2.onKeyDown,
|
10447 |
+
children = _ref2.children,
|
10448 |
+
className = _ref2.className,
|
10449 |
+
_ref2$noArrow = _ref2.noArrow,
|
10450 |
+
noArrow = _ref2$noArrow === void 0 ? true : _ref2$noArrow,
|
10451 |
+
isAlternate = _ref2.isAlternate,
|
10452 |
+
_ref2$position = _ref2.position,
|
10453 |
+
position = _ref2$position === void 0 ? 'bottom right' : _ref2$position,
|
10454 |
+
range = _ref2.range,
|
10455 |
+
_ref2$focusOnMount = _ref2.focusOnMount,
|
10456 |
+
focusOnMount = _ref2$focusOnMount === void 0 ? 'firstElement' : _ref2$focusOnMount,
|
10457 |
+
anchorRef = _ref2.anchorRef,
|
10458 |
+
shouldAnchorIncludePadding = _ref2.shouldAnchorIncludePadding,
|
10459 |
+
anchorRect = _ref2.anchorRect,
|
10460 |
+
getAnchorRect = _ref2.getAnchorRect,
|
10461 |
+
expandOnMobile = _ref2.expandOnMobile,
|
10462 |
+
_ref2$animate = _ref2.animate,
|
10463 |
+
animate = _ref2$animate === void 0 ? true : _ref2$animate,
|
10464 |
+
onClickOutside = _ref2.onClickOutside,
|
10465 |
+
onFocusOutside = _ref2.onFocusOutside,
|
10466 |
+
__unstableSticky = _ref2.__unstableSticky,
|
10467 |
+
_ref2$__unstableSlotN = _ref2.__unstableSlotName,
|
10468 |
+
__unstableSlotName = _ref2$__unstableSlotN === void 0 ? SLOT_NAME : _ref2$__unstableSlotN,
|
10469 |
+
__unstableObserveElement = _ref2.__unstableObserveElement,
|
10470 |
+
__unstableBoundaryParent = _ref2.__unstableBoundaryParent,
|
10471 |
+
contentProps = Object(objectWithoutProperties["a" /* default */])(_ref2, ["headerTitle", "onClose", "onKeyDown", "children", "className", "noArrow", "isAlternate", "position", "range", "focusOnMount", "anchorRef", "shouldAnchorIncludePadding", "anchorRect", "getAnchorRect", "expandOnMobile", "animate", "onClickOutside", "onFocusOutside", "__unstableSticky", "__unstableSlotName", "__unstableObserveElement", "__unstableBoundaryParent"]);
|
10472 |
|
10473 |
+
var anchorRefFallback = Object(external_this_wp_element_["useRef"])(null);
|
10474 |
+
var contentRef = Object(external_this_wp_element_["useRef"])(null);
|
10475 |
+
var containerRef = Object(external_this_wp_element_["useRef"])();
|
10476 |
+
var isMobileViewport = Object(use_viewport_match["a" /* default */])('medium', '<');
|
10477 |
|
10478 |
+
var _useState = Object(external_this_wp_element_["useState"])(),
|
10479 |
+
_useState2 = Object(slicedToArray["a" /* default */])(_useState, 2),
|
10480 |
+
animateOrigin = _useState2[0],
|
10481 |
+
setAnimateOrigin = _useState2[1];
|
|
|
|
|
10482 |
|
10483 |
+
var slot = Object(use_slot["a" /* default */])(__unstableSlotName);
|
10484 |
+
var isExpanded = expandOnMobile && isMobileViewport;
|
10485 |
+
|
10486 |
+
var _useResizeObserver = Object(use_resize_observer["a" /* default */])(),
|
10487 |
+
_useResizeObserver2 = Object(slicedToArray["a" /* default */])(_useResizeObserver, 2),
|
10488 |
+
containerResizeListener = _useResizeObserver2[0],
|
10489 |
+
contentSize = _useResizeObserver2[1];
|
10490 |
+
|
10491 |
+
noArrow = isExpanded || noArrow;
|
10492 |
+
Object(external_this_wp_element_["useLayoutEffect"])(function () {
|
10493 |
+
if (isExpanded) {
|
10494 |
+
setClass(containerRef.current, 'is-without-arrow', noArrow);
|
10495 |
+
setClass(containerRef.current, 'is-alternate', isAlternate);
|
10496 |
+
setAttribute(containerRef.current, 'data-x-axis');
|
10497 |
+
setAttribute(containerRef.current, 'data-y-axis');
|
10498 |
+
setStyle(containerRef.current, 'top');
|
10499 |
+
setStyle(containerRef.current, 'left');
|
10500 |
+
setStyle(contentRef.current, 'maxHeight');
|
10501 |
+
setStyle(contentRef.current, 'maxWidth');
|
10502 |
+
return;
|
10503 |
}
|
10504 |
|
10505 |
+
var refresh = function refresh() {
|
10506 |
+
if (!containerRef.current || !contentRef.current) {
|
10507 |
+
return;
|
10508 |
+
}
|
10509 |
+
|
10510 |
+
var anchor = computeAnchorRect(anchorRefFallback, anchorRect, getAnchorRect, anchorRef, shouldAnchorIncludePadding);
|
10511 |
+
|
10512 |
+
if (!anchor) {
|
10513 |
+
return;
|
10514 |
+
}
|
10515 |
+
|
10516 |
+
var _containerRef$current = containerRef.current,
|
10517 |
+
offsetParent = _containerRef$current.offsetParent,
|
10518 |
+
ownerDocument = _containerRef$current.ownerDocument;
|
10519 |
+
var relativeOffsetTop = 0; // If there is a positioned ancestor element that is not the body,
|
10520 |
+
// subtract the position from the anchor rect. If the position of
|
10521 |
+
// the popover is fixed, the offset parent is null or the body
|
10522 |
+
// element, in which case the position is relative to the viewport.
|
10523 |
+
// See https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/offsetParent
|
10524 |
+
|
10525 |
+
if (offsetParent && offsetParent !== ownerDocument.body) {
|
10526 |
+
var offsetParentRect = offsetParent.getBoundingClientRect();
|
10527 |
+
relativeOffsetTop = offsetParentRect.top;
|
10528 |
+
anchor = new window.DOMRect(anchor.left - offsetParentRect.left, anchor.top - offsetParentRect.top, anchor.width, anchor.height);
|
10529 |
+
}
|
10530 |
+
|
10531 |
+
var boundaryElement;
|
10532 |
+
|
10533 |
+
if (__unstableBoundaryParent) {
|
10534 |
+
var _containerRef$current2;
|
10535 |
+
|
10536 |
+
boundaryElement = (_containerRef$current2 = containerRef.current.closest('.popover-slot')) === null || _containerRef$current2 === void 0 ? void 0 : _containerRef$current2.parentNode;
|
10537 |
}
|
|
|
|
|
10538 |
|
10539 |
+
var usedContentSize = !contentSize.height ? contentRef.current.getBoundingClientRect() : contentSize;
|
|
|
|
|
|
|
10540 |
|
10541 |
+
var _computePopoverPositi = computePopoverPosition(anchor, usedContentSize, position, __unstableSticky, containerRef.current, relativeOffsetTop, boundaryElement),
|
10542 |
+
popoverTop = _computePopoverPositi.popoverTop,
|
10543 |
+
popoverLeft = _computePopoverPositi.popoverLeft,
|
10544 |
+
xAxis = _computePopoverPositi.xAxis,
|
10545 |
+
yAxis = _computePopoverPositi.yAxis,
|
10546 |
+
contentHeight = _computePopoverPositi.contentHeight,
|
10547 |
+
contentWidth = _computePopoverPositi.contentWidth;
|
10548 |
|
10549 |
+
if (typeof popoverTop === 'number' && typeof popoverLeft === 'number') {
|
10550 |
+
setStyle(containerRef.current, 'top', popoverTop + 'px');
|
10551 |
+
setStyle(containerRef.current, 'left', popoverLeft + 'px');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10552 |
}
|
|
|
|
|
10553 |
|
10554 |
+
setClass(containerRef.current, 'is-without-arrow', noArrow || xAxis === 'center' && yAxis === 'middle');
|
10555 |
+
setClass(containerRef.current, 'is-alternate', isAlternate);
|
10556 |
+
setAttribute(containerRef.current, 'data-x-axis', xAxis);
|
10557 |
+
setAttribute(containerRef.current, 'data-y-axis', yAxis);
|
10558 |
+
setStyle(contentRef.current, 'maxHeight', typeof contentHeight === 'number' ? contentHeight + 'px' : '');
|
10559 |
+
setStyle(contentRef.current, 'maxWidth', typeof contentWidth === 'number' ? contentWidth + 'px' : ''); // Compute the animation position
|
10560 |
|
10561 |
+
var yAxisMapping = {
|
10562 |
+
top: 'bottom',
|
10563 |
+
bottom: 'top'
|
10564 |
+
};
|
10565 |
+
var xAxisMapping = {
|
10566 |
+
left: 'right',
|
10567 |
+
right: 'left'
|
10568 |
+
};
|
10569 |
+
var animateYAxis = yAxisMapping[yAxis] || 'middle';
|
10570 |
+
var animateXAxis = xAxisMapping[xAxis] || 'center';
|
10571 |
+
setAnimateOrigin(animateXAxis + ' ' + animateYAxis);
|
10572 |
+
};
|
10573 |
|
10574 |
+
refresh();
|
10575 |
+
/*
|
10576 |
+
* There are sometimes we need to reposition or resize the popover that
|
10577 |
+
* are not handled by the resize/scroll window events (i.e. CSS changes
|
10578 |
+
* in the layout that changes the position of the anchor).
|
10579 |
+
*
|
10580 |
+
* For these situations, we refresh the popover every 0.5s
|
10581 |
+
*/
|
10582 |
|
10583 |
+
var intervalHandle = window.setInterval(refresh, 500);
|
10584 |
+
var rafId;
|
10585 |
|
10586 |
+
var refreshOnAnimationFrame = function refreshOnAnimationFrame() {
|
10587 |
+
window.cancelAnimationFrame(rafId);
|
10588 |
+
rafId = window.requestAnimationFrame(refresh);
|
10589 |
+
}; // Sometimes a click trigger a layout change that affects the popover
|
10590 |
+
// position. This is an opportunity to immediately refresh rather than
|
10591 |
+
// at the interval.
|
10592 |
|
10593 |
|
10594 |
+
window.addEventListener('click', refreshOnAnimationFrame);
|
10595 |
+
window.addEventListener('resize', refresh);
|
10596 |
+
window.addEventListener('scroll', refresh, true);
|
10597 |
+
var observer;
|
10598 |
|
10599 |
+
if (__unstableObserveElement) {
|
10600 |
+
observer = new window.MutationObserver(refresh);
|
10601 |
+
observer.observe(__unstableObserveElement, {
|
10602 |
+
attributes: true
|
10603 |
+
});
|
10604 |
+
}
|
10605 |
|
10606 |
+
return function () {
|
10607 |
+
window.clearInterval(intervalHandle);
|
10608 |
+
window.removeEventListener('resize', refresh);
|
10609 |
+
window.removeEventListener('scroll', refresh, true);
|
10610 |
+
window.removeEventListener('click', refreshOnAnimationFrame);
|
10611 |
+
window.cancelAnimationFrame(rafId);
|
10612 |
|
10613 |
+
if (observer) {
|
10614 |
+
observer.disconnect();
|
10615 |
+
}
|
10616 |
+
};
|
10617 |
+
}, [isExpanded, anchorRect, getAnchorRect, anchorRef, shouldAnchorIncludePadding, position, contentSize, __unstableSticky, __unstableObserveElement, __unstableBoundaryParent]);
|
10618 |
+
useFocusContentOnMount(focusOnMount, contentRef); // Event handlers
|
10619 |
|
10620 |
+
var maybeClose = function maybeClose(event) {
|
10621 |
+
// Close on escape
|
10622 |
+
if (event.keyCode === keycodes_build_module["b" /* ESCAPE */] && onClose) {
|
10623 |
+
event.stopPropagation();
|
10624 |
+
onClose();
|
10625 |
+
} // Preserve original content prop behavior
|
10626 |
|
|
|
|
|
|
|
10627 |
|
10628 |
+
if (onKeyDown) {
|
10629 |
+
onKeyDown(event);
|
10630 |
+
}
|
10631 |
+
};
|
10632 |
+
/**
|
10633 |
+
* Shims an onFocusOutside callback to be compatible with a deprecated
|
10634 |
+
* onClickOutside prop function, if provided.
|
10635 |
+
*
|
10636 |
+
* @param {FocusEvent} event Focus event from onFocusOutside.
|
10637 |
+
*/
|
10638 |
|
10639 |
|
10640 |
+
function handleOnFocusOutside(event) {
|
10641 |
+
// Defer to given `onFocusOutside` if specified. Call `onClose` only if
|
10642 |
+
// both `onFocusOutside` and `onClickOutside` are unspecified. Doing so
|
10643 |
+
// assures backwards-compatibility for prior `onClickOutside` default.
|
10644 |
+
if (onFocusOutside) {
|
10645 |
+
onFocusOutside(event);
|
10646 |
+
return;
|
10647 |
+
} else if (!onClickOutside) {
|
10648 |
+
if (onClose) {
|
10649 |
+
onClose();
|
10650 |
+
}
|
10651 |
|
10652 |
+
return;
|
10653 |
+
} // Simulate MouseEvent using FocusEvent#relatedTarget as emulated click
|
10654 |
+
// target. MouseEvent constructor is unsupported in Internet Explorer.
|
10655 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10656 |
|
10657 |
+
var clickEvent;
|
|
|
|
|
10658 |
|
10659 |
+
try {
|
10660 |
+
clickEvent = new window.MouseEvent('click');
|
10661 |
+
} catch (error) {
|
10662 |
+
clickEvent = document.createEvent('MouseEvent');
|
10663 |
+
clickEvent.initMouseEvent('click', true, true, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);
|
10664 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
10665 |
|
10666 |
+
Object.defineProperty(clickEvent, 'target', {
|
10667 |
+
get: function get() {
|
10668 |
+
return event.relatedTarget;
|
10669 |
}
|
10670 |
+
});
|
10671 |
+
Object(deprecated_build_module["a" /* default */])('Popover onClickOutside prop', {
|
10672 |
+
alternative: 'onFocusOutside'
|
10673 |
+
});
|
10674 |
+
onClickOutside(clickEvent);
|
10675 |
+
} // Disable reason: We care to capture the _bubbled_ events from inputs
|
10676 |
+
// within popover as inferring close intent.
|
10677 |
+
|
10678 |
+
|
10679 |
+
var content = Object(external_this_wp_element_["createElement"])(detect_outside, {
|
10680 |
+
onFocusOutside: handleOnFocusOutside
|
10681 |
+
}, Object(external_this_wp_element_["createElement"])(build_module_animate["a" /* default */], {
|
10682 |
+
type: animate && animateOrigin ? 'appear' : null,
|
10683 |
+
options: {
|
10684 |
+
origin: animateOrigin
|
10685 |
}
|
10686 |
+
}, function (_ref3) {
|
10687 |
+
var animateClassName = _ref3.className;
|
10688 |
+
return Object(external_this_wp_element_["createElement"])(isolated_event_container["a" /* default */], Object(esm_extends["a" /* default */])({
|
10689 |
+
className: classnames_default()('components-popover', className, animateClassName, {
|
10690 |
+
'is-expanded': isExpanded,
|
10691 |
+
'is-without-arrow': noArrow,
|
10692 |
+
'is-alternate': isAlternate
|
10693 |
+
})
|
10694 |
+
}, contentProps, {
|
10695 |
+
onKeyDown: maybeClose,
|
10696 |
+
ref: containerRef
|
10697 |
+
}), isExpanded && Object(external_this_wp_element_["createElement"])(scroll_lock, null), isExpanded && Object(external_this_wp_element_["createElement"])("div", {
|
10698 |
+
className: "components-popover__header"
|
10699 |
+
}, Object(external_this_wp_element_["createElement"])("span", {
|
10700 |
+
className: "components-popover__header-title"
|
10701 |
+
}, headerTitle), Object(external_this_wp_element_["createElement"])(build_module_button["a" /* default */], {
|
10702 |
+
className: "components-popover__close",
|
10703 |
+
icon: library_close["a" /* default */],
|
10704 |
+
onClick: onClose
|
10705 |
+
})), Object(external_this_wp_element_["createElement"])("div", {
|
10706 |
+
ref: contentRef,
|
10707 |
+
className: "components-popover__content",
|
10708 |
+
tabIndex: "-1"
|
10709 |
+
}, Object(external_this_wp_element_["createElement"])("div", {
|
10710 |
+
style: {
|
10711 |
+
position: 'relative'
|
10712 |
+
}
|
10713 |
+
}, containerResizeListener, children)));
|
10714 |
+
})); // Apply focus to element as long as focusOnMount is truthy; false is
|
10715 |
+
// the only "disabled" value.
|
10716 |
|
10717 |
+
if (focusOnMount) {
|
10718 |
+
content = Object(external_this_wp_element_["createElement"])(FocusManaged, null, content);
|
10719 |
+
}
|
|
|
|
|
10720 |
|
10721 |
+
if (slot.ref) {
|
10722 |
+
content = Object(external_this_wp_element_["createElement"])(slot_fill["a" /* Fill */], {
|
10723 |
+
name: __unstableSlotName
|
10724 |
+
}, content);
|
10725 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10726 |
|
10727 |
+
if (anchorRef || anchorRect) {
|
10728 |
+
return content;
|
10729 |
+
}
|
10730 |
|
10731 |
+
return Object(external_this_wp_element_["createElement"])("span", {
|
10732 |
+
ref: anchorRefFallback
|
10733 |
+
}, content);
|
10734 |
+
};
|
10735 |
|
10736 |
+
var PopoverContainer = popover_Popover;
|
10737 |
|
10738 |
+
PopoverContainer.Slot = function (_ref4) {
|
10739 |
+
var _ref4$name = _ref4.name,
|
10740 |
+
name = _ref4$name === void 0 ? SLOT_NAME : _ref4$name;
|
10741 |
+
return Object(external_this_wp_element_["createElement"])(slot_fill["b" /* Slot */], {
|
10742 |
+
bubblesVirtually: true,
|
10743 |
+
name: name,
|
10744 |
+
className: "popover-slot"
|
10745 |
+
});
|
10746 |
+
};
|
10747 |
|
10748 |
+
/* harmony default export */ var popover = __webpack_exports__["a"] = (PopoverContainer);
|
10749 |
+
//# sourceMappingURL=index.js.map
|
10750 |
|
10751 |
+
/***/ }),
|
10752 |
+
/* 118 */
|
10753 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
10754 |
|
10755 |
+
"use strict";
|
10756 |
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return STORE_KEY; });
|
10757 |
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return API_NAMESPACE; });
|
10758 |
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return QUEUE_OPTION_NAME; });
|
10759 |
+
var STORE_KEY = 'wc/customer-effort-score';
|
10760 |
+
var API_NAMESPACE = '/wc-admin';
|
10761 |
+
var QUEUE_OPTION_NAME = 'woocommerce_ces_tracks_queue';
|
10762 |
|
10763 |
+
/***/ }),
|
10764 |
+
/* 119 */
|
10765 |
+
/***/ (function(module, exports, __webpack_require__) {
|
10766 |
|
10767 |
/**
|
10768 |
+
* Copyright (c) 2014-present, Facebook, Inc.
|
10769 |
+
*
|
10770 |
+
* This source code is licensed under the MIT license found in the
|
10771 |
+
* LICENSE file in the root directory of this source tree.
|
10772 |
*/
|
10773 |
|
10774 |
+
var runtime = (function (exports) {
|
10775 |
+
"use strict";
|
10776 |
|
10777 |
+
var Op = Object.prototype;
|
10778 |
+
var hasOwn = Op.hasOwnProperty;
|
10779 |
+
var undefined; // More compressible than void 0.
|
10780 |
+
var $Symbol = typeof Symbol === "function" ? Symbol : {};
|
10781 |
+
var iteratorSymbol = $Symbol.iterator || "@@iterator";
|
10782 |
+
var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator";
|
10783 |
+
var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
|
10784 |
|
10785 |
+
function define(obj, key, value) {
|
10786 |
+
Object.defineProperty(obj, key, {
|
10787 |
+
value: value,
|
10788 |
+
enumerable: true,
|
10789 |
+
configurable: true,
|
10790 |
+
writable: true
|
10791 |
+
});
|
10792 |
+
return obj[key];
|
10793 |
+
}
|
10794 |
+
try {
|
10795 |
+
// IE 8 has a broken Object.defineProperty that only works on DOM objects.
|
10796 |
+
define({}, "");
|
10797 |
+
} catch (err) {
|
10798 |
+
define = function(obj, key, value) {
|
10799 |
+
return obj[key] = value;
|
10800 |
+
};
|
10801 |
+
}
|
10802 |
|
10803 |
+
function wrap(innerFn, outerFn, self, tryLocsList) {
|
10804 |
+
// If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.
|
10805 |
+
var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;
|
10806 |
+
var generator = Object.create(protoGenerator.prototype);
|
10807 |
+
var context = new Context(tryLocsList || []);
|
10808 |
|
10809 |
+
// The ._invoke method unifies the implementations of the .next,
|
10810 |
+
// .throw, and .return methods.
|
10811 |
+
generator._invoke = makeInvokeMethod(innerFn, self, context);
|
10812 |
+
|
10813 |
+
return generator;
|
10814 |
}
|
10815 |
+
exports.wrap = wrap;
|
10816 |
|
10817 |
+
// Try/catch helper to minimize deoptimizations. Returns a completion
|
10818 |
+
// record like context.tryEntries[i].completion. This interface could
|
10819 |
+
// have been (and was previously) designed to take a closure to be
|
10820 |
+
// invoked without arguments, but in all the cases we care about we
|
10821 |
+
// already have an existing method we want to call, so there's no need
|
10822 |
+
// to create a new function object. We can even get away with assuming
|
10823 |
+
// the method takes exactly one argument, since that happens to be true
|
10824 |
+
// in every case, so we don't have to touch the arguments object. The
|
10825 |
+
// only additional allocation required is the completion record, which
|
10826 |
+
// has a stable shape and so hopefully should be cheap to allocate.
|
10827 |
+
function tryCatch(fn, obj, arg) {
|
10828 |
+
try {
|
10829 |
+
return { type: "normal", arg: fn.call(obj, arg) };
|
10830 |
+
} catch (err) {
|
10831 |
+
return { type: "throw", arg: err };
|
10832 |
}
|
10833 |
+
}
|
|
|
|
|
|
|
10834 |
|
10835 |
+
var GenStateSuspendedStart = "suspendedStart";
|
10836 |
+
var GenStateSuspendedYield = "suspendedYield";
|
10837 |
+
var GenStateExecuting = "executing";
|
10838 |
+
var GenStateCompleted = "completed";
|
10839 |
|
10840 |
+
// Returning this object from the innerFn has the same effect as
|
10841 |
+
// breaking out of the dispatch switch statement.
|
10842 |
+
var ContinueSentinel = {};
|
|
|
|
|
|
|
|
|
|
|
|
|
10843 |
|
10844 |
+
// Dummy constructor functions that we use as the .constructor and
|
10845 |
+
// .constructor.prototype properties for functions that return Generator
|
10846 |
+
// objects. For full spec compliance, you may wish to configure your
|
10847 |
+
// minifier not to mangle the names of these two functions.
|
10848 |
+
function Generator() {}
|
10849 |
+
function GeneratorFunction() {}
|
10850 |
+
function GeneratorFunctionPrototype() {}
|
10851 |
|
10852 |
+
// This is a polyfill for %IteratorPrototype% for environments that
|
10853 |
+
// don't natively support it.
|
10854 |
+
var IteratorPrototype = {};
|
10855 |
+
IteratorPrototype[iteratorSymbol] = function () {
|
10856 |
+
return this;
|
10857 |
+
};
|
10858 |
|
10859 |
+
var getProto = Object.getPrototypeOf;
|
10860 |
+
var NativeIteratorPrototype = getProto && getProto(getProto(values([])));
|
10861 |
+
if (NativeIteratorPrototype &&
|
10862 |
+
NativeIteratorPrototype !== Op &&
|
10863 |
+
hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {
|
10864 |
+
// This environment has a native %IteratorPrototype%; use it instead
|
10865 |
+
// of the polyfill.
|
10866 |
+
IteratorPrototype = NativeIteratorPrototype;
|
10867 |
+
}
|
10868 |
|
10869 |
+
var Gp = GeneratorFunctionPrototype.prototype =
|
10870 |
+
Generator.prototype = Object.create(IteratorPrototype);
|
10871 |
+
GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype;
|
10872 |
+
GeneratorFunctionPrototype.constructor = GeneratorFunction;
|
10873 |
+
GeneratorFunction.displayName = define(
|
10874 |
+
GeneratorFunctionPrototype,
|
10875 |
+
toStringTagSymbol,
|
10876 |
+
"GeneratorFunction"
|
10877 |
+
);
|
10878 |
|
10879 |
+
// Helper for defining the .next, .throw, and .return methods of the
|
10880 |
+
// Iterator interface in terms of a single ._invoke method.
|
10881 |
+
function defineIteratorMethods(prototype) {
|
10882 |
+
["next", "throw", "return"].forEach(function(method) {
|
10883 |
+
define(prototype, method, function(arg) {
|
10884 |
+
return this._invoke(method, arg);
|
10885 |
+
});
|
10886 |
});
|
10887 |
+
}
|
|
|
|
|
|
|
10888 |
|
10889 |
+
exports.isGeneratorFunction = function(genFun) {
|
10890 |
+
var ctor = typeof genFun === "function" && genFun.constructor;
|
10891 |
+
return ctor
|
10892 |
+
? ctor === GeneratorFunction ||
|
10893 |
+
// For the native GeneratorFunction constructor, the best we can
|
10894 |
+
// do is to check its .name property.
|
10895 |
+
(ctor.displayName || ctor.name) === "GeneratorFunction"
|
10896 |
+
: false;
|
10897 |
+
};
|
10898 |
|
10899 |
+
exports.mark = function(genFun) {
|
10900 |
+
if (Object.setPrototypeOf) {
|
10901 |
+
Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);
|
10902 |
+
} else {
|
10903 |
+
genFun.__proto__ = GeneratorFunctionPrototype;
|
10904 |
+
define(genFun, toStringTagSymbol, "GeneratorFunction");
|
10905 |
+
}
|
10906 |
+
genFun.prototype = Object.create(Gp);
|
10907 |
+
return genFun;
|
10908 |
+
};
|
10909 |
|
10910 |
+
// Within the body of any async function, `await x` is transformed to
|
10911 |
+
// `yield regeneratorRuntime.awrap(x)`, so that the runtime can test
|
10912 |
+
// `hasOwn.call(value, "__await")` to determine if the yielded value is
|
10913 |
+
// meant to be awaited.
|
10914 |
+
exports.awrap = function(arg) {
|
10915 |
+
return { __await: arg };
|
10916 |
+
};
|
10917 |
|
10918 |
+
function AsyncIterator(generator, PromiseImpl) {
|
10919 |
+
function invoke(method, arg, resolve, reject) {
|
10920 |
+
var record = tryCatch(generator[method], generator, arg);
|
10921 |
+
if (record.type === "throw") {
|
10922 |
+
reject(record.arg);
|
10923 |
+
} else {
|
10924 |
+
var result = record.arg;
|
10925 |
+
var value = result.value;
|
10926 |
+
if (value &&
|
10927 |
+
typeof value === "object" &&
|
10928 |
+
hasOwn.call(value, "__await")) {
|
10929 |
+
return PromiseImpl.resolve(value.__await).then(function(value) {
|
10930 |
+
invoke("next", value, resolve, reject);
|
10931 |
+
}, function(err) {
|
10932 |
+
invoke("throw", err, resolve, reject);
|
10933 |
+
});
|
10934 |
+
}
|
10935 |
|
10936 |
+
return PromiseImpl.resolve(value).then(function(unwrapped) {
|
10937 |
+
// When a yielded Promise is resolved, its final value becomes
|
10938 |
+
// the .value of the Promise<{value,done}> result for the
|
10939 |
+
// current iteration.
|
10940 |
+
result.value = unwrapped;
|
10941 |
+
resolve(result);
|
10942 |
+
}, function(error) {
|
10943 |
+
// If a rejected Promise was yielded, throw the rejection back
|
10944 |
+
// into the async generator function so it can be handled there.
|
10945 |
+
return invoke("throw", error, resolve, reject);
|
10946 |
+
});
|
10947 |
+
}
|
10948 |
+
}
|
10949 |
|
10950 |
+
var previousPromise;
|
10951 |
|
10952 |
+
function enqueue(method, arg) {
|
10953 |
+
function callInvokeWithMethodAndArg() {
|
10954 |
+
return new PromiseImpl(function(resolve, reject) {
|
10955 |
+
invoke(method, arg, resolve, reject);
|
10956 |
+
});
|
10957 |
+
}
|
10958 |
|
10959 |
+
return previousPromise =
|
10960 |
+
// If enqueue has been called before, then we want to wait until
|
10961 |
+
// all previous Promises have been resolved before calling invoke,
|
10962 |
+
// so that results are always delivered in the correct order. If
|
10963 |
+
// enqueue has not been called before, then it is important to
|
10964 |
+
// call invoke immediately, without waiting on a callback to fire,
|
10965 |
+
// so that the async generator function has the opportunity to do
|
10966 |
+
// any necessary setup in a predictable way. This predictability
|
10967 |
+
// is why the Promise constructor synchronously invokes its
|
10968 |
+
// executor callback, and why async functions synchronously
|
10969 |
+
// execute code before the first await. Since we implement simple
|
10970 |
+
// async functions in terms of async generators, it is especially
|
10971 |
+
// important to get this right, even though it requires care.
|
10972 |
+
previousPromise ? previousPromise.then(
|
10973 |
+
callInvokeWithMethodAndArg,
|
10974 |
+
// Avoid propagating failures to Promises returned by later
|
10975 |
+
// invocations of the iterator.
|
10976 |
+
callInvokeWithMethodAndArg
|
10977 |
+
) : callInvokeWithMethodAndArg();
|
10978 |
+
}
|
10979 |
|
10980 |
+
// Define the unified helper method that is used to implement .next,
|
10981 |
+
// .throw, and .return (see defineIteratorMethods).
|
10982 |
+
this._invoke = enqueue;
|
10983 |
+
}
|
10984 |
|
10985 |
+
defineIteratorMethods(AsyncIterator.prototype);
|
10986 |
+
AsyncIterator.prototype[asyncIteratorSymbol] = function () {
|
10987 |
+
return this;
|
10988 |
+
};
|
10989 |
+
exports.AsyncIterator = AsyncIterator;
|
10990 |
|
10991 |
+
// Note that simple async functions are implemented on top of
|
10992 |
+
// AsyncIterator objects; they just return a Promise for the value of
|
10993 |
+
// the final result produced by the iterator.
|
10994 |
+
exports.async = function(innerFn, outerFn, self, tryLocsList, PromiseImpl) {
|
10995 |
+
if (PromiseImpl === void 0) PromiseImpl = Promise;
|
10996 |
|
10997 |
+
var iter = new AsyncIterator(
|
10998 |
+
wrap(innerFn, outerFn, self, tryLocsList),
|
10999 |
+
PromiseImpl
|
11000 |
+
);
|
11001 |
|
11002 |
+
return exports.isGeneratorFunction(outerFn)
|
11003 |
+
? iter // If outerFn is a generator, return the full iterator.
|
11004 |
+
: iter.next().then(function(result) {
|
11005 |
+
return result.done ? result.value : iter.next();
|
11006 |
+
});
|
11007 |
+
};
|
11008 |
|
11009 |
+
function makeInvokeMethod(innerFn, self, context) {
|
11010 |
+
var state = GenStateSuspendedStart;
|
11011 |
|
11012 |
+
return function invoke(method, arg) {
|
11013 |
+
if (state === GenStateExecuting) {
|
11014 |
+
throw new Error("Generator is already running");
|
11015 |
+
}
|
11016 |
|
11017 |
+
if (state === GenStateCompleted) {
|
11018 |
+
if (method === "throw") {
|
11019 |
+
throw arg;
|
11020 |
+
}
|
11021 |
|
11022 |
+
// Be forgiving, per 25.3.3.3.3 of the spec:
|
11023 |
+
// https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume
|
11024 |
+
return doneResult();
|
11025 |
+
}
|
11026 |
|
11027 |
+
context.method = method;
|
11028 |
+
context.arg = arg;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11029 |
|
11030 |
+
while (true) {
|
11031 |
+
var delegate = context.delegate;
|
11032 |
+
if (delegate) {
|
11033 |
+
var delegateResult = maybeInvokeDelegate(delegate, context);
|
11034 |
+
if (delegateResult) {
|
11035 |
+
if (delegateResult === ContinueSentinel) continue;
|
11036 |
+
return delegateResult;
|
11037 |
+
}
|
11038 |
+
}
|
11039 |
|
11040 |
+
if (context.method === "next") {
|
11041 |
+
// Setting context._sent for legacy support of Babel's
|
11042 |
+
// function.sent implementation.
|
11043 |
+
context.sent = context._sent = context.arg;
|
|
|
11044 |
|
11045 |
+
} else if (context.method === "throw") {
|
11046 |
+
if (state === GenStateSuspendedStart) {
|
11047 |
+
state = GenStateCompleted;
|
11048 |
+
throw context.arg;
|
11049 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11050 |
|
11051 |
+
context.dispatchException(context.arg);
|
|
|
11052 |
|
11053 |
+
} else if (context.method === "return") {
|
11054 |
+
context.abrupt("return", context.arg);
|
11055 |
+
}
|
|
|
|
|
|
|
|
|
11056 |
|
11057 |
+
state = GenStateExecuting;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11058 |
|
11059 |
+
var record = tryCatch(innerFn, self, context);
|
11060 |
+
if (record.type === "normal") {
|
11061 |
+
// If an exception is thrown from innerFn, we leave state ===
|
11062 |
+
// GenStateExecuting and loop back for another invocation.
|
11063 |
+
state = context.done
|
11064 |
+
? GenStateCompleted
|
11065 |
+
: GenStateSuspendedYield;
|
11066 |
|
11067 |
+
if (record.arg === ContinueSentinel) {
|
11068 |
+
continue;
|
11069 |
+
}
|
|
|
|
|
|
|
|
|
11070 |
|
11071 |
+
return {
|
11072 |
+
value: record.arg,
|
11073 |
+
done: context.done
|
11074 |
+
};
|
|
|
|
|
|
|
|
|
11075 |
|
11076 |
+
} else if (record.type === "throw") {
|
11077 |
+
state = GenStateCompleted;
|
11078 |
+
// Dispatch the exception by looping back around to the
|
11079 |
+
// context.dispatchException(context.arg) call above.
|
11080 |
+
context.method = "throw";
|
11081 |
+
context.arg = record.arg;
|
11082 |
+
}
|
11083 |
+
}
|
11084 |
};
|
11085 |
+
}
|
11086 |
|
11087 |
+
// Call delegate.iterator[context.method](context.arg) and handle the
|
11088 |
+
// result, either by returning a { value, done } result from the
|
11089 |
+
// delegate iterator, or by modifying context.method and context.arg,
|
11090 |
+
// setting context.delegate to null, and returning the ContinueSentinel.
|
11091 |
+
function maybeInvokeDelegate(delegate, context) {
|
11092 |
+
var method = delegate.iterator[context.method];
|
11093 |
+
if (method === undefined) {
|
11094 |
+
// A .throw or .return when the delegate iterator has no .throw
|
11095 |
+
// method always terminates the yield* loop.
|
11096 |
+
context.delegate = null;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11097 |
|
11098 |
+
if (context.method === "throw") {
|
11099 |
+
// Note: ["return"] must be used for ES3 parsing compatibility.
|
11100 |
+
if (delegate.iterator["return"]) {
|
11101 |
+
// If the delegate iterator has a return method, give it a
|
11102 |
+
// chance to clean up.
|
11103 |
+
context.method = "return";
|
11104 |
+
context.arg = undefined;
|
11105 |
+
maybeInvokeDelegate(delegate, context);
|
11106 |
|
11107 |
+
if (context.method === "throw") {
|
11108 |
+
// If maybeInvokeDelegate(context) changed context.method from
|
11109 |
+
// "return" to "throw", let that override the TypeError below.
|
11110 |
+
return ContinueSentinel;
|
11111 |
+
}
|
11112 |
+
}
|
11113 |
|
11114 |
+
context.method = "throw";
|
11115 |
+
context.arg = new TypeError(
|
11116 |
+
"The iterator does not provide a 'throw' method");
|
11117 |
+
}
|
11118 |
|
11119 |
+
return ContinueSentinel;
|
11120 |
+
}
|
11121 |
|
11122 |
+
var record = tryCatch(method, delegate.iterator, context.arg);
|
11123 |
|
11124 |
+
if (record.type === "throw") {
|
11125 |
+
context.method = "throw";
|
11126 |
+
context.arg = record.arg;
|
11127 |
+
context.delegate = null;
|
11128 |
+
return ContinueSentinel;
|
11129 |
+
}
|
11130 |
|
11131 |
+
var info = record.arg;
|
11132 |
|
11133 |
+
if (! info) {
|
11134 |
+
context.method = "throw";
|
11135 |
+
context.arg = new TypeError("iterator result is not an object");
|
11136 |
+
context.delegate = null;
|
11137 |
+
return ContinueSentinel;
|
11138 |
+
}
|
11139 |
|
11140 |
+
if (info.done) {
|
11141 |
+
// Assign the result of the finished delegate to the temporary
|
11142 |
+
// variable specified by delegate.resultName (see delegateYield).
|
11143 |
+
context[delegate.resultName] = info.value;
|
11144 |
|
11145 |
+
// Resume execution at the desired location (see delegateYield).
|
11146 |
+
context.next = delegate.nextLoc;
|
11147 |
|
11148 |
+
// If context.method was "throw" but the delegate handled the
|
11149 |
+
// exception, let the outer generator proceed normally. If
|
11150 |
+
// context.method was "next", forget context.arg since it has been
|
11151 |
+
// "consumed" by the delegate iterator. If context.method was
|
11152 |
+
// "return", allow the original .return call to continue in the
|
11153 |
+
// outer generator.
|
11154 |
+
if (context.method !== "return") {
|
11155 |
+
context.method = "next";
|
11156 |
+
context.arg = undefined;
|
11157 |
+
}
|
11158 |
|
11159 |
+
} else {
|
11160 |
+
// Re-yield the result returned by the delegate method.
|
11161 |
+
return info;
|
11162 |
+
}
|
11163 |
|
11164 |
+
// The delegate iterator is finished, so forget it and continue with
|
11165 |
+
// the outer generator.
|
11166 |
+
context.delegate = null;
|
11167 |
+
return ContinueSentinel;
|
11168 |
+
}
|
11169 |
|
11170 |
+
// Define Generator.prototype.{next,throw,return} in terms of the
|
11171 |
+
// unified ._invoke helper method.
|
11172 |
+
defineIteratorMethods(Gp);
|
11173 |
|
11174 |
+
define(Gp, toStringTagSymbol, "Generator");
|
11175 |
|
11176 |
+
// A Generator should always return itself as the iterator object when the
|
11177 |
+
// @@iterator function is called on it. Some browsers' implementations of the
|
11178 |
+
// iterator prototype chain incorrectly implement this, causing the Generator
|
11179 |
+
// object to not be returned from this call. This ensures that doesn't happen.
|
11180 |
+
// See https://github.com/facebook/regenerator/issues/274 for more details.
|
11181 |
+
Gp[iteratorSymbol] = function() {
|
11182 |
+
return this;
|
11183 |
+
};
|
11184 |
|
11185 |
+
Gp.toString = function() {
|
11186 |
+
return "[object Generator]";
|
11187 |
+
};
|
11188 |
|
11189 |
+
function pushTryEntry(locs) {
|
11190 |
+
var entry = { tryLoc: locs[0] };
|
11191 |
|
11192 |
+
if (1 in locs) {
|
11193 |
+
entry.catchLoc = locs[1];
|
11194 |
+
}
|
11195 |
|
11196 |
+
if (2 in locs) {
|
11197 |
+
entry.finallyLoc = locs[2];
|
11198 |
+
entry.afterLoc = locs[3];
|
11199 |
+
}
|
11200 |
|
11201 |
+
this.tryEntries.push(entry);
|
11202 |
+
}
|
11203 |
|
11204 |
+
function resetTryEntry(entry) {
|
11205 |
+
var record = entry.completion || {};
|
11206 |
+
record.type = "normal";
|
11207 |
+
delete record.arg;
|
11208 |
+
entry.completion = record;
|
11209 |
+
}
|
11210 |
|
11211 |
+
function Context(tryLocsList) {
|
11212 |
+
// The root entry object (effectively a try statement without a catch
|
11213 |
+
// or a finally block) gives us a place to store values thrown from
|
11214 |
+
// locations where there is no enclosing try statement.
|
11215 |
+
this.tryEntries = [{ tryLoc: "root" }];
|
11216 |
+
tryLocsList.forEach(pushTryEntry, this);
|
11217 |
+
this.reset(true);
|
11218 |
}
|
11219 |
|
11220 |
+
exports.keys = function(object) {
|
11221 |
+
var keys = [];
|
11222 |
+
for (var key in object) {
|
11223 |
+
keys.push(key);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11224 |
}
|
11225 |
+
keys.reverse();
|
|
|
|
|
|
|
11226 |
|
11227 |
+
// Rather than returning an object with a next method, we keep
|
11228 |
+
// things simple and return the next function itself.
|
11229 |
+
return function next() {
|
11230 |
+
while (keys.length) {
|
11231 |
+
var key = keys.pop();
|
11232 |
+
if (key in object) {
|
11233 |
+
next.value = key;
|
11234 |
+
next.done = false;
|
11235 |
+
return next;
|
11236 |
+
}
|
11237 |
+
}
|
11238 |
|
11239 |
+
// To avoid creating an additional object, we just hang the .value
|
11240 |
+
// and .done properties off the next function object itself. This
|
11241 |
+
// also ensures that the minifier will not anonymize the function.
|
11242 |
+
next.done = true;
|
11243 |
+
return next;
|
11244 |
+
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11245 |
};
|
|
|
|
|
|
|
11246 |
|
11247 |
+
function values(iterable) {
|
11248 |
+
if (iterable) {
|
11249 |
+
var iteratorMethod = iterable[iteratorSymbol];
|
11250 |
+
if (iteratorMethod) {
|
11251 |
+
return iteratorMethod.call(iterable);
|
11252 |
+
}
|
11253 |
|
11254 |
+
if (typeof iterable.next === "function") {
|
11255 |
+
return iterable;
|
11256 |
+
}
|
11257 |
|
11258 |
+
if (!isNaN(iterable.length)) {
|
11259 |
+
var i = -1, next = function next() {
|
11260 |
+
while (++i < iterable.length) {
|
11261 |
+
if (hasOwn.call(iterable, i)) {
|
11262 |
+
next.value = iterable[i];
|
11263 |
+
next.done = false;
|
11264 |
+
return next;
|
11265 |
+
}
|
11266 |
+
}
|
11267 |
|
11268 |
+
next.value = undefined;
|
11269 |
+
next.done = true;
|
11270 |
|
11271 |
+
return next;
|
11272 |
+
};
|
11273 |
|
11274 |
+
return next.next = next;
|
11275 |
+
}
|
11276 |
+
}
|
11277 |
|
11278 |
+
// Return an iterator with no values.
|
11279 |
+
return { next: doneResult };
|
11280 |
+
}
|
11281 |
+
exports.values = values;
|
11282 |
|
11283 |
+
function doneResult() {
|
11284 |
+
return { value: undefined, done: true };
|
11285 |
+
}
|
11286 |
|
11287 |
+
Context.prototype = {
|
11288 |
+
constructor: Context,
|
11289 |
|
11290 |
+
reset: function(skipTempReset) {
|
11291 |
+
this.prev = 0;
|
11292 |
+
this.next = 0;
|
11293 |
+
// Resetting context._sent for legacy support of Babel's
|
11294 |
+
// function.sent implementation.
|
11295 |
+
this.sent = this._sent = undefined;
|
11296 |
+
this.done = false;
|
11297 |
+
this.delegate = null;
|
11298 |
+
|
11299 |
+
this.method = "next";
|
11300 |
+
this.arg = undefined;
|
11301 |
+
|
11302 |
+
this.tryEntries.forEach(resetTryEntry);
|
11303 |
|
11304 |
+
if (!skipTempReset) {
|
11305 |
+
for (var name in this) {
|
11306 |
+
// Not sure about the optimal order of these conditions:
|
11307 |
+
if (name.charAt(0) === "t" &&
|
11308 |
+
hasOwn.call(this, name) &&
|
11309 |
+
!isNaN(+name.slice(1))) {
|
11310 |
+
this[name] = undefined;
|
11311 |
+
}
|
11312 |
+
}
|
11313 |
+
}
|
11314 |
+
},
|
11315 |
|
11316 |
+
stop: function() {
|
11317 |
+
this.done = true;
|
11318 |
|
11319 |
+
var rootEntry = this.tryEntries[0];
|
11320 |
+
var rootRecord = rootEntry.completion;
|
11321 |
+
if (rootRecord.type === "throw") {
|
11322 |
+
throw rootRecord.arg;
|
11323 |
+
}
|
11324 |
|
11325 |
+
return this.rval;
|
11326 |
+
},
|
11327 |
|
11328 |
+
dispatchException: function(exception) {
|
11329 |
+
if (this.done) {
|
11330 |
+
throw exception;
|
11331 |
+
}
|
|
|
|
|
|
|
|
|
|
|
11332 |
|
11333 |
+
var context = this;
|
11334 |
+
function handle(loc, caught) {
|
11335 |
+
record.type = "throw";
|
11336 |
+
record.arg = exception;
|
11337 |
+
context.next = loc;
|
|
|
|
|
|
|
|
|
11338 |
|
11339 |
+
if (caught) {
|
11340 |
+
// If the dispatched exception was caught by a catch block,
|
11341 |
+
// then let that catch block handle the exception normally.
|
11342 |
+
context.method = "next";
|
11343 |
+
context.arg = undefined;
|
11344 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11345 |
|
11346 |
+
return !! caught;
|
11347 |
+
}
|
|
|
|
|
11348 |
|
11349 |
+
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
11350 |
+
var entry = this.tryEntries[i];
|
11351 |
+
var record = entry.completion;
|
11352 |
|
11353 |
+
if (entry.tryLoc === "root") {
|
11354 |
+
// Exception thrown outside of any try block that could handle
|
11355 |
+
// it, so set the completion value of the entire function to
|
11356 |
+
// throw the exception.
|
11357 |
+
return handle("end");
|
11358 |
+
}
|
11359 |
|
11360 |
+
if (entry.tryLoc <= this.prev) {
|
11361 |
+
var hasCatch = hasOwn.call(entry, "catchLoc");
|
11362 |
+
var hasFinally = hasOwn.call(entry, "finallyLoc");
|
11363 |
|
11364 |
+
if (hasCatch && hasFinally) {
|
11365 |
+
if (this.prev < entry.catchLoc) {
|
11366 |
+
return handle(entry.catchLoc, true);
|
11367 |
+
} else if (this.prev < entry.finallyLoc) {
|
11368 |
+
return handle(entry.finallyLoc);
|
11369 |
+
}
|
11370 |
|
11371 |
+
} else if (hasCatch) {
|
11372 |
+
if (this.prev < entry.catchLoc) {
|
11373 |
+
return handle(entry.catchLoc, true);
|
11374 |
+
}
|
11375 |
|
11376 |
+
} else if (hasFinally) {
|
11377 |
+
if (this.prev < entry.finallyLoc) {
|
11378 |
+
return handle(entry.finallyLoc);
|
11379 |
+
}
|
11380 |
|
11381 |
+
} else {
|
11382 |
+
throw new Error("try statement without catch or finally");
|
11383 |
+
}
|
11384 |
+
}
|
11385 |
+
}
|
11386 |
+
},
|
11387 |
|
11388 |
+
abrupt: function(type, arg) {
|
11389 |
+
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
11390 |
+
var entry = this.tryEntries[i];
|
11391 |
+
if (entry.tryLoc <= this.prev &&
|
11392 |
+
hasOwn.call(entry, "finallyLoc") &&
|
11393 |
+
this.prev < entry.finallyLoc) {
|
11394 |
+
var finallyEntry = entry;
|
11395 |
+
break;
|
11396 |
+
}
|
11397 |
+
}
|
11398 |
|
11399 |
+
if (finallyEntry &&
|
11400 |
+
(type === "break" ||
|
11401 |
+
type === "continue") &&
|
11402 |
+
finallyEntry.tryLoc <= arg &&
|
11403 |
+
arg <= finallyEntry.finallyLoc) {
|
11404 |
+
// Ignore the finally entry if control is not jumping to a
|
11405 |
+
// location outside the try/catch block.
|
11406 |
+
finallyEntry = null;
|
11407 |
+
}
|
11408 |
|
11409 |
+
var record = finallyEntry ? finallyEntry.completion : {};
|
11410 |
+
record.type = type;
|
11411 |
+
record.arg = arg;
|
11412 |
|
11413 |
+
if (finallyEntry) {
|
11414 |
+
this.method = "next";
|
11415 |
+
this.next = finallyEntry.finallyLoc;
|
11416 |
+
return ContinueSentinel;
|
11417 |
+
}
|
11418 |
|
11419 |
+
return this.complete(record);
|
11420 |
+
},
|
11421 |
|
11422 |
+
complete: function(record, afterLoc) {
|
11423 |
+
if (record.type === "throw") {
|
11424 |
+
throw record.arg;
|
11425 |
+
}
|
11426 |
|
11427 |
+
if (record.type === "break" ||
|
11428 |
+
record.type === "continue") {
|
11429 |
+
this.next = record.arg;
|
11430 |
+
} else if (record.type === "return") {
|
11431 |
+
this.rval = this.arg = record.arg;
|
11432 |
+
this.method = "return";
|
11433 |
+
this.next = "end";
|
11434 |
+
} else if (record.type === "normal" && afterLoc) {
|
11435 |
+
this.next = afterLoc;
|
11436 |
+
}
|
11437 |
|
11438 |
+
return ContinueSentinel;
|
11439 |
+
},
|
11440 |
+
|
11441 |
+
finish: function(finallyLoc) {
|
11442 |
+
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
11443 |
+
var entry = this.tryEntries[i];
|
11444 |
+
if (entry.finallyLoc === finallyLoc) {
|
11445 |
+
this.complete(entry.completion, entry.afterLoc);
|
11446 |
+
resetTryEntry(entry);
|
11447 |
+
return ContinueSentinel;
|
11448 |
+
}
|
11449 |
+
}
|
11450 |
+
},
|
11451 |
|
11452 |
+
"catch": function(tryLoc) {
|
11453 |
+
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
11454 |
+
var entry = this.tryEntries[i];
|
11455 |
+
if (entry.tryLoc === tryLoc) {
|
11456 |
+
var record = entry.completion;
|
11457 |
+
if (record.type === "throw") {
|
11458 |
+
var thrown = record.arg;
|
11459 |
+
resetTryEntry(entry);
|
11460 |
+
}
|
11461 |
+
return thrown;
|
11462 |
+
}
|
11463 |
+
}
|
11464 |
|
11465 |
+
// The context.catch method must only be called with a location
|
11466 |
+
// argument that corresponds to a known catch block.
|
11467 |
+
throw new Error("illegal catch attempt");
|
11468 |
+
},
|
11469 |
|
11470 |
+
delegateYield: function(iterable, resultName, nextLoc) {
|
11471 |
+
this.delegate = {
|
11472 |
+
iterator: values(iterable),
|
11473 |
+
resultName: resultName,
|
11474 |
+
nextLoc: nextLoc
|
11475 |
+
};
|
11476 |
|
11477 |
+
if (this.method === "next") {
|
11478 |
+
// Deliberately forget the last sent value so that we don't
|
11479 |
+
// accidentally pass it on to the delegate.
|
11480 |
+
this.arg = undefined;
|
11481 |
+
}
|
11482 |
|
11483 |
+
return ContinueSentinel;
|
11484 |
+
}
|
11485 |
+
};
|
11486 |
|
11487 |
+
// Regardless of whether this script is executing as a CommonJS module
|
11488 |
+
// or not, return the runtime object so that we can declare the variable
|
11489 |
+
// regeneratorRuntime in the outer scope, which allows this module to be
|
11490 |
+
// injected easily by `bin/regenerator --include-runtime script.js`.
|
11491 |
+
return exports;
|
11492 |
|
11493 |
+
}(
|
11494 |
+
// If this script is executing as a CommonJS module, use module.exports
|
11495 |
+
// as the regeneratorRuntime namespace. Otherwise create a new empty
|
11496 |
+
// object. Either way, the resulting object will be used to initialize
|
11497 |
+
// the regeneratorRuntime variable at the top of this file.
|
11498 |
+
true ? module.exports : undefined
|
11499 |
+
));
|
11500 |
|
11501 |
+
try {
|
11502 |
+
regeneratorRuntime = runtime;
|
11503 |
+
} catch (accidentalStrictMode) {
|
11504 |
+
// This module should not be running in strict mode, so the above
|
11505 |
+
// assignment should always work unless something is misconfigured. Just
|
11506 |
+
// in case runtime.js accidentally runs in strict mode, we can escape
|
11507 |
+
// strict mode using a global Function call. This could conceivably fail
|
11508 |
+
// if a Content Security Policy forbids using Function, but in that case
|
11509 |
+
// the proper solution is to fix the accidental strict mode problem. If
|
11510 |
+
// you've misconfigured your bundler to force strict mode and applied a
|
11511 |
+
// CSP to forbid Function, and you're not willing to fix either of those
|
11512 |
+
// problems, please detail your unique predicament in a GitHub issue.
|
11513 |
+
Function("r", "regeneratorRuntime = r")(runtime);
|
11514 |
+
}
|
11515 |
|
11516 |
|
11517 |
+
/***/ }),
|
11518 |
+
/* 120 */
|
11519 |
+
/***/ (function(module, exports, __webpack_require__) {
|
11520 |
|
11521 |
+
"use strict";
|
11522 |
/**
|
11523 |
+
* Copyright (c) 2013-present, Facebook, Inc.
|
11524 |
+
*
|
11525 |
+
* This source code is licensed under the MIT license found in the
|
11526 |
+
* LICENSE file in the root directory of this source tree.
|
11527 |
*/
|
11528 |
|
11529 |
|
11530 |
|
11531 |
+
var ReactPropTypesSecret = __webpack_require__(121);
|
11532 |
|
11533 |
+
function emptyFunction() {}
|
11534 |
+
function emptyFunctionWithReset() {}
|
11535 |
+
emptyFunctionWithReset.resetWarningCache = emptyFunction;
|
11536 |
|
11537 |
+
module.exports = function() {
|
11538 |
+
function shim(props, propName, componentName, location, propFullName, secret) {
|
11539 |
+
if (secret === ReactPropTypesSecret) {
|
11540 |
+
// It is still safe when called from React.
|
11541 |
+
return;
|
11542 |
+
}
|
11543 |
+
var err = new Error(
|
11544 |
+
'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +
|
11545 |
+
'Use PropTypes.checkPropTypes() to call them. ' +
|
11546 |
+
'Read more at http://fb.me/use-check-prop-types'
|
11547 |
+
);
|
11548 |
+
err.name = 'Invariant Violation';
|
11549 |
+
throw err;
|
11550 |
+
};
|
11551 |
+
shim.isRequired = shim;
|
11552 |
+
function getShim() {
|
11553 |
+
return shim;
|
11554 |
+
};
|
11555 |
+
// Important!
|
11556 |
+
// Keep this list in sync with production version in `./factoryWithTypeCheckers.js`.
|
11557 |
+
var ReactPropTypes = {
|
11558 |
+
array: shim,
|
11559 |
+
bool: shim,
|
11560 |
+
func: shim,
|
11561 |
+
number: shim,
|
11562 |
+
object: shim,
|
11563 |
+
string: shim,
|
11564 |
+
symbol: shim,
|
11565 |
|
11566 |
+
any: shim,
|
11567 |
+
arrayOf: getShim,
|
11568 |
+
element: shim,
|
11569 |
+
elementType: shim,
|
11570 |
+
instanceOf: getShim,
|
11571 |
+
node: shim,
|
11572 |
+
objectOf: getShim,
|
11573 |
+
oneOf: getShim,
|
11574 |
+
oneOfType: getShim,
|
11575 |
+
shape: getShim,
|
11576 |
+
exact: getShim,
|
11577 |
|
11578 |
+
checkPropTypes: emptyFunctionWithReset,
|
11579 |
+
resetWarningCache: emptyFunction
|
11580 |
+
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11581 |
|
11582 |
+
ReactPropTypes.PropTypes = ReactPropTypes;
|
|
|
11583 |
|
11584 |
+
return ReactPropTypes;
|
11585 |
+
};
|
11586 |
|
|
|
11587 |
|
11588 |
+
/***/ }),
|
11589 |
+
/* 121 */
|
11590 |
+
/***/ (function(module, exports, __webpack_require__) {
|
11591 |
|
11592 |
+
"use strict";
|
11593 |
+
/**
|
11594 |
+
* Copyright (c) 2013-present, Facebook, Inc.
|
11595 |
+
*
|
11596 |
+
* This source code is licensed under the MIT license found in the
|
11597 |
+
* LICENSE file in the root directory of this source tree.
|
11598 |
+
*/
|
11599 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11600 |
|
|
|
|
|
|
|
11601 |
|
11602 |
+
var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11603 |
|
11604 |
+
module.exports = ReactPropTypesSecret;
|
|
|
11605 |
|
|
|
|
|
|
|
|
|
|
|
11606 |
|
11607 |
+
/***/ }),
|
11608 |
+
/* 122 */,
|
11609 |
+
/* 123 */,
|
11610 |
+
/* 124 */,
|
11611 |
+
/* 125 */,
|
11612 |
+
/* 126 */,
|
11613 |
+
/* 127 */
|
11614 |
+
/***/ (function(module, exports) {
|
11615 |
|
11616 |
+
var g;
|
|
|
|
|
11617 |
|
11618 |
+
// This works in non-strict mode
|
11619 |
+
g = (function() {
|
11620 |
+
return this;
|
11621 |
+
})();
|
11622 |
|
11623 |
+
try {
|
11624 |
+
// This works if eval is allowed (see CSP)
|
11625 |
+
g = g || new Function("return this")();
|
11626 |
+
} catch (e) {
|
11627 |
+
// This works if the window reference is available
|
11628 |
+
if (typeof window === "object") g = window;
|
11629 |
+
}
|
11630 |
|
11631 |
+
// g can still be undefined, but nothing to do about it...
|
11632 |
+
// We return undefined, instead of nothing here, so it's
|
11633 |
+
// easier to handle this case. if(!global) { ...}
|
11634 |
|
11635 |
+
module.exports = g;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11636 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11637 |
|
11638 |
+
/***/ }),
|
11639 |
+
/* 128 */,
|
11640 |
+
/* 129 */
|
11641 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11642 |
|
11643 |
+
"use strict";
|
11644 |
+
/* unused harmony export isHorizontalEdge */
|
11645 |
+
/* unused harmony export isVerticalEdge */
|
11646 |
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return getRectangleFromRange; });
|
11647 |
+
/* unused harmony export computeCaretRect */
|
11648 |
+
/* unused harmony export placeCaretAtHorizontalEdge */
|
11649 |
+
/* unused harmony export placeCaretAtVerticalEdge */
|
11650 |
+
/* unused harmony export isTextField */
|
11651 |
+
/* unused harmony export isNumberInput */
|
11652 |
+
/* unused harmony export documentHasTextSelection */
|
11653 |
+
/* unused harmony export documentHasUncollapsedSelection */
|
11654 |
+
/* unused harmony export documentHasSelection */
|
11655 |
+
/* unused harmony export isEntirelySelected */
|
11656 |
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return getScrollContainer; });
|
11657 |
+
/* unused harmony export getOffsetParent */
|
11658 |
+
/* unused harmony export replace */
|
11659 |
+
/* unused harmony export remove */
|
11660 |
+
/* unused harmony export insertAfter */
|
11661 |
+
/* unused harmony export unwrap */
|
11662 |
+
/* unused harmony export replaceTag */
|
11663 |
+
/* unused harmony export wrap */
|
11664 |
+
/* unused harmony export __unstableStripHTML */
|
11665 |
+
/* unused harmony export isEmpty */
|
11666 |
+
/* unused harmony export removeInvalidHTML */
|
11667 |
+
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2);
|
11668 |
+
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_0__);
|
11669 |
+
/* harmony import */ var _phrasing_content__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(69);
|
11670 |
+
/**
|
11671 |
+
* External dependencies
|
11672 |
+
*/
|
11673 |
|
11674 |
+
/**
|
11675 |
+
* Internal dependencies
|
11676 |
+
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11677 |
|
|
|
|
|
|
|
|
|
11678 |
|
|
|
|
|
|
|
|
|
11679 |
|
11680 |
+
function getComputedStyle(node) {
|
11681 |
+
return node.ownerDocument.defaultView.getComputedStyle(node);
|
11682 |
+
}
|
11683 |
+
/**
|
11684 |
+
* Returns true if the given selection object is in the forward direction, or
|
11685 |
+
* false otherwise.
|
11686 |
+
*
|
11687 |
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/Node/compareDocumentPosition
|
11688 |
+
*
|
11689 |
+
* @param {Selection} selection Selection object to check.
|
11690 |
+
*
|
11691 |
+
* @return {boolean} Whether the selection is forward.
|
11692 |
+
*/
|
11693 |
|
|
|
|
|
11694 |
|
11695 |
+
function isSelectionForward(selection) {
|
11696 |
+
var anchorNode = selection.anchorNode,
|
11697 |
+
focusNode = selection.focusNode,
|
11698 |
+
anchorOffset = selection.anchorOffset,
|
11699 |
+
focusOffset = selection.focusOffset;
|
11700 |
+
var position = anchorNode.compareDocumentPosition(focusNode); // Disable reason: `Node#compareDocumentPosition` returns a bitmask value,
|
11701 |
+
// so bitwise operators are intended.
|
11702 |
|
11703 |
+
/* eslint-disable no-bitwise */
|
11704 |
+
// Compare whether anchor node precedes focus node. If focus node (where
|
11705 |
+
// end of selection occurs) is after the anchor node, it is forward.
|
11706 |
|
11707 |
+
if (position & anchorNode.DOCUMENT_POSITION_PRECEDING) {
|
11708 |
+
return false;
|
11709 |
}
|
11710 |
|
11711 |
+
if (position & anchorNode.DOCUMENT_POSITION_FOLLOWING) {
|
11712 |
+
return true;
|
11713 |
+
}
|
11714 |
+
/* eslint-enable no-bitwise */
|
11715 |
+
// `compareDocumentPosition` returns 0 when passed the same node, in which
|
11716 |
+
// case compare offsets.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11717 |
|
|
|
|
|
11718 |
|
11719 |
+
if (position === 0) {
|
11720 |
+
return anchorOffset <= focusOffset;
|
11721 |
+
} // This should never be reached, but return true as default case.
|
11722 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11723 |
|
11724 |
+
return true;
|
11725 |
+
}
|
11726 |
+
/**
|
11727 |
+
* Check whether the selection is at the edge of the container. Checks for
|
11728 |
+
* horizontal position by default. Set `onlyVertical` to true to check only
|
11729 |
+
* vertically.
|
11730 |
+
*
|
11731 |
+
* @param {Element} container Focusable element.
|
11732 |
+
* @param {boolean} isReverse Set to true to check left, false to check right.
|
11733 |
+
* @param {boolean} onlyVertical Set to true to check only vertical position.
|
11734 |
+
*
|
11735 |
+
* @return {boolean} True if at the edge, false if not.
|
11736 |
+
*/
|
11737 |
+
|
11738 |
+
|
11739 |
+
function isEdge(container, isReverse, onlyVertical) {
|
11740 |
+
if (Object(lodash__WEBPACK_IMPORTED_MODULE_0__["includes"])(['INPUT', 'TEXTAREA'], container.tagName)) {
|
11741 |
+
if (container.selectionStart !== container.selectionEnd) {
|
11742 |
+
return false;
|
11743 |
+
}
|
11744 |
+
|
11745 |
+
if (isReverse) {
|
11746 |
+
return container.selectionStart === 0;
|
11747 |
+
}
|
11748 |
|
11749 |
+
return container.value.length === container.selectionStart;
|
11750 |
+
}
|
11751 |
|
11752 |
+
if (!container.isContentEditable) {
|
11753 |
+
return true;
|
11754 |
+
}
|
11755 |
|
11756 |
+
var ownerDocument = container.ownerDocument;
|
11757 |
+
var defaultView = ownerDocument.defaultView;
|
11758 |
+
var selection = defaultView.getSelection();
|
11759 |
|
11760 |
+
if (!selection.rangeCount) {
|
11761 |
+
return false;
|
11762 |
+
}
|
11763 |
|
11764 |
+
var originalRange = selection.getRangeAt(0);
|
11765 |
+
var range = originalRange.cloneRange();
|
11766 |
+
var isForward = isSelectionForward(selection);
|
11767 |
+
var isCollapsed = selection.isCollapsed; // Collapse in direction of selection.
|
11768 |
|
11769 |
+
if (!isCollapsed) {
|
11770 |
+
range.collapse(!isForward);
|
11771 |
+
}
|
11772 |
|
11773 |
+
var rangeRect = getRectangleFromRange(range);
|
11774 |
|
11775 |
+
if (!rangeRect) {
|
11776 |
+
return false;
|
11777 |
+
}
|
11778 |
|
11779 |
+
var computedStyle = getComputedStyle(container);
|
11780 |
+
var lineHeight = parseInt(computedStyle.lineHeight, 10) || 0; // Only consider the multiline selection at the edge if the direction is
|
11781 |
+
// towards the edge.
|
11782 |
|
11783 |
+
if (!isCollapsed && rangeRect.height > lineHeight && isForward === isReverse) {
|
11784 |
+
return false;
|
11785 |
+
}
|
11786 |
|
11787 |
+
var padding = parseInt(computedStyle["padding".concat(isReverse ? 'Top' : 'Bottom')], 10) || 0; // Calculate a buffer that is half the line height. In some browsers, the
|
11788 |
+
// selection rectangle may not fill the entire height of the line, so we add
|
11789 |
+
// 3/4 the line height to the selection rectangle to ensure that it is well
|
11790 |
+
// over its line boundary.
|
11791 |
|
11792 |
+
var buffer = 3 * parseInt(lineHeight, 10) / 4;
|
11793 |
+
var containerRect = container.getBoundingClientRect();
|
11794 |
+
var originalRangeRect = getRectangleFromRange(originalRange);
|
11795 |
+
var verticalEdge = isReverse ? containerRect.top + padding > originalRangeRect.top - buffer : containerRect.bottom - padding < originalRangeRect.bottom + buffer;
|
11796 |
|
11797 |
+
if (!verticalEdge) {
|
11798 |
+
return false;
|
11799 |
+
}
|
11800 |
|
11801 |
+
if (onlyVertical) {
|
11802 |
+
return true;
|
11803 |
+
} // In the case of RTL scripts, the horizontal edge is at the opposite side.
|
11804 |
|
|
|
11805 |
|
11806 |
+
var direction = computedStyle.direction;
|
11807 |
+
var isReverseDir = direction === 'rtl' ? !isReverse : isReverse; // To calculate the horizontal position, we insert a test range and see if
|
11808 |
+
// this test range has the same horizontal position. This method proves to
|
11809 |
+
// be better than a DOM-based calculation, because it ignores empty text
|
11810 |
+
// nodes and a trailing line break element. In other words, we need to check
|
11811 |
+
// visual positioning, not DOM positioning.
|
11812 |
|
11813 |
+
var x = isReverseDir ? containerRect.left + 1 : containerRect.right - 1;
|
11814 |
+
var y = isReverse ? containerRect.top + buffer : containerRect.bottom - buffer;
|
11815 |
+
var testRange = hiddenCaretRangeFromPoint(ownerDocument, x, y, container);
|
|
|
|
|
|
|
|
|
11816 |
|
11817 |
+
if (!testRange) {
|
11818 |
+
return false;
|
11819 |
+
}
|
|
|
|
|
|
|
11820 |
|
11821 |
+
var side = isReverseDir ? 'left' : 'right';
|
11822 |
+
var testRect = getRectangleFromRange(testRange); // Allow the position to be 1px off.
|
11823 |
+
|
11824 |
+
return Math.abs(testRect[side] - rangeRect[side]) <= 1;
|
11825 |
}
|
11826 |
/**
|
11827 |
+
* Check whether the selection is horizontally at the edge of the container.
|
11828 |
*
|
11829 |
+
* @param {Element} container Focusable element.
|
11830 |
+
* @param {boolean} isReverse Set to true to check left, false for right.
|
11831 |
+
*
|
11832 |
+
* @return {boolean} True if at the horizontal edge, false if not.
|
11833 |
*/
|
11834 |
|
11835 |
|
11836 |
+
function isHorizontalEdge(container, isReverse) {
|
11837 |
+
return isEdge(container, isReverse);
|
|
|
|
|
|
|
11838 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11839 |
/**
|
11840 |
+
* Check whether the selection is vertically at the edge of the container.
|
11841 |
+
*
|
11842 |
+
* @param {Element} container Focusable element.
|
11843 |
+
* @param {boolean} isReverse Set to true to check top, false for bottom.
|
11844 |
+
*
|
11845 |
+
* @return {boolean} True if at the vertical edge, false if not.
|
11846 |
*/
|
11847 |
|
11848 |
+
function isVerticalEdge(container, isReverse) {
|
11849 |
+
return isEdge(container, isReverse, true);
|
11850 |
+
}
|
11851 |
/**
|
11852 |
+
* Get the rectangle of a given Range.
|
11853 |
*
|
11854 |
+
* @param {Range} range The range.
|
11855 |
*
|
11856 |
+
* @return {DOMRect} The rectangle.
|
11857 |
*/
|
11858 |
|
11859 |
+
function getRectangleFromRange(range) {
|
11860 |
+
// For uncollapsed ranges, get the rectangle that bounds the contents of the
|
11861 |
+
// range; this a rectangle enclosing the union of the bounding rectangles
|
11862 |
+
// for all the elements in the range.
|
11863 |
+
if (!range.collapsed) {
|
11864 |
+
return range.getBoundingClientRect();
|
11865 |
+
}
|
|
|
|
|
|
|
|
|
11866 |
|
11867 |
+
var _range = range,
|
11868 |
+
startContainer = _range.startContainer;
|
11869 |
+
var ownerDocument = startContainer.ownerDocument; // Correct invalid "BR" ranges. The cannot contain any children.
|
|
|
|
|
11870 |
|
11871 |
+
if (startContainer.nodeName === 'BR') {
|
11872 |
+
var parentNode = startContainer.parentNode;
|
11873 |
+
var index = Array.from(parentNode.childNodes).indexOf(startContainer);
|
11874 |
+
range = ownerDocument.createRange();
|
11875 |
+
range.setStart(parentNode, index);
|
11876 |
+
range.setEnd(parentNode, index);
|
11877 |
+
}
|
|
|
|
|
11878 |
|
11879 |
+
var rect = range.getClientRects()[0]; // If the collapsed range starts (and therefore ends) at an element node,
|
11880 |
+
// `getClientRects` can be empty in some browsers. This can be resolved
|
11881 |
+
// by adding a temporary text node with zero-width space to the range.
|
11882 |
+
//
|
11883 |
+
// See: https://stackoverflow.com/a/6847328/995445
|
11884 |
+
|
11885 |
+
if (!rect) {
|
11886 |
+
var padNode = ownerDocument.createTextNode("\u200B"); // Do not modify the live range.
|
11887 |
+
|
11888 |
+
range = range.cloneRange();
|
11889 |
+
range.insertNode(padNode);
|
11890 |
+
rect = range.getClientRects()[0];
|
11891 |
+
padNode.parentNode.removeChild(padNode);
|
11892 |
}
|
11893 |
+
|
11894 |
+
return rect;
|
11895 |
+
}
|
11896 |
/**
|
11897 |
+
* Get the rectangle for the selection in a container.
|
|
|
|
|
|
|
|
|
|
|
11898 |
*
|
11899 |
+
* @param {Window} win The window of the selection.
|
|
|
|
|
|
|
11900 |
*
|
11901 |
+
* @return {?DOMRect} The rectangle.
|
11902 |
*/
|
11903 |
|
11904 |
+
function computeCaretRect(win) {
|
11905 |
+
var selection = win.getSelection();
|
11906 |
+
var range = selection.rangeCount ? selection.getRangeAt(0) : null;
|
|
|
|
|
11907 |
|
11908 |
+
if (!range) {
|
11909 |
+
return;
|
11910 |
}
|
11911 |
|
11912 |
+
return getRectangleFromRange(range);
|
11913 |
+
}
|
11914 |
+
/**
|
11915 |
+
* Places the caret at start or end of a given element.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11916 |
*
|
11917 |
+
* @param {Element} container Focusable element.
|
11918 |
+
* @param {boolean} isReverse True for end, false for start.
|
11919 |
*/
|
11920 |
|
11921 |
+
function placeCaretAtHorizontalEdge(container, isReverse) {
|
11922 |
+
if (!container) {
|
11923 |
+
return;
|
11924 |
+
}
|
|
|
|
|
11925 |
|
11926 |
+
if (Object(lodash__WEBPACK_IMPORTED_MODULE_0__["includes"])(['INPUT', 'TEXTAREA'], container.tagName)) {
|
11927 |
+
container.focus();
|
11928 |
|
11929 |
+
if (isReverse) {
|
11930 |
+
container.selectionStart = container.value.length;
|
11931 |
+
container.selectionEnd = container.value.length;
|
11932 |
+
} else {
|
11933 |
+
container.selectionStart = 0;
|
11934 |
+
container.selectionEnd = 0;
|
11935 |
+
}
|
11936 |
|
11937 |
+
return;
|
11938 |
+
}
|
11939 |
|
11940 |
+
container.focus();
|
11941 |
+
|
11942 |
+
if (!container.isContentEditable) {
|
11943 |
+
return;
|
11944 |
+
} // Select on extent child of the container, not the container itself. This
|
11945 |
+
// avoids the selection always being `endOffset` of 1 when placed at end,
|
11946 |
+
// where `startContainer`, `endContainer` would always be container itself.
|
|
|
|
|
|
|
|
|
11947 |
|
11948 |
|
11949 |
+
var rangeTarget = container[isReverse ? 'lastChild' : 'firstChild']; // If no range target, it implies that the container is empty. Focusing is
|
11950 |
+
// sufficient for caret to be placed correctly.
|
|
|
11951 |
|
11952 |
+
if (!rangeTarget) {
|
11953 |
+
return;
|
11954 |
+
}
|
11955 |
|
11956 |
+
var ownerDocument = container.ownerDocument;
|
11957 |
+
var defaultView = ownerDocument.defaultView;
|
11958 |
+
var selection = defaultView.getSelection();
|
11959 |
+
var range = ownerDocument.createRange();
|
11960 |
+
range.selectNodeContents(rangeTarget);
|
11961 |
+
range.collapse(!isReverse);
|
11962 |
+
selection.removeAllRanges();
|
11963 |
+
selection.addRange(range);
|
11964 |
+
}
|
11965 |
/**
|
11966 |
+
* Polyfill.
|
11967 |
+
* Get a collapsed range for a given point.
|
11968 |
*
|
11969 |
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/Document/caretRangeFromPoint
|
|
|
|
|
11970 |
*
|
11971 |
+
* @param {Document} doc The document of the range.
|
11972 |
+
* @param {number} x Horizontal position within the current viewport.
|
11973 |
+
* @param {number} y Vertical position within the current viewport.
|
11974 |
+
*
|
11975 |
+
* @return {?Range} The best range for the given point.
|
11976 |
*/
|
11977 |
|
11978 |
+
function caretRangeFromPoint(doc, x, y) {
|
11979 |
+
if (doc.caretRangeFromPoint) {
|
11980 |
+
return doc.caretRangeFromPoint(x, y);
|
11981 |
+
}
|
11982 |
|
11983 |
+
if (!doc.caretPositionFromPoint) {
|
11984 |
+
return null;
|
11985 |
+
}
|
|
|
11986 |
|
11987 |
+
var point = doc.caretPositionFromPoint(x, y); // If x or y are negative, outside viewport, or there is no text entry node.
|
11988 |
+
// https://developer.mozilla.org/en-US/docs/Web/API/Document/caretRangeFromPoint
|
11989 |
+
|
11990 |
+
if (!point) {
|
11991 |
+
return null;
|
11992 |
+
}
|
11993 |
+
|
11994 |
+
var range = doc.createRange();
|
11995 |
+
range.setStart(point.offsetNode, point.offset);
|
11996 |
+
range.collapse(true);
|
11997 |
+
return range;
|
11998 |
}
|
11999 |
/**
|
12000 |
+
* Get a collapsed range for a given point.
|
12001 |
+
* Gives the container a temporary high z-index (above any UI).
|
12002 |
+
* This is preferred over getting the UI nodes and set styles there.
|
12003 |
*
|
12004 |
+
* @param {Document} doc The document of the range.
|
12005 |
+
* @param {number} x Horizontal position within the current viewport.
|
12006 |
+
* @param {number} y Vertical position within the current viewport.
|
12007 |
+
* @param {Element} container Container in which the range is expected to be found.
|
12008 |
*
|
12009 |
+
* @return {?Range} The best range for the given point.
|
|
|
|
|
12010 |
*/
|
12011 |
|
|
|
|
|
|
|
|
|
|
|
12012 |
|
12013 |
+
function hiddenCaretRangeFromPoint(doc, x, y, container) {
|
12014 |
+
var originalZIndex = container.style.zIndex;
|
12015 |
+
var originalPosition = container.style.position; // A z-index only works if the element position is not static.
|
12016 |
|
12017 |
+
container.style.zIndex = '10000';
|
12018 |
+
container.style.position = 'relative';
|
12019 |
+
var range = caretRangeFromPoint(doc, x, y);
|
12020 |
+
container.style.zIndex = originalZIndex;
|
12021 |
+
container.style.position = originalPosition;
|
12022 |
+
return range;
|
12023 |
+
}
|
12024 |
+
/**
|
12025 |
+
* Places the caret at the top or bottom of a given element.
|
12026 |
+
*
|
12027 |
+
* @param {Element} container Focusable element.
|
12028 |
+
* @param {boolean} isReverse True for bottom, false for top.
|
12029 |
+
* @param {DOMRect} [rect] The rectangle to position the caret with.
|
12030 |
+
* @param {boolean} [mayUseScroll=true] True to allow scrolling, false to disallow.
|
12031 |
+
*/
|
12032 |
|
|
|
12033 |
|
12034 |
+
function placeCaretAtVerticalEdge(container, isReverse, rect) {
|
12035 |
+
var mayUseScroll = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true;
|
12036 |
|
12037 |
+
if (!container) {
|
12038 |
+
return;
|
12039 |
+
}
|
12040 |
|
12041 |
+
if (!rect || !container.isContentEditable) {
|
12042 |
+
placeCaretAtHorizontalEdge(container, isReverse);
|
12043 |
+
return;
|
12044 |
+
} // Offset by a buffer half the height of the caret rect. This is needed
|
12045 |
+
// because caretRangeFromPoint may default to the end of the selection if
|
12046 |
+
// offset is too close to the edge. It's unclear how to precisely calculate
|
12047 |
+
// this threshold; it may be the padded area of some combination of line
|
12048 |
+
// height, caret height, and font size. The buffer offset is effectively
|
12049 |
+
// equivalent to a point at half the height of a line of text.
|
12050 |
|
|
|
|
|
|
|
|
|
12051 |
|
12052 |
+
var buffer = rect.height / 2;
|
12053 |
+
var editableRect = container.getBoundingClientRect();
|
12054 |
+
var x = rect.left;
|
12055 |
+
var y = isReverse ? editableRect.bottom - buffer : editableRect.top + buffer;
|
12056 |
+
var ownerDocument = container.ownerDocument;
|
12057 |
+
var defaultView = ownerDocument.defaultView;
|
12058 |
+
var range = hiddenCaretRangeFromPoint(ownerDocument, x, y, container);
|
12059 |
|
12060 |
+
if (!range || !container.contains(range.startContainer)) {
|
12061 |
+
if (mayUseScroll && (!range || !range.startContainer || !range.startContainer.contains(container))) {
|
12062 |
+
// Might be out of view.
|
12063 |
+
// Easier than attempting to calculate manually.
|
12064 |
+
container.scrollIntoView(isReverse);
|
12065 |
+
placeCaretAtVerticalEdge(container, isReverse, rect, false);
|
12066 |
+
return;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12067 |
}
|
12068 |
|
12069 |
+
placeCaretAtHorizontalEdge(container, isReverse);
|
12070 |
+
return;
|
12071 |
+
}
|
12072 |
|
12073 |
+
var selection = defaultView.getSelection();
|
12074 |
+
selection.removeAllRanges();
|
12075 |
+
selection.addRange(range);
|
12076 |
+
container.focus(); // Editable was already focussed, it goes back to old range...
|
12077 |
+
// This fixes it.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12078 |
|
12079 |
+
selection.removeAllRanges();
|
12080 |
+
selection.addRange(range);
|
12081 |
+
}
|
12082 |
+
/**
|
12083 |
+
* Check whether the given element is a text field, where text field is defined
|
12084 |
+
* by the ability to select within the input, or that it is contenteditable.
|
12085 |
+
*
|
12086 |
+
* See: https://html.spec.whatwg.org/#textFieldSelection
|
12087 |
+
*
|
12088 |
+
* @param {HTMLElement} element The HTML element.
|
12089 |
+
*
|
12090 |
+
* @return {boolean} True if the element is an text field, false if not.
|
12091 |
+
*/
|
12092 |
|
12093 |
+
function isTextField(element) {
|
12094 |
+
var nodeName = element.nodeName,
|
12095 |
+
contentEditable = element.contentEditable;
|
12096 |
+
var nonTextInputs = ['button', 'checkbox', 'hidden', 'file', 'radio', 'image', 'range', 'reset', 'submit', 'number'];
|
12097 |
+
return nodeName === 'INPUT' && !nonTextInputs.includes(element.type) || nodeName === 'TEXTAREA' || contentEditable === 'true';
|
12098 |
+
}
|
12099 |
+
/**
|
12100 |
+
* Check whether the given element is an input field of type number
|
12101 |
+
* and has a valueAsNumber
|
12102 |
+
*
|
12103 |
+
* @param {HTMLElement} element The HTML element.
|
12104 |
+
*
|
12105 |
+
* @return {boolean} True if the element is input and holds a number.
|
12106 |
+
*/
|
12107 |
|
12108 |
+
function isNumberInput(element) {
|
12109 |
+
var nodeName = element.nodeName,
|
12110 |
+
type = element.type,
|
12111 |
+
valueAsNumber = element.valueAsNumber;
|
12112 |
+
return nodeName === 'INPUT' && type === 'number' && !!valueAsNumber;
|
12113 |
}
|
12114 |
+
/**
|
12115 |
+
* Check whether the current document has selected text. This applies to ranges
|
12116 |
+
* of text in the document, and not selection inside <input> and <textarea>
|
12117 |
+
* elements.
|
12118 |
+
*
|
12119 |
+
* See: https://developer.mozilla.org/en-US/docs/Web/API/Window/getSelection#Related_objects.
|
12120 |
+
*
|
12121 |
+
* @param {Document} doc The document to check.
|
12122 |
+
*
|
12123 |
+
* @return {boolean} True if there is selection, false if not.
|
12124 |
+
*/
|
12125 |
|
12126 |
+
function documentHasTextSelection(doc) {
|
12127 |
+
var selection = doc.defaultView.getSelection();
|
12128 |
+
var range = selection.rangeCount ? selection.getRangeAt(0) : null;
|
12129 |
+
return range && !range.collapsed;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12130 |
}
|
12131 |
+
/**
|
12132 |
+
* Check whether the given element, assumed an input field or textarea,
|
12133 |
+
* contains a (uncollapsed) selection of text.
|
12134 |
+
*
|
12135 |
+
* Note: this is perhaps an abuse of the term "selection", since these elements
|
12136 |
+
* manage selection differently and aren't covered by Selection#collapsed.
|
12137 |
+
*
|
12138 |
+
* See: https://developer.mozilla.org/en-US/docs/Web/API/Window/getSelection#Related_objects.
|
12139 |
+
*
|
12140 |
+
* @param {HTMLElement} element The HTML element.
|
12141 |
+
*
|
12142 |
+
* @return {boolean} Whether the input/textareaa element has some "selection".
|
12143 |
+
*/
|
12144 |
|
12145 |
+
function inputFieldHasUncollapsedSelection(element) {
|
12146 |
+
if (!isTextField(element) && !isNumberInput(element)) {
|
12147 |
+
return false;
|
12148 |
+
}
|
|
|
|
|
12149 |
|
12150 |
+
try {
|
12151 |
+
var selectionStart = element.selectionStart,
|
12152 |
+
selectionEnd = element.selectionEnd;
|
12153 |
+
return selectionStart !== null && selectionStart !== selectionEnd;
|
12154 |
+
} catch (error) {
|
12155 |
+
// Safari throws an exception when trying to get `selectionStart`
|
12156 |
+
// on non-text <input> elements (which, understandably, don't
|
12157 |
+
// have the text selection API). We catch this via a try/catch
|
12158 |
+
// block, as opposed to a more explicit check of the element's
|
12159 |
+
// input types, because of Safari's non-standard behavior. This
|
12160 |
+
// also means we don't have to worry about the list of input
|
12161 |
+
// types that support `selectionStart` changing as the HTML spec
|
12162 |
+
// evolves over time.
|
12163 |
+
return false;
|
12164 |
+
}
|
12165 |
}
|
12166 |
+
/**
|
12167 |
+
* Check whether the current document has any sort of selection. This includes
|
12168 |
+
* ranges of text across elements and any selection inside <input> and
|
12169 |
+
* <textarea> elements.
|
12170 |
+
*
|
12171 |
+
* @param {Document} doc The document to check.
|
12172 |
+
*
|
12173 |
+
* @return {boolean} Whether there is any sort of "selection" in the document.
|
12174 |
+
*/
|
12175 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12176 |
|
12177 |
+
function documentHasUncollapsedSelection(doc) {
|
12178 |
+
return documentHasTextSelection(doc) || inputFieldHasUncollapsedSelection(doc.activeElement);
|
|
|
|
|
12179 |
}
|
12180 |
+
/**
|
12181 |
+
* Check whether the current document has a selection. This checks for both
|
12182 |
+
* focus in an input field and general text selection.
|
12183 |
+
*
|
12184 |
+
* @param {Document} doc The document to check.
|
12185 |
+
*
|
12186 |
+
* @return {boolean} True if there is selection, false if not.
|
12187 |
+
*/
|
|
|
|
|
|
|
12188 |
|
12189 |
+
function documentHasSelection(doc) {
|
12190 |
+
return isTextField(doc.activeElement) || isNumberInput(doc.activeElement) || documentHasTextSelection(doc);
|
12191 |
+
}
|
12192 |
+
/**
|
12193 |
+
* Check whether the contents of the element have been entirely selected.
|
12194 |
+
* Returns true if there is no possibility of selection.
|
12195 |
+
*
|
12196 |
+
* @param {Element} element The element to check.
|
12197 |
+
*
|
12198 |
+
* @return {boolean} True if entirely selected, false if not.
|
12199 |
+
*/
|
12200 |
|
12201 |
+
function isEntirelySelected(element) {
|
12202 |
+
if (Object(lodash__WEBPACK_IMPORTED_MODULE_0__["includes"])(['INPUT', 'TEXTAREA'], element.nodeName)) {
|
12203 |
+
return element.selectionStart === 0 && element.value.length === element.selectionEnd;
|
12204 |
+
}
|
12205 |
|
12206 |
+
if (!element.isContentEditable) {
|
12207 |
+
return true;
|
12208 |
+
}
|
12209 |
|
12210 |
+
var ownerDocument = element.ownerDocument;
|
12211 |
+
var defaultView = ownerDocument.defaultView;
|
12212 |
+
var selection = defaultView.getSelection();
|
12213 |
+
var range = selection.rangeCount ? selection.getRangeAt(0) : null;
|
|
|
12214 |
|
12215 |
+
if (!range) {
|
12216 |
+
return true;
|
12217 |
+
}
|
12218 |
|
12219 |
+
var startContainer = range.startContainer,
|
12220 |
+
endContainer = range.endContainer,
|
12221 |
+
startOffset = range.startOffset,
|
12222 |
+
endOffset = range.endOffset;
|
12223 |
|
12224 |
+
if (startContainer === element && endContainer === element && startOffset === 0 && endOffset === element.childNodes.length) {
|
12225 |
+
return true;
|
12226 |
+
}
|
12227 |
|
12228 |
+
var lastChild = element.lastChild;
|
12229 |
+
var lastChildContentLength = lastChild.nodeType === lastChild.TEXT_NODE ? lastChild.data.length : lastChild.childNodes.length;
|
12230 |
+
return startContainer === element.firstChild && endContainer === element.lastChild && startOffset === 0 && endOffset === lastChildContentLength;
|
12231 |
+
}
|
12232 |
+
/**
|
12233 |
+
* Given a DOM node, finds the closest scrollable container node.
|
12234 |
+
*
|
12235 |
+
* @param {Element} node Node from which to start.
|
12236 |
+
*
|
12237 |
+
* @return {?Element} Scrollable container node, if found.
|
12238 |
+
*/
|
12239 |
|
12240 |
+
function getScrollContainer(node) {
|
12241 |
+
if (!node) {
|
12242 |
+
return;
|
12243 |
+
} // Scrollable if scrollable height exceeds displayed...
|
12244 |
|
|
|
12245 |
|
12246 |
+
if (node.scrollHeight > node.clientHeight) {
|
12247 |
+
// ...except when overflow is defined to be hidden or visible
|
12248 |
+
var _getComputedStyle = getComputedStyle(node),
|
12249 |
+
overflowY = _getComputedStyle.overflowY;
|
12250 |
|
12251 |
+
if (/(auto|scroll)/.test(overflowY)) {
|
12252 |
+
return node;
|
12253 |
+
}
|
12254 |
+
} // Continue traversing
|
12255 |
|
|
|
12256 |
|
12257 |
+
return getScrollContainer(node.parentNode);
|
12258 |
+
}
|
12259 |
+
/**
|
12260 |
+
* Returns the closest positioned element, or null under any of the conditions
|
12261 |
+
* of the offsetParent specification. Unlike offsetParent, this function is not
|
12262 |
+
* limited to HTMLElement and accepts any Node (e.g. Node.TEXT_NODE).
|
12263 |
+
*
|
12264 |
+
* @see https://drafts.csswg.org/cssom-view/#dom-htmlelement-offsetparent
|
12265 |
+
*
|
12266 |
+
* @param {Node} node Node from which to find offset parent.
|
12267 |
+
*
|
12268 |
+
* @return {?Node} Offset parent.
|
12269 |
+
*/
|
12270 |
|
12271 |
+
function getOffsetParent(node) {
|
12272 |
+
// Cannot retrieve computed style or offset parent only anything other than
|
12273 |
+
// an element node, so find the closest element node.
|
12274 |
+
var closestElement;
|
12275 |
|
12276 |
+
while (closestElement = node.parentNode) {
|
12277 |
+
if (closestElement.nodeType === closestElement.ELEMENT_NODE) {
|
12278 |
+
break;
|
12279 |
+
}
|
12280 |
+
}
|
12281 |
|
12282 |
+
if (!closestElement) {
|
12283 |
+
return null;
|
12284 |
+
} // If the closest element is already positioned, return it, as offsetParent
|
12285 |
+
// does not otherwise consider the node itself.
|
12286 |
|
|
|
|
|
12287 |
|
12288 |
+
if (getComputedStyle(closestElement).position !== 'static') {
|
12289 |
+
return closestElement;
|
12290 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12291 |
|
12292 |
+
return closestElement.offsetParent;
|
12293 |
+
}
|
12294 |
+
/**
|
12295 |
+
* Given two DOM nodes, replaces the former with the latter in the DOM.
|
12296 |
+
*
|
12297 |
+
* @param {Element} processedNode Node to be removed.
|
12298 |
+
* @param {Element} newNode Node to be inserted in its place.
|
12299 |
+
* @return {void}
|
12300 |
+
*/
|
12301 |
|
12302 |
+
function replace(processedNode, newNode) {
|
12303 |
+
insertAfter(newNode, processedNode.parentNode);
|
12304 |
+
remove(processedNode);
|
12305 |
+
}
|
12306 |
/**
|
12307 |
+
* Given a DOM node, removes it from the DOM.
|
12308 |
+
*
|
12309 |
+
* @param {Element} node Node to be removed.
|
12310 |
+
* @return {void}
|
12311 |
*/
|
|
|
12312 |
|
12313 |
+
function remove(node) {
|
12314 |
+
node.parentNode.removeChild(node);
|
12315 |
+
}
|
12316 |
+
/**
|
12317 |
+
* Given two DOM nodes, inserts the former in the DOM as the next sibling of
|
12318 |
+
* the latter.
|
12319 |
+
*
|
12320 |
+
* @param {Element} newNode Node to be inserted.
|
12321 |
+
* @param {Element} referenceNode Node after which to perform the insertion.
|
12322 |
+
* @return {void}
|
12323 |
+
*/
|
12324 |
|
12325 |
+
function insertAfter(newNode, referenceNode) {
|
12326 |
+
referenceNode.parentNode.insertBefore(newNode, referenceNode.nextSibling);
|
12327 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
12328 |
/**
|
12329 |
+
* Unwrap the given node. This means any child nodes are moved to the parent.
|
12330 |
*
|
12331 |
+
* @param {Node} node The node to unwrap.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12332 |
*
|
12333 |
+
* @return {void}
|
|
|
12334 |
*/
|
12335 |
|
12336 |
+
function unwrap(node) {
|
12337 |
+
var parent = node.parentNode;
|
|
|
|
|
|
|
12338 |
|
12339 |
+
while (node.firstChild) {
|
12340 |
+
parent.insertBefore(node.firstChild, node);
|
12341 |
}
|
12342 |
|
12343 |
+
parent.removeChild(node);
|
|
|
12344 |
}
|
12345 |
/**
|
12346 |
+
* Replaces the given node with a new node with the given tag name.
|
|
|
|
|
|
|
12347 |
*
|
12348 |
+
* @param {Element} node The node to replace
|
12349 |
+
* @param {string} tagName The new tag name.
|
12350 |
*
|
12351 |
+
* @return {Element} The new node.
|
|
|
|
|
|
|
|
|
|
|
12352 |
*/
|
12353 |
|
12354 |
+
function replaceTag(node, tagName) {
|
12355 |
+
var newNode = node.ownerDocument.createElement(tagName);
|
|
|
|
|
12356 |
|
12357 |
+
while (node.firstChild) {
|
12358 |
+
newNode.appendChild(node.firstChild);
|
12359 |
}
|
12360 |
|
12361 |
+
node.parentNode.replaceChild(newNode, node);
|
12362 |
+
return newNode;
|
12363 |
}
|
12364 |
/**
|
12365 |
+
* Wraps the given node with a new node with the given tag name.
|
12366 |
*
|
12367 |
+
* @param {Element} newNode The node to insert.
|
12368 |
+
* @param {Element} referenceNode The node to wrap.
|
12369 |
*/
|
12370 |
|
12371 |
+
function wrap(newNode, referenceNode) {
|
12372 |
+
referenceNode.parentNode.insertBefore(newNode, referenceNode);
|
12373 |
+
newNode.appendChild(referenceNode);
|
12374 |
}
|
12375 |
+
/**
|
12376 |
+
* Removes any HTML tags from the provided string.
|
12377 |
+
*
|
12378 |
+
* @param {string} html The string containing html.
|
12379 |
+
*
|
12380 |
+
* @return {string} The text content with any html removed.
|
12381 |
+
*/
|
12382 |
|
12383 |
+
function __unstableStripHTML(html) {
|
12384 |
+
var document = new window.DOMParser().parseFromString(html, 'text/html');
|
12385 |
+
return document.body.textContent || '';
|
12386 |
+
}
|
12387 |
+
/**
|
12388 |
+
* Given a schema, unwraps or removes nodes, attributes and classes on a node
|
12389 |
+
* list.
|
12390 |
+
*
|
12391 |
+
* @param {NodeList} nodeList The nodeList to filter.
|
12392 |
+
* @param {Document} doc The document of the nodeList.
|
12393 |
+
* @param {Object} schema An array of functions that can mutate with the provided node.
|
12394 |
+
* @param {Object} inline Whether to clean for inline mode.
|
12395 |
+
*/
|
12396 |
|
12397 |
+
function cleanNodeList(nodeList, doc, schema, inline) {
|
12398 |
+
Array.from(nodeList).forEach(function (node) {
|
12399 |
+
var tag = node.nodeName.toLowerCase(); // It's a valid child, if the tag exists in the schema without an isMatch
|
12400 |
+
// function, or with an isMatch function that matches the node.
|
12401 |
|
12402 |
+
if (schema.hasOwnProperty(tag) && (!schema[tag].isMatch || schema[tag].isMatch(node))) {
|
12403 |
+
if (node.nodeType === node.ELEMENT_NODE) {
|
12404 |
+
var _schema$tag = schema[tag],
|
12405 |
+
_schema$tag$attribute = _schema$tag.attributes,
|
12406 |
+
attributes = _schema$tag$attribute === void 0 ? [] : _schema$tag$attribute,
|
12407 |
+
_schema$tag$classes = _schema$tag.classes,
|
12408 |
+
classes = _schema$tag$classes === void 0 ? [] : _schema$tag$classes,
|
12409 |
+
children = _schema$tag.children,
|
12410 |
+
_schema$tag$require = _schema$tag.require,
|
12411 |
+
require = _schema$tag$require === void 0 ? [] : _schema$tag$require,
|
12412 |
+
allowEmpty = _schema$tag.allowEmpty; // If the node is empty and it's supposed to have children,
|
12413 |
+
// remove the node.
|
12414 |
|
|
|
12415 |
|
12416 |
+
if (children && !allowEmpty && isEmpty(node)) {
|
12417 |
+
remove(node);
|
12418 |
+
return;
|
12419 |
+
}
|
12420 |
|
12421 |
+
if (node.hasAttributes()) {
|
12422 |
+
// Strip invalid attributes.
|
12423 |
+
Array.from(node.attributes).forEach(function (_ref) {
|
12424 |
+
var name = _ref.name;
|
12425 |
|
12426 |
+
if (name !== 'class' && !Object(lodash__WEBPACK_IMPORTED_MODULE_0__["includes"])(attributes, name)) {
|
12427 |
+
node.removeAttribute(name);
|
12428 |
+
}
|
12429 |
+
}); // Strip invalid classes.
|
12430 |
+
// In jsdom-jscore, 'node.classList' can be undefined.
|
12431 |
+
// TODO: Explore patching this in jsdom-jscore.
|
12432 |
+
|
12433 |
+
if (node.classList && node.classList.length) {
|
12434 |
+
var mattchers = classes.map(function (item) {
|
12435 |
+
if (typeof item === 'string') {
|
12436 |
+
return function (className) {
|
12437 |
+
return className === item;
|
12438 |
+
};
|
12439 |
+
} else if (item instanceof RegExp) {
|
12440 |
+
return function (className) {
|
12441 |
+
return item.test(className);
|
12442 |
+
};
|
12443 |
+
}
|
12444 |
+
|
12445 |
+
return lodash__WEBPACK_IMPORTED_MODULE_0__["noop"];
|
12446 |
+
});
|
12447 |
+
Array.from(node.classList).forEach(function (name) {
|
12448 |
+
if (!mattchers.some(function (isMatch) {
|
12449 |
+
return isMatch(name);
|
12450 |
+
})) {
|
12451 |
+
node.classList.remove(name);
|
12452 |
+
}
|
12453 |
+
});
|
12454 |
+
|
12455 |
+
if (!node.classList.length) {
|
12456 |
+
node.removeAttribute('class');
|
12457 |
+
}
|
12458 |
+
}
|
12459 |
}
|
|
|
|
|
12460 |
|
12461 |
+
if (node.hasChildNodes()) {
|
12462 |
+
// Do not filter any content.
|
12463 |
+
if (children === '*') {
|
12464 |
+
return;
|
12465 |
+
} // Continue if the node is supposed to have children.
|
12466 |
|
|
|
|
|
12467 |
|
12468 |
+
if (children) {
|
12469 |
+
// If a parent requires certain children, but it does
|
12470 |
+
// not have them, drop the parent and continue.
|
12471 |
+
if (require.length && !node.querySelector(require.join(','))) {
|
12472 |
+
cleanNodeList(node.childNodes, doc, schema, inline);
|
12473 |
+
unwrap(node); // If the node is at the top, phrasing content, and
|
12474 |
+
// contains children that are block content, unwrap
|
12475 |
+
// the node because it is invalid.
|
12476 |
+
} else if (node.parentNode.nodeName === 'BODY' && Object(_phrasing_content__WEBPACK_IMPORTED_MODULE_1__[/* isPhrasingContent */ "a"])(node)) {
|
12477 |
+
cleanNodeList(node.childNodes, doc, schema, inline);
|
12478 |
|
12479 |
+
if (Array.from(node.childNodes).some(function (child) {
|
12480 |
+
return !Object(_phrasing_content__WEBPACK_IMPORTED_MODULE_1__[/* isPhrasingContent */ "a"])(child);
|
12481 |
+
})) {
|
12482 |
+
unwrap(node);
|
12483 |
+
}
|
12484 |
+
} else {
|
12485 |
+
cleanNodeList(node.childNodes, doc, children, inline);
|
12486 |
+
} // Remove children if the node is not supposed to have any.
|
12487 |
|
12488 |
+
} else {
|
12489 |
+
while (node.firstChild) {
|
12490 |
+
remove(node.firstChild);
|
12491 |
+
}
|
12492 |
+
}
|
12493 |
+
}
|
12494 |
+
} // Invalid child. Continue with schema at the same place and unwrap.
|
12495 |
|
12496 |
+
} else {
|
12497 |
+
cleanNodeList(node.childNodes, doc, schema, inline); // For inline mode, insert a line break when unwrapping nodes that
|
12498 |
+
// are not phrasing content.
|
|
|
|
|
|
|
12499 |
|
12500 |
+
if (inline && !Object(_phrasing_content__WEBPACK_IMPORTED_MODULE_1__[/* isPhrasingContent */ "a"])(node) && node.nextElementSibling) {
|
12501 |
+
insertAfter(doc.createElement('br'), node);
|
12502 |
+
}
|
12503 |
|
12504 |
+
unwrap(node);
|
12505 |
+
}
|
12506 |
+
});
|
12507 |
+
}
|
12508 |
+
/**
|
12509 |
+
* Recursively checks if an element is empty. An element is not empty if it
|
12510 |
+
* contains text or contains elements with attributes such as images.
|
12511 |
+
*
|
12512 |
+
* @param {Element} element The element to check.
|
12513 |
+
*
|
12514 |
+
* @return {boolean} Wether or not the element is empty.
|
12515 |
+
*/
|
12516 |
|
|
|
|
|
12517 |
|
12518 |
+
function isEmpty(element) {
|
12519 |
+
if (!element.hasChildNodes()) {
|
12520 |
+
return true;
|
12521 |
+
}
|
12522 |
|
12523 |
+
return Array.from(element.childNodes).every(function (node) {
|
12524 |
+
if (node.nodeType === node.TEXT_NODE) {
|
12525 |
+
return !node.nodeValue.trim();
|
12526 |
+
}
|
12527 |
|
12528 |
+
if (node.nodeType === node.ELEMENT_NODE) {
|
12529 |
+
if (node.nodeName === 'BR') {
|
12530 |
+
return true;
|
12531 |
+
} else if (node.hasAttributes()) {
|
12532 |
+
return false;
|
12533 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12534 |
|
12535 |
+
return isEmpty(node);
|
12536 |
+
}
|
12537 |
|
12538 |
+
return true;
|
12539 |
+
});
|
12540 |
+
}
|
12541 |
+
/**
|
12542 |
+
* Given a schema, unwraps or removes nodes, attributes and classes on HTML.
|
12543 |
+
*
|
12544 |
+
* @param {string} HTML The HTML to clean up.
|
12545 |
+
* @param {Object} schema Schema for the HTML.
|
12546 |
+
* @param {Object} inline Whether to clean for inline mode.
|
12547 |
+
*
|
12548 |
+
* @return {string} The cleaned up HTML.
|
12549 |
+
*/
|
12550 |
|
12551 |
+
function removeInvalidHTML(HTML, schema, inline) {
|
12552 |
+
var doc = document.implementation.createHTMLDocument('');
|
12553 |
+
doc.body.innerHTML = HTML;
|
12554 |
+
cleanNodeList(doc.body.childNodes, doc, schema, inline);
|
12555 |
+
return doc.body.innerHTML;
|
12556 |
+
}
|
12557 |
+
//# sourceMappingURL=dom.js.map
|
12558 |
|
12559 |
/***/ }),
|
12560 |
+
/* 130 */
|
|
|
12561 |
/***/ (function(module, exports) {
|
12562 |
|
12563 |
+
function _inheritsLoose(subClass, superClass) {
|
12564 |
+
subClass.prototype = Object.create(superClass.prototype);
|
12565 |
+
subClass.prototype.constructor = subClass;
|
12566 |
+
subClass.__proto__ = superClass;
|
12567 |
+
}
|
12568 |
|
12569 |
+
module.exports = _inheritsLoose;
|
12570 |
|
12571 |
+
/***/ }),
|
12572 |
+
/* 131 */,
|
12573 |
+
/* 132 */,
|
12574 |
+
/* 133 */
|
12575 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
12576 |
|
12577 |
"use strict";
|
12578 |
+
/* harmony import */ var _babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(16);
|
12579 |
+
/* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(17);
|
12580 |
+
/* harmony import */ var _babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(18);
|
12581 |
+
/* harmony import */ var _babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(21);
|
12582 |
+
/* harmony import */ var _babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(9);
|
12583 |
+
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(0);
|
12584 |
+
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_5__);
|
12585 |
+
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(2);
|
12586 |
+
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_6__);
|
12587 |
+
/* harmony import */ var _popover__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(117);
|
12588 |
+
/* harmony import */ var _shortcut__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(116);
|
12589 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12590 |
|
12591 |
|
|
|
12592 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12593 |
|
|
|
12594 |
|
|
|
|
|
12595 |
|
12596 |
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__[/* default */ "a"])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__[/* default */ "a"])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__[/* default */ "a"])(this, result); }; }
|
|
|
12597 |
|
12598 |
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
|
|
|
12599 |
|
12600 |
+
/**
|
12601 |
+
* External dependencies
|
12602 |
+
*/
|
12603 |
|
12604 |
+
/**
|
12605 |
+
* WordPress dependencies
|
12606 |
+
*/
|
12607 |
|
12608 |
|
12609 |
+
/**
|
12610 |
+
* Internal dependencies
|
12611 |
+
*/
|
12612 |
|
12613 |
|
12614 |
|
12615 |
+
/**
|
12616 |
+
* Time over children to wait before showing tooltip
|
12617 |
+
*
|
12618 |
+
* @type {number}
|
12619 |
+
*/
|
12620 |
|
12621 |
+
var TOOLTIP_DELAY = 700;
|
12622 |
|
12623 |
+
var Tooltip = /*#__PURE__*/function (_Component) {
|
12624 |
+
Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_2__[/* default */ "a"])(Tooltip, _Component);
|
|
|
12625 |
|
12626 |
+
var _super = _createSuper(Tooltip);
|
|
|
|
|
|
|
|
|
|
|
12627 |
|
12628 |
+
function Tooltip() {
|
12629 |
+
var _this;
|
12630 |
|
12631 |
+
Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])(this, Tooltip);
|
|
|
12632 |
|
12633 |
+
_this = _super.apply(this, arguments);
|
12634 |
+
_this.delayedSetIsOver = Object(lodash__WEBPACK_IMPORTED_MODULE_6__["debounce"])(function (isOver) {
|
12635 |
+
return _this.setState({
|
12636 |
+
isOver: isOver
|
12637 |
+
});
|
12638 |
+
}, TOOLTIP_DELAY);
|
12639 |
+
/**
|
12640 |
+
* Prebound `isInMouseDown` handler, created as a constant reference to
|
12641 |
+
* assure ability to remove in component unmount.
|
12642 |
+
*
|
12643 |
+
* @type {Function}
|
12644 |
+
*/
|
12645 |
|
12646 |
+
_this.cancelIsMouseDown = _this.createSetIsMouseDown(false);
|
12647 |
+
/**
|
12648 |
+
* Whether a the mouse is currently pressed, used in determining whether
|
12649 |
+
* to handle a focus event as displaying the tooltip immediately.
|
12650 |
+
*
|
12651 |
+
* @type {boolean}
|
12652 |
+
*/
|
12653 |
|
12654 |
+
_this.isInMouseDown = false;
|
12655 |
+
_this.state = {
|
12656 |
+
isOver: false
|
12657 |
+
};
|
12658 |
+
return _this;
|
|
|
|
|
12659 |
}
|
12660 |
|
12661 |
+
Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"])(Tooltip, [{
|
12662 |
+
key: "componentWillUnmount",
|
12663 |
+
value: function componentWillUnmount() {
|
12664 |
+
this.delayedSetIsOver.cancel();
|
12665 |
+
document.removeEventListener('mouseup', this.cancelIsMouseDown);
|
12666 |
+
}
|
12667 |
+
}, {
|
12668 |
+
key: "emitToChild",
|
12669 |
+
value: function emitToChild(eventName, event) {
|
12670 |
+
var children = this.props.children;
|
12671 |
|
12672 |
+
if (_wordpress_element__WEBPACK_IMPORTED_MODULE_5__["Children"].count(children) !== 1) {
|
12673 |
+
return;
|
12674 |
+
}
|
12675 |
|
12676 |
+
var child = _wordpress_element__WEBPACK_IMPORTED_MODULE_5__["Children"].only(children);
|
|
|
|
|
|
|
|
|
12677 |
|
12678 |
+
if (typeof child.props[eventName] === 'function') {
|
12679 |
+
child.props[eventName](event);
|
12680 |
+
}
|
12681 |
}
|
12682 |
+
}, {
|
12683 |
+
key: "createToggleIsOver",
|
12684 |
+
value: function createToggleIsOver(eventName, isDelayed) {
|
12685 |
+
var _this2 = this;
|
12686 |
|
12687 |
+
return function (event) {
|
12688 |
+
// Preserve original child callback behavior
|
12689 |
+
_this2.emitToChild(eventName, event); // Mouse events behave unreliably in React for disabled elements,
|
12690 |
+
// firing on mouseenter but not mouseleave. Further, the default
|
12691 |
+
// behavior for disabled elements in some browsers is to ignore
|
12692 |
+
// mouse events. Don't bother trying to to handle them.
|
12693 |
+
//
|
12694 |
+
// See: https://github.com/facebook/react/issues/4251
|
12695 |
|
|
|
|
|
12696 |
|
12697 |
+
if (event.currentTarget.disabled) {
|
12698 |
+
return;
|
12699 |
+
} // A focus event will occur as a result of a mouse click, but it
|
12700 |
+
// should be disambiguated between interacting with the button and
|
12701 |
+
// using an explicit focus shift as a cue to display the tooltip.
|
12702 |
|
12703 |
|
12704 |
+
if ('focus' === event.type && _this2.isInMouseDown) {
|
12705 |
+
return;
|
12706 |
+
} // Needed in case unsetting is over while delayed set pending, i.e.
|
12707 |
+
// quickly blur/mouseleave before delayedSetIsOver is called
|
|
|
|
|
12708 |
|
|
|
|
|
12709 |
|
12710 |
+
_this2.delayedSetIsOver.cancel();
|
|
|
|
|
12711 |
|
12712 |
+
var isOver = Object(lodash__WEBPACK_IMPORTED_MODULE_6__["includes"])(['focus', 'mouseenter'], event.type);
|
|
|
12713 |
|
12714 |
+
if (isOver === _this2.state.isOver) {
|
12715 |
+
return;
|
|
|
|
|
12716 |
}
|
12717 |
|
12718 |
+
if (isDelayed) {
|
12719 |
+
_this2.delayedSetIsOver(isOver);
|
12720 |
+
} else {
|
12721 |
+
_this2.setState({
|
12722 |
+
isOver: isOver
|
12723 |
+
});
|
12724 |
}
|
12725 |
+
};
|
12726 |
+
}
|
12727 |
+
/**
|
12728 |
+
* Creates an event callback to handle assignment of the `isInMouseDown`
|
12729 |
+
* instance property in response to a `mousedown` or `mouseup` event.
|
12730 |
+
*
|
12731 |
+
* @param {boolean} isMouseDown Whether handler is to be created for the
|
12732 |
+
* `mousedown` event, as opposed to `mouseup`.
|
12733 |
+
*
|
12734 |
+
* @return {Function} Event callback handler.
|
12735 |
+
*/
|
12736 |
|
12737 |
+
}, {
|
12738 |
+
key: "createSetIsMouseDown",
|
12739 |
+
value: function createSetIsMouseDown(isMouseDown) {
|
12740 |
+
var _this3 = this;
|
12741 |
|
12742 |
+
return function (event) {
|
12743 |
+
// Preserve original child callback behavior
|
12744 |
+
_this3.emitToChild(isMouseDown ? 'onMouseDown' : 'onMouseUp', event); // On mouse down, the next `mouseup` should revert the value of the
|
12745 |
+
// instance property and remove its own event handler. The bind is
|
12746 |
+
// made on the document since the `mouseup` might not occur within
|
12747 |
+
// the bounds of the element.
|
12748 |
|
|
|
|
|
|
|
|
|
|
|
12749 |
|
12750 |
+
document[isMouseDown ? 'addEventListener' : 'removeEventListener']('mouseup', _this3.cancelIsMouseDown);
|
12751 |
+
_this3.isInMouseDown = isMouseDown;
|
12752 |
+
};
|
12753 |
+
}
|
12754 |
+
}, {
|
12755 |
+
key: "render",
|
12756 |
+
value: function render() {
|
12757 |
+
var _this$props = this.props,
|
12758 |
+
children = _this$props.children,
|
12759 |
+
position = _this$props.position,
|
12760 |
+
text = _this$props.text,
|
12761 |
+
shortcut = _this$props.shortcut;
|
12762 |
|
12763 |
+
if (_wordpress_element__WEBPACK_IMPORTED_MODULE_5__["Children"].count(children) !== 1) {
|
12764 |
if (false) {}
|
12765 |
|
12766 |
+
return children;
|
12767 |
+
}
|
12768 |
|
12769 |
+
var child = _wordpress_element__WEBPACK_IMPORTED_MODULE_5__["Children"].only(children);
|
12770 |
+
var isOver = this.state.isOver;
|
12771 |
+
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_5__["cloneElement"])(child, {
|
12772 |
+
onMouseEnter: this.createToggleIsOver('onMouseEnter', true),
|
12773 |
+
onMouseLeave: this.createToggleIsOver('onMouseLeave'),
|
12774 |
+
onClick: this.createToggleIsOver('onClick'),
|
12775 |
+
onFocus: this.createToggleIsOver('onFocus'),
|
12776 |
+
onBlur: this.createToggleIsOver('onBlur'),
|
12777 |
+
onMouseDown: this.createSetIsMouseDown(true),
|
12778 |
+
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 */ "a"], {
|
12779 |
+
focusOnMount: false,
|
12780 |
+
position: position,
|
12781 |
+
className: "components-tooltip",
|
12782 |
+
"aria-hidden": "true",
|
12783 |
+
animate: false,
|
12784 |
+
noArrow: true
|
12785 |
+
}, text, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_5__["createElement"])(_shortcut__WEBPACK_IMPORTED_MODULE_8__[/* default */ "a"], {
|
12786 |
+
className: "components-tooltip__shortcut",
|
12787 |
+
shortcut: shortcut
|
12788 |
+
})))
|
12789 |
});
|
12790 |
+
}
|
12791 |
+
}]);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12792 |
|
12793 |
+
return Tooltip;
|
12794 |
+
}(_wordpress_element__WEBPACK_IMPORTED_MODULE_5__["Component"]);
|
12795 |
|
12796 |
+
/* harmony default export */ __webpack_exports__["a"] = (Tooltip);
|
12797 |
+
//# sourceMappingURL=index.js.map
|
|
|
12798 |
|
12799 |
+
/***/ }),
|
12800 |
+
/* 134 */,
|
12801 |
+
/* 135 */
|
12802 |
+
/***/ (function(module, exports) {
|
12803 |
|
12804 |
+
function _setPrototypeOf(o, p) {
|
12805 |
+
module.exports = _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
|
12806 |
+
o.__proto__ = p;
|
12807 |
+
return o;
|
12808 |
};
|
|
|
|
|
|
|
12809 |
|
12810 |
+
return _setPrototypeOf(o, p);
|
12811 |
+
}
|
12812 |
|
12813 |
+
module.exports = _setPrototypeOf;
|
|
|
|
|
|
|
|
|
|
|
12814 |
|
12815 |
/***/ }),
|
12816 |
+
/* 136 */
|
|
|
12817 |
/***/ (function(module, exports, __webpack_require__) {
|
12818 |
|
12819 |
"use strict";
|
12820 |
|
12821 |
|
12822 |
+
var utils = __webpack_require__(87);
|
12823 |
+
var formats = __webpack_require__(96);
|
12824 |
+
var has = Object.prototype.hasOwnProperty;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12825 |
|
12826 |
+
var arrayPrefixGenerators = {
|
12827 |
+
brackets: function brackets(prefix) {
|
12828 |
+
return prefix + '[]';
|
12829 |
+
},
|
12830 |
+
comma: 'comma',
|
12831 |
+
indices: function indices(prefix, key) {
|
12832 |
+
return prefix + '[' + key + ']';
|
12833 |
+
},
|
12834 |
+
repeat: function repeat(prefix) {
|
12835 |
+
return prefix;
|
12836 |
}
|
|
|
|
|
|
|
12837 |
};
|
|
|
|
|
|
|
|
|
12838 |
|
12839 |
+
var isArray = Array.isArray;
|
12840 |
+
var push = Array.prototype.push;
|
12841 |
+
var pushToArray = function (arr, valueOrArray) {
|
12842 |
+
push.apply(arr, isArray(valueOrArray) ? valueOrArray : [valueOrArray]);
|
12843 |
+
};
|
|
|
|
|
|
|
|
|
|
|
|
|
12844 |
|
12845 |
+
var toISO = Date.prototype.toISOString;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12846 |
|
12847 |
+
var defaultFormat = formats['default'];
|
12848 |
+
var defaults = {
|
12849 |
+
addQueryPrefix: false,
|
12850 |
+
allowDots: false,
|
12851 |
+
charset: 'utf-8',
|
12852 |
+
charsetSentinel: false,
|
12853 |
+
delimiter: '&',
|
12854 |
+
encode: true,
|
12855 |
+
encoder: utils.encode,
|
12856 |
+
encodeValuesOnly: false,
|
12857 |
+
format: defaultFormat,
|
12858 |
+
formatter: formats.formatters[defaultFormat],
|
12859 |
+
// deprecated
|
12860 |
+
indices: false,
|
12861 |
+
serializeDate: function serializeDate(date) {
|
12862 |
+
return toISO.call(date);
|
12863 |
+
},
|
12864 |
+
skipNulls: false,
|
12865 |
+
strictNullHandling: false
|
12866 |
+
};
|
12867 |
|
12868 |
+
var isNonNullishPrimitive = function isNonNullishPrimitive(v) {
|
12869 |
+
return typeof v === 'string'
|
12870 |
+
|| typeof v === 'number'
|
12871 |
+
|| typeof v === 'boolean'
|
12872 |
+
|| typeof v === 'symbol'
|
12873 |
+
|| typeof v === 'bigint';
|
12874 |
+
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12875 |
|
12876 |
+
var stringify = function stringify(
|
12877 |
+
object,
|
12878 |
+
prefix,
|
12879 |
+
generateArrayPrefix,
|
12880 |
+
strictNullHandling,
|
12881 |
+
skipNulls,
|
12882 |
+
encoder,
|
12883 |
+
filter,
|
12884 |
+
sort,
|
12885 |
+
allowDots,
|
12886 |
+
serializeDate,
|
12887 |
+
formatter,
|
12888 |
+
encodeValuesOnly,
|
12889 |
+
charset
|
12890 |
+
) {
|
12891 |
+
var obj = object;
|
12892 |
+
if (typeof filter === 'function') {
|
12893 |
+
obj = filter(prefix, obj);
|
12894 |
+
} else if (obj instanceof Date) {
|
12895 |
+
obj = serializeDate(obj);
|
12896 |
+
} else if (generateArrayPrefix === 'comma' && isArray(obj)) {
|
12897 |
+
obj = utils.maybeMap(obj, function (value) {
|
12898 |
+
if (value instanceof Date) {
|
12899 |
+
return serializeDate(value);
|
12900 |
+
}
|
12901 |
+
return value;
|
12902 |
+
}).join(',');
|
12903 |
+
}
|
12904 |
|
12905 |
+
if (obj === null) {
|
12906 |
+
if (strictNullHandling) {
|
12907 |
+
return encoder && !encodeValuesOnly ? encoder(prefix, defaults.encoder, charset, 'key') : prefix;
|
12908 |
+
}
|
|
|
|
|
|
|
12909 |
|
12910 |
+
obj = '';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12911 |
}
|
|
|
12912 |
|
12913 |
+
if (isNonNullishPrimitive(obj) || utils.isBuffer(obj)) {
|
12914 |
+
if (encoder) {
|
12915 |
+
var keyValue = encodeValuesOnly ? prefix : encoder(prefix, defaults.encoder, charset, 'key');
|
12916 |
+
return [formatter(keyValue) + '=' + formatter(encoder(obj, defaults.encoder, charset, 'value'))];
|
12917 |
+
}
|
12918 |
+
return [formatter(prefix) + '=' + formatter(String(obj))];
|
12919 |
+
}
|
12920 |
|
12921 |
+
var values = [];
|
|
|
|
|
|
|
|
|
|
|
|
|
12922 |
|
12923 |
+
if (typeof obj === 'undefined') {
|
12924 |
+
return values;
|
12925 |
+
}
|
12926 |
|
12927 |
+
var objKeys;
|
12928 |
+
if (isArray(filter)) {
|
12929 |
+
objKeys = filter;
|
12930 |
+
} else {
|
12931 |
+
var keys = Object.keys(obj);
|
12932 |
+
objKeys = sort ? keys.sort(sort) : keys;
|
12933 |
+
}
|
12934 |
|
12935 |
+
for (var i = 0; i < objKeys.length; ++i) {
|
12936 |
+
var key = objKeys[i];
|
12937 |
+
var value = obj[key];
|
12938 |
|
12939 |
+
if (skipNulls && value === null) {
|
12940 |
+
continue;
|
12941 |
+
}
|
12942 |
|
12943 |
+
var keyPrefix = isArray(obj)
|
12944 |
+
? typeof generateArrayPrefix === 'function' ? generateArrayPrefix(prefix, key) : prefix
|
12945 |
+
: prefix + (allowDots ? '.' + key : '[' + key + ']');
|
12946 |
|
12947 |
+
pushToArray(values, stringify(
|
12948 |
+
value,
|
12949 |
+
keyPrefix,
|
12950 |
+
generateArrayPrefix,
|
12951 |
+
strictNullHandling,
|
12952 |
+
skipNulls,
|
12953 |
+
encoder,
|
12954 |
+
filter,
|
12955 |
+
sort,
|
12956 |
+
allowDots,
|
12957 |
+
serializeDate,
|
12958 |
+
formatter,
|
12959 |
+
encodeValuesOnly,
|
12960 |
+
charset
|
12961 |
+
));
|
12962 |
+
}
|
12963 |
|
12964 |
+
return values;
|
12965 |
+
};
|
|
|
|
|
12966 |
|
12967 |
+
var normalizeStringifyOptions = function normalizeStringifyOptions(opts) {
|
12968 |
+
if (!opts) {
|
12969 |
+
return defaults;
|
12970 |
+
}
|
|
|
12971 |
|
12972 |
+
if (opts.encoder !== null && opts.encoder !== undefined && typeof opts.encoder !== 'function') {
|
12973 |
+
throw new TypeError('Encoder has to be a function.');
|
12974 |
+
}
|
|
|
|
|
|
|
12975 |
|
12976 |
+
var charset = opts.charset || defaults.charset;
|
12977 |
+
if (typeof opts.charset !== 'undefined' && opts.charset !== 'utf-8' && opts.charset !== 'iso-8859-1') {
|
12978 |
+
throw new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined');
|
12979 |
+
}
|
12980 |
|
12981 |
+
var format = formats['default'];
|
12982 |
+
if (typeof opts.format !== 'undefined') {
|
12983 |
+
if (!has.call(formats.formatters, opts.format)) {
|
12984 |
+
throw new TypeError('Unknown format option provided.');
|
12985 |
+
}
|
12986 |
+
format = opts.format;
|
12987 |
}
|
12988 |
+
var formatter = formats.formatters[format];
|
12989 |
|
12990 |
+
var filter = defaults.filter;
|
12991 |
+
if (typeof opts.filter === 'function' || isArray(opts.filter)) {
|
12992 |
+
filter = opts.filter;
|
12993 |
+
}
|
12994 |
|
12995 |
+
return {
|
12996 |
+
addQueryPrefix: typeof opts.addQueryPrefix === 'boolean' ? opts.addQueryPrefix : defaults.addQueryPrefix,
|
12997 |
+
allowDots: typeof opts.allowDots === 'undefined' ? defaults.allowDots : !!opts.allowDots,
|
12998 |
+
charset: charset,
|
12999 |
+
charsetSentinel: typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults.charsetSentinel,
|
13000 |
+
delimiter: typeof opts.delimiter === 'undefined' ? defaults.delimiter : opts.delimiter,
|
13001 |
+
encode: typeof opts.encode === 'boolean' ? opts.encode : defaults.encode,
|
13002 |
+
encoder: typeof opts.encoder === 'function' ? opts.encoder : defaults.encoder,
|
13003 |
+
encodeValuesOnly: typeof opts.encodeValuesOnly === 'boolean' ? opts.encodeValuesOnly : defaults.encodeValuesOnly,
|
13004 |
+
filter: filter,
|
13005 |
+
formatter: formatter,
|
13006 |
+
serializeDate: typeof opts.serializeDate === 'function' ? opts.serializeDate : defaults.serializeDate,
|
13007 |
+
skipNulls: typeof opts.skipNulls === 'boolean' ? opts.skipNulls : defaults.skipNulls,
|
13008 |
+
sort: typeof opts.sort === 'function' ? opts.sort : null,
|
13009 |
+
strictNullHandling: typeof opts.strictNullHandling === 'boolean' ? opts.strictNullHandling : defaults.strictNullHandling
|
13010 |
};
|
13011 |
+
};
|
13012 |
|
13013 |
+
module.exports = function (object, opts) {
|
13014 |
+
var obj = object;
|
13015 |
+
var options = normalizeStringifyOptions(opts);
|
|
|
|
|
13016 |
|
13017 |
+
var objKeys;
|
13018 |
+
var filter;
|
13019 |
|
13020 |
+
if (typeof options.filter === 'function') {
|
13021 |
+
filter = options.filter;
|
13022 |
+
obj = filter('', obj);
|
13023 |
+
} else if (isArray(options.filter)) {
|
13024 |
+
filter = options.filter;
|
13025 |
+
objKeys = filter;
|
13026 |
+
}
|
13027 |
|
13028 |
+
var keys = [];
|
|
|
13029 |
|
13030 |
+
if (typeof obj !== 'object' || obj === null) {
|
13031 |
+
return '';
|
13032 |
}
|
13033 |
|
13034 |
+
var arrayFormat;
|
13035 |
+
if (opts && opts.arrayFormat in arrayPrefixGenerators) {
|
13036 |
+
arrayFormat = opts.arrayFormat;
|
13037 |
+
} else if (opts && 'indices' in opts) {
|
13038 |
+
arrayFormat = opts.indices ? 'indices' : 'repeat';
|
13039 |
+
} else {
|
13040 |
+
arrayFormat = 'indices';
|
13041 |
+
}
|
13042 |
|
13043 |
+
var generateArrayPrefix = arrayPrefixGenerators[arrayFormat];
|
|
|
|
|
|
|
|
|
13044 |
|
13045 |
+
if (!objKeys) {
|
13046 |
+
objKeys = Object.keys(obj);
|
13047 |
+
}
|
|
|
|
|
13048 |
|
13049 |
+
if (options.sort) {
|
13050 |
+
objKeys.sort(options.sort);
|
13051 |
+
}
|
13052 |
|
13053 |
+
for (var i = 0; i < objKeys.length; ++i) {
|
13054 |
+
var key = objKeys[i];
|
13055 |
|
13056 |
+
if (options.skipNulls && obj[key] === null) {
|
13057 |
+
continue;
|
13058 |
+
}
|
13059 |
+
pushToArray(keys, stringify(
|
13060 |
+
obj[key],
|
13061 |
+
key,
|
13062 |
+
generateArrayPrefix,
|
13063 |
+
options.strictNullHandling,
|
13064 |
+
options.skipNulls,
|
13065 |
+
options.encode ? options.encoder : null,
|
13066 |
+
options.filter,
|
13067 |
+
options.sort,
|
13068 |
+
options.allowDots,
|
13069 |
+
options.serializeDate,
|
13070 |
+
options.formatter,
|
13071 |
+
options.encodeValuesOnly,
|
13072 |
+
options.charset
|
13073 |
+
));
|
13074 |
}
|
13075 |
|
13076 |
+
var joined = keys.join(options.delimiter);
|
13077 |
+
var prefix = options.addQueryPrefix === true ? '?' : '';
|
13078 |
|
13079 |
+
if (options.charsetSentinel) {
|
13080 |
+
if (options.charset === 'iso-8859-1') {
|
13081 |
+
// encodeURIComponent('✓'), the "numeric entity" representation of a checkmark
|
13082 |
+
prefix += 'utf8=%26%2310003%3B&';
|
13083 |
+
} else {
|
13084 |
+
// encodeURIComponent('✓')
|
13085 |
+
prefix += 'utf8=%E2%9C%93&';
|
13086 |
+
}
|
13087 |
}
|
13088 |
|
13089 |
+
return joined.length > 0 ? prefix + joined : '';
|
13090 |
+
};
|
13091 |
|
|
|
|
|
|
|
13092 |
|
13093 |
+
/***/ }),
|
13094 |
+
/* 137 */
|
13095 |
+
/***/ (function(module, exports, __webpack_require__) {
|
13096 |
|
13097 |
+
"use strict";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13098 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13099 |
|
13100 |
+
var utils = __webpack_require__(87);
|
|
|
|
|
13101 |
|
13102 |
+
var has = Object.prototype.hasOwnProperty;
|
13103 |
+
var isArray = Array.isArray;
|
|
|
|
|
13104 |
|
13105 |
+
var defaults = {
|
13106 |
+
allowDots: false,
|
13107 |
+
allowPrototypes: false,
|
13108 |
+
arrayLimit: 20,
|
13109 |
+
charset: 'utf-8',
|
13110 |
+
charsetSentinel: false,
|
13111 |
+
comma: false,
|
13112 |
+
decoder: utils.decode,
|
13113 |
+
delimiter: '&',
|
13114 |
+
depth: 5,
|
13115 |
+
ignoreQueryPrefix: false,
|
13116 |
+
interpretNumericEntities: false,
|
13117 |
+
parameterLimit: 1000,
|
13118 |
+
parseArrays: true,
|
13119 |
+
plainObjects: false,
|
13120 |
+
strictNullHandling: false
|
13121 |
+
};
|
13122 |
|
13123 |
+
var interpretNumericEntities = function (str) {
|
13124 |
+
return str.replace(/&#(\d+);/g, function ($0, numberStr) {
|
13125 |
+
return String.fromCharCode(parseInt(numberStr, 10));
|
|
|
13126 |
});
|
13127 |
+
};
|
13128 |
|
13129 |
+
var parseArrayValue = function (val, options) {
|
13130 |
+
if (val && typeof val === 'string' && options.comma && val.indexOf(',') > -1) {
|
13131 |
+
return val.split(',');
|
13132 |
+
}
|
13133 |
|
13134 |
+
return val;
|
13135 |
+
};
|
13136 |
|
13137 |
+
// This is what browsers will submit when the ✓ character occurs in an
|
13138 |
+
// application/x-www-form-urlencoded body and the encoding of the page containing
|
13139 |
+
// the form is iso-8859-1, or when the submitted form has an accept-charset
|
13140 |
+
// attribute of iso-8859-1. Presumably also with other charsets that do not contain
|
13141 |
+
// the ✓ character, such as us-ascii.
|
13142 |
+
var isoSentinel = 'utf8=%26%2310003%3B'; // encodeURIComponent('✓')
|
13143 |
|
13144 |
+
// These are the percent-encoded utf-8 octets representing a checkmark, indicating that the request actually is utf-8 encoded.
|
13145 |
+
var charsetSentinel = 'utf8=%E2%9C%93'; // encodeURIComponent('✓')
|
13146 |
+
|
13147 |
+
var parseValues = function parseQueryStringValues(str, options) {
|
13148 |
+
var obj = {};
|
13149 |
+
var cleanStr = options.ignoreQueryPrefix ? str.replace(/^\?/, '') : str;
|
13150 |
+
var limit = options.parameterLimit === Infinity ? undefined : options.parameterLimit;
|
13151 |
+
var parts = cleanStr.split(options.delimiter, limit);
|
13152 |
+
var skipIndex = -1; // Keep track of where the utf8 sentinel was found
|
13153 |
+
var i;
|
13154 |
+
|
13155 |
+
var charset = options.charset;
|
13156 |
+
if (options.charsetSentinel) {
|
13157 |
+
for (i = 0; i < parts.length; ++i) {
|
13158 |
+
if (parts[i].indexOf('utf8=') === 0) {
|
13159 |
+
if (parts[i] === charsetSentinel) {
|
13160 |
+
charset = 'utf-8';
|
13161 |
+
} else if (parts[i] === isoSentinel) {
|
13162 |
+
charset = 'iso-8859-1';
|
13163 |
+
}
|
13164 |
+
skipIndex = i;
|
13165 |
+
i = parts.length; // The eslint settings do not allow break;
|
13166 |
+
}
|
13167 |
+
}
|
13168 |
+
}
|
13169 |
|
13170 |
+
for (i = 0; i < parts.length; ++i) {
|
13171 |
+
if (i === skipIndex) {
|
13172 |
+
continue;
|
13173 |
+
}
|
13174 |
+
var part = parts[i];
|
|
|
|
|
|
|
13175 |
|
13176 |
+
var bracketEqualsPos = part.indexOf(']=');
|
13177 |
+
var pos = bracketEqualsPos === -1 ? part.indexOf('=') : bracketEqualsPos + 1;
|
13178 |
|
13179 |
+
var key, val;
|
13180 |
+
if (pos === -1) {
|
13181 |
+
key = options.decoder(part, defaults.decoder, charset, 'key');
|
13182 |
+
val = options.strictNullHandling ? null : '';
|
13183 |
+
} else {
|
13184 |
+
key = options.decoder(part.slice(0, pos), defaults.decoder, charset, 'key');
|
13185 |
+
val = utils.maybeMap(
|
13186 |
+
parseArrayValue(part.slice(pos + 1), options),
|
13187 |
+
function (encodedVal) {
|
13188 |
+
return options.decoder(encodedVal, defaults.decoder, charset, 'value');
|
13189 |
+
}
|
13190 |
+
);
|
13191 |
}
|
13192 |
|
13193 |
+
if (val && options.interpretNumericEntities && charset === 'iso-8859-1') {
|
13194 |
+
val = interpretNumericEntities(val);
|
|
|
|
|
13195 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13196 |
|
13197 |
+
if (part.indexOf('[]=') > -1) {
|
13198 |
+
val = isArray(val) ? [val] : val;
|
13199 |
+
}
|
|
|
|
|
13200 |
|
13201 |
+
if (has.call(obj, key)) {
|
13202 |
+
obj[key] = utils.combine(obj[key], val);
|
13203 |
+
} else {
|
13204 |
+
obj[key] = val;
|
13205 |
+
}
|
13206 |
+
}
|
13207 |
|
13208 |
+
return obj;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13209 |
};
|
13210 |
|
13211 |
+
var parseObject = function (chain, val, options, valuesParsed) {
|
13212 |
+
var leaf = valuesParsed ? val : parseArrayValue(val, options);
|
13213 |
|
13214 |
+
for (var i = chain.length - 1; i >= 0; --i) {
|
13215 |
+
var obj;
|
13216 |
+
var root = chain[i];
|
13217 |
|
13218 |
+
if (root === '[]' && options.parseArrays) {
|
13219 |
+
obj = [].concat(leaf);
|
13220 |
+
} else {
|
13221 |
+
obj = options.plainObjects ? Object.create(null) : {};
|
13222 |
+
var cleanRoot = root.charAt(0) === '[' && root.charAt(root.length - 1) === ']' ? root.slice(1, -1) : root;
|
13223 |
+
var index = parseInt(cleanRoot, 10);
|
13224 |
+
if (!options.parseArrays && cleanRoot === '') {
|
13225 |
+
obj = { 0: leaf };
|
13226 |
+
} else if (
|
13227 |
+
!isNaN(index)
|
13228 |
+
&& root !== cleanRoot
|
13229 |
+
&& String(index) === cleanRoot
|
13230 |
+
&& index >= 0
|
13231 |
+
&& (options.parseArrays && index <= options.arrayLimit)
|
13232 |
+
) {
|
13233 |
+
obj = [];
|
13234 |
+
obj[index] = leaf;
|
13235 |
+
} else {
|
13236 |
+
obj[cleanRoot] = leaf;
|
13237 |
+
}
|
13238 |
+
}
|
13239 |
|
13240 |
+
leaf = obj; // eslint-disable-line no-param-reassign
|
|
|
|
|
|
|
|
|
|
|
|
|
13241 |
}
|
13242 |
|
13243 |
+
return leaf;
|
13244 |
+
};
|
|
|
|
|
|
|
|
|
|
|
13245 |
|
13246 |
+
var parseKeys = function parseQueryStringKeys(givenKey, val, options, valuesParsed) {
|
13247 |
+
if (!givenKey) {
|
13248 |
+
return;
|
13249 |
+
}
|
13250 |
|
13251 |
+
// Transform dot notation to bracket notation
|
13252 |
+
var key = options.allowDots ? givenKey.replace(/\.([^.[]+)/g, '[$1]') : givenKey;
|
|
|
|
|
|
|
|
|
|
|
13253 |
|
13254 |
+
// The regex chunks
|
|
|
|
|
|
|
|
|
13255 |
|
13256 |
+
var brackets = /(\[[^[\]]*])/;
|
13257 |
+
var child = /(\[[^[\]]*])/g;
|
13258 |
|
13259 |
+
// Get the parent
|
|
|
|
|
|
|
|
|
13260 |
|
13261 |
+
var segment = options.depth > 0 && brackets.exec(key);
|
13262 |
+
var parent = segment ? key.slice(0, segment.index) : key;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13263 |
|
13264 |
+
// Stash the parent if it exists
|
13265 |
|
13266 |
+
var keys = [];
|
13267 |
+
if (parent) {
|
13268 |
+
// If we aren't using plain objects, optionally prefix keys that would overwrite object prototype properties
|
13269 |
+
if (!options.plainObjects && has.call(Object.prototype, parent)) {
|
13270 |
+
if (!options.allowPrototypes) {
|
13271 |
+
return;
|
13272 |
+
}
|
13273 |
+
}
|
13274 |
|
13275 |
+
keys.push(parent);
|
13276 |
+
}
|
|
|
|
|
|
|
|
|
|
|
13277 |
|
13278 |
+
// Loop through children appending to the array until we hit depth
|
13279 |
|
13280 |
+
var i = 0;
|
13281 |
+
while (options.depth > 0 && (segment = child.exec(key)) !== null && i < options.depth) {
|
13282 |
+
i += 1;
|
13283 |
+
if (!options.plainObjects && has.call(Object.prototype, segment[1].slice(1, -1))) {
|
13284 |
+
if (!options.allowPrototypes) {
|
13285 |
+
return;
|
13286 |
+
}
|
13287 |
+
}
|
13288 |
+
keys.push(segment[1]);
|
13289 |
+
}
|
13290 |
|
13291 |
+
// If there's a remainder, just add whatever is left
|
13292 |
|
13293 |
+
if (segment) {
|
13294 |
+
keys.push('[' + key.slice(segment.index) + ']');
|
13295 |
+
}
|
13296 |
|
13297 |
+
return parseObject(keys, val, options, valuesParsed);
|
13298 |
+
};
|
|
|
|
|
|
|
13299 |
|
13300 |
+
var normalizeParseOptions = function normalizeParseOptions(opts) {
|
13301 |
+
if (!opts) {
|
13302 |
+
return defaults;
|
13303 |
+
}
|
13304 |
|
13305 |
+
if (opts.decoder !== null && opts.decoder !== undefined && typeof opts.decoder !== 'function') {
|
13306 |
+
throw new TypeError('Decoder has to be a function.');
|
13307 |
+
}
|
13308 |
|
13309 |
+
if (typeof opts.charset !== 'undefined' && opts.charset !== 'utf-8' && opts.charset !== 'iso-8859-1') {
|
13310 |
+
throw new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined');
|
13311 |
+
}
|
13312 |
+
var charset = typeof opts.charset === 'undefined' ? defaults.charset : opts.charset;
|
13313 |
|
13314 |
+
return {
|
13315 |
+
allowDots: typeof opts.allowDots === 'undefined' ? defaults.allowDots : !!opts.allowDots,
|
13316 |
+
allowPrototypes: typeof opts.allowPrototypes === 'boolean' ? opts.allowPrototypes : defaults.allowPrototypes,
|
13317 |
+
arrayLimit: typeof opts.arrayLimit === 'number' ? opts.arrayLimit : defaults.arrayLimit,
|
13318 |
+
charset: charset,
|
13319 |
+
charsetSentinel: typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults.charsetSentinel,
|
13320 |
+
comma: typeof opts.comma === 'boolean' ? opts.comma : defaults.comma,
|
13321 |
+
decoder: typeof opts.decoder === 'function' ? opts.decoder : defaults.decoder,
|
13322 |
+
delimiter: typeof opts.delimiter === 'string' || utils.isRegExp(opts.delimiter) ? opts.delimiter : defaults.delimiter,
|
13323 |
+
// eslint-disable-next-line no-implicit-coercion, no-extra-parens
|
13324 |
+
depth: (typeof opts.depth === 'number' || opts.depth === false) ? +opts.depth : defaults.depth,
|
13325 |
+
ignoreQueryPrefix: opts.ignoreQueryPrefix === true,
|
13326 |
+
interpretNumericEntities: typeof opts.interpretNumericEntities === 'boolean' ? opts.interpretNumericEntities : defaults.interpretNumericEntities,
|
13327 |
+
parameterLimit: typeof opts.parameterLimit === 'number' ? opts.parameterLimit : defaults.parameterLimit,
|
13328 |
+
parseArrays: opts.parseArrays !== false,
|
13329 |
+
plainObjects: typeof opts.plainObjects === 'boolean' ? opts.plainObjects : defaults.plainObjects,
|
13330 |
+
strictNullHandling: typeof opts.strictNullHandling === 'boolean' ? opts.strictNullHandling : defaults.strictNullHandling
|
13331 |
+
};
|
13332 |
+
};
|
13333 |
|
13334 |
+
module.exports = function (str, opts) {
|
13335 |
+
var options = normalizeParseOptions(opts);
|
13336 |
|
13337 |
+
if (str === '' || str === null || typeof str === 'undefined') {
|
13338 |
+
return options.plainObjects ? Object.create(null) : {};
|
|
|
13339 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13340 |
|
13341 |
+
var tempObj = typeof str === 'string' ? parseValues(str, options) : str;
|
13342 |
+
var obj = options.plainObjects ? Object.create(null) : {};
|
13343 |
|
13344 |
+
// Iterate over the keys and setup the new object
|
|
|
13345 |
|
13346 |
+
var keys = Object.keys(tempObj);
|
13347 |
+
for (var i = 0; i < keys.length; ++i) {
|
13348 |
+
var key = keys[i];
|
13349 |
+
var newObj = parseKeys(key, tempObj[key], options, typeof str === 'string');
|
13350 |
+
obj = utils.merge(obj, newObj, options);
|
13351 |
+
}
|
13352 |
|
13353 |
+
return utils.compact(obj);
|
|
|
13354 |
};
|
13355 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13356 |
|
13357 |
+
/***/ }),
|
13358 |
+
/* 138 */,
|
13359 |
+
/* 139 */,
|
13360 |
+
/* 140 */,
|
13361 |
+
/* 141 */
|
13362 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
13363 |
|
13364 |
+
"use strict";
|
|
|
|
|
|
|
|
|
13365 |
|
13366 |
+
// EXPORTS
|
13367 |
+
__webpack_require__.d(__webpack_exports__, "a", function() { return /* binding */ speak; });
|
|
|
13368 |
|
13369 |
+
// UNUSED EXPORTS: setup
|
|
|
|
|
|
|
|
|
13370 |
|
13371 |
+
// EXTERNAL MODULE: ./node_modules/@wordpress/dom-ready/build-module/index.js
|
13372 |
+
var build_module = __webpack_require__(81);
|
13373 |
|
13374 |
+
// EXTERNAL MODULE: external {"this":["wp","i18n"]}
|
13375 |
+
var external_this_wp_i18n_ = __webpack_require__(3);
|
|
|
13376 |
|
13377 |
+
// CONCATENATED MODULE: ./node_modules/@wordpress/a11y/build-module/add-intro-text.js
|
13378 |
+
/**
|
13379 |
+
* WordPress dependencies
|
13380 |
+
*/
|
13381 |
|
13382 |
+
/**
|
13383 |
+
* Build the explanatory text to be placed before the aria live regions.
|
13384 |
+
*
|
13385 |
+
* This text is initially hidden from assistive technologies by using a `hidden`
|
13386 |
+
* HTML attribute which is then removed once a message fills the aria-live regions.
|
13387 |
+
*
|
13388 |
+
* @return {HTMLParagraphElement} The explanatory text HTML element.
|
13389 |
+
*/
|
13390 |
|
13391 |
+
function addIntroText() {
|
13392 |
+
var introText = document.createElement('p');
|
13393 |
+
introText.id = 'a11y-speak-intro-text';
|
13394 |
+
introText.className = 'a11y-speak-intro-text';
|
13395 |
+
introText.textContent = Object(external_this_wp_i18n_["__"])('Notifications');
|
13396 |
+
introText.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;');
|
13397 |
+
introText.setAttribute('hidden', 'hidden');
|
13398 |
+
var _document = document,
|
13399 |
+
body = _document.body;
|
13400 |
|
13401 |
+
if (body) {
|
13402 |
+
body.appendChild(introText);
|
13403 |
+
}
|
13404 |
|
13405 |
+
return introText;
|
|
|
13406 |
}
|
13407 |
+
//# sourceMappingURL=add-intro-text.js.map
|
13408 |
+
// CONCATENATED MODULE: ./node_modules/@wordpress/a11y/build-module/add-container.js
|
13409 |
+
/**
|
13410 |
+
* Build the live regions markup.
|
13411 |
+
*
|
13412 |
+
* @param {string} [ariaLive] Value for the 'aria-live' attribute; default: 'polite'.
|
13413 |
+
*
|
13414 |
+
* @return {HTMLDivElement} The ARIA live region HTML element.
|
13415 |
+
*/
|
13416 |
+
function addContainer() {
|
13417 |
+
var ariaLive = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'polite';
|
13418 |
+
var container = document.createElement('div');
|
13419 |
+
container.id = "a11y-speak-".concat(ariaLive);
|
13420 |
+
container.className = 'a11y-speak-region';
|
13421 |
+
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;');
|
13422 |
+
container.setAttribute('aria-live', ariaLive);
|
13423 |
+
container.setAttribute('aria-relevant', 'additions text');
|
13424 |
+
container.setAttribute('aria-atomic', 'true');
|
13425 |
+
var _document = document,
|
13426 |
+
body = _document.body;
|
13427 |
|
13428 |
+
if (body) {
|
13429 |
+
body.appendChild(container);
|
|
|
13430 |
}
|
13431 |
|
13432 |
+
return container;
|
13433 |
}
|
13434 |
+
//# sourceMappingURL=add-container.js.map
|
13435 |
+
// CONCATENATED MODULE: ./node_modules/@wordpress/a11y/build-module/clear.js
|
13436 |
+
/**
|
13437 |
+
* Clears the a11y-speak-region elements and hides the explanatory text.
|
13438 |
+
*/
|
13439 |
+
function clear() {
|
13440 |
+
var regions = document.getElementsByClassName('a11y-speak-region');
|
13441 |
+
var introText = document.getElementById('a11y-speak-intro-text');
|
13442 |
|
13443 |
+
for (var i = 0; i < regions.length; i++) {
|
13444 |
+
regions[i].textContent = '';
|
13445 |
+
} // Make sure the explanatory text is hidden from assistive technologies.
|
|
|
13446 |
|
|
|
|
|
13447 |
|
13448 |
+
if (introText) {
|
13449 |
+
introText.setAttribute('hidden', 'hidden');
|
|
|
|
|
|
|
13450 |
}
|
13451 |
+
}
|
13452 |
+
//# sourceMappingURL=clear.js.map
|
13453 |
+
// CONCATENATED MODULE: ./node_modules/@wordpress/a11y/build-module/filter-message.js
|
13454 |
+
var previousMessage = '';
|
13455 |
+
/**
|
13456 |
+
* Filter the message to be announced to the screenreader.
|
13457 |
+
*
|
13458 |
+
* @param {string} message The message to be announced.
|
13459 |
+
*
|
13460 |
+
* @return {string} The filtered message.
|
13461 |
+
*/
|
13462 |
|
13463 |
+
function filterMessage(message) {
|
13464 |
+
/*
|
13465 |
+
* Strip HTML tags (if any) from the message string. Ideally, messages should
|
13466 |
+
* be simple strings, carefully crafted for specific use with A11ySpeak.
|
13467 |
+
* When re-using already existing strings this will ensure simple HTML to be
|
13468 |
+
* stripped out and replaced with a space. Browsers will collapse multiple
|
13469 |
+
* spaces natively.
|
13470 |
+
*/
|
13471 |
+
message = message.replace(/<[^<>]+>/g, ' ');
|
13472 |
+
/*
|
13473 |
+
* Safari + VoiceOver don't announce repeated, identical strings. We use
|
13474 |
+
* a `no-break space` to force them to think identical strings are different.
|
13475 |
+
*/
|
13476 |
|
13477 |
+
if (previousMessage === message) {
|
13478 |
+
message += "\xA0";
|
13479 |
+
}
|
|
|
|
|
13480 |
|
13481 |
+
previousMessage = message;
|
13482 |
+
return message;
|
13483 |
+
}
|
13484 |
+
//# sourceMappingURL=filter-message.js.map
|
13485 |
+
// CONCATENATED MODULE: ./node_modules/@wordpress/a11y/build-module/index.js
|
13486 |
+
/**
|
13487 |
+
* WordPress dependencies
|
13488 |
+
*/
|
13489 |
|
13490 |
+
/**
|
13491 |
+
* Internal dependencies
|
13492 |
+
*/
|
13493 |
|
|
|
|
|
13494 |
|
|
|
|
|
|
|
13495 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13496 |
|
13497 |
+
|
13498 |
+
/**
|
13499 |
+
* Create the live regions.
|
13500 |
*/
|
13501 |
|
13502 |
+
function setup() {
|
13503 |
+
var introText = document.getElementById('a11y-speak-intro-text');
|
13504 |
+
var containerAssertive = document.getElementById('a11y-speak-assertive');
|
13505 |
+
var containerPolite = document.getElementById('a11y-speak-polite');
|
13506 |
+
|
13507 |
+
if (introText === null) {
|
13508 |
+
addIntroText();
|
13509 |
}
|
13510 |
|
13511 |
+
if (containerAssertive === null) {
|
13512 |
+
addContainer('assertive');
|
13513 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13514 |
|
13515 |
+
if (containerPolite === null) {
|
13516 |
+
addContainer('polite');
|
13517 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13518 |
}
|
13519 |
+
/**
|
13520 |
+
* Run setup on domReady.
|
13521 |
+
*/
|
13522 |
|
13523 |
+
Object(build_module["a" /* default */])(setup);
|
13524 |
/**
|
13525 |
+
* Allows you to easily announce dynamic interface updates to screen readers using ARIA live regions.
|
13526 |
+
* This module is inspired by the `speak` function in `wp-a11y.js`.
|
13527 |
*
|
13528 |
+
* @param {string} message The message to be announced by assistive technologies.
|
13529 |
+
* @param {string} [ariaLive] The politeness level for aria-live; default: 'polite'.
|
|
|
|
|
|
|
|
|
13530 |
*
|
13531 |
+
* @example
|
13532 |
+
* ```js
|
13533 |
+
* import { speak } from '@wordpress/a11y';
|
|
|
13534 |
*
|
13535 |
+
* // For polite messages that shouldn't interrupt what screen readers are currently announcing.
|
13536 |
+
* speak( 'The message you want to send to the ARIA live region' );
|
13537 |
+
*
|
13538 |
+
* // For assertive messages that should interrupt what screen readers are currently announcing.
|
13539 |
+
* speak( 'The message you want to send to the ARIA live region', 'assertive' );
|
13540 |
+
* ```
|
13541 |
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13542 |
|
13543 |
+
function speak(message, ariaLive) {
|
13544 |
+
/*
|
13545 |
+
* Clear previous messages to allow repeated strings being read out and hide
|
13546 |
+
* the explanatory text from assistive technologies.
|
13547 |
+
*/
|
13548 |
+
clear();
|
13549 |
+
message = filterMessage(message);
|
13550 |
+
var introText = document.getElementById('a11y-speak-intro-text');
|
13551 |
+
var containerAssertive = document.getElementById('a11y-speak-assertive');
|
13552 |
+
var containerPolite = document.getElementById('a11y-speak-polite');
|
13553 |
|
13554 |
+
if (containerAssertive && ariaLive === 'assertive') {
|
13555 |
+
containerAssertive.textContent = message;
|
13556 |
+
} else if (containerPolite) {
|
13557 |
+
containerPolite.textContent = message;
|
13558 |
+
}
|
13559 |
+
/*
|
13560 |
+
* Make the explanatory text available to assistive technologies by removing
|
13561 |
+
* the 'hidden' HTML attribute.
|
13562 |
+
*/
|
13563 |
|
|
|
|
|
|
|
13564 |
|
13565 |
+
if (introText) {
|
13566 |
+
introText.removeAttribute('hidden');
|
|
|
|
|
13567 |
}
|
13568 |
+
}
|
13569 |
+
//# sourceMappingURL=index.js.map
|
13570 |
|
13571 |
+
/***/ }),
|
13572 |
+
/* 142 */
|
13573 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
|
13574 |
|
13575 |
+
"use strict";
|
|
|
|
|
|
|
13576 |
|
13577 |
+
// EXTERNAL MODULE: ./node_modules/@emotion/styled-base/dist/styled-base.browser.esm.js + 1 modules
|
13578 |
+
var styled_base_browser_esm = __webpack_require__(32);
|
|
|
13579 |
|
13580 |
+
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/taggedTemplateLiteral.js
|
13581 |
+
var taggedTemplateLiteral = __webpack_require__(39);
|
|
|
13582 |
|
13583 |
+
// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/text/styles/font-family.js
|
13584 |
+
var fontFamily = "font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto,\nOxygen-Sans, Ubuntu, Cantarell, \"Helvetica Neue\", sans-serif;";
|
13585 |
+
//# sourceMappingURL=font-family.js.map
|
13586 |
+
// EXTERNAL MODULE: ./node_modules/@emotion/core/dist/core.browser.esm.js + 6 modules
|
13587 |
+
var core_browser_esm = __webpack_require__(48);
|
13588 |
|
13589 |
+
// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/text/styles/emotion-css.js
|
13590 |
+
/**
|
13591 |
+
* External dependencies
|
13592 |
+
*/
|
13593 |
|
13594 |
+
/* harmony default export */ var emotion_css = (core_browser_esm["b" /* css */]);
|
13595 |
+
//# sourceMappingURL=emotion-css.js.map
|
13596 |
+
// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/text/styles/text-mixins.js
|
|
|
13597 |
|
|
|
|
|
13598 |
|
13599 |
+
function _templateObject9() {
|
13600 |
+
var data = Object(taggedTemplateLiteral["a" /* default */])(["\n\t", "\n\t", "\n"]);
|
|
|
|
|
|
|
|
|
13601 |
|
13602 |
+
_templateObject9 = function _templateObject9() {
|
13603 |
+
return data;
|
13604 |
+
};
|
13605 |
|
13606 |
+
return data;
|
13607 |
+
}
|
13608 |
|
13609 |
+
function _templateObject8() {
|
13610 |
+
var data = Object(taggedTemplateLiteral["a" /* default */])(["\n\t\t\t\t", "\n\t\t\t\t", "\n\t\t\t"]);
|
|
|
13611 |
|
13612 |
+
_templateObject8 = function _templateObject8() {
|
13613 |
+
return data;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13614 |
};
|
13615 |
|
13616 |
+
return data;
|
13617 |
+
}
|
|
|
|
|
|
|
13618 |
|
13619 |
+
function _templateObject7() {
|
13620 |
+
var data = Object(taggedTemplateLiteral["a" /* default */])(["\n\t\t\t\t", "\n\t\t\t\t", "\n\t\t\t"]);
|
|
|
13621 |
|
13622 |
+
_templateObject7 = function _templateObject7() {
|
13623 |
+
return data;
|
13624 |
+
};
|
13625 |
|
13626 |
+
return data;
|
13627 |
+
}
|
13628 |
|
13629 |
+
function _templateObject6() {
|
13630 |
+
var data = Object(taggedTemplateLiteral["a" /* default */])(["\n\t\t\t\t", "\n\t\t\t"]);
|
|
|
|
|
|
|
13631 |
|
13632 |
+
_templateObject6 = function _templateObject6() {
|
13633 |
+
return data;
|
13634 |
+
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13635 |
|
13636 |
+
return data;
|
13637 |
+
}
|
|
|
13638 |
|
13639 |
+
function _templateObject5() {
|
13640 |
+
var data = Object(taggedTemplateLiteral["a" /* default */])(["\n\t\t\t\t", "\n\t\t\t\t", "\n\t\t\t"]);
|
|
|
|
|
|
|
13641 |
|
13642 |
+
_templateObject5 = function _templateObject5() {
|
13643 |
+
return data;
|
13644 |
+
};
|
13645 |
|
13646 |
+
return data;
|
13647 |
+
}
|
13648 |
|
13649 |
+
function _templateObject4() {
|
13650 |
+
var data = Object(taggedTemplateLiteral["a" /* default */])(["\n\t\t\t\t", "\n\t\t\t\t", "\n\t\t\t"]);
|
|
|
13651 |
|
13652 |
+
_templateObject4 = function _templateObject4() {
|
13653 |
+
return data;
|
13654 |
+
};
|
|
|
|
|
13655 |
|
13656 |
+
return data;
|
13657 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13658 |
|
13659 |
+
function _templateObject3() {
|
13660 |
+
var data = Object(taggedTemplateLiteral["a" /* default */])(["\n\t\t\t\t", "\n\t\t\t\t", "\n\t\t\t"]);
|
13661 |
|
13662 |
+
_templateObject3 = function _templateObject3() {
|
13663 |
+
return data;
|
13664 |
+
};
|
|
|
|
|
13665 |
|
13666 |
+
return data;
|
13667 |
+
}
|
|
|
|
|
|
|
|
|
|
|
13668 |
|
13669 |
+
function _templateObject2() {
|
13670 |
+
var data = Object(taggedTemplateLiteral["a" /* default */])(["\n\t\t\t\t", "\n\t\t\t\t", "\n\t\t\t"]);
|
13671 |
|
13672 |
+
_templateObject2 = function _templateObject2() {
|
13673 |
+
return data;
|
13674 |
+
};
|
13675 |
|
13676 |
+
return data;
|
13677 |
+
}
|
|
|
|
|
|
|
|
|
13678 |
|
13679 |
+
function _templateObject() {
|
13680 |
+
var data = Object(taggedTemplateLiteral["a" /* default */])(["\n\t\t\t\t", "\n\t\t\t\t", "\n\t\t\t"]);
|
13681 |
|
13682 |
+
_templateObject = function _templateObject() {
|
13683 |
+
return data;
|
13684 |
+
};
|
13685 |
|
13686 |
+
return data;
|
13687 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13688 |
|
13689 |
+
/**
|
13690 |
+
* Internal dependencies
|
13691 |
+
*/
|
13692 |
|
|
|
|
|
|
|
13693 |
|
13694 |
+
var fontWeightNormal = "font-weight: 400;";
|
13695 |
+
var fontWeightSemibold = "font-weight: 600;";
|
13696 |
+
var title = "\n ".concat(fontWeightNormal, "\n");
|
13697 |
+
var titleLarge = "\n\tfont-size: 32px;\n\tline-height: 40px;\n";
|
13698 |
+
var titleMedium = "\n\tfont-size: 24px;\n\tline-height: 32px;\n";
|
13699 |
+
var titleSmall = "\n\tfont-size: 20px;\n\tline-height: 28px;\n";
|
13700 |
+
var subtitle = "\n\t".concat(fontWeightSemibold, "\n\tfont-size: 14px;\n\tline-height: 20px;\n");
|
13701 |
+
var subtitleLarge = "\n\tfont-size: 16px;\n\tline-height: 24px;\n";
|
13702 |
+
var subtitleSmall = "\n\tfont-size: 14px;\n\tline-height: 20px;\n";
|
13703 |
+
var body = "\n\t".concat(fontWeightNormal, "\n");
|
13704 |
+
var bodyLarge = "\n\tfont-size: 16px;\n\tline-height: 24px;\n";
|
13705 |
+
var bodySmall = "\n\tfont-size: 14px;\n\tline-height: 20px;\n";
|
13706 |
+
var text_mixins_button = "\n ".concat(fontWeightSemibold, "\n font-size: 14px;\n line-height: 20px;\n");
|
13707 |
+
var caption = "\n\t".concat(fontWeightNormal, "\n\tfont-size: 12px;\n\tline-height: 16px;\n");
|
13708 |
+
var label = "\n\t".concat(fontWeightSemibold, "\n\tfont-size: 12px;\n\tline-height: 16px;\n");
|
13709 |
+
/**
|
13710 |
+
* @typedef {'title.large'|'title.medium'|'title.small'|'subtitle'|'subtitle.small'|'body'|'body.large'|'body.small'|'button'|'caption'|'label'} TextVariant
|
13711 |
+
*/
|
13712 |
|
13713 |
+
/**
|
13714 |
+
* @param {TextVariant} variantName
|
13715 |
+
*/
|
|
|
|
|
13716 |
|
13717 |
+
var text_mixins_variant = function variant() {
|
13718 |
+
var variantName = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'body';
|
13719 |
|
13720 |
+
switch (variantName) {
|
13721 |
+
case 'title.large':
|
13722 |
+
return emotion_css(_templateObject(), title, titleLarge);
|
13723 |
|
13724 |
+
case 'title.medium':
|
13725 |
+
return emotion_css(_templateObject2(), title, titleMedium);
|
13726 |
|
13727 |
+
case 'title.small':
|
13728 |
+
return emotion_css(_templateObject3(), title, titleSmall);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13729 |
|
13730 |
+
case 'subtitle':
|
13731 |
+
return emotion_css(_templateObject4(), subtitle, subtitleLarge);
|
13732 |
|
13733 |
+
case 'subtitle.small':
|
13734 |
+
return emotion_css(_templateObject5(), subtitle, subtitleSmall);
|
13735 |
|
13736 |
+
case 'body':
|
13737 |
+
return emotion_css(_templateObject6(), body);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13738 |
|
13739 |
+
case 'body.large':
|
13740 |
+
return emotion_css(_templateObject7(), body, bodyLarge);
|
|
|
|
|
|
|
13741 |
|
13742 |
+
case 'body.small':
|
13743 |
+
return emotion_css(_templateObject8(), body, bodySmall);
|
13744 |
|
13745 |
+
case 'button':
|
13746 |
+
return text_mixins_button;
|
13747 |
|
13748 |
+
case 'caption':
|
13749 |
+
return caption;
|
13750 |
|
13751 |
+
case 'label':
|
13752 |
+
return label;
|
13753 |
+
}
|
13754 |
+
};
|
13755 |
+
/**
|
13756 |
+
* @typedef {Object} TextProps
|
13757 |
+
* @property {TextVariant} variant one of TextVariant to be used
|
13758 |
+
*/
|
13759 |
|
13760 |
+
/**
|
13761 |
+
* @param {TextProps} props
|
13762 |
+
*/
|
13763 |
|
|
|
13764 |
|
13765 |
+
var text_mixins_text = function text(props) {
|
13766 |
+
return emotion_css(_templateObject9(), fontFamily, text_mixins_variant(props.variant));
|
13767 |
+
};
|
13768 |
+
//# sourceMappingURL=text-mixins.js.map
|
13769 |
+
// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/text/index.js
|
|
|
|
|
|
|
13770 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13771 |
|
13772 |
+
/**
|
13773 |
+
* Internal dependencies
|
13774 |
+
*/
|
13775 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13776 |
|
13777 |
+
var Text = Object(styled_base_browser_esm["a" /* default */])("p", {
|
13778 |
+
target: "e15wbhsk0",
|
13779 |
+
label: "Text"
|
13780 |
+
})("\n\tbox-sizing: border-box;\n\tmargin: 0;\n", text_mixins_text, true ? "" : undefined);
|
|
|
|
|
13781 |
|
13782 |
+
/* harmony default export */ var build_module_text = __webpack_exports__["a"] = (Text);
|
13783 |
+
//# sourceMappingURL=index.js.map
|
13784 |
|
13785 |
+
/***/ }),
|
13786 |
+
/* 143 */
|
13787 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
13788 |
|
13789 |
+
"use strict";
|
13790 |
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return getCountryCode; });
|
13791 |
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return getCurrencyRegion; });
|
13792 |
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return getProductIdsForCart; });
|
13793 |
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return getCategorizedOnboardingProducts; });
|
13794 |
+
/* unused harmony export getProductList */
|
13795 |
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return getPriceValue; });
|
13796 |
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return isWCAdmin; });
|
13797 |
+
/* harmony import */ var _babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(28);
|
13798 |
+
/* harmony import */ var _babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_0__);
|
13799 |
+
/* harmony import */ var _wordpress_html_entities__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(76);
|
13800 |
+
/* harmony import */ var _wordpress_html_entities__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_html_entities__WEBPACK_IMPORTED_MODULE_1__);
|
13801 |
+
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(2);
|
13802 |
+
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_2__);
|
13803 |
+
/* harmony import */ var _woocommerce_wc_admin_settings__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(35);
|
13804 |
|
|
|
|
|
|
|
|
|
|
|
13805 |
|
13806 |
+
/**
|
13807 |
+
* External dependencies
|
13808 |
+
*/
|
13809 |
|
|
|
|
|
13810 |
|
|
|
13811 |
|
13812 |
+
/**
|
13813 |
+
* Gets the country code from a country:state value string.
|
13814 |
+
*
|
13815 |
+
* @param {string} countryState Country state string, e.g. US:GA.
|
13816 |
+
* @return {string} Country string.
|
13817 |
+
*/
|
13818 |
|
13819 |
+
function getCountryCode(countryState) {
|
13820 |
+
if (!countryState) {
|
13821 |
+
return null;
|
13822 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13823 |
|
13824 |
+
return countryState.split(':')[0];
|
13825 |
+
}
|
13826 |
+
function getCurrencyRegion(countryState) {
|
13827 |
+
var region = getCountryCode(countryState);
|
13828 |
+
var euCountries = Object(lodash__WEBPACK_IMPORTED_MODULE_2__["without"])(Object(_woocommerce_wc_admin_settings__WEBPACK_IMPORTED_MODULE_3__[/* getSetting */ "g"])('onboarding', {
|
13829 |
+
euCountries: []
|
13830 |
+
}).euCountries, 'GB');
|
|
|
13831 |
|
13832 |
+
if (euCountries.includes(region)) {
|
13833 |
+
region = 'EU';
|
13834 |
+
}
|
13835 |
|
13836 |
+
return region;
|
13837 |
+
}
|
13838 |
+
/**
|
13839 |
+
* Gets the product IDs for items based on the product types and theme selected in the onboarding profiler.
|
13840 |
+
*
|
13841 |
+
* @param {Object} profileItems Onboarding profile.
|
13842 |
+
* @param {boolean} includeInstalledItems Include installed items in returned product IDs.
|
13843 |
+
* @param {Array} installedPlugins Installed plugins.
|
13844 |
+
* @return {Array} Product Ids.
|
13845 |
+
*/
|
13846 |
|
13847 |
+
function getProductIdsForCart(profileItems) {
|
13848 |
+
var includeInstalledItems = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
13849 |
+
var installedPlugins = arguments.length > 2 ? arguments[2] : undefined;
|
13850 |
+
var productList = getProductList(profileItems, includeInstalledItems, installedPlugins);
|
13851 |
+
var productIds = productList.map(function (product) {
|
13852 |
+
return product.id || product.product;
|
13853 |
+
});
|
13854 |
+
return productIds;
|
13855 |
+
}
|
13856 |
+
/**
|
13857 |
+
* Gets the labeled/categorized product names and types for items based on the product types and theme selected in the onboarding profiler.
|
13858 |
+
*
|
13859 |
+
* @param {Object} profileItems Onboarding profile.
|
13860 |
+
* @param {Array} installedPlugins Installed plugins.
|
13861 |
+
* @return {Array} Objects with labeled/categorized product names and types.
|
13862 |
+
*/
|
13863 |
|
13864 |
+
function getCategorizedOnboardingProducts(profileItems, installedPlugins) {
|
13865 |
+
var productList = {};
|
13866 |
+
productList.products = getProductList(profileItems, true, installedPlugins);
|
13867 |
+
productList.remainingProducts = getProductList(profileItems, false, installedPlugins);
|
13868 |
|
13869 |
+
var uniqueItemsList = _babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_0___default()(new Set([].concat(_babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_0___default()(productList.products), _babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_0___default()(productList.remainingProducts))));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13870 |
|
13871 |
+
productList.uniqueItemsList = uniqueItemsList.map(function (product) {
|
13872 |
+
var cleanedProduct;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13873 |
|
13874 |
+
if (product.label) {
|
13875 |
+
cleanedProduct = {
|
13876 |
+
type: 'extension',
|
13877 |
+
name: product.label
|
13878 |
+
};
|
13879 |
+
} else {
|
13880 |
+
cleanedProduct = {
|
13881 |
+
type: 'theme',
|
13882 |
+
name: product.title
|
13883 |
+
};
|
13884 |
+
}
|
13885 |
|
13886 |
+
return cleanedProduct;
|
13887 |
+
});
|
13888 |
+
return productList;
|
13889 |
+
}
|
13890 |
+
/**
|
13891 |
+
* Gets a product list for items based on the product types and theme selected in the onboarding profiler.
|
13892 |
+
*
|
13893 |
+
* @param {Object} profileItems Onboarding profile.
|
13894 |
+
* @param {boolean} includeInstalledItems Include installed items in returned product list.
|
13895 |
+
* @param {Array} installedPlugins Installed plugins.
|
13896 |
+
* @return {Array} Products.
|
13897 |
+
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13898 |
|
13899 |
+
function getProductList(profileItems) {
|
13900 |
+
var includeInstalledItems = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
13901 |
+
var installedPlugins = arguments.length > 2 ? arguments[2] : undefined;
|
13902 |
+
var onboarding = Object(_woocommerce_wc_admin_settings__WEBPACK_IMPORTED_MODULE_3__[/* getSetting */ "g"])('onboarding', {});
|
13903 |
+
var productList = []; // The population of onboarding.productTypes only happens if the task list should be shown
|
13904 |
+
// so bail early if it isn't present.
|
|
|
|
|
|
|
|
|
13905 |
|
13906 |
+
if (!onboarding.productTypes) {
|
13907 |
+
return productList;
|
13908 |
+
}
|
|
|
|
|
|
|
13909 |
|
13910 |
+
var productTypes = profileItems.product_types || [];
|
13911 |
+
productTypes.forEach(function (productType) {
|
13912 |
+
if (onboarding.productTypes[productType] && onboarding.productTypes[productType].product && (includeInstalledItems || !installedPlugins.includes(onboarding.productTypes[productType].slug))) {
|
13913 |
+
productList.push(onboarding.productTypes[productType]);
|
13914 |
+
}
|
13915 |
+
});
|
13916 |
+
var theme = onboarding.themes.find(function (themeData) {
|
13917 |
+
return themeData.slug === profileItems.theme;
|
13918 |
+
});
|
13919 |
|
13920 |
+
if (theme && theme.id && getPriceValue(theme.price) > 0 && (includeInstalledItems || !theme.is_installed)) {
|
13921 |
+
productList.push(theme);
|
13922 |
+
}
|
|
|
|
|
13923 |
|
13924 |
+
return productList;
|
13925 |
+
}
|
13926 |
+
/**
|
13927 |
+
* Get the value of a price from a string, removing any non-numeric characters.
|
13928 |
+
*
|
13929 |
+
* @param {string} string Price string.
|
13930 |
+
* @return {number} Number value.
|
13931 |
+
*/
|
13932 |
|
13933 |
+
function getPriceValue(string) {
|
13934 |
+
return Number(Object(_wordpress_html_entities__WEBPACK_IMPORTED_MODULE_1__["decodeEntities"])(string).replace(/[^0-9.-]+/g, ''));
|
13935 |
+
}
|
13936 |
+
/**
|
13937 |
+
* Determines if a URL is a WC admin url.
|
13938 |
+
*
|
13939 |
+
* @param {*} url - the url to test
|
13940 |
+
* @return {boolean} true if the url is a wc-admin URL
|
13941 |
+
*/
|
13942 |
|
13943 |
+
function isWCAdmin(url) {
|
13944 |
+
return /admin.php\?page=wc-admin/.test(url);
|
13945 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13946 |
|
13947 |
+
/***/ }),
|
13948 |
+
/* 144 */,
|
13949 |
+
/* 145 */,
|
13950 |
+
/* 146 */,
|
13951 |
+
/* 147 */
|
13952 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
13953 |
|
13954 |
+
"use strict";
|
13955 |
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return useInstanceId; });
|
13956 |
+
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0);
|
13957 |
+
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
|
13958 |
+
/**
|
13959 |
+
* WordPress dependencies
|
13960 |
*/
|
13961 |
|
13962 |
+
var instanceMap = new WeakMap();
|
13963 |
+
/**
|
13964 |
+
* Creates a new id for a given object.
|
13965 |
+
*
|
13966 |
+
* @param {Object} object Object reference to create an id for.
|
13967 |
+
*/
|
13968 |
|
13969 |
+
function createId(object) {
|
13970 |
+
var instances = instanceMap.get(object) || 0;
|
13971 |
+
instanceMap.set(object, instances + 1);
|
13972 |
+
return instances;
|
13973 |
+
}
|
13974 |
+
/**
|
13975 |
+
* Provides a unique instance ID.
|
13976 |
+
*
|
13977 |
+
* @param {Object} object Object reference to create an id for.
|
13978 |
+
* @param {string} prefix Prefix for the unique id.
|
13979 |
+
*/
|
13980 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13981 |
|
13982 |
+
function useInstanceId(object, prefix) {
|
13983 |
+
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["useMemo"])(function () {
|
13984 |
+
var id = createId(object);
|
13985 |
+
return prefix ? "".concat(prefix, "-").concat(id) : id;
|
13986 |
+
}, [object]);
|
13987 |
+
}
|
13988 |
+
//# sourceMappingURL=index.js.map
|
13989 |
|
13990 |
+
/***/ }),
|
13991 |
+
/* 148 */,
|
13992 |
+
/* 149 */,
|
13993 |
+
/* 150 */
|
13994 |
+
/***/ (function(module, exports) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13995 |
|
13996 |
+
function _objectWithoutPropertiesLoose(source, excluded) {
|
13997 |
+
if (source == null) return {};
|
13998 |
+
var target = {};
|
13999 |
+
var sourceKeys = Object.keys(source);
|
14000 |
+
var key, i;
|
14001 |
|
14002 |
+
for (i = 0; i < sourceKeys.length; i++) {
|
14003 |
+
key = sourceKeys[i];
|
14004 |
+
if (excluded.indexOf(key) >= 0) continue;
|
14005 |
+
target[key] = source[key];
|
14006 |
+
}
|
14007 |
|
14008 |
+
return target;
|
14009 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
14010 |
|
14011 |
+
module.exports = _objectWithoutPropertiesLoose;
|
|
|
|
|
|
|
|
|
|
|
|
|
14012 |
|
14013 |
+
/***/ }),
|
14014 |
+
/* 151 */,
|
14015 |
+
/* 152 */,
|
14016 |
+
/* 153 */,
|
14017 |
+
/* 154 */,
|
14018 |
+
/* 155 */,
|
14019 |
+
/* 156 */,
|
14020 |
+
/* 157 */,
|
14021 |
+
/* 158 */,
|
14022 |
+
/* 159 */,
|
14023 |
+
/* 160 */,
|
14024 |
+
/* 161 */,
|
14025 |
+
/* 162 */,
|
14026 |
+
/* 163 */,
|
14027 |
+
/* 164 */,
|
14028 |
+
/* 165 */,
|
14029 |
+
/* 166 */,
|
14030 |
+
/* 167 */
|
14031 |
+
/***/ (function(module, exports) {
|
14032 |
|
14033 |
+
(function() { module.exports = this["wc"]["currency"]; }());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14034 |
|
14035 |
+
/***/ }),
|
14036 |
+
/* 168 */,
|
14037 |
+
/* 169 */,
|
14038 |
+
/* 170 */,
|
14039 |
+
/* 171 */,
|
14040 |
+
/* 172 */,
|
14041 |
+
/* 173 */,
|
14042 |
+
/* 174 */,
|
14043 |
+
/* 175 */,
|
14044 |
+
/* 176 */,
|
14045 |
+
/* 177 */
|
14046 |
+
/***/ (function(module, exports, __webpack_require__) {
|
14047 |
|
14048 |
+
"use strict";
|
14049 |
+
var _extends=Object.assign||function(a){for(var c,b=1;b<arguments.length;b++)for(var d in c=arguments[b],c)Object.prototype.hasOwnProperty.call(c,d)&&(a[d]=c[d]);return a};Object.defineProperty(exports,'__esModule',{value:!0});exports.default=function(a){var b=a.size,c=b===void 0?24:b,d=a.onClick,e=a.icon,f=a.className,g=_objectWithoutProperties(a,['size','onClick','icon','className']),j=['gridicon','gridicons-cross-small',f,!1,!1,!1].filter(Boolean).join(' ');return _react2.default.createElement('svg',_extends({className:j,height:c,width:c,onClick:d},g,{xmlns:'http://www.w3.org/2000/svg',viewBox:'0 0 24 24'}),_react2.default.createElement('g',null,_react2.default.createElement('path',{d:'M17.705 7.705l-1.41-1.41L12 10.59 7.705 6.295l-1.41 1.41L10.59 12l-4.295 4.295 1.41 1.41L12 13.41l4.295 4.295 1.41-1.41L13.41 12l4.295-4.295z'})))};var _react=__webpack_require__(8),_react2=_interopRequireDefault(_react);function _interopRequireDefault(a){return a&&a.__esModule?a:{default:a}}function _objectWithoutProperties(a,b){var d={};for(var c in a)0<=b.indexOf(c)||Object.prototype.hasOwnProperty.call(a,c)&&(d[c]=a[c]);return d}module.exports=exports['default'];
|
14050 |
|
|
|
|
|
|
|
|
|
14051 |
|
14052 |
+
/***/ }),
|
14053 |
+
/* 178 */,
|
14054 |
+
/* 179 */,
|
14055 |
+
/* 180 */
|
14056 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
14057 |
|
14058 |
+
"use strict";
|
14059 |
+
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0);
|
14060 |
+
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
|
14061 |
+
/* harmony import */ var _use_media_query__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(85);
|
14062 |
+
/**
|
14063 |
+
* WordPress dependencies
|
14064 |
*/
|
14065 |
|
14066 |
+
/**
|
14067 |
+
* Internal dependencies
|
14068 |
+
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14069 |
|
14070 |
|
14071 |
+
/**
|
14072 |
+
* @typedef {"huge"|"wide"|"large"|"medium"|"small"|"mobile"} WPBreakpoint
|
14073 |
+
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14074 |
|
14075 |
+
/**
|
14076 |
+
* Hash of breakpoint names with pixel width at which it becomes effective.
|
14077 |
+
*
|
14078 |
+
* @see _breakpoints.scss
|
14079 |
+
*
|
14080 |
+
* @type {Object<WPBreakpoint,number>}
|
14081 |
+
*/
|
14082 |
|
14083 |
+
var BREAKPOINTS = {
|
14084 |
+
huge: 1440,
|
14085 |
+
wide: 1280,
|
14086 |
+
large: 960,
|
14087 |
+
medium: 782,
|
14088 |
+
small: 600,
|
14089 |
+
mobile: 480
|
14090 |
};
|
14091 |
+
/**
|
14092 |
+
* @typedef {">="|"<"} WPViewportOperator
|
14093 |
+
*/
|
14094 |
|
14095 |
+
/**
|
14096 |
+
* Object mapping media query operators to the condition to be used.
|
14097 |
+
*
|
14098 |
+
* @type {Object<WPViewportOperator,string>}
|
14099 |
*/
|
14100 |
|
14101 |
+
var CONDITIONS = {
|
14102 |
+
'>=': 'min-width',
|
14103 |
+
'<': 'max-width'
|
14104 |
+
};
|
14105 |
+
/**
|
14106 |
+
* Object mapping media query operators to a function that given a breakpointValue and a width evaluates if the operator matches the values.
|
14107 |
+
*
|
14108 |
+
* @type {Object<WPViewportOperator,Function>}
|
14109 |
+
*/
|
14110 |
|
14111 |
+
var OPERATOR_EVALUATORS = {
|
14112 |
+
'>=': function _(breakpointValue, width) {
|
14113 |
+
return width >= breakpointValue;
|
14114 |
+
},
|
14115 |
+
'<': function _(breakpointValue, width) {
|
14116 |
+
return width < breakpointValue;
|
14117 |
+
}
|
14118 |
};
|
14119 |
+
var ViewportMatchWidthContext = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createContext"])(null);
|
14120 |
+
/**
|
14121 |
+
* Returns true if the viewport matches the given query, or false otherwise.
|
14122 |
+
*
|
14123 |
+
* @param {WPBreakpoint} breakpoint Breakpoint size name.
|
14124 |
+
* @param {WPViewportOperator} [operator=">="] Viewport operator.
|
14125 |
+
*
|
14126 |
+
* @example
|
14127 |
+
*
|
14128 |
+
* ```js
|
14129 |
+
* useViewportMatch( 'huge', '<' );
|
14130 |
+
* useViewportMatch( 'medium' );
|
14131 |
+
* ```
|
14132 |
+
*
|
14133 |
+
* @return {boolean} Whether viewport matches query.
|
14134 |
+
*/
|
14135 |
|
14136 |
+
var useViewportMatch = function useViewportMatch(breakpoint) {
|
14137 |
+
var operator = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '>=';
|
14138 |
+
var simulatedWidth = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["useContext"])(ViewportMatchWidthContext);
|
14139 |
+
var mediaQuery = !simulatedWidth && "(".concat(CONDITIONS[operator], ": ").concat(BREAKPOINTS[breakpoint], "px)");
|
14140 |
+
var mediaQueryResult = Object(_use_media_query__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"])(mediaQuery);
|
|
|
|
|
14141 |
|
14142 |
+
if (simulatedWidth) {
|
14143 |
+
return OPERATOR_EVALUATORS[operator](BREAKPOINTS[breakpoint], simulatedWidth);
|
14144 |
+
}
|
|
|
|
|
|
|
14145 |
|
14146 |
+
return mediaQueryResult;
|
14147 |
+
};
|
|
|
|
|
|
|
|
|
|
|
14148 |
|
14149 |
+
useViewportMatch.__experimentalWidthProvider = ViewportMatchWidthContext.Provider;
|
14150 |
+
/* harmony default export */ __webpack_exports__["a"] = (useViewportMatch);
|
14151 |
+
//# sourceMappingURL=index.js.map
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14152 |
|
14153 |
+
/***/ }),
|
14154 |
+
/* 181 */
|
14155 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14156 |
|
14157 |
+
"use strict";
|
14158 |
+
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2);
|
14159 |
+
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_0__);
|
14160 |
+
/**
|
14161 |
+
* External dependencies
|
14162 |
+
*/
|
14163 |
|
14164 |
+
/**
|
14165 |
+
* Composes multiple higher-order components into a single higher-order component. Performs right-to-left function
|
14166 |
+
* composition, where each successive invocation is supplied the return value of the previous.
|
14167 |
+
*
|
14168 |
+
* @param {...Function} hocs The HOC functions to invoke.
|
14169 |
+
*
|
14170 |
+
* @return {Function} Returns the new composite function.
|
14171 |
+
*/
|
14172 |
|
14173 |
+
/* harmony default export */ __webpack_exports__["a"] = (lodash__WEBPACK_IMPORTED_MODULE_0__["flowRight"]);
|
14174 |
+
//# sourceMappingURL=compose.js.map
|
14175 |
|
14176 |
+
/***/ }),
|
14177 |
+
/* 182 */
|
14178 |
+
/***/ (function(module, exports, __webpack_require__) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14179 |
|
14180 |
+
"use strict";
|
14181 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14182 |
|
14183 |
+
if (true) {
|
14184 |
+
module.exports = __webpack_require__(208);
|
14185 |
+
} else {}
|
14186 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14187 |
|
14188 |
+
/***/ }),
|
14189 |
+
/* 183 */,
|
14190 |
+
/* 184 */,
|
14191 |
+
/* 185 */,
|
14192 |
+
/* 186 */,
|
14193 |
+
/* 187 */,
|
14194 |
+
/* 188 */,
|
14195 |
+
/* 189 */,
|
14196 |
+
/* 190 */,
|
14197 |
+
/* 191 */,
|
14198 |
+
/* 192 */,
|
14199 |
+
/* 193 */
|
14200 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
14201 |
|
14202 |
+
"use strict";
|
14203 |
+
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(3);
|
14204 |
+
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__);
|
14205 |
+
/* harmony import */ var _wordpress_hooks__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(51);
|
14206 |
+
/* harmony import */ var _wordpress_hooks__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_hooks__WEBPACK_IMPORTED_MODULE_1__);
|
14207 |
+
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(0);
|
14208 |
+
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__);
|
14209 |
+
/* harmony import */ var _settings__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(35);
|
14210 |
+
/**
|
14211 |
+
* External dependencies
|
14212 |
+
*/
|
14213 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14214 |
|
|
|
|
|
14215 |
|
14216 |
+
/**
|
14217 |
+
* Internal dependencies
|
14218 |
+
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
14219 |
|
|
|
|
|
14220 |
|
14221 |
+
var manageStock = Object(_settings__WEBPACK_IMPORTED_MODULE_3__[/* getSetting */ "g"])('manageStock', 'no');
|
14222 |
+
var REPORTS_FILTER = 'woocommerce_admin_reports_list';
|
14223 |
+
/**
|
14224 |
+
* Internal dependencies
|
14225 |
+
*/
|
14226 |
|
14227 |
+
var RevenueReport = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["lazy"])(function () {
|
14228 |
+
return Promise.all(/* import() | analytics-report-revenue */[__webpack_require__.e(1), __webpack_require__.e(0), __webpack_require__.e(19)]).then(__webpack_require__.bind(null, 554));
|
14229 |
+
});
|
14230 |
+
var ProductsReport = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["lazy"])(function () {
|
14231 |
+
return Promise.all(/* import() | analytics-report-products */[__webpack_require__.e(1), __webpack_require__.e(0), __webpack_require__.e(6), __webpack_require__.e(18)]).then(__webpack_require__.bind(null, 550));
|
14232 |
+
});
|
14233 |
+
var VariationsReport = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["lazy"])(function () {
|
14234 |
+
return Promise.all(/* import() | analytics-report-variations */[__webpack_require__.e(1), __webpack_require__.e(0), __webpack_require__.e(22)]).then(__webpack_require__.bind(null, 555));
|
14235 |
+
});
|
14236 |
+
var OrdersReport = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["lazy"])(function () {
|
14237 |
+
return Promise.all(/* import() | analytics-report-orders */[__webpack_require__.e(1), __webpack_require__.e(0), __webpack_require__.e(8), __webpack_require__.e(17)]).then(__webpack_require__.bind(null, 556));
|
14238 |
+
});
|
14239 |
+
var CategoriesReport = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["lazy"])(function () {
|
14240 |
+
return Promise.all(/* import() | analytics-report-categories */[__webpack_require__.e(1), __webpack_require__.e(0), __webpack_require__.e(6), __webpack_require__.e(13)]).then(__webpack_require__.bind(null, 552));
|
14241 |
+
});
|
14242 |
+
var CouponsReport = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["lazy"])(function () {
|
14243 |
+
return Promise.all(/* import() | analytics-report-coupons */[__webpack_require__.e(1), __webpack_require__.e(0), __webpack_require__.e(14)]).then(__webpack_require__.bind(null, 557));
|
14244 |
+
});
|
14245 |
+
var TaxesReport = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["lazy"])(function () {
|
14246 |
+
return Promise.all(/* import() | analytics-report-taxes */[__webpack_require__.e(1), __webpack_require__.e(0), __webpack_require__.e(21)]).then(__webpack_require__.bind(null, 558));
|
14247 |
+
});
|
14248 |
+
var DownloadsReport = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["lazy"])(function () {
|
14249 |
+
return Promise.all(/* import() | analytics-report-downloads */[__webpack_require__.e(1), __webpack_require__.e(0), __webpack_require__.e(16)]).then(__webpack_require__.bind(null, 559));
|
14250 |
+
});
|
14251 |
+
var StockReport = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["lazy"])(function () {
|
14252 |
+
return Promise.all(/* import() | analytics-report-stock */[__webpack_require__.e(0), __webpack_require__.e(20)]).then(__webpack_require__.bind(null, 551));
|
14253 |
+
});
|
14254 |
+
var CustomersReport = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["lazy"])(function () {
|
14255 |
+
return Promise.all(/* import() | analytics-report-customers */[__webpack_require__.e(0), __webpack_require__.e(15)]).then(__webpack_require__.bind(null, 553));
|
14256 |
+
});
|
14257 |
+
/* harmony default export */ __webpack_exports__["a"] = (function () {
|
14258 |
+
var reports = [{
|
14259 |
+
report: 'revenue',
|
14260 |
+
title: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__["__"])('Revenue', 'woocommerce-admin'),
|
14261 |
+
component: RevenueReport,
|
14262 |
+
navArgs: {
|
14263 |
+
id: 'woocommerce-analytics-revenue'
|
14264 |
}
|
14265 |
+
}, {
|
14266 |
+
report: 'products',
|
14267 |
+
title: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__["__"])('Products', 'woocommerce-admin'),
|
14268 |
+
component: ProductsReport,
|
14269 |
+
navArgs: {
|
14270 |
+
id: 'woocommerce-analytics-products'
|
14271 |
+
}
|
14272 |
+
}, {
|
14273 |
+
report: 'variations',
|
14274 |
+
title: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__["__"])('Variations', 'woocommerce-admin'),
|
14275 |
+
component: VariationsReport,
|
14276 |
+
navArgs: {
|
14277 |
+
id: 'woocommerce-analytics-variations'
|
14278 |
+
}
|
14279 |
+
}, {
|
14280 |
+
report: 'orders',
|
14281 |
+
title: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__["__"])('Orders', 'woocommerce-admin'),
|
14282 |
+
component: OrdersReport,
|
14283 |
+
navArgs: {
|
14284 |
+
id: 'woocommerce-analytics-orders'
|
14285 |
+
}
|
14286 |
+
}, {
|
14287 |
+
report: 'categories',
|
14288 |
+
title: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__["__"])('Categories', 'woocommerce-admin'),
|
14289 |
+
component: CategoriesReport,
|
14290 |
+
navArgs: {
|
14291 |
+
id: 'woocommerce-analytics-categories'
|
14292 |
+
}
|
14293 |
+
}, {
|
14294 |
+
report: 'coupons',
|
14295 |
+
title: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__["__"])('Coupons', 'woocommerce-admin'),
|
14296 |
+
component: CouponsReport,
|
14297 |
+
navArgs: {
|
14298 |
+
id: 'woocommerce-analytics-coupons'
|
14299 |
+
}
|
14300 |
+
}, {
|
14301 |
+
report: 'taxes',
|
14302 |
+
title: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__["__"])('Taxes', 'woocommerce-admin'),
|
14303 |
+
component: TaxesReport,
|
14304 |
+
navArgs: {
|
14305 |
+
id: 'woocommerce-analytics-taxes'
|
14306 |
+
}
|
14307 |
+
}, manageStock === 'yes' ? {
|
14308 |
+
report: 'stock',
|
14309 |
+
title: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__["__"])('Stock', 'woocommerce-admin'),
|
14310 |
+
component: StockReport,
|
14311 |
+
navArgs: {
|
14312 |
+
id: 'woocommerce-analytics-stock'
|
14313 |
+
}
|
14314 |
+
} : null, {
|
14315 |
+
report: 'customers',
|
14316 |
+
title: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__["__"])('Customers', 'woocommerce-admin'),
|
14317 |
+
component: CustomersReport
|
14318 |
+
}, {
|
14319 |
+
report: 'downloads',
|
14320 |
+
title: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__["__"])('Downloads', 'woocommerce-admin'),
|
14321 |
+
component: DownloadsReport,
|
14322 |
+
navArgs: {
|
14323 |
+
id: 'woocommerce-analytics-downloads'
|
14324 |
+
}
|
14325 |
+
}].filter(Boolean);
|
14326 |
+
return Object(_wordpress_hooks__WEBPACK_IMPORTED_MODULE_1__["applyFilters"])(REPORTS_FILTER, reports);
|
14327 |
+
});
|
14328 |
|
14329 |
+
/***/ }),
|
14330 |
+
/* 194 */
|
14331 |
+
/***/ (function(module, exports, __webpack_require__) {
|
14332 |
|
14333 |
+
"use strict";
|
14334 |
|
|
|
|
|
14335 |
|
14336 |
+
var reactIs = __webpack_require__(182);
|
|
|
14337 |
|
14338 |
+
/**
|
14339 |
+
* Copyright 2015, Yahoo! Inc.
|
14340 |
+
* Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.
|
14341 |
+
*/
|
14342 |
+
var REACT_STATICS = {
|
14343 |
+
childContextTypes: true,
|
14344 |
+
contextType: true,
|
14345 |
+
contextTypes: true,
|
14346 |
+
defaultProps: true,
|
14347 |
+
displayName: true,
|
14348 |
+
getDefaultProps: true,
|
14349 |
+
getDerivedStateFromError: true,
|
14350 |
+
getDerivedStateFromProps: true,
|
14351 |
+
mixins: true,
|
14352 |
+
propTypes: true,
|
14353 |
+
type: true
|
14354 |
+
};
|
14355 |
+
var KNOWN_STATICS = {
|
14356 |
+
name: true,
|
14357 |
+
length: true,
|
14358 |
+
prototype: true,
|
14359 |
+
caller: true,
|
14360 |
+
callee: true,
|
14361 |
+
arguments: true,
|
14362 |
+
arity: true
|
14363 |
+
};
|
14364 |
+
var FORWARD_REF_STATICS = {
|
14365 |
+
'$$typeof': true,
|
14366 |
+
render: true,
|
14367 |
+
defaultProps: true,
|
14368 |
+
displayName: true,
|
14369 |
+
propTypes: true
|
14370 |
+
};
|
14371 |
+
var MEMO_STATICS = {
|
14372 |
+
'$$typeof': true,
|
14373 |
+
compare: true,
|
14374 |
+
defaultProps: true,
|
14375 |
+
displayName: true,
|
14376 |
+
propTypes: true,
|
14377 |
+
type: true
|
14378 |
+
};
|
14379 |
+
var TYPE_STATICS = {};
|
14380 |
+
TYPE_STATICS[reactIs.ForwardRef] = FORWARD_REF_STATICS;
|
14381 |
+
TYPE_STATICS[reactIs.Memo] = MEMO_STATICS;
|
14382 |
|
14383 |
+
function getStatics(component) {
|
14384 |
+
// React v16.11 and below
|
14385 |
+
if (reactIs.isMemo(component)) {
|
14386 |
+
return MEMO_STATICS;
|
14387 |
+
} // React v16.12 and above
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14388 |
|
|
|
|
|
|
|
14389 |
|
14390 |
+
return TYPE_STATICS[component['$$typeof']] || REACT_STATICS;
|
14391 |
+
}
|
14392 |
|
14393 |
+
var defineProperty = Object.defineProperty;
|
14394 |
+
var getOwnPropertyNames = Object.getOwnPropertyNames;
|
14395 |
+
var getOwnPropertySymbols = Object.getOwnPropertySymbols;
|
14396 |
+
var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
|
14397 |
+
var getPrototypeOf = Object.getPrototypeOf;
|
14398 |
+
var objectPrototype = Object.prototype;
|
14399 |
+
function hoistNonReactStatics(targetComponent, sourceComponent, blacklist) {
|
14400 |
+
if (typeof sourceComponent !== 'string') {
|
14401 |
+
// don't hoist over string (html) components
|
14402 |
+
if (objectPrototype) {
|
14403 |
+
var inheritedComponent = getPrototypeOf(sourceComponent);
|
14404 |
|
14405 |
+
if (inheritedComponent && inheritedComponent !== objectPrototype) {
|
14406 |
+
hoistNonReactStatics(targetComponent, inheritedComponent, blacklist);
|
14407 |
+
}
|
14408 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14409 |
|
14410 |
+
var keys = getOwnPropertyNames(sourceComponent);
|
|
|
14411 |
|
14412 |
+
if (getOwnPropertySymbols) {
|
14413 |
+
keys = keys.concat(getOwnPropertySymbols(sourceComponent));
|
14414 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14415 |
|
14416 |
+
var targetStatics = getStatics(targetComponent);
|
14417 |
+
var sourceStatics = getStatics(sourceComponent);
|
|
|
|
|
14418 |
|
14419 |
+
for (var i = 0; i < keys.length; ++i) {
|
14420 |
+
var key = keys[i];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14421 |
|
14422 |
+
if (!KNOWN_STATICS[key] && !(blacklist && blacklist[key]) && !(sourceStatics && sourceStatics[key]) && !(targetStatics && targetStatics[key])) {
|
14423 |
+
var descriptor = getOwnPropertyDescriptor(sourceComponent, key);
|
14424 |
+
|
14425 |
+
try {
|
14426 |
+
// Avoid failures from read-only properties
|
14427 |
+
defineProperty(targetComponent, key, descriptor);
|
14428 |
+
} catch (e) {}
|
14429 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14430 |
}
|
14431 |
}
|
14432 |
|
14433 |
+
return targetComponent;
|
14434 |
+
}
|
|
|
|
|
14435 |
|
14436 |
+
module.exports = hoistNonReactStatics;
|
|
|
|
|
|
|
14437 |
|
|
|
14438 |
|
14439 |
+
/***/ }),
|
14440 |
+
/* 195 */,
|
14441 |
+
/* 196 */
|
14442 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
14443 |
|
14444 |
+
"use strict";
|
14445 |
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return useIsScrolled; });
|
14446 |
+
/* harmony import */ var _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(31);
|
14447 |
+
/* harmony import */ var _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_0__);
|
14448 |
+
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(0);
|
14449 |
+
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__);
|
|
|
|
|
|
|
|
|
|
|
|
|
14450 |
|
|
|
|
|
|
|
|
|
14451 |
|
14452 |
+
/**
|
14453 |
+
* External dependencies
|
14454 |
+
*/
|
14455 |
|
14456 |
+
function useIsScrolled() {
|
14457 |
+
var _useState = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["useState"])(false),
|
14458 |
+
_useState2 = _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_0___default()(_useState, 2),
|
14459 |
+
isScrolled = _useState2[0],
|
14460 |
+
setIsScrolled = _useState2[1];
|
14461 |
|
14462 |
+
var rafHandle = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["useRef"])(null);
|
14463 |
+
Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["useEffect"])(function () {
|
14464 |
+
var updateIsScrolled = function updateIsScrolled() {
|
14465 |
+
setIsScrolled(window.pageYOffset > 20);
|
14466 |
+
};
|
14467 |
|
14468 |
+
var scrollListener = function scrollListener() {
|
14469 |
+
rafHandle.current = window.requestAnimationFrame(updateIsScrolled);
|
14470 |
+
};
|
14471 |
|
14472 |
+
window.addEventListener('scroll', scrollListener);
|
14473 |
+
return function () {
|
14474 |
+
window.removeEventListener('scroll', scrollListener);
|
14475 |
+
window.cancelAnimationFrame(rafHandle.current);
|
14476 |
+
};
|
14477 |
+
}, []);
|
14478 |
+
return isScrolled;
|
14479 |
+
}
|
14480 |
|
14481 |
+
/***/ }),
|
14482 |
+
/* 197 */
|
14483 |
+
/***/ (function(module, exports) {
|
14484 |
|
14485 |
+
(function() { module.exports = this["wp"]["plugins"]; }());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14486 |
|
14487 |
+
/***/ }),
|
14488 |
+
/* 198 */
|
14489 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
14490 |
|
14491 |
+
"use strict";
|
|
|
|
|
|
|
14492 |
|
14493 |
+
// EXPORTS
|
14494 |
+
__webpack_require__.d(__webpack_exports__, "c", function() { return /* binding */ layout_PrimaryLayout; });
|
14495 |
+
__webpack_require__.d(__webpack_exports__, "b", function() { return /* binding */ PageLayout; });
|
14496 |
+
__webpack_require__.d(__webpack_exports__, "a", function() { return /* binding */ EmbedLayout; });
|
14497 |
|
14498 |
+
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/extends.js
|
14499 |
+
var helpers_extends = __webpack_require__(36);
|
14500 |
+
var extends_default = /*#__PURE__*/__webpack_require__.n(helpers_extends);
|
|
|
|
|
|
|
|
|
|
|
14501 |
|
14502 |
+
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/objectWithoutProperties.js
|
14503 |
+
var objectWithoutProperties = __webpack_require__(58);
|
14504 |
+
var objectWithoutProperties_default = /*#__PURE__*/__webpack_require__.n(objectWithoutProperties);
|
14505 |
|
14506 |
+
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/defineProperty.js
|
14507 |
+
var defineProperty = __webpack_require__(5);
|
14508 |
+
var defineProperty_default = /*#__PURE__*/__webpack_require__.n(defineProperty);
|
14509 |
|
14510 |
+
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/classCallCheck.js
|
14511 |
+
var classCallCheck = __webpack_require__(20);
|
14512 |
+
var classCallCheck_default = /*#__PURE__*/__webpack_require__.n(classCallCheck);
|
14513 |
|
14514 |
+
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/createClass.js
|
14515 |
+
var createClass = __webpack_require__(15);
|
14516 |
+
var createClass_default = /*#__PURE__*/__webpack_require__.n(createClass);
|
14517 |
|
14518 |
+
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/inherits.js
|
14519 |
+
var inherits = __webpack_require__(22);
|
14520 |
+
var inherits_default = /*#__PURE__*/__webpack_require__.n(inherits);
|
14521 |
|
14522 |
+
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js
|
14523 |
+
var possibleConstructorReturn = __webpack_require__(23);
|
14524 |
+
var possibleConstructorReturn_default = /*#__PURE__*/__webpack_require__.n(possibleConstructorReturn);
|
14525 |
|
14526 |
+
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/getPrototypeOf.js
|
14527 |
+
var getPrototypeOf = __webpack_require__(10);
|
14528 |
+
var getPrototypeOf_default = /*#__PURE__*/__webpack_require__.n(getPrototypeOf);
|
14529 |
|
14530 |
+
// EXTERNAL MODULE: external {"this":["wp","element"]}
|
14531 |
+
var external_this_wp_element_ = __webpack_require__(0);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14532 |
|
14533 |
+
// EXTERNAL MODULE: ./node_modules/@wordpress/compose/build-module/higher-order/compose.js
|
14534 |
+
var compose = __webpack_require__(181);
|
|
|
14535 |
|
14536 |
+
// EXTERNAL MODULE: external {"this":["wp","data"]}
|
14537 |
+
var external_this_wp_data_ = __webpack_require__(25);
|
14538 |
|
14539 |
+
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js
|
14540 |
+
var inheritsLoose = __webpack_require__(53);
|
14541 |
|
14542 |
+
// EXTERNAL MODULE: external "React"
|
14543 |
+
var external_React_ = __webpack_require__(8);
|
14544 |
+
var external_React_default = /*#__PURE__*/__webpack_require__.n(external_React_);
|
|
|
|
|
|
|
|
|
14545 |
|
14546 |
+
// EXTERNAL MODULE: ./node_modules/prop-types/index.js
|
14547 |
+
var prop_types = __webpack_require__(1);
|
14548 |
+
var prop_types_default = /*#__PURE__*/__webpack_require__.n(prop_types);
|
|
|
|
|
|
|
|
|
14549 |
|
14550 |
+
// EXTERNAL MODULE: ./node_modules/history/esm/history.js + 2 modules
|
14551 |
+
var esm_history = __webpack_require__(108);
|
|
|
|
|
|
|
|
|
|
|
14552 |
|
14553 |
+
// EXTERNAL MODULE: ./node_modules/mini-create-react-context/dist/esm/index.js
|
14554 |
+
var esm = __webpack_require__(341);
|
14555 |
|
14556 |
+
// EXTERNAL MODULE: ./node_modules/tiny-invariant/dist/tiny-invariant.esm.js
|
14557 |
+
var tiny_invariant_esm = __webpack_require__(92);
|
14558 |
|
14559 |
+
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/extends.js
|
14560 |
+
var esm_extends = __webpack_require__(7);
|
|
|
|
|
|
|
|
|
|
|
14561 |
|
14562 |
+
// EXTERNAL MODULE: ./node_modules/path-to-regexp/index.js
|
14563 |
+
var path_to_regexp = __webpack_require__(239);
|
14564 |
+
var path_to_regexp_default = /*#__PURE__*/__webpack_require__.n(path_to_regexp);
|
|
|
|
|
|
|
|
|
14565 |
|
14566 |
+
// EXTERNAL MODULE: ./node_modules/react-is/index.js
|
14567 |
+
var react_is = __webpack_require__(182);
|
14568 |
+
|
14569 |
+
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js
|
14570 |
+
var objectWithoutPropertiesLoose = __webpack_require__(54);
|
14571 |
+
|
14572 |
+
// EXTERNAL MODULE: ./node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js
|
14573 |
+
var hoist_non_react_statics_cjs = __webpack_require__(194);
|
14574 |
+
var hoist_non_react_statics_cjs_default = /*#__PURE__*/__webpack_require__.n(hoist_non_react_statics_cjs);
|
14575 |
+
|
14576 |
+
// CONCATENATED MODULE: ./node_modules/react-router/esm/react-router.js
|
14577 |
+
|
14578 |
+
|
14579 |
+
|
14580 |
+
|
14581 |
+
|
14582 |
+
|
14583 |
+
|
14584 |
+
|
14585 |
+
|
14586 |
+
|
14587 |
+
|
14588 |
+
|
14589 |
+
|
14590 |
+
// TODO: Replace with React.createContext once we can assume React 16+
|
14591 |
+
|
14592 |
+
var react_router_createNamedContext = function createNamedContext(name) {
|
14593 |
+
var context = Object(esm["a" /* default */])();
|
14594 |
+
context.displayName = name;
|
14595 |
+
return context;
|
14596 |
+
};
|
14597 |
+
|
14598 |
+
var react_router_context =
|
14599 |
+
/*#__PURE__*/
|
14600 |
+
react_router_createNamedContext("Router");
|
14601 |
+
|
14602 |
+
/**
|
14603 |
+
* The public API for putting history on context.
|
14604 |
+
*/
|
14605 |
+
|
14606 |
+
var react_router_Router =
|
14607 |
+
/*#__PURE__*/
|
14608 |
+
function (_React$Component) {
|
14609 |
+
Object(inheritsLoose["a" /* default */])(Router, _React$Component);
|
14610 |
+
|
14611 |
+
Router.computeRootMatch = function computeRootMatch(pathname) {
|
14612 |
+
return {
|
14613 |
+
path: "/",
|
14614 |
+
url: "/",
|
14615 |
+
params: {},
|
14616 |
+
isExact: pathname === "/"
|
14617 |
+
};
|
14618 |
+
};
|
14619 |
+
|
14620 |
+
function Router(props) {
|
14621 |
+
var _this;
|
14622 |
+
|
14623 |
+
_this = _React$Component.call(this, props) || this;
|
14624 |
+
_this.state = {
|
14625 |
+
location: props.history.location
|
14626 |
+
}; // This is a bit of a hack. We have to start listening for location
|
14627 |
+
// changes here in the constructor in case there are any <Redirect>s
|
14628 |
+
// on the initial render. If there are, they will replace/push when
|
14629 |
+
// they mount and since cDM fires in children before parents, we may
|
14630 |
+
// get a new location before the <Router> is mounted.
|
14631 |
+
|
14632 |
+
_this._isMounted = false;
|
14633 |
+
_this._pendingLocation = null;
|
14634 |
+
|
14635 |
+
if (!props.staticContext) {
|
14636 |
+
_this.unlisten = props.history.listen(function (location) {
|
14637 |
+
if (_this._isMounted) {
|
14638 |
+
_this.setState({
|
14639 |
+
location: location
|
14640 |
+
});
|
14641 |
+
} else {
|
14642 |
+
_this._pendingLocation = location;
|
14643 |
+
}
|
14644 |
+
});
|
14645 |
+
}
|
14646 |
+
|
14647 |
+
return _this;
|
14648 |
}
|
14649 |
|
14650 |
+
var _proto = Router.prototype;
|
|
|
14651 |
|
14652 |
+
_proto.componentDidMount = function componentDidMount() {
|
14653 |
+
this._isMounted = true;
|
|
|
|
|
|
|
|
|
|
|
|
|
14654 |
|
14655 |
+
if (this._pendingLocation) {
|
14656 |
+
this.setState({
|
14657 |
+
location: this._pendingLocation
|
14658 |
+
});
|
14659 |
+
}
|
14660 |
+
};
|
|
|
|
|
14661 |
|
14662 |
+
_proto.componentWillUnmount = function componentWillUnmount() {
|
14663 |
+
if (this.unlisten) this.unlisten();
|
14664 |
+
};
|
14665 |
+
|
14666 |
+
_proto.render = function render() {
|
14667 |
+
return external_React_default.a.createElement(react_router_context.Provider, {
|
14668 |
+
children: this.props.children || null,
|
14669 |
+
value: {
|
14670 |
+
history: this.props.history,
|
14671 |
+
location: this.state.location,
|
14672 |
+
match: Router.computeRootMatch(this.state.location.pathname),
|
14673 |
+
staticContext: this.props.staticContext
|
14674 |
+
}
|
14675 |
+
});
|
14676 |
+
};
|
14677 |
|
14678 |
+
return Router;
|
14679 |
+
}(external_React_default.a.Component);
|
|
|
|
|
14680 |
|
14681 |
+
if (false) {}
|
|
|
|
|
|
|
|
|
|
|
14682 |
|
14683 |
+
/**
|
14684 |
+
* The public API for a <Router> that stores location in memory.
|
14685 |
+
*/
|
|
|
|
|
|
|
|
|
14686 |
|
14687 |
+
var react_router_MemoryRouter =
|
14688 |
+
/*#__PURE__*/
|
14689 |
+
function (_React$Component) {
|
14690 |
+
Object(inheritsLoose["a" /* default */])(MemoryRouter, _React$Component);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14691 |
|
14692 |
+
function MemoryRouter() {
|
14693 |
+
var _this;
|
14694 |
|
14695 |
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
14696 |
+
args[_key] = arguments[_key];
|
14697 |
+
}
|
14698 |
|
14699 |
+
_this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;
|
14700 |
+
_this.history = Object(esm_history["c" /* createMemoryHistory */])(_this.props);
|
14701 |
+
return _this;
|
14702 |
+
}
|
14703 |
|
14704 |
+
var _proto = MemoryRouter.prototype;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14705 |
|
14706 |
+
_proto.render = function render() {
|
14707 |
+
return external_React_default.a.createElement(react_router_Router, {
|
14708 |
+
history: this.history,
|
14709 |
+
children: this.props.children
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14710 |
});
|
14711 |
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14712 |
|
14713 |
+
return MemoryRouter;
|
14714 |
+
}(external_React_default.a.Component);
|
|
|
|
|
|
|
|
|
|
|
14715 |
|
14716 |
+
if (false) {}
|
|
|
|
|
14717 |
|
14718 |
+
var react_router_Lifecycle =
|
14719 |
+
/*#__PURE__*/
|
14720 |
+
function (_React$Component) {
|
14721 |
+
Object(inheritsLoose["a" /* default */])(Lifecycle, _React$Component);
|
14722 |
|
14723 |
+
function Lifecycle() {
|
14724 |
+
return _React$Component.apply(this, arguments) || this;
|
14725 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14726 |
|
14727 |
+
var _proto = Lifecycle.prototype;
|
|
|
|
|
14728 |
|
14729 |
+
_proto.componentDidMount = function componentDidMount() {
|
14730 |
+
if (this.props.onMount) this.props.onMount.call(this, this);
|
14731 |
+
};
|
14732 |
|
14733 |
+
_proto.componentDidUpdate = function componentDidUpdate(prevProps) {
|
14734 |
+
if (this.props.onUpdate) this.props.onUpdate.call(this, this, prevProps);
|
14735 |
+
};
|
|
|
|
|
|
|
|
|
14736 |
|
14737 |
+
_proto.componentWillUnmount = function componentWillUnmount() {
|
14738 |
+
if (this.props.onUnmount) this.props.onUnmount.call(this, this);
|
14739 |
+
};
|
14740 |
|
14741 |
+
_proto.render = function render() {
|
14742 |
+
return null;
|
14743 |
+
};
|
|
|
|
|
|
|
|
|
14744 |
|
14745 |
+
return Lifecycle;
|
14746 |
+
}(external_React_default.a.Component);
|
|
|
|
|
|
|
14747 |
|
14748 |
+
/**
|
14749 |
+
* The public API for prompting the user before navigating away from a screen.
|
14750 |
+
*/
|
|
|
|
|
14751 |
|
14752 |
+
function Prompt(_ref) {
|
14753 |
+
var message = _ref.message,
|
14754 |
+
_ref$when = _ref.when,
|
14755 |
+
when = _ref$when === void 0 ? true : _ref$when;
|
14756 |
+
return external_React_default.a.createElement(react_router_context.Consumer, null, function (context) {
|
14757 |
+
!context ? false ? undefined : Object(tiny_invariant_esm["a" /* default */])(false) : void 0;
|
14758 |
+
if (!when || context.staticContext) return null;
|
14759 |
+
var method = context.history.block;
|
14760 |
+
return external_React_default.a.createElement(react_router_Lifecycle, {
|
14761 |
+
onMount: function onMount(self) {
|
14762 |
+
self.release = method(message);
|
14763 |
+
},
|
14764 |
+
onUpdate: function onUpdate(self, prevProps) {
|
14765 |
+
if (prevProps.message !== message) {
|
14766 |
+
self.release();
|
14767 |
+
self.release = method(message);
|
14768 |
+
}
|
14769 |
+
},
|
14770 |
+
onUnmount: function onUnmount(self) {
|
14771 |
+
self.release();
|
14772 |
+
},
|
14773 |
+
message: message
|
14774 |
+
});
|
14775 |
+
});
|
14776 |
+
}
|
14777 |
|
14778 |
+
if (false) { var messageType; }
|
14779 |
|
14780 |
+
var cache = {};
|
14781 |
+
var cacheLimit = 10000;
|
14782 |
+
var cacheCount = 0;
|
14783 |
|
14784 |
+
function compilePath(path) {
|
14785 |
+
if (cache[path]) return cache[path];
|
14786 |
+
var generator = path_to_regexp_default.a.compile(path);
|
14787 |
|
14788 |
+
if (cacheCount < cacheLimit) {
|
14789 |
+
cache[path] = generator;
|
14790 |
+
cacheCount++;
|
14791 |
+
}
|
14792 |
|
14793 |
+
return generator;
|
14794 |
+
}
|
14795 |
/**
|
14796 |
+
* Public API for generating a URL pathname from a path and parameters.
|
14797 |
*/
|
|
|
|
|
|
|
|
|
|
|
14798 |
|
14799 |
+
|
14800 |
+
function generatePath(path, params) {
|
14801 |
+
if (path === void 0) {
|
14802 |
+
path = "/";
|
14803 |
+
}
|
14804 |
+
|
14805 |
+
if (params === void 0) {
|
14806 |
+
params = {};
|
14807 |
+
}
|
14808 |
+
|
14809 |
+
return path === "/" ? path : compilePath(path)(params, {
|
14810 |
+
pretty: true
|
14811 |
+
});
|
14812 |
+
}
|
|
|
|
|
|
|
14813 |
|
14814 |
/**
|
14815 |
+
* The public API for navigating programmatically with a component.
|
|
|
|
|
|
|
|
|
14816 |
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14817 |
|
14818 |
+
function Redirect(_ref) {
|
14819 |
+
var computedMatch = _ref.computedMatch,
|
14820 |
+
to = _ref.to,
|
14821 |
+
_ref$push = _ref.push,
|
14822 |
+
push = _ref$push === void 0 ? false : _ref$push;
|
14823 |
+
return external_React_default.a.createElement(react_router_context.Consumer, null, function (context) {
|
14824 |
+
!context ? false ? undefined : Object(tiny_invariant_esm["a" /* default */])(false) : void 0;
|
14825 |
+
var history = context.history,
|
14826 |
+
staticContext = context.staticContext;
|
14827 |
+
var method = push ? history.push : history.replace;
|
14828 |
+
var location = Object(esm_history["b" /* createLocation */])(computedMatch ? typeof to === "string" ? generatePath(to, computedMatch.params) : Object(esm_extends["a" /* default */])({}, to, {
|
14829 |
+
pathname: generatePath(to.pathname, computedMatch.params)
|
14830 |
+
}) : to); // When rendering in a static context,
|
14831 |
+
// set the new location immediately.
|
14832 |
|
14833 |
+
if (staticContext) {
|
14834 |
+
method(location);
|
14835 |
+
return null;
|
|
|
14836 |
}
|
14837 |
|
14838 |
+
return external_React_default.a.createElement(react_router_Lifecycle, {
|
14839 |
+
onMount: function onMount() {
|
14840 |
+
method(location);
|
14841 |
+
},
|
14842 |
+
onUpdate: function onUpdate(self, prevProps) {
|
14843 |
+
var prevLocation = Object(esm_history["b" /* createLocation */])(prevProps.to);
|
|
|
14844 |
|
14845 |
+
if (!Object(esm_history["e" /* locationsAreEqual */])(prevLocation, Object(esm_extends["a" /* default */])({}, location, {
|
14846 |
+
key: prevLocation.key
|
14847 |
+
}))) {
|
14848 |
+
method(location);
|
14849 |
+
}
|
14850 |
+
},
|
14851 |
+
to: to
|
14852 |
+
});
|
14853 |
+
});
|
14854 |
+
}
|
14855 |
|
14856 |
+
if (false) {}
|
|
|
|
|
|
|
|
|
14857 |
|
14858 |
+
var cache$1 = {};
|
14859 |
+
var cacheLimit$1 = 10000;
|
14860 |
+
var cacheCount$1 = 0;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14861 |
|
14862 |
+
function compilePath$1(path, options) {
|
14863 |
+
var cacheKey = "" + options.end + options.strict + options.sensitive;
|
14864 |
+
var pathCache = cache$1[cacheKey] || (cache$1[cacheKey] = {});
|
14865 |
+
if (pathCache[path]) return pathCache[path];
|
14866 |
+
var keys = [];
|
14867 |
+
var regexp = path_to_regexp_default()(path, keys, options);
|
14868 |
+
var result = {
|
14869 |
+
regexp: regexp,
|
14870 |
+
keys: keys
|
14871 |
+
};
|
14872 |
|
14873 |
+
if (cacheCount$1 < cacheLimit$1) {
|
14874 |
+
pathCache[path] = result;
|
14875 |
+
cacheCount$1++;
|
14876 |
}
|
14877 |
|
14878 |
+
return result;
|
14879 |
}
|
|
|
14880 |
/**
|
14881 |
+
* Public API for matching a URL pathname to a path.
|
|
|
|
|
|
|
|
|
14882 |
*/
|
|
|
|
|
|
|
14883 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14884 |
|
14885 |
+
function matchPath(pathname, options) {
|
14886 |
+
if (options === void 0) {
|
14887 |
+
options = {};
|
14888 |
+
}
|
14889 |
+
|
14890 |
+
if (typeof options === "string" || Array.isArray(options)) {
|
14891 |
+
options = {
|
14892 |
+
path: options
|
14893 |
+
};
|
14894 |
+
}
|
14895 |
+
|
14896 |
+
var _options = options,
|
14897 |
+
path = _options.path,
|
14898 |
+
_options$exact = _options.exact,
|
14899 |
+
exact = _options$exact === void 0 ? false : _options$exact,
|
14900 |
+
_options$strict = _options.strict,
|
14901 |
+
strict = _options$strict === void 0 ? false : _options$strict,
|
14902 |
+
_options$sensitive = _options.sensitive,
|
14903 |
+
sensitive = _options$sensitive === void 0 ? false : _options$sensitive;
|
14904 |
+
var paths = [].concat(path);
|
14905 |
+
return paths.reduce(function (matched, path) {
|
14906 |
+
if (!path && path !== "") return null;
|
14907 |
+
if (matched) return matched;
|
14908 |
+
|
14909 |
+
var _compilePath = compilePath$1(path, {
|
14910 |
+
end: exact,
|
14911 |
+
strict: strict,
|
14912 |
+
sensitive: sensitive
|
14913 |
+
}),
|
14914 |
+
regexp = _compilePath.regexp,
|
14915 |
+
keys = _compilePath.keys;
|
14916 |
+
|
14917 |
+
var match = regexp.exec(pathname);
|
14918 |
+
if (!match) return null;
|
14919 |
+
var url = match[0],
|
14920 |
+
values = match.slice(1);
|
14921 |
+
var isExact = pathname === url;
|
14922 |
+
if (exact && !isExact) return null;
|
14923 |
+
return {
|
14924 |
+
path: path,
|
14925 |
+
// the path used to match
|
14926 |
+
url: path === "/" && url === "" ? "/" : url,
|
14927 |
+
// the matched portion of the URL
|
14928 |
+
isExact: isExact,
|
14929 |
+
// whether or not we matched exactly
|
14930 |
+
params: keys.reduce(function (memo, key, index) {
|
14931 |
+
memo[key.name] = values[index];
|
14932 |
+
return memo;
|
14933 |
+
}, {})
|
14934 |
+
};
|
14935 |
+
}, null);
|
14936 |
+
}
|
14937 |
+
|
14938 |
+
function isEmptyChildren(children) {
|
14939 |
+
return external_React_default.a.Children.count(children) === 0;
|
14940 |
}
|
14941 |
|
14942 |
+
function evalChildrenDev(children, props, path) {
|
14943 |
+
var value = children(props);
|
14944 |
+
false ? undefined : void 0;
|
14945 |
+
return value || null;
|
14946 |
+
}
|
14947 |
/**
|
14948 |
+
* The public API for matching a single path and rendering.
|
14949 |
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14950 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14951 |
|
14952 |
+
var react_router_Route =
|
14953 |
+
/*#__PURE__*/
|
14954 |
+
function (_React$Component) {
|
14955 |
+
Object(inheritsLoose["a" /* default */])(Route, _React$Component);
|
|
|
|
|
|
|
|
|
|
|
14956 |
|
14957 |
+
function Route() {
|
14958 |
+
return _React$Component.apply(this, arguments) || this;
|
14959 |
+
}
|
|
|
|
|
14960 |
|
14961 |
+
var _proto = Route.prototype;
|
|
|
|
|
|
|
14962 |
|
14963 |
+
_proto.render = function render() {
|
14964 |
+
var _this = this;
|
|
|
|
|
|
|
|
|
|
|
14965 |
|
14966 |
+
return external_React_default.a.createElement(react_router_context.Consumer, null, function (context$1) {
|
14967 |
+
!context$1 ? false ? undefined : Object(tiny_invariant_esm["a" /* default */])(false) : void 0;
|
14968 |
+
var location = _this.props.location || context$1.location;
|
14969 |
+
var match = _this.props.computedMatch ? _this.props.computedMatch // <Switch> already computed the match for us
|
14970 |
+
: _this.props.path ? matchPath(location.pathname, _this.props) : context$1.match;
|
14971 |
|
14972 |
+
var props = Object(esm_extends["a" /* default */])({}, context$1, {
|
14973 |
+
location: location,
|
14974 |
+
match: match
|
14975 |
+
});
|
14976 |
|
14977 |
+
var _this$props = _this.props,
|
14978 |
+
children = _this$props.children,
|
14979 |
+
component = _this$props.component,
|
14980 |
+
render = _this$props.render; // Preact uses an empty array as children by
|
14981 |
+
// default, so use null if that's the case.
|
14982 |
|
14983 |
+
if (Array.isArray(children) && children.length === 0) {
|
14984 |
+
children = null;
|
14985 |
}
|
14986 |
|
14987 |
+
return external_React_default.a.createElement(react_router_context.Provider, {
|
14988 |
+
value: props
|
14989 |
+
}, props.match ? children ? typeof children === "function" ? false ? undefined : children(props) : children : component ? external_React_default.a.createElement(component, props) : render ? render(props) : null : typeof children === "function" ? false ? undefined : children(props) : null);
|
14990 |
+
});
|
14991 |
+
};
|
14992 |
|
14993 |
+
return Route;
|
14994 |
+
}(external_React_default.a.Component);
|
|
|
14995 |
|
14996 |
+
if (false) {}
|
|
|
14997 |
|
14998 |
+
function addLeadingSlash(path) {
|
14999 |
+
return path.charAt(0) === "/" ? path : "/" + path;
|
15000 |
}
|
15001 |
|
15002 |
+
function addBasename(basename, location) {
|
15003 |
+
if (!basename) return location;
|
15004 |
+
return Object(esm_extends["a" /* default */])({}, location, {
|
15005 |
+
pathname: addLeadingSlash(basename) + location.pathname
|
15006 |
+
});
|
|
|
|
|
|
|
15007 |
}
|
15008 |
|
15009 |
+
function stripBasename(basename, location) {
|
15010 |
+
if (!basename) return location;
|
15011 |
+
var base = addLeadingSlash(basename);
|
15012 |
+
if (location.pathname.indexOf(base) !== 0) return location;
|
15013 |
+
return Object(esm_extends["a" /* default */])({}, location, {
|
15014 |
+
pathname: location.pathname.substr(base.length)
|
15015 |
+
});
|
|
|
15016 |
}
|
15017 |
|
15018 |
+
function createURL(location) {
|
15019 |
+
return typeof location === "string" ? location : Object(esm_history["d" /* createPath */])(location);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15020 |
}
|
15021 |
|
15022 |
+
function staticHandler(methodName) {
|
15023 |
+
return function () {
|
15024 |
+
false ? undefined : Object(tiny_invariant_esm["a" /* default */])(false) ;
|
15025 |
+
};
|
|
|
|
|
|
|
|
|
15026 |
}
|
15027 |
|
15028 |
+
function noop() {}
|
15029 |
/**
|
15030 |
+
* The public top-level API for a "static" <Router>, so-called because it
|
15031 |
+
* can't actually change the current location. Instead, it just records
|
15032 |
+
* location changes in a context object. Useful mainly in testing and
|
15033 |
+
* server-rendering scenarios.
|
|
|
15034 |
*/
|
|
|
|
|
|
|
15035 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15036 |
|
15037 |
+
var react_router_StaticRouter =
|
15038 |
+
/*#__PURE__*/
|
15039 |
+
function (_React$Component) {
|
15040 |
+
Object(inheritsLoose["a" /* default */])(StaticRouter, _React$Component);
|
15041 |
+
|
15042 |
+
function StaticRouter() {
|
15043 |
+
var _this;
|
15044 |
+
|
15045 |
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
15046 |
+
args[_key] = arguments[_key];
|
15047 |
+
}
|
15048 |
+
|
15049 |
+
_this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;
|
15050 |
+
|
15051 |
+
_this.handlePush = function (location) {
|
15052 |
+
return _this.navigateTo(location, "PUSH");
|
15053 |
+
};
|
15054 |
+
|
15055 |
+
_this.handleReplace = function (location) {
|
15056 |
+
return _this.navigateTo(location, "REPLACE");
|
15057 |
+
};
|
15058 |
+
|
15059 |
+
_this.handleListen = function () {
|
15060 |
+
return noop;
|
15061 |
+
};
|
15062 |
+
|
15063 |
+
_this.handleBlock = function () {
|
15064 |
+
return noop;
|
15065 |
+
};
|
15066 |
+
|
15067 |
+
return _this;
|
15068 |
+
}
|
15069 |
+
|
15070 |
+
var _proto = StaticRouter.prototype;
|
15071 |
+
|
15072 |
+
_proto.navigateTo = function navigateTo(location, action) {
|
15073 |
+
var _this$props = this.props,
|
15074 |
+
_this$props$basename = _this$props.basename,
|
15075 |
+
basename = _this$props$basename === void 0 ? "" : _this$props$basename,
|
15076 |
+
_this$props$context = _this$props.context,
|
15077 |
+
context = _this$props$context === void 0 ? {} : _this$props$context;
|
15078 |
+
context.action = action;
|
15079 |
+
context.location = addBasename(basename, Object(esm_history["b" /* createLocation */])(location));
|
15080 |
+
context.url = createURL(context.location);
|
15081 |
+
};
|
15082 |
+
|
15083 |
+
_proto.render = function render() {
|
15084 |
+
var _this$props2 = this.props,
|
15085 |
+
_this$props2$basename = _this$props2.basename,
|
15086 |
+
basename = _this$props2$basename === void 0 ? "" : _this$props2$basename,
|
15087 |
+
_this$props2$context = _this$props2.context,
|
15088 |
+
context = _this$props2$context === void 0 ? {} : _this$props2$context,
|
15089 |
+
_this$props2$location = _this$props2.location,
|
15090 |
+
location = _this$props2$location === void 0 ? "/" : _this$props2$location,
|
15091 |
+
rest = Object(objectWithoutPropertiesLoose["a" /* default */])(_this$props2, ["basename", "context", "location"]);
|
15092 |
+
|
15093 |
+
var history = {
|
15094 |
+
createHref: function createHref(path) {
|
15095 |
+
return addLeadingSlash(basename + createURL(path));
|
15096 |
+
},
|
15097 |
+
action: "POP",
|
15098 |
+
location: stripBasename(basename, Object(esm_history["b" /* createLocation */])(location)),
|
15099 |
+
push: this.handlePush,
|
15100 |
+
replace: this.handleReplace,
|
15101 |
+
go: staticHandler("go"),
|
15102 |
+
goBack: staticHandler("goBack"),
|
15103 |
+
goForward: staticHandler("goForward"),
|
15104 |
+
listen: this.handleListen,
|
15105 |
+
block: this.handleBlock
|
15106 |
+
};
|
15107 |
+
return external_React_default.a.createElement(react_router_Router, Object(esm_extends["a" /* default */])({}, rest, {
|
15108 |
+
history: history,
|
15109 |
+
staticContext: context
|
15110 |
+
}));
|
15111 |
+
};
|
15112 |
+
|
15113 |
+
return StaticRouter;
|
15114 |
+
}(external_React_default.a.Component);
|
15115 |
+
|
15116 |
+
if (false) {}
|
15117 |
|
15118 |
/**
|
15119 |
+
* The public API for rendering the first <Route> that matches.
|
|
|
|
|
|
|
|
|
|
|
15120 |
*/
|
|
|
|
|
15121 |
|
15122 |
+
var react_router_Switch =
|
15123 |
+
/*#__PURE__*/
|
15124 |
+
function (_React$Component) {
|
15125 |
+
Object(inheritsLoose["a" /* default */])(Switch, _React$Component);
|
15126 |
+
|
15127 |
+
function Switch() {
|
15128 |
+
return _React$Component.apply(this, arguments) || this;
|
15129 |
}
|
15130 |
|
15131 |
+
var _proto = Switch.prototype;
|
15132 |
|
15133 |
+
_proto.render = function render() {
|
15134 |
+
var _this = this;
|
15135 |
|
15136 |
+
return external_React_default.a.createElement(react_router_context.Consumer, null, function (context) {
|
15137 |
+
!context ? false ? undefined : Object(tiny_invariant_esm["a" /* default */])(false) : void 0;
|
15138 |
+
var location = _this.props.location || context.location;
|
15139 |
+
var element, match; // We use React.Children.forEach instead of React.Children.toArray().find()
|
15140 |
+
// here because toArray adds keys to all child elements and we do not want
|
15141 |
+
// to trigger an unmount/remount for two <Route>s that render the same
|
15142 |
+
// component at different URLs.
|
15143 |
+
|
15144 |
+
external_React_default.a.Children.forEach(_this.props.children, function (child) {
|
15145 |
+
if (match == null && external_React_default.a.isValidElement(child)) {
|
15146 |
+
element = child;
|
15147 |
+
var path = child.props.path || child.props.from;
|
15148 |
+
match = path ? matchPath(location.pathname, Object(esm_extends["a" /* default */])({}, child.props, {
|
15149 |
+
path: path
|
15150 |
+
})) : context.match;
|
15151 |
+
}
|
15152 |
+
});
|
15153 |
+
return match ? external_React_default.a.cloneElement(element, {
|
15154 |
+
location: location,
|
15155 |
+
computedMatch: match
|
15156 |
+
}) : null;
|
15157 |
+
});
|
15158 |
+
};
|
15159 |
+
|
15160 |
+
return Switch;
|
15161 |
+
}(external_React_default.a.Component);
|
15162 |
+
|
15163 |
+
if (false) {}
|
15164 |
|
15165 |
/**
|
15166 |
+
* A public higher-order component to access the imperative API
|
|
|
|
|
|
|
|
|
|
|
15167 |
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15168 |
|
15169 |
+
function withRouter(Component) {
|
15170 |
+
var displayName = "withRouter(" + (Component.displayName || Component.name) + ")";
|
|
|
15171 |
|
15172 |
+
var C = function C(props) {
|
15173 |
+
var wrappedComponentRef = props.wrappedComponentRef,
|
15174 |
+
remainingProps = Object(objectWithoutPropertiesLoose["a" /* default */])(props, ["wrappedComponentRef"]);
|
15175 |
|
15176 |
+
return external_React_default.a.createElement(react_router_context.Consumer, null, function (context) {
|
15177 |
+
!context ? false ? undefined : Object(tiny_invariant_esm["a" /* default */])(false) : void 0;
|
15178 |
+
return external_React_default.a.createElement(Component, Object(esm_extends["a" /* default */])({}, remainingProps, context, {
|
15179 |
+
ref: wrappedComponentRef
|
15180 |
+
}));
|
15181 |
+
});
|
15182 |
+
};
|
15183 |
|
15184 |
+
C.displayName = displayName;
|
15185 |
+
C.WrappedComponent = Component;
|
15186 |
|
15187 |
+
if (false) {}
|
|
|
|
|
15188 |
|
15189 |
+
return hoist_non_react_statics_cjs_default()(C, Component);
|
15190 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15191 |
|
15192 |
+
var useContext = external_React_default.a.useContext;
|
15193 |
+
function useHistory() {
|
15194 |
+
if (false) {}
|
15195 |
|
15196 |
+
return useContext(react_router_context).history;
|
15197 |
+
}
|
15198 |
+
function useLocation() {
|
15199 |
+
if (false) {}
|
15200 |
|
15201 |
+
return useContext(react_router_context).location;
|
15202 |
+
}
|
15203 |
+
function useParams() {
|
15204 |
+
if (false) {}
|
|
|
|
|
|
|
15205 |
|
15206 |
+
var match = useContext(react_router_context).match;
|
15207 |
+
return match ? match.params : {};
|
15208 |
+
}
|
15209 |
+
function useRouteMatch(path) {
|
15210 |
+
if (false) {}
|
|
|
|
|
15211 |
|
15212 |
+
return path ? matchPath(useLocation().pathname, path) : useContext(react_router_context).match;
|
15213 |
}
|
15214 |
|
15215 |
+
if (false) { var secondaryBuildName, initialBuildName, buildNames, react_router_key, global; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15216 |
|
|
|
15217 |
|
15218 |
+
//# sourceMappingURL=react-router.js.map
|
|
|
|
|
15219 |
|
15220 |
+
// EXTERNAL MODULE: external "lodash"
|
15221 |
+
var external_lodash_ = __webpack_require__(2);
|
|
|
15222 |
|
15223 |
+
// EXTERNAL MODULE: ./node_modules/qs/lib/index.js
|
15224 |
+
var lib = __webpack_require__(82);
|
15225 |
|
15226 |
+
// EXTERNAL MODULE: external {"this":["wc","components"]}
|
15227 |
+
var external_this_wc_components_ = __webpack_require__(74);
|
15228 |
|
15229 |
+
// EXTERNAL MODULE: external {"this":["wc","navigation"]}
|
15230 |
+
var external_this_wc_navigation_ = __webpack_require__(29);
|
15231 |
|
15232 |
+
// EXTERNAL MODULE: ./client/settings/index.js
|
15233 |
+
var settings = __webpack_require__(35);
|
15234 |
|
15235 |
+
// EXTERNAL MODULE: external {"this":["wc","data"]}
|
15236 |
+
var external_this_wc_data_ = __webpack_require__(34);
|
|
|
|
|
|
|
|
|
|
|
|
|
15237 |
|
15238 |
+
// EXTERNAL MODULE: external {"this":["wc","tracks"]}
|
15239 |
+
var external_this_wc_tracks_ = __webpack_require__(50);
|
|
|
|
|
|
|
|
|
|
|
15240 |
|
15241 |
+
// EXTERNAL MODULE: ./client/layout/style.scss
|
15242 |
+
var layout_style = __webpack_require__(373);
|
|
|
|
|
|
|
15243 |
|
15244 |
+
// EXTERNAL MODULE: external {"this":["wp","hooks"]}
|
15245 |
+
var external_this_wp_hooks_ = __webpack_require__(51);
|
15246 |
+
|
15247 |
+
// EXTERNAL MODULE: external {"this":["wp","i18n"]}
|
15248 |
+
var external_this_wp_i18n_ = __webpack_require__(3);
|
15249 |
+
|
15250 |
+
// EXTERNAL MODULE: ./client/analytics/report/get-reports.js
|
15251 |
+
var get_reports = __webpack_require__(193);
|
|
|
|
|
|
|
|
|
|
|
15252 |
|
15253 |
+
// EXTERNAL MODULE: ./client/dashboard/utils.js
|
15254 |
+
var utils = __webpack_require__(143);
|
|
|
|
|
|
|
|
|
|
|
15255 |
|
15256 |
+
// CONCATENATED MODULE: ./client/layout/controller.js
|
15257 |
|
|
|
|
|
15258 |
|
|
|
|
|
|
|
|
|
15259 |
|
15260 |
|
|
|
|
|
|
|
15261 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15262 |
|
|
|
15263 |
|
15264 |
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = getPrototypeOf_default()(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = getPrototypeOf_default()(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return possibleConstructorReturn_default()(this, result); }; }
|
|
|
15265 |
|
15266 |
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
|
15267 |
|
15268 |
+
/**
|
15269 |
+
* External dependencies
|
15270 |
+
*/
|
|
|
15271 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15272 |
|
|
|
|
|
|
|
15273 |
|
|
|
15274 |
|
15275 |
|
|
|
15276 |
|
|
|
|
|
15277 |
|
15278 |
+
/**
|
15279 |
+
* Internal dependencies
|
15280 |
+
*/
|
|
|
15281 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15282 |
|
|
|
|
|
15283 |
|
15284 |
+
var AnalyticsReport = Object(external_this_wp_element_["lazy"])(function () {
|
15285 |
+
return __webpack_require__.e(/* import() | analytics-report */ 12).then(__webpack_require__.bind(null, 661));
|
15286 |
+
});
|
15287 |
+
var AnalyticsSettings = Object(external_this_wp_element_["lazy"])(function () {
|
15288 |
+
ret
|