Version Description
Download this release
Release Info
Developer | gutenbergplugin |
Plugin | Gutenberg |
Version | 13.4.0 |
Comparing to | |
See all releases |
Code changes from version 13.3.0 to 13.4.0
- build/annotations/index.js +111 -89
- build/annotations/index.min.asset.php +1 -1
- build/annotations/index.min.js +1 -1
- build/annotations/index.min.js.map +1 -1
- build/block-editor/index.js +735 -461
- build/block-editor/index.min.asset.php +1 -1
- build/block-editor/index.min.js +39 -43
build/annotations/index.js
CHANGED
@@ -435,31 +435,57 @@ function annotations() {
|
|
435 |
;// CONCATENATED MODULE: ./node_modules/rememo/es/rememo.js
|
436 |
|
437 |
|
438 |
-
|
|
|
|
|
439 |
|
440 |
/**
|
441 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
442 |
*
|
443 |
-
* @
|
|
|
|
|
|
|
|
|
|
|
444 |
*/
|
445 |
-
LEAF_KEY = {};
|
446 |
|
447 |
/**
|
448 |
-
*
|
449 |
*
|
450 |
-
* @
|
|
|
|
|
|
|
|
|
|
|
451 |
*/
|
452 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
453 |
|
454 |
/**
|
455 |
* Returns the first argument as the sole entry in an array.
|
456 |
*
|
457 |
-
* @
|
|
|
|
|
458 |
*
|
459 |
-
* @return {
|
460 |
*/
|
461 |
-
function arrayOf(
|
462 |
-
return [
|
463 |
}
|
464 |
|
465 |
/**
|
@@ -470,18 +496,19 @@ function arrayOf( value ) {
|
|
470 |
*
|
471 |
* @return {boolean} Whether value is object-like.
|
472 |
*/
|
473 |
-
function isObjectLike(
|
474 |
-
return !!
|
475 |
}
|
476 |
|
477 |
/**
|
478 |
* Creates and returns a new cache object.
|
479 |
*
|
480 |
-
* @return {
|
481 |
*/
|
482 |
function createCache() {
|
|
|
483 |
var cache = {
|
484 |
-
clear: function() {
|
485 |
cache.head = null;
|
486 |
},
|
487 |
};
|
@@ -493,21 +520,21 @@ function createCache() {
|
|
493 |
* Returns true if entries within the two arrays are strictly equal by
|
494 |
* reference from a starting index.
|
495 |
*
|
496 |
-
* @param {
|
497 |
-
* @param {
|
498 |
* @param {number} fromIndex Index from which to start comparison.
|
499 |
*
|
500 |
* @return {boolean} Whether arrays are shallowly equal.
|
501 |
*/
|
502 |
-
function isShallowEqual(
|
503 |
var i;
|
504 |
|
505 |
-
if (
|
506 |
return false;
|
507 |
}
|
508 |
|
509 |
-
for (
|
510 |
-
if (
|
511 |
return false;
|
512 |
}
|
513 |
}
|
@@ -523,31 +550,18 @@ function isShallowEqual( a, b, fromIndex ) {
|
|
523 |
* dependant references remain the same. If getDependants returns a different
|
524 |
* reference(s), the cache is cleared and the selector value regenerated.
|
525 |
*
|
526 |
-
* @
|
527 |
-
* @param {Function} getDependants Dependant getter returning an immutable
|
528 |
-
* reference or array of reference used in
|
529 |
-
* cache bust consideration.
|
530 |
*
|
531 |
-
* @
|
|
|
|
|
532 |
*/
|
533 |
-
/* harmony default export */ function rememo(selector, getDependants
|
534 |
-
|
|
|
535 |
|
536 |
-
|
537 |
-
|
538 |
-
getDependants = arrayOf;
|
539 |
-
}
|
540 |
-
|
541 |
-
/**
|
542 |
-
* Returns the root cache. If WeakMap is supported, this is assigned to the
|
543 |
-
* root WeakMap cache set, otherwise it is a shared instance of the default
|
544 |
-
* cache object.
|
545 |
-
*
|
546 |
-
* @return {(WeakMap|Object)} Root cache object.
|
547 |
-
*/
|
548 |
-
function getRootCache() {
|
549 |
-
return rootCache;
|
550 |
-
}
|
551 |
|
552 |
/**
|
553 |
* Returns the cache for a given dependants array. When possible, a WeakMap
|
@@ -563,85 +577,93 @@ function isShallowEqual( a, b, fromIndex ) {
|
|
563 |
*
|
564 |
* @see isObjectLike
|
565 |
*
|
566 |
-
* @param {
|
567 |
*
|
568 |
-
* @return {
|
569 |
*/
|
570 |
-
function
|
571 |
var caches = rootCache,
|
572 |
isUniqueByDependants = true,
|
573 |
-
i,
|
|
|
|
|
|
|
574 |
|
575 |
-
for (
|
576 |
-
dependant = dependants[
|
577 |
|
578 |
// Can only compose WeakMap from object-like key.
|
579 |
-
if (
|
580 |
isUniqueByDependants = false;
|
581 |
break;
|
582 |
}
|
583 |
|
584 |
// Does current segment of cache already have a WeakMap?
|
585 |
-
if (
|
586 |
// Traverse into nested WeakMap.
|
587 |
-
caches = caches.get(
|
588 |
} else {
|
589 |
// Create, set, and traverse into a new one.
|
590 |
map = new WeakMap();
|
591 |
-
caches.set(
|
592 |
caches = map;
|
593 |
}
|
594 |
}
|
595 |
|
596 |
// We use an arbitrary (but consistent) object as key for the last item
|
597 |
// in the WeakMap to serve as our running cache.
|
598 |
-
if (
|
599 |
cache = createCache();
|
600 |
cache.isUniqueByDependants = isUniqueByDependants;
|
601 |
-
caches.set(
|
602 |
}
|
603 |
|
604 |
-
return caches.get(
|
605 |
}
|
606 |
|
607 |
-
// Assign cache handler by availability of WeakMap
|
608 |
-
getCache = hasWeakMap ? getWeakMapCache : getRootCache;
|
609 |
-
|
610 |
/**
|
611 |
* Resets root memoization cache.
|
612 |
*/
|
613 |
function clear() {
|
614 |
-
rootCache =
|
615 |
}
|
616 |
|
617 |
-
|
618 |
/**
|
619 |
* The augmented selector call, considering first whether dependants have
|
620 |
* changed before passing it to underlying memoize function.
|
621 |
*
|
622 |
-
* @param {
|
623 |
-
* @param {...*}
|
624 |
*
|
625 |
* @return {*} Selector result.
|
626 |
*/
|
627 |
-
|
|
|
628 |
var len = arguments.length,
|
629 |
-
cache,
|
|
|
|
|
|
|
|
|
630 |
|
631 |
// Create copy of arguments (avoid leaking deoptimization).
|
632 |
-
args = new Array(
|
633 |
-
for (
|
634 |
-
args[
|
635 |
}
|
636 |
|
637 |
-
dependants =
|
638 |
-
cache = getCache(
|
639 |
-
|
640 |
-
// If not guaranteed uniqueness by dependants (primitive type
|
641 |
-
//
|
642 |
-
//
|
643 |
-
if (
|
644 |
-
if (
|
|
|
|
|
|
|
645 |
cache.clear();
|
646 |
}
|
647 |
|
@@ -649,9 +671,9 @@ function isShallowEqual( a, b, fromIndex ) {
|
|
649 |
}
|
650 |
|
651 |
node = cache.head;
|
652 |
-
while (
|
653 |
// Check whether node arguments match arguments
|
654 |
-
if (
|
655 |
node = node.next;
|
656 |
continue;
|
657 |
}
|
@@ -659,16 +681,16 @@ function isShallowEqual( a, b, fromIndex ) {
|
|
659 |
// At this point we can assume we've found a match
|
660 |
|
661 |
// Surface matched node to head if not already
|
662 |
-
if (
|
663 |
// Adjust siblings to point to each other.
|
664 |
-
node.prev.next = node.next;
|
665 |
-
if (
|
666 |
node.next.prev = node.prev;
|
667 |
}
|
668 |
|
669 |
node.next = cache.head;
|
670 |
node.prev = null;
|
671 |
-
cache.head.prev = node;
|
672 |
cache.head = node;
|
673 |
}
|
674 |
|
@@ -678,20 +700,20 @@ function isShallowEqual( a, b, fromIndex ) {
|
|
678 |
|
679 |
// No cached value found. Continue to insertion phase:
|
680 |
|
681 |
-
node = {
|
682 |
// Generate the result from original function
|
683 |
-
val: selector.apply(
|
684 |
-
};
|
685 |
|
686 |
// Avoid including the source object in the cache.
|
687 |
-
args[
|
688 |
node.args = args;
|
689 |
|
690 |
// Don't need to check whether node is already head, since it would
|
691 |
// have been returned above already if it was
|
692 |
|
693 |
// Shift existing head down list
|
694 |
-
if (
|
695 |
cache.head.prev = node;
|
696 |
node.next = cache.head;
|
697 |
}
|
@@ -701,11 +723,11 @@ function isShallowEqual( a, b, fromIndex ) {
|
|
701 |
return node.val;
|
702 |
}
|
703 |
|
704 |
-
callSelector.getDependants =
|
705 |
callSelector.clear = clear;
|
706 |
clear();
|
707 |
|
708 |
-
return callSelector;
|
709 |
}
|
710 |
|
711 |
;// CONCATENATED MODULE: ./packages/annotations/build-module/store/selectors.js
|
435 |
;// CONCATENATED MODULE: ./node_modules/rememo/es/rememo.js
|
436 |
|
437 |
|
438 |
+
/** @typedef {(...args: any[]) => *[]} GetDependants */
|
439 |
+
|
440 |
+
/** @typedef {() => void} Clear */
|
441 |
|
442 |
/**
|
443 |
+
* @typedef {{
|
444 |
+
* getDependants: GetDependants,
|
445 |
+
* clear: Clear
|
446 |
+
* }} EnhancedSelector
|
447 |
+
*/
|
448 |
+
|
449 |
+
/**
|
450 |
+
* Internal cache entry.
|
451 |
*
|
452 |
+
* @typedef CacheNode
|
453 |
+
*
|
454 |
+
* @property {?CacheNode|undefined} [prev] Previous node.
|
455 |
+
* @property {?CacheNode|undefined} [next] Next node.
|
456 |
+
* @property {*[]} args Function arguments for cache entry.
|
457 |
+
* @property {*} val Function result.
|
458 |
*/
|
|
|
459 |
|
460 |
/**
|
461 |
+
* @typedef Cache
|
462 |
*
|
463 |
+
* @property {Clear} clear Function to clear cache.
|
464 |
+
* @property {boolean} [isUniqueByDependants] Whether dependants are valid in
|
465 |
+
* considering cache uniqueness. A cache is unique if dependents are all arrays
|
466 |
+
* or objects.
|
467 |
+
* @property {CacheNode?} [head] Cache head.
|
468 |
+
* @property {*[]} [lastDependants] Dependants from previous invocation.
|
469 |
*/
|
470 |
+
|
471 |
+
/**
|
472 |
+
* Arbitrary value used as key for referencing cache object in WeakMap tree.
|
473 |
+
*
|
474 |
+
* @type {{}}
|
475 |
+
*/
|
476 |
+
var LEAF_KEY = {};
|
477 |
|
478 |
/**
|
479 |
* Returns the first argument as the sole entry in an array.
|
480 |
*
|
481 |
+
* @template T
|
482 |
+
*
|
483 |
+
* @param {T} value Value to return.
|
484 |
*
|
485 |
+
* @return {[T]} Value returned as entry in array.
|
486 |
*/
|
487 |
+
function arrayOf(value) {
|
488 |
+
return [value];
|
489 |
}
|
490 |
|
491 |
/**
|
496 |
*
|
497 |
* @return {boolean} Whether value is object-like.
|
498 |
*/
|
499 |
+
function isObjectLike(value) {
|
500 |
+
return !!value && 'object' === typeof value;
|
501 |
}
|
502 |
|
503 |
/**
|
504 |
* Creates and returns a new cache object.
|
505 |
*
|
506 |
+
* @return {Cache} Cache object.
|
507 |
*/
|
508 |
function createCache() {
|
509 |
+
/** @type {Cache} */
|
510 |
var cache = {
|
511 |
+
clear: function () {
|
512 |
cache.head = null;
|
513 |
},
|
514 |
};
|
520 |
* Returns true if entries within the two arrays are strictly equal by
|
521 |
* reference from a starting index.
|
522 |
*
|
523 |
+
* @param {*[]} a First array.
|
524 |
+
* @param {*[]} b Second array.
|
525 |
* @param {number} fromIndex Index from which to start comparison.
|
526 |
*
|
527 |
* @return {boolean} Whether arrays are shallowly equal.
|
528 |
*/
|
529 |
+
function isShallowEqual(a, b, fromIndex) {
|
530 |
var i;
|
531 |
|
532 |
+
if (a.length !== b.length) {
|
533 |
return false;
|
534 |
}
|
535 |
|
536 |
+
for (i = fromIndex; i < a.length; i++) {
|
537 |
+
if (a[i] !== b[i]) {
|
538 |
return false;
|
539 |
}
|
540 |
}
|
550 |
* dependant references remain the same. If getDependants returns a different
|
551 |
* reference(s), the cache is cleared and the selector value regenerated.
|
552 |
*
|
553 |
+
* @template {(...args: *[]) => *} S
|
|
|
|
|
|
|
554 |
*
|
555 |
+
* @param {S} selector Selector function.
|
556 |
+
* @param {GetDependants=} getDependants Dependant getter returning an array of
|
557 |
+
* references used in cache bust consideration.
|
558 |
*/
|
559 |
+
/* harmony default export */ function rememo(selector, getDependants) {
|
560 |
+
/** @type {WeakMap<*,*>} */
|
561 |
+
var rootCache;
|
562 |
|
563 |
+
/** @type {GetDependants} */
|
564 |
+
var normalizedGetDependants = getDependants ? getDependants : arrayOf;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
565 |
|
566 |
/**
|
567 |
* Returns the cache for a given dependants array. When possible, a WeakMap
|
577 |
*
|
578 |
* @see isObjectLike
|
579 |
*
|
580 |
+
* @param {*[]} dependants Selector dependants.
|
581 |
*
|
582 |
+
* @return {Cache} Cache object.
|
583 |
*/
|
584 |
+
function getCache(dependants) {
|
585 |
var caches = rootCache,
|
586 |
isUniqueByDependants = true,
|
587 |
+
i,
|
588 |
+
dependant,
|
589 |
+
map,
|
590 |
+
cache;
|
591 |
|
592 |
+
for (i = 0; i < dependants.length; i++) {
|
593 |
+
dependant = dependants[i];
|
594 |
|
595 |
// Can only compose WeakMap from object-like key.
|
596 |
+
if (!isObjectLike(dependant)) {
|
597 |
isUniqueByDependants = false;
|
598 |
break;
|
599 |
}
|
600 |
|
601 |
// Does current segment of cache already have a WeakMap?
|
602 |
+
if (caches.has(dependant)) {
|
603 |
// Traverse into nested WeakMap.
|
604 |
+
caches = caches.get(dependant);
|
605 |
} else {
|
606 |
// Create, set, and traverse into a new one.
|
607 |
map = new WeakMap();
|
608 |
+
caches.set(dependant, map);
|
609 |
caches = map;
|
610 |
}
|
611 |
}
|
612 |
|
613 |
// We use an arbitrary (but consistent) object as key for the last item
|
614 |
// in the WeakMap to serve as our running cache.
|
615 |
+
if (!caches.has(LEAF_KEY)) {
|
616 |
cache = createCache();
|
617 |
cache.isUniqueByDependants = isUniqueByDependants;
|
618 |
+
caches.set(LEAF_KEY, cache);
|
619 |
}
|
620 |
|
621 |
+
return caches.get(LEAF_KEY);
|
622 |
}
|
623 |
|
|
|
|
|
|
|
624 |
/**
|
625 |
* Resets root memoization cache.
|
626 |
*/
|
627 |
function clear() {
|
628 |
+
rootCache = new WeakMap();
|
629 |
}
|
630 |
|
631 |
+
/* eslint-disable jsdoc/check-param-names */
|
632 |
/**
|
633 |
* The augmented selector call, considering first whether dependants have
|
634 |
* changed before passing it to underlying memoize function.
|
635 |
*
|
636 |
+
* @param {*} source Source object for derivation.
|
637 |
+
* @param {...*} extraArgs Additional arguments to pass to selector.
|
638 |
*
|
639 |
* @return {*} Selector result.
|
640 |
*/
|
641 |
+
/* eslint-enable jsdoc/check-param-names */
|
642 |
+
function callSelector(/* source, ...extraArgs */) {
|
643 |
var len = arguments.length,
|
644 |
+
cache,
|
645 |
+
node,
|
646 |
+
i,
|
647 |
+
args,
|
648 |
+
dependants;
|
649 |
|
650 |
// Create copy of arguments (avoid leaking deoptimization).
|
651 |
+
args = new Array(len);
|
652 |
+
for (i = 0; i < len; i++) {
|
653 |
+
args[i] = arguments[i];
|
654 |
}
|
655 |
|
656 |
+
dependants = normalizedGetDependants.apply(null, args);
|
657 |
+
cache = getCache(dependants);
|
658 |
+
|
659 |
+
// If not guaranteed uniqueness by dependants (primitive type), shallow
|
660 |
+
// compare against last dependants and, if references have changed,
|
661 |
+
// destroy cache to recalculate result.
|
662 |
+
if (!cache.isUniqueByDependants) {
|
663 |
+
if (
|
664 |
+
cache.lastDependants &&
|
665 |
+
!isShallowEqual(dependants, cache.lastDependants, 0)
|
666 |
+
) {
|
667 |
cache.clear();
|
668 |
}
|
669 |
|
671 |
}
|
672 |
|
673 |
node = cache.head;
|
674 |
+
while (node) {
|
675 |
// Check whether node arguments match arguments
|
676 |
+
if (!isShallowEqual(node.args, args, 1)) {
|
677 |
node = node.next;
|
678 |
continue;
|
679 |
}
|
681 |
// At this point we can assume we've found a match
|
682 |
|
683 |
// Surface matched node to head if not already
|
684 |
+
if (node !== cache.head) {
|
685 |
// Adjust siblings to point to each other.
|
686 |
+
/** @type {CacheNode} */ (node.prev).next = node.next;
|
687 |
+
if (node.next) {
|
688 |
node.next.prev = node.prev;
|
689 |
}
|
690 |
|
691 |
node.next = cache.head;
|
692 |
node.prev = null;
|
693 |
+
/** @type {CacheNode} */ (cache.head).prev = node;
|
694 |
cache.head = node;
|
695 |
}
|
696 |
|
700 |
|
701 |
// No cached value found. Continue to insertion phase:
|
702 |
|
703 |
+
node = /** @type {CacheNode} */ ({
|
704 |
// Generate the result from original function
|
705 |
+
val: selector.apply(null, args),
|
706 |
+
});
|
707 |
|
708 |
// Avoid including the source object in the cache.
|
709 |
+
args[0] = null;
|
710 |
node.args = args;
|
711 |
|
712 |
// Don't need to check whether node is already head, since it would
|
713 |
// have been returned above already if it was
|
714 |
|
715 |
// Shift existing head down list
|
716 |
+
if (cache.head) {
|
717 |
cache.head.prev = node;
|
718 |
node.next = cache.head;
|
719 |
}
|
723 |
return node.val;
|
724 |
}
|
725 |
|
726 |
+
callSelector.getDependants = normalizedGetDependants;
|
727 |
callSelector.clear = clear;
|
728 |
clear();
|
729 |
|
730 |
+
return /** @type {S & EnhancedSelector} */ (callSelector);
|
731 |
}
|
732 |
|
733 |
;// CONCATENATED MODULE: ./packages/annotations/build-module/store/selectors.js
|
build/annotations/index.min.asset.php
CHANGED
@@ -1 +1 @@
|
|
1 |
-
<?php return array('dependencies' => array('lodash', 'wp-data', 'wp-hooks', 'wp-i18n', 'wp-polyfill', 'wp-rich-text'), 'version' => '
|
1 |
+
<?php return array('dependencies' => array('lodash', 'wp-data', 'wp-hooks', 'wp-i18n', 'wp-polyfill', 'wp-rich-text'), 'version' => 'c775e71f662c50167480');
|
build/annotations/index.min.js
CHANGED
@@ -1,2 +1,2 @@
|
|
1 |
-
!function(){"use strict";var e={d:function(t,n){for(var r in n)e.o(n,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:n[r]})},o:function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r:function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{store:function(){return
|
2 |
//# sourceMappingURL=index.min.js.map
|
1 |
+
!function(){"use strict";var e={d:function(t,n){for(var r in n)e.o(n,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:n[r]})},o:function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r:function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{store:function(){return G}});var n={};e.r(n),e.d(n,{__experimentalGetAllAnnotationsForBlock:function(){return T},__experimentalGetAnnotations:function(){return b},__experimentalGetAnnotationsForBlock:function(){return N},__experimentalGetAnnotationsForRichText:function(){return w}});var r={};e.r(r),e.d(r,{__experimentalAddAnnotation:function(){return V},__experimentalRemoveAnnotation:function(){return P},__experimentalRemoveAnnotationsBySource:function(){return F},__experimentalUpdateAnnotationRange:function(){return U}});var o=window.wp.richText,a=window.wp.i18n;const i="core/annotations",l="core/annotation",u="annotation-text-",s={name:l,title:(0,a.__)("Annotation"),tagName:"mark",className:"annotation-text",attributes:{className:"class",id:"id"},edit:()=>null,__experimentalGetPropsForEditableTreePreparation(e,t){let{richTextIdentifier:n,blockClientId:r}=t;return{annotations:e(i).__experimentalGetAnnotationsForRichText(r,n)}},__experimentalCreatePrepareEditableTree(e){let{annotations:t}=e;return(e,n)=>{if(0===t.length)return e;let r={formats:e,text:n};return r=function(e){return(arguments.length>1&&void 0!==arguments[1]?arguments[1]:[]).forEach((t=>{let{start:n,end:r}=t;n>e.text.length&&(n=e.text.length),r>e.text.length&&(r=e.text.length);const a=u+t.source,i=u+t.id;e=(0,o.applyFormat)(e,{type:l,attributes:{className:a,id:i}},n,r)})),e}(r,t),r.formats}},__experimentalGetPropsForEditableTreeChangeHandler:e=>({removeAnnotation:e(i).__experimentalRemoveAnnotation,updateAnnotationRange:e(i).__experimentalUpdateAnnotationRange}),__experimentalCreateOnChangeEditableValue:e=>t=>{const n=function(e){const t={};return e.forEach(((e,n)=>{(e=(e=e||[]).filter((e=>e.type===l))).forEach((e=>{let{id:r}=e.attributes;r=r.replace(u,""),t.hasOwnProperty(r)||(t[r]={start:n}),t[r].end=n+1}))})),t}(t),{removeAnnotation:r,updateAnnotationRange:o,annotations:a}=e;!function(e,t,n){let{removeAnnotation:r,updateAnnotationRange:o}=n;e.forEach((e=>{const n=t[e.id];if(!n)return void r(e.id);const{start:a,end:i}=e;a===n.start&&i===n.end||o(e.id,n.start,n.end)}))}(a,n,{removeAnnotation:r,updateAnnotationRange:o})}},{name:c,...d}=s;(0,o.registerFormatType)(c,d);var p=window.wp.hooks,f=window.wp.data;(0,p.addFilter)("editor.BlockListBlock","core/annotations",(e=>(0,f.withSelect)(((e,t)=>{let{clientId:n,className:r}=t;return{className:e(i).__experimentalGetAnnotationsForBlock(n).map((e=>"is-annotated-by-"+e.source)).concat(r).filter(Boolean).join(" ")}}))(e)));var v=window.lodash;function m(e,t){const n=e.filter(t);return e.length===n.length?e:n}function g(e){return(0,v.isNumber)(e.start)&&(0,v.isNumber)(e.end)&&e.start<=e.end}var h={};function _(e){return[e]}function A(e,t,n){var r;if(e.length!==t.length)return!1;for(r=n;r<e.length;r++)if(e[r]!==t[r])return!1;return!0}function y(e,t){var n,r=t||_;function o(e){var t,r,o,a,i,l=n,u=!0;for(t=0;t<e.length;t++){if(!(i=r=e[t])||"object"!=typeof i){u=!1;break}l.has(r)?l=l.get(r):(o=new WeakMap,l.set(r,o),l=o)}return l.has(h)||((a=function(){var e={clear:function(){e.head=null}};return e}()).isUniqueByDependants=u,l.set(h,a)),l.get(h)}function a(){n=new WeakMap}function i(){var t,n,a,i,l,u=arguments.length;for(i=new Array(u),a=0;a<u;a++)i[a]=arguments[a];for((t=o(l=r.apply(null,i))).isUniqueByDependants||(t.lastDependants&&!A(l,t.lastDependants,0)&&t.clear(),t.lastDependants=l),n=t.head;n;){if(A(n.args,i,1))return n!==t.head&&(n.prev.next=n.next,n.next&&(n.next.prev=n.prev),n.next=t.head,n.prev=null,t.head.prev=n,t.head=n),n.val;n=n.next}return n={val:e.apply(null,i)},i[0]=null,n.args=i,t.head&&(t.head.prev=n,n.next=t.head),t.head=n,n.val}return i.getDependants=r,i.clear=a,a(),i}const x=[],N=y(((e,t)=>{var n;return(null!==(n=null==e?void 0:e[t])&&void 0!==n?n:[]).filter((e=>"block"===e.selector))}),((e,t)=>{var n;return[null!==(n=null==e?void 0:e[t])&&void 0!==n?n:x]}));function T(e,t){var n;return null!==(n=null==e?void 0:e[t])&&void 0!==n?n:x}const w=y(((e,t,n)=>{var r;return(null!==(r=null==e?void 0:e[t])&&void 0!==r?r:[]).filter((e=>"range"===e.selector&&n===e.richTextIdentifier)).map((e=>{const{range:t,...n}=e;return{...t,...n}}))}),((e,t)=>{var n;return[null!==(n=null==e?void 0:e[t])&&void 0!==n?n:x]}));function b(e){return(0,v.flatMap)(e,(e=>e))}var O="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto),I=new Uint8Array(16);function R(){if(!O)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return O(I)}for(var E=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,k=function(e){return"string"==typeof e&&E.test(e)},C=[],D=0;D<256;++D)C.push((D+256).toString(16).substr(1));var S=function(e,t,n){var r=(e=e||{}).random||(e.rng||R)();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,t){n=n||0;for(var o=0;o<16;++o)t[n+o]=r[o];return t}return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=(C[e[t+0]]+C[e[t+1]]+C[e[t+2]]+C[e[t+3]]+"-"+C[e[t+4]]+C[e[t+5]]+"-"+C[e[t+6]]+C[e[t+7]]+"-"+C[e[t+8]]+C[e[t+9]]+"-"+C[e[t+10]]+C[e[t+11]]+C[e[t+12]]+C[e[t+13]]+C[e[t+14]]+C[e[t+15]]).toLowerCase();if(!k(n))throw TypeError("Stringified UUID is invalid");return n}(r)};function V(e){let{blockClientId:t,richTextIdentifier:n=null,range:r=null,selector:o="range",source:a="default",id:i=S()}=e;const l={type:"ANNOTATION_ADD",id:i,blockClientId:t,richTextIdentifier:n,source:a,selector:o};return"range"===o&&(l.range=r),l}function P(e){return{type:"ANNOTATION_REMOVE",annotationId:e}}function U(e,t,n){return{type:"ANNOTATION_UPDATE_RANGE",annotationId:e,start:t,end:n}}function F(e){return{type:"ANNOTATION_REMOVE_SOURCE",source:e}}const G=(0,f.createReduxStore)(i,{reducer:function(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;switch(n.type){case"ANNOTATION_ADD":const r=n.blockClientId,o={id:n.id,blockClientId:r,richTextIdentifier:n.richTextIdentifier,source:n.source,selector:n.selector,range:n.range};if("range"===o.selector&&!g(o.range))return t;const a=null!==(e=null==t?void 0:t[r])&&void 0!==e?e:[];return{...t,[r]:[...a,o]};case"ANNOTATION_REMOVE":return(0,v.mapValues)(t,(e=>m(e,(e=>e.id!==n.annotationId))));case"ANNOTATION_UPDATE_RANGE":return(0,v.mapValues)(t,(e=>{let t=!1;const r=e.map((e=>e.id===n.annotationId?(t=!0,{...e,range:{start:n.start,end:n.end}}):e));return t?r:e}));case"ANNOTATION_REMOVE_SOURCE":return(0,v.mapValues)(t,(e=>m(e,(e=>e.source!==n.source))))}return t},selectors:n,actions:r});(0,f.register)(G),(window.wp=window.wp||{}).annotations=t}();
|
2 |
//# sourceMappingURL=index.min.js.map
|
build/annotations/index.min.js.map
CHANGED
@@ -1 +1 @@
|
|
1 |
-
{"version":3,"file":"./build/annotations/index.min.js","mappings":"yBACA,IAAIA,EAAsB,CCA1B,EAAwB,SAASC,EAASC,GACzC,IAAI,IAAIC,KAAOD,EACXF,EAAoBI,EAAEF,EAAYC,KAASH,EAAoBI,EAAEH,EAASE,IAC5EE,OAAOC,eAAeL,EAASE,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,MCJ3E,EAAwB,SAASM,EAAKC,GAAQ,OAAOL,OAAOM,UAAUC,eAAeC,KAAKJ,EAAKC,ICC/F,EAAwB,SAAST,GACX,oBAAXa,QAA0BA,OAAOC,aAC1CV,OAAOC,eAAeL,EAASa,OAAOC,YAAa,CAAEC,MAAO,WAE7DX,OAAOC,eAAeL,EAAS,aAAc,CAAEe,OAAO,M,miBCLvD,IAAI,EAA+BC,OAAW,GAAY,SCAtD,EAA+BA,OAAW,GAAQ,KCK/C,MAAMC,EAAa,mBCCpBC,EAAc,kBAEdC,EAA8B,mBA4HvBC,EAAa,CACzBC,KAAMH,EACNI,OAAOC,EAAAA,EAAAA,IAAI,cACXC,QAAS,OACTC,UAAW,kBACXC,WAAY,CACXD,UAAW,QACXE,GAAI,MAELC,KAAI,IACI,KAERC,iDACCC,EAD+C,GAG9C,IADD,mBAAEC,EAAF,cAAsBC,GACrB,EACD,MAAO,CACNC,YAAaH,EACZb,GACCiB,wCACDF,EACAD,KAIHI,wCAAwC,GAAmB,IAAlB,YAAEF,GAAgB,EAC1D,MAAO,CAAEG,EAASC,KACjB,GAA4B,IAAvBJ,EAAYK,OAChB,OAAOF,EAGR,IAAIG,EAAS,CAAEH,QAAAA,EAASC,KAAAA,GAExB,OADAE,EA/II,SAA2BA,GA6BjC,OA7B4D,uDAAL,IAC3CC,SAAWpB,IACtB,IAAI,MAAEqB,EAAF,IAASC,GAAQtB,EAEhBqB,EAAQF,EAAOF,KAAKC,SACxBG,EAAQF,EAAOF,KAAKC,QAGhBI,EAAMH,EAAOF,KAAKC,SACtBI,EAAMH,EAAOF,KAAKC,QAGnB,MAAMb,EAAYN,EAA8BC,EAAWuB,OACrDhB,EAAKR,EAA8BC,EAAWO,GAEpDY,GAASK,EAAAA,EAAAA,aACRL,EACA,CACCM,KAAM3B,EACNQ,WAAY,CACXD,UAAAA,EACAE,GAAAA,IAGFc,EACAC,MAIKH,EAkHIO,CAAkBP,EAAQN,GAC5BM,EAAOH,UAGhBW,mDAAoDC,IAC5C,CACNC,iBAAkBD,EAAU/B,GAC1BiC,+BACFC,sBAAuBH,EAAU/B,GAC/BmC,sCAGJC,0CAA2CC,GACjClB,IACR,MAAMmB,EA7GT,SAAsCnB,GACrC,MAAMmB,EAAY,GAwBlB,OAtBAnB,EAAQI,SAAS,CAAEgB,EAAkBC,MAEpCD,GADAA,EAAmBA,GAAoB,IACHE,QACjCC,GAAYA,EAAOd,OAAS3B,KAEdsB,SAAWmB,IAC3B,IAAI,GAAEhC,GAAOgC,EAAOjC,WACpBC,EAAKA,EAAGiC,QAASzC,EAA6B,IAEvCoC,EAAU5C,eAAgBgB,KAChC4B,EAAW5B,GAAO,CACjBc,MAAOgB,IAOTF,EAAW5B,GAAKe,IAAMe,EAAI,QAIrBF,EAoFaM,CAA6BzB,IACzC,iBACLa,EADK,sBAELE,EAFK,YAGLlB,GACGqB,GA7EP,SACCrB,EACAsB,EAFD,GAIE,IADD,iBAAEN,EAAF,sBAAoBE,GACnB,EACDlB,EAAYO,SAAWsB,IACtB,MAAMC,EAAWR,EAAWO,EAAkBnC,IAE9C,IAAOoC,EAIN,YADAd,EAAkBa,EAAkBnC,IAIrC,MAAM,MAAEc,EAAF,IAASC,GAAQoB,EAClBrB,IAAUsB,EAAStB,OAASC,IAAQqB,EAASrB,KACjDS,EACCW,EAAkBnC,GAClBoC,EAAStB,MACTsB,EAASrB,QA2DVsB,CAAgC/B,EAAasB,EAAW,CACvDN,iBAAAA,EACAE,sBAAAA,OCjLI9B,KAAF,KAAW4C,GAAa7C,GAE9B8C,EAAAA,EAAAA,oBAAoB7C,EAAM4C,GCZ1B,IAAI,EAA+BjD,OAAW,GAAS,MCAnD,EAA+BA,OAAW,GAAQ,MCkCtDmD,EAAAA,EAAAA,WACC,wBACA,oBApBgCC,IACzBC,EAAAA,EAAAA,aAAY,CAAEvC,EAAF,KAAuC,IAA7B,SAAEwC,EAAF,UAAY7C,GAAiB,EAKzD,MAAO,CACNA,UALmBK,EACnBb,GACCsD,qCAAsCD,GAIrCE,KAAOpD,GACA,mBAAqBA,EAAWuB,SAEvC8B,OAAQhD,GACRiC,OAAQgB,SACRC,KAAM,QAZHN,CAcFD,KC/BN,IAAI,EAA+BpD,OAAe,OCclD,SAAS4D,EAAqBC,EAAYC,GACzC,MAAMC,EAAqBF,EAAWnB,OAAQoB,GAE9C,OAAOD,EAAWvC,SAAWyC,EAAmBzC,OAC7CuC,EACAE,EASJ,SAASC,EAAwB5D,GAChC,OACC6D,EAAAA,EAAAA,UAAU7D,EAAWqB,SACrBwC,EAAAA,EAAAA,UAAU7D,EAAWsB,MACrBtB,EAAWqB,OAASrB,EAAWsB,IA0FjC,ICxHIwC,EAAUC,EAuBd,SAASC,EAASrE,GACjB,MAAO,CAAEA,GAoBV,SAASsE,IACR,IAAIC,EAAQ,CACXC,MAAO,WACND,EAAME,KAAO,OAIf,OAAOF,EAaR,SAASG,EAAgBC,EAAGC,EAAGC,GAC9B,IAAInC,EAEJ,GAAKiC,EAAEpD,SAAWqD,EAAErD,OACnB,OAAO,EAGR,IAAMmB,EAAImC,EAAWnC,EAAIiC,EAAEpD,OAAQmB,IAClC,GAAKiC,EAAGjC,KAAQkC,EAAGlC,GAClB,OAAO,EAIT,OAAO,EAkBO,WAAUoC,EAAUC,GAClC,IAAIC,EAAWC,EA+Ef,SAAST,IACRQ,EAAYZ,EAAa,IAAIc,QAAYZ,IAa1C,SAASa,IACR,IACCZ,EAAOa,EAAM1C,EAAG2C,EAAMC,EADnBC,EAAMC,UAAUjE,OAKpB,IADA8D,EAAO,IAAII,MAAOF,GACZ7C,EAAI,EAAGA,EAAI6C,EAAK7C,IACrB2C,EAAM3C,GAAM8C,UAAW9C,GAkBxB,IAfA4C,EAAaP,EAAcW,MAAO,KAAML,IACxCd,EAAQU,EAAUK,IAKLK,uBACPpB,EAAMqB,iBAAoBlB,EAAgBY,EAAYf,EAAMqB,eAAgB,IAChFrB,EAAMC,QAGPD,EAAMqB,eAAiBN,GAGxBF,EAAOb,EAAME,KACLW,GAAO,CAEd,GAAOV,EAAgBU,EAAKC,KAAMA,EAAM,GAsBxC,OAdKD,IAASb,EAAME,OAEnBW,EAAKS,KAAKC,KAAOV,EAAKU,KACjBV,EAAKU,OACTV,EAAKU,KAAKD,KAAOT,EAAKS,MAGvBT,EAAKU,KAAOvB,EAAME,KAClBW,EAAKS,KAAO,KACZtB,EAAME,KAAKoB,KAAOT,EAClBb,EAAME,KAAOW,GAIPA,EAAKW,IArBXX,EAAOA,EAAKU,KA8Cd,OApBAV,EAAO,CAENW,IAAKjB,EAASY,MAAO,KAAML,IAI5BA,EAAM,GAAM,KACZD,EAAKC,KAAOA,EAMPd,EAAME,OACVF,EAAME,KAAKoB,KAAOT,EAClBA,EAAKU,KAAOvB,EAAME,MAGnBF,EAAME,KAAOW,EAENA,EAAKW,IAOb,OA3KOhB,IACNA,EAAgBV,GAsEjBY,EAAWb,EAtCX,SAA0BkB,GACzB,IAEC5C,EAAGsD,EAAWvC,EAAKc,EApGCvE,EAkGjBiG,EAASjB,EACZW,GAAuB,EAGxB,IAAMjD,EAAI,EAAGA,EAAI4C,EAAW/D,OAAQmB,IAAM,CAIzC,KA1GoB1C,EAuGpBgG,EAAYV,EAAY5C,KAtGP,iBAAoB1C,EAyGF,CAClC2F,GAAuB,EACvB,MAIIM,EAAOC,IAAKF,GAEhBC,EAASA,EAAOzG,IAAKwG,IAGrBvC,EAAM,IAAIyB,QACVe,EAAOE,IAAKH,EAAWvC,GACvBwC,EAASxC,GAYX,OANOwC,EAAOC,IAAK/B,MAClBI,EAAQD,KACFqB,qBAAuBA,EAC7BM,EAAOE,IAAKhC,EAAUI,IAGhB0B,EAAOzG,IAAK2E,IAxDpB,WACC,OAAOa,GA2JRG,EAAaJ,cAAgBA,EAC7BI,EAAaX,MAAQA,EACrBA,IAEOW,EAvQRhB,EAAW,GAOXC,EAAgC,oBAAZc,QCDpB,MAAMkB,EAAc,GAUP5C,EAAuC6C,GACnD,CAAEC,EAAOrF,KAAmB,MAC3B,OAAO,UAAEqF,MAAAA,OAAF,EAAEA,EAASrF,UAAX,QAA8B,IAAK0B,QAAUtC,GACpB,UAAxBA,EAAWyE,cAGpB,CAAEwB,EAAOrF,KAAT,YAA4B,WAAEqF,MAAAA,OAAF,EAAEA,EAASrF,UAAX,QAA8BmF,MAGpD,SAASG,EACfD,EACArF,GACC,MACD,iBAAOqF,MAAAA,OAAP,EAAOA,EAASrF,UAAhB,QAAmCmF,EAe7B,MAAMjF,EAA0CkF,GACtD,CAAEC,EAAOrF,EAAeD,KAAwB,MAC/C,OAAO,UAAEsF,MAAAA,OAAF,EAAEA,EAASrF,UAAX,QAA8B,IACnC0B,QAAUtC,GAEe,UAAxBA,EAAWyE,UACX9D,IAAuBX,EAAWW,qBAGnCyC,KAAOpD,IACP,MAAM,MAAEmG,KAAUC,GAAUpG,EAE5B,MAAO,IACHmG,KACAC,SAIP,CAAEH,EAAOrF,KAAT,YAA4B,WAAEqF,MAAAA,OAAF,EAAEA,EAASrF,UAAX,QAA8BmF,MASpD,SAASM,EAA8BJ,GAC7C,OAAOK,EAAAA,EAAAA,SAASL,GAASpF,GACjBA,IC7ET,IAAI0F,EAAoC,oBAAXC,QAA0BA,OAAOD,iBAAmBC,OAAOD,gBAAgBE,KAAKD,SAA+B,oBAAbE,UAAgE,mBAA7BA,SAASH,iBAAkCG,SAASH,gBAAgBE,KAAKC,UACvOC,EAAQ,IAAIC,WAAW,IACZ,SAASC,IACtB,IAAKN,EACH,MAAM,IAAIO,MAAM,4GAGlB,OAAOP,EAAgBI,GCJzB,ICRA,4HCMA,EAJA,SAAkBI,GAChB,MAAuB,iBAATA,GAAqB,OAAWA,IFG5CC,EAAY,GAEP3E,EAAI,EAAGA,EAAI,MAAOA,EACzB2E,EAAUC,MAAM5E,EAAI,KAAO6E,SAAS,IAAIC,OAAO,IAoBjD,IGNA,EApBA,SAAYC,EAASC,EAAKC,GAExB,IAAIC,GADJH,EAAUA,GAAW,IACFI,SAAWJ,EAAQP,KAAOA,KAK7C,GAHAU,EAAK,GAAe,GAAVA,EAAK,GAAY,GAC3BA,EAAK,GAAe,GAAVA,EAAK,GAAY,IAEvBF,EAAK,CACPC,EAASA,GAAU,EAEnB,IAAK,IAAIjF,EAAI,EAAGA,EAAI,KAAMA,EACxBgF,EAAIC,EAASjF,GAAKkF,EAAKlF,GAGzB,OAAOgF,EAGT,OHRF,SAAmBI,GACjB,IAAIH,EAASnC,UAAUjE,OAAS,QAAsBwG,IAAjBvC,UAAU,GAAmBA,UAAU,GAAK,EAG7E4B,GAAQC,EAAUS,EAAIH,EAAS,IAAMN,EAAUS,EAAIH,EAAS,IAAMN,EAAUS,EAAIH,EAAS,IAAMN,EAAUS,EAAIH,EAAS,IAAM,IAAMN,EAAUS,EAAIH,EAAS,IAAMN,EAAUS,EAAIH,EAAS,IAAM,IAAMN,EAAUS,EAAIH,EAAS,IAAMN,EAAUS,EAAIH,EAAS,IAAM,IAAMN,EAAUS,EAAIH,EAAS,IAAMN,EAAUS,EAAIH,EAAS,IAAM,IAAMN,EAAUS,EAAIH,EAAS,KAAON,EAAUS,EAAIH,EAAS,KAAON,EAAUS,EAAIH,EAAS,KAAON,EAAUS,EAAIH,EAAS,KAAON,EAAUS,EAAIH,EAAS,KAAON,EAAUS,EAAIH,EAAS,MAAMK,cAMzf,IAAK,EAASZ,GACZ,MAAMa,UAAU,+BAGlB,OAAOb,EGNA,CAAUQ,ICYZ,SAASM,EAAT,GAOH,IAPyC,cAC5CjH,EAD4C,mBAE5CD,EAAqB,KAFuB,MAG5CwF,EAAQ,KAHoC,SAI5C1B,EAAW,QAJiC,OAK5ClD,EAAS,UALmC,GAM5ChB,EAAKwG,KACF,EACH,MAAMe,EAAS,CACdrG,KAAM,iBACNlB,GAAAA,EACAK,cAAAA,EACAD,mBAAAA,EACAY,OAAAA,EACAkD,SAAAA,GAOD,MAJkB,UAAbA,IACJqD,EAAO3B,MAAQA,GAGT2B,EAUD,SAAShG,EAAgCiG,GAC/C,MAAO,CACNtG,KAAM,oBACNsG,aAAAA,GAaK,SAAS/F,EACf+F,EACA1G,EACAC,GAEA,MAAO,CACNG,KAAM,0BACNsG,aAAAA,EACA1G,MAAAA,EACAC,IAAAA,GAWK,SAAS0G,EAAyCzG,GACxD,MAAO,CACNE,KAAM,2BACNF,OAAAA,GC9EK,MAAM0G,GAAQC,EAAAA,EAAAA,kBAAkBrI,EAAY,CAClDsI,QTmBM,WAA2C,UAArBlC,EAAqB,uDAAb,GAAI6B,EAAS,uCACjD,OAASA,EAAOrG,MACf,IAAK,iBACJ,MAAMb,EAAgBkH,EAAOlH,cACvBwH,EAAgB,CACrB7H,GAAIuH,EAAOvH,GACXK,cAAAA,EACAD,mBAAoBmH,EAAOnH,mBAC3BY,OAAQuG,EAAOvG,OACfkD,SAAUqD,EAAOrD,SACjB0B,MAAO2B,EAAO3B,OAGf,GAC4B,UAA3BiC,EAAc3D,WACZb,EAAwBwE,EAAcjC,OAExC,OAAOF,EAGR,MAAMoC,EAA2B,UAAGpC,MAAAA,OAAH,EAAGA,EAASrF,UAAZ,QAA+B,GAEhE,MAAO,IACHqF,EACH,CAAErF,GAAiB,IACfyH,EACHD,IAIH,IAAK,oBACJ,OAAOE,EAAAA,EAAAA,WAAWrC,GAASsC,GACnB/E,EACN+E,GACEvI,GACMA,EAAWO,KAAOuH,EAAOC,iBAKpC,IAAK,0BACJ,OAAOO,EAAAA,EAAAA,WAAWrC,GAASsC,IAC1B,IAAIC,GAAkB,EAEtB,MAAMC,EAAiBF,EAAoBnF,KACxCpD,GACIA,EAAWO,KAAOuH,EAAOC,cAC7BS,GAAkB,EACX,IACHxI,EACHmG,MAAO,CACN9E,MAAOyG,EAAOzG,MACdC,IAAKwG,EAAOxG,OAKRtB,IAIT,OAAOwI,EAAkBC,EAAiBF,KAG5C,IAAK,2BACJ,OAAOD,EAAAA,EAAAA,WAAWrC,GAASsC,GACnB/E,EACN+E,GACEvI,GACMA,EAAWuB,SAAWuG,EAAOvG,WAMzC,OAAO0E,GS7FPyC,UAFkD,EAGlDC,QAAOA,KAGRC,EAAAA,EAAAA,UAAUX,I","sources":["webpack://wp/webpack/bootstrap","webpack://wp/webpack/runtime/define property getters","webpack://wp/webpack/runtime/hasOwnProperty shorthand","webpack://wp/webpack/runtime/make namespace object","webpack://wp/external window [\"wp\",\"richText\"]","webpack://wp/external window [\"wp\",\"i18n\"]","webpack://wp/./packages/annotations/build-module/store/@wordpress/annotations/src/store/constants.js","webpack://wp/./packages/annotations/build-module/format/@wordpress/annotations/src/format/annotation.js","webpack://wp/./packages/annotations/build-module/format/@wordpress/annotations/src/format/index.js","webpack://wp/external window [\"wp\",\"hooks\"]","webpack://wp/external window [\"wp\",\"data\"]","webpack://wp/./packages/annotations/build-module/block/@wordpress/annotations/src/block/index.js","webpack://wp/external window \"lodash\"","webpack://wp/./packages/annotations/build-module/store/@wordpress/annotations/src/store/reducer.js","webpack://wp/./node_modules/rememo/es/rememo.js","webpack://wp/./packages/annotations/build-module/store/@wordpress/annotations/src/store/selectors.js","webpack://wp/./node_modules/uuid/dist/esm-browser/rng.js","webpack://wp/./node_modules/uuid/dist/esm-browser/stringify.js","webpack://wp/./node_modules/uuid/dist/esm-browser/regex.js","webpack://wp/./node_modules/uuid/dist/esm-browser/validate.js","webpack://wp/./node_modules/uuid/dist/esm-browser/v4.js","webpack://wp/./packages/annotations/build-module/store/@wordpress/annotations/src/store/actions.js","webpack://wp/./packages/annotations/build-module/store/@wordpress/annotations/src/store/index.js"],"sourcesContent":["// The require scope\nvar __webpack_require__ = {};\n\n","// define getter functions for harmony exports\n__webpack_require__.d = function(exports, definition) {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }","// define __esModule on exports\n__webpack_require__.r = function(exports) {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","var __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"richText\"];","var __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"i18n\"];","/**\n * The identifier for the data store.\n *\n * @type {string}\n */\nexport const STORE_NAME = 'core/annotations';\n","/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { applyFormat, removeFormat } from '@wordpress/rich-text';\n\nconst FORMAT_NAME = 'core/annotation';\n\nconst ANNOTATION_ATTRIBUTE_PREFIX = 'annotation-text-';\n/**\n * Internal dependencies\n */\nimport { STORE_NAME } from '../store/constants';\n\n/**\n * Applies given annotations to the given record.\n *\n * @param {Object} record The record to apply annotations to.\n * @param {Array} annotations The annotation to apply.\n * @return {Object} A record with the annotations applied.\n */\nexport function applyAnnotations( record, annotations = [] ) {\n\tannotations.forEach( ( annotation ) => {\n\t\tlet { start, end } = annotation;\n\n\t\tif ( start > record.text.length ) {\n\t\t\tstart = record.text.length;\n\t\t}\n\n\t\tif ( end > record.text.length ) {\n\t\t\tend = record.text.length;\n\t\t}\n\n\t\tconst className = ANNOTATION_ATTRIBUTE_PREFIX + annotation.source;\n\t\tconst id = ANNOTATION_ATTRIBUTE_PREFIX + annotation.id;\n\n\t\trecord = applyFormat(\n\t\t\trecord,\n\t\t\t{\n\t\t\t\ttype: FORMAT_NAME,\n\t\t\t\tattributes: {\n\t\t\t\t\tclassName,\n\t\t\t\t\tid,\n\t\t\t\t},\n\t\t\t},\n\t\t\tstart,\n\t\t\tend\n\t\t);\n\t} );\n\n\treturn record;\n}\n\n/**\n * Removes annotations from the given record.\n *\n * @param {Object} record Record to remove annotations from.\n * @return {Object} The cleaned record.\n */\nexport function removeAnnotations( record ) {\n\treturn removeFormat( record, 'core/annotation', 0, record.text.length );\n}\n\n/**\n * Retrieves the positions of annotations inside an array of formats.\n *\n * @param {Array} formats Formats with annotations in there.\n * @return {Object} ID keyed positions of annotations.\n */\nfunction retrieveAnnotationPositions( formats ) {\n\tconst positions = {};\n\n\tformats.forEach( ( characterFormats, i ) => {\n\t\tcharacterFormats = characterFormats || [];\n\t\tcharacterFormats = characterFormats.filter(\n\t\t\t( format ) => format.type === FORMAT_NAME\n\t\t);\n\t\tcharacterFormats.forEach( ( format ) => {\n\t\t\tlet { id } = format.attributes;\n\t\t\tid = id.replace( ANNOTATION_ATTRIBUTE_PREFIX, '' );\n\n\t\t\tif ( ! positions.hasOwnProperty( id ) ) {\n\t\t\t\tpositions[ id ] = {\n\t\t\t\t\tstart: i,\n\t\t\t\t};\n\t\t\t}\n\n\t\t\t// Annotations refer to positions between characters.\n\t\t\t// Formats refer to the character themselves.\n\t\t\t// So we need to adjust for that here.\n\t\t\tpositions[ id ].end = i + 1;\n\t\t} );\n\t} );\n\n\treturn positions;\n}\n\n/**\n * Updates annotations in the state based on positions retrieved from RichText.\n *\n * @param {Array} annotations The annotations that are currently applied.\n * @param {Array} positions The current positions of the given annotations.\n * @param {Object} actions\n * @param {Function} actions.removeAnnotation Function to remove an annotation from the state.\n * @param {Function} actions.updateAnnotationRange Function to update an annotation range in the state.\n */\nfunction updateAnnotationsWithPositions(\n\tannotations,\n\tpositions,\n\t{ removeAnnotation, updateAnnotationRange }\n) {\n\tannotations.forEach( ( currentAnnotation ) => {\n\t\tconst position = positions[ currentAnnotation.id ];\n\t\t// If we cannot find an annotation, delete it.\n\t\tif ( ! position ) {\n\t\t\t// Apparently the annotation has been removed, so remove it from the state:\n\t\t\t// Remove...\n\t\t\tremoveAnnotation( currentAnnotation.id );\n\t\t\treturn;\n\t\t}\n\n\t\tconst { start, end } = currentAnnotation;\n\t\tif ( start !== position.start || end !== position.end ) {\n\t\t\tupdateAnnotationRange(\n\t\t\t\tcurrentAnnotation.id,\n\t\t\t\tposition.start,\n\t\t\t\tposition.end\n\t\t\t);\n\t\t}\n\t} );\n}\n\nexport const annotation = {\n\tname: FORMAT_NAME,\n\ttitle: __( 'Annotation' ),\n\ttagName: 'mark',\n\tclassName: 'annotation-text',\n\tattributes: {\n\t\tclassName: 'class',\n\t\tid: 'id',\n\t},\n\tedit() {\n\t\treturn null;\n\t},\n\t__experimentalGetPropsForEditableTreePreparation(\n\t\tselect,\n\t\t{ richTextIdentifier, blockClientId }\n\t) {\n\t\treturn {\n\t\t\tannotations: select(\n\t\t\t\tSTORE_NAME\n\t\t\t).__experimentalGetAnnotationsForRichText(\n\t\t\t\tblockClientId,\n\t\t\t\trichTextIdentifier\n\t\t\t),\n\t\t};\n\t},\n\t__experimentalCreatePrepareEditableTree( { annotations } ) {\n\t\treturn ( formats, text ) => {\n\t\t\tif ( annotations.length === 0 ) {\n\t\t\t\treturn formats;\n\t\t\t}\n\n\t\t\tlet record = { formats, text };\n\t\t\trecord = applyAnnotations( record, annotations );\n\t\t\treturn record.formats;\n\t\t};\n\t},\n\t__experimentalGetPropsForEditableTreeChangeHandler( dispatch ) {\n\t\treturn {\n\t\t\tremoveAnnotation: dispatch( STORE_NAME )\n\t\t\t\t.__experimentalRemoveAnnotation,\n\t\t\tupdateAnnotationRange: dispatch( STORE_NAME )\n\t\t\t\t.__experimentalUpdateAnnotationRange,\n\t\t};\n\t},\n\t__experimentalCreateOnChangeEditableValue( props ) {\n\t\treturn ( formats ) => {\n\t\t\tconst positions = retrieveAnnotationPositions( formats );\n\t\t\tconst {\n\t\t\t\tremoveAnnotation,\n\t\t\t\tupdateAnnotationRange,\n\t\t\t\tannotations,\n\t\t\t} = props;\n\n\t\t\tupdateAnnotationsWithPositions( annotations, positions, {\n\t\t\t\tremoveAnnotation,\n\t\t\t\tupdateAnnotationRange,\n\t\t\t} );\n\t\t};\n\t},\n};\n","/**\n * WordPress dependencies\n */\nimport { registerFormatType } from '@wordpress/rich-text';\n\n/**\n * Internal dependencies\n */\nimport { annotation } from './annotation';\n\nconst { name, ...settings } = annotation;\n\nregisterFormatType( name, settings );\n","var __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"hooks\"];","var __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"data\"];","/**\n * WordPress dependencies\n */\nimport { addFilter } from '@wordpress/hooks';\nimport { withSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { STORE_NAME } from '../store/constants';\n/**\n * Adds annotation className to the block-list-block component.\n *\n * @param {Object} OriginalComponent The original BlockListBlock component.\n * @return {Object} The enhanced component.\n */\nconst addAnnotationClassName = ( OriginalComponent ) => {\n\treturn withSelect( ( select, { clientId, className } ) => {\n\t\tconst annotations = select(\n\t\t\tSTORE_NAME\n\t\t).__experimentalGetAnnotationsForBlock( clientId );\n\n\t\treturn {\n\t\t\tclassName: annotations\n\t\t\t\t.map( ( annotation ) => {\n\t\t\t\t\treturn 'is-annotated-by-' + annotation.source;\n\t\t\t\t} )\n\t\t\t\t.concat( className )\n\t\t\t\t.filter( Boolean )\n\t\t\t\t.join( ' ' ),\n\t\t};\n\t} )( OriginalComponent );\n};\n\naddFilter(\n\t'editor.BlockListBlock',\n\t'core/annotations',\n\taddAnnotationClassName\n);\n","var __WEBPACK_NAMESPACE_OBJECT__ = window[\"lodash\"];","/**\n * External dependencies\n */\nimport { isNumber, mapValues } from 'lodash';\n\n/**\n * Filters an array based on the predicate, but keeps the reference the same if\n * the array hasn't changed.\n *\n * @param {Array} collection The collection to filter.\n * @param {Function} predicate Function that determines if the item should stay\n * in the array.\n * @return {Array} Filtered array.\n */\nfunction filterWithReference( collection, predicate ) {\n\tconst filteredCollection = collection.filter( predicate );\n\n\treturn collection.length === filteredCollection.length\n\t\t? collection\n\t\t: filteredCollection;\n}\n\n/**\n * Verifies whether the given annotations is a valid annotation.\n *\n * @param {Object} annotation The annotation to verify.\n * @return {boolean} Whether the given annotation is valid.\n */\nfunction isValidAnnotationRange( annotation ) {\n\treturn (\n\t\tisNumber( annotation.start ) &&\n\t\tisNumber( annotation.end ) &&\n\t\tannotation.start <= annotation.end\n\t);\n}\n\n/**\n * Reducer managing annotations.\n *\n * @param {Object} state The annotations currently shown in the editor.\n * @param {Object} action Dispatched action.\n *\n * @return {Array} Updated state.\n */\nexport function annotations( state = {}, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'ANNOTATION_ADD':\n\t\t\tconst blockClientId = action.blockClientId;\n\t\t\tconst newAnnotation = {\n\t\t\t\tid: action.id,\n\t\t\t\tblockClientId,\n\t\t\t\trichTextIdentifier: action.richTextIdentifier,\n\t\t\t\tsource: action.source,\n\t\t\t\tselector: action.selector,\n\t\t\t\trange: action.range,\n\t\t\t};\n\n\t\t\tif (\n\t\t\t\tnewAnnotation.selector === 'range' &&\n\t\t\t\t! isValidAnnotationRange( newAnnotation.range )\n\t\t\t) {\n\t\t\t\treturn state;\n\t\t\t}\n\n\t\t\tconst previousAnnotationsForBlock = state?.[ blockClientId ] ?? [];\n\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\t[ blockClientId ]: [\n\t\t\t\t\t...previousAnnotationsForBlock,\n\t\t\t\t\tnewAnnotation,\n\t\t\t\t],\n\t\t\t};\n\n\t\tcase 'ANNOTATION_REMOVE':\n\t\t\treturn mapValues( state, ( annotationsForBlock ) => {\n\t\t\t\treturn filterWithReference(\n\t\t\t\t\tannotationsForBlock,\n\t\t\t\t\t( annotation ) => {\n\t\t\t\t\t\treturn annotation.id !== action.annotationId;\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t} );\n\n\t\tcase 'ANNOTATION_UPDATE_RANGE':\n\t\t\treturn mapValues( state, ( annotationsForBlock ) => {\n\t\t\t\tlet hasChangedRange = false;\n\n\t\t\t\tconst newAnnotations = annotationsForBlock.map(\n\t\t\t\t\t( annotation ) => {\n\t\t\t\t\t\tif ( annotation.id === action.annotationId ) {\n\t\t\t\t\t\t\thasChangedRange = true;\n\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\t...annotation,\n\t\t\t\t\t\t\t\trange: {\n\t\t\t\t\t\t\t\t\tstart: action.start,\n\t\t\t\t\t\t\t\t\tend: action.end,\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\treturn annotation;\n\t\t\t\t\t}\n\t\t\t\t);\n\n\t\t\t\treturn hasChangedRange ? newAnnotations : annotationsForBlock;\n\t\t\t} );\n\n\t\tcase 'ANNOTATION_REMOVE_SOURCE':\n\t\t\treturn mapValues( state, ( annotationsForBlock ) => {\n\t\t\t\treturn filterWithReference(\n\t\t\t\t\tannotationsForBlock,\n\t\t\t\t\t( annotation ) => {\n\t\t\t\t\t\treturn annotation.source !== action.source;\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t} );\n\t}\n\n\treturn state;\n}\n\nexport default annotations;\n","'use strict';\n\nvar LEAF_KEY, hasWeakMap;\n\n/**\n * Arbitrary value used as key for referencing cache object in WeakMap tree.\n *\n * @type {Object}\n */\nLEAF_KEY = {};\n\n/**\n * Whether environment supports WeakMap.\n *\n * @type {boolean}\n */\nhasWeakMap = typeof WeakMap !== 'undefined';\n\n/**\n * Returns the first argument as the sole entry in an array.\n *\n * @param {*} value Value to return.\n *\n * @return {Array} Value returned as entry in array.\n */\nfunction arrayOf( value ) {\n\treturn [ value ];\n}\n\n/**\n * Returns true if the value passed is object-like, or false otherwise. A value\n * is object-like if it can support property assignment, e.g. object or array.\n *\n * @param {*} value Value to test.\n *\n * @return {boolean} Whether value is object-like.\n */\nfunction isObjectLike( value ) {\n\treturn !! value && 'object' === typeof value;\n}\n\n/**\n * Creates and returns a new cache object.\n *\n * @return {Object} Cache object.\n */\nfunction createCache() {\n\tvar cache = {\n\t\tclear: function() {\n\t\t\tcache.head = null;\n\t\t},\n\t};\n\n\treturn cache;\n}\n\n/**\n * Returns true if entries within the two arrays are strictly equal by\n * reference from a starting index.\n *\n * @param {Array} a First array.\n * @param {Array} b Second array.\n * @param {number} fromIndex Index from which to start comparison.\n *\n * @return {boolean} Whether arrays are shallowly equal.\n */\nfunction isShallowEqual( a, b, fromIndex ) {\n\tvar i;\n\n\tif ( a.length !== b.length ) {\n\t\treturn false;\n\t}\n\n\tfor ( i = fromIndex; i < a.length; i++ ) {\n\t\tif ( a[ i ] !== b[ i ] ) {\n\t\t\treturn false;\n\t\t}\n\t}\n\n\treturn true;\n}\n\n/**\n * Returns a memoized selector function. The getDependants function argument is\n * called before the memoized selector and is expected to return an immutable\n * reference or array of references on which the selector depends for computing\n * its own return value. The memoize cache is preserved only as long as those\n * dependant references remain the same. If getDependants returns a different\n * reference(s), the cache is cleared and the selector value regenerated.\n *\n * @param {Function} selector Selector function.\n * @param {Function} getDependants Dependant getter returning an immutable\n * reference or array of reference used in\n * cache bust consideration.\n *\n * @return {Function} Memoized selector.\n */\nexport default function( selector, getDependants ) {\n\tvar rootCache, getCache;\n\n\t// Use object source as dependant if getter not provided\n\tif ( ! getDependants ) {\n\t\tgetDependants = arrayOf;\n\t}\n\n\t/**\n\t * Returns the root cache. If WeakMap is supported, this is assigned to the\n\t * root WeakMap cache set, otherwise it is a shared instance of the default\n\t * cache object.\n\t *\n\t * @return {(WeakMap|Object)} Root cache object.\n\t */\n\tfunction getRootCache() {\n\t\treturn rootCache;\n\t}\n\n\t/**\n\t * Returns the cache for a given dependants array. When possible, a WeakMap\n\t * will be used to create a unique cache for each set of dependants. This\n\t * is feasible due to the nature of WeakMap in allowing garbage collection\n\t * to occur on entries where the key object is no longer referenced. Since\n\t * WeakMap requires the key to be an object, this is only possible when the\n\t * dependant is object-like. The root cache is created as a hierarchy where\n\t * each top-level key is the first entry in a dependants set, the value a\n\t * WeakMap where each key is the next dependant, and so on. This continues\n\t * so long as the dependants are object-like. If no dependants are object-\n\t * like, then the cache is shared across all invocations.\n\t *\n\t * @see isObjectLike\n\t *\n\t * @param {Array} dependants Selector dependants.\n\t *\n\t * @return {Object} Cache object.\n\t */\n\tfunction getWeakMapCache( dependants ) {\n\t\tvar caches = rootCache,\n\t\t\tisUniqueByDependants = true,\n\t\t\ti, dependant, map, cache;\n\n\t\tfor ( i = 0; i < dependants.length; i++ ) {\n\t\t\tdependant = dependants[ i ];\n\n\t\t\t// Can only compose WeakMap from object-like key.\n\t\t\tif ( ! isObjectLike( dependant ) ) {\n\t\t\t\tisUniqueByDependants = false;\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t// Does current segment of cache already have a WeakMap?\n\t\t\tif ( caches.has( dependant ) ) {\n\t\t\t\t// Traverse into nested WeakMap.\n\t\t\t\tcaches = caches.get( dependant );\n\t\t\t} else {\n\t\t\t\t// Create, set, and traverse into a new one.\n\t\t\t\tmap = new WeakMap();\n\t\t\t\tcaches.set( dependant, map );\n\t\t\t\tcaches = map;\n\t\t\t}\n\t\t}\n\n\t\t// We use an arbitrary (but consistent) object as key for the last item\n\t\t// in the WeakMap to serve as our running cache.\n\t\tif ( ! caches.has( LEAF_KEY ) ) {\n\t\t\tcache = createCache();\n\t\t\tcache.isUniqueByDependants = isUniqueByDependants;\n\t\t\tcaches.set( LEAF_KEY, cache );\n\t\t}\n\n\t\treturn caches.get( LEAF_KEY );\n\t}\n\n\t// Assign cache handler by availability of WeakMap\n\tgetCache = hasWeakMap ? getWeakMapCache : getRootCache;\n\n\t/**\n\t * Resets root memoization cache.\n\t */\n\tfunction clear() {\n\t\trootCache = hasWeakMap ? new WeakMap() : createCache();\n\t}\n\n\t// eslint-disable-next-line jsdoc/check-param-names\n\t/**\n\t * The augmented selector call, considering first whether dependants have\n\t * changed before passing it to underlying memoize function.\n\t *\n\t * @param {Object} source Source object for derivation.\n\t * @param {...*} extraArgs Additional arguments to pass to selector.\n\t *\n\t * @return {*} Selector result.\n\t */\n\tfunction callSelector( /* source, ...extraArgs */ ) {\n\t\tvar len = arguments.length,\n\t\t\tcache, node, i, args, dependants;\n\n\t\t// Create copy of arguments (avoid leaking deoptimization).\n\t\targs = new Array( len );\n\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\targs[ i ] = arguments[ i ];\n\t\t}\n\n\t\tdependants = getDependants.apply( null, args );\n\t\tcache = getCache( dependants );\n\n\t\t// If not guaranteed uniqueness by dependants (primitive type or lack\n\t\t// of WeakMap support), shallow compare against last dependants and, if\n\t\t// references have changed, destroy cache to recalculate result.\n\t\tif ( ! cache.isUniqueByDependants ) {\n\t\t\tif ( cache.lastDependants && ! isShallowEqual( dependants, cache.lastDependants, 0 ) ) {\n\t\t\t\tcache.clear();\n\t\t\t}\n\n\t\t\tcache.lastDependants = dependants;\n\t\t}\n\n\t\tnode = cache.head;\n\t\twhile ( node ) {\n\t\t\t// Check whether node arguments match arguments\n\t\t\tif ( ! isShallowEqual( node.args, args, 1 ) ) {\n\t\t\t\tnode = node.next;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// At this point we can assume we've found a match\n\n\t\t\t// Surface matched node to head if not already\n\t\t\tif ( node !== cache.head ) {\n\t\t\t\t// Adjust siblings to point to each other.\n\t\t\t\tnode.prev.next = node.next;\n\t\t\t\tif ( node.next ) {\n\t\t\t\t\tnode.next.prev = node.prev;\n\t\t\t\t}\n\n\t\t\t\tnode.next = cache.head;\n\t\t\t\tnode.prev = null;\n\t\t\t\tcache.head.prev = node;\n\t\t\t\tcache.head = node;\n\t\t\t}\n\n\t\t\t// Return immediately\n\t\t\treturn node.val;\n\t\t}\n\n\t\t// No cached value found. Continue to insertion phase:\n\n\t\tnode = {\n\t\t\t// Generate the result from original function\n\t\t\tval: selector.apply( null, args ),\n\t\t};\n\n\t\t// Avoid including the source object in the cache.\n\t\targs[ 0 ] = null;\n\t\tnode.args = args;\n\n\t\t// Don't need to check whether node is already head, since it would\n\t\t// have been returned above already if it was\n\n\t\t// Shift existing head down list\n\t\tif ( cache.head ) {\n\t\t\tcache.head.prev = node;\n\t\t\tnode.next = cache.head;\n\t\t}\n\n\t\tcache.head = node;\n\n\t\treturn node.val;\n\t}\n\n\tcallSelector.getDependants = getDependants;\n\tcallSelector.clear = clear;\n\tclear();\n\n\treturn callSelector;\n}\n","/**\n * External dependencies\n */\nimport createSelector from 'rememo';\nimport { flatMap } from 'lodash';\n\n/**\n * Shared reference to an empty array for cases where it is important to avoid\n * returning a new array reference on every invocation, as in a connected or\n * other pure component which performs `shouldComponentUpdate` check on props.\n * This should be used as a last resort, since the normalized data should be\n * maintained by the reducer result in state.\n *\n * @type {Array}\n */\nconst EMPTY_ARRAY = [];\n\n/**\n * Returns the annotations for a specific client ID.\n *\n * @param {Object} state Editor state.\n * @param {string} clientId The ID of the block to get the annotations for.\n *\n * @return {Array} The annotations applicable to this block.\n */\nexport const __experimentalGetAnnotationsForBlock = createSelector(\n\t( state, blockClientId ) => {\n\t\treturn ( state?.[ blockClientId ] ?? [] ).filter( ( annotation ) => {\n\t\t\treturn annotation.selector === 'block';\n\t\t} );\n\t},\n\t( state, blockClientId ) => [ state?.[ blockClientId ] ?? EMPTY_ARRAY ]\n);\n\nexport function __experimentalGetAllAnnotationsForBlock(\n\tstate,\n\tblockClientId\n) {\n\treturn state?.[ blockClientId ] ?? EMPTY_ARRAY;\n}\n\n/**\n * Returns the annotations that apply to the given RichText instance.\n *\n * Both a blockClientId and a richTextIdentifier are required. This is because\n * a block might have multiple `RichText` components. This does mean that every\n * block needs to implement annotations itself.\n *\n * @param {Object} state Editor state.\n * @param {string} blockClientId The client ID for the block.\n * @param {string} richTextIdentifier Unique identifier that identifies the given RichText.\n * @return {Array} All the annotations relevant for the `RichText`.\n */\nexport const __experimentalGetAnnotationsForRichText = createSelector(\n\t( state, blockClientId, richTextIdentifier ) => {\n\t\treturn ( state?.[ blockClientId ] ?? [] )\n\t\t\t.filter( ( annotation ) => {\n\t\t\t\treturn (\n\t\t\t\t\tannotation.selector === 'range' &&\n\t\t\t\t\trichTextIdentifier === annotation.richTextIdentifier\n\t\t\t\t);\n\t\t\t} )\n\t\t\t.map( ( annotation ) => {\n\t\t\t\tconst { range, ...other } = annotation;\n\n\t\t\t\treturn {\n\t\t\t\t\t...range,\n\t\t\t\t\t...other,\n\t\t\t\t};\n\t\t\t} );\n\t},\n\t( state, blockClientId ) => [ state?.[ blockClientId ] ?? EMPTY_ARRAY ]\n);\n\n/**\n * Returns all annotations in the editor state.\n *\n * @param {Object} state Editor state.\n * @return {Array} All annotations currently applied.\n */\nexport function __experimentalGetAnnotations( state ) {\n\treturn flatMap( state, ( annotations ) => {\n\t\treturn annotations;\n\t} );\n}\n","// Unique ID creation requires a high quality random # generator. In the browser we therefore\n// require the crypto API and do not support built-in fallback to lower quality random number\n// generators (like Math.random()).\n// getRandomValues needs to be invoked in a context where \"this\" is a Crypto implementation. Also,\n// find the complete implementation of crypto (msCrypto) on IE11.\nvar getRandomValues = typeof crypto !== 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto) || typeof msCrypto !== 'undefined' && typeof msCrypto.getRandomValues === 'function' && msCrypto.getRandomValues.bind(msCrypto);\nvar rnds8 = new Uint8Array(16);\nexport default function rng() {\n if (!getRandomValues) {\n throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported');\n }\n\n return getRandomValues(rnds8);\n}","import validate from './validate.js';\n/**\n * Convert array of 16 byte values to UUID string format of the form:\n * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX\n */\n\nvar byteToHex = [];\n\nfor (var i = 0; i < 256; ++i) {\n byteToHex.push((i + 0x100).toString(16).substr(1));\n}\n\nfunction stringify(arr) {\n var offset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n // Note: Be careful editing this code! It's been tuned for performance\n // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434\n var uuid = (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase(); // Consistency check for valid UUID. If this throws, it's likely due to one\n // of the following:\n // - One or more input array values don't map to a hex octet (leading to\n // \"undefined\" in the uuid)\n // - Invalid input values for the RFC `version` or `variant` fields\n\n if (!validate(uuid)) {\n throw TypeError('Stringified UUID is invalid');\n }\n\n return uuid;\n}\n\nexport default stringify;","export default /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;","import REGEX from './regex.js';\n\nfunction validate(uuid) {\n return typeof uuid === 'string' && REGEX.test(uuid);\n}\n\nexport default validate;","import rng from './rng.js';\nimport stringify from './stringify.js';\n\nfunction v4(options, buf, offset) {\n options = options || {};\n var rnds = options.random || (options.rng || rng)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`\n\n rnds[6] = rnds[6] & 0x0f | 0x40;\n rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided\n\n if (buf) {\n offset = offset || 0;\n\n for (var i = 0; i < 16; ++i) {\n buf[offset + i] = rnds[i];\n }\n\n return buf;\n }\n\n return stringify(rnds);\n}\n\nexport default v4;","/**\n * External dependencies\n */\nimport { v4 as uuid } from 'uuid';\n\n/**\n * @typedef WPAnnotationRange\n *\n * @property {number} start The offset where the annotation should start.\n * @property {number} end The offset where the annotation should end.\n */\n\n/**\n * Adds an annotation to a block.\n *\n * The `block` attribute refers to a block ID that needs to be annotated.\n * `isBlockAnnotation` controls whether or not the annotation is a block\n * annotation. The `source` is the source of the annotation, this will be used\n * to identity groups of annotations.\n *\n * The `range` property is only relevant if the selector is 'range'.\n *\n * @param {Object} annotation The annotation to add.\n * @param {string} annotation.blockClientId The blockClientId to add the annotation to.\n * @param {string} annotation.richTextIdentifier Identifier for the RichText instance the annotation applies to.\n * @param {WPAnnotationRange} annotation.range The range at which to apply this annotation.\n * @param {string} [annotation.selector=\"range\"] The way to apply this annotation.\n * @param {string} [annotation.source=\"default\"] The source that added the annotation.\n * @param {string} [annotation.id] The ID the annotation should have. Generates a UUID by default.\n *\n * @return {Object} Action object.\n */\nexport function __experimentalAddAnnotation( {\n\tblockClientId,\n\trichTextIdentifier = null,\n\trange = null,\n\tselector = 'range',\n\tsource = 'default',\n\tid = uuid(),\n} ) {\n\tconst action = {\n\t\ttype: 'ANNOTATION_ADD',\n\t\tid,\n\t\tblockClientId,\n\t\trichTextIdentifier,\n\t\tsource,\n\t\tselector,\n\t};\n\n\tif ( selector === 'range' ) {\n\t\taction.range = range;\n\t}\n\n\treturn action;\n}\n\n/**\n * Removes an annotation with a specific ID.\n *\n * @param {string} annotationId The annotation to remove.\n *\n * @return {Object} Action object.\n */\nexport function __experimentalRemoveAnnotation( annotationId ) {\n\treturn {\n\t\ttype: 'ANNOTATION_REMOVE',\n\t\tannotationId,\n\t};\n}\n\n/**\n * Updates the range of an annotation.\n *\n * @param {string} annotationId ID of the annotation to update.\n * @param {number} start The start of the new range.\n * @param {number} end The end of the new range.\n *\n * @return {Object} Action object.\n */\nexport function __experimentalUpdateAnnotationRange(\n\tannotationId,\n\tstart,\n\tend\n) {\n\treturn {\n\t\ttype: 'ANNOTATION_UPDATE_RANGE',\n\t\tannotationId,\n\t\tstart,\n\t\tend,\n\t};\n}\n\n/**\n * Removes all annotations of a specific source.\n *\n * @param {string} source The source to remove.\n *\n * @return {Object} Action object.\n */\nexport function __experimentalRemoveAnnotationsBySource( source ) {\n\treturn {\n\t\ttype: 'ANNOTATION_REMOVE_SOURCE',\n\t\tsource,\n\t};\n}\n","/**\n * WordPress dependencies\n */\nimport { register, createReduxStore } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport reducer from './reducer';\nimport * as selectors from './selectors';\nimport * as actions from './actions';\n\n/**\n * Module Constants\n */\nimport { STORE_NAME } from './constants';\n\n/**\n * Store definition for the annotations namespace.\n *\n * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#createReduxStore\n *\n * @type {Object}\n */\nexport const store = createReduxStore( STORE_NAME, {\n\treducer,\n\tselectors,\n\tactions,\n} );\n\nregister( store );\n"],"names":["__webpack_require__","exports","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","Symbol","toStringTag","value","window","STORE_NAME","FORMAT_NAME","ANNOTATION_ATTRIBUTE_PREFIX","annotation","name","title","__","tagName","className","attributes","id","edit","__experimentalGetPropsForEditableTreePreparation","select","richTextIdentifier","blockClientId","annotations","__experimentalGetAnnotationsForRichText","__experimentalCreatePrepareEditableTree","formats","text","length","record","forEach","start","end","source","applyFormat","type","applyAnnotations","__experimentalGetPropsForEditableTreeChangeHandler","dispatch","removeAnnotation","__experimentalRemoveAnnotation","updateAnnotationRange","__experimentalUpdateAnnotationRange","__experimentalCreateOnChangeEditableValue","props","positions","characterFormats","i","filter","format","replace","retrieveAnnotationPositions","currentAnnotation","position","updateAnnotationsWithPositions","settings","registerFormatType","addFilter","OriginalComponent","withSelect","clientId","__experimentalGetAnnotationsForBlock","map","concat","Boolean","join","filterWithReference","collection","predicate","filteredCollection","isValidAnnotationRange","isNumber","LEAF_KEY","hasWeakMap","arrayOf","createCache","cache","clear","head","isShallowEqual","a","b","fromIndex","selector","getDependants","rootCache","getCache","WeakMap","callSelector","node","args","dependants","len","arguments","Array","apply","isUniqueByDependants","lastDependants","prev","next","val","dependant","caches","has","set","EMPTY_ARRAY","createSelector","state","__experimentalGetAllAnnotationsForBlock","range","other","__experimentalGetAnnotations","flatMap","getRandomValues","crypto","bind","msCrypto","rnds8","Uint8Array","rng","Error","uuid","byteToHex","push","toString","substr","options","buf","offset","rnds","random","arr","undefined","toLowerCase","TypeError","__experimentalAddAnnotation","action","annotationId","__experimentalRemoveAnnotationsBySource","store","createReduxStore","reducer","newAnnotation","previousAnnotationsForBlock","mapValues","annotationsForBlock","hasChangedRange","newAnnotations","selectors","actions","register"],"sourceRoot":""}
|
1 |
+
{"version":3,"file":"./build/annotations/index.min.js","mappings":"yBACA,IAAIA,EAAsB,CCA1B,EAAwB,SAASC,EAASC,GACzC,IAAI,IAAIC,KAAOD,EACXF,EAAoBI,EAAEF,EAAYC,KAASH,EAAoBI,EAAEH,EAASE,IAC5EE,OAAOC,eAAeL,EAASE,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,MCJ3E,EAAwB,SAASM,EAAKC,GAAQ,OAAOL,OAAOM,UAAUC,eAAeC,KAAKJ,EAAKC,ICC/F,EAAwB,SAAST,GACX,oBAAXa,QAA0BA,OAAOC,aAC1CV,OAAOC,eAAeL,EAASa,OAAOC,YAAa,CAAEC,MAAO,WAE7DX,OAAOC,eAAeL,EAAS,aAAc,CAAEe,OAAO,M,miBCLvD,IAAI,EAA+BC,OAAW,GAAY,SCAtD,EAA+BA,OAAW,GAAQ,KCK/C,MAAMC,EAAa,mBCCpBC,EAAc,kBAEdC,EAA8B,mBA4HvBC,EAAa,CACzBC,KAAMH,EACNI,OAAOC,EAAAA,EAAAA,IAAI,cACXC,QAAS,OACTC,UAAW,kBACXC,WAAY,CACXD,UAAW,QACXE,GAAI,MAELC,KAAI,IACI,KAERC,iDACCC,EAD+C,GAG9C,IADD,mBAAEC,EAAF,cAAsBC,GACrB,EACD,MAAO,CACNC,YAAaH,EACZb,GACCiB,wCACDF,EACAD,KAIHI,wCAAwC,GAAmB,IAAlB,YAAEF,GAAgB,EAC1D,MAAO,CAAEG,EAASC,KACjB,GAA4B,IAAvBJ,EAAYK,OAChB,OAAOF,EAGR,IAAIG,EAAS,CAAEH,QAAAA,EAASC,KAAAA,GAExB,OADAE,EA/II,SAA2BA,GA6BjC,OA7B4D,uDAAL,IAC3CC,SAAWpB,IACtB,IAAI,MAAEqB,EAAF,IAASC,GAAQtB,EAEhBqB,EAAQF,EAAOF,KAAKC,SACxBG,EAAQF,EAAOF,KAAKC,QAGhBI,EAAMH,EAAOF,KAAKC,SACtBI,EAAMH,EAAOF,KAAKC,QAGnB,MAAMb,EAAYN,EAA8BC,EAAWuB,OACrDhB,EAAKR,EAA8BC,EAAWO,GAEpDY,GAASK,EAAAA,EAAAA,aACRL,EACA,CACCM,KAAM3B,EACNQ,WAAY,CACXD,UAAAA,EACAE,GAAAA,IAGFc,EACAC,MAIKH,EAkHIO,CAAkBP,EAAQN,GAC5BM,EAAOH,UAGhBW,mDAAoDC,IAC5C,CACNC,iBAAkBD,EAAU/B,GAC1BiC,+BACFC,sBAAuBH,EAAU/B,GAC/BmC,sCAGJC,0CAA2CC,GACjClB,IACR,MAAMmB,EA7GT,SAAsCnB,GACrC,MAAMmB,EAAY,GAwBlB,OAtBAnB,EAAQI,SAAS,CAAEgB,EAAkBC,MAEpCD,GADAA,EAAmBA,GAAoB,IACHE,QACjCC,GAAYA,EAAOd,OAAS3B,KAEdsB,SAAWmB,IAC3B,IAAI,GAAEhC,GAAOgC,EAAOjC,WACpBC,EAAKA,EAAGiC,QAASzC,EAA6B,IAEvCoC,EAAU5C,eAAgBgB,KAChC4B,EAAW5B,GAAO,CACjBc,MAAOgB,IAOTF,EAAW5B,GAAKe,IAAMe,EAAI,QAIrBF,EAoFaM,CAA6BzB,IACzC,iBACLa,EADK,sBAELE,EAFK,YAGLlB,GACGqB,GA7EP,SACCrB,EACAsB,EAFD,GAIE,IADD,iBAAEN,EAAF,sBAAoBE,GACnB,EACDlB,EAAYO,SAAWsB,IACtB,MAAMC,EAAWR,EAAWO,EAAkBnC,IAE9C,IAAOoC,EAIN,YADAd,EAAkBa,EAAkBnC,IAIrC,MAAM,MAAEc,EAAF,IAASC,GAAQoB,EAClBrB,IAAUsB,EAAStB,OAASC,IAAQqB,EAASrB,KACjDS,EACCW,EAAkBnC,GAClBoC,EAAStB,MACTsB,EAASrB,QA2DVsB,CAAgC/B,EAAasB,EAAW,CACvDN,iBAAAA,EACAE,sBAAAA,OCjLI9B,KAAF,KAAW4C,GAAa7C,GAE9B8C,EAAAA,EAAAA,oBAAoB7C,EAAM4C,GCZ1B,IAAI,EAA+BjD,OAAW,GAAS,MCAnD,EAA+BA,OAAW,GAAQ,MCkCtDmD,EAAAA,EAAAA,WACC,wBACA,oBApBgCC,IACzBC,EAAAA,EAAAA,aAAY,CAAEvC,EAAF,KAAuC,IAA7B,SAAEwC,EAAF,UAAY7C,GAAiB,EAKzD,MAAO,CACNA,UALmBK,EACnBb,GACCsD,qCAAsCD,GAIrCE,KAAOpD,GACA,mBAAqBA,EAAWuB,SAEvC8B,OAAQhD,GACRiC,OAAQgB,SACRC,KAAM,QAZHN,CAcFD,KC/BN,IAAI,EAA+BpD,OAAe,OCclD,SAAS4D,EAAqBC,EAAYC,GACzC,MAAMC,EAAqBF,EAAWnB,OAAQoB,GAE9C,OAAOD,EAAWvC,SAAWyC,EAAmBzC,OAC7CuC,EACAE,EASJ,SAASC,EAAwB5D,GAChC,OACC6D,EAAAA,EAAAA,UAAU7D,EAAWqB,SACrBwC,EAAAA,EAAAA,UAAU7D,EAAWsB,MACrBtB,EAAWqB,OAASrB,EAAWsB,IA0FjC,IClFIwC,EAAW,GAWf,SAASC,EAAQpE,GAChB,MAAO,CAACA,GAyCT,SAASqE,EAAeC,EAAGC,EAAGC,GAC7B,IAAI9B,EAEJ,GAAI4B,EAAE/C,SAAWgD,EAAEhD,OAClB,OAAO,EAGR,IAAKmB,EAAI8B,EAAW9B,EAAI4B,EAAE/C,OAAQmB,IACjC,GAAI4B,EAAE5B,KAAO6B,EAAE7B,GACd,OAAO,EAIT,OAAO,EAiBO,SAAS,EAAC+B,EAAUC,GAElC,IAAIC,EAGAC,EAA0BF,GAAgCN,EAoB9D,SAASS,EAASC,GACjB,IAECpC,EACAqC,EACAtB,EACAuB,EA3FmBhF,EAsFhBiF,EAASN,EACZO,GAAuB,EAMxB,IAAKxC,EAAI,EAAGA,EAAIoC,EAAWvD,OAAQmB,IAAK,CAIvC,KAjGmB1C,EA8FnB+E,EAAYD,EAAWpC,KA7FP,iBAAoB1C,EAgGN,CAC7BkF,GAAuB,EACvB,MAIGD,EAAOE,IAAIJ,GAEdE,EAASA,EAAOzF,IAAIuF,IAGpBtB,EAAM,IAAI2B,QACVH,EAAOI,IAAIN,EAAWtB,GACtBwB,EAASxB,GAYX,OANKwB,EAAOE,IAAIhB,MACfa,EA5GH,WAEC,IAAIA,EAAQ,CACXM,MAAO,WACNN,EAAMO,KAAO,OAIf,OAAOP,EAoGGQ,IACFN,qBAAuBA,EAC7BD,EAAOI,IAAIlB,EAAUa,IAGfC,EAAOzF,IAAI2E,GAMnB,SAASmB,IACRX,EAAY,IAAIS,QAcjB,SAASK,IACR,IACCT,EACAU,EACAhD,EACAiD,EACAb,EALGc,EAAMC,UAAUtE,OASpB,IADAoE,EAAO,IAAIG,MAAMF,GACZlD,EAAI,EAAGA,EAAIkD,EAAKlD,IACpBiD,EAAKjD,GAAKmD,UAAUnD,GAqBrB,KAjBAsC,EAAQH,EADRC,EAAaF,EAAwBmB,MAAM,KAAMJ,KAMtCT,uBAETF,EAAMgB,iBACL3B,EAAeS,EAAYE,EAAMgB,eAAgB,IAElDhB,EAAMM,QAGPN,EAAMgB,eAAiBlB,GAGxBY,EAAOV,EAAMO,KACNG,GAAM,CAEZ,GAAKrB,EAAeqB,EAAKC,KAAMA,EAAM,GAsBrC,OAdID,IAASV,EAAMO,OAEQG,EAAS,KAAEO,KAAOP,EAAKO,KAC7CP,EAAKO,OACRP,EAAKO,KAAKC,KAAOR,EAAKQ,MAGvBR,EAAKO,KAAOjB,EAAMO,KAClBG,EAAKQ,KAAO,KACclB,EAAU,KAAEkB,KAAOR,EAC7CV,EAAMO,KAAOG,GAIPA,EAAKS,IArBXT,EAAOA,EAAKO,KA8Cd,OApBAP,EAAgC,CAE/BS,IAAK1B,EAASsB,MAAM,KAAMJ,IAI3BA,EAAK,GAAK,KACVD,EAAKC,KAAOA,EAMRX,EAAMO,OACTP,EAAMO,KAAKW,KAAOR,EAClBA,EAAKO,KAAOjB,EAAMO,MAGnBP,EAAMO,KAAOG,EAENA,EAAKS,IAOb,OAJAV,EAAaf,cAAgBE,EAC7Ba,EAAaH,MAAQA,EACrBA,IAE2C,ECvR5C,MAAMc,EAAc,GAUP5C,EAAuC6C,GACnD,CAAEC,EAAOrF,KAAmB,MAC3B,OAAO,UAAEqF,MAAAA,OAAF,EAAEA,EAASrF,UAAX,QAA8B,IAAK0B,QAAUtC,GACpB,UAAxBA,EAAWoE,cAGpB,CAAE6B,EAAOrF,KAAT,YAA4B,WAAEqF,MAAAA,OAAF,EAAEA,EAASrF,UAAX,QAA8BmF,MAGpD,SAASG,EACfD,EACArF,GACC,MACD,iBAAOqF,MAAAA,OAAP,EAAOA,EAASrF,UAAhB,QAAmCmF,EAe7B,MAAMjF,EAA0CkF,GACtD,CAAEC,EAAOrF,EAAeD,KAAwB,MAC/C,OAAO,UAAEsF,MAAAA,OAAF,EAAEA,EAASrF,UAAX,QAA8B,IACnC0B,QAAUtC,GAEe,UAAxBA,EAAWoE,UACXzD,IAAuBX,EAAWW,qBAGnCyC,KAAOpD,IACP,MAAM,MAAEmG,KAAUC,GAAUpG,EAE5B,MAAO,IACHmG,KACAC,SAIP,CAAEH,EAAOrF,KAAT,YAA4B,WAAEqF,MAAAA,OAAF,EAAEA,EAASrF,UAAX,QAA8BmF,MASpD,SAASM,EAA8BJ,GAC7C,OAAOK,EAAAA,EAAAA,SAASL,GAASpF,GACjBA,IC7ET,IAAI0F,EAAoC,oBAAXC,QAA0BA,OAAOD,iBAAmBC,OAAOD,gBAAgBE,KAAKD,SAA+B,oBAAbE,UAAgE,mBAA7BA,SAASH,iBAAkCG,SAASH,gBAAgBE,KAAKC,UACvOC,EAAQ,IAAIC,WAAW,IACZ,SAASC,IACtB,IAAKN,EACH,MAAM,IAAIO,MAAM,4GAGlB,OAAOP,EAAgBI,GCJzB,ICRA,4HCMA,EAJA,SAAkBI,GAChB,MAAuB,iBAATA,GAAqB,OAAWA,IFG5CC,EAAY,GAEP3E,EAAI,EAAGA,EAAI,MAAOA,EACzB2E,EAAUC,MAAM5E,EAAI,KAAO6E,SAAS,IAAIC,OAAO,IAoBjD,IGNA,EApBA,SAAYC,EAASC,EAAKC,GAExB,IAAIC,GADJH,EAAUA,GAAW,IACFI,SAAWJ,EAAQP,KAAOA,KAK7C,GAHAU,EAAK,GAAe,GAAVA,EAAK,GAAY,GAC3BA,EAAK,GAAe,GAAVA,EAAK,GAAY,IAEvBF,EAAK,CACPC,EAASA,GAAU,EAEnB,IAAK,IAAIjF,EAAI,EAAGA,EAAI,KAAMA,EACxBgF,EAAIC,EAASjF,GAAKkF,EAAKlF,GAGzB,OAAOgF,EAGT,OHRF,SAAmBI,GACjB,IAAIH,EAAS9B,UAAUtE,OAAS,QAAsBwG,IAAjBlC,UAAU,GAAmBA,UAAU,GAAK,EAG7EuB,GAAQC,EAAUS,EAAIH,EAAS,IAAMN,EAAUS,EAAIH,EAAS,IAAMN,EAAUS,EAAIH,EAAS,IAAMN,EAAUS,EAAIH,EAAS,IAAM,IAAMN,EAAUS,EAAIH,EAAS,IAAMN,EAAUS,EAAIH,EAAS,IAAM,IAAMN,EAAUS,EAAIH,EAAS,IAAMN,EAAUS,EAAIH,EAAS,IAAM,IAAMN,EAAUS,EAAIH,EAAS,IAAMN,EAAUS,EAAIH,EAAS,IAAM,IAAMN,EAAUS,EAAIH,EAAS,KAAON,EAAUS,EAAIH,EAAS,KAAON,EAAUS,EAAIH,EAAS,KAAON,EAAUS,EAAIH,EAAS,KAAON,EAAUS,EAAIH,EAAS,KAAON,EAAUS,EAAIH,EAAS,MAAMK,cAMzf,IAAK,EAASZ,GACZ,MAAMa,UAAU,+BAGlB,OAAOb,EGNA,CAAUQ,ICYZ,SAASM,EAAT,GAOH,IAPyC,cAC5CjH,EAD4C,mBAE5CD,EAAqB,KAFuB,MAG5CwF,EAAQ,KAHoC,SAI5C/B,EAAW,QAJiC,OAK5C7C,EAAS,UALmC,GAM5ChB,EAAKwG,KACF,EACH,MAAMe,EAAS,CACdrG,KAAM,iBACNlB,GAAAA,EACAK,cAAAA,EACAD,mBAAAA,EACAY,OAAAA,EACA6C,SAAAA,GAOD,MAJkB,UAAbA,IACJ0D,EAAO3B,MAAQA,GAGT2B,EAUD,SAAShG,EAAgCiG,GAC/C,MAAO,CACNtG,KAAM,oBACNsG,aAAAA,GAaK,SAAS/F,EACf+F,EACA1G,EACAC,GAEA,MAAO,CACNG,KAAM,0BACNsG,aAAAA,EACA1G,MAAAA,EACAC,IAAAA,GAWK,SAAS0G,EAAyCzG,GACxD,MAAO,CACNE,KAAM,2BACNF,OAAAA,GC9EK,MAAM0G,GAAQC,EAAAA,EAAAA,kBAAkBrI,EAAY,CAClDsI,QTmBM,WAA2C,UAArBlC,EAAqB,uDAAb,GAAI6B,EAAS,uCACjD,OAASA,EAAOrG,MACf,IAAK,iBACJ,MAAMb,EAAgBkH,EAAOlH,cACvBwH,EAAgB,CACrB7H,GAAIuH,EAAOvH,GACXK,cAAAA,EACAD,mBAAoBmH,EAAOnH,mBAC3BY,OAAQuG,EAAOvG,OACf6C,SAAU0D,EAAO1D,SACjB+B,MAAO2B,EAAO3B,OAGf,GAC4B,UAA3BiC,EAAchE,WACZR,EAAwBwE,EAAcjC,OAExC,OAAOF,EAGR,MAAMoC,EAA2B,UAAGpC,MAAAA,OAAH,EAAGA,EAASrF,UAAZ,QAA+B,GAEhE,MAAO,IACHqF,EACH,CAAErF,GAAiB,IACfyH,EACHD,IAIH,IAAK,oBACJ,OAAOE,EAAAA,EAAAA,WAAWrC,GAASsC,GACnB/E,EACN+E,GACEvI,GACMA,EAAWO,KAAOuH,EAAOC,iBAKpC,IAAK,0BACJ,OAAOO,EAAAA,EAAAA,WAAWrC,GAASsC,IAC1B,IAAIC,GAAkB,EAEtB,MAAMC,EAAiBF,EAAoBnF,KACxCpD,GACIA,EAAWO,KAAOuH,EAAOC,cAC7BS,GAAkB,EACX,IACHxI,EACHmG,MAAO,CACN9E,MAAOyG,EAAOzG,MACdC,IAAKwG,EAAOxG,OAKRtB,IAIT,OAAOwI,EAAkBC,EAAiBF,KAG5C,IAAK,2BACJ,OAAOD,EAAAA,EAAAA,WAAWrC,GAASsC,GACnB/E,EACN+E,GACEvI,GACMA,EAAWuB,SAAWuG,EAAOvG,WAMzC,OAAO0E,GS7FPyC,UAFkD,EAGlDC,QAAOA,KAGRC,EAAAA,EAAAA,UAAUX,I","sources":["webpack://wp/webpack/bootstrap","webpack://wp/webpack/runtime/define property getters","webpack://wp/webpack/runtime/hasOwnProperty shorthand","webpack://wp/webpack/runtime/make namespace object","webpack://wp/external window [\"wp\",\"richText\"]","webpack://wp/external window [\"wp\",\"i18n\"]","webpack://wp/./packages/annotations/build-module/store/@wordpress/annotations/src/store/constants.js","webpack://wp/./packages/annotations/build-module/format/@wordpress/annotations/src/format/annotation.js","webpack://wp/./packages/annotations/build-module/format/@wordpress/annotations/src/format/index.js","webpack://wp/external window [\"wp\",\"hooks\"]","webpack://wp/external window [\"wp\",\"data\"]","webpack://wp/./packages/annotations/build-module/block/@wordpress/annotations/src/block/index.js","webpack://wp/external window \"lodash\"","webpack://wp/./packages/annotations/build-module/store/@wordpress/annotations/src/store/reducer.js","webpack://wp/./node_modules/rememo/es/rememo.js","webpack://wp/./packages/annotations/build-module/store/@wordpress/annotations/src/store/selectors.js","webpack://wp/./node_modules/uuid/dist/esm-browser/rng.js","webpack://wp/./node_modules/uuid/dist/esm-browser/stringify.js","webpack://wp/./node_modules/uuid/dist/esm-browser/regex.js","webpack://wp/./node_modules/uuid/dist/esm-browser/validate.js","webpack://wp/./node_modules/uuid/dist/esm-browser/v4.js","webpack://wp/./packages/annotations/build-module/store/@wordpress/annotations/src/store/actions.js","webpack://wp/./packages/annotations/build-module/store/@wordpress/annotations/src/store/index.js"],"sourcesContent":["// The require scope\nvar __webpack_require__ = {};\n\n","// define getter functions for harmony exports\n__webpack_require__.d = function(exports, definition) {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }","// define __esModule on exports\n__webpack_require__.r = function(exports) {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","var __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"richText\"];","var __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"i18n\"];","/**\n * The identifier for the data store.\n *\n * @type {string}\n */\nexport const STORE_NAME = 'core/annotations';\n","/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { applyFormat, removeFormat } from '@wordpress/rich-text';\n\nconst FORMAT_NAME = 'core/annotation';\n\nconst ANNOTATION_ATTRIBUTE_PREFIX = 'annotation-text-';\n/**\n * Internal dependencies\n */\nimport { STORE_NAME } from '../store/constants';\n\n/**\n * Applies given annotations to the given record.\n *\n * @param {Object} record The record to apply annotations to.\n * @param {Array} annotations The annotation to apply.\n * @return {Object} A record with the annotations applied.\n */\nexport function applyAnnotations( record, annotations = [] ) {\n\tannotations.forEach( ( annotation ) => {\n\t\tlet { start, end } = annotation;\n\n\t\tif ( start > record.text.length ) {\n\t\t\tstart = record.text.length;\n\t\t}\n\n\t\tif ( end > record.text.length ) {\n\t\t\tend = record.text.length;\n\t\t}\n\n\t\tconst className = ANNOTATION_ATTRIBUTE_PREFIX + annotation.source;\n\t\tconst id = ANNOTATION_ATTRIBUTE_PREFIX + annotation.id;\n\n\t\trecord = applyFormat(\n\t\t\trecord,\n\t\t\t{\n\t\t\t\ttype: FORMAT_NAME,\n\t\t\t\tattributes: {\n\t\t\t\t\tclassName,\n\t\t\t\t\tid,\n\t\t\t\t},\n\t\t\t},\n\t\t\tstart,\n\t\t\tend\n\t\t);\n\t} );\n\n\treturn record;\n}\n\n/**\n * Removes annotations from the given record.\n *\n * @param {Object} record Record to remove annotations from.\n * @return {Object} The cleaned record.\n */\nexport function removeAnnotations( record ) {\n\treturn removeFormat( record, 'core/annotation', 0, record.text.length );\n}\n\n/**\n * Retrieves the positions of annotations inside an array of formats.\n *\n * @param {Array} formats Formats with annotations in there.\n * @return {Object} ID keyed positions of annotations.\n */\nfunction retrieveAnnotationPositions( formats ) {\n\tconst positions = {};\n\n\tformats.forEach( ( characterFormats, i ) => {\n\t\tcharacterFormats = characterFormats || [];\n\t\tcharacterFormats = characterFormats.filter(\n\t\t\t( format ) => format.type === FORMAT_NAME\n\t\t);\n\t\tcharacterFormats.forEach( ( format ) => {\n\t\t\tlet { id } = format.attributes;\n\t\t\tid = id.replace( ANNOTATION_ATTRIBUTE_PREFIX, '' );\n\n\t\t\tif ( ! positions.hasOwnProperty( id ) ) {\n\t\t\t\tpositions[ id ] = {\n\t\t\t\t\tstart: i,\n\t\t\t\t};\n\t\t\t}\n\n\t\t\t// Annotations refer to positions between characters.\n\t\t\t// Formats refer to the character themselves.\n\t\t\t// So we need to adjust for that here.\n\t\t\tpositions[ id ].end = i + 1;\n\t\t} );\n\t} );\n\n\treturn positions;\n}\n\n/**\n * Updates annotations in the state based on positions retrieved from RichText.\n *\n * @param {Array} annotations The annotations that are currently applied.\n * @param {Array} positions The current positions of the given annotations.\n * @param {Object} actions\n * @param {Function} actions.removeAnnotation Function to remove an annotation from the state.\n * @param {Function} actions.updateAnnotationRange Function to update an annotation range in the state.\n */\nfunction updateAnnotationsWithPositions(\n\tannotations,\n\tpositions,\n\t{ removeAnnotation, updateAnnotationRange }\n) {\n\tannotations.forEach( ( currentAnnotation ) => {\n\t\tconst position = positions[ currentAnnotation.id ];\n\t\t// If we cannot find an annotation, delete it.\n\t\tif ( ! position ) {\n\t\t\t// Apparently the annotation has been removed, so remove it from the state:\n\t\t\t// Remove...\n\t\t\tremoveAnnotation( currentAnnotation.id );\n\t\t\treturn;\n\t\t}\n\n\t\tconst { start, end } = currentAnnotation;\n\t\tif ( start !== position.start || end !== position.end ) {\n\t\t\tupdateAnnotationRange(\n\t\t\t\tcurrentAnnotation.id,\n\t\t\t\tposition.start,\n\t\t\t\tposition.end\n\t\t\t);\n\t\t}\n\t} );\n}\n\nexport const annotation = {\n\tname: FORMAT_NAME,\n\ttitle: __( 'Annotation' ),\n\ttagName: 'mark',\n\tclassName: 'annotation-text',\n\tattributes: {\n\t\tclassName: 'class',\n\t\tid: 'id',\n\t},\n\tedit() {\n\t\treturn null;\n\t},\n\t__experimentalGetPropsForEditableTreePreparation(\n\t\tselect,\n\t\t{ richTextIdentifier, blockClientId }\n\t) {\n\t\treturn {\n\t\t\tannotations: select(\n\t\t\t\tSTORE_NAME\n\t\t\t).__experimentalGetAnnotationsForRichText(\n\t\t\t\tblockClientId,\n\t\t\t\trichTextIdentifier\n\t\t\t),\n\t\t};\n\t},\n\t__experimentalCreatePrepareEditableTree( { annotations } ) {\n\t\treturn ( formats, text ) => {\n\t\t\tif ( annotations.length === 0 ) {\n\t\t\t\treturn formats;\n\t\t\t}\n\n\t\t\tlet record = { formats, text };\n\t\t\trecord = applyAnnotations( record, annotations );\n\t\t\treturn record.formats;\n\t\t};\n\t},\n\t__experimentalGetPropsForEditableTreeChangeHandler( dispatch ) {\n\t\treturn {\n\t\t\tremoveAnnotation: dispatch( STORE_NAME )\n\t\t\t\t.__experimentalRemoveAnnotation,\n\t\t\tupdateAnnotationRange: dispatch( STORE_NAME )\n\t\t\t\t.__experimentalUpdateAnnotationRange,\n\t\t};\n\t},\n\t__experimentalCreateOnChangeEditableValue( props ) {\n\t\treturn ( formats ) => {\n\t\t\tconst positions = retrieveAnnotationPositions( formats );\n\t\t\tconst {\n\t\t\t\tremoveAnnotation,\n\t\t\t\tupdateAnnotationRange,\n\t\t\t\tannotations,\n\t\t\t} = props;\n\n\t\t\tupdateAnnotationsWithPositions( annotations, positions, {\n\t\t\t\tremoveAnnotation,\n\t\t\t\tupdateAnnotationRange,\n\t\t\t} );\n\t\t};\n\t},\n};\n","/**\n * WordPress dependencies\n */\nimport { registerFormatType } from '@wordpress/rich-text';\n\n/**\n * Internal dependencies\n */\nimport { annotation } from './annotation';\n\nconst { name, ...settings } = annotation;\n\nregisterFormatType( name, settings );\n","var __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"hooks\"];","var __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"data\"];","/**\n * WordPress dependencies\n */\nimport { addFilter } from '@wordpress/hooks';\nimport { withSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { STORE_NAME } from '../store/constants';\n/**\n * Adds annotation className to the block-list-block component.\n *\n * @param {Object} OriginalComponent The original BlockListBlock component.\n * @return {Object} The enhanced component.\n */\nconst addAnnotationClassName = ( OriginalComponent ) => {\n\treturn withSelect( ( select, { clientId, className } ) => {\n\t\tconst annotations = select(\n\t\t\tSTORE_NAME\n\t\t).__experimentalGetAnnotationsForBlock( clientId );\n\n\t\treturn {\n\t\t\tclassName: annotations\n\t\t\t\t.map( ( annotation ) => {\n\t\t\t\t\treturn 'is-annotated-by-' + annotation.source;\n\t\t\t\t} )\n\t\t\t\t.concat( className )\n\t\t\t\t.filter( Boolean )\n\t\t\t\t.join( ' ' ),\n\t\t};\n\t} )( OriginalComponent );\n};\n\naddFilter(\n\t'editor.BlockListBlock',\n\t'core/annotations',\n\taddAnnotationClassName\n);\n","var __WEBPACK_NAMESPACE_OBJECT__ = window[\"lodash\"];","/**\n * External dependencies\n */\nimport { isNumber, mapValues } from 'lodash';\n\n/**\n * Filters an array based on the predicate, but keeps the reference the same if\n * the array hasn't changed.\n *\n * @param {Array} collection The collection to filter.\n * @param {Function} predicate Function that determines if the item should stay\n * in the array.\n * @return {Array} Filtered array.\n */\nfunction filterWithReference( collection, predicate ) {\n\tconst filteredCollection = collection.filter( predicate );\n\n\treturn collection.length === filteredCollection.length\n\t\t? collection\n\t\t: filteredCollection;\n}\n\n/**\n * Verifies whether the given annotations is a valid annotation.\n *\n * @param {Object} annotation The annotation to verify.\n * @return {boolean} Whether the given annotation is valid.\n */\nfunction isValidAnnotationRange( annotation ) {\n\treturn (\n\t\tisNumber( annotation.start ) &&\n\t\tisNumber( annotation.end ) &&\n\t\tannotation.start <= annotation.end\n\t);\n}\n\n/**\n * Reducer managing annotations.\n *\n * @param {Object} state The annotations currently shown in the editor.\n * @param {Object} action Dispatched action.\n *\n * @return {Array} Updated state.\n */\nexport function annotations( state = {}, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'ANNOTATION_ADD':\n\t\t\tconst blockClientId = action.blockClientId;\n\t\t\tconst newAnnotation = {\n\t\t\t\tid: action.id,\n\t\t\t\tblockClientId,\n\t\t\t\trichTextIdentifier: action.richTextIdentifier,\n\t\t\t\tsource: action.source,\n\t\t\t\tselector: action.selector,\n\t\t\t\trange: action.range,\n\t\t\t};\n\n\t\t\tif (\n\t\t\t\tnewAnnotation.selector === 'range' &&\n\t\t\t\t! isValidAnnotationRange( newAnnotation.range )\n\t\t\t) {\n\t\t\t\treturn state;\n\t\t\t}\n\n\t\t\tconst previousAnnotationsForBlock = state?.[ blockClientId ] ?? [];\n\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\t[ blockClientId ]: [\n\t\t\t\t\t...previousAnnotationsForBlock,\n\t\t\t\t\tnewAnnotation,\n\t\t\t\t],\n\t\t\t};\n\n\t\tcase 'ANNOTATION_REMOVE':\n\t\t\treturn mapValues( state, ( annotationsForBlock ) => {\n\t\t\t\treturn filterWithReference(\n\t\t\t\t\tannotationsForBlock,\n\t\t\t\t\t( annotation ) => {\n\t\t\t\t\t\treturn annotation.id !== action.annotationId;\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t} );\n\n\t\tcase 'ANNOTATION_UPDATE_RANGE':\n\t\t\treturn mapValues( state, ( annotationsForBlock ) => {\n\t\t\t\tlet hasChangedRange = false;\n\n\t\t\t\tconst newAnnotations = annotationsForBlock.map(\n\t\t\t\t\t( annotation ) => {\n\t\t\t\t\t\tif ( annotation.id === action.annotationId ) {\n\t\t\t\t\t\t\thasChangedRange = true;\n\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\t...annotation,\n\t\t\t\t\t\t\t\trange: {\n\t\t\t\t\t\t\t\t\tstart: action.start,\n\t\t\t\t\t\t\t\t\tend: action.end,\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\treturn annotation;\n\t\t\t\t\t}\n\t\t\t\t);\n\n\t\t\t\treturn hasChangedRange ? newAnnotations : annotationsForBlock;\n\t\t\t} );\n\n\t\tcase 'ANNOTATION_REMOVE_SOURCE':\n\t\t\treturn mapValues( state, ( annotationsForBlock ) => {\n\t\t\t\treturn filterWithReference(\n\t\t\t\t\tannotationsForBlock,\n\t\t\t\t\t( annotation ) => {\n\t\t\t\t\t\treturn annotation.source !== action.source;\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t} );\n\t}\n\n\treturn state;\n}\n\nexport default annotations;\n","'use strict';\n\n/** @typedef {(...args: any[]) => *[]} GetDependants */\n\n/** @typedef {() => void} Clear */\n\n/**\n * @typedef {{\n * getDependants: GetDependants,\n * clear: Clear\n * }} EnhancedSelector\n */\n\n/**\n * Internal cache entry.\n *\n * @typedef CacheNode\n *\n * @property {?CacheNode|undefined} [prev] Previous node.\n * @property {?CacheNode|undefined} [next] Next node.\n * @property {*[]} args Function arguments for cache entry.\n * @property {*} val Function result.\n */\n\n/**\n * @typedef Cache\n *\n * @property {Clear} clear Function to clear cache.\n * @property {boolean} [isUniqueByDependants] Whether dependants are valid in\n * considering cache uniqueness. A cache is unique if dependents are all arrays\n * or objects.\n * @property {CacheNode?} [head] Cache head.\n * @property {*[]} [lastDependants] Dependants from previous invocation.\n */\n\n/**\n * Arbitrary value used as key for referencing cache object in WeakMap tree.\n *\n * @type {{}}\n */\nvar LEAF_KEY = {};\n\n/**\n * Returns the first argument as the sole entry in an array.\n *\n * @template T\n *\n * @param {T} value Value to return.\n *\n * @return {[T]} Value returned as entry in array.\n */\nfunction arrayOf(value) {\n\treturn [value];\n}\n\n/**\n * Returns true if the value passed is object-like, or false otherwise. A value\n * is object-like if it can support property assignment, e.g. object or array.\n *\n * @param {*} value Value to test.\n *\n * @return {boolean} Whether value is object-like.\n */\nfunction isObjectLike(value) {\n\treturn !!value && 'object' === typeof value;\n}\n\n/**\n * Creates and returns a new cache object.\n *\n * @return {Cache} Cache object.\n */\nfunction createCache() {\n\t/** @type {Cache} */\n\tvar cache = {\n\t\tclear: function () {\n\t\t\tcache.head = null;\n\t\t},\n\t};\n\n\treturn cache;\n}\n\n/**\n * Returns true if entries within the two arrays are strictly equal by\n * reference from a starting index.\n *\n * @param {*[]} a First array.\n * @param {*[]} b Second array.\n * @param {number} fromIndex Index from which to start comparison.\n *\n * @return {boolean} Whether arrays are shallowly equal.\n */\nfunction isShallowEqual(a, b, fromIndex) {\n\tvar i;\n\n\tif (a.length !== b.length) {\n\t\treturn false;\n\t}\n\n\tfor (i = fromIndex; i < a.length; i++) {\n\t\tif (a[i] !== b[i]) {\n\t\t\treturn false;\n\t\t}\n\t}\n\n\treturn true;\n}\n\n/**\n * Returns a memoized selector function. The getDependants function argument is\n * called before the memoized selector and is expected to return an immutable\n * reference or array of references on which the selector depends for computing\n * its own return value. The memoize cache is preserved only as long as those\n * dependant references remain the same. If getDependants returns a different\n * reference(s), the cache is cleared and the selector value regenerated.\n *\n * @template {(...args: *[]) => *} S\n *\n * @param {S} selector Selector function.\n * @param {GetDependants=} getDependants Dependant getter returning an array of\n * references used in cache bust consideration.\n */\nexport default function (selector, getDependants) {\n\t/** @type {WeakMap<*,*>} */\n\tvar rootCache;\n\n\t/** @type {GetDependants} */\n\tvar normalizedGetDependants = getDependants ? getDependants : arrayOf;\n\n\t/**\n\t * Returns the cache for a given dependants array. When possible, a WeakMap\n\t * will be used to create a unique cache for each set of dependants. This\n\t * is feasible due to the nature of WeakMap in allowing garbage collection\n\t * to occur on entries where the key object is no longer referenced. Since\n\t * WeakMap requires the key to be an object, this is only possible when the\n\t * dependant is object-like. The root cache is created as a hierarchy where\n\t * each top-level key is the first entry in a dependants set, the value a\n\t * WeakMap where each key is the next dependant, and so on. This continues\n\t * so long as the dependants are object-like. If no dependants are object-\n\t * like, then the cache is shared across all invocations.\n\t *\n\t * @see isObjectLike\n\t *\n\t * @param {*[]} dependants Selector dependants.\n\t *\n\t * @return {Cache} Cache object.\n\t */\n\tfunction getCache(dependants) {\n\t\tvar caches = rootCache,\n\t\t\tisUniqueByDependants = true,\n\t\t\ti,\n\t\t\tdependant,\n\t\t\tmap,\n\t\t\tcache;\n\n\t\tfor (i = 0; i < dependants.length; i++) {\n\t\t\tdependant = dependants[i];\n\n\t\t\t// Can only compose WeakMap from object-like key.\n\t\t\tif (!isObjectLike(dependant)) {\n\t\t\t\tisUniqueByDependants = false;\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t// Does current segment of cache already have a WeakMap?\n\t\t\tif (caches.has(dependant)) {\n\t\t\t\t// Traverse into nested WeakMap.\n\t\t\t\tcaches = caches.get(dependant);\n\t\t\t} else {\n\t\t\t\t// Create, set, and traverse into a new one.\n\t\t\t\tmap = new WeakMap();\n\t\t\t\tcaches.set(dependant, map);\n\t\t\t\tcaches = map;\n\t\t\t}\n\t\t}\n\n\t\t// We use an arbitrary (but consistent) object as key for the last item\n\t\t// in the WeakMap to serve as our running cache.\n\t\tif (!caches.has(LEAF_KEY)) {\n\t\t\tcache = createCache();\n\t\t\tcache.isUniqueByDependants = isUniqueByDependants;\n\t\t\tcaches.set(LEAF_KEY, cache);\n\t\t}\n\n\t\treturn caches.get(LEAF_KEY);\n\t}\n\n\t/**\n\t * Resets root memoization cache.\n\t */\n\tfunction clear() {\n\t\trootCache = new WeakMap();\n\t}\n\n\t/* eslint-disable jsdoc/check-param-names */\n\t/**\n\t * The augmented selector call, considering first whether dependants have\n\t * changed before passing it to underlying memoize function.\n\t *\n\t * @param {*} source Source object for derivation.\n\t * @param {...*} extraArgs Additional arguments to pass to selector.\n\t *\n\t * @return {*} Selector result.\n\t */\n\t/* eslint-enable jsdoc/check-param-names */\n\tfunction callSelector(/* source, ...extraArgs */) {\n\t\tvar len = arguments.length,\n\t\t\tcache,\n\t\t\tnode,\n\t\t\ti,\n\t\t\targs,\n\t\t\tdependants;\n\n\t\t// Create copy of arguments (avoid leaking deoptimization).\n\t\targs = new Array(len);\n\t\tfor (i = 0; i < len; i++) {\n\t\t\targs[i] = arguments[i];\n\t\t}\n\n\t\tdependants = normalizedGetDependants.apply(null, args);\n\t\tcache = getCache(dependants);\n\n\t\t// If not guaranteed uniqueness by dependants (primitive type), shallow\n\t\t// compare against last dependants and, if references have changed,\n\t\t// destroy cache to recalculate result.\n\t\tif (!cache.isUniqueByDependants) {\n\t\t\tif (\n\t\t\t\tcache.lastDependants &&\n\t\t\t\t!isShallowEqual(dependants, cache.lastDependants, 0)\n\t\t\t) {\n\t\t\t\tcache.clear();\n\t\t\t}\n\n\t\t\tcache.lastDependants = dependants;\n\t\t}\n\n\t\tnode = cache.head;\n\t\twhile (node) {\n\t\t\t// Check whether node arguments match arguments\n\t\t\tif (!isShallowEqual(node.args, args, 1)) {\n\t\t\t\tnode = node.next;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// At this point we can assume we've found a match\n\n\t\t\t// Surface matched node to head if not already\n\t\t\tif (node !== cache.head) {\n\t\t\t\t// Adjust siblings to point to each other.\n\t\t\t\t/** @type {CacheNode} */ (node.prev).next = node.next;\n\t\t\t\tif (node.next) {\n\t\t\t\t\tnode.next.prev = node.prev;\n\t\t\t\t}\n\n\t\t\t\tnode.next = cache.head;\n\t\t\t\tnode.prev = null;\n\t\t\t\t/** @type {CacheNode} */ (cache.head).prev = node;\n\t\t\t\tcache.head = node;\n\t\t\t}\n\n\t\t\t// Return immediately\n\t\t\treturn node.val;\n\t\t}\n\n\t\t// No cached value found. Continue to insertion phase:\n\n\t\tnode = /** @type {CacheNode} */ ({\n\t\t\t// Generate the result from original function\n\t\t\tval: selector.apply(null, args),\n\t\t});\n\n\t\t// Avoid including the source object in the cache.\n\t\targs[0] = null;\n\t\tnode.args = args;\n\n\t\t// Don't need to check whether node is already head, since it would\n\t\t// have been returned above already if it was\n\n\t\t// Shift existing head down list\n\t\tif (cache.head) {\n\t\t\tcache.head.prev = node;\n\t\t\tnode.next = cache.head;\n\t\t}\n\n\t\tcache.head = node;\n\n\t\treturn node.val;\n\t}\n\n\tcallSelector.getDependants = normalizedGetDependants;\n\tcallSelector.clear = clear;\n\tclear();\n\n\treturn /** @type {S & EnhancedSelector} */ (callSelector);\n}\n","/**\n * External dependencies\n */\nimport createSelector from 'rememo';\nimport { flatMap } from 'lodash';\n\n/**\n * Shared reference to an empty array for cases where it is important to avoid\n * returning a new array reference on every invocation, as in a connected or\n * other pure component which performs `shouldComponentUpdate` check on props.\n * This should be used as a last resort, since the normalized data should be\n * maintained by the reducer result in state.\n *\n * @type {Array}\n */\nconst EMPTY_ARRAY = [];\n\n/**\n * Returns the annotations for a specific client ID.\n *\n * @param {Object} state Editor state.\n * @param {string} clientId The ID of the block to get the annotations for.\n *\n * @return {Array} The annotations applicable to this block.\n */\nexport const __experimentalGetAnnotationsForBlock = createSelector(\n\t( state, blockClientId ) => {\n\t\treturn ( state?.[ blockClientId ] ?? [] ).filter( ( annotation ) => {\n\t\t\treturn annotation.selector === 'block';\n\t\t} );\n\t},\n\t( state, blockClientId ) => [ state?.[ blockClientId ] ?? EMPTY_ARRAY ]\n);\n\nexport function __experimentalGetAllAnnotationsForBlock(\n\tstate,\n\tblockClientId\n) {\n\treturn state?.[ blockClientId ] ?? EMPTY_ARRAY;\n}\n\n/**\n * Returns the annotations that apply to the given RichText instance.\n *\n * Both a blockClientId and a richTextIdentifier are required. This is because\n * a block might have multiple `RichText` components. This does mean that every\n * block needs to implement annotations itself.\n *\n * @param {Object} state Editor state.\n * @param {string} blockClientId The client ID for the block.\n * @param {string} richTextIdentifier Unique identifier that identifies the given RichText.\n * @return {Array} All the annotations relevant for the `RichText`.\n */\nexport const __experimentalGetAnnotationsForRichText = createSelector(\n\t( state, blockClientId, richTextIdentifier ) => {\n\t\treturn ( state?.[ blockClientId ] ?? [] )\n\t\t\t.filter( ( annotation ) => {\n\t\t\t\treturn (\n\t\t\t\t\tannotation.selector === 'range' &&\n\t\t\t\t\trichTextIdentifier === annotation.richTextIdentifier\n\t\t\t\t);\n\t\t\t} )\n\t\t\t.map( ( annotation ) => {\n\t\t\t\tconst { range, ...other } = annotation;\n\n\t\t\t\treturn {\n\t\t\t\t\t...range,\n\t\t\t\t\t...other,\n\t\t\t\t};\n\t\t\t} );\n\t},\n\t( state, blockClientId ) => [ state?.[ blockClientId ] ?? EMPTY_ARRAY ]\n);\n\n/**\n * Returns all annotations in the editor state.\n *\n * @param {Object} state Editor state.\n * @return {Array} All annotations currently applied.\n */\nexport function __experimentalGetAnnotations( state ) {\n\treturn flatMap( state, ( annotations ) => {\n\t\treturn annotations;\n\t} );\n}\n","// Unique ID creation requires a high quality random # generator. In the browser we therefore\n// require the crypto API and do not support built-in fallback to lower quality random number\n// generators (like Math.random()).\n// getRandomValues needs to be invoked in a context where \"this\" is a Crypto implementation. Also,\n// find the complete implementation of crypto (msCrypto) on IE11.\nvar getRandomValues = typeof crypto !== 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto) || typeof msCrypto !== 'undefined' && typeof msCrypto.getRandomValues === 'function' && msCrypto.getRandomValues.bind(msCrypto);\nvar rnds8 = new Uint8Array(16);\nexport default function rng() {\n if (!getRandomValues) {\n throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported');\n }\n\n return getRandomValues(rnds8);\n}","import validate from './validate.js';\n/**\n * Convert array of 16 byte values to UUID string format of the form:\n * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX\n */\n\nvar byteToHex = [];\n\nfor (var i = 0; i < 256; ++i) {\n byteToHex.push((i + 0x100).toString(16).substr(1));\n}\n\nfunction stringify(arr) {\n var offset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n // Note: Be careful editing this code! It's been tuned for performance\n // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434\n var uuid = (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase(); // Consistency check for valid UUID. If this throws, it's likely due to one\n // of the following:\n // - One or more input array values don't map to a hex octet (leading to\n // \"undefined\" in the uuid)\n // - Invalid input values for the RFC `version` or `variant` fields\n\n if (!validate(uuid)) {\n throw TypeError('Stringified UUID is invalid');\n }\n\n return uuid;\n}\n\nexport default stringify;","export default /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;","import REGEX from './regex.js';\n\nfunction validate(uuid) {\n return typeof uuid === 'string' && REGEX.test(uuid);\n}\n\nexport default validate;","import rng from './rng.js';\nimport stringify from './stringify.js';\n\nfunction v4(options, buf, offset) {\n options = options || {};\n var rnds = options.random || (options.rng || rng)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`\n\n rnds[6] = rnds[6] & 0x0f | 0x40;\n rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided\n\n if (buf) {\n offset = offset || 0;\n\n for (var i = 0; i < 16; ++i) {\n buf[offset + i] = rnds[i];\n }\n\n return buf;\n }\n\n return stringify(rnds);\n}\n\nexport default v4;","/**\n * External dependencies\n */\nimport { v4 as uuid } from 'uuid';\n\n/**\n * @typedef WPAnnotationRange\n *\n * @property {number} start The offset where the annotation should start.\n * @property {number} end The offset where the annotation should end.\n */\n\n/**\n * Adds an annotation to a block.\n *\n * The `block` attribute refers to a block ID that needs to be annotated.\n * `isBlockAnnotation` controls whether or not the annotation is a block\n * annotation. The `source` is the source of the annotation, this will be used\n * to identity groups of annotations.\n *\n * The `range` property is only relevant if the selector is 'range'.\n *\n * @param {Object} annotation The annotation to add.\n * @param {string} annotation.blockClientId The blockClientId to add the annotation to.\n * @param {string} annotation.richTextIdentifier Identifier for the RichText instance the annotation applies to.\n * @param {WPAnnotationRange} annotation.range The range at which to apply this annotation.\n * @param {string} [annotation.selector=\"range\"] The way to apply this annotation.\n * @param {string} [annotation.source=\"default\"] The source that added the annotation.\n * @param {string} [annotation.id] The ID the annotation should have. Generates a UUID by default.\n *\n * @return {Object} Action object.\n */\nexport function __experimentalAddAnnotation( {\n\tblockClientId,\n\trichTextIdentifier = null,\n\trange = null,\n\tselector = 'range',\n\tsource = 'default',\n\tid = uuid(),\n} ) {\n\tconst action = {\n\t\ttype: 'ANNOTATION_ADD',\n\t\tid,\n\t\tblockClientId,\n\t\trichTextIdentifier,\n\t\tsource,\n\t\tselector,\n\t};\n\n\tif ( selector === 'range' ) {\n\t\taction.range = range;\n\t}\n\n\treturn action;\n}\n\n/**\n * Removes an annotation with a specific ID.\n *\n * @param {string} annotationId The annotation to remove.\n *\n * @return {Object} Action object.\n */\nexport function __experimentalRemoveAnnotation( annotationId ) {\n\treturn {\n\t\ttype: 'ANNOTATION_REMOVE',\n\t\tannotationId,\n\t};\n}\n\n/**\n * Updates the range of an annotation.\n *\n * @param {string} annotationId ID of the annotation to update.\n * @param {number} start The start of the new range.\n * @param {number} end The end of the new range.\n *\n * @return {Object} Action object.\n */\nexport function __experimentalUpdateAnnotationRange(\n\tannotationId,\n\tstart,\n\tend\n) {\n\treturn {\n\t\ttype: 'ANNOTATION_UPDATE_RANGE',\n\t\tannotationId,\n\t\tstart,\n\t\tend,\n\t};\n}\n\n/**\n * Removes all annotations of a specific source.\n *\n * @param {string} source The source to remove.\n *\n * @return {Object} Action object.\n */\nexport function __experimentalRemoveAnnotationsBySource( source ) {\n\treturn {\n\t\ttype: 'ANNOTATION_REMOVE_SOURCE',\n\t\tsource,\n\t};\n}\n","/**\n * WordPress dependencies\n */\nimport { register, createReduxStore } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport reducer from './reducer';\nimport * as selectors from './selectors';\nimport * as actions from './actions';\n\n/**\n * Module Constants\n */\nimport { STORE_NAME } from './constants';\n\n/**\n * Store definition for the annotations namespace.\n *\n * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#createReduxStore\n *\n * @type {Object}\n */\nexport const store = createReduxStore( STORE_NAME, {\n\treducer,\n\tselectors,\n\tactions,\n} );\n\nregister( store );\n"],"names":["__webpack_require__","exports","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","Symbol","toStringTag","value","window","STORE_NAME","FORMAT_NAME","ANNOTATION_ATTRIBUTE_PREFIX","annotation","name","title","__","tagName","className","attributes","id","edit","__experimentalGetPropsForEditableTreePreparation","select","richTextIdentifier","blockClientId","annotations","__experimentalGetAnnotationsForRichText","__experimentalCreatePrepareEditableTree","formats","text","length","record","forEach","start","end","source","applyFormat","type","applyAnnotations","__experimentalGetPropsForEditableTreeChangeHandler","dispatch","removeAnnotation","__experimentalRemoveAnnotation","updateAnnotationRange","__experimentalUpdateAnnotationRange","__experimentalCreateOnChangeEditableValue","props","positions","characterFormats","i","filter","format","replace","retrieveAnnotationPositions","currentAnnotation","position","updateAnnotationsWithPositions","settings","registerFormatType","addFilter","OriginalComponent","withSelect","clientId","__experimentalGetAnnotationsForBlock","map","concat","Boolean","join","filterWithReference","collection","predicate","filteredCollection","isValidAnnotationRange","isNumber","LEAF_KEY","arrayOf","isShallowEqual","a","b","fromIndex","selector","getDependants","rootCache","normalizedGetDependants","getCache","dependants","dependant","cache","caches","isUniqueByDependants","has","WeakMap","set","clear","head","createCache","callSelector","node","args","len","arguments","Array","apply","lastDependants","next","prev","val","EMPTY_ARRAY","createSelector","state","__experimentalGetAllAnnotationsForBlock","range","other","__experimentalGetAnnotations","flatMap","getRandomValues","crypto","bind","msCrypto","rnds8","Uint8Array","rng","Error","uuid","byteToHex","push","toString","substr","options","buf","offset","rnds","random","arr","undefined","toLowerCase","TypeError","__experimentalAddAnnotation","action","annotationId","__experimentalRemoveAnnotationsBySource","store","createReduxStore","reducer","newAnnotation","previousAnnotationsForBlock","mapValues","annotationsForBlock","hasChangedRange","newAnnotations","selectors","actions","register"],"sourceRoot":""}
|
build/block-editor/index.js
CHANGED
@@ -2214,6 +2214,7 @@ __webpack_require__.d(__webpack_exports__, {
|
|
2214 |
"__experimentalColorGradientSettingsDropdown": function() { return /* reexport */ ColorGradientSettingsDropdown; },
|
2215 |
"__experimentalDateFormatPicker": function() { return /* reexport */ DateFormatPicker; },
|
2216 |
"__experimentalDuotoneControl": function() { return /* reexport */ duotone_control; },
|
|
|
2217 |
"__experimentalFontAppearanceControl": function() { return /* reexport */ FontAppearanceControl; },
|
2218 |
"__experimentalFontFamilyControl": function() { return /* reexport */ FontFamilyControl; },
|
2219 |
"__experimentalGetBorderClassesAndStyles": function() { return /* reexport */ getBorderClassesAndStyles; },
|
@@ -2236,6 +2237,7 @@ __webpack_require__.d(__webpack_exports__, {
|
|
2236 |
"__experimentalListView": function() { return /* reexport */ components_list_view; },
|
2237 |
"__experimentalPanelColorGradientSettings": function() { return /* reexport */ panel_color_gradient_settings; },
|
2238 |
"__experimentalPreviewOptions": function() { return /* reexport */ PreviewOptions; },
|
|
|
2239 |
"__experimentalResponsiveBlockControl": function() { return /* reexport */ responsive_block_control; },
|
2240 |
"__experimentalTextDecorationControl": function() { return /* reexport */ TextDecorationControl; },
|
2241 |
"__experimentalTextTransformControl": function() { return /* reexport */ TextTransformControl; },
|
@@ -2304,6 +2306,7 @@ __webpack_require__.d(selectors_namespaceObject, {
|
|
2304 |
"__unstableGetClientIdWithClientIdsTree": function() { return __unstableGetClientIdWithClientIdsTree; },
|
2305 |
"__unstableGetClientIdsTree": function() { return __unstableGetClientIdsTree; },
|
2306 |
"__unstableGetSelectedBlocksWithPartialSelection": function() { return __unstableGetSelectedBlocksWithPartialSelection; },
|
|
|
2307 |
"__unstableIsFullySelected": function() { return __unstableIsFullySelected; },
|
2308 |
"__unstableIsLastBlockChangeIgnored": function() { return __unstableIsLastBlockChangeIgnored; },
|
2309 |
"__unstableIsSelectionCollapsed": function() { return __unstableIsSelectionCollapsed; },
|
@@ -2374,6 +2377,7 @@ __webpack_require__.d(selectors_namespaceObject, {
|
|
2374 |
"isBlockMultiSelected": function() { return isBlockMultiSelected; },
|
2375 |
"isBlockSelected": function() { return isBlockSelected; },
|
2376 |
"isBlockValid": function() { return isBlockValid; },
|
|
|
2377 |
"isBlockWithinSelection": function() { return isBlockWithinSelection; },
|
2378 |
"isCaretWithinFormattedText": function() { return isCaretWithinFormattedText; },
|
2379 |
"isDraggingBlocks": function() { return isDraggingBlocks; },
|
@@ -2428,6 +2432,7 @@ __webpack_require__.d(actions_namespaceObject, {
|
|
2428 |
"selectPreviousBlock": function() { return selectPreviousBlock; },
|
2429 |
"selectionChange": function() { return selectionChange; },
|
2430 |
"setBlockMovingClientId": function() { return setBlockMovingClientId; },
|
|
|
2431 |
"setHasControlledInnerBlocks": function() { return setHasControlledInnerBlocks; },
|
2432 |
"setNavigationMode": function() { return setNavigationMode; },
|
2433 |
"setTemplateValidity": function() { return setTemplateValidity; },
|
@@ -3279,7 +3284,8 @@ const withBlockReset = reducer => (state, action) => {
|
|
3279 |
attributes: getFlattenedBlockAttributes(action.blocks),
|
3280 |
order: mapBlockOrder(action.blocks),
|
3281 |
parents: mapBlockParents(action.blocks),
|
3282 |
-
controlledInnerBlocks: {}
|
|
|
3283 |
};
|
3284 |
const subTree = buildBlockTree(newState, action.blocks);
|
3285 |
newState.tree = { ...subTree,
|
@@ -3746,6 +3752,19 @@ withBlockReset, withPersistentBlockChange, withIgnoredBlockChange, withResetCont
|
|
3746 |
};
|
3747 |
}
|
3748 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3749 |
return state;
|
3750 |
}
|
3751 |
|
@@ -4338,8 +4357,9 @@ function automaticChangeStatus(state, action) {
|
|
4338 |
|
4339 |
return;
|
4340 |
// Undoing an automatic change should still be possible after mouse
|
4341 |
-
// move.
|
4342 |
|
|
|
4343 |
case 'START_TYPING':
|
4344 |
case 'STOP_TYPING':
|
4345 |
return state;
|
@@ -4439,31 +4459,57 @@ function lastBlockInserted() {
|
|
4439 |
;// CONCATENATED MODULE: ./node_modules/rememo/es/rememo.js
|
4440 |
|
4441 |
|
4442 |
-
|
|
|
|
|
4443 |
|
4444 |
/**
|
4445 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4446 |
*
|
4447 |
-
* @
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4448 |
*/
|
4449 |
-
LEAF_KEY = {};
|
4450 |
|
4451 |
/**
|
4452 |
-
*
|
4453 |
*
|
4454 |
-
* @type {
|
4455 |
*/
|
4456 |
-
|
4457 |
|
4458 |
/**
|
4459 |
* Returns the first argument as the sole entry in an array.
|
4460 |
*
|
4461 |
-
* @
|
4462 |
*
|
4463 |
-
* @
|
|
|
|
|
4464 |
*/
|
4465 |
-
function arrayOf(
|
4466 |
-
return [
|
4467 |
}
|
4468 |
|
4469 |
/**
|
@@ -4474,18 +4520,19 @@ function arrayOf( value ) {
|
|
4474 |
*
|
4475 |
* @return {boolean} Whether value is object-like.
|
4476 |
*/
|
4477 |
-
function isObjectLike(
|
4478 |
-
return !!
|
4479 |
}
|
4480 |
|
4481 |
/**
|
4482 |
* Creates and returns a new cache object.
|
4483 |
*
|
4484 |
-
* @return {
|
4485 |
*/
|
4486 |
function createCache() {
|
|
|
4487 |
var cache = {
|
4488 |
-
clear: function() {
|
4489 |
cache.head = null;
|
4490 |
},
|
4491 |
};
|
@@ -4497,21 +4544,21 @@ function createCache() {
|
|
4497 |
* Returns true if entries within the two arrays are strictly equal by
|
4498 |
* reference from a starting index.
|
4499 |
*
|
4500 |
-
* @param {
|
4501 |
-
* @param {
|
4502 |
* @param {number} fromIndex Index from which to start comparison.
|
4503 |
*
|
4504 |
* @return {boolean} Whether arrays are shallowly equal.
|
4505 |
*/
|
4506 |
-
function isShallowEqual(
|
4507 |
var i;
|
4508 |
|
4509 |
-
if (
|
4510 |
return false;
|
4511 |
}
|
4512 |
|
4513 |
-
for (
|
4514 |
-
if (
|
4515 |
return false;
|
4516 |
}
|
4517 |
}
|
@@ -4527,31 +4574,18 @@ function isShallowEqual( a, b, fromIndex ) {
|
|
4527 |
* dependant references remain the same. If getDependants returns a different
|
4528 |
* reference(s), the cache is cleared and the selector value regenerated.
|
4529 |
*
|
4530 |
-
* @
|
4531 |
-
* @param {Function} getDependants Dependant getter returning an immutable
|
4532 |
-
* reference or array of reference used in
|
4533 |
-
* cache bust consideration.
|
4534 |
*
|
4535 |
-
* @
|
|
|
|
|
4536 |
*/
|
4537 |
-
/* harmony default export */ function rememo(selector, getDependants
|
4538 |
-
|
|
|
4539 |
|
4540 |
-
|
4541 |
-
|
4542 |
-
getDependants = arrayOf;
|
4543 |
-
}
|
4544 |
-
|
4545 |
-
/**
|
4546 |
-
* Returns the root cache. If WeakMap is supported, this is assigned to the
|
4547 |
-
* root WeakMap cache set, otherwise it is a shared instance of the default
|
4548 |
-
* cache object.
|
4549 |
-
*
|
4550 |
-
* @return {(WeakMap|Object)} Root cache object.
|
4551 |
-
*/
|
4552 |
-
function getRootCache() {
|
4553 |
-
return rootCache;
|
4554 |
-
}
|
4555 |
|
4556 |
/**
|
4557 |
* Returns the cache for a given dependants array. When possible, a WeakMap
|
@@ -4567,85 +4601,93 @@ function isShallowEqual( a, b, fromIndex ) {
|
|
4567 |
*
|
4568 |
* @see isObjectLike
|
4569 |
*
|
4570 |
-
* @param {
|
4571 |
*
|
4572 |
-
* @return {
|
4573 |
*/
|
4574 |
-
function
|
4575 |
var caches = rootCache,
|
4576 |
isUniqueByDependants = true,
|
4577 |
-
i,
|
|
|
|
|
|
|
4578 |
|
4579 |
-
for (
|
4580 |
-
dependant = dependants[
|
4581 |
|
4582 |
// Can only compose WeakMap from object-like key.
|
4583 |
-
if (
|
4584 |
isUniqueByDependants = false;
|
4585 |
break;
|
4586 |
}
|
4587 |
|
4588 |
// Does current segment of cache already have a WeakMap?
|
4589 |
-
if (
|
4590 |
// Traverse into nested WeakMap.
|
4591 |
-
caches = caches.get(
|
4592 |
} else {
|
4593 |
// Create, set, and traverse into a new one.
|
4594 |
map = new WeakMap();
|
4595 |
-
caches.set(
|
4596 |
caches = map;
|
4597 |
}
|
4598 |
}
|
4599 |
|
4600 |
// We use an arbitrary (but consistent) object as key for the last item
|
4601 |
// in the WeakMap to serve as our running cache.
|
4602 |
-
if (
|
4603 |
cache = createCache();
|
4604 |
cache.isUniqueByDependants = isUniqueByDependants;
|
4605 |
-
caches.set(
|
4606 |
}
|
4607 |
|
4608 |
-
return caches.get(
|
4609 |
}
|
4610 |
|
4611 |
-
// Assign cache handler by availability of WeakMap
|
4612 |
-
getCache = hasWeakMap ? getWeakMapCache : getRootCache;
|
4613 |
-
|
4614 |
/**
|
4615 |
* Resets root memoization cache.
|
4616 |
*/
|
4617 |
function clear() {
|
4618 |
-
rootCache =
|
4619 |
}
|
4620 |
|
4621 |
-
|
4622 |
/**
|
4623 |
* The augmented selector call, considering first whether dependants have
|
4624 |
* changed before passing it to underlying memoize function.
|
4625 |
*
|
4626 |
-
* @param {
|
4627 |
-
* @param {...*}
|
4628 |
*
|
4629 |
* @return {*} Selector result.
|
4630 |
*/
|
4631 |
-
|
|
|
4632 |
var len = arguments.length,
|
4633 |
-
cache,
|
|
|
|
|
|
|
|
|
4634 |
|
4635 |
// Create copy of arguments (avoid leaking deoptimization).
|
4636 |
-
args = new Array(
|
4637 |
-
for (
|
4638 |
-
args[
|
4639 |
}
|
4640 |
|
4641 |
-
dependants =
|
4642 |
-
cache = getCache(
|
4643 |
-
|
4644 |
-
// If not guaranteed uniqueness by dependants (primitive type
|
4645 |
-
//
|
4646 |
-
//
|
4647 |
-
if (
|
4648 |
-
if (
|
|
|
|
|
|
|
4649 |
cache.clear();
|
4650 |
}
|
4651 |
|
@@ -4653,9 +4695,9 @@ function isShallowEqual( a, b, fromIndex ) {
|
|
4653 |
}
|
4654 |
|
4655 |
node = cache.head;
|
4656 |
-
while (
|
4657 |
// Check whether node arguments match arguments
|
4658 |
-
if (
|
4659 |
node = node.next;
|
4660 |
continue;
|
4661 |
}
|
@@ -4663,16 +4705,16 @@ function isShallowEqual( a, b, fromIndex ) {
|
|
4663 |
// At this point we can assume we've found a match
|
4664 |
|
4665 |
// Surface matched node to head if not already
|
4666 |
-
if (
|
4667 |
// Adjust siblings to point to each other.
|
4668 |
-
node.prev.next = node.next;
|
4669 |
-
if (
|
4670 |
node.next.prev = node.prev;
|
4671 |
}
|
4672 |
|
4673 |
node.next = cache.head;
|
4674 |
node.prev = null;
|
4675 |
-
cache.head.prev = node;
|
4676 |
cache.head = node;
|
4677 |
}
|
4678 |
|
@@ -4682,20 +4724,20 @@ function isShallowEqual( a, b, fromIndex ) {
|
|
4682 |
|
4683 |
// No cached value found. Continue to insertion phase:
|
4684 |
|
4685 |
-
node = {
|
4686 |
// Generate the result from original function
|
4687 |
-
val: selector.apply(
|
4688 |
-
};
|
4689 |
|
4690 |
// Avoid including the source object in the cache.
|
4691 |
-
args[
|
4692 |
node.args = args;
|
4693 |
|
4694 |
// Don't need to check whether node is already head, since it would
|
4695 |
// have been returned above already if it was
|
4696 |
|
4697 |
// Shift existing head down list
|
4698 |
-
if (
|
4699 |
cache.head.prev = node;
|
4700 |
node.next = cache.head;
|
4701 |
}
|
@@ -4705,11 +4747,11 @@ function isShallowEqual( a, b, fromIndex ) {
|
|
4705 |
return node.val;
|
4706 |
}
|
4707 |
|
4708 |
-
callSelector.getDependants =
|
4709 |
callSelector.clear = clear;
|
4710 |
clear();
|
4711 |
|
4712 |
-
return callSelector;
|
4713 |
}
|
4714 |
|
4715 |
;// CONCATENATED MODULE: external ["wp","primitives"]
|
@@ -7181,6 +7223,29 @@ function wasBlockJustInserted(state, clientId, source) {
|
|
7181 |
} = state;
|
7182 |
return lastBlockInserted.clientId === clientId && lastBlockInserted.source === source;
|
7183 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7184 |
|
7185 |
;// CONCATENATED MODULE: external ["wp","a11y"]
|
7186 |
var external_wp_a11y_namespaceObject = window["wp"]["a11y"];
|
@@ -8694,6 +8759,18 @@ function setHasControlledInnerBlocks(clientId, hasControlledInnerBlocks) {
|
|
8694 |
clientId
|
8695 |
};
|
8696 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8697 |
|
8698 |
;// CONCATENATED MODULE: ./packages/block-editor/build-module/store/constants.js
|
8699 |
const STORE_NAME = 'core/block-editor';
|
@@ -9816,7 +9893,8 @@ function BlockPopover(_ref) {
|
|
9816 |
__unstableSlotName: __unstablePopoverSlot || null // Observe movement for block animations (especially horizontal).
|
9817 |
,
|
9818 |
__unstableObserveElement: selectedElement,
|
9819 |
-
__unstableForcePosition: true
|
|
|
9820 |
}, props, {
|
9821 |
className: classnames_default()('block-editor-block-popover', props.className)
|
9822 |
}), __unstableCoverTarget && (0,external_wp_element_namespaceObject.createElement)("div", {
|
@@ -10320,7 +10398,7 @@ const useIsDimensionsDisabled = function () {
|
|
10320 |
return gapDisabled && paddingDisabled && marginDisabled;
|
10321 |
};
|
10322 |
/**
|
10323 |
-
* Custom hook to retrieve which padding/margin is supported
|
10324 |
* e.g. top, right, bottom or left.
|
10325 |
*
|
10326 |
* Sides are opted into by default. It is only if a specific side is set to
|
@@ -10329,18 +10407,28 @@ const useIsDimensionsDisabled = function () {
|
|
10329 |
* @param {string} blockName Block name.
|
10330 |
* @param {string} feature The feature custom sides relate to e.g. padding or margins.
|
10331 |
*
|
10332 |
-
* @return {
|
10333 |
*/
|
10334 |
|
10335 |
|
10336 |
function useCustomSides(blockName, feature) {
|
|
|
|
|
10337 |
const support = (0,external_wp_blocks_namespaceObject.getBlockSupport)(blockName, SPACING_SUPPORT_KEY); // Skip when setting is boolean as theme isn't setting arbitrary sides.
|
10338 |
|
10339 |
if (!support || typeof support[feature] === 'boolean') {
|
10340 |
return;
|
10341 |
-
}
|
|
|
|
|
|
|
|
|
|
|
10342 |
|
10343 |
-
|
|
|
|
|
|
|
10344 |
}
|
10345 |
/**
|
10346 |
* Custom hook to determine whether the sides configured in the
|
@@ -10816,6 +10904,7 @@ const JustifyToolbar = props => {
|
|
10816 |
|
10817 |
|
10818 |
|
|
|
10819 |
/**
|
10820 |
* Internal dependencies
|
10821 |
*/
|
@@ -10907,10 +10996,11 @@ const flexWrapOptions = ['wrap', 'nowrap'];
|
|
10907 |
orientation = 'horizontal'
|
10908 |
} = layout;
|
10909 |
const blockGapSupport = useSetting('spacing.blockGap');
|
|
|
10910 |
const hasBlockGapStylesSupport = blockGapSupport !== null; // If a block's block.json skips serialization for spacing or spacing.blockGap,
|
10911 |
// don't apply the user-defined value to the styles.
|
10912 |
|
10913 |
-
const blockGapValue = style !== null && style !== void 0 && (_style$spacing = style.spacing) !== null && _style$spacing !== void 0 && _style$spacing.blockGap && !shouldSkipSerialization(blockName, 'spacing', 'blockGap') ? getGapCSSValue(style === null || style === void 0 ? void 0 : (_style$spacing2 = style.spacing) === null || _style$spacing2 === void 0 ? void 0 : _style$spacing2.blockGap,
|
10914 |
const justifyContent = justifyContentMap[layout.justifyContent] || justifyContentMap.left;
|
10915 |
const flexWrap = flexWrapOptions.includes(layout.flexWrap) ? layout.flexWrap : 'wrap';
|
10916 |
const verticalAlignment = verticalAlignmentMap[layout.verticalAlignment] || verticalAlignmentMap.center;
|
@@ -10928,7 +11018,7 @@ const flexWrapOptions = ['wrap', 'nowrap'];
|
|
10928 |
${appendSelectors(selector)} {
|
10929 |
display: flex;
|
10930 |
flex-wrap: ${flexWrap};
|
10931 |
-
gap: ${hasBlockGapStylesSupport ? blockGapValue :
|
10932 |
${orientation === 'horizontal' ? rowOrientation : columnOrientation}
|
10933 |
}
|
10934 |
|
@@ -13226,7 +13316,7 @@ function BlockHTML(_ref) {
|
|
13226 |
|
13227 |
/* harmony default export */ var block_html = (BlockHTML);
|
13228 |
|
13229 |
-
;// CONCATENATED MODULE: ./node_modules/@react-spring/rafz/dist/react-spring-rafz.esm.js
|
13230 |
let updateQueue = makeQueue();
|
13231 |
const raf = fn => schedule(fn, updateQueue);
|
13232 |
let writeQueue = makeQueue();
|
@@ -13253,7 +13343,7 @@ raf.setTimeout = (handler, ms) => {
|
|
13253 |
let cancel = () => {
|
13254 |
let i = timeouts.findIndex(t => t.cancel == cancel);
|
13255 |
if (~i) timeouts.splice(i, 1);
|
13256 |
-
|
13257 |
};
|
13258 |
|
13259 |
let timeout = {
|
@@ -13262,7 +13352,7 @@ raf.setTimeout = (handler, ms) => {
|
|
13262 |
cancel
|
13263 |
};
|
13264 |
timeouts.splice(findTimeout(time), 0, timeout);
|
13265 |
-
|
13266 |
start();
|
13267 |
return timeout;
|
13268 |
};
|
@@ -13270,8 +13360,11 @@ raf.setTimeout = (handler, ms) => {
|
|
13270 |
let findTimeout = time => ~(~timeouts.findIndex(t => t.time > time) || ~timeouts.length);
|
13271 |
|
13272 |
raf.cancel = fn => {
|
|
|
|
|
13273 |
updateQueue.delete(fn);
|
13274 |
writeQueue.delete(fn);
|
|
|
13275 |
};
|
13276 |
|
13277 |
raf.sync = fn => {
|
@@ -13326,6 +13419,7 @@ raf.advance = () => {
|
|
13326 |
};
|
13327 |
|
13328 |
let ts = -1;
|
|
|
13329 |
let sync = false;
|
13330 |
|
13331 |
function schedule(fn, queue) {
|
@@ -13348,6 +13442,10 @@ function start() {
|
|
13348 |
}
|
13349 |
}
|
13350 |
|
|
|
|
|
|
|
|
|
13351 |
function loop() {
|
13352 |
if (~ts) {
|
13353 |
nativeRaf(loop);
|
@@ -13362,7 +13460,7 @@ function update() {
|
|
13362 |
|
13363 |
if (count) {
|
13364 |
eachSafely(timeouts.splice(0, count), t => t.handler());
|
13365 |
-
|
13366 |
}
|
13367 |
|
13368 |
onStartQueue.flush();
|
@@ -13370,6 +13468,10 @@ function update() {
|
|
13370 |
onFrameQueue.flush();
|
13371 |
writeQueue.flush();
|
13372 |
onFinishQueue.flush();
|
|
|
|
|
|
|
|
|
13373 |
}
|
13374 |
|
13375 |
function makeQueue() {
|
@@ -13377,21 +13479,21 @@ function makeQueue() {
|
|
13377 |
let current = next;
|
13378 |
return {
|
13379 |
add(fn) {
|
13380 |
-
|
13381 |
next.add(fn);
|
13382 |
},
|
13383 |
|
13384 |
delete(fn) {
|
13385 |
-
|
13386 |
return next.delete(fn);
|
13387 |
},
|
13388 |
|
13389 |
flush(arg) {
|
13390 |
if (current.size) {
|
13391 |
next = new Set();
|
13392 |
-
|
13393 |
eachSafely(current, fn => fn(arg) && next.add(fn));
|
13394 |
-
|
13395 |
current = next;
|
13396 |
}
|
13397 |
}
|
@@ -13410,7 +13512,13 @@ function eachSafely(values, each) {
|
|
13410 |
}
|
13411 |
|
13412 |
const __raf = {
|
13413 |
-
count
|
|
|
|
|
|
|
|
|
|
|
|
|
13414 |
|
13415 |
clear() {
|
13416 |
ts = -1;
|
@@ -13420,7 +13528,7 @@ const __raf = {
|
|
13420 |
onFrameQueue = makeQueue();
|
13421 |
writeQueue = makeQueue();
|
13422 |
onFinishQueue = makeQueue();
|
13423 |
-
|
13424 |
}
|
13425 |
|
13426 |
};
|
@@ -13430,7 +13538,7 @@ const __raf = {
|
|
13430 |
// EXTERNAL MODULE: external "React"
|
13431 |
var external_React_ = __webpack_require__(9196);
|
13432 |
var external_React_default = /*#__PURE__*/__webpack_require__.n(external_React_);
|
13433 |
-
;// CONCATENATED MODULE: ./node_modules/@react-spring/shared/dist/react-spring-shared.esm.js
|
13434 |
|
13435 |
|
13436 |
|
@@ -13465,6 +13573,14 @@ function isEqual(a, b) {
|
|
13465 |
}
|
13466 |
const react_spring_shared_esm_each = (obj, fn) => obj.forEach(fn);
|
13467 |
function eachProp(obj, fn, ctx) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13468 |
for (const key in obj) {
|
13469 |
if (obj.hasOwnProperty(key)) {
|
13470 |
fn.call(ctx, obj[key], key);
|
@@ -13480,6 +13596,7 @@ function flush(queue, iterator) {
|
|
13480 |
}
|
13481 |
}
|
13482 |
const flushCalls = (queue, ...args) => flush(queue, fn => fn(...args));
|
|
|
13483 |
|
13484 |
let createStringInterpolator$1;
|
13485 |
let to;
|
@@ -14021,14 +14138,54 @@ const setHidden = (target, key, value) => Object.defineProperty(target, key, {
|
|
14021 |
|
14022 |
const numberRegex = /[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?/g;
|
14023 |
const colorRegex = /(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi;
|
14024 |
-
|
14025 |
const rgbaRegex = /rgba\(([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+)\)/gi;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14026 |
|
14027 |
const rgbaRound = (_, p1, p2, p3, p4) => `rgba(${Math.round(p1)}, ${Math.round(p2)}, ${Math.round(p3)}, ${p4})`;
|
14028 |
|
14029 |
const createStringInterpolator = config => {
|
14030 |
if (!namedColorRegex) namedColorRegex = colors$1 ? new RegExp(`(${Object.keys(colors$1).join('|')})(?!\\w)`, 'g') : /^\b$/;
|
14031 |
-
const output = config.output.map(value =>
|
|
|
|
|
14032 |
const keyframes = output.map(value => value.match(numberRegex).map(Number));
|
14033 |
const outputRanges = keyframes[0].map((_, i) => keyframes.map(values => {
|
14034 |
if (!(i in values)) {
|
@@ -14041,8 +14198,11 @@ const createStringInterpolator = config => {
|
|
14041 |
output
|
14042 |
})));
|
14043 |
return input => {
|
|
|
|
|
|
|
14044 |
let i = 0;
|
14045 |
-
return output[0].replace(numberRegex, () =>
|
14046 |
};
|
14047 |
};
|
14048 |
|
@@ -14074,33 +14234,32 @@ function deprecateDirectCall() {
|
|
14074 |
}
|
14075 |
|
14076 |
function isAnimatedString(value) {
|
14077 |
-
return react_spring_shared_esm_is.str(value) && (value[0] == '#' || /\d/.test(value) || value in (colors$1 || {}));
|
14078 |
}
|
14079 |
|
14080 |
-
const
|
14081 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14082 |
|
14083 |
function react_spring_shared_esm_useForceUpdate() {
|
14084 |
const update = (0,external_React_.useState)()[1];
|
14085 |
-
const
|
14086 |
-
react_spring_shared_esm_useOnce(mounted.unmount);
|
14087 |
return () => {
|
14088 |
-
if (
|
14089 |
-
update(
|
14090 |
}
|
14091 |
};
|
14092 |
}
|
14093 |
|
14094 |
-
function makeMountedRef() {
|
14095 |
-
const mounted = {
|
14096 |
-
current: true,
|
14097 |
-
unmount: () => () => {
|
14098 |
-
mounted.current = false;
|
14099 |
-
}
|
14100 |
-
};
|
14101 |
-
return mounted;
|
14102 |
-
}
|
14103 |
-
|
14104 |
function useMemoOne(getResult, inputs) {
|
14105 |
const [initial] = (0,external_React_.useState)(() => ({
|
14106 |
inputs,
|
@@ -14147,6 +14306,9 @@ function areInputsEqual(next, prev) {
|
|
14147 |
return true;
|
14148 |
}
|
14149 |
|
|
|
|
|
|
|
14150 |
function react_spring_shared_esm_usePrev(value) {
|
14151 |
const prevRef = (0,external_React_.useRef)();
|
14152 |
(0,external_React_.useEffect)(() => {
|
@@ -14155,11 +14317,9 @@ function react_spring_shared_esm_usePrev(value) {
|
|
14155 |
return prevRef.current;
|
14156 |
}
|
14157 |
|
14158 |
-
const react_spring_shared_esm_useLayoutEffect = typeof window !== 'undefined' && window.document && window.document.createElement ? external_React_.useLayoutEffect : external_React_.useEffect;
|
14159 |
-
|
14160 |
|
14161 |
|
14162 |
-
;// CONCATENATED MODULE: ./node_modules/@react-spring/animated/dist/react-spring-animated.esm.js
|
14163 |
|
14164 |
|
14165 |
|
@@ -14435,14 +14595,14 @@ const withAnimated = (Component, host) => {
|
|
14435 |
const observer = new PropsObserver(callback, deps);
|
14436 |
const observerRef = (0,external_React_.useRef)();
|
14437 |
react_spring_shared_esm_useLayoutEffect(() => {
|
14438 |
-
const lastObserver = observerRef.current;
|
14439 |
observerRef.current = observer;
|
14440 |
react_spring_shared_esm_each(deps, dep => addFluidObserver(dep, observer));
|
14441 |
-
|
14442 |
-
|
14443 |
-
|
14444 |
-
|
14445 |
-
|
|
|
14446 |
});
|
14447 |
(0,external_React_.useEffect)(callback, []);
|
14448 |
react_spring_shared_esm_useOnce(() => () => {
|
@@ -14530,7 +14690,7 @@ const getDisplayName = arg => react_spring_shared_esm_is.str(arg) ? arg : arg &&
|
|
14530 |
|
14531 |
|
14532 |
|
14533 |
-
;// CONCATENATED MODULE: ./node_modules/@react-spring/core/dist/react-spring-core.esm.js
|
14534 |
|
14535 |
|
14536 |
|
@@ -14697,8 +14857,8 @@ function useChain(refs, timeSteps, timeFrame = 1000) {
|
|
14697 |
|
14698 |
props.delay = key => delay + callProp(memoizedDelayProp || 0, key);
|
14699 |
});
|
14700 |
-
ctrl.start();
|
14701 |
});
|
|
|
14702 |
}
|
14703 |
});
|
14704 |
} else {
|
@@ -14714,7 +14874,7 @@ function useChain(refs, timeSteps, timeFrame = 1000) {
|
|
14714 |
});
|
14715 |
p = p.then(() => {
|
14716 |
each(controllers, (ctrl, i) => each(queues[i] || [], update => ctrl.queue.push(update)));
|
14717 |
-
return ref.start();
|
14718 |
});
|
14719 |
}
|
14720 |
});
|
@@ -14748,13 +14908,65 @@ const config = {
|
|
14748 |
friction: 120
|
14749 |
}
|
14750 |
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14751 |
|
14752 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14753 |
|
14754 |
const defaults = react_spring_core_esm_extends({}, config.default, {
|
14755 |
mass: 1,
|
14756 |
damping: 1,
|
14757 |
-
easing: linear,
|
14758 |
clamp: false
|
14759 |
});
|
14760 |
|
@@ -14889,7 +15101,8 @@ function scheduleProps(callId, {
|
|
14889 |
}
|
14890 |
|
14891 |
function onResume() {
|
14892 |
-
if (delay > 0) {
|
|
|
14893 |
timeout = raf.setTimeout(onStart, delay);
|
14894 |
state.pauseQueue.add(onPause);
|
14895 |
state.timeouts.add(timeout);
|
@@ -14899,6 +15112,10 @@ function scheduleProps(callId, {
|
|
14899 |
}
|
14900 |
|
14901 |
function onStart() {
|
|
|
|
|
|
|
|
|
14902 |
state.pauseQueue.delete(onPause);
|
14903 |
state.timeouts.delete(timeout);
|
14904 |
|
@@ -15166,6 +15383,7 @@ class SpringValue extends FrameValue {
|
|
15166 |
this.defaultProps = {};
|
15167 |
this._state = {
|
15168 |
paused: false,
|
|
|
15169 |
pauseQueue: new Set(),
|
15170 |
resumeQueue: new Set(),
|
15171 |
timeouts: new Set()
|
@@ -15213,6 +15431,10 @@ class SpringValue extends FrameValue {
|
|
15213 |
return isPaused(this);
|
15214 |
}
|
15215 |
|
|
|
|
|
|
|
|
|
15216 |
advance(dt) {
|
15217 |
let idle = true;
|
15218 |
let changed = false;
|
@@ -15416,7 +15638,11 @@ class SpringValue extends FrameValue {
|
|
15416 |
this.queue = [];
|
15417 |
}
|
15418 |
|
15419 |
-
return Promise.all(queue.map(props =>
|
|
|
|
|
|
|
|
|
15420 |
}
|
15421 |
|
15422 |
stop(cancel) {
|
@@ -15949,7 +16175,9 @@ class Controller {
|
|
15949 |
}
|
15950 |
|
15951 |
get idle() {
|
15952 |
-
return !this._state.asyncTo && Object.values(this.springs).every(spring =>
|
|
|
|
|
15953 |
}
|
15954 |
|
15955 |
get item() {
|
@@ -16512,21 +16740,30 @@ const initSpringRef = () => SpringRef();
|
|
16512 |
const useSpringRef = () => useState(initSpringRef)[0];
|
16513 |
|
16514 |
function useTrail(length, propsArg, deps) {
|
|
|
|
|
16515 |
const propsFn = is.fun(propsArg) && propsArg;
|
16516 |
if (propsFn && !deps) deps = [];
|
16517 |
let reverse = true;
|
|
|
16518 |
const result = useSprings(length, (i, ctrl) => {
|
16519 |
const props = propsFn ? propsFn(i, ctrl) : propsArg;
|
|
|
16520 |
reverse = reverse && props.reverse;
|
16521 |
return props;
|
16522 |
}, deps || [{}]);
|
16523 |
-
const ref = result[1];
|
16524 |
useLayoutEffect(() => {
|
16525 |
each(ref.current, (ctrl, i) => {
|
16526 |
const parent = ref.current[i + (reverse ? 1 : -1)];
|
16527 |
-
|
16528 |
-
|
16529 |
-
|
|
|
|
|
|
|
|
|
|
|
16530 |
});
|
16531 |
}, deps);
|
16532 |
|
@@ -16544,6 +16781,23 @@ function useTrail(length, propsArg, deps) {
|
|
16544 |
return result;
|
16545 |
}
|
16546 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
16547 |
return result[0];
|
16548 |
}
|
16549 |
|
@@ -16563,6 +16817,7 @@ function useTransition(data, props, deps) {
|
|
16563 |
sort,
|
16564 |
trail = 0,
|
16565 |
expires = true,
|
|
|
16566 |
onDestroyed,
|
16567 |
ref: propsRef,
|
16568 |
config: propsConfig
|
@@ -16575,14 +16830,28 @@ function useTransition(data, props, deps) {
|
|
16575 |
useLayoutEffect(() => {
|
16576 |
usedTransitions.current = transitions;
|
16577 |
});
|
16578 |
-
useOnce(() =>
|
16579 |
-
|
16580 |
-
|
16581 |
-
}
|
16582 |
|
16583 |
-
|
16584 |
-
|
16585 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
16586 |
const keys = getKeys(items, propsFn ? propsFn() : props, prevTransitions);
|
16587 |
const expired = reset && usedTransitions.current || [];
|
16588 |
useLayoutEffect(() => each(expired, ({
|
@@ -16642,6 +16911,8 @@ function useTransition(data, props, deps) {
|
|
16642 |
const forceUpdate = useForceUpdate();
|
16643 |
const defaultProps = getDefaultProps(props);
|
16644 |
const changes = new Map();
|
|
|
|
|
16645 |
each(transitions, (t, i) => {
|
16646 |
const key = t.key;
|
16647 |
const prevPhase = t.phase;
|
@@ -16727,30 +16998,53 @@ function useTransition(data, props, deps) {
|
|
16727 |
}
|
16728 |
|
16729 |
if (idle && transitions.some(t => t.expired)) {
|
|
|
|
|
|
|
|
|
|
|
|
|
16730 |
forceUpdate();
|
16731 |
}
|
16732 |
}
|
16733 |
};
|
16734 |
|
16735 |
const springs = getSprings(t.ctrl, payload);
|
16736 |
-
|
16737 |
-
|
16738 |
-
|
16739 |
-
|
16740 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
16741 |
});
|
16742 |
const context = useContext(SpringContext);
|
16743 |
const prevContext = usePrev(context);
|
16744 |
const hasContext = context !== prevContext && hasProps(context);
|
16745 |
useLayoutEffect(() => {
|
16746 |
-
if (hasContext)
|
16747 |
-
t
|
16748 |
-
|
|
|
|
|
16749 |
});
|
16750 |
-
}
|
16751 |
}, [context]);
|
|
|
|
|
|
|
|
|
|
|
|
|
16752 |
useLayoutEffect(() => {
|
16753 |
-
each(changes, ({
|
16754 |
phase,
|
16755 |
payload
|
16756 |
}, t) => {
|
@@ -16769,10 +17063,14 @@ function useTransition(data, props, deps) {
|
|
16769 |
if (payload) {
|
16770 |
replaceRef(ctrl, payload.ref);
|
16771 |
|
16772 |
-
if (ctrl.ref) {
|
16773 |
ctrl.update(payload);
|
16774 |
} else {
|
16775 |
ctrl.start(payload);
|
|
|
|
|
|
|
|
|
16776 |
}
|
16777 |
}
|
16778 |
});
|
@@ -16987,7 +17285,7 @@ const react_spring_core_esm_update = frameLoop.advance;
|
|
16987 |
|
16988 |
;// CONCATENATED MODULE: external "ReactDOM"
|
16989 |
var external_ReactDOM_namespaceObject = window["ReactDOM"];
|
16990 |
-
;// CONCATENATED MODULE: ./node_modules/@react-spring/web/dist/react-spring-web.esm.js
|
16991 |
|
16992 |
|
16993 |
|
@@ -20123,6 +20421,19 @@ function useInput() {
|
|
20123 |
__unstableExpandSelection
|
20124 |
} = (0,external_wp_data_namespaceObject.useDispatch)(store);
|
20125 |
return (0,external_wp_compose_namespaceObject.useRefEffect)(node => {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
20126 |
function onKeyDown(event) {
|
20127 |
if (event.defaultPrevented) {
|
20128 |
return;
|
@@ -20187,9 +20498,11 @@ function useInput() {
|
|
20187 |
}
|
20188 |
}
|
20189 |
|
|
|
20190 |
node.addEventListener('keydown', onKeyDown);
|
20191 |
node.addEventListener('compositionstart', onCompositionStart);
|
20192 |
return () => {
|
|
|
20193 |
node.removeEventListener('keydown', onKeyDown);
|
20194 |
node.removeEventListener('compositionstart', onCompositionStart);
|
20195 |
};
|
@@ -25183,27 +25496,30 @@ function BlockPopoverInbetween(_ref) {
|
|
25183 |
} = _ref;
|
25184 |
const {
|
25185 |
orientation,
|
25186 |
-
rootClientId
|
|
|
25187 |
} = (0,external_wp_data_namespaceObject.useSelect)(select => {
|
25188 |
var _getBlockListSettings;
|
25189 |
|
25190 |
const {
|
25191 |
getBlockListSettings,
|
25192 |
-
getBlockRootClientId
|
|
|
25193 |
} = select(store);
|
25194 |
|
25195 |
const _rootClientId = getBlockRootClientId(previousClientId);
|
25196 |
|
25197 |
return {
|
25198 |
orientation: ((_getBlockListSettings = getBlockListSettings(_rootClientId)) === null || _getBlockListSettings === void 0 ? void 0 : _getBlockListSettings.orientation) || 'vertical',
|
25199 |
-
rootClientId: _rootClientId
|
|
|
25200 |
};
|
25201 |
}, [previousClientId]);
|
25202 |
const previousElement = useBlockElement(previousClientId);
|
25203 |
const nextElement = useBlockElement(nextClientId);
|
25204 |
const isVertical = orientation === 'vertical';
|
25205 |
const style = (0,external_wp_element_namespaceObject.useMemo)(() => {
|
25206 |
-
if (!previousElement && !nextElement) {
|
25207 |
return {};
|
25208 |
}
|
25209 |
|
@@ -25229,7 +25545,7 @@ function BlockPopoverInbetween(_ref) {
|
|
25229 |
};
|
25230 |
}, [previousElement, nextElement, isVertical]);
|
25231 |
const getAnchorRect = (0,external_wp_element_namespaceObject.useCallback)(() => {
|
25232 |
-
if (!previousElement && !nextElement) {
|
25233 |
return {};
|
25234 |
}
|
25235 |
|
@@ -25287,7 +25603,7 @@ function BlockPopoverInbetween(_ref) {
|
|
25287 |
}, [previousElement, nextElement]);
|
25288 |
const popoverScrollRef = use_popover_scroll(__unstableContentRef);
|
25289 |
|
25290 |
-
if (!previousElement || !nextElement) {
|
25291 |
return null;
|
25292 |
}
|
25293 |
/* eslint-disable jsx-a11y/no-static-element-interactions, jsx-a11y/click-events-have-key-events */
|
@@ -26375,6 +26691,7 @@ function BlockSelectionButton(_ref) {
|
|
26375 |
onClick: () => setNavigationMode(false),
|
26376 |
onKeyDown: onKeyDown,
|
26377 |
label: label,
|
|
|
26378 |
className: "block-selection-button_select-button"
|
26379 |
}, (0,external_wp_element_namespaceObject.createElement)(BlockTitle, {
|
26380 |
clientId: clientId,
|
@@ -29632,15 +29949,20 @@ function BlockGroupToolbar() {
|
|
29632 |
replaceBlocks
|
29633 |
} = (0,external_wp_data_namespaceObject.useDispatch)(store);
|
29634 |
const {
|
29635 |
-
canRemove
|
|
|
29636 |
} = (0,external_wp_data_namespaceObject.useSelect)(select => {
|
29637 |
const {
|
29638 |
canRemoveBlocks
|
29639 |
} = select(store);
|
|
|
|
|
|
|
29640 |
return {
|
29641 |
-
canRemove: canRemoveBlocks(clientIds)
|
|
|
29642 |
};
|
29643 |
-
}, [clientIds]);
|
29644 |
|
29645 |
const onConvertToGroup = function () {
|
29646 |
let layout = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'group';
|
@@ -29666,15 +29988,27 @@ function BlockGroupToolbar() {
|
|
29666 |
return null;
|
29667 |
}
|
29668 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
29669 |
return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarGroup, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, {
|
29670 |
icon: library_group,
|
29671 |
label: (0,external_wp_i18n_namespaceObject._x)('Group', 'verb'),
|
29672 |
onClick: onConvertToGroup
|
29673 |
-
}), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, {
|
29674 |
icon: library_row,
|
29675 |
label: (0,external_wp_i18n_namespaceObject._x)('Row', 'single horizontal line'),
|
29676 |
onClick: onConvertToRow
|
29677 |
-
}), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, {
|
29678 |
icon: library_stack,
|
29679 |
label: (0,external_wp_i18n_namespaceObject._x)('Stack', 'verb'),
|
29680 |
onClick: onConvertToStack
|
@@ -31101,6 +31435,29 @@ function Root(_ref) {
|
|
31101 |
isNavigationMode: _isNavigationMode()
|
31102 |
};
|
31103 |
}, []);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
31104 |
const innerBlocksProps = useInnerBlocksProps({
|
31105 |
ref: (0,external_wp_compose_namespaceObject.useMergeRefs)([useBlockSelectionClearer(), useInBetweenInserter(), setElement]),
|
31106 |
className: classnames_default()('is-root-container', className, {
|
@@ -31111,7 +31468,9 @@ function Root(_ref) {
|
|
31111 |
}, settings);
|
31112 |
return (0,external_wp_element_namespaceObject.createElement)(elementContext.Provider, {
|
31113 |
value: element
|
31114 |
-
}, (0,external_wp_element_namespaceObject.createElement)(
|
|
|
|
|
31115 |
}
|
31116 |
|
31117 |
function BlockList(settings) {
|
@@ -31130,56 +31489,33 @@ function Items(_ref2) {
|
|
31130 |
__experimentalAppenderTagName,
|
31131 |
__experimentalLayout: layout = defaultLayout
|
31132 |
} = _ref2;
|
31133 |
-
const [intersectingBlocks, setIntersectingBlocks] = (0,external_wp_element_namespaceObject.useState)(new Set());
|
31134 |
-
const intersectionObserver = (0,external_wp_element_namespaceObject.useMemo)(() => {
|
31135 |
-
const {
|
31136 |
-
IntersectionObserver: Observer
|
31137 |
-
} = window;
|
31138 |
-
|
31139 |
-
if (!Observer) {
|
31140 |
-
return;
|
31141 |
-
}
|
31142 |
-
|
31143 |
-
return new Observer(entries => {
|
31144 |
-
setIntersectingBlocks(oldIntersectingBlocks => {
|
31145 |
-
const newIntersectingBlocks = new Set(oldIntersectingBlocks);
|
31146 |
-
|
31147 |
-
for (const entry of entries) {
|
31148 |
-
const clientId = entry.target.getAttribute('data-block');
|
31149 |
-
const action = entry.isIntersecting ? 'add' : 'delete';
|
31150 |
-
newIntersectingBlocks[action](clientId);
|
31151 |
-
}
|
31152 |
-
|
31153 |
-
return newIntersectingBlocks;
|
31154 |
-
});
|
31155 |
-
});
|
31156 |
-
}, [setIntersectingBlocks]);
|
31157 |
const {
|
31158 |
order,
|
31159 |
-
selectedBlocks
|
|
|
31160 |
} = (0,external_wp_data_namespaceObject.useSelect)(select => {
|
31161 |
const {
|
31162 |
getBlockOrder,
|
31163 |
-
getSelectedBlockClientIds
|
|
|
31164 |
} = select(store);
|
31165 |
return {
|
31166 |
order: getBlockOrder(rootClientId),
|
31167 |
-
selectedBlocks: getSelectedBlockClientIds()
|
|
|
31168 |
};
|
31169 |
}, [rootClientId]);
|
31170 |
return (0,external_wp_element_namespaceObject.createElement)(LayoutProvider, {
|
31171 |
value: layout
|
31172 |
-
}, (0,external_wp_element_namespaceObject.createElement)(IntersectionObserver.Provider, {
|
31173 |
-
value: intersectionObserver
|
31174 |
}, order.map(clientId => (0,external_wp_element_namespaceObject.createElement)(external_wp_data_namespaceObject.AsyncModeProvider, {
|
31175 |
key: clientId,
|
31176 |
value: // Only provide data asynchronously if the block is
|
31177 |
// not visible and not selected.
|
31178 |
-
!
|
31179 |
}, (0,external_wp_element_namespaceObject.createElement)(block, {
|
31180 |
rootClientId: rootClientId,
|
31181 |
clientId: clientId
|
31182 |
-
})))
|
31183 |
tagName: __experimentalAppenderTagName,
|
31184 |
rootClientId: rootClientId,
|
31185 |
renderAppender: renderAppender
|
@@ -32620,57 +32956,46 @@ function ColorGradientControl(props) {
|
|
32620 |
* Internal dependencies
|
32621 |
*/
|
32622 |
|
32623 |
-
//
|
32624 |
-
// `ItemGroup` allowing for a standalone group of controls to be
|
32625 |
-
// rendered semantically.
|
32626 |
-
|
32627 |
-
const WithItemGroup = _ref => {
|
32628 |
-
let {
|
32629 |
-
__experimentalIsItemGroup,
|
32630 |
-
children
|
32631 |
-
} = _ref;
|
32632 |
-
|
32633 |
-
if (!__experimentalIsItemGroup) {
|
32634 |
-
return children;
|
32635 |
-
}
|
32636 |
-
|
32637 |
-
return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalItemGroup, {
|
32638 |
-
isBordered: true,
|
32639 |
-
isSeparated: true,
|
32640 |
-
className: "block-editor-panel-color-gradient-settings__item-group"
|
32641 |
-
}, children);
|
32642 |
-
}; // When the `ColorGradientSettingsDropdown` controls are being rendered to a
|
32643 |
// `ToolsPanel` they must be wrapped in a `ToolsPanelItem`.
|
32644 |
|
32645 |
-
|
32646 |
-
const WithToolsPanelItem = _ref2 => {
|
32647 |
let {
|
32648 |
-
|
32649 |
-
settings,
|
32650 |
children,
|
|
|
32651 |
...props
|
32652 |
-
} =
|
32653 |
|
32654 |
-
|
32655 |
-
|
32656 |
-
|
|
|
|
|
|
|
|
|
32657 |
|
32658 |
return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, _extends({
|
32659 |
-
hasValue:
|
32660 |
-
|
32661 |
-
|
32662 |
-
|
32663 |
-
|
|
|
32664 |
}, props, {
|
32665 |
-
className: "block-editor-tools-panel-color-gradient-settings__item"
|
|
|
|
|
|
|
|
|
32666 |
}), children);
|
32667 |
};
|
32668 |
|
32669 |
-
const LabeledColorIndicator =
|
32670 |
let {
|
32671 |
colorValue,
|
32672 |
label
|
32673 |
-
} =
|
32674 |
return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalHStack, {
|
32675 |
justify: "flex-start"
|
32676 |
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ColorIndicator, {
|
@@ -32682,27 +33007,23 @@ const LabeledColorIndicator = _ref3 => {
|
|
32682 |
// a `ToolsPanel`.
|
32683 |
|
32684 |
|
32685 |
-
const renderToggle = settings =>
|
32686 |
let {
|
32687 |
onToggle,
|
32688 |
isOpen
|
32689 |
-
} =
|
32690 |
const {
|
32691 |
-
__experimentalIsItemGroup,
|
32692 |
colorValue,
|
32693 |
label
|
32694 |
-
} = settings;
|
32695 |
-
|
32696 |
-
const ToggleComponent = __experimentalIsItemGroup ? external_wp_components_namespaceObject.__experimentalItem : external_wp_components_namespaceObject.Button;
|
32697 |
-
const toggleClassName = __experimentalIsItemGroup ? 'block-editor-panel-color-gradient-settings__item' : 'block-editor-panel-color-gradient-settings__dropdown';
|
32698 |
const toggleProps = {
|
32699 |
onClick: onToggle,
|
32700 |
-
className: classnames_default()(
|
32701 |
'is-open': isOpen
|
32702 |
}),
|
32703 |
-
'aria-expanded':
|
32704 |
};
|
32705 |
-
return (0,external_wp_element_namespaceObject.createElement)(
|
32706 |
colorValue: colorValue,
|
32707 |
label: label
|
32708 |
}));
|
@@ -32715,20 +33036,18 @@ const renderToggle = settings => _ref4 => {
|
|
32715 |
// For more context see: https://github.com/WordPress/gutenberg/pull/40084
|
32716 |
|
32717 |
|
32718 |
-
function ColorGradientSettingsDropdown(
|
32719 |
let {
|
32720 |
colors,
|
32721 |
disableCustomColors,
|
32722 |
disableCustomGradients,
|
32723 |
enableAlpha,
|
32724 |
gradients,
|
32725 |
-
__experimentalIsItemGroup = true,
|
32726 |
settings,
|
32727 |
__experimentalHasMultipleOrigins,
|
32728 |
__experimentalIsRenderedInSidebar,
|
32729 |
...props
|
32730 |
-
} =
|
32731 |
-
const dropdownClassName = __experimentalIsItemGroup ? 'block-editor-panel-color-gradient-settings__dropdown' : 'block-editor-tools-panel-color-gradient-settings__dropdown';
|
32732 |
let popoverProps;
|
32733 |
|
32734 |
if (__experimentalIsRenderedInSidebar) {
|
@@ -32738,50 +33057,43 @@ function ColorGradientSettingsDropdown(_ref5) {
|
|
32738 |
};
|
32739 |
}
|
32740 |
|
32741 |
-
return (
|
32742 |
-
|
32743 |
-
(0,external_wp_element_namespaceObject.createElement)(WithItemGroup, {
|
32744 |
-
__experimentalIsItemGroup: __experimentalIsItemGroup
|
32745 |
-
}, settings.map((setting, index) => {
|
32746 |
-
var _setting$gradientValu;
|
32747 |
|
32748 |
-
|
32749 |
-
|
32750 |
-
|
32751 |
-
|
32752 |
-
|
32753 |
-
|
32754 |
-
|
32755 |
-
|
32756 |
-
|
32757 |
-
|
32758 |
-
|
32759 |
-
|
32760 |
-
|
32761 |
-
|
32762 |
-
|
32763 |
-
|
32764 |
-
|
32765 |
-
|
32766 |
-
|
32767 |
-
|
32768 |
-
|
32769 |
-
|
32770 |
-
|
32771 |
-
|
32772 |
-
|
32773 |
-
|
32774 |
-
|
32775 |
-
|
32776 |
-
|
32777 |
-
|
32778 |
-
|
32779 |
-
|
32780 |
-
|
32781 |
-
|
32782 |
-
}));
|
32783 |
-
}))
|
32784 |
-
);
|
32785 |
}
|
32786 |
|
32787 |
;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/contrast-checker/index.js
|
@@ -33038,33 +33350,6 @@ const hasTextColorSupport = blockType => {
|
|
33038 |
const colorSupport = (0,external_wp_blocks_namespaceObject.getBlockSupport)(blockType, COLOR_SUPPORT_KEY);
|
33039 |
return colorSupport && colorSupport.text !== false;
|
33040 |
};
|
33041 |
-
/**
|
33042 |
-
* Checks whether a color has been set either with a named preset color in
|
33043 |
-
* a top level block attribute or as a custom value within the style attribute
|
33044 |
-
* object.
|
33045 |
-
*
|
33046 |
-
* @param {string} name Name of the color to check.
|
33047 |
-
* @return {boolean} Whether or not a color has a value.
|
33048 |
-
*/
|
33049 |
-
|
33050 |
-
|
33051 |
-
const hasColor = name => props => {
|
33052 |
-
var _props$attributes$sty9, _props$attributes$sty10;
|
33053 |
-
|
33054 |
-
if (name === 'background') {
|
33055 |
-
var _props$attributes$sty, _props$attributes$sty2, _props$attributes$sty3, _props$attributes$sty4;
|
33056 |
-
|
33057 |
-
return !!props.attributes.backgroundColor || !!((_props$attributes$sty = props.attributes.style) !== null && _props$attributes$sty !== void 0 && (_props$attributes$sty2 = _props$attributes$sty.color) !== null && _props$attributes$sty2 !== void 0 && _props$attributes$sty2.background) || !!props.attributes.gradient || !!((_props$attributes$sty3 = props.attributes.style) !== null && _props$attributes$sty3 !== void 0 && (_props$attributes$sty4 = _props$attributes$sty3.color) !== null && _props$attributes$sty4 !== void 0 && _props$attributes$sty4.gradient);
|
33058 |
-
}
|
33059 |
-
|
33060 |
-
if (name === 'link') {
|
33061 |
-
var _props$attributes$sty5, _props$attributes$sty6, _props$attributes$sty7, _props$attributes$sty8;
|
33062 |
-
|
33063 |
-
return !!((_props$attributes$sty5 = props.attributes.style) !== null && _props$attributes$sty5 !== void 0 && (_props$attributes$sty6 = _props$attributes$sty5.elements) !== null && _props$attributes$sty6 !== void 0 && (_props$attributes$sty7 = _props$attributes$sty6.link) !== null && _props$attributes$sty7 !== void 0 && (_props$attributes$sty8 = _props$attributes$sty7.color) !== null && _props$attributes$sty8 !== void 0 && _props$attributes$sty8.text);
|
33064 |
-
}
|
33065 |
-
|
33066 |
-
return !!props.attributes[`${name}Color`] || !!((_props$attributes$sty9 = props.attributes.style) !== null && _props$attributes$sty9 !== void 0 && (_props$attributes$sty10 = _props$attributes$sty9.color) !== null && _props$attributes$sty10 !== void 0 && _props$attributes$sty10[name]);
|
33067 |
-
};
|
33068 |
/**
|
33069 |
* Clears a single color property from a style object.
|
33070 |
*
|
@@ -33075,25 +33360,6 @@ const hasColor = name => props => {
|
|
33075 |
|
33076 |
|
33077 |
const clearColorFromStyles = (path, style) => cleanEmptyObject(immutableSet(style, path, undefined));
|
33078 |
-
/**
|
33079 |
-
* Resets the block attributes for text color.
|
33080 |
-
*
|
33081 |
-
* @param {Object} props Current block props.
|
33082 |
-
* @param {Object} props.attributes Block attributes.
|
33083 |
-
* @param {Function} props.setAttributes Block's setAttributes prop used to apply reset.
|
33084 |
-
*/
|
33085 |
-
|
33086 |
-
|
33087 |
-
const resetTextColor = _ref => {
|
33088 |
-
let {
|
33089 |
-
attributes,
|
33090 |
-
setAttributes
|
33091 |
-
} = _ref;
|
33092 |
-
setAttributes({
|
33093 |
-
textColor: undefined,
|
33094 |
-
style: clearColorFromStyles(['color', 'text'], attributes.style)
|
33095 |
-
});
|
33096 |
-
};
|
33097 |
/**
|
33098 |
* Clears text color related properties from supplied attributes.
|
33099 |
*
|
@@ -33106,25 +33372,6 @@ const resetAllTextFilter = attributes => ({
|
|
33106 |
textColor: undefined,
|
33107 |
style: clearColorFromStyles(['color', 'text'], attributes.style)
|
33108 |
});
|
33109 |
-
/**
|
33110 |
-
* Resets the block attributes for link color.
|
33111 |
-
*
|
33112 |
-
* @param {Object} props Current block props.
|
33113 |
-
* @param {Object} props.attributes Block attributes.
|
33114 |
-
* @param {Function} props.setAttributes Block's setAttributes prop used to apply reset.
|
33115 |
-
*/
|
33116 |
-
|
33117 |
-
|
33118 |
-
const resetLinkColor = _ref2 => {
|
33119 |
-
let {
|
33120 |
-
attributes,
|
33121 |
-
setAttributes
|
33122 |
-
} = _ref2;
|
33123 |
-
const path = ['elements', 'link', 'color', 'text'];
|
33124 |
-
setAttributes({
|
33125 |
-
style: clearColorFromStyles(path, attributes.style)
|
33126 |
-
});
|
33127 |
-
};
|
33128 |
/**
|
33129 |
* Clears link color related properties from supplied attributes.
|
33130 |
*
|
@@ -33159,22 +33406,6 @@ const clearBackgroundAndGradient = attributes => {
|
|
33159 |
}
|
33160 |
};
|
33161 |
};
|
33162 |
-
/**
|
33163 |
-
* Resets the block attributes for both background color and gradient.
|
33164 |
-
*
|
33165 |
-
* @param {Object} props Current block props.
|
33166 |
-
* @param {Object} props.attributes Block attributes.
|
33167 |
-
* @param {Function} props.setAttributes Block's setAttributes prop used to apply reset.
|
33168 |
-
*/
|
33169 |
-
|
33170 |
-
|
33171 |
-
const resetBackgroundAndGradient = _ref3 => {
|
33172 |
-
let {
|
33173 |
-
attributes,
|
33174 |
-
setAttributes
|
33175 |
-
} = _ref3;
|
33176 |
-
setAttributes(clearBackgroundAndGradient(attributes));
|
33177 |
-
};
|
33178 |
/**
|
33179 |
* Filters registered block settings, extending attributes to include
|
33180 |
* `backgroundColor` and `textColor` attribute.
|
@@ -33432,12 +33663,19 @@ function ColorEdit(props) {
|
|
33432 |
};
|
33433 |
|
33434 |
const onChangeLinkColor = value => {
|
|
|
|
|
33435 |
const colorObject = getColorObjectByColorValue(allSolids, value);
|
33436 |
const newLinkColorValue = colorObject !== null && colorObject !== void 0 && colorObject.slug ? `var:preset|color|${colorObject.slug}` : value;
|
33437 |
-
const newStyle = cleanEmptyObject(immutableSet(style, ['elements', 'link', 'color', 'text'], newLinkColorValue));
|
33438 |
props.setAttributes({
|
33439 |
style: newStyle
|
33440 |
});
|
|
|
|
|
|
|
|
|
|
|
33441 |
};
|
33442 |
|
33443 |
const enableContrastChecking = external_wp_element_namespaceObject.Platform.OS === 'web' && !gradient && !(style !== null && style !== void 0 && (_style$color6 = style.color) !== null && _style$color6 !== void 0 && _style$color6.gradient);
|
@@ -33451,8 +33689,6 @@ function ColorEdit(props) {
|
|
33451 |
onColorChange: onChangeColor('text'),
|
33452 |
colorValue: getColorObjectByAttributeValues(allSolids, textColor, style === null || style === void 0 ? void 0 : (_style$color7 = style.color) === null || _style$color7 === void 0 ? void 0 : _style$color7.text).color,
|
33453 |
isShownByDefault: defaultColorControls === null || defaultColorControls === void 0 ? void 0 : defaultColorControls.text,
|
33454 |
-
hasValue: () => hasColor('text')(props),
|
33455 |
-
onDeselect: () => resetTextColor(props),
|
33456 |
resetAllFilter: resetAllTextFilter
|
33457 |
}] : []), ...(hasBackgroundColor || hasGradientColor ? [{
|
33458 |
label: (0,external_wp_i18n_namespaceObject.__)('Background'),
|
@@ -33461,8 +33697,6 @@ function ColorEdit(props) {
|
|
33461 |
gradientValue,
|
33462 |
onGradientChange: hasGradientColor ? onChangeGradient : undefined,
|
33463 |
isShownByDefault: defaultColorControls === null || defaultColorControls === void 0 ? void 0 : defaultColorControls.background,
|
33464 |
-
hasValue: () => hasColor('background')(props),
|
33465 |
-
onDeselect: () => resetBackgroundAndGradient(props),
|
33466 |
resetAllFilter: clearBackgroundAndGradient
|
33467 |
}] : []), ...(hasLinkColor ? [{
|
33468 |
label: (0,external_wp_i18n_namespaceObject.__)('Link'),
|
@@ -33470,8 +33704,6 @@ function ColorEdit(props) {
|
|
33470 |
colorValue: getLinkColorFromAttributeValue(allSolids, style === null || style === void 0 ? void 0 : (_style$elements2 = style.elements) === null || _style$elements2 === void 0 ? void 0 : (_style$elements2$link = _style$elements2.link) === null || _style$elements2$link === void 0 ? void 0 : (_style$elements2$link2 = _style$elements2$link.color) === null || _style$elements2$link2 === void 0 ? void 0 : _style$elements2$link2.text),
|
33471 |
clearable: !!(style !== null && style !== void 0 && (_style$elements3 = style.elements) !== null && _style$elements3 !== void 0 && (_style$elements3$link = _style$elements3.link) !== null && _style$elements3$link !== void 0 && (_style$elements3$link2 = _style$elements3$link.color) !== null && _style$elements3$link2 !== void 0 && _style$elements3$link2.text),
|
33472 |
isShownByDefault: defaultColorControls === null || defaultColorControls === void 0 ? void 0 : defaultColorControls.link,
|
33473 |
-
hasValue: () => hasColor('link')(props),
|
33474 |
-
onDeselect: () => resetLinkColor(props),
|
33475 |
resetAllFilter: resetAllLinkFilter
|
33476 |
}] : [])]
|
33477 |
});
|
@@ -39964,6 +40196,7 @@ const BlockPatternSetup = _ref4 => {
|
|
39964 |
|
39965 |
|
39966 |
|
|
|
39967 |
function VariationsButtons(_ref) {
|
39968 |
let {
|
39969 |
className,
|
@@ -39977,7 +40210,10 @@ function VariationsButtons(_ref) {
|
|
39977 |
as: "legend"
|
39978 |
}, (0,external_wp_i18n_namespaceObject.__)('Transform to variation')), variations.map(variation => (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
|
39979 |
key: variation.name,
|
39980 |
-
icon:
|
|
|
|
|
|
|
39981 |
isPressed: selectedValue === variation.name,
|
39982 |
label: selectedValue === variation.name ? variation.title : (0,external_wp_i18n_namespaceObject.sprintf)(
|
39983 |
/* translators: %s: Name of the block variation */
|
@@ -40057,9 +40293,16 @@ function __experimentalBlockVariationTransforms(_ref4) {
|
|
40057 |
|
40058 |
const hasUniqueIcons = (0,external_wp_element_namespaceObject.useMemo)(() => {
|
40059 |
const variationIcons = new Set();
|
|
|
|
|
|
|
|
|
|
|
40060 |
variations.forEach(variation => {
|
40061 |
if (variation.icon) {
|
40062 |
-
|
|
|
|
|
40063 |
}
|
40064 |
});
|
40065 |
return variationIcons.size === variations.length;
|
@@ -40296,6 +40539,7 @@ function NonDefaultControls(_ref2) {
|
|
40296 |
|
40297 |
|
40298 |
|
|
|
40299 |
/**
|
40300 |
* Internal dependencies
|
40301 |
*/
|
@@ -40304,55 +40548,8 @@ function NonDefaultControls(_ref2) {
|
|
40304 |
|
40305 |
|
40306 |
|
40307 |
-
|
40308 |
-
// translators: first %s: The type of color or gradient (e.g. background, overlay...), second %s: the color name or value (e.g. red or #ff0000)
|
40309 |
-
|
40310 |
-
const colorIndicatorAriaLabel = (0,external_wp_i18n_namespaceObject.__)('(%s: color %s)'); // translators: first %s: The type of color or gradient (e.g. background, overlay...), second %s: the color name or value (e.g. red or #ff0000)
|
40311 |
-
|
40312 |
-
|
40313 |
-
const gradientIndicatorAriaLabel = (0,external_wp_i18n_namespaceObject.__)('(%s: gradient %s)');
|
40314 |
-
|
40315 |
const panel_color_gradient_settings_colorsAndGradientKeys = ['colors', 'disableCustomColors', 'gradients', 'disableCustomGradients'];
|
40316 |
-
|
40317 |
-
const Indicators = _ref => {
|
40318 |
-
let {
|
40319 |
-
colors,
|
40320 |
-
gradients,
|
40321 |
-
settings
|
40322 |
-
} = _ref;
|
40323 |
-
return settings.map((_ref2, index) => {
|
40324 |
-
let {
|
40325 |
-
colorValue,
|
40326 |
-
gradientValue,
|
40327 |
-
label,
|
40328 |
-
colors: availableColors,
|
40329 |
-
gradients: availableGradients
|
40330 |
-
} = _ref2;
|
40331 |
-
|
40332 |
-
if (!colorValue && !gradientValue) {
|
40333 |
-
return null;
|
40334 |
-
}
|
40335 |
-
|
40336 |
-
let ariaLabel;
|
40337 |
-
|
40338 |
-
if (colorValue) {
|
40339 |
-
const colorObject = getColorObjectByColorValue(availableColors || colors, colorValue);
|
40340 |
-
ariaLabel = (0,external_wp_i18n_namespaceObject.sprintf)(colorIndicatorAriaLabel, label.toLowerCase(), colorObject && colorObject.name || colorValue);
|
40341 |
-
} else {
|
40342 |
-
const gradientObject = __experimentalGetGradientObjectByGradientValue(availableGradients || gradients, colorValue);
|
40343 |
-
|
40344 |
-
ariaLabel = (0,external_wp_i18n_namespaceObject.sprintf)(gradientIndicatorAriaLabel, label.toLowerCase(), gradientObject && gradientObject.name || gradientValue);
|
40345 |
-
}
|
40346 |
-
|
40347 |
-
return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ColorIndicator, {
|
40348 |
-
key: index,
|
40349 |
-
colorValue: colorValue || gradientValue,
|
40350 |
-
"aria-label": ariaLabel
|
40351 |
-
});
|
40352 |
-
});
|
40353 |
-
};
|
40354 |
-
|
40355 |
-
const PanelColorGradientSettingsInner = _ref3 => {
|
40356 |
let {
|
40357 |
className,
|
40358 |
colors,
|
@@ -40365,26 +40562,44 @@ const PanelColorGradientSettingsInner = _ref3 => {
|
|
40365 |
showTitle = true,
|
40366 |
__experimentalHasMultipleOrigins,
|
40367 |
__experimentalIsRenderedInSidebar,
|
40368 |
-
enableAlpha
|
40369 |
-
|
40370 |
-
|
|
|
|
|
|
|
40371 |
|
40372 |
if ((0,external_lodash_namespaceObject.isEmpty)(colors) && (0,external_lodash_namespaceObject.isEmpty)(gradients) && disableCustomColors && disableCustomGradients && (0,external_lodash_namespaceObject.every)(settings, setting => (0,external_lodash_namespaceObject.isEmpty)(setting.colors) && (0,external_lodash_namespaceObject.isEmpty)(setting.gradients) && (setting.disableCustomColors === undefined || setting.disableCustomColors) && (setting.disableCustomGradients === undefined || setting.disableCustomGradients))) {
|
40373 |
return null;
|
40374 |
}
|
40375 |
|
40376 |
-
|
40377 |
-
className: "block-editor-panel-color-gradient-settings__panel-title"
|
40378 |
-
}, title, (0,external_wp_element_namespaceObject.createElement)(Indicators, {
|
40379 |
-
colors: colors,
|
40380 |
-
gradients: gradients,
|
40381 |
-
settings: settings
|
40382 |
-
}));
|
40383 |
-
return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, _extends({
|
40384 |
className: classnames_default()('block-editor-panel-color-gradient-settings', className),
|
40385 |
-
|
40386 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
40387 |
settings: settings,
|
|
|
40388 |
colors,
|
40389 |
gradients,
|
40390 |
disableCustomColors,
|
@@ -44057,7 +44272,6 @@ const MediaReplaceFlow = _ref => {
|
|
44057 |
onSelect,
|
44058 |
onSelectURL,
|
44059 |
onFilesUpload = external_lodash_namespaceObject.noop,
|
44060 |
-
onCloseModal = external_lodash_namespaceObject.noop,
|
44061 |
name = (0,external_wp_i18n_namespaceObject.__)('Replace'),
|
44062 |
createNotice,
|
44063 |
removeNotice,
|
@@ -44173,7 +44387,6 @@ const MediaReplaceFlow = _ref => {
|
|
44173 |
value: multiple ? mediaIds : mediaId,
|
44174 |
onSelect: media => selectMedia(media, onClose),
|
44175 |
allowedTypes: allowedTypes,
|
44176 |
-
onClose: onCloseModal,
|
44177 |
render: _ref5 => {
|
44178 |
let {
|
44179 |
open
|
@@ -44494,7 +44707,6 @@ function MediaPlaceholder(_ref2) {
|
|
44494 |
onDoubleClick,
|
44495 |
onFilesPreUpload = external_lodash_namespaceObject.noop,
|
44496 |
onHTMLDrop = external_lodash_namespaceObject.noop,
|
44497 |
-
onClose = external_lodash_namespaceObject.noop,
|
44498 |
children,
|
44499 |
mediaLibraryButton,
|
44500 |
placeholder,
|
@@ -44734,7 +44946,6 @@ function MediaPlaceholder(_ref2) {
|
|
44734 |
gallery: multiple && onlyAllowsImages(),
|
44735 |
multiple: multiple,
|
44736 |
onSelect: onSelect,
|
44737 |
-
onClose: onClose,
|
44738 |
allowedTypes: allowedTypes,
|
44739 |
value: Array.isArray(value) ? value.map(_ref7 => {
|
44740 |
let {
|
@@ -46123,7 +46334,7 @@ const inputEventContext = (0,external_wp_element_namespaceObject.createContext)(
|
|
46123 |
*/
|
46124 |
|
46125 |
function removeNativeProps(props) {
|
46126 |
-
return (0,external_lodash_namespaceObject.omit)(props, ['__unstableMobileNoFocusOnMount', 'deleteEnter', 'placeholderTextColor', 'textAlign', 'selectionColor', 'tagsToEliminate', 'rootTagsToEliminate', 'disableEditingMenu', 'fontSize', 'fontFamily', 'fontWeight', 'fontStyle', 'minWidth', 'maxWidth', 'setRef']);
|
46127 |
}
|
46128 |
|
46129 |
function RichTextWrapper(_ref, forwardedRef) {
|
@@ -48580,6 +48791,64 @@ function useNoRecursiveRenders(uniqueId) {
|
|
48580 |
return [hasAlreadyRendered, Provider];
|
48581 |
}
|
48582 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
48583 |
;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/index.js
|
48584 |
/*
|
48585 |
* Block Creation Components
|
@@ -48668,6 +48937,7 @@ function useNoRecursiveRenders(uniqueId) {
|
|
48668 |
|
48669 |
|
48670 |
|
|
|
48671 |
|
48672 |
|
48673 |
|
@@ -48692,6 +48962,9 @@ function useNoRecursiveRenders(uniqueId) {
|
|
48692 |
|
48693 |
|
48694 |
|
|
|
|
|
|
|
48695 |
;// CONCATENATED MODULE: ./packages/block-editor/build-module/utils/block-variation-transforms.js
|
48696 |
/**
|
48697 |
* External dependencies
|
@@ -49030,6 +49303,7 @@ function hashOptions(options) {
|
|
49030 |
|
49031 |
|
49032 |
|
|
|
49033 |
}();
|
49034 |
(window.wp = window.wp || {}).blockEditor = __webpack_exports__;
|
49035 |
/******/ })()
|
2214 |
"__experimentalColorGradientSettingsDropdown": function() { return /* reexport */ ColorGradientSettingsDropdown; },
|
2215 |
"__experimentalDateFormatPicker": function() { return /* reexport */ DateFormatPicker; },
|
2216 |
"__experimentalDuotoneControl": function() { return /* reexport */ duotone_control; },
|
2217 |
+
"__experimentalElementButtonClassName": function() { return /* reexport */ __experimentalElementButtonClassName; },
|
2218 |
"__experimentalFontAppearanceControl": function() { return /* reexport */ FontAppearanceControl; },
|
2219 |
"__experimentalFontFamilyControl": function() { return /* reexport */ FontFamilyControl; },
|
2220 |
"__experimentalGetBorderClassesAndStyles": function() { return /* reexport */ getBorderClassesAndStyles; },
|
2237 |
"__experimentalListView": function() { return /* reexport */ components_list_view; },
|
2238 |
"__experimentalPanelColorGradientSettings": function() { return /* reexport */ panel_color_gradient_settings; },
|
2239 |
"__experimentalPreviewOptions": function() { return /* reexport */ PreviewOptions; },
|
2240 |
+
"__experimentalPublishDateTimePicker": function() { return /* reexport */ publish_date_time_picker; },
|
2241 |
"__experimentalResponsiveBlockControl": function() { return /* reexport */ responsive_block_control; },
|
2242 |
"__experimentalTextDecorationControl": function() { return /* reexport */ TextDecorationControl; },
|
2243 |
"__experimentalTextTransformControl": function() { return /* reexport */ TextTransformControl; },
|
2306 |
"__unstableGetClientIdWithClientIdsTree": function() { return __unstableGetClientIdWithClientIdsTree; },
|
2307 |
"__unstableGetClientIdsTree": function() { return __unstableGetClientIdsTree; },
|
2308 |
"__unstableGetSelectedBlocksWithPartialSelection": function() { return __unstableGetSelectedBlocksWithPartialSelection; },
|
2309 |
+
"__unstableGetVisibleBlocks": function() { return __unstableGetVisibleBlocks; },
|
2310 |
"__unstableIsFullySelected": function() { return __unstableIsFullySelected; },
|
2311 |
"__unstableIsLastBlockChangeIgnored": function() { return __unstableIsLastBlockChangeIgnored; },
|
2312 |
"__unstableIsSelectionCollapsed": function() { return __unstableIsSelectionCollapsed; },
|
2377 |
"isBlockMultiSelected": function() { return isBlockMultiSelected; },
|
2378 |
"isBlockSelected": function() { return isBlockSelected; },
|
2379 |
"isBlockValid": function() { return isBlockValid; },
|
2380 |
+
"isBlockVisible": function() { return isBlockVisible; },
|
2381 |
"isBlockWithinSelection": function() { return isBlockWithinSelection; },
|
2382 |
"isCaretWithinFormattedText": function() { return isCaretWithinFormattedText; },
|
2383 |
"isDraggingBlocks": function() { return isDraggingBlocks; },
|
2432 |
"selectPreviousBlock": function() { return selectPreviousBlock; },
|
2433 |
"selectionChange": function() { return selectionChange; },
|
2434 |
"setBlockMovingClientId": function() { return setBlockMovingClientId; },
|
2435 |
+
"setBlockVisibility": function() { return setBlockVisibility; },
|
2436 |
"setHasControlledInnerBlocks": function() { return setHasControlledInnerBlocks; },
|
2437 |
"setNavigationMode": function() { return setNavigationMode; },
|
2438 |
"setTemplateValidity": function() { return setTemplateValidity; },
|
3284 |
attributes: getFlattenedBlockAttributes(action.blocks),
|
3285 |
order: mapBlockOrder(action.blocks),
|
3286 |
parents: mapBlockParents(action.blocks),
|
3287 |
+
controlledInnerBlocks: {},
|
3288 |
+
visibility: {}
|
3289 |
};
|
3290 |
const subTree = buildBlockTree(newState, action.blocks);
|
3291 |
newState.tree = { ...subTree,
|
3752 |
};
|
3753 |
}
|
3754 |
|
3755 |
+
return state;
|
3756 |
+
},
|
3757 |
+
|
3758 |
+
visibility() {
|
3759 |
+
let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
3760 |
+
let action = arguments.length > 1 ? arguments[1] : undefined;
|
3761 |
+
|
3762 |
+
if (action.type === 'SET_BLOCK_VISIBILITY') {
|
3763 |
+
return { ...state,
|
3764 |
+
...action.updates
|
3765 |
+
};
|
3766 |
+
}
|
3767 |
+
|
3768 |
return state;
|
3769 |
}
|
3770 |
|
4357 |
|
4358 |
return;
|
4359 |
// Undoing an automatic change should still be possible after mouse
|
4360 |
+
// move or after visibility change.
|
4361 |
|
4362 |
+
case 'SET_BLOCK_VISIBILITY':
|
4363 |
case 'START_TYPING':
|
4364 |
case 'STOP_TYPING':
|
4365 |
return state;
|
4459 |
;// CONCATENATED MODULE: ./node_modules/rememo/es/rememo.js
|
4460 |
|
4461 |
|
4462 |
+
/** @typedef {(...args: any[]) => *[]} GetDependants */
|
4463 |
+
|
4464 |
+
/** @typedef {() => void} Clear */
|
4465 |
|
4466 |
/**
|
4467 |
+
* @typedef {{
|
4468 |
+
* getDependants: GetDependants,
|
4469 |
+
* clear: Clear
|
4470 |
+
* }} EnhancedSelector
|
4471 |
+
*/
|
4472 |
+
|
4473 |
+
/**
|
4474 |
+
* Internal cache entry.
|
4475 |
*
|
4476 |
+
* @typedef CacheNode
|
4477 |
+
*
|
4478 |
+
* @property {?CacheNode|undefined} [prev] Previous node.
|
4479 |
+
* @property {?CacheNode|undefined} [next] Next node.
|
4480 |
+
* @property {*[]} args Function arguments for cache entry.
|
4481 |
+
* @property {*} val Function result.
|
4482 |
+
*/
|
4483 |
+
|
4484 |
+
/**
|
4485 |
+
* @typedef Cache
|
4486 |
+
*
|
4487 |
+
* @property {Clear} clear Function to clear cache.
|
4488 |
+
* @property {boolean} [isUniqueByDependants] Whether dependants are valid in
|
4489 |
+
* considering cache uniqueness. A cache is unique if dependents are all arrays
|
4490 |
+
* or objects.
|
4491 |
+
* @property {CacheNode?} [head] Cache head.
|
4492 |
+
* @property {*[]} [lastDependants] Dependants from previous invocation.
|
4493 |
*/
|
|
|
4494 |
|
4495 |
/**
|
4496 |
+
* Arbitrary value used as key for referencing cache object in WeakMap tree.
|
4497 |
*
|
4498 |
+
* @type {{}}
|
4499 |
*/
|
4500 |
+
var LEAF_KEY = {};
|
4501 |
|
4502 |
/**
|
4503 |
* Returns the first argument as the sole entry in an array.
|
4504 |
*
|
4505 |
+
* @template T
|
4506 |
*
|
4507 |
+
* @param {T} value Value to return.
|
4508 |
+
*
|
4509 |
+
* @return {[T]} Value returned as entry in array.
|
4510 |
*/
|
4511 |
+
function arrayOf(value) {
|
4512 |
+
return [value];
|
4513 |
}
|
4514 |
|
4515 |
/**
|
4520 |
*
|
4521 |
* @return {boolean} Whether value is object-like.
|
4522 |
*/
|
4523 |
+
function isObjectLike(value) {
|
4524 |
+
return !!value && 'object' === typeof value;
|
4525 |
}
|
4526 |
|
4527 |
/**
|
4528 |
* Creates and returns a new cache object.
|
4529 |
*
|
4530 |
+
* @return {Cache} Cache object.
|
4531 |
*/
|
4532 |
function createCache() {
|
4533 |
+
/** @type {Cache} */
|
4534 |
var cache = {
|
4535 |
+
clear: function () {
|
4536 |
cache.head = null;
|
4537 |
},
|
4538 |
};
|
4544 |
* Returns true if entries within the two arrays are strictly equal by
|
4545 |
* reference from a starting index.
|
4546 |
*
|
4547 |
+
* @param {*[]} a First array.
|
4548 |
+
* @param {*[]} b Second array.
|
4549 |
* @param {number} fromIndex Index from which to start comparison.
|
4550 |
*
|
4551 |
* @return {boolean} Whether arrays are shallowly equal.
|
4552 |
*/
|
4553 |
+
function isShallowEqual(a, b, fromIndex) {
|
4554 |
var i;
|
4555 |
|
4556 |
+
if (a.length !== b.length) {
|
4557 |
return false;
|
4558 |
}
|
4559 |
|
4560 |
+
for (i = fromIndex; i < a.length; i++) {
|
4561 |
+
if (a[i] !== b[i]) {
|
4562 |
return false;
|
4563 |
}
|
4564 |
}
|
4574 |
* dependant references remain the same. If getDependants returns a different
|
4575 |
* reference(s), the cache is cleared and the selector value regenerated.
|
4576 |
*
|
4577 |
+
* @template {(...args: *[]) => *} S
|
|
|
|
|
|
|
4578 |
*
|
4579 |
+
* @param {S} selector Selector function.
|
4580 |
+
* @param {GetDependants=} getDependants Dependant getter returning an array of
|
4581 |
+
* references used in cache bust consideration.
|
4582 |
*/
|
4583 |
+
/* harmony default export */ function rememo(selector, getDependants) {
|
4584 |
+
/** @type {WeakMap<*,*>} */
|
4585 |
+
var rootCache;
|
4586 |
|
4587 |
+
/** @type {GetDependants} */
|
4588 |
+
var normalizedGetDependants = getDependants ? getDependants : arrayOf;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4589 |
|
4590 |
/**
|
4591 |
* Returns the cache for a given dependants array. When possible, a WeakMap
|
4601 |
*
|
4602 |
* @see isObjectLike
|
4603 |
*
|
4604 |
+
* @param {*[]} dependants Selector dependants.
|
4605 |
*
|
4606 |
+
* @return {Cache} Cache object.
|
4607 |
*/
|
4608 |
+
function getCache(dependants) {
|
4609 |
var caches = rootCache,
|
4610 |
isUniqueByDependants = true,
|
4611 |
+
i,
|
4612 |
+
dependant,
|
4613 |
+
map,
|
4614 |
+
cache;
|
4615 |
|
4616 |
+
for (i = 0; i < dependants.length; i++) {
|
4617 |
+
dependant = dependants[i];
|
4618 |
|
4619 |
// Can only compose WeakMap from object-like key.
|
4620 |
+
if (!isObjectLike(dependant)) {
|
4621 |
isUniqueByDependants = false;
|
4622 |
break;
|
4623 |
}
|
4624 |
|
4625 |
// Does current segment of cache already have a WeakMap?
|
4626 |
+
if (caches.has(dependant)) {
|
4627 |
// Traverse into nested WeakMap.
|
4628 |
+
caches = caches.get(dependant);
|
4629 |
} else {
|
4630 |
// Create, set, and traverse into a new one.
|
4631 |
map = new WeakMap();
|
4632 |
+
caches.set(dependant, map);
|
4633 |
caches = map;
|
4634 |
}
|
4635 |
}
|
4636 |
|
4637 |
// We use an arbitrary (but consistent) object as key for the last item
|
4638 |
// in the WeakMap to serve as our running cache.
|
4639 |
+
if (!caches.has(LEAF_KEY)) {
|
4640 |
cache = createCache();
|
4641 |
cache.isUniqueByDependants = isUniqueByDependants;
|
4642 |
+
caches.set(LEAF_KEY, cache);
|
4643 |
}
|
4644 |
|
4645 |
+
return caches.get(LEAF_KEY);
|
4646 |
}
|
4647 |
|
|
|
|
|
|
|
4648 |
/**
|
4649 |
* Resets root memoization cache.
|
4650 |
*/
|
4651 |
function clear() {
|
4652 |
+
rootCache = new WeakMap();
|
4653 |
}
|
4654 |
|
4655 |
+
/* eslint-disable jsdoc/check-param-names */
|
4656 |
/**
|
4657 |
* The augmented selector call, considering first whether dependants have
|
4658 |
* changed before passing it to underlying memoize function.
|
4659 |
*
|
4660 |
+
* @param {*} source Source object for derivation.
|
4661 |
+
* @param {...*} extraArgs Additional arguments to pass to selector.
|
4662 |
*
|
4663 |
* @return {*} Selector result.
|
4664 |
*/
|
4665 |
+
/* eslint-enable jsdoc/check-param-names */
|
4666 |
+
function callSelector(/* source, ...extraArgs */) {
|
4667 |
var len = arguments.length,
|
4668 |
+
cache,
|
4669 |
+
node,
|
4670 |
+
i,
|
4671 |
+
args,
|
4672 |
+
dependants;
|
4673 |
|
4674 |
// Create copy of arguments (avoid leaking deoptimization).
|
4675 |
+
args = new Array(len);
|
4676 |
+
for (i = 0; i < len; i++) {
|
4677 |
+
args[i] = arguments[i];
|
4678 |
}
|
4679 |
|
4680 |
+
dependants = normalizedGetDependants.apply(null, args);
|
4681 |
+
cache = getCache(dependants);
|
4682 |
+
|
4683 |
+
// If not guaranteed uniqueness by dependants (primitive type), shallow
|
4684 |
+
// compare against last dependants and, if references have changed,
|
4685 |
+
// destroy cache to recalculate result.
|
4686 |
+
if (!cache.isUniqueByDependants) {
|
4687 |
+
if (
|
4688 |
+
cache.lastDependants &&
|
4689 |
+
!isShallowEqual(dependants, cache.lastDependants, 0)
|
4690 |
+
) {
|
4691 |
cache.clear();
|
4692 |
}
|
4693 |
|
4695 |
}
|
4696 |
|
4697 |
node = cache.head;
|
4698 |
+
while (node) {
|
4699 |
// Check whether node arguments match arguments
|
4700 |
+
if (!isShallowEqual(node.args, args, 1)) {
|
4701 |
node = node.next;
|
4702 |
continue;
|
4703 |
}
|
4705 |
// At this point we can assume we've found a match
|
4706 |
|
4707 |
// Surface matched node to head if not already
|
4708 |
+
if (node !== cache.head) {
|
4709 |
// Adjust siblings to point to each other.
|
4710 |
+
/** @type {CacheNode} */ (node.prev).next = node.next;
|
4711 |
+
if (node.next) {
|
4712 |
node.next.prev = node.prev;
|
4713 |
}
|
4714 |
|
4715 |
node.next = cache.head;
|
4716 |
node.prev = null;
|
4717 |
+
/** @type {CacheNode} */ (cache.head).prev = node;
|
4718 |
cache.head = node;
|
4719 |
}
|
4720 |
|
4724 |
|
4725 |
// No cached value found. Continue to insertion phase:
|
4726 |
|
4727 |
+
node = /** @type {CacheNode} */ ({
|
4728 |
// Generate the result from original function
|
4729 |
+
val: selector.apply(null, args),
|
4730 |
+
});
|
4731 |
|
4732 |
// Avoid including the source object in the cache.
|
4733 |
+
args[0] = null;
|
4734 |
node.args = args;
|
4735 |
|
4736 |
// Don't need to check whether node is already head, since it would
|
4737 |
// have been returned above already if it was
|
4738 |
|
4739 |
// Shift existing head down list
|
4740 |
+
if (cache.head) {
|
4741 |
cache.head.prev = node;
|
4742 |
node.next = cache.head;
|
4743 |
}
|
4747 |
return node.val;
|
4748 |
}
|
4749 |
|
4750 |
+
callSelector.getDependants = normalizedGetDependants;
|
4751 |
callSelector.clear = clear;
|
4752 |
clear();
|
4753 |
|
4754 |
+
return /** @type {S & EnhancedSelector} */ (callSelector);
|
4755 |
}
|
4756 |
|
4757 |
;// CONCATENATED MODULE: external ["wp","primitives"]
|
7223 |
} = state;
|
7224 |
return lastBlockInserted.clientId === clientId && lastBlockInserted.source === source;
|
7225 |
}
|
7226 |
+
/**
|
7227 |
+
* Tells if the block is visible on the canvas or not.
|
7228 |
+
*
|
7229 |
+
* @param {Object} state Global application state.
|
7230 |
+
* @param {Object} clientId Client Id of the block.
|
7231 |
+
* @return {boolean} True if the block is visible.
|
7232 |
+
*/
|
7233 |
+
|
7234 |
+
function isBlockVisible(state, clientId) {
|
7235 |
+
var _state$blocks$visibil, _state$blocks$visibil2;
|
7236 |
+
|
7237 |
+
return (_state$blocks$visibil = (_state$blocks$visibil2 = state.blocks.visibility) === null || _state$blocks$visibil2 === void 0 ? void 0 : _state$blocks$visibil2[clientId]) !== null && _state$blocks$visibil !== void 0 ? _state$blocks$visibil : true;
|
7238 |
+
}
|
7239 |
+
/**
|
7240 |
+
* Returns the list of all hidden blocks.
|
7241 |
+
*
|
7242 |
+
* @param {Object} state Global application state.
|
7243 |
+
* @return {[string]} List of hidden blocks.
|
7244 |
+
*/
|
7245 |
+
|
7246 |
+
const __unstableGetVisibleBlocks = rememo(state => {
|
7247 |
+
return new Set(Object.keys(state.blocks.visibility).filter(key => state.blocks.visibility[key]));
|
7248 |
+
}, state => [state.blocks.visibility]);
|
7249 |
|
7250 |
;// CONCATENATED MODULE: external ["wp","a11y"]
|
7251 |
var external_wp_a11y_namespaceObject = window["wp"]["a11y"];
|
8759 |
clientId
|
8760 |
};
|
8761 |
}
|
8762 |
+
/**
|
8763 |
+
* Action that sets whether given blocks are visible on the canvas.
|
8764 |
+
*
|
8765 |
+
* @param {Record<string,boolean>} updates For each block's clientId, its new visibility setting.
|
8766 |
+
*/
|
8767 |
+
|
8768 |
+
function setBlockVisibility(updates) {
|
8769 |
+
return {
|
8770 |
+
type: 'SET_BLOCK_VISIBILITY',
|
8771 |
+
updates
|
8772 |
+
};
|
8773 |
+
}
|
8774 |
|
8775 |
;// CONCATENATED MODULE: ./packages/block-editor/build-module/store/constants.js
|
8776 |
const STORE_NAME = 'core/block-editor';
|
9893 |
__unstableSlotName: __unstablePopoverSlot || null // Observe movement for block animations (especially horizontal).
|
9894 |
,
|
9895 |
__unstableObserveElement: selectedElement,
|
9896 |
+
__unstableForcePosition: true,
|
9897 |
+
__unstableShift: true
|
9898 |
}, props, {
|
9899 |
className: classnames_default()('block-editor-block-popover', props.className)
|
9900 |
}), __unstableCoverTarget && (0,external_wp_element_namespaceObject.createElement)("div", {
|
10398 |
return gapDisabled && paddingDisabled && marginDisabled;
|
10399 |
};
|
10400 |
/**
|
10401 |
+
* Custom hook to retrieve which padding/margin/blockGap is supported
|
10402 |
* e.g. top, right, bottom or left.
|
10403 |
*
|
10404 |
* Sides are opted into by default. It is only if a specific side is set to
|
10407 |
* @param {string} blockName Block name.
|
10408 |
* @param {string} feature The feature custom sides relate to e.g. padding or margins.
|
10409 |
*
|
10410 |
+
* @return {?string[]} Strings representing the custom sides available.
|
10411 |
*/
|
10412 |
|
10413 |
|
10414 |
function useCustomSides(blockName, feature) {
|
10415 |
+
var _support$feature;
|
10416 |
+
|
10417 |
const support = (0,external_wp_blocks_namespaceObject.getBlockSupport)(blockName, SPACING_SUPPORT_KEY); // Skip when setting is boolean as theme isn't setting arbitrary sides.
|
10418 |
|
10419 |
if (!support || typeof support[feature] === 'boolean') {
|
10420 |
return;
|
10421 |
+
} // Return if the setting is an array of sides (e.g. `[ 'top', 'bottom' ]`).
|
10422 |
+
|
10423 |
+
|
10424 |
+
if (Array.isArray(support[feature])) {
|
10425 |
+
return support[feature];
|
10426 |
+
} // Finally, attempt to return `.sides` if the setting is an object.
|
10427 |
|
10428 |
+
|
10429 |
+
if ((_support$feature = support[feature]) !== null && _support$feature !== void 0 && _support$feature.sides) {
|
10430 |
+
return support[feature].sides;
|
10431 |
+
}
|
10432 |
}
|
10433 |
/**
|
10434 |
* Custom hook to determine whether the sides configured in the
|
10904 |
|
10905 |
|
10906 |
|
10907 |
+
|
10908 |
/**
|
10909 |
* Internal dependencies
|
10910 |
*/
|
10996 |
orientation = 'horizontal'
|
10997 |
} = layout;
|
10998 |
const blockGapSupport = useSetting('spacing.blockGap');
|
10999 |
+
const fallbackValue = (0,external_wp_blocks_namespaceObject.getBlockSupport)(blockName, ['spacing', 'blockGap', '__experimentalDefault']) || '0.5em';
|
11000 |
const hasBlockGapStylesSupport = blockGapSupport !== null; // If a block's block.json skips serialization for spacing or spacing.blockGap,
|
11001 |
// don't apply the user-defined value to the styles.
|
11002 |
|
11003 |
+
const blockGapValue = style !== null && style !== void 0 && (_style$spacing = style.spacing) !== null && _style$spacing !== void 0 && _style$spacing.blockGap && !shouldSkipSerialization(blockName, 'spacing', 'blockGap') ? getGapCSSValue(style === null || style === void 0 ? void 0 : (_style$spacing2 = style.spacing) === null || _style$spacing2 === void 0 ? void 0 : _style$spacing2.blockGap, fallbackValue) : `var( --wp--style--block-gap, ${fallbackValue} )`;
|
11004 |
const justifyContent = justifyContentMap[layout.justifyContent] || justifyContentMap.left;
|
11005 |
const flexWrap = flexWrapOptions.includes(layout.flexWrap) ? layout.flexWrap : 'wrap';
|
11006 |
const verticalAlignment = verticalAlignmentMap[layout.verticalAlignment] || verticalAlignmentMap.center;
|
11018 |
${appendSelectors(selector)} {
|
11019 |
display: flex;
|
11020 |
flex-wrap: ${flexWrap};
|
11021 |
+
gap: ${hasBlockGapStylesSupport ? blockGapValue : fallbackValue};
|
11022 |
${orientation === 'horizontal' ? rowOrientation : columnOrientation}
|
11023 |
}
|
11024 |
|
13316 |
|
13317 |
/* harmony default export */ var block_html = (BlockHTML);
|
13318 |
|
13319 |
+
;// CONCATENATED MODULE: ./packages/block-editor/node_modules/@react-spring/rafz/dist/react-spring-rafz.esm.js
|
13320 |
let updateQueue = makeQueue();
|
13321 |
const raf = fn => schedule(fn, updateQueue);
|
13322 |
let writeQueue = makeQueue();
|
13343 |
let cancel = () => {
|
13344 |
let i = timeouts.findIndex(t => t.cancel == cancel);
|
13345 |
if (~i) timeouts.splice(i, 1);
|
13346 |
+
pendingCount -= ~i ? 1 : 0;
|
13347 |
};
|
13348 |
|
13349 |
let timeout = {
|
13352 |
cancel
|
13353 |
};
|
13354 |
timeouts.splice(findTimeout(time), 0, timeout);
|
13355 |
+
pendingCount += 1;
|
13356 |
start();
|
13357 |
return timeout;
|
13358 |
};
|
13360 |
let findTimeout = time => ~(~timeouts.findIndex(t => t.time > time) || ~timeouts.length);
|
13361 |
|
13362 |
raf.cancel = fn => {
|
13363 |
+
onStartQueue.delete(fn);
|
13364 |
+
onFrameQueue.delete(fn);
|
13365 |
updateQueue.delete(fn);
|
13366 |
writeQueue.delete(fn);
|
13367 |
+
onFinishQueue.delete(fn);
|
13368 |
};
|
13369 |
|
13370 |
raf.sync = fn => {
|
13419 |
};
|
13420 |
|
13421 |
let ts = -1;
|
13422 |
+
let pendingCount = 0;
|
13423 |
let sync = false;
|
13424 |
|
13425 |
function schedule(fn, queue) {
|
13442 |
}
|
13443 |
}
|
13444 |
|
13445 |
+
function stop() {
|
13446 |
+
ts = -1;
|
13447 |
+
}
|
13448 |
+
|
13449 |
function loop() {
|
13450 |
if (~ts) {
|
13451 |
nativeRaf(loop);
|
13460 |
|
13461 |
if (count) {
|
13462 |
eachSafely(timeouts.splice(0, count), t => t.handler());
|
13463 |
+
pendingCount -= count;
|
13464 |
}
|
13465 |
|
13466 |
onStartQueue.flush();
|
13468 |
onFrameQueue.flush();
|
13469 |
writeQueue.flush();
|
13470 |
onFinishQueue.flush();
|
13471 |
+
|
13472 |
+
if (!pendingCount) {
|
13473 |
+
stop();
|
13474 |
+
}
|
13475 |
}
|
13476 |
|
13477 |
function makeQueue() {
|
13479 |
let current = next;
|
13480 |
return {
|
13481 |
add(fn) {
|
13482 |
+
pendingCount += current == next && !next.has(fn) ? 1 : 0;
|
13483 |
next.add(fn);
|
13484 |
},
|
13485 |
|
13486 |
delete(fn) {
|
13487 |
+
pendingCount -= current == next && next.has(fn) ? 1 : 0;
|
13488 |
return next.delete(fn);
|
13489 |
},
|
13490 |
|
13491 |
flush(arg) {
|
13492 |
if (current.size) {
|
13493 |
next = new Set();
|
13494 |
+
pendingCount -= current.size;
|
13495 |
eachSafely(current, fn => fn(arg) && next.add(fn));
|
13496 |
+
pendingCount += next.size;
|
13497 |
current = next;
|
13498 |
}
|
13499 |
}
|
13512 |
}
|
13513 |
|
13514 |
const __raf = {
|
13515 |
+
count() {
|
13516 |
+
return pendingCount;
|
13517 |
+
},
|
13518 |
+
|
13519 |
+
isRunning() {
|
13520 |
+
return ts >= 0;
|
13521 |
+
},
|
13522 |
|
13523 |
clear() {
|
13524 |
ts = -1;
|
13528 |
onFrameQueue = makeQueue();
|
13529 |
writeQueue = makeQueue();
|
13530 |
onFinishQueue = makeQueue();
|
13531 |
+
pendingCount = 0;
|
13532 |
}
|
13533 |
|
13534 |
};
|
13538 |
// EXTERNAL MODULE: external "React"
|
13539 |
var external_React_ = __webpack_require__(9196);
|
13540 |
var external_React_default = /*#__PURE__*/__webpack_require__.n(external_React_);
|
13541 |
+
;// CONCATENATED MODULE: ./packages/block-editor/node_modules/@react-spring/shared/dist/react-spring-shared.esm.js
|
13542 |
|
13543 |
|
13544 |
|
13573 |
}
|
13574 |
const react_spring_shared_esm_each = (obj, fn) => obj.forEach(fn);
|
13575 |
function eachProp(obj, fn, ctx) {
|
13576 |
+
if (react_spring_shared_esm_is.arr(obj)) {
|
13577 |
+
for (let i = 0; i < obj.length; i++) {
|
13578 |
+
fn.call(ctx, obj[i], `${i}`);
|
13579 |
+
}
|
13580 |
+
|
13581 |
+
return;
|
13582 |
+
}
|
13583 |
+
|
13584 |
for (const key in obj) {
|
13585 |
if (obj.hasOwnProperty(key)) {
|
13586 |
fn.call(ctx, obj[key], key);
|
13596 |
}
|
13597 |
}
|
13598 |
const flushCalls = (queue, ...args) => flush(queue, fn => fn(...args));
|
13599 |
+
const isSSR = () => typeof window === 'undefined' || !window.navigator || /ServerSideRendering|^Deno\//.test(window.navigator.userAgent);
|
13600 |
|
13601 |
let createStringInterpolator$1;
|
13602 |
let to;
|
14138 |
|
14139 |
const numberRegex = /[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?/g;
|
14140 |
const colorRegex = /(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi;
|
14141 |
+
const unitRegex = new RegExp(`(${numberRegex.source})(%|[a-z]+)`, 'i');
|
14142 |
const rgbaRegex = /rgba\(([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+)\)/gi;
|
14143 |
+
const cssVariableRegex = /var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/;
|
14144 |
+
|
14145 |
+
const variableToRgba = input => {
|
14146 |
+
const [token, fallback] = parseCSSVariable(input);
|
14147 |
+
|
14148 |
+
if (!token || isSSR()) {
|
14149 |
+
return input;
|
14150 |
+
}
|
14151 |
+
|
14152 |
+
const value = window.getComputedStyle(document.documentElement).getPropertyValue(token);
|
14153 |
+
|
14154 |
+
if (value) {
|
14155 |
+
return value.trim();
|
14156 |
+
} else if (fallback && fallback.startsWith('--')) {
|
14157 |
+
const _value = window.getComputedStyle(document.documentElement).getPropertyValue(fallback);
|
14158 |
+
|
14159 |
+
if (_value) {
|
14160 |
+
return _value;
|
14161 |
+
} else {
|
14162 |
+
return input;
|
14163 |
+
}
|
14164 |
+
} else if (fallback && cssVariableRegex.test(fallback)) {
|
14165 |
+
return variableToRgba(fallback);
|
14166 |
+
} else if (fallback) {
|
14167 |
+
return fallback;
|
14168 |
+
}
|
14169 |
+
|
14170 |
+
return input;
|
14171 |
+
};
|
14172 |
+
|
14173 |
+
const parseCSSVariable = current => {
|
14174 |
+
const match = cssVariableRegex.exec(current);
|
14175 |
+
if (!match) return [,];
|
14176 |
+
const [, token, fallback] = match;
|
14177 |
+
return [token, fallback];
|
14178 |
+
};
|
14179 |
+
|
14180 |
+
let namedColorRegex;
|
14181 |
|
14182 |
const rgbaRound = (_, p1, p2, p3, p4) => `rgba(${Math.round(p1)}, ${Math.round(p2)}, ${Math.round(p3)}, ${p4})`;
|
14183 |
|
14184 |
const createStringInterpolator = config => {
|
14185 |
if (!namedColorRegex) namedColorRegex = colors$1 ? new RegExp(`(${Object.keys(colors$1).join('|')})(?!\\w)`, 'g') : /^\b$/;
|
14186 |
+
const output = config.output.map(value => {
|
14187 |
+
return getFluidValue(value).replace(cssVariableRegex, variableToRgba).replace(colorRegex, colorToRgba).replace(namedColorRegex, colorToRgba);
|
14188 |
+
});
|
14189 |
const keyframes = output.map(value => value.match(numberRegex).map(Number));
|
14190 |
const outputRanges = keyframes[0].map((_, i) => keyframes.map(values => {
|
14191 |
if (!(i in values)) {
|
14198 |
output
|
14199 |
})));
|
14200 |
return input => {
|
14201 |
+
var _output$find;
|
14202 |
+
|
14203 |
+
const missingUnit = !unitRegex.test(output[0]) && ((_output$find = output.find(value => unitRegex.test(value))) == null ? void 0 : _output$find.replace(numberRegex, ''));
|
14204 |
let i = 0;
|
14205 |
+
return output[0].replace(numberRegex, () => `${interpolators[i++](input)}${missingUnit || ''}`).replace(rgbaRegex, rgbaRound);
|
14206 |
};
|
14207 |
};
|
14208 |
|
14234 |
}
|
14235 |
|
14236 |
function isAnimatedString(value) {
|
14237 |
+
return react_spring_shared_esm_is.str(value) && (value[0] == '#' || /\d/.test(value) || !isSSR() && cssVariableRegex.test(value) || value in (colors$1 || {}));
|
14238 |
}
|
14239 |
|
14240 |
+
const react_spring_shared_esm_useLayoutEffect = typeof window !== 'undefined' && window.document && window.document.createElement ? external_React_.useLayoutEffect : external_React_.useEffect;
|
14241 |
+
|
14242 |
+
const useIsMounted = () => {
|
14243 |
+
const isMounted = (0,external_React_.useRef)(false);
|
14244 |
+
react_spring_shared_esm_useLayoutEffect(() => {
|
14245 |
+
isMounted.current = true;
|
14246 |
+
return () => {
|
14247 |
+
isMounted.current = false;
|
14248 |
+
};
|
14249 |
+
}, []);
|
14250 |
+
return isMounted;
|
14251 |
+
};
|
14252 |
|
14253 |
function react_spring_shared_esm_useForceUpdate() {
|
14254 |
const update = (0,external_React_.useState)()[1];
|
14255 |
+
const isMounted = useIsMounted();
|
|
|
14256 |
return () => {
|
14257 |
+
if (isMounted.current) {
|
14258 |
+
update(Math.random());
|
14259 |
}
|
14260 |
};
|
14261 |
}
|
14262 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14263 |
function useMemoOne(getResult, inputs) {
|
14264 |
const [initial] = (0,external_React_.useState)(() => ({
|
14265 |
inputs,
|
14306 |
return true;
|
14307 |
}
|
14308 |
|
14309 |
+
const react_spring_shared_esm_useOnce = effect => (0,external_React_.useEffect)(effect, emptyDeps);
|
14310 |
+
const emptyDeps = [];
|
14311 |
+
|
14312 |
function react_spring_shared_esm_usePrev(value) {
|
14313 |
const prevRef = (0,external_React_.useRef)();
|
14314 |
(0,external_React_.useEffect)(() => {
|
14317 |
return prevRef.current;
|
14318 |
}
|
14319 |
|
|
|
|
|
14320 |
|
14321 |
|
14322 |
+
;// CONCATENATED MODULE: ./packages/block-editor/node_modules/@react-spring/animated/dist/react-spring-animated.esm.js
|
14323 |
|
14324 |
|
14325 |
|
14595 |
const observer = new PropsObserver(callback, deps);
|
14596 |
const observerRef = (0,external_React_.useRef)();
|
14597 |
react_spring_shared_esm_useLayoutEffect(() => {
|
|
|
14598 |
observerRef.current = observer;
|
14599 |
react_spring_shared_esm_each(deps, dep => addFluidObserver(dep, observer));
|
14600 |
+
return () => {
|
14601 |
+
if (observerRef.current) {
|
14602 |
+
react_spring_shared_esm_each(observerRef.current.deps, dep => removeFluidObserver(dep, observerRef.current));
|
14603 |
+
raf.cancel(observerRef.current.update);
|
14604 |
+
}
|
14605 |
+
};
|
14606 |
});
|
14607 |
(0,external_React_.useEffect)(callback, []);
|
14608 |
react_spring_shared_esm_useOnce(() => () => {
|
14690 |
|
14691 |
|
14692 |
|
14693 |
+
;// CONCATENATED MODULE: ./packages/block-editor/node_modules/@react-spring/core/dist/react-spring-core.esm.js
|
14694 |
|
14695 |
|
14696 |
|
14857 |
|
14858 |
props.delay = key => delay + callProp(memoizedDelayProp || 0, key);
|
14859 |
});
|
|
|
14860 |
});
|
14861 |
+
ref.start();
|
14862 |
}
|
14863 |
});
|
14864 |
} else {
|
14874 |
});
|
14875 |
p = p.then(() => {
|
14876 |
each(controllers, (ctrl, i) => each(queues[i] || [], update => ctrl.queue.push(update)));
|
14877 |
+
return Promise.all(ref.start());
|
14878 |
});
|
14879 |
}
|
14880 |
});
|
14908 |
friction: 120
|
14909 |
}
|
14910 |
};
|
14911 |
+
const c1 = 1.70158;
|
14912 |
+
const c2 = c1 * 1.525;
|
14913 |
+
const c3 = c1 + 1;
|
14914 |
+
const c4 = 2 * Math.PI / 3;
|
14915 |
+
const c5 = 2 * Math.PI / 4.5;
|
14916 |
+
|
14917 |
+
const bounceOut = x => {
|
14918 |
+
const n1 = 7.5625;
|
14919 |
+
const d1 = 2.75;
|
14920 |
|
14921 |
+
if (x < 1 / d1) {
|
14922 |
+
return n1 * x * x;
|
14923 |
+
} else if (x < 2 / d1) {
|
14924 |
+
return n1 * (x -= 1.5 / d1) * x + 0.75;
|
14925 |
+
} else if (x < 2.5 / d1) {
|
14926 |
+
return n1 * (x -= 2.25 / d1) * x + 0.9375;
|
14927 |
+
} else {
|
14928 |
+
return n1 * (x -= 2.625 / d1) * x + 0.984375;
|
14929 |
+
}
|
14930 |
+
};
|
14931 |
+
|
14932 |
+
const easings = {
|
14933 |
+
linear: x => x,
|
14934 |
+
easeInQuad: x => x * x,
|
14935 |
+
easeOutQuad: x => 1 - (1 - x) * (1 - x),
|
14936 |
+
easeInOutQuad: x => x < 0.5 ? 2 * x * x : 1 - Math.pow(-2 * x + 2, 2) / 2,
|
14937 |
+
easeInCubic: x => x * x * x,
|
14938 |
+
easeOutCubic: x => 1 - Math.pow(1 - x, 3),
|
14939 |
+
easeInOutCubic: x => x < 0.5 ? 4 * x * x * x : 1 - Math.pow(-2 * x + 2, 3) / 2,
|
14940 |
+
easeInQuart: x => x * x * x * x,
|
14941 |
+
easeOutQuart: x => 1 - Math.pow(1 - x, 4),
|
14942 |
+
easeInOutQuart: x => x < 0.5 ? 8 * x * x * x * x : 1 - Math.pow(-2 * x + 2, 4) / 2,
|
14943 |
+
easeInQuint: x => x * x * x * x * x,
|
14944 |
+
easeOutQuint: x => 1 - Math.pow(1 - x, 5),
|
14945 |
+
easeInOutQuint: x => x < 0.5 ? 16 * x * x * x * x * x : 1 - Math.pow(-2 * x + 2, 5) / 2,
|
14946 |
+
easeInSine: x => 1 - Math.cos(x * Math.PI / 2),
|
14947 |
+
easeOutSine: x => Math.sin(x * Math.PI / 2),
|
14948 |
+
easeInOutSine: x => -(Math.cos(Math.PI * x) - 1) / 2,
|
14949 |
+
easeInExpo: x => x === 0 ? 0 : Math.pow(2, 10 * x - 10),
|
14950 |
+
easeOutExpo: x => x === 1 ? 1 : 1 - Math.pow(2, -10 * x),
|
14951 |
+
easeInOutExpo: x => x === 0 ? 0 : x === 1 ? 1 : x < 0.5 ? Math.pow(2, 20 * x - 10) / 2 : (2 - Math.pow(2, -20 * x + 10)) / 2,
|
14952 |
+
easeInCirc: x => 1 - Math.sqrt(1 - Math.pow(x, 2)),
|
14953 |
+
easeOutCirc: x => Math.sqrt(1 - Math.pow(x - 1, 2)),
|
14954 |
+
easeInOutCirc: x => x < 0.5 ? (1 - Math.sqrt(1 - Math.pow(2 * x, 2))) / 2 : (Math.sqrt(1 - Math.pow(-2 * x + 2, 2)) + 1) / 2,
|
14955 |
+
easeInBack: x => c3 * x * x * x - c1 * x * x,
|
14956 |
+
easeOutBack: x => 1 + c3 * Math.pow(x - 1, 3) + c1 * Math.pow(x - 1, 2),
|
14957 |
+
easeInOutBack: x => x < 0.5 ? Math.pow(2 * x, 2) * ((c2 + 1) * 2 * x - c2) / 2 : (Math.pow(2 * x - 2, 2) * ((c2 + 1) * (x * 2 - 2) + c2) + 2) / 2,
|
14958 |
+
easeInElastic: x => x === 0 ? 0 : x === 1 ? 1 : -Math.pow(2, 10 * x - 10) * Math.sin((x * 10 - 10.75) * c4),
|
14959 |
+
easeOutElastic: x => x === 0 ? 0 : x === 1 ? 1 : Math.pow(2, -10 * x) * Math.sin((x * 10 - 0.75) * c4) + 1,
|
14960 |
+
easeInOutElastic: x => x === 0 ? 0 : x === 1 ? 1 : x < 0.5 ? -(Math.pow(2, 20 * x - 10) * Math.sin((20 * x - 11.125) * c5)) / 2 : Math.pow(2, -20 * x + 10) * Math.sin((20 * x - 11.125) * c5) / 2 + 1,
|
14961 |
+
easeInBounce: x => 1 - bounceOut(1 - x),
|
14962 |
+
easeOutBounce: bounceOut,
|
14963 |
+
easeInOutBounce: x => x < 0.5 ? (1 - bounceOut(1 - 2 * x)) / 2 : (1 + bounceOut(2 * x - 1)) / 2
|
14964 |
+
};
|
14965 |
|
14966 |
const defaults = react_spring_core_esm_extends({}, config.default, {
|
14967 |
mass: 1,
|
14968 |
damping: 1,
|
14969 |
+
easing: easings.linear,
|
14970 |
clamp: false
|
14971 |
});
|
14972 |
|
15101 |
}
|
15102 |
|
15103 |
function onResume() {
|
15104 |
+
if (delay > 0 && !globals.skipAnimation) {
|
15105 |
+
state.delayed = true;
|
15106 |
timeout = raf.setTimeout(onStart, delay);
|
15107 |
state.pauseQueue.add(onPause);
|
15108 |
state.timeouts.add(timeout);
|
15112 |
}
|
15113 |
|
15114 |
function onStart() {
|
15115 |
+
if (state.delayed) {
|
15116 |
+
state.delayed = false;
|
15117 |
+
}
|
15118 |
+
|
15119 |
state.pauseQueue.delete(onPause);
|
15120 |
state.timeouts.delete(timeout);
|
15121 |
|
15383 |
this.defaultProps = {};
|
15384 |
this._state = {
|
15385 |
paused: false,
|
15386 |
+
delayed: false,
|
15387 |
pauseQueue: new Set(),
|
15388 |
resumeQueue: new Set(),
|
15389 |
timeouts: new Set()
|
15431 |
return isPaused(this);
|
15432 |
}
|
15433 |
|
15434 |
+
get isDelayed() {
|
15435 |
+
return this._state.delayed;
|
15436 |
+
}
|
15437 |
+
|
15438 |
advance(dt) {
|
15439 |
let idle = true;
|
15440 |
let changed = false;
|
15638 |
this.queue = [];
|
15639 |
}
|
15640 |
|
15641 |
+
return Promise.all(queue.map(props => {
|
15642 |
+
const up = this._update(props);
|
15643 |
+
|
15644 |
+
return up;
|
15645 |
+
})).then(results => getCombinedResult(this, results));
|
15646 |
}
|
15647 |
|
15648 |
stop(cancel) {
|
16175 |
}
|
16176 |
|
16177 |
get idle() {
|
16178 |
+
return !this._state.asyncTo && Object.values(this.springs).every(spring => {
|
16179 |
+
return spring.idle && !spring.isDelayed && !spring.isPaused;
|
16180 |
+
});
|
16181 |
}
|
16182 |
|
16183 |
get item() {
|
16740 |
const useSpringRef = () => useState(initSpringRef)[0];
|
16741 |
|
16742 |
function useTrail(length, propsArg, deps) {
|
16743 |
+
var _passedRef;
|
16744 |
+
|
16745 |
const propsFn = is.fun(propsArg) && propsArg;
|
16746 |
if (propsFn && !deps) deps = [];
|
16747 |
let reverse = true;
|
16748 |
+
let passedRef = undefined;
|
16749 |
const result = useSprings(length, (i, ctrl) => {
|
16750 |
const props = propsFn ? propsFn(i, ctrl) : propsArg;
|
16751 |
+
passedRef = props.ref;
|
16752 |
reverse = reverse && props.reverse;
|
16753 |
return props;
|
16754 |
}, deps || [{}]);
|
16755 |
+
const ref = (_passedRef = passedRef) != null ? _passedRef : result[1];
|
16756 |
useLayoutEffect(() => {
|
16757 |
each(ref.current, (ctrl, i) => {
|
16758 |
const parent = ref.current[i + (reverse ? 1 : -1)];
|
16759 |
+
|
16760 |
+
if (parent) {
|
16761 |
+
ctrl.start({
|
16762 |
+
to: parent.springs
|
16763 |
+
});
|
16764 |
+
} else {
|
16765 |
+
ctrl.start();
|
16766 |
+
}
|
16767 |
});
|
16768 |
}, deps);
|
16769 |
|
16781 |
return result;
|
16782 |
}
|
16783 |
|
16784 |
+
ref['start'] = propsArg => {
|
16785 |
+
const results = [];
|
16786 |
+
each(ref.current, (ctrl, i) => {
|
16787 |
+
const props = is.fun(propsArg) ? propsArg(i, ctrl) : propsArg;
|
16788 |
+
const parent = ref.current[i + (reverse ? 1 : -1)];
|
16789 |
+
|
16790 |
+
if (parent) {
|
16791 |
+
results.push(ctrl.start(react_spring_core_esm_extends({}, props, {
|
16792 |
+
to: parent.springs
|
16793 |
+
})));
|
16794 |
+
} else {
|
16795 |
+
results.push(ctrl.start(react_spring_core_esm_extends({}, props)));
|
16796 |
+
}
|
16797 |
+
});
|
16798 |
+
return results;
|
16799 |
+
};
|
16800 |
+
|
16801 |
return result[0];
|
16802 |
}
|
16803 |
|
16817 |
sort,
|
16818 |
trail = 0,
|
16819 |
expires = true,
|
16820 |
+
exitBeforeEnter = false,
|
16821 |
onDestroyed,
|
16822 |
ref: propsRef,
|
16823 |
config: propsConfig
|
16830 |
useLayoutEffect(() => {
|
16831 |
usedTransitions.current = transitions;
|
16832 |
});
|
16833 |
+
useOnce(() => {
|
16834 |
+
each(usedTransitions.current, t => {
|
16835 |
+
var _t$ctrl$ref;
|
|
|
16836 |
|
16837 |
+
(_t$ctrl$ref = t.ctrl.ref) == null ? void 0 : _t$ctrl$ref.add(t.ctrl);
|
16838 |
+
const change = changes.get(t);
|
16839 |
+
|
16840 |
+
if (change) {
|
16841 |
+
t.ctrl.start(change.payload);
|
16842 |
+
}
|
16843 |
+
});
|
16844 |
+
return () => {
|
16845 |
+
each(usedTransitions.current, t => {
|
16846 |
+
if (t.expired) {
|
16847 |
+
clearTimeout(t.expirationId);
|
16848 |
+
}
|
16849 |
+
|
16850 |
+
detachRefs(t.ctrl, ref);
|
16851 |
+
t.ctrl.stop(true);
|
16852 |
+
});
|
16853 |
+
};
|
16854 |
+
});
|
16855 |
const keys = getKeys(items, propsFn ? propsFn() : props, prevTransitions);
|
16856 |
const expired = reset && usedTransitions.current || [];
|
16857 |
useLayoutEffect(() => each(expired, ({
|
16911 |
const forceUpdate = useForceUpdate();
|
16912 |
const defaultProps = getDefaultProps(props);
|
16913 |
const changes = new Map();
|
16914 |
+
const exitingTransitions = useRef(new Map());
|
16915 |
+
const forceChange = useRef(false);
|
16916 |
each(transitions, (t, i) => {
|
16917 |
const key = t.key;
|
16918 |
const prevPhase = t.phase;
|
16998 |
}
|
16999 |
|
17000 |
if (idle && transitions.some(t => t.expired)) {
|
17001 |
+
exitingTransitions.current.delete(t);
|
17002 |
+
|
17003 |
+
if (exitBeforeEnter) {
|
17004 |
+
forceChange.current = true;
|
17005 |
+
}
|
17006 |
+
|
17007 |
forceUpdate();
|
17008 |
}
|
17009 |
}
|
17010 |
};
|
17011 |
|
17012 |
const springs = getSprings(t.ctrl, payload);
|
17013 |
+
|
17014 |
+
if (phase === TransitionPhase.LEAVE && exitBeforeEnter) {
|
17015 |
+
exitingTransitions.current.set(t, {
|
17016 |
+
phase,
|
17017 |
+
springs,
|
17018 |
+
payload
|
17019 |
+
});
|
17020 |
+
} else {
|
17021 |
+
changes.set(t, {
|
17022 |
+
phase,
|
17023 |
+
springs,
|
17024 |
+
payload
|
17025 |
+
});
|
17026 |
+
}
|
17027 |
});
|
17028 |
const context = useContext(SpringContext);
|
17029 |
const prevContext = usePrev(context);
|
17030 |
const hasContext = context !== prevContext && hasProps(context);
|
17031 |
useLayoutEffect(() => {
|
17032 |
+
if (hasContext) {
|
17033 |
+
each(transitions, t => {
|
17034 |
+
t.ctrl.start({
|
17035 |
+
default: context
|
17036 |
+
});
|
17037 |
});
|
17038 |
+
}
|
17039 |
}, [context]);
|
17040 |
+
each(changes, (_, t) => {
|
17041 |
+
if (exitingTransitions.current.size) {
|
17042 |
+
const ind = transitions.findIndex(state => state.key === t.key);
|
17043 |
+
transitions.splice(ind, 1);
|
17044 |
+
}
|
17045 |
+
});
|
17046 |
useLayoutEffect(() => {
|
17047 |
+
each(exitingTransitions.current.size ? exitingTransitions.current : changes, ({
|
17048 |
phase,
|
17049 |
payload
|
17050 |
}, t) => {
|
17063 |
if (payload) {
|
17064 |
replaceRef(ctrl, payload.ref);
|
17065 |
|
17066 |
+
if (ctrl.ref && !forceChange.current) {
|
17067 |
ctrl.update(payload);
|
17068 |
} else {
|
17069 |
ctrl.start(payload);
|
17070 |
+
|
17071 |
+
if (forceChange.current) {
|
17072 |
+
forceChange.current = false;
|
17073 |
+
}
|
17074 |
}
|
17075 |
}
|
17076 |
});
|
17285 |
|
17286 |
;// CONCATENATED MODULE: external "ReactDOM"
|
17287 |
var external_ReactDOM_namespaceObject = window["ReactDOM"];
|
17288 |
+
;// CONCATENATED MODULE: ./packages/block-editor/node_modules/@react-spring/web/dist/react-spring-web.esm.js
|
17289 |
|
17290 |
|
17291 |
|
20421 |
__unstableExpandSelection
|
20422 |
} = (0,external_wp_data_namespaceObject.useDispatch)(store);
|
20423 |
return (0,external_wp_compose_namespaceObject.useRefEffect)(node => {
|
20424 |
+
function onBeforeInput(event) {
|
20425 |
+
var _event$inputType;
|
20426 |
+
|
20427 |
+
if (!hasMultiSelection()) {
|
20428 |
+
return;
|
20429 |
+
} // Prevent the browser to format something when we have multiselection.
|
20430 |
+
|
20431 |
+
|
20432 |
+
if ((_event$inputType = event.inputType) !== null && _event$inputType !== void 0 && _event$inputType.startsWith('format')) {
|
20433 |
+
event.preventDefault();
|
20434 |
+
}
|
20435 |
+
}
|
20436 |
+
|
20437 |
function onKeyDown(event) {
|
20438 |
if (event.defaultPrevented) {
|
20439 |
return;
|
20498 |
}
|
20499 |
}
|
20500 |
|
20501 |
+
node.addEventListener('beforeinput', onBeforeInput);
|
20502 |
node.addEventListener('keydown', onKeyDown);
|
20503 |
node.addEventListener('compositionstart', onCompositionStart);
|
20504 |
return () => {
|
20505 |
+
node.removeEventListener('beforeinput', onBeforeInput);
|
20506 |
node.removeEventListener('keydown', onKeyDown);
|
20507 |
node.removeEventListener('compositionstart', onCompositionStart);
|
20508 |
};
|
25496 |
} = _ref;
|
25497 |
const {
|
25498 |
orientation,
|
25499 |
+
rootClientId,
|
25500 |
+
isVisible
|
25501 |
} = (0,external_wp_data_namespaceObject.useSelect)(select => {
|
25502 |
var _getBlockListSettings;
|
25503 |
|
25504 |
const {
|
25505 |
getBlockListSettings,
|
25506 |
+
getBlockRootClientId,
|
25507 |
+
isBlockVisible
|
25508 |
} = select(store);
|
25509 |
|
25510 |
const _rootClientId = getBlockRootClientId(previousClientId);
|
25511 |
|
25512 |
return {
|
25513 |
orientation: ((_getBlockListSettings = getBlockListSettings(_rootClientId)) === null || _getBlockListSettings === void 0 ? void 0 : _getBlockListSettings.orientation) || 'vertical',
|
25514 |
+
rootClientId: _rootClientId,
|
25515 |
+
isVisible: isBlockVisible(previousClientId) && isBlockVisible(nextClientId)
|
25516 |
};
|
25517 |
}, [previousClientId]);
|
25518 |
const previousElement = useBlockElement(previousClientId);
|
25519 |
const nextElement = useBlockElement(nextClientId);
|
25520 |
const isVertical = orientation === 'vertical';
|
25521 |
const style = (0,external_wp_element_namespaceObject.useMemo)(() => {
|
25522 |
+
if (!previousElement && !nextElement || !isVisible) {
|
25523 |
return {};
|
25524 |
}
|
25525 |
|
25545 |
};
|
25546 |
}, [previousElement, nextElement, isVertical]);
|
25547 |
const getAnchorRect = (0,external_wp_element_namespaceObject.useCallback)(() => {
|
25548 |
+
if (!previousElement && !nextElement || !isVisible) {
|
25549 |
return {};
|
25550 |
}
|
25551 |
|
25603 |
}, [previousElement, nextElement]);
|
25604 |
const popoverScrollRef = use_popover_scroll(__unstableContentRef);
|
25605 |
|
25606 |
+
if (!previousElement || !nextElement || !isVisible) {
|
25607 |
return null;
|
25608 |
}
|
25609 |
/* eslint-disable jsx-a11y/no-static-element-interactions, jsx-a11y/click-events-have-key-events */
|
26691 |
onClick: () => setNavigationMode(false),
|
26692 |
onKeyDown: onKeyDown,
|
26693 |
label: label,
|
26694 |
+
showTooltip: false,
|
26695 |
className: "block-selection-button_select-button"
|
26696 |
}, (0,external_wp_element_namespaceObject.createElement)(BlockTitle, {
|
26697 |
clientId: clientId,
|
29949 |
replaceBlocks
|
29950 |
} = (0,external_wp_data_namespaceObject.useDispatch)(store);
|
29951 |
const {
|
29952 |
+
canRemove,
|
29953 |
+
variations
|
29954 |
} = (0,external_wp_data_namespaceObject.useSelect)(select => {
|
29955 |
const {
|
29956 |
canRemoveBlocks
|
29957 |
} = select(store);
|
29958 |
+
const {
|
29959 |
+
getBlockVariations
|
29960 |
+
} = select(external_wp_blocks_namespaceObject.store);
|
29961 |
return {
|
29962 |
+
canRemove: canRemoveBlocks(clientIds),
|
29963 |
+
variations: getBlockVariations(groupingBlockName, 'transform')
|
29964 |
};
|
29965 |
+
}, [clientIds, groupingBlockName]);
|
29966 |
|
29967 |
const onConvertToGroup = function () {
|
29968 |
let layout = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'group';
|
29988 |
return null;
|
29989 |
}
|
29990 |
|
29991 |
+
const canInsertRow = !!variations.find(_ref => {
|
29992 |
+
let {
|
29993 |
+
name
|
29994 |
+
} = _ref;
|
29995 |
+
return name === 'group-row';
|
29996 |
+
});
|
29997 |
+
const canInsertStack = !!variations.find(_ref2 => {
|
29998 |
+
let {
|
29999 |
+
name
|
30000 |
+
} = _ref2;
|
30001 |
+
return name === 'group-stack';
|
30002 |
+
});
|
30003 |
return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarGroup, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, {
|
30004 |
icon: library_group,
|
30005 |
label: (0,external_wp_i18n_namespaceObject._x)('Group', 'verb'),
|
30006 |
onClick: onConvertToGroup
|
30007 |
+
}), canInsertRow && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, {
|
30008 |
icon: library_row,
|
30009 |
label: (0,external_wp_i18n_namespaceObject._x)('Row', 'single horizontal line'),
|
30010 |
onClick: onConvertToRow
|
30011 |
+
}), canInsertStack && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, {
|
30012 |
icon: library_stack,
|
30013 |
label: (0,external_wp_i18n_namespaceObject._x)('Stack', 'verb'),
|
30014 |
onClick: onConvertToStack
|
31435 |
isNavigationMode: _isNavigationMode()
|
31436 |
};
|
31437 |
}, []);
|
31438 |
+
const {
|
31439 |
+
setBlockVisibility
|
31440 |
+
} = (0,external_wp_data_namespaceObject.useDispatch)(store);
|
31441 |
+
const intersectionObserver = (0,external_wp_element_namespaceObject.useMemo)(() => {
|
31442 |
+
const {
|
31443 |
+
IntersectionObserver: Observer
|
31444 |
+
} = window;
|
31445 |
+
|
31446 |
+
if (!Observer) {
|
31447 |
+
return;
|
31448 |
+
}
|
31449 |
+
|
31450 |
+
return new Observer(entries => {
|
31451 |
+
const updates = {};
|
31452 |
+
|
31453 |
+
for (const entry of entries) {
|
31454 |
+
const clientId = entry.target.getAttribute('data-block');
|
31455 |
+
updates[clientId] = entry.isIntersecting;
|
31456 |
+
}
|
31457 |
+
|
31458 |
+
setBlockVisibility(updates);
|
31459 |
+
});
|
31460 |
+
}, []);
|
31461 |
const innerBlocksProps = useInnerBlocksProps({
|
31462 |
ref: (0,external_wp_compose_namespaceObject.useMergeRefs)([useBlockSelectionClearer(), useInBetweenInserter(), setElement]),
|
31463 |
className: classnames_default()('is-root-container', className, {
|
31468 |
}, settings);
|
31469 |
return (0,external_wp_element_namespaceObject.createElement)(elementContext.Provider, {
|
31470 |
value: element
|
31471 |
+
}, (0,external_wp_element_namespaceObject.createElement)(IntersectionObserver.Provider, {
|
31472 |
+
value: intersectionObserver
|
31473 |
+
}, (0,external_wp_element_namespaceObject.createElement)("div", innerBlocksProps)));
|
31474 |
}
|
31475 |
|
31476 |
function BlockList(settings) {
|
31489 |
__experimentalAppenderTagName,
|
31490 |
__experimentalLayout: layout = defaultLayout
|
31491 |
} = _ref2;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
31492 |
const {
|
31493 |
order,
|
31494 |
+
selectedBlocks,
|
31495 |
+
visibleBlocks
|
31496 |
} = (0,external_wp_data_namespaceObject.useSelect)(select => {
|
31497 |
const {
|
31498 |
getBlockOrder,
|
31499 |
+
getSelectedBlockClientIds,
|
31500 |
+
__unstableGetVisibleBlocks
|
31501 |
} = select(store);
|
31502 |
return {
|
31503 |
order: getBlockOrder(rootClientId),
|
31504 |
+
selectedBlocks: getSelectedBlockClientIds(),
|
31505 |
+
visibleBlocks: __unstableGetVisibleBlocks()
|
31506 |
};
|
31507 |
}, [rootClientId]);
|
31508 |
return (0,external_wp_element_namespaceObject.createElement)(LayoutProvider, {
|
31509 |
value: layout
|
|
|
|
|
31510 |
}, order.map(clientId => (0,external_wp_element_namespaceObject.createElement)(external_wp_data_namespaceObject.AsyncModeProvider, {
|
31511 |
key: clientId,
|
31512 |
value: // Only provide data asynchronously if the block is
|
31513 |
// not visible and not selected.
|
31514 |
+
!visibleBlocks.has(clientId) && !selectedBlocks.includes(clientId)
|
31515 |
}, (0,external_wp_element_namespaceObject.createElement)(block, {
|
31516 |
rootClientId: rootClientId,
|
31517 |
clientId: clientId
|
31518 |
+
}))), order.length < 1 && placeholder, (0,external_wp_element_namespaceObject.createElement)(block_list_appender, {
|
31519 |
tagName: __experimentalAppenderTagName,
|
31520 |
rootClientId: rootClientId,
|
31521 |
renderAppender: renderAppender
|
32956 |
* Internal dependencies
|
32957 |
*/
|
32958 |
|
32959 |
+
// When the `ColorGradientSettingsDropdown` controls are being rendered to a
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
32960 |
// `ToolsPanel` they must be wrapped in a `ToolsPanelItem`.
|
32961 |
|
32962 |
+
const WithToolsPanelItem = _ref => {
|
|
|
32963 |
let {
|
32964 |
+
setting,
|
|
|
32965 |
children,
|
32966 |
+
panelId,
|
32967 |
...props
|
32968 |
+
} = _ref;
|
32969 |
|
32970 |
+
const clearValue = () => {
|
32971 |
+
if (setting.colorValue) {
|
32972 |
+
setting.onColorChange();
|
32973 |
+
} else if (setting.gradientValue) {
|
32974 |
+
setting.onGradientChange();
|
32975 |
+
}
|
32976 |
+
};
|
32977 |
|
32978 |
return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, _extends({
|
32979 |
+
hasValue: () => {
|
32980 |
+
return !!setting.colorValue || !!setting.gradientValue;
|
32981 |
+
},
|
32982 |
+
label: setting.label,
|
32983 |
+
onDeselect: clearValue,
|
32984 |
+
isShownByDefault: setting.isShownByDefault !== undefined ? setting.isShownByDefault : true
|
32985 |
}, props, {
|
32986 |
+
className: "block-editor-tools-panel-color-gradient-settings__item",
|
32987 |
+
panelId: panelId // Pass resetAllFilter if supplied due to rendering via SlotFill
|
32988 |
+
// into parent ToolsPanel.
|
32989 |
+
,
|
32990 |
+
resetAllFilter: setting.resetAllFilter
|
32991 |
}), children);
|
32992 |
};
|
32993 |
|
32994 |
+
const LabeledColorIndicator = _ref2 => {
|
32995 |
let {
|
32996 |
colorValue,
|
32997 |
label
|
32998 |
+
} = _ref2;
|
32999 |
return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalHStack, {
|
33000 |
justify: "flex-start"
|
33001 |
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ColorIndicator, {
|
33007 |
// a `ToolsPanel`.
|
33008 |
|
33009 |
|
33010 |
+
const renderToggle = settings => _ref3 => {
|
33011 |
let {
|
33012 |
onToggle,
|
33013 |
isOpen
|
33014 |
+
} = _ref3;
|
33015 |
const {
|
|
|
33016 |
colorValue,
|
33017 |
label
|
33018 |
+
} = settings;
|
|
|
|
|
|
|
33019 |
const toggleProps = {
|
33020 |
onClick: onToggle,
|
33021 |
+
className: classnames_default()('block-editor-panel-color-gradient-settings__dropdown', {
|
33022 |
'is-open': isOpen
|
33023 |
}),
|
33024 |
+
'aria-expanded': isOpen
|
33025 |
};
|
33026 |
+
return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, toggleProps, (0,external_wp_element_namespaceObject.createElement)(LabeledColorIndicator, {
|
33027 |
colorValue: colorValue,
|
33028 |
label: label
|
33029 |
}));
|
33036 |
// For more context see: https://github.com/WordPress/gutenberg/pull/40084
|
33037 |
|
33038 |
|
33039 |
+
function ColorGradientSettingsDropdown(_ref4) {
|
33040 |
let {
|
33041 |
colors,
|
33042 |
disableCustomColors,
|
33043 |
disableCustomGradients,
|
33044 |
enableAlpha,
|
33045 |
gradients,
|
|
|
33046 |
settings,
|
33047 |
__experimentalHasMultipleOrigins,
|
33048 |
__experimentalIsRenderedInSidebar,
|
33049 |
...props
|
33050 |
+
} = _ref4;
|
|
|
33051 |
let popoverProps;
|
33052 |
|
33053 |
if (__experimentalIsRenderedInSidebar) {
|
33057 |
};
|
33058 |
}
|
33059 |
|
33060 |
+
return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, settings.map((setting, index) => {
|
33061 |
+
var _setting$gradientValu;
|
|
|
|
|
|
|
|
|
33062 |
|
33063 |
+
const controlProps = {
|
33064 |
+
clearable: false,
|
33065 |
+
colorValue: setting.colorValue,
|
33066 |
+
colors,
|
33067 |
+
disableCustomColors,
|
33068 |
+
disableCustomGradients,
|
33069 |
+
enableAlpha,
|
33070 |
+
gradientValue: setting.gradientValue,
|
33071 |
+
gradients,
|
33072 |
+
label: setting.label,
|
33073 |
+
onColorChange: setting.onColorChange,
|
33074 |
+
onGradientChange: setting.onGradientChange,
|
33075 |
+
showTitle: false,
|
33076 |
+
__experimentalHasMultipleOrigins,
|
33077 |
+
__experimentalIsRenderedInSidebar,
|
33078 |
+
...setting
|
33079 |
+
};
|
33080 |
+
const toggleSettings = {
|
33081 |
+
colorValue: (_setting$gradientValu = setting.gradientValue) !== null && _setting$gradientValu !== void 0 ? _setting$gradientValu : setting.colorValue,
|
33082 |
+
label: setting.label
|
33083 |
+
};
|
33084 |
+
return setting && // If not in an `ItemGroup` wrap the dropdown in a
|
33085 |
+
// `ToolsPanelItem`
|
33086 |
+
(0,external_wp_element_namespaceObject.createElement)(WithToolsPanelItem, _extends({
|
33087 |
+
key: index,
|
33088 |
+
setting: setting
|
33089 |
+
}, props), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Dropdown, {
|
33090 |
+
popoverProps: popoverProps,
|
33091 |
+
className: "block-editor-tools-panel-color-gradient-settings__dropdown",
|
33092 |
+
contentClassName: "block-editor-panel-color-gradient-settings__dropdown-content",
|
33093 |
+
renderToggle: renderToggle(toggleSettings),
|
33094 |
+
renderContent: () => (0,external_wp_element_namespaceObject.createElement)(control, controlProps)
|
33095 |
+
}));
|
33096 |
+
}));
|
|
|
|
|
|
|
33097 |
}
|
33098 |
|
33099 |
;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/contrast-checker/index.js
|
33350 |
const colorSupport = (0,external_wp_blocks_namespaceObject.getBlockSupport)(blockType, COLOR_SUPPORT_KEY);
|
33351 |
return colorSupport && colorSupport.text !== false;
|
33352 |
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
33353 |
/**
|
33354 |
* Clears a single color property from a style object.
|
33355 |
*
|
33360 |
|
33361 |
|
33362 |
const clearColorFromStyles = (path, style) => cleanEmptyObject(immutableSet(style, path, undefined));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
33363 |
/**
|
33364 |
* Clears text color related properties from supplied attributes.
|
33365 |
*
|
33372 |
textColor: undefined,
|
33373 |
style: clearColorFromStyles(['color', 'text'], attributes.style)
|
33374 |
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
33375 |
/**
|
33376 |
* Clears link color related properties from supplied attributes.
|
33377 |
*
|
33406 |
}
|
33407 |
};
|
33408 |
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
33409 |
/**
|
33410 |
* Filters registered block settings, extending attributes to include
|
33411 |
* `backgroundColor` and `textColor` attribute.
|
33663 |
};
|
33664 |
|
33665 |
const onChangeLinkColor = value => {
|
33666 |
+
var _localAttributes$curr9;
|
33667 |
+
|
33668 |
const colorObject = getColorObjectByColorValue(allSolids, value);
|
33669 |
const newLinkColorValue = colorObject !== null && colorObject !== void 0 && colorObject.slug ? `var:preset|color|${colorObject.slug}` : value;
|
33670 |
+
const newStyle = cleanEmptyObject(immutableSet((_localAttributes$curr9 = localAttributes.current) === null || _localAttributes$curr9 === void 0 ? void 0 : _localAttributes$curr9.style, ['elements', 'link', 'color', 'text'], newLinkColorValue));
|
33671 |
props.setAttributes({
|
33672 |
style: newStyle
|
33673 |
});
|
33674 |
+
localAttributes.current = { ...localAttributes.current,
|
33675 |
+
...{
|
33676 |
+
style: newStyle
|
33677 |
+
}
|
33678 |
+
};
|
33679 |
};
|
33680 |
|
33681 |
const enableContrastChecking = external_wp_element_namespaceObject.Platform.OS === 'web' && !gradient && !(style !== null && style !== void 0 && (_style$color6 = style.color) !== null && _style$color6 !== void 0 && _style$color6.gradient);
|
33689 |
onColorChange: onChangeColor('text'),
|
33690 |
colorValue: getColorObjectByAttributeValues(allSolids, textColor, style === null || style === void 0 ? void 0 : (_style$color7 = style.color) === null || _style$color7 === void 0 ? void 0 : _style$color7.text).color,
|
33691 |
isShownByDefault: defaultColorControls === null || defaultColorControls === void 0 ? void 0 : defaultColorControls.text,
|
|
|
|
|
33692 |
resetAllFilter: resetAllTextFilter
|
33693 |
}] : []), ...(hasBackgroundColor || hasGradientColor ? [{
|
33694 |
label: (0,external_wp_i18n_namespaceObject.__)('Background'),
|
33697 |
gradientValue,
|
33698 |
onGradientChange: hasGradientColor ? onChangeGradient : undefined,
|
33699 |
isShownByDefault: defaultColorControls === null || defaultColorControls === void 0 ? void 0 : defaultColorControls.background,
|
|
|
|
|
33700 |
resetAllFilter: clearBackgroundAndGradient
|
33701 |
}] : []), ...(hasLinkColor ? [{
|
33702 |
label: (0,external_wp_i18n_namespaceObject.__)('Link'),
|
33704 |
colorValue: getLinkColorFromAttributeValue(allSolids, style === null || style === void 0 ? void 0 : (_style$elements2 = style.elements) === null || _style$elements2 === void 0 ? void 0 : (_style$elements2$link = _style$elements2.link) === null || _style$elements2$link === void 0 ? void 0 : (_style$elements2$link2 = _style$elements2$link.color) === null || _style$elements2$link2 === void 0 ? void 0 : _style$elements2$link2.text),
|
33705 |
clearable: !!(style !== null && style !== void 0 && (_style$elements3 = style.elements) !== null && _style$elements3 !== void 0 && (_style$elements3$link = _style$elements3.link) !== null && _style$elements3$link !== void 0 && (_style$elements3$link2 = _style$elements3$link.color) !== null && _style$elements3$link2 !== void 0 && _style$elements3$link2.text),
|
33706 |
isShownByDefault: defaultColorControls === null || defaultColorControls === void 0 ? void 0 : defaultColorControls.link,
|
|
|
|
|
33707 |
resetAllFilter: resetAllLinkFilter
|
33708 |
}] : [])]
|
33709 |
});
|
40196 |
|
40197 |
|
40198 |
|
40199 |
+
|
40200 |
function VariationsButtons(_ref) {
|
40201 |
let {
|
40202 |
className,
|
40210 |
as: "legend"
|
40211 |
}, (0,external_wp_i18n_namespaceObject.__)('Transform to variation')), variations.map(variation => (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
|
40212 |
key: variation.name,
|
40213 |
+
icon: (0,external_wp_element_namespaceObject.createElement)(block_icon, {
|
40214 |
+
icon: variation.icon,
|
40215 |
+
showColors: true
|
40216 |
+
}),
|
40217 |
isPressed: selectedValue === variation.name,
|
40218 |
label: selectedValue === variation.name ? variation.title : (0,external_wp_i18n_namespaceObject.sprintf)(
|
40219 |
/* translators: %s: Name of the block variation */
|
40293 |
|
40294 |
const hasUniqueIcons = (0,external_wp_element_namespaceObject.useMemo)(() => {
|
40295 |
const variationIcons = new Set();
|
40296 |
+
|
40297 |
+
if (!variations) {
|
40298 |
+
return false;
|
40299 |
+
}
|
40300 |
+
|
40301 |
variations.forEach(variation => {
|
40302 |
if (variation.icon) {
|
40303 |
+
var _variation$icon;
|
40304 |
+
|
40305 |
+
variationIcons.add(((_variation$icon = variation.icon) === null || _variation$icon === void 0 ? void 0 : _variation$icon.src) || variation.icon);
|
40306 |
}
|
40307 |
});
|
40308 |
return variationIcons.size === variations.length;
|
40539 |
|
40540 |
|
40541 |
|
40542 |
+
|
40543 |
/**
|
40544 |
* Internal dependencies
|
40545 |
*/
|
40548 |
|
40549 |
|
40550 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
40551 |
const panel_color_gradient_settings_colorsAndGradientKeys = ['colors', 'disableCustomColors', 'gradients', 'disableCustomGradients'];
|
40552 |
+
const PanelColorGradientSettingsInner = _ref => {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
40553 |
let {
|
40554 |
className,
|
40555 |
colors,
|
40562 |
showTitle = true,
|
40563 |
__experimentalHasMultipleOrigins,
|
40564 |
__experimentalIsRenderedInSidebar,
|
40565 |
+
enableAlpha
|
40566 |
+
} = _ref;
|
40567 |
+
const panelId = (0,external_wp_compose_namespaceObject.useInstanceId)(PanelColorGradientSettingsInner);
|
40568 |
+
const {
|
40569 |
+
batch
|
40570 |
+
} = (0,external_wp_data_namespaceObject.useRegistry)();
|
40571 |
|
40572 |
if ((0,external_lodash_namespaceObject.isEmpty)(colors) && (0,external_lodash_namespaceObject.isEmpty)(gradients) && disableCustomColors && disableCustomGradients && (0,external_lodash_namespaceObject.every)(settings, setting => (0,external_lodash_namespaceObject.isEmpty)(setting.colors) && (0,external_lodash_namespaceObject.isEmpty)(setting.gradients) && (setting.disableCustomColors === undefined || setting.disableCustomColors) && (setting.disableCustomGradients === undefined || setting.disableCustomGradients))) {
|
40573 |
return null;
|
40574 |
}
|
40575 |
|
40576 |
+
return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToolsPanel, {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
40577 |
className: classnames_default()('block-editor-panel-color-gradient-settings', className),
|
40578 |
+
label: showTitle ? title : undefined,
|
40579 |
+
resetAll: () => {
|
40580 |
+
batch(() => {
|
40581 |
+
settings.forEach(_ref2 => {
|
40582 |
+
let {
|
40583 |
+
colorValue,
|
40584 |
+
gradientValue,
|
40585 |
+
onColorChange,
|
40586 |
+
onGradientChange
|
40587 |
+
} = _ref2;
|
40588 |
+
|
40589 |
+
if (colorValue) {
|
40590 |
+
onColorChange();
|
40591 |
+
} else if (gradientValue) {
|
40592 |
+
onGradientChange();
|
40593 |
+
}
|
40594 |
+
});
|
40595 |
+
});
|
40596 |
+
},
|
40597 |
+
panelId: panelId,
|
40598 |
+
__experimentalFirstVisibleItemClass: "first",
|
40599 |
+
__experimentalLastVisibleItemClass: "last"
|
40600 |
+
}, (0,external_wp_element_namespaceObject.createElement)(ColorGradientSettingsDropdown, {
|
40601 |
settings: settings,
|
40602 |
+
panelId: panelId,
|
40603 |
colors,
|
40604 |
gradients,
|
40605 |
disableCustomColors,
|
44272 |
onSelect,
|
44273 |
onSelectURL,
|
44274 |
onFilesUpload = external_lodash_namespaceObject.noop,
|
|
|
44275 |
name = (0,external_wp_i18n_namespaceObject.__)('Replace'),
|
44276 |
createNotice,
|
44277 |
removeNotice,
|
44387 |
value: multiple ? mediaIds : mediaId,
|
44388 |
onSelect: media => selectMedia(media, onClose),
|
44389 |
allowedTypes: allowedTypes,
|
|
|
44390 |
render: _ref5 => {
|
44391 |
let {
|
44392 |
open
|
44707 |
onDoubleClick,
|
44708 |
onFilesPreUpload = external_lodash_namespaceObject.noop,
|
44709 |
onHTMLDrop = external_lodash_namespaceObject.noop,
|
|
|
44710 |
children,
|
44711 |
mediaLibraryButton,
|
44712 |
placeholder,
|
44946 |
gallery: multiple && onlyAllowsImages(),
|
44947 |
multiple: multiple,
|
44948 |
onSelect: onSelect,
|
|
|
44949 |
allowedTypes: allowedTypes,
|
44950 |
value: Array.isArray(value) ? value.map(_ref7 => {
|
44951 |
let {
|
46334 |
*/
|
46335 |
|
46336 |
function removeNativeProps(props) {
|
46337 |
+
return (0,external_lodash_namespaceObject.omit)(props, ['__unstableMobileNoFocusOnMount', 'deleteEnter', 'placeholderTextColor', 'textAlign', 'selectionColor', 'tagsToEliminate', 'rootTagsToEliminate', 'disableEditingMenu', 'fontSize', 'fontFamily', 'fontWeight', 'fontStyle', 'minWidth', 'maxWidth', 'setRef', 'disableSuggestions', 'disableAutocorrection']);
|
46338 |
}
|
46339 |
|
46340 |
function RichTextWrapper(_ref, forwardedRef) {
|
48791 |
return [hasAlreadyRendered, Provider];
|
48792 |
}
|
48793 |
|
48794 |
+
;// CONCATENATED MODULE: ./packages/icons/build-module/library/close-small.js
|
48795 |
+
|
48796 |
+
|
48797 |
+
/**
|
48798 |
+
* WordPress dependencies
|
48799 |
+
*/
|
48800 |
+
|
48801 |
+
const closeSmall = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
|
48802 |
+
xmlns: "http://www.w3.org/2000/svg",
|
48803 |
+
viewBox: "0 0 24 24"
|
48804 |
+
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
|
48805 |
+
d: "M12 13.06l3.712 3.713 1.061-1.06L13.061 12l3.712-3.712-1.06-1.06L12 10.938 8.288 7.227l-1.061 1.06L10.939 12l-3.712 3.712 1.06 1.061L12 13.061z"
|
48806 |
+
}));
|
48807 |
+
/* harmony default export */ var close_small = (closeSmall);
|
48808 |
+
|
48809 |
+
;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/publish-date-time-picker/index.js
|
48810 |
+
|
48811 |
+
|
48812 |
+
|
48813 |
+
/**
|
48814 |
+
* WordPress dependencies
|
48815 |
+
*/
|
48816 |
+
|
48817 |
+
|
48818 |
+
|
48819 |
+
|
48820 |
+
|
48821 |
+
function PublishDateTimePicker(_ref, ref) {
|
48822 |
+
let {
|
48823 |
+
onClose,
|
48824 |
+
onChange,
|
48825 |
+
...additionalProps
|
48826 |
+
} = _ref;
|
48827 |
+
return (0,external_wp_element_namespaceObject.createElement)("div", {
|
48828 |
+
ref: ref,
|
48829 |
+
className: "block-editor-publish-date-time-picker"
|
48830 |
+
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalHStack, {
|
48831 |
+
className: "block-editor-publish-date-time-picker__header"
|
48832 |
+
}, (0,external_wp_element_namespaceObject.createElement)("h2", {
|
48833 |
+
className: "block-editor-publish-date-time-picker__heading"
|
48834 |
+
}, (0,external_wp_i18n_namespaceObject.__)('Publish')), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalSpacer, null), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
|
48835 |
+
className: "block-editor-publish-date-time-picker__reset",
|
48836 |
+
variant: "tertiary",
|
48837 |
+
onClick: () => onChange === null || onChange === void 0 ? void 0 : onChange(null)
|
48838 |
+
}, (0,external_wp_i18n_namespaceObject.__)('Now')), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
|
48839 |
+
className: "block-editor-publish-date-time-picker__close",
|
48840 |
+
icon: close_small,
|
48841 |
+
label: (0,external_wp_i18n_namespaceObject.__)('Close'),
|
48842 |
+
onClick: onClose
|
48843 |
+
})), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.DateTimePicker, _extends({
|
48844 |
+
__nextRemoveHelpButton: true,
|
48845 |
+
__nextRemoveResetButton: true,
|
48846 |
+
onChange: onChange
|
48847 |
+
}, additionalProps)));
|
48848 |
+
}
|
48849 |
+
|
48850 |
+
/* harmony default export */ var publish_date_time_picker = ((0,external_wp_element_namespaceObject.forwardRef)(PublishDateTimePicker));
|
48851 |
+
|
48852 |
;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/index.js
|
48853 |
/*
|
48854 |
* Block Creation Components
|
48937 |
|
48938 |
|
48939 |
|
48940 |
+
|
48941 |
|
48942 |
|
48943 |
|
48962 |
|
48963 |
|
48964 |
|
48965 |
+
;// CONCATENATED MODULE: ./packages/block-editor/build-module/elements/index.js
|
48966 |
+
const __experimentalElementButtonClassName = 'wp-element-button';
|
48967 |
+
|
48968 |
;// CONCATENATED MODULE: ./packages/block-editor/build-module/utils/block-variation-transforms.js
|
48969 |
/**
|
48970 |
* External dependencies
|
49303 |
|
49304 |
|
49305 |
|
49306 |
+
|
49307 |
}();
|
49308 |
(window.wp = window.wp || {}).blockEditor = __webpack_exports__;
|
49309 |
/******/ })()
|
build/block-editor/index.min.asset.php
CHANGED
@@ -1 +1 @@
|
|
1 |
-
<?php return array('dependencies' => array('lodash', 'react', 'react-dom', 'wp-a11y', 'wp-api-fetch', 'wp-blob', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-date', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-keyboard-shortcuts', 'wp-keycodes', 'wp-notices', 'wp-polyfill', 'wp-primitives', 'wp-rich-text', 'wp-shortcode', 'wp-token-list', 'wp-url', 'wp-warning', 'wp-wordcount'), 'version' => '
|
1 |
+
<?php return array('dependencies' => array('lodash', 'react', 'react-dom', 'wp-a11y', 'wp-api-fetch', 'wp-blob', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-date', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-keyboard-shortcuts', 'wp-keycodes', 'wp-notices', 'wp-polyfill', 'wp-primitives', 'wp-rich-text', 'wp-shortcode', 'wp-token-list', 'wp-url', 'wp-warning', 'wp-wordcount'), 'version' => '5ac2be4f88511bdea30c');
|
build/block-editor/index.min.js
CHANGED
@@ -1,33 +1,33 @@
|
|
1 |
-
!function(){var e={6411:function(e,t){var n,o;void 0===(o="function"==typeof(n=function(e,t){"use strict";var n,o,r="function"==typeof Map?new Map:(n=[],o=[],{has:function(e){return n.indexOf(e)>-1},get:function(e){return o[n.indexOf(e)]},set:function(e,t){-1===n.indexOf(e)&&(n.push(e),o.push(t))},delete:function(e){var t=n.indexOf(e);t>-1&&(n.splice(t,1),o.splice(t,1))}}),l=function(e){return new Event(e,{bubbles:!0})};try{new Event("test")}catch(e){l=function(e){var t=document.createEvent("Event");return t.initEvent(e,!0,!1),t}}function i(e){if(e&&e.nodeName&&"TEXTAREA"===e.nodeName&&!r.has(e)){var t=null,n=null,o=null,i=function(){e.clientWidth!==n&&d()},s=function(t){window.removeEventListener("resize",i,!1),e.removeEventListener("input",d,!1),e.removeEventListener("keyup",d,!1),e.removeEventListener("autosize:destroy",s,!1),e.removeEventListener("autosize:update",d,!1),Object.keys(t).forEach((function(n){e.style[n]=t[n]})),r.delete(e)}.bind(e,{height:e.style.height,resize:e.style.resize,overflowY:e.style.overflowY,overflowX:e.style.overflowX,wordWrap:e.style.wordWrap});e.addEventListener("autosize:destroy",s,!1),"onpropertychange"in e&&"oninput"in e&&e.addEventListener("keyup",d,!1),window.addEventListener("resize",i,!1),e.addEventListener("input",d,!1),e.addEventListener("autosize:update",d,!1),e.style.overflowX="hidden",e.style.wordWrap="break-word",r.set(e,{destroy:s,update:d}),"vertical"===(a=window.getComputedStyle(e,null)).resize?e.style.resize="none":"both"===a.resize&&(e.style.resize="horizontal"),t="content-box"===a.boxSizing?-(parseFloat(a.paddingTop)+parseFloat(a.paddingBottom)):parseFloat(a.borderTopWidth)+parseFloat(a.borderBottomWidth),isNaN(t)&&(t=0),d()}var a;function c(t){var n=e.style.width;e.style.width="0px",e.offsetWidth,e.style.width=n,e.style.overflowY=t}function u(){if(0!==e.scrollHeight){var o=function(e){for(var t=[];e&&e.parentNode&&e.parentNode instanceof Element;)e.parentNode.scrollTop&&t.push({node:e.parentNode,scrollTop:e.parentNode.scrollTop}),e=e.parentNode;return t}(e),r=document.documentElement&&document.documentElement.scrollTop;e.style.height="",e.style.height=e.scrollHeight+t+"px",n=e.clientWidth,o.forEach((function(e){e.node.scrollTop=e.scrollTop})),r&&(document.documentElement.scrollTop=r)}}function d(){u();var t=Math.round(parseFloat(e.style.height)),n=window.getComputedStyle(e,null),r="content-box"===n.boxSizing?Math.round(parseFloat(n.height)):e.offsetHeight;if(r<t?"hidden"===n.overflowY&&(c("scroll"),u(),r="content-box"===n.boxSizing?Math.round(parseFloat(window.getComputedStyle(e,null).height)):e.offsetHeight):"hidden"!==n.overflowY&&(c("hidden"),u(),r="content-box"===n.boxSizing?Math.round(parseFloat(window.getComputedStyle(e,null).height)):e.offsetHeight),o!==r){o=r;var i=l("autosize:resized");try{e.dispatchEvent(i)}catch(e){}}}}function s(e){var t=r.get(e);t&&t.destroy()}function a(e){var t=r.get(e);t&&t.update()}var c=null;"undefined"==typeof window||"function"!=typeof window.getComputedStyle?((c=function(e){return e}).destroy=function(e){return e},c.update=function(e){return e}):((c=function(e,t){return e&&Array.prototype.forEach.call(e.length?e:[e],(function(e){return i(e)})),e}).destroy=function(e){return e&&Array.prototype.forEach.call(e.length?e:[e],s),e},c.update=function(e){return e&&Array.prototype.forEach.call(e.length?e:[e],a),e}),t.default=c,e.exports=t.default})?n.apply(t,[e,t]):n)||(e.exports=o)},4403:function(e,t){var n;!function(){"use strict";var o={}.hasOwnProperty;function r(){for(var e=[],t=0;t<arguments.length;t++){var n=arguments[t];if(n){var l=typeof n;if("string"===l||"number"===l)e.push(n);else if(Array.isArray(n)){if(n.length){var i=r.apply(null,n);i&&e.push(i)}}else if("object"===l)if(n.toString===Object.prototype.toString)for(var s in n)o.call(n,s)&&n[s]&&e.push(s);else e.push(n.toString())}}return e.join(" ")}e.exports?(r.default=r,e.exports=r):void 0===(n=function(){return r}.apply(t,[]))||(e.exports=n)}()},4827:function(e){e.exports=function(e,t,n){return((n=window.getComputedStyle)?n(e):e.currentStyle)[t.replace(/-(\w)/gi,(function(e,t){return t.toUpperCase()}))]}},1198:function(e,t){"use strict";function n(){}function o(e,t,n,o,r){for(var l=0,i=t.length,s=0,a=0;l<i;l++){var c=t[l];if(c.removed){if(c.value=e.join(o.slice(a,a+c.count)),a+=c.count,l&&t[l-1].added){var u=t[l-1];t[l-1]=t[l],t[l]=u}}else{if(!c.added&&r){var d=n.slice(s,s+c.count);d=d.map((function(e,t){var n=o[a+t];return n.length>e.length?n:e})),c.value=e.join(d)}else c.value=e.join(n.slice(s,s+c.count));s+=c.count,c.added||(a+=c.count)}}var p=t[i-1];return i>1&&"string"==typeof p.value&&(p.added||p.removed)&&e.equals("",p.value)&&(t[i-2].value+=p.value,t.pop()),t}function r(e){return{newPos:e.newPos,components:e.components.slice(0)}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=n,n.prototype={diff:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},l=n.callback;"function"==typeof n&&(l=n,n={}),this.options=n;var i=this;function s(e){return l?(setTimeout((function(){l(void 0,e)}),0),!0):e}e=this.castInput(e),t=this.castInput(t),e=this.removeEmpty(this.tokenize(e));var a=(t=this.removeEmpty(this.tokenize(t))).length,c=e.length,u=1,d=a+c,p=[{newPos:-1,components:[]}],m=this.extractCommon(p[0],t,e,0);if(p[0].newPos+1>=a&&m+1>=c)return s([{value:this.join(t),count:t.length}]);function f(){for(var n=-1*u;n<=u;n+=2){var l=void 0,d=p[n-1],m=p[n+1],f=(m?m.newPos:0)-n;d&&(p[n-1]=void 0);var g=d&&d.newPos+1<a,h=m&&0<=f&&f<c;if(g||h){if(!g||h&&d.newPos<m.newPos?(l=r(m),i.pushComponent(l.components,void 0,!0)):((l=d).newPos++,i.pushComponent(l.components,!0,void 0)),f=i.extractCommon(l,t,e,n),l.newPos+1>=a&&f+1>=c)return s(o(i,l.components,t,e,i.useLongestToken));p[n]=l}else p[n]=void 0}u++}if(l)!function e(){setTimeout((function(){if(u>d)return l();f()||e()}),0)}();else for(;u<=d;){var g=f();if(g)return g}},pushComponent:function(e,t,n){var o=e[e.length-1];o&&o.added===t&&o.removed===n?e[e.length-1]={count:o.count+1,added:t,removed:n}:e.push({count:1,added:t,removed:n})},extractCommon:function(e,t,n,o){for(var r=t.length,l=n.length,i=e.newPos,s=i-o,a=0;i+1<r&&s+1<l&&this.equals(t[i+1],n[s+1]);)i++,s++,a++;return a&&e.components.push({count:a}),e.newPos=i,s},equals:function(e,t){return this.options.comparator?this.options.comparator(e,t):e===t||this.options.ignoreCase&&e.toLowerCase()===t.toLowerCase()},removeEmpty:function(e){for(var t=[],n=0;n<e.length;n++)e[n]&&t.push(e[n]);return t},castInput:function(e){return e},tokenize:function(e){return e.split("")},join:function(e){return e.join("")}}},1973:function(e,t,n){"use strict";var o;t.Kx=function(e,t,n){return r.diff(e,t,n)};var r=new(((o=n(1198))&&o.__esModule?o:{default:o}).default)},1345:function(e,t,n){"use strict";var o=n(5022);e.exports=function(e,t,n){n=n||{},9===t.nodeType&&(t=o.getWindow(t));var r=n.allowHorizontalScroll,l=n.onlyScrollIfNeeded,i=n.alignWithTop,s=n.alignWithLeft,a=n.offsetTop||0,c=n.offsetLeft||0,u=n.offsetBottom||0,d=n.offsetRight||0;r=void 0===r||r;var p=o.isWindow(t),m=!(!p||!t.frameElement),f=o.offset(e),g=o.outerHeight(e),h=o.outerWidth(e),v=void 0,b=void 0,k=void 0,_=void 0,y=void 0,E=void 0,C=void 0,S=void 0,w=void 0,B=void 0;m&&(t=t.document.scrollingElement||t.document.body),p||m?(C=t,B=o.height(C),w=o.width(C),S={left:o.scrollLeft(C),top:o.scrollTop(C)},y={left:f.left-S.left-c,top:f.top-S.top-a},E={left:f.left+h-(S.left+w)+d,top:f.top+g-(S.top+B)+u},_=S):(v=o.offset(t),b=t.clientHeight,k=t.clientWidth,_={left:t.scrollLeft,top:t.scrollTop},y={left:f.left-(v.left+(parseFloat(o.css(t,"borderLeftWidth"))||0))-c,top:f.top-(v.top+(parseFloat(o.css(t,"borderTopWidth"))||0))-a},E={left:f.left+h-(v.left+k+(parseFloat(o.css(t,"borderRightWidth"))||0))+d,top:f.top+g-(v.top+b+(parseFloat(o.css(t,"borderBottomWidth"))||0))+u}),y.top<0||E.top>0?!0===i?o.scrollTop(t,_.top+y.top):!1===i?o.scrollTop(t,_.top+E.top):y.top<0?o.scrollTop(t,_.top+y.top):o.scrollTop(t,_.top+E.top):l||((i=void 0===i||!!i)?o.scrollTop(t,_.top+y.top):o.scrollTop(t,_.top+E.top)),r&&(y.left<0||E.left>0?!0===s?o.scrollLeft(t,_.left+y.left):!1===s?o.scrollLeft(t,_.left+E.left):y.left<0?o.scrollLeft(t,_.left+y.left):o.scrollLeft(t,_.left+E.left):l||((s=void 0===s||!!s)?o.scrollLeft(t,_.left+y.left):o.scrollLeft(t,_.left+E.left)))}},5425:function(e,t,n){"use strict";e.exports=n(1345)},5022:function(e){"use strict";var t=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function o(e,t){var n=e["page"+(t?"Y":"X")+"Offset"],o="scroll"+(t?"Top":"Left");if("number"!=typeof n){var r=e.document;"number"!=typeof(n=r.documentElement[o])&&(n=r.body[o])}return n}function r(e){return o(e)}function l(e){return o(e,!0)}function i(e){var t=function(e){var t,n=void 0,o=void 0,r=e.ownerDocument,l=r.body,i=r&&r.documentElement;return n=(t=e.getBoundingClientRect()).left,o=t.top,{left:n-=i.clientLeft||l.clientLeft||0,top:o-=i.clientTop||l.clientTop||0}}(e),n=e.ownerDocument,o=n.defaultView||n.parentWindow;return t.left+=r(o),t.top+=l(o),t}var s=new RegExp("^("+/[\-+]?(?:\d*\.|)\d+(?:[eE][\-+]?\d+|)/.source+")(?!px)[a-z%]+$","i"),a=/^(top|right|bottom|left)$/,c=void 0;function u(e,t){for(var n=0;n<e.length;n++)t(e[n])}function d(e){return"border-box"===c(e,"boxSizing")}"undefined"!=typeof window&&(c=window.getComputedStyle?function(e,t,n){var o="",r=e.ownerDocument,l=n||r.defaultView.getComputedStyle(e,null);return l&&(o=l.getPropertyValue(t)||l[t]),o}:function(e,t){var n=e.currentStyle&&e.currentStyle[t];if(s.test(n)&&!a.test(t)){var o=e.style,r=o.left,l=e.runtimeStyle.left;e.runtimeStyle.left=e.currentStyle.left,o.left="fontSize"===t?"1em":n||0,n=o.pixelLeft+"px",o.left=r,e.runtimeStyle.left=l}return""===n?"auto":n});var p=["margin","border","padding"];function m(e,t,n){var o={},r=e.style,l=void 0;for(l in t)t.hasOwnProperty(l)&&(o[l]=r[l],r[l]=t[l]);for(l in n.call(e),t)t.hasOwnProperty(l)&&(r[l]=o[l])}function f(e,t,n){var o=0,r=void 0,l=void 0,i=void 0;for(l=0;l<t.length;l++)if(r=t[l])for(i=0;i<n.length;i++){var s;s="border"===r?r+n[i]+"Width":r+n[i],o+=parseFloat(c(e,s))||0}return o}function g(e){return null!=e&&e==e.window}var h={};function v(e,t,n){if(g(e))return"width"===t?h.viewportWidth(e):h.viewportHeight(e);if(9===e.nodeType)return"width"===t?h.docWidth(e):h.docHeight(e);var o="width"===t?["Left","Right"]:["Top","Bottom"],r="width"===t?e.offsetWidth:e.offsetHeight,l=(c(e),d(e)),i=0;(null==r||r<=0)&&(r=void 0,(null==(i=c(e,t))||Number(i)<0)&&(i=e.style[t]||0),i=parseFloat(i)||0),void 0===n&&(n=l?1:-1);var s=void 0!==r||l,a=r||i;if(-1===n)return s?a-f(e,["border","padding"],o):i;if(s){var u=2===n?-f(e,["border"],o):f(e,["margin"],o);return a+(1===n?0:u)}return i+f(e,p.slice(n),o)}u(["Width","Height"],(function(e){h["doc"+e]=function(t){var n=t.document;return Math.max(n.documentElement["scroll"+e],n.body["scroll"+e],h["viewport"+e](n))},h["viewport"+e]=function(t){var n="client"+e,o=t.document,r=o.body,l=o.documentElement[n];return"CSS1Compat"===o.compatMode&&l||r&&r[n]||l}}));var b={position:"absolute",visibility:"hidden",display:"block"};function k(e){var t=void 0,n=arguments;return 0!==e.offsetWidth?t=v.apply(void 0,n):m(e,b,(function(){t=v.apply(void 0,n)})),t}function _(e,t,o){var r=o;if("object"!==(void 0===t?"undefined":n(t)))return void 0!==r?("number"==typeof r&&(r+="px"),void(e.style[t]=r)):c(e,t);for(var l in t)t.hasOwnProperty(l)&&_(e,l,t[l])}u(["width","height"],(function(e){var t=e.charAt(0).toUpperCase()+e.slice(1);h["outer"+t]=function(t,n){return t&&k(t,e,n?0:1)};var n="width"===e?["Left","Right"]:["Top","Bottom"];h[e]=function(t,o){return void 0===o?t&&k(t,e,-1):t?(c(t),d(t)&&(o+=f(t,["padding","border"],n)),_(t,e,o)):void 0}})),e.exports=t({getWindow:function(e){var t=e.ownerDocument||e;return t.defaultView||t.parentWindow},offset:function(e,t){if(void 0===t)return i(e);!function(e,t){"static"===_(e,"position")&&(e.style.position="relative");var n=i(e),o={},r=void 0,l=void 0;for(l in t)t.hasOwnProperty(l)&&(r=parseFloat(_(e,l))||0,o[l]=r+t[l]-n[l]);_(e,o)}(e,t)},isWindow:g,each:u,css:_,clone:function(e){var t={};for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);if(e.overflow)for(var n in e)e.hasOwnProperty(n)&&(t.overflow[n]=e.overflow[n]);return t},scrollLeft:function(e,t){if(g(e)){if(void 0===t)return r(e);window.scrollTo(t,l(e))}else{if(void 0===t)return e.scrollLeft;e.scrollLeft=t}},scrollTop:function(e,t){if(g(e)){if(void 0===t)return l(e);window.scrollTo(r(e),t)}else{if(void 0===t)return e.scrollTop;e.scrollTop=t}},viewportWidth:0,viewportHeight:0},h)},8575:function(e){"function"==typeof Object.create?e.exports=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:e.exports=function(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}},9894:function(e,t,n){var o=n(4827);e.exports=function(e){var t=o(e,"line-height"),n=parseFloat(t,10);if(t===n+""){var r=e.style.lineHeight;e.style.lineHeight=t+"em",t=o(e,"line-height"),n=parseFloat(t,10),r?e.style.lineHeight=r:delete e.style.lineHeight}if(-1!==t.indexOf("pt")?(n*=4,n/=3):-1!==t.indexOf("mm")?(n*=96,n/=25.4):-1!==t.indexOf("cm")?(n*=96,n/=2.54):-1!==t.indexOf("in")?n*=96:-1!==t.indexOf("pc")&&(n*=16),n=Math.round(n),"normal"===t){var l=e.nodeName,i=document.createElement(l);i.innerHTML=" ","TEXTAREA"===l.toUpperCase()&&i.setAttribute("rows","1");var s=o(e,"font-size");i.style.fontSize=s,i.style.padding="0px",i.style.border="0px";var a=document.body;a.appendChild(i),n=i.offsetHeight,a.removeChild(i)}return n}},5372:function(e,t,n){"use strict";var o=n(9567);function r(){}function l(){}l.resetWarningCache=r,e.exports=function(){function e(e,t,n,r,l,i){if(i!==o){var s=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:l,resetWarningCache:r};return n.PropTypes=n,n}},2652:function(e,t,n){e.exports=n(5372)()},9567:function(e){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},5438:function(e,t,n){"use strict";var o,r=this&&this.__extends||(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function __(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)}),l=this&&this.__assign||Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},i=this&&this.__rest||function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&(n[o[r]]=e[o[r]])}return n};t.__esModule=!0;var s=n(9196),a=n(2652),c=n(6411),u=n(9894),d="autosize:resized",p=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.state={lineHeight:null},t.textarea=null,t.onResize=function(e){t.props.onResize&&t.props.onResize(e)},t.updateLineHeight=function(){t.textarea&&t.setState({lineHeight:u(t.textarea)})},t.onChange=function(e){var n=t.props.onChange;t.currentValue=e.currentTarget.value,n&&n(e)},t}return r(t,e),t.prototype.componentDidMount=function(){var e=this,t=this.props,n=t.maxRows,o=t.async;"number"==typeof n&&this.updateLineHeight(),"number"==typeof n||o?setTimeout((function(){return e.textarea&&c(e.textarea)})):this.textarea&&c(this.textarea),this.textarea&&this.textarea.addEventListener(d,this.onResize)},t.prototype.componentWillUnmount=function(){this.textarea&&(this.textarea.removeEventListener(d,this.onResize),c.destroy(this.textarea))},t.prototype.render=function(){var e=this,t=this.props,n=(t.onResize,t.maxRows),o=(t.onChange,t.style),r=(t.innerRef,t.children),a=i(t,["onResize","maxRows","onChange","style","innerRef","children"]),c=this.state.lineHeight,u=n&&c?c*n:null;return s.createElement("textarea",l({},a,{onChange:this.onChange,style:u?l({},o,{maxHeight:u}):o,ref:function(t){e.textarea=t,"function"==typeof e.props.innerRef?e.props.innerRef(t):e.props.innerRef&&(e.props.innerRef.current=t)}}),r)},t.prototype.componentDidUpdate=function(){this.textarea&&c.update(this.textarea)},t.defaultProps={rows:1,async:!1},t.propTypes={rows:a.number,maxRows:a.number,onResize:a.func,innerRef:a.any,async:a.bool},t}(s.Component);t.TextareaAutosize=s.forwardRef((function(e,t){return s.createElement(p,l({},e,{innerRef:t}))}))},773:function(e,t,n){"use strict";var o=n(5438);t.Z=o.TextareaAutosize},3124:function(e){var t=e.exports=function(e){return new n(e)};function n(e){this.value=e}function o(e,t,n){var o=[],i=[],u=!0;return function e(d){var p=n?r(d):d,m={},f=!0,g={node:p,node_:d,path:[].concat(o),parent:i[i.length-1],parents:i,key:o.slice(-1)[0],isRoot:0===o.length,level:o.length,circular:null,update:function(e,t){g.isRoot||(g.parent.node[g.key]=e),g.node=e,t&&(f=!1)},delete:function(e){delete g.parent.node[g.key],e&&(f=!1)},remove:function(e){s(g.parent.node)?g.parent.node.splice(g.key,1):delete g.parent.node[g.key],e&&(f=!1)},keys:null,before:function(e){m.before=e},after:function(e){m.after=e},pre:function(e){m.pre=e},post:function(e){m.post=e},stop:function(){u=!1},block:function(){f=!1}};if(!u)return g;function h(){if("object"==typeof g.node&&null!==g.node){g.keys&&g.node_===g.node||(g.keys=l(g.node)),g.isLeaf=0==g.keys.length;for(var e=0;e<i.length;e++)if(i[e].node_===d){g.circular=i[e];break}}else g.isLeaf=!0,g.keys=null;g.notLeaf=!g.isLeaf,g.notRoot=!g.isRoot}h();var v=t.call(g,g.node);return void 0!==v&&g.update&&g.update(v),m.before&&m.before.call(g,g.node),f?("object"!=typeof g.node||null===g.node||g.circular||(i.push(g),h(),a(g.keys,(function(t,r){o.push(t),m.pre&&m.pre.call(g,g.node[t],t);var l=e(g.node[t]);n&&c.call(g.node,t)&&(g.node[t]=l.node),l.isLast=r==g.keys.length-1,l.isFirst=0==r,m.post&&m.post.call(g,l),o.pop()})),i.pop()),m.after&&m.after.call(g,g.node),g):g}(e).node}function r(e){if("object"==typeof e&&null!==e){var t;if(s(e))t=[];else if("[object Date]"===i(e))t=new Date(e.getTime?e.getTime():e);else if("[object RegExp]"===i(e))t=new RegExp(e);else if(function(e){return"[object Error]"===i(e)}(e))t={message:e.message};else if(function(e){return"[object Boolean]"===i(e)}(e))t=new Boolean(e);else if(function(e){return"[object Number]"===i(e)}(e))t=new Number(e);else if(function(e){return"[object String]"===i(e)}(e))t=new String(e);else if(Object.create&&Object.getPrototypeOf)t=Object.create(Object.getPrototypeOf(e));else if(e.constructor===Object)t={};else{var n=e.constructor&&e.constructor.prototype||e.__proto__||{},o=function(){};o.prototype=n,t=new o}return a(l(e),(function(n){t[n]=e[n]})),t}return e}n.prototype.get=function(e){for(var t=this.value,n=0;n<e.length;n++){var o=e[n];if(!t||!c.call(t,o)){t=void 0;break}t=t[o]}return t},n.prototype.has=function(e){for(var t=this.value,n=0;n<e.length;n++){var o=e[n];if(!t||!c.call(t,o))return!1;t=t[o]}return!0},n.prototype.set=function(e,t){for(var n=this.value,o=0;o<e.length-1;o++){var r=e[o];c.call(n,r)||(n[r]={}),n=n[r]}return n[e[o]]=t,t},n.prototype.map=function(e){return o(this.value,e,!0)},n.prototype.forEach=function(e){return this.value=o(this.value,e,!1),this.value},n.prototype.reduce=function(e,t){var n=1===arguments.length,o=n?this.value:t;return this.forEach((function(t){this.isRoot&&n||(o=e.call(this,o,t))})),o},n.prototype.paths=function(){var e=[];return this.forEach((function(t){e.push(this.path)})),e},n.prototype.nodes=function(){var e=[];return this.forEach((function(t){e.push(this.node)})),e},n.prototype.clone=function(){var e=[],t=[];return function n(o){for(var i=0;i<e.length;i++)if(e[i]===o)return t[i];if("object"==typeof o&&null!==o){var s=r(o);return e.push(o),t.push(s),a(l(o),(function(e){s[e]=n(o[e])})),e.pop(),t.pop(),s}return o}(this.value)};var l=Object.keys||function(e){var t=[];for(var n in e)t.push(n);return t};function i(e){return Object.prototype.toString.call(e)}var s=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)},a=function(e,t){if(e.forEach)return e.forEach(t);for(var n=0;n<e.length;n++)t(e[n],n,e)};a(l(n.prototype),(function(e){t[e]=function(t){var o=[].slice.call(arguments,1),r=new n(t);return r[e].apply(r,o)}}));var c=Object.hasOwnProperty||function(e,t){return t in e}},9196:function(e){"use strict";e.exports=window.React}},t={};function n(o){var r=t[o];if(void 0!==r)return r.exports;var l=t[o]={exports:{}};return e[o].call(l.exports,l,l.exports,n),l.exports}n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,{a:t}),t},n.d=function(e,t){for(var o in t)n.o(t,o)&&!n.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var o={};!function(){"use strict";n.r(o),n.d(o,{AlignmentControl:function(){return Ov},AlignmentToolbar:function(){return Fv},Autocomplete:function(){return Kv},BlockAlignmentControl:function(){return jr},BlockAlignmentToolbar:function(){return Kr},BlockBreadcrumb:function(){return Xv},BlockColorsStyleSelector:function(){return ob},BlockContextProvider:function(){return dl},BlockControls:function(){return io},BlockEdit:function(){return gl},BlockEditorKeyboardShortcuts:function(){return xy},BlockEditorProvider:function(){return Gc},BlockFormatControls:function(){return lo},BlockIcon:function(){return zc},BlockInspector:function(){return Sy},BlockList:function(){return Mf},BlockMover:function(){return Xp},BlockNavigationDropdown:function(){return Cb},BlockPreview:function(){return fd},BlockSelectionClearer:function(){return $c},BlockSettingsMenu:function(){return Jm},BlockSettingsMenuControls:function(){return Ym},BlockStyles:function(){return Ib},BlockTitle:function(){return Fp},BlockToolbar:function(){return af},BlockTools:function(){return wy},BlockVerticalAlignmentControl:function(){return dr},BlockVerticalAlignmentToolbar:function(){return pr},ButtonBlockAppender:function(){return Ip},ButtonBlockerAppender:function(){return Bp},ColorPalette:function(){return Wb},ColorPaletteControl:function(){return $b},ContrastChecker:function(){return Bg},CopyHandler:function(){return Mm},DefaultBlockAppender:function(){return Sp},FontSizePicker:function(){return mh},InnerBlocks:function(){return xf},Inserter:function(){return Cp},InspectorAdvancedControls:function(){return Lo},InspectorControls:function(){return Ao},JustifyContentControl:function(){return gr},JustifyToolbar:function(){return hr},LineHeightControl:function(){return Yg},MediaPlaceholder:function(){return y_},MediaReplaceFlow:function(){return g_},MediaUpload:function(){return m_},MediaUploadCheck:function(){return f_},MultiSelectScrollIntoView:function(){return Ty},NavigableToolbar:function(){return Gp},ObserveTyping:function(){return Ry},PanelColorSettings:function(){return E_},PlainText:function(){return Q_},RichText:function(){return K_},RichTextShortcut:function(){return J_},RichTextToolbarButton:function(){return ey},SETTINGS_DEFAULTS:function(){return v},SkipToSelectedBlock:function(){return by},ToolSelector:function(){return oy},Typewriter:function(){return Oy},URLInput:function(){return Hk},URLInputButton:function(){return sy},URLPopover:function(){return b_},Warning:function(){return vl},WritingFlow:function(){return lu},__experimentalBlockAlignmentMatrixControl:function(){return Qv},__experimentalBlockFullHeightAligmentControl:function(){return Yv},__experimentalBlockPatternSetup:function(){return zb},__experimentalBlockPatternsList:function(){return Od},__experimentalBlockVariationPicker:function(){return Tb},__experimentalBlockVariationTransforms:function(){return Gb},__experimentalBorderRadiusControl:function(){return Kf},__experimentalColorGradientControl:function(){return _g},__experimentalColorGradientSettingsDropdown:function(){return wg},__experimentalDateFormatPicker:function(){return qb},__experimentalDuotoneControl:function(){return tv},__experimentalFontAppearanceControl:function(){return qg},__experimentalFontFamilyControl:function(){return lh},__experimentalGetBorderClassesAndStyles:function(){return vv},__experimentalGetColorClassesAndStyles:function(){return kv},__experimentalGetGradientClass:function(){return pg},__experimentalGetGradientObjectByGradientValue:function(){return fg},__experimentalGetMatchingVariation:function(){return Hy},__experimentalGetSpacingClassesAndStyles:function(){return Ev},__experimentalImageEditingProvider:function(){return Ck},__experimentalImageEditor:function(){return Rk},__experimentalImageSizeControl:function(){return Ak},__experimentalImageURLInputUI:function(){return gy},__experimentalLayoutStyle:function(){return Ar},__experimentalLetterSpacingControl:function(){return Ah},__experimentalLibrary:function(){return By},__experimentalLinkControl:function(){return u_},__experimentalLinkControlSearchInput:function(){return n_},__experimentalLinkControlSearchItem:function(){return Wk},__experimentalLinkControlSearchResults:function(){return Qk},__experimentalListView:function(){return yb},__experimentalPanelColorGradientSettings:function(){return ok},__experimentalPreviewOptions:function(){return hy},__experimentalResponsiveBlockControl:function(){return X_},__experimentalTextDecorationControl:function(){return Ch},__experimentalTextTransformControl:function(){return Ph},__experimentalUnitControl:function(){return ry},__experimentalUseBlockOverlayActive:function(){return Jv},__experimentalUseBlockPreview:function(){return gd},__experimentalUseBorderProps:function(){return bv},__experimentalUseColorProps:function(){return yv},__experimentalUseCustomSides:function(){return Jo},__experimentalUseGradient:function(){return hg},__experimentalUseNoRecursiveRenders:function(){return Vy},__experimentalUseResizeCanvas:function(){return vy},__unstableBlockNameContext:function(){return sf},__unstableBlockSettingsMenuFirstItem:function(){return Fm},__unstableBlockToolbarLastItem:function(){return Bm},__unstableEditorStyles:function(){return ud},__unstableIframe:function(){return au},__unstableInserterMenuExtension:function(){return pp},__unstablePresetDuotoneFilter:function(){return dv},__unstableRichTextInputEvent:function(){return ty},__unstableUseBlockSelectionClearer:function(){return Wc},__unstableUseClipboardHandler:function(){return Pm},__unstableUseMouseMoveTypingReset:function(){return Py},__unstableUseTypewriter:function(){return Dy},__unstableUseTypingObserver:function(){return My},createCustomColorsHOC:function(){return Iv},getColorClassName:function(){return Zf},getColorObjectByAttributeValues:function(){return Yf},getColorObjectByColorValue:function(){return Qf},getFontSize:function(){return uh},getFontSizeClass:function(){return ph},getFontSizeObjectByValue:function(){return dh},getGradientSlugByValue:function(){return gg},getGradientValueBySlug:function(){return mg},getPxFromCssUnit:function(){return Zy},store:function(){return Qn},storeConfig:function(){return Yn},transformStyles:function(){return sd},useBlockDisplayInformation:function(){return Dp},useBlockEditContext:function(){return eo},useBlockProps:function(){return xc},useCachedTruthy:function(){return Cv},useInnerBlocksProps:function(){return If},useSetting:function(){return Co},withColorContext:function(){return Ub},withColors:function(){return xv},withFontSizes:function(){return Nv}});var e={};n.r(e),n.d(e,{__experimentalGetActiveBlockIdByBlockNames:function(){return zt},__experimentalGetAllowedBlocks:function(){return kt},__experimentalGetAllowedPatterns:function(){return Ct},__experimentalGetBlockListSettingsForBlocks:function(){return Tt},__experimentalGetDirectInsertBlock:function(){return _t},__experimentalGetGlobalBlocksByName:function(){return te},__experimentalGetLastBlockAttributeChanges:function(){return Mt},__experimentalGetParsedPattern:function(){return yt},__experimentalGetPatternTransformItems:function(){return wt},__experimentalGetPatternsByBlockTypes:function(){return St},__experimentalGetReusableBlockTitle:function(){return Nt},__unstableGetBlockWithoutInnerBlocks:function(){return q},__unstableGetClientIdWithClientIdsTree:function(){return Q},__unstableGetClientIdsTree:function(){return Z},__unstableGetSelectedBlocksWithPartialSelection:function(){return Le},__unstableIsFullySelected:function(){return Pe},__unstableIsLastBlockChangeIgnored:function(){return Pt},__unstableIsSelectionCollapsed:function(){return Me},__unstableIsSelectionMergeable:function(){return Re},areInnerBlocksControlled:function(){return Ft},canEditBlock:function(){return ct},canInsertBlockType:function(){return ot},canInsertBlocks:function(){return rt},canLockBlockType:function(){return ut},canMoveBlock:function(){return st},canMoveBlocks:function(){return at},canRemoveBlock:function(){return lt},canRemoveBlocks:function(){return it},didAutomaticChange:function(){return Dt},getAdjacentBlockClientId:function(){return ve},getBlock:function(){return K},getBlockAttributes:function(){return j},getBlockCount:function(){return oe},getBlockHierarchyRootClientId:function(){return ge},getBlockIndex:function(){return De},getBlockInsertionPoint:function(){return Qe},getBlockListSettings:function(){return Bt},getBlockMode:function(){return Ue},getBlockName:function(){return W},getBlockOrder:function(){return Ae},getBlockParents:function(){return me},getBlockParentsByBlockName:function(){return fe},getBlockRootClientId:function(){return pe},getBlockSelectionEnd:function(){return se},getBlockSelectionStart:function(){return ie},getBlockTransformItems:function(){return vt},getBlocks:function(){return Y},getBlocksByClientId:function(){return ne},getClientIdsOfDescendants:function(){return X},getClientIdsWithDescendants:function(){return J},getDraggedBlockClientIds:function(){return je},getFirstMultiSelectedBlockClientId:function(){return Se},getGlobalBlockCount:function(){return ee},getInserterItems:function(){return ht},getLastMultiSelectedBlockClientId:function(){return we},getLowestCommonAncestorWithSelectedBlock:function(){return he},getMultiSelectedBlockClientIds:function(){return Ee},getMultiSelectedBlocks:function(){return Ce},getMultiSelectedBlocksEndClientId:function(){return Ne},getMultiSelectedBlocksStartClientId:function(){return Te},getNextBlockClientId:function(){return ke},getPreviousBlockClientId:function(){return be},getSelectedBlock:function(){return de},getSelectedBlockClientId:function(){return ue},getSelectedBlockClientIds:function(){return ye},getSelectedBlockCount:function(){return ae},getSelectedBlocksInitialCaretPosition:function(){return _e},getSelectionEnd:function(){return le},getSelectionStart:function(){return re},getSettings:function(){return It},getTemplate:function(){return Je},getTemplateLock:function(){return et},hasBlockMovingClientId:function(){return At},hasInserterItems:function(){return bt},hasMultiSelection:function(){return Ve},hasSelectedBlock:function(){return ce},hasSelectedInnerBlock:function(){return Fe},isAncestorBeingDragged:function(){return qe},isAncestorMultiSelected:function(){return xe},isBlockBeingDragged:function(){return Ke},isBlockHighlighted:function(){return Ot},isBlockInsertionPointVisible:function(){return Ze},isBlockMultiSelected:function(){return Ie},isBlockSelected:function(){return Oe},isBlockValid:function(){return $},isBlockWithinSelection:function(){return ze},isCaretWithinFormattedText:function(){return Ye},isDraggingBlocks:function(){return $e},isFirstMultiSelectedBlock:function(){return Be},isLastBlockChangePersistent:function(){return xt},isMultiSelecting:function(){return He},isNavigationMode:function(){return Lt},isSelectionEnabled:function(){return Ge},isTyping:function(){return We},isValidTemplate:function(){return Xe},wasBlockJustInserted:function(){return Vt}});var t={};n.r(t),n.d(t,{__unstableDeleteSelection:function(){return vn},__unstableExpandSelection:function(){return kn},__unstableMarkAutomaticChange:function(){return zn},__unstableMarkLastChangeAsPersistent:function(){return On},__unstableMarkNextChangeAsNotPersistent:function(){return Fn},__unstableSaveReusableBlock:function(){return Dn},__unstableSplitSelection:function(){return bn},clearSelectedBlock:function(){return en},duplicateBlocks:function(){return Gn},enterFormattedText:function(){return Nn},exitFormattedText:function(){return Pn},flashBlock:function(){return jn},hideInsertionPoint:function(){return fn},insertAfterBlock:function(){return Wn},insertBeforeBlock:function(){return Un},insertBlock:function(){return dn},insertBlocks:function(){return pn},insertDefaultBlock:function(){return Rn},mergeBlocks:function(){return yn},moveBlockToPosition:function(){return un},moveBlocksDown:function(){return sn},moveBlocksToPosition:function(){return cn},moveBlocksUp:function(){return an},multiSelect:function(){return Jt},receiveBlocks:function(){return $t},removeBlock:function(){return Cn},removeBlocks:function(){return En},replaceBlock:function(){return rn},replaceBlocks:function(){return on},replaceInnerBlocks:function(){return Sn},resetBlocks:function(){return Gt},resetSelection:function(){return Wt},selectBlock:function(){return qt},selectNextBlock:function(){return Qt},selectPreviousBlock:function(){return Yt},selectionChange:function(){return Mn},setBlockMovingClientId:function(){return Hn},setHasControlledInnerBlocks:function(){return Kn},setNavigationMode:function(){return Vn},setTemplateValidity:function(){return gn},showInsertionPoint:function(){return mn},startDraggingBlocks:function(){return xn},startMultiSelect:function(){return Zt},startTyping:function(){return Bn},stopDraggingBlocks:function(){return Tn},stopMultiSelect:function(){return Xt},stopTyping:function(){return In},synchronizeTemplate:function(){return hn},toggleBlockHighlight:function(){return $n},toggleBlockMode:function(){return wn},toggleSelection:function(){return tn},updateBlock:function(){return Kt},updateBlockAttributes:function(){return jt},updateBlockListSettings:function(){return Ln},updateSettings:function(){return An},validateBlocksToTemplate:function(){return Ut}});var r=window.wp.blocks,l=window.wp.hooks;function i(){return(i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e}).apply(this,arguments)}(0,l.addFilter)("blocks.registerBlockType","core/compat/migrateLightBlockWrapper",(function(e){const{apiVersion:t=1}=e;return t<2&&(0,r.hasBlockSupport)(e,"lightBlockWrapper",!1)&&(e.apiVersion=2),e}));var s=window.wp.element,a=n(4403),c=n.n(a),u=window.lodash,d=window.wp.compose,p=window.wp.components,m=window.wp.data,f={default:(0,p.createSlotFill)("BlockControls"),block:(0,p.createSlotFill)("BlockControlsBlock"),inline:(0,p.createSlotFill)("BlockFormatControls"),other:(0,p.createSlotFill)("BlockControlsOther"),parent:(0,p.createSlotFill)("BlockControlsParent")},g=window.wp.i18n;const h={insertUsage:{}},v={alignWide:!1,supportsLayout:!0,colors:[{name:(0,g.__)("Black"),slug:"black",color:"#000000"},{name:(0,g.__)("Cyan bluish gray"),slug:"cyan-bluish-gray",color:"#abb8c3"},{name:(0,g.__)("White"),slug:"white",color:"#ffffff"},{name:(0,g.__)("Pale pink"),slug:"pale-pink",color:"#f78da7"},{name:(0,g.__)("Vivid red"),slug:"vivid-red",color:"#cf2e2e"},{name:(0,g.__)("Luminous vivid orange"),slug:"luminous-vivid-orange",color:"#ff6900"},{name:(0,g.__)("Luminous vivid amber"),slug:"luminous-vivid-amber",color:"#fcb900"},{name:(0,g.__)("Light green cyan"),slug:"light-green-cyan",color:"#7bdcb5"},{name:(0,g.__)("Vivid green cyan"),slug:"vivid-green-cyan",color:"#00d084"},{name:(0,g.__)("Pale cyan blue"),slug:"pale-cyan-blue",color:"#8ed1fc"},{name:(0,g.__)("Vivid cyan blue"),slug:"vivid-cyan-blue",color:"#0693e3"},{name:(0,g.__)("Vivid purple"),slug:"vivid-purple",color:"#9b51e0"}],fontSizes:[{name:(0,g._x)("Small","font size name"),size:13,slug:"small"},{name:(0,g._x)("Normal","font size name"),size:16,slug:"normal"},{name:(0,g._x)("Medium","font size name"),size:20,slug:"medium"},{name:(0,g._x)("Large","font size name"),size:36,slug:"large"},{name:(0,g._x)("Huge","font size name"),size:42,slug:"huge"}],imageDefaultSize:"large",imageSizes:[{slug:"thumbnail",name:(0,g.__)("Thumbnail")},{slug:"medium",name:(0,g.__)("Medium")},{slug:"large",name:(0,g.__)("Large")},{slug:"full",name:(0,g.__)("Full Size")}],imageEditing:!0,maxWidth:580,allowedBlockTypes:!0,maxUploadFileSize:0,allowedMimeTypes:null,canLockBlocks:!0,__experimentalCanUserUseUnfilteredHTML:!1,__experimentalBlockDirectory:!1,__mobileEnablePageTemplates:!1,__experimentalBlockPatterns:[],__experimentalBlockPatternCategories:[],__unstableGalleryWithImageBlocks:!1,generateAnchors:!1,gradients:[{name:(0,g.__)("Vivid cyan blue to vivid purple"),gradient:"linear-gradient(135deg,rgba(6,147,227,1) 0%,rgb(155,81,224) 100%)",slug:"vivid-cyan-blue-to-vivid-purple"},{name:(0,g.__)("Light green cyan to vivid green cyan"),gradient:"linear-gradient(135deg,rgb(122,220,180) 0%,rgb(0,208,130) 100%)",slug:"light-green-cyan-to-vivid-green-cyan"},{name:(0,g.__)("Luminous vivid amber to luminous vivid orange"),gradient:"linear-gradient(135deg,rgba(252,185,0,1) 0%,rgba(255,105,0,1) 100%)",slug:"luminous-vivid-amber-to-luminous-vivid-orange"},{name:(0,g.__)("Luminous vivid orange to vivid red"),gradient:"linear-gradient(135deg,rgba(255,105,0,1) 0%,rgb(207,46,46) 100%)",slug:"luminous-vivid-orange-to-vivid-red"},{name:(0,g.__)("Very light gray to cyan bluish gray"),gradient:"linear-gradient(135deg,rgb(238,238,238) 0%,rgb(169,184,195) 100%)",slug:"very-light-gray-to-cyan-bluish-gray"},{name:(0,g.__)("Cool to warm spectrum"),gradient:"linear-gradient(135deg,rgb(74,234,220) 0%,rgb(151,120,209) 20%,rgb(207,42,186) 40%,rgb(238,44,130) 60%,rgb(251,105,98) 80%,rgb(254,248,76) 100%)",slug:"cool-to-warm-spectrum"},{name:(0,g.__)("Blush light purple"),gradient:"linear-gradient(135deg,rgb(255,206,236) 0%,rgb(152,150,240) 100%)",slug:"blush-light-purple"},{name:(0,g.__)("Blush bordeaux"),gradient:"linear-gradient(135deg,rgb(254,205,165) 0%,rgb(254,45,45) 50%,rgb(107,0,62) 100%)",slug:"blush-bordeaux"},{name:(0,g.__)("Luminous dusk"),gradient:"linear-gradient(135deg,rgb(255,203,112) 0%,rgb(199,81,192) 50%,rgb(65,88,208) 100%)",slug:"luminous-dusk"},{name:(0,g.__)("Pale ocean"),gradient:"linear-gradient(135deg,rgb(255,245,203) 0%,rgb(182,227,212) 50%,rgb(51,167,181) 100%)",slug:"pale-ocean"},{name:(0,g.__)("Electric grass"),gradient:"linear-gradient(135deg,rgb(202,248,128) 0%,rgb(113,206,126) 100%)",slug:"electric-grass"},{name:(0,g.__)("Midnight"),gradient:"linear-gradient(135deg,rgb(2,3,129) 0%,rgb(40,116,252) 100%)",slug:"midnight"}],__unstableResolvedAssets:{styles:[],scripts:[]}};function b(e,t,n){return[...e.slice(0,n),...(0,u.castArray)(t),...e.slice(n)]}function k(e,t,n){let o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;const r=[...e];return r.splice(t,o),b(r,e.slice(t,t+o),n)}function _(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const n={[t]:[]};return e.forEach((e=>{const{clientId:o,innerBlocks:r}=e;n[t].push(o),Object.assign(n,_(r,o))})),n}function y(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return e.reduce(((e,n)=>Object.assign(e,{[n.clientId]:t},y(n.innerBlocks,n.clientId))),{})}function E(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:u.identity;const n={},o=[...e];for(;o.length;){const{innerBlocks:e,...r}=o.shift();o.push(...e),n[r.clientId]=t(r)}return n}function C(e){return E(e,(e=>(0,u.omit)(e,"attributes")))}function S(e){return E(e,(e=>e.attributes))}function w(e,t){return"UPDATE_BLOCK_ATTRIBUTES"===e.type&&void 0!==t&&"UPDATE_BLOCK_ATTRIBUTES"===t.type&&(0,u.isEqual)(e.clientIds,t.clientIds)&&function(e,t){return(0,u.isEqual)((0,u.keys)(e),(0,u.keys)(t))}(e.attributes,t.attributes)}function B(e,t){const n={},o=[...t],r=[...t];for(;o.length;){const e=o.shift();o.push(...e.innerBlocks),r.push(...e.innerBlocks)}for(const e of r)n[e.clientId]={};for(const t of r)n[t.clientId]=Object.assign(n[t.clientId],{...e.byClientId[t.clientId],attributes:e.attributes[t.clientId],innerBlocks:t.innerBlocks.map((e=>n[e.clientId]))});return n}function I(e,t,n){let o=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const r=new Set([]),l=new Set;for(const t of n){let n=o?t:e.parents[t];do{if(e.controlledInnerBlocks[n]){l.add(n);break}r.add(n),n=e.parents[n]}while(void 0!==n)}for(const e of r)t[e]={...t[e]};for(const n of r)t[n].innerBlocks=(e.order[n]||[]).map((e=>t[e]));for(const n of l)t["controlled||"+n]={innerBlocks:(e.order[n]||[]).map((e=>t[e]))};return t}const x=(0,u.flow)(m.combineReducers,(e=>(t,n)=>{if(t&&"SAVE_REUSABLE_BLOCK_SUCCESS"===n.type){const{id:e,updatedId:o}=n;if(e===o)return t;(t={...t}).attributes=(0,u.mapValues)(t.attributes,((n,r)=>{const{name:l}=t.byClientId[r];return"core/block"===l&&n.ref===e?{...n,ref:o}:n}))}return e(t,n)}),(e=>function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;const o=e(t,n);if(o===t)return t;switch(o.tree=t.tree?t.tree:{},n.type){case"RECEIVE_BLOCKS":case"INSERT_BLOCKS":{const e=B(o,n.blocks);o.tree=I(o,{...o.tree,...e},n.rootClientId?[n.rootClientId]:[""],!0);break}case"UPDATE_BLOCK":o.tree=I(o,{...o.tree,[n.clientId]:{...o.tree[n.clientId],...o.byClientId[n.clientId],attributes:o.attributes[n.clientId]}},[n.clientId],!1);break;case"UPDATE_BLOCK_ATTRIBUTES":{const e=n.clientIds.reduce(((e,t)=>(e[t]={...o.tree[t],attributes:o.attributes[t]},e)),{});o.tree=I(o,{...o.tree,...e},n.clientIds,!1);break}case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":{const e=B(o,n.blocks);o.tree=I(o,{...(0,u.omit)(o.tree,n.replacedClientIds.concat(n.replacedClientIds.filter((t=>!e[t])).map((e=>"controlled||"+e)))),...e},n.blocks.map((e=>e.clientId)),!1);const r=[];for(const e of n.clientIds)void 0===t.parents[e]||""!==t.parents[e]&&!o.byClientId[t.parents[e]]||r.push(t.parents[e]);o.tree=I(o,o.tree,r,!0);break}case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":const e=[];for(const r of n.clientIds)void 0===t.parents[r]||""!==t.parents[r]&&!o.byClientId[t.parents[r]]||e.push(t.parents[r]);o.tree=I(o,(0,u.omit)(o.tree,n.removedClientIds.concat(n.removedClientIds.map((e=>"controlled||"+e)))),e,!0);break;case"MOVE_BLOCKS_TO_POSITION":{const e=[];n.fromRootClientId&&e.push(n.fromRootClientId),n.toRootClientId&&e.push(n.toRootClientId),n.fromRootClientId&&n.fromRootClientId||e.push(""),o.tree=I(o,o.tree,e,!0);break}case"MOVE_BLOCKS_UP":case"MOVE_BLOCKS_DOWN":{const e=[n.rootClientId?n.rootClientId:""];o.tree=I(o,o.tree,e,!0);break}case"SAVE_REUSABLE_BLOCK_SUCCESS":{const e=(0,u.keys)((0,u.omitBy)(o.attributes,((e,t)=>"core/block"!==o.byClientId[t].name||e.ref!==n.updatedId)));o.tree=I(o,{...o.tree,...e.reduce(((e,t)=>(e[t]={...o.byClientId[t],attributes:o.attributes[t],innerBlocks:o.tree[t].innerBlocks},e)),{})},e,!1)}}return o}),(e=>(t,n)=>{const o=e=>{let o=e;for(let r=0;r<o.length;r++)!t.order[o[r]]||n.keepControlledInnerBlocks&&n.keepControlledInnerBlocks[o[r]]||(o===e&&(o=[...o]),o.push(...t.order[o[r]]));return o};if(t)switch(n.type){case"REMOVE_BLOCKS":n={...n,type:"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN",removedClientIds:o(n.clientIds)};break;case"REPLACE_BLOCKS":n={...n,type:"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN",replacedClientIds:o(n.clientIds)}}return e(t,n)}),(e=>(t,n)=>{if("REPLACE_INNER_BLOCKS"!==n.type)return e(t,n);const o={};if(Object.keys(t.controlledInnerBlocks).length){const e=[...n.blocks];for(;e.length;){const{innerBlocks:n,...r}=e.shift();e.push(...n),t.controlledInnerBlocks[r.clientId]&&(o[r.clientId]=!0)}}let r=t;t.order[n.rootClientId]&&(r=e(r,{type:"REMOVE_BLOCKS",keepControlledInnerBlocks:o,clientIds:t.order[n.rootClientId]}));let l=r;return n.blocks.length&&(l=e(l,{...n,type:"INSERT_BLOCKS",index:0}),l.order={...l.order,...(0,u.reduce)(o,((e,n,o)=>(t.order[o]&&(e[o]=t.order[o]),e)),{})}),l}),(e=>(t,n)=>{if("RESET_BLOCKS"===n.type){const e={...t,byClientId:C(n.blocks),attributes:S(n.blocks),order:_(n.blocks),parents:y(n.blocks),controlledInnerBlocks:{}},o=B(e,n.blocks);return e.tree={...o,"":{innerBlocks:n.blocks.map((e=>o[e.clientId]))}},e}return e(t,n)}),(function(e){let t,n=!1;return(o,r)=>{let l=e(o,r);const i="MARK_LAST_CHANGE_AS_PERSISTENT"===r.type||n;if(o===l&&!i){var s;n="MARK_NEXT_CHANGE_AS_NOT_PERSISTENT"===r.type;const e=null===(s=null==o?void 0:o.isPersistentChange)||void 0===s||s;return o.isPersistentChange===e?o:{...l,isPersistentChange:e}}return l={...l,isPersistentChange:i?!n:!w(r,t)},t=r,n="MARK_NEXT_CHANGE_AS_NOT_PERSISTENT"===r.type,l}}),(function(e){const t=new Set(["RECEIVE_BLOCKS"]);return(n,o)=>{const r=e(n,o);return r!==n&&(r.isIgnoredChange=t.has(o.type)),r}}),(e=>(t,n)=>{if("SET_HAS_CONTROLLED_INNER_BLOCKS"===n.type){const o=e(t,{type:"REPLACE_INNER_BLOCKS",rootClientId:n.clientId,blocks:[]});return e(o,n)}return e(t,n)}))({byClientId(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"RECEIVE_BLOCKS":case"INSERT_BLOCKS":return{...e,...C(t.blocks)};case"UPDATE_BLOCK":if(!e[t.clientId])return e;const n=(0,u.omit)(t.updates,"attributes");return(0,u.isEmpty)(n)?e:{...e,[t.clientId]:{...e[t.clientId],...n}};case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":return t.blocks?{...(0,u.omit)(e,t.replacedClientIds),...C(t.blocks)}:e;case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":return(0,u.omit)(e,t.removedClientIds)}return e},attributes(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"RECEIVE_BLOCKS":case"INSERT_BLOCKS":return{...e,...S(t.blocks)};case"UPDATE_BLOCK":return e[t.clientId]&&t.updates.attributes?{...e,[t.clientId]:{...e[t.clientId],...t.updates.attributes}}:e;case"UPDATE_BLOCK_ATTRIBUTES":{if(t.clientIds.every((t=>!e[t])))return e;const n=t.clientIds.reduce(((n,o)=>({...n,[o]:(0,u.reduce)(t.uniqueByBlock?t.attributes[o]:t.attributes,((t,n,r)=>{var l,i;return n!==t[r]&&((t=(l=e[o])===(i=t)?{...l}:i)[r]=n),t}),e[o])})),{});return t.clientIds.every((t=>n[t]===e[t]))?e:{...e,...n}}case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":return t.blocks?{...(0,u.omit)(e,t.replacedClientIds),...S(t.blocks)}:e;case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":return(0,u.omit)(e,t.removedClientIds)}return e},order(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"RECEIVE_BLOCKS":{const n=_(t.blocks);return{...e,...(0,u.omit)(n,""),"":((null==e?void 0:e[""])||[]).concat(n[""])}}case"INSERT_BLOCKS":{const{rootClientId:n=""}=t,o=e[n]||[],r=_(t.blocks,n),{index:l=o.length}=t;return{...e,...r,[n]:b(o,r[n],l)}}case"MOVE_BLOCKS_TO_POSITION":{const{fromRootClientId:n="",toRootClientId:o="",clientIds:r}=t,{index:l=e[o].length}=t;if(n===o){const t=e[o].indexOf(r[0]);return{...e,[o]:k(e[o],t,l,r.length)}}return{...e,[n]:(0,u.without)(e[n],...r),[o]:b(e[o],r,l)}}case"MOVE_BLOCKS_UP":{const{clientIds:n,rootClientId:o=""}=t,r=(0,u.first)(n),l=e[o];if(!l.length||r===(0,u.first)(l))return e;const i=l.indexOf(r);return{...e,[o]:k(l,i,i-1,n.length)}}case"MOVE_BLOCKS_DOWN":{const{clientIds:n,rootClientId:o=""}=t,r=(0,u.first)(n),l=(0,u.last)(n),i=e[o];if(!i.length||l===(0,u.last)(i))return e;const s=i.indexOf(r);return{...e,[o]:k(i,s,s+1,n.length)}}case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":{const{clientIds:n}=t;if(!t.blocks)return e;const o=_(t.blocks);return(0,u.flow)([e=>(0,u.omit)(e,t.replacedClientIds),e=>({...e,...(0,u.omit)(o,"")}),e=>(0,u.mapValues)(e,(e=>(0,u.reduce)(e,((e,t)=>t===n[0]?[...e,...o[""]]:(-1===n.indexOf(t)&&e.push(t),e)),[])))])(e)}case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":return(0,u.flow)([e=>(0,u.omit)(e,t.removedClientIds),e=>(0,u.mapValues)(e,(e=>(0,u.without)(e,...t.removedClientIds)))])(e)}return e},parents(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"RECEIVE_BLOCKS":return{...e,...y(t.blocks)};case"INSERT_BLOCKS":return{...e,...y(t.blocks,t.rootClientId||"")};case"MOVE_BLOCKS_TO_POSITION":return{...e,...t.clientIds.reduce(((e,n)=>(e[n]=t.toRootClientId||"",e)),{})};case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":return{...(0,u.omit)(e,t.replacedClientIds),...y(t.blocks,e[t.clientIds[0]])};case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":return(0,u.omit)(e,t.removedClientIds)}return e},controlledInnerBlocks(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{type:t,clientId:n,hasControlledInnerBlocks:o}=arguments.length>1?arguments[1]:void 0;return"SET_HAS_CONTROLLED_INNER_BLOCKS"===t?{...e,[n]:o}:e}});function T(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"CLEAR_SELECTED_BLOCK":return e.clientId?{}:e;case"SELECT_BLOCK":return t.clientId===e.clientId?e:{clientId:t.clientId};case"REPLACE_INNER_BLOCKS":case"INSERT_BLOCKS":return t.updateSelection&&t.blocks.length?{clientId:t.blocks[0].clientId}:e;case"REMOVE_BLOCKS":return t.clientIds&&t.clientIds.length&&-1!==t.clientIds.indexOf(e.clientId)?{}:e;case"REPLACE_BLOCKS":{if(-1===t.clientIds.indexOf(e.clientId))return e;const n=t.blocks[t.indexToSelect]||t.blocks[t.blocks.length-1];return n?n.clientId===e.clientId?e:{clientId:n.clientId}:{}}}return e}var N,P,M=(0,m.combineReducers)({blocks:x,isTyping:function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"START_TYPING":return!0;case"STOP_TYPING":return!1}return e},draggedBlocks:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"START_DRAGGING_BLOCKS":return t.clientIds;case"STOP_DRAGGING_BLOCKS":return[]}return e},selection:function(){var e,t,n,o;let r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},l=arguments.length>1?arguments[1]:void 0;switch(l.type){case"SELECTION_CHANGE":return l.clientId?{selectionStart:{clientId:l.clientId,attributeKey:l.attributeKey,offset:l.startOffset},selectionEnd:{clientId:l.clientId,attributeKey:l.attributeKey,offset:l.endOffset}}:{selectionStart:l.start||r.selectionStart,selectionEnd:l.end||r.selectionEnd};case"RESET_SELECTION":const{selectionStart:i,selectionEnd:s}=l;return{selectionStart:i,selectionEnd:s};case"MULTI_SELECT":const{start:a,end:c}=l;return a===(null===(e=r.selectionStart)||void 0===e?void 0:e.clientId)&&c===(null===(t=r.selectionEnd)||void 0===t?void 0:t.clientId)?r:{selectionStart:{clientId:a},selectionEnd:{clientId:c}};case"RESET_BLOCKS":const u=null==r||null===(n=r.selectionStart)||void 0===n?void 0:n.clientId,d=null==r||null===(o=r.selectionEnd)||void 0===o?void 0:o.clientId;if(!u&&!d)return r;if(!l.blocks.some((e=>e.clientId===u)))return{selectionStart:{},selectionEnd:{}};if(!l.blocks.some((e=>e.clientId===d)))return{...r,selectionEnd:r.selectionStart}}return{selectionStart:T(r.selectionStart,l),selectionEnd:T(r.selectionEnd,l)}},isMultiSelecting:function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"START_MULTI_SELECT":return!0;case"STOP_MULTI_SELECT":return!1}return e},isSelectionEnabled:function(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"TOGGLE_SELECTION":return t.isSelectionEnabled}return e},initialPosition:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1?arguments[1]:void 0;return"REPLACE_BLOCKS"===t.type&&void 0!==t.initialPosition||["MULTI_SELECT","SELECT_BLOCK","RESET_SELECTION","INSERT_BLOCKS","REPLACE_INNER_BLOCKS"].includes(t.type)?t.initialPosition:e},blocksMode:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;if("TOGGLE_BLOCK_MODE"===t.type){const{clientId:n}=t;return{...e,[n]:e[n]&&"html"===e[n]?"visual":"html"}}return e},blockListSettings:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"REPLACE_BLOCKS":case"REMOVE_BLOCKS":return(0,u.omit)(e,t.clientIds);case"UPDATE_BLOCK_LIST_SETTINGS":{const{clientId:n}=t;return t.settings?(0,u.isEqual)(e[n],t.settings)?e:{...e,[n]:t.settings}:e.hasOwnProperty(n)?(0,u.omit)(e,n):e}}return e},insertionPoint:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SHOW_INSERTION_POINT":const{rootClientId:e,index:n,__unstableWithInserter:o}=t;return{rootClientId:e,index:n,__unstableWithInserter:o};case"HIDE_INSERTION_POINT":return null}return e},template:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{isValid:!0},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SET_TEMPLATE_VALIDITY":return{...e,isValid:t.isValid}}return e},settings:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:v,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"UPDATE_SETTINGS":return{...e,...t.settings}}return e},preferences:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:h,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"INSERT_BLOCKS":case"REPLACE_BLOCKS":return t.blocks.reduce(((e,n)=>{const{attributes:o,name:l}=n,i=(0,m.select)(r.store).getActiveBlockVariation(l,o);let s=null!=i&&i.name?`${l}/${i.name}`:l;const a={name:s};return"core/block"===l&&(a.ref=o.ref,s+="/"+o.ref),{...e,insertUsage:{...e.insertUsage,[s]:{time:t.time,count:e.insertUsage[s]?e.insertUsage[s].count+1:1,insert:a}}}}),e)}return e},lastBlockAttributesChange:function(e,t){switch(t.type){case"UPDATE_BLOCK":if(!t.updates.attributes)break;return{[t.clientId]:t.updates.attributes};case"UPDATE_BLOCK_ATTRIBUTES":return t.clientIds.reduce(((e,n)=>({...e,[n]:t.uniqueByBlock?t.attributes[n]:t.attributes})),{})}return null},isNavigationMode:function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0;return"INSERT_BLOCKS"!==t.type&&("SET_NAVIGATION_MODE"===t.type?t.isNavigationMode:e)},hasBlockMovingClientId:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1?arguments[1]:void 0;return"SET_BLOCK_MOVING_MODE"===t.type?t.hasBlockMovingClientId:"SET_NAVIGATION_MODE"===t.type?null:e},automaticChangeStatus:function(e,t){switch(t.type){case"MARK_AUTOMATIC_CHANGE":return"pending";case"MARK_AUTOMATIC_CHANGE_FINAL":return"pending"===e?"final":void 0;case"SELECTION_CHANGE":return"final"!==e?e:void 0;case"START_TYPING":case"STOP_TYPING":return e}},highlightedBlock:function(e,t){switch(t.type){case"TOGGLE_BLOCK_HIGHLIGHT":const{clientId:n,isHighlighted:o}=t;return o?n:e===n?null:e;case"SELECT_BLOCK":if(t.clientId!==e)return null}return e},lastBlockInserted:function(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;switch(n.type){case"INSERT_BLOCKS":return n.blocks.length?{clientId:n.blocks[0].clientId,source:null===(e=n.meta)||void 0===e?void 0:e.source}:t;case"RESET_BLOCKS":return{}}return t}});function R(e){return[e]}function L(){var e={clear:function(){e.head=null}};return e}function A(e,t,n){var o;if(e.length!==t.length)return!1;for(o=n;o<e.length;o++)if(e[o]!==t[o])return!1;return!0}function D(e,t){var n,o;function r(){n=P?new WeakMap:L()}function l(){var n,r,l,i,s,a=arguments.length;for(i=new Array(a),l=0;l<a;l++)i[l]=arguments[l];for(s=t.apply(null,i),(n=o(s)).isUniqueByDependants||(n.lastDependants&&!A(s,n.lastDependants,0)&&n.clear(),n.lastDependants=s),r=n.head;r;){if(A(r.args,i,1))return r!==n.head&&(r.prev.next=r.next,r.next&&(r.next.prev=r.prev),r.next=n.head,r.prev=null,n.head.prev=r,n.head=r),r.val;r=r.next}return r={val:e.apply(null,i)},i[0]=null,r.args=i,n.head&&(n.head.prev=r,r.next=n.head),n.head=r,r.val}return t||(t=R),o=P?function(e){var t,o,r,l,i,s=n,a=!0;for(t=0;t<e.length;t++){if(!(i=o=e[t])||"object"!=typeof i){a=!1;break}s.has(o)?s=s.get(o):(r=new WeakMap,s.set(o,r),s=r)}return s.has(N)||((l=L()).isUniqueByDependants=a,s.set(N,l)),s.get(N)}:function(){return n},l.getDependants=t,l.clear=r,r(),l}N={},P="undefined"!=typeof WeakMap;var O=window.wp.primitives,F=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M21.3 10.8l-5.6-5.6c-.7-.7-1.8-.7-2.5 0l-5.6 5.6c-.7.7-.7 1.8 0 2.5l5.6 5.6c.3.3.8.5 1.2.5s.9-.2 1.2-.5l5.6-5.6c.8-.7.8-1.9.1-2.5zm-1 1.4l-5.6 5.6c-.1.1-.3.1-.4 0l-5.6-5.6c-.1-.1-.1-.3 0-.4l5.6-5.6s.1-.1.2-.1.1 0 .2.1l5.6 5.6c.1.1.1.3 0 .4zm-16.6-.4L10 5.5l-1-1-6.3 6.3c-.7.7-.7 1.8 0 2.5L9 19.5l1.1-1.1-6.3-6.3c-.2 0-.2-.2-.1-.3z"})),z=window.wp.richText,V=window.wp.deprecated,H=n.n(V);function G(e){const{multiline:t,__unstableMultilineWrapperTags:n,__unstablePreserveWhiteSpace:o}=e;return{multilineTag:t,multilineWrapperTags:n,preserveWhiteSpace:o}}const U=[];function W(e,t){const n=e.blocks.byClientId[t],o="core/social-link";if("web"!==s.Platform.OS&&(null==n?void 0:n.name)===o){const n=e.blocks.attributes[t],{service:r}=n;return r?`core/social-link-${r}`:o}return n?n.name:null}function $(e,t){const n=e.blocks.byClientId[t];return!!n&&n.isValid}function j(e,t){return e.blocks.byClientId[t]?e.blocks.attributes[t]:null}function K(e,t){return e.blocks.byClientId[t]?e.blocks.tree[t]:null}const q=D(((e,t)=>{const n=e.blocks.byClientId[t];return n?{...n,attributes:j(e,t)}:null}),((e,t)=>[e.blocks.byClientId[t],e.blocks.attributes[t]]));function Y(e,t){var n;const o=t&&Ft(e,t)?"controlled||"+t:t||"";return(null===(n=e.blocks.tree[o])||void 0===n?void 0:n.innerBlocks)||U}const Q=D(((e,t)=>({clientId:t,innerBlocks:Z(e,t)})),(e=>[e.blocks.order])),Z=D((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return(0,u.map)(Ae(e,t),(t=>Q(e,t)))}),(e=>[e.blocks.order])),X=D(((e,t)=>{const n=[];for(const o of t)for(const t of Ae(e,o))n.push(t,...X(e,[t]));return n}),(e=>[e.blocks.order])),J=D((e=>{const t=[];for(const n of Ae(e))t.push(n,...X(e,[n]));return t}),(e=>[e.blocks.order])),ee=D(((e,t)=>{const n=J(e);return t?(0,u.reduce)(n,((n,o)=>e.blocks.byClientId[o].name===t?n+1:n),0):n.length}),(e=>[e.blocks.order,e.blocks.byClientId])),te=D(((e,t)=>{if(!t)return U;const n=J(e).filter((n=>e.blocks.byClientId[n].name===t));return n.length>0?n:U}),(e=>[e.blocks.order,e.blocks.byClientId])),ne=D(((e,t)=>(0,u.map)((0,u.castArray)(t),(t=>K(e,t)))),((e,t)=>(0,u.map)((0,u.castArray)(t),(t=>e.blocks.tree[t]))));function oe(e,t){return Ae(e,t).length}function re(e){return e.selection.selectionStart}function le(e){return e.selection.selectionEnd}function ie(e){return e.selection.selectionStart.clientId}function se(e){return e.selection.selectionEnd.clientId}function ae(e){return Ee(e).length||(e.selection.selectionStart.clientId?1:0)}function ce(e){const{selectionStart:t,selectionEnd:n}=e.selection;return!!t.clientId&&t.clientId===n.clientId}function ue(e){const{selectionStart:t,selectionEnd:n}=e.selection,{clientId:o}=t;return o&&o===n.clientId?o:null}function de(e){const t=ue(e);return t?K(e,t):null}function pe(e,t){return void 0!==e.blocks.parents[t]?e.blocks.parents[t]:null}const me=D((function(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const o=[];let r=t;for(;e.blocks.parents[r];)r=e.blocks.parents[r],o.push(r);return n?o:o.reverse()}),(e=>[e.blocks.parents])),fe=D((function(e,t,n){let o=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const r=me(e,t,o);return(0,u.map)((0,u.filter)((0,u.map)(r,(t=>({id:t,name:W(e,t)}))),(e=>{let{name:t}=e;return Array.isArray(n)?n.includes(t):t===n})),(e=>{let{id:t}=e;return t}))}),(e=>[e.blocks.parents]));function ge(e,t){let n,o=t;do{n=o,o=e.blocks.parents[o]}while(o);return n}function he(e,t){const n=ue(e),o=[...me(e,t),t],r=[...me(e,n),n];let l;const i=Math.min(o.length,r.length);for(let e=0;e<i&&o[e]===r[e];e++)l=o[e];return l}function ve(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;if(void 0===t&&(t=ue(e)),void 0===t&&(t=n<0?Se(e):we(e)),!t)return null;const o=pe(e,t);if(null===o)return null;const{order:r}=e.blocks,l=r[o],i=l.indexOf(t),s=i+1*n;return s<0||s===l.length?null:l[s]}function be(e,t){return ve(e,t,-1)}function ke(e,t){return ve(e,t,1)}function _e(e){return e.initialPosition}const ye=D((e=>{const{selectionStart:t,selectionEnd:n}=e.selection;if(void 0===t.clientId||void 0===n.clientId)return U;if(t.clientId===n.clientId)return[t.clientId];const o=pe(e,t.clientId);if(null===o)return U;const r=Ae(e,o),l=r.indexOf(t.clientId),i=r.indexOf(n.clientId);return l>i?r.slice(i,l+1):r.slice(l,i+1)}),(e=>[e.blocks.order,e.selection.selectionStart.clientId,e.selection.selectionEnd.clientId]));function Ee(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId===n.clientId?U:ye(e)}const Ce=D((e=>{const t=Ee(e);return t.length?t.map((t=>K(e,t))):U}),(e=>[...ye.getDependants(e),e.blocks.byClientId,e.blocks.order,e.blocks.attributes]));function Se(e){return(0,u.first)(Ee(e))||null}function we(e){return(0,u.last)(Ee(e))||null}function Be(e,t){return Se(e)===t}function Ie(e,t){return-1!==Ee(e).indexOf(t)}const xe=D(((e,t)=>{let n=t,o=!1;for(;n&&!o;)n=pe(e,n),o=Ie(e,n);return o}),(e=>[e.blocks.order,e.selection.selectionStart.clientId,e.selection.selectionEnd.clientId]));function Te(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId===n.clientId?null:t.clientId||null}function Ne(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId===n.clientId?null:n.clientId||null}function Pe(e){const t=re(e),n=le(e);return!t.attributeKey&&!n.attributeKey&&void 0===t.offset&&void 0===n.offset}function Me(e){const t=re(e),n=le(e);return!!t&&!!n&&t.clientId===n.clientId&&t.attributeKey===n.attributeKey&&t.offset===n.offset}function Re(e,t){const n=re(e),o=le(e);if(n.clientId===o.clientId)return!1;if(!n.attributeKey||!o.attributeKey||void 0===n.offset||void 0===o.offset)return!1;const l=pe(e,n.clientId);if(l!==pe(e,o.clientId))return!1;const i=Ae(e,l);let s,a;i.indexOf(n.clientId)>i.indexOf(o.clientId)?(s=o,a=n):(s=n,a=o);const c=t?a.clientId:s.clientId,u=t?s.clientId:a.clientId,d=K(e,c);if(!(0,r.getBlockType)(d.name).merge)return!1;const p=K(e,u);if(p.name===d.name)return!0;const m=(0,r.switchToBlockType)(p,d.name);return m&&m.length}const Le=e=>{const t=re(e),n=le(e);if(t.clientId===n.clientId)return U;if(!t.attributeKey||!n.attributeKey||void 0===t.offset||void 0===n.offset)return U;const o=pe(e,t.clientId);if(o!==pe(e,n.clientId))return U;const l=Ae(e,o),i=l.indexOf(t.clientId),s=l.indexOf(n.clientId),[a,c]=i>s?[n,t]:[t,n],u=K(e,a.clientId),d=(0,r.getBlockType)(u.name),p=K(e,c.clientId),m=(0,r.getBlockType)(p.name),f=u.attributes[a.attributeKey],g=p.attributes[c.attributeKey],h=d.attributes[a.attributeKey],v=m.attributes[c.attributeKey];let b=(0,z.create)({html:f,...G(h)}),k=(0,z.create)({html:g,...G(v)});return b=(0,z.remove)(b,0,a.offset),k=(0,z.remove)(k,c.offset,k.text.length),[{...u,attributes:{...u.attributes,[a.attributeKey]:(0,z.toHTMLString)({value:b,...G(h)})}},{...p,attributes:{...p.attributes,[c.attributeKey]:(0,z.toHTMLString)({value:k,...G(v)})}}]};function Ae(e,t){return e.blocks.order[t||""]||U}function De(e,t){return Ae(e,pe(e,t)).indexOf(t)}function Oe(e,t){const{selectionStart:n,selectionEnd:o}=e.selection;return n.clientId===o.clientId&&n.clientId===t}function Fe(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return(0,u.some)(Ae(e,t),(t=>Oe(e,t)||Ie(e,t)||n&&Fe(e,t,n)))}function ze(e,t){if(!t)return!1;const n=Ee(e),o=n.indexOf(t);return o>-1&&o<n.length-1}function Ve(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId!==n.clientId}function He(e){return e.isMultiSelecting}function Ge(e){return e.isSelectionEnabled}function Ue(e,t){return e.blocksMode[t]||"visual"}function We(e){return e.isTyping}function $e(e){return!!e.draggedBlocks.length}function je(e){return e.draggedBlocks}function Ke(e,t){return e.draggedBlocks.includes(t)}function qe(e,t){if(!$e(e))return!1;const n=me(e,t);return(0,u.some)(n,(t=>Ke(e,t)))}function Ye(){return H()('wp.data.select( "core/block-editor" ).isCaretWithinFormattedText',{since:"6.1",version:"6.3"}),!1}function Qe(e){let t,n;const{insertionPoint:o,selection:{selectionEnd:r}}=e;if(null!==o)return o;const{clientId:l}=r;return l?(t=pe(e,l)||void 0,n=De(e,r.clientId)+1):n=Ae(e).length,{rootClientId:t,index:n}}function Ze(e){return null!==e.insertionPoint}function Xe(e){return e.template.isValid}function Je(e){return e.settings.template}function et(e,t){if(!t)return e.settings.templateLock;const n=Bt(e,t);return n?n.templateLock:null}const tt=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return(0,u.isBoolean)(e)?e:(0,u.isArray)(e)?!(!e.includes("core/post-content")||null!==t)||e.includes(t):n},nt=function(e,t){let n,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(t&&"object"==typeof t?(n=t,t=n.name):n=(0,r.getBlockType)(t),!n)return!1;const{allowedBlockTypes:i}=It(e),s=tt(i,t,!0);if(!s)return!1;const a=!!et(e,o);if(a)return!1;const c=Bt(e,o);if(o&&void 0===c)return!1;const d=null==c?void 0:c.allowedBlocks,p=tt(d,t),m=n.parent,f=W(e,o),g=tt(m,f);let h=!0;const v=n.ancestor;if(v){const t=[o,...me(e,o)];h=(0,u.some)(t,(t=>tt(v,W(e,t))))}const b=h&&(null===p&&null===g||!0===p||!0===g);return b?(0,l.applyFilters)("blockEditor.__unstableCanInsertBlockType",b,n,o,{getBlock:K.bind(null,e),getBlockParentsByBlockName:fe.bind(null,e)}):b},ot=D(nt,((e,t,n)=>[e.blockListSettings[n],e.blocks.byClientId[n],e.settings.allowedBlockTypes,e.settings.templateLock]));function rt(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return t.every((t=>ot(e,W(e,t),n)))}function lt(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const o=j(e,t);if(null===o)return!0;const{lock:r}=o,l=!!et(e,n);return void 0===r||void 0===(null==r?void 0:r.remove)?!l:!(null!=r&&r.remove)}function it(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return t.every((t=>lt(e,t,n)))}function st(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const o=j(e,t);if(null===o)return;const{lock:r}=o,l="all"===et(e,n);return void 0===r||void 0===(null==r?void 0:r.move)?!l:!(null!=r&&r.move)}function at(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return t.every((t=>st(e,t,n)))}function ct(e,t){const n=j(e,t);if(null===n)return!0;const{lock:o}=n;return!(null!=o&&o.edit)}function ut(e,t){var n;return!!(0,r.hasBlockSupport)(t,"lock",!0)&&!(null===(n=e.settings)||void 0===n||!n.canLockBlocks)}function dt(e,t){var n,o;return null!==(n=null===(o=e.preferences.insertUsage)||void 0===o?void 0:o[t])&&void 0!==n?n:null}const pt=(e,t,n)=>!!(0,r.hasBlockSupport)(t,"inserter",!0)&&nt(e,t.name,n),mt=(e,t)=>n=>{const o=`${t.id}/${n.name}`,{time:r,count:l=0}=dt(e,o)||{};return{...t,id:o,icon:n.icon||t.icon,title:n.title||t.title,description:n.description||t.description,category:n.category||t.category,example:n.hasOwnProperty("example")?n.example:t.example,initialAttributes:{...t.initialAttributes,...n.attributes},innerBlocks:n.innerBlocks,keywords:n.keywords||t.keywords,frecency:ft(r,l)}},ft=(e,t)=>{if(!e)return t;const n=Date.now()-e;switch(!0){case n<36e5:return 4*t;case n<864e5:return 2*t;case n<6048e5:return t/2;default:return t/4}},gt=(e,t)=>{let{buildScope:n="inserter"}=t;return t=>{const o=t.name;let l=!1;(0,r.hasBlockSupport)(t.name,"multiple",!0)||(l=(0,u.some)(ne(e,J(e)),{name:t.name}));const{time:i,count:s=0}=dt(e,o)||{},a={id:o,name:t.name,title:t.title,icon:t.icon,isDisabled:l,frecency:ft(i,s)};if("transform"===n)return a;const c=(0,r.getBlockVariations)(t.name,"inserter");return{...a,initialAttributes:{},description:t.description,category:t.category,keywords:t.keywords,variations:c,example:t.example,utility:1}}},ht=D((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const n=gt(e,{buildScope:"inserter"}),o=/^\s*<!--\s+(\/)?wp:([a-z][a-z0-9_-]*\/)?([a-z][a-z0-9_-]*)\s+({(?:(?=([^}]+|}+(?=})|(?!}\s+\/?-->)[^])*)\5|[^]*?)}\s+)?(\/)?-->/,l=t=>{let n=F;if("web"===s.Platform.OS){const e=("string"==typeof t.content.raw?t.content.raw:t.content).match(o);if(e){const[,,t="core/",o]=e,l=(0,r.getBlockType)(t+o);l&&(n=l.icon)}}const l=`core/block/${t.id}`,{time:i,count:a=0}=dt(e,l)||{},c=ft(i,a);return{id:l,name:"core/block",initialAttributes:{ref:t.id},title:t.title.raw,icon:n,category:"reusable",keywords:[],isDisabled:!1,utility:1,frecency:c}},i=(0,r.getBlockTypes)().filter((n=>pt(e,n,t))).map(n),a=nt(e,"core/block",t)?Rt(e).map(l):[],c=i.reduce(((t,n)=>{const{variations:o=[]}=n;if(o.some((e=>{let{isDefault:t}=e;return t}))||t.push(n),o.length){const r=mt(e,n);t.push(...o.map(r))}return t}),[]),u=(e,t)=>{const{core:n,noncore:o}=e;return(t.name.startsWith("core/")?n:o).push(t),e},{core:d,noncore:p}=c.reduce(u,{core:[],noncore:[]}),m=[...d,...p];return[...m,...a]}),((e,t)=>[e.blockListSettings[t],e.blocks.byClientId,e.blocks.order,e.preferences.insertUsage,e.settings.allowedBlockTypes,e.settings.templateLock,Rt(e),(0,r.getBlockTypes)()])),vt=D((function(e,t){var n;let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const l=(0,u.castArray)(t),[i]=l,s=gt(e,{buildScope:"transform"}),a=(0,r.getBlockTypes)().filter((t=>pt(e,t,o))).map(s),c=(0,u.mapKeys)(a,(e=>{let{name:t}=e;return t}));c["*"]={frecency:1/0,id:"*",isDisabled:!1,name:"*",title:(0,g.__)("Unwrap"),icon:null===(n=c[null==i?void 0:i.name])||void 0===n?void 0:n.icon};const d=(0,r.getPossibleBlockTransformations)(l).reduce(((e,t)=>("*"===t?e.push(c["*"]):c[null==t?void 0:t.name]&&e.push(c[t.name]),e)),[]);return(0,u.orderBy)(d,(e=>c[e.name].frecency),"desc")}),((e,t)=>[e.blockListSettings[t],e.blocks.byClientId,e.preferences.insertUsage,e.settings.allowedBlockTypes,e.settings.templateLock,(0,r.getBlockTypes)()])),bt=D((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const n=(0,u.some)((0,r.getBlockTypes)(),(n=>pt(e,n,t)));if(n)return!0;const o=nt(e,"core/block",t)&&Rt(e).length>0;return o}),((e,t)=>[e.blockListSettings[t],e.blocks.byClientId,e.settings.allowedBlockTypes,e.settings.templateLock,Rt(e),(0,r.getBlockTypes)()])),kt=D((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(t)return(0,u.filter)((0,r.getBlockTypes)(),(n=>pt(e,n,t)))}),((e,t)=>[e.blockListSettings[t],e.blocks.byClientId,e.settings.allowedBlockTypes,e.settings.templateLock,(0,r.getBlockTypes)()])),_t=D((function(e){var t,n;let o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(!o)return;const r=null===(t=e.blockListSettings[o])||void 0===t?void 0:t.__experimentalDefaultBlock,l=null===(n=e.blockListSettings[o])||void 0===n?void 0:n.__experimentalDirectInsert;return r&&l?"function"==typeof l?l(K(e,o))?r:null:r:void 0}),((e,t)=>[e.blockListSettings[t],e.blocks.tree[t]])),yt=D(((e,t)=>{const n=e.settings.__experimentalBlockPatterns.find((e=>{let{name:n}=e;return n===t}));return n?{...n,blocks:(0,r.parse)(n.content,{__unstableSkipMigrationLogs:!0})}:null}),(e=>[e.settings.__experimentalBlockPatterns])),Et=D((e=>{const t=e.settings.__experimentalBlockPatterns,{allowedBlockTypes:n}=It(e);return t.filter((e=>{let{inserter:t=!0}=e;return!!t})).map((t=>{let{name:n}=t;return yt(e,n)})).filter((e=>{let{blocks:t}=e;return((e,t)=>{if((0,u.isBoolean)(t))return t;const n=[...e];for(;n.length>0;){var o;const e=n.shift();if(!tt(t,e.name||e.blockName,!0))return!1;null===(o=e.innerBlocks)||void 0===o||o.forEach((e=>{n.push(e)}))}return!0})(t,n)}))}),(e=>[e.settings.__experimentalBlockPatterns,e.settings.allowedBlockTypes])),Ct=D((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const n=Et(e),o=(0,u.filter)(n,(n=>{let{blocks:o}=n;return o.every((n=>{let{name:o}=n;return ot(e,o,t)}))}));return o}),((e,t)=>[e.settings.__experimentalBlockPatterns,e.settings.allowedBlockTypes,e.settings.templateLock,e.blockListSettings[t],e.blocks.byClientId[t]])),St=D((function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!t)return U;const o=Ct(e,n),r=Array.isArray(t)?t:[t];return o.filter((e=>{var t,n;return null==e||null===(t=e.blockTypes)||void 0===t||null===(n=t.some)||void 0===n?void 0:n.call(t,(e=>r.includes(e)))}))}),((e,t)=>[...Ct.getDependants(e,t)])),wt=D((function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!t)return U;if(t.some((t=>{let{clientId:n,innerBlocks:o}=t;return o.length||Ft(e,n)})))return U;const o=Array.from(new Set(t.map((e=>{let{name:t}=e;return t}))));return St(e,o,n)}),((e,t)=>[...St.getDependants(e,t)]));function Bt(e,t){return e.blockListSettings[t]}function It(e){return e.settings}function xt(e){return e.blocks.isPersistentChange}const Tt=D((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return t.reduce(((t,n)=>e.blockListSettings[n]?{...t,[n]:e.blockListSettings[n]}:t),{})}),(e=>[e.blockListSettings])),Nt=D(((e,t)=>{var n;const o=(0,u.find)(Rt(e),(e=>e.id===t));return o?null===(n=o.title)||void 0===n?void 0:n.raw:null}),(e=>[Rt(e)]));function Pt(e){return e.blocks.isIgnoredChange}function Mt(e){return e.lastBlockAttributesChange}function Rt(e){var t,n;return null!==(t=null==e||null===(n=e.settings)||void 0===n?void 0:n.__experimentalReusableBlocks)&&void 0!==t?t:U}function Lt(e){return e.isNavigationMode}function At(e){return e.hasBlockMovingClientId}function Dt(e){return!!e.automaticChangeStatus}function Ot(e,t){return e.highlightedBlock===t}function Ft(e,t){return!!e.blocks.controlledInnerBlocks[t]}const zt=D(((e,t)=>{if(!t.length)return null;const n=ue(e);if(t.includes(W(e,n)))return n;const o=Ee(e),r=fe(e,n||o[0],t);return r?(0,u.last)(r):null}),((e,t)=>[e.selection.selectionStart.clientId,e.selection.selectionEnd.clientId,t]));function Vt(e,t,n){const{lastBlockInserted:o}=e;return o.clientId===t&&o.source===n}var Ht=window.wp.a11y;const Gt=e=>t=>{let{dispatch:n}=t;n({type:"RESET_BLOCKS",blocks:e}),n(Ut(e))},Ut=e=>t=>{let{select:n,dispatch:o}=t;const l=n.getTemplate(),i=n.getTemplateLock(),s=!l||"all"!==i||(0,r.doBlocksMatchTemplate)(e,l);if(s!==n.isValidTemplate())return o.setTemplateValidity(s),s};function Wt(e,t,n){return{type:"RESET_SELECTION",selectionStart:e,selectionEnd:t,initialPosition:n}}function $t(e){return H()('wp.data.dispatch( "core/block-editor" ).receiveBlocks',{since:"5.9",alternative:"resetBlocks or insertBlocks"}),{type:"RECEIVE_BLOCKS",blocks:e}}function jt(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return{type:"UPDATE_BLOCK_ATTRIBUTES",clientIds:(0,u.castArray)(e),attributes:t,uniqueByBlock:n}}function Kt(e,t){return{type:"UPDATE_BLOCK",clientId:e,updates:t}}function qt(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return{type:"SELECT_BLOCK",initialPosition:t,clientId:e}}const Yt=e=>t=>{let{select:n,dispatch:o}=t;const r=n.getPreviousBlockClientId(e);r&&o.selectBlock(r,-1)},Qt=e=>t=>{let{select:n,dispatch:o}=t;const r=n.getNextBlockClientId(e);r&&o.selectBlock(r)};function Zt(){return{type:"START_MULTI_SELECT"}}function Xt(){return{type:"STOP_MULTI_SELECT"}}const Jt=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return o=>{let{select:r,dispatch:l}=o;if(r.getBlockRootClientId(e)!==r.getBlockRootClientId(t))return;l({type:"MULTI_SELECT",start:e,end:t,initialPosition:n});const i=r.getSelectedBlockCount();(0,Ht.speak)((0,g.sprintf)(
|
2 |
/* translators: %s: number of selected blocks */
|
3 |
-
(0,g._n)("%s block selected.","%s blocks selected.",i),i),"assertive")}};function en(){return{type:"CLEAR_SELECTED_BLOCK"}}function tn(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return{type:"TOGGLE_SELECTION",isSelectionEnabled:e}}function nn(e,t){var n,o;const l=null!==(n=null==t||null===(o=t.__experimentalPreferredStyleVariations)||void 0===o?void 0:o.value)&&void 0!==n?n:{};return e.map((e=>{var t;const n=e.name;if(!(0,r.hasBlockSupport)(n,"defaultStylePicker",!0))return e;if(!l[n])return e;const o=null===(t=e.attributes)||void 0===t?void 0:t.className;if(null!=o&&o.includes("is-style-"))return e;const{attributes:i={}}=e,s=l[n];return{...e,attributes:{...i,className:`${o||""} is-style-${s}`.trim()}}}))}const on=function(e,t,n){let o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,r=arguments.length>4?arguments[4]:void 0;return l=>{let{select:i,dispatch:s}=l;e=(0,u.castArray)(e),t=nn((0,u.castArray)(t),i.getSettings());const a=i.getBlockRootClientId((0,u.first)(e));for(let e=0;e<t.length;e++){const n=t[e];if(!i.canInsertBlockType(n.name,a))return}s({type:"REPLACE_BLOCKS",clientIds:e,blocks:t,time:Date.now(),indexToSelect:n,initialPosition:o,meta:r}),s((e=>{let{select:t,dispatch:n}=e;if(t.getBlockCount()>0)return;const{__unstableHasCustomAppender:o}=t.getSettings();o||n.insertDefaultBlock()}))}};function rn(e,t){return on(e,t)}const ln=e=>(t,n)=>o=>{let{select:r,dispatch:l}=o;r.canMoveBlocks(t,n)&&l({type:e,clientIds:(0,u.castArray)(t),rootClientId:n})},sn=ln("MOVE_BLOCKS_DOWN"),an=ln("MOVE_BLOCKS_UP"),cn=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",o=arguments.length>3?arguments[3]:void 0;return r=>{let{select:l,dispatch:i}=r;if(l.canMoveBlocks(e,t)){if(t!==n){if(!l.canRemoveBlocks(e,t))return;if(!l.canInsertBlocks(e,n))return}i({type:"MOVE_BLOCKS_TO_POSITION",fromRootClientId:t,toRootClientId:n,clientIds:e,index:o})}}};function un(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",o=arguments.length>3?arguments[3]:void 0;return cn([e],t,n,o)}function dn(e,t,n,o,r){return pn([e],t,n,o,0,r)}const pn=function(e,t,n){let o=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,l=arguments.length>5?arguments[5]:void 0;return i=>{let{select:s,dispatch:a}=i;(0,u.isObject)(r)&&(l=r,r=0,H()("meta argument in wp.data.dispatch('core/block-editor')",{since:"5.8",hint:"The meta argument is now the 6th argument of the function"})),e=nn((0,u.castArray)(e),s.getSettings());const c=[];for(const t of e)s.canInsertBlockType(t.name,n)&&c.push(t);c.length&&a({type:"INSERT_BLOCKS",blocks:c,index:t,rootClientId:n,time:Date.now(),updateSelection:o,initialPosition:o?r:null,meta:l})}};function mn(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{__unstableWithInserter:o}=n;return{type:"SHOW_INSERTION_POINT",rootClientId:e,index:t,__unstableWithInserter:o}}function fn(){return{type:"HIDE_INSERTION_POINT"}}function gn(e){return{type:"SET_TEMPLATE_VALIDITY",isValid:e}}const hn=()=>e=>{let{select:t,dispatch:n}=e;n({type:"SYNCHRONIZE_TEMPLATE"});const o=t.getBlocks(),l=t.getTemplate(),i=(0,r.synchronizeBlocksWithTemplate)(o,l);n.resetBlocks(i)},vn=e=>t=>{let{registry:n,select:o,dispatch:l}=t;const i=o.getSelectionStart(),s=o.getSelectionEnd();if(i.clientId===s.clientId)return;if(!i.attributeKey||!s.attributeKey||void 0===i.offset||void 0===s.offset)return!1;const a=o.getBlockRootClientId(i.clientId);if(a!==o.getBlockRootClientId(s.clientId))return;const c=o.getBlockOrder(a);let d,p;c.indexOf(i.clientId)>c.indexOf(s.clientId)?(d=s,p=i):(d=i,p=s);const m=e?p:d,f=o.getBlock(m.clientId),g=(0,r.getBlockType)(f.name);if(!g.merge)return;const h=d,v=p,b=o.getBlock(h.clientId),k=(0,r.getBlockType)(b.name),_=o.getBlock(v.clientId),y=(0,r.getBlockType)(_.name),E=b.attributes[h.attributeKey],C=_.attributes[v.attributeKey],S=k.attributes[h.attributeKey],w=y.attributes[v.attributeKey];let B=(0,z.create)({html:E,...G(S)}),I=(0,z.create)({html:C,...G(w)});B=(0,z.remove)(B,h.offset,B.text.length),I=(0,z.insert)(I,"",0,v.offset);const x=(0,r.cloneBlock)(b,{[h.attributeKey]:(0,z.toHTMLString)({value:B,...G(S)})}),T=(0,r.cloneBlock)(_,{[v.attributeKey]:(0,z.toHTMLString)({value:I,...G(w)})}),N=e?x:T,P=b.name===_.name?[N]:(0,r.switchToBlockType)(N,g.name);if(!P||!P.length)return;let M;if(e){const e=P.pop();M=g.merge(e.attributes,T.attributes)}else{const e=P.shift();M=g.merge(x.attributes,e.attributes)}const R=(0,u.findKey)(M,(e=>"string"==typeof e&&-1!==e.indexOf(""))),L=M[R],A=(0,z.create)({html:L,...G(g.attributes[R])}),D=A.text.indexOf(""),O=(0,z.remove)(A,D,D+1),F=(0,z.toHTMLString)({value:O,...G(g.attributes[R])});M[R]=F;const V=o.getSelectedBlockClientIds(),H=[...e?P:[],{...f,attributes:{...f.attributes,...M}},...e?[]:P];n.batch((()=>{l.selectionChange(f.clientId,R,D,D),l.replaceBlocks(V,H,0,o.getSelectedBlocksInitialCaretPosition())}))},bn=()=>e=>{let{select:t,dispatch:n}=e;const o=t.getSelectionStart(),l=t.getSelectionEnd();if(o.clientId===l.clientId)return;if(!o.attributeKey||!l.attributeKey||void 0===o.offset||void 0===l.offset)return;const i=t.getBlockRootClientId(o.clientId);if(i!==t.getBlockRootClientId(l.clientId))return;const s=t.getBlockOrder(i);let a,c;s.indexOf(o.clientId)>s.indexOf(l.clientId)?(a=l,c=o):(a=o,c=l);const u=a,d=c,p=t.getBlock(u.clientId),m=(0,r.getBlockType)(p.name),f=t.getBlock(d.clientId),g=(0,r.getBlockType)(f.name),h=p.attributes[u.attributeKey],v=f.attributes[d.attributeKey],b=m.attributes[u.attributeKey],k=g.attributes[d.attributeKey];let _=(0,z.create)({html:h,...G(b)}),y=(0,z.create)({html:v,...G(k)});_=(0,z.remove)(_,u.offset,_.text.length),y=(0,z.remove)(y,0,d.offset),n.replaceBlocks(t.getSelectedBlockClientIds(),[{...p,attributes:{...p.attributes,[u.attributeKey]:(0,z.toHTMLString)({value:_,...G(b)})}},(0,r.createBlock)((0,r.getDefaultBlockName)()),{...f,attributes:{...f.attributes,[d.attributeKey]:(0,z.toHTMLString)({value:y,...G(k)})}}],1,t.getSelectedBlocksInitialCaretPosition())},kn=()=>e=>{let{select:t,dispatch:n}=e;const o=t.getSelectionStart(),r=t.getSelectionEnd();n.selectionChange({start:{clientId:o.clientId},end:{clientId:r.clientId}})},yn=(e,t)=>n=>{let{select:o,dispatch:l}=n;const i=[e,t];l({type:"MERGE_BLOCKS",blocks:i});const[s,a]=i,c=o.getBlock(s),d=(0,r.getBlockType)(c.name);if(d&&!d.merge)return void l.selectBlock(c.clientId);const p=o.getBlock(a),m=(0,r.getBlockType)(p.name),{clientId:f,attributeKey:g,offset:h}=o.getSelectionStart(),v=(f===s?d:m).attributes[g],b=(f===s||f===a)&&void 0!==g&&void 0!==h&&!!v;v||("number"==typeof g?window.console.error("RichText needs an identifier prop that is the block attribute key of the attribute it controls. Its type is expected to be a string, but was "+typeof g):window.console.error("The RichText identifier prop does not match any attributes defined by the block."));const k=(0,r.cloneBlock)(c),_=(0,r.cloneBlock)(p);if(b){const e=f===s?k:_,t=e.attributes[g],n=(0,z.insert)((0,z.create)({html:t,...G(v)}),"",h,h);e.attributes[g]=(0,z.toHTMLString)({value:n,...G(v)})}const y=c.name===p.name?[_]:(0,r.switchToBlockType)(_,c.name);if(!y||!y.length)return;const E=d.merge(k.attributes,y[0].attributes);if(b){const e=(0,u.findKey)(E,(e=>"string"==typeof e&&-1!==e.indexOf(""))),t=E[e],n=(0,z.create)({html:t,...G(d.attributes[e])}),o=n.text.indexOf(""),r=(0,z.remove)(n,o,o+1),i=(0,z.toHTMLString)({value:r,...G(d.attributes[e])});E[e]=i,l.selectionChange(c.clientId,e,o,o)}l.replaceBlocks([c.clientId,p.clientId],[{...c,attributes:{...c.attributes,...E}},...y.slice(1)],0)},En=function(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return n=>{let{select:o,dispatch:r}=n;if(!e||!e.length)return;e=(0,u.castArray)(e);const l=o.getBlockRootClientId(e[0]);o.canRemoveBlocks(e,l)&&(t&&r.selectPreviousBlock(e[0]),r({type:"REMOVE_BLOCKS",clientIds:e}),r((e=>{let{select:t,dispatch:n}=e;if(t.getBlockCount()>0)return;const{__unstableHasCustomAppender:o}=t.getSettings();o||n.insertDefaultBlock()})))}};function Cn(e,t){return En([e],t)}function Sn(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return{type:"REPLACE_INNER_BLOCKS",rootClientId:e,blocks:t,updateSelection:n,initialPosition:n?o:null,time:Date.now()}}function wn(e){return{type:"TOGGLE_BLOCK_MODE",clientId:e}}function Bn(){return{type:"START_TYPING"}}function In(){return{type:"STOP_TYPING"}}function xn(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return{type:"START_DRAGGING_BLOCKS",clientIds:e}}function Tn(){return{type:"STOP_DRAGGING_BLOCKS"}}function Nn(){return H()('wp.data.dispatch( "core/block-editor" ).enterFormattedText',{since:"6.1",version:"6.3"}),{type:"DO_NOTHING"}}function Pn(){return H()('wp.data.dispatch( "core/block-editor" ).exitFormattedText',{since:"6.1",version:"6.3"}),{type:"DO_NOTHING"}}function Mn(e,t,n,o){return"string"==typeof e?{type:"SELECTION_CHANGE",clientId:e,attributeKey:t,startOffset:n,endOffset:o}:{type:"SELECTION_CHANGE",...e}}const Rn=(e,t,n)=>o=>{let{dispatch:l}=o;const i=(0,r.getDefaultBlockName)();if(!i)return;const s=(0,r.createBlock)(i,e);return l.insertBlock(s,n,t)};function Ln(e,t){return{type:"UPDATE_BLOCK_LIST_SETTINGS",clientId:e,settings:t}}function An(e){return{type:"UPDATE_SETTINGS",settings:e}}function Dn(e,t){return{type:"SAVE_REUSABLE_BLOCK_SUCCESS",id:e,updatedId:t}}function On(){return{type:"MARK_LAST_CHANGE_AS_PERSISTENT"}}function Fn(){return{type:"MARK_NEXT_CHANGE_AS_NOT_PERSISTENT"}}const zn=()=>e=>{let{dispatch:t}=e;t({type:"MARK_AUTOMATIC_CHANGE"});const{requestIdleCallback:n=(e=>setTimeout(e,100))}=window;n((()=>{t({type:"MARK_AUTOMATIC_CHANGE_FINAL"})}))},Vn=function(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return t=>{let{dispatch:n}=t;n({type:"SET_NAVIGATION_MODE",isNavigationMode:e}),e?(0,Ht.speak)((0,g.__)("You are currently in navigation mode. Navigate blocks using the Tab key and Arrow keys. Use Left and Right Arrow keys to move between nesting levels. To exit navigation mode and edit the selected block, press Enter.")):(0,Ht.speak)((0,g.__)("You are currently in edit mode. To return to the navigation mode, press Escape."))}},Hn=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return t=>{let{dispatch:n}=t;n({type:"SET_BLOCK_MOVING_MODE",hasBlockMovingClientId:e}),e&&(0,Ht.speak)((0,g.__)("Use the Tab key and Arrow keys to choose new block location. Use Left and Right Arrow keys to move between nesting levels. Once location is selected press Enter or Space to move the block."))}},Gn=function(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return n=>{let{select:o,dispatch:l}=n;if(!e||!e.length)return;const i=o.getBlocksByClientId(e);if((0,u.some)(i,(e=>!e)))return;if(i.map((e=>e.name)).some((e=>!(0,r.hasBlockSupport)(e,"multiple",!0))))return;const s=o.getBlockRootClientId(e[0]),a=o.getBlockIndex((0,u.last)((0,u.castArray)(e))),c=i.map((e=>(0,r.__experimentalCloneSanitizedBlock)(e)));return l.insertBlocks(c,a+1,s,t),c.length>1&&t&&l.multiSelect((0,u.first)(c).clientId,(0,u.last)(c).clientId),c.map((e=>e.clientId))}},Un=e=>t=>{let{select:n,dispatch:o}=t;if(!e)return;const r=n.getBlockRootClientId(e);if(n.getTemplateLock(r))return;const l=n.getBlockIndex(e);return o.insertDefaultBlock({},r,l)},Wn=e=>t=>{let{select:n,dispatch:o}=t;if(!e)return;const r=n.getBlockRootClientId(e);if(n.getTemplateLock(r))return;const l=n.getBlockIndex(e);return o.insertDefaultBlock({},r,l+1)};function $n(e,t){return{type:"TOGGLE_BLOCK_HIGHLIGHT",clientId:e,isHighlighted:t}}const jn=e=>async t=>{let{dispatch:n}=t;n($n(e,!0)),await new Promise((e=>setTimeout(e,150))),n($n(e,!1))};function Kn(e,t){return{type:"SET_HAS_CONTROLLED_INNER_BLOCKS",hasControlledInnerBlocks:t,clientId:e}}const qn="core/block-editor",Yn={reducer:M,selectors:e,actions:t},Qn=(0,m.createReduxStore)(qn,{...Yn,persist:["preferences"]});(0,m.registerStore)(qn,{...Yn,persist:["preferences"]});const Zn={name:"",isSelected:!1},Xn=(0,s.createContext)(Zn),{Provider:Jn}=Xn;function eo(){return(0,s.useContext)(Xn)}function to(){const{isSelected:e,clientId:t,name:n}=eo();return(0,m.useSelect)((o=>{if(e)return!0;const{getBlockName:r,isFirstMultiSelectedBlock:l,getMultiSelectedBlockClientIds:i}=o(Qn);return!!l(t)&&i().every((e=>r(e)===n))}),[t,e,n])}function no(e){let{group:t="default",controls:n,children:o,__experimentalShareWithChildBlocks:l=!1}=e;const i=function(e,t){const n=to(),{clientId:o}=eo(),l=(0,m.useSelect)((e=>{const{getBlockName:n,hasSelectedInnerBlock:l}=e(Qn),{hasBlockSupport:i}=e(r.store);return t&&i(n(o),"__experimentalExposeControlsToChildren",!1)&&l(o)}),[t,o]);var i;return n?null===(i=f[e])||void 0===i?void 0:i.Fill:l?f.parent.Fill:null}(t,l);return i?(0,s.createElement)(p.__experimentalStyleProvider,{document:document},(0,s.createElement)(i,null,(e=>{const r=(0,u.isEmpty)(e)?null:e;return(0,s.createElement)(p.__experimentalToolbarContext.Provider,{value:r},"default"===t&&(0,s.createElement)(p.ToolbarGroup,{controls:n}),o)}))):null}function oo(e){let{group:t="default",...n}=e;const o=(0,s.useContext)(p.__experimentalToolbarContext),r=f[t].Slot,l=(0,p.__experimentalUseSlot)(r.__unstableName);return Boolean(l.fills&&l.fills.length)?"default"===t?(0,s.createElement)(r,i({},n,{bubblesVirtually:!0,fillProps:o})):(0,s.createElement)(p.ToolbarGroup,null,(0,s.createElement)(r,i({},n,{bubblesVirtually:!0,fillProps:o}))):null}const ro=no;ro.Slot=oo;const lo=e=>(0,s.createElement)(no,i({group:"inline"},e));lo.Slot=e=>(0,s.createElement)(oo,i({group:"inline"},e));var io=ro,so=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M9 9v6h11V9H9zM4 20h1.5V4H4v16z"})),ao=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M20 9h-7.2V4h-1.6v5H4v6h7.2v5h1.6v-5H20z"})),co=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M4 15h11V9H4v6zM18.5 4v16H20V4h-1.5z"})),uo=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M9 15h6V9H9v6zm-5 5h1.5V4H4v16zM18.5 4v16H20V4h-1.5z"})),po=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M14.3 6.7l-1.1 1.1 4 4H4v1.5h13.3l-4.1 4.4 1.1 1.1 5.8-6.3z"})),mo=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M16.2 13.2l-4 4V4h-1.5v13.3l-4.5-4.1-1 1.1 6.2 5.8 5.8-5.8-1-1.1z"}));function fo(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return e.split(",").map((e=>`.editor-styles-wrapper ${e} ${t}`)).join(",")}const go=(0,s.createContext)({refs:new Map,callbacks:new Map});function ho(e){let{children:t}=e;const n=(0,s.useMemo)((()=>({refs:new Map,callbacks:new Map})),[]);return(0,s.createElement)(go.Provider,{value:n},t)}function vo(e){const{refs:t,callbacks:n}=(0,s.useContext)(go),o=(0,s.useRef)();return(0,s.useLayoutEffect)((()=>(t.set(o,e),()=>{t.delete(o)})),[e]),(0,d.useRefEffect)((t=>{o.current=t,n.forEach(((n,o)=>{e===n&&o(t)}))}),[e])}function bo(e){const{refs:t}=(0,s.useContext)(go),n=(0,s.useRef)();return n.current=e,(0,s.useMemo)((()=>({get current(){let e=null;for(const[o,r]of t.entries())r===n.current&&o.current&&(e=o.current);return e}})),[])}function ko(e){const{callbacks:t}=(0,s.useContext)(go),n=bo(e),[o,r]=(0,s.useState)(null);return(0,s.useLayoutEffect)((()=>{if(e)return t.set(r,e),()=>{t.delete(r)}}),[e]),n.current||o}const _o=["color","border","typography","spacing"],yo={"color.palette":e=>void 0===e.colors?void 0:e.colors,"color.gradients":e=>void 0===e.gradients?void 0:e.gradients,"color.custom":e=>void 0===e.disableCustomColors?void 0:!e.disableCustomColors,"color.customGradient":e=>void 0===e.disableCustomGradients?void 0:!e.disableCustomGradients,"typography.fontSizes":e=>void 0===e.fontSizes?void 0:e.fontSizes,"typography.customFontSize":e=>void 0===e.disableCustomFontSizes?void 0:!e.disableCustomFontSizes,"typography.lineHeight":e=>e.enableCustomLineHeight,"spacing.units":e=>{if(void 0!==e.enableCustomUnits)return!0===e.enableCustomUnits?["px","em","rem","vh","vw","%"]:e.enableCustomUnits},"spacing.padding":e=>e.enableCustomSpacing},Eo={"border.customColor":"border.color","border.customStyle":"border.style","border.customWidth":"border.width","typography.customFontStyle":"typography.fontStyle","typography.customFontWeight":"typography.fontWeight","typography.customLetterSpacing":"typography.letterSpacing","typography.customTextDecorations":"typography.textDecoration","typography.customTextTransforms":"typography.textTransform","border.customRadius":"border.radius","spacing.customMargin":"spacing.margin","spacing.customPadding":"spacing.padding","typography.customLineHeight":"typography.lineHeight"};function Co(e){const{name:t,clientId:n}=eo();return(0,m.useSelect)((o=>{if(_o.includes(e))return void console.warn("Top level useSetting paths are disabled. Please use a subpath to query the information needed.");let l;const i=(e=>Eo[e]||e)(e);[...o(Qn).getBlockParents(n),n].forEach((e=>{const n=o(Qn).getBlockName(e);if((0,r.hasBlockSupport)(n,"__experimentalSettings",!1)){var s;const n=o(Qn).getBlockAttributes(e),r=null!==(s=(0,u.get)(n,`settings.blocks.${t}.${i}`))&&void 0!==s?s:(0,u.get)(n,`settings.${i}`);void 0!==r&&(l=r)}}));const s=o(Qn).getSettings();if(void 0===l){var a;const e=`__experimentalFeatures.${i}`,n=`__experimentalFeatures.blocks.${t}.${i}`;l=null!==(a=(0,u.get)(s,n))&&void 0!==a?a:(0,u.get)(s,e)}var c,d;if(void 0!==l)return r.__EXPERIMENTAL_PATHS_WITH_MERGE[i]?null!==(c=null!==(d=l.custom)&&void 0!==d?d:l.theme)&&void 0!==c?c:l.default:l;const p=yo[i]?yo[i](s):void 0;return void 0!==p?p:"typography.dropCap"===i||void 0}),[t,n,e])}window.wp.warning;var So={default:(0,p.createSlotFill)("InspectorControls"),advanced:(0,p.createSlotFill)("InspectorAdvancedControls"),border:(0,p.createSlotFill)("InspectorControlsBorder"),color:(0,p.createSlotFill)("InspectorControlsColor"),dimensions:(0,p.createSlotFill)("InspectorControlsDimensions"),typography:(0,p.createSlotFill)("InspectorControlsTypography")};function wo(e){var t;let{__experimentalGroup:n="default",children:o}=e;const r=to(),l=null===(t=So[n])||void 0===t?void 0:t.Fill;return l?r?(0,s.createElement)(p.__experimentalStyleProvider,{document:document},(0,s.createElement)(l,null,(e=>{const t=(0,u.isEmpty)(e)?null:e;return(0,s.createElement)(p.__experimentalToolsPanelContext.Provider,{value:t},o)}))):null:("undefined"!=typeof process&&process.env,null)}const Bo=e=>{if(!(0,u.isObject)(e)||Array.isArray(e))return e;const t=(0,u.pickBy)((0,u.mapValues)(e,Bo),u.identity);return(0,u.isEmpty)(t)?void 0:t};function Io(e,t,n){return(0,u.setWith)(e?(0,u.clone)(e):{},t,n,u.clone)}function xo(e,t,n,o,r,l){var i;if((0,u.every)(e,(e=>!e)))return n;if(1===l.length&&n.innerBlocks.length===o.length)return n;let s=null===(i=o[0])||void 0===i?void 0:i.attributes;if(l.length>1&&o.length>1){if(!o[r])return n;var a;s=null===(a=o[r])||void 0===a?void 0:a.attributes}let c=n;return(0,u.forEach)(e,((e,n)=>{e&&t[n].forEach((e=>{const t=(0,u.get)(s,e);t&&(c={...c,attributes:Io(c.attributes,e,t)})}))})),c}function To(e,t,n){const o=(0,r.getBlockSupport)(e,t),l=null==o?void 0:o.__experimentalSkipSerialization;return Array.isArray(l)?l.includes(n):l}function No(e){let{children:t,group:n,label:o}=e;const{updateBlockAttributes:r}=(0,m.useDispatch)(Qn),{getBlockAttributes:l,getMultiSelectedBlockClientIds:i,getSelectedBlockClientId:a,hasMultiSelection:c}=(0,m.useSelect)(Qn),u=a(),d=(0,s.useCallback)((function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t={},n=c()?i():[u];n.forEach((n=>{const{style:o}=l(n);let r={style:o};e.forEach((e=>{r={...r,...e(r)}})),r={...r,style:Bo(r.style)},t[n]=r})),r(n,t,!0)}),[Bo,l,i,c,u,r]);return(0,s.createElement)(p.__experimentalToolsPanel,{className:`${n}-block-support-panel`,label:o,resetAll:d,key:u,panelId:u,hasInnerWrapper:!0,shouldRenderPlaceholderItems:!0,__experimentalFirstVisibleItemClass:"first",__experimentalLastVisibleItemClass:"last"},t)}function Po(e){let{Slot:t,...n}=e;const o=(0,s.useContext)(p.__experimentalToolsPanelContext);return(0,s.createElement)(t,i({},n,{fillProps:o,bubblesVirtually:!0}))}function Mo(e){var t;let{__experimentalGroup:n="default",label:o,...r}=e;const l=null===(t=So[n])||void 0===t?void 0:t.Slot,a=(0,p.__experimentalUseSlot)(null==l?void 0:l.__unstableName);return l&&a?Boolean(a.fills&&a.fills.length)?o?(0,s.createElement)(No,{group:n,label:o},(0,s.createElement)(Po,i({},r,{Slot:l}))):(0,s.createElement)(l,i({},r,{bubblesVirtually:!0})):null:("undefined"!=typeof process&&process.env,null)}const Ro=wo;Ro.Slot=Mo;const Lo=e=>(0,s.createElement)(wo,i({},e,{__experimentalGroup:"advanced"}));Lo.Slot=e=>(0,s.createElement)(Mo,i({},e,{__experimentalGroup:"advanced"})),Lo.slotName="InspectorAdvancedControls";var Ao=Ro,Do=window.wp.isShallowEqual,Oo=n.n(Do),Fo=function(e){return(0,d.useRefEffect)((t=>{if(!e)return;function n(t){const{deltaX:n,deltaY:o}=t;e.current.scrollBy(n,o)}const o={passive:!0};return t.addEventListener("wheel",n,o),()=>{t.removeEventListener("wheel",n,o)}}),[e])};function zo(e){let{clientId:t,bottomClientId:n,children:o,__unstableRefreshSize:r,__unstableCoverTarget:l=!1,__unstablePopoverSlot:a,__unstableContentRef:u,...d}=e;const m=ko(t),f=ko(null!=n?n:t),g=Fo(u),h=(0,s.useMemo)((()=>m&&f===m?{position:"absolute",width:m.offsetWidth,height:m.offsetHeight}:{}),[m,f,r]);if(!m||n&&!f)return null;const v={top:m,bottom:f};return(0,s.createElement)(p.Popover,i({ref:g,animate:!1,position:"top right left",focusOnMount:!1,anchorRef:v,__unstableSlotName:a||null,__unstableObserveElement:m,__unstableForcePosition:!0},d,{className:c()("block-editor-block-popover",d.className)}),l&&(0,s.createElement)("div",{style:h},o),!l&&o)}function Vo(e){const t=(0,r.getBlockSupport)(e,qo);return!!(!0===t||null!=t&&t.margin)}function Ho(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!Co("spacing.margin"),n=!er(e,"margin");return!Vo(e)||t||n}function Go(e){var t;const{name:n,attributes:{style:o},setAttributes:r}=e,l=(0,p.__experimentalUseCustomUnits)({availableUnits:Co("spacing.units")||["%","px","em","rem","vw"]}),i=Jo(n,"margin"),a=i&&i.some((e=>Qo.includes(e)));return Ho(e)?null:s.Platform.select({web:(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.__experimentalBoxControl,{values:null==o||null===(t=o.spacing)||void 0===t?void 0:t.margin,onChange:e=>{const t={...o,spacing:{...null==o?void 0:o.spacing,margin:e}};r({style:Bo(t)})},label:(0,g.__)("Margin"),sides:i,units:l,allowReset:!1,splitOnAxis:a})),native:null})}function Uo(e){var t,n;let{clientId:o,attributes:r}=e;const l=null==r||null===(t=r.style)||void 0===t||null===(n=t.spacing)||void 0===n?void 0:n.margin,i=(0,s.useMemo)((()=>{var e,t,n,o;return{borderTopWidth:null!==(e=null==l?void 0:l.top)&&void 0!==e?e:0,borderRightWidth:null!==(t=null==l?void 0:l.right)&&void 0!==t?t:0,borderBottomWidth:null!==(n=null==l?void 0:l.bottom)&&void 0!==n?n:0,borderLeftWidth:null!==(o=null==l?void 0:l.left)&&void 0!==o?o:0,top:null!=l&&l.top?`-${l.top}`:0,right:null!=l&&l.right?`-${l.right}`:0,bottom:null!=l&&l.bottom?`-${l.bottom}`:0,left:null!=l&&l.left?`-${l.left}`:0}}),[l]),[a,c]=(0,s.useState)(!1),u=(0,s.useRef)(l),d=(0,s.useRef)(),p=()=>{d.current&&window.clearTimeout(d.current)};return(0,s.useEffect)((()=>(Oo()(l,u.current)||(c(!0),u.current=l,p(),d.current=setTimeout((()=>{c(!1)}),400)),()=>p())),[l]),a?(0,s.createElement)(zo,{clientId:o,__unstableCoverTarget:!0,__unstableRefreshSize:l},(0,s.createElement)("div",{className:"block-editor__padding-visualizer",style:i})):null}function Wo(e){const t=(0,r.getBlockSupport)(e,qo);return!!(!0===t||null!=t&&t.padding)}function $o(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!Co("spacing.padding"),n=!er(e,"padding");return!Wo(e)||t||n}function jo(e){var t;const{name:n,attributes:{style:o},setAttributes:r}=e,l=(0,p.__experimentalUseCustomUnits)({availableUnits:Co("spacing.units")||["%","px","em","rem","vw"]}),i=Jo(n,"padding"),a=i&&i.some((e=>Qo.includes(e)));return $o(e)?null:s.Platform.select({web:(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.__experimentalBoxControl,{values:null==o||null===(t=o.spacing)||void 0===t?void 0:t.padding,onChange:e=>{const t={...o,spacing:{...null==o?void 0:o.spacing,padding:e}};r({style:Bo(t)})},label:(0,g.__)("Padding"),sides:i,units:l,allowReset:!1,splitOnAxis:a})),native:null})}function Ko(e){var t,n;let{clientId:o,attributes:r}=e;const l=null==r||null===(t=r.style)||void 0===t||null===(n=t.spacing)||void 0===n?void 0:n.padding,i=(0,s.useMemo)((()=>{var e,t,n,o;return{borderTopWidth:null!==(e=null==l?void 0:l.top)&&void 0!==e?e:0,borderRightWidth:null!==(t=null==l?void 0:l.right)&&void 0!==t?t:0,borderBottomWidth:null!==(n=null==l?void 0:l.bottom)&&void 0!==n?n:0,borderLeftWidth:null!==(o=null==l?void 0:l.left)&&void 0!==o?o:0}}),[l]),[a,c]=(0,s.useState)(!1),u=(0,s.useRef)(l),d=(0,s.useRef)(),p=()=>{d.current&&window.clearTimeout(d.current)};return(0,s.useEffect)((()=>(Oo()(l,u.current)||(c(!0),u.current=l,p(),d.current=setTimeout((()=>{c(!1)}),400)),()=>p())),[l]),a?(0,s.createElement)(zo,{clientId:o,__unstableCoverTarget:!0,__unstableRefreshSize:l},(0,s.createElement)("div",{className:"block-editor__padding-visualizer",style:i})):null}const qo="spacing",Yo=["top","right","bottom","left"],Qo=["vertical","horizontal"];function Zo(e){const t=or(e),n=$o(e),o=Ho(e),l=Xo(e),i=(a=e.name,"web"===s.Platform.OS&&(tr(a)||Wo(a)||Vo(a)));var a;if(l||!i)return null;const c=(0,r.getBlockSupport)(e.name,[qo,"__experimentalDefaultControls"]),u=e=>t=>{var n;return{...t,style:{...t.style,spacing:{...null===(n=t.style)||void 0===n?void 0:n.spacing,[e]:void 0}}}};return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Ao,{__experimentalGroup:"dimensions"},!n&&(0,s.createElement)(p.__experimentalToolsPanelItem,{hasValue:()=>function(e){var t,n;return void 0!==(null===(t=e.attributes.style)||void 0===t||null===(n=t.spacing)||void 0===n?void 0:n.padding)}(e),label:(0,g.__)("Padding"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:Bo({...o,spacing:{...null==o?void 0:o.spacing,padding:void 0}})})}(e),resetAllFilter:u("padding"),isShownByDefault:null==c?void 0:c.padding,panelId:e.clientId},(0,s.createElement)(jo,e)),!o&&(0,s.createElement)(p.__experimentalToolsPanelItem,{hasValue:()=>function(e){var t,n;return void 0!==(null===(t=e.attributes.style)||void 0===t||null===(n=t.spacing)||void 0===n?void 0:n.margin)}(e),label:(0,g.__)("Margin"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:Bo({...o,spacing:{...null==o?void 0:o.spacing,margin:void 0}})})}(e),resetAllFilter:u("margin"),isShownByDefault:null==c?void 0:c.margin,panelId:e.clientId},(0,s.createElement)(Go,e)),!t&&(0,s.createElement)(p.__experimentalToolsPanelItem,{hasValue:()=>function(e){var t,n;return void 0!==(null===(t=e.attributes.style)||void 0===t||null===(n=t.spacing)||void 0===n?void 0:n.blockGap)}(e),label:(0,g.__)("Block spacing"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:{...o,spacing:{...null==o?void 0:o.spacing,blockGap:void 0}}})}(e),resetAllFilter:u("blockGap"),isShownByDefault:null==c?void 0:c.blockGap,panelId:e.clientId},(0,s.createElement)(rr,e))),!n&&(0,s.createElement)(Ko,e),!o&&(0,s.createElement)(Uo,e))}const Xo=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=or(e),n=$o(e),o=Ho(e);return t&&n&&o};function Jo(e,t){const n=(0,r.getBlockSupport)(e,qo);if(n&&"boolean"!=typeof n[t])return n[t]}function er(e,t){const n=Jo(e,t);return!(n&&n.some((e=>Yo.includes(e)))&&n.some((e=>Qo.includes(e)))&&(console.warn(`The ${t} support for the "${e}" block can not be configured to support both axial and arbitrary sides.`),1))}function tr(e){const t=(0,r.getBlockSupport)(e,qo);return!!(!0===t||null!=t&&t.blockGap)}function nr(e){if(!e)return null;const t="string"==typeof e;return{top:t?e:null==e?void 0:e.top,left:t?e:null==e?void 0:e.left}}function or(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!Co("spacing.blockGap");return!tr(e)||t}function rr(e){var t;const{clientId:n,attributes:{style:o},name:r,setAttributes:l}=e,i=(0,p.__experimentalUseCustomUnits)({availableUnits:Co("spacing.units")||["%","px","em","rem","vw"]}),a=Jo(r,"blockGap"),c=bo(n);if(or(e))return null;const u=a&&a.some((e=>Qo.includes(e))),d=e=>{var t;let n=e;e&&u&&(n={...nr(e)});const r={...o,spacing:{...null==o?void 0:o.spacing,blockGap:n}};l({style:Bo(r)});const i=(null===(t=window)||void 0===t?void 0:t.navigator.userAgent)&&window.navigator.userAgent.includes("Safari")&&!window.navigator.userAgent.includes("Chrome ")&&!window.navigator.userAgent.includes("Chromium ");var s;c.current&&i&&(null===(s=c.current.parentNode)||void 0===s||s.replaceChild(c.current,c.current))},m=nr(null==o||null===(t=o.spacing)||void 0===t?void 0:t.blockGap),f=u?{...m,right:null==m?void 0:m.left,bottom:null==m?void 0:m.top}:null==m?void 0:m.top;return s.Platform.select({web:(0,s.createElement)(s.Fragment,null,u?(0,s.createElement)(p.__experimentalBoxControl,{label:(0,g.__)("Block spacing"),min:0,onChange:d,units:i,sides:a,values:f,allowReset:!1,splitOnAxis:u}):(0,s.createElement)(p.__experimentalUnitControl,{label:(0,g.__)("Block spacing"),__unstableInputWidth:"80px",min:0,onChange:d,units:i,value:f})),native:null})}const lr=(0,s.createElement)(p.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(p.Path,{d:"M15 4H9v11h6V4zM4 18.5V20h16v-1.5H4z"})),ir=(0,s.createElement)(p.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(p.Path,{d:"M20 11h-5V4H9v7H4v1.5h5V20h6v-7.5h5z"})),sr={top:{icon:(0,s.createElement)(p.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(p.Path,{d:"M9 20h6V9H9v11zM4 4v1.5h16V4H4z"})),title:(0,g._x)("Align top","Block vertical alignment setting")},center:{icon:ir,title:(0,g._x)("Align middle","Block vertical alignment setting")},bottom:{icon:lr,title:(0,g._x)("Align bottom","Block vertical alignment setting")}},ar=["top","center","bottom"],cr={isAlternate:!0};var ur=function(e){let{value:t,onChange:n,controls:o=ar,isCollapsed:r=!0,isToolbar:l}=e;const a=sr[t],c=sr.top,u=l?p.ToolbarGroup:p.ToolbarDropdownMenu,d=l?{isCollapsed:r}:{};return(0,s.createElement)(u,i({popoverProps:cr,icon:a?a.icon:c.icon,label:(0,g._x)("Change vertical alignment","Block vertical alignment setting label"),controls:o.map((e=>{return{...sr[e],isActive:t===e,role:r?"menuitemradio":void 0,onClick:(o=e,()=>n(t===o?void 0:o))};var o}))},d))};const dr=e=>(0,s.createElement)(ur,i({},e,{isToolbar:!1})),pr=e=>(0,s.createElement)(ur,i({},e,{isToolbar:!0})),mr={left:so,center:ao,right:co,"space-between":uo};var fr=function(e){let{allowedControls:t=["left","center","right","space-between"],isCollapsed:n=!0,onChange:o,value:r,popoverProps:l,isToolbar:a}=e;const c=e=>{o(e===r?void 0:e)},u=r?mr[r]:mr.left,d=[{name:"left",icon:so,title:(0,g.__)("Justify items left"),isActive:"left"===r,onClick:()=>c("left")},{name:"center",icon:ao,title:(0,g.__)("Justify items center"),isActive:"center"===r,onClick:()=>c("center")},{name:"right",icon:co,title:(0,g.__)("Justify items right"),isActive:"right"===r,onClick:()=>c("right")},{name:"space-between",icon:uo,title:(0,g.__)("Space between items"),isActive:"space-between"===r,onClick:()=>c("space-between")}],m=a?p.ToolbarGroup:p.ToolbarDropdownMenu,f=a?{isCollapsed:n}:{};return(0,s.createElement)(m,i({icon:u,popoverProps:l,label:(0,g.__)("Change items justification"),controls:d.filter((e=>t.includes(e.name)))},f))};const gr=e=>(0,s.createElement)(fr,i({},e,{isToolbar:!1})),hr=e=>(0,s.createElement)(fr,i({},e,{isToolbar:!0})),vr={left:"flex-start",right:"flex-end",center:"center","space-between":"space-between"},br={left:"flex-start",right:"flex-end",center:"center"},kr={top:"flex-start",center:"center",bottom:"flex-end"},_r=["wrap","nowrap"];var yr={name:"flex",label:(0,g.__)("Flex"),inspectorControls:function(e){let{layout:t={},onChange:n,layoutBlockSupport:o={}}=e;const{allowOrientation:r=!0}=o;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.Flex,null,(0,s.createElement)(p.FlexItem,null,(0,s.createElement)(Cr,{layout:t,onChange:n})),(0,s.createElement)(p.FlexItem,null,r&&(0,s.createElement)(wr,{layout:t,onChange:n}))),(0,s.createElement)(Sr,{layout:t,onChange:n}))},toolBarControls:function(e){let{layout:t={},onChange:n,layoutBlockSupport:o}=e;if(null!=o&&o.allowSwitching)return null;const{allowVerticalAlignment:r=!0}=o;return(0,s.createElement)(io,{group:"block",__experimentalShareWithChildBlocks:!0},(0,s.createElement)(Cr,{layout:t,onChange:n,isToolbar:!0}),r&&"vertical"!==(null==t?void 0:t.orientation)&&(0,s.createElement)(Er,{layout:t,onChange:n,isToolbar:!0}))},save:function(e){var t,n;let{selector:o,layout:r,style:l,blockName:i}=e;const{orientation:a="horizontal"}=r,c=null!==Co("spacing.blockGap"),u=null!=l&&null!==(t=l.spacing)&&void 0!==t&&t.blockGap&&!To(i,"spacing","blockGap")?function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"0";const n=nr(e);if(!n)return null;const o=(null==n?void 0:n.top)||t,r=(null==n?void 0:n.left)||t;return o===r?o:`${o} ${r}`}(null==l||null===(n=l.spacing)||void 0===n?void 0:n.blockGap,"0.5em"):"var( --wp--style--block-gap, 0.5em )",d=vr[r.justifyContent]||vr.left,p=_r.includes(r.flexWrap)?r.flexWrap:"wrap",m=`\n\t\tflex-direction: row;\n\t\talign-items: ${kr[r.verticalAlignment]||kr.center};\n\t\tjustify-content: ${d};\n\t\t`,f=`\n\t\tflex-direction: column;\n\t\talign-items: ${br[r.justifyContent]||br.left};\n\t\t`;return(0,s.createElement)("style",null,`\n\t\t\t\t${fo(o)} {\n\t\t\t\t\tdisplay: flex;\n\t\t\t\t\tflex-wrap: ${p};\n\t\t\t\t\tgap: ${c?u:"0.5em"};\n\t\t\t\t\t${"horizontal"===a?m:f}\n\t\t\t\t}\n\n\t\t\t\t${fo(o,"> *")} {\n\t\t\t\t\tmargin: 0;\n\t\t\t\t}\n\t\t\t`)},getOrientation(e){const{orientation:t="horizontal"}=e;return t},getAlignments:()=>[]};function Er(e){let{layout:t,onChange:n,isToolbar:o=!1}=e;const{verticalAlignment:r=kr.center}=t,l=e=>{n({...t,verticalAlignment:e})};if(o)return(0,s.createElement)(dr,{onChange:l,value:r});const i=[{value:"flex-start",label:(0,g.__)("Align items top")},{value:"center",label:(0,g.__)("Align items center")},{value:"flex-end",label:(0,g.__)("Align items bottom")}];return(0,s.createElement)("fieldset",{className:"block-editor-hooks__flex-layout-vertical-alignment-control"},(0,s.createElement)("legend",null,(0,g.__)("Vertical alignment")),(0,s.createElement)("div",null,i.map(((e,t,n)=>(0,s.createElement)(p.Button,{key:e,label:n,icon:t,isPressed:r===e,onClick:()=>l(e)})))))}function Cr(e){let{layout:t,onChange:n,isToolbar:o=!1}=e;const{justifyContent:r="left",orientation:l="horizontal"}=t,i=e=>{n({...t,justifyContent:e})},a=["left","center","right"];if("horizontal"===l&&a.push("space-between"),o)return(0,s.createElement)(gr,{allowedControls:a,value:r,onChange:i,popoverProps:{position:"bottom right",isAlternate:!0}});const c=[{value:"left",icon:so,label:(0,g.__)("Justify items left")},{value:"center",icon:ao,label:(0,g.__)("Justify items center")},{value:"right",icon:co,label:(0,g.__)("Justify items right")}];return"horizontal"===l&&c.push({value:"space-between",icon:uo,label:(0,g.__)("Space between items")}),(0,s.createElement)("fieldset",{className:"block-editor-hooks__flex-layout-justification-controls"},(0,s.createElement)("legend",null,(0,g.__)("Justification")),(0,s.createElement)("div",null,c.map((e=>{let{value:t,icon:n,label:o}=e;return(0,s.createElement)(p.Button,{key:t,label:o,icon:n,isPressed:r===t,onClick:()=>i(t)})}))))}function Sr(e){let{layout:t,onChange:n}=e;const{flexWrap:o="wrap"}=t;return(0,s.createElement)(p.ToggleControl,{label:(0,g.__)("Allow to wrap to multiple lines"),onChange:e=>{n({...t,flexWrap:e?"wrap":"nowrap"})},checked:"wrap"===o})}function wr(e){let{layout:t,onChange:n}=e;const{orientation:o="horizontal"}=t;return(0,s.createElement)("fieldset",{className:"block-editor-hooks__flex-layout-orientation-controls"},(0,s.createElement)("legend",null,(0,g.__)("Orientation")),(0,s.createElement)(p.Button,{label:"horizontal",icon:po,isPressed:"horizontal"===o,onClick:()=>n({...t,orientation:"horizontal"})}),(0,s.createElement)(p.Button,{label:"vertical",icon:mo,isPressed:"vertical"===o,onClick:()=>n({...t,orientation:"vertical"})}))}var Br=function(e){let{icon:t,size:n=24,...o}=e;return(0,s.cloneElement)(t,{width:n,height:n,...o})},Ir=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M7 9v6h10V9H7zM5 19.8h14v-1.5H5v1.5zM5 4.3v1.5h14V4.3H5z"})),xr=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M5 9v6h14V9H5zm11-4.8H8v1.5h8V4.2zM8 19.8h8v-1.5H8v1.5z"}));const Tr=[{name:"default",label:(0,g.__)("Flow"),inspectorControls:function(e){let{layout:t,onChange:n}=e;const{wideSize:o,contentSize:r}=t,l=(0,p.__experimentalUseCustomUnits)({availableUnits:Co("spacing.units")||["%","px","em","rem","vw"]});return(0,s.createElement)(s.Fragment,null,(0,s.createElement)("div",{className:"block-editor-hooks__layout-controls"},(0,s.createElement)("div",{className:"block-editor-hooks__layout-controls-unit"},(0,s.createElement)(p.__experimentalUnitControl,{label:(0,g.__)("Content"),labelPosition:"top",__unstableInputWidth:"80px",value:r||o||"",onChange:e=>{e=0>parseFloat(e)?"0":e,n({...t,contentSize:e})},units:l}),(0,s.createElement)(Br,{icon:Ir})),(0,s.createElement)("div",{className:"block-editor-hooks__layout-controls-unit"},(0,s.createElement)(p.__experimentalUnitControl,{label:(0,g.__)("Wide"),labelPosition:"top",__unstableInputWidth:"80px",value:o||r||"",onChange:e=>{e=0>parseFloat(e)?"0":e,n({...t,wideSize:e})},units:l}),(0,s.createElement)(Br,{icon:xr}))),(0,s.createElement)("div",{className:"block-editor-hooks__layout-controls-reset"},(0,s.createElement)(p.Button,{variant:"secondary",isSmall:!0,disabled:!r&&!o,onClick:()=>n({contentSize:void 0,wideSize:void 0,inherit:!1})},(0,g.__)("Reset"))),(0,s.createElement)("p",{className:"block-editor-hooks__layout-controls-helptext"},(0,g.__)("Customize the width for all elements that are assigned to the center or wide columns.")))},toolBarControls:function(){return null},save:function(e){var t;let{selector:n,layout:o={},style:r,blockName:l}=e;const{contentSize:i,wideSize:a}=o,c=null!==Co("spacing.blockGap"),u=nr(null==r||null===(t=r.spacing)||void 0===t?void 0:t.blockGap),d=null!=u&&u.top&&!To(l,"spacing","blockGap")?null==u?void 0:u.top:"var( --wp--style--block-gap )";let p=i||a?`\n\t\t\t\t\t${fo(n,"> :where(:not(.alignleft):not(.alignright))")} {\n\t\t\t\t\t\tmax-width: ${null!=i?i:a};\n\t\t\t\t\t\tmargin-left: auto !important;\n\t\t\t\t\t\tmargin-right: auto !important;\n\t\t\t\t\t}\n\t\t\t\t\t${fo(n,"> .alignwide")} {\n\t\t\t\t\t\tmax-width: ${null!=a?a:i};\n\t\t\t\t\t}\n\t\t\t\t\t${fo(n,"> .alignfull")} {\n\t\t\t\t\t\tmax-width: none;\n\t\t\t\t\t}\n\t\t\t\t`:"";return p+=`\n\t\t\t${fo(n,"> .alignleft")} {\n\t\t\t\tfloat: left;\n\t\t\t\tmargin-inline-start: 0;\n\t\t\t\tmargin-inline-end: 2em;\n\t\t\t}\n\t\t\t${fo(n,"> .alignright")} {\n\t\t\t\tfloat: right;\n\t\t\t\tmargin-inline-start: 2em;\n\t\t\t\tmargin-inline-end: 0;\n\t\t\t}\n\n\t\t\t${fo(n,"> .aligncenter")} {\n\t\t\t\tmargin-left: auto !important;\n\t\t\t\tmargin-right: auto !important;\n\t\t\t}\n\t\t`,c&&(p+=`\n\t\t\t\t${fo(n,"> *")} {\n\t\t\t\t\tmargin-block-start: 0;\n\t\t\t\t\tmargin-block-end: 0;\n\t\t\t\t}\n\t\t\t\t${fo(n,"> * + *")} {\n\t\t\t\t\tmargin-block-start: ${d};\n\t\t\t\t}\n\t\t\t`),(0,s.createElement)("style",null,p)},getOrientation:()=>"vertical",getAlignments(e){const t=function(e){const{contentSize:t,wideSize:n}=e,o={},r=/^(?!0)\d+(px|em|rem|vw|vh|%)?$/i;return r.test(t)&&(
|
4 |
// translators: %s: container size (i.e. 600px etc)
|
5 |
o.none=(0,g.sprintf)((0,g.__)("Max %s wide"),t)),r.test(n)&&(
|
6 |
// translators: %s: container size (i.e. 600px etc)
|
7 |
-
o.wide=(0,g.sprintf)((0,g.__)("Max %s wide"),n)),o}(e);if(void 0!==e.alignments)return e.alignments.includes("none")||e.alignments.unshift("none"),e.alignments.map((e=>({name:e,info:t[e]})));const{contentSize:n,wideSize:o}=e,r=[{name:"left"},{name:"center"},{name:"right"}];return n&&r.unshift({name:"full"}),o&&r.unshift({name:"wide",info:t.wide}),r.unshift({name:"none",info:t.none}),r}},yr];function Nr(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default";return Tr.find((t=>t.name===e))}const Pr={type:"default"},Mr=(0,s.createContext)(Pr),Rr=Mr.Provider;function Lr(){return(0,s.useContext)(Mr)}function Ar(e){let{layout:t={},...n}=e;const o=Nr(t.type);return o?(0,s.createElement)(o.save,i({layout:t},n)):null}const Dr=["none","left","center","right","wide","full"],Or=["wide","full"];function Fr(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Dr;e.includes("none")||(e=["none",...e]);const{wideControlsEnabled:t=!1,themeSupportsLayout:n}=(0,m.useSelect)((e=>{const{getSettings:t}=e(Qn),n=t();return{wideControlsEnabled:n.alignWide,themeSupportsLayout:n.supportsLayout}}),[]),o=Lr(),r=Nr(null==o?void 0:o.type),l=r.getAlignments(o);if(n){const t=l.filter((t=>{let{name:n}=t;return e.includes(n)}));return 1===t.length&&"none"===t[0].name?[]:t}if("default"!==r.name)return[];const{alignments:i=Dr}=o,s=e.filter((e=>(o.alignments||t||!Or.includes(e))&&i.includes(e))).map((e=>({name:e})));return 1===s.length&&"none"===s[0].name?[]:s}var zr=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M5 15h14V9H5v6zm0 4.8h14v-1.5H5v1.5zM5 4.2v1.5h14V4.2H5z"})),Vr=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M4 9v6h14V9H4zm8-4.8H4v1.5h8V4.2zM4 19.8h8v-1.5H4v1.5z"})),Hr=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M6 15h14V9H6v6zm6-10.8v1.5h8V4.2h-8zm0 15.6h8v-1.5h-8v1.5z"})),Gr=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M5 4v11h14V4H5zm3 15.8h8v-1.5H8v1.5z"}));const Ur={none:{icon:zr,title:(0,g._x)("None","Alignment option")},left:{icon:Vr,title:(0,g.__)("Align left")},center:{icon:Ir,title:(0,g.__)("Align center")},right:{icon:Hr,title:(0,g.__)("Align right")},wide:{icon:xr,title:(0,g.__)("Wide width")},full:{icon:Gr,title:(0,g.__)("Full width")}},Wr={isAlternate:!0};var $r=function(e){let{value:t,onChange:n,controls:o,isToolbar:r,isCollapsed:l=!0}=e;const a=Fr(o);if(!a.length)return null;function u(e){n([t,"none"].includes(e)?void 0:e)}const d=Ur[t],m=Ur.none,f=r?p.ToolbarGroup:p.ToolbarDropdownMenu,h={popoverProps:Wr,icon:d?d.icon:m.icon,label:(0,g.__)("Align"),toggleProps:{describedBy:(0,g.__)("Change alignment")}},v=r?{isCollapsed:l,controls:a.map((e=>{let{name:n}=e;return{...Ur[n],isActive:t===n||!t&&"none"===n,role:l?"menuitemradio":void 0,onClick:()=>u(n)}}))}:{children:e=>{let{onClose:n}=e;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.MenuGroup,{className:"block-editor-block-alignment-control__menu-group"},a.map((e=>{let{name:o,info:r}=e;const{icon:l,title:i}=Ur[o],a=o===t||!t&&"none"===o;return(0,s.createElement)(p.MenuItem,{key:o,icon:l,iconPosition:"left",className:c()("components-dropdown-menu__menu-item",{"is-active":a}),isSelected:a,onClick:()=>{u(o),n()},role:"menuitemradio",info:r},i)}))))}};return(0,s.createElement)(f,i({},h,v))};const jr=e=>(0,s.createElement)($r,i({},e,{isToolbar:!1})),Kr=e=>(0,s.createElement)($r,i({},e,{isToolbar:!0})),qr=["left","center","right","wide","full"],Yr=["wide","full"];function Qr(e){let t,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],o=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return t=Array.isArray(e)?qr.filter((t=>e.includes(t))):!0===e?[...qr]:[],!o||!0===e&&!n?(0,u.without)(t,...Yr):t}const Zr=(0,d.createHigherOrderComponent)((e=>t=>{const{name:n}=t,o=Fr(Qr((0,r.getBlockSupport)(n,"align"),(0,r.hasBlockSupport)(n,"alignWide",!0))).map((e=>{let{name:t}=e;return t}));return(0,s.createElement)(s.Fragment,null,!!o.length&&(0,s.createElement)(io,{group:"block",__experimentalShareWithChildBlocks:!0},(0,s.createElement)(jr,{value:t.attributes.align,onChange:e=>{if(!e){var n,o;const l=(0,r.getBlockType)(t.name);(null==l||null===(n=l.attributes)||void 0===n||null===(o=n.align)||void 0===o?void 0:o.default)&&(e="")}t.setAttributes({align:e})},controls:o})),(0,s.createElement)(e,t))}),"withToolbarControls"),Xr=(0,d.createHigherOrderComponent)((e=>t=>{const{name:n,attributes:o}=t,{align:l}=o,a=Fr(Qr((0,r.getBlockSupport)(n,"align"),(0,r.hasBlockSupport)(n,"alignWide",!0)));if(void 0===l)return(0,s.createElement)(e,t);let c=t.wrapperProps;return a.some((e=>e.name===l))&&(c={...c,"data-align":l}),(0,s.createElement)(e,i({},t,{wrapperProps:c}))}));(0,l.addFilter)("blocks.registerBlockType","core/align/addAttribute",(function(e){return(0,u.has)(e.attributes,["align","type"])||(0,r.hasBlockSupport)(e,"align")&&(e.attributes={...e.attributes,align:{type:"string",enum:[...qr,""]}}),e})),(0,l.addFilter)("editor.BlockListBlock","core/editor/align/with-data-align",Xr),(0,l.addFilter)("editor.BlockEdit","core/editor/align/with-toolbar-controls",Zr),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/align/addAssignedAlign",(function(e,t,n){const{align:o}=n;return Qr((0,r.getBlockSupport)(t,"align"),(0,r.hasBlockSupport)(t,"alignWide",!0)).includes(o)&&(e.className=c()(`align${o}`,e.className)),e})),(0,l.addFilter)("blocks.registerBlockType","core/lock/addAttribute",(function(e){return(0,u.has)(e.attributes,["lock","type"])||(e.attributes={...e.attributes,lock:{type:"object"}}),e}));const Jr=/[\s#]/g,el={type:"string",source:"attribute",attribute:"id",selector:"*"},tl=(0,d.createHigherOrderComponent)((e=>t=>{if((0,r.hasBlockSupport)(t.name,"anchor")&&t.isSelected){const n="web"===s.Platform.OS,o=(0,s.createElement)(p.TextControl,{className:"html-anchor-control",label:(0,g.__)("HTML anchor"),help:(0,s.createElement)(s.Fragment,null,(0,g.__)("Enter a word or two — without spaces — to make a unique web address just for this block, called an “anchor.” Then, you’ll be able to link directly to this section of your page."),n&&(0,s.createElement)(p.ExternalLink,{href:(0,g.__)("https://wordpress.org/support/article/page-jumps/")},(0,g.__)("Learn more about anchors"))),value:t.attributes.anchor||"",placeholder:n?null:(0,g.__)("Add an anchor"),onChange:e=>{e=e.replace(Jr,"-"),t.setAttributes({anchor:e})},autoCapitalize:"none",autoComplete:"off"});return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(e,t),n&&(0,s.createElement)(Ao,{__experimentalGroup:"advanced"},o),!n&&"core/heading"===t.name&&(0,s.createElement)(Ao,null,(0,s.createElement)(p.PanelBody,{title:(0,g.__)("Heading settings")},o)))}return(0,s.createElement)(e,t)}),"withInspectorControl");(0,l.addFilter)("blocks.registerBlockType","core/anchor/attribute",(function(e){return(0,u.has)(e.attributes,["anchor","type"])||(0,r.hasBlockSupport)(e,"anchor")&&(e.attributes={...e.attributes,anchor:el}),e})),(0,l.addFilter)("editor.BlockEdit","core/editor/anchor/with-inspector-control",tl),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/anchor/save-props",(function(e,t,n){return(0,r.hasBlockSupport)(t,"anchor")&&(e.id=""===n.anchor?null:n.anchor),e}));const nl=(0,d.createHigherOrderComponent)((e=>t=>(0,r.hasBlockSupport)(t.name,"customClassName",!0)&&t.isSelected?(0,s.createElement)(s.Fragment,null,(0,s.createElement)(e,t),(0,s.createElement)(Ao,{__experimentalGroup:"advanced"},(0,s.createElement)(p.TextControl,{autoComplete:"off",label:(0,g.__)("Additional CSS class(es)"),value:t.attributes.className||"",onChange:e=>{t.setAttributes({className:""!==e?e:void 0})},help:(0,g.__)("Separate multiple classes with spaces.")}))):(0,s.createElement)(e,t)),"withInspectorControl");(0,l.addFilter)("blocks.registerBlockType","core/custom-class-name/attribute",(function(e){return(0,r.hasBlockSupport)(e,"customClassName",!0)&&(e.attributes={...e.attributes,className:{type:"string"}}),e})),(0,l.addFilter)("editor.BlockEdit","core/editor/custom-class-name/with-inspector-control",nl),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/custom-class-name/save-props",(function(e,t,n){return(0,r.hasBlockSupport)(t,"customClassName",!0)&&n.className&&(e.className=c()(e.className,n.className)),e})),(0,l.addFilter)("blocks.switchToBlockType.transformedBlock","core/color/addTransforms",(function(e,t,n,o){if(!(0,r.hasBlockSupport)(e.name,"customClassName",!0))return e;if(1===o.length&&e.innerBlocks.length===t.length)return e;if(1===o.length&&t.length>1||o.length>1&&1===t.length)return e;if(t[n]){var l;const o=null===(l=t[n])||void 0===l?void 0:l.attributes.className;if(o)return{...e,attributes:{...e.attributes,className:o}}}return e})),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/generated-class-name/save-props",(function(e,t){return(0,r.hasBlockSupport)(t,"className",!0)&&("string"==typeof e.className?e.className=(0,u.uniq)([(0,r.getBlockDefaultClassName)(t.name),...e.className.split(" ")]).join(" ").trim():e.className=(0,r.getBlockDefaultClassName)(t.name)),e}));const ol="var:";function rl(e,t,n,o){const r=(0,u.get)(e,n);return r?[{selector:null==t?void 0:t.selector,key:o,value:il(r)}]:[]}function ll(e,t,n,o){const r=(0,u.get)(e,n);if(!r)return[];const l=[];if("string"==typeof r)l.push({selector:null==t?void 0:t.selector,key:o,value:r});else{const e=["top","right","bottom","left"].reduce(((e,n)=>{const l=(0,u.get)(r,[n]);return l&&e.push({selector:null==t?void 0:t.selector,key:`${o}${(0,u.upperFirst)(n)}`,value:l}),e}),[]);l.push(...e)}return l}function il(e){return"string"==typeof e&&e.startsWith(ol)?`var(--wp--${e.slice(ol.length).split("|").join("--")})`:e}const sl=[{name:"text",generate:(e,t)=>rl(e,t,["color","text"],"color")},{name:"gradient",generate:(e,t)=>rl(e,t,["color","gradient"],"background")},{name:"background",generate:(e,t)=>rl(e,t,["color","background"],"backgroundColor")},{name:"margin",generate:(e,t)=>ll(e,t,["spacing","margin"],"margin")},{name:"padding",generate:(e,t)=>ll(e,t,["spacing","padding"],"padding")},{name:"fontSize",generate:(e,t)=>rl(e,t,["typography","fontSize"],"fontSize")},{name:"fontStyle",generate:(e,t)=>rl(e,t,["typography","fontStyle"],"fontStyle")},{name:"fontWeight",generate:(e,t)=>rl(e,t,["typography","fontWeight"],"fontWeight")},{name:"letterSpacing",generate:(e,t)=>rl(e,t,["typography","letterSpacing"],"letterSpacing")},{name:"letterSpacing",generate:(e,t)=>rl(e,t,["typography","lineHeight"],"lineHeight")},{name:"textDecoration",generate:(e,t)=>rl(e,t,["typography","textDecoration"],"textDecoration")},{name:"textTransform",generate:(e,t)=>rl(e,t,["typography","textTransform"],"textTransform")}];function al(e,t){const n=[];return sl.forEach((o=>{"function"==typeof o.generate&&n.push(...o.generate(e,t))})),n}var cl=window.wp.dom;const ul=(0,s.createContext)({});function dl(e){let{value:t,children:n}=e;const o=(0,s.useContext)(ul),r=(0,s.useMemo)((()=>({...o,...t})),[o,t]);return(0,s.createElement)(ul.Provider,{value:r,children:n})}var pl=ul;const ml={};var fl=(0,p.withFilters)("editor.BlockEdit")((e=>{const{attributes:t={},name:n}=e,o=(0,r.getBlockType)(n),l=(0,s.useContext)(pl),a=(0,s.useMemo)((()=>o&&o.usesContext?(0,u.pick)(l,o.usesContext):ml),[o,l]);if(!o)return null;const d=o.edit||o.save;if(o.apiVersion>1)return(0,s.createElement)(d,i({},e,{context:a}));const p=(0,r.hasBlockSupport)(o,"className",!0)?(0,r.getBlockDefaultClassName)(n):null,m=c()(p,t.className);return(0,s.createElement)(d,i({},e,{context:a,className:m}))}));function gl(e){const{name:t,isSelected:n,clientId:o}=e,r={name:t,isSelected:n,clientId:o};return(0,s.createElement)(Jn,{value:(0,s.useMemo)((()=>r),Object.values(r))},(0,s.createElement)(fl,e))}var hl=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M11 13h2v-2h-2v2zm-6 0h2v-2H5v2zm12-2v2h2v-2h-2z"})),vl=function(e){let{className:t,actions:n,children:o,secondaryActions:r}=e;return(0,s.createElement)("div",{style:{display:"contents",all:"initial"}},(0,s.createElement)("div",{className:c()(t,"block-editor-warning")},(0,s.createElement)("div",{className:"block-editor-warning__contents"},(0,s.createElement)("p",{className:"block-editor-warning__message"},o),(s.Children.count(n)>0||r)&&(0,s.createElement)("div",{className:"block-editor-warning__actions"},s.Children.count(n)>0&&s.Children.map(n,((e,t)=>(0,s.createElement)("span",{key:t,className:"block-editor-warning__action"},e))),r&&(0,s.createElement)(p.DropdownMenu,{className:"block-editor-warning__secondary",icon:hl,label:(0,g.__)("More options"),popoverProps:{position:"bottom left",className:"block-editor-warning__dropdown"},noIcons:!0},(()=>(0,s.createElement)(p.MenuGroup,null,r.map(((e,t)=>(0,s.createElement)(p.MenuItem,{onClick:e.onClick,key:t},e.title))))))))))},bl=n(1973);function kl(e){let{title:t,rawContent:n,renderedContent:o,action:r,actionText:l,className:i}=e;return(0,s.createElement)("div",{className:i},(0,s.createElement)("div",{className:"block-editor-block-compare__content"},(0,s.createElement)("h2",{className:"block-editor-block-compare__heading"},t),(0,s.createElement)("div",{className:"block-editor-block-compare__html"},n),(0,s.createElement)("div",{className:"block-editor-block-compare__preview edit-post-visual-editor"},(0,s.createElement)(s.RawHTML,null,(0,cl.safeHTML)(o)))),(0,s.createElement)("div",{className:"block-editor-block-compare__action"},(0,s.createElement)(p.Button,{variant:"secondary",tabIndex:"0",onClick:r},l)))}var _l=function(e){let{block:t,onKeep:n,onConvert:o,convertor:l,convertButtonText:i}=e;const a=(d=l(t),(0,u.castArray)(d).map((e=>(0,r.getSaveContent)(e.name,e.attributes,e.innerBlocks))).join(""));var d;const p=(m=t.originalContent,f=a,(0,bl.Kx)(m,f).map(((e,t)=>{const n=c()({"block-editor-block-compare__added":e.added,"block-editor-block-compare__removed":e.removed});return(0,s.createElement)("span",{key:t,className:n},e.value)})));var m,f;return(0,s.createElement)("div",{className:"block-editor-block-compare__wrapper"},(0,s.createElement)(kl,{title:(0,g.__)("Current"),className:"block-editor-block-compare__current",action:n,actionText:(0,g.__)("Convert to HTML"),rawContent:t.originalContent,renderedContent:t.originalContent}),(0,s.createElement)(kl,{title:(0,g.__)("After Conversion"),className:"block-editor-block-compare__converted",action:o,actionText:i,rawContent:p,renderedContent:a}))};const yl=e=>(0,r.rawHandler)({HTML:e.originalContent});var El=(0,d.compose)([(0,m.withSelect)(((e,t)=>{let{clientId:n}=t;return{block:e(Qn).getBlock(n)}})),(0,m.withDispatch)(((e,t)=>{let{block:n}=t;const{replaceBlock:o}=e(Qn);return{convertToClassic(){o(n.clientId,(e=>(0,r.createBlock)("core/freeform",{content:e.originalContent}))(n))},convertToHTML(){o(n.clientId,(e=>(0,r.createBlock)("core/html",{content:e.originalContent}))(n))},convertToBlocks(){o(n.clientId,yl(n))},attemptBlockRecovery(){o(n.clientId,(e=>{let{name:t,attributes:n,innerBlocks:o}=e;return(0,r.createBlock)(t,n,o)})(n))}}}))])((function(e){let{convertToHTML:t,convertToBlocks:n,convertToClassic:o,attemptBlockRecovery:l,block:i}=e;const a=!!(0,r.getBlockType)("core/html"),[c,u]=(0,s.useState)(!1),d=(0,s.useCallback)((()=>u(!0)),[]),m=(0,s.useCallback)((()=>u(!1)),[]),f=(0,s.useMemo)((()=>[{
|
8 |
// translators: Button to fix block content
|
9 |
-
title:(0,g._x)("Resolve","imperative verb"),onClick:d},a&&{title:(0,g.__)("Convert to HTML"),onClick:t},{title:(0,g.__)("Convert to Classic Block"),onClick:o}].filter(Boolean)),[d,t,o]);return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(
|
10 |
-
(0,g.__)("Resolve Block"),onRequestClose:m,className:"block-editor-block-compare"},(0,s.createElement)(_l,{block:i,onKeep:t,onConvert:n,convertor:yl,convertButtonText:(0,g.__)("Convert to Blocks")})))}));const Cl=(0,s.createElement)(vl,{className:"block-editor-block-list__block-crash-warning"},(0,g.__)("This block has encountered an error and cannot be previewed."));var Sl=()=>Cl;class wl extends s.Component{constructor(){super(...arguments),this.state={hasError:!1}}componentDidCatch(){this.setState({hasError:!0})}render(){return this.state.hasError?this.props.fallback:this.props.children}}var Bl=wl,Il=n(773),xl=function(e){let{clientId:t}=e;const[n,o]=(0,s.useState)(""),l=(0,m.useSelect)((e=>e(Qn).getBlock(t)),[t]),{updateBlock:i}=(0,m.useDispatch)(Qn);return(0,s.useEffect)((()=>{o((0,r.getBlockContent)(l))}),[l]),(0,s.createElement)(Il.Z,{className:"block-editor-block-list__block-html-textarea",value:n,onBlur:()=>{const e=(0,r.getBlockType)(l.name);if(!e)return;const s=(0,r.getBlockAttributes)(e,n,l.attributes),a=n||(0,r.getSaveContent)(e,s),[c]=n?(0,r.validateBlock)({...l,attributes:s,originalContent:a}):[!0];i(t,{attributes:s,originalContent:a,isValid:c}),n||o({content:a})},onChange:e=>o(e.target.value)})};let Tl=Wl();const Nl=e=>Vl(e,Tl);let Pl=Wl();Nl.write=e=>Vl(e,Pl);let Ml=Wl();Nl.onStart=e=>Vl(e,Ml);let Rl=Wl();Nl.onFrame=e=>Vl(e,Rl);let Ll=Wl();Nl.onFinish=e=>Vl(e,Ll);let Al=[];Nl.setTimeout=(e,t)=>{let n=Nl.now()+t,o=()=>{let e=Al.findIndex((e=>e.cancel==o));~e&&Al.splice(e,1),jl.count-=~e?1:0},r={time:n,handler:e,cancel:o};return Al.splice(Dl(n),0,r),jl.count+=1,Hl(),r};let Dl=e=>~(~Al.findIndex((t=>t.time>e))||~Al.length);Nl.cancel=e=>{Tl.delete(e),Pl.delete(e)},Nl.sync=e=>{zl=!0,Nl.batchedUpdates(e),zl=!1},Nl.throttle=e=>{let t;function n(){try{e(...t)}finally{t=null}}function o(...e){t=e,Nl.onStart(n)}return o.handler=e,o.cancel=()=>{Ml.delete(n),t=null},o};let Ol="undefined"!=typeof window?window.requestAnimationFrame:()=>{};Nl.use=e=>Ol=e,Nl.now="undefined"!=typeof performance?()=>performance.now():Date.now,Nl.batchedUpdates=e=>e(),Nl.catch=console.error,Nl.frameLoop="always",Nl.advance=()=>{"demand"!==Nl.frameLoop?console.warn("Cannot call the manual advancement of rafz whilst frameLoop is not set as demand"):Ul()};let Fl=-1,zl=!1;function Vl(e,t){zl?(t.delete(e),e(0)):(t.add(e),Hl())}function Hl(){Fl<0&&(Fl=0,"demand"!==Nl.frameLoop&&Ol(Gl))}function Gl(){~Fl&&(Ol(Gl),Nl.batchedUpdates(Ul))}function Ul(){let e=Fl;Fl=Nl.now();let t=Dl(Fl);t&&($l(Al.splice(0,t),(e=>e.handler())),jl.count-=t),Ml.flush(),Tl.flush(e?Math.min(64,Fl-e):16.667),Rl.flush(),Pl.flush(),Ll.flush()}function Wl(){let e=new Set,t=e;return{add(n){jl.count+=t!=e||e.has(n)?0:1,e.add(n)},delete:n=>(jl.count-=t==e&&e.has(n)?1:0,e.delete(n)),flush(n){t.size&&(e=new Set,jl.count-=t.size,$l(t,(t=>t(n)&&e.add(t))),jl.count+=e.size,t=e)}}}function $l(e,t){e.forEach((e=>{try{t(e)}catch(e){Nl.catch(e)}}))}const jl={count:0,clear(){Fl=-1,Al=[],Ml=Wl(),Tl=Wl(),Rl=Wl(),Pl=Wl(),Ll=Wl(),jl.count=0}};var Kl=n(9196),ql=n.n(Kl);function Yl(){}const Ql={arr:Array.isArray,obj:e=>!!e&&"Object"===e.constructor.name,fun:e=>"function"==typeof e,str:e=>"string"==typeof e,num:e=>"number"==typeof e,und:e=>void 0===e};function Zl(e,t){if(Ql.arr(e)){if(!Ql.arr(t)||e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}return e===t}const Xl=(e,t)=>e.forEach(t);function Jl(e,t,n){for(const o in e)e.hasOwnProperty(o)&&t.call(n,e[o],o)}const ei=e=>Ql.und(e)?[]:Ql.arr(e)?e:[e];function ti(e,t){if(e.size){const n=Array.from(e);e.clear(),Xl(n,t)}}const ni=(e,...t)=>ti(e,(e=>e(...t)));let oi,ri,li=null,ii=!1,si=Yl;var ai=Object.freeze({__proto__:null,get createStringInterpolator(){return oi},get to(){return ri},get colors(){return li},get skipAnimation(){return ii},get willAdvance(){return si},assign:e=>{e.to&&(ri=e.to),e.now&&(Nl.now=e.now),void 0!==e.colors&&(li=e.colors),null!=e.skipAnimation&&(ii=e.skipAnimation),e.createStringInterpolator&&(oi=e.createStringInterpolator),e.requestAnimationFrame&&Nl.use(e.requestAnimationFrame),e.batchedUpdates&&(Nl.batchedUpdates=e.batchedUpdates),e.willAdvance&&(si=e.willAdvance),e.frameLoop&&(Nl.frameLoop=e.frameLoop)}});const ci=new Set;let ui=[],di=[],pi=0;const mi={get idle(){return!ci.size&&!ui.length},start(e){pi>e.priority?(ci.add(e),Nl.onStart(fi)):(gi(e),Nl(vi))},advance:vi,sort(e){if(pi)Nl.onFrame((()=>mi.sort(e)));else{const t=ui.indexOf(e);~t&&(ui.splice(t,1),hi(e))}},clear(){ui=[],ci.clear()}};function fi(){ci.forEach(gi),ci.clear(),Nl(vi)}function gi(e){ui.includes(e)||hi(e)}function hi(e){ui.splice(function(t,n){const o=t.findIndex((t=>t.priority>e.priority));return o<0?t.length:o}(ui),0,e)}function vi(e){const t=di;for(let n=0;n<ui.length;n++){const o=ui[n];pi=o.priority,o.idle||(si(o),o.advance(e),o.idle||t.push(o))}return pi=0,di=ui,di.length=0,ui=t,ui.length>0}const bi="[-+]?\\d*\\.?\\d+",ki=bi+"%";function _i(...e){return"\\(\\s*("+e.join(")\\s*,\\s*(")+")\\s*\\)"}const yi=new RegExp("rgb"+_i(bi,bi,bi)),Ei=new RegExp("rgba"+_i(bi,bi,bi,bi)),Ci=new RegExp("hsl"+_i(bi,ki,ki)),Si=new RegExp("hsla"+_i(bi,ki,ki,bi)),wi=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,Bi=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,Ii=/^#([0-9a-fA-F]{6})$/,xi=/^#([0-9a-fA-F]{8})$/;function Ti(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function Ni(e,t,n){const o=n<.5?n*(1+t):n+t-n*t,r=2*n-o,l=Ti(r,o,e+1/3),i=Ti(r,o,e),s=Ti(r,o,e-1/3);return Math.round(255*l)<<24|Math.round(255*i)<<16|Math.round(255*s)<<8}function Pi(e){const t=parseInt(e,10);return t<0?0:t>255?255:t}function Mi(e){return(parseFloat(e)%360+360)%360/360}function Ri(e){const t=parseFloat(e);return t<0?0:t>1?255:Math.round(255*t)}function Li(e){const t=parseFloat(e);return t<0?0:t>100?1:t/100}function Ai(e){let t=function(e){let t;return"number"==typeof e?e>>>0===e&&e>=0&&e<=4294967295?e:null:(t=Ii.exec(e))?parseInt(t[1]+"ff",16)>>>0:li&&void 0!==li[e]?li[e]:(t=yi.exec(e))?(Pi(t[1])<<24|Pi(t[2])<<16|Pi(t[3])<<8|255)>>>0:(t=Ei.exec(e))?(Pi(t[1])<<24|Pi(t[2])<<16|Pi(t[3])<<8|Ri(t[4]))>>>0:(t=wi.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+"ff",16)>>>0:(t=xi.exec(e))?parseInt(t[1],16)>>>0:(t=Bi.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+t[4]+t[4],16)>>>0:(t=Ci.exec(e))?(255|Ni(Mi(t[1]),Li(t[2]),Li(t[3])))>>>0:(t=Si.exec(e))?(Ni(Mi(t[1]),Li(t[2]),Li(t[3]))|Ri(t[4]))>>>0:null}(e);return null===t?e:(t=t||0,`rgba(${(4278190080&t)>>>24}, ${(16711680&t)>>>16}, ${(65280&t)>>>8}, ${(255&t)/255})`)}const Di=(e,t,n)=>{if(Ql.fun(e))return e;if(Ql.arr(e))return Di({range:e,output:t,extrapolate:n});if(Ql.str(e.output[0]))return oi(e);const o=e,r=o.output,l=o.range||[0,1],i=o.extrapolateLeft||o.extrapolate||"extend",s=o.extrapolateRight||o.extrapolate||"extend",a=o.easing||(e=>e);return e=>{const t=function(e,t){for(var n=1;n<t.length-1&&!(t[n]>=e);++n);return n-1}(e,l);return function(e,t,n,o,r,l,i,s,a){let c=a?a(e):e;if(c<t){if("identity"===i)return c;"clamp"===i&&(c=t)}if(c>n){if("identity"===s)return c;"clamp"===s&&(c=n)}return o===r?o:t===n?e<=t?o:r:(t===-1/0?c=-c:n===1/0?c-=t:c=(c-t)/(n-t),c=l(c),o===-1/0?c=-c:r===1/0?c+=o:c=c*(r-o)+o,c)}(e,l[t],l[t+1],r[t],r[t+1],a,i,s,o.map)}};function Oi(){return(Oi=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e}).apply(this,arguments)}const Fi=Symbol.for("FluidValue.get"),zi=Symbol.for("FluidValue.observers"),Vi=e=>Boolean(e&&e[Fi]),Hi=e=>e&&e[Fi]?e[Fi]():e,Gi=e=>e[zi]||null;function Ui(e,t){let n=e[zi];n&&n.forEach((e=>{!function(e,t){e.eventObserved?e.eventObserved(t):e(t)}(e,t)}))}class Wi{constructor(e){if(this[Fi]=void 0,this[zi]=void 0,!e&&!(e=this.get))throw Error("Unknown getter");$i(this,e)}}const $i=(e,t)=>qi(e,Fi,t);function ji(e,t){if(e[Fi]){let n=e[zi];n||qi(e,zi,n=new Set),n.has(t)||(n.add(t),e.observerAdded&&e.observerAdded(n.size,t))}return t}function Ki(e,t){let n=e[zi];if(n&&n.has(t)){const o=n.size-1;o?n.delete(t):e[zi]=null,e.observerRemoved&&e.observerRemoved(o,t)}}const qi=(e,t,n)=>Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0}),Yi=/[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,Qi=/(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi;let Zi;const Xi=/rgba\(([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+)\)/gi,Ji=(e,t,n,o,r)=>`rgba(${Math.round(t)}, ${Math.round(n)}, ${Math.round(o)}, ${r})`,es=e=>{Zi||(Zi=li?new RegExp(`(${Object.keys(li).join("|")})(?!\\w)`,"g"):/^\b$/);const t=e.output.map((e=>Hi(e).replace(Qi,Ai).replace(Zi,Ai))),n=t.map((e=>e.match(Yi).map(Number))),o=n[0].map(((e,t)=>n.map((e=>{if(!(t in e))throw Error('The arity of each "output" value must be equal');return e[t]})))).map((t=>Di(Oi({},e,{output:t}))));return e=>{let n=0;return t[0].replace(Yi,(()=>String(o[n++](e)))).replace(Xi,Ji)}},ts="react-spring: ",ns=e=>{const t=e;let n=!1;if("function"!=typeof t)throw new TypeError(`${ts}once requires a function parameter`);return(...e)=>{n||(t(...e),n=!0)}},os=ns(console.warn),rs=ns(console.warn);function ls(e){return Ql.str(e)&&("#"==e[0]||/\d/.test(e)||e in(li||{}))}const is=e=>(0,Kl.useEffect)(e,ss),ss=[];function as(){const e=(0,Kl.useState)()[1],t=(0,Kl.useState)(cs)[0];return is(t.unmount),()=>{t.current&&e({})}}function cs(){const e={current:!0,unmount:()=>()=>{e.current=!1}};return e}function us(e){const t=(0,Kl.useRef)();return(0,Kl.useEffect)((()=>{t.current=e})),t.current}const ds="undefined"!=typeof window&&window.document&&window.document.createElement?Kl.useLayoutEffect:Kl.useEffect,ps=Symbol.for("Animated:node"),ms=e=>e&&e[ps],fs=(e,t)=>{return n=e,o=ps,r=t,Object.defineProperty(n,o,{value:r,writable:!0,configurable:!0});var n,o,r},gs=e=>e&&e[ps]&&e[ps].getPayload();class hs{constructor(){this.payload=void 0,fs(this,this)}getPayload(){return this.payload||[]}}class vs extends hs{constructor(e){super(),this.done=!0,this.elapsedTime=void 0,this.lastPosition=void 0,this.lastVelocity=void 0,this.v0=void 0,this.durationProgress=0,this._value=e,Ql.num(this._value)&&(this.lastPosition=this._value)}static create(e){return new vs(e)}getPayload(){return[this]}getValue(){return this._value}setValue(e,t){return Ql.num(e)&&(this.lastPosition=e,t&&(e=Math.round(e/t)*t,this.done&&(this.lastPosition=e))),this._value!==e&&(this._value=e,!0)}reset(){const{done:e}=this;this.done=!1,Ql.num(this._value)&&(this.elapsedTime=0,this.durationProgress=0,this.lastPosition=this._value,e&&(this.lastVelocity=null),this.v0=null)}}class bs extends vs{constructor(e){super(0),this._string=null,this._toString=void 0,this._toString=Di({output:[e,e]})}static create(e){return new bs(e)}getValue(){let e=this._string;return null==e?this._string=this._toString(this._value):e}setValue(e){if(Ql.str(e)){if(e==this._string)return!1;this._string=e,this._value=1}else{if(!super.setValue(e))return!1;this._string=null}return!0}reset(e){e&&(this._toString=Di({output:[this.getValue(),e]})),this._value=0,super.reset()}}const ks={dependencies:null};class _s extends hs{constructor(e){super(),this.source=e,this.setValue(e)}getValue(e){const t={};return Jl(this.source,((n,o)=>{var r;(r=n)&&r[ps]===r?t[o]=n.getValue(e):Vi(n)?t[o]=Hi(n):e||(t[o]=n)})),t}setValue(e){this.source=e,this.payload=this._makePayload(e)}reset(){this.payload&&Xl(this.payload,(e=>e.reset()))}_makePayload(e){if(e){const t=new Set;return Jl(e,this._addToPayload,t),Array.from(t)}}_addToPayload(e){ks.dependencies&&Vi(e)&&ks.dependencies.add(e);const t=gs(e);t&&Xl(t,(e=>this.add(e)))}}class ys extends _s{constructor(e){super(e)}static create(e){return new ys(e)}getValue(){return this.source.map((e=>e.getValue()))}setValue(e){const t=this.getPayload();return e.length==t.length?t.map(((t,n)=>t.setValue(e[n]))).some(Boolean):(super.setValue(e.map(Es)),!0)}}function Es(e){return(ls(e)?bs:vs).create(e)}function Cs(e){const t=ms(e);return t?t.constructor:Ql.arr(e)?ys:ls(e)?bs:vs}function Ss(){return(Ss=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e}).apply(this,arguments)}const ws=(e,t)=>{const n=!Ql.fun(e)||e.prototype&&e.prototype.isReactComponent;return(0,Kl.forwardRef)(((o,r)=>{const l=(0,Kl.useRef)(null),i=n&&(0,Kl.useCallback)((e=>{l.current=function(e,t){return e&&(Ql.fun(e)?e(t):e.current=t),t}(r,e)}),[r]),[s,a]=function(e,t){const n=new Set;return ks.dependencies=n,e.style&&(e=Ss({},e,{style:t.createAnimatedStyle(e.style)})),e=new _s(e),ks.dependencies=null,[e,n]}(o,t),c=as(),u=()=>{const e=l.current;n&&!e||!1===(!!e&&t.applyAnimatedValues(e,s.getValue(!0)))&&c()},d=new Bs(u,a),p=(0,Kl.useRef)();ds((()=>{const e=p.current;p.current=d,Xl(a,(e=>ji(e,d))),e&&(Xl(e.deps,(t=>Ki(t,e))),Nl.cancel(e.update))})),(0,Kl.useEffect)(u,[]),is((()=>()=>{const e=p.current;Xl(e.deps,(t=>Ki(t,e)))}));const m=t.getComponentProps(s.getValue());return Kl.createElement(e,Ss({},m,{ref:i}))}))};class Bs{constructor(e,t){this.update=e,this.deps=t}eventObserved(e){"change"==e.type&&Nl.write(this.update)}}const Is=Symbol.for("AnimatedComponent"),xs=e=>Ql.str(e)?e:e&&Ql.str(e.displayName)?e.displayName:Ql.fun(e)&&e.name||null;function Ts(){return(Ts=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e}).apply(this,arguments)}function Ns(e,...t){return Ql.fun(e)?e(...t):e}const Ps=(e,t)=>!0===e||!!(t&&e&&(Ql.fun(e)?e(t):ei(e).includes(t))),Ms=(e,t)=>Ql.obj(e)?t&&e[t]:e,Rs=(e,t)=>!0===e.default?e[t]:e.default?e.default[t]:void 0,Ls=e=>e,As=(e,t=Ls)=>{let n=Ds;e.default&&!0!==e.default&&(e=e.default,n=Object.keys(e));const o={};for(const r of n){const n=t(e[r],r);Ql.und(n)||(o[r]=n)}return o},Ds=["config","onProps","onStart","onChange","onPause","onResume","onRest"],Os={config:1,from:1,to:1,ref:1,loop:1,reset:1,pause:1,cancel:1,reverse:1,immediate:1,default:1,delay:1,onProps:1,onStart:1,onChange:1,onPause:1,onResume:1,onRest:1,onResolve:1,items:1,trail:1,sort:1,expires:1,initial:1,enter:1,update:1,leave:1,children:1,onDestroyed:1,keys:1,callId:1,parentId:1};function Fs(e){const t=function(e){const t={};let n=0;if(Jl(e,((e,o)=>{Os[o]||(t[o]=e,n++)})),n)return t}(e);if(t){const n={to:t};return Jl(e,((e,o)=>o in t||(n[o]=e))),n}return Ts({},e)}function zs(e){return e=Hi(e),Ql.arr(e)?e.map(zs):ls(e)?ai.createStringInterpolator({range:[0,1],output:[e,e]})(1):e}function Vs(e){for(const t in e)return!0;return!1}function Hs(e){return Ql.fun(e)||Ql.arr(e)&&Ql.obj(e[0])}function Gs(e,t){var n;null==(n=e.ref)||n.delete(e),null==t||t.delete(e)}function Us(e,t){var n;t&&e.ref!==t&&(null==(n=e.ref)||n.delete(e),t.add(e),e.ref=t)}const Ws=Ts({},{tension:170,friction:26},{mass:1,damping:1,easing:e=>e,clamp:!1});class $s{constructor(){this.tension=void 0,this.friction=void 0,this.frequency=void 0,this.damping=void 0,this.mass=void 0,this.velocity=0,this.restVelocity=void 0,this.precision=void 0,this.progress=void 0,this.duration=void 0,this.easing=void 0,this.clamp=void 0,this.bounce=void 0,this.decay=void 0,this.round=void 0,Object.assign(this,Ws)}}function js(e,t){if(Ql.und(t.decay)){const n=!Ql.und(t.tension)||!Ql.und(t.friction);!n&&Ql.und(t.frequency)&&Ql.und(t.damping)&&Ql.und(t.mass)||(e.duration=void 0,e.decay=void 0),n&&(e.frequency=void 0)}else e.duration=void 0}const Ks=[];class qs{constructor(){this.changed=!1,this.values=Ks,this.toValues=null,this.fromValues=Ks,this.to=void 0,this.from=void 0,this.config=new $s,this.immediate=!1}}function Ys(e,{key:t,props:n,defaultProps:o,state:r,actions:l}){return new Promise(((i,s)=>{var a;let c,u,d=Ps(null!=(a=n.cancel)?a:null==o?void 0:o.cancel,t);if(d)f();else{Ql.und(n.pause)||(r.paused=Ps(n.pause,t));let e=null==o?void 0:o.pause;!0!==e&&(e=r.paused||Ps(e,t)),c=Ns(n.delay||0,t),e?(r.resumeQueue.add(m),l.pause()):(l.resume(),m())}function p(){r.resumeQueue.add(m),r.timeouts.delete(u),u.cancel(),c=u.time-Nl.now()}function m(){c>0?(u=Nl.setTimeout(f,c),r.pauseQueue.add(p),r.timeouts.add(u)):f()}function f(){r.pauseQueue.delete(p),r.timeouts.delete(u),e<=(r.cancelId||0)&&(d=!0);try{l.start(Ts({},n,{callId:e,cancel:d}),i)}catch(e){s(e)}}}))}const Qs=(e,t)=>1==t.length?t[0]:t.some((e=>e.cancelled))?Js(e.get()):t.every((e=>e.noop))?Zs(e.get()):Xs(e.get(),t.every((e=>e.finished))),Zs=e=>({value:e,noop:!0,finished:!0,cancelled:!1}),Xs=(e,t,n=!1)=>({value:e,finished:t,cancelled:n}),Js=e=>({value:e,cancelled:!0,finished:!1});function ea(e,t,n,o){const{callId:r,parentId:l,onRest:i}=t,{asyncTo:s,promise:a}=n;return l||e!==s||t.reset?n.promise=(async()=>{n.asyncId=r,n.asyncTo=e;const c=As(t,((e,t)=>"onRest"===t?void 0:e));let u,d;const p=new Promise(((e,t)=>(u=e,d=t))),m=e=>{const t=r<=(n.cancelId||0)&&Js(o)||r!==n.asyncId&&Xs(o,!1);if(t)throw e.result=t,d(e),e},f=(e,t)=>{const l=new na,i=new oa;return(async()=>{if(ai.skipAnimation)throw ta(n),i.result=Xs(o,!1),d(i),i;m(l);const s=Ql.obj(e)?Ts({},e):Ts({},t,{to:e});s.parentId=r,Jl(c,((e,t)=>{Ql.und(s[t])&&(s[t]=e)}));const a=await o.start(s);return m(l),n.paused&&await new Promise((e=>{n.resumeQueue.add(e)})),a})()};let g;if(ai.skipAnimation)return ta(n),Xs(o,!1);try{let t;t=Ql.arr(e)?(async e=>{for(const t of e)await f(t)})(e):Promise.resolve(e(f,o.stop.bind(o))),await Promise.all([t.then(u),p]),g=Xs(o.get(),!0,!1)}catch(e){if(e instanceof na)g=e.result;else{if(!(e instanceof oa))throw e;g=e.result}}finally{r==n.asyncId&&(n.asyncId=l,n.asyncTo=l?s:void 0,n.promise=l?a:void 0)}return Ql.fun(i)&&Nl.batchedUpdates((()=>{i(g,o,o.item)})),g})():a}function ta(e,t){ti(e.timeouts,(e=>e.cancel())),e.pauseQueue.clear(),e.resumeQueue.clear(),e.asyncId=e.asyncTo=e.promise=void 0,t&&(e.cancelId=t)}class na extends Error{constructor(){super("An async animation has been interrupted. You see this error because you forgot to use `await` or `.catch(...)` on its returned promise."),this.result=void 0}}class oa extends Error{constructor(){super("SkipAnimationSignal"),this.result=void 0}}const ra=e=>e instanceof ia;let la=1;class ia extends Wi{constructor(...e){super(...e),this.id=la++,this.key=void 0,this._priority=0}get priority(){return this._priority}set priority(e){this._priority!=e&&(this._priority=e,this._onPriorityChange(e))}get(){const e=ms(this);return e&&e.getValue()}to(...e){return ai.to(this,e)}interpolate(...e){return os(`${ts}The "interpolate" function is deprecated in v9 (use "to" instead)`),ai.to(this,e)}toJSON(){return this.get()}observerAdded(e){1==e&&this._attach()}observerRemoved(e){0==e&&this._detach()}_attach(){}_detach(){}_onChange(e,t=!1){Ui(this,{type:"change",parent:this,value:e,idle:t})}_onPriorityChange(e){this.idle||mi.sort(this),Ui(this,{type:"priority",parent:this,priority:e})}}const sa=Symbol.for("SpringPhase"),aa=e=>(1&e[sa])>0,ca=e=>(2&e[sa])>0,ua=e=>(4&e[sa])>0,da=(e,t)=>t?e[sa]|=3:e[sa]&=-3,pa=(e,t)=>t?e[sa]|=4:e[sa]&=-5;class ma extends ia{constructor(e,t){if(super(),this.key=void 0,this.animation=new qs,this.queue=void 0,this.defaultProps={},this._state={paused:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set},this._pendingCalls=new Set,this._lastCallId=0,this._lastToId=0,this._memoizedDuration=0,!Ql.und(e)||!Ql.und(t)){const n=Ql.obj(e)?Ts({},e):Ts({},t,{from:e});Ql.und(n.default)&&(n.default=!0),this.start(n)}}get idle(){return!(ca(this)||this._state.asyncTo)||ua(this)}get goal(){return Hi(this.animation.to)}get velocity(){const e=ms(this);return e instanceof vs?e.lastVelocity||0:e.getPayload().map((e=>e.lastVelocity||0))}get hasAnimated(){return aa(this)}get isAnimating(){return ca(this)}get isPaused(){return ua(this)}advance(e){let t=!0,n=!1;const o=this.animation;let{config:r,toValues:l}=o;const i=gs(o.to);!i&&Vi(o.to)&&(l=ei(Hi(o.to))),o.values.forEach(((s,a)=>{if(s.done)return;const c=s.constructor==bs?1:i?i[a].lastPosition:l[a];let u=o.immediate,d=c;if(!u){if(d=s.lastPosition,r.tension<=0)return void(s.done=!0);let t=s.elapsedTime+=e;const n=o.fromValues[a],l=null!=s.v0?s.v0:s.v0=Ql.arr(r.velocity)?r.velocity[a]:r.velocity;let i;if(Ql.und(r.duration))if(r.decay){const e=!0===r.decay?.998:r.decay,o=Math.exp(-(1-e)*t);d=n+l/(1-e)*(1-o),u=Math.abs(s.lastPosition-d)<.1,i=l*o}else{i=null==s.lastVelocity?l:s.lastVelocity;const t=r.precision||(n==c?.005:Math.min(1,.001*Math.abs(c-n))),o=r.restVelocity||t/10,a=r.clamp?0:r.bounce,p=!Ql.und(a),m=n==c?s.v0>0:n<c;let f,g=!1;const h=1,v=Math.ceil(e/h);for(let e=0;e<v&&(f=Math.abs(i)>o,f||(u=Math.abs(c-d)<=t,!u));++e)p&&(g=d==c||d>c==m,g&&(i=-i*a,d=c)),i+=(1e-6*-r.tension*(d-c)+.001*-r.friction*i)/r.mass*h,d+=i*h}else{let o=1;r.duration>0&&(this._memoizedDuration!==r.duration&&(this._memoizedDuration=r.duration,s.durationProgress>0&&(s.elapsedTime=r.duration*s.durationProgress,t=s.elapsedTime+=e)),o=(r.progress||0)+t/this._memoizedDuration,o=o>1?1:o<0?0:o,s.durationProgress=o),d=n+r.easing(o)*(c-n),i=(d-s.lastPosition)/e,u=1==o}s.lastVelocity=i,Number.isNaN(d)&&(console.warn("Got NaN while animating:",this),u=!0)}i&&!i[a].done&&(u=!1),u?s.done=!0:t=!1,s.setValue(d,r.round)&&(n=!0)}));const s=ms(this),a=s.getValue();if(t){const e=Hi(o.to);a===e&&!n||r.decay?n&&r.decay&&this._onChange(a):(s.setValue(e),this._onChange(e)),this._stop()}else n&&this._onChange(a)}set(e){return Nl.batchedUpdates((()=>{this._stop(),this._focus(e),this._set(e)})),this}pause(){this._update({pause:!0})}resume(){this._update({pause:!1})}finish(){if(ca(this)){const{to:e,config:t}=this.animation;Nl.batchedUpdates((()=>{this._onStart(),t.decay||this._set(e,!1),this._stop()}))}return this}update(e){return(this.queue||(this.queue=[])).push(e),this}start(e,t){let n;return Ql.und(e)?(n=this.queue||[],this.queue=[]):n=[Ql.obj(e)?e:Ts({},t,{to:e})],Promise.all(n.map((e=>this._update(e)))).then((e=>Qs(this,e)))}stop(e){const{to:t}=this.animation;return this._focus(this.get()),ta(this._state,e&&this._lastCallId),Nl.batchedUpdates((()=>this._stop(t,e))),this}reset(){this._update({reset:!0})}eventObserved(e){"change"==e.type?this._start():"priority"==e.type&&(this.priority=e.priority+1)}_prepareNode(e){const t=this.key||"";let{to:n,from:o}=e;n=Ql.obj(n)?n[t]:n,(null==n||Hs(n))&&(n=void 0),o=Ql.obj(o)?o[t]:o,null==o&&(o=void 0);const r={to:n,from:o};return aa(this)||(e.reverse&&([n,o]=[o,n]),o=Hi(o),Ql.und(o)?ms(this)||this._set(n):this._set(o)),r}_update(e,t){let n=Ts({},e);const{key:o,defaultProps:r}=this;n.default&&Object.assign(r,As(n,((e,t)=>/^on/.test(t)?Ms(e,o):e))),_a(this,n,"onProps"),ya(this,"onProps",n,this);const l=this._prepareNode(n);if(Object.isFrozen(this))throw Error("Cannot animate a `SpringValue` object that is frozen. Did you forget to pass your component to `animated(...)` before animating its props?");const i=this._state;return Ys(++this._lastCallId,{key:o,props:n,defaultProps:r,state:i,actions:{pause:()=>{ua(this)||(pa(this,!0),ni(i.pauseQueue),ya(this,"onPause",Xs(this,fa(this,this.animation.to)),this))},resume:()=>{ua(this)&&(pa(this,!1),ca(this)&&this._resume(),ni(i.resumeQueue),ya(this,"onResume",Xs(this,fa(this,this.animation.to)),this))},start:this._merge.bind(this,l)}}).then((e=>{if(n.loop&&e.finished&&(!t||!e.noop)){const e=ga(n);if(e)return this._update(e,!0)}return e}))}_merge(e,t,n){if(t.cancel)return this.stop(!0),n(Js(this));const o=!Ql.und(e.to),r=!Ql.und(e.from);if(o||r){if(!(t.callId>this._lastToId))return n(Js(this));this._lastToId=t.callId}const{key:l,defaultProps:i,animation:s}=this,{to:a,from:c}=s;let{to:u=a,from:d=c}=e;!r||o||t.default&&!Ql.und(u)||(u=d),t.reverse&&([u,d]=[d,u]);const p=!Zl(d,c);p&&(s.from=d),d=Hi(d);const m=!Zl(u,a);m&&this._focus(u);const f=Hs(t.to),{config:g}=s,{decay:h,velocity:v}=g;(o||r)&&(g.velocity=0),t.config&&!f&&function(e,t,n){n&&(js(n=Ts({},n),t),t=Ts({},n,t)),js(e,t),Object.assign(e,t);for(const t in Ws)null==e[t]&&(e[t]=Ws[t]);let{mass:o,frequency:r,damping:l}=e;Ql.und(r)||(r<.01&&(r=.01),l<0&&(l=0),e.tension=Math.pow(2*Math.PI/r,2)*o,e.friction=4*Math.PI*l*o/r)}(g,Ns(t.config,l),t.config!==i.config?Ns(i.config,l):void 0);let b=ms(this);if(!b||Ql.und(u))return n(Xs(this,!0));const k=Ql.und(t.reset)?r&&!t.default:!Ql.und(d)&&Ps(t.reset,l),_=k?d:this.get(),y=zs(u),E=Ql.num(y)||Ql.arr(y)||ls(y),C=!f&&(!E||Ps(i.immediate||t.immediate,l));if(m){const e=Cs(u);if(e!==b.constructor){if(!C)throw Error(`Cannot animate between ${b.constructor.name} and ${e.name}, as the "to" prop suggests`);b=this._set(y)}}const S=b.constructor;let w=Vi(u),B=!1;if(!w){const e=k||!aa(this)&&p;(m||e)&&(B=Zl(zs(_),y),w=!B),(Zl(s.immediate,C)||C)&&Zl(g.decay,h)&&Zl(g.velocity,v)||(w=!0)}if(B&&ca(this)&&(s.changed&&!k?w=!0:w||this._stop(a)),!f&&((w||Vi(a))&&(s.values=b.getPayload(),s.toValues=Vi(u)?null:S==bs?[1]:ei(y)),s.immediate!=C&&(s.immediate=C,C||k||this._set(a)),w)){const{onRest:e}=s;Xl(ka,(e=>_a(this,t,e)));const o=Xs(this,fa(this,a));ni(this._pendingCalls,o),this._pendingCalls.add(n),s.changed&&Nl.batchedUpdates((()=>{s.changed=!k,null==e||e(o,this),k?Ns(i.onRest,o):null==s.onStart||s.onStart(o,this)}))}k&&this._set(_),f?n(ea(t.to,t,this._state,this)):w?this._start():ca(this)&&!m?this._pendingCalls.add(n):n(Zs(_))}_focus(e){const t=this.animation;e!==t.to&&(Gi(this)&&this._detach(),t.to=e,Gi(this)&&this._attach())}_attach(){let e=0;const{to:t}=this.animation;Vi(t)&&(ji(t,this),ra(t)&&(e=t.priority+1)),this.priority=e}_detach(){const{to:e}=this.animation;Vi(e)&&Ki(e,this)}_set(e,t=!0){const n=Hi(e);if(!Ql.und(n)){const e=ms(this);if(!e||!Zl(n,e.getValue())){const o=Cs(n);e&&e.constructor==o?e.setValue(n):fs(this,o.create(n)),e&&Nl.batchedUpdates((()=>{this._onChange(n,t)}))}}return ms(this)}_onStart(){const e=this.animation;e.changed||(e.changed=!0,ya(this,"onStart",Xs(this,fa(this,e.to)),this))}_onChange(e,t){t||(this._onStart(),Ns(this.animation.onChange,e,this)),Ns(this.defaultProps.onChange,e,this),super._onChange(e,t)}_start(){const e=this.animation;ms(this).reset(Hi(e.to)),e.immediate||(e.fromValues=e.values.map((e=>e.lastPosition))),ca(this)||(da(this,!0),ua(this)||this._resume())}_resume(){ai.skipAnimation?this.finish():mi.start(this)}_stop(e,t){if(ca(this)){da(this,!1);const n=this.animation;Xl(n.values,(e=>{e.done=!0})),n.toValues&&(n.onChange=n.onPause=n.onResume=void 0),Ui(this,{type:"idle",parent:this});const o=t?Js(this.get()):Xs(this.get(),fa(this,null!=e?e:n.to));ni(this._pendingCalls,o),n.changed&&(n.changed=!1,ya(this,"onRest",o,this))}}}function fa(e,t){const n=zs(t);return Zl(zs(e.get()),n)}function ga(e,t=e.loop,n=e.to){let o=Ns(t);if(o){const r=!0!==o&&Fs(o),l=(r||e).reverse,i=!r||r.reset;return ha(Ts({},e,{loop:t,default:!1,pause:void 0,to:!l||Hs(n)?n:void 0,from:i?e.from:void 0,reset:i},r))}}function ha(e){const{to:t,from:n}=e=Fs(e),o=new Set;return Ql.obj(t)&&ba(t,o),Ql.obj(n)&&ba(n,o),e.keys=o.size?Array.from(o):null,e}function va(e){const t=ha(e);return Ql.und(t.default)&&(t.default=As(t)),t}function ba(e,t){Jl(e,((e,n)=>null!=e&&t.add(n)))}const ka=["onStart","onRest","onChange","onPause","onResume"];function _a(e,t,n){e.animation[n]=t[n]!==Rs(t,n)?Ms(t[n],e.key):void 0}function ya(e,t,...n){var o,r,l,i;null==(o=(r=e.animation)[t])||o.call(r,...n),null==(l=(i=e.defaultProps)[t])||l.call(i,...n)}const Ea=["onStart","onChange","onRest"];let Ca=1;class Sa{constructor(e,t){this.id=Ca++,this.springs={},this.queue=[],this.ref=void 0,this._flush=void 0,this._initialProps=void 0,this._lastAsyncId=0,this._active=new Set,this._changed=new Set,this._started=!1,this._item=void 0,this._state={paused:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set},this._events={onStart:new Map,onChange:new Map,onRest:new Map},this._onFrame=this._onFrame.bind(this),t&&(this._flush=t),e&&this.start(Ts({default:!0},e))}get idle(){return!this._state.asyncTo&&Object.values(this.springs).every((e=>e.idle))}get item(){return this._item}set item(e){this._item=e}get(){const e={};return this.each(((t,n)=>e[n]=t.get())),e}set(e){for(const t in e){const n=e[t];Ql.und(n)||this.springs[t].set(n)}}update(e){return e&&this.queue.push(ha(e)),this}start(e){let{queue:t}=this;return e?t=ei(e).map(ha):this.queue=[],this._flush?this._flush(this,t):(Pa(this,t),wa(this,t))}stop(e,t){if(e!==!!e&&(t=e),t){const n=this.springs;Xl(ei(t),(t=>n[t].stop(!!e)))}else ta(this._state,this._lastAsyncId),this.each((t=>t.stop(!!e)));return this}pause(e){if(Ql.und(e))this.start({pause:!0});else{const t=this.springs;Xl(ei(e),(e=>t[e].pause()))}return this}resume(e){if(Ql.und(e))this.start({pause:!1});else{const t=this.springs;Xl(ei(e),(e=>t[e].resume()))}return this}each(e){Jl(this.springs,e)}_onFrame(){const{onStart:e,onChange:t,onRest:n}=this._events,o=this._active.size>0,r=this._changed.size>0;(o&&!this._started||r&&!this._started)&&(this._started=!0,ti(e,(([e,t])=>{t.value=this.get(),e(t,this,this._item)})));const l=!o&&this._started,i=r||l&&n.size?this.get():null;r&&t.size&&ti(t,(([e,t])=>{t.value=i,e(t,this,this._item)})),l&&(this._started=!1,ti(n,(([e,t])=>{t.value=i,e(t,this,this._item)})))}eventObserved(e){if("change"==e.type)this._changed.add(e.parent),e.idle||this._active.add(e.parent);else{if("idle"!=e.type)return;this._active.delete(e.parent)}Nl.onFrame(this._onFrame)}}function wa(e,t){return Promise.all(t.map((t=>Ba(e,t)))).then((t=>Qs(e,t)))}async function Ba(e,t,n){const{keys:o,to:r,from:l,loop:i,onRest:s,onResolve:a}=t,c=Ql.obj(t.default)&&t.default;i&&(t.loop=!1),!1===r&&(t.to=null),!1===l&&(t.from=null);const u=Ql.arr(r)||Ql.fun(r)?r:void 0;u?(t.to=void 0,t.onRest=void 0,c&&(c.onRest=void 0)):Xl(Ea,(n=>{const o=t[n];if(Ql.fun(o)){const r=e._events[n];t[n]=({finished:e,cancelled:t})=>{const n=r.get(o);n?(e||(n.finished=!1),t&&(n.cancelled=!0)):r.set(o,{value:null,finished:e||!1,cancelled:t||!1})},c&&(c[n]=t[n])}}));const d=e._state;t.pause===!d.paused?(d.paused=t.pause,ni(t.pause?d.pauseQueue:d.resumeQueue)):d.paused&&(t.pause=!0);const p=(o||Object.keys(e.springs)).map((n=>e.springs[n].start(t))),m=!0===t.cancel||!0===Rs(t,"cancel");(u||m&&d.asyncId)&&p.push(Ys(++e._lastAsyncId,{props:t,state:d,actions:{pause:Yl,resume:Yl,start(t,n){m?(ta(d,e._lastAsyncId),n(Js(e))):(t.onRest=s,n(ea(u,t,d,e)))}}})),d.paused&&await new Promise((e=>{d.resumeQueue.add(e)}));const f=Qs(e,await Promise.all(p));if(i&&f.finished&&(!n||!f.noop)){const n=ga(t,i,r);if(n)return Pa(e,[n]),Ba(e,n,!0)}return a&&Nl.batchedUpdates((()=>a(f,e,e.item))),f}function Ia(e,t){const n=Ts({},e.springs);return t&&Xl(ei(t),(e=>{Ql.und(e.keys)&&(e=ha(e)),Ql.obj(e.to)||(e=Ts({},e,{to:void 0})),Na(n,e,(e=>Ta(e)))})),xa(e,n),n}function xa(e,t){Jl(t,((t,n)=>{e.springs[n]||(e.springs[n]=t,ji(t,e))}))}function Ta(e,t){const n=new ma;return n.key=e,t&&ji(n,t),n}function Na(e,t,n){t.keys&&Xl(t.keys,(o=>{(e[o]||(e[o]=n(o)))._prepareNode(t)}))}function Pa(e,t){Xl(t,(t=>{Na(e.springs,t,(t=>Ta(t,e)))}))}const Ma=["children"],Ra=e=>{let{children:t}=e,n=function(e,t){if(null==e)return{};var n,o,r={},l=Object.keys(e);for(o=0;o<l.length;o++)n=l[o],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,Ma);const o=(0,Kl.useContext)(La),r=n.pause||!!o.pause,l=n.immediate||!!o.immediate;n=function(e,t){const[n]=(0,Kl.useState)((()=>({inputs:t,result:e()}))),o=(0,Kl.useRef)(),r=o.current;let l=r;return l?Boolean(t&&l.inputs&&function(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}(t,l.inputs))||(l={inputs:t,result:e()}):l=n,(0,Kl.useEffect)((()=>{o.current=l,r==n&&(n.inputs=n.result=void 0)}),[l]),l.result}((()=>({pause:r,immediate:l})),[r,l]);const{Provider:i}=La;return Kl.createElement(i,{value:n},t)},La=(Aa=Ra,Da={},Object.assign(Aa,Kl.createContext(Da)),Aa.Provider._context=Aa,Aa.Consumer._context=Aa,Aa);var Aa,Da;Ra.Provider=La.Provider,Ra.Consumer=La.Consumer;const Oa=()=>{const e=[],t=function(t){rs(`${ts}Directly calling start instead of using the api object is deprecated in v9 (use ".start" instead), this will be removed in later 0.X.0 versions`);const o=[];return Xl(e,((e,r)=>{if(Ql.und(t))o.push(e.start());else{const l=n(t,e,r);l&&o.push(e.start(l))}})),o};t.current=e,t.add=function(t){e.includes(t)||e.push(t)},t.delete=function(t){const n=e.indexOf(t);~n&&e.splice(n,1)},t.pause=function(){return Xl(e,(e=>e.pause(...arguments))),this},t.resume=function(){return Xl(e,(e=>e.resume(...arguments))),this},t.set=function(t){Xl(e,(e=>e.set(t)))},t.start=function(t){const n=[];return Xl(e,((e,o)=>{if(Ql.und(t))n.push(e.start());else{const r=this._getProps(t,e,o);r&&n.push(e.start(r))}})),n},t.stop=function(){return Xl(e,(e=>e.stop(...arguments))),this},t.update=function(t){return Xl(e,((e,n)=>e.update(this._getProps(t,e,n)))),this};const n=function(e,t,n){return Ql.fun(e)?e(n,t):e};return t._getProps=n,t};function Fa(e,t,n){const o=Ql.fun(t)&&t;o&&!n&&(n=[]);const r=(0,Kl.useMemo)((()=>o||3==arguments.length?Oa():void 0),[]),l=(0,Kl.useRef)(0),i=as(),s=(0,Kl.useMemo)((()=>({ctrls:[],queue:[],flush(e,t){const n=Ia(e,t);return l.current>0&&!s.queue.length&&!Object.keys(n).some((t=>!e.springs[t]))?wa(e,t):new Promise((o=>{xa(e,n),s.queue.push((()=>{o(wa(e,t))})),i()}))}})),[]),a=(0,Kl.useRef)([...s.ctrls]),c=[],u=us(e)||0;function d(e,n){for(let r=e;r<n;r++){const e=a.current[r]||(a.current[r]=new Sa(null,s.flush)),n=o?o(r,e):t[r];n&&(c[r]=va(n))}}(0,Kl.useMemo)((()=>{Xl(a.current.slice(e,u),(e=>{Gs(e,r),e.stop(!0)})),a.current.length=e,d(u,e)}),[e]),(0,Kl.useMemo)((()=>{d(0,Math.min(u,e))}),n);const p=a.current.map(((e,t)=>Ia(e,c[t]))),m=(0,Kl.useContext)(Ra),f=us(m),g=m!==f&&Vs(m);ds((()=>{l.current++,s.ctrls=a.current;const{queue:e}=s;e.length&&(s.queue=[],Xl(e,(e=>e()))),Xl(a.current,((e,t)=>{null==r||r.add(e),g&&e.start({default:m});const n=c[t];n&&(Us(e,n.ref),e.ref?e.queue.push(n):e.start(n))}))})),is((()=>()=>{Xl(s.ctrls,(e=>e.stop(!0)))}));const h=p.map((e=>Ts({},e)));return r?[h,r]:h}let za;!function(e){e.MOUNT="mount",e.ENTER="enter",e.UPDATE="update",e.LEAVE="leave"}(za||(za={}));class Va extends ia{constructor(e,t){super(),this.key=void 0,this.idle=!0,this.calc=void 0,this._active=new Set,this.source=e,this.calc=Di(...t);const n=this._get(),o=Cs(n);fs(this,o.create(n))}advance(e){const t=this._get();Zl(t,this.get())||(ms(this).setValue(t),this._onChange(t,this.idle)),!this.idle&&Ga(this._active)&&Ua(this)}_get(){const e=Ql.arr(this.source)?this.source.map(Hi):ei(Hi(this.source));return this.calc(...e)}_start(){this.idle&&!Ga(this._active)&&(this.idle=!1,Xl(gs(this),(e=>{e.done=!1})),ai.skipAnimation?(Nl.batchedUpdates((()=>this.advance())),Ua(this)):mi.start(this))}_attach(){let e=1;Xl(ei(this.source),(t=>{Vi(t)&&ji(t,this),ra(t)&&(t.idle||this._active.add(t),e=Math.max(e,t.priority+1))})),this.priority=e,this._start()}_detach(){Xl(ei(this.source),(e=>{Vi(e)&&Ki(e,this)})),this._active.clear(),Ua(this)}eventObserved(e){"change"==e.type?e.idle?this.advance():(this._active.add(e.parent),this._start()):"idle"==e.type?this._active.delete(e.parent):"priority"==e.type&&(this.priority=ei(this.source).reduce(((e,t)=>Math.max(e,(ra(t)?t.priority:0)+1)),0))}}function Ha(e){return!1!==e.idle}function Ga(e){return!e.size||Array.from(e).every(Ha)}function Ua(e){e.idle||(e.idle=!0,Xl(gs(e),(e=>{e.done=!0})),Ui(e,{type:"idle",parent:e}))}ai.assign({createStringInterpolator:es,to:(e,t)=>new Va(e,t)}),mi.advance;var Wa=window.ReactDOM;function $a(e,t){if(null==e)return{};var n,o,r={},l=Object.keys(e);for(o=0;o<l.length;o++)n=l[o],t.indexOf(n)>=0||(r[n]=e[n]);return r}const ja=["style","children","scrollTop","scrollLeft"],Ka=/^--/;function qa(e,t){return null==t||"boolean"==typeof t||""===t?"":"number"!=typeof t||0===t||Ka.test(e)||Qa.hasOwnProperty(e)&&Qa[e]?(""+t).trim():t+"px"}const Ya={};let Qa={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0};const Za=["Webkit","Ms","Moz","O"];Qa=Object.keys(Qa).reduce(((e,t)=>(Za.forEach((n=>e[((e,t)=>e+t.charAt(0).toUpperCase()+t.substring(1))(n,t)]=e[t])),e)),Qa);const Xa=["x","y","z"],Ja=/^(matrix|translate|scale|rotate|skew)/,ec=/^(translate)/,tc=/^(rotate|skew)/,nc=(e,t)=>Ql.num(e)&&0!==e?e+t:e,oc=(e,t)=>Ql.arr(e)?e.every((e=>oc(e,t))):Ql.num(e)?e===t:parseFloat(e)===t;class rc extends _s{constructor(e){let{x:t,y:n,z:o}=e,r=$a(e,Xa);const l=[],i=[];(t||n||o)&&(l.push([t||0,n||0,o||0]),i.push((e=>[`translate3d(${e.map((e=>nc(e,"px"))).join(",")})`,oc(e,0)]))),Jl(r,((e,t)=>{if("transform"===t)l.push([e||""]),i.push((e=>[e,""===e]));else if(Ja.test(t)){if(delete r[t],Ql.und(e))return;const n=ec.test(t)?"px":tc.test(t)?"deg":"";l.push(ei(e)),i.push("rotate3d"===t?([e,t,o,r])=>[`rotate3d(${e},${t},${o},${nc(r,n)})`,oc(r,0)]:e=>[`${t}(${e.map((e=>nc(e,n))).join(",")})`,oc(e,t.startsWith("scale")?1:0)])}})),l.length&&(r.transform=new lc(l,i)),super(r)}}class lc extends Wi{constructor(e,t){super(),this._value=null,this.inputs=e,this.transforms=t}get(){return this._value||(this._value=this._get())}_get(){let e="",t=!0;return Xl(this.inputs,((n,o)=>{const r=Hi(n[0]),[l,i]=this.transforms[o](Ql.arr(r)?r:n.map(Hi));e+=" "+l,t=t&&i})),t?"none":e}observerAdded(e){1==e&&Xl(this.inputs,(e=>Xl(e,(e=>Vi(e)&&ji(e,this)))))}observerRemoved(e){0==e&&Xl(this.inputs,(e=>Xl(e,(e=>Vi(e)&&Ki(e,this)))))}eventObserved(e){"change"==e.type&&(this._value=null),Ui(this,e)}}const ic=["scrollTop","scrollLeft"];ai.assign({batchedUpdates:Wa.unstable_batchedUpdates,createStringInterpolator:es,colors:{transparent:0,aliceblue:4042850303,antiquewhite:4209760255,aqua:16777215,aquamarine:2147472639,azure:4043309055,beige:4126530815,bisque:4293182719,black:255,blanchedalmond:4293643775,blue:65535,blueviolet:2318131967,brown:2771004159,burlywood:3736635391,burntsienna:3934150143,cadetblue:1604231423,chartreuse:2147418367,chocolate:3530104575,coral:4286533887,cornflowerblue:1687547391,cornsilk:4294499583,crimson:3692313855,cyan:16777215,darkblue:35839,darkcyan:9145343,darkgoldenrod:3095792639,darkgray:2846468607,darkgreen:6553855,darkgrey:2846468607,darkkhaki:3182914559,darkmagenta:2332068863,darkolivegreen:1433087999,darkorange:4287365375,darkorchid:2570243327,darkred:2332033279,darksalmon:3918953215,darkseagreen:2411499519,darkslateblue:1211993087,darkslategray:793726975,darkslategrey:793726975,darkturquoise:13554175,darkviolet:2483082239,deeppink:4279538687,deepskyblue:12582911,dimgray:1768516095,dimgrey:1768516095,dodgerblue:512819199,firebrick:2988581631,floralwhite:4294635775,forestgreen:579543807,fuchsia:4278255615,gainsboro:3705462015,ghostwhite:4177068031,gold:4292280575,goldenrod:3668254975,gray:2155905279,green:8388863,greenyellow:2919182335,grey:2155905279,honeydew:4043305215,hotpink:4285117695,indianred:3445382399,indigo:1258324735,ivory:4294963455,khaki:4041641215,lavender:3873897215,lavenderblush:4293981695,lawngreen:2096890111,lemonchiffon:4294626815,lightblue:2916673279,lightcoral:4034953471,lightcyan:3774873599,lightgoldenrodyellow:4210742015,lightgray:3553874943,lightgreen:2431553791,lightgrey:3553874943,lightpink:4290167295,lightsalmon:4288707327,lightseagreen:548580095,lightskyblue:2278488831,lightslategray:2005441023,lightslategrey:2005441023,lightsteelblue:2965692159,lightyellow:4294959359,lime:16711935,limegreen:852308735,linen:4210091775,magenta:4278255615,maroon:2147483903,mediumaquamarine:1724754687,mediumblue:52735,mediumorchid:3126187007,mediumpurple:2473647103,mediumseagreen:1018393087,mediumslateblue:2070474495,mediumspringgreen:16423679,mediumturquoise:1221709055,mediumvioletred:3340076543,midnightblue:421097727,mintcream:4127193855,mistyrose:4293190143,moccasin:4293178879,navajowhite:4292783615,navy:33023,oldlace:4260751103,olive:2155872511,olivedrab:1804477439,orange:4289003775,orangered:4282712319,orchid:3664828159,palegoldenrod:4008225535,palegreen:2566625535,paleturquoise:2951671551,palevioletred:3681588223,papayawhip:4293907967,peachpuff:4292524543,peru:3448061951,pink:4290825215,plum:3718307327,powderblue:2967529215,purple:2147516671,rebeccapurple:1714657791,red:4278190335,rosybrown:3163525119,royalblue:1097458175,saddlebrown:2336560127,salmon:4202722047,sandybrown:4104413439,seagreen:780883967,seashell:4294307583,sienna:2689740287,silver:3233857791,skyblue:2278484991,slateblue:1784335871,slategray:1887473919,slategrey:1887473919,snow:4294638335,springgreen:16744447,steelblue:1182971135,tan:3535047935,teal:8421631,thistle:3636451583,tomato:4284696575,turquoise:1088475391,violet:4001558271,wheat:4125012991,white:4294967295,whitesmoke:4126537215,yellow:4294902015,yellowgreen:2597139199}});const sc=((e,{applyAnimatedValues:t=(()=>!1),createAnimatedStyle:n=(e=>new _s(e)),getComponentProps:o=(e=>e)}={})=>{const r={applyAnimatedValues:t,createAnimatedStyle:n,getComponentProps:o},l=e=>{const t=xs(e)||"Anonymous";return(e=Ql.str(e)?l[e]||(l[e]=ws(e,r)):e[Is]||(e[Is]=ws(e,r))).displayName=`Animated(${t})`,e};return Jl(e,((t,n)=>{Ql.arr(e)&&(n=xs(t)),l[n]=l(t)})),{animated:l}})(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"],{applyAnimatedValues:function(e,t){if(!e.nodeType||!e.setAttribute)return!1;const n="filter"===e.nodeName||e.parentNode&&"filter"===e.parentNode.nodeName,o=t,{style:r,children:l,scrollTop:i,scrollLeft:s}=o,a=$a(o,ja),c=Object.values(a),u=Object.keys(a).map((t=>n||e.hasAttribute(t)?t:Ya[t]||(Ya[t]=t.replace(/([A-Z])/g,(e=>"-"+e.toLowerCase())))));void 0!==l&&(e.textContent=l);for(let t in r)if(r.hasOwnProperty(t)){const n=qa(t,r[t]);Ka.test(t)?e.style.setProperty(t,n):e.style[t]=n}u.forEach(((t,n)=>{e.setAttribute(t,c[n])})),void 0!==i&&(e.scrollTop=i),void 0!==s&&(e.scrollLeft=s)},createAnimatedStyle:e=>new rc(e),getComponentProps:e=>$a(e,ic)}).animated,ac=e=>e+1,cc=e=>({top:e.offsetTop,left:e.offsetLeft});var uc=function(e){let{isSelected:t,adjustScrolling:n,enableAnimation:o,triggerAnimationOnChange:r}=e;const l=(0,s.useRef)(),i=(0,d.useReducedMotion)()||!o,[a,c]=(0,s.useReducer)(ac,0),[u,p]=(0,s.useReducer)(ac,0),[m,f]=(0,s.useState)({x:0,y:0}),g=(0,s.useMemo)((()=>l.current?cc(l.current):null),[r]),h=(0,s.useMemo)((()=>{if(!n||!l.current)return()=>{};const e=(0,cl.getScrollContainer)(l.current);if(!e)return()=>{};const t=l.current.getBoundingClientRect();return()=>{const n=l.current.getBoundingClientRect().top-t.top;n&&(e.scrollTop+=n)}}),[r,n]);function v(e){let{value:n}=e,{x:o,y:r}=n;o=Math.round(o),r=Math.round(r),o===v.x&&r===v.y||(function(e){let{x:n,y:o}=e;if(!l.current)return;const r=0===n&&0===o;l.current.style.transformOrigin=r?"":"center",l.current.style.transform=r?"":`translate3d(${n}px,${o}px,0)`,l.current.style.zIndex=!t||r?"":"1",h()}({x:o,y:r}),v.x=o,v.y=r)}return(0,s.useLayoutEffect)((()=>{a&&p()}),[a]),(0,s.useLayoutEffect)((()=>{if(!g)return;if(i)return void h();l.current.style.transform="";const e=cc(l.current);c(),f({x:Math.round(g.left-e.left),y:Math.round(g.top-e.top)})}),[r]),v.x=0,v.y=0,function(e,t){const n=Ql.fun(e),[[o],r]=Fa(1,n?e:[e],n?t||[]:t)}({from:{x:m.x,y:m.y},to:{x:0,y:0},reset:a!==u,config:{mass:5,tension:2e3,friction:200},immediate:i,onChange:v}),l};const dc=".block-editor-block-list__block",pc=".block-list-appender",mc=".block-editor-button-block-appender";function fc(e,t){return t.closest([dc,pc,mc].join(","))===e}function gc(e){for(;e&&e.nodeType!==e.ELEMENT_NODE;)e=e.parentNode;if(!e)return;const t=e.closest(dc);return t?t.id.slice("block-".length):void 0}function hc(e){const t=(0,s.useRef)(),n=function(e){return(0,m.useSelect)((t=>{const{getSelectedBlocksInitialCaretPosition:n,isNavigationMode:o,isBlockSelected:r}=t(Qn);if(r(e)&&!o())return n()}),[e])}(e),{isBlockSelected:o,isMultiSelecting:r}=(0,m.useSelect)(Qn);return(0,s.useEffect)((()=>{if(!o(e)||r())return;if(null==n)return;if(!t.current)return;const{ownerDocument:l}=t.current;if(t.current.contains(l.activeElement))return;const i=cl.focus.tabbable.find(t.current).filter((e=>(0,cl.isTextField)(e))),s=-1===n,a=(s?u.last:u.first)(i)||t.current;if(fc(t.current,a)){if(!t.current.getAttribute("contenteditable")){const e=cl.focus.tabbable.findNext(t.current);if(e&&fc(t.current,e)&&(0,cl.isFormElement)(e))return void e.focus()}(0,cl.placeCaretAtHorizontalEdge)(a,s)}else t.current.focus()}),[n,e]),t}function vc(e){if(e.defaultPrevented)return;const t="mouseover"===e.type?"add":"remove";e.preventDefault(),e.currentTarget.classList[t]("is-hovered")}function bc(){const e=(0,m.useSelect)((e=>{const{isNavigationMode:t,getSettings:n}=e(Qn);return t()||n().outlineMode}),[]);return(0,d.useRefEffect)((t=>{if(e)return t.addEventListener("mouseout",vc),t.addEventListener("mouseover",vc),()=>{t.removeEventListener("mouseout",vc),t.removeEventListener("mouseover",vc),t.classList.remove("is-hovered")}}),[e])}function kc(e){return(0,m.useSelect)((t=>{const{isBlockBeingDragged:n,isBlockHighlighted:o,isBlockSelected:l,isBlockMultiSelected:i,getBlockName:s,getSettings:a,hasSelectedInnerBlock:u,isTyping:d}=t(Qn),{outlineMode:p}=a(),m=n(e),f=l(e),g=s(e),h=u(e,!0);return c()({"is-selected":f,"is-highlighted":o(e),"is-multi-selected":i(e),"is-reusable":(0,r.isReusableBlock)((0,r.getBlockType)(g)),"is-dragging":m,"has-child-selected":h,"remove-outline":f&&p&&d()})}),[e])}function _c(e){return(0,m.useSelect)((t=>{const n=t(Qn).getBlockName(e),o=(0,r.getBlockType)(n);if((null==o?void 0:o.apiVersion)>1)return(0,r.getBlockDefaultClassName)(n)}),[e])}function yc(e){return(0,m.useSelect)((t=>{const{getBlockName:n,getBlockAttributes:o}=t(Qn),l=o(e);if(null==l||!l.className)return;const i=(0,r.getBlockType)(n(e));return(null==i?void 0:i.apiVersion)>1?l.className:void 0}),[e])}function Ec(e){return(0,m.useSelect)((t=>{const{hasBlockMovingClientId:n,canInsertBlockType:o,getBlockName:r,getBlockRootClientId:l,isBlockSelected:i}=t(Qn);if(!i(e))return;const s=n();return s?c()("is-block-moving-mode",{"can-insert-moving-block":o(r(s),l(e))}):void 0}),[e])}function Cc(e){const{isBlockSelected:t}=(0,m.useSelect)(Qn),{selectBlock:n,selectionChange:o}=(0,m.useDispatch)(Qn);return(0,d.useRefEffect)((r=>{function l(l){r.parentElement.closest('[contenteditable="true"]')||(t(e)?l.target.isContentEditable||o(e):fc(r,l.target)&&n(e))}return r.addEventListener("focusin",l),()=>{r.removeEventListener("focusin",l)}}),[t,n])}var Sc=window.wp.keycodes;function wc(e){const t=(0,m.useSelect)((t=>t(Qn).isBlockSelected(e)),[e]),{getBlockRootClientId:n,getBlockIndex:o}=(0,m.useSelect)(Qn),{insertDefaultBlock:r,removeBlock:l}=(0,m.useDispatch)(Qn);return(0,d.useRefEffect)((i=>{if(t)return i.addEventListener("keydown",s),i.addEventListener("dragstart",a),()=>{i.removeEventListener("keydown",s),i.removeEventListener("dragstart",a)};function s(t){const{keyCode:s,target:a}=t;s!==Sc.ENTER&&s!==Sc.BACKSPACE&&s!==Sc.DELETE||a!==i||(0,cl.isTextField)(a)||(t.preventDefault(),s===Sc.ENTER?r({},n(e),o(e)+1):l(e))}function a(e){e.preventDefault()}}),[e,t,n,o,r,l])}function Bc(e){const{isNavigationMode:t,isBlockSelected:n}=(0,m.useSelect)(Qn),{setNavigationMode:o,selectBlock:r}=(0,m.useDispatch)(Qn);return(0,d.useRefEffect)((l=>{function i(l){t()&&!l.defaultPrevented&&(l.preventDefault(),n(e)?o(!1):r(e))}return l.addEventListener("mousedown",i),()=>{l.addEventListener("mousedown",i)}}),[e,t,n,o])}function Ic(){const e=(0,s.useContext)(Nf);return(0,d.useRefEffect)((t=>{if(e)return e.observe(t),()=>{e.unobserve(t)}}),[e])}function xc(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{__unstableIsHtml:t,__unstableIsDisabled:n=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{clientId:o,className:l,wrapperProps:i={},isAligned:a}=(0,s.useContext)(Tc),{index:u,mode:p,name:f,blockApiVersion:h,blockTitle:v,isPartOfSelection:b,adjustScrolling:k,enableAnimation:_}=(0,m.useSelect)((e=>{const{getBlockIndex:t,getBlockMode:n,getBlockName:l,isTyping:i,getGlobalBlockCount:s,isBlockSelected:a,isBlockMultiSelected:c,isAncestorMultiSelected:u,isFirstMultiSelectedBlock:d}=e(Qn),p=a(o),m=c(o)||u(o),f=l(o),g=(0,r.getBlockType)(f);return{index:t(o),mode:n(o),name:f,blockApiVersion:(null==g?void 0:g.apiVersion)||1,blockTitle:null==g?void 0:g.title,isPartOfSelection:p||m,adjustScrolling:p||d(o),enableAnimation:!i()&&s()<=200}}),[o]),y=(0,g.sprintf)((0,g.__)("Block: %s"),v),E="html"!==p||t?"":"-visual",C=(0,d.useMergeRefs)([e.ref,hc(o),vo(o),Cc(o),wc(o),Bc(o),bc(),Ic(),uc({isSelected:b,adjustScrolling:k,enableAnimation:_,triggerAnimationOnChange:u}),(0,d.useDisabled)({isDisabled:!n})]),S=eo();return h<2&&o===S.clientId&&"undefined"!=typeof process&&process.env,{...i,...e,ref:C,id:`block-${o}${E}`,tabIndex:0,role:"document","aria-label":y,"data-block":o,"data-type":f,"data-title":v,className:c()(c()("block-editor-block-list__block",{"wp-block":!a}),l,e.className,i.className,kc(o),_c(o),yc(o),Ec(o)),style:{...i.style,...e.style}}}xc.save=r.__unstableGetBlockProps;const Tc=(0,s.createContext)();function Nc(e){let{children:t,isHtml:n,...o}=e;return(0,s.createElement)("div",xc(o,{__unstableIsHtml:n}),t)}const Pc=(0,m.withSelect)(((e,t)=>{let{clientId:n,rootClientId:o}=t;const{isBlockSelected:r,getBlockMode:l,isSelectionEnabled:i,getTemplateLock:s,__unstableGetBlockWithoutInnerBlocks:a,canRemoveBlock:c,canMoveBlock:u}=e(Qn),d=a(n),p=r(n),m=s(o),f=c(n,o),g=u(n,o),{name:h,attributes:v,isValid:b}=d||{};return{mode:l(n),isSelectionEnabled:i(),isLocked:!!m,canRemove:f,canMove:g,block:d,name:h,attributes:v,isValid:b,isSelected:p}})),Mc=(0,m.withDispatch)(((e,t,n)=>{let{select:o}=n;const{updateBlockAttributes:l,insertBlocks:i,mergeBlocks:s,replaceBlocks:a,toggleSelection:c,__unstableMarkLastChangeAsPersistent:u}=e(Qn);return{setAttributes(e){const{getMultiSelectedBlockClientIds:n}=o(Qn),r=n(),{clientId:i}=t,s=r.length?r:[i];l(s,e)},onInsertBlocks(e,n){const{rootClientId:o}=t;i(e,n,o)},onInsertBlocksAfter(e){const{clientId:n,rootClientId:r}=t,{getBlockIndex:l}=o(Qn),s=l(n);i(e,s+1,r)},onMerge(e){const{clientId:n}=t,{getPreviousBlockClientId:r,getNextBlockClientId:l}=o(Qn);if(e){const e=l(n);e&&s(n,e)}else{const e=r(n);e&&s(e,n)}},onReplace(e,n,o){e.length&&!(0,r.isUnmodifiedDefaultBlock)(e[e.length-1])&&u(),a([t.clientId],e,n,o)},toggleSelection(e){c(e)}}}));var Rc=(0,d.compose)(d.pure,Pc,Mc,(0,d.ifCondition)((e=>{let{block:t}=e;return!!t})),(0,p.withFilters)("editor.BlockListBlock"))((function(e){var t;let{block:{__unstableBlockSource:n},mode:o,isLocked:l,canRemove:i,clientId:a,isSelected:d,isSelectionEnabled:p,className:f,name:g,isValid:h,attributes:v,wrapperProps:b,setAttributes:k,onReplace:_,onInsertBlocksAfter:y,onMerge:E,toggleSelection:C}=e;const S=(0,m.useSelect)((e=>{const{getSettings:t}=e(Qn);return t().supportsLayout}),[]),{removeBlock:w}=(0,m.useDispatch)(Qn),B=(0,s.useCallback)((()=>w(a)),[a]);let I=(0,s.createElement)(gl,{name:g,isSelected:d,attributes:v,setAttributes:k,insertBlocksAfter:l?void 0:y,onReplace:i?_:void 0,onRemove:i?B:void 0,mergeBlocks:i?E:void 0,clientId:a,isSelectionEnabled:p,toggleSelection:C});const x=(0,r.getBlockType)(g);null!=x&&x.getEditWrapperProps&&(b=function(e,t){const n={...e,...t};return e&&t&&e.className&&t.className&&(n.className=c()(e.className,t.className)),e&&t&&e.style&&t.style&&(n.style={...e.style,...t.style}),n}(b,x.getEditWrapperProps(v)));const T=b&&!!b["data-align"]&&!S;let N;if(T&&(I=(0,s.createElement)("div",{className:"wp-block","data-align":b["data-align"]},I)),h)N="html"===o?(0,s.createElement)(s.Fragment,null,(0,s.createElement)("div",{style:{display:"none"}},I),(0,s.createElement)(Nc,{isHtml:!0},(0,s.createElement)(xl,{clientId:a}))):(null==x?void 0:x.apiVersion)>1?I:(0,s.createElement)(Nc,b,I);else{const e=n?(0,r.serializeRawBlock)(n):(0,r.getSaveContent)(x,v);N=(0,s.createElement)(Nc,{className:"has-warning"},(0,s.createElement)(El,{clientId:a}),(0,s.createElement)(s.RawHTML,null,(0,cl.safeHTML)(e)))}const P={clientId:a,className:null!==(t=b)&&void 0!==t&&t["data-align"]&&S?c()(f,`align${b["data-align"]}`):f,wrapperProps:(0,u.omit)(b,["data-align"]),isAligned:T},M=(0,s.useMemo)((()=>P),Object.values(P));return(0,s.createElement)(Tc.Provider,{value:M},(0,s.createElement)(Bl,{fallback:(0,s.createElement)(Nc,{className:"has-warning"},(0,s.createElement)(Sl,null))},N))})),Lc=window.wp.htmlEntities,Ac=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M18 11.2h-5.2V6h-1.6v5.2H6v1.6h5.2V18h1.6v-5.2H18z"}));const Dc=[(0,s.createInterpolateElement)((0,g.__)("While writing, you can press <kbd>/</kbd> to quickly insert new blocks."),{kbd:(0,s.createElement)("kbd",null)}),(0,s.createInterpolateElement)((0,g.__)("Indent a list by pressing <kbd>space</kbd> at the beginning of a line."),{kbd:(0,s.createElement)("kbd",null)}),(0,s.createInterpolateElement)((0,g.__)("Outdent a list by pressing <kbd>backspace</kbd> at the beginning of a line."),{kbd:(0,s.createElement)("kbd",null)}),(0,g.__)("Drag files into the editor to automatically insert media blocks."),(0,g.__)("Change a block's type by pressing the block icon on the toolbar.")];var Oc=function(){const[e]=(0,s.useState)(Math.floor(Math.random()*Dc.length));return(0,s.createElement)(p.Tip,null,Dc[e])},Fc=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M19 8h-1V6h-5v2h-2V6H6v2H5c-1.1 0-2 .9-2 2v8c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-8c0-1.1-.9-2-2-2zm.5 10c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5v-8c0-.3.2-.5.5-.5h14c.3 0 .5.2.5.5v8z"})),zc=(0,s.memo)((function(e){var t;let{icon:n,showColors:o=!1,className:r}=e;"block-default"===(null===(t=n)||void 0===t?void 0:t.src)&&(n={src:Fc});const l=(0,s.createElement)(p.Icon,{icon:n&&n.src?n.src:n}),i=o?{backgroundColor:n&&n.background,color:n&&n.foreground}:{};return(0,s.createElement)("span",{style:i,className:c()("block-editor-block-icon",r,{"has-colors":o})},l)})),Vc=function(e){let{title:t,icon:n,description:o,blockType:r}=e;return r&&(H()("`blockType` property in `BlockCard component`",{since:"5.7",alternative:"`title, icon and description` properties"}),({title:t,icon:n,description:o}=r)),(0,s.createElement)("div",{className:"block-editor-block-card"},(0,s.createElement)(zc,{icon:n,showColors:!0}),(0,s.createElement)("div",{className:"block-editor-block-card__content"},(0,s.createElement)("h2",{className:"block-editor-block-card__title"},t),(0,s.createElement)("span",{className:"block-editor-block-card__description"},o)))};function Hc(e){let{clientId:t=null,value:n,selection:o,onChange:l=u.noop,onInput:i=u.noop}=e;const a=(0,m.useRegistry)(),{resetBlocks:c,resetSelection:d,replaceInnerBlocks:p,setHasControlledInnerBlocks:f,__unstableMarkNextChangeAsNotPersistent:g}=a.dispatch(Qn),{getBlockName:h,getBlocks:v}=a.select(Qn),b=(0,m.useSelect)((e=>!t||e(Qn).areInnerBlocksControlled(t)),[t]),k=(0,s.useRef)({incoming:null,outgoing:[]}),_=(0,s.useRef)(!1),y=()=>{n&&(g(),t?a.batch((()=>{f(t,!0);const e=n.map((e=>(0,r.cloneBlock)(e)));_.current&&(k.current.incoming=e),g(),p(t,e)})):(_.current&&(k.current.incoming=n),c(n)))},E=(0,s.useRef)(i),C=(0,s.useRef)(l);(0,s.useEffect)((()=>{E.current=i,C.current=l}),[i,l]),(0,s.useEffect)((()=>{k.current.outgoing.includes(n)?(0,u.last)(k.current.outgoing)===n&&(k.current.outgoing=[]):v(t)!==n&&(k.current.outgoing=[],y(),o&&d(o.selectionStart,o.selectionEnd,o.initialPosition))}),[n,t]),(0,s.useEffect)((()=>{b||(k.current.outgoing=[],y())}),[b]),(0,s.useEffect)((()=>{const{getSelectionStart:e,getSelectionEnd:n,getSelectedBlocksInitialCaretPosition:o,isLastBlockChangePersistent:r,__unstableIsLastBlockChangeIgnored:l,areInnerBlocksControlled:i}=a.select(Qn);let s=v(t),c=r(),u=!1;_.current=!0;const d=a.subscribe((()=>{if(null!==t&&null===h(t))return;if(t&&!i(t))return;const a=r(),d=v(t),p=d!==s;if(s=d,p&&(k.current.incoming||l()))return k.current.incoming=null,void(c=a);(p||u&&!p&&a&&!c)&&(c=a,k.current.outgoing.push(s),(c?C.current:E.current)(s,{selection:{selectionStart:e(),selectionEnd:n(),initialPosition:o()}})),u=p}));return()=>d()}),[a,t])}var Gc=(0,d.createHigherOrderComponent)((e=>(0,m.withRegistry)((t=>{let{useSubRegistry:n=!0,registry:o,...r}=t;if(!n)return(0,s.createElement)(e,i({registry:o},r));const[l,a]=(0,s.useState)(null);return(0,s.useEffect)((()=>{const e=(0,m.createRegistry)({},o);e.registerStore(qn,Yn),a(e)}),[o]),l?(0,s.createElement)(m.RegistryProvider,{value:l},(0,s.createElement)(e,i({registry:l},r))):null}))),"withRegistryProvider")((function(e){const{children:t,settings:n}=e,{updateSettings:o}=(0,m.useDispatch)(Qn);return(0,s.useEffect)((()=>{o(n)}),[n]),Hc(e),(0,s.createElement)(ho,null,t)}));function Uc(e){let{onClick:t}=e;return(0,s.createElement)("div",{tabIndex:0,role:"button",onClick:t,onKeyPress:t},(0,s.createElement)(p.Disabled,null,(0,s.createElement)(Mf,null)))}function Wc(){const{hasSelectedBlock:e,hasMultiSelection:t}=(0,m.useSelect)(Qn),{clearSelectedBlock:n}=(0,m.useDispatch)(Qn);return(0,d.useRefEffect)((o=>{function r(r){(e()||t())&&r.target===o&&n()}return o.addEventListener("mousedown",r),()=>{o.removeEventListener("mousedown",r)}}),[e,t,n])}function $c(e){return(0,s.createElement)("div",i({ref:Wc()},e))}function jc(e){const{isMultiSelecting:t,getMultiSelectedBlockClientIds:n,hasMultiSelection:o,getSelectedBlockClientId:r,getSelectedBlocksInitialCaretPosition:l,__unstableIsFullySelected:i}=e(Qn);return{isMultiSelecting:t(),multiSelectedBlockClientIds:n(),hasMultiSelection:o(),selectedBlockClientId:r(),initialPosition:l(),isFullSelection:i()}}function Kc(){const{initialPosition:e,isMultiSelecting:t,multiSelectedBlockClientIds:n,hasMultiSelection:o,selectedBlockClientId:r,isFullSelection:l}=(0,m.useSelect)(jc,[]),i=bo(r),s=bo((0,u.first)(n)),a=bo((0,u.last)(n));return(0,d.useRefEffect)((c=>{const{ownerDocument:u}=c,{defaultView:d}=u;if(null==e)return;if(!o||t){if(!r||t)return;const e=d.getSelection();if(e.rangeCount&&!e.isCollapsed){const t=i.current,{startContainer:n,endContainer:o}=e.getRangeAt(0);!t||t.contains(n)&&t.contains(o)||e.removeAllRanges()}return}const{length:p}=n;if(p<2)return;if(!l)return;if(c.contentEditable=!0,c.focus(),!s.current||!a.current)return;const m=d.getSelection(),f=u.createRange();f.setStartBefore(s.current),f.setEndAfter(a.current),m.removeAllRanges(),m.addRange(f)}),[o,t,n,r,e,l])}function qc(e,t,n,o){let r,l=cl.focus.focusable.find(n);return t&&(l=(0,u.reverse)(l)),l=l.slice(l.indexOf(e)+1),o&&(r=e.getBoundingClientRect()),(0,u.find)(l,(function(e){if(!cl.focus.tabbable.isTabbableIndex(e))return!1;if(e.isContentEditable&&"true"!==e.contentEditable)return!1;if(o){const t=e.getBoundingClientRect();if(t.left>=r.right||t.right<=r.left)return!1}return!0}))}function Yc(){const{getSelectedBlockClientId:e,getMultiSelectedBlocksEndClientId:t,getPreviousBlockClientId:n,getNextBlockClientId:o,getSettings:r,hasMultiSelection:l}=(0,m.useSelect)(Qn);return(0,d.useRefEffect)((i=>{let s;function a(){s=null}function c(a){const{keyCode:c,target:u}=a,d=c===Sc.UP,p=c===Sc.DOWN,m=c===Sc.LEFT,f=c===Sc.RIGHT,g=d||m,h=m||f,v=d||p,b=h||v,k=a.shiftKey,_=k||a.ctrlKey||a.altKey||a.metaKey,y=v?cl.isVerticalEdge:cl.isHorizontalEdge,{ownerDocument:E}=i,{defaultView:C}=E;if(l())return;if(v?s||(s=(0,cl.computeCaretRect)(C)):s=null,a.defaultPrevented)return;if(!b)return;if(!function(e,t,n){if((t===Sc.UP||t===Sc.DOWN)&&!n)return!0;const{tagName:o}=e;return"INPUT"!==o&&"TEXTAREA"!==o}(u,c,_))return;const S=(0,cl.isRTL)(u)?!g:g,{keepCaretInsideBlock:w}=r(),B=e();if(k){const e=t(),r=n(e||B),l=o(e||B);(g&&r||!g&&l)&&function(e,t){const n=qc(e,t,i);return!n||!function(e,t){return e.closest(dc)===t.closest(dc)}(e,n)}(u,g)&&y(u,g)&&(i.contentEditable=!0,i.focus())}else if(v&&(0,cl.isVerticalEdge)(u,g)&&!w){const e=qc(u,g,i,!0);e&&((0,cl.placeCaretAtVerticalEdge)(e,g,s),a.preventDefault())}else if(h&&C.getSelection().isCollapsed&&(0,cl.isHorizontalEdge)(u,S)&&!w){const e=qc(u,S,i);(0,cl.placeCaretAtHorizontalEdge)(e,g),a.preventDefault()}}return i.addEventListener("mousedown",a),i.addEventListener("keydown",c),()=>{i.removeEventListener("mousedown",a),i.removeEventListener("keydown",c)}}),[])}var Qc=window.wp.keyboardShortcuts;function Zc(){const{getBlockOrder:e,getSelectedBlockClientIds:t,getBlockRootClientId:n}=(0,m.useSelect)(Qn),{multiSelect:o}=(0,m.useDispatch)(Qn),r=(0,Qc.__unstableUseShortcutEventMatch)();return(0,d.useRefEffect)((l=>{function i(l){if(!r("core/block-editor/select-all",l))return;const i=t();if(i.length<2&&!(0,cl.isEntirelySelected)(l.target))return;const[s]=i,a=n(s);let c=e(a);i.length===c.length&&(c=e(n(a)));const d=(0,u.first)(c),p=(0,u.last)(c);d!==p&&(o(d,p),l.preventDefault())}return l.addEventListener("keydown",i),()=>{l.removeEventListener("keydown",i)}}),[])}function Xc(e,t){e.contentEditable=t,t&&e.focus()}function Jc(){const{startMultiSelect:e,stopMultiSelect:t}=(0,m.useDispatch)(Qn),{isSelectionEnabled:n,hasMultiSelection:o}=(0,m.useSelect)(Qn);return(0,d.useRefEffect)((r=>{const{ownerDocument:l}=r,{defaultView:i}=l;let s,a;function c(){t(),i.removeEventListener("mouseup",c),a=i.requestAnimationFrame((()=>{if(o())return;Xc(r,!1);const e=i.getSelection();if(e.rangeCount){const{commonAncestorContainer:t}=e.getRangeAt(0);s.contains(t)&&s.focus()}}))}function u(t){let{buttons:o,target:a}=t;1===o&&a.getAttribute("contenteditable")&&n()&&(s=l.activeElement,e(),i.addEventListener("mouseup",c),Xc(r,!0))}return r.addEventListener("mouseout",u),()=>{r.removeEventListener("mouseout",u),i.removeEventListener("mouseup",c),i.cancelAnimationFrame(a)}}),[e,t,n,o])}function eu(e,t){e.contentEditable=t,t&&e.focus()}function tu(){const{multiSelect:e,selectBlock:t,selectionChange:n}=(0,m.useDispatch)(Qn),{getBlockParents:o,getBlockSelectionStart:r}=(0,m.useSelect)(Qn);return(0,d.useRefEffect)((n=>{const{ownerDocument:l}=n,{defaultView:i}=l;function s(l){const s=i.getSelection();if(!s.rangeCount)return void eu(n,!1);const a=l.shiftKey&&"mouseup"===l.type;if(s.isCollapsed&&!a)return void eu(n,!1);let c=gc(function(e){const{anchorNode:t,anchorOffset:n}=e;return t.nodeType===t.TEXT_NODE?t:t.childNodes[n]}(s)),u=gc(function(e){const{focusNode:t,focusOffset:n}=e;return t.nodeType===t.TEXT_NODE?t:t.childNodes[n-1]}(s));if(a){const e=r(),t=gc(l.target),n=t!==u;(c===u&&s.isCollapsed||!u||n)&&(u=t),c!==e&&(c=e)}if(void 0!==c||void 0!==u)if(c===u)t(c);else{const t=[...o(c),c],n=[...o(u),u],r=function(e,t){let n=0;for(;e[n]===t[n];)n++;return n}(t,n);e(t[r],n[r])}else eu(n,!1)}function a(){l.addEventListener("selectionchange",s),i.addEventListener("mouseup",s)}function c(){l.removeEventListener("selectionchange",s),i.removeEventListener("mouseup",s)}function u(){c(),a()}return a(),n.addEventListener("focusin",u),()=>{c(),n.removeEventListener("focusin",u)}}),[e,t,n,o])}function nu(){const{selectBlock:e}=(0,m.useDispatch)(Qn),{isSelectionEnabled:t,getBlockSelectionStart:n,hasMultiSelection:o}=(0,m.useSelect)(Qn);return(0,d.useRefEffect)((r=>{function l(l){if(!t()||0!==l.button)return;const i=n(),s=gc(l.target);l.shiftKey?i!==s&&(r.contentEditable=!0,r.focus()):o()&&e(s)}return r.addEventListener("mousedown",l),()=>{r.removeEventListener("mousedown",l)}}),[e,t,n,o])}function ou(){const{__unstableIsFullySelected:e,getSelectedBlockClientIds:t,__unstableIsSelectionMergeable:n,hasMultiSelection:o}=(0,m.useSelect)(Qn),{replaceBlocks:l,__unstableSplitSelection:i,removeBlocks:s,__unstableDeleteSelection:a,__unstableExpandSelection:c}=(0,m.useDispatch)(Qn);return(0,d.useRefEffect)((u=>{function d(d){d.defaultPrevented||o()&&(d.keyCode===Sc.ENTER?(u.contentEditable=!1,d.preventDefault(),e()?l(t(),(0,r.createBlock)((0,r.getDefaultBlockName)())):i()):d.keyCode===Sc.BACKSPACE||d.keyCode===Sc.DELETE?(u.contentEditable=!1,d.preventDefault(),e()?s(t()):n()?a(d.keyCode===Sc.DELETE):c()):1!==d.key.length||d.metaKey||d.ctrlKey||(u.contentEditable=!1,n()?a(d.keyCode===Sc.DELETE):(d.preventDefault(),u.ownerDocument.defaultView.getSelection().removeAllRanges())))}function p(e){o()&&(u.contentEditable=!1,n()?a():(e.preventDefault(),u.ownerDocument.defaultView.getSelection().removeAllRanges()))}return u.addEventListener("keydown",d),u.addEventListener("compositionstart",p),()=>{u.removeEventListener("keydown",d),u.removeEventListener("compositionstart",p)}}),[])}function ru(){const[e,t,n]=function(){const e=(0,s.useRef)(),t=(0,s.useRef)(),n=(0,s.useRef)(),o=(0,s.useRef)(),{hasMultiSelection:r,getSelectedBlockClientId:l,getBlockCount:i}=(0,m.useSelect)(Qn),{setNavigationMode:a}=(0,m.useDispatch)(Qn),c=(0,m.useSelect)((e=>e(Qn).isNavigationMode()),[])?void 0:"0",u=(0,s.useRef)();function p(t){if(u.current)u.current=null;else if(r())e.current.focus();else if(l())o.current.focus();else{a(!0);const n=t.target.compareDocumentPosition(e.current)&t.target.DOCUMENT_POSITION_FOLLOWING?"findNext":"findPrevious";cl.focus.tabbable[n](t.target).focus()}}const f=(0,s.createElement)("div",{ref:t,tabIndex:c,onFocus:p}),g=(0,s.createElement)("div",{ref:n,tabIndex:c,onFocus:p}),h=(0,d.useRefEffect)((s=>{function c(e){if(e.defaultPrevented)return;if(e.keyCode===Sc.ESCAPE&&!r())return e.preventDefault(),void a(!0);if(e.keyCode!==Sc.TAB)return;const o=e.shiftKey,i=o?"findPrevious":"findNext";if(!r()&&!l())return void(e.target===s&&a(!0));if(((0,cl.isFormElement)(e.target)||e.target.getAttribute("data-block")===l())&&(0,cl.isFormElement)(cl.focus.tabbable[i](e.target)))return;const c=o?t:n;u.current=!0,c.current.focus({preventScroll:!0})}function d(e){o.current=e.target;const{ownerDocument:t}=s;e.relatedTarget||t.activeElement!==t.body||0!==i()||s.focus()}function p(o){var r;if(o.keyCode!==Sc.TAB)return;if("region"===(null===(r=o.target)||void 0===r?void 0:r.getAttribute("role")))return;if(e.current===o.target)return;const l=o.shiftKey?"findPrevious":"findNext",i=cl.focus.tabbable[l](o.target);i!==t.current&&i!==n.current||(o.preventDefault(),i.focus({preventScroll:!0}))}const{ownerDocument:m}=s,{defaultView:f}=m;return f.addEventListener("keydown",p),s.addEventListener("keydown",c),s.addEventListener("focusout",d),()=>{f.removeEventListener("keydown",p),s.removeEventListener("keydown",c),s.removeEventListener("focusout",d)}}),[]);return[f,(0,d.useMergeRefs)([e,h]),g]}(),o=(0,m.useSelect)((e=>e(Qn).hasMultiSelection()),[]);return[e,(0,d.useMergeRefs)([t,ou(),Jc(),tu(),nu(),Kc(),Zc(),Yc(),(0,d.useRefEffect)((e=>{if(e.tabIndex=-1,e.contentEditable=o,o)return e.setAttribute("aria-label",(0,g.__)("Multiple selected blocks")),()=>{e.removeAttribute("aria-label")}}),[o])]),n]}var lu=(0,s.forwardRef)((function(e,t){let{children:n,...o}=e;const[r,l,a]=ru();return(0,s.createElement)(s.Fragment,null,r,(0,s.createElement)("div",i({},o,{ref:(0,d.useMergeRefs)([l,t]),className:c()(o.className,"block-editor-writing-flow")}),n),a)}));const iu="editor-styles-wrapper";function su(e){return(0,s.useMemo)((()=>{const t=document.implementation.createHTMLDocument("");return t.body.innerHTML=e,Array.from(t.body.children)}),[e])}var au=(0,s.forwardRef)((function(e,t){let{contentRef:n,children:o,head:r,tabIndex:l=0,assets:a,...u}=e;const[,m]=(0,s.useReducer)((()=>({}))),[f,h]=(0,s.useState)(),[v,b]=(0,s.useState)([]),k=su(null==a?void 0:a.styles),_=su(null==a?void 0:a.scripts),y=Wc(),[E,C,S]=ru(),w=(0,d.useRefEffect)((e=>{function t(){const{contentDocument:t,ownerDocument:n}=e,{readyState:o,documentElement:r}=t;return("interactive"===o||"complete"===o)&&(function(e){const{defaultView:t}=e,{frameElement:n}=t;function o(e){const o=Object.getPrototypeOf(e).constructor.name,r=window[o],l={};for(const t in e)l[t]=e[t];if(e instanceof t.MouseEvent){const e=n.getBoundingClientRect();l.clientX+=e.left,l.clientY+=e.top}const i=new r(e.type,l);!n.dispatchEvent(i)&&e.preventDefault()}const r=["dragover"];for(const t of r)e.addEventListener(t,o)}(t),h(t),y(r),b(Array.from(n.body.classList).filter((e=>e.startsWith("admin-color-")||e.startsWith("post-type-")||"wp-embed-responsive"===e))),t.dir=n.dir,r.removeChild(t.head),r.removeChild(t.body),!0)}return e.addEventListener("load",t),()=>e.removeEventListener("load",t)}),[]),B=(0,d.useRefEffect)((e=>{_.reduce(((t,n)=>t.then((()=>async function(e,t){let{id:n,src:o}=t;return new Promise(((t,r)=>{const l=e.ownerDocument.createElement("script");l.id=n,o?(l.src=o,l.onload=()=>t(),l.onerror=()=>r()):t(),e.appendChild(l)}))}(e,n)))),Promise.resolve()).finally((()=>{m()}))}),[]),I=(0,d.useMergeRefs)([n,y,C]),x=(0,d.useRefEffect)((e=>{Array.from(document.styleSheets).forEach((t=>{try{t.cssRules}catch(e){return}const{ownerNode:n,cssRules:o}=t;if(o&&"LINK"===n.tagName&&"wp-reset-editor-styles-css"!==n.id&&Array.from(o).find((e=>{let{selectorText:t}=e;return t&&(t.includes(`.${iu}`)||t.includes(".wp-block"))}))&&!e.ownerDocument.getElementById(n.id)){e.appendChild(n.cloneNode(!0));const t=n.id.replace("-css","-inline-css"),o=document.getElementById(t);o&&e.appendChild(o.cloneNode(!0))}}))}),[]);return r=(0,s.createElement)(s.Fragment,null,(0,s.createElement)("style",null,"body{margin:0}"),k.map((e=>{let{tagName:t,href:n,id:o,rel:r,media:l,textContent:i}=e;const a=t.toLowerCase();return"style"===a?(0,s.createElement)(a,{id:o,key:o},i):(0,s.createElement)(a,{href:n,id:o,rel:r,media:l,key:o})})),r),(0,s.createElement)(s.Fragment,null,l>=0&&E,(0,s.createElement)("iframe",i({},u,{ref:(0,d.useMergeRefs)([t,w]),tabIndex:l,srcDoc:"<!doctype html>",title:(0,g.__)("Editor canvas")}),f&&(0,s.createPortal)((0,s.createElement)(s.Fragment,null,(0,s.createElement)("head",{ref:B},r),(0,s.createElement)("body",{ref:I,className:c()(iu,...v)},(0,s.createElement)("div",{style:{display:"none"},ref:x}),(0,s.createElement)(p.__experimentalStyleProvider,{document:f},o))),f.documentElement)),l>=0&&S)})),cu={grad:.9,turn:360,rad:360/(2*Math.PI)},uu=function(e){return"string"==typeof e?e.length>0:"number"==typeof e},du=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=Math.pow(10,t)),Math.round(n*e)/n+0},pu=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=1),e>n?n:e>t?e:t},mu=function(e){return(e=isFinite(e)?e%360:0)>0?e:e+360},fu=function(e){return{r:pu(e.r,0,255),g:pu(e.g,0,255),b:pu(e.b,0,255),a:pu(e.a)}},gu=function(e){return{r:du(e.r),g:du(e.g),b:du(e.b),a:du(e.a,3)}},hu=/^#([0-9a-f]{3,8})$/i,vu=function(e){var t=e.toString(16);return t.length<2?"0"+t:t},bu=function(e){var t=e.r,n=e.g,o=e.b,r=e.a,l=Math.max(t,n,o),i=l-Math.min(t,n,o),s=i?l===t?(n-o)/i:l===n?2+(o-t)/i:4+(t-n)/i:0;return{h:60*(s<0?s+6:s),s:l?i/l*100:0,v:l/255*100,a:r}},ku=function(e){var t=e.h,n=e.s,o=e.v,r=e.a;t=t/360*6,n/=100,o/=100;var l=Math.floor(t),i=o*(1-n),s=o*(1-(t-l)*n),a=o*(1-(1-t+l)*n),c=l%6;return{r:255*[o,s,i,i,a,o][c],g:255*[a,o,o,s,i,i][c],b:255*[i,i,a,o,o,s][c],a:r}},_u=function(e){return{h:mu(e.h),s:pu(e.s,0,100),l:pu(e.l,0,100),a:pu(e.a)}},yu=function(e){return{h:du(e.h),s:du(e.s),l:du(e.l),a:du(e.a,3)}},Eu=function(e){return ku((n=(t=e).s,{h:t.h,s:(n*=((o=t.l)<50?o:100-o)/100)>0?2*n/(o+n)*100:0,v:o+n,a:t.a}));var t,n,o},Cu=function(e){return{h:(t=bu(e)).h,s:(r=(200-(n=t.s))*(o=t.v)/100)>0&&r<200?n*o/100/(r<=100?r:200-r)*100:0,l:r/2,a:t.a};var t,n,o,r},Su=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,wu=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Bu=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Iu=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,xu={string:[[function(e){var t=hu.exec(e);return t?(e=t[1]).length<=4?{r:parseInt(e[0]+e[0],16),g:parseInt(e[1]+e[1],16),b:parseInt(e[2]+e[2],16),a:4===e.length?du(parseInt(e[3]+e[3],16)/255,2):1}:6===e.length||8===e.length?{r:parseInt(e.substr(0,2),16),g:parseInt(e.substr(2,2),16),b:parseInt(e.substr(4,2),16),a:8===e.length?du(parseInt(e.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(e){var t=Bu.exec(e)||Iu.exec(e);return t?t[2]!==t[4]||t[4]!==t[6]?null:fu({r:Number(t[1])/(t[2]?100/255:1),g:Number(t[3])/(t[4]?100/255:1),b:Number(t[5])/(t[6]?100/255:1),a:void 0===t[7]?1:Number(t[7])/(t[8]?100:1)}):null},"rgb"],[function(e){var t=Su.exec(e)||wu.exec(e);if(!t)return null;var n,o,r=_u({h:(n=t[1],o=t[2],void 0===o&&(o="deg"),Number(n)*(cu[o]||1)),s:Number(t[3]),l:Number(t[4]),a:void 0===t[5]?1:Number(t[5])/(t[6]?100:1)});return Eu(r)},"hsl"]],object:[[function(e){var t=e.r,n=e.g,o=e.b,r=e.a,l=void 0===r?1:r;return uu(t)&&uu(n)&&uu(o)?fu({r:Number(t),g:Number(n),b:Number(o),a:Number(l)}):null},"rgb"],[function(e){var t=e.h,n=e.s,o=e.l,r=e.a,l=void 0===r?1:r;if(!uu(t)||!uu(n)||!uu(o))return null;var i=_u({h:Number(t),s:Number(n),l:Number(o),a:Number(l)});return Eu(i)},"hsl"],[function(e){var t=e.h,n=e.s,o=e.v,r=e.a,l=void 0===r?1:r;if(!uu(t)||!uu(n)||!uu(o))return null;var i=function(e){return{h:mu(e.h),s:pu(e.s,0,100),v:pu(e.v,0,100),a:pu(e.a)}}({h:Number(t),s:Number(n),v:Number(o),a:Number(l)});return ku(i)},"hsv"]]},Tu=function(e,t){for(var n=0;n<t.length;n++){var o=t[n][0](e);if(o)return[o,t[n][1]]}return[null,void 0]},Nu=function(e,t){var n=Cu(e);return{h:n.h,s:pu(n.s+100*t,0,100),l:n.l,a:n.a}},Pu=function(e){return(299*e.r+587*e.g+114*e.b)/1e3/255},Mu=function(e,t){var n=Cu(e);return{h:n.h,s:n.s,l:pu(n.l+100*t,0,100),a:n.a}},Ru=function(){function e(e){this.parsed=function(e){return"string"==typeof e?Tu(e.trim(),xu.string):"object"==typeof e&&null!==e?Tu(e,xu.object):[null,void 0]}(e)[0],this.rgba=this.parsed||{r:0,g:0,b:0,a:1}}return e.prototype.isValid=function(){return null!==this.parsed},e.prototype.brightness=function(){return du(Pu(this.rgba),2)},e.prototype.isDark=function(){return Pu(this.rgba)<.5},e.prototype.isLight=function(){return Pu(this.rgba)>=.5},e.prototype.toHex=function(){return t=(e=gu(this.rgba)).r,n=e.g,o=e.b,l=(r=e.a)<1?vu(du(255*r)):"","#"+vu(t)+vu(n)+vu(o)+l;var e,t,n,o,r,l},e.prototype.toRgb=function(){return gu(this.rgba)},e.prototype.toRgbString=function(){return t=(e=gu(this.rgba)).r,n=e.g,o=e.b,(r=e.a)<1?"rgba("+t+", "+n+", "+o+", "+r+")":"rgb("+t+", "+n+", "+o+")";var e,t,n,o,r},e.prototype.toHsl=function(){return yu(Cu(this.rgba))},e.prototype.toHslString=function(){return t=(e=yu(Cu(this.rgba))).h,n=e.s,o=e.l,(r=e.a)<1?"hsla("+t+", "+n+"%, "+o+"%, "+r+")":"hsl("+t+", "+n+"%, "+o+"%)";var e,t,n,o,r},e.prototype.toHsv=function(){return e=bu(this.rgba),{h:du(e.h),s:du(e.s),v:du(e.v),a:du(e.a,3)};var e},e.prototype.invert=function(){return Lu({r:255-(e=this.rgba).r,g:255-e.g,b:255-e.b,a:e.a});var e},e.prototype.saturate=function(e){return void 0===e&&(e=.1),Lu(Nu(this.rgba,e))},e.prototype.desaturate=function(e){return void 0===e&&(e=.1),Lu(Nu(this.rgba,-e))},e.prototype.grayscale=function(){return Lu(Nu(this.rgba,-1))},e.prototype.lighten=function(e){return void 0===e&&(e=.1),Lu(Mu(this.rgba,e))},e.prototype.darken=function(e){return void 0===e&&(e=.1),Lu(Mu(this.rgba,-e))},e.prototype.rotate=function(e){return void 0===e&&(e=15),this.hue(this.hue()+e)},e.prototype.alpha=function(e){return"number"==typeof e?Lu({r:(t=this.rgba).r,g:t.g,b:t.b,a:e}):du(this.rgba.a,3);var t},e.prototype.hue=function(e){var t=Cu(this.rgba);return"number"==typeof e?Lu({h:e,s:t.s,l:t.l,a:t.a}):du(t.h)},e.prototype.isEqual=function(e){return this.toHex()===Lu(e).toHex()},e}(),Lu=function(e){return e instanceof Ru?e:new Ru(e)},Au=[],Du=function(e){e.forEach((function(e){Au.indexOf(e)<0&&(e(Ru,xu),Au.push(e))}))};function Ou(e,t){var n={white:"#ffffff",bisque:"#ffe4c4",blue:"#0000ff",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",antiquewhite:"#faebd7",aqua:"#00ffff",azure:"#f0ffff",whitesmoke:"#f5f5f5",papayawhip:"#ffefd5",plum:"#dda0dd",blanchedalmond:"#ffebcd",black:"#000000",gold:"#ffd700",goldenrod:"#daa520",gainsboro:"#dcdcdc",cornsilk:"#fff8dc",cornflowerblue:"#6495ed",burlywood:"#deb887",aquamarine:"#7fffd4",beige:"#f5f5dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkkhaki:"#bdb76b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",peachpuff:"#ffdab9",darkmagenta:"#8b008b",darkred:"#8b0000",darkorchid:"#9932cc",darkorange:"#ff8c00",darkslateblue:"#483d8b",gray:"#808080",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",deeppink:"#ff1493",deepskyblue:"#00bfff",wheat:"#f5deb3",firebrick:"#b22222",floralwhite:"#fffaf0",ghostwhite:"#f8f8ff",darkviolet:"#9400d3",magenta:"#ff00ff",green:"#008000",dodgerblue:"#1e90ff",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",blueviolet:"#8a2be2",forestgreen:"#228b22",lawngreen:"#7cfc00",indianred:"#cd5c5c",indigo:"#4b0082",fuchsia:"#ff00ff",brown:"#a52a2a",maroon:"#800000",mediumblue:"#0000cd",lightcoral:"#f08080",darkturquoise:"#00ced1",lightcyan:"#e0ffff",ivory:"#fffff0",lightyellow:"#ffffe0",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",linen:"#faf0e6",mediumaquamarine:"#66cdaa",lemonchiffon:"#fffacd",lime:"#00ff00",khaki:"#f0e68c",mediumseagreen:"#3cb371",limegreen:"#32cd32",mediumspringgreen:"#00fa9a",lightskyblue:"#87cefa",lightblue:"#add8e6",midnightblue:"#191970",lightpink:"#ffb6c1",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",mintcream:"#f5fffa",lightslategray:"#778899",lightslategrey:"#778899",navajowhite:"#ffdead",navy:"#000080",mediumvioletred:"#c71585",powderblue:"#b0e0e6",palegoldenrod:"#eee8aa",oldlace:"#fdf5e6",paleturquoise:"#afeeee",mediumturquoise:"#48d1cc",mediumorchid:"#ba55d3",rebeccapurple:"#663399",lightsteelblue:"#b0c4de",mediumslateblue:"#7b68ee",thistle:"#d8bfd8",tan:"#d2b48c",orchid:"#da70d6",mediumpurple:"#9370db",purple:"#800080",pink:"#ffc0cb",skyblue:"#87ceeb",springgreen:"#00ff7f",palegreen:"#98fb98",red:"#ff0000",yellow:"#ffff00",slateblue:"#6a5acd",lavenderblush:"#fff0f5",peru:"#cd853f",palevioletred:"#db7093",violet:"#ee82ee",teal:"#008080",slategray:"#708090",slategrey:"#708090",aliceblue:"#f0f8ff",darkseagreen:"#8fbc8f",darkolivegreen:"#556b2f",greenyellow:"#adff2f",seagreen:"#2e8b57",seashell:"#fff5ee",tomato:"#ff6347",silver:"#c0c0c0",sienna:"#a0522d",lavender:"#e6e6fa",lightgreen:"#90ee90",orange:"#ffa500",orangered:"#ff4500",steelblue:"#4682b4",royalblue:"#4169e1",turquoise:"#40e0d0",yellowgreen:"#9acd32",salmon:"#fa8072",saddlebrown:"#8b4513",sandybrown:"#f4a460",rosybrown:"#bc8f8f",darksalmon:"#e9967a",lightgoldenrodyellow:"#fafad2",snow:"#fffafa",lightgrey:"#d3d3d3",lightgray:"#d3d3d3",dimgray:"#696969",dimgrey:"#696969",olivedrab:"#6b8e23",olive:"#808000"},o={};for(var r in n)o[n[r]]=r;var l={};e.prototype.toName=function(t){if(!(this.rgba.a||this.rgba.r||this.rgba.g||this.rgba.b))return"transparent";var r,i,s=o[this.toHex()];if(s)return s;if(null==t?void 0:t.closest){var a=this.toRgb(),c=1/0,u="black";if(!l.length)for(var d in n)l[d]=new e(n[d]).toRgb();for(var p in n){var m=(r=a,i=l[p],Math.pow(r.r-i.r,2)+Math.pow(r.g-i.g,2)+Math.pow(r.b-i.b,2));m<c&&(c=m,u=p)}return u}},t.string.push([function(t){var o=t.toLowerCase(),r="transparent"===o?"#0000":n[o];return r?new e(r).toRgb():null},"name"])}var Fu=function(e){var t=e/255;return t<.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)},zu=function(e){return.2126*Fu(e.r)+.7152*Fu(e.g)+.0722*Fu(e.b)};function Vu(e){e.prototype.luminance=function(){return e=zu(this.rgba),void 0===(t=2)&&(t=0),void 0===n&&(n=Math.pow(10,t)),Math.round(n*e)/n+0;var e,t,n},e.prototype.contrast=function(t){void 0===t&&(t="#FFF");var n,o,r,l,i,s,a,c=t instanceof e?t:new e(t);return l=this.rgba,i=c.toRgb(),n=(s=zu(l))>(a=zu(i))?(s+.05)/(a+.05):(a+.05)/(s+.05),void 0===(o=2)&&(o=0),void 0===r&&(r=Math.pow(10,o)),Math.floor(r*n)/r+0},e.prototype.isReadable=function(e,t){return void 0===e&&(e="#FFF"),void 0===t&&(t={}),this.contrast(e)>=(i=void 0===(l=(n=t).size)?"normal":l,"AAA"===(r=void 0===(o=n.level)?"AA":o)&&"normal"===i?7:"AA"===r&&"large"===i?3:4.5);var n,o,r,l,i}}var Hu=n(3124),Gu=n.n(Hu);const Uu=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;function Wu(e,t){t=t||{};let n=1,o=1;function r(e){const t=e.match(/\n/g);t&&(n+=t.length);const r=e.lastIndexOf("\n");o=~r?e.length-r:o+e.length}function l(){const e={line:n,column:o};return function(t){return t.position=new i(e),m(),t}}function i(e){this.start=e,this.end={line:n,column:o},this.source=t.source}i.prototype.content=e;const s=[];function a(r){const l=new Error(t.source+":"+n+":"+o+": "+r);if(l.reason=r,l.filename=t.source,l.line=n,l.column=o,l.source=e,!t.silent)throw l;s.push(l)}function c(){return p(/^{\s*/)}function u(){return p(/^}/)}function d(){let t;const n=[];for(m(),f(n);e.length&&"}"!==e.charAt(0)&&(t=S()||w());)!1!==t&&(n.push(t),f(n));return n}function p(t){const n=t.exec(e);if(!n)return;const o=n[0];return r(o),e=e.slice(o.length),n}function m(){p(/^\s*/)}function f(e){let t;for(e=e||[];t=g();)!1!==t&&e.push(t);return e}function g(){const t=l();if("/"!==e.charAt(0)||"*"!==e.charAt(1))return;let n=2;for(;""!==e.charAt(n)&&("*"!==e.charAt(n)||"/"!==e.charAt(n+1));)++n;if(n+=2,""===e.charAt(n-1))return a("End of comment missing");const i=e.slice(2,n-2);return o+=2,r(i),e=e.slice(n),o+=2,t({type:"comment",comment:i})}function h(){const e=p(/^([^{]+)/);if(e)return $u(e[0]).replace(/\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*\/+/g,"").replace(/"(?:\\"|[^"])*"|'(?:\\'|[^'])*'/g,(function(e){return e.replace(/,/g,"")})).split(/\s*(?![^(]*\)),\s*/).map((function(e){return e.replace(/\u200C/g,",")}))}function v(){const e=l();let t=p(/^(\*?[-#\/\*\\\w]+(\[[0-9a-z_-]+\])?)\s*/);if(!t)return;if(t=$u(t[0]),!p(/^:\s*/))return a("property missing ':'");const n=p(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^\)]*?\)|[^};])+)/),o=e({type:"declaration",property:t.replace(Uu,""),value:n?$u(n[0]).replace(Uu,""):""});return p(/^[;\s]*/),o}function b(){const e=[];if(!c())return a("missing '{'");let t;for(f(e);t=v();)!1!==t&&(e.push(t),f(e));return u()?e:a("missing '}'")}function k(){let e;const t=[],n=l();for(;e=p(/^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/);)t.push(e[1]),p(/^,\s*/);if(t.length)return n({type:"keyframe",values:t,declarations:b()})}const _=C("import"),y=C("charset"),E=C("namespace");function C(e){const t=new RegExp("^@"+e+"\\s*([^;]+);");return function(){const n=l(),o=p(t);if(!o)return;const r={type:e};return r[e]=o[1].trim(),n(r)}}function S(){if("@"===e[0])return function(){const e=l();let t=p(/^@([-\w]+)?keyframes\s*/);if(!t)return;const n=t[1];if(t=p(/^([-\w]+)\s*/),!t)return a("@keyframes missing name");const o=t[1];if(!c())return a("@keyframes missing '{'");let r,i=f();for(;r=k();)i.push(r),i=i.concat(f());return u()?e({type:"keyframes",name:o,vendor:n,keyframes:i}):a("@keyframes missing '}'")}()||function(){const e=l(),t=p(/^@media *([^{]+)/);if(!t)return;const n=$u(t[1]);if(!c())return a("@media missing '{'");const o=f().concat(d());return u()?e({type:"media",media:n,rules:o}):a("@media missing '}'")}()||function(){const e=l(),t=p(/^@custom-media\s+(--[^\s]+)\s*([^{;]+);/);if(t)return e({type:"custom-media",name:$u(t[1]),media:$u(t[2])})}()||function(){const e=l(),t=p(/^@supports *([^{]+)/);if(!t)return;const n=$u(t[1]);if(!c())return a("@supports missing '{'");const o=f().concat(d());return u()?e({type:"supports",supports:n,rules:o}):a("@supports missing '}'")}()||_()||y()||E()||function(){const e=l(),t=p(/^@([-\w]+)?document *([^{]+)/);if(!t)return;const n=$u(t[1]),o=$u(t[2]);if(!c())return a("@document missing '{'");const r=f().concat(d());return u()?e({type:"document",document:o,vendor:n,rules:r}):a("@document missing '}'")}()||function(){const e=l();if(!p(/^@page */))return;const t=h()||[];if(!c())return a("@page missing '{'");let n,o=f();for(;n=v();)o.push(n),o=o.concat(f());return u()?e({type:"page",selectors:t,declarations:o}):a("@page missing '}'")}()||function(){const e=l();if(!p(/^@host\s*/))return;if(!c())return a("@host missing '{'");const t=f().concat(d());return u()?e({type:"host",rules:t}):a("@host missing '}'")}()||function(){const e=l();if(!p(/^@font-face\s*/))return;if(!c())return a("@font-face missing '{'");let t,n=f();for(;t=v();)n.push(t),n=n.concat(f());return u()?e({type:"font-face",declarations:n}):a("@font-face missing '}'")}()}function w(){const e=l(),t=h();return t?(f(),e({type:"rule",selectors:t,declarations:b()})):a("selector missing")}return ju(function(){const e=d();return{type:"stylesheet",stylesheet:{source:t.source,rules:e,parsingErrors:s}}}())}function $u(e){return e?e.replace(/^\s+|\s+$/g,""):""}function ju(e,t){const n=e&&"string"==typeof e.type,o=n?e:t;for(const t in e){const n=e[t];Array.isArray(n)?n.forEach((function(e){ju(e,o)})):n&&"object"==typeof n&&ju(n,o)}return n&&Object.defineProperty(e,"parent",{configurable:!0,writable:!0,enumerable:!1,value:t||null}),e}var Ku=n(8575),qu=n.n(Ku),Yu=Qu;function Qu(e){this.options=e||{}}Qu.prototype.emit=function(e){return e},Qu.prototype.visit=function(e){return this[e.type](e)},Qu.prototype.mapVisit=function(e,t){let n="";t=t||"";for(let o=0,r=e.length;o<r;o++)n+=this.visit(e[o]),t&&o<r-1&&(n+=this.emit(t));return n};var Zu=Xu;function Xu(e){Yu.call(this,e)}qu()(Xu,Yu),Xu.prototype.compile=function(e){return e.stylesheet.rules.map(this.visit,this).join("")},Xu.prototype.comment=function(e){return this.emit("",e.position)},Xu.prototype.import=function(e){return this.emit("@import "+e.import+";",e.position)},Xu.prototype.media=function(e){return this.emit("@media "+e.media,e.position)+this.emit("{")+this.mapVisit(e.rules)+this.emit("}")},Xu.prototype.document=function(e){const t="@"+(e.vendor||"")+"document "+e.document;return this.emit(t,e.position)+this.emit("{")+this.mapVisit(e.rules)+this.emit("}")},Xu.prototype.charset=function(e){return this.emit("@charset "+e.charset+";",e.position)},Xu.prototype.namespace=function(e){return this.emit("@namespace "+e.namespace+";",e.position)},Xu.prototype.supports=function(e){return this.emit("@supports "+e.supports,e.position)+this.emit("{")+this.mapVisit(e.rules)+this.emit("}")},Xu.prototype.keyframes=function(e){return this.emit("@"+(e.vendor||"")+"keyframes "+e.name,e.position)+this.emit("{")+this.mapVisit(e.keyframes)+this.emit("}")},Xu.prototype.keyframe=function(e){const t=e.declarations;return this.emit(e.values.join(","),e.position)+this.emit("{")+this.mapVisit(t)+this.emit("}")},Xu.prototype.page=function(e){const t=e.selectors.length?e.selectors.join(", "):"";return this.emit("@page "+t,e.position)+this.emit("{")+this.mapVisit(e.declarations)+this.emit("}")},Xu.prototype["font-face"]=function(e){return this.emit("@font-face",e.position)+this.emit("{")+this.mapVisit(e.declarations)+this.emit("}")},Xu.prototype.host=function(e){return this.emit("@host",e.position)+this.emit("{")+this.mapVisit(e.rules)+this.emit("}")},Xu.prototype["custom-media"]=function(e){return this.emit("@custom-media "+e.name+" "+e.media+";",e.position)},Xu.prototype.rule=function(e){const t=e.declarations;return t.length?this.emit(e.selectors.join(","),e.position)+this.emit("{")+this.mapVisit(t)+this.emit("}"):""},Xu.prototype.declaration=function(e){return this.emit(e.property+":"+e.value,e.position)+this.emit(";")};var Ju=ed;function ed(e){e=e||{},Yu.call(this,e),this.indentation=e.indent}qu()(ed,Yu),ed.prototype.compile=function(e){return this.stylesheet(e)},ed.prototype.stylesheet=function(e){return this.mapVisit(e.stylesheet.rules,"\n\n")},ed.prototype.comment=function(e){return this.emit(this.indent()+"/*"+e.comment+"*/",e.position)},ed.prototype.import=function(e){return this.emit("@import "+e.import+";",e.position)},ed.prototype.media=function(e){return this.emit("@media "+e.media,e.position)+this.emit(" {\n"+this.indent(1))+this.mapVisit(e.rules,"\n\n")+this.emit(this.indent(-1)+"\n}")},ed.prototype.document=function(e){const t="@"+(e.vendor||"")+"document "+e.document;return this.emit(t,e.position)+this.emit(" {\n"+this.indent(1))+this.mapVisit(e.rules,"\n\n")+this.emit(this.indent(-1)+"\n}")},ed.prototype.charset=function(e){return this.emit("@charset "+e.charset+";",e.position)},ed.prototype.namespace=function(e){return this.emit("@namespace "+e.namespace+";",e.position)},ed.prototype.supports=function(e){return this.emit("@supports "+e.supports,e.position)+this.emit(" {\n"+this.indent(1))+this.mapVisit(e.rules,"\n\n")+this.emit(this.indent(-1)+"\n}")},ed.prototype.keyframes=function(e){return this.emit("@"+(e.vendor||"")+"keyframes "+e.name,e.position)+this.emit(" {\n"+this.indent(1))+this.mapVisit(e.keyframes,"\n")+this.emit(this.indent(-1)+"}")},ed.prototype.keyframe=function(e){const t=e.declarations;return this.emit(this.indent())+this.emit(e.values.join(", "),e.position)+this.emit(" {\n"+this.indent(1))+this.mapVisit(t,"\n")+this.emit(this.indent(-1)+"\n"+this.indent()+"}\n")},ed.prototype.page=function(e){const t=e.selectors.length?e.selectors.join(", ")+" ":"";return this.emit("@page "+t,e.position)+this.emit("{\n")+this.emit(this.indent(1))+this.mapVisit(e.declarations,"\n")+this.emit(this.indent(-1))+this.emit("\n}")},ed.prototype["font-face"]=function(e){return this.emit("@font-face ",e.position)+this.emit("{\n")+this.emit(this.indent(1))+this.mapVisit(e.declarations,"\n")+this.emit(this.indent(-1))+this.emit("\n}")},ed.prototype.host=function(e){return this.emit("@host",e.position)+this.emit(" {\n"+this.indent(1))+this.mapVisit(e.rules,"\n\n")+this.emit(this.indent(-1)+"\n}")},ed.prototype["custom-media"]=function(e){return this.emit("@custom-media "+e.name+" "+e.media+";",e.position)},ed.prototype.rule=function(e){const t=this.indent(),n=e.declarations;return n.length?this.emit(e.selectors.map((function(e){return t+e})).join(",\n"),e.position)+this.emit(" {\n")+this.emit(this.indent(1))+this.mapVisit(n,"\n")+this.emit(this.indent(-1))+this.emit("\n"+this.indent()+"}"):""},ed.prototype.declaration=function(e){return this.emit(this.indent())+this.emit(e.property+": "+e.value,e.position)+this.emit(";")},ed.prototype.indent=function(e){return this.level=this.level||1,null!==e?(this.level+=e,""):Array(this.level).join(this.indentation||" ")};var td=function(e,t){try{const r=Wu(e);return n=Gu().map(r,(function(e){if(!e)return e;const n=t(e);return this.update(n)})),((o=o||{}).compress?new Zu(o):new Ju(o)).compile(n)}catch(e){return console.warn("Error while traversing the CSS: "+e),null}var n,o};function nd(e){return 0!==e.value.indexOf("data:")&&0!==e.value.indexOf("#")&&(t=e.value,!/^\/(?!\/)/.test(t)&&!function(e){return/^(?:https?:)?\/\//.test(e)}(e.value));var t}function od(e,t){return new URL(e,t).toString()}var rd=e=>t=>{if("declaration"===t.type){const l=function(e){const t=/url\((\s*)(['"]?)(.+?)\2(\s*)\)/g;let n;const o=[];for(;null!==(n=t.exec(e));){const e={source:n[0],before:n[1],quote:n[2],value:n[3],after:n[4]};nd(e)&&o.push(e)}return o}(t.value).map((r=e,e=>({...e,newUrl:"url("+e.before+e.quote+od(e.value,r)+e.quote+e.after+")"})));return{...t,value:(n=t.value,o=l,o.forEach((e=>{n=n.replace(e.source,e.newUrl)})),n)}}var n,o,r;return t};const ld=/^(body|html|:root).*$/;var id=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return n=>"rule"===n.type?{...n,selectors:n.selectors.map((n=>t.includes(n.trim())?n:n.match(ld)?n.replace(/^(body|html|:root)/,e):e+" "+n))}:n},sd=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return(0,u.map)(e,(e=>{let{css:n,baseURL:o}=e;const r=[];return t&&r.push(id(t)),o&&r.push(rd(o)),r.length?td(n,(0,d.compose)(r)):n}))};const ad=".editor-styles-wrapper";function cd(e){return(0,s.useCallback)((e=>{if(!e)return;const{ownerDocument:t}=e,{defaultView:n,body:o}=t,r=t.querySelector(ad);let l;if(r)l=n.getComputedStyle(r,null).getPropertyValue("background-color");else{const e=t.createElement("div");e.classList.add("editor-styles-wrapper"),o.appendChild(e),l=n.getComputedStyle(e,null).getPropertyValue("background-color"),o.removeChild(e)}const i=Lu(l);i.luminance()>.5||0===i.alpha()?o.classList.remove("is-dark-theme"):o.classList.add("is-dark-theme")}),[e])}function ud(e){let{styles:t}=e;const n=(0,s.useMemo)((()=>sd(t,ad)),[t]);return(0,s.createElement)(s.Fragment,null,(0,s.createElement)("style",{ref:cd(t)}),n.map(((e,t)=>(0,s.createElement)("style",{key:t},e))))}let dd;Du([Ou,Vu]);const pd=2e3;var md=function(e){let{viewportWidth:t,__experimentalPadding:n,__experimentalMinHeight:o}=e;const[r,{width:l}]=(0,d.useResizeObserver)(),[i,{height:a}]=(0,d.useResizeObserver)(),{styles:c,assets:u}=(0,m.useSelect)((e=>{const t=e(Qn).getSettings();return{styles:t.styles,assets:t.__unstableResolvedAssets}}),[]),f=(0,s.useMemo)((()=>c?[...c,{css:"body{height:auto;overflow:hidden;}",__unstableType:"presets"}]:c),[c]);dd=dd||(0,d.pure)(Mf);const g=l/t;return(0,s.createElement)("div",{className:"block-editor-block-preview__container"},r,(0,s.createElement)(p.Disabled,{className:"block-editor-block-preview__content",style:{transform:`scale(${g})`,height:a*g,maxHeight:a>pd?pd*g:void 0,minHeight:o}},(0,s.createElement)(au,{head:(0,s.createElement)(ud,{styles:f}),assets:u,contentRef:(0,d.useRefEffect)((e=>{const{ownerDocument:{documentElement:t}}=e;t.classList.add("block-editor-block-preview__content-iframe"),t.style.position="absolute",t.style.width="100%",e.style.padding=n+"px",e.style.position="relative"}),[]),"aria-hidden":!0,tabIndex:-1,style:{position:"absolute",width:t,height:a,pointerEvents:"none",maxHeight:pd,minHeight:g<1&&o?o/g:o}},i,(0,s.createElement)(dd,{renderAppender:!1}))))},fd=(0,s.memo)((function(e){let{blocks:t,__experimentalPadding:n=0,viewportWidth:o=1200,__experimentalLive:r=!1,__experimentalOnClick:l,__experimentalMinHeight:i}=e;const a=(0,m.useSelect)((e=>e(Qn).getSettings()),[]),c=(0,s.useMemo)((()=>{const e={...a};return e.__experimentalBlockPatterns=[],e}),[a]),d=(0,s.useMemo)((()=>(0,u.castArray)(t)),[t]);return t&&0!==t.length?(0,s.createElement)(Gc,{value:d,settings:c},r?(0,s.createElement)(Uc,{onClick:l}):(0,s.createElement)(md,{viewportWidth:o,__experimentalPadding:n,__experimentalMinHeight:i})):null}));function gd(e){let{blocks:t,props:n={},__experimentalLayout:o}=e;const r=(0,m.useSelect)((e=>e(Qn).getSettings()),[]),l=(0,d.useDisabled)(),i=(0,d.useMergeRefs)([n.ref,l]),a=(0,s.useMemo)((()=>({...r,__experimentalBlockPatterns:[]})),[r]),p=(0,s.useMemo)((()=>(0,u.castArray)(t)),[t]),f=(0,s.createElement)(Gc,{value:p,settings:a},(0,s.createElement)(Lf,{renderAppender:!1,__experimentalLayout:o}));return{...n,ref:i,className:c()(n.className,"block-editor-block-preview__live-content","components-disabled"),children:null!=t&&t.length?f:null}}var hd=function(e){var t,n;let{item:o}=e;const{name:l,title:i,icon:a,description:c,initialAttributes:u}=o,d=(0,r.getBlockType)(l),p=(0,r.isReusableBlock)(o);return(0,s.createElement)("div",{className:"block-editor-inserter__preview-container"},(0,s.createElement)("div",{className:"block-editor-inserter__preview"},p||null!=d&&d.example?(0,s.createElement)("div",{className:"block-editor-inserter__preview-content"},(0,s.createElement)(fd,{__experimentalPadding:16,viewportWidth:null!==(t=null===(n=d.example)||void 0===n?void 0:n.viewportWidth)&&void 0!==t?t:500,blocks:d.example?(0,r.getBlockFromExample)(o.name,{attributes:{...d.example.attributes,...u},innerBlocks:d.example.innerBlocks}):(0,r.createBlock)(l,u)})):(0,s.createElement)("div",{className:"block-editor-inserter__preview-content-missing"},(0,g.__)("No Preview Available."))),!p&&(0,s.createElement)(Vc,{title:i,icon:a,description:c}))},vd=(0,s.createContext)(),bd=(0,s.forwardRef)((function(e,t){let{isFirst:n,as:o,children:r,...l}=e;const a=(0,s.useContext)(vd);return(0,s.createElement)(p.__unstableCompositeItem,i({ref:t,state:a,role:"option",focusable:!0},l),(e=>{const t={...e,tabIndex:n?0:e.tabIndex};return o?(0,s.createElement)(o,t,r):"function"==typeof r?r(t):(0,s.createElement)(p.Button,t,r)}))})),kd=(0,s.createElement)(O.SVG,{width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M8 7h2V5H8v2zm0 6h2v-2H8v2zm0 6h2v-2H8v2zm6-14v2h2V5h-2zm0 8h2v-2h-2v2zm0 6h2v-2h-2v2z"}));function _d(e){let{count:t,icon:n}=e;return(0,s.createElement)("div",{className:"block-editor-block-draggable-chip-wrapper"},(0,s.createElement)("div",{className:"block-editor-block-draggable-chip"},(0,s.createElement)(p.Flex,{justify:"center",className:"block-editor-block-draggable-chip__content"},(0,s.createElement)(p.FlexItem,null,n?(0,s.createElement)(zc,{icon:n}):(0,g.sprintf)(
|
11 |
/* translators: %d: Number of blocks. */
|
12 |
-
(0,g._n)("%d block","%d blocks",t),t)),(0,s.createElement)(p.FlexItem,null,(0,s.createElement)(
|
13 |
/* translators: %s: block pattern title. */
|
14 |
-
(0,g.__)('Block pattern "%s" inserted.'),t.title),{type:"snackbar"})}),[])]};function
|
15 |
-
(0,g._n)("%d block added.","%d blocks added.",(0,u.castArray)(e).length),(0,u.castArray)(e).length);(0,Ht.speak)(s),i&&i()}),[l,c,f,h,d,p,i,a]),_=(0,s.useCallback)((e=>{e?v(d,p):b()}),[v,b,d,p]);return[d,k,_]};const
|
16 |
/* translators: %d: number of patterns. %s: block pattern search query */
|
17 |
-
(0,g._n)('%1$d pattern found for "%2$s"','%1$d patterns found for "%2$s"',n),n,t)):null}var
|
18 |
/* translators: %d: number of results. */
|
19 |
-
(0,g._n)("%d result found.","%d results found.",e),e);r(n)}),[t,r]);const m=(0,d.useAsyncList)(p,{step:2}),f=!(null==p||!p.length);return(0,s.createElement)("div",{className:"block-editor-block-patterns-explorer__list"},f&&(0,s.createElement)(
|
20 |
/* translators: %d: number of results. */
|
21 |
-
(0,g._n)("%d result found.","%d results found.",e),e);k(n)}),[t,k]);const P=(0,d.useAsyncList)(N,{step:9}),
|
22 |
/* translators: Blocks tab title in the block inserter. */
|
23 |
-
title:(0,g.__)("Blocks")},
|
24 |
/* translators: Patterns tab title in the block inserter. */
|
25 |
-
title:(0,g.__)("Patterns")},
|
26 |
/* translators: Reusable blocks tab title in the block inserter. */
|
27 |
-
title:(0,g.__)("Reusable")};var
|
28 |
-
(0,g._x)("Add %s","directly add the only allowed block"),l):u?(0,g.__)("Add pattern"):(0,g._x)("Add block","Generic label for block inserter button");const{onClick:d,...m}=c;return(0,s.createElement)(p.Button,i({icon:
|
29 |
-
(0,g.__)("%s block added"),a.title);(0,Ht.speak)(m)}}})),(0,d.ifCondition)((e=>{let{hasItems:t,isAppender:n,rootClientId:o,clientId:r}=e;return t||!n&&!o&&!r}))])(
|
30 |
-
(0,g._x)("Add %s","directly add the only allowed block"),d):(0,g._x)("Add block","Generic label for block inserter button");const f=!m;let h=(0,s.createElement)(p.Button,{ref:t,onFocus:r,tabIndex:l,className:c()(o,"block-editor-button-block-appender"),onClick:i,"aria-haspopup":f?"true":void 0,"aria-expanded":f?u:void 0,disabled:a,label:n},!m&&(0,s.createElement)(p.VisuallyHidden,{as:"span"},n),(0,s.createElement)(Br,{icon:Ac}));return(f||m)&&(h=(0,s.createElement)(p.Tooltip,{text:n},h)),h},isAppender:!0})}const Bp=(0,s.forwardRef)(((e,t)=>(H()("wp.blockEditor.ButtonBlockerAppender",{alternative:"wp.blockEditor.ButtonBlockAppender",since:"5.9"}),wp(e,t))));var Ip=(0,s.forwardRef)(wp),xp=(0,m.withSelect)(((e,t)=>{let{rootClientId:n}=t;const{canInsertBlockType:o,getTemplateLock:l,getSelectedBlockClientId:i}=e(Qn);return{isLocked:!!l(n),canInsertDefaultBlock:o((0,r.getDefaultBlockName)(),n),selectedBlockClientId:i()}}))((function(e){let t,{rootClientId:n,canInsertDefaultBlock:o,isLocked:r,renderAppender:l,className:i,selectedBlockClientId:a,tagName:u="div"}=e;if(r||!1===l)return null;if(l)t=(0,s.createElement)(l,null);else{if(a!==n&&(n||a))return null;t=o?(0,s.createElement)(Sp,{rootClientId:n}):(0,s.createElement)(Ip,{rootClientId:n,className:"block-list-appender__toggle"})}return(0,s.createElement)(u,{tabIndex:-1,className:c()("block-list-appender wp-block",i),contentEditable:!1,"data-block":!0},t)}));(0,s.createContext)();var Tp=function(e){let{previousClientId:t,nextClientId:n,children:o,__unstablePopoverSlot:r,__unstableContentRef:l,...a}=e;const{orientation:u,rootClientId:d}=(0,m.useSelect)((e=>{var n;const{getBlockListSettings:o,getBlockRootClientId:r}=e(Qn),l=r(t);return{orientation:(null===(n=o(l))||void 0===n?void 0:n.orientation)||"vertical",rootClientId:l}}),[t]),f=ko(t),h=ko(n),v="vertical"===u,b=(0,s.useMemo)((()=>{if(!f&&!h)return{};const e=f?f.getBoundingClientRect():null,t=h?h.getBoundingClientRect():null;if(v)return{width:f?f.offsetWidth:h.offsetWidth,height:t&&e?t.top-e.bottom:0};let n=0;return e&&t&&(n=(0,g.isRTL)()?e.left-t.right:t.left-e.right),{width:n,height:f?f.offsetHeight:h.offsetHeight}}),[f,h,v]),k=(0,s.useCallback)((()=>{if(!f&&!h)return{};const{ownerDocument:e}=f||h,t=f?f.getBoundingClientRect():null,n=h?h.getBoundingClientRect():null;return v?(0,g.isRTL)()?{top:t?t.bottom:n.top,left:t?t.right:n.right,right:t?t.left:n.left,bottom:n?n.top:t.bottom,height:0,width:0,ownerDocument:e}:{top:t?t.bottom:n.top,left:t?t.left:n.left,right:t?t.right:n.right,bottom:n?n.top:t.bottom,height:0,width:0,ownerDocument:e}:(0,g.isRTL)()?{top:t?t.top:n.top,left:t?t.left:n.right,right:n?n.right:t.left,bottom:t?t.bottom:n.bottom,height:0,width:0,ownerDocument:e}:{top:t?t.top:n.top,left:t?t.right:n.left,right:n?n.left:t.right,bottom:t?t.bottom:n.bottom,height:0,width:0,ownerDocument:e}}),[f,h]),_=Fo(l);return f&&h?(0,s.createElement)(p.Popover,i({ref:_,animate:!1,getAnchorRect:k,focusOnMount:!1,__unstableSlotName:r||null,key:n+"--"+d},a,{className:c()("block-editor-block-popover",a.className),__unstableForcePosition:!0}),(0,s.createElement)("div",{style:b},o)):null};const Np=(0,s.createContext)();function Pp(e){let{__unstablePopoverSlot:t,__unstableContentRef:n}=e;const{selectBlock:o,hideInsertionPoint:r}=(0,m.useDispatch)(Qn),l=(0,s.useContext)(Np),i=(0,s.useRef)(),{orientation:a,previousClientId:u,nextClientId:f,rootClientId:g,isInserterShown:h}=(0,m.useSelect)((e=>{var t;const{getBlockOrder:n,getBlockListSettings:o,getBlockInsertionPoint:r,isBlockBeingDragged:l,getPreviousBlockClientId:i,getNextBlockClientId:s}=e(Qn),a=r(),c=n(a.rootClientId);if(!c.length)return{};let u=c[a.index-1],d=c[a.index];for(;l(u);)u=i(u);for(;l(d);)d=s(d);return{previousClientId:u,nextClientId:d,orientation:(null===(t=o(a.rootClientId))||void 0===t?void 0:t.orientation)||"vertical",rootClientId:a.rootClientId,isInserterShown:null==a?void 0:a.__unstableWithInserter}}),[]),v="vertical"===a,b=(0,d.useReducedMotion)(),k={start:{...v?{height:0,left:"50%",right:"50%",y:0}:{width:0,top:"50%",bottom:"50%",x:0},opacity:0},rest:{...v?{height:4,left:0,right:0,y:-2}:{width:4,top:0,bottom:0,x:-2},opacity:1,borderRadius:"2px",transition:{delay:h?.4:0}},hover:{...v?{height:4,left:0,right:0,y:-2}:{width:4,top:0,bottom:0,x:-2},opacity:1,borderRadius:"2px",transition:{delay:.4}}},_={start:{scale:b?1:0},rest:{scale:1,transition:{delay:.2}}},y=c()("block-editor-block-list__insertion-point","is-"+a);return(0,s.createElement)(Tp,{previousClientId:u,nextClientId:f,__unstablePopoverSlot:t,__unstableContentRef:n},(0,s.createElement)(p.__unstableMotion.div,{layout:!b,initial:b?"rest":"start",animate:"rest",whileHover:"hover",whileTap:"pressed",exit:"start",ref:i,tabIndex:-1,onClick:function(e){e.target===i.current&&f&&o(f,-1)},onFocus:function(e){e.target!==i.current&&(l.current=!0)},className:c()(y,{"is-with-inserter":h}),onHoverEnd:function(e){e.target!==i.current||l.current||r()}},(0,s.createElement)(p.__unstableMotion.div,{variants:k,className:"block-editor-block-list__insertion-point-indicator"}),h&&(0,s.createElement)(p.__unstableMotion.div,{variants:_,className:c()("block-editor-block-list__insertion-point-inserter")},(0,s.createElement)(Cp,{position:"bottom center",clientId:f,rootClientId:g,__experimentalIsQuick:!0,onToggle:e=>{l.current=e},onSelectOrClose:()=>{l.current=!1}}))))}function Mp(e){let{children:t,...n}=e;const o=(0,m.useSelect)((e=>e(Qn).isBlockInsertionPointVisible()),[]);return(0,s.createElement)(Np.Provider,{value:(0,s.useRef)(!1)},o&&(0,s.createElement)(Pp,n),t)}function Rp(){const e=(0,s.useContext)(Np),t=(0,m.useSelect)((e=>e(Qn).getSettings().hasReducedUI),[]),{getBlockListSettings:n,getBlockRootClientId:o,getBlockIndex:r,isBlockInsertionPointVisible:l,isMultiSelecting:i,getSelectedBlockClientIds:a,getTemplateLock:c}=(0,m.useSelect)(Qn),{showInsertionPoint:u,hideInsertionPoint:p}=(0,m.useDispatch)(Qn);return(0,d.useRefEffect)((o=>{if(!t)return o.addEventListener("mousemove",s),()=>{o.removeEventListener("mousemove",s)};function s(t){var o,s;if(e.current)return;if(i())return;if(!t.target.classList.contains("block-editor-block-list__layout"))return void(l()&&p());let d;if(t.target.classList.contains("is-root-container")||(d=(t.target.getAttribute("data-block")?t.target:t.target.closest("[data-block]")).getAttribute("data-block")),c(d))return;const m=(null===(o=n(d))||void 0===o?void 0:o.orientation)||"vertical",f=t.target.getBoundingClientRect(),g=t.clientY-f.top,h=t.clientX-f.left;let v=Array.from(t.target.children).find((e=>e.classList.contains("wp-block")&&"vertical"===m&&e.offsetTop>g||e.classList.contains("wp-block")&&"horizontal"===m&&e.offsetLeft>h));if(!v)return;if(!v.id&&(v=v.firstElementChild,!v))return;if(null===(s=v.parentElement)||void 0===s?void 0:s.closest(".block-editor-block-content-overlay"))return;const b=v.id.slice("block-".length);if(!b)return;if(a().includes(b))return;const k=v.getBoundingClientRect();if("horizontal"===m&&(t.clientY>k.bottom||t.clientY<k.top)||"vertical"===m&&(t.clientX>k.right||t.clientX<k.left))return void(l()&&p());const _=r(b);0!==_?u(d,_,{__unstableWithInserter:!0}):l()&&p()}}),[e,n,o,r,l,i,u,p,a])}const Lp="undefined"==typeof window?e=>{setTimeout((()=>e(Date.now())),0)}:window.requestIdleCallback||window.requestAnimationFrame,Ap="undefined"==typeof window?clearTimeout:window.cancelIdleCallback||window.cancelAnimationFrame;function Dp(e){return(0,m.useSelect)((t=>{if(!e)return null;const{getBlockName:n,getBlockAttributes:o}=t(Qn),{getBlockType:l,getActiveBlockVariation:i}=t(r.store),s=n(e),a=l(s);if(!a)return null;const c=o(e),u=i(s,c),d={title:a.title,icon:a.icon,description:a.description,anchor:null==c?void 0:c.anchor};return u?{title:u.title||a.title,icon:u.icon||a.icon,description:u.description||a.description,anchor:null==c?void 0:c.anchor}:d}),[e])}function Op(e,t){const{attributes:n,name:o,reusableBlockTitle:l}=(0,m.useSelect)((t=>{if(!e)return{};const{getBlockName:n,getBlockAttributes:o,__experimentalGetReusableBlockTitle:l}=t(Qn),i=n(e);if(!i)return{};const s=(0,r.isReusableBlock)((0,r.getBlockType)(i));return{attributes:o(e),name:i,reusableBlockTitle:s&&l(o(e).ref)}}),[e]),i=Dp(e);if(!o||!i)return null;const s=(0,r.getBlockType)(o),a=s?(0,r.__experimentalGetBlockLabel)(s,n):null,c=l||a,d=c&&c!==s.title?c:i.title;return t&&t>0?(0,u.truncate)(d,{length:t}):d}function Fp(e){let{clientId:t,maximumLength:n}=e;return Op(t,n)}var zp=e=>{let{children:t,clientIds:n,cloneClassname:o,onDragStart:l,onDragEnd:i}=e;const{srcRootClientId:a,isDraggable:c,icon:u}=(0,m.useSelect)((e=>{var t;const{canMoveBlocks:o,getBlockRootClientId:l,getBlockName:i}=e(Qn),s=l(n[0]),a=i(n[0]);return{srcRootClientId:s,isDraggable:o(n,s),icon:null===(t=(0,r.getBlockType)(a))||void 0===t?void 0:t.icon}}),[n]),d=(0,s.useRef)(!1),[f,g,h]=function(){const e=(0,s.useRef)(null),t=(0,s.useRef)(null),n=(0,s.useRef)(null),o=(0,s.useRef)(null);return(0,s.useEffect)((()=>()=>{o.current&&(clearInterval(o.current),o.current=null)}),[]),[(0,s.useCallback)((r=>{e.current=r.clientY,n.current=(0,cl.getScrollContainer)(r.target),o.current=setInterval((()=>{if(n.current&&t.current){const e=n.current.scrollTop+t.current;n.current.scroll({top:e})}}),25)}),[]),(0,s.useCallback)((o=>{if(!n.current)return;const r=n.current.offsetHeight,l=e.current-n.current.offsetTop,i=o.clientY-n.current.offsetTop;if(o.clientY>l){const e=Math.max(r-l-50,0),n=Math.max(i-l-50,0)/e;t.current=25*n}else if(o.clientY<l){const e=Math.max(l-50,0),n=Math.max(l-i-50,0)/e;t.current=-25*n}else t.current=0}),[]),()=>{e.current=null,n.current=null,o.current&&(clearInterval(o.current),o.current=null)}]}(),{startDraggingBlocks:v,stopDraggingBlocks:b}=(0,m.useDispatch)(Qn);if((0,s.useEffect)((()=>()=>{d.current&&b()}),[]),!c)return t({isDraggable:!1});const k={type:"block",srcClientIds:n,srcRootClientId:a};return(0,s.createElement)(p.Draggable,{cloneClassname:o,__experimentalTransferDataType:"wp-blocks",transferData:k,onDragStart:e=>{v(n),d.current=!0,f(e),l&&l()},onDragOver:g,onDragEnd:()=>{b(),d.current=!1,h(),i&&i()},__experimentalDragComponent:(0,s.createElement)(_d,{count:n.length,icon:u})},(e=>{let{onDraggableStart:n,onDraggableEnd:o}=e;return t({draggable:!0,onDragStart:n,onDragEnd:o})}))},Vp=function(e){let{clientId:t,rootClientId:n}=e;const o=Dp(t),l=(0,m.useSelect)((e=>{var o;const{getBlock:r,getBlockIndex:l,hasBlockMovingClientId:i,getBlockListSettings:s}=e(Qn),a=l(t),{name:c,attributes:u}=r(t);return{index:a,name:c,attributes:u,blockMovingMode:i(),orientation:null===(o=s(n))||void 0===o?void 0:o.orientation}}),[t,n]),{index:a,name:u,attributes:d,blockMovingMode:f,orientation:h}=l,{setNavigationMode:v,removeBlock:b}=(0,m.useDispatch)(Qn),k=(0,s.useRef)(),_=(0,r.getBlockType)(u),y=(0,r.__experimentalGetAccessibleBlockLabel)(_,d,a+1,h);(0,s.useEffect)((()=>{k.current.focus(),(0,Ht.speak)(y)}),[y]);const E=ko(t),{hasBlockMovingClientId:C,getBlockIndex:S,getBlockRootClientId:w,getClientIdsOfDescendants:B,getSelectedBlockClientId:I,getMultiSelectedBlocksEndClientId:x,getPreviousBlockClientId:T,getNextBlockClientId:N,isNavigationMode:P}=(0,m.useSelect)(Qn),{selectBlock:M,clearSelectedBlock:R,setBlockMovingClientId:L,moveBlockToPosition:A}=(0,m.useDispatch)(Qn),D=c()("block-editor-block-list__block-selection-button",{"is-block-moving-mode":!!f}),O=(0,g.__)("Drag");return(0,s.createElement)("div",{className:D},(0,s.createElement)(p.Flex,{justify:"center",className:"block-editor-block-list__block-selection-button__content"},(0,s.createElement)(p.FlexItem,null,(0,s.createElement)(zc,{icon:null==o?void 0:o.icon,showColors:!0})),(0,s.createElement)(p.FlexItem,null,(0,s.createElement)(zp,{clientIds:[t]},(e=>(0,s.createElement)(p.Button,i({icon:kd,className:"block-selection-button_drag-handle","aria-hidden":"true",label:O,tabIndex:"-1"},e))))),(0,s.createElement)(p.FlexItem,null,(0,s.createElement)(p.Button,{ref:k,onClick:()=>v(!1),onKeyDown:function(e){const{keyCode:n}=e,o=n===Sc.UP,r=n===Sc.DOWN,l=n===Sc.LEFT,i=n===Sc.RIGHT,s=n===Sc.TAB,a=n===Sc.ESCAPE,c=n===Sc.ENTER,u=n===Sc.SPACE,d=e.shiftKey;if(n===Sc.BACKSPACE||n===Sc.DELETE)return b(t),void e.preventDefault();const p=I(),m=x(),f=T(m||p),g=N(m||p),h=s&&d||o,v=s&&!d||r,k=l,_=i;let y;if(h)y=f;else if(v)y=g;else if(k){var D;y=null!==(D=w(p))&&void 0!==D?D:p}else if(_){var O;y=null!==(O=B([p])[0])&&void 0!==O?O:p}const F=C();if(a&&P()&&(R(),e.preventDefault()),a&&F&&!e.defaultPrevented&&(L(null),e.preventDefault()),(c||u)&&F){const e=w(F),t=w(p),n=S(F);let o=S(p);n<o&&e===t&&(o-=1),A(F,e,t,o),M(F),L(null)}if(v||h||k||_)if(y)e.preventDefault(),M(y);else if(s&&p){let t;if(v){t=E;do{t=cl.focus.tabbable.findNext(t)}while(t&&E.contains(t));t||(t=E.ownerDocument.defaultView.frameElement,t=cl.focus.tabbable.findNext(t))}else t=cl.focus.tabbable.findPrevious(E);t&&(e.preventDefault(),t.focus(),R())}},label:y,className:"block-selection-button_select-button"},(0,s.createElement)(Fp,{clientId:t,maximumLength:35})))))};function Hp(e){return Array.from(e.querySelectorAll("[data-toolbar-item]"))}var Gp=function(e){let{children:t,focusOnMount:n,__experimentalInitialIndex:o,__experimentalOnIndexChange:r,...l}=e;const a=(0,s.useRef)(),c=function(e){const[t,n]=(0,s.useState)(!0),o=(0,s.useCallback)((()=>{const t=!cl.focus.tabbable.find(e.current).some((e=>!("toolbarItem"in e.dataset)));t||H()("Using custom components as toolbar controls",{since:"5.6",alternative:"ToolbarItem, ToolbarButton or ToolbarDropdownMenu components",link:"https://developer.wordpress.org/block-editor/components/toolbar-button/#inside-blockcontrols"}),n(t)}),[]);return(0,s.useLayoutEffect)((()=>{const t=new window.MutationObserver(o);return t.observe(e.current,{childList:!0,subtree:!0}),()=>t.disconnect()}),[t]),t}(a);return function(e,t,n,o,r){const[l]=(0,s.useState)(t),[i]=(0,s.useState)(o),a=(0,s.useCallback)((()=>{!function(e){const[t]=cl.focus.tabbable.find(e);t&&t.focus({preventScroll:!0})}(e.current)}),[]);(0,Qc.useShortcut)("core/block-editor/focus-toolbar",a),(0,s.useEffect)((()=>{l&&a()}),[n,l,a]),(0,s.useEffect)((()=>{let t=0;return i&&!l&&(t=window.requestAnimationFrame((()=>{const t=Hp(e.current),n=i||0;var o;t[n]&&(o=e.current).contains(o.ownerDocument.activeElement)&&t[n].focus({preventScroll:!0})}))),()=>{if(window.cancelAnimationFrame(t),!r||!e.current)return;const n=Hp(e.current).findIndex((e=>0===e.tabIndex));r(n)}}),[i,l])}(a,n,c,o,r),c?(0,s.createElement)(p.Toolbar,i({label:l["aria-label"],ref:a},l),t):(0,s.createElement)(p.NavigableMenu,i({orientation:"horizontal",role:"toolbar",ref:a},l),t)},Up=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M10.6 6L9.4 7l4.6 5-4.6 5 1.2 1 5.4-6z"})),Wp=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M14.6 7l-1.2-1L8 12l5.4 6 1.2-1-4.6-5z"})),$p=(0,s.createElement)(O.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(O.Path,{d:"M6.5 12.4L12 8l5.5 4.4-.9 1.2L12 10l-4.5 3.6-1-1.2z"})),jp=(0,s.createElement)(O.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(O.Path,{d:"M17.5 11.6L12 16l-5.5-4.4.9-1.2L12 14l4.5-3.6 1 1.2z"}));const Kp=(e,t)=>"up"===e?"horizontal"===t?(0,g.isRTL)()?Up:Wp:$p:"down"===e?"horizontal"===t?(0,g.isRTL)()?Wp:Up:jp:null,qp=(e,t)=>"up"===e?"horizontal"===t?(0,g.isRTL)()?(0,g.__)("Move right"):(0,g.__)("Move left"):(0,g.__)("Move up"):"down"===e?"horizontal"===t?(0,g.isRTL)()?(0,g.__)("Move left"):(0,g.__)("Move right"):(0,g.__)("Move down"):null,Yp=(0,s.forwardRef)(((e,t)=>{let{clientIds:n,direction:o,orientation:l,...a}=e;const f=(0,d.useInstanceId)(Yp),h=(0,u.castArray)(n).length,{blockType:v,isDisabled:b,rootClientId:k,isFirst:_,isLast:y,firstIndex:E,orientation:C="vertical"}=(0,m.useSelect)((e=>{const{getBlockIndex:t,getBlockRootClientId:i,getBlockOrder:s,getBlock:a,getBlockListSettings:c}=e(Qn),d=(0,u.castArray)(n),p=(0,u.first)(d),m=i(p),f=t(p),g=t((0,u.last)(d)),h=s(m),v=a(p),b=0===f,k=g===h.length-1,{orientation:_}=c(m)||{};return{blockType:v?(0,r.getBlockType)(v.name):null,isDisabled:"up"===o?b:k,rootClientId:m,firstIndex:f,isFirst:b,isLast:k,orientation:l||_}}),[n,o]),{moveBlocksDown:S,moveBlocksUp:w}=(0,m.useDispatch)(Qn),B="up"===o?w:S,I=`block-editor-block-mover-button__description-${f}`;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.Button,i({ref:t,className:c()("block-editor-block-mover-button",`is-${o}-button`),icon:Kp(o,C),label:qp(o,C),"aria-describedby":I},a,{onClick:b?null:e=>{B(n,k),a.onClick&&a.onClick(e)},disabled:b,__experimentalIsFocusable:!0})),(0,s.createElement)(p.VisuallyHidden,{id:I},function(e,t,n,o,r,l,i){const s=n+1,a=e=>"up"===e?"horizontal"===i?(0,g.isRTL)()?"right":"left":"up":"down"===e?"horizontal"===i?(0,g.isRTL)()?"left":"right":"down":null;if(e>1)return function(e,t,n,o,r){const l=t+1;return r<0&&n?(0,g.__)("Blocks cannot be moved up as they are already at the top"):r>0&&o?(0,g.__)("Blocks cannot be moved down as they are already at the bottom"):r<0&&!n?(0,g.sprintf)(// translators: 1: Number of selected blocks, 2: Position of selected blocks
|
31 |
(0,g._n)("Move %1$d block from position %2$d up by one place","Move %1$d blocks from position %2$d up by one place",e),e,l):r>0&&!o?(0,g.sprintf)(// translators: 1: Number of selected blocks, 2: Position of selected blocks
|
32 |
(0,g._n)("Move %1$d block from position %2$d down by one place","Move %1$d blocks from position %2$d down by one place",e),e,l):void 0}(e,n,o,r,l);if(o&&r)return(0,g.sprintf)(// translators: %s: Type of block (i.e. Text, Image etc)
|
33 |
(0,g.__)("Block %s is the only block, and cannot be moved"),t);if(l>0&&!r){const e=a("down");if("down"===e)return(0,g.sprintf)(// translators: 1: Type of block (i.e. Text, Image etc), 2: Position of selected block, 3: New position
|
@@ -42,71 +42,68 @@ title:(0,g.__)("Reusable")};var bp=function(e){let{children:t,showPatterns:n=!1,
|
|
42 |
(0,g.__)("Move %1$s block from position %2$d right to position %3$d"),t,s,s-1)}if(l<0&&o){const e=a("up");if("up"===e)return(0,g.sprintf)(// translators: 1: Type of block (i.e. Text, Image etc)
|
43 |
(0,g.__)("Block %1$s is at the beginning of the content and can’t be moved up"),t);if("left"===e)return(0,g.sprintf)(// translators: 1: Type of block (i.e. Text, Image etc)
|
44 |
(0,g.__)("Block %1$s is at the beginning of the content and can’t be moved left"),t);if("right"===e)return(0,g.sprintf)(// translators: 1: Type of block (i.e. Text, Image etc)
|
45 |
-
(0,g.__)("Block %1$s is at the beginning of the content and can’t be moved right"),t)}}(h,v&&v.title,E,_,y,"up"===o?-1:1,C)))})),
|
46 |
/* translators: %s: Name of the block's parent. */
|
47 |
-
(0,g.__)("Select %s"),a.title),showTooltip:!0,icon:(0,s.createElement)(
|
48 |
/* translators: %s: block title. */
|
49 |
(0,g.__)("%s: Change block type or style"),f):(0,g.sprintf)(
|
50 |
/* translators: %d: number of blocks. */
|
51 |
-
(0,g._n)("Change type of %d block","Change type of %d blocks",n.length),n.length),C=c||k||_;return(0,s.createElement)(p.ToolbarGroup,null,(0,s.createElement)(p.ToolbarItem,null,(e=>(0,s.createElement)(p.DropdownMenu,{className:"block-editor-block-switcher",label:y,popoverProps:{position:"bottom right",isAlternate:!0,className:"block-editor-block-switcher__popover"},icon:(0,s.createElement)(s.Fragment,null,(0,s.createElement)(
|
52 |
(0,g.__)('Copied "%s" to clipboard.'),s):(0,g.sprintf)(// Translators: Name of the block being cut, e.g. "Paragraph".
|
53 |
(0,g.__)('Moved "%s" to clipboard.'),s)}else l="copy"===o?(0,g.sprintf)(// Translators: %d: Number of blocks being copied.
|
54 |
(0,g._n)("Copied %d block to clipboard.","Copied %d blocks to clipboard.",r.length),r.length):(0,g.sprintf)(// Translators: %d: Number of blocks being cut.
|
55 |
-
(0,g._n)("Moved %d block to clipboard.","Moved %d blocks to clipboard.",r.length),r.length);n(l,{type:"snackbar"})}),[])}function
|
56 |
/* translators: %s: Name of the block. */
|
57 |
-
(0,g.__)("Lock %s"),h.title),overlayClassName:"block-editor-block-lock-modal",closeLabel:(0,g.__)("Close"),onRequestClose:n},(0,s.createElement)("form",{onSubmit:e=>{e.preventDefault(),f([t],{lock:o}),n()}},(0,s.createElement)("p",null,(0,g.__)("Choose specific attributes to restrict or lock all available options.")),(0,s.createElement)("div",{role:"group","aria-labelledby":v,className:"block-editor-block-lock-modal__options"},(0,s.createElement)(p.CheckboxControl,{className:"block-editor-block-lock-modal__options-title",label:(0,s.createElement)("span",{id:v},(0,g.__)("Lock all")),checked:b,indeterminate:k,onChange:e=>l({move:e,remove:e,...u?{edit:e}:{}})}),(0,s.createElement)("ul",{className:"block-editor-block-lock-modal__checklist"},u&&(0,s.createElement)("li",{className:"block-editor-block-lock-modal__checklist-item"},(0,s.createElement)(p.CheckboxControl,{label:(0,s.createElement)(s.Fragment,null,(0,g.__)("Restrict editing"),(0,s.createElement)(p.Icon,{icon:o.edit?
|
58 |
/* translators: %s: block name */
|
59 |
-
(0,g.__)("Remove %s"),B),T=1===c?x:(0,g.__)("Remove blocks"),N=(0,s.useRef)(),{gestures:P}=
|
60 |
/* translators: %s: Name of the block's parent. */
|
61 |
-
(0,g.__)("Select parent block (%s)"),b.title)),1===c&&(0,s.createElement)(
|
62 |
/* translators: %s: block name */
|
63 |
-
(0,g.__)("Unlock %s"),n.title),onClick:c})),a&&(0,s.createElement)(
|
64 |
-
/* translators: accessibility text for the block toolbar */,"aria-label":(0,g.__)("Block tools")},o),(0,s.createElement)(af,{hideDragHandle:n}))};function uf(e){const{isNavigationMode:t,isMultiSelecting:n,hasMultiSelection:o,isTyping:r,getSettings:l,getLastMultiSelectedBlockClientId:i}=e(Qn);return{isNavigationMode:t(),isMultiSelecting:n(),isTyping:r(),hasFixedToolbar:l().hasFixedToolbar,lastClientId:o()?i():null}}function df(e){let{clientId:t,rootClientId:n,isEmptyDefaultBlock:o,capturingClientId:r,__unstablePopoverSlot:l,__unstableContentRef:i}=e;const{isNavigationMode:a,isMultiSelecting:u,isTyping:p,hasFixedToolbar:f,lastClientId:g}=(0,m.useSelect)(uf,[]),h=(0,m.useSelect)((e=>{const{isBlockInsertionPointVisible:n,getBlockInsertionPoint:o,getBlockOrder:r}=e(Qn);if(!n())return!1;const l=o();return r(l.rootClientId)[l.index]===t}),[t]),v=(0,d.useViewportMatch)("medium"),b=(0,s.useRef)(!1),{stopTyping:k}=(0,m.useDispatch)(Qn),_=a,y=!a&&!f&&v&&!u&&!(!p&&!a&&o)&&!p,E=!(a||y||f||o);(0,Qc.useShortcut)("core/block-editor/focus-toolbar",(()=>{b.current=!0,k(!0)}),{isDisabled:!E}),(0,s.useEffect)((()=>{b.current=!1}));const C=(0,s.useRef)();return _||y?(0,s.createElement)(zo,{clientId:r||t,bottomClientId:g,className:c()("block-editor-block-list__block-popover",{"is-insertion-point-visible":h}),__unstablePopoverSlot:l,__unstableContentRef:i},y&&(0,s.createElement)(cf,{focusOnMount:b.current,__experimentalInitialIndex:C.current,__experimentalOnIndexChange:e=>{C.current=e},key:t}),_&&(0,s.createElement)(Vp,{clientId:t,rootClientId:n})):null}function pf(e){const{getSelectedBlockClientId:t,getFirstMultiSelectedBlockClientId:n,getBlockRootClientId:o,getBlock:l,getBlockParents:i,__experimentalGetBlockListSettingsForBlocks:s}=e(Qn),a=t()||n();if(!a)return;const{name:c,attributes:d={}}=l(a)||{},p=i(a),m=s(p),f=(0,u.find)(p,(e=>{var t;return null===(t=m[e])||void 0===t?void 0:t.__experimentalCaptureToolbars}));return{clientId:a,rootClientId:o(a),name:c,isEmptyDefaultBlock:c&&(0,r.isUnmodifiedDefaultBlock)({name:c,attributes:d}),capturingClientId:f}}function mf(e){let{__unstablePopoverSlot:t,__unstableContentRef:n}=e;const o=(0,m.useSelect)(pf,[]);if(!o)return null;const{clientId:r,rootClientId:l,name:i,isEmptyDefaultBlock:a,capturingClientId:c}=o;return i?(0,s.createElement)(df,{clientId:r,rootClientId:l,isEmptyDefaultBlock:a,capturingClientId:c,__unstablePopoverSlot:t,__unstableContentRef:n}):null}function ff(e){let{children:t}=e;const n=(0,s.useContext)(Np),o=(0,s.useContext)(p.Disabled.Context);return n||o?t:(H()('wp.components.Popover.Slot name="block-toolbar"',{alternative:"wp.blockEditor.BlockTools",since:"5.8"}),(0,s.createElement)(Mp,{__unstablePopoverSlot:"block-toolbar"},(0,s.createElement)(mf,{__unstablePopoverSlot:"block-toolbar"}),t))}var gf=(0,d.createHigherOrderComponent)((e=>t=>{const{clientId:n}=eo();return(0,s.createElement)(e,i({},t,{clientId:n}))}),"withClientId"),hf=gf((e=>{let{clientId:t,showSeparator:n,isFloating:o,onAddBlock:r,isToggle:l}=e;return(0,s.createElement)(Ip,{className:c()({"block-list-appender__toggle":l}),rootClientId:t,showSeparator:n,isFloating:o,onAddBlock:r})})),vf=(0,d.compose)([gf,(0,m.withSelect)(((e,t)=>{let{clientId:n}=t;const{getBlockOrder:o}=e(Qn),r=o(n);return{lastBlockClientId:(0,u.last)(r)}}))])((e=>{let{clientId:t}=e;return(0,s.createElement)(Sp,{rootClientId:t})}));const bf=new WeakMap;function kf(e,t){const n=(0,m.useSelect)((e=>e(Qn).getSettings().mediaUpload),[]),{canInsertBlockType:o,getBlockIndex:l,getClientIdsOfDescendants:i}=(0,m.useSelect)(Qn),{insertBlocks:s,moveBlocksToPosition:a,updateBlockAttributes:c,clearSelectedBlock:u}=(0,m.useDispatch)(Qn),d=function(e,t,n,o,l,i,s){return a=>{const{srcRootClientId:c,srcClientIds:u,type:d,blocks:p}=function(e){let t={srcRootClientId:null,srcClientIds:null,srcIndex:null,type:null,blocks:null};if(!e.dataTransfer)return t;try{t=Object.assign(t,JSON.parse(e.dataTransfer.getData("wp-blocks")))}catch(e){return t}return t}(a);if("inserter"===d){s();const n=p.map((e=>(0,r.cloneBlock)(e)));i(n,t,e,!0,null)}if("block"===d){const r=n(u[0]);if(c===e&&r===t)return;if(u.includes(e)||o(u).some((t=>t===e)))return;const i=c===e,s=u.length;l(u,c,e,i&&r<t?t-s:t)}}}(e,t,l,i,a,s,u),p=function(e,t,n,o,l,i){return s=>{if(!n)return;const a=(0,r.findTransform)((0,r.getBlockTransforms)("from"),(t=>"files"===t.type&&l(t.blockName,e)&&t.isMatch(s)));if(a){const n=a.transform(s,o);i(n,t,e)}}}(e,t,n,c,o,s),f=function(e,t,n){return o=>{const l=(0,r.pasteHandler)({HTML:o,mode:"BLOCKS"});l.length&&n(l,t,e)}}(e,t,s);return e=>{const t=(0,cl.getFilesFromDataTransfer)(e.dataTransfer),n=e.dataTransfer.getData("text/html");n?f(n):t.length?p(t):d(e)}}function _f(e,t,n){const o="top"===n||"bottom"===n,{x:r,y:l}=e,i=o?r:l,s=o?l:r,a=o?t.left:t.top,c=o?t.right:t.bottom,u=t[n];let d;return d=i>=a&&i<=c?i:i<c?a:c,Math.sqrt((i-d)**2+(s-u)**2)}function yf(e,t){let n,o,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:["top","bottom","left","right"];return r.forEach((r=>{const l=_f(e,t,r);(void 0===n||l<n)&&(n=l,o=r)})),[n,o]}function Ef(e,t,n){const o="horizontal"===n?["left","right"]:["top","bottom"],r=(0,g.isRTL)();let l,i;return e.forEach(((e,n)=>{const s=e.getBoundingClientRect(),[a,c]=yf(t,s,o);(void 0===i||a<i)&&(i=a,l=n+("bottom"===c||!r&&"right"===c||r&&"left"===c?1:0))})),l}function Cf(){let{rootClientId:e=""}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const[t,n]=(0,s.useState)(null),o=(0,m.useSelect)((t=>{const{getTemplateLock:n}=t(Qn);return"all"===n(e)}),[e]),{getBlockListSettings:r}=(0,m.useSelect)(Qn),{showInsertionPoint:l,hideInsertionPoint:i}=(0,m.useDispatch)(Qn),a=kf(e,t),c=(0,d.useThrottle)((0,s.useCallback)(((t,o)=>{var i;const s=Ef(Array.from(o.children).filter((e=>e.classList.contains("wp-block"))),{x:t.clientX,y:t.clientY},null===(i=r(e))||void 0===i?void 0:i.orientation);n(void 0===s?0:s),null!==s&&l(e,s)}),[]),200);return(0,d.__experimentalUseDropZone)({isDisabled:o,onDrop:a,onDragOver(e){c(e,e.currentTarget)},onDragLeave(){c.cancel(),i(),n(null)},onDragEnd(){c.cancel(),i(),n(null)}})}function Sf(e){const{clientId:t,allowedBlocks:n,__experimentalDefaultBlock:o,__experimentalDirectInsert:l,template:i,templateLock:a,wrapperRef:c,templateInsertUpdatesSelection:d,__experimentalCaptureToolbars:p,__experimentalAppenderTagName:f,renderAppender:g,orientation:h,placeholder:v,__experimentalLayout:b}=e;!function(e,t,n,o,r,l,i,a){const{updateBlockListSettings:c}=(0,m.useDispatch)(Qn),{blockListSettings:u,parentLock:d}=(0,m.useSelect)((t=>{const n=t(Qn).getBlockRootClientId(e);return{blockListSettings:t(Qn).getBlockListSettings(e),parentLock:t(Qn).getTemplateLock(n)}}),[e]),p=(0,s.useMemo)((()=>t),t);(0,s.useLayoutEffect)((()=>{const t={allowedBlocks:p,templateLock:void 0===r?d:r};if(void 0!==l&&(t.__experimentalCaptureToolbars=l),void 0!==i)t.orientation=i;else{const e=Nr(null==a?void 0:a.type);t.orientation=e.getOrientation(a)}void 0!==n&&(t.__experimentalDefaultBlock=n),void 0!==o&&(t.__experimentalDirectInsert=o),Oo()(u,t)||c(e,t)}),[e,u,p,n,o,r,d,l,i,c,a])}(t,n,o,l,a,p,h,b),function(e,t,n,o){const{getSelectedBlocksInitialCaretPosition:l}=(0,m.useSelect)(Qn),{replaceInnerBlocks:i}=(0,m.useDispatch)(Qn),a=(0,m.useSelect)((t=>t(Qn).getBlocks(e)),[e]),c=(0,s.useRef)(null);(0,s.useLayoutEffect)((()=>{if((0===a.length||"all"===n)&&!(0,u.isEqual)(t,c.current)){c.current=t;const n=(0,r.synchronizeBlocksWithTemplate)(a,t);(0,u.isEqual)(n,a)||i(e,n,0===a.length&&o&&0!==n.length,l())}}),[a,t,n,e])}(t,i,a,d);const k=(0,m.useSelect)((e=>{const n=e(Qn).getBlock(t),o=(0,r.getBlockType)(n.name);if(o&&o.providesContext)return function(e,t){bf.has(t)||bf.set(t,new WeakMap);const n=bf.get(t);if(!n.has(e)){const o=(0,u.mapValues)(t.providesContext,(t=>e[t]));n.set(e,o)}return n.get(e)}(n.attributes,o)}),[t]);return(0,s.createElement)(dl,{value:k},(0,s.createElement)(Lf,{rootClientId:t,renderAppender:g,__experimentalAppenderTagName:f,__experimentalLayout:b,wrapperRef:c,placeholder:v}))}function wf(e){return Hc(e),(0,s.createElement)(Sf,e)}const Bf=(0,s.forwardRef)(((e,t)=>{const n=If({ref:t},e);return(0,s.createElement)("div",{className:"block-editor-inner-blocks"},(0,s.createElement)("div",n))}));function If(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{clientId:n}=eo(),o=(0,d.useViewportMatch)("medium","<"),{__experimentalCaptureToolbars:l,hasOverlay:a}=(0,m.useSelect)((e=>{if(!n)return{};const{getBlockName:t,isBlockSelected:l,hasSelectedInnerBlock:i,isNavigationMode:s}=e(Qn),a=t(n),c=s()||o;return{__experimentalCaptureToolbars:e(r.store).hasBlockSupport(a,"__experimentalExposeControlsToChildren",!1),hasOverlay:"core/template"!==a&&!l(n)&&!i(n,!0)&&c}}),[n,o]),u=(0,d.useMergeRefs)([e.ref,Cf({rootClientId:n})]),p={__experimentalCaptureToolbars:l,...t},f=p.value&&p.onChange?wf:Sf;return{...e,ref:u,className:c()(e.className,"block-editor-block-list__layout",{"has-overlay":a}),children:n?(0,s.createElement)(f,i({},p,{clientId:n})):(0,s.createElement)(Lf,t)}}If.save=r.__unstableGetInnerBlocksProps,Bf.DefaultBlockAppender=vf,Bf.ButtonBlockAppender=hf,Bf.Content=()=>If.save().children;var xf=Bf;const Tf=(0,s.createContext)(),Nf=(0,s.createContext)();function Pf(e){let{className:t,...n}=e;const[o,r]=(0,s.useState)(),l=(0,d.useViewportMatch)("medium"),{isOutlineMode:i,isFocusMode:a,isNavigationMode:u}=(0,m.useSelect)((e=>{const{getSettings:t,isNavigationMode:n}=e(Qn),{outlineMode:o,focusMode:r}=t();return{isOutlineMode:o,isFocusMode:r,isNavigationMode:n()}}),[]),p=If({ref:(0,d.useMergeRefs)([Wc(),Rp(),r]),className:c()("is-root-container",t,{"is-outline-mode":i,"is-focus-mode":a&&l,"is-navigate-mode":u})},n);return(0,s.createElement)(Tf.Provider,{value:o},(0,s.createElement)("div",p))}function Mf(e){return function(){const e=(0,m.useSelect)((e=>e(Qn).getSettings().__experimentalBlockPatterns),[]);(0,s.useEffect)((()=>{if(null==e||!e.length)return;let t,n=-1;const o=()=>{n++,n>=e.length||((0,m.select)(Qn).__experimentalGetParsedPattern(e[n].name),t=Lp(o))};return t=Lp(o),()=>Ap(t)}),[e])}(),(0,s.createElement)(ff,null,(0,s.createElement)(Jn,{value:Zn},(0,s.createElement)(Pf,e)))}function Rf(e){let{placeholder:t,rootClientId:n,renderAppender:o,__experimentalAppenderTagName:r,__experimentalLayout:l=Pr}=e;const[i,a]=(0,s.useState)(new Set),c=(0,s.useMemo)((()=>{const{IntersectionObserver:e}=window;if(e)return new e((e=>{a((t=>{const n=new Set(t);for(const t of e){const e=t.target.getAttribute("data-block");n[t.isIntersecting?"add":"delete"](e)}return n}))}))}),[a]),{order:u,selectedBlocks:d}=(0,m.useSelect)((e=>{const{getBlockOrder:t,getSelectedBlockClientIds:o}=e(Qn);return{order:t(n),selectedBlocks:o()}}),[n]);return(0,s.createElement)(Rr,{value:l},(0,s.createElement)(Nf.Provider,{value:c},u.map((e=>(0,s.createElement)(m.AsyncModeProvider,{key:e,value:!i.has(e)&&!d.includes(e)},(0,s.createElement)(Rc,{rootClientId:n,clientId:e}))))),u.length<1&&t,(0,s.createElement)(xp,{tagName:r,rootClientId:n,renderAppender:o}))}function Lf(e){return(0,s.createElement)(m.AsyncModeProvider,{value:!1},(0,s.createElement)(Rf,e))}function Af(e){return[...e].sort(((t,n)=>e.filter((e=>e===n)).length-e.filter((e=>e===t)).length)).shift()}function Df(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if("string"==typeof e)return e;const t=Object.values(e).map((e=>(0,p.__experimentalParseQuantityAndUnitFromRawValue)(e))),n=t.map((e=>{var t;return null!==(t=e[0])&&void 0!==t?t:""})),o=t.map((e=>e[1])),r=n.every((e=>e===n[0]))?n[0]:"",l=Af(o),i=0===r||r?`${r}${l}`:void 0;return i}function Of(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=Df(e),n="string"!=typeof e&&isNaN(parseFloat(t));return n}function Ff(e){return!!e&&("string"==typeof e||!!Object.values(e).filter((e=>!!e||0===e)).length)}function zf(e){let{onChange:t,values:n,...o}=e;const r=Df(n),l=Ff(n)&&Of(n),a=l?(0,g.__)("Mixed"):null;return(0,s.createElement)(p.__experimentalUnitControl,i({},o,{"aria-label":(0,g.__)("Border radius"),disableUnits:l,isOnly:!0,value:r,onChange:t,placeholder:a}))}Mf.__unstableElementContext=Tf;const Vf={topLeft:(0,g.__)("Top left"),topRight:(0,g.__)("Top right"),bottomLeft:(0,g.__)("Bottom left"),bottomRight:(0,g.__)("Bottom right")};function Hf(e){let{onChange:t,values:n,...o}=e;const r="string"!=typeof n?n:{topLeft:n,topRight:n,bottomLeft:n,bottomRight:n};return(0,s.createElement)("div",{className:"components-border-radius-control__input-controls-wrapper"},Object.entries(Vf).map((e=>{let[n,l]=e;return(0,s.createElement)(p.Tooltip,{text:l,position:"top",key:n},(0,s.createElement)("div",{className:"components-border-radius-control__tooltip-wrapper"},(0,s.createElement)(p.__experimentalUnitControl,i({},o,{"aria-label":l,value:r[n],onChange:(a=n,e=>{t&&t({...r,[a]:e||void 0})})}))));var a})))}var Gf=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M15.6 7.2H14v1.5h1.6c2 0 3.7 1.7 3.7 3.7s-1.7 3.7-3.7 3.7H14v1.5h1.6c2.8 0 5.2-2.3 5.2-5.2 0-2.9-2.3-5.2-5.2-5.2zM4.7 12.4c0-2 1.7-3.7 3.7-3.7H10V7.2H8.4c-2.9 0-5.2 2.3-5.2 5.2 0 2.9 2.3 5.2 5.2 5.2H10v-1.5H8.4c-2 0-3.7-1.7-3.7-3.7zm4.6.9h5.3v-1.5H9.3v1.5z"})),Uf=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M15.6 7.3h-.7l1.6-3.5-.9-.4-3.9 8.5H9v1.5h2l-1.3 2.8H8.4c-2 0-3.7-1.7-3.7-3.7s1.7-3.7 3.7-3.7H10V7.3H8.4c-2.9 0-5.2 2.3-5.2 5.2 0 2.9 2.3 5.2 5.2 5.2H9l-1.4 3.2.9.4 5.7-12.5h1.4c2 0 3.7 1.7 3.7 3.7s-1.7 3.7-3.7 3.7H14v1.5h1.6c2.9 0 5.2-2.3 5.2-5.2 0-2.9-2.4-5.2-5.2-5.2z"}));function Wf(e){let{isLinked:t,...n}=e;const o=t?(0,g.__)("Unlink Radii"):(0,g.__)("Link Radii");return(0,s.createElement)(p.Tooltip,{text:o},(0,s.createElement)(p.Button,i({},n,{className:"component-border-radius-control__linked-button",isPrimary:t,isSecondary:!t,isSmall:!0,icon:t?Gf:Uf,iconSize:16,"aria-label":o})))}const $f={topLeft:null,topRight:null,bottomLeft:null,bottomRight:null},jf={px:100,em:20,rem:20};function Kf(e){let{onChange:t,values:n}=e;const[o,r]=(0,s.useState)(!Ff(n)||!Of(n)),l=(0,p.__experimentalUseCustomUnits)({availableUnits:Co("spacing.units")||["px","em","rem"]}),i=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if("string"==typeof e){const[,t]=(0,p.__experimentalParseQuantityAndUnitFromRawValue)(e);return t||"px"}return Af(Object.values(e).map((e=>{const[,t]=(0,p.__experimentalParseQuantityAndUnitFromRawValue)(e);return t})))||"px"}(n),a=l&&l.find((e=>e.value===i)),c=(null==a?void 0:a.step)||1,[u]=(0,p.__experimentalParseQuantityAndUnitFromRawValue)(Df(n));return(0,s.createElement)("fieldset",{className:"components-border-radius-control"},(0,s.createElement)("legend",null,(0,g.__)("Radius")),(0,s.createElement)("div",{className:"components-border-radius-control__wrapper"},o?(0,s.createElement)(s.Fragment,null,(0,s.createElement)(zf,{className:"components-border-radius-control__unit-control",values:n,min:0,onChange:t,units:l}),(0,s.createElement)(p.RangeControl,{className:"components-border-radius-control__range-control",value:null!=u?u:"",min:0,max:jf[i],initialPosition:0,withInputField:!1,onChange:e=>{t(void 0!==e?`${e}${i}`:void 0)},step:c})):(0,s.createElement)(Hf,{min:0,onChange:t,values:n||$f,units:l}),(0,s.createElement)(Wf,{onClick:()=>r(!o),isLinked:o})))}function qf(e){var t;const{attributes:{style:n},setAttributes:o}=e;return(0,s.createElement)(Kf,{values:null==n||null===(t=n.border)||void 0===t?void 0:t.radius,onChange:e=>{let t={...n,border:{...null==n?void 0:n.border,radius:e}};void 0!==e&&""!==e||(t=Bo(t)),o({style:t})}})}Du([Ou,Vu]);const Yf=(e,t,n)=>{if(t){const n=(0,u.find)(e,{slug:t});if(n)return n}return{color:n}},Qf=(e,t)=>(0,u.find)(e,{color:t});function Zf(e,t){if(e&&t)return`has-${(0,u.kebabCase)(t)}-${e}`}function Xf(){return{disableCustomColors:!Co("color.custom"),disableCustomGradients:!Co("color.customGradient")}}function Jf(){const e=Xf(),t=Co("color.palette.custom"),n=Co("color.palette.theme"),o=Co("color.palette.default"),r=Co("color.defaultPalette");e.colors=(0,s.useMemo)((()=>{const e=[];return n&&n.length&&e.push({name:(0,g._x)("Theme","Indicates this palette comes from the theme."),colors:n}),r&&o&&o.length&&e.push({name:(0,g._x)("Default","Indicates this palette comes from WordPress."),colors:o}),t&&t.length&&e.push({name:(0,g._x)("Custom","Indicates this palette comes from the theme."),colors:t}),e}),[o,n,t]);const l=Co("color.gradients.custom"),i=Co("color.gradients.theme"),a=Co("color.gradients.default"),c=Co("color.defaultGradients");return e.gradients=(0,s.useMemo)((()=>{const e=[];return i&&i.length&&e.push({name:(0,g._x)("Theme","Indicates this palette comes from the theme."),gradients:i}),c&&a&&a.length&&e.push({name:(0,g._x)("Default","Indicates this palette comes from WordPress."),gradients:a}),l&&l.length&&e.push({name:(0,g._x)("Custom","Indicates this palette is created by the user."),gradients:l}),e}),[l,i,a]),e}const eg="__experimentalBorder",tg=["top","right","bottom","left"],ng=e=>{var t,n;return{...e,borderColor:void 0,style:{...e.style,border:{radius:null===(t=e.style)||void 0===t||null===(n=t.border)||void 0===n?void 0:n.radius}}}},og=(e,t,n)=>{let o;return e.some((e=>e.colors.some((e=>e[t]===n&&(o=e,!0))))),o},rg=e=>{let{colors:t,namedColor:n,customColor:o}=e;if(n){const e=og(t,"slug",n);if(e)return e}if(!o)return{color:void 0};return og(t,"color",o)||{color:o}};function lg(e){const t=/var:preset\|color\|(.+)/.exec(e);return t&&t[1]?t[1]:null}function ig(e){const{attributes:t,clientId:n,setAttributes:o}=e,{style:l}=t,{colors:i}=Jf(),a=sg(e.name),c=Co("border.color")&&sg(e.name,"color"),u=Co("border.radius")&&sg(e.name,"radius"),d=Co("border.style")&&sg(e.name,"style"),m=Co("border.width")&&sg(e.name,"width");if([!c,!u,!d,!m].every(Boolean)||!a)return null;const f=(0,r.getBlockSupport)(e.name,[eg,"__experimentalDefaultControls"]),h=(null==f?void 0:f.color)||(null==f?void 0:f.width),v=((e,t)=>{const{borderColor:n,style:o}=e,{border:r}=o||{};if(n){const{color:e}=rg({colors:t,namedColor:n});return e?{...r,color:e}:r}if(!r)return r;const l={...r};return tg.forEach((e=>{var n;const o=lg(null===(n=l[e])||void 0===n?void 0:n.color);if(o){const{color:n}=rg({colors:t,namedColor:o});l[e]={...l[e],color:n}}})),l})(t,i);return(0,s.createElement)(Ao,{__experimentalGroup:"border"},(m||c)&&(0,s.createElement)(p.__experimentalToolsPanelItem,{hasValue:()=>(e=>{const{borderColor:t,style:n}=e.attributes;return(0,p.__experimentalIsDefinedBorder)(null==n?void 0:n.border)||!!t})(e),label:(0,g.__)("Border"),onDeselect:()=>(e=>{var t;let{attributes:n={},setAttributes:o}=e;const{style:r}=n;o({borderColor:void 0,style:{...r,border:Bo({radius:null==r||null===(t=r.border)||void 0===t?void 0:t.radius})}})})(e),isShownByDefault:h,resetAllFilter:ng,panelId:n},(0,s.createElement)(p.__experimentalBorderBoxControl,{colors:i,enableAlpha:!0,onChange:e=>{var t;let n,r={...e};if((0,p.__experimentalHasSplitBorders)(e))r={top:{...e.top},right:{...e.right},bottom:{...e.bottom},left:{...e.left}},tg.forEach((t=>{var n;if(null!==(n=e[t])&&void 0!==n&&n.color){var o;const n=rg({colors:i,customColor:null===(o=e[t])||void 0===o?void 0:o.color});n.slug&&(r[t].color=`var:preset|color|${n.slug}`)}}));else if(null!=e&&e.color){const t=null==e?void 0:e.color,o=rg({colors:i,customColor:t});o.slug&&(n=o.slug,r.color=void 0)}const s=Bo({...l,border:{radius:null==l||null===(t=l.border)||void 0===t?void 0:t.radius,...r}});o({style:s,borderColor:n})},popoverPlacement:"left-start",popoverOffset:40,showStyle:d,value:v,__experimentalHasMultipleOrigins:!0,__experimentalIsRenderedInSidebar:!0})),u&&(0,s.createElement)(p.__experimentalToolsPanelItem,{hasValue:()=>function(e){var t,n;const o=null===(t=e.attributes.style)||void 0===t||null===(n=t.border)||void 0===n?void 0:n.radius;return"object"==typeof o?Object.entries(o).some(Boolean):!!o}(e),label:(0,g.__)("Radius"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:ag(o,"radius")})}(e),isShownByDefault:null==f?void 0:f.radius,resetAllFilter:e=>{var t;return{...e,style:{...e.style,border:{...null===(t=e.style)||void 0===t?void 0:t.border,radius:void 0}}}},panelId:n},(0,s.createElement)(qf,e)))}function sg(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"any";if("web"!==s.Platform.OS)return!1;const n=(0,r.getBlockSupport)(e,eg);return!!(!0===n||("any"===t?null!=n&&n.color||null!=n&&n.radius||null!=n&&n.width||null!=n&&n.style:null!=n&&n[t]))}function ag(e,t){return Bo({...e,border:{...null==e?void 0:e.border,[t]:void 0}})}function cg(e,t,n){if(!sg(t,"color")||To(t,eg,"color"))return e;const o=ug(n),r=c()(e.className,o);return e.className=r||void 0,e}function ug(e){var t;const{borderColor:n,style:o}=e,r=Zf("border-color",n);return c()({"has-border-color":n||(null==o||null===(t=o.border)||void 0===t?void 0:t.color),[r]:!!r})}const dg=(0,d.createHigherOrderComponent)((e=>t=>{var n,o,r,l,a,c,u,d,p;const{name:m,attributes:f}=t,{borderColor:g,style:h}=f,{colors:v}=Jf();if(!sg(m,"color")||To(m,eg,"color"))return(0,s.createElement)(e,t);const{color:b}=rg({colors:v,namedColor:g}),{color:k}=rg({colors:v,namedColor:lg(null==h||null===(n=h.border)||void 0===n||null===(o=n.top)||void 0===o?void 0:o.color)}),{color:_}=rg({colors:v,namedColor:lg(null==h||null===(r=h.border)||void 0===r||null===(l=r.right)||void 0===l?void 0:l.color)}),{color:y}=rg({colors:v,namedColor:lg(null==h||null===(a=h.border)||void 0===a||null===(c=a.bottom)||void 0===c?void 0:c.color)}),{color:E}=rg({colors:v,namedColor:lg(null==h||null===(u=h.border)||void 0===u||null===(d=u.left)||void 0===d?void 0:d.color)}),C={borderTopColor:k||b,borderRightColor:_||b,borderBottomColor:y||b,borderLeftColor:E||b};let S=t.wrapperProps;return S={...t.wrapperProps,style:{...null===(p=t.wrapperProps)||void 0===p?void 0:p.style,...C}},(0,s.createElement)(e,i({},t,{wrapperProps:S}))}));function pg(e){if(e)return`has-${e}-gradient-background`}function mg(e,t){const n=(0,u.find)(e,["slug",t]);return n&&n.gradient}function fg(e,t){return(0,u.find)(e,["gradient",t])}function gg(e,t){const n=fg(e,t);return n&&n.slug}function hg(){let{gradientAttribute:e="gradient",customGradientAttribute:t="customGradient"}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{clientId:n}=eo(),o=Co("color.gradients.custom"),r=Co("color.gradients.theme"),l=Co("color.gradients.default"),i=(0,s.useMemo)((()=>[...o||[],...r||[],...l||[]]),[o,r,l]),{gradient:a,customGradient:c}=(0,m.useSelect)((o=>{const{getBlockAttributes:r}=o(Qn),l=r(n)||{};return{customGradient:l[t],gradient:l[e]}}),[n,e,t]),{updateBlockAttributes:u}=(0,m.useDispatch)(Qn),d=(0,s.useCallback)((o=>{const r=gg(i,o);u(n,r?{[e]:r,[t]:void 0}:{[e]:void 0,[t]:o})}),[i,n,u]),p=pg(a);let f;return f=a?mg(i,a):c,{gradientClass:p,gradientValue:f,setGradient:d}}(0,l.addFilter)("blocks.registerBlockType","core/border/addAttributes",(function(e){return sg(e,"color")?e.attributes.borderColor?e:{...e,attributes:{...e.attributes,borderColor:{type:"string"}}}:e})),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/border/addSaveProps",cg),(0,l.addFilter)("blocks.registerBlockType","core/border/addEditProps",(function(e){if(!sg(e,"color")||To(e,eg,"color"))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),cg(o,e,n)},e})),(0,l.addFilter)("editor.BlockListBlock","core/border/with-border-color-palette-styles",dg);const vg=["colors","disableCustomColors","gradients","disableCustomGradients"];function bg(e){let{colors:t,gradients:n,disableCustomColors:o,disableCustomGradients:r,__experimentalHasMultipleOrigins:l,__experimentalIsRenderedInSidebar:i,className:a,label:d,onColorChange:m,onGradientChange:f,colorValue:h,gradientValue:v,clearable:b,showTitle:k=!0,enableAlpha:_}=e;const y=m&&(!(0,u.isEmpty)(t)||!o),E=f&&(!(0,u.isEmpty)(n)||!r),[C,S]=(0,s.useState)(v?"gradient":!!y&&"color");return y||E?(0,s.createElement)(p.BaseControl,{className:c()("block-editor-color-gradient-control",a)},(0,s.createElement)("fieldset",{className:"block-editor-color-gradient-control__fieldset"},(0,s.createElement)(p.__experimentalVStack,{spacing:1},k&&(0,s.createElement)("legend",null,(0,s.createElement)("div",{className:"block-editor-color-gradient-control__color-indicator"},(0,s.createElement)(p.BaseControl.VisualLabel,null,d))),y&&E&&(0,s.createElement)(p.__experimentalToggleGroupControl,{value:C,onChange:S,label:(0,g.__)("Select color type"),hideLabelFromVision:!0,isBlock:!0},(0,s.createElement)(p.__experimentalToggleGroupControlOption,{value:"color",label:(0,g.__)("Solid")}),(0,s.createElement)(p.__experimentalToggleGroupControlOption,{value:"gradient",label:(0,g.__)("Gradient")})),("color"===C||!E)&&(0,s.createElement)(p.ColorPalette,{value:h,onChange:E?e=>{m(e),f()}:m,colors:t,disableCustomColors:o,__experimentalHasMultipleOrigins:l,__experimentalIsRenderedInSidebar:i,clearable:b,enableAlpha:_}),("gradient"===C||!y)&&(0,s.createElement)(p.GradientPicker,{value:v,onChange:y?e=>{f(e),m()}:f,gradients:n,disableCustomGradients:r,__experimentalHasMultipleOrigins:l,__experimentalIsRenderedInSidebar:i,clearable:b})))):null}function kg(e){const t={};return t.colors=Co("color.palette"),t.gradients=Co("color.gradients"),t.disableCustomColors=!Co("color.custom"),t.disableCustomGradients=!Co("color.customGradient"),(0,s.createElement)(bg,i({},t,e))}var _g=function(e){return(0,u.every)(vg,(t=>e.hasOwnProperty(t)))?(0,s.createElement)(bg,e):(0,s.createElement)(kg,e)};const yg=e=>{let{__experimentalIsItemGroup:t,children:n}=e;return t?(0,s.createElement)(p.__experimentalItemGroup,{isBordered:!0,isSeparated:!0,className:"block-editor-panel-color-gradient-settings__item-group"},n):n},Eg=e=>{let{__experimentalIsItemGroup:t,settings:n,children:o,...r}=e;return t?o:(0,s.createElement)(p.__experimentalToolsPanelItem,i({hasValue:n.hasValue,label:n.label,onDeselect:n.onDeselect,isShownByDefault:n.isShownByDefault,resetAllFilter:n.resetAllFilter},r,{className:"block-editor-tools-panel-color-gradient-settings__item"}),o)},Cg=e=>{let{colorValue:t,label:n}=e;return(0,s.createElement)(p.__experimentalHStack,{justify:"flex-start"},(0,s.createElement)(p.ColorIndicator,{className:"block-editor-panel-color-gradient-settings__color-indicator",colorValue:t}),(0,s.createElement)(p.FlexItem,null,n))},Sg=e=>t=>{let{onToggle:n,isOpen:o}=t;const{__experimentalIsItemGroup:r,colorValue:l,label:i}=e,a=r?p.__experimentalItem:p.Button,u=r?"block-editor-panel-color-gradient-settings__item":"block-editor-panel-color-gradient-settings__dropdown",d={onClick:n,className:c()(u,{"is-open":o}),"aria-expanded":r?void 0:o};return(0,s.createElement)(a,d,(0,s.createElement)(Cg,{colorValue:l,label:i}))};function wg(e){let{colors:t,disableCustomColors:n,disableCustomGradients:o,enableAlpha:r,gradients:l,__experimentalIsItemGroup:a=!0,settings:c,__experimentalHasMultipleOrigins:u,__experimentalIsRenderedInSidebar:d,...m}=e;const f=a?"block-editor-panel-color-gradient-settings__dropdown":"block-editor-tools-panel-color-gradient-settings__dropdown";let g;return d&&(g={placement:"left-start",offset:36}),(0,s.createElement)(yg,{__experimentalIsItemGroup:a},c.map(((e,c)=>{var h;const v={clearable:!!a&&void 0,colorValue:e.colorValue,colors:t,disableCustomColors:n,disableCustomGradients:o,enableAlpha:r,gradientValue:e.gradientValue,gradients:l,label:e.label,onColorChange:e.onColorChange,onGradientChange:e.onGradientChange,showTitle:!1,__experimentalHasMultipleOrigins:u,__experimentalIsRenderedInSidebar:d,...e},b={colorValue:null!==(h=e.gradientValue)&&void 0!==h?h:e.colorValue,__experimentalIsItemGroup:a,label:e.label};return e&&(0,s.createElement)(Eg,i({key:c,__experimentalIsItemGroup:a,settings:e},m),(0,s.createElement)(p.Dropdown,{popoverProps:g,className:f,contentClassName:"block-editor-panel-color-gradient-settings__dropdown-content",renderToggle:Sg(b),renderContent:()=>(0,s.createElement)(_g,v)}))})))}Du([Ou,Vu]);var Bg=function(e){let{backgroundColor:t,fallbackBackgroundColor:n,fallbackTextColor:o,fallbackLinkColor:r,fontSize:l,isLargeText:i,textColor:a,linkColor:c,enableAlphaChecker:u=!1}=e;const d=t||n;if(!d)return null;const m=a||o,f=c||r;if(!m&&!f)return null;const h=[{color:m,description:(0,g.__)("text color")},{color:f,description:(0,g.__)("link color")}],v=Lu(d),b=v.alpha()<1,k=v.brightness(),_={level:"AA",size:i||!1!==i&&l>=24?"large":"small"};let y="",E="";for(const e of h){if(!e.color)continue;const t=Lu(e.color),n=t.isReadable(v,_),o=t.alpha()<1;if(!n){if(b||o)continue;y=k<t.brightness()?(0,g.sprintf)(// translators: %s is a type of text color, e.g., "text color" or "link color".
|
65 |
(0,g.__)("This color combination may be hard for people to read. Try using a darker background color and/or a brighter %s."),e.description):(0,g.sprintf)(// translators: %s is a type of text color, e.g., "text color" or "link color".
|
66 |
-
(0,g.__)("This color combination may be hard for people to read. Try using a brighter background color and/or a darker %s."),e.description),E=(0,g.__)("This color combination may be hard for people to read.");break}o&&u&&(y=(0,g.__)("Transparent text may be hard for people to read."),E=(0,g.__)("Transparent text may be hard for people to read."))}return y?((0,Ht.speak)(E),(0,s.createElement)("div",{className:"block-editor-contrast-checker"},(0,s.createElement)(p.Notice,{spokenMessage:null,status:"warning",isDismissible:!1},y))):null};function
|
67 |
/* translators: 1: Font weight name. 2: Font style name. */
|
68 |
-
(0,g.__)("%1$s %2$s"),r,n);e.push({key:`${o}-${l}`,name:i,style:{fontStyle:o,fontWeight:l}})}))})),e})():n?(()=>{const e=[c];return
|
69 |
(0,g.__)("Currently selected font appearance: %s"),d.name):(0,g.sprintf)(// translators: %s: Currently selected font style.
|
70 |
(0,g.__)("Currently selected font style: %s"),d.name):(0,g.sprintf)(// translators: %s: Currently selected font weight.
|
71 |
-
(0,g.__)("Currently selected font weight: %s"),d.name):(0,g.__)("No selected font appearance"),options:u,value:d,onChange:e=>{let{selectedItem:n}=e;return t(n.style)}})}var Yg=e=>{let{value:t,onChange:n,__nextHasNoMarginBottom:o=!1,__unstableInputWidth:r="60px"}=e;const l=function(e){return void 0!==e&&""!==e}(t),i=l?t:"";o||H()("Bottom margin styles for wp.blockEditor.LineHeightControl",{since:"6.0",version:"6.4",hint:"Set the `__nextHasNoMarginBottom` prop to true to start opting into the new styles, which will become the default in a future version"});const a=o?void 0:{marginBottom:24};return(0,s.createElement)("div",{className:"block-editor-line-height-control",style:a},(0,s.createElement)(p.__experimentalNumberControl,{__unstableInputWidth:r,__unstableStateReducer:(e,t)=>{var n;const o=["insertText","insertFromPaste"].includes(null===(n=t.payload.event.nativeEvent)||void 0===n?void 0:n.inputType),r=((e,t)=>{if(l)return e;switch(`${e}`){case"0.1":return 1.6;case"0":return t?e:1.4;case"":return 1.5;default:return e}})(e.value,o);return{...e,value:r}},onChange:n,label:(0,g.__)("Line height"),placeholder:1.5,step:.1,value:i,min:0}))};const Qg="typography.lineHeight";function Zg(e){var t;const{attributes:{style:n},setAttributes:o}=e;return(0,s.createElement)(Yg,{__unstableInputWidth:"100%",__nextHasNoMarginBottom:!0,value:null==n||null===(t=n.typography)||void 0===t?void 0:t.lineHeight,onChange:e=>{const t={...n,typography:{...null==n?void 0:n.typography,lineHeight:e}};o({style:Bo(t)})}})}function Xg(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!Co("typography.lineHeight");return!(0,r.hasBlockSupport)(e,Qg)||t}const Jg="typography.__experimentalFontStyle",eh="typography.__experimentalFontWeight";function th(e){var t,n;const{attributes:{style:o},setAttributes:r}=e,l=!nh(e),i=!oh(e),a=null==o||null===(t=o.typography)||void 0===t?void 0:t.fontStyle,c=null==o||null===(n=o.typography)||void 0===n?void 0:n.fontWeight;return(0,s.createElement)(qg,{onChange:e=>{r({style:Bo({...o,typography:{...null==o?void 0:o.typography,fontStyle:e.fontStyle,fontWeight:e.fontWeight}})})},hasFontStyles:l,hasFontWeights:i,value:{fontStyle:a,fontWeight:c}})}function nh(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=(0,r.hasBlockSupport)(e,Jg),n=Co("typography.fontStyle");return!t||!n}function oh(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=(0,r.hasBlockSupport)(e,eh),n=Co("typography.fontWeight");return!t||!n}function rh(e){const t=nh(e),n=oh(e);return t&&n}function lh(e){let{value:t="",onChange:n,fontFamilies:o,...r}=e;const l=Co("typography.fontFamilies");if(o||(o=l),(0,u.isEmpty)(o))return null;const a=[{value:"",label:(0,g.__)("Default")},...o.map((e=>{let{fontFamily:t,name:n}=e;return{value:t,label:n||t}}))];return(0,s.createElement)(p.SelectControl,i({label:(0,g.__)("Font family"),options:a,value:t,onChange:n,labelPosition:"top"},r))}const ih="typography.__experimentalFontFamily";function sh(e,t,n){if(!(0,r.hasBlockSupport)(t,ih))return e;if(To(t,zh,"fontFamily"))return e;if(null==n||!n.fontFamily)return e;const o=new(um())(e.className);o.add(`has-${(0,u.kebabCase)(null==n?void 0:n.fontFamily)}-font-family`);const l=o.value;return e.className=l||void 0,e}function ah(e){var t;let{setAttributes:n,attributes:{fontFamily:o}}=e;const r=Co("typography.fontFamilies"),l=null===(t=(0,u.find)(r,(e=>{let{slug:t}=e;return o===t})))||void 0===t?void 0:t.fontFamily;return(0,s.createElement)(lh,{className:"block-editor-hooks-font-family-control",fontFamilies:r,value:l,onChange:function(e){const t=(0,u.find)(r,(t=>{let{fontFamily:n}=t;return n===e}));n({fontFamily:null==t?void 0:t.slug})}})}function ch(e){let{name:t}=e;const n=Co("typography.fontFamilies");return!n||0===n.length||!(0,r.hasBlockSupport)(t,ih)}(0,l.addFilter)("blocks.registerBlockType","core/fontFamily/addAttribute",(function(e){return(0,r.hasBlockSupport)(e,ih)?(e.attributes.fontFamily||Object.assign(e.attributes,{fontFamily:{type:"string"}}),e):e})),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/fontFamily/addSaveProps",sh),(0,l.addFilter)("blocks.registerBlockType","core/fontFamily/addEditProps",(function(e){if(!(0,r.hasBlockSupport)(e,ih))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),sh(o,e,n)},e}));const uh=(e,t,n)=>{if(t){const n=(0,u.find)(e,{slug:t});if(n)return n}return{size:n}};function dh(e,t){return(0,u.find)(e,{size:t})||{size:t}}function ph(e){if(e)return`has-${(0,u.kebabCase)(e)}-font-size`}var mh=function(e){const t=Co("typography.fontSizes"),n=!Co("typography.customFontSize");return(0,s.createElement)(p.FontSizePicker,i({},e,{fontSizes:t,disableCustomFontSizes:n}))};const fh="typography.fontSize";function gh(e,t,n){if(!(0,r.hasBlockSupport)(t,fh))return e;if(To(t,zh,"fontSize"))return e;const o=new(um())(e.className);o.add(ph(n.fontSize));const l=o.value;return e.className=l||void 0,e}function hh(e){var t,n;const{attributes:{fontSize:o,style:r},setAttributes:l}=e,i=Co("typography.fontSizes"),a=uh(i,o,null==r||null===(t=r.typography)||void 0===t?void 0:t.fontSize),c=(null==a?void 0:a.size)||(null==r||null===(n=r.typography)||void 0===n?void 0:n.fontSize)||o;return(0,s.createElement)(mh,{onChange:e=>{const t=dh(i,e).slug;l({style:Bo({...r,typography:{...null==r?void 0:r.typography,fontSize:t?void 0:e}}),fontSize:t})},value:c,withReset:!1})}function vh(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=Co("typography.fontSizes"),n=!(null==t||!t.length);return!(0,r.hasBlockSupport)(e,fh)||!n}const bh=(0,d.createHigherOrderComponent)((e=>t=>{var n,o;const l=Co("typography.fontSizes"),{name:i,attributes:{fontSize:a,style:c},wrapperProps:u}=t;if(!(0,r.hasBlockSupport)(i,fh)||To(i,zh,"fontSize")||!a||null!=c&&null!==(n=c.typography)&&void 0!==n&&n.fontSize)return(0,s.createElement)(e,t);const d=uh(l,a,null==c||null===(o=c.typography)||void 0===o?void 0:o.fontSize).size,p={...t,wrapperProps:{...u,style:{fontSize:d,...null==u?void 0:u.style}}};return(0,s.createElement)(e,p)}),"withFontSizeInlineStyles"),kh={fontSize:[["fontSize"],["style","typography","fontSize"]]};(0,l.addFilter)("blocks.registerBlockType","core/font/addAttribute",(function(e){return(0,r.hasBlockSupport)(e,fh)?(e.attributes.fontSize||Object.assign(e.attributes,{fontSize:{type:"string"}}),e):e})),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/font/addSaveProps",gh),(0,l.addFilter)("blocks.registerBlockType","core/font/addEditProps",(function(e){if(!(0,r.hasBlockSupport)(e,fh))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),gh(o,e,n)},e})),(0,l.addFilter)("editor.BlockListBlock","core/font-size/with-font-size-inline-styles",bh),(0,l.addFilter)("blocks.switchToBlockType.transformedBlock","core/font-size/addTransforms",(function(e,t,n,o){const l=e.name;return xo({fontSize:(0,r.hasBlockSupport)(l,fh)},kh,e,t,n,o)}));var _h=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M7 18v1h10v-1H7zm5-2c1.5 0 2.6-.4 3.4-1.2.8-.8 1.1-2 1.1-3.5V5H15v5.8c0 1.2-.2 2.1-.6 2.8-.4.7-1.2 1-2.4 1s-2-.3-2.4-1c-.4-.7-.6-1.6-.6-2.8V5H7.5v6.2c0 1.5.4 2.7 1.1 3.5.8.9 1.9 1.3 3.4 1.3z"})),yh=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M9.1 9v-.5c0-.6.2-1.1.7-1.4.5-.3 1.2-.5 2-.5.7 0 1.4.1 2.1.3.7.2 1.4.5 2.1.9l.2-1.9c-.6-.3-1.2-.5-1.9-.7-.8-.1-1.6-.2-2.4-.2-1.5 0-2.7.3-3.6 1-.8.7-1.2 1.5-1.2 2.6V9h2zM20 12H4v1h8.3c.3.1.6.2.8.3.5.2.9.5 1.1.8.3.3.4.7.4 1.2 0 .7-.2 1.1-.8 1.5-.5.3-1.2.5-2.1.5-.8 0-1.6-.1-2.4-.3-.8-.2-1.5-.5-2.2-.8L7 18.1c.5.2 1.2.4 2 .6.8.2 1.6.3 2.4.3 1.7 0 3-.3 3.9-1 .9-.7 1.3-1.6 1.3-2.8 0-.9-.2-1.7-.7-2.2H20v-1z"}));const Eh=[{name:(0,g.__)("Underline"),value:"underline",icon:_h},{name:(0,g.__)("Strikethrough"),value:"line-through",icon:yh}];function Ch(e){let{value:t,onChange:n}=e;return(0,s.createElement)("fieldset",{className:"block-editor-text-decoration-control"},(0,s.createElement)("legend",null,(0,g.__)("Decoration")),(0,s.createElement)("div",{className:"block-editor-text-decoration-control__buttons"},Eh.map((e=>(0,s.createElement)(p.Button,{key:e.value,icon:e.icon,isSmall:!0,isPressed:e.value===t,onClick:()=>n(e.value===t?void 0:e.value),"aria-label":e.name})))))}const Sh="typography.__experimentalTextDecoration";function wh(e){var t;const{attributes:{style:n},setAttributes:o}=e;return(0,s.createElement)(Ch,{value:null==n||null===(t=n.typography)||void 0===t?void 0:t.textDecoration,onChange:function(e){o({style:Bo({...n,typography:{...null==n?void 0:n.typography,textDecoration:e}})})}})}function Bh(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!(0,r.hasBlockSupport)(e,Sh),n=Co("typography.textDecoration");return t||!n}var Ih=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M6.1 6.8L2.1 18h1.6l1.1-3h4.3l1.1 3h1.6l-4-11.2H6.1zm-.8 6.8L7 8.9l1.7 4.7H5.3zm15.1-.7c-.4-.5-.9-.8-1.6-1 .4-.2.7-.5.8-.9.2-.4.3-.9.3-1.4 0-.9-.3-1.6-.8-2-.6-.5-1.3-.7-2.4-.7h-3.5V18h4.2c1.1 0 2-.3 2.6-.8.6-.6 1-1.4 1-2.4-.1-.8-.3-1.4-.6-1.9zm-5.7-4.7h1.8c.6 0 1.1.1 1.4.4.3.2.5.7.5 1.3 0 .6-.2 1.1-.5 1.3-.3.2-.8.4-1.4.4h-1.8V8.2zm4 8c-.4.3-.9.5-1.5.5h-2.6v-3.8h2.6c1.4 0 2 .6 2 1.9.1.6-.1 1-.5 1.4z"})),xh=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M11 16.8c-.1-.1-.2-.3-.3-.5v-2.6c0-.9-.1-1.7-.3-2.2-.2-.5-.5-.9-.9-1.2-.4-.2-.9-.3-1.6-.3-.5 0-1 .1-1.5.2s-.9.3-1.2.6l.2 1.2c.4-.3.7-.4 1.1-.5.3-.1.7-.2 1-.2.6 0 1 .1 1.3.4.3.2.4.7.4 1.4-1.2 0-2.3.2-3.3.7s-1.4 1.1-1.4 2.1c0 .7.2 1.2.7 1.6.4.4 1 .6 1.8.6.9 0 1.7-.4 2.4-1.2.1.3.2.5.4.7.1.2.3.3.6.4.3.1.6.1 1.1.1h.1l.2-1.2h-.1c-.4.1-.6 0-.7-.1zM9.2 16c-.2.3-.5.6-.9.8-.3.1-.7.2-1.1.2-.4 0-.7-.1-.9-.3-.2-.2-.3-.5-.3-.9 0-.6.2-1 .7-1.3.5-.3 1.3-.4 2.5-.5v2zm10.6-3.9c-.3-.6-.7-1.1-1.2-1.5-.6-.4-1.2-.6-1.9-.6-.5 0-.9.1-1.4.3-.4.2-.8.5-1.1.8V6h-1.4v12h1.3l.2-1c.2.4.6.6 1 .8.4.2.9.3 1.4.3.7 0 1.2-.2 1.8-.5.5-.4 1-.9 1.3-1.5.3-.6.5-1.3.5-2.1-.1-.6-.2-1.3-.5-1.9zm-1.7 4c-.4.5-.9.8-1.6.8s-1.2-.2-1.7-.7c-.4-.5-.7-1.2-.7-2.1 0-.9.2-1.6.7-2.1.4-.5 1-.7 1.7-.7s1.2.3 1.6.8c.4.5.6 1.2.6 2s-.2 1.4-.6 2z"})),Th=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M7.1 6.8L3.1 18h1.6l1.1-3h4.3l1.1 3h1.6l-4-11.2H7.1zm-.8 6.8L8 8.9l1.7 4.7H6.3zm14.5-1.5c-.3-.6-.7-1.1-1.2-1.5-.6-.4-1.2-.6-1.9-.6-.5 0-.9.1-1.4.3-.4.2-.8.5-1.1.8V6h-1.4v12h1.3l.2-1c.2.4.6.6 1 .8.4.2.9.3 1.4.3.7 0 1.2-.2 1.8-.5.5-.4 1-.9 1.3-1.5.3-.6.5-1.3.5-2.1-.1-.6-.2-1.3-.5-1.9zm-1.7 4c-.4.5-.9.8-1.6.8s-1.2-.2-1.7-.7c-.4-.5-.7-1.2-.7-2.1 0-.9.2-1.6.7-2.1.4-.5 1-.7 1.7-.7s1.2.3 1.6.8c.4.5.6 1.2.6 2 .1.8-.2 1.4-.6 2z"}));const Nh=[{name:(0,g.__)("Uppercase"),value:"uppercase",icon:Ih},{name:(0,g.__)("Lowercase"),value:"lowercase",icon:xh},{name:(0,g.__)("Capitalize"),value:"capitalize",icon:Th}];function Ph(e){let{value:t,onChange:n}=e;return(0,s.createElement)("fieldset",{className:"block-editor-text-transform-control"},(0,s.createElement)("legend",null,(0,g.__)("Letter case")),(0,s.createElement)("div",{className:"block-editor-text-transform-control__buttons"},Nh.map((e=>(0,s.createElement)(p.Button,{key:e.value,icon:e.icon,isSmall:!0,isPressed:t===e.value,"aria-label":e.name,onClick:()=>n(t===e.value?void 0:e.value)})))))}const Mh="typography.__experimentalTextTransform";function Rh(e){var t;const{attributes:{style:n},setAttributes:o}=e;return(0,s.createElement)(Ph,{value:null==n||null===(t=n.typography)||void 0===t?void 0:t.textTransform,onChange:function(e){o({style:Bo({...n,typography:{...null==n?void 0:n.typography,textTransform:e}})})}})}function Lh(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!(0,r.hasBlockSupport)(e,Mh),n=Co("typography.textTransform");return t||!n}function Ah(e){let{value:t,onChange:n,__unstableInputWidth:o="60px"}=e;const r=(0,p.__experimentalUseCustomUnits)({availableUnits:Co("spacing.units")||["px","em","rem"],defaultValues:{px:2,em:.2,rem:.2}});return(0,s.createElement)(p.__experimentalUnitControl,{label:(0,g.__)("Letter spacing"),value:t,__unstableInputWidth:o,units:r,onChange:n})}const Dh="typography.__experimentalLetterSpacing";function Oh(e){var t;const{attributes:{style:n},setAttributes:o}=e;return(0,s.createElement)(Ah,{value:null==n||null===(t=n.typography)||void 0===t?void 0:t.letterSpacing,onChange:function(e){o({style:Bo({...n,typography:{...null==n?void 0:n.typography,letterSpacing:e}})})},__unstableInputWidth:"100%"})}function Fh(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!(0,r.hasBlockSupport)(e,Dh),n=Co("typography.letterSpacing");return t||!n}const zh="typography",Vh=[Qg,fh,Jg,eh,ih,Sh,Mh,Dh];function Hh(e){const{clientId:t}=e,n=ch(e),o=vh(e),l=rh(e),i=Xg(e),a=Bh(e),c=Lh(e),u=Fh(e),d=!nh(e),m=!oh(e),f=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=[rh(e),vh(e),Xg(e),ch(e),Bh(e),Lh(e),Fh(e)];return t.filter(Boolean).length===t.length}(e),h=Gh(e.name);if(f||!h)return null;const v=(0,r.getBlockSupport)(e.name,[zh,"__experimentalDefaultControls"]),b=e=>t=>{var n;return{...t,style:{...t.style,typography:{...null===(n=t.style)||void 0===n?void 0:n.typography,[e]:void 0}}}};return(0,s.createElement)(Ao,{__experimentalGroup:"typography"},!n&&(0,s.createElement)(p.__experimentalToolsPanelItem,{hasValue:()=>function(e){return!!e.attributes.fontFamily}(e),label:(0,g.__)("Font family"),onDeselect:()=>function(e){let{setAttributes:t}=e;t({fontFamily:void 0})}(e),isShownByDefault:null==v?void 0:v.fontFamily,resetAllFilter:e=>({...e,fontFamily:void 0}),panelId:t},(0,s.createElement)(ah,e)),!o&&(0,s.createElement)(p.__experimentalToolsPanelItem,{hasValue:()=>function(e){var t;const{fontSize:n,style:o}=e.attributes;return!!n||!(null==o||null===(t=o.typography)||void 0===t||!t.fontSize)}(e)
|
72 |
-
/* translators: Ensure translation is distinct from "Letter case" */,label:(0,g.__)("Font size"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({fontSize:void 0,style:
|
73 |
-
/* translators: Ensure translation is distinct from "Font size" */,label:(0,g.__)("Letter case"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:Bo({...o,typography:{...null==o?void 0:o.typography,textTransform:void 0}})})}(e),isShownByDefault:null==v?void 0:v.textTransform,resetAllFilter:b("textTransform"),panelId:t},(0,s.createElement)(Rh,e)),!u&&(0,s.createElement)(p.__experimentalToolsPanelItem,{className:"single-column",hasValue:()=>function(e){var t,n;return!(null===(t=e.attributes.style)||void 0===t||null===(n=t.typography)||void 0===n||!n.letterSpacing)}(e),label:(0,g.__)("Letter spacing"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:Bo({...o,typography:{...null==o?void 0:o.typography,letterSpacing:void 0}})})}(e),isShownByDefault:null==v?void 0:v.letterSpacing,resetAllFilter:b("letterSpacing"),panelId:t},(0,s.createElement)(Oh,e)))}const Gh=e=>Vh.some((t=>(0,r.hasBlockSupport)(e,t))),Uh=[...Vh,eg,Tg,qo],Wh=e=>Uh.some((t=>(0,r.hasBlockSupport)(e,t))),$h="var:";function jh(e){var t;return null!=e&&null!==(t=e.startsWith)&&void 0!==t&&t.call(e,$h)?`var(--wp--${e.slice($h.length).split("|").join("--")})`:e}function Kh(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=["spacing.blockGap"],n={};Object.keys(r.__EXPERIMENTAL_STYLE_PROPERTY).forEach((o=>{const l=r.__EXPERIMENTAL_STYLE_PROPERTY[o].value,i=r.__EXPERIMENTAL_STYLE_PROPERTY[o].properties;if((0,u.has)(e,l)&&"elements"!==(null==l?void 0:l[0])){const s=(0,u.get)(e,l);r.__EXPERIMENTAL_STYLE_PROPERTY[o].useEngine||(i&&"string"!=typeof s?Object.entries(i).forEach((e=>{const[t,o]=e,r=(0,u.get)(s,[o]);r&&(n[t]=jh(r))})):t.includes(l.join("."))||(n[o]=jh((0,u.get)(e,l))))}}));const o=al(e);return o.forEach((e=>{n[e.key]=e.value})),n}const qh={"__experimentalBorder.__experimentalSkipSerialization":["border"],"color.__experimentalSkipSerialization":[Tg],[`${zh}.__experimentalSkipSerialization`]:[zh],[`${qo}.__experimentalSkipSerialization`]:["spacing"]},Yh={...qh,[`${qo}`]:["spacing.blockGap"]},Qh={gradients:"gradient"};function Zh(e,t,n){let o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Yh;if(!Wh(t))return e;let{style:l}=n;return Object.entries(o).forEach((e=>{let[n,o]=e;const i=(0,r.getBlockSupport)(t,n);!0===i&&(l=(0,u.omit)(l,o)),Array.isArray(i)&&i.forEach((e=>{const t=Qh[e]||e;l=(0,u.omit)(l,[[...o,t]])}))})),e.style={...Kh(l),...e.style},e}const Xh=(0,d.createHigherOrderComponent)((e=>t=>{const n=to();return(0,s.createElement)(s.Fragment,null,n&&(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Gg,t),(0,s.createElement)(Hh,t),(0,s.createElement)(ig,t),(0,s.createElement)(Zo,t)),(0,s.createElement)(e,t))}),"withToolbarControls"),Jh=(0,d.createHigherOrderComponent)((e=>t=>{var n,o;const l=`wp-elements-${(0,d.useInstanceId)(e)}`,a=To(t.name,Tg,"link")?(0,u.omit)(null===(n=t.attributes.style)||void 0===n?void 0:n.elements,["link"]):null===(o=t.attributes.style)||void 0===o?void 0:o.elements,p=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object.entries(t).map((t=>{let[n,o]=t;const l=Kh(o);return(0,u.isEmpty)(l)?"":[`.editor-styles-wrapper .${e} ${r.__EXPERIMENTAL_ELEMENTS[n]}{`,...Object.entries(l).map((e=>{let[t,n]=e;return`\t${(0,u.kebabCase)(t)}: ${n};`})),"}"].join("\n")})).join("\n")}(l,a),m=(0,s.useContext)(Mf.__unstableElementContext);return(0,s.createElement)(s.Fragment,null,a&&m&&(0,s.createPortal)((0,s.createElement)("style",{dangerouslySetInnerHTML:{__html:p}}),m),(0,s.createElement)(e,i({},t,{className:a?c()(t.className,l):t.className})))}));(0,l.addFilter)("blocks.registerBlockType","core/style/addAttribute",(function(e){return Wh(e)?(e.attributes.style||Object.assign(e.attributes,{style:{type:"object"}}),e):e})),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/style/addSaveProps",Zh),(0,l.addFilter)("blocks.registerBlockType","core/style/addEditProps",(function(e){if(!Wh(e))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),Zh(o,e,n,qh)},e})),(0,l.addFilter)("editor.BlockEdit","core/style/with-block-controls",Xh),(0,l.addFilter)("editor.BlockListBlock","core/editor/with-elements-styles",Jh),(0,l.addFilter)("blocks.registerBlockType","core/settings/addAttribute",(function(e){var t,n;return n=e,(0,r.hasBlockSupport)(n,"__experimentalSettings",!1)?(null!=e&&null!==(t=e.attributes)&&void 0!==t&&t.settings||(e.attributes={...e.attributes,settings:{type:"object"}}),e):e}));var ev=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M12 4 4 19h16L12 4zm0 3.2 5.5 10.3H12V7.2z"})),tv=function(e){let{colorPalette:t,duotonePalette:n,disableCustomColors:o,disableCustomDuotone:r,value:l,onChange:i}=e;return(0,s.createElement)(p.Dropdown,{popoverProps:{className:"block-editor-duotone-control__popover",headerTitle:(0,g.__)("Duotone"),isAlternate:!0},renderToggle:e=>{let{isOpen:t,onToggle:n}=e;return(0,s.createElement)(p.ToolbarButton,{showTooltip:!0,onClick:n,"aria-haspopup":"true","aria-expanded":t,onKeyDown:e=>{t||e.keyCode!==Sc.DOWN||(e.preventDefault(),n())},label:(0,g.__)("Apply duotone filter"),icon:l?(0,s.createElement)(p.DuotoneSwatch,{values:l}):(0,s.createElement)(Br,{icon:ev})})},renderContent:()=>(0,s.createElement)(p.MenuGroup,{label:(0,g.__)("Duotone")},(0,s.createElement)("div",{className:"block-editor-duotone-control__description"},(0,g.__)("Create a two-tone color effect without losing your original image.")),(0,s.createElement)(p.DuotonePicker,{colorPalette:t,duotonePalette:n,disableCustomColors:o,disableCustomDuotone:r,value:l,onChange:i}))})};const nv=[];function ov(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t={r:[],g:[],b:[],a:[]};return e.forEach((e=>{const n=Lu(e).toRgb();t.r.push(n.r/255),t.g.push(n.g/255),t.b.push(n.b/255),t.a.push(n.a)})),t}function rv(e){let{selector:t,id:n}=e;const o=`\n${t} {\n\tfilter: url( #${n} );\n}\n`;return(0,s.createElement)("style",null,o)}function lv(e){let{id:t,values:n}=e;return(0,s.createElement)(p.SVG,{xmlnsXlink:"http://www.w3.org/1999/xlink",viewBox:"0 0 0 0",width:"0",height:"0",focusable:"false",role:"none",style:{visibility:"hidden",position:"absolute",left:"-9999px",overflow:"hidden"}},(0,s.createElement)("defs",null,(0,s.createElement)("filter",{id:t},(0,s.createElement)("feColorMatrix",{colorInterpolationFilters:"sRGB",type:"matrix",values:" .299 .587 .114 0 0 .299 .587 .114 0 0 .299 .587 .114 0 0 .299 .587 .114 0 0 "}),(0,s.createElement)("feComponentTransfer",{colorInterpolationFilters:"sRGB"},(0,s.createElement)("feFuncR",{type:"table",tableValues:n.r.join(" ")}),(0,s.createElement)("feFuncG",{type:"table",tableValues:n.g.join(" ")}),(0,s.createElement)("feFuncB",{type:"table",tableValues:n.b.join(" ")}),(0,s.createElement)("feFuncA",{type:"table",tableValues:n.a.join(" ")})),(0,s.createElement)("feComposite",{in2:"SourceGraphic",operator:"in"}))))}function iv(e){let{selector:t,id:n,values:o}=e;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(lv,{id:n,values:o}),(0,s.createElement)(rv,{id:n,selector:t}))}function sv(e){let{presetSetting:t,defaultSetting:n}=e;const o=!Co(n),r=Co(`${t}.custom`)||nv,l=Co(`${t}.theme`)||nv,i=Co(`${t}.default`)||nv;return(0,s.useMemo)((()=>[...r,...l,...o?nv:i]),[o,r,l,i])}function av(e){var t;let{attributes:n,setAttributes:o}=e;const r=null==n?void 0:n.style,l=null==r||null===(t=r.color)||void 0===t?void 0:t.duotone,i=sv({presetSetting:"color.duotone",defaultSetting:"color.defaultDuotone"}),a=sv({presetSetting:"color.palette",defaultSetting:"color.defaultPalette"}),c=!Co("color.custom"),u=!Co("color.customDuotone")||0===(null==a?void 0:a.length)&&c;return 0===(null==i?void 0:i.length)&&u?null:(0,s.createElement)(io,{group:"block",__experimentalShareWithChildBlocks:!0},(0,s.createElement)(tv,{duotonePalette:i,colorPalette:a,disableCustomDuotone:u,disableCustomColors:c,value:l,onChange:e=>{const t={...r,color:{...null==r?void 0:r.color,duotone:e}};o({style:t})}}))}Du([Ou]);const cv=(0,d.createHigherOrderComponent)((e=>t=>{const n=(0,r.hasBlockSupport)(t.name,"color.__experimentalDuotone");return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(e,t),n&&(0,s.createElement)(av,t))}),"withDuotoneControls"),uv=(0,d.createHigherOrderComponent)((e=>t=>{var n,o,l;const a=(0,r.getBlockSupport)(t.name,"color.__experimentalDuotone"),u=null==t||null===(n=t.attributes)||void 0===n||null===(o=n.style)||void 0===o||null===(l=o.color)||void 0===l?void 0:l.duotone;if(!a||!u)return(0,s.createElement)(e,t);const p=`wp-duotone-${(0,d.useInstanceId)(e)}`,m=function(e,t){const n=e.split(","),o=t.split(","),r=[];return n.forEach((e=>{o.forEach((t=>{r.push(`${e.trim()} ${t.trim()}`)}))})),r.join(", ")}(`.editor-styles-wrapper .${p}`,a),f=c()(null==t?void 0:t.className,p),g=(0,s.useContext)(Mf.__unstableElementContext);return(0,s.createElement)(s.Fragment,null,g&&(0,s.createPortal)((0,s.createElement)(iv,{selector:m,id:p,values:ov(u)}),g),(0,s.createElement)(e,i({},t,{className:f})))}),"withDuotoneStyles");function dv(e){let{preset:t}=e;return(0,s.createElement)(lv,{id:`wp-duotone-${t.slug}`,values:ov(t.colors)})}(0,l.addFilter)("blocks.registerBlockType","core/editor/duotone/add-attributes",(function(e){return(0,r.hasBlockSupport)(e,"color.__experimentalDuotone")?(e.attributes.style||Object.assign(e.attributes,{style:{type:"object"}}),e):e})),(0,l.addFilter)("editor.BlockEdit","core/editor/duotone/with-editor-controls",cv),(0,l.addFilter)("editor.BlockListBlock","core/editor/duotone/with-styles",uv);const pv="__experimentalLayout";function mv(e){let{setAttributes:t,attributes:n,name:o}=e;const{layout:l}=n,i=Co("layout"),a=(0,m.useSelect)((e=>{const{getSettings:t}=e(Qn);return t().supportsLayout}),[]),c=(0,r.getBlockSupport)(o,pv,{}),{allowSwitching:u,allowEditing:d=!0,allowInheriting:f=!0,default:h}=c;if(!d)return null;const v=!(!f||!i||null!=l&&l.type&&"default"!==(null==l?void 0:l.type)&&(null==l||!l.inherit)),b=l||h||{},{inherit:k=!1,type:_="default"}=b;if("default"===_&&!a)return null;const y=Nr(_),E=e=>t({layout:e});return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Ao,null,(0,s.createElement)(p.PanelBody,{title:(0,g.__)("Layout")},v&&(0,s.createElement)(p.ToggleControl,{label:(0,g.__)("Inherit default layout"),checked:!!k,onChange:()=>t({layout:{inherit:!k}})}),!k&&u&&(0,s.createElement)(fv,{type:_,onChange:e=>t({layout:{type:e}})}),!k&&y&&(0,s.createElement)(y.inspectorControls,{layout:b,onChange:E,layoutBlockSupport:c}))),!k&&y&&(0,s.createElement)(y.toolBarControls,{layout:b,onChange:E,layoutBlockSupport:c}))}function fv(e){let{type:t,onChange:n}=e;return(0,s.createElement)(p.ButtonGroup,null,Tr.map((e=>{let{name:o,label:r}=e;return(0,s.createElement)(p.Button,{key:o,isPressed:t===o,onClick:()=>n(o)},r)})))}const gv=(0,d.createHigherOrderComponent)((e=>t=>{const{name:n}=t;return[(0,r.hasBlockSupport)(n,pv)&&(0,s.createElement)(mv,i({key:"layout"},t)),(0,s.createElement)(e,i({key:"edit"},t))]}),"withInspectorControls"),hv=(0,d.createHigherOrderComponent)((e=>t=>{const{name:n,attributes:o}=t,l=(0,r.hasBlockSupport)(n,pv),a=(0,d.useInstanceId)(e),u=Co("layout")||{},p=(0,s.useContext)(Mf.__unstableElementContext),{layout:m}=o,{default:f}=(0,r.getBlockSupport)(n,pv)||{},g=null!=m&&m.inherit?u:m||f||{},h=c()(null==t?void 0:t.className,{[`wp-container-${a}`]:l});return(0,s.createElement)(s.Fragment,null,l&&p&&(0,s.createPortal)((0,s.createElement)(Ar,{blockName:n,selector:`.wp-container-${a}`,layout:g,style:null==o?void 0:o.style}),p),(0,s.createElement)(e,i({},t,{className:h})))}));function vv(e){var t;const n=(null===(t=e.style)||void 0===t?void 0:t.border)||{};return{className:ug(e)||void 0,style:Kh({border:n})}}function bv(e){const{colors:t}=Jf(),n=vv(e),{borderColor:o}=e;if(o){const e=rg({colors:t,namedColor:o});n.style.borderColor=e.color}return n}function kv(e){var t,n,o,r,l,i;const{backgroundColor:s,textColor:a,gradient:u,style:d}=e,p=Zf("background-color",s),m=Zf("color",a),f=pg(u),g=f||(null==d||null===(t=d.color)||void 0===t?void 0:t.gradient);return{className:c()(m,f,{[p]:!g&&!!p,"has-text-color":a||(null==d||null===(n=d.color)||void 0===n?void 0:n.text),"has-background":s||(null==d||null===(o=d.color)||void 0===o?void 0:o.background)||u||(null==d||null===(r=d.color)||void 0===r?void 0:r.gradient),"has-link-color":null==d||null===(l=d.elements)||void 0===l||null===(i=l.link)||void 0===i?void 0:i.color})||void 0,style:Kh({color:(null==d?void 0:d.color)||{}})}}(0,l.addFilter)("blocks.registerBlockType","core/layout/addAttribute",(function(e){return(0,u.has)(e.attributes,["layout","type"])||(0,r.hasBlockSupport)(e,pv)&&(e.attributes={...e.attributes,layout:{type:"object"}}),e})),(0,l.addFilter)("editor.BlockListBlock","core/editor/layout/with-layout-styles",hv),(0,l.addFilter)("editor.BlockEdit","core/editor/layout/with-inspector-controls",gv);const _v={};function yv(e){const{backgroundColor:t,textColor:n,gradient:o}=e,r=Co("color.palette.custom")||[],l=Co("color.palette.theme")||[],i=Co("color.palette.default")||[],a=Co("color.gradients")||_v,c=(0,s.useMemo)((()=>[...r||[],...l||[],...i||[]]),[r,l,i]),u=(0,s.useMemo)((()=>[...(null==a?void 0:a.custom)||[],...(null==a?void 0:a.theme)||[],...(null==a?void 0:a.default)||[]]),[a]),d=kv(e);if(t){const e=Yf(c,t);d.style.backgroundColor=e.color}if(o&&(d.style.background=mg(u,o)),n){const e=Yf(c,n);d.style.color=e.color}return d}function Ev(e){const{style:t}=e;return{style:Kh({spacing:(null==t?void 0:t.spacing)||{}})}}function Cv(e){const[t,n]=(0,s.useState)(e);return(0,s.useEffect)((()=>{e&&n(e)}),[e]),t}const Sv=e=>(0,d.createHigherOrderComponent)((t=>n=>(0,s.createElement)(t,i({},n,{colors:e}))),"withCustomColorPalette"),wv=()=>(0,d.createHigherOrderComponent)((e=>t=>{const n=Co("color.palette.custom"),o=Co("color.palette.theme"),r=Co("color.palette.default"),l=(0,s.useMemo)((()=>[...n||[],...o||[],...r||[]]),[n,o,r]);return(0,s.createElement)(e,i({},t,{colors:l}))}),"withEditorColorPalette");function Bv(e,t){const n=(0,u.reduce)(e,((e,t)=>({...e,...(0,u.isString)(t)?{[t]:(0,u.kebabCase)(t)}:t})),{});return(0,d.compose)([t,e=>class extends s.Component{constructor(e){super(e),this.setters=this.createSetters(),this.colorUtils={getMostReadableColor:this.getMostReadableColor.bind(this)},this.state={}}getMostReadableColor(e){const{colors:t}=this.props;return function(e,t){const n=Lu(t);return(0,u.maxBy)(e,(e=>{let{color:t}=e;return n.contrast(t)})).color}(t,e)}createSetters(){return(0,u.reduce)(n,((e,t,n)=>{const o=(0,u.upperFirst)(n),r=`custom${o}`;return e[`set${o}`]=this.createSetColor(n,r),e}),{})}createSetColor(e,t){return n=>{const o=Qf(this.props.colors,n);this.props.setAttributes({[e]:o&&o.slug?o.slug:void 0,[t]:o&&o.slug?void 0:n})}}static getDerivedStateFromProps(e,t){let{attributes:o,colors:r}=e;return(0,u.reduce)(n,((e,n,l)=>{const i=Yf(r,o[l],o[`custom${(0,u.upperFirst)(l)}`]),s=t[l];return(null==s?void 0:s.color)===i.color&&s?e[l]=s:e[l]={...i,class:Zf(n,i.slug)},e}),{})}render(){return(0,s.createElement)(e,i({},this.props,{colors:void 0},this.state,this.setters,{colorUtils:this.colorUtils}))}}])}function Iv(e){return function(){const t=Sv(e);for(var n=arguments.length,o=new Array(n),r=0;r<n;r++)o[r]=arguments[r];return(0,d.createHigherOrderComponent)(Bv(o,t),"withCustomColors")}}function xv(){const e=wv();for(var t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];return(0,d.createHigherOrderComponent)(Bv(n,e),"withColors")}const Tv=[];var Nv=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];const o=(0,u.reduce)(t,((e,t)=>(e[t]=`custom${(0,u.upperFirst)(t)}`,e)),{});return(0,d.createHigherOrderComponent)((0,d.compose)([(0,d.createHigherOrderComponent)((e=>t=>{const n=Co("typography.fontSizes")||Tv;return(0,s.createElement)(e,i({},t,{fontSizes:n}))}),"withFontSizes"),e=>class extends s.Component{constructor(e){super(e),this.setters=this.createSetters(),this.state={}}createSetters(){return(0,u.reduce)(o,((e,t,n)=>(e[`set${(0,u.upperFirst)(n)}`]=this.createSetFontSize(n,t),e)),{})}createSetFontSize(e,t){return n=>{const o=(0,u.find)(this.props.fontSizes,{size:Number(n)});this.props.setAttributes({[e]:o&&o.slug?o.slug:void 0,[t]:o&&o.slug?void 0:n})}}static getDerivedStateFromProps(e,t){let{attributes:n,fontSizes:r}=e;const l=(e,o)=>!t[o]||(n[o]?n[o]!==t[o].slug:t[o].size!==n[e]);if(!(0,u.some)(o,l))return null;const i=(0,u.reduce)((0,u.pickBy)(o,l),((e,t,o)=>{const l=n[o],i=uh(r,l,n[t]);return e[o]={...i,class:ph(l)},e}),{});return{...t,...i}}render(){return(0,s.createElement)(e,i({},this.props,{fontSizes:void 0},this.state,this.setters))}}]),"withFontSizes")},Pv=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M4 19.8h8.9v-1.5H4v1.5zm8.9-15.6H4v1.5h8.9V4.2zm-8.9 7v1.5h16v-1.5H4z"})),Mv=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M16.4 4.2H7.6v1.5h8.9V4.2zM4 11.2v1.5h16v-1.5H4zm3.6 8.6h8.9v-1.5H7.6v1.5z"})),Rv=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M11.1 19.8H20v-1.5h-8.9v1.5zm0-15.6v1.5H20V4.2h-8.9zM4 12.8h16v-1.5H4v1.5z"}));const Lv=[{icon:Pv,title:(0,g.__)("Align text left"),align:"left"},{icon:Mv,title:(0,g.__)("Align text center"),align:"center"},{icon:Rv,title:(0,g.__)("Align text right"),align:"right"}],Av={position:"bottom right",isAlternate:!0};var Dv=function(e){let{value:t,onChange:n,alignmentControls:o=Lv,label:r=(0,g.__)("Align"),describedBy:l=(0,g.__)("Change text alignment"),isCollapsed:a=!0,isToolbar:c}=e;function d(e){return()=>n(t===e?void 0:e)}const m=(0,u.find)(o,(e=>e.align===t)),f=c?p.ToolbarGroup:p.ToolbarDropdownMenu,h=c?{isCollapsed:a}:{};return(0,s.createElement)(f,i({icon:m?m.icon:(0,g.isRTL)()?Rv:Pv,label:r,toggleProps:{describedBy:l},popoverProps:Av,controls:o.map((e=>{const{align:n}=e,o=t===n;return{...e,isActive:o,role:a?"menuitemradio":void 0,onClick:d(n)}}))},h))};const Ov=e=>(0,s.createElement)(Dv,i({},e,{isToolbar:!1})),Fv=e=>(0,s.createElement)(Dv,i({},e,{isToolbar:!0}));var zv={name:"blocks",className:"block-editor-autocompleters__block",triggerPrefix:"/",useItems(e){const{rootClientId:t,selectedBlockName:n}=(0,m.useSelect)((e=>{const{getSelectedBlockClientId:t,getBlockName:n,getBlockInsertionPoint:o}=e(Qn),r=t();return{selectedBlockName:r?n(r):null,rootClientId:o().rootClientId}}),[]),[o,r,l]=xd(t,u.noop),i=(0,s.useMemo)((()=>(e.trim()?Xd(o,r,l,e):(0,u.orderBy)(o,["frecency"],["desc"])).filter((e=>e.name!==n)).slice(0,9)),[e,n,o,r,l]);return[(0,s.useMemo)((()=>i.map((e=>{const{title:t,icon:n,isDisabled:o}=e;return{key:`block-${e.id}`,value:e,label:(0,s.createElement)(s.Fragment,null,(0,s.createElement)(zc,{key:"icon",icon:n,showColors:!0}),t),isDisabled:o}}))),[i])]},allowContext:(e,t)=>!(/\S/.test(e)||/\S/.test(t)),getOptionCompletion(e){const{name:t,initialAttributes:n,innerBlocks:o}=e;return{action:"replace",value:(0,r.createBlock)(t,n,(0,r.createBlocksFromInnerBlocksTemplate)(o))}}},Vv=window.wp.apiFetch,Hv=n.n(Vv),Gv=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M7 5.5h10a.5.5 0 01.5.5v12a.5.5 0 01-.5.5H7a.5.5 0 01-.5-.5V6a.5.5 0 01.5-.5zM17 4H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V6a2 2 0 00-2-2zm-1 3.75H8v1.5h8v-1.5zM8 11h8v1.5H8V11zm6 3.25H8v1.5h6v-1.5z"})),Uv=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"m7.3 9.7 1.4 1.4c.2-.2.3-.3.4-.5 0 0 0-.1.1-.1.3-.5.4-1.1.3-1.6L12 7 9 4 7.2 6.5c-.6-.1-1.1 0-1.6.3 0 0-.1 0-.1.1-.3.1-.4.2-.6.4l1.4 1.4L4 11v1h1l2.3-2.3zM4 20h9v-1.5H4V20zm0-5.5V16h16v-1.5H4z"})),Wv={name:"links",className:"block-editor-autocompleters__link",triggerPrefix:"[[",options:async e=>{let t=await Hv()({path:(0,sp.addQueryArgs)("/wp/v2/search",{per_page:10,search:e,type:"post",order_by:"menu_order"})});return t=t.filter((e=>""!==e.title)),t},getOptionKeywords:e=>[...e.title.split(/\s+/)],getOptionLabel:e=>(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Br,{key:"icon",icon:"page"===e.subtype?Gv:Uv}),e.title),getOptionCompletion:e=>(0,s.createElement)("a",{href:e.url},e.title)};const $v=[];function jv(e){let{completers:t=$v}=e;const{name:n}=eo();return(0,s.useMemo)((()=>{let e=t;return(n===(0,r.getDefaultBlockName)()||(0,r.getBlockSupport)(n,"__experimentalSlashInserter",!1))&&(e=e.concat([zv,Wv])),(0,l.hasFilter)("editor.Autocomplete.completers")&&(e===t&&(e=e.map(u.clone)),e=(0,l.applyFilters)("editor.Autocomplete.completers",e,n)),e}),[t,n])}var Kv=function(e){return(0,s.createElement)(p.Autocomplete,i({},e,{completers:jv(e)}))},qv=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M4.2 9h1.5V5.8H9V4.2H4.2V9zm14 9.2H15v1.5h4.8V15h-1.5v3.2zM15 4.2v1.5h3.2V9h1.5V4.2H15zM5.8 15H4.2v4.8H9v-1.5H5.8V15z"})),Yv=function(e){let{isActive:t,label:n=(0,g.__)("Toggle full height"),onToggle:o,isDisabled:r}=e;return(0,s.createElement)(p.ToolbarButton,{isActive:t,icon:qv,label:n,onClick:()=>o(!t),disabled:r})},Qv=function(e){const{label:t=(0,g.__)("Change matrix alignment"),onChange:n=u.noop,value:o="center",isDisabled:r}=e,l=(0,s.createElement)(p.__experimentalAlignmentMatrixControl.Icon,{value:o});return(0,s.createElement)(p.Dropdown,{position:"bottom right",popoverProps:{isAlternate:!0},renderToggle:e=>{let{onToggle:n,isOpen:o}=e;return(0,s.createElement)(p.ToolbarButton,{onClick:n,"aria-haspopup":"true","aria-expanded":o,onKeyDown:e=>{o||e.keyCode!==Sc.DOWN||(e.preventDefault(),n())},label:t,icon:l,showTooltip:!0,disabled:r})},renderContent:()=>(0,s.createElement)(p.__experimentalAlignmentMatrixControl,{hasFocusBorder:!1,onChange:n,value:o})})},Zv=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M10.8622 8.04053L14.2805 12.0286L10.8622 16.0167L9.72327 15.0405L12.3049 12.0286L9.72327 9.01672L10.8622 8.04053Z"})),Xv=function(e){let{rootLabelText:t}=e;const{selectBlock:n,clearSelectedBlock:o}=(0,m.useDispatch)(Qn),{clientId:r,parents:l,hasSelection:i}=(0,m.useSelect)((e=>{const{getSelectionStart:t,getSelectedBlockClientId:n,getBlockParents:o}=e(Qn),r=n();return{parents:o(r),clientId:r,hasSelection:!!t().clientId}}),[]),a=t||(0,g.__)("Document");return(0,s.createElement)("ul",{className:"block-editor-block-breadcrumb",role:"list","aria-label":(0,g.__)("Block breadcrumb")},(0,s.createElement)("li",{className:i?void 0:"block-editor-block-breadcrumb__current","aria-current":i?void 0:"true"},i&&(0,s.createElement)(p.Button,{className:"block-editor-block-breadcrumb__button",variant:"tertiary",onClick:o},a),!i&&a,!!r&&(0,s.createElement)(Br,{icon:Zv,className:"block-editor-block-breadcrumb__separator"})),l.map((e=>(0,s.createElement)("li",{key:e},(0,s.createElement)(p.Button,{className:"block-editor-block-breadcrumb__button",variant:"tertiary",onClick:()=>n(e)},(0,s.createElement)(Fp,{clientId:e,maximumLength:35})),(0,s.createElement)(Br,{icon:Zv,className:"block-editor-block-breadcrumb__separator"})))),!!r&&(0,s.createElement)("li",{className:"block-editor-block-breadcrumb__current","aria-current":"true"},(0,s.createElement)(Fp,{clientId:r,maximumLength:35})))};function Jv(e){return(0,m.useSelect)((t=>{const{isBlockSelected:n,hasSelectedInnerBlock:o,canEditBlock:r}=t(Qn);return!r(e)||!n(e)&&!o(e,!0)}),[e])}const eb=()=>(0,s.createElement)(p.SVG,{xmlns:"https://www.w3.org/2000/svg",viewBox:"0 0 20 20"},(0,s.createElement)(p.Path,{d:"M7.434 5l3.18 9.16H8.538l-.692-2.184H4.628l-.705 2.184H2L5.18 5h2.254zm-1.13 1.904h-.115l-1.148 3.593H7.44L6.304 6.904zM14.348 7.006c1.853 0 2.9.876 2.9 2.374v4.78h-1.79v-.914h-.114c-.362.64-1.123 1.022-2.031 1.022-1.346 0-2.292-.826-2.292-2.108 0-1.27.972-2.006 2.71-2.107l1.696-.102V9.38c0-.584-.42-.914-1.18-.914-.667 0-1.112.228-1.264.647h-1.701c.12-1.295 1.307-2.107 3.066-2.107zm1.079 4.1l-1.416.09c-.793.056-1.18.342-1.18.844 0 .52.45.837 1.091.837.857 0 1.505-.545 1.505-1.256v-.515z"})),tb=e=>{let{style:t,className:n}=e;return(0,s.createElement)("div",{className:"block-library-colors-selector__icon-container"},(0,s.createElement)("div",{className:`${n} block-library-colors-selector__state-selection`,style:t},(0,s.createElement)(eb,null)))},nb=e=>{let{TextColor:t,BackgroundColor:n}=e;return e=>{let{onToggle:o,isOpen:r}=e;return(0,s.createElement)(p.ToolbarGroup,null,(0,s.createElement)(p.ToolbarButton,{className:"components-toolbar__control block-library-colors-selector__toggle",label:(0,g.__)("Open Colors Selector"),onClick:o,onKeyDown:e=>{r||e.keyCode!==Sc.DOWN||(e.preventDefault(),o())},icon:(0,s.createElement)(n,null,(0,s.createElement)(t,null,(0,s.createElement)(tb,null)))}))}};var ob=e=>{let{children:t,...n}=e;return H()("wp.blockEditor.BlockColorsStyleSelector",{alternative:"block supports API",since:"6.1",version:"6.3"}),(0,s.createElement)(p.Dropdown,{position:"bottom right",className:"block-library-colors-selector",contentClassName:"block-library-colors-selector__popover",renderToggle:nb(n),renderContent:()=>t})},rb=(0,s.createElement)(O.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(O.Path,{d:"M13.8 5.2H3v1.5h10.8V5.2zm-3.6 12v1.5H21v-1.5H10.2zm7.2-6H6.6v1.5h10.8v-1.5z"}));const lb=sc(p.__experimentalTreeGridRow);function ib(e){let{isSelected:t,position:n,level:o,rowCount:r,children:l,className:a,path:u,...d}=e;const p=uc({isSelected:t,adjustScrolling:!1,enableAnimation:!0,triggerAnimationOnChange:u});return(0,s.createElement)(lb,i({ref:p,className:c()("block-editor-list-view-leaf",a),level:o,positionInSet:n,setSize:r},d),l)}function sb(e){let{onClick:t}=e;return(0,s.createElement)("span",{className:"block-editor-list-view__expander",onClick:e=>t(e,{forceToggle:!0}),"aria-hidden":"true"},(0,s.createElement)(Br,{icon:Zv}))}var ab=(0,s.forwardRef)((function(e,t){let{className:n,block:{clientId:o},onClick:r,onToggleExpanded:l,tabIndex:i,onFocus:a,onDragStart:u,onDragEnd:d,draggable:m}=e;const f=Dp(o),{isLocked:g}=Um(o);return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.Button,{className:c()("block-editor-list-view-block-select-button",n),onClick:r,onKeyDown:function(e){e.keyCode!==Sc.ENTER&&e.keyCode!==Sc.SPACE||r(e)},ref:t,tabIndex:i,onFocus:a,onDragStart:e=>{e.dataTransfer.clearData(),null==u||u(e)},onDragEnd:d,draggable:m,href:`#block-${o}`,"aria-hidden":!0},(0,s.createElement)(sb,{onClick:l}),(0,s.createElement)(zc,{icon:null==f?void 0:f.icon,showColors:!0}),(0,s.createElement)("span",{className:"block-editor-list-view-block-select-button__title"},(0,s.createElement)(Fp,{clientId:o,maximumLength:35})),(null==f?void 0:f.anchor)&&(0,s.createElement)("span",{className:"block-editor-list-view-block-select-button__anchor"},f.anchor),g&&(0,s.createElement)("span",{className:"block-editor-list-view-block-select-button__lock"},(0,s.createElement)(Br,{icon:Gm}))))})),cb=(0,s.forwardRef)(((e,t)=>{let{onClick:n,onToggleExpanded:o,block:r,isSelected:l,position:a,siblingBlockCount:u,level:d,isExpanded:p,selectedClientIds:f,...g}=e;const{clientId:h}=r,{blockMovingClientId:v,selectedBlockInBlockEditor:b}=(0,m.useSelect)((e=>{const{hasBlockMovingClientId:t,getSelectedBlockClientId:n}=e(Qn);return{blockMovingClientId:t(),selectedBlockInBlockEditor:n()}}),[h]),k=v&&b===h,_=c()("block-editor-list-view-block-contents",{"is-dropping-before":k}),y=f.includes(h)?f:[h];return(0,s.createElement)(zp,{clientIds:y},(e=>{let{draggable:c,onDragStart:m,onDragEnd:f}=e;return(0,s.createElement)(ab,i({ref:t,className:_,block:r,onClick:n,onToggleExpanded:o,isSelected:l,position:a,siblingBlockCount:u,level:d,draggable:c,onDragStart:m,onDragEnd:f,isExpanded:p},g))}))}));const ub=(0,s.createContext)({}),db=()=>(0,s.useContext)(ub);var pb=(0,s.memo)((function e(t){let{block:n,isDragged:o,isSelected:l,isBranchSelected:i,selectBlock:a,position:u,level:f,rowCount:h,siblingBlockCount:v,showBlockMovers:b,path:k,isExpanded:_,selectedClientIds:y,preventAnnouncement:E}=t;const C=(0,s.useRef)(null),[S,w]=(0,s.useState)(!1),{clientId:B}=n,I=l&&y[0]===B,x=l&&y[y.length-1]===B,{toggleBlockHighlight:T}=(0,m.useDispatch)(Qn),N=Dp(B),P=(0,m.useSelect)((e=>e(Qn).getBlockName(B)),[B]),M=(0,r.hasBlockSupport)(P,"__experimentalToolbar",!0),{isLocked:R}=Um(B),L=`list-view-block-select-button__${(0,d.useInstanceId)(e)}`,A=((e,t,n)=>(0,g.sprintf)(
|
74 |
/* translators: 1: The numerical position of the block. 2: The total number of blocks. 3. The level of nesting for the block. */
|
75 |
-
(0,g.__)("Block %1$d of %2$d, Level %3$d"),e,t,n))(u,v,f);let D=(0,g.__)("Link");N&&(D=
|
76 |
(0,g.__)("%s link (locked)"),N.title):(0,g.sprintf)(// translators: %s: The title of the block. This string indicates a link to select the block.
|
77 |
(0,g.__)("%s link"),N.title));const O=N?(0,g.sprintf)(// translators: %s: The title of the block.
|
78 |
-
(0,g.__)("Options for %s block"),N.title):(0,g.__)("Options"),{isTreeGridMounted:F,expand:z,collapse:V}=
|
79 |
/* translators: %s: block name */
|
80 |
(0,g.__)("%s deselected."),e))}else w.length>1&&(B=(0,g.sprintf)(
|
81 |
/* translators: %s: number of deselected blocks */
|
82 |
-
(0,g.__)("%s blocks deselected."),w.length));B&&(0,Ht.speak)(B)}),[e,o,f,l,i,a,c,d,p,t,n])}}(),[b,k]=(0,s.useReducer)(
|
83 |
-
/* translators: button label text should, if possible, be under 16 characters. */,label:(0,g.__)("List view"),className:"block-editor-block-navigation","aria-disabled":!t}))}var
|
84 |
/* translators: %s: Name of the block variation */
|
85 |
-
(0,g.__)("Transform to %s"),e.title),onClick:()=>n(e.name),"aria-label":e.title,showTooltip:!0}))))}function Hb(e){let{className:t,onSelectVariation:n,selectedValue:o,variations:r}=e;const l=r.map((e=>{let{name:t,title:n,description:o}=e;return{value:t,label:n,info:o}}));return(0,s.createElement)(p.DropdownMenu,{className:t,label:(0,g.__)("Transform to variation"),text:(0,g.__)("Transform to variation"),popoverProps:{position:"bottom center",className:`${t}__popover`},icon:jp,toggleProps:{iconPosition:"right"}},(()=>(0,s.createElement)("div",{className:`${t}__container`},(0,s.createElement)(p.MenuGroup,null,(0,s.createElement)(p.MenuItemsChoice,{choices:l,value:o,onSelect:n})))))}var Gb=function(e){let{blockClientId:t}=e;const{updateBlockAttributes:n}=(0,m.useDispatch)(Qn),{activeBlockVariation:o,variations:l}=(0,m.useSelect)((e=>{const{getActiveBlockVariation:n,getBlockVariations:o}=e(r.store),{getBlockName:l,getBlockAttributes:i}=e(Qn),s=t&&l(t);return{activeBlockVariation:n(s,i(t)),variations:s&&o(s,"transform")}}),[t]),i=null==o?void 0:o.name,a=(0,s.useMemo)((()=>{const e=new Set;return l.forEach((t=>{t.icon&&e.add(t.icon)})),e.size===l.length}),[l]);if(null==l||!l.length)return null;const c=a?Vb:Hb;return(0,s.createElement)(c,{className:"block-editor-block-variation-transforms",onSelectVariation:e=>{n(t,{...l.find((t=>{let{name:n}=t;return n===e})).attributes})},selectedValue:i,variations:l})},Ub=(0,d.createHigherOrderComponent)((e=>t=>{const n=Co("color.palette"),o=!Co("color.custom"),r=void 0===t.colors?n:t.colors,l=void 0===t.disableCustomColors?o:t.disableCustomColors,a=!(0,u.isEmpty)(r)||!l;return(0,s.createElement)(e,i({},t,{colors:r,disableCustomColors:l,hasColorsToChoose:a}))}),"withColorContext"),Wb=Ub(p.ColorPalette);function $b(e){let{onChange:t,value:n,...o}=e;return(0,s.createElement)(_g,i({},o,{onColorChange:t,colorValue:n,gradients:[],disableCustomGradients:!0}))}var jb=window.wp.date;const Kb=new Date(2022,0,25);function qb(e){let{format:t,defaultFormat:n,onChange:o}=e;return(0,s.createElement)("fieldset",{className:"block-editor-date-format-picker"},(0,s.createElement)(p.VisuallyHidden,{as:"legend"},(0,g.__)("Date format")),(0,s.createElement)(p.ToggleControl,{label:(0,s.createElement)(s.Fragment,null,(0,g.__)("Default format"),(0,s.createElement)("span",{className:"block-editor-date-format-picker__default-format-toggle-control__hint"},(0,jb.dateI18n)(n,Kb))),checked:!t,onChange:e=>o(e?null:n)}),t&&(0,s.createElement)(Yb,{format:t,onChange:o}))}function Yb(e){var t;let{format:n,onChange:o}=e;const r=(0,u.uniq)(["Y-m-d",(0,g._x)("n/j/Y","short date format"),(0,g._x)("n/j/Y g:i A","short date format with time"),(0,g._x)("M j, Y","medium date format"),(0,g._x)("M j, Y g:i A","medium date format with time"),(0,g._x)("F j, Y","long date format")]),l=r.map(((e,t)=>({key:`suggested-${t}`,name:(0,jb.dateI18n)(e,Kb),format:e}))),i={key:"custom",name:(0,g.__)("Custom"),className:"block-editor-date-format-picker__custom-format-select-control__custom-option",__experimentalHint:(0,g.__)("Enter your own date format")},[a,c]=(0,s.useState)((()=>!!n&&!r.includes(n)));return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.BaseControl,{className:"block-editor-date-format-picker__custom-format-select-control"},(0,s.createElement)(p.CustomSelectControl,{label:(0,g.__)("Choose a format"),options:[...l,i],value:a?i:null!==(t=l.find((e=>e.format===n)))&&void 0!==t?t:i,onChange:e=>{let{selectedItem:t}=e;t===i?c(!0):(c(!1),o(t.format))}})),a&&(0,s.createElement)(p.TextControl,{label:(0,g.__)("Custom format"),hideLabelFromVision:!0,help:(0,s.createInterpolateElement)((0,g.__)("Enter a date or time <Link>format string</Link>."),{Link:(0,s.createElement)(p.ExternalLink,{href:(0,g.__)("https://wordpress.org/support/article/formatting-date-and-time/")})}),value:n,onChange:e=>o(e)}))}
|
86 |
-
// translators: first %s: The type of color or gradient (e.g. background, overlay...), second %s: the color name or value (e.g. red or #ff0000)
|
87 |
-
const Qb=(0,g.__)("(%s: color %s)"),Zb=(0,g.__)("(%s: gradient %s)"),Xb=["colors","disableCustomColors","gradients","disableCustomGradients"],Jb=e=>{let{colors:t,gradients:n,settings:o}=e;return o.map(((e,o)=>{let r,{colorValue:l,gradientValue:i,label:a,colors:c,gradients:u}=e;if(!l&&!i)return null;if(l){const e=Qf(c||t,l);r=(0,g.sprintf)(Qb,a.toLowerCase(),e&&e.name||l)}else{const e=fg(u||n,l);r=(0,g.sprintf)(Zb,a.toLowerCase(),e&&e.name||i)}return(0,s.createElement)(p.ColorIndicator,{key:o,colorValue:l||i,"aria-label":r})}))},ek=e=>{let{className:t,colors:n,gradients:o,disableCustomColors:r,disableCustomGradients:l,children:a,settings:d,title:m,showTitle:f=!0,__experimentalHasMultipleOrigins:g,__experimentalIsRenderedInSidebar:h,enableAlpha:v,...b}=e;if((0,u.isEmpty)(n)&&(0,u.isEmpty)(o)&&r&&l&&(0,u.every)(d,(e=>(0,u.isEmpty)(e.colors)&&(0,u.isEmpty)(e.gradients)&&(void 0===e.disableCustomColors||e.disableCustomColors)&&(void 0===e.disableCustomGradients||e.disableCustomGradients))))return null;const k=(0,s.createElement)("span",{className:"block-editor-panel-color-gradient-settings__panel-title"},m,(0,s.createElement)(Jb,{colors:n,gradients:o,settings:d}));return(0,s.createElement)(p.PanelBody,i({className:c()("block-editor-panel-color-gradient-settings",t),title:f?k:void 0},b),(0,s.createElement)(wg,{settings:d,colors:n,gradients:o,disableCustomColors:r,disableCustomGradients:l,__experimentalHasMultipleOrigins:g,__experimentalIsRenderedInSidebar:h,enableAlpha:v}),!!a&&(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.__experimentalSpacer,{marginY:4})," ",a))},tk=e=>{const t=Xf();return t.colors=Co("color.palette"),t.gradients=Co("color.gradients"),(0,s.createElement)(ek,i({},t,e))},nk=e=>{const t=Jf();return(0,s.createElement)(ek,i({},t,e))};// translators: first %s: The type of color or gradient (e.g. background, overlay...), second %s: the color name or value (e.g. red or #ff0000)
|
88 |
-
var ok=e=>(0,u.every)(Xb,(t=>e.hasOwnProperty(t)))?(0,s.createElement)(ek,e):e.__experimentalHasMultipleOrigins?(0,s.createElement)(nk,e):(0,s.createElement)(tk,e),rk=function(e,t){return(rk=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},lk=function(){return(lk=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)};function ik(e,t,n,o){void 0===o&&(o=0);var r=vk(e,t,o),l=r.width,i=r.height;return e>=t*n&&l>t*n?{width:t*n,height:t}:l>t*n?{width:e,height:e/n}:l>i*n?{width:i*n,height:i}:{width:l,height:l/n}}function sk(e,t,n,o,r){void 0===r&&(r=0);var l=vk(t.width,t.height,r),i=l.width,s=l.height;return{x:ak(e.x,i,n.width,o),y:ak(e.y,s,n.height,o)}}function ak(e,t,n,o){var r=t*o/2-n/2;return Math.min(r,Math.max(e,-r))}function ck(e,t){return Math.sqrt(Math.pow(e.y-t.y,2)+Math.pow(e.x-t.x,2))}function uk(e,t){return 180*Math.atan2(t.y-e.y,t.x-e.x)/Math.PI}function dk(e,t,n,o,r,l,i){void 0===l&&(l=0),void 0===i&&(i=!0);var s=i&&0===l?pk:mk,a={x:s(100,((t.width-n.width/r)/2-e.x/r)/t.width*100),y:s(100,((t.height-n.height/r)/2-e.y/r)/t.height*100),width:s(100,n.width/t.width*100/r),height:s(100,n.height/t.height*100/r)},c=Math.round(s(t.naturalWidth,a.width*t.naturalWidth/100)),u=Math.round(s(t.naturalHeight,a.height*t.naturalHeight/100)),d=t.naturalWidth>=t.naturalHeight*o?{width:Math.round(u*o),height:u}:{width:c,height:Math.round(c/o)};return{croppedAreaPercentages:a,croppedAreaPixels:lk(lk({},d),{x:Math.round(s(t.naturalWidth-d.width,a.x*t.naturalWidth/100)),y:Math.round(s(t.naturalHeight-d.height,a.y*t.naturalHeight/100))})}}function pk(e,t){return Math.min(e,Math.max(0,t))}function mk(e,t){return t}function fk(e,t,n){var o=t.width/t.naturalWidth,r=function(e,t,n){var o=t.width/t.naturalWidth;if(n)return n.height>n.width?n.height/o/e.height:n.width/o/e.width;var r=e.width/e.height;return t.naturalWidth>=t.naturalHeight*r?t.naturalHeight/e.height:t.naturalWidth/e.width}(e,t,n),l=o*r;return{crop:{x:((t.naturalWidth-e.width)/2-e.x)*l,y:((t.naturalHeight-e.height)/2-e.y)*l},zoom:r}}function gk(e,t){return{x:(t.x+e.x)/2,y:(t.y+e.y)/2}}function hk(e,t,n,o,r){var l=Math.cos,i=Math.sin,s=r*Math.PI/180;return[(e-n)*l(s)-(t-o)*i(s)+n,(e-n)*i(s)+(t-o)*l(s)+o]}function vk(e,t,n){var o=e/2,r=t/2,l=[hk(0,0,o,r,n),hk(e,0,o,r,n),hk(e,t,o,r,n),hk(0,t,o,r,n)],i=Math.min.apply(Math,l.map((function(e){return e[0]}))),s=Math.max.apply(Math,l.map((function(e){return e[0]}))),a=Math.min.apply(Math,l.map((function(e){return e[1]})));return{width:s-i,height:Math.max.apply(Math,l.map((function(e){return e[1]})))-a}}function bk(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.filter((function(e){return"string"==typeof e&&e.length>0})).join(" ").trim()}var kk=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.imageRef=null,n.videoRef=null,n.containerRef=null,n.styleRef=null,n.containerRect=null,n.mediaSize={width:0,height:0,naturalWidth:0,naturalHeight:0},n.dragStartPosition={x:0,y:0},n.dragStartCrop={x:0,y:0},n.lastPinchDistance=0,n.lastPinchRotation=0,n.rafDragTimeout=null,n.rafPinchTimeout=null,n.wheelTimer=null,n.state={cropSize:null,hasWheelJustStarted:!1},n.preventZoomSafari=function(e){return e.preventDefault()},n.cleanEvents=function(){document.removeEventListener("mousemove",n.onMouseMove),document.removeEventListener("mouseup",n.onDragStopped),document.removeEventListener("touchmove",n.onTouchMove),document.removeEventListener("touchend",n.onDragStopped)},n.clearScrollEvent=function(){n.containerRef&&n.containerRef.removeEventListener("wheel",n.onWheel),n.wheelTimer&&clearTimeout(n.wheelTimer)},n.onMediaLoad=function(){n.computeSizes(),n.emitCropData(),n.setInitialCrop(),n.props.onMediaLoaded&&n.props.onMediaLoaded(n.mediaSize)},n.setInitialCrop=function(){var e=n.props,t=e.initialCroppedAreaPixels,o=e.cropSize;if(t){var r=fk(t,n.mediaSize,o),l=r.crop,i=r.zoom;n.props.onCropChange(l),n.props.onZoomChange&&n.props.onZoomChange(i)}},n.computeSizes=function(){var e,t,o,r,l=n.imageRef||n.videoRef;if(l){n.mediaSize={width:l.offsetWidth,height:l.offsetHeight,naturalWidth:(null===(e=n.imageRef)||void 0===e?void 0:e.naturalWidth)||(null===(t=n.videoRef)||void 0===t?void 0:t.videoWidth)||0,naturalHeight:(null===(o=n.imageRef)||void 0===o?void 0:o.naturalHeight)||(null===(r=n.videoRef)||void 0===r?void 0:r.videoHeight)||0};var i=n.props.cropSize?n.props.cropSize:ik(l.offsetWidth,l.offsetHeight,n.props.aspect,n.props.rotation);n.setState({cropSize:i},n.recomputeCropPosition)}n.containerRef&&(n.containerRect=n.containerRef.getBoundingClientRect())},n.onMouseDown=function(e){e.preventDefault(),document.addEventListener("mousemove",n.onMouseMove),document.addEventListener("mouseup",n.onDragStopped),n.onDragStart(t.getMousePoint(e))},n.onMouseMove=function(e){return n.onDrag(t.getMousePoint(e))},n.onTouchStart=function(e){e.preventDefault(),document.addEventListener("touchmove",n.onTouchMove,{passive:!1}),document.addEventListener("touchend",n.onDragStopped),2===e.touches.length?n.onPinchStart(e):1===e.touches.length&&n.onDragStart(t.getTouchPoint(e.touches[0]))},n.onTouchMove=function(e){e.preventDefault(),2===e.touches.length?n.onPinchMove(e):1===e.touches.length&&n.onDrag(t.getTouchPoint(e.touches[0]))},n.onDragStart=function(e){var t,o,r=e.x,l=e.y;n.dragStartPosition={x:r,y:l},n.dragStartCrop=lk({},n.props.crop),null===(o=(t=n.props).onInteractionStart)||void 0===o||o.call(t)},n.onDrag=function(e){var t=e.x,o=e.y;n.rafDragTimeout&&window.cancelAnimationFrame(n.rafDragTimeout),n.rafDragTimeout=window.requestAnimationFrame((function(){if(n.state.cropSize&&void 0!==t&&void 0!==o){var e=t-n.dragStartPosition.x,r=o-n.dragStartPosition.y,l={x:n.dragStartCrop.x+e,y:n.dragStartCrop.y+r},i=n.props.restrictPosition?sk(l,n.mediaSize,n.state.cropSize,n.props.zoom,n.props.rotation):l;n.props.onCropChange(i)}}))},n.onDragStopped=function(){var e,t;n.cleanEvents(),n.emitCropData(),null===(t=(e=n.props).onInteractionEnd)||void 0===t||t.call(e)},n.onWheel=function(e){e.preventDefault();var o=t.getMousePoint(e),r=n.props.zoom-e.deltaY*n.props.zoomSpeed/200;n.setNewZoom(r,o),n.state.hasWheelJustStarted||n.setState({hasWheelJustStarted:!0},(function(){var e,t;return null===(t=(e=n.props).onInteractionStart)||void 0===t?void 0:t.call(e)})),n.wheelTimer&&clearTimeout(n.wheelTimer),n.wheelTimer=window.setTimeout((function(){return n.setState({hasWheelJustStarted:!1},(function(){var e,t;return null===(t=(e=n.props).onInteractionEnd)||void 0===t?void 0:t.call(e)}))}),250)},n.getPointOnContainer=function(e){var t=e.x,o=e.y;if(!n.containerRect)throw new Error("The Cropper is not mounted");return{x:n.containerRect.width/2-(t-n.containerRect.left),y:n.containerRect.height/2-(o-n.containerRect.top)}},n.getPointOnMedia=function(e){var t=e.x,o=e.y,r=n.props,l=r.crop,i=r.zoom;return{x:(t+l.x)/i,y:(o+l.y)/i}},n.setNewZoom=function(e,t){if(n.state.cropSize&&n.props.onZoomChange){var o=n.getPointOnContainer(t),r=n.getPointOnMedia(o),l=Math.min(n.props.maxZoom,Math.max(e,n.props.minZoom)),i={x:r.x*l-o.x,y:r.y*l-o.y},s=n.props.restrictPosition?sk(i,n.mediaSize,n.state.cropSize,l,n.props.rotation):i;n.props.onCropChange(s),n.props.onZoomChange(l)}},n.emitCropData=function(){if(n.state.cropSize){var e=dk(n.props.restrictPosition?sk(n.props.crop,n.mediaSize,n.state.cropSize,n.props.zoom,n.props.rotation):n.props.crop,n.mediaSize,n.state.cropSize,n.getAspect(),n.props.zoom,n.props.rotation,n.props.restrictPosition),t=e.croppedAreaPercentages,o=e.croppedAreaPixels;n.props.onCropComplete&&n.props.onCropComplete(t,o)}},n.recomputeCropPosition=function(){if(n.state.cropSize){var e=n.props.restrictPosition?sk(n.props.crop,n.mediaSize,n.state.cropSize,n.props.zoom,n.props.rotation):n.props.crop;n.props.onCropChange(e),n.emitCropData()}},n}return function(e,t){function __(){this.constructor=e}rk(e,t),e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)}(t,e),t.prototype.componentDidMount=function(){window.addEventListener("resize",this.computeSizes),this.containerRef&&(this.props.zoomWithScroll&&this.containerRef.addEventListener("wheel",this.onWheel,{passive:!1}),this.containerRef.addEventListener("gesturestart",this.preventZoomSafari),this.containerRef.addEventListener("gesturechange",this.preventZoomSafari)),this.props.disableAutomaticStylesInjection||(this.styleRef=document.createElement("style"),this.styleRef.setAttribute("type","text/css"),this.styleRef.innerHTML=".reactEasyCrop_Container {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n overflow: hidden;\n user-select: none;\n touch-action: none;\n cursor: move;\n}\n\n.reactEasyCrop_Image,\n.reactEasyCrop_Video {\n max-width: 100%;\n max-height: 100%;\n margin: auto;\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n will-change: transform; /* this improves performances and prevent painting issues on iOS Chrome */\n}\n\n.reactEasyCrop_CropArea {\n position: absolute;\n left: 50%;\n top: 50%;\n transform: translate(-50%, -50%);\n border: 1px solid rgba(255, 255, 255, 0.5);\n box-sizing: border-box;\n box-shadow: 0 0 0 9999em;\n color: rgba(0, 0, 0, 0.5);\n overflow: hidden;\n}\n\n.reactEasyCrop_CropAreaRound {\n border-radius: 50%;\n}\n\n.reactEasyCrop_CropAreaGrid::before {\n content: ' ';\n box-sizing: border-box;\n position: absolute;\n border: 1px solid rgba(255, 255, 255, 0.5);\n top: 0;\n bottom: 0;\n left: 33.33%;\n right: 33.33%;\n border-top: 0;\n border-bottom: 0;\n}\n\n.reactEasyCrop_CropAreaGrid::after {\n content: ' ';\n box-sizing: border-box;\n position: absolute;\n border: 1px solid rgba(255, 255, 255, 0.5);\n top: 33.33%;\n bottom: 33.33%;\n left: 0;\n right: 0;\n border-left: 0;\n border-right: 0;\n}\n",document.head.appendChild(this.styleRef)),this.imageRef&&this.imageRef.complete&&this.onMediaLoad()},t.prototype.componentWillUnmount=function(){window.removeEventListener("resize",this.computeSizes),this.containerRef&&(this.containerRef.removeEventListener("gesturestart",this.preventZoomSafari),this.containerRef.removeEventListener("gesturechange",this.preventZoomSafari)),this.styleRef&&this.styleRef.remove(),this.cleanEvents(),this.props.zoomWithScroll&&this.clearScrollEvent()},t.prototype.componentDidUpdate=function(e){e.rotation!==this.props.rotation?(this.computeSizes(),this.recomputeCropPosition()):e.aspect!==this.props.aspect?this.computeSizes():e.zoom!==this.props.zoom?this.recomputeCropPosition():e.cropSize!==this.props.cropSize&&this.computeSizes(),e.zoomWithScroll!==this.props.zoomWithScroll&&this.containerRef&&(this.props.zoomWithScroll?this.containerRef.addEventListener("wheel",this.onWheel,{passive:!1}):this.clearScrollEvent())},t.prototype.getAspect=function(){var e=this.props,t=e.cropSize,n=e.aspect;return t?t.width/t.height:n},t.prototype.onPinchStart=function(e){var n=t.getTouchPoint(e.touches[0]),o=t.getTouchPoint(e.touches[1]);this.lastPinchDistance=ck(n,o),this.lastPinchRotation=uk(n,o),this.onDragStart(gk(n,o))},t.prototype.onPinchMove=function(e){var n=this,o=t.getTouchPoint(e.touches[0]),r=t.getTouchPoint(e.touches[1]),l=gk(o,r);this.onDrag(l),this.rafPinchTimeout&&window.cancelAnimationFrame(this.rafPinchTimeout),this.rafPinchTimeout=window.requestAnimationFrame((function(){var e=ck(o,r),t=n.props.zoom*(e/n.lastPinchDistance);n.setNewZoom(t,l),n.lastPinchDistance=e;var i=uk(o,r),s=n.props.rotation+(i-n.lastPinchRotation);n.props.onRotationChange&&n.props.onRotationChange(s),n.lastPinchRotation=i}))},t.prototype.render=function(){var e=this,t=this.props,n=t.image,o=t.video,r=t.mediaProps,l=t.crop,i=l.x,s=l.y,a=t.rotation,c=t.zoom,u=t.cropShape,d=t.showGrid,p=t.style,m=p.containerStyle,f=p.cropAreaStyle,g=p.mediaStyle,h=t.classes,v=h.containerClassName,b=h.cropAreaClassName,k=h.mediaClassName;return ql().createElement("div",{onMouseDown:this.onMouseDown,onTouchStart:this.onTouchStart,ref:function(t){return e.containerRef=t},"data-testid":"container",style:m,className:bk("reactEasyCrop_Container",v)},n?ql().createElement("img",lk({alt:"",className:bk("reactEasyCrop_Image",k)},r,{src:n,ref:function(t){return e.imageRef=t},style:lk(lk({},g),{transform:"translate("+i+"px, "+s+"px) rotate("+a+"deg) scale("+c+")"}),onLoad:this.onMediaLoad})):o&&ql().createElement("video",lk({autoPlay:!0,loop:!0,muted:!0,className:bk("reactEasyCrop_Video",k)},r,{src:o,ref:function(t){return e.videoRef=t},onLoadedMetadata:this.onMediaLoad,style:lk(lk({},g),{transform:"translate("+i+"px, "+s+"px) rotate("+a+"deg) scale("+c+")"}),controls:!1})),this.state.cropSize&&ql().createElement("div",{style:lk(lk({},f),{width:this.state.cropSize.width,height:this.state.cropSize.height}),"data-testid":"cropper",className:bk("reactEasyCrop_CropArea","round"===u&&"reactEasyCrop_CropAreaRound",d&&"reactEasyCrop_CropAreaGrid",b)}))},t.defaultProps={zoom:1,rotation:0,aspect:4/3,maxZoom:3,minZoom:1,cropShape:"rect",showGrid:!0,style:{},classes:{},mediaProps:{},zoomSpeed:1,restrictPosition:!0,zoomWithScroll:!0},t.getMousePoint=function(e){return{x:Number(e.clientX),y:Number(e.clientY)}},t.getTouchPoint=function(e){return{x:Number(e.clientX),y:Number(e.clientY)}},t}(ql().Component);const _k={position:"bottom right",isAlternate:!0};const yk=(0,s.createContext)({}),Ek=()=>(0,s.useContext)(yk);function Ck(e){let{id:t,url:n,naturalWidth:o,naturalHeight:r,isEditing:i,onFinishEditing:a,onSaveImage:c,children:u}=e;const d=function(e,t){const n=function(e){let{url:t,naturalWidth:n,naturalHeight:o}=e;const[r,i]=(0,s.useState)(),[a,c]=(0,s.useState)(),[u,d]=(0,s.useState)({x:0,y:0}),[p,m]=(0,s.useState)(),[f,g]=(0,s.useState)(),[h,v]=(0,s.useState)(),[b,k]=(0,s.useState)(),_=(0,s.useCallback)((()=>{d({x:0,y:0}),m(100),g(0),v(n/o),k(n/o)}),[n,o,d,m,g,v,k]),y=(0,s.useCallback)((()=>{const e=(f+90)%360;let r=n/o;if(f%180==90&&(r=o/n),0===e)return i(),g(e),v(1/h),void d({x:-u.y*r,y:u.x*r});const s=new window.Image;s.src=t,s.onload=function(t){const n=document.createElement("canvas");let o=0,l=0;e%180?(n.width=t.target.height,n.height=t.target.width):(n.width=t.target.width,n.height=t.target.height),90!==e&&180!==e||(o=n.width),270!==e&&180!==e||(l=n.height);const s=n.getContext("2d");s.translate(o,l),s.rotate(e*Math.PI/180),s.drawImage(t.target,0,0),n.toBlob((t=>{i(URL.createObjectURL(t)),g(e),v(1/h),d({x:-u.y*r,y:u.x*r})}))};const a=(0,l.applyFilters)("media.crossOrigin",void 0,t);"string"==typeof a&&(s.crossOrigin=a)}),[f,n,o,i,g,v,d]);return(0,s.useMemo)((()=>({editedUrl:r,setEditedUrl:i,crop:a,setCrop:c,position:u,setPosition:d,zoom:p,setZoom:m,rotation:f,setRotation:g,rotateClockwise:y,aspect:h,setAspect:v,defaultAspect:b,initializeTransformValues:_})),[r,i,a,c,u,d,p,m,f,g,y,h,v,b,_])}(e),{initializeTransformValues:o}=n;return(0,s.useEffect)((()=>{t&&o()}),[t,o]),n}({url:n,naturalWidth:o,naturalHeight:r},i),p=function(e){let{crop:t,rotation:n,height:o,width:r,aspect:l,url:i,id:a,onSaveImage:c,onFinishEditing:u}=e;const{createErrorNotice:d}=(0,m.useDispatch)(Rd.store),[p,f]=(0,s.useState)(!1),h=(0,s.useCallback)((()=>{f(!1),u()}),[f,u]),v=(0,s.useCallback)((()=>{f(!0);let e={};(t.width<99.9||t.height<99.9)&&(e=t),n>0&&(e.rotation=n),e.src=i,Hv()({path:`/wp/v2/media/${a}/edit`,method:"POST",data:e}).then((e=>{c({id:e.id,url:e.source_url,height:o&&r?r/l:void 0})})).catch((e=>{d((0,g.sprintf)(
|
89 |
/* translators: 1. Error message */
|
90 |
-
(0,g.__)("Could not edit image. %s"),(0,cl.__unstableStripHTML)(e.message)),{id:"image-editing-error",type:"snackbar"})})).finally((()=>{f(!1),u()}))}),[f,t,n,o,r,l,i,c,d,f,u]);return(0,s.useMemo)((()=>({isInProgress:p,apply:v,cancel:h})),[p,v,h])}({id:t,url:n,onSaveImage:c,onFinishEditing:a,...d}),f=(0,s.useMemo)((()=>({...d,...p})),[d,p]);return(0,s.createElement)(yk.Provider,{value:f},u)}function Sk(e){let{url:t,width:n,height:o,clientWidth:r,naturalHeight:l,naturalWidth:i}=e;const{isInProgress:a,editedUrl:u,position:d,zoom:m,aspect:f,setPosition:g,setCrop:h,setZoom:v,rotation:b}=Ek();let k=o||r*l/i;return b%180==90&&(k=r*i/l),(0,s.createElement)("div",{className:c()("wp-block-image__crop-area",{"is-applying":a}),style:{width:n||r,height:k}},(0,s.createElement)(kk,{image:u||t,disabled:a,minZoom:1,maxZoom:3,crop:d,zoom:m/100,aspect:f,onCropChange:g,onCropComplete:e=>{h(e)},onZoomChange:e=>{v(100*e)}}),a&&(0,s.createElement)(p.Spinner,null))}var wk=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M13.5 6C10.5 6 8 8.5 8 11.5c0 1.1.3 2.1.9 3l-3.4 3 1 1.1 3.4-2.9c1 .9 2.2 1.4 3.6 1.4 3 0 5.5-2.5 5.5-5.5C19 8.5 16.5 6 13.5 6zm0 9.5c-2.2 0-4-1.8-4-4s1.8-4 4-4 4 1.8 4 4-1.8 4-4 4z"}));function Bk(){const{isInProgress:e,zoom:t,setZoom:n}=Ek();return(0,s.createElement)(p.Dropdown,{contentClassName:"wp-block-image__zoom",popoverProps:_k,renderToggle:t=>{let{isOpen:n,onToggle:o}=t;return(0,s.createElement)(p.ToolbarButton,{icon:wk,label:(0,g.__)("Zoom"),onClick:o,"aria-expanded":n,disabled:e})},renderContent:()=>(0,s.createElement)(p.RangeControl,{label:(0,g.__)("Zoom"),min:100,max:300,value:Math.round(t),onChange:n})})}var Ik=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M18.5 5.5h-13c-1.1 0-2 .9-2 2v9c0 1.1.9 2 2 2h13c1.1 0 2-.9 2-2v-9c0-1.1-.9-2-2-2zm.5 11c0 .3-.2.5-.5.5h-13c-.3 0-.5-.2-.5-.5v-9c0-.3.2-.5.5-.5h13c.3 0 .5.2.5.5v9zM6.5 12H8v-2h2V8.5H6.5V12zm9.5 2h-2v1.5h3.5V12H16v2z"}));function xk(e){let{aspectRatios:t,isDisabled:n,label:o,onClick:r,value:l}=e;return(0,s.createElement)(p.MenuGroup,{label:o},t.map((e=>{let{title:t,aspect:o}=e;return(0,s.createElement)(p.MenuItem,{key:o,disabled:n,onClick:()=>{r(o)},role:"menuitemradio",isSelected:o===l,icon:o===l?am:void 0},t)})))}function Tk(e){let{toggleProps:t}=e;const{isInProgress:n,aspect:o,setAspect:r,defaultAspect:l}=Ek();return(0,s.createElement)(p.DropdownMenu,{icon:Ik,label:(0,g.__)("Aspect Ratio"),popoverProps:_k,toggleProps:t,className:"wp-block-image__aspect-ratio"},(e=>{let{onClose:t}=e;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(xk,{isDisabled:n,onClick:e=>{r(e),t()},value:o,aspectRatios:[{title:(0,g.__)("Original"),aspect:l},{title:(0,g.__)("Square"),aspect:1}]}),(0,s.createElement)(xk,{label:(0,g.__)("Landscape"),isDisabled:n,onClick:e=>{r(e),t()},value:o,aspectRatios:[{title:(0,g.__)("16:10"),aspect:1.6},{title:(0,g.__)("16:9"),aspect:16/9},{title:(0,g.__)("4:3"),aspect:4/3},{title:(0,g.__)("3:2"),aspect:1.5}]}),(0,s.createElement)(xk,{label:(0,g.__)("Portrait"),isDisabled:n,onClick:e=>{r(e),t()},value:o,aspectRatios:[{title:(0,g.__)("10:16"),aspect:.625},{title:(0,g.__)("9:16"),aspect:9/16},{title:(0,g.__)("3:4"),aspect:3/4},{title:(0,g.__)("2:3"),aspect:2/3}]}))}))}var Nk=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M15.1 4.8l-3-2.5V4c-4.4 0-8 3.6-8 8 0 3.7 2.5 6.9 6 7.7.3.1.6.1 1 .2l.2-1.5c-.4 0-.7-.1-1.1-.2l-.1.2v-.2c-2.6-.8-4.5-3.3-4.5-6.2 0-3.6 2.9-6.5 6.5-6.5v1.8l3-2.5zM20 11c-.2-1.4-.7-2.7-1.6-3.8l-1.2.8c.7.9 1.1 2 1.3 3.1L20 11zm-1.5 1.8c-.1.5-.2 1.1-.4 1.6s-.5 1-.8 1.5l1.2.9c.4-.5.8-1.1 1-1.8s.5-1.3.5-2l-1.5-.2zm-5.6 5.6l.2 1.5c1.4-.2 2.7-.7 3.8-1.6l-.9-1.1c-.9.7-2 1.1-3.1 1.2z"}));function Pk(){const{isInProgress:e,rotateClockwise:t}=Ek();return(0,s.createElement)(p.ToolbarButton,{icon:Nk,label:(0,g.__)("Rotate"),onClick:t,disabled:e})}function Mk(){const{isInProgress:e,apply:t,cancel:n}=Ek();return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.ToolbarButton,{onClick:t,disabled:e},(0,g.__)("Apply")),(0,s.createElement)(p.ToolbarButton,{onClick:n},(0,g.__)("Cancel")))}function Rk(e){let{url:t,width:n,height:o,clientWidth:r,naturalHeight:l,naturalWidth:i}=e;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Sk,{url:t,width:n,height:o,clientWidth:r,naturalHeight:l,naturalWidth:i}),(0,s.createElement)(io,null,(0,s.createElement)(p.ToolbarGroup,null,(0,s.createElement)(Bk,null),(0,s.createElement)(p.ToolbarItem,null,(e=>(0,s.createElement)(Tk,{toggleProps:e}))),(0,s.createElement)(Pk,null)),(0,s.createElement)(p.ToolbarGroup,null,(0,s.createElement)(Mk,null))))}const Lk=[25,50,75,100];function Ak(e){let{imageWidth:t,imageHeight:n,imageSizeOptions:o=[],isResizable:r=!0,slug:l,width:i,height:a,onChange:c,onChangeImage:d=u.noop}=e;const{currentHeight:m,currentWidth:f,updateDimension:h,updateDimensions:v}=function(e,t,n,o,r){var l,i;const[a,c]=(0,s.useState)(null!==(l=null!=t?t:o)&&void 0!==l?l:""),[u,d]=(0,s.useState)(null!==(i=null!=e?e:n)&&void 0!==i?i:"");return(0,s.useEffect)((()=>{void 0===t&&void 0!==o&&c(o),void 0===e&&void 0!==n&&d(n)}),[o,n]),(0,s.useEffect)((()=>{void 0!==t&&Number.parseInt(t)!==Number.parseInt(a)&&c(t),void 0!==e&&Number.parseInt(e)!==Number.parseInt(u)&&d(e)}),[t,e]),{currentHeight:u,currentWidth:a,updateDimension:(e,t)=>{"width"===e?c(t):d(t),r({[e]:""===t?void 0:parseInt(t,10)})},updateDimensions:(e,t)=>{d(null!=e?e:n),c(null!=t?t:o),r({height:e,width:t})}}}(a,i,n,t,c);return(0,s.createElement)(s.Fragment,null,!(0,u.isEmpty)(o)&&(0,s.createElement)(p.SelectControl,{label:(0,g.__)("Image size"),value:l,options:o,onChange:d}),r&&(0,s.createElement)("div",{className:"block-editor-image-size-control"},(0,s.createElement)("p",{className:"block-editor-image-size-control__row"},(0,g.__)("Image dimensions")),(0,s.createElement)("div",{className:"block-editor-image-size-control__row"},(0,s.createElement)(p.TextControl,{type:"number",className:"block-editor-image-size-control__width",label:(0,g.__)("Width"),value:f,min:1,onChange:e=>h("width",e)}),(0,s.createElement)(p.TextControl,{type:"number",className:"block-editor-image-size-control__height",label:(0,g.__)("Height"),value:m,min:1,onChange:e=>h("height",e)})),(0,s.createElement)("div",{className:"block-editor-image-size-control__row"},(0,s.createElement)(p.ButtonGroup,{"aria-label":(0,g.__)("Image size presets")},Lk.map((e=>{const o=Math.round(t*(e/100)),r=Math.round(n*(e/100)),l=f===o&&m===r;return(0,s.createElement)(p.Button,{key:e,isSmall:!0,variant:l?"primary":void 0,isPressed:l,onClick:()=>v(r,o)},e,"%")}))),(0,s.createElement)(p.Button,{isSmall:!0,onClick:()=>v()},(0,g.__)("Reset")))))}var Dk=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -2 24 24"},(0,s.createElement)(O.Path,{d:"M6.734 16.106l2.176-2.38-1.093-1.028-3.846 4.158 3.846 4.157 1.093-1.027-2.176-2.38h2.811c1.125 0 2.25.03 3.374 0 1.428-.001 3.362-.25 4.963-1.277 1.66-1.065 2.868-2.906 2.868-5.859 0-2.479-1.327-4.896-3.65-5.93-1.82-.813-3.044-.8-4.806-.788l-.567.002v1.5c.184 0 .368 0 .553-.002 1.82-.007 2.704-.014 4.21.657 1.854.827 2.76 2.657 2.76 4.561 0 2.472-.973 3.824-2.178 4.596-1.258.807-2.864 1.04-4.163 1.04h-.02c-1.115.03-2.229 0-3.344 0H6.734z"})),Ok=e=>{let{value:t,onChange:n=u.noop,settings:o}=e;if(!o||!o.length)return null;const r=e=>o=>{n({...t,[e.id]:o})},l=o.map((e=>(0,s.createElement)(p.ToggleControl,{className:"block-editor-link-control__setting",key:e.id,label:e.title,onChange:r(e),checked:!!t&&!!t[e.id]})));return(0,s.createElement)("fieldset",{className:"block-editor-link-control__settings"},(0,s.createElement)(p.VisuallyHidden,{as:"legend"},(0,g.__)("Currently selected link settings")),l)},Fk=n(5425),zk=n.n(Fk);class Vk extends s.Component{constructor(e){super(e),this.onChange=this.onChange.bind(this),this.onFocus=this.onFocus.bind(this),this.onKeyDown=this.onKeyDown.bind(this),this.selectLink=this.selectLink.bind(this),this.handleOnClick=this.handleOnClick.bind(this),this.bindSuggestionNode=this.bindSuggestionNode.bind(this),this.autocompleteRef=e.autocompleteRef||(0,s.createRef)(),this.inputRef=(0,s.createRef)(),this.updateSuggestions=(0,u.debounce)(this.updateSuggestions.bind(this),200),this.suggestionNodes=[],this.isUpdatingSuggestions=!1,this.state={suggestions:[],showSuggestions:!1,selectedSuggestion:null,suggestionsListboxId:"",suggestionOptionIdPrefix:""}}componentDidUpdate(e){const{showSuggestions:t,selectedSuggestion:n}=this.state,{value:o,__experimentalShowInitialSuggestions:r=!1}=this.props;t&&null!==n&&this.suggestionNodes[n]&&!this.scrollingIntoView&&(this.scrollingIntoView=!0,zk()(this.suggestionNodes[n],this.autocompleteRef.current,{onlyScrollIfNeeded:!0}),this.props.setTimeout((()=>{this.scrollingIntoView=!1}),100)),e.value===o||this.props.disableSuggestions||this.isUpdatingSuggestions||(null!=o&&o.length?this.updateSuggestions(o):r&&this.updateSuggestions())}componentDidMount(){this.shouldShowInitialSuggestions()&&this.updateSuggestions()}componentWillUnmount(){var e,t;null===(e=this.suggestionsRequest)||void 0===e||null===(t=e.cancel)||void 0===t||t.call(e),delete this.suggestionsRequest}bindSuggestionNode(e){return t=>{this.suggestionNodes[e]=t}}shouldShowInitialSuggestions(){const{suggestions:e}=this.state,{__experimentalShowInitialSuggestions:t=!1,value:n}=this.props;return!this.isUpdatingSuggestions&&t&&!(n&&n.length)&&!(e&&e.length)}updateSuggestions(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";const{__experimentalFetchLinkSuggestions:n,__experimentalHandleURLSuggestions:o}=this.props;if(!n)return;const r=!(null!==(e=t)&&void 0!==e&&e.length);if(t=t.trim(),!r&&(t.length<2||!o&&(0,sp.isURL)(t)))return void this.setState({showSuggestions:!1,selectedSuggestion:null,loading:!1});this.isUpdatingSuggestions=!0,this.setState({selectedSuggestion:null,loading:!0});const l=n(t,{isInitialSuggestions:r});l.then((e=>{this.suggestionsRequest===l&&(this.setState({suggestions:e,loading:!1,showSuggestions:!!e.length}),e.length?this.props.debouncedSpeak((0,g.sprintf)(
|
91 |
/* translators: %s: number of results. */
|
92 |
-
(0,g._n)("%d result found, use up and down arrow keys to navigate.","%d results found, use up and down arrow keys to navigate.",e.length),e.length),"assertive"):this.props.debouncedSpeak((0,g.__)("No results."),"assertive"),this.isUpdatingSuggestions=!1)})).catch((()=>{this.suggestionsRequest===l&&(this.setState({loading:!1}),this.isUpdatingSuggestions=!1)})),this.suggestionsRequest=l}onChange(e){const t=e.target.value;this.props.onChange(t),this.props.disableSuggestions||this.updateSuggestions(t)}onFocus(){const{suggestions:e}=this.state,{disableSuggestions:t,value:n}=this.props;!n||t||this.isUpdatingSuggestions||e&&e.length||this.updateSuggestions(n)}onKeyDown(e){const{showSuggestions:t,selectedSuggestion:n,suggestions:o,loading:r}=this.state;if(!t||!o.length||r){switch(e.keyCode){case
|
93 |
/* translators: %s: search term. */
|
94 |
-
(0,g.__)("Create: <mark>%s</mark>"),n),{mark:(0,s.createElement)("mark",null)}),(0,s.createElement)(p.Button,i({},r,{className:c()("block-editor-link-control__search-create block-editor-link-control__search-item",{"is-selected":l}),onClick:o}),(0,s.createElement)(
|
95 |
/* translators: %s: search term. */
|
96 |
-
(0,g.__)('Search results for "%s"'),o),S=(0,s.createElement)(f?s.Fragment:p.VisuallyHidden,{},(0,s.createElement)("span",{className:"block-editor-link-control__search-results-label",id:E},C));return(0,s.createElement)("div",{className:"block-editor-link-control__search-results-wrapper"},S,(0,s.createElement)("div",i({},l,{className:b,"aria-labelledby":E}),u.map(((e,t)=>_&&$k===e.type?(0,s.createElement)(Gk,{searchTerm:o,buttonText:h,onClick:()=>r(e),key:e.type,itemProps:a(e,t),isSelected:t===d}):$k===e.type?null:(0,s.createElement)(Wk,{key:`${e.id}-${e.type}`,itemProps:a(e,t),suggestion:e,index:t,onClick:()=>{r(e)},isSelected:t===d,isURL:qk.includes(e.type),searchTerm:o,shouldShowType:y,isFrontPage:null==e?void 0:e.isFrontPage})))))}function Zk(e){const t=(0,u.startsWith)(e,"#");return(0,sp.isURL)(e)||e&&e.includes("www.")||t}const Xk=()=>Promise.resolve([]),Jk=e=>{let t="URL";const n=(0,sp.getProtocol)(e)||"";return n.includes("mailto")&&(t=jk),n.includes("tel")&&(t="tel"),(0,u.startsWith)(e,"#")&&(t=Kk),Promise.resolve([{id:e,title:e,url:"URL"===t?(0,sp.prependHTTP)(e):e,type:t}])};const e_=()=>Promise.resolve([]),t_=(0,s.forwardRef)(((e,t)=>{let{value:n,children:o,currentLink:r={},className:l=null,placeholder:i=null,withCreateSuggestion:a=!1,onCreateSuggestion:p=u.noop,onChange:f=u.noop,onSelect:h=u.noop,showSuggestions:v=!0,renderSuggestions:b=(e=>(0,s.createElement)(Qk,e)),fetchSuggestions:k=null,allowDirectEntry:_=!0,showInitialSuggestions:y=!1,suggestionsQuery:E={},withURLSuggestion:C=!0,createSuggestionButtonText:S,useLabel:w=!1}=e;const B=function(e,t,n,o){const{fetchSearchSuggestions:r,pageOnFront:l}=(0,m.useSelect)((e=>{const{getSettings:t}=e(Qn);return{pageOnFront:t().pageOnFront,fetchSearchSuggestions:t().__experimentalFetchLinkSuggestions}}),[]),i=t?Jk:Xk;return(0,s.useCallback)(((t,s)=>{let{isInitialSuggestions:a}=s;return Zk(t)?i(t,{isInitialSuggestions:a}):(async(e,t,n,o,r,l,i)=>{const{isInitialSuggestions:s}=t;let a=!1,c=await Promise.all([n(e,t),o(e)]);c[0]=c[0].map((e=>Number(e.id)===i?(a=!0,e.isFrontPage=!0,e):e));const u=!e.includes(" ");return c=!a&&u&&l&&!s?c[0].concat(c[1]):c[0],s||Zk(e)||!r?c:c.concat({title:e,url:e,type:$k})})(t,{...e,isInitialSuggestions:a},r,i,n,o,l)}),[i,r,n])}(E,_,a,C),I=v?k||B:e_,x=(0,d.useInstanceId)(t_),[T,N]=(0,s.useState)(),P=async e=>{let t=e;if($k!==e.type)(_||t&&Object.keys(t).length>=1)&&h({...(0,u.omit)(r,"id","url"),...t},t);else try{var n;t=await p(e.title),null!==(n=t)&&void 0!==n&&n.url&&h(t)}catch(e){}},M=c()(l,{"has-no-label":!w});return(0,s.createElement)("div",{className:"block-editor-link-control__search-input-container"},(0,s.createElement)(Hk,{label:w?"URL":void 0,className:M,value:n,onChange:(e,t)=>{f(e),N(t)},placeholder:null!=i?i:(0,g.__)("Search or type url"),__experimentalRenderSuggestions:v?e=>b({...e,instanceId:x,withCreateSuggestion:a,currentInputValue:n,createSuggestionButtonText:S,suggestionsQuery:E,handleSuggestionClick:t=>{e.handleSuggestionClick&&e.handleSuggestionClick(t),P(t)}}):null,__experimentalFetchLinkSuggestions:I,__experimentalHandleURLSuggestions:!0,__experimentalShowInitialSuggestions:y,onSubmit:(e,t)=>{var o;const r=e||T;r||null!=n&&null!==(o=n.trim())&&void 0!==o&&o.length?P(r||{url:n}):t.preventDefault()},ref:t}),o)}));var n_=t_,o_=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M12 3.2c-4.8 0-8.8 3.9-8.8 8.8 0 4.8 3.9 8.8 8.8 8.8 4.8 0 8.8-3.9 8.8-8.8 0-4.8-4-8.8-8.8-8.8zm0 16c-4 0-7.2-3.3-7.2-7.2C4.8 8 8 4.8 12 4.8s7.2 3.3 7.2 7.2c0 4-3.2 7.2-7.2 7.2zM11 17h2v-6h-2v6zm0-8h2V7h-2v2z"})),r_=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M20.1 5.1L16.9 2 6.2 12.7l-1.3 4.4 4.5-1.3L20.1 5.1zM4 20.8h8v-1.5H4v1.5z"}));const{Slot:l_,Fill:i_}=(0,p.createSlotFill)("BlockEditorLinkControlViewer");function s_(e,t){switch(t.type){case"RESOLVED":return{...e,isFetching:!1,richData:t.richData};case"ERROR":return{...e,isFetching:!1,richData:null};case"LOADING":return{...e,isFetching:!0};default:throw new Error(`Unexpected action type ${t.type}`)}}function a_(e){var t;let{value:n,onEditClick:o,hasRichPreviews:r=!1,hasUnlinkControl:l=!1,onRemove:i}=e;const a=r?null==n?void 0:n.url:null,{richData:u,isFetching:d}=function(e){const[t,n]=(0,s.useReducer)(s_,{richData:null,isFetching:!1}),{fetchRichUrlData:o}=(0,m.useSelect)((e=>{const{getSettings:t}=e(Qn);return{fetchRichUrlData:t().__experimentalFetchRichUrlData}}),[]);return(0,s.useEffect)((()=>{if(null!=e&&e.length&&o&&"undefined"!=typeof AbortController){n({type:"LOADING"});const t=new window.AbortController,r=t.signal;return o(e,{signal:r}).then((e=>{n({type:"RESOLVED",richData:e})})).catch((()=>{r.aborted||n({type:"ERROR"})})),()=>{t.abort()}}}),[e]),t}(a),f=u&&Object.keys(u).length,h=n&&(0,sp.filterURLForDisplay)((0,sp.safeDecodeURI)(n.url),16)||"",v=(null==u?void 0:u.title)||(null==n?void 0:n.title)||h,b=!(null!=n&&null!==(t=n.url)&&void 0!==t&&t.length);let k;return k=null!=u&&u.icon?(0,s.createElement)("img",{src:null==u?void 0:u.icon,alt:""}):b?(0,s.createElement)(Br,{icon:o_,size:32}):(0,s.createElement)(Br,{icon:Uk}),(0,s.createElement)("div",{"aria-label":(0,g.__)("Currently selected"),"aria-selected":"true",className:c()("block-editor-link-control__search-item",{"is-current":!0,"is-rich":f,"is-fetching":!!d,"is-preview":!0,"is-error":b})},(0,s.createElement)("div",{className:"block-editor-link-control__search-item-top"},(0,s.createElement)("span",{className:"block-editor-link-control__search-item-header"},(0,s.createElement)("span",{className:c()("block-editor-link-control__search-item-icon",{"is-image":null==u?void 0:u.icon})},k),(0,s.createElement)("span",{className:"block-editor-link-control__search-item-details"},b?(0,s.createElement)("span",{className:"block-editor-link-control__search-item-error-notice"},(0,g.__)("Link is empty")):(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.ExternalLink,{className:"block-editor-link-control__search-item-title",href:n.url},(0,cl.__unstableStripHTML)(v)),(null==n?void 0:n.url)&&(0,s.createElement)("span",{className:"block-editor-link-control__search-item-info"},h)))),(0,s.createElement)(p.Button,{icon:r_,label:(0,g.__)("Edit"),className:"block-editor-link-control__search-item-action",onClick:o,iconSize:24}),l&&(0,s.createElement)(p.Button,{icon:Uf,label:(0,g.__)("Unlink"),className:"block-editor-link-control__search-item-action block-editor-link-control__unlink",onClick:i,iconSize:24}),(0,s.createElement)(l_,{fillProps:n})),(f&&((null==u?void 0:u.image)||(null==u?void 0:u.description))||d)&&(0,s.createElement)("div",{className:"block-editor-link-control__search-item-bottom"},((null==u?void 0:u.image)||d)&&(0,s.createElement)("div",{"aria-hidden":!(null!=u&&u.image),className:c()("block-editor-link-control__search-item-image",{"is-placeholder":!(null!=u&&u.image)})},(null==u?void 0:u.image)&&(0,s.createElement)("img",{src:null==u?void 0:u.image,alt:""})),((null==u?void 0:u.description)||d)&&(0,s.createElement)("div",{"aria-hidden":!(null!=u&&u.description),className:c()("block-editor-link-control__search-item-description",{"is-placeholder":!(null!=u&&u.description)})},(null==u?void 0:u.description)&&(0,s.createElement)(p.__experimentalText,{truncate:!0,numberOfLines:"2"},u.description))))}function c_(e){var t,n,o;let{searchInputPlaceholder:r,value:l,settings:i=Yk,onChange:a=u.noop,onRemove:d,noDirectEntry:m=!1,showSuggestions:f=!0,showInitialSuggestions:h,forceIsEditingLink:v,createSuggestion:b,withCreateSuggestion:k,inputValue:_="",suggestionsQuery:y={},noURLSuggestion:E=!1,createSuggestionButtonText:C,hasRichPreviews:S=!1,hasTextControl:w=!1,renderControlBottom:B=null}=e;void 0===k&&b&&(k=!0);const I=(0,s.useRef)(!0),x=(0,s.useRef)(),T=(0,s.useRef)(),[N,P]=(0,s.useState)((null==l?void 0:l.url)||""),[M,R]=(0,s.useState)((null==l?void 0:l.title)||""),L=_||N,[A,D]=(0,s.useState)(void 0!==v?v:!l||!l.url),O=(0,s.useRef)(!1),F=!(null!=L&&null!==(t=L.trim())&&void 0!==t&&t.length),{createPage:z,isCreatingPage:V,errorMessage:H}=function(e){const t=(0,s.useRef)(),[n,o]=(0,s.useState)(!1),[r,l]=(0,s.useState)(null);return(0,s.useEffect)((()=>()=>{t.current&&t.current.cancel()}),[]),{createPage:async function(n){o(!0),l(null);try{return t.current=(e=>{let t=!1;return{promise:new Promise(((n,o)=>{e.then((e=>t?o({isCanceled:!0}):n(e)),(e=>o(t?{isCanceled:!0}:e)))})),cancel(){t=!0}}})(Promise.resolve(e(n))),await t.current.promise}catch(e){if(e&&e.isCanceled)return;throw l(e.message||(0,g.__)("An unknown error occurred during creation. Please try again.")),e}finally{o(!1)}},isCreatingPage:n,errorMessage:r}}(b);function G(){var e;O.current=!(null===(e=x.current)||void 0===e||!e.contains(x.current.ownerDocument.activeElement)),D(!1)}(0,s.useEffect)((()=>{void 0!==v&&v!==A&&D(v)}),[v]),(0,s.useEffect)((()=>{if(I.current)return void(I.current=!1);const e=null!=T&&T.current?1:0;(cl.focus.focusable.find(x.current)[e]||x.current).focus(),O.current=!1}),[A,V]),(0,s.useEffect)((()=>{null!=l&&l.title&&l.title!==M&&R(l.title),null!=l&&l.url&&P(l.url)}),[l]);const U=()=>{L===(null==l?void 0:l.url)&&M===(null==l?void 0:l.title)||a({url:L,title:M}),G()},W=d&&l&&!A&&!V,$=!(null==i||!i.length),j=(null==l||null===(n=l.url)||void 0===n||null===(o=n.trim())||void 0===o?void 0:o.length)>0&&w;return(0,s.createElement)("div",{tabIndex:-1,ref:x,className:"block-editor-link-control"},V&&(0,s.createElement)("div",{className:"block-editor-link-control__loading"},(0,s.createElement)(p.Spinner,null)," ",(0,g.__)("Creating"),"…"),(A||!l)&&!V&&(0,s.createElement)(s.Fragment,null,(0,s.createElement)("div",{className:c()({"block-editor-link-control__search-input-wrapper":!0,"has-text-control":j})},j&&(0,s.createElement)(p.TextControl,{ref:T,className:"block-editor-link-control__field block-editor-link-control__text-content",label:"Text",value:M,onChange:R,onKeyDown:e=>{const{keyCode:t}=e;t!==Sc.ENTER||F||(e.preventDefault(),U())}}),(0,s.createElement)(n_,{currentLink:l,className:"block-editor-link-control__field block-editor-link-control__search-input",placeholder:r,value:L,withCreateSuggestion:k,onCreateSuggestion:z,onChange:P,onSelect:e=>{a({...e,title:M||(null==e?void 0:e.title)}),G()},showInitialSuggestions:h,allowDirectEntry:!m,showSuggestions:f,suggestionsQuery:y,withURLSuggestion:!E,createSuggestionButtonText:C,useLabel:j},(0,s.createElement)("div",{className:"block-editor-link-control__search-actions"},(0,s.createElement)(p.Button,{onClick:U,label:(0,g.__)("Submit"),icon:Dk,className:"block-editor-link-control__search-submit",disabled:F})))),H&&(0,s.createElement)(p.Notice,{className:"block-editor-link-control__search-error",status:"error",isDismissible:!1},H)),l&&!A&&!V&&(0,s.createElement)(a_,{key:null==l?void 0:l.url,value:l,onEditClick:()=>D(!0),hasRichPreviews:S,hasUnlinkControl:W,onRemove:d}),$&&(0,s.createElement)("div",{className:"block-editor-link-control__tools"},(0,s.createElement)(Ok,{value:l,settings:i,onChange:a})),B&&B())}c_.ViewerFill=i_;var u_=c_,d_=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M18.7 3H5.3C4 3 3 4 3 5.3v13.4C3 20 4 21 5.3 21h13.4c1.3 0 2.3-1 2.3-2.3V5.3C21 4 20 3 18.7 3zm.8 15.7c0 .4-.4.8-.8.8H5.3c-.4 0-.8-.4-.8-.8V5.3c0-.4.4-.8.8-.8h13.4c.4 0 .8.4.8.8v13.4zM10 15l5-3-5-3v6z"})),p_=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M18.5 15v3.5H13V6.7l4.5 4.1 1-1.1-6.2-5.8-5.8 5.8 1 1.1 4-4v11.7h-6V15H4v5h16v-5z"})),m_=(0,p.withFilters)("editor.MediaUpload")((()=>null)),f_=function(e){let{fallback:t=null,children:n}=e;return(0,m.useSelect)((e=>{const{getSettings:t}=e(Qn);return!!t().mediaUpload}),[])?n:t},g_=(0,d.compose)([(0,m.withDispatch)((e=>{const{createNotice:t,removeNotice:n}=e(Rd.store);return{createNotice:t,removeNotice:n}})),(0,p.withFilters)("editor.MediaReplaceFlow")])((e=>{let{mediaURL:t,mediaId:n,mediaIds:o,allowedTypes:r,accept:l,onError:i,onSelect:a,onSelectURL:c,onFilesUpload:d=u.noop,onCloseModal:f=u.noop,name:h=(0,g.__)("Replace"),createNotice:v,removeNotice:b,children:k,multiple:_=!1,addToGallery:y,handleUpload:E=!0}=e;const[C,S]=(0,s.useState)(t),w=(0,m.useSelect)((e=>e(Qn).getSettings().mediaUpload),[]),B=(0,s.useRef)(),I=(0,u.uniqueId)("block-editor/media-replace-flow/error-notice/"),x=e=>{const t=(0,cl.__unstableStripHTML)(e);i?i(t):setTimeout((()=>{v("error",t,{speak:!0,id:I,isDismissible:!0})}),1e3)},T=(e,t)=>{t(),S(null==e?void 0:e.url),a(e),(0,Ht.speak)((0,g.__)("The media file has been replaced")),b(I)},N=e=>{e.keyCode===Sc.DOWN&&(e.preventDefault(),e.target.click())},P=_&&!(!r||0===r.length)&&r.every((e=>"image"===e||e.startsWith("image/")));return(0,s.createElement)(p.Dropdown,{popoverProps:{isAlternate:!0},contentClassName:"block-editor-media-replace-flow__options",renderToggle:e=>{let{isOpen:t,onToggle:n}=e;return(0,s.createElement)(p.ToolbarButton,{ref:B,"aria-expanded":t,"aria-haspopup":"true",onClick:n,onKeyDown:N},h)},renderContent:e=>{let{onClose:t}=e;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.NavigableMenu,{className:"block-editor-media-replace-flow__media-upload-menu"},(0,s.createElement)(m_,{gallery:P,addToGallery:y,multiple:_,value:_?o:n,onSelect:e=>T(e,t),allowedTypes:r,onClose:f,render:e=>{let{open:t}=e;return(0,s.createElement)(p.MenuItem,{icon:d_,onClick:t},(0,g.__)("Open Media Library"))}}),(0,s.createElement)(f_,null,(0,s.createElement)(p.FormFileUpload,{onChange:e=>{((e,t)=>{const n=e.target.files;if(!E)return t(),a(n);d(n),w({allowedTypes:r,filesList:n,onFileChange:e=>{let[n]=e;T(n,t)},onError:x})})(e,t)},accept:l,multiple:_,render:e=>{let{openFileDialog:t}=e;return(0,s.createElement)(p.MenuItem,{icon:p_,onClick:()=>{t()}},(0,g.__)("Upload"))}})),k),c&&(0,s.createElement)("form",{className:"block-editor-media-flow__url-input"},(0,s.createElement)("span",{className:"block-editor-media-replace-flow__image-url-label"},(0,g.__)("Current media URL:")),(0,s.createElement)(u_,{value:{url:C},settings:[],showSuggestions:!1,onChange:e=>{let{url:t}=e;S(t),c(t),B.current.focus()}})))}})}));function h_(e){let{url:t,urlLabel:n,className:o}=e;const r=c()(o,"block-editor-url-popover__link-viewer-url");return t?(0,s.createElement)(p.ExternalLink,{className:r,href:t},n||(0,sp.filterURLForDisplay)((0,sp.safeDecodeURI)(t))):(0,s.createElement)("span",{className:r})}function v_(e){let{additionalControls:t,children:n,renderSettings:o,position:r="bottom center",focusOnMount:l="firstElement",...a}=e;const[c,u]=(0,s.useState)(!1),d=!!o&&c;return(0,s.createElement)(p.Popover,i({className:"block-editor-url-popover",focusOnMount:l,position:r},a),(0,s.createElement)("div",{className:"block-editor-url-popover__input-container"},(0,s.createElement)("div",{className:"block-editor-url-popover__row"},n,!!o&&(0,s.createElement)(p.Button,{className:"block-editor-url-popover__settings-toggle",icon:jp,label:(0,g.__)("Link settings"),onClick:()=>{u(!c)},"aria-expanded":c})),d&&(0,s.createElement)("div",{className:"block-editor-url-popover__row block-editor-url-popover__settings"},o())),t&&!d&&(0,s.createElement)("div",{className:"block-editor-url-popover__additional-controls"},t))}v_.LinkEditor=function(e){let{autocompleteRef:t,className:n,onChangeInputValue:o,value:r,...l}=e;return(0,s.createElement)("form
|
1 |
+
!function(){var e={6411:function(e,t){var n,o;void 0===(o="function"==typeof(n=function(e,t){"use strict";var n,o,r="function"==typeof Map?new Map:(n=[],o=[],{has:function(e){return n.indexOf(e)>-1},get:function(e){return o[n.indexOf(e)]},set:function(e,t){-1===n.indexOf(e)&&(n.push(e),o.push(t))},delete:function(e){var t=n.indexOf(e);t>-1&&(n.splice(t,1),o.splice(t,1))}}),l=function(e){return new Event(e,{bubbles:!0})};try{new Event("test")}catch(e){l=function(e){var t=document.createEvent("Event");return t.initEvent(e,!0,!1),t}}function i(e){if(e&&e.nodeName&&"TEXTAREA"===e.nodeName&&!r.has(e)){var t=null,n=null,o=null,i=function(){e.clientWidth!==n&&d()},s=function(t){window.removeEventListener("resize",i,!1),e.removeEventListener("input",d,!1),e.removeEventListener("keyup",d,!1),e.removeEventListener("autosize:destroy",s,!1),e.removeEventListener("autosize:update",d,!1),Object.keys(t).forEach((function(n){e.style[n]=t[n]})),r.delete(e)}.bind(e,{height:e.style.height,resize:e.style.resize,overflowY:e.style.overflowY,overflowX:e.style.overflowX,wordWrap:e.style.wordWrap});e.addEventListener("autosize:destroy",s,!1),"onpropertychange"in e&&"oninput"in e&&e.addEventListener("keyup",d,!1),window.addEventListener("resize",i,!1),e.addEventListener("input",d,!1),e.addEventListener("autosize:update",d,!1),e.style.overflowX="hidden",e.style.wordWrap="break-word",r.set(e,{destroy:s,update:d}),"vertical"===(a=window.getComputedStyle(e,null)).resize?e.style.resize="none":"both"===a.resize&&(e.style.resize="horizontal"),t="content-box"===a.boxSizing?-(parseFloat(a.paddingTop)+parseFloat(a.paddingBottom)):parseFloat(a.borderTopWidth)+parseFloat(a.borderBottomWidth),isNaN(t)&&(t=0),d()}var a;function c(t){var n=e.style.width;e.style.width="0px",e.offsetWidth,e.style.width=n,e.style.overflowY=t}function u(){if(0!==e.scrollHeight){var o=function(e){for(var t=[];e&&e.parentNode&&e.parentNode instanceof Element;)e.parentNode.scrollTop&&t.push({node:e.parentNode,scrollTop:e.parentNode.scrollTop}),e=e.parentNode;return t}(e),r=document.documentElement&&document.documentElement.scrollTop;e.style.height="",e.style.height=e.scrollHeight+t+"px",n=e.clientWidth,o.forEach((function(e){e.node.scrollTop=e.scrollTop})),r&&(document.documentElement.scrollTop=r)}}function d(){u();var t=Math.round(parseFloat(e.style.height)),n=window.getComputedStyle(e,null),r="content-box"===n.boxSizing?Math.round(parseFloat(n.height)):e.offsetHeight;if(r<t?"hidden"===n.overflowY&&(c("scroll"),u(),r="content-box"===n.boxSizing?Math.round(parseFloat(window.getComputedStyle(e,null).height)):e.offsetHeight):"hidden"!==n.overflowY&&(c("hidden"),u(),r="content-box"===n.boxSizing?Math.round(parseFloat(window.getComputedStyle(e,null).height)):e.offsetHeight),o!==r){o=r;var i=l("autosize:resized");try{e.dispatchEvent(i)}catch(e){}}}}function s(e){var t=r.get(e);t&&t.destroy()}function a(e){var t=r.get(e);t&&t.update()}var c=null;"undefined"==typeof window||"function"!=typeof window.getComputedStyle?((c=function(e){return e}).destroy=function(e){return e},c.update=function(e){return e}):((c=function(e,t){return e&&Array.prototype.forEach.call(e.length?e:[e],(function(e){return i(e)})),e}).destroy=function(e){return e&&Array.prototype.forEach.call(e.length?e:[e],s),e},c.update=function(e){return e&&Array.prototype.forEach.call(e.length?e:[e],a),e}),t.default=c,e.exports=t.default})?n.apply(t,[e,t]):n)||(e.exports=o)},4403:function(e,t){var n;!function(){"use strict";var o={}.hasOwnProperty;function r(){for(var e=[],t=0;t<arguments.length;t++){var n=arguments[t];if(n){var l=typeof n;if("string"===l||"number"===l)e.push(n);else if(Array.isArray(n)){if(n.length){var i=r.apply(null,n);i&&e.push(i)}}else if("object"===l)if(n.toString===Object.prototype.toString)for(var s in n)o.call(n,s)&&n[s]&&e.push(s);else e.push(n.toString())}}return e.join(" ")}e.exports?(r.default=r,e.exports=r):void 0===(n=function(){return r}.apply(t,[]))||(e.exports=n)}()},4827:function(e){e.exports=function(e,t,n){return((n=window.getComputedStyle)?n(e):e.currentStyle)[t.replace(/-(\w)/gi,(function(e,t){return t.toUpperCase()}))]}},1198:function(e,t){"use strict";function n(){}function o(e,t,n,o,r){for(var l=0,i=t.length,s=0,a=0;l<i;l++){var c=t[l];if(c.removed){if(c.value=e.join(o.slice(a,a+c.count)),a+=c.count,l&&t[l-1].added){var u=t[l-1];t[l-1]=t[l],t[l]=u}}else{if(!c.added&&r){var d=n.slice(s,s+c.count);d=d.map((function(e,t){var n=o[a+t];return n.length>e.length?n:e})),c.value=e.join(d)}else c.value=e.join(n.slice(s,s+c.count));s+=c.count,c.added||(a+=c.count)}}var p=t[i-1];return i>1&&"string"==typeof p.value&&(p.added||p.removed)&&e.equals("",p.value)&&(t[i-2].value+=p.value,t.pop()),t}function r(e){return{newPos:e.newPos,components:e.components.slice(0)}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=n,n.prototype={diff:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},l=n.callback;"function"==typeof n&&(l=n,n={}),this.options=n;var i=this;function s(e){return l?(setTimeout((function(){l(void 0,e)}),0),!0):e}e=this.castInput(e),t=this.castInput(t),e=this.removeEmpty(this.tokenize(e));var a=(t=this.removeEmpty(this.tokenize(t))).length,c=e.length,u=1,d=a+c,p=[{newPos:-1,components:[]}],m=this.extractCommon(p[0],t,e,0);if(p[0].newPos+1>=a&&m+1>=c)return s([{value:this.join(t),count:t.length}]);function f(){for(var n=-1*u;n<=u;n+=2){var l=void 0,d=p[n-1],m=p[n+1],f=(m?m.newPos:0)-n;d&&(p[n-1]=void 0);var g=d&&d.newPos+1<a,h=m&&0<=f&&f<c;if(g||h){if(!g||h&&d.newPos<m.newPos?(l=r(m),i.pushComponent(l.components,void 0,!0)):((l=d).newPos++,i.pushComponent(l.components,!0,void 0)),f=i.extractCommon(l,t,e,n),l.newPos+1>=a&&f+1>=c)return s(o(i,l.components,t,e,i.useLongestToken));p[n]=l}else p[n]=void 0}u++}if(l)!function e(){setTimeout((function(){if(u>d)return l();f()||e()}),0)}();else for(;u<=d;){var g=f();if(g)return g}},pushComponent:function(e,t,n){var o=e[e.length-1];o&&o.added===t&&o.removed===n?e[e.length-1]={count:o.count+1,added:t,removed:n}:e.push({count:1,added:t,removed:n})},extractCommon:function(e,t,n,o){for(var r=t.length,l=n.length,i=e.newPos,s=i-o,a=0;i+1<r&&s+1<l&&this.equals(t[i+1],n[s+1]);)i++,s++,a++;return a&&e.components.push({count:a}),e.newPos=i,s},equals:function(e,t){return this.options.comparator?this.options.comparator(e,t):e===t||this.options.ignoreCase&&e.toLowerCase()===t.toLowerCase()},removeEmpty:function(e){for(var t=[],n=0;n<e.length;n++)e[n]&&t.push(e[n]);return t},castInput:function(e){return e},tokenize:function(e){return e.split("")},join:function(e){return e.join("")}}},1973:function(e,t,n){"use strict";var o;t.Kx=function(e,t,n){return r.diff(e,t,n)};var r=new(((o=n(1198))&&o.__esModule?o:{default:o}).default)},1345:function(e,t,n){"use strict";var o=n(5022);e.exports=function(e,t,n){n=n||{},9===t.nodeType&&(t=o.getWindow(t));var r=n.allowHorizontalScroll,l=n.onlyScrollIfNeeded,i=n.alignWithTop,s=n.alignWithLeft,a=n.offsetTop||0,c=n.offsetLeft||0,u=n.offsetBottom||0,d=n.offsetRight||0;r=void 0===r||r;var p=o.isWindow(t),m=!(!p||!t.frameElement),f=o.offset(e),g=o.outerHeight(e),h=o.outerWidth(e),v=void 0,b=void 0,k=void 0,_=void 0,y=void 0,E=void 0,C=void 0,S=void 0,w=void 0,B=void 0;m&&(t=t.document.scrollingElement||t.document.body),p||m?(C=t,B=o.height(C),w=o.width(C),S={left:o.scrollLeft(C),top:o.scrollTop(C)},y={left:f.left-S.left-c,top:f.top-S.top-a},E={left:f.left+h-(S.left+w)+d,top:f.top+g-(S.top+B)+u},_=S):(v=o.offset(t),b=t.clientHeight,k=t.clientWidth,_={left:t.scrollLeft,top:t.scrollTop},y={left:f.left-(v.left+(parseFloat(o.css(t,"borderLeftWidth"))||0))-c,top:f.top-(v.top+(parseFloat(o.css(t,"borderTopWidth"))||0))-a},E={left:f.left+h-(v.left+k+(parseFloat(o.css(t,"borderRightWidth"))||0))+d,top:f.top+g-(v.top+b+(parseFloat(o.css(t,"borderBottomWidth"))||0))+u}),y.top<0||E.top>0?!0===i?o.scrollTop(t,_.top+y.top):!1===i?o.scrollTop(t,_.top+E.top):y.top<0?o.scrollTop(t,_.top+y.top):o.scrollTop(t,_.top+E.top):l||((i=void 0===i||!!i)?o.scrollTop(t,_.top+y.top):o.scrollTop(t,_.top+E.top)),r&&(y.left<0||E.left>0?!0===s?o.scrollLeft(t,_.left+y.left):!1===s?o.scrollLeft(t,_.left+E.left):y.left<0?o.scrollLeft(t,_.left+y.left):o.scrollLeft(t,_.left+E.left):l||((s=void 0===s||!!s)?o.scrollLeft(t,_.left+y.left):o.scrollLeft(t,_.left+E.left)))}},5425:function(e,t,n){"use strict";e.exports=n(1345)},5022:function(e){"use strict";var t=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function o(e,t){var n=e["page"+(t?"Y":"X")+"Offset"],o="scroll"+(t?"Top":"Left");if("number"!=typeof n){var r=e.document;"number"!=typeof(n=r.documentElement[o])&&(n=r.body[o])}return n}function r(e){return o(e)}function l(e){return o(e,!0)}function i(e){var t=function(e){var t,n=void 0,o=void 0,r=e.ownerDocument,l=r.body,i=r&&r.documentElement;return n=(t=e.getBoundingClientRect()).left,o=t.top,{left:n-=i.clientLeft||l.clientLeft||0,top:o-=i.clientTop||l.clientTop||0}}(e),n=e.ownerDocument,o=n.defaultView||n.parentWindow;return t.left+=r(o),t.top+=l(o),t}var s=new RegExp("^("+/[\-+]?(?:\d*\.|)\d+(?:[eE][\-+]?\d+|)/.source+")(?!px)[a-z%]+$","i"),a=/^(top|right|bottom|left)$/,c=void 0;function u(e,t){for(var n=0;n<e.length;n++)t(e[n])}function d(e){return"border-box"===c(e,"boxSizing")}"undefined"!=typeof window&&(c=window.getComputedStyle?function(e,t,n){var o="",r=e.ownerDocument,l=n||r.defaultView.getComputedStyle(e,null);return l&&(o=l.getPropertyValue(t)||l[t]),o}:function(e,t){var n=e.currentStyle&&e.currentStyle[t];if(s.test(n)&&!a.test(t)){var o=e.style,r=o.left,l=e.runtimeStyle.left;e.runtimeStyle.left=e.currentStyle.left,o.left="fontSize"===t?"1em":n||0,n=o.pixelLeft+"px",o.left=r,e.runtimeStyle.left=l}return""===n?"auto":n});var p=["margin","border","padding"];function m(e,t,n){var o={},r=e.style,l=void 0;for(l in t)t.hasOwnProperty(l)&&(o[l]=r[l],r[l]=t[l]);for(l in n.call(e),t)t.hasOwnProperty(l)&&(r[l]=o[l])}function f(e,t,n){var o=0,r=void 0,l=void 0,i=void 0;for(l=0;l<t.length;l++)if(r=t[l])for(i=0;i<n.length;i++){var s;s="border"===r?r+n[i]+"Width":r+n[i],o+=parseFloat(c(e,s))||0}return o}function g(e){return null!=e&&e==e.window}var h={};function v(e,t,n){if(g(e))return"width"===t?h.viewportWidth(e):h.viewportHeight(e);if(9===e.nodeType)return"width"===t?h.docWidth(e):h.docHeight(e);var o="width"===t?["Left","Right"]:["Top","Bottom"],r="width"===t?e.offsetWidth:e.offsetHeight,l=(c(e),d(e)),i=0;(null==r||r<=0)&&(r=void 0,(null==(i=c(e,t))||Number(i)<0)&&(i=e.style[t]||0),i=parseFloat(i)||0),void 0===n&&(n=l?1:-1);var s=void 0!==r||l,a=r||i;if(-1===n)return s?a-f(e,["border","padding"],o):i;if(s){var u=2===n?-f(e,["border"],o):f(e,["margin"],o);return a+(1===n?0:u)}return i+f(e,p.slice(n),o)}u(["Width","Height"],(function(e){h["doc"+e]=function(t){var n=t.document;return Math.max(n.documentElement["scroll"+e],n.body["scroll"+e],h["viewport"+e](n))},h["viewport"+e]=function(t){var n="client"+e,o=t.document,r=o.body,l=o.documentElement[n];return"CSS1Compat"===o.compatMode&&l||r&&r[n]||l}}));var b={position:"absolute",visibility:"hidden",display:"block"};function k(e){var t=void 0,n=arguments;return 0!==e.offsetWidth?t=v.apply(void 0,n):m(e,b,(function(){t=v.apply(void 0,n)})),t}function _(e,t,o){var r=o;if("object"!==(void 0===t?"undefined":n(t)))return void 0!==r?("number"==typeof r&&(r+="px"),void(e.style[t]=r)):c(e,t);for(var l in t)t.hasOwnProperty(l)&&_(e,l,t[l])}u(["width","height"],(function(e){var t=e.charAt(0).toUpperCase()+e.slice(1);h["outer"+t]=function(t,n){return t&&k(t,e,n?0:1)};var n="width"===e?["Left","Right"]:["Top","Bottom"];h[e]=function(t,o){return void 0===o?t&&k(t,e,-1):t?(c(t),d(t)&&(o+=f(t,["padding","border"],n)),_(t,e,o)):void 0}})),e.exports=t({getWindow:function(e){var t=e.ownerDocument||e;return t.defaultView||t.parentWindow},offset:function(e,t){if(void 0===t)return i(e);!function(e,t){"static"===_(e,"position")&&(e.style.position="relative");var n=i(e),o={},r=void 0,l=void 0;for(l in t)t.hasOwnProperty(l)&&(r=parseFloat(_(e,l))||0,o[l]=r+t[l]-n[l]);_(e,o)}(e,t)},isWindow:g,each:u,css:_,clone:function(e){var t={};for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);if(e.overflow)for(var n in e)e.hasOwnProperty(n)&&(t.overflow[n]=e.overflow[n]);return t},scrollLeft:function(e,t){if(g(e)){if(void 0===t)return r(e);window.scrollTo(t,l(e))}else{if(void 0===t)return e.scrollLeft;e.scrollLeft=t}},scrollTop:function(e,t){if(g(e)){if(void 0===t)return l(e);window.scrollTo(r(e),t)}else{if(void 0===t)return e.scrollTop;e.scrollTop=t}},viewportWidth:0,viewportHeight:0},h)},8575:function(e){"function"==typeof Object.create?e.exports=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:e.exports=function(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}},9894:function(e,t,n){var o=n(4827);e.exports=function(e){var t=o(e,"line-height"),n=parseFloat(t,10);if(t===n+""){var r=e.style.lineHeight;e.style.lineHeight=t+"em",t=o(e,"line-height"),n=parseFloat(t,10),r?e.style.lineHeight=r:delete e.style.lineHeight}if(-1!==t.indexOf("pt")?(n*=4,n/=3):-1!==t.indexOf("mm")?(n*=96,n/=25.4):-1!==t.indexOf("cm")?(n*=96,n/=2.54):-1!==t.indexOf("in")?n*=96:-1!==t.indexOf("pc")&&(n*=16),n=Math.round(n),"normal"===t){var l=e.nodeName,i=document.createElement(l);i.innerHTML=" ","TEXTAREA"===l.toUpperCase()&&i.setAttribute("rows","1");var s=o(e,"font-size");i.style.fontSize=s,i.style.padding="0px",i.style.border="0px";var a=document.body;a.appendChild(i),n=i.offsetHeight,a.removeChild(i)}return n}},5372:function(e,t,n){"use strict";var o=n(9567);function r(){}function l(){}l.resetWarningCache=r,e.exports=function(){function e(e,t,n,r,l,i){if(i!==o){var s=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:l,resetWarningCache:r};return n.PropTypes=n,n}},2652:function(e,t,n){e.exports=n(5372)()},9567:function(e){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},5438:function(e,t,n){"use strict";var o,r=this&&this.__extends||(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function __(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)}),l=this&&this.__assign||Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},i=this&&this.__rest||function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&(n[o[r]]=e[o[r]])}return n};t.__esModule=!0;var s=n(9196),a=n(2652),c=n(6411),u=n(9894),d="autosize:resized",p=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.state={lineHeight:null},t.textarea=null,t.onResize=function(e){t.props.onResize&&t.props.onResize(e)},t.updateLineHeight=function(){t.textarea&&t.setState({lineHeight:u(t.textarea)})},t.onChange=function(e){var n=t.props.onChange;t.currentValue=e.currentTarget.value,n&&n(e)},t}return r(t,e),t.prototype.componentDidMount=function(){var e=this,t=this.props,n=t.maxRows,o=t.async;"number"==typeof n&&this.updateLineHeight(),"number"==typeof n||o?setTimeout((function(){return e.textarea&&c(e.textarea)})):this.textarea&&c(this.textarea),this.textarea&&this.textarea.addEventListener(d,this.onResize)},t.prototype.componentWillUnmount=function(){this.textarea&&(this.textarea.removeEventListener(d,this.onResize),c.destroy(this.textarea))},t.prototype.render=function(){var e=this,t=this.props,n=(t.onResize,t.maxRows),o=(t.onChange,t.style),r=(t.innerRef,t.children),a=i(t,["onResize","maxRows","onChange","style","innerRef","children"]),c=this.state.lineHeight,u=n&&c?c*n:null;return s.createElement("textarea",l({},a,{onChange:this.onChange,style:u?l({},o,{maxHeight:u}):o,ref:function(t){e.textarea=t,"function"==typeof e.props.innerRef?e.props.innerRef(t):e.props.innerRef&&(e.props.innerRef.current=t)}}),r)},t.prototype.componentDidUpdate=function(){this.textarea&&c.update(this.textarea)},t.defaultProps={rows:1,async:!1},t.propTypes={rows:a.number,maxRows:a.number,onResize:a.func,innerRef:a.any,async:a.bool},t}(s.Component);t.TextareaAutosize=s.forwardRef((function(e,t){return s.createElement(p,l({},e,{innerRef:t}))}))},773:function(e,t,n){"use strict";var o=n(5438);t.Z=o.TextareaAutosize},3124:function(e){var t=e.exports=function(e){return new n(e)};function n(e){this.value=e}function o(e,t,n){var o=[],i=[],u=!0;return function e(d){var p=n?r(d):d,m={},f=!0,g={node:p,node_:d,path:[].concat(o),parent:i[i.length-1],parents:i,key:o.slice(-1)[0],isRoot:0===o.length,level:o.length,circular:null,update:function(e,t){g.isRoot||(g.parent.node[g.key]=e),g.node=e,t&&(f=!1)},delete:function(e){delete g.parent.node[g.key],e&&(f=!1)},remove:function(e){s(g.parent.node)?g.parent.node.splice(g.key,1):delete g.parent.node[g.key],e&&(f=!1)},keys:null,before:function(e){m.before=e},after:function(e){m.after=e},pre:function(e){m.pre=e},post:function(e){m.post=e},stop:function(){u=!1},block:function(){f=!1}};if(!u)return g;function h(){if("object"==typeof g.node&&null!==g.node){g.keys&&g.node_===g.node||(g.keys=l(g.node)),g.isLeaf=0==g.keys.length;for(var e=0;e<i.length;e++)if(i[e].node_===d){g.circular=i[e];break}}else g.isLeaf=!0,g.keys=null;g.notLeaf=!g.isLeaf,g.notRoot=!g.isRoot}h();var v=t.call(g,g.node);return void 0!==v&&g.update&&g.update(v),m.before&&m.before.call(g,g.node),f?("object"!=typeof g.node||null===g.node||g.circular||(i.push(g),h(),a(g.keys,(function(t,r){o.push(t),m.pre&&m.pre.call(g,g.node[t],t);var l=e(g.node[t]);n&&c.call(g.node,t)&&(g.node[t]=l.node),l.isLast=r==g.keys.length-1,l.isFirst=0==r,m.post&&m.post.call(g,l),o.pop()})),i.pop()),m.after&&m.after.call(g,g.node),g):g}(e).node}function r(e){if("object"==typeof e&&null!==e){var t;if(s(e))t=[];else if("[object Date]"===i(e))t=new Date(e.getTime?e.getTime():e);else if("[object RegExp]"===i(e))t=new RegExp(e);else if(function(e){return"[object Error]"===i(e)}(e))t={message:e.message};else if(function(e){return"[object Boolean]"===i(e)}(e))t=new Boolean(e);else if(function(e){return"[object Number]"===i(e)}(e))t=new Number(e);else if(function(e){return"[object String]"===i(e)}(e))t=new String(e);else if(Object.create&&Object.getPrototypeOf)t=Object.create(Object.getPrototypeOf(e));else if(e.constructor===Object)t={};else{var n=e.constructor&&e.constructor.prototype||e.__proto__||{},o=function(){};o.prototype=n,t=new o}return a(l(e),(function(n){t[n]=e[n]})),t}return e}n.prototype.get=function(e){for(var t=this.value,n=0;n<e.length;n++){var o=e[n];if(!t||!c.call(t,o)){t=void 0;break}t=t[o]}return t},n.prototype.has=function(e){for(var t=this.value,n=0;n<e.length;n++){var o=e[n];if(!t||!c.call(t,o))return!1;t=t[o]}return!0},n.prototype.set=function(e,t){for(var n=this.value,o=0;o<e.length-1;o++){var r=e[o];c.call(n,r)||(n[r]={}),n=n[r]}return n[e[o]]=t,t},n.prototype.map=function(e){return o(this.value,e,!0)},n.prototype.forEach=function(e){return this.value=o(this.value,e,!1),this.value},n.prototype.reduce=function(e,t){var n=1===arguments.length,o=n?this.value:t;return this.forEach((function(t){this.isRoot&&n||(o=e.call(this,o,t))})),o},n.prototype.paths=function(){var e=[];return this.forEach((function(t){e.push(this.path)})),e},n.prototype.nodes=function(){var e=[];return this.forEach((function(t){e.push(this.node)})),e},n.prototype.clone=function(){var e=[],t=[];return function n(o){for(var i=0;i<e.length;i++)if(e[i]===o)return t[i];if("object"==typeof o&&null!==o){var s=r(o);return e.push(o),t.push(s),a(l(o),(function(e){s[e]=n(o[e])})),e.pop(),t.pop(),s}return o}(this.value)};var l=Object.keys||function(e){var t=[];for(var n in e)t.push(n);return t};function i(e){return Object.prototype.toString.call(e)}var s=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)},a=function(e,t){if(e.forEach)return e.forEach(t);for(var n=0;n<e.length;n++)t(e[n],n,e)};a(l(n.prototype),(function(e){t[e]=function(t){var o=[].slice.call(arguments,1),r=new n(t);return r[e].apply(r,o)}}));var c=Object.hasOwnProperty||function(e,t){return t in e}},9196:function(e){"use strict";e.exports=window.React}},t={};function n(o){var r=t[o];if(void 0!==r)return r.exports;var l=t[o]={exports:{}};return e[o].call(l.exports,l,l.exports,n),l.exports}n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,{a:t}),t},n.d=function(e,t){for(var o in t)n.o(t,o)&&!n.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var o={};!function(){"use strict";n.r(o),n.d(o,{AlignmentControl:function(){return Vv},AlignmentToolbar:function(){return Hv},Autocomplete:function(){return Zv},BlockAlignmentControl:function(){return Kr},BlockAlignmentToolbar:function(){return qr},BlockBreadcrumb:function(){return tb},BlockColorsStyleSelector:function(){return ib},BlockContextProvider:function(){return pl},BlockControls:function(){return so},BlockEdit:function(){return hl},BlockEditorKeyboardShortcuts:function(){return xy},BlockEditorProvider:function(){return Kc},BlockFormatControls:function(){return io},BlockIcon:function(){return Wc},BlockInspector:function(){return Sy},BlockList:function(){return Of},BlockMover:function(){return om},BlockNavigationDropdown:function(){return Bb},BlockPreview:function(){return kd},BlockSelectionClearer:function(){return Zc},BlockSettingsMenu:function(){return rf},BlockSettingsMenuControls:function(){return ef},BlockStyles:function(){return Nb},BlockTitle:function(){return Up},BlockToolbar:function(){return mf},BlockTools:function(){return wy},BlockVerticalAlignmentControl:function(){return pr},BlockVerticalAlignmentToolbar:function(){return mr},ButtonBlockAppender:function(){return Rp},ButtonBlockerAppender:function(){return Pp},ColorPalette:function(){return Kb},ColorPaletteControl:function(){return qb},ContrastChecker:function(){return Ng},CopyHandler:function(){return Om},DefaultBlockAppender:function(){return Tp},FontSizePicker:function(){return hh},InnerBlocks:function(){return Mf},Inserter:function(){return xp},InspectorAdvancedControls:function(){return Ao},InspectorControls:function(){return Do},JustifyContentControl:function(){return hr},JustifyToolbar:function(){return vr},LineHeightControl:function(){return Xg},MediaPlaceholder:function(){return y_},MediaReplaceFlow:function(){return g_},MediaUpload:function(){return m_},MediaUploadCheck:function(){return f_},MultiSelectScrollIntoView:function(){return Ty},NavigableToolbar:function(){return Kp},ObserveTyping:function(){return My},PanelColorSettings:function(){return E_},PlainText:function(){return Z_},RichText:function(){return K_},RichTextShortcut:function(){return J_},RichTextToolbarButton:function(){return ey},SETTINGS_DEFAULTS:function(){return v},SkipToSelectedBlock:function(){return by},ToolSelector:function(){return oy},Typewriter:function(){return Oy},URLInput:function(){return Hk},URLInputButton:function(){return sy},URLPopover:function(){return b_},Warning:function(){return bl},WritingFlow:function(){return uu},__experimentalBlockAlignmentMatrixControl:function(){return Jv},__experimentalBlockFullHeightAligmentControl:function(){return Xv},__experimentalBlockPatternSetup:function(){return Gb},__experimentalBlockPatternsList:function(){return Gd},__experimentalBlockVariationPicker:function(){return Rb},__experimentalBlockVariationTransforms:function(){return $b},__experimentalBorderRadiusControl:function(){return Xf},__experimentalColorGradientControl:function(){return wg},__experimentalColorGradientSettingsDropdown:function(){return Tg},__experimentalDateFormatPicker:function(){return Qb},__experimentalDuotoneControl:function(){return rv},__experimentalElementButtonClassName:function(){return Uy},__experimentalFontAppearanceControl:function(){return Qg},__experimentalFontFamilyControl:function(){return ah},__experimentalGetBorderClassesAndStyles:function(){return _v},__experimentalGetColorClassesAndStyles:function(){return Ev},__experimentalGetGradientClass:function(){return vg},__experimentalGetGradientObjectByGradientValue:function(){return kg},__experimentalGetMatchingVariation:function(){return Wy},__experimentalGetSpacingClassesAndStyles:function(){return wv},__experimentalImageEditingProvider:function(){return Ck},__experimentalImageEditor:function(){return Mk},__experimentalImageSizeControl:function(){return Ak},__experimentalImageURLInputUI:function(){return gy},__experimentalLayoutStyle:function(){return Dr},__experimentalLetterSpacingControl:function(){return Fh},__experimentalLibrary:function(){return By},__experimentalLinkControl:function(){return u_},__experimentalLinkControlSearchInput:function(){return n_},__experimentalLinkControlSearchItem:function(){return Wk},__experimentalLinkControlSearchResults:function(){return Zk},__experimentalListView:function(){return Sb},__experimentalPanelColorGradientSettings:function(){return ok},__experimentalPreviewOptions:function(){return hy},__experimentalPublishDateTimePicker:function(){return Gy},__experimentalResponsiveBlockControl:function(){return X_},__experimentalTextDecorationControl:function(){return Bh},__experimentalTextTransformControl:function(){return Lh},__experimentalUnitControl:function(){return ry},__experimentalUseBlockOverlayActive:function(){return nb},__experimentalUseBlockPreview:function(){return _d},__experimentalUseBorderProps:function(){return yv},__experimentalUseColorProps:function(){return Sv},__experimentalUseCustomSides:function(){return er},__experimentalUseGradient:function(){return yg},__experimentalUseNoRecursiveRenders:function(){return Vy},__experimentalUseResizeCanvas:function(){return vy},__unstableBlockNameContext:function(){return pf},__unstableBlockSettingsMenuFirstItem:function(){return Um},__unstableBlockToolbarLastItem:function(){return Pm},__unstableEditorStyles:function(){return gd},__unstableIframe:function(){return mu},__unstableInserterMenuExtension:function(){return vp},__unstablePresetDuotoneFilter:function(){return fv},__unstableRichTextInputEvent:function(){return ty},__unstableUseBlockSelectionClearer:function(){return Yc},__unstableUseClipboardHandler:function(){return Dm},__unstableUseMouseMoveTypingReset:function(){return Py},__unstableUseTypewriter:function(){return Dy},__unstableUseTypingObserver:function(){return Ry},createCustomColorsHOC:function(){return Nv},getColorClassName:function(){return ng},getColorObjectByAttributeValues:function(){return eg},getColorObjectByColorValue:function(){return tg},getFontSize:function(){return mh},getFontSizeClass:function(){return gh},getFontSizeObjectByValue:function(){return fh},getGradientSlugByValue:function(){return _g},getGradientValueBySlug:function(){return bg},getPxFromCssUnit:function(){return eE},store:function(){return Qn},storeConfig:function(){return Zn},transformStyles:function(){return pd},useBlockDisplayInformation:function(){return Hp},useBlockEditContext:function(){return to},useBlockProps:function(){return Mc},useCachedTruthy:function(){return Bv},useInnerBlocksProps:function(){return Rf},useSetting:function(){return So},withColorContext:function(){return jb},withColors:function(){return Pv},withFontSizes:function(){return Mv}});var e={};n.r(e),n.d(e,{__experimentalGetActiveBlockIdByBlockNames:function(){return Ot},__experimentalGetAllowedBlocks:function(){return vt},__experimentalGetAllowedPatterns:function(){return yt},__experimentalGetBlockListSettingsForBlocks:function(){return It},__experimentalGetDirectInsertBlock:function(){return bt},__experimentalGetGlobalBlocksByName:function(){return J},__experimentalGetLastBlockAttributeChanges:function(){return Nt},__experimentalGetParsedPattern:function(){return kt},__experimentalGetPatternTransformItems:function(){return Ct},__experimentalGetPatternsByBlockTypes:function(){return Et},__experimentalGetReusableBlockTitle:function(){return xt},__unstableGetBlockWithoutInnerBlocks:function(){return j},__unstableGetClientIdWithClientIdsTree:function(){return q},__unstableGetClientIdsTree:function(){return Y},__unstableGetSelectedBlocksWithPartialSelection:function(){return Re},__unstableGetVisibleBlocks:function(){return Vt},__unstableIsFullySelected:function(){return Te},__unstableIsLastBlockChangeIgnored:function(){return Tt},__unstableIsSelectionCollapsed:function(){return Ne},__unstableIsSelectionMergeable:function(){return Pe},areInnerBlocksControlled:function(){return Dt},canEditBlock:function(){return st},canInsertBlockType:function(){return tt},canInsertBlocks:function(){return nt},canLockBlockType:function(){return at},canMoveBlock:function(){return lt},canMoveBlocks:function(){return it},canRemoveBlock:function(){return ot},canRemoveBlocks:function(){return rt},didAutomaticChange:function(){return Lt},getAdjacentBlockClientId:function(){return ge},getBlock:function(){return $},getBlockAttributes:function(){return W},getBlockCount:function(){return te},getBlockHierarchyRootClientId:function(){return me},getBlockIndex:function(){return Le},getBlockInsertionPoint:function(){return qe},getBlockListSettings:function(){return St},getBlockMode:function(){return He},getBlockName:function(){return G},getBlockOrder:function(){return Me},getBlockParents:function(){return de},getBlockParentsByBlockName:function(){return pe},getBlockRootClientId:function(){return ue},getBlockSelectionEnd:function(){return le},getBlockSelectionStart:function(){return re},getBlockTransformItems:function(){return gt},getBlocks:function(){return K},getBlocksByClientId:function(){return ee},getClientIdsOfDescendants:function(){return Z},getClientIdsWithDescendants:function(){return Q},getDraggedBlockClientIds:function(){return We},getFirstMultiSelectedBlockClientId:function(){return Ee},getGlobalBlockCount:function(){return X},getInserterItems:function(){return ft},getLastMultiSelectedBlockClientId:function(){return Ce},getLowestCommonAncestorWithSelectedBlock:function(){return fe},getMultiSelectedBlockClientIds:function(){return _e},getMultiSelectedBlocks:function(){return ye},getMultiSelectedBlocksEndClientId:function(){return xe},getMultiSelectedBlocksStartClientId:function(){return Ie},getNextBlockClientId:function(){return ve},getPreviousBlockClientId:function(){return he},getSelectedBlock:function(){return ce},getSelectedBlockClientId:function(){return ae},getSelectedBlockClientIds:function(){return ke},getSelectedBlockCount:function(){return ie},getSelectedBlocksInitialCaretPosition:function(){return be},getSelectionEnd:function(){return oe},getSelectionStart:function(){return ne},getSettings:function(){return wt},getTemplate:function(){return Qe},getTemplateLock:function(){return Xe},hasBlockMovingClientId:function(){return Mt},hasInserterItems:function(){return ht},hasMultiSelection:function(){return Fe},hasSelectedBlock:function(){return se},hasSelectedInnerBlock:function(){return De},isAncestorBeingDragged:function(){return je},isAncestorMultiSelected:function(){return Be},isBlockBeingDragged:function(){return $e},isBlockHighlighted:function(){return At},isBlockInsertionPointVisible:function(){return Ye},isBlockMultiSelected:function(){return we},isBlockSelected:function(){return Ae},isBlockValid:function(){return U},isBlockVisible:function(){return zt},isBlockWithinSelection:function(){return Oe},isCaretWithinFormattedText:function(){return Ke},isDraggingBlocks:function(){return Ue},isFirstMultiSelectedBlock:function(){return Se},isLastBlockChangePersistent:function(){return Bt},isMultiSelecting:function(){return ze},isNavigationMode:function(){return Rt},isSelectionEnabled:function(){return Ve},isTyping:function(){return Ge},isValidTemplate:function(){return Ze},wasBlockJustInserted:function(){return Ft}});var t={};n.r(t),n.d(t,{__unstableDeleteSelection:function(){return vn},__unstableExpandSelection:function(){return kn},__unstableMarkAutomaticChange:function(){return zn},__unstableMarkLastChangeAsPersistent:function(){return On},__unstableMarkNextChangeAsNotPersistent:function(){return Fn},__unstableSaveReusableBlock:function(){return Dn},__unstableSplitSelection:function(){return bn},clearSelectedBlock:function(){return en},duplicateBlocks:function(){return Gn},enterFormattedText:function(){return Nn},exitFormattedText:function(){return Pn},flashBlock:function(){return jn},hideInsertionPoint:function(){return fn},insertAfterBlock:function(){return Wn},insertBeforeBlock:function(){return Un},insertBlock:function(){return dn},insertBlocks:function(){return pn},insertDefaultBlock:function(){return Mn},mergeBlocks:function(){return yn},moveBlockToPosition:function(){return un},moveBlocksDown:function(){return sn},moveBlocksToPosition:function(){return cn},moveBlocksUp:function(){return an},multiSelect:function(){return Jt},receiveBlocks:function(){return $t},removeBlock:function(){return Cn},removeBlocks:function(){return En},replaceBlock:function(){return rn},replaceBlocks:function(){return on},replaceInnerBlocks:function(){return Sn},resetBlocks:function(){return Gt},resetSelection:function(){return Wt},selectBlock:function(){return qt},selectNextBlock:function(){return Zt},selectPreviousBlock:function(){return Yt},selectionChange:function(){return Rn},setBlockMovingClientId:function(){return Hn},setBlockVisibility:function(){return qn},setHasControlledInnerBlocks:function(){return Kn},setNavigationMode:function(){return Vn},setTemplateValidity:function(){return gn},showInsertionPoint:function(){return mn},startDraggingBlocks:function(){return xn},startMultiSelect:function(){return Qt},startTyping:function(){return Bn},stopDraggingBlocks:function(){return Tn},stopMultiSelect:function(){return Xt},stopTyping:function(){return In},synchronizeTemplate:function(){return hn},toggleBlockHighlight:function(){return $n},toggleBlockMode:function(){return wn},toggleSelection:function(){return tn},updateBlock:function(){return Kt},updateBlockAttributes:function(){return jt},updateBlockListSettings:function(){return Ln},updateSettings:function(){return An},validateBlocksToTemplate:function(){return Ut}});var r=window.wp.blocks,l=window.wp.hooks;function i(){return(i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e}).apply(this,arguments)}(0,l.addFilter)("blocks.registerBlockType","core/compat/migrateLightBlockWrapper",(function(e){const{apiVersion:t=1}=e;return t<2&&(0,r.hasBlockSupport)(e,"lightBlockWrapper",!1)&&(e.apiVersion=2),e}));var s=window.wp.element,a=n(4403),c=n.n(a),u=window.lodash,d=window.wp.compose,p=window.wp.components,m=window.wp.data,f={default:(0,p.createSlotFill)("BlockControls"),block:(0,p.createSlotFill)("BlockControlsBlock"),inline:(0,p.createSlotFill)("BlockFormatControls"),other:(0,p.createSlotFill)("BlockControlsOther"),parent:(0,p.createSlotFill)("BlockControlsParent")},g=window.wp.i18n;const h={insertUsage:{}},v={alignWide:!1,supportsLayout:!0,colors:[{name:(0,g.__)("Black"),slug:"black",color:"#000000"},{name:(0,g.__)("Cyan bluish gray"),slug:"cyan-bluish-gray",color:"#abb8c3"},{name:(0,g.__)("White"),slug:"white",color:"#ffffff"},{name:(0,g.__)("Pale pink"),slug:"pale-pink",color:"#f78da7"},{name:(0,g.__)("Vivid red"),slug:"vivid-red",color:"#cf2e2e"},{name:(0,g.__)("Luminous vivid orange"),slug:"luminous-vivid-orange",color:"#ff6900"},{name:(0,g.__)("Luminous vivid amber"),slug:"luminous-vivid-amber",color:"#fcb900"},{name:(0,g.__)("Light green cyan"),slug:"light-green-cyan",color:"#7bdcb5"},{name:(0,g.__)("Vivid green cyan"),slug:"vivid-green-cyan",color:"#00d084"},{name:(0,g.__)("Pale cyan blue"),slug:"pale-cyan-blue",color:"#8ed1fc"},{name:(0,g.__)("Vivid cyan blue"),slug:"vivid-cyan-blue",color:"#0693e3"},{name:(0,g.__)("Vivid purple"),slug:"vivid-purple",color:"#9b51e0"}],fontSizes:[{name:(0,g._x)("Small","font size name"),size:13,slug:"small"},{name:(0,g._x)("Normal","font size name"),size:16,slug:"normal"},{name:(0,g._x)("Medium","font size name"),size:20,slug:"medium"},{name:(0,g._x)("Large","font size name"),size:36,slug:"large"},{name:(0,g._x)("Huge","font size name"),size:42,slug:"huge"}],imageDefaultSize:"large",imageSizes:[{slug:"thumbnail",name:(0,g.__)("Thumbnail")},{slug:"medium",name:(0,g.__)("Medium")},{slug:"large",name:(0,g.__)("Large")},{slug:"full",name:(0,g.__)("Full Size")}],imageEditing:!0,maxWidth:580,allowedBlockTypes:!0,maxUploadFileSize:0,allowedMimeTypes:null,canLockBlocks:!0,__experimentalCanUserUseUnfilteredHTML:!1,__experimentalBlockDirectory:!1,__mobileEnablePageTemplates:!1,__experimentalBlockPatterns:[],__experimentalBlockPatternCategories:[],__unstableGalleryWithImageBlocks:!1,generateAnchors:!1,gradients:[{name:(0,g.__)("Vivid cyan blue to vivid purple"),gradient:"linear-gradient(135deg,rgba(6,147,227,1) 0%,rgb(155,81,224) 100%)",slug:"vivid-cyan-blue-to-vivid-purple"},{name:(0,g.__)("Light green cyan to vivid green cyan"),gradient:"linear-gradient(135deg,rgb(122,220,180) 0%,rgb(0,208,130) 100%)",slug:"light-green-cyan-to-vivid-green-cyan"},{name:(0,g.__)("Luminous vivid amber to luminous vivid orange"),gradient:"linear-gradient(135deg,rgba(252,185,0,1) 0%,rgba(255,105,0,1) 100%)",slug:"luminous-vivid-amber-to-luminous-vivid-orange"},{name:(0,g.__)("Luminous vivid orange to vivid red"),gradient:"linear-gradient(135deg,rgba(255,105,0,1) 0%,rgb(207,46,46) 100%)",slug:"luminous-vivid-orange-to-vivid-red"},{name:(0,g.__)("Very light gray to cyan bluish gray"),gradient:"linear-gradient(135deg,rgb(238,238,238) 0%,rgb(169,184,195) 100%)",slug:"very-light-gray-to-cyan-bluish-gray"},{name:(0,g.__)("Cool to warm spectrum"),gradient:"linear-gradient(135deg,rgb(74,234,220) 0%,rgb(151,120,209) 20%,rgb(207,42,186) 40%,rgb(238,44,130) 60%,rgb(251,105,98) 80%,rgb(254,248,76) 100%)",slug:"cool-to-warm-spectrum"},{name:(0,g.__)("Blush light purple"),gradient:"linear-gradient(135deg,rgb(255,206,236) 0%,rgb(152,150,240) 100%)",slug:"blush-light-purple"},{name:(0,g.__)("Blush bordeaux"),gradient:"linear-gradient(135deg,rgb(254,205,165) 0%,rgb(254,45,45) 50%,rgb(107,0,62) 100%)",slug:"blush-bordeaux"},{name:(0,g.__)("Luminous dusk"),gradient:"linear-gradient(135deg,rgb(255,203,112) 0%,rgb(199,81,192) 50%,rgb(65,88,208) 100%)",slug:"luminous-dusk"},{name:(0,g.__)("Pale ocean"),gradient:"linear-gradient(135deg,rgb(255,245,203) 0%,rgb(182,227,212) 50%,rgb(51,167,181) 100%)",slug:"pale-ocean"},{name:(0,g.__)("Electric grass"),gradient:"linear-gradient(135deg,rgb(202,248,128) 0%,rgb(113,206,126) 100%)",slug:"electric-grass"},{name:(0,g.__)("Midnight"),gradient:"linear-gradient(135deg,rgb(2,3,129) 0%,rgb(40,116,252) 100%)",slug:"midnight"}],__unstableResolvedAssets:{styles:[],scripts:[]}};function b(e,t,n){return[...e.slice(0,n),...(0,u.castArray)(t),...e.slice(n)]}function k(e,t,n){let o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;const r=[...e];return r.splice(t,o),b(r,e.slice(t,t+o),n)}function _(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const n={[t]:[]};return e.forEach((e=>{const{clientId:o,innerBlocks:r}=e;n[t].push(o),Object.assign(n,_(r,o))})),n}function y(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return e.reduce(((e,n)=>Object.assign(e,{[n.clientId]:t},y(n.innerBlocks,n.clientId))),{})}function E(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:u.identity;const n={},o=[...e];for(;o.length;){const{innerBlocks:e,...r}=o.shift();o.push(...e),n[r.clientId]=t(r)}return n}function C(e){return E(e,(e=>(0,u.omit)(e,"attributes")))}function S(e){return E(e,(e=>e.attributes))}function w(e,t){return"UPDATE_BLOCK_ATTRIBUTES"===e.type&&void 0!==t&&"UPDATE_BLOCK_ATTRIBUTES"===t.type&&(0,u.isEqual)(e.clientIds,t.clientIds)&&function(e,t){return(0,u.isEqual)((0,u.keys)(e),(0,u.keys)(t))}(e.attributes,t.attributes)}function B(e,t){const n={},o=[...t],r=[...t];for(;o.length;){const e=o.shift();o.push(...e.innerBlocks),r.push(...e.innerBlocks)}for(const e of r)n[e.clientId]={};for(const t of r)n[t.clientId]=Object.assign(n[t.clientId],{...e.byClientId[t.clientId],attributes:e.attributes[t.clientId],innerBlocks:t.innerBlocks.map((e=>n[e.clientId]))});return n}function I(e,t,n){let o=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const r=new Set([]),l=new Set;for(const t of n){let n=o?t:e.parents[t];do{if(e.controlledInnerBlocks[n]){l.add(n);break}r.add(n),n=e.parents[n]}while(void 0!==n)}for(const e of r)t[e]={...t[e]};for(const n of r)t[n].innerBlocks=(e.order[n]||[]).map((e=>t[e]));for(const n of l)t["controlled||"+n]={innerBlocks:(e.order[n]||[]).map((e=>t[e]))};return t}const x=(0,u.flow)(m.combineReducers,(e=>(t,n)=>{if(t&&"SAVE_REUSABLE_BLOCK_SUCCESS"===n.type){const{id:e,updatedId:o}=n;if(e===o)return t;(t={...t}).attributes=(0,u.mapValues)(t.attributes,((n,r)=>{const{name:l}=t.byClientId[r];return"core/block"===l&&n.ref===e?{...n,ref:o}:n}))}return e(t,n)}),(e=>function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;const o=e(t,n);if(o===t)return t;switch(o.tree=t.tree?t.tree:{},n.type){case"RECEIVE_BLOCKS":case"INSERT_BLOCKS":{const e=B(o,n.blocks);o.tree=I(o,{...o.tree,...e},n.rootClientId?[n.rootClientId]:[""],!0);break}case"UPDATE_BLOCK":o.tree=I(o,{...o.tree,[n.clientId]:{...o.tree[n.clientId],...o.byClientId[n.clientId],attributes:o.attributes[n.clientId]}},[n.clientId],!1);break;case"UPDATE_BLOCK_ATTRIBUTES":{const e=n.clientIds.reduce(((e,t)=>(e[t]={...o.tree[t],attributes:o.attributes[t]},e)),{});o.tree=I(o,{...o.tree,...e},n.clientIds,!1);break}case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":{const e=B(o,n.blocks);o.tree=I(o,{...(0,u.omit)(o.tree,n.replacedClientIds.concat(n.replacedClientIds.filter((t=>!e[t])).map((e=>"controlled||"+e)))),...e},n.blocks.map((e=>e.clientId)),!1);const r=[];for(const e of n.clientIds)void 0===t.parents[e]||""!==t.parents[e]&&!o.byClientId[t.parents[e]]||r.push(t.parents[e]);o.tree=I(o,o.tree,r,!0);break}case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":const e=[];for(const r of n.clientIds)void 0===t.parents[r]||""!==t.parents[r]&&!o.byClientId[t.parents[r]]||e.push(t.parents[r]);o.tree=I(o,(0,u.omit)(o.tree,n.removedClientIds.concat(n.removedClientIds.map((e=>"controlled||"+e)))),e,!0);break;case"MOVE_BLOCKS_TO_POSITION":{const e=[];n.fromRootClientId&&e.push(n.fromRootClientId),n.toRootClientId&&e.push(n.toRootClientId),n.fromRootClientId&&n.fromRootClientId||e.push(""),o.tree=I(o,o.tree,e,!0);break}case"MOVE_BLOCKS_UP":case"MOVE_BLOCKS_DOWN":{const e=[n.rootClientId?n.rootClientId:""];o.tree=I(o,o.tree,e,!0);break}case"SAVE_REUSABLE_BLOCK_SUCCESS":{const e=(0,u.keys)((0,u.omitBy)(o.attributes,((e,t)=>"core/block"!==o.byClientId[t].name||e.ref!==n.updatedId)));o.tree=I(o,{...o.tree,...e.reduce(((e,t)=>(e[t]={...o.byClientId[t],attributes:o.attributes[t],innerBlocks:o.tree[t].innerBlocks},e)),{})},e,!1)}}return o}),(e=>(t,n)=>{const o=e=>{let o=e;for(let r=0;r<o.length;r++)!t.order[o[r]]||n.keepControlledInnerBlocks&&n.keepControlledInnerBlocks[o[r]]||(o===e&&(o=[...o]),o.push(...t.order[o[r]]));return o};if(t)switch(n.type){case"REMOVE_BLOCKS":n={...n,type:"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN",removedClientIds:o(n.clientIds)};break;case"REPLACE_BLOCKS":n={...n,type:"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN",replacedClientIds:o(n.clientIds)}}return e(t,n)}),(e=>(t,n)=>{if("REPLACE_INNER_BLOCKS"!==n.type)return e(t,n);const o={};if(Object.keys(t.controlledInnerBlocks).length){const e=[...n.blocks];for(;e.length;){const{innerBlocks:n,...r}=e.shift();e.push(...n),t.controlledInnerBlocks[r.clientId]&&(o[r.clientId]=!0)}}let r=t;t.order[n.rootClientId]&&(r=e(r,{type:"REMOVE_BLOCKS",keepControlledInnerBlocks:o,clientIds:t.order[n.rootClientId]}));let l=r;return n.blocks.length&&(l=e(l,{...n,type:"INSERT_BLOCKS",index:0}),l.order={...l.order,...(0,u.reduce)(o,((e,n,o)=>(t.order[o]&&(e[o]=t.order[o]),e)),{})}),l}),(e=>(t,n)=>{if("RESET_BLOCKS"===n.type){const e={...t,byClientId:C(n.blocks),attributes:S(n.blocks),order:_(n.blocks),parents:y(n.blocks),controlledInnerBlocks:{},visibility:{}},o=B(e,n.blocks);return e.tree={...o,"":{innerBlocks:n.blocks.map((e=>o[e.clientId]))}},e}return e(t,n)}),(function(e){let t,n=!1;return(o,r)=>{let l=e(o,r);const i="MARK_LAST_CHANGE_AS_PERSISTENT"===r.type||n;if(o===l&&!i){var s;n="MARK_NEXT_CHANGE_AS_NOT_PERSISTENT"===r.type;const e=null===(s=null==o?void 0:o.isPersistentChange)||void 0===s||s;return o.isPersistentChange===e?o:{...l,isPersistentChange:e}}return l={...l,isPersistentChange:i?!n:!w(r,t)},t=r,n="MARK_NEXT_CHANGE_AS_NOT_PERSISTENT"===r.type,l}}),(function(e){const t=new Set(["RECEIVE_BLOCKS"]);return(n,o)=>{const r=e(n,o);return r!==n&&(r.isIgnoredChange=t.has(o.type)),r}}),(e=>(t,n)=>{if("SET_HAS_CONTROLLED_INNER_BLOCKS"===n.type){const o=e(t,{type:"REPLACE_INNER_BLOCKS",rootClientId:n.clientId,blocks:[]});return e(o,n)}return e(t,n)}))({byClientId(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"RECEIVE_BLOCKS":case"INSERT_BLOCKS":return{...e,...C(t.blocks)};case"UPDATE_BLOCK":if(!e[t.clientId])return e;const n=(0,u.omit)(t.updates,"attributes");return(0,u.isEmpty)(n)?e:{...e,[t.clientId]:{...e[t.clientId],...n}};case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":return t.blocks?{...(0,u.omit)(e,t.replacedClientIds),...C(t.blocks)}:e;case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":return(0,u.omit)(e,t.removedClientIds)}return e},attributes(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"RECEIVE_BLOCKS":case"INSERT_BLOCKS":return{...e,...S(t.blocks)};case"UPDATE_BLOCK":return e[t.clientId]&&t.updates.attributes?{...e,[t.clientId]:{...e[t.clientId],...t.updates.attributes}}:e;case"UPDATE_BLOCK_ATTRIBUTES":{if(t.clientIds.every((t=>!e[t])))return e;const n=t.clientIds.reduce(((n,o)=>({...n,[o]:(0,u.reduce)(t.uniqueByBlock?t.attributes[o]:t.attributes,((t,n,r)=>{var l,i;return n!==t[r]&&((t=(l=e[o])===(i=t)?{...l}:i)[r]=n),t}),e[o])})),{});return t.clientIds.every((t=>n[t]===e[t]))?e:{...e,...n}}case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":return t.blocks?{...(0,u.omit)(e,t.replacedClientIds),...S(t.blocks)}:e;case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":return(0,u.omit)(e,t.removedClientIds)}return e},order(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"RECEIVE_BLOCKS":{const n=_(t.blocks);return{...e,...(0,u.omit)(n,""),"":((null==e?void 0:e[""])||[]).concat(n[""])}}case"INSERT_BLOCKS":{const{rootClientId:n=""}=t,o=e[n]||[],r=_(t.blocks,n),{index:l=o.length}=t;return{...e,...r,[n]:b(o,r[n],l)}}case"MOVE_BLOCKS_TO_POSITION":{const{fromRootClientId:n="",toRootClientId:o="",clientIds:r}=t,{index:l=e[o].length}=t;if(n===o){const t=e[o].indexOf(r[0]);return{...e,[o]:k(e[o],t,l,r.length)}}return{...e,[n]:(0,u.without)(e[n],...r),[o]:b(e[o],r,l)}}case"MOVE_BLOCKS_UP":{const{clientIds:n,rootClientId:o=""}=t,r=(0,u.first)(n),l=e[o];if(!l.length||r===(0,u.first)(l))return e;const i=l.indexOf(r);return{...e,[o]:k(l,i,i-1,n.length)}}case"MOVE_BLOCKS_DOWN":{const{clientIds:n,rootClientId:o=""}=t,r=(0,u.first)(n),l=(0,u.last)(n),i=e[o];if(!i.length||l===(0,u.last)(i))return e;const s=i.indexOf(r);return{...e,[o]:k(i,s,s+1,n.length)}}case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":{const{clientIds:n}=t;if(!t.blocks)return e;const o=_(t.blocks);return(0,u.flow)([e=>(0,u.omit)(e,t.replacedClientIds),e=>({...e,...(0,u.omit)(o,"")}),e=>(0,u.mapValues)(e,(e=>(0,u.reduce)(e,((e,t)=>t===n[0]?[...e,...o[""]]:(-1===n.indexOf(t)&&e.push(t),e)),[])))])(e)}case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":return(0,u.flow)([e=>(0,u.omit)(e,t.removedClientIds),e=>(0,u.mapValues)(e,(e=>(0,u.without)(e,...t.removedClientIds)))])(e)}return e},parents(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"RECEIVE_BLOCKS":return{...e,...y(t.blocks)};case"INSERT_BLOCKS":return{...e,...y(t.blocks,t.rootClientId||"")};case"MOVE_BLOCKS_TO_POSITION":return{...e,...t.clientIds.reduce(((e,n)=>(e[n]=t.toRootClientId||"",e)),{})};case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":return{...(0,u.omit)(e,t.replacedClientIds),...y(t.blocks,e[t.clientIds[0]])};case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":return(0,u.omit)(e,t.removedClientIds)}return e},controlledInnerBlocks(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{type:t,clientId:n,hasControlledInnerBlocks:o}=arguments.length>1?arguments[1]:void 0;return"SET_HAS_CONTROLLED_INNER_BLOCKS"===t?{...e,[n]:o}:e},visibility(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return"SET_BLOCK_VISIBILITY"===t.type?{...e,...t.updates}:e}});function T(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"CLEAR_SELECTED_BLOCK":return e.clientId?{}:e;case"SELECT_BLOCK":return t.clientId===e.clientId?e:{clientId:t.clientId};case"REPLACE_INNER_BLOCKS":case"INSERT_BLOCKS":return t.updateSelection&&t.blocks.length?{clientId:t.blocks[0].clientId}:e;case"REMOVE_BLOCKS":return t.clientIds&&t.clientIds.length&&-1!==t.clientIds.indexOf(e.clientId)?{}:e;case"REPLACE_BLOCKS":{if(-1===t.clientIds.indexOf(e.clientId))return e;const n=t.blocks[t.indexToSelect]||t.blocks[t.blocks.length-1];return n?n.clientId===e.clientId?e:{clientId:n.clientId}:{}}}return e}var N=(0,m.combineReducers)({blocks:x,isTyping:function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"START_TYPING":return!0;case"STOP_TYPING":return!1}return e},draggedBlocks:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"START_DRAGGING_BLOCKS":return t.clientIds;case"STOP_DRAGGING_BLOCKS":return[]}return e},selection:function(){var e,t,n,o;let r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},l=arguments.length>1?arguments[1]:void 0;switch(l.type){case"SELECTION_CHANGE":return l.clientId?{selectionStart:{clientId:l.clientId,attributeKey:l.attributeKey,offset:l.startOffset},selectionEnd:{clientId:l.clientId,attributeKey:l.attributeKey,offset:l.endOffset}}:{selectionStart:l.start||r.selectionStart,selectionEnd:l.end||r.selectionEnd};case"RESET_SELECTION":const{selectionStart:i,selectionEnd:s}=l;return{selectionStart:i,selectionEnd:s};case"MULTI_SELECT":const{start:a,end:c}=l;return a===(null===(e=r.selectionStart)||void 0===e?void 0:e.clientId)&&c===(null===(t=r.selectionEnd)||void 0===t?void 0:t.clientId)?r:{selectionStart:{clientId:a},selectionEnd:{clientId:c}};case"RESET_BLOCKS":const u=null==r||null===(n=r.selectionStart)||void 0===n?void 0:n.clientId,d=null==r||null===(o=r.selectionEnd)||void 0===o?void 0:o.clientId;if(!u&&!d)return r;if(!l.blocks.some((e=>e.clientId===u)))return{selectionStart:{},selectionEnd:{}};if(!l.blocks.some((e=>e.clientId===d)))return{...r,selectionEnd:r.selectionStart}}return{selectionStart:T(r.selectionStart,l),selectionEnd:T(r.selectionEnd,l)}},isMultiSelecting:function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"START_MULTI_SELECT":return!0;case"STOP_MULTI_SELECT":return!1}return e},isSelectionEnabled:function(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"TOGGLE_SELECTION":return t.isSelectionEnabled}return e},initialPosition:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1?arguments[1]:void 0;return"REPLACE_BLOCKS"===t.type&&void 0!==t.initialPosition||["MULTI_SELECT","SELECT_BLOCK","RESET_SELECTION","INSERT_BLOCKS","REPLACE_INNER_BLOCKS"].includes(t.type)?t.initialPosition:e},blocksMode:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;if("TOGGLE_BLOCK_MODE"===t.type){const{clientId:n}=t;return{...e,[n]:e[n]&&"html"===e[n]?"visual":"html"}}return e},blockListSettings:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"REPLACE_BLOCKS":case"REMOVE_BLOCKS":return(0,u.omit)(e,t.clientIds);case"UPDATE_BLOCK_LIST_SETTINGS":{const{clientId:n}=t;return t.settings?(0,u.isEqual)(e[n],t.settings)?e:{...e,[n]:t.settings}:e.hasOwnProperty(n)?(0,u.omit)(e,n):e}}return e},insertionPoint:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SHOW_INSERTION_POINT":const{rootClientId:e,index:n,__unstableWithInserter:o}=t;return{rootClientId:e,index:n,__unstableWithInserter:o};case"HIDE_INSERTION_POINT":return null}return e},template:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{isValid:!0},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SET_TEMPLATE_VALIDITY":return{...e,isValid:t.isValid}}return e},settings:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:v,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"UPDATE_SETTINGS":return{...e,...t.settings}}return e},preferences:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:h,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"INSERT_BLOCKS":case"REPLACE_BLOCKS":return t.blocks.reduce(((e,n)=>{const{attributes:o,name:l}=n,i=(0,m.select)(r.store).getActiveBlockVariation(l,o);let s=null!=i&&i.name?`${l}/${i.name}`:l;const a={name:s};return"core/block"===l&&(a.ref=o.ref,s+="/"+o.ref),{...e,insertUsage:{...e.insertUsage,[s]:{time:t.time,count:e.insertUsage[s]?e.insertUsage[s].count+1:1,insert:a}}}}),e)}return e},lastBlockAttributesChange:function(e,t){switch(t.type){case"UPDATE_BLOCK":if(!t.updates.attributes)break;return{[t.clientId]:t.updates.attributes};case"UPDATE_BLOCK_ATTRIBUTES":return t.clientIds.reduce(((e,n)=>({...e,[n]:t.uniqueByBlock?t.attributes[n]:t.attributes})),{})}return null},isNavigationMode:function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0;return"INSERT_BLOCKS"!==t.type&&("SET_NAVIGATION_MODE"===t.type?t.isNavigationMode:e)},hasBlockMovingClientId:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1?arguments[1]:void 0;return"SET_BLOCK_MOVING_MODE"===t.type?t.hasBlockMovingClientId:"SET_NAVIGATION_MODE"===t.type?null:e},automaticChangeStatus:function(e,t){switch(t.type){case"MARK_AUTOMATIC_CHANGE":return"pending";case"MARK_AUTOMATIC_CHANGE_FINAL":return"pending"===e?"final":void 0;case"SELECTION_CHANGE":return"final"!==e?e:void 0;case"SET_BLOCK_VISIBILITY":case"START_TYPING":case"STOP_TYPING":return e}},highlightedBlock:function(e,t){switch(t.type){case"TOGGLE_BLOCK_HIGHLIGHT":const{clientId:n,isHighlighted:o}=t;return o?n:e===n?null:e;case"SELECT_BLOCK":if(t.clientId!==e)return null}return e},lastBlockInserted:function(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;switch(n.type){case"INSERT_BLOCKS":return n.blocks.length?{clientId:n.blocks[0].clientId,source:null===(e=n.meta)||void 0===e?void 0:e.source}:t;case"RESET_BLOCKS":return{}}return t}}),P={};function R(e){return[e]}function M(e,t,n){var o;if(e.length!==t.length)return!1;for(o=n;o<e.length;o++)if(e[o]!==t[o])return!1;return!0}function L(e,t){var n,o=t||R;function r(e){var t,o,r,l,i,s=n,a=!0;for(t=0;t<e.length;t++){if(!(i=o=e[t])||"object"!=typeof i){a=!1;break}s.has(o)?s=s.get(o):(r=new WeakMap,s.set(o,r),s=r)}return s.has(P)||((l=function(){var e={clear:function(){e.head=null}};return e}()).isUniqueByDependants=a,s.set(P,l)),s.get(P)}function l(){n=new WeakMap}function i(){var t,n,l,i,s,a=arguments.length;for(i=new Array(a),l=0;l<a;l++)i[l]=arguments[l];for((t=r(s=o.apply(null,i))).isUniqueByDependants||(t.lastDependants&&!M(s,t.lastDependants,0)&&t.clear(),t.lastDependants=s),n=t.head;n;){if(M(n.args,i,1))return n!==t.head&&(n.prev.next=n.next,n.next&&(n.next.prev=n.prev),n.next=t.head,n.prev=null,t.head.prev=n,t.head=n),n.val;n=n.next}return n={val:e.apply(null,i)},i[0]=null,n.args=i,t.head&&(t.head.prev=n,n.next=t.head),t.head=n,n.val}return i.getDependants=o,i.clear=l,l(),i}var A=window.wp.primitives,D=(0,s.createElement)(A.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(A.Path,{d:"M21.3 10.8l-5.6-5.6c-.7-.7-1.8-.7-2.5 0l-5.6 5.6c-.7.7-.7 1.8 0 2.5l5.6 5.6c.3.3.8.5 1.2.5s.9-.2 1.2-.5l5.6-5.6c.8-.7.8-1.9.1-2.5zm-1 1.4l-5.6 5.6c-.1.1-.3.1-.4 0l-5.6-5.6c-.1-.1-.1-.3 0-.4l5.6-5.6s.1-.1.2-.1.1 0 .2.1l5.6 5.6c.1.1.1.3 0 .4zm-16.6-.4L10 5.5l-1-1-6.3 6.3c-.7.7-.7 1.8 0 2.5L9 19.5l1.1-1.1-6.3-6.3c-.2 0-.2-.2-.1-.3z"})),O=window.wp.richText,F=window.wp.deprecated,z=n.n(F);function V(e){const{multiline:t,__unstableMultilineWrapperTags:n,__unstablePreserveWhiteSpace:o}=e;return{multilineTag:t,multilineWrapperTags:n,preserveWhiteSpace:o}}const H=[];function G(e,t){const n=e.blocks.byClientId[t],o="core/social-link";if("web"!==s.Platform.OS&&(null==n?void 0:n.name)===o){const n=e.blocks.attributes[t],{service:r}=n;return r?`core/social-link-${r}`:o}return n?n.name:null}function U(e,t){const n=e.blocks.byClientId[t];return!!n&&n.isValid}function W(e,t){return e.blocks.byClientId[t]?e.blocks.attributes[t]:null}function $(e,t){return e.blocks.byClientId[t]?e.blocks.tree[t]:null}const j=L(((e,t)=>{const n=e.blocks.byClientId[t];return n?{...n,attributes:W(e,t)}:null}),((e,t)=>[e.blocks.byClientId[t],e.blocks.attributes[t]]));function K(e,t){var n;const o=t&&Dt(e,t)?"controlled||"+t:t||"";return(null===(n=e.blocks.tree[o])||void 0===n?void 0:n.innerBlocks)||H}const q=L(((e,t)=>({clientId:t,innerBlocks:Y(e,t)})),(e=>[e.blocks.order])),Y=L((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return(0,u.map)(Me(e,t),(t=>q(e,t)))}),(e=>[e.blocks.order])),Z=L(((e,t)=>{const n=[];for(const o of t)for(const t of Me(e,o))n.push(t,...Z(e,[t]));return n}),(e=>[e.blocks.order])),Q=L((e=>{const t=[];for(const n of Me(e))t.push(n,...Z(e,[n]));return t}),(e=>[e.blocks.order])),X=L(((e,t)=>{const n=Q(e);return t?(0,u.reduce)(n,((n,o)=>e.blocks.byClientId[o].name===t?n+1:n),0):n.length}),(e=>[e.blocks.order,e.blocks.byClientId])),J=L(((e,t)=>{if(!t)return H;const n=Q(e).filter((n=>e.blocks.byClientId[n].name===t));return n.length>0?n:H}),(e=>[e.blocks.order,e.blocks.byClientId])),ee=L(((e,t)=>(0,u.map)((0,u.castArray)(t),(t=>$(e,t)))),((e,t)=>(0,u.map)((0,u.castArray)(t),(t=>e.blocks.tree[t]))));function te(e,t){return Me(e,t).length}function ne(e){return e.selection.selectionStart}function oe(e){return e.selection.selectionEnd}function re(e){return e.selection.selectionStart.clientId}function le(e){return e.selection.selectionEnd.clientId}function ie(e){return _e(e).length||(e.selection.selectionStart.clientId?1:0)}function se(e){const{selectionStart:t,selectionEnd:n}=e.selection;return!!t.clientId&&t.clientId===n.clientId}function ae(e){const{selectionStart:t,selectionEnd:n}=e.selection,{clientId:o}=t;return o&&o===n.clientId?o:null}function ce(e){const t=ae(e);return t?$(e,t):null}function ue(e,t){return void 0!==e.blocks.parents[t]?e.blocks.parents[t]:null}const de=L((function(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const o=[];let r=t;for(;e.blocks.parents[r];)r=e.blocks.parents[r],o.push(r);return n?o:o.reverse()}),(e=>[e.blocks.parents])),pe=L((function(e,t,n){let o=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const r=de(e,t,o);return(0,u.map)((0,u.filter)((0,u.map)(r,(t=>({id:t,name:G(e,t)}))),(e=>{let{name:t}=e;return Array.isArray(n)?n.includes(t):t===n})),(e=>{let{id:t}=e;return t}))}),(e=>[e.blocks.parents]));function me(e,t){let n,o=t;do{n=o,o=e.blocks.parents[o]}while(o);return n}function fe(e,t){const n=ae(e),o=[...de(e,t),t],r=[...de(e,n),n];let l;const i=Math.min(o.length,r.length);for(let e=0;e<i&&o[e]===r[e];e++)l=o[e];return l}function ge(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;if(void 0===t&&(t=ae(e)),void 0===t&&(t=n<0?Ee(e):Ce(e)),!t)return null;const o=ue(e,t);if(null===o)return null;const{order:r}=e.blocks,l=r[o],i=l.indexOf(t),s=i+1*n;return s<0||s===l.length?null:l[s]}function he(e,t){return ge(e,t,-1)}function ve(e,t){return ge(e,t,1)}function be(e){return e.initialPosition}const ke=L((e=>{const{selectionStart:t,selectionEnd:n}=e.selection;if(void 0===t.clientId||void 0===n.clientId)return H;if(t.clientId===n.clientId)return[t.clientId];const o=ue(e,t.clientId);if(null===o)return H;const r=Me(e,o),l=r.indexOf(t.clientId),i=r.indexOf(n.clientId);return l>i?r.slice(i,l+1):r.slice(l,i+1)}),(e=>[e.blocks.order,e.selection.selectionStart.clientId,e.selection.selectionEnd.clientId]));function _e(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId===n.clientId?H:ke(e)}const ye=L((e=>{const t=_e(e);return t.length?t.map((t=>$(e,t))):H}),(e=>[...ke.getDependants(e),e.blocks.byClientId,e.blocks.order,e.blocks.attributes]));function Ee(e){return(0,u.first)(_e(e))||null}function Ce(e){return(0,u.last)(_e(e))||null}function Se(e,t){return Ee(e)===t}function we(e,t){return-1!==_e(e).indexOf(t)}const Be=L(((e,t)=>{let n=t,o=!1;for(;n&&!o;)n=ue(e,n),o=we(e,n);return o}),(e=>[e.blocks.order,e.selection.selectionStart.clientId,e.selection.selectionEnd.clientId]));function Ie(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId===n.clientId?null:t.clientId||null}function xe(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId===n.clientId?null:n.clientId||null}function Te(e){const t=ne(e),n=oe(e);return!t.attributeKey&&!n.attributeKey&&void 0===t.offset&&void 0===n.offset}function Ne(e){const t=ne(e),n=oe(e);return!!t&&!!n&&t.clientId===n.clientId&&t.attributeKey===n.attributeKey&&t.offset===n.offset}function Pe(e,t){const n=ne(e),o=oe(e);if(n.clientId===o.clientId)return!1;if(!n.attributeKey||!o.attributeKey||void 0===n.offset||void 0===o.offset)return!1;const l=ue(e,n.clientId);if(l!==ue(e,o.clientId))return!1;const i=Me(e,l);let s,a;i.indexOf(n.clientId)>i.indexOf(o.clientId)?(s=o,a=n):(s=n,a=o);const c=t?a.clientId:s.clientId,u=t?s.clientId:a.clientId,d=$(e,c);if(!(0,r.getBlockType)(d.name).merge)return!1;const p=$(e,u);if(p.name===d.name)return!0;const m=(0,r.switchToBlockType)(p,d.name);return m&&m.length}const Re=e=>{const t=ne(e),n=oe(e);if(t.clientId===n.clientId)return H;if(!t.attributeKey||!n.attributeKey||void 0===t.offset||void 0===n.offset)return H;const o=ue(e,t.clientId);if(o!==ue(e,n.clientId))return H;const l=Me(e,o),i=l.indexOf(t.clientId),s=l.indexOf(n.clientId),[a,c]=i>s?[n,t]:[t,n],u=$(e,a.clientId),d=(0,r.getBlockType)(u.name),p=$(e,c.clientId),m=(0,r.getBlockType)(p.name),f=u.attributes[a.attributeKey],g=p.attributes[c.attributeKey],h=d.attributes[a.attributeKey],v=m.attributes[c.attributeKey];let b=(0,O.create)({html:f,...V(h)}),k=(0,O.create)({html:g,...V(v)});return b=(0,O.remove)(b,0,a.offset),k=(0,O.remove)(k,c.offset,k.text.length),[{...u,attributes:{...u.attributes,[a.attributeKey]:(0,O.toHTMLString)({value:b,...V(h)})}},{...p,attributes:{...p.attributes,[c.attributeKey]:(0,O.toHTMLString)({value:k,...V(v)})}}]};function Me(e,t){return e.blocks.order[t||""]||H}function Le(e,t){return Me(e,ue(e,t)).indexOf(t)}function Ae(e,t){const{selectionStart:n,selectionEnd:o}=e.selection;return n.clientId===o.clientId&&n.clientId===t}function De(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return(0,u.some)(Me(e,t),(t=>Ae(e,t)||we(e,t)||n&&De(e,t,n)))}function Oe(e,t){if(!t)return!1;const n=_e(e),o=n.indexOf(t);return o>-1&&o<n.length-1}function Fe(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId!==n.clientId}function ze(e){return e.isMultiSelecting}function Ve(e){return e.isSelectionEnabled}function He(e,t){return e.blocksMode[t]||"visual"}function Ge(e){return e.isTyping}function Ue(e){return!!e.draggedBlocks.length}function We(e){return e.draggedBlocks}function $e(e,t){return e.draggedBlocks.includes(t)}function je(e,t){if(!Ue(e))return!1;const n=de(e,t);return(0,u.some)(n,(t=>$e(e,t)))}function Ke(){return z()('wp.data.select( "core/block-editor" ).isCaretWithinFormattedText',{since:"6.1",version:"6.3"}),!1}function qe(e){let t,n;const{insertionPoint:o,selection:{selectionEnd:r}}=e;if(null!==o)return o;const{clientId:l}=r;return l?(t=ue(e,l)||void 0,n=Le(e,r.clientId)+1):n=Me(e).length,{rootClientId:t,index:n}}function Ye(e){return null!==e.insertionPoint}function Ze(e){return e.template.isValid}function Qe(e){return e.settings.template}function Xe(e,t){if(!t)return e.settings.templateLock;const n=St(e,t);return n?n.templateLock:null}const Je=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return(0,u.isBoolean)(e)?e:(0,u.isArray)(e)?!(!e.includes("core/post-content")||null!==t)||e.includes(t):n},et=function(e,t){let n,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(t&&"object"==typeof t?(n=t,t=n.name):n=(0,r.getBlockType)(t),!n)return!1;const{allowedBlockTypes:i}=wt(e),s=Je(i,t,!0);if(!s)return!1;const a=!!Xe(e,o);if(a)return!1;const c=St(e,o);if(o&&void 0===c)return!1;const d=null==c?void 0:c.allowedBlocks,p=Je(d,t),m=n.parent,f=G(e,o),g=Je(m,f);let h=!0;const v=n.ancestor;if(v){const t=[o,...de(e,o)];h=(0,u.some)(t,(t=>Je(v,G(e,t))))}const b=h&&(null===p&&null===g||!0===p||!0===g);return b?(0,l.applyFilters)("blockEditor.__unstableCanInsertBlockType",b,n,o,{getBlock:$.bind(null,e),getBlockParentsByBlockName:pe.bind(null,e)}):b},tt=L(et,((e,t,n)=>[e.blockListSettings[n],e.blocks.byClientId[n],e.settings.allowedBlockTypes,e.settings.templateLock]));function nt(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return t.every((t=>tt(e,G(e,t),n)))}function ot(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const o=W(e,t);if(null===o)return!0;const{lock:r}=o,l=!!Xe(e,n);return void 0===r||void 0===(null==r?void 0:r.remove)?!l:!(null!=r&&r.remove)}function rt(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return t.every((t=>ot(e,t,n)))}function lt(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const o=W(e,t);if(null===o)return;const{lock:r}=o,l="all"===Xe(e,n);return void 0===r||void 0===(null==r?void 0:r.move)?!l:!(null!=r&&r.move)}function it(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return t.every((t=>lt(e,t,n)))}function st(e,t){const n=W(e,t);if(null===n)return!0;const{lock:o}=n;return!(null!=o&&o.edit)}function at(e,t){var n;return!!(0,r.hasBlockSupport)(t,"lock",!0)&&!(null===(n=e.settings)||void 0===n||!n.canLockBlocks)}function ct(e,t){var n,o;return null!==(n=null===(o=e.preferences.insertUsage)||void 0===o?void 0:o[t])&&void 0!==n?n:null}const ut=(e,t,n)=>!!(0,r.hasBlockSupport)(t,"inserter",!0)&&et(e,t.name,n),dt=(e,t)=>n=>{const o=`${t.id}/${n.name}`,{time:r,count:l=0}=ct(e,o)||{};return{...t,id:o,icon:n.icon||t.icon,title:n.title||t.title,description:n.description||t.description,category:n.category||t.category,example:n.hasOwnProperty("example")?n.example:t.example,initialAttributes:{...t.initialAttributes,...n.attributes},innerBlocks:n.innerBlocks,keywords:n.keywords||t.keywords,frecency:pt(r,l)}},pt=(e,t)=>{if(!e)return t;const n=Date.now()-e;switch(!0){case n<36e5:return 4*t;case n<864e5:return 2*t;case n<6048e5:return t/2;default:return t/4}},mt=(e,t)=>{let{buildScope:n="inserter"}=t;return t=>{const o=t.name;let l=!1;(0,r.hasBlockSupport)(t.name,"multiple",!0)||(l=(0,u.some)(ee(e,Q(e)),{name:t.name}));const{time:i,count:s=0}=ct(e,o)||{},a={id:o,name:t.name,title:t.title,icon:t.icon,isDisabled:l,frecency:pt(i,s)};if("transform"===n)return a;const c=(0,r.getBlockVariations)(t.name,"inserter");return{...a,initialAttributes:{},description:t.description,category:t.category,keywords:t.keywords,variations:c,example:t.example,utility:1}}},ft=L((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const n=mt(e,{buildScope:"inserter"}),o=/^\s*<!--\s+(\/)?wp:([a-z][a-z0-9_-]*\/)?([a-z][a-z0-9_-]*)\s+({(?:(?=([^}]+|}+(?=})|(?!}\s+\/?-->)[^])*)\5|[^]*?)}\s+)?(\/)?-->/,l=t=>{let n=D;if("web"===s.Platform.OS){const e=("string"==typeof t.content.raw?t.content.raw:t.content).match(o);if(e){const[,,t="core/",o]=e,l=(0,r.getBlockType)(t+o);l&&(n=l.icon)}}const l=`core/block/${t.id}`,{time:i,count:a=0}=ct(e,l)||{},c=pt(i,a);return{id:l,name:"core/block",initialAttributes:{ref:t.id},title:t.title.raw,icon:n,category:"reusable",keywords:[],isDisabled:!1,utility:1,frecency:c}},i=(0,r.getBlockTypes)().filter((n=>ut(e,n,t))).map(n),a=et(e,"core/block",t)?Pt(e).map(l):[],c=i.reduce(((t,n)=>{const{variations:o=[]}=n;if(o.some((e=>{let{isDefault:t}=e;return t}))||t.push(n),o.length){const r=dt(e,n);t.push(...o.map(r))}return t}),[]),u=(e,t)=>{const{core:n,noncore:o}=e;return(t.name.startsWith("core/")?n:o).push(t),e},{core:d,noncore:p}=c.reduce(u,{core:[],noncore:[]}),m=[...d,...p];return[...m,...a]}),((e,t)=>[e.blockListSettings[t],e.blocks.byClientId,e.blocks.order,e.preferences.insertUsage,e.settings.allowedBlockTypes,e.settings.templateLock,Pt(e),(0,r.getBlockTypes)()])),gt=L((function(e,t){var n;let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const l=(0,u.castArray)(t),[i]=l,s=mt(e,{buildScope:"transform"}),a=(0,r.getBlockTypes)().filter((t=>ut(e,t,o))).map(s),c=(0,u.mapKeys)(a,(e=>{let{name:t}=e;return t}));c["*"]={frecency:1/0,id:"*",isDisabled:!1,name:"*",title:(0,g.__)("Unwrap"),icon:null===(n=c[null==i?void 0:i.name])||void 0===n?void 0:n.icon};const d=(0,r.getPossibleBlockTransformations)(l).reduce(((e,t)=>("*"===t?e.push(c["*"]):c[null==t?void 0:t.name]&&e.push(c[t.name]),e)),[]);return(0,u.orderBy)(d,(e=>c[e.name].frecency),"desc")}),((e,t)=>[e.blockListSettings[t],e.blocks.byClientId,e.preferences.insertUsage,e.settings.allowedBlockTypes,e.settings.templateLock,(0,r.getBlockTypes)()])),ht=L((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const n=(0,u.some)((0,r.getBlockTypes)(),(n=>ut(e,n,t)));if(n)return!0;const o=et(e,"core/block",t)&&Pt(e).length>0;return o}),((e,t)=>[e.blockListSettings[t],e.blocks.byClientId,e.settings.allowedBlockTypes,e.settings.templateLock,Pt(e),(0,r.getBlockTypes)()])),vt=L((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(t)return(0,u.filter)((0,r.getBlockTypes)(),(n=>ut(e,n,t)))}),((e,t)=>[e.blockListSettings[t],e.blocks.byClientId,e.settings.allowedBlockTypes,e.settings.templateLock,(0,r.getBlockTypes)()])),bt=L((function(e){var t,n;let o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(!o)return;const r=null===(t=e.blockListSettings[o])||void 0===t?void 0:t.__experimentalDefaultBlock,l=null===(n=e.blockListSettings[o])||void 0===n?void 0:n.__experimentalDirectInsert;return r&&l?"function"==typeof l?l($(e,o))?r:null:r:void 0}),((e,t)=>[e.blockListSettings[t],e.blocks.tree[t]])),kt=L(((e,t)=>{const n=e.settings.__experimentalBlockPatterns.find((e=>{let{name:n}=e;return n===t}));return n?{...n,blocks:(0,r.parse)(n.content,{__unstableSkipMigrationLogs:!0})}:null}),(e=>[e.settings.__experimentalBlockPatterns])),_t=L((e=>{const t=e.settings.__experimentalBlockPatterns,{allowedBlockTypes:n}=wt(e);return t.filter((e=>{let{inserter:t=!0}=e;return!!t})).map((t=>{let{name:n}=t;return kt(e,n)})).filter((e=>{let{blocks:t}=e;return((e,t)=>{if((0,u.isBoolean)(t))return t;const n=[...e];for(;n.length>0;){var o;const e=n.shift();if(!Je(t,e.name||e.blockName,!0))return!1;null===(o=e.innerBlocks)||void 0===o||o.forEach((e=>{n.push(e)}))}return!0})(t,n)}))}),(e=>[e.settings.__experimentalBlockPatterns,e.settings.allowedBlockTypes])),yt=L((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const n=_t(e),o=(0,u.filter)(n,(n=>{let{blocks:o}=n;return o.every((n=>{let{name:o}=n;return tt(e,o,t)}))}));return o}),((e,t)=>[e.settings.__experimentalBlockPatterns,e.settings.allowedBlockTypes,e.settings.templateLock,e.blockListSettings[t],e.blocks.byClientId[t]])),Et=L((function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!t)return H;const o=yt(e,n),r=Array.isArray(t)?t:[t];return o.filter((e=>{var t,n;return null==e||null===(t=e.blockTypes)||void 0===t||null===(n=t.some)||void 0===n?void 0:n.call(t,(e=>r.includes(e)))}))}),((e,t)=>[...yt.getDependants(e,t)])),Ct=L((function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!t)return H;if(t.some((t=>{let{clientId:n,innerBlocks:o}=t;return o.length||Dt(e,n)})))return H;const o=Array.from(new Set(t.map((e=>{let{name:t}=e;return t}))));return Et(e,o,n)}),((e,t)=>[...Et.getDependants(e,t)]));function St(e,t){return e.blockListSettings[t]}function wt(e){return e.settings}function Bt(e){return e.blocks.isPersistentChange}const It=L((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return t.reduce(((t,n)=>e.blockListSettings[n]?{...t,[n]:e.blockListSettings[n]}:t),{})}),(e=>[e.blockListSettings])),xt=L(((e,t)=>{var n;const o=(0,u.find)(Pt(e),(e=>e.id===t));return o?null===(n=o.title)||void 0===n?void 0:n.raw:null}),(e=>[Pt(e)]));function Tt(e){return e.blocks.isIgnoredChange}function Nt(e){return e.lastBlockAttributesChange}function Pt(e){var t,n;return null!==(t=null==e||null===(n=e.settings)||void 0===n?void 0:n.__experimentalReusableBlocks)&&void 0!==t?t:H}function Rt(e){return e.isNavigationMode}function Mt(e){return e.hasBlockMovingClientId}function Lt(e){return!!e.automaticChangeStatus}function At(e,t){return e.highlightedBlock===t}function Dt(e,t){return!!e.blocks.controlledInnerBlocks[t]}const Ot=L(((e,t)=>{if(!t.length)return null;const n=ae(e);if(t.includes(G(e,n)))return n;const o=_e(e),r=pe(e,n||o[0],t);return r?(0,u.last)(r):null}),((e,t)=>[e.selection.selectionStart.clientId,e.selection.selectionEnd.clientId,t]));function Ft(e,t,n){const{lastBlockInserted:o}=e;return o.clientId===t&&o.source===n}function zt(e,t){var n,o;return null===(n=null===(o=e.blocks.visibility)||void 0===o?void 0:o[t])||void 0===n||n}const Vt=L((e=>new Set(Object.keys(e.blocks.visibility).filter((t=>e.blocks.visibility[t])))),(e=>[e.blocks.visibility]));var Ht=window.wp.a11y;const Gt=e=>t=>{let{dispatch:n}=t;n({type:"RESET_BLOCKS",blocks:e}),n(Ut(e))},Ut=e=>t=>{let{select:n,dispatch:o}=t;const l=n.getTemplate(),i=n.getTemplateLock(),s=!l||"all"!==i||(0,r.doBlocksMatchTemplate)(e,l);if(s!==n.isValidTemplate())return o.setTemplateValidity(s),s};function Wt(e,t,n){return{type:"RESET_SELECTION",selectionStart:e,selectionEnd:t,initialPosition:n}}function $t(e){return z()('wp.data.dispatch( "core/block-editor" ).receiveBlocks',{since:"5.9",alternative:"resetBlocks or insertBlocks"}),{type:"RECEIVE_BLOCKS",blocks:e}}function jt(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return{type:"UPDATE_BLOCK_ATTRIBUTES",clientIds:(0,u.castArray)(e),attributes:t,uniqueByBlock:n}}function Kt(e,t){return{type:"UPDATE_BLOCK",clientId:e,updates:t}}function qt(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return{type:"SELECT_BLOCK",initialPosition:t,clientId:e}}const Yt=e=>t=>{let{select:n,dispatch:o}=t;const r=n.getPreviousBlockClientId(e);r&&o.selectBlock(r,-1)},Zt=e=>t=>{let{select:n,dispatch:o}=t;const r=n.getNextBlockClientId(e);r&&o.selectBlock(r)};function Qt(){return{type:"START_MULTI_SELECT"}}function Xt(){return{type:"STOP_MULTI_SELECT"}}const Jt=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return o=>{let{select:r,dispatch:l}=o;if(r.getBlockRootClientId(e)!==r.getBlockRootClientId(t))return;l({type:"MULTI_SELECT",start:e,end:t,initialPosition:n});const i=r.getSelectedBlockCount();(0,Ht.speak)((0,g.sprintf)(
|
2 |
/* translators: %s: number of selected blocks */
|
3 |
+
(0,g._n)("%s block selected.","%s blocks selected.",i),i),"assertive")}};function en(){return{type:"CLEAR_SELECTED_BLOCK"}}function tn(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return{type:"TOGGLE_SELECTION",isSelectionEnabled:e}}function nn(e,t){var n,o;const l=null!==(n=null==t||null===(o=t.__experimentalPreferredStyleVariations)||void 0===o?void 0:o.value)&&void 0!==n?n:{};return e.map((e=>{var t;const n=e.name;if(!(0,r.hasBlockSupport)(n,"defaultStylePicker",!0))return e;if(!l[n])return e;const o=null===(t=e.attributes)||void 0===t?void 0:t.className;if(null!=o&&o.includes("is-style-"))return e;const{attributes:i={}}=e,s=l[n];return{...e,attributes:{...i,className:`${o||""} is-style-${s}`.trim()}}}))}const on=function(e,t,n){let o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,r=arguments.length>4?arguments[4]:void 0;return l=>{let{select:i,dispatch:s}=l;e=(0,u.castArray)(e),t=nn((0,u.castArray)(t),i.getSettings());const a=i.getBlockRootClientId((0,u.first)(e));for(let e=0;e<t.length;e++){const n=t[e];if(!i.canInsertBlockType(n.name,a))return}s({type:"REPLACE_BLOCKS",clientIds:e,blocks:t,time:Date.now(),indexToSelect:n,initialPosition:o,meta:r}),s((e=>{let{select:t,dispatch:n}=e;if(t.getBlockCount()>0)return;const{__unstableHasCustomAppender:o}=t.getSettings();o||n.insertDefaultBlock()}))}};function rn(e,t){return on(e,t)}const ln=e=>(t,n)=>o=>{let{select:r,dispatch:l}=o;r.canMoveBlocks(t,n)&&l({type:e,clientIds:(0,u.castArray)(t),rootClientId:n})},sn=ln("MOVE_BLOCKS_DOWN"),an=ln("MOVE_BLOCKS_UP"),cn=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",o=arguments.length>3?arguments[3]:void 0;return r=>{let{select:l,dispatch:i}=r;if(l.canMoveBlocks(e,t)){if(t!==n){if(!l.canRemoveBlocks(e,t))return;if(!l.canInsertBlocks(e,n))return}i({type:"MOVE_BLOCKS_TO_POSITION",fromRootClientId:t,toRootClientId:n,clientIds:e,index:o})}}};function un(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",o=arguments.length>3?arguments[3]:void 0;return cn([e],t,n,o)}function dn(e,t,n,o,r){return pn([e],t,n,o,0,r)}const pn=function(e,t,n){let o=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,l=arguments.length>5?arguments[5]:void 0;return i=>{let{select:s,dispatch:a}=i;(0,u.isObject)(r)&&(l=r,r=0,z()("meta argument in wp.data.dispatch('core/block-editor')",{since:"5.8",hint:"The meta argument is now the 6th argument of the function"})),e=nn((0,u.castArray)(e),s.getSettings());const c=[];for(const t of e)s.canInsertBlockType(t.name,n)&&c.push(t);c.length&&a({type:"INSERT_BLOCKS",blocks:c,index:t,rootClientId:n,time:Date.now(),updateSelection:o,initialPosition:o?r:null,meta:l})}};function mn(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{__unstableWithInserter:o}=n;return{type:"SHOW_INSERTION_POINT",rootClientId:e,index:t,__unstableWithInserter:o}}function fn(){return{type:"HIDE_INSERTION_POINT"}}function gn(e){return{type:"SET_TEMPLATE_VALIDITY",isValid:e}}const hn=()=>e=>{let{select:t,dispatch:n}=e;n({type:"SYNCHRONIZE_TEMPLATE"});const o=t.getBlocks(),l=t.getTemplate(),i=(0,r.synchronizeBlocksWithTemplate)(o,l);n.resetBlocks(i)},vn=e=>t=>{let{registry:n,select:o,dispatch:l}=t;const i=o.getSelectionStart(),s=o.getSelectionEnd();if(i.clientId===s.clientId)return;if(!i.attributeKey||!s.attributeKey||void 0===i.offset||void 0===s.offset)return!1;const a=o.getBlockRootClientId(i.clientId);if(a!==o.getBlockRootClientId(s.clientId))return;const c=o.getBlockOrder(a);let d,p;c.indexOf(i.clientId)>c.indexOf(s.clientId)?(d=s,p=i):(d=i,p=s);const m=e?p:d,f=o.getBlock(m.clientId),g=(0,r.getBlockType)(f.name);if(!g.merge)return;const h=d,v=p,b=o.getBlock(h.clientId),k=(0,r.getBlockType)(b.name),_=o.getBlock(v.clientId),y=(0,r.getBlockType)(_.name),E=b.attributes[h.attributeKey],C=_.attributes[v.attributeKey],S=k.attributes[h.attributeKey],w=y.attributes[v.attributeKey];let B=(0,O.create)({html:E,...V(S)}),I=(0,O.create)({html:C,...V(w)});B=(0,O.remove)(B,h.offset,B.text.length),I=(0,O.insert)(I,"",0,v.offset);const x=(0,r.cloneBlock)(b,{[h.attributeKey]:(0,O.toHTMLString)({value:B,...V(S)})}),T=(0,r.cloneBlock)(_,{[v.attributeKey]:(0,O.toHTMLString)({value:I,...V(w)})}),N=e?x:T,P=b.name===_.name?[N]:(0,r.switchToBlockType)(N,g.name);if(!P||!P.length)return;let R;if(e){const e=P.pop();R=g.merge(e.attributes,T.attributes)}else{const e=P.shift();R=g.merge(x.attributes,e.attributes)}const M=(0,u.findKey)(R,(e=>"string"==typeof e&&-1!==e.indexOf(""))),L=R[M],A=(0,O.create)({html:L,...V(g.attributes[M])}),D=A.text.indexOf(""),F=(0,O.remove)(A,D,D+1),z=(0,O.toHTMLString)({value:F,...V(g.attributes[M])});R[M]=z;const H=o.getSelectedBlockClientIds(),G=[...e?P:[],{...f,attributes:{...f.attributes,...R}},...e?[]:P];n.batch((()=>{l.selectionChange(f.clientId,M,D,D),l.replaceBlocks(H,G,0,o.getSelectedBlocksInitialCaretPosition())}))},bn=()=>e=>{let{select:t,dispatch:n}=e;const o=t.getSelectionStart(),l=t.getSelectionEnd();if(o.clientId===l.clientId)return;if(!o.attributeKey||!l.attributeKey||void 0===o.offset||void 0===l.offset)return;const i=t.getBlockRootClientId(o.clientId);if(i!==t.getBlockRootClientId(l.clientId))return;const s=t.getBlockOrder(i);let a,c;s.indexOf(o.clientId)>s.indexOf(l.clientId)?(a=l,c=o):(a=o,c=l);const u=a,d=c,p=t.getBlock(u.clientId),m=(0,r.getBlockType)(p.name),f=t.getBlock(d.clientId),g=(0,r.getBlockType)(f.name),h=p.attributes[u.attributeKey],v=f.attributes[d.attributeKey],b=m.attributes[u.attributeKey],k=g.attributes[d.attributeKey];let _=(0,O.create)({html:h,...V(b)}),y=(0,O.create)({html:v,...V(k)});_=(0,O.remove)(_,u.offset,_.text.length),y=(0,O.remove)(y,0,d.offset),n.replaceBlocks(t.getSelectedBlockClientIds(),[{...p,attributes:{...p.attributes,[u.attributeKey]:(0,O.toHTMLString)({value:_,...V(b)})}},(0,r.createBlock)((0,r.getDefaultBlockName)()),{...f,attributes:{...f.attributes,[d.attributeKey]:(0,O.toHTMLString)({value:y,...V(k)})}}],1,t.getSelectedBlocksInitialCaretPosition())},kn=()=>e=>{let{select:t,dispatch:n}=e;const o=t.getSelectionStart(),r=t.getSelectionEnd();n.selectionChange({start:{clientId:o.clientId},end:{clientId:r.clientId}})},yn=(e,t)=>n=>{let{select:o,dispatch:l}=n;const i=[e,t];l({type:"MERGE_BLOCKS",blocks:i});const[s,a]=i,c=o.getBlock(s),d=(0,r.getBlockType)(c.name);if(d&&!d.merge)return void l.selectBlock(c.clientId);const p=o.getBlock(a),m=(0,r.getBlockType)(p.name),{clientId:f,attributeKey:g,offset:h}=o.getSelectionStart(),v=(f===s?d:m).attributes[g],b=(f===s||f===a)&&void 0!==g&&void 0!==h&&!!v;v||("number"==typeof g?window.console.error("RichText needs an identifier prop that is the block attribute key of the attribute it controls. Its type is expected to be a string, but was "+typeof g):window.console.error("The RichText identifier prop does not match any attributes defined by the block."));const k=(0,r.cloneBlock)(c),_=(0,r.cloneBlock)(p);if(b){const e=f===s?k:_,t=e.attributes[g],n=(0,O.insert)((0,O.create)({html:t,...V(v)}),"",h,h);e.attributes[g]=(0,O.toHTMLString)({value:n,...V(v)})}const y=c.name===p.name?[_]:(0,r.switchToBlockType)(_,c.name);if(!y||!y.length)return;const E=d.merge(k.attributes,y[0].attributes);if(b){const e=(0,u.findKey)(E,(e=>"string"==typeof e&&-1!==e.indexOf(""))),t=E[e],n=(0,O.create)({html:t,...V(d.attributes[e])}),o=n.text.indexOf(""),r=(0,O.remove)(n,o,o+1),i=(0,O.toHTMLString)({value:r,...V(d.attributes[e])});E[e]=i,l.selectionChange(c.clientId,e,o,o)}l.replaceBlocks([c.clientId,p.clientId],[{...c,attributes:{...c.attributes,...E}},...y.slice(1)],0)},En=function(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return n=>{let{select:o,dispatch:r}=n;if(!e||!e.length)return;e=(0,u.castArray)(e);const l=o.getBlockRootClientId(e[0]);o.canRemoveBlocks(e,l)&&(t&&r.selectPreviousBlock(e[0]),r({type:"REMOVE_BLOCKS",clientIds:e}),r((e=>{let{select:t,dispatch:n}=e;if(t.getBlockCount()>0)return;const{__unstableHasCustomAppender:o}=t.getSettings();o||n.insertDefaultBlock()})))}};function Cn(e,t){return En([e],t)}function Sn(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return{type:"REPLACE_INNER_BLOCKS",rootClientId:e,blocks:t,updateSelection:n,initialPosition:n?o:null,time:Date.now()}}function wn(e){return{type:"TOGGLE_BLOCK_MODE",clientId:e}}function Bn(){return{type:"START_TYPING"}}function In(){return{type:"STOP_TYPING"}}function xn(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return{type:"START_DRAGGING_BLOCKS",clientIds:e}}function Tn(){return{type:"STOP_DRAGGING_BLOCKS"}}function Nn(){return z()('wp.data.dispatch( "core/block-editor" ).enterFormattedText',{since:"6.1",version:"6.3"}),{type:"DO_NOTHING"}}function Pn(){return z()('wp.data.dispatch( "core/block-editor" ).exitFormattedText',{since:"6.1",version:"6.3"}),{type:"DO_NOTHING"}}function Rn(e,t,n,o){return"string"==typeof e?{type:"SELECTION_CHANGE",clientId:e,attributeKey:t,startOffset:n,endOffset:o}:{type:"SELECTION_CHANGE",...e}}const Mn=(e,t,n)=>o=>{let{dispatch:l}=o;const i=(0,r.getDefaultBlockName)();if(!i)return;const s=(0,r.createBlock)(i,e);return l.insertBlock(s,n,t)};function Ln(e,t){return{type:"UPDATE_BLOCK_LIST_SETTINGS",clientId:e,settings:t}}function An(e){return{type:"UPDATE_SETTINGS",settings:e}}function Dn(e,t){return{type:"SAVE_REUSABLE_BLOCK_SUCCESS",id:e,updatedId:t}}function On(){return{type:"MARK_LAST_CHANGE_AS_PERSISTENT"}}function Fn(){return{type:"MARK_NEXT_CHANGE_AS_NOT_PERSISTENT"}}const zn=()=>e=>{let{dispatch:t}=e;t({type:"MARK_AUTOMATIC_CHANGE"});const{requestIdleCallback:n=(e=>setTimeout(e,100))}=window;n((()=>{t({type:"MARK_AUTOMATIC_CHANGE_FINAL"})}))},Vn=function(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return t=>{let{dispatch:n}=t;n({type:"SET_NAVIGATION_MODE",isNavigationMode:e}),e?(0,Ht.speak)((0,g.__)("You are currently in navigation mode. Navigate blocks using the Tab key and Arrow keys. Use Left and Right Arrow keys to move between nesting levels. To exit navigation mode and edit the selected block, press Enter.")):(0,Ht.speak)((0,g.__)("You are currently in edit mode. To return to the navigation mode, press Escape."))}},Hn=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return t=>{let{dispatch:n}=t;n({type:"SET_BLOCK_MOVING_MODE",hasBlockMovingClientId:e}),e&&(0,Ht.speak)((0,g.__)("Use the Tab key and Arrow keys to choose new block location. Use Left and Right Arrow keys to move between nesting levels. Once location is selected press Enter or Space to move the block."))}},Gn=function(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return n=>{let{select:o,dispatch:l}=n;if(!e||!e.length)return;const i=o.getBlocksByClientId(e);if((0,u.some)(i,(e=>!e)))return;if(i.map((e=>e.name)).some((e=>!(0,r.hasBlockSupport)(e,"multiple",!0))))return;const s=o.getBlockRootClientId(e[0]),a=o.getBlockIndex((0,u.last)((0,u.castArray)(e))),c=i.map((e=>(0,r.__experimentalCloneSanitizedBlock)(e)));return l.insertBlocks(c,a+1,s,t),c.length>1&&t&&l.multiSelect((0,u.first)(c).clientId,(0,u.last)(c).clientId),c.map((e=>e.clientId))}},Un=e=>t=>{let{select:n,dispatch:o}=t;if(!e)return;const r=n.getBlockRootClientId(e);if(n.getTemplateLock(r))return;const l=n.getBlockIndex(e);return o.insertDefaultBlock({},r,l)},Wn=e=>t=>{let{select:n,dispatch:o}=t;if(!e)return;const r=n.getBlockRootClientId(e);if(n.getTemplateLock(r))return;const l=n.getBlockIndex(e);return o.insertDefaultBlock({},r,l+1)};function $n(e,t){return{type:"TOGGLE_BLOCK_HIGHLIGHT",clientId:e,isHighlighted:t}}const jn=e=>async t=>{let{dispatch:n}=t;n($n(e,!0)),await new Promise((e=>setTimeout(e,150))),n($n(e,!1))};function Kn(e,t){return{type:"SET_HAS_CONTROLLED_INNER_BLOCKS",hasControlledInnerBlocks:t,clientId:e}}function qn(e){return{type:"SET_BLOCK_VISIBILITY",updates:e}}const Yn="core/block-editor",Zn={reducer:N,selectors:e,actions:t},Qn=(0,m.createReduxStore)(Yn,{...Zn,persist:["preferences"]});(0,m.registerStore)(Yn,{...Zn,persist:["preferences"]});const Xn={name:"",isSelected:!1},Jn=(0,s.createContext)(Xn),{Provider:eo}=Jn;function to(){return(0,s.useContext)(Jn)}function no(){const{isSelected:e,clientId:t,name:n}=to();return(0,m.useSelect)((o=>{if(e)return!0;const{getBlockName:r,isFirstMultiSelectedBlock:l,getMultiSelectedBlockClientIds:i}=o(Qn);return!!l(t)&&i().every((e=>r(e)===n))}),[t,e,n])}function oo(e){let{group:t="default",controls:n,children:o,__experimentalShareWithChildBlocks:l=!1}=e;const i=function(e,t){const n=no(),{clientId:o}=to(),l=(0,m.useSelect)((e=>{const{getBlockName:n,hasSelectedInnerBlock:l}=e(Qn),{hasBlockSupport:i}=e(r.store);return t&&i(n(o),"__experimentalExposeControlsToChildren",!1)&&l(o)}),[t,o]);var i;return n?null===(i=f[e])||void 0===i?void 0:i.Fill:l?f.parent.Fill:null}(t,l);return i?(0,s.createElement)(p.__experimentalStyleProvider,{document:document},(0,s.createElement)(i,null,(e=>{const r=(0,u.isEmpty)(e)?null:e;return(0,s.createElement)(p.__experimentalToolbarContext.Provider,{value:r},"default"===t&&(0,s.createElement)(p.ToolbarGroup,{controls:n}),o)}))):null}function ro(e){let{group:t="default",...n}=e;const o=(0,s.useContext)(p.__experimentalToolbarContext),r=f[t].Slot,l=(0,p.__experimentalUseSlot)(r.__unstableName);return Boolean(l.fills&&l.fills.length)?"default"===t?(0,s.createElement)(r,i({},n,{bubblesVirtually:!0,fillProps:o})):(0,s.createElement)(p.ToolbarGroup,null,(0,s.createElement)(r,i({},n,{bubblesVirtually:!0,fillProps:o}))):null}const lo=oo;lo.Slot=ro;const io=e=>(0,s.createElement)(oo,i({group:"inline"},e));io.Slot=e=>(0,s.createElement)(ro,i({group:"inline"},e));var so=lo,ao=(0,s.createElement)(A.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(A.Path,{d:"M9 9v6h11V9H9zM4 20h1.5V4H4v16z"})),co=(0,s.createElement)(A.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(A.Path,{d:"M20 9h-7.2V4h-1.6v5H4v6h7.2v5h1.6v-5H20z"})),uo=(0,s.createElement)(A.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(A.Path,{d:"M4 15h11V9H4v6zM18.5 4v16H20V4h-1.5z"})),po=(0,s.createElement)(A.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(A.Path,{d:"M9 15h6V9H9v6zm-5 5h1.5V4H4v16zM18.5 4v16H20V4h-1.5z"})),mo=(0,s.createElement)(A.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(A.Path,{d:"M14.3 6.7l-1.1 1.1 4 4H4v1.5h13.3l-4.1 4.4 1.1 1.1 5.8-6.3z"})),fo=(0,s.createElement)(A.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(A.Path,{d:"M16.2 13.2l-4 4V4h-1.5v13.3l-4.5-4.1-1 1.1 6.2 5.8 5.8-5.8-1-1.1z"}));function go(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return e.split(",").map((e=>`.editor-styles-wrapper ${e} ${t}`)).join(",")}const ho=(0,s.createContext)({refs:new Map,callbacks:new Map});function vo(e){let{children:t}=e;const n=(0,s.useMemo)((()=>({refs:new Map,callbacks:new Map})),[]);return(0,s.createElement)(ho.Provider,{value:n},t)}function bo(e){const{refs:t,callbacks:n}=(0,s.useContext)(ho),o=(0,s.useRef)();return(0,s.useLayoutEffect)((()=>(t.set(o,e),()=>{t.delete(o)})),[e]),(0,d.useRefEffect)((t=>{o.current=t,n.forEach(((n,o)=>{e===n&&o(t)}))}),[e])}function ko(e){const{refs:t}=(0,s.useContext)(ho),n=(0,s.useRef)();return n.current=e,(0,s.useMemo)((()=>({get current(){let e=null;for(const[o,r]of t.entries())r===n.current&&o.current&&(e=o.current);return e}})),[])}function _o(e){const{callbacks:t}=(0,s.useContext)(ho),n=ko(e),[o,r]=(0,s.useState)(null);return(0,s.useLayoutEffect)((()=>{if(e)return t.set(r,e),()=>{t.delete(r)}}),[e]),n.current||o}const yo=["color","border","typography","spacing"],Eo={"color.palette":e=>void 0===e.colors?void 0:e.colors,"color.gradients":e=>void 0===e.gradients?void 0:e.gradients,"color.custom":e=>void 0===e.disableCustomColors?void 0:!e.disableCustomColors,"color.customGradient":e=>void 0===e.disableCustomGradients?void 0:!e.disableCustomGradients,"typography.fontSizes":e=>void 0===e.fontSizes?void 0:e.fontSizes,"typography.customFontSize":e=>void 0===e.disableCustomFontSizes?void 0:!e.disableCustomFontSizes,"typography.lineHeight":e=>e.enableCustomLineHeight,"spacing.units":e=>{if(void 0!==e.enableCustomUnits)return!0===e.enableCustomUnits?["px","em","rem","vh","vw","%"]:e.enableCustomUnits},"spacing.padding":e=>e.enableCustomSpacing},Co={"border.customColor":"border.color","border.customStyle":"border.style","border.customWidth":"border.width","typography.customFontStyle":"typography.fontStyle","typography.customFontWeight":"typography.fontWeight","typography.customLetterSpacing":"typography.letterSpacing","typography.customTextDecorations":"typography.textDecoration","typography.customTextTransforms":"typography.textTransform","border.customRadius":"border.radius","spacing.customMargin":"spacing.margin","spacing.customPadding":"spacing.padding","typography.customLineHeight":"typography.lineHeight"};function So(e){const{name:t,clientId:n}=to();return(0,m.useSelect)((o=>{if(yo.includes(e))return void console.warn("Top level useSetting paths are disabled. Please use a subpath to query the information needed.");let l;const i=(e=>Co[e]||e)(e);[...o(Qn).getBlockParents(n),n].forEach((e=>{const n=o(Qn).getBlockName(e);if((0,r.hasBlockSupport)(n,"__experimentalSettings",!1)){var s;const n=o(Qn).getBlockAttributes(e),r=null!==(s=(0,u.get)(n,`settings.blocks.${t}.${i}`))&&void 0!==s?s:(0,u.get)(n,`settings.${i}`);void 0!==r&&(l=r)}}));const s=o(Qn).getSettings();if(void 0===l){var a;const e=`__experimentalFeatures.${i}`,n=`__experimentalFeatures.blocks.${t}.${i}`;l=null!==(a=(0,u.get)(s,n))&&void 0!==a?a:(0,u.get)(s,e)}var c,d;if(void 0!==l)return r.__EXPERIMENTAL_PATHS_WITH_MERGE[i]?null!==(c=null!==(d=l.custom)&&void 0!==d?d:l.theme)&&void 0!==c?c:l.default:l;const p=Eo[i]?Eo[i](s):void 0;return void 0!==p?p:"typography.dropCap"===i||void 0}),[t,n,e])}window.wp.warning;var wo={default:(0,p.createSlotFill)("InspectorControls"),advanced:(0,p.createSlotFill)("InspectorAdvancedControls"),border:(0,p.createSlotFill)("InspectorControlsBorder"),color:(0,p.createSlotFill)("InspectorControlsColor"),dimensions:(0,p.createSlotFill)("InspectorControlsDimensions"),typography:(0,p.createSlotFill)("InspectorControlsTypography")};function Bo(e){var t;let{__experimentalGroup:n="default",children:o}=e;const r=no(),l=null===(t=wo[n])||void 0===t?void 0:t.Fill;return l?r?(0,s.createElement)(p.__experimentalStyleProvider,{document:document},(0,s.createElement)(l,null,(e=>{const t=(0,u.isEmpty)(e)?null:e;return(0,s.createElement)(p.__experimentalToolsPanelContext.Provider,{value:t},o)}))):null:("undefined"!=typeof process&&process.env,null)}const Io=e=>{if(!(0,u.isObject)(e)||Array.isArray(e))return e;const t=(0,u.pickBy)((0,u.mapValues)(e,Io),u.identity);return(0,u.isEmpty)(t)?void 0:t};function xo(e,t,n){return(0,u.setWith)(e?(0,u.clone)(e):{},t,n,u.clone)}function To(e,t,n,o,r,l){var i;if((0,u.every)(e,(e=>!e)))return n;if(1===l.length&&n.innerBlocks.length===o.length)return n;let s=null===(i=o[0])||void 0===i?void 0:i.attributes;if(l.length>1&&o.length>1){if(!o[r])return n;var a;s=null===(a=o[r])||void 0===a?void 0:a.attributes}let c=n;return(0,u.forEach)(e,((e,n)=>{e&&t[n].forEach((e=>{const t=(0,u.get)(s,e);t&&(c={...c,attributes:xo(c.attributes,e,t)})}))})),c}function No(e,t,n){const o=(0,r.getBlockSupport)(e,t),l=null==o?void 0:o.__experimentalSkipSerialization;return Array.isArray(l)?l.includes(n):l}function Po(e){let{children:t,group:n,label:o}=e;const{updateBlockAttributes:r}=(0,m.useDispatch)(Qn),{getBlockAttributes:l,getMultiSelectedBlockClientIds:i,getSelectedBlockClientId:a,hasMultiSelection:c}=(0,m.useSelect)(Qn),u=a(),d=(0,s.useCallback)((function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t={},n=c()?i():[u];n.forEach((n=>{const{style:o}=l(n);let r={style:o};e.forEach((e=>{r={...r,...e(r)}})),r={...r,style:Io(r.style)},t[n]=r})),r(n,t,!0)}),[Io,l,i,c,u,r]);return(0,s.createElement)(p.__experimentalToolsPanel,{className:`${n}-block-support-panel`,label:o,resetAll:d,key:u,panelId:u,hasInnerWrapper:!0,shouldRenderPlaceholderItems:!0,__experimentalFirstVisibleItemClass:"first",__experimentalLastVisibleItemClass:"last"},t)}function Ro(e){let{Slot:t,...n}=e;const o=(0,s.useContext)(p.__experimentalToolsPanelContext);return(0,s.createElement)(t,i({},n,{fillProps:o,bubblesVirtually:!0}))}function Mo(e){var t;let{__experimentalGroup:n="default",label:o,...r}=e;const l=null===(t=wo[n])||void 0===t?void 0:t.Slot,a=(0,p.__experimentalUseSlot)(null==l?void 0:l.__unstableName);return l&&a?Boolean(a.fills&&a.fills.length)?o?(0,s.createElement)(Po,{group:n,label:o},(0,s.createElement)(Ro,i({},r,{Slot:l}))):(0,s.createElement)(l,i({},r,{bubblesVirtually:!0})):null:("undefined"!=typeof process&&process.env,null)}const Lo=Bo;Lo.Slot=Mo;const Ao=e=>(0,s.createElement)(Bo,i({},e,{__experimentalGroup:"advanced"}));Ao.Slot=e=>(0,s.createElement)(Mo,i({},e,{__experimentalGroup:"advanced"})),Ao.slotName="InspectorAdvancedControls";var Do=Lo,Oo=window.wp.isShallowEqual,Fo=n.n(Oo),zo=function(e){return(0,d.useRefEffect)((t=>{if(!e)return;function n(t){const{deltaX:n,deltaY:o}=t;e.current.scrollBy(n,o)}const o={passive:!0};return t.addEventListener("wheel",n,o),()=>{t.removeEventListener("wheel",n,o)}}),[e])};function Vo(e){let{clientId:t,bottomClientId:n,children:o,__unstableRefreshSize:r,__unstableCoverTarget:l=!1,__unstablePopoverSlot:a,__unstableContentRef:u,...d}=e;const m=_o(t),f=_o(null!=n?n:t),g=zo(u),h=(0,s.useMemo)((()=>m&&f===m?{position:"absolute",width:m.offsetWidth,height:m.offsetHeight}:{}),[m,f,r]);if(!m||n&&!f)return null;const v={top:m,bottom:f};return(0,s.createElement)(p.Popover,i({ref:g,animate:!1,position:"top right left",focusOnMount:!1,anchorRef:v,__unstableSlotName:a||null,__unstableObserveElement:m,__unstableForcePosition:!0,__unstableShift:!0},d,{className:c()("block-editor-block-popover",d.className)}),l&&(0,s.createElement)("div",{style:h},o),!l&&o)}function Ho(e){const t=(0,r.getBlockSupport)(e,Yo);return!!(!0===t||null!=t&&t.margin)}function Go(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!So("spacing.margin"),n=!tr(e,"margin");return!Ho(e)||t||n}function Uo(e){var t;const{name:n,attributes:{style:o},setAttributes:r}=e,l=(0,p.__experimentalUseCustomUnits)({availableUnits:So("spacing.units")||["%","px","em","rem","vw"]}),i=er(n,"margin"),a=i&&i.some((e=>Qo.includes(e)));return Go(e)?null:s.Platform.select({web:(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.__experimentalBoxControl,{values:null==o||null===(t=o.spacing)||void 0===t?void 0:t.margin,onChange:e=>{const t={...o,spacing:{...null==o?void 0:o.spacing,margin:e}};r({style:Io(t)})},label:(0,g.__)("Margin"),sides:i,units:l,allowReset:!1,splitOnAxis:a})),native:null})}function Wo(e){var t,n;let{clientId:o,attributes:r}=e;const l=null==r||null===(t=r.style)||void 0===t||null===(n=t.spacing)||void 0===n?void 0:n.margin,i=(0,s.useMemo)((()=>{var e,t,n,o;return{borderTopWidth:null!==(e=null==l?void 0:l.top)&&void 0!==e?e:0,borderRightWidth:null!==(t=null==l?void 0:l.right)&&void 0!==t?t:0,borderBottomWidth:null!==(n=null==l?void 0:l.bottom)&&void 0!==n?n:0,borderLeftWidth:null!==(o=null==l?void 0:l.left)&&void 0!==o?o:0,top:null!=l&&l.top?`-${l.top}`:0,right:null!=l&&l.right?`-${l.right}`:0,bottom:null!=l&&l.bottom?`-${l.bottom}`:0,left:null!=l&&l.left?`-${l.left}`:0}}),[l]),[a,c]=(0,s.useState)(!1),u=(0,s.useRef)(l),d=(0,s.useRef)(),p=()=>{d.current&&window.clearTimeout(d.current)};return(0,s.useEffect)((()=>(Fo()(l,u.current)||(c(!0),u.current=l,p(),d.current=setTimeout((()=>{c(!1)}),400)),()=>p())),[l]),a?(0,s.createElement)(Vo,{clientId:o,__unstableCoverTarget:!0,__unstableRefreshSize:l},(0,s.createElement)("div",{className:"block-editor__padding-visualizer",style:i})):null}function $o(e){const t=(0,r.getBlockSupport)(e,Yo);return!!(!0===t||null!=t&&t.padding)}function jo(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!So("spacing.padding"),n=!tr(e,"padding");return!$o(e)||t||n}function Ko(e){var t;const{name:n,attributes:{style:o},setAttributes:r}=e,l=(0,p.__experimentalUseCustomUnits)({availableUnits:So("spacing.units")||["%","px","em","rem","vw"]}),i=er(n,"padding"),a=i&&i.some((e=>Qo.includes(e)));return jo(e)?null:s.Platform.select({web:(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.__experimentalBoxControl,{values:null==o||null===(t=o.spacing)||void 0===t?void 0:t.padding,onChange:e=>{const t={...o,spacing:{...null==o?void 0:o.spacing,padding:e}};r({style:Io(t)})},label:(0,g.__)("Padding"),sides:i,units:l,allowReset:!1,splitOnAxis:a})),native:null})}function qo(e){var t,n;let{clientId:o,attributes:r}=e;const l=null==r||null===(t=r.style)||void 0===t||null===(n=t.spacing)||void 0===n?void 0:n.padding,i=(0,s.useMemo)((()=>{var e,t,n,o;return{borderTopWidth:null!==(e=null==l?void 0:l.top)&&void 0!==e?e:0,borderRightWidth:null!==(t=null==l?void 0:l.right)&&void 0!==t?t:0,borderBottomWidth:null!==(n=null==l?void 0:l.bottom)&&void 0!==n?n:0,borderLeftWidth:null!==(o=null==l?void 0:l.left)&&void 0!==o?o:0}}),[l]),[a,c]=(0,s.useState)(!1),u=(0,s.useRef)(l),d=(0,s.useRef)(),p=()=>{d.current&&window.clearTimeout(d.current)};return(0,s.useEffect)((()=>(Fo()(l,u.current)||(c(!0),u.current=l,p(),d.current=setTimeout((()=>{c(!1)}),400)),()=>p())),[l]),a?(0,s.createElement)(Vo,{clientId:o,__unstableCoverTarget:!0,__unstableRefreshSize:l},(0,s.createElement)("div",{className:"block-editor__padding-visualizer",style:i})):null}const Yo="spacing",Zo=["top","right","bottom","left"],Qo=["vertical","horizontal"];function Xo(e){const t=rr(e),n=jo(e),o=Go(e),l=Jo(e),i=(a=e.name,"web"===s.Platform.OS&&(nr(a)||$o(a)||Ho(a)));var a;if(l||!i)return null;const c=(0,r.getBlockSupport)(e.name,[Yo,"__experimentalDefaultControls"]),u=e=>t=>{var n;return{...t,style:{...t.style,spacing:{...null===(n=t.style)||void 0===n?void 0:n.spacing,[e]:void 0}}}};return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Do,{__experimentalGroup:"dimensions"},!n&&(0,s.createElement)(p.__experimentalToolsPanelItem,{hasValue:()=>function(e){var t,n;return void 0!==(null===(t=e.attributes.style)||void 0===t||null===(n=t.spacing)||void 0===n?void 0:n.padding)}(e),label:(0,g.__)("Padding"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:Io({...o,spacing:{...null==o?void 0:o.spacing,padding:void 0}})})}(e),resetAllFilter:u("padding"),isShownByDefault:null==c?void 0:c.padding,panelId:e.clientId},(0,s.createElement)(Ko,e)),!o&&(0,s.createElement)(p.__experimentalToolsPanelItem,{hasValue:()=>function(e){var t,n;return void 0!==(null===(t=e.attributes.style)||void 0===t||null===(n=t.spacing)||void 0===n?void 0:n.margin)}(e),label:(0,g.__)("Margin"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:Io({...o,spacing:{...null==o?void 0:o.spacing,margin:void 0}})})}(e),resetAllFilter:u("margin"),isShownByDefault:null==c?void 0:c.margin,panelId:e.clientId},(0,s.createElement)(Uo,e)),!t&&(0,s.createElement)(p.__experimentalToolsPanelItem,{hasValue:()=>function(e){var t,n;return void 0!==(null===(t=e.attributes.style)||void 0===t||null===(n=t.spacing)||void 0===n?void 0:n.blockGap)}(e),label:(0,g.__)("Block spacing"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:{...o,spacing:{...null==o?void 0:o.spacing,blockGap:void 0}}})}(e),resetAllFilter:u("blockGap"),isShownByDefault:null==c?void 0:c.blockGap,panelId:e.clientId},(0,s.createElement)(lr,e))),!n&&(0,s.createElement)(qo,e),!o&&(0,s.createElement)(Wo,e))}const Jo=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=rr(e),n=jo(e),o=Go(e);return t&&n&&o};function er(e,t){var n;const o=(0,r.getBlockSupport)(e,Yo);if(o&&"boolean"!=typeof o[t])return Array.isArray(o[t])?o[t]:null!==(n=o[t])&&void 0!==n&&n.sides?o[t].sides:void 0}function tr(e,t){const n=er(e,t);return!(n&&n.some((e=>Zo.includes(e)))&&n.some((e=>Qo.includes(e)))&&(console.warn(`The ${t} support for the "${e}" block can not be configured to support both axial and arbitrary sides.`),1))}function nr(e){const t=(0,r.getBlockSupport)(e,Yo);return!!(!0===t||null!=t&&t.blockGap)}function or(e){if(!e)return null;const t="string"==typeof e;return{top:t?e:null==e?void 0:e.top,left:t?e:null==e?void 0:e.left}}function rr(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!So("spacing.blockGap");return!nr(e)||t}function lr(e){var t;const{clientId:n,attributes:{style:o},name:r,setAttributes:l}=e,i=(0,p.__experimentalUseCustomUnits)({availableUnits:So("spacing.units")||["%","px","em","rem","vw"]}),a=er(r,"blockGap"),c=ko(n);if(rr(e))return null;const u=a&&a.some((e=>Qo.includes(e))),d=e=>{var t;let n=e;e&&u&&(n={...or(e)});const r={...o,spacing:{...null==o?void 0:o.spacing,blockGap:n}};l({style:Io(r)});const i=(null===(t=window)||void 0===t?void 0:t.navigator.userAgent)&&window.navigator.userAgent.includes("Safari")&&!window.navigator.userAgent.includes("Chrome ")&&!window.navigator.userAgent.includes("Chromium ");var s;c.current&&i&&(null===(s=c.current.parentNode)||void 0===s||s.replaceChild(c.current,c.current))},m=or(null==o||null===(t=o.spacing)||void 0===t?void 0:t.blockGap),f=u?{...m,right:null==m?void 0:m.left,bottom:null==m?void 0:m.top}:null==m?void 0:m.top;return s.Platform.select({web:(0,s.createElement)(s.Fragment,null,u?(0,s.createElement)(p.__experimentalBoxControl,{label:(0,g.__)("Block spacing"),min:0,onChange:d,units:i,sides:a,values:f,allowReset:!1,splitOnAxis:u}):(0,s.createElement)(p.__experimentalUnitControl,{label:(0,g.__)("Block spacing"),__unstableInputWidth:"80px",min:0,onChange:d,units:i,value:f})),native:null})}const ir=(0,s.createElement)(p.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(p.Path,{d:"M15 4H9v11h6V4zM4 18.5V20h16v-1.5H4z"})),sr=(0,s.createElement)(p.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(p.Path,{d:"M20 11h-5V4H9v7H4v1.5h5V20h6v-7.5h5z"})),ar={top:{icon:(0,s.createElement)(p.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(p.Path,{d:"M9 20h6V9H9v11zM4 4v1.5h16V4H4z"})),title:(0,g._x)("Align top","Block vertical alignment setting")},center:{icon:sr,title:(0,g._x)("Align middle","Block vertical alignment setting")},bottom:{icon:ir,title:(0,g._x)("Align bottom","Block vertical alignment setting")}},cr=["top","center","bottom"],ur={isAlternate:!0};var dr=function(e){let{value:t,onChange:n,controls:o=cr,isCollapsed:r=!0,isToolbar:l}=e;const a=ar[t],c=ar.top,u=l?p.ToolbarGroup:p.ToolbarDropdownMenu,d=l?{isCollapsed:r}:{};return(0,s.createElement)(u,i({popoverProps:ur,icon:a?a.icon:c.icon,label:(0,g._x)("Change vertical alignment","Block vertical alignment setting label"),controls:o.map((e=>{return{...ar[e],isActive:t===e,role:r?"menuitemradio":void 0,onClick:(o=e,()=>n(t===o?void 0:o))};var o}))},d))};const pr=e=>(0,s.createElement)(dr,i({},e,{isToolbar:!1})),mr=e=>(0,s.createElement)(dr,i({},e,{isToolbar:!0})),fr={left:ao,center:co,right:uo,"space-between":po};var gr=function(e){let{allowedControls:t=["left","center","right","space-between"],isCollapsed:n=!0,onChange:o,value:r,popoverProps:l,isToolbar:a}=e;const c=e=>{o(e===r?void 0:e)},u=r?fr[r]:fr.left,d=[{name:"left",icon:ao,title:(0,g.__)("Justify items left"),isActive:"left"===r,onClick:()=>c("left")},{name:"center",icon:co,title:(0,g.__)("Justify items center"),isActive:"center"===r,onClick:()=>c("center")},{name:"right",icon:uo,title:(0,g.__)("Justify items right"),isActive:"right"===r,onClick:()=>c("right")},{name:"space-between",icon:po,title:(0,g.__)("Space between items"),isActive:"space-between"===r,onClick:()=>c("space-between")}],m=a?p.ToolbarGroup:p.ToolbarDropdownMenu,f=a?{isCollapsed:n}:{};return(0,s.createElement)(m,i({icon:u,popoverProps:l,label:(0,g.__)("Change items justification"),controls:d.filter((e=>t.includes(e.name)))},f))};const hr=e=>(0,s.createElement)(gr,i({},e,{isToolbar:!1})),vr=e=>(0,s.createElement)(gr,i({},e,{isToolbar:!0})),br={left:"flex-start",right:"flex-end",center:"center","space-between":"space-between"},kr={left:"flex-start",right:"flex-end",center:"center"},_r={top:"flex-start",center:"center",bottom:"flex-end"},yr=["wrap","nowrap"];var Er={name:"flex",label:(0,g.__)("Flex"),inspectorControls:function(e){let{layout:t={},onChange:n,layoutBlockSupport:o={}}=e;const{allowOrientation:r=!0}=o;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.Flex,null,(0,s.createElement)(p.FlexItem,null,(0,s.createElement)(Sr,{layout:t,onChange:n})),(0,s.createElement)(p.FlexItem,null,r&&(0,s.createElement)(Br,{layout:t,onChange:n}))),(0,s.createElement)(wr,{layout:t,onChange:n}))},toolBarControls:function(e){let{layout:t={},onChange:n,layoutBlockSupport:o}=e;if(null!=o&&o.allowSwitching)return null;const{allowVerticalAlignment:r=!0}=o;return(0,s.createElement)(so,{group:"block",__experimentalShareWithChildBlocks:!0},(0,s.createElement)(Sr,{layout:t,onChange:n,isToolbar:!0}),r&&"vertical"!==(null==t?void 0:t.orientation)&&(0,s.createElement)(Cr,{layout:t,onChange:n,isToolbar:!0}))},save:function(e){var t,n;let{selector:o,layout:l,style:i,blockName:a}=e;const{orientation:c="horizontal"}=l,u=So("spacing.blockGap"),d=(0,r.getBlockSupport)(a,["spacing","blockGap","__experimentalDefault"])||"0.5em",p=null!==u,m=null!=i&&null!==(t=i.spacing)&&void 0!==t&&t.blockGap&&!No(a,"spacing","blockGap")?function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"0";const n=or(e);if(!n)return null;const o=(null==n?void 0:n.top)||t,r=(null==n?void 0:n.left)||t;return o===r?o:`${o} ${r}`}(null==i||null===(n=i.spacing)||void 0===n?void 0:n.blockGap,d):`var( --wp--style--block-gap, ${d} )`,f=br[l.justifyContent]||br.left,g=yr.includes(l.flexWrap)?l.flexWrap:"wrap",h=`\n\t\tflex-direction: row;\n\t\talign-items: ${_r[l.verticalAlignment]||_r.center};\n\t\tjustify-content: ${f};\n\t\t`,v=`\n\t\tflex-direction: column;\n\t\talign-items: ${kr[l.justifyContent]||kr.left};\n\t\t`;return(0,s.createElement)("style",null,`\n\t\t\t\t${go(o)} {\n\t\t\t\t\tdisplay: flex;\n\t\t\t\t\tflex-wrap: ${g};\n\t\t\t\t\tgap: ${p?m:d};\n\t\t\t\t\t${"horizontal"===c?h:v}\n\t\t\t\t}\n\n\t\t\t\t${go(o,"> *")} {\n\t\t\t\t\tmargin: 0;\n\t\t\t\t}\n\t\t\t`)},getOrientation(e){const{orientation:t="horizontal"}=e;return t},getAlignments:()=>[]};function Cr(e){let{layout:t,onChange:n,isToolbar:o=!1}=e;const{verticalAlignment:r=_r.center}=t,l=e=>{n({...t,verticalAlignment:e})};if(o)return(0,s.createElement)(pr,{onChange:l,value:r});const i=[{value:"flex-start",label:(0,g.__)("Align items top")},{value:"center",label:(0,g.__)("Align items center")},{value:"flex-end",label:(0,g.__)("Align items bottom")}];return(0,s.createElement)("fieldset",{className:"block-editor-hooks__flex-layout-vertical-alignment-control"},(0,s.createElement)("legend",null,(0,g.__)("Vertical alignment")),(0,s.createElement)("div",null,i.map(((e,t,n)=>(0,s.createElement)(p.Button,{key:e,label:n,icon:t,isPressed:r===e,onClick:()=>l(e)})))))}function Sr(e){let{layout:t,onChange:n,isToolbar:o=!1}=e;const{justifyContent:r="left",orientation:l="horizontal"}=t,i=e=>{n({...t,justifyContent:e})},a=["left","center","right"];if("horizontal"===l&&a.push("space-between"),o)return(0,s.createElement)(hr,{allowedControls:a,value:r,onChange:i,popoverProps:{position:"bottom right",isAlternate:!0}});const c=[{value:"left",icon:ao,label:(0,g.__)("Justify items left")},{value:"center",icon:co,label:(0,g.__)("Justify items center")},{value:"right",icon:uo,label:(0,g.__)("Justify items right")}];return"horizontal"===l&&c.push({value:"space-between",icon:po,label:(0,g.__)("Space between items")}),(0,s.createElement)("fieldset",{className:"block-editor-hooks__flex-layout-justification-controls"},(0,s.createElement)("legend",null,(0,g.__)("Justification")),(0,s.createElement)("div",null,c.map((e=>{let{value:t,icon:n,label:o}=e;return(0,s.createElement)(p.Button,{key:t,label:o,icon:n,isPressed:r===t,onClick:()=>i(t)})}))))}function wr(e){let{layout:t,onChange:n}=e;const{flexWrap:o="wrap"}=t;return(0,s.createElement)(p.ToggleControl,{label:(0,g.__)("Allow to wrap to multiple lines"),onChange:e=>{n({...t,flexWrap:e?"wrap":"nowrap"})},checked:"wrap"===o})}function Br(e){let{layout:t,onChange:n}=e;const{orientation:o="horizontal"}=t;return(0,s.createElement)("fieldset",{className:"block-editor-hooks__flex-layout-orientation-controls"},(0,s.createElement)("legend",null,(0,g.__)("Orientation")),(0,s.createElement)(p.Button,{label:"horizontal",icon:mo,isPressed:"horizontal"===o,onClick:()=>n({...t,orientation:"horizontal"})}),(0,s.createElement)(p.Button,{label:"vertical",icon:fo,isPressed:"vertical"===o,onClick:()=>n({...t,orientation:"vertical"})}))}var Ir=function(e){let{icon:t,size:n=24,...o}=e;return(0,s.cloneElement)(t,{width:n,height:n,...o})},xr=(0,s.createElement)(A.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(A.Path,{d:"M7 9v6h10V9H7zM5 19.8h14v-1.5H5v1.5zM5 4.3v1.5h14V4.3H5z"})),Tr=(0,s.createElement)(A.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(A.Path,{d:"M5 9v6h14V9H5zm11-4.8H8v1.5h8V4.2zM8 19.8h8v-1.5H8v1.5z"}));const Nr=[{name:"default",label:(0,g.__)("Flow"),inspectorControls:function(e){let{layout:t,onChange:n}=e;const{wideSize:o,contentSize:r}=t,l=(0,p.__experimentalUseCustomUnits)({availableUnits:So("spacing.units")||["%","px","em","rem","vw"]});return(0,s.createElement)(s.Fragment,null,(0,s.createElement)("div",{className:"block-editor-hooks__layout-controls"},(0,s.createElement)("div",{className:"block-editor-hooks__layout-controls-unit"},(0,s.createElement)(p.__experimentalUnitControl,{label:(0,g.__)("Content"),labelPosition:"top",__unstableInputWidth:"80px",value:r||o||"",onChange:e=>{e=0>parseFloat(e)?"0":e,n({...t,contentSize:e})},units:l}),(0,s.createElement)(Ir,{icon:xr})),(0,s.createElement)("div",{className:"block-editor-hooks__layout-controls-unit"},(0,s.createElement)(p.__experimentalUnitControl,{label:(0,g.__)("Wide"),labelPosition:"top",__unstableInputWidth:"80px",value:o||r||"",onChange:e=>{e=0>parseFloat(e)?"0":e,n({...t,wideSize:e})},units:l}),(0,s.createElement)(Ir,{icon:Tr}))),(0,s.createElement)("div",{className:"block-editor-hooks__layout-controls-reset"},(0,s.createElement)(p.Button,{variant:"secondary",isSmall:!0,disabled:!r&&!o,onClick:()=>n({contentSize:void 0,wideSize:void 0,inherit:!1})},(0,g.__)("Reset"))),(0,s.createElement)("p",{className:"block-editor-hooks__layout-controls-helptext"},(0,g.__)("Customize the width for all elements that are assigned to the center or wide columns.")))},toolBarControls:function(){return null},save:function(e){var t;let{selector:n,layout:o={},style:r,blockName:l}=e;const{contentSize:i,wideSize:a}=o,c=null!==So("spacing.blockGap"),u=or(null==r||null===(t=r.spacing)||void 0===t?void 0:t.blockGap),d=null!=u&&u.top&&!No(l,"spacing","blockGap")?null==u?void 0:u.top:"var( --wp--style--block-gap )";let p=i||a?`\n\t\t\t\t\t${go(n,"> :where(:not(.alignleft):not(.alignright))")} {\n\t\t\t\t\t\tmax-width: ${null!=i?i:a};\n\t\t\t\t\t\tmargin-left: auto !important;\n\t\t\t\t\t\tmargin-right: auto !important;\n\t\t\t\t\t}\n\t\t\t\t\t${go(n,"> .alignwide")} {\n\t\t\t\t\t\tmax-width: ${null!=a?a:i};\n\t\t\t\t\t}\n\t\t\t\t\t${go(n,"> .alignfull")} {\n\t\t\t\t\t\tmax-width: none;\n\t\t\t\t\t}\n\t\t\t\t`:"";return p+=`\n\t\t\t${go(n,"> .alignleft")} {\n\t\t\t\tfloat: left;\n\t\t\t\tmargin-inline-start: 0;\n\t\t\t\tmargin-inline-end: 2em;\n\t\t\t}\n\t\t\t${go(n,"> .alignright")} {\n\t\t\t\tfloat: right;\n\t\t\t\tmargin-inline-start: 2em;\n\t\t\t\tmargin-inline-end: 0;\n\t\t\t}\n\n\t\t\t${go(n,"> .aligncenter")} {\n\t\t\t\tmargin-left: auto !important;\n\t\t\t\tmargin-right: auto !important;\n\t\t\t}\n\t\t`,c&&(p+=`\n\t\t\t\t${go(n,"> *")} {\n\t\t\t\t\tmargin-block-start: 0;\n\t\t\t\t\tmargin-block-end: 0;\n\t\t\t\t}\n\t\t\t\t${go(n,"> * + *")} {\n\t\t\t\t\tmargin-block-start: ${d};\n\t\t\t\t}\n\t\t\t`),(0,s.createElement)("style",null,p)},getOrientation:()=>"vertical",getAlignments(e){const t=function(e){const{contentSize:t,wideSize:n}=e,o={},r=/^(?!0)\d+(px|em|rem|vw|vh|%)?$/i;return r.test(t)&&(
|
4 |
// translators: %s: container size (i.e. 600px etc)
|
5 |
o.none=(0,g.sprintf)((0,g.__)("Max %s wide"),t)),r.test(n)&&(
|
6 |
// translators: %s: container size (i.e. 600px etc)
|
7 |
+
o.wide=(0,g.sprintf)((0,g.__)("Max %s wide"),n)),o}(e);if(void 0!==e.alignments)return e.alignments.includes("none")||e.alignments.unshift("none"),e.alignments.map((e=>({name:e,info:t[e]})));const{contentSize:n,wideSize:o}=e,r=[{name:"left"},{name:"center"},{name:"right"}];return n&&r.unshift({name:"full"}),o&&r.unshift({name:"wide",info:t.wide}),r.unshift({name:"none",info:t.none}),r}},Er];function Pr(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default";return Nr.find((t=>t.name===e))}const Rr={type:"default"},Mr=(0,s.createContext)(Rr),Lr=Mr.Provider;function Ar(){return(0,s.useContext)(Mr)}function Dr(e){let{layout:t={},...n}=e;const o=Pr(t.type);return o?(0,s.createElement)(o.save,i({layout:t},n)):null}const Or=["none","left","center","right","wide","full"],Fr=["wide","full"];function zr(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Or;e.includes("none")||(e=["none",...e]);const{wideControlsEnabled:t=!1,themeSupportsLayout:n}=(0,m.useSelect)((e=>{const{getSettings:t}=e(Qn),n=t();return{wideControlsEnabled:n.alignWide,themeSupportsLayout:n.supportsLayout}}),[]),o=Ar(),r=Pr(null==o?void 0:o.type),l=r.getAlignments(o);if(n){const t=l.filter((t=>{let{name:n}=t;return e.includes(n)}));return 1===t.length&&"none"===t[0].name?[]:t}if("default"!==r.name)return[];const{alignments:i=Or}=o,s=e.filter((e=>(o.alignments||t||!Fr.includes(e))&&i.includes(e))).map((e=>({name:e})));return 1===s.length&&"none"===s[0].name?[]:s}var Vr=(0,s.createElement)(A.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(A.Path,{d:"M5 15h14V9H5v6zm0 4.8h14v-1.5H5v1.5zM5 4.2v1.5h14V4.2H5z"})),Hr=(0,s.createElement)(A.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(A.Path,{d:"M4 9v6h14V9H4zm8-4.8H4v1.5h8V4.2zM4 19.8h8v-1.5H4v1.5z"})),Gr=(0,s.createElement)(A.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(A.Path,{d:"M6 15h14V9H6v6zm6-10.8v1.5h8V4.2h-8zm0 15.6h8v-1.5h-8v1.5z"})),Ur=(0,s.createElement)(A.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(A.Path,{d:"M5 4v11h14V4H5zm3 15.8h8v-1.5H8v1.5z"}));const Wr={none:{icon:Vr,title:(0,g._x)("None","Alignment option")},left:{icon:Hr,title:(0,g.__)("Align left")},center:{icon:xr,title:(0,g.__)("Align center")},right:{icon:Gr,title:(0,g.__)("Align right")},wide:{icon:Tr,title:(0,g.__)("Wide width")},full:{icon:Ur,title:(0,g.__)("Full width")}},$r={isAlternate:!0};var jr=function(e){let{value:t,onChange:n,controls:o,isToolbar:r,isCollapsed:l=!0}=e;const a=zr(o);if(!a.length)return null;function u(e){n([t,"none"].includes(e)?void 0:e)}const d=Wr[t],m=Wr.none,f=r?p.ToolbarGroup:p.ToolbarDropdownMenu,h={popoverProps:$r,icon:d?d.icon:m.icon,label:(0,g.__)("Align"),toggleProps:{describedBy:(0,g.__)("Change alignment")}},v=r?{isCollapsed:l,controls:a.map((e=>{let{name:n}=e;return{...Wr[n],isActive:t===n||!t&&"none"===n,role:l?"menuitemradio":void 0,onClick:()=>u(n)}}))}:{children:e=>{let{onClose:n}=e;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.MenuGroup,{className:"block-editor-block-alignment-control__menu-group"},a.map((e=>{let{name:o,info:r}=e;const{icon:l,title:i}=Wr[o],a=o===t||!t&&"none"===o;return(0,s.createElement)(p.MenuItem,{key:o,icon:l,iconPosition:"left",className:c()("components-dropdown-menu__menu-item",{"is-active":a}),isSelected:a,onClick:()=>{u(o),n()},role:"menuitemradio",info:r},i)}))))}};return(0,s.createElement)(f,i({},h,v))};const Kr=e=>(0,s.createElement)(jr,i({},e,{isToolbar:!1})),qr=e=>(0,s.createElement)(jr,i({},e,{isToolbar:!0})),Yr=["left","center","right","wide","full"],Zr=["wide","full"];function Qr(e){let t,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],o=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return t=Array.isArray(e)?Yr.filter((t=>e.includes(t))):!0===e?[...Yr]:[],!o||!0===e&&!n?(0,u.without)(t,...Zr):t}const Xr=(0,d.createHigherOrderComponent)((e=>t=>{const{name:n}=t,o=zr(Qr((0,r.getBlockSupport)(n,"align"),(0,r.hasBlockSupport)(n,"alignWide",!0))).map((e=>{let{name:t}=e;return t}));return(0,s.createElement)(s.Fragment,null,!!o.length&&(0,s.createElement)(so,{group:"block",__experimentalShareWithChildBlocks:!0},(0,s.createElement)(Kr,{value:t.attributes.align,onChange:e=>{if(!e){var n,o;const l=(0,r.getBlockType)(t.name);(null==l||null===(n=l.attributes)||void 0===n||null===(o=n.align)||void 0===o?void 0:o.default)&&(e="")}t.setAttributes({align:e})},controls:o})),(0,s.createElement)(e,t))}),"withToolbarControls"),Jr=(0,d.createHigherOrderComponent)((e=>t=>{const{name:n,attributes:o}=t,{align:l}=o,a=zr(Qr((0,r.getBlockSupport)(n,"align"),(0,r.hasBlockSupport)(n,"alignWide",!0)));if(void 0===l)return(0,s.createElement)(e,t);let c=t.wrapperProps;return a.some((e=>e.name===l))&&(c={...c,"data-align":l}),(0,s.createElement)(e,i({},t,{wrapperProps:c}))}));(0,l.addFilter)("blocks.registerBlockType","core/align/addAttribute",(function(e){return(0,u.has)(e.attributes,["align","type"])||(0,r.hasBlockSupport)(e,"align")&&(e.attributes={...e.attributes,align:{type:"string",enum:[...Yr,""]}}),e})),(0,l.addFilter)("editor.BlockListBlock","core/editor/align/with-data-align",Jr),(0,l.addFilter)("editor.BlockEdit","core/editor/align/with-toolbar-controls",Xr),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/align/addAssignedAlign",(function(e,t,n){const{align:o}=n;return Qr((0,r.getBlockSupport)(t,"align"),(0,r.hasBlockSupport)(t,"alignWide",!0)).includes(o)&&(e.className=c()(`align${o}`,e.className)),e})),(0,l.addFilter)("blocks.registerBlockType","core/lock/addAttribute",(function(e){return(0,u.has)(e.attributes,["lock","type"])||(e.attributes={...e.attributes,lock:{type:"object"}}),e}));const el=/[\s#]/g,tl={type:"string",source:"attribute",attribute:"id",selector:"*"},nl=(0,d.createHigherOrderComponent)((e=>t=>{if((0,r.hasBlockSupport)(t.name,"anchor")&&t.isSelected){const n="web"===s.Platform.OS,o=(0,s.createElement)(p.TextControl,{className:"html-anchor-control",label:(0,g.__)("HTML anchor"),help:(0,s.createElement)(s.Fragment,null,(0,g.__)("Enter a word or two — without spaces — to make a unique web address just for this block, called an “anchor.” Then, you’ll be able to link directly to this section of your page."),n&&(0,s.createElement)(p.ExternalLink,{href:(0,g.__)("https://wordpress.org/support/article/page-jumps/")},(0,g.__)("Learn more about anchors"))),value:t.attributes.anchor||"",placeholder:n?null:(0,g.__)("Add an anchor"),onChange:e=>{e=e.replace(el,"-"),t.setAttributes({anchor:e})},autoCapitalize:"none",autoComplete:"off"});return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(e,t),n&&(0,s.createElement)(Do,{__experimentalGroup:"advanced"},o),!n&&"core/heading"===t.name&&(0,s.createElement)(Do,null,(0,s.createElement)(p.PanelBody,{title:(0,g.__)("Heading settings")},o)))}return(0,s.createElement)(e,t)}),"withInspectorControl");(0,l.addFilter)("blocks.registerBlockType","core/anchor/attribute",(function(e){return(0,u.has)(e.attributes,["anchor","type"])||(0,r.hasBlockSupport)(e,"anchor")&&(e.attributes={...e.attributes,anchor:tl}),e})),(0,l.addFilter)("editor.BlockEdit","core/editor/anchor/with-inspector-control",nl),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/anchor/save-props",(function(e,t,n){return(0,r.hasBlockSupport)(t,"anchor")&&(e.id=""===n.anchor?null:n.anchor),e}));const ol=(0,d.createHigherOrderComponent)((e=>t=>(0,r.hasBlockSupport)(t.name,"customClassName",!0)&&t.isSelected?(0,s.createElement)(s.Fragment,null,(0,s.createElement)(e,t),(0,s.createElement)(Do,{__experimentalGroup:"advanced"},(0,s.createElement)(p.TextControl,{autoComplete:"off",label:(0,g.__)("Additional CSS class(es)"),value:t.attributes.className||"",onChange:e=>{t.setAttributes({className:""!==e?e:void 0})},help:(0,g.__)("Separate multiple classes with spaces.")}))):(0,s.createElement)(e,t)),"withInspectorControl");(0,l.addFilter)("blocks.registerBlockType","core/custom-class-name/attribute",(function(e){return(0,r.hasBlockSupport)(e,"customClassName",!0)&&(e.attributes={...e.attributes,className:{type:"string"}}),e})),(0,l.addFilter)("editor.BlockEdit","core/editor/custom-class-name/with-inspector-control",ol),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/custom-class-name/save-props",(function(e,t,n){return(0,r.hasBlockSupport)(t,"customClassName",!0)&&n.className&&(e.className=c()(e.className,n.className)),e})),(0,l.addFilter)("blocks.switchToBlockType.transformedBlock","core/color/addTransforms",(function(e,t,n,o){if(!(0,r.hasBlockSupport)(e.name,"customClassName",!0))return e;if(1===o.length&&e.innerBlocks.length===t.length)return e;if(1===o.length&&t.length>1||o.length>1&&1===t.length)return e;if(t[n]){var l;const o=null===(l=t[n])||void 0===l?void 0:l.attributes.className;if(o)return{...e,attributes:{...e.attributes,className:o}}}return e})),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/generated-class-name/save-props",(function(e,t){return(0,r.hasBlockSupport)(t,"className",!0)&&("string"==typeof e.className?e.className=(0,u.uniq)([(0,r.getBlockDefaultClassName)(t.name),...e.className.split(" ")]).join(" ").trim():e.className=(0,r.getBlockDefaultClassName)(t.name)),e}));const rl="var:";function ll(e,t,n,o){const r=(0,u.get)(e,n);return r?[{selector:null==t?void 0:t.selector,key:o,value:sl(r)}]:[]}function il(e,t,n,o){const r=(0,u.get)(e,n);if(!r)return[];const l=[];if("string"==typeof r)l.push({selector:null==t?void 0:t.selector,key:o,value:r});else{const e=["top","right","bottom","left"].reduce(((e,n)=>{const l=(0,u.get)(r,[n]);return l&&e.push({selector:null==t?void 0:t.selector,key:`${o}${(0,u.upperFirst)(n)}`,value:l}),e}),[]);l.push(...e)}return l}function sl(e){return"string"==typeof e&&e.startsWith(rl)?`var(--wp--${e.slice(rl.length).split("|").join("--")})`:e}const al=[{name:"text",generate:(e,t)=>ll(e,t,["color","text"],"color")},{name:"gradient",generate:(e,t)=>ll(e,t,["color","gradient"],"background")},{name:"background",generate:(e,t)=>ll(e,t,["color","background"],"backgroundColor")},{name:"margin",generate:(e,t)=>il(e,t,["spacing","margin"],"margin")},{name:"padding",generate:(e,t)=>il(e,t,["spacing","padding"],"padding")},{name:"fontSize",generate:(e,t)=>ll(e,t,["typography","fontSize"],"fontSize")},{name:"fontStyle",generate:(e,t)=>ll(e,t,["typography","fontStyle"],"fontStyle")},{name:"fontWeight",generate:(e,t)=>ll(e,t,["typography","fontWeight"],"fontWeight")},{name:"letterSpacing",generate:(e,t)=>ll(e,t,["typography","letterSpacing"],"letterSpacing")},{name:"letterSpacing",generate:(e,t)=>ll(e,t,["typography","lineHeight"],"lineHeight")},{name:"textDecoration",generate:(e,t)=>ll(e,t,["typography","textDecoration"],"textDecoration")},{name:"textTransform",generate:(e,t)=>ll(e,t,["typography","textTransform"],"textTransform")}];function cl(e,t){const n=[];return al.forEach((o=>{"function"==typeof o.generate&&n.push(...o.generate(e,t))})),n}var ul=window.wp.dom;const dl=(0,s.createContext)({});function pl(e){let{value:t,children:n}=e;const o=(0,s.useContext)(dl),r=(0,s.useMemo)((()=>({...o,...t})),[o,t]);return(0,s.createElement)(dl.Provider,{value:r,children:n})}var ml=dl;const fl={};var gl=(0,p.withFilters)("editor.BlockEdit")((e=>{const{attributes:t={},name:n}=e,o=(0,r.getBlockType)(n),l=(0,s.useContext)(ml),a=(0,s.useMemo)((()=>o&&o.usesContext?(0,u.pick)(l,o.usesContext):fl),[o,l]);if(!o)return null;const d=o.edit||o.save;if(o.apiVersion>1)return(0,s.createElement)(d,i({},e,{context:a}));const p=(0,r.hasBlockSupport)(o,"className",!0)?(0,r.getBlockDefaultClassName)(n):null,m=c()(p,t.className);return(0,s.createElement)(d,i({},e,{context:a,className:m}))}));function hl(e){const{name:t,isSelected:n,clientId:o}=e,r={name:t,isSelected:n,clientId:o};return(0,s.createElement)(eo,{value:(0,s.useMemo)((()=>r),Object.values(r))},(0,s.createElement)(gl,e))}var vl=(0,s.createElement)(A.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(A.Path,{d:"M11 13h2v-2h-2v2zm-6 0h2v-2H5v2zm12-2v2h2v-2h-2z"})),bl=function(e){let{className:t,actions:n,children:o,secondaryActions:r}=e;return(0,s.createElement)("div",{style:{display:"contents",all:"initial"}},(0,s.createElement)("div",{className:c()(t,"block-editor-warning")},(0,s.createElement)("div",{className:"block-editor-warning__contents"},(0,s.createElement)("p",{className:"block-editor-warning__message"},o),(s.Children.count(n)>0||r)&&(0,s.createElement)("div",{className:"block-editor-warning__actions"},s.Children.count(n)>0&&s.Children.map(n,((e,t)=>(0,s.createElement)("span",{key:t,className:"block-editor-warning__action"},e))),r&&(0,s.createElement)(p.DropdownMenu,{className:"block-editor-warning__secondary",icon:vl,label:(0,g.__)("More options"),popoverProps:{position:"bottom left",className:"block-editor-warning__dropdown"},noIcons:!0},(()=>(0,s.createElement)(p.MenuGroup,null,r.map(((e,t)=>(0,s.createElement)(p.MenuItem,{onClick:e.onClick,key:t},e.title))))))))))},kl=n(1973);function _l(e){let{title:t,rawContent:n,renderedContent:o,action:r,actionText:l,className:i}=e;return(0,s.createElement)("div",{className:i},(0,s.createElement)("div",{className:"block-editor-block-compare__content"},(0,s.createElement)("h2",{className:"block-editor-block-compare__heading"},t),(0,s.createElement)("div",{className:"block-editor-block-compare__html"},n),(0,s.createElement)("div",{className:"block-editor-block-compare__preview edit-post-visual-editor"},(0,s.createElement)(s.RawHTML,null,(0,ul.safeHTML)(o)))),(0,s.createElement)("div",{className:"block-editor-block-compare__action"},(0,s.createElement)(p.Button,{variant:"secondary",tabIndex:"0",onClick:r},l)))}var yl=function(e){let{block:t,onKeep:n,onConvert:o,convertor:l,convertButtonText:i}=e;const a=(d=l(t),(0,u.castArray)(d).map((e=>(0,r.getSaveContent)(e.name,e.attributes,e.innerBlocks))).join(""));var d;const p=(m=t.originalContent,f=a,(0,kl.Kx)(m,f).map(((e,t)=>{const n=c()({"block-editor-block-compare__added":e.added,"block-editor-block-compare__removed":e.removed});return(0,s.createElement)("span",{key:t,className:n},e.value)})));var m,f;return(0,s.createElement)("div",{className:"block-editor-block-compare__wrapper"},(0,s.createElement)(_l,{title:(0,g.__)("Current"),className:"block-editor-block-compare__current",action:n,actionText:(0,g.__)("Convert to HTML"),rawContent:t.originalContent,renderedContent:t.originalContent}),(0,s.createElement)(_l,{title:(0,g.__)("After Conversion"),className:"block-editor-block-compare__converted",action:o,actionText:i,rawContent:p,renderedContent:a}))};const El=e=>(0,r.rawHandler)({HTML:e.originalContent});var Cl=(0,d.compose)([(0,m.withSelect)(((e,t)=>{let{clientId:n}=t;return{block:e(Qn).getBlock(n)}})),(0,m.withDispatch)(((e,t)=>{let{block:n}=t;const{replaceBlock:o}=e(Qn);return{convertToClassic(){o(n.clientId,(e=>(0,r.createBlock)("core/freeform",{content:e.originalContent}))(n))},convertToHTML(){o(n.clientId,(e=>(0,r.createBlock)("core/html",{content:e.originalContent}))(n))},convertToBlocks(){o(n.clientId,El(n))},attemptBlockRecovery(){o(n.clientId,(e=>{let{name:t,attributes:n,innerBlocks:o}=e;return(0,r.createBlock)(t,n,o)})(n))}}}))])((function(e){let{convertToHTML:t,convertToBlocks:n,convertToClassic:o,attemptBlockRecovery:l,block:i}=e;const a=!!(0,r.getBlockType)("core/html"),[c,u]=(0,s.useState)(!1),d=(0,s.useCallback)((()=>u(!0)),[]),m=(0,s.useCallback)((()=>u(!1)),[]),f=(0,s.useMemo)((()=>[{
|
8 |
// translators: Button to fix block content
|
9 |
+
title:(0,g._x)("Resolve","imperative verb"),onClick:d},a&&{title:(0,g.__)("Convert to HTML"),onClick:t},{title:(0,g.__)("Convert to Classic Block"),onClick:o}].filter(Boolean)),[d,t,o]);return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(bl,{actions:[(0,s.createElement)(p.Button,{key:"recover",onClick:l,variant:"primary"},(0,g.__)("Attempt Block Recovery"))],secondaryActions:f},(0,g.__)("This block contains unexpected or invalid content.")),c&&(0,s.createElement)(p.Modal,{title:// translators: Dialog title to fix block content
|
10 |
+
(0,g.__)("Resolve Block"),onRequestClose:m,className:"block-editor-block-compare"},(0,s.createElement)(yl,{block:i,onKeep:t,onConvert:n,convertor:El,convertButtonText:(0,g.__)("Convert to Blocks")})))}));const Sl=(0,s.createElement)(bl,{className:"block-editor-block-list__block-crash-warning"},(0,g.__)("This block has encountered an error and cannot be previewed."));var wl=()=>Sl;class Bl extends s.Component{constructor(){super(...arguments),this.state={hasError:!1}}componentDidCatch(){this.setState({hasError:!0})}render(){return this.state.hasError?this.props.fallback:this.props.children}}var Il=Bl,xl=n(773),Tl=function(e){let{clientId:t}=e;const[n,o]=(0,s.useState)(""),l=(0,m.useSelect)((e=>e(Qn).getBlock(t)),[t]),{updateBlock:i}=(0,m.useDispatch)(Qn);return(0,s.useEffect)((()=>{o((0,r.getBlockContent)(l))}),[l]),(0,s.createElement)(xl.Z,{className:"block-editor-block-list__block-html-textarea",value:n,onBlur:()=>{const e=(0,r.getBlockType)(l.name);if(!e)return;const s=(0,r.getBlockAttributes)(e,n,l.attributes),a=n||(0,r.getSaveContent)(e,s),[c]=n?(0,r.validateBlock)({...l,attributes:s,originalContent:a}):[!0];i(t,{attributes:s,originalContent:a,isValid:c}),n||o({content:a})},onChange:e=>o(e.target.value)})};let Nl=jl();const Pl=e=>Gl(e,Nl);let Rl=jl();Pl.write=e=>Gl(e,Rl);let Ml=jl();Pl.onStart=e=>Gl(e,Ml);let Ll=jl();Pl.onFrame=e=>Gl(e,Ll);let Al=jl();Pl.onFinish=e=>Gl(e,Al);let Dl=[];Pl.setTimeout=(e,t)=>{let n=Pl.now()+t,o=()=>{let e=Dl.findIndex((e=>e.cancel==o));~e&&Dl.splice(e,1),Vl-=~e?1:0},r={time:n,handler:e,cancel:o};return Dl.splice(Ol(n),0,r),Vl+=1,Ul(),r};let Ol=e=>~(~Dl.findIndex((t=>t.time>e))||~Dl.length);Pl.cancel=e=>{Ml.delete(e),Ll.delete(e),Nl.delete(e),Rl.delete(e),Al.delete(e)},Pl.sync=e=>{Hl=!0,Pl.batchedUpdates(e),Hl=!1},Pl.throttle=e=>{let t;function n(){try{e(...t)}finally{t=null}}function o(...e){t=e,Pl.onStart(n)}return o.handler=e,o.cancel=()=>{Ml.delete(n),t=null},o};let Fl="undefined"!=typeof window?window.requestAnimationFrame:()=>{};Pl.use=e=>Fl=e,Pl.now="undefined"!=typeof performance?()=>performance.now():Date.now,Pl.batchedUpdates=e=>e(),Pl.catch=console.error,Pl.frameLoop="always",Pl.advance=()=>{"demand"!==Pl.frameLoop?console.warn("Cannot call the manual advancement of rafz whilst frameLoop is not set as demand"):$l()};let zl=-1,Vl=0,Hl=!1;function Gl(e,t){Hl?(t.delete(e),e(0)):(t.add(e),Ul())}function Ul(){zl<0&&(zl=0,"demand"!==Pl.frameLoop&&Fl(Wl))}function Wl(){~zl&&(Fl(Wl),Pl.batchedUpdates($l))}function $l(){let e=zl;zl=Pl.now();let t=Ol(zl);t&&(Kl(Dl.splice(0,t),(e=>e.handler())),Vl-=t),Ml.flush(),Nl.flush(e?Math.min(64,zl-e):16.667),Ll.flush(),Rl.flush(),Al.flush(),Vl||(zl=-1)}function jl(){let e=new Set,t=e;return{add(n){Vl+=t!=e||e.has(n)?0:1,e.add(n)},delete:n=>(Vl-=t==e&&e.has(n)?1:0,e.delete(n)),flush(n){t.size&&(e=new Set,Vl-=t.size,Kl(t,(t=>t(n)&&e.add(t))),Vl+=e.size,t=e)}}}function Kl(e,t){e.forEach((e=>{try{t(e)}catch(e){Pl.catch(e)}}))}var ql=n(9196),Yl=n.n(ql);function Zl(){}const Ql={arr:Array.isArray,obj:e=>!!e&&"Object"===e.constructor.name,fun:e=>"function"==typeof e,str:e=>"string"==typeof e,num:e=>"number"==typeof e,und:e=>void 0===e};function Xl(e,t){if(Ql.arr(e)){if(!Ql.arr(t)||e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}return e===t}const Jl=(e,t)=>e.forEach(t);function ei(e,t,n){if(Ql.arr(e))for(let o=0;o<e.length;o++)t.call(n,e[o],`${o}`);else for(const o in e)e.hasOwnProperty(o)&&t.call(n,e[o],o)}const ti=e=>Ql.und(e)?[]:Ql.arr(e)?e:[e];function ni(e,t){if(e.size){const n=Array.from(e);e.clear(),Jl(n,t)}}const oi=(e,...t)=>ni(e,(e=>e(...t))),ri=()=>"undefined"==typeof window||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent);let li,ii,si=null,ai=!1,ci=Zl;var ui=Object.freeze({__proto__:null,get createStringInterpolator(){return li},get to(){return ii},get colors(){return si},get skipAnimation(){return ai},get willAdvance(){return ci},assign:e=>{e.to&&(ii=e.to),e.now&&(Pl.now=e.now),void 0!==e.colors&&(si=e.colors),null!=e.skipAnimation&&(ai=e.skipAnimation),e.createStringInterpolator&&(li=e.createStringInterpolator),e.requestAnimationFrame&&Pl.use(e.requestAnimationFrame),e.batchedUpdates&&(Pl.batchedUpdates=e.batchedUpdates),e.willAdvance&&(ci=e.willAdvance),e.frameLoop&&(Pl.frameLoop=e.frameLoop)}});const di=new Set;let pi=[],mi=[],fi=0;const gi={get idle(){return!di.size&&!pi.length},start(e){fi>e.priority?(di.add(e),Pl.onStart(hi)):(vi(e),Pl(ki))},advance:ki,sort(e){if(fi)Pl.onFrame((()=>gi.sort(e)));else{const t=pi.indexOf(e);~t&&(pi.splice(t,1),bi(e))}},clear(){pi=[],di.clear()}};function hi(){di.forEach(vi),di.clear(),Pl(ki)}function vi(e){pi.includes(e)||bi(e)}function bi(e){pi.splice(function(t,n){const o=t.findIndex((t=>t.priority>e.priority));return o<0?t.length:o}(pi),0,e)}function ki(e){const t=mi;for(let n=0;n<pi.length;n++){const o=pi[n];fi=o.priority,o.idle||(ci(o),o.advance(e),o.idle||t.push(o))}return fi=0,mi=pi,mi.length=0,pi=t,pi.length>0}const _i="[-+]?\\d*\\.?\\d+",yi=_i+"%";function Ei(...e){return"\\(\\s*("+e.join(")\\s*,\\s*(")+")\\s*\\)"}const Ci=new RegExp("rgb"+Ei(_i,_i,_i)),Si=new RegExp("rgba"+Ei(_i,_i,_i,_i)),wi=new RegExp("hsl"+Ei(_i,yi,yi)),Bi=new RegExp("hsla"+Ei(_i,yi,yi,_i)),Ii=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,xi=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,Ti=/^#([0-9a-fA-F]{6})$/,Ni=/^#([0-9a-fA-F]{8})$/;function Pi(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function Ri(e,t,n){const o=n<.5?n*(1+t):n+t-n*t,r=2*n-o,l=Pi(r,o,e+1/3),i=Pi(r,o,e),s=Pi(r,o,e-1/3);return Math.round(255*l)<<24|Math.round(255*i)<<16|Math.round(255*s)<<8}function Mi(e){const t=parseInt(e,10);return t<0?0:t>255?255:t}function Li(e){return(parseFloat(e)%360+360)%360/360}function Ai(e){const t=parseFloat(e);return t<0?0:t>1?255:Math.round(255*t)}function Di(e){const t=parseFloat(e);return t<0?0:t>100?1:t/100}function Oi(e){let t=function(e){let t;return"number"==typeof e?e>>>0===e&&e>=0&&e<=4294967295?e:null:(t=Ti.exec(e))?parseInt(t[1]+"ff",16)>>>0:si&&void 0!==si[e]?si[e]:(t=Ci.exec(e))?(Mi(t[1])<<24|Mi(t[2])<<16|Mi(t[3])<<8|255)>>>0:(t=Si.exec(e))?(Mi(t[1])<<24|Mi(t[2])<<16|Mi(t[3])<<8|Ai(t[4]))>>>0:(t=Ii.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+"ff",16)>>>0:(t=Ni.exec(e))?parseInt(t[1],16)>>>0:(t=xi.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+t[4]+t[4],16)>>>0:(t=wi.exec(e))?(255|Ri(Li(t[1]),Di(t[2]),Di(t[3])))>>>0:(t=Bi.exec(e))?(Ri(Li(t[1]),Di(t[2]),Di(t[3]))|Ai(t[4]))>>>0:null}(e);return null===t?e:(t=t||0,`rgba(${(4278190080&t)>>>24}, ${(16711680&t)>>>16}, ${(65280&t)>>>8}, ${(255&t)/255})`)}const Fi=(e,t,n)=>{if(Ql.fun(e))return e;if(Ql.arr(e))return Fi({range:e,output:t,extrapolate:n});if(Ql.str(e.output[0]))return li(e);const o=e,r=o.output,l=o.range||[0,1],i=o.extrapolateLeft||o.extrapolate||"extend",s=o.extrapolateRight||o.extrapolate||"extend",a=o.easing||(e=>e);return e=>{const t=function(e,t){for(var n=1;n<t.length-1&&!(t[n]>=e);++n);return n-1}(e,l);return function(e,t,n,o,r,l,i,s,a){let c=a?a(e):e;if(c<t){if("identity"===i)return c;"clamp"===i&&(c=t)}if(c>n){if("identity"===s)return c;"clamp"===s&&(c=n)}return o===r?o:t===n?e<=t?o:r:(t===-1/0?c=-c:n===1/0?c-=t:c=(c-t)/(n-t),c=l(c),o===-1/0?c=-c:r===1/0?c+=o:c=c*(r-o)+o,c)}(e,l[t],l[t+1],r[t],r[t+1],a,i,s,o.map)}};function zi(){return(zi=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e}).apply(this,arguments)}const Vi=Symbol.for("FluidValue.get"),Hi=Symbol.for("FluidValue.observers"),Gi=e=>Boolean(e&&e[Vi]),Ui=e=>e&&e[Vi]?e[Vi]():e,Wi=e=>e[Hi]||null;function $i(e,t){let n=e[Hi];n&&n.forEach((e=>{!function(e,t){e.eventObserved?e.eventObserved(t):e(t)}(e,t)}))}class ji{constructor(e){if(this[Vi]=void 0,this[Hi]=void 0,!e&&!(e=this.get))throw Error("Unknown getter");Ki(this,e)}}const Ki=(e,t)=>Zi(e,Vi,t);function qi(e,t){if(e[Vi]){let n=e[Hi];n||Zi(e,Hi,n=new Set),n.has(t)||(n.add(t),e.observerAdded&&e.observerAdded(n.size,t))}return t}function Yi(e,t){let n=e[Hi];if(n&&n.has(t)){const o=n.size-1;o?n.delete(t):e[Hi]=null,e.observerRemoved&&e.observerRemoved(o,t)}}const Zi=(e,t,n)=>Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0}),Qi=/[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,Xi=/(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi,Ji=new RegExp(`(${Qi.source})(%|[a-z]+)`,"i"),es=/rgba\(([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+)\)/gi,ts=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/,ns=e=>{const[t,n]=os(e);if(!t||ri())return e;const o=window.getComputedStyle(document.documentElement).getPropertyValue(t);if(o)return o.trim();if(n&&n.startsWith("--")){return window.getComputedStyle(document.documentElement).getPropertyValue(n)||e}return n&&ts.test(n)?ns(n):n||e},os=e=>{const t=ts.exec(e);if(!t)return[,];const[,n,o]=t;return[n,o]};let rs;const ls=(e,t,n,o,r)=>`rgba(${Math.round(t)}, ${Math.round(n)}, ${Math.round(o)}, ${r})`,is=e=>{rs||(rs=si?new RegExp(`(${Object.keys(si).join("|")})(?!\\w)`,"g"):/^\b$/);const t=e.output.map((e=>Ui(e).replace(ts,ns).replace(Xi,Oi).replace(rs,Oi))),n=t.map((e=>e.match(Qi).map(Number))),o=n[0].map(((e,t)=>n.map((e=>{if(!(t in e))throw Error('The arity of each "output" value must be equal');return e[t]})))).map((t=>Fi(zi({},e,{output:t}))));return e=>{var n;const r=!Ji.test(t[0])&&(null==(n=t.find((e=>Ji.test(e))))?void 0:n.replace(Qi,""));let l=0;return t[0].replace(Qi,(()=>`${o[l++](e)}${r||""}`)).replace(es,ls)}},ss="react-spring: ",as=e=>{const t=e;let n=!1;if("function"!=typeof t)throw new TypeError(`${ss}once requires a function parameter`);return(...e)=>{n||(t(...e),n=!0)}},cs=as(console.warn),us=as(console.warn);function ds(e){return Ql.str(e)&&("#"==e[0]||/\d/.test(e)||!ri()&&ts.test(e)||e in(si||{}))}const ps="undefined"!=typeof window&&window.document&&window.document.createElement?ql.useLayoutEffect:ql.useEffect;function ms(){const e=(0,ql.useState)()[1],t=(()=>{const e=(0,ql.useRef)(!1);return ps((()=>(e.current=!0,()=>{e.current=!1})),[]),e})();return()=>{t.current&&e(Math.random())}}const fs=e=>(0,ql.useEffect)(e,gs),gs=[];function hs(e){const t=(0,ql.useRef)();return(0,ql.useEffect)((()=>{t.current=e})),t.current}const vs=Symbol.for("Animated:node"),bs=e=>e&&e[vs],ks=(e,t)=>{return n=e,o=vs,r=t,Object.defineProperty(n,o,{value:r,writable:!0,configurable:!0});var n,o,r},_s=e=>e&&e[vs]&&e[vs].getPayload();class ys{constructor(){this.payload=void 0,ks(this,this)}getPayload(){return this.payload||[]}}class Es extends ys{constructor(e){super(),this.done=!0,this.elapsedTime=void 0,this.lastPosition=void 0,this.lastVelocity=void 0,this.v0=void 0,this.durationProgress=0,this._value=e,Ql.num(this._value)&&(this.lastPosition=this._value)}static create(e){return new Es(e)}getPayload(){return[this]}getValue(){return this._value}setValue(e,t){return Ql.num(e)&&(this.lastPosition=e,t&&(e=Math.round(e/t)*t,this.done&&(this.lastPosition=e))),this._value!==e&&(this._value=e,!0)}reset(){const{done:e}=this;this.done=!1,Ql.num(this._value)&&(this.elapsedTime=0,this.durationProgress=0,this.lastPosition=this._value,e&&(this.lastVelocity=null),this.v0=null)}}class Cs extends Es{constructor(e){super(0),this._string=null,this._toString=void 0,this._toString=Fi({output:[e,e]})}static create(e){return new Cs(e)}getValue(){let e=this._string;return null==e?this._string=this._toString(this._value):e}setValue(e){if(Ql.str(e)){if(e==this._string)return!1;this._string=e,this._value=1}else{if(!super.setValue(e))return!1;this._string=null}return!0}reset(e){e&&(this._toString=Fi({output:[this.getValue(),e]})),this._value=0,super.reset()}}const Ss={dependencies:null};class ws extends ys{constructor(e){super(),this.source=e,this.setValue(e)}getValue(e){const t={};return ei(this.source,((n,o)=>{var r;(r=n)&&r[vs]===r?t[o]=n.getValue(e):Gi(n)?t[o]=Ui(n):e||(t[o]=n)})),t}setValue(e){this.source=e,this.payload=this._makePayload(e)}reset(){this.payload&&Jl(this.payload,(e=>e.reset()))}_makePayload(e){if(e){const t=new Set;return ei(e,this._addToPayload,t),Array.from(t)}}_addToPayload(e){Ss.dependencies&&Gi(e)&&Ss.dependencies.add(e);const t=_s(e);t&&Jl(t,(e=>this.add(e)))}}class Bs extends ws{constructor(e){super(e)}static create(e){return new Bs(e)}getValue(){return this.source.map((e=>e.getValue()))}setValue(e){const t=this.getPayload();return e.length==t.length?t.map(((t,n)=>t.setValue(e[n]))).some(Boolean):(super.setValue(e.map(Is)),!0)}}function Is(e){return(ds(e)?Cs:Es).create(e)}function xs(e){const t=bs(e);return t?t.constructor:Ql.arr(e)?Bs:ds(e)?Cs:Es}function Ts(){return(Ts=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e}).apply(this,arguments)}const Ns=(e,t)=>{const n=!Ql.fun(e)||e.prototype&&e.prototype.isReactComponent;return(0,ql.forwardRef)(((o,r)=>{const l=(0,ql.useRef)(null),i=n&&(0,ql.useCallback)((e=>{l.current=function(e,t){return e&&(Ql.fun(e)?e(t):e.current=t),t}(r,e)}),[r]),[s,a]=function(e,t){const n=new Set;return Ss.dependencies=n,e.style&&(e=Ts({},e,{style:t.createAnimatedStyle(e.style)})),e=new ws(e),Ss.dependencies=null,[e,n]}(o,t),c=ms(),u=()=>{const e=l.current;n&&!e||!1===(!!e&&t.applyAnimatedValues(e,s.getValue(!0)))&&c()},d=new Ps(u,a),p=(0,ql.useRef)();ps((()=>(p.current=d,Jl(a,(e=>qi(e,d))),()=>{p.current&&(Jl(p.current.deps,(e=>Yi(e,p.current))),Pl.cancel(p.current.update))}))),(0,ql.useEffect)(u,[]),fs((()=>()=>{const e=p.current;Jl(e.deps,(t=>Yi(t,e)))}));const m=t.getComponentProps(s.getValue());return ql.createElement(e,Ts({},m,{ref:i}))}))};class Ps{constructor(e,t){this.update=e,this.deps=t}eventObserved(e){"change"==e.type&&Pl.write(this.update)}}const Rs=Symbol.for("AnimatedComponent"),Ms=e=>Ql.str(e)?e:e&&Ql.str(e.displayName)?e.displayName:Ql.fun(e)&&e.name||null;function Ls(){return(Ls=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e}).apply(this,arguments)}function As(e,...t){return Ql.fun(e)?e(...t):e}const Ds=(e,t)=>!0===e||!!(t&&e&&(Ql.fun(e)?e(t):ti(e).includes(t))),Os=(e,t)=>Ql.obj(e)?t&&e[t]:e,Fs=(e,t)=>!0===e.default?e[t]:e.default?e.default[t]:void 0,zs=e=>e,Vs=(e,t=zs)=>{let n=Hs;e.default&&!0!==e.default&&(e=e.default,n=Object.keys(e));const o={};for(const r of n){const n=t(e[r],r);Ql.und(n)||(o[r]=n)}return o},Hs=["config","onProps","onStart","onChange","onPause","onResume","onRest"],Gs={config:1,from:1,to:1,ref:1,loop:1,reset:1,pause:1,cancel:1,reverse:1,immediate:1,default:1,delay:1,onProps:1,onStart:1,onChange:1,onPause:1,onResume:1,onRest:1,onResolve:1,items:1,trail:1,sort:1,expires:1,initial:1,enter:1,update:1,leave:1,children:1,onDestroyed:1,keys:1,callId:1,parentId:1};function Us(e){const t=function(e){const t={};let n=0;if(ei(e,((e,o)=>{Gs[o]||(t[o]=e,n++)})),n)return t}(e);if(t){const n={to:t};return ei(e,((e,o)=>o in t||(n[o]=e))),n}return Ls({},e)}function Ws(e){return e=Ui(e),Ql.arr(e)?e.map(Ws):ds(e)?ui.createStringInterpolator({range:[0,1],output:[e,e]})(1):e}function $s(e){for(const t in e)return!0;return!1}function js(e){return Ql.fun(e)||Ql.arr(e)&&Ql.obj(e[0])}function Ks(e,t){var n;null==(n=e.ref)||n.delete(e),null==t||t.delete(e)}function qs(e,t){var n;t&&e.ref!==t&&(null==(n=e.ref)||n.delete(e),t.add(e),e.ref=t)}Math.PI,Math.PI;const Ys=Ls({},{tension:170,friction:26},{mass:1,damping:1,easing:e=>e,clamp:!1});class Zs{constructor(){this.tension=void 0,this.friction=void 0,this.frequency=void 0,this.damping=void 0,this.mass=void 0,this.velocity=0,this.restVelocity=void 0,this.precision=void 0,this.progress=void 0,this.duration=void 0,this.easing=void 0,this.clamp=void 0,this.bounce=void 0,this.decay=void 0,this.round=void 0,Object.assign(this,Ys)}}function Qs(e,t){if(Ql.und(t.decay)){const n=!Ql.und(t.tension)||!Ql.und(t.friction);!n&&Ql.und(t.frequency)&&Ql.und(t.damping)&&Ql.und(t.mass)||(e.duration=void 0,e.decay=void 0),n&&(e.frequency=void 0)}else e.duration=void 0}const Xs=[];class Js{constructor(){this.changed=!1,this.values=Xs,this.toValues=null,this.fromValues=Xs,this.to=void 0,this.from=void 0,this.config=new Zs,this.immediate=!1}}function ea(e,{key:t,props:n,defaultProps:o,state:r,actions:l}){return new Promise(((i,s)=>{var a;let c,u,d=Ds(null!=(a=n.cancel)?a:null==o?void 0:o.cancel,t);if(d)f();else{Ql.und(n.pause)||(r.paused=Ds(n.pause,t));let e=null==o?void 0:o.pause;!0!==e&&(e=r.paused||Ds(e,t)),c=As(n.delay||0,t),e?(r.resumeQueue.add(m),l.pause()):(l.resume(),m())}function p(){r.resumeQueue.add(m),r.timeouts.delete(u),u.cancel(),c=u.time-Pl.now()}function m(){c>0&&!ui.skipAnimation?(r.delayed=!0,u=Pl.setTimeout(f,c),r.pauseQueue.add(p),r.timeouts.add(u)):f()}function f(){r.delayed&&(r.delayed=!1),r.pauseQueue.delete(p),r.timeouts.delete(u),e<=(r.cancelId||0)&&(d=!0);try{l.start(Ls({},n,{callId:e,cancel:d}),i)}catch(e){s(e)}}}))}const ta=(e,t)=>1==t.length?t[0]:t.some((e=>e.cancelled))?ra(e.get()):t.every((e=>e.noop))?na(e.get()):oa(e.get(),t.every((e=>e.finished))),na=e=>({value:e,noop:!0,finished:!0,cancelled:!1}),oa=(e,t,n=!1)=>({value:e,finished:t,cancelled:n}),ra=e=>({value:e,cancelled:!0,finished:!1});function la(e,t,n,o){const{callId:r,parentId:l,onRest:i}=t,{asyncTo:s,promise:a}=n;return l||e!==s||t.reset?n.promise=(async()=>{n.asyncId=r,n.asyncTo=e;const c=Vs(t,((e,t)=>"onRest"===t?void 0:e));let u,d;const p=new Promise(((e,t)=>(u=e,d=t))),m=e=>{const t=r<=(n.cancelId||0)&&ra(o)||r!==n.asyncId&&oa(o,!1);if(t)throw e.result=t,d(e),e},f=(e,t)=>{const l=new sa,i=new aa;return(async()=>{if(ui.skipAnimation)throw ia(n),i.result=oa(o,!1),d(i),i;m(l);const s=Ql.obj(e)?Ls({},e):Ls({},t,{to:e});s.parentId=r,ei(c,((e,t)=>{Ql.und(s[t])&&(s[t]=e)}));const a=await o.start(s);return m(l),n.paused&&await new Promise((e=>{n.resumeQueue.add(e)})),a})()};let g;if(ui.skipAnimation)return ia(n),oa(o,!1);try{let t;t=Ql.arr(e)?(async e=>{for(const t of e)await f(t)})(e):Promise.resolve(e(f,o.stop.bind(o))),await Promise.all([t.then(u),p]),g=oa(o.get(),!0,!1)}catch(e){if(e instanceof sa)g=e.result;else{if(!(e instanceof aa))throw e;g=e.result}}finally{r==n.asyncId&&(n.asyncId=l,n.asyncTo=l?s:void 0,n.promise=l?a:void 0)}return Ql.fun(i)&&Pl.batchedUpdates((()=>{i(g,o,o.item)})),g})():a}function ia(e,t){ni(e.timeouts,(e=>e.cancel())),e.pauseQueue.clear(),e.resumeQueue.clear(),e.asyncId=e.asyncTo=e.promise=void 0,t&&(e.cancelId=t)}class sa extends Error{constructor(){super("An async animation has been interrupted. You see this error because you forgot to use `await` or `.catch(...)` on its returned promise."),this.result=void 0}}class aa extends Error{constructor(){super("SkipAnimationSignal"),this.result=void 0}}const ca=e=>e instanceof da;let ua=1;class da extends ji{constructor(...e){super(...e),this.id=ua++,this.key=void 0,this._priority=0}get priority(){return this._priority}set priority(e){this._priority!=e&&(this._priority=e,this._onPriorityChange(e))}get(){const e=bs(this);return e&&e.getValue()}to(...e){return ui.to(this,e)}interpolate(...e){return cs(`${ss}The "interpolate" function is deprecated in v9 (use "to" instead)`),ui.to(this,e)}toJSON(){return this.get()}observerAdded(e){1==e&&this._attach()}observerRemoved(e){0==e&&this._detach()}_attach(){}_detach(){}_onChange(e,t=!1){$i(this,{type:"change",parent:this,value:e,idle:t})}_onPriorityChange(e){this.idle||gi.sort(this),$i(this,{type:"priority",parent:this,priority:e})}}const pa=Symbol.for("SpringPhase"),ma=e=>(1&e[pa])>0,fa=e=>(2&e[pa])>0,ga=e=>(4&e[pa])>0,ha=(e,t)=>t?e[pa]|=3:e[pa]&=-3,va=(e,t)=>t?e[pa]|=4:e[pa]&=-5;class ba extends da{constructor(e,t){if(super(),this.key=void 0,this.animation=new Js,this.queue=void 0,this.defaultProps={},this._state={paused:!1,delayed:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set},this._pendingCalls=new Set,this._lastCallId=0,this._lastToId=0,this._memoizedDuration=0,!Ql.und(e)||!Ql.und(t)){const n=Ql.obj(e)?Ls({},e):Ls({},t,{from:e});Ql.und(n.default)&&(n.default=!0),this.start(n)}}get idle(){return!(fa(this)||this._state.asyncTo)||ga(this)}get goal(){return Ui(this.animation.to)}get velocity(){const e=bs(this);return e instanceof Es?e.lastVelocity||0:e.getPayload().map((e=>e.lastVelocity||0))}get hasAnimated(){return ma(this)}get isAnimating(){return fa(this)}get isPaused(){return ga(this)}get isDelayed(){return this._state.delayed}advance(e){let t=!0,n=!1;const o=this.animation;let{config:r,toValues:l}=o;const i=_s(o.to);!i&&Gi(o.to)&&(l=ti(Ui(o.to))),o.values.forEach(((s,a)=>{if(s.done)return;const c=s.constructor==Cs?1:i?i[a].lastPosition:l[a];let u=o.immediate,d=c;if(!u){if(d=s.lastPosition,r.tension<=0)return void(s.done=!0);let t=s.elapsedTime+=e;const n=o.fromValues[a],l=null!=s.v0?s.v0:s.v0=Ql.arr(r.velocity)?r.velocity[a]:r.velocity;let i;if(Ql.und(r.duration))if(r.decay){const e=!0===r.decay?.998:r.decay,o=Math.exp(-(1-e)*t);d=n+l/(1-e)*(1-o),u=Math.abs(s.lastPosition-d)<.1,i=l*o}else{i=null==s.lastVelocity?l:s.lastVelocity;const t=r.precision||(n==c?.005:Math.min(1,.001*Math.abs(c-n))),o=r.restVelocity||t/10,a=r.clamp?0:r.bounce,p=!Ql.und(a),m=n==c?s.v0>0:n<c;let f,g=!1;const h=1,v=Math.ceil(e/h);for(let e=0;e<v&&(f=Math.abs(i)>o,f||(u=Math.abs(c-d)<=t,!u));++e)p&&(g=d==c||d>c==m,g&&(i=-i*a,d=c)),i+=(1e-6*-r.tension*(d-c)+.001*-r.friction*i)/r.mass*h,d+=i*h}else{let o=1;r.duration>0&&(this._memoizedDuration!==r.duration&&(this._memoizedDuration=r.duration,s.durationProgress>0&&(s.elapsedTime=r.duration*s.durationProgress,t=s.elapsedTime+=e)),o=(r.progress||0)+t/this._memoizedDuration,o=o>1?1:o<0?0:o,s.durationProgress=o),d=n+r.easing(o)*(c-n),i=(d-s.lastPosition)/e,u=1==o}s.lastVelocity=i,Number.isNaN(d)&&(console.warn("Got NaN while animating:",this),u=!0)}i&&!i[a].done&&(u=!1),u?s.done=!0:t=!1,s.setValue(d,r.round)&&(n=!0)}));const s=bs(this),a=s.getValue();if(t){const e=Ui(o.to);a===e&&!n||r.decay?n&&r.decay&&this._onChange(a):(s.setValue(e),this._onChange(e)),this._stop()}else n&&this._onChange(a)}set(e){return Pl.batchedUpdates((()=>{this._stop(),this._focus(e),this._set(e)})),this}pause(){this._update({pause:!0})}resume(){this._update({pause:!1})}finish(){if(fa(this)){const{to:e,config:t}=this.animation;Pl.batchedUpdates((()=>{this._onStart(),t.decay||this._set(e,!1),this._stop()}))}return this}update(e){return(this.queue||(this.queue=[])).push(e),this}start(e,t){let n;return Ql.und(e)?(n=this.queue||[],this.queue=[]):n=[Ql.obj(e)?e:Ls({},t,{to:e})],Promise.all(n.map((e=>this._update(e)))).then((e=>ta(this,e)))}stop(e){const{to:t}=this.animation;return this._focus(this.get()),ia(this._state,e&&this._lastCallId),Pl.batchedUpdates((()=>this._stop(t,e))),this}reset(){this._update({reset:!0})}eventObserved(e){"change"==e.type?this._start():"priority"==e.type&&(this.priority=e.priority+1)}_prepareNode(e){const t=this.key||"";let{to:n,from:o}=e;n=Ql.obj(n)?n[t]:n,(null==n||js(n))&&(n=void 0),o=Ql.obj(o)?o[t]:o,null==o&&(o=void 0);const r={to:n,from:o};return ma(this)||(e.reverse&&([n,o]=[o,n]),o=Ui(o),Ql.und(o)?bs(this)||this._set(n):this._set(o)),r}_update(e,t){let n=Ls({},e);const{key:o,defaultProps:r}=this;n.default&&Object.assign(r,Vs(n,((e,t)=>/^on/.test(t)?Os(e,o):e))),wa(this,n,"onProps"),Ba(this,"onProps",n,this);const l=this._prepareNode(n);if(Object.isFrozen(this))throw Error("Cannot animate a `SpringValue` object that is frozen. Did you forget to pass your component to `animated(...)` before animating its props?");const i=this._state;return ea(++this._lastCallId,{key:o,props:n,defaultProps:r,state:i,actions:{pause:()=>{ga(this)||(va(this,!0),oi(i.pauseQueue),Ba(this,"onPause",oa(this,ka(this,this.animation.to)),this))},resume:()=>{ga(this)&&(va(this,!1),fa(this)&&this._resume(),oi(i.resumeQueue),Ba(this,"onResume",oa(this,ka(this,this.animation.to)),this))},start:this._merge.bind(this,l)}}).then((e=>{if(n.loop&&e.finished&&(!t||!e.noop)){const e=_a(n);if(e)return this._update(e,!0)}return e}))}_merge(e,t,n){if(t.cancel)return this.stop(!0),n(ra(this));const o=!Ql.und(e.to),r=!Ql.und(e.from);if(o||r){if(!(t.callId>this._lastToId))return n(ra(this));this._lastToId=t.callId}const{key:l,defaultProps:i,animation:s}=this,{to:a,from:c}=s;let{to:u=a,from:d=c}=e;!r||o||t.default&&!Ql.und(u)||(u=d),t.reverse&&([u,d]=[d,u]);const p=!Xl(d,c);p&&(s.from=d),d=Ui(d);const m=!Xl(u,a);m&&this._focus(u);const f=js(t.to),{config:g}=s,{decay:h,velocity:v}=g;(o||r)&&(g.velocity=0),t.config&&!f&&function(e,t,n){n&&(Qs(n=Ls({},n),t),t=Ls({},n,t)),Qs(e,t),Object.assign(e,t);for(const t in Ys)null==e[t]&&(e[t]=Ys[t]);let{mass:o,frequency:r,damping:l}=e;Ql.und(r)||(r<.01&&(r=.01),l<0&&(l=0),e.tension=Math.pow(2*Math.PI/r,2)*o,e.friction=4*Math.PI*l*o/r)}(g,As(t.config,l),t.config!==i.config?As(i.config,l):void 0);let b=bs(this);if(!b||Ql.und(u))return n(oa(this,!0));const k=Ql.und(t.reset)?r&&!t.default:!Ql.und(d)&&Ds(t.reset,l),_=k?d:this.get(),y=Ws(u),E=Ql.num(y)||Ql.arr(y)||ds(y),C=!f&&(!E||Ds(i.immediate||t.immediate,l));if(m){const e=xs(u);if(e!==b.constructor){if(!C)throw Error(`Cannot animate between ${b.constructor.name} and ${e.name}, as the "to" prop suggests`);b=this._set(y)}}const S=b.constructor;let w=Gi(u),B=!1;if(!w){const e=k||!ma(this)&&p;(m||e)&&(B=Xl(Ws(_),y),w=!B),(Xl(s.immediate,C)||C)&&Xl(g.decay,h)&&Xl(g.velocity,v)||(w=!0)}if(B&&fa(this)&&(s.changed&&!k?w=!0:w||this._stop(a)),!f&&((w||Gi(a))&&(s.values=b.getPayload(),s.toValues=Gi(u)?null:S==Cs?[1]:ti(y)),s.immediate!=C&&(s.immediate=C,C||k||this._set(a)),w)){const{onRest:e}=s;Jl(Sa,(e=>wa(this,t,e)));const o=oa(this,ka(this,a));oi(this._pendingCalls,o),this._pendingCalls.add(n),s.changed&&Pl.batchedUpdates((()=>{s.changed=!k,null==e||e(o,this),k?As(i.onRest,o):null==s.onStart||s.onStart(o,this)}))}k&&this._set(_),f?n(la(t.to,t,this._state,this)):w?this._start():fa(this)&&!m?this._pendingCalls.add(n):n(na(_))}_focus(e){const t=this.animation;e!==t.to&&(Wi(this)&&this._detach(),t.to=e,Wi(this)&&this._attach())}_attach(){let e=0;const{to:t}=this.animation;Gi(t)&&(qi(t,this),ca(t)&&(e=t.priority+1)),this.priority=e}_detach(){const{to:e}=this.animation;Gi(e)&&Yi(e,this)}_set(e,t=!0){const n=Ui(e);if(!Ql.und(n)){const e=bs(this);if(!e||!Xl(n,e.getValue())){const o=xs(n);e&&e.constructor==o?e.setValue(n):ks(this,o.create(n)),e&&Pl.batchedUpdates((()=>{this._onChange(n,t)}))}}return bs(this)}_onStart(){const e=this.animation;e.changed||(e.changed=!0,Ba(this,"onStart",oa(this,ka(this,e.to)),this))}_onChange(e,t){t||(this._onStart(),As(this.animation.onChange,e,this)),As(this.defaultProps.onChange,e,this),super._onChange(e,t)}_start(){const e=this.animation;bs(this).reset(Ui(e.to)),e.immediate||(e.fromValues=e.values.map((e=>e.lastPosition))),fa(this)||(ha(this,!0),ga(this)||this._resume())}_resume(){ui.skipAnimation?this.finish():gi.start(this)}_stop(e,t){if(fa(this)){ha(this,!1);const n=this.animation;Jl(n.values,(e=>{e.done=!0})),n.toValues&&(n.onChange=n.onPause=n.onResume=void 0),$i(this,{type:"idle",parent:this});const o=t?ra(this.get()):oa(this.get(),ka(this,null!=e?e:n.to));oi(this._pendingCalls,o),n.changed&&(n.changed=!1,Ba(this,"onRest",o,this))}}}function ka(e,t){const n=Ws(t);return Xl(Ws(e.get()),n)}function _a(e,t=e.loop,n=e.to){let o=As(t);if(o){const r=!0!==o&&Us(o),l=(r||e).reverse,i=!r||r.reset;return ya(Ls({},e,{loop:t,default:!1,pause:void 0,to:!l||js(n)?n:void 0,from:i?e.from:void 0,reset:i},r))}}function ya(e){const{to:t,from:n}=e=Us(e),o=new Set;return Ql.obj(t)&&Ca(t,o),Ql.obj(n)&&Ca(n,o),e.keys=o.size?Array.from(o):null,e}function Ea(e){const t=ya(e);return Ql.und(t.default)&&(t.default=Vs(t)),t}function Ca(e,t){ei(e,((e,n)=>null!=e&&t.add(n)))}const Sa=["onStart","onRest","onChange","onPause","onResume"];function wa(e,t,n){e.animation[n]=t[n]!==Fs(t,n)?Os(t[n],e.key):void 0}function Ba(e,t,...n){var o,r,l,i;null==(o=(r=e.animation)[t])||o.call(r,...n),null==(l=(i=e.defaultProps)[t])||l.call(i,...n)}const Ia=["onStart","onChange","onRest"];let xa=1;class Ta{constructor(e,t){this.id=xa++,this.springs={},this.queue=[],this.ref=void 0,this._flush=void 0,this._initialProps=void 0,this._lastAsyncId=0,this._active=new Set,this._changed=new Set,this._started=!1,this._item=void 0,this._state={paused:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set},this._events={onStart:new Map,onChange:new Map,onRest:new Map},this._onFrame=this._onFrame.bind(this),t&&(this._flush=t),e&&this.start(Ls({default:!0},e))}get idle(){return!this._state.asyncTo&&Object.values(this.springs).every((e=>e.idle&&!e.isDelayed&&!e.isPaused))}get item(){return this._item}set item(e){this._item=e}get(){const e={};return this.each(((t,n)=>e[n]=t.get())),e}set(e){for(const t in e){const n=e[t];Ql.und(n)||this.springs[t].set(n)}}update(e){return e&&this.queue.push(ya(e)),this}start(e){let{queue:t}=this;return e?t=ti(e).map(ya):this.queue=[],this._flush?this._flush(this,t):(Da(this,t),Na(this,t))}stop(e,t){if(e!==!!e&&(t=e),t){const n=this.springs;Jl(ti(t),(t=>n[t].stop(!!e)))}else ia(this._state,this._lastAsyncId),this.each((t=>t.stop(!!e)));return this}pause(e){if(Ql.und(e))this.start({pause:!0});else{const t=this.springs;Jl(ti(e),(e=>t[e].pause()))}return this}resume(e){if(Ql.und(e))this.start({pause:!1});else{const t=this.springs;Jl(ti(e),(e=>t[e].resume()))}return this}each(e){ei(this.springs,e)}_onFrame(){const{onStart:e,onChange:t,onRest:n}=this._events,o=this._active.size>0,r=this._changed.size>0;(o&&!this._started||r&&!this._started)&&(this._started=!0,ni(e,(([e,t])=>{t.value=this.get(),e(t,this,this._item)})));const l=!o&&this._started,i=r||l&&n.size?this.get():null;r&&t.size&&ni(t,(([e,t])=>{t.value=i,e(t,this,this._item)})),l&&(this._started=!1,ni(n,(([e,t])=>{t.value=i,e(t,this,this._item)})))}eventObserved(e){if("change"==e.type)this._changed.add(e.parent),e.idle||this._active.add(e.parent);else{if("idle"!=e.type)return;this._active.delete(e.parent)}Pl.onFrame(this._onFrame)}}function Na(e,t){return Promise.all(t.map((t=>Pa(e,t)))).then((t=>ta(e,t)))}async function Pa(e,t,n){const{keys:o,to:r,from:l,loop:i,onRest:s,onResolve:a}=t,c=Ql.obj(t.default)&&t.default;i&&(t.loop=!1),!1===r&&(t.to=null),!1===l&&(t.from=null);const u=Ql.arr(r)||Ql.fun(r)?r:void 0;u?(t.to=void 0,t.onRest=void 0,c&&(c.onRest=void 0)):Jl(Ia,(n=>{const o=t[n];if(Ql.fun(o)){const r=e._events[n];t[n]=({finished:e,cancelled:t})=>{const n=r.get(o);n?(e||(n.finished=!1),t&&(n.cancelled=!0)):r.set(o,{value:null,finished:e||!1,cancelled:t||!1})},c&&(c[n]=t[n])}}));const d=e._state;t.pause===!d.paused?(d.paused=t.pause,oi(t.pause?d.pauseQueue:d.resumeQueue)):d.paused&&(t.pause=!0);const p=(o||Object.keys(e.springs)).map((n=>e.springs[n].start(t))),m=!0===t.cancel||!0===Fs(t,"cancel");(u||m&&d.asyncId)&&p.push(ea(++e._lastAsyncId,{props:t,state:d,actions:{pause:Zl,resume:Zl,start(t,n){m?(ia(d,e._lastAsyncId),n(ra(e))):(t.onRest=s,n(la(u,t,d,e)))}}})),d.paused&&await new Promise((e=>{d.resumeQueue.add(e)}));const f=ta(e,await Promise.all(p));if(i&&f.finished&&(!n||!f.noop)){const n=_a(t,i,r);if(n)return Da(e,[n]),Pa(e,n,!0)}return a&&Pl.batchedUpdates((()=>a(f,e,e.item))),f}function Ra(e,t){const n=Ls({},e.springs);return t&&Jl(ti(t),(e=>{Ql.und(e.keys)&&(e=ya(e)),Ql.obj(e.to)||(e=Ls({},e,{to:void 0})),Aa(n,e,(e=>La(e)))})),Ma(e,n),n}function Ma(e,t){ei(t,((t,n)=>{e.springs[n]||(e.springs[n]=t,qi(t,e))}))}function La(e,t){const n=new ba;return n.key=e,t&&qi(n,t),n}function Aa(e,t,n){t.keys&&Jl(t.keys,(o=>{(e[o]||(e[o]=n(o)))._prepareNode(t)}))}function Da(e,t){Jl(t,(t=>{Aa(e.springs,t,(t=>La(t,e)))}))}const Oa=["children"],Fa=e=>{let{children:t}=e,n=function(e,t){if(null==e)return{};var n,o,r={},l=Object.keys(e);for(o=0;o<l.length;o++)n=l[o],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,Oa);const o=(0,ql.useContext)(za),r=n.pause||!!o.pause,l=n.immediate||!!o.immediate;n=function(e,t){const[n]=(0,ql.useState)((()=>({inputs:t,result:e()}))),o=(0,ql.useRef)(),r=o.current;let l=r;return l?Boolean(t&&l.inputs&&function(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}(t,l.inputs))||(l={inputs:t,result:e()}):l=n,(0,ql.useEffect)((()=>{o.current=l,r==n&&(n.inputs=n.result=void 0)}),[l]),l.result}((()=>({pause:r,immediate:l})),[r,l]);const{Provider:i}=za;return ql.createElement(i,{value:n},t)},za=(Va=Fa,Ha={},Object.assign(Va,ql.createContext(Ha)),Va.Provider._context=Va,Va.Consumer._context=Va,Va);var Va,Ha;Fa.Provider=za.Provider,Fa.Consumer=za.Consumer;const Ga=()=>{const e=[],t=function(t){us(`${ss}Directly calling start instead of using the api object is deprecated in v9 (use ".start" instead), this will be removed in later 0.X.0 versions`);const o=[];return Jl(e,((e,r)=>{if(Ql.und(t))o.push(e.start());else{const l=n(t,e,r);l&&o.push(e.start(l))}})),o};t.current=e,t.add=function(t){e.includes(t)||e.push(t)},t.delete=function(t){const n=e.indexOf(t);~n&&e.splice(n,1)},t.pause=function(){return Jl(e,(e=>e.pause(...arguments))),this},t.resume=function(){return Jl(e,(e=>e.resume(...arguments))),this},t.set=function(t){Jl(e,(e=>e.set(t)))},t.start=function(t){const n=[];return Jl(e,((e,o)=>{if(Ql.und(t))n.push(e.start());else{const r=this._getProps(t,e,o);r&&n.push(e.start(r))}})),n},t.stop=function(){return Jl(e,(e=>e.stop(...arguments))),this},t.update=function(t){return Jl(e,((e,n)=>e.update(this._getProps(t,e,n)))),this};const n=function(e,t,n){return Ql.fun(e)?e(n,t):e};return t._getProps=n,t};function Ua(e,t,n){const o=Ql.fun(t)&&t;o&&!n&&(n=[]);const r=(0,ql.useMemo)((()=>o||3==arguments.length?Ga():void 0),[]),l=(0,ql.useRef)(0),i=ms(),s=(0,ql.useMemo)((()=>({ctrls:[],queue:[],flush(e,t){const n=Ra(e,t);return l.current>0&&!s.queue.length&&!Object.keys(n).some((t=>!e.springs[t]))?Na(e,t):new Promise((o=>{Ma(e,n),s.queue.push((()=>{o(Na(e,t))})),i()}))}})),[]),a=(0,ql.useRef)([...s.ctrls]),c=[],u=hs(e)||0;function d(e,n){for(let r=e;r<n;r++){const e=a.current[r]||(a.current[r]=new Ta(null,s.flush)),n=o?o(r,e):t[r];n&&(c[r]=Ea(n))}}(0,ql.useMemo)((()=>{Jl(a.current.slice(e,u),(e=>{Ks(e,r),e.stop(!0)})),a.current.length=e,d(u,e)}),[e]),(0,ql.useMemo)((()=>{d(0,Math.min(u,e))}),n);const p=a.current.map(((e,t)=>Ra(e,c[t]))),m=(0,ql.useContext)(Fa),f=hs(m),g=m!==f&&$s(m);ps((()=>{l.current++,s.ctrls=a.current;const{queue:e}=s;e.length&&(s.queue=[],Jl(e,(e=>e()))),Jl(a.current,((e,t)=>{null==r||r.add(e),g&&e.start({default:m});const n=c[t];n&&(qs(e,n.ref),e.ref?e.queue.push(n):e.start(n))}))})),fs((()=>()=>{Jl(s.ctrls,(e=>e.stop(!0)))}));const h=p.map((e=>Ls({},e)));return r?[h,r]:h}let Wa;!function(e){e.MOUNT="mount",e.ENTER="enter",e.UPDATE="update",e.LEAVE="leave"}(Wa||(Wa={}));class $a extends da{constructor(e,t){super(),this.key=void 0,this.idle=!0,this.calc=void 0,this._active=new Set,this.source=e,this.calc=Fi(...t);const n=this._get(),o=xs(n);ks(this,o.create(n))}advance(e){const t=this._get();Xl(t,this.get())||(bs(this).setValue(t),this._onChange(t,this.idle)),!this.idle&&Ka(this._active)&&qa(this)}_get(){const e=Ql.arr(this.source)?this.source.map(Ui):ti(Ui(this.source));return this.calc(...e)}_start(){this.idle&&!Ka(this._active)&&(this.idle=!1,Jl(_s(this),(e=>{e.done=!1})),ui.skipAnimation?(Pl.batchedUpdates((()=>this.advance())),qa(this)):gi.start(this))}_attach(){let e=1;Jl(ti(this.source),(t=>{Gi(t)&&qi(t,this),ca(t)&&(t.idle||this._active.add(t),e=Math.max(e,t.priority+1))})),this.priority=e,this._start()}_detach(){Jl(ti(this.source),(e=>{Gi(e)&&Yi(e,this)})),this._active.clear(),qa(this)}eventObserved(e){"change"==e.type?e.idle?this.advance():(this._active.add(e.parent),this._start()):"idle"==e.type?this._active.delete(e.parent):"priority"==e.type&&(this.priority=ti(this.source).reduce(((e,t)=>Math.max(e,(ca(t)?t.priority:0)+1)),0))}}function ja(e){return!1!==e.idle}function Ka(e){return!e.size||Array.from(e).every(ja)}function qa(e){e.idle||(e.idle=!0,Jl(_s(e),(e=>{e.done=!0})),$i(e,{type:"idle",parent:e}))}ui.assign({createStringInterpolator:is,to:(e,t)=>new $a(e,t)}),gi.advance;var Ya=window.ReactDOM;function Za(e,t){if(null==e)return{};var n,o,r={},l=Object.keys(e);for(o=0;o<l.length;o++)n=l[o],t.indexOf(n)>=0||(r[n]=e[n]);return r}const Qa=["style","children","scrollTop","scrollLeft"],Xa=/^--/;function Ja(e,t){return null==t||"boolean"==typeof t||""===t?"":"number"!=typeof t||0===t||Xa.test(e)||tc.hasOwnProperty(e)&&tc[e]?(""+t).trim():t+"px"}const ec={};let tc={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0};const nc=["Webkit","Ms","Moz","O"];tc=Object.keys(tc).reduce(((e,t)=>(nc.forEach((n=>e[((e,t)=>e+t.charAt(0).toUpperCase()+t.substring(1))(n,t)]=e[t])),e)),tc);const oc=["x","y","z"],rc=/^(matrix|translate|scale|rotate|skew)/,lc=/^(translate)/,ic=/^(rotate|skew)/,sc=(e,t)=>Ql.num(e)&&0!==e?e+t:e,ac=(e,t)=>Ql.arr(e)?e.every((e=>ac(e,t))):Ql.num(e)?e===t:parseFloat(e)===t;class cc extends ws{constructor(e){let{x:t,y:n,z:o}=e,r=Za(e,oc);const l=[],i=[];(t||n||o)&&(l.push([t||0,n||0,o||0]),i.push((e=>[`translate3d(${e.map((e=>sc(e,"px"))).join(",")})`,ac(e,0)]))),ei(r,((e,t)=>{if("transform"===t)l.push([e||""]),i.push((e=>[e,""===e]));else if(rc.test(t)){if(delete r[t],Ql.und(e))return;const n=lc.test(t)?"px":ic.test(t)?"deg":"";l.push(ti(e)),i.push("rotate3d"===t?([e,t,o,r])=>[`rotate3d(${e},${t},${o},${sc(r,n)})`,ac(r,0)]:e=>[`${t}(${e.map((e=>sc(e,n))).join(",")})`,ac(e,t.startsWith("scale")?1:0)])}})),l.length&&(r.transform=new uc(l,i)),super(r)}}class uc extends ji{constructor(e,t){super(),this._value=null,this.inputs=e,this.transforms=t}get(){return this._value||(this._value=this._get())}_get(){let e="",t=!0;return Jl(this.inputs,((n,o)=>{const r=Ui(n[0]),[l,i]=this.transforms[o](Ql.arr(r)?r:n.map(Ui));e+=" "+l,t=t&&i})),t?"none":e}observerAdded(e){1==e&&Jl(this.inputs,(e=>Jl(e,(e=>Gi(e)&&qi(e,this)))))}observerRemoved(e){0==e&&Jl(this.inputs,(e=>Jl(e,(e=>Gi(e)&&Yi(e,this)))))}eventObserved(e){"change"==e.type&&(this._value=null),$i(this,e)}}const dc=["scrollTop","scrollLeft"];ui.assign({batchedUpdates:Ya.unstable_batchedUpdates,createStringInterpolator:is,colors:{transparent:0,aliceblue:4042850303,antiquewhite:4209760255,aqua:16777215,aquamarine:2147472639,azure:4043309055,beige:4126530815,bisque:4293182719,black:255,blanchedalmond:4293643775,blue:65535,blueviolet:2318131967,brown:2771004159,burlywood:3736635391,burntsienna:3934150143,cadetblue:1604231423,chartreuse:2147418367,chocolate:3530104575,coral:4286533887,cornflowerblue:1687547391,cornsilk:4294499583,crimson:3692313855,cyan:16777215,darkblue:35839,darkcyan:9145343,darkgoldenrod:3095792639,darkgray:2846468607,darkgreen:6553855,darkgrey:2846468607,darkkhaki:3182914559,darkmagenta:2332068863,darkolivegreen:1433087999,darkorange:4287365375,darkorchid:2570243327,darkred:2332033279,darksalmon:3918953215,darkseagreen:2411499519,darkslateblue:1211993087,darkslategray:793726975,darkslategrey:793726975,darkturquoise:13554175,darkviolet:2483082239,deeppink:4279538687,deepskyblue:12582911,dimgray:1768516095,dimgrey:1768516095,dodgerblue:512819199,firebrick:2988581631,floralwhite:4294635775,forestgreen:579543807,fuchsia:4278255615,gainsboro:3705462015,ghostwhite:4177068031,gold:4292280575,goldenrod:3668254975,gray:2155905279,green:8388863,greenyellow:2919182335,grey:2155905279,honeydew:4043305215,hotpink:4285117695,indianred:3445382399,indigo:1258324735,ivory:4294963455,khaki:4041641215,lavender:3873897215,lavenderblush:4293981695,lawngreen:2096890111,lemonchiffon:4294626815,lightblue:2916673279,lightcoral:4034953471,lightcyan:3774873599,lightgoldenrodyellow:4210742015,lightgray:3553874943,lightgreen:2431553791,lightgrey:3553874943,lightpink:4290167295,lightsalmon:4288707327,lightseagreen:548580095,lightskyblue:2278488831,lightslategray:2005441023,lightslategrey:2005441023,lightsteelblue:2965692159,lightyellow:4294959359,lime:16711935,limegreen:852308735,linen:4210091775,magenta:4278255615,maroon:2147483903,mediumaquamarine:1724754687,mediumblue:52735,mediumorchid:3126187007,mediumpurple:2473647103,mediumseagreen:1018393087,mediumslateblue:2070474495,mediumspringgreen:16423679,mediumturquoise:1221709055,mediumvioletred:3340076543,midnightblue:421097727,mintcream:4127193855,mistyrose:4293190143,moccasin:4293178879,navajowhite:4292783615,navy:33023,oldlace:4260751103,olive:2155872511,olivedrab:1804477439,orange:4289003775,orangered:4282712319,orchid:3664828159,palegoldenrod:4008225535,palegreen:2566625535,paleturquoise:2951671551,palevioletred:3681588223,papayawhip:4293907967,peachpuff:4292524543,peru:3448061951,pink:4290825215,plum:3718307327,powderblue:2967529215,purple:2147516671,rebeccapurple:1714657791,red:4278190335,rosybrown:3163525119,royalblue:1097458175,saddlebrown:2336560127,salmon:4202722047,sandybrown:4104413439,seagreen:780883967,seashell:4294307583,sienna:2689740287,silver:3233857791,skyblue:2278484991,slateblue:1784335871,slategray:1887473919,slategrey:1887473919,snow:4294638335,springgreen:16744447,steelblue:1182971135,tan:3535047935,teal:8421631,thistle:3636451583,tomato:4284696575,turquoise:1088475391,violet:4001558271,wheat:4125012991,white:4294967295,whitesmoke:4126537215,yellow:4294902015,yellowgreen:2597139199}});const pc=((e,{applyAnimatedValues:t=(()=>!1),createAnimatedStyle:n=(e=>new ws(e)),getComponentProps:o=(e=>e)}={})=>{const r={applyAnimatedValues:t,createAnimatedStyle:n,getComponentProps:o},l=e=>{const t=Ms(e)||"Anonymous";return(e=Ql.str(e)?l[e]||(l[e]=Ns(e,r)):e[Rs]||(e[Rs]=Ns(e,r))).displayName=`Animated(${t})`,e};return ei(e,((t,n)=>{Ql.arr(e)&&(n=Ms(t)),l[n]=l(t)})),{animated:l}})(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"],{applyAnimatedValues:function(e,t){if(!e.nodeType||!e.setAttribute)return!1;const n="filter"===e.nodeName||e.parentNode&&"filter"===e.parentNode.nodeName,o=t,{style:r,children:l,scrollTop:i,scrollLeft:s}=o,a=Za(o,Qa),c=Object.values(a),u=Object.keys(a).map((t=>n||e.hasAttribute(t)?t:ec[t]||(ec[t]=t.replace(/([A-Z])/g,(e=>"-"+e.toLowerCase())))));void 0!==l&&(e.textContent=l);for(let t in r)if(r.hasOwnProperty(t)){const n=Ja(t,r[t]);Xa.test(t)?e.style.setProperty(t,n):e.style[t]=n}u.forEach(((t,n)=>{e.setAttribute(t,c[n])})),void 0!==i&&(e.scrollTop=i),void 0!==s&&(e.scrollLeft=s)},createAnimatedStyle:e=>new cc(e),getComponentProps:e=>Za(e,dc)}).animated,mc=e=>e+1,fc=e=>({top:e.offsetTop,left:e.offsetLeft});var gc=function(e){let{isSelected:t,adjustScrolling:n,enableAnimation:o,triggerAnimationOnChange:r}=e;const l=(0,s.useRef)(),i=(0,d.useReducedMotion)()||!o,[a,c]=(0,s.useReducer)(mc,0),[u,p]=(0,s.useReducer)(mc,0),[m,f]=(0,s.useState)({x:0,y:0}),g=(0,s.useMemo)((()=>l.current?fc(l.current):null),[r]),h=(0,s.useMemo)((()=>{if(!n||!l.current)return()=>{};const e=(0,ul.getScrollContainer)(l.current);if(!e)return()=>{};const t=l.current.getBoundingClientRect();return()=>{const n=l.current.getBoundingClientRect().top-t.top;n&&(e.scrollTop+=n)}}),[r,n]);function v(e){let{value:n}=e,{x:o,y:r}=n;o=Math.round(o),r=Math.round(r),o===v.x&&r===v.y||(function(e){let{x:n,y:o}=e;if(!l.current)return;const r=0===n&&0===o;l.current.style.transformOrigin=r?"":"center",l.current.style.transform=r?"":`translate3d(${n}px,${o}px,0)`,l.current.style.zIndex=!t||r?"":"1",h()}({x:o,y:r}),v.x=o,v.y=r)}return(0,s.useLayoutEffect)((()=>{a&&p()}),[a]),(0,s.useLayoutEffect)((()=>{if(!g)return;if(i)return void h();l.current.style.transform="";const e=fc(l.current);c(),f({x:Math.round(g.left-e.left),y:Math.round(g.top-e.top)})}),[r]),v.x=0,v.y=0,function(e,t){const n=Ql.fun(e),[[o],r]=Ua(1,n?e:[e],n?t||[]:t)}({from:{x:m.x,y:m.y},to:{x:0,y:0},reset:a!==u,config:{mass:5,tension:2e3,friction:200},immediate:i,onChange:v}),l};const hc=".block-editor-block-list__block",vc=".block-list-appender",bc=".block-editor-button-block-appender";function kc(e,t){return t.closest([hc,vc,bc].join(","))===e}function _c(e){for(;e&&e.nodeType!==e.ELEMENT_NODE;)e=e.parentNode;if(!e)return;const t=e.closest(hc);return t?t.id.slice("block-".length):void 0}function yc(e){const t=(0,s.useRef)(),n=function(e){return(0,m.useSelect)((t=>{const{getSelectedBlocksInitialCaretPosition:n,isNavigationMode:o,isBlockSelected:r}=t(Qn);if(r(e)&&!o())return n()}),[e])}(e),{isBlockSelected:o,isMultiSelecting:r}=(0,m.useSelect)(Qn);return(0,s.useEffect)((()=>{if(!o(e)||r())return;if(null==n)return;if(!t.current)return;const{ownerDocument:l}=t.current;if(t.current.contains(l.activeElement))return;const i=ul.focus.tabbable.find(t.current).filter((e=>(0,ul.isTextField)(e))),s=-1===n,a=(s?u.last:u.first)(i)||t.current;if(kc(t.current,a)){if(!t.current.getAttribute("contenteditable")){const e=ul.focus.tabbable.findNext(t.current);if(e&&kc(t.current,e)&&(0,ul.isFormElement)(e))return void e.focus()}(0,ul.placeCaretAtHorizontalEdge)(a,s)}else t.current.focus()}),[n,e]),t}function Ec(e){if(e.defaultPrevented)return;const t="mouseover"===e.type?"add":"remove";e.preventDefault(),e.currentTarget.classList[t]("is-hovered")}function Cc(){const e=(0,m.useSelect)((e=>{const{isNavigationMode:t,getSettings:n}=e(Qn);return t()||n().outlineMode}),[]);return(0,d.useRefEffect)((t=>{if(e)return t.addEventListener("mouseout",Ec),t.addEventListener("mouseover",Ec),()=>{t.removeEventListener("mouseout",Ec),t.removeEventListener("mouseover",Ec),t.classList.remove("is-hovered")}}),[e])}function Sc(e){return(0,m.useSelect)((t=>{const{isBlockBeingDragged:n,isBlockHighlighted:o,isBlockSelected:l,isBlockMultiSelected:i,getBlockName:s,getSettings:a,hasSelectedInnerBlock:u,isTyping:d}=t(Qn),{outlineMode:p}=a(),m=n(e),f=l(e),g=s(e),h=u(e,!0);return c()({"is-selected":f,"is-highlighted":o(e),"is-multi-selected":i(e),"is-reusable":(0,r.isReusableBlock)((0,r.getBlockType)(g)),"is-dragging":m,"has-child-selected":h,"remove-outline":f&&p&&d()})}),[e])}function wc(e){return(0,m.useSelect)((t=>{const n=t(Qn).getBlockName(e),o=(0,r.getBlockType)(n);if((null==o?void 0:o.apiVersion)>1)return(0,r.getBlockDefaultClassName)(n)}),[e])}function Bc(e){return(0,m.useSelect)((t=>{const{getBlockName:n,getBlockAttributes:o}=t(Qn),l=o(e);if(null==l||!l.className)return;const i=(0,r.getBlockType)(n(e));return(null==i?void 0:i.apiVersion)>1?l.className:void 0}),[e])}function Ic(e){return(0,m.useSelect)((t=>{const{hasBlockMovingClientId:n,canInsertBlockType:o,getBlockName:r,getBlockRootClientId:l,isBlockSelected:i}=t(Qn);if(!i(e))return;const s=n();return s?c()("is-block-moving-mode",{"can-insert-moving-block":o(r(s),l(e))}):void 0}),[e])}function xc(e){const{isBlockSelected:t}=(0,m.useSelect)(Qn),{selectBlock:n,selectionChange:o}=(0,m.useDispatch)(Qn);return(0,d.useRefEffect)((r=>{function l(l){r.parentElement.closest('[contenteditable="true"]')||(t(e)?l.target.isContentEditable||o(e):kc(r,l.target)&&n(e))}return r.addEventListener("focusin",l),()=>{r.removeEventListener("focusin",l)}}),[t,n])}var Tc=window.wp.keycodes;function Nc(e){const t=(0,m.useSelect)((t=>t(Qn).isBlockSelected(e)),[e]),{getBlockRootClientId:n,getBlockIndex:o}=(0,m.useSelect)(Qn),{insertDefaultBlock:r,removeBlock:l}=(0,m.useDispatch)(Qn);return(0,d.useRefEffect)((i=>{if(t)return i.addEventListener("keydown",s),i.addEventListener("dragstart",a),()=>{i.removeEventListener("keydown",s),i.removeEventListener("dragstart",a)};function s(t){const{keyCode:s,target:a}=t;s!==Tc.ENTER&&s!==Tc.BACKSPACE&&s!==Tc.DELETE||a!==i||(0,ul.isTextField)(a)||(t.preventDefault(),s===Tc.ENTER?r({},n(e),o(e)+1):l(e))}function a(e){e.preventDefault()}}),[e,t,n,o,r,l])}function Pc(e){const{isNavigationMode:t,isBlockSelected:n}=(0,m.useSelect)(Qn),{setNavigationMode:o,selectBlock:r}=(0,m.useDispatch)(Qn);return(0,d.useRefEffect)((l=>{function i(l){t()&&!l.defaultPrevented&&(l.preventDefault(),n(e)?o(!1):r(e))}return l.addEventListener("mousedown",i),()=>{l.addEventListener("mousedown",i)}}),[e,t,n,o])}function Rc(){const e=(0,s.useContext)(Af);return(0,d.useRefEffect)((t=>{if(e)return e.observe(t),()=>{e.unobserve(t)}}),[e])}function Mc(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{__unstableIsHtml:t,__unstableIsDisabled:n=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{clientId:o,className:l,wrapperProps:i={},isAligned:a}=(0,s.useContext)(Lc),{index:u,mode:p,name:f,blockApiVersion:h,blockTitle:v,isPartOfSelection:b,adjustScrolling:k,enableAnimation:_}=(0,m.useSelect)((e=>{const{getBlockIndex:t,getBlockMode:n,getBlockName:l,isTyping:i,getGlobalBlockCount:s,isBlockSelected:a,isBlockMultiSelected:c,isAncestorMultiSelected:u,isFirstMultiSelectedBlock:d}=e(Qn),p=a(o),m=c(o)||u(o),f=l(o),g=(0,r.getBlockType)(f);return{index:t(o),mode:n(o),name:f,blockApiVersion:(null==g?void 0:g.apiVersion)||1,blockTitle:null==g?void 0:g.title,isPartOfSelection:p||m,adjustScrolling:p||d(o),enableAnimation:!i()&&s()<=200}}),[o]),y=(0,g.sprintf)((0,g.__)("Block: %s"),v),E="html"!==p||t?"":"-visual",C=(0,d.useMergeRefs)([e.ref,yc(o),bo(o),xc(o),Nc(o),Pc(o),Cc(),Rc(),gc({isSelected:b,adjustScrolling:k,enableAnimation:_,triggerAnimationOnChange:u}),(0,d.useDisabled)({isDisabled:!n})]),S=to();return h<2&&o===S.clientId&&"undefined"!=typeof process&&process.env,{...i,...e,ref:C,id:`block-${o}${E}`,tabIndex:0,role:"document","aria-label":y,"data-block":o,"data-type":f,"data-title":v,className:c()(c()("block-editor-block-list__block",{"wp-block":!a}),l,e.className,i.className,Sc(o),wc(o),Bc(o),Ic(o)),style:{...i.style,...e.style}}}Mc.save=r.__unstableGetBlockProps;const Lc=(0,s.createContext)();function Ac(e){let{children:t,isHtml:n,...o}=e;return(0,s.createElement)("div",Mc(o,{__unstableIsHtml:n}),t)}const Dc=(0,m.withSelect)(((e,t)=>{let{clientId:n,rootClientId:o}=t;const{isBlockSelected:r,getBlockMode:l,isSelectionEnabled:i,getTemplateLock:s,__unstableGetBlockWithoutInnerBlocks:a,canRemoveBlock:c,canMoveBlock:u}=e(Qn),d=a(n),p=r(n),m=s(o),f=c(n,o),g=u(n,o),{name:h,attributes:v,isValid:b}=d||{};return{mode:l(n),isSelectionEnabled:i(),isLocked:!!m,canRemove:f,canMove:g,block:d,name:h,attributes:v,isValid:b,isSelected:p}})),Oc=(0,m.withDispatch)(((e,t,n)=>{let{select:o}=n;const{updateBlockAttributes:l,insertBlocks:i,mergeBlocks:s,replaceBlocks:a,toggleSelection:c,__unstableMarkLastChangeAsPersistent:u}=e(Qn);return{setAttributes(e){const{getMultiSelectedBlockClientIds:n}=o(Qn),r=n(),{clientId:i}=t,s=r.length?r:[i];l(s,e)},onInsertBlocks(e,n){const{rootClientId:o}=t;i(e,n,o)},onInsertBlocksAfter(e){const{clientId:n,rootClientId:r}=t,{getBlockIndex:l}=o(Qn),s=l(n);i(e,s+1,r)},onMerge(e){const{clientId:n}=t,{getPreviousBlockClientId:r,getNextBlockClientId:l}=o(Qn);if(e){const e=l(n);e&&s(n,e)}else{const e=r(n);e&&s(e,n)}},onReplace(e,n,o){e.length&&!(0,r.isUnmodifiedDefaultBlock)(e[e.length-1])&&u(),a([t.clientId],e,n,o)},toggleSelection(e){c(e)}}}));var Fc=(0,d.compose)(d.pure,Dc,Oc,(0,d.ifCondition)((e=>{let{block:t}=e;return!!t})),(0,p.withFilters)("editor.BlockListBlock"))((function(e){var t;let{block:{__unstableBlockSource:n},mode:o,isLocked:l,canRemove:i,clientId:a,isSelected:d,isSelectionEnabled:p,className:f,name:g,isValid:h,attributes:v,wrapperProps:b,setAttributes:k,onReplace:_,onInsertBlocksAfter:y,onMerge:E,toggleSelection:C}=e;const S=(0,m.useSelect)((e=>{const{getSettings:t}=e(Qn);return t().supportsLayout}),[]),{removeBlock:w}=(0,m.useDispatch)(Qn),B=(0,s.useCallback)((()=>w(a)),[a]);let I=(0,s.createElement)(hl,{name:g,isSelected:d,attributes:v,setAttributes:k,insertBlocksAfter:l?void 0:y,onReplace:i?_:void 0,onRemove:i?B:void 0,mergeBlocks:i?E:void 0,clientId:a,isSelectionEnabled:p,toggleSelection:C});const x=(0,r.getBlockType)(g);null!=x&&x.getEditWrapperProps&&(b=function(e,t){const n={...e,...t};return e&&t&&e.className&&t.className&&(n.className=c()(e.className,t.className)),e&&t&&e.style&&t.style&&(n.style={...e.style,...t.style}),n}(b,x.getEditWrapperProps(v)));const T=b&&!!b["data-align"]&&!S;let N;if(T&&(I=(0,s.createElement)("div",{className:"wp-block","data-align":b["data-align"]},I)),h)N="html"===o?(0,s.createElement)(s.Fragment,null,(0,s.createElement)("div",{style:{display:"none"}},I),(0,s.createElement)(Ac,{isHtml:!0},(0,s.createElement)(Tl,{clientId:a}))):(null==x?void 0:x.apiVersion)>1?I:(0,s.createElement)(Ac,b,I);else{const e=n?(0,r.serializeRawBlock)(n):(0,r.getSaveContent)(x,v);N=(0,s.createElement)(Ac,{className:"has-warning"},(0,s.createElement)(Cl,{clientId:a}),(0,s.createElement)(s.RawHTML,null,(0,ul.safeHTML)(e)))}const P={clientId:a,className:null!==(t=b)&&void 0!==t&&t["data-align"]&&S?c()(f,`align${b["data-align"]}`):f,wrapperProps:(0,u.omit)(b,["data-align"]),isAligned:T},R=(0,s.useMemo)((()=>P),Object.values(P));return(0,s.createElement)(Lc.Provider,{value:R},(0,s.createElement)(Il,{fallback:(0,s.createElement)(Ac,{className:"has-warning"},(0,s.createElement)(wl,null))},N))})),zc=window.wp.htmlEntities,Vc=(0,s.createElement)(A.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(A.Path,{d:"M18 11.2h-5.2V6h-1.6v5.2H6v1.6h5.2V18h1.6v-5.2H18z"}));const Hc=[(0,s.createInterpolateElement)((0,g.__)("While writing, you can press <kbd>/</kbd> to quickly insert new blocks."),{kbd:(0,s.createElement)("kbd",null)}),(0,s.createInterpolateElement)((0,g.__)("Indent a list by pressing <kbd>space</kbd> at the beginning of a line."),{kbd:(0,s.createElement)("kbd",null)}),(0,s.createInterpolateElement)((0,g.__)("Outdent a list by pressing <kbd>backspace</kbd> at the beginning of a line."),{kbd:(0,s.createElement)("kbd",null)}),(0,g.__)("Drag files into the editor to automatically insert media blocks."),(0,g.__)("Change a block's type by pressing the block icon on the toolbar.")];var Gc=function(){const[e]=(0,s.useState)(Math.floor(Math.random()*Hc.length));return(0,s.createElement)(p.Tip,null,Hc[e])},Uc=(0,s.createElement)(A.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(A.Path,{d:"M19 8h-1V6h-5v2h-2V6H6v2H5c-1.1 0-2 .9-2 2v8c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-8c0-1.1-.9-2-2-2zm.5 10c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5v-8c0-.3.2-.5.5-.5h14c.3 0 .5.2.5.5v8z"})),Wc=(0,s.memo)((function(e){var t;let{icon:n,showColors:o=!1,className:r}=e;"block-default"===(null===(t=n)||void 0===t?void 0:t.src)&&(n={src:Uc});const l=(0,s.createElement)(p.Icon,{icon:n&&n.src?n.src:n}),i=o?{backgroundColor:n&&n.background,color:n&&n.foreground}:{};return(0,s.createElement)("span",{style:i,className:c()("block-editor-block-icon",r,{"has-colors":o})},l)})),$c=function(e){let{title:t,icon:n,description:o,blockType:r}=e;return r&&(z()("`blockType` property in `BlockCard component`",{since:"5.7",alternative:"`title, icon and description` properties"}),({title:t,icon:n,description:o}=r)),(0,s.createElement)("div",{className:"block-editor-block-card"},(0,s.createElement)(Wc,{icon:n,showColors:!0}),(0,s.createElement)("div",{className:"block-editor-block-card__content"},(0,s.createElement)("h2",{className:"block-editor-block-card__title"},t),(0,s.createElement)("span",{className:"block-editor-block-card__description"},o)))};function jc(e){let{clientId:t=null,value:n,selection:o,onChange:l=u.noop,onInput:i=u.noop}=e;const a=(0,m.useRegistry)(),{resetBlocks:c,resetSelection:d,replaceInnerBlocks:p,setHasControlledInnerBlocks:f,__unstableMarkNextChangeAsNotPersistent:g}=a.dispatch(Qn),{getBlockName:h,getBlocks:v}=a.select(Qn),b=(0,m.useSelect)((e=>!t||e(Qn).areInnerBlocksControlled(t)),[t]),k=(0,s.useRef)({incoming:null,outgoing:[]}),_=(0,s.useRef)(!1),y=()=>{n&&(g(),t?a.batch((()=>{f(t,!0);const e=n.map((e=>(0,r.cloneBlock)(e)));_.current&&(k.current.incoming=e),g(),p(t,e)})):(_.current&&(k.current.incoming=n),c(n)))},E=(0,s.useRef)(i),C=(0,s.useRef)(l);(0,s.useEffect)((()=>{E.current=i,C.current=l}),[i,l]),(0,s.useEffect)((()=>{k.current.outgoing.includes(n)?(0,u.last)(k.current.outgoing)===n&&(k.current.outgoing=[]):v(t)!==n&&(k.current.outgoing=[],y(),o&&d(o.selectionStart,o.selectionEnd,o.initialPosition))}),[n,t]),(0,s.useEffect)((()=>{b||(k.current.outgoing=[],y())}),[b]),(0,s.useEffect)((()=>{const{getSelectionStart:e,getSelectionEnd:n,getSelectedBlocksInitialCaretPosition:o,isLastBlockChangePersistent:r,__unstableIsLastBlockChangeIgnored:l,areInnerBlocksControlled:i}=a.select(Qn);let s=v(t),c=r(),u=!1;_.current=!0;const d=a.subscribe((()=>{if(null!==t&&null===h(t))return;if(t&&!i(t))return;const a=r(),d=v(t),p=d!==s;if(s=d,p&&(k.current.incoming||l()))return k.current.incoming=null,void(c=a);(p||u&&!p&&a&&!c)&&(c=a,k.current.outgoing.push(s),(c?C.current:E.current)(s,{selection:{selectionStart:e(),selectionEnd:n(),initialPosition:o()}})),u=p}));return()=>d()}),[a,t])}var Kc=(0,d.createHigherOrderComponent)((e=>(0,m.withRegistry)((t=>{let{useSubRegistry:n=!0,registry:o,...r}=t;if(!n)return(0,s.createElement)(e,i({registry:o},r));const[l,a]=(0,s.useState)(null);return(0,s.useEffect)((()=>{const e=(0,m.createRegistry)({},o);e.registerStore(Yn,Zn),a(e)}),[o]),l?(0,s.createElement)(m.RegistryProvider,{value:l},(0,s.createElement)(e,i({registry:l},r))):null}))),"withRegistryProvider")((function(e){const{children:t,settings:n}=e,{updateSettings:o}=(0,m.useDispatch)(Qn);return(0,s.useEffect)((()=>{o(n)}),[n]),jc(e),(0,s.createElement)(vo,null,t)}));function qc(e){let{onClick:t}=e;return(0,s.createElement)("div",{tabIndex:0,role:"button",onClick:t,onKeyPress:t},(0,s.createElement)(p.Disabled,null,(0,s.createElement)(Of,null)))}function Yc(){const{hasSelectedBlock:e,hasMultiSelection:t}=(0,m.useSelect)(Qn),{clearSelectedBlock:n}=(0,m.useDispatch)(Qn);return(0,d.useRefEffect)((o=>{function r(r){(e()||t())&&r.target===o&&n()}return o.addEventListener("mousedown",r),()=>{o.removeEventListener("mousedown",r)}}),[e,t,n])}function Zc(e){return(0,s.createElement)("div",i({ref:Yc()},e))}function Qc(e){const{isMultiSelecting:t,getMultiSelectedBlockClientIds:n,hasMultiSelection:o,getSelectedBlockClientId:r,getSelectedBlocksInitialCaretPosition:l,__unstableIsFullySelected:i}=e(Qn);return{isMultiSelecting:t(),multiSelectedBlockClientIds:n(),hasMultiSelection:o(),selectedBlockClientId:r(),initialPosition:l(),isFullSelection:i()}}function Xc(){const{initialPosition:e,isMultiSelecting:t,multiSelectedBlockClientIds:n,hasMultiSelection:o,selectedBlockClientId:r,isFullSelection:l}=(0,m.useSelect)(Qc,[]),i=ko(r),s=ko((0,u.first)(n)),a=ko((0,u.last)(n));return(0,d.useRefEffect)((c=>{const{ownerDocument:u}=c,{defaultView:d}=u;if(null==e)return;if(!o||t){if(!r||t)return;const e=d.getSelection();if(e.rangeCount&&!e.isCollapsed){const t=i.current,{startContainer:n,endContainer:o}=e.getRangeAt(0);!t||t.contains(n)&&t.contains(o)||e.removeAllRanges()}return}const{length:p}=n;if(p<2)return;if(!l)return;if(c.contentEditable=!0,c.focus(),!s.current||!a.current)return;const m=d.getSelection(),f=u.createRange();f.setStartBefore(s.current),f.setEndAfter(a.current),m.removeAllRanges(),m.addRange(f)}),[o,t,n,r,e,l])}function Jc(e,t,n,o){let r,l=ul.focus.focusable.find(n);return t&&(l=(0,u.reverse)(l)),l=l.slice(l.indexOf(e)+1),o&&(r=e.getBoundingClientRect()),(0,u.find)(l,(function(e){if(!ul.focus.tabbable.isTabbableIndex(e))return!1;if(e.isContentEditable&&"true"!==e.contentEditable)return!1;if(o){const t=e.getBoundingClientRect();if(t.left>=r.right||t.right<=r.left)return!1}return!0}))}function eu(){const{getSelectedBlockClientId:e,getMultiSelectedBlocksEndClientId:t,getPreviousBlockClientId:n,getNextBlockClientId:o,getSettings:r,hasMultiSelection:l}=(0,m.useSelect)(Qn);return(0,d.useRefEffect)((i=>{let s;function a(){s=null}function c(a){const{keyCode:c,target:u}=a,d=c===Tc.UP,p=c===Tc.DOWN,m=c===Tc.LEFT,f=c===Tc.RIGHT,g=d||m,h=m||f,v=d||p,b=h||v,k=a.shiftKey,_=k||a.ctrlKey||a.altKey||a.metaKey,y=v?ul.isVerticalEdge:ul.isHorizontalEdge,{ownerDocument:E}=i,{defaultView:C}=E;if(l())return;if(v?s||(s=(0,ul.computeCaretRect)(C)):s=null,a.defaultPrevented)return;if(!b)return;if(!function(e,t,n){if((t===Tc.UP||t===Tc.DOWN)&&!n)return!0;const{tagName:o}=e;return"INPUT"!==o&&"TEXTAREA"!==o}(u,c,_))return;const S=(0,ul.isRTL)(u)?!g:g,{keepCaretInsideBlock:w}=r(),B=e();if(k){const e=t(),r=n(e||B),l=o(e||B);(g&&r||!g&&l)&&function(e,t){const n=Jc(e,t,i);return!n||!function(e,t){return e.closest(hc)===t.closest(hc)}(e,n)}(u,g)&&y(u,g)&&(i.contentEditable=!0,i.focus())}else if(v&&(0,ul.isVerticalEdge)(u,g)&&!w){const e=Jc(u,g,i,!0);e&&((0,ul.placeCaretAtVerticalEdge)(e,g,s),a.preventDefault())}else if(h&&C.getSelection().isCollapsed&&(0,ul.isHorizontalEdge)(u,S)&&!w){const e=Jc(u,S,i);(0,ul.placeCaretAtHorizontalEdge)(e,g),a.preventDefault()}}return i.addEventListener("mousedown",a),i.addEventListener("keydown",c),()=>{i.removeEventListener("mousedown",a),i.removeEventListener("keydown",c)}}),[])}var tu=window.wp.keyboardShortcuts;function nu(){const{getBlockOrder:e,getSelectedBlockClientIds:t,getBlockRootClientId:n}=(0,m.useSelect)(Qn),{multiSelect:o}=(0,m.useDispatch)(Qn),r=(0,tu.__unstableUseShortcutEventMatch)();return(0,d.useRefEffect)((l=>{function i(l){if(!r("core/block-editor/select-all",l))return;const i=t();if(i.length<2&&!(0,ul.isEntirelySelected)(l.target))return;const[s]=i,a=n(s);let c=e(a);i.length===c.length&&(c=e(n(a)));const d=(0,u.first)(c),p=(0,u.last)(c);d!==p&&(o(d,p),l.preventDefault())}return l.addEventListener("keydown",i),()=>{l.removeEventListener("keydown",i)}}),[])}function ou(e,t){e.contentEditable=t,t&&e.focus()}function ru(){const{startMultiSelect:e,stopMultiSelect:t}=(0,m.useDispatch)(Qn),{isSelectionEnabled:n,hasMultiSelection:o}=(0,m.useSelect)(Qn);return(0,d.useRefEffect)((r=>{const{ownerDocument:l}=r,{defaultView:i}=l;let s,a;function c(){t(),i.removeEventListener("mouseup",c),a=i.requestAnimationFrame((()=>{if(o())return;ou(r,!1);const e=i.getSelection();if(e.rangeCount){const{commonAncestorContainer:t}=e.getRangeAt(0);s.contains(t)&&s.focus()}}))}function u(t){let{buttons:o,target:a}=t;1===o&&a.getAttribute("contenteditable")&&n()&&(s=l.activeElement,e(),i.addEventListener("mouseup",c),ou(r,!0))}return r.addEventListener("mouseout",u),()=>{r.removeEventListener("mouseout",u),i.removeEventListener("mouseup",c),i.cancelAnimationFrame(a)}}),[e,t,n,o])}function lu(e,t){e.contentEditable=t,t&&e.focus()}function iu(){const{multiSelect:e,selectBlock:t,selectionChange:n}=(0,m.useDispatch)(Qn),{getBlockParents:o,getBlockSelectionStart:r}=(0,m.useSelect)(Qn);return(0,d.useRefEffect)((n=>{const{ownerDocument:l}=n,{defaultView:i}=l;function s(l){const s=i.getSelection();if(!s.rangeCount)return void lu(n,!1);const a=l.shiftKey&&"mouseup"===l.type;if(s.isCollapsed&&!a)return void lu(n,!1);let c=_c(function(e){const{anchorNode:t,anchorOffset:n}=e;return t.nodeType===t.TEXT_NODE?t:t.childNodes[n]}(s)),u=_c(function(e){const{focusNode:t,focusOffset:n}=e;return t.nodeType===t.TEXT_NODE?t:t.childNodes[n-1]}(s));if(a){const e=r(),t=_c(l.target),n=t!==u;(c===u&&s.isCollapsed||!u||n)&&(u=t),c!==e&&(c=e)}if(void 0!==c||void 0!==u)if(c===u)t(c);else{const t=[...o(c),c],n=[...o(u),u],r=function(e,t){let n=0;for(;e[n]===t[n];)n++;return n}(t,n);e(t[r],n[r])}else lu(n,!1)}function a(){l.addEventListener("selectionchange",s),i.addEventListener("mouseup",s)}function c(){l.removeEventListener("selectionchange",s),i.removeEventListener("mouseup",s)}function u(){c(),a()}return a(),n.addEventListener("focusin",u),()=>{c(),n.removeEventListener("focusin",u)}}),[e,t,n,o])}function su(){const{selectBlock:e}=(0,m.useDispatch)(Qn),{isSelectionEnabled:t,getBlockSelectionStart:n,hasMultiSelection:o}=(0,m.useSelect)(Qn);return(0,d.useRefEffect)((r=>{function l(l){if(!t()||0!==l.button)return;const i=n(),s=_c(l.target);l.shiftKey?i!==s&&(r.contentEditable=!0,r.focus()):o()&&e(s)}return r.addEventListener("mousedown",l),()=>{r.removeEventListener("mousedown",l)}}),[e,t,n,o])}function au(){const{__unstableIsFullySelected:e,getSelectedBlockClientIds:t,__unstableIsSelectionMergeable:n,hasMultiSelection:o}=(0,m.useSelect)(Qn),{replaceBlocks:l,__unstableSplitSelection:i,removeBlocks:s,__unstableDeleteSelection:a,__unstableExpandSelection:c}=(0,m.useDispatch)(Qn);return(0,d.useRefEffect)((u=>{function d(e){var t;o()&&null!==(t=e.inputType)&&void 0!==t&&t.startsWith("format")&&e.preventDefault()}function p(d){d.defaultPrevented||o()&&(d.keyCode===Tc.ENTER?(u.contentEditable=!1,d.preventDefault(),e()?l(t(),(0,r.createBlock)((0,r.getDefaultBlockName)())):i()):d.keyCode===Tc.BACKSPACE||d.keyCode===Tc.DELETE?(u.contentEditable=!1,d.preventDefault(),e()?s(t()):n()?a(d.keyCode===Tc.DELETE):c()):1!==d.key.length||d.metaKey||d.ctrlKey||(u.contentEditable=!1,n()?a(d.keyCode===Tc.DELETE):(d.preventDefault(),u.ownerDocument.defaultView.getSelection().removeAllRanges())))}function m(e){o()&&(u.contentEditable=!1,n()?a():(e.preventDefault(),u.ownerDocument.defaultView.getSelection().removeAllRanges()))}return u.addEventListener("beforeinput",d),u.addEventListener("keydown",p),u.addEventListener("compositionstart",m),()=>{u.removeEventListener("beforeinput",d),u.removeEventListener("keydown",p),u.removeEventListener("compositionstart",m)}}),[])}function cu(){const[e,t,n]=function(){const e=(0,s.useRef)(),t=(0,s.useRef)(),n=(0,s.useRef)(),o=(0,s.useRef)(),{hasMultiSelection:r,getSelectedBlockClientId:l,getBlockCount:i}=(0,m.useSelect)(Qn),{setNavigationMode:a}=(0,m.useDispatch)(Qn),c=(0,m.useSelect)((e=>e(Qn).isNavigationMode()),[])?void 0:"0",u=(0,s.useRef)();function p(t){if(u.current)u.current=null;else if(r())e.current.focus();else if(l())o.current.focus();else{a(!0);const n=t.target.compareDocumentPosition(e.current)&t.target.DOCUMENT_POSITION_FOLLOWING?"findNext":"findPrevious";ul.focus.tabbable[n](t.target).focus()}}const f=(0,s.createElement)("div",{ref:t,tabIndex:c,onFocus:p}),g=(0,s.createElement)("div",{ref:n,tabIndex:c,onFocus:p}),h=(0,d.useRefEffect)((s=>{function c(e){if(e.defaultPrevented)return;if(e.keyCode===Tc.ESCAPE&&!r())return e.preventDefault(),void a(!0);if(e.keyCode!==Tc.TAB)return;const o=e.shiftKey,i=o?"findPrevious":"findNext";if(!r()&&!l())return void(e.target===s&&a(!0));if(((0,ul.isFormElement)(e.target)||e.target.getAttribute("data-block")===l())&&(0,ul.isFormElement)(ul.focus.tabbable[i](e.target)))return;const c=o?t:n;u.current=!0,c.current.focus({preventScroll:!0})}function d(e){o.current=e.target;const{ownerDocument:t}=s;e.relatedTarget||t.activeElement!==t.body||0!==i()||s.focus()}function p(o){var r;if(o.keyCode!==Tc.TAB)return;if("region"===(null===(r=o.target)||void 0===r?void 0:r.getAttribute("role")))return;if(e.current===o.target)return;const l=o.shiftKey?"findPrevious":"findNext",i=ul.focus.tabbable[l](o.target);i!==t.current&&i!==n.current||(o.preventDefault(),i.focus({preventScroll:!0}))}const{ownerDocument:m}=s,{defaultView:f}=m;return f.addEventListener("keydown",p),s.addEventListener("keydown",c),s.addEventListener("focusout",d),()=>{f.removeEventListener("keydown",p),s.removeEventListener("keydown",c),s.removeEventListener("focusout",d)}}),[]);return[f,(0,d.useMergeRefs)([e,h]),g]}(),o=(0,m.useSelect)((e=>e(Qn).hasMultiSelection()),[]);return[e,(0,d.useMergeRefs)([t,au(),ru(),iu(),su(),Xc(),nu(),eu(),(0,d.useRefEffect)((e=>{if(e.tabIndex=-1,e.contentEditable=o,o)return e.setAttribute("aria-label",(0,g.__)("Multiple selected blocks")),()=>{e.removeAttribute("aria-label")}}),[o])]),n]}var uu=(0,s.forwardRef)((function(e,t){let{children:n,...o}=e;const[r,l,a]=cu();return(0,s.createElement)(s.Fragment,null,r,(0,s.createElement)("div",i({},o,{ref:(0,d.useMergeRefs)([l,t]),className:c()(o.className,"block-editor-writing-flow")}),n),a)}));const du="editor-styles-wrapper";function pu(e){return(0,s.useMemo)((()=>{const t=document.implementation.createHTMLDocument("");return t.body.innerHTML=e,Array.from(t.body.children)}),[e])}var mu=(0,s.forwardRef)((function(e,t){let{contentRef:n,children:o,head:r,tabIndex:l=0,assets:a,...u}=e;const[,m]=(0,s.useReducer)((()=>({}))),[f,h]=(0,s.useState)(),[v,b]=(0,s.useState)([]),k=pu(null==a?void 0:a.styles),_=pu(null==a?void 0:a.scripts),y=Yc(),[E,C,S]=cu(),w=(0,d.useRefEffect)((e=>{function t(){const{contentDocument:t,ownerDocument:n}=e,{readyState:o,documentElement:r}=t;return("interactive"===o||"complete"===o)&&(function(e){const{defaultView:t}=e,{frameElement:n}=t;function o(e){const o=Object.getPrototypeOf(e).constructor.name,r=window[o],l={};for(const t in e)l[t]=e[t];if(e instanceof t.MouseEvent){const e=n.getBoundingClientRect();l.clientX+=e.left,l.clientY+=e.top}const i=new r(e.type,l);!n.dispatchEvent(i)&&e.preventDefault()}const r=["dragover"];for(const t of r)e.addEventListener(t,o)}(t),h(t),y(r),b(Array.from(n.body.classList).filter((e=>e.startsWith("admin-color-")||e.startsWith("post-type-")||"wp-embed-responsive"===e))),t.dir=n.dir,r.removeChild(t.head),r.removeChild(t.body),!0)}return e.addEventListener("load",t),()=>e.removeEventListener("load",t)}),[]),B=(0,d.useRefEffect)((e=>{_.reduce(((t,n)=>t.then((()=>async function(e,t){let{id:n,src:o}=t;return new Promise(((t,r)=>{const l=e.ownerDocument.createElement("script");l.id=n,o?(l.src=o,l.onload=()=>t(),l.onerror=()=>r()):t(),e.appendChild(l)}))}(e,n)))),Promise.resolve()).finally((()=>{m()}))}),[]),I=(0,d.useMergeRefs)([n,y,C]),x=(0,d.useRefEffect)((e=>{Array.from(document.styleSheets).forEach((t=>{try{t.cssRules}catch(e){return}const{ownerNode:n,cssRules:o}=t;if(o&&"LINK"===n.tagName&&"wp-reset-editor-styles-css"!==n.id&&Array.from(o).find((e=>{let{selectorText:t}=e;return t&&(t.includes(`.${du}`)||t.includes(".wp-block"))}))&&!e.ownerDocument.getElementById(n.id)){e.appendChild(n.cloneNode(!0));const t=n.id.replace("-css","-inline-css"),o=document.getElementById(t);o&&e.appendChild(o.cloneNode(!0))}}))}),[]);return r=(0,s.createElement)(s.Fragment,null,(0,s.createElement)("style",null,"body{margin:0}"),k.map((e=>{let{tagName:t,href:n,id:o,rel:r,media:l,textContent:i}=e;const a=t.toLowerCase();return"style"===a?(0,s.createElement)(a,{id:o,key:o},i):(0,s.createElement)(a,{href:n,id:o,rel:r,media:l,key:o})})),r),(0,s.createElement)(s.Fragment,null,l>=0&&E,(0,s.createElement)("iframe",i({},u,{ref:(0,d.useMergeRefs)([t,w]),tabIndex:l,srcDoc:"<!doctype html>",title:(0,g.__)("Editor canvas")}),f&&(0,s.createPortal)((0,s.createElement)(s.Fragment,null,(0,s.createElement)("head",{ref:B},r),(0,s.createElement)("body",{ref:I,className:c()(du,...v)},(0,s.createElement)("div",{style:{display:"none"},ref:x}),(0,s.createElement)(p.__experimentalStyleProvider,{document:f},o))),f.documentElement)),l>=0&&S)})),fu={grad:.9,turn:360,rad:360/(2*Math.PI)},gu=function(e){return"string"==typeof e?e.length>0:"number"==typeof e},hu=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=Math.pow(10,t)),Math.round(n*e)/n+0},vu=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=1),e>n?n:e>t?e:t},bu=function(e){return(e=isFinite(e)?e%360:0)>0?e:e+360},ku=function(e){return{r:vu(e.r,0,255),g:vu(e.g,0,255),b:vu(e.b,0,255),a:vu(e.a)}},_u=function(e){return{r:hu(e.r),g:hu(e.g),b:hu(e.b),a:hu(e.a,3)}},yu=/^#([0-9a-f]{3,8})$/i,Eu=function(e){var t=e.toString(16);return t.length<2?"0"+t:t},Cu=function(e){var t=e.r,n=e.g,o=e.b,r=e.a,l=Math.max(t,n,o),i=l-Math.min(t,n,o),s=i?l===t?(n-o)/i:l===n?2+(o-t)/i:4+(t-n)/i:0;return{h:60*(s<0?s+6:s),s:l?i/l*100:0,v:l/255*100,a:r}},Su=function(e){var t=e.h,n=e.s,o=e.v,r=e.a;t=t/360*6,n/=100,o/=100;var l=Math.floor(t),i=o*(1-n),s=o*(1-(t-l)*n),a=o*(1-(1-t+l)*n),c=l%6;return{r:255*[o,s,i,i,a,o][c],g:255*[a,o,o,s,i,i][c],b:255*[i,i,a,o,o,s][c],a:r}},wu=function(e){return{h:bu(e.h),s:vu(e.s,0,100),l:vu(e.l,0,100),a:vu(e.a)}},Bu=function(e){return{h:hu(e.h),s:hu(e.s),l:hu(e.l),a:hu(e.a,3)}},Iu=function(e){return Su((n=(t=e).s,{h:t.h,s:(n*=((o=t.l)<50?o:100-o)/100)>0?2*n/(o+n)*100:0,v:o+n,a:t.a}));var t,n,o},xu=function(e){return{h:(t=Cu(e)).h,s:(r=(200-(n=t.s))*(o=t.v)/100)>0&&r<200?n*o/100/(r<=100?r:200-r)*100:0,l:r/2,a:t.a};var t,n,o,r},Tu=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Nu=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Pu=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Ru=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Mu={string:[[function(e){var t=yu.exec(e);return t?(e=t[1]).length<=4?{r:parseInt(e[0]+e[0],16),g:parseInt(e[1]+e[1],16),b:parseInt(e[2]+e[2],16),a:4===e.length?hu(parseInt(e[3]+e[3],16)/255,2):1}:6===e.length||8===e.length?{r:parseInt(e.substr(0,2),16),g:parseInt(e.substr(2,2),16),b:parseInt(e.substr(4,2),16),a:8===e.length?hu(parseInt(e.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(e){var t=Pu.exec(e)||Ru.exec(e);return t?t[2]!==t[4]||t[4]!==t[6]?null:ku({r:Number(t[1])/(t[2]?100/255:1),g:Number(t[3])/(t[4]?100/255:1),b:Number(t[5])/(t[6]?100/255:1),a:void 0===t[7]?1:Number(t[7])/(t[8]?100:1)}):null},"rgb"],[function(e){var t=Tu.exec(e)||Nu.exec(e);if(!t)return null;var n,o,r=wu({h:(n=t[1],o=t[2],void 0===o&&(o="deg"),Number(n)*(fu[o]||1)),s:Number(t[3]),l:Number(t[4]),a:void 0===t[5]?1:Number(t[5])/(t[6]?100:1)});return Iu(r)},"hsl"]],object:[[function(e){var t=e.r,n=e.g,o=e.b,r=e.a,l=void 0===r?1:r;return gu(t)&&gu(n)&&gu(o)?ku({r:Number(t),g:Number(n),b:Number(o),a:Number(l)}):null},"rgb"],[function(e){var t=e.h,n=e.s,o=e.l,r=e.a,l=void 0===r?1:r;if(!gu(t)||!gu(n)||!gu(o))return null;var i=wu({h:Number(t),s:Number(n),l:Number(o),a:Number(l)});return Iu(i)},"hsl"],[function(e){var t=e.h,n=e.s,o=e.v,r=e.a,l=void 0===r?1:r;if(!gu(t)||!gu(n)||!gu(o))return null;var i=function(e){return{h:bu(e.h),s:vu(e.s,0,100),v:vu(e.v,0,100),a:vu(e.a)}}({h:Number(t),s:Number(n),v:Number(o),a:Number(l)});return Su(i)},"hsv"]]},Lu=function(e,t){for(var n=0;n<t.length;n++){var o=t[n][0](e);if(o)return[o,t[n][1]]}return[null,void 0]},Au=function(e,t){var n=xu(e);return{h:n.h,s:vu(n.s+100*t,0,100),l:n.l,a:n.a}},Du=function(e){return(299*e.r+587*e.g+114*e.b)/1e3/255},Ou=function(e,t){var n=xu(e);return{h:n.h,s:n.s,l:vu(n.l+100*t,0,100),a:n.a}},Fu=function(){function e(e){this.parsed=function(e){return"string"==typeof e?Lu(e.trim(),Mu.string):"object"==typeof e&&null!==e?Lu(e,Mu.object):[null,void 0]}(e)[0],this.rgba=this.parsed||{r:0,g:0,b:0,a:1}}return e.prototype.isValid=function(){return null!==this.parsed},e.prototype.brightness=function(){return hu(Du(this.rgba),2)},e.prototype.isDark=function(){return Du(this.rgba)<.5},e.prototype.isLight=function(){return Du(this.rgba)>=.5},e.prototype.toHex=function(){return t=(e=_u(this.rgba)).r,n=e.g,o=e.b,l=(r=e.a)<1?Eu(hu(255*r)):"","#"+Eu(t)+Eu(n)+Eu(o)+l;var e,t,n,o,r,l},e.prototype.toRgb=function(){return _u(this.rgba)},e.prototype.toRgbString=function(){return t=(e=_u(this.rgba)).r,n=e.g,o=e.b,(r=e.a)<1?"rgba("+t+", "+n+", "+o+", "+r+")":"rgb("+t+", "+n+", "+o+")";var e,t,n,o,r},e.prototype.toHsl=function(){return Bu(xu(this.rgba))},e.prototype.toHslString=function(){return t=(e=Bu(xu(this.rgba))).h,n=e.s,o=e.l,(r=e.a)<1?"hsla("+t+", "+n+"%, "+o+"%, "+r+")":"hsl("+t+", "+n+"%, "+o+"%)";var e,t,n,o,r},e.prototype.toHsv=function(){return e=Cu(this.rgba),{h:hu(e.h),s:hu(e.s),v:hu(e.v),a:hu(e.a,3)};var e},e.prototype.invert=function(){return zu({r:255-(e=this.rgba).r,g:255-e.g,b:255-e.b,a:e.a});var e},e.prototype.saturate=function(e){return void 0===e&&(e=.1),zu(Au(this.rgba,e))},e.prototype.desaturate=function(e){return void 0===e&&(e=.1),zu(Au(this.rgba,-e))},e.prototype.grayscale=function(){return zu(Au(this.rgba,-1))},e.prototype.lighten=function(e){return void 0===e&&(e=.1),zu(Ou(this.rgba,e))},e.prototype.darken=function(e){return void 0===e&&(e=.1),zu(Ou(this.rgba,-e))},e.prototype.rotate=function(e){return void 0===e&&(e=15),this.hue(this.hue()+e)},e.prototype.alpha=function(e){return"number"==typeof e?zu({r:(t=this.rgba).r,g:t.g,b:t.b,a:e}):hu(this.rgba.a,3);var t},e.prototype.hue=function(e){var t=xu(this.rgba);return"number"==typeof e?zu({h:e,s:t.s,l:t.l,a:t.a}):hu(t.h)},e.prototype.isEqual=function(e){return this.toHex()===zu(e).toHex()},e}(),zu=function(e){return e instanceof Fu?e:new Fu(e)},Vu=[],Hu=function(e){e.forEach((function(e){Vu.indexOf(e)<0&&(e(Fu,Mu),Vu.push(e))}))};function Gu(e,t){var n={white:"#ffffff",bisque:"#ffe4c4",blue:"#0000ff",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",antiquewhite:"#faebd7",aqua:"#00ffff",azure:"#f0ffff",whitesmoke:"#f5f5f5",papayawhip:"#ffefd5",plum:"#dda0dd",blanchedalmond:"#ffebcd",black:"#000000",gold:"#ffd700",goldenrod:"#daa520",gainsboro:"#dcdcdc",cornsilk:"#fff8dc",cornflowerblue:"#6495ed",burlywood:"#deb887",aquamarine:"#7fffd4",beige:"#f5f5dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkkhaki:"#bdb76b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",peachpuff:"#ffdab9",darkmagenta:"#8b008b",darkred:"#8b0000",darkorchid:"#9932cc",darkorange:"#ff8c00",darkslateblue:"#483d8b",gray:"#808080",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",deeppink:"#ff1493",deepskyblue:"#00bfff",wheat:"#f5deb3",firebrick:"#b22222",floralwhite:"#fffaf0",ghostwhite:"#f8f8ff",darkviolet:"#9400d3",magenta:"#ff00ff",green:"#008000",dodgerblue:"#1e90ff",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",blueviolet:"#8a2be2",forestgreen:"#228b22",lawngreen:"#7cfc00",indianred:"#cd5c5c",indigo:"#4b0082",fuchsia:"#ff00ff",brown:"#a52a2a",maroon:"#800000",mediumblue:"#0000cd",lightcoral:"#f08080",darkturquoise:"#00ced1",lightcyan:"#e0ffff",ivory:"#fffff0",lightyellow:"#ffffe0",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",linen:"#faf0e6",mediumaquamarine:"#66cdaa",lemonchiffon:"#fffacd",lime:"#00ff00",khaki:"#f0e68c",mediumseagreen:"#3cb371",limegreen:"#32cd32",mediumspringgreen:"#00fa9a",lightskyblue:"#87cefa",lightblue:"#add8e6",midnightblue:"#191970",lightpink:"#ffb6c1",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",mintcream:"#f5fffa",lightslategray:"#778899",lightslategrey:"#778899",navajowhite:"#ffdead",navy:"#000080",mediumvioletred:"#c71585",powderblue:"#b0e0e6",palegoldenrod:"#eee8aa",oldlace:"#fdf5e6",paleturquoise:"#afeeee",mediumturquoise:"#48d1cc",mediumorchid:"#ba55d3",rebeccapurple:"#663399",lightsteelblue:"#b0c4de",mediumslateblue:"#7b68ee",thistle:"#d8bfd8",tan:"#d2b48c",orchid:"#da70d6",mediumpurple:"#9370db",purple:"#800080",pink:"#ffc0cb",skyblue:"#87ceeb",springgreen:"#00ff7f",palegreen:"#98fb98",red:"#ff0000",yellow:"#ffff00",slateblue:"#6a5acd",lavenderblush:"#fff0f5",peru:"#cd853f",palevioletred:"#db7093",violet:"#ee82ee",teal:"#008080",slategray:"#708090",slategrey:"#708090",aliceblue:"#f0f8ff",darkseagreen:"#8fbc8f",darkolivegreen:"#556b2f",greenyellow:"#adff2f",seagreen:"#2e8b57",seashell:"#fff5ee",tomato:"#ff6347",silver:"#c0c0c0",sienna:"#a0522d",lavender:"#e6e6fa",lightgreen:"#90ee90",orange:"#ffa500",orangered:"#ff4500",steelblue:"#4682b4",royalblue:"#4169e1",turquoise:"#40e0d0",yellowgreen:"#9acd32",salmon:"#fa8072",saddlebrown:"#8b4513",sandybrown:"#f4a460",rosybrown:"#bc8f8f",darksalmon:"#e9967a",lightgoldenrodyellow:"#fafad2",snow:"#fffafa",lightgrey:"#d3d3d3",lightgray:"#d3d3d3",dimgray:"#696969",dimgrey:"#696969",olivedrab:"#6b8e23",olive:"#808000"},o={};for(var r in n)o[n[r]]=r;var l={};e.prototype.toName=function(t){if(!(this.rgba.a||this.rgba.r||this.rgba.g||this.rgba.b))return"transparent";var r,i,s=o[this.toHex()];if(s)return s;if(null==t?void 0:t.closest){var a=this.toRgb(),c=1/0,u="black";if(!l.length)for(var d in n)l[d]=new e(n[d]).toRgb();for(var p in n){var m=(r=a,i=l[p],Math.pow(r.r-i.r,2)+Math.pow(r.g-i.g,2)+Math.pow(r.b-i.b,2));m<c&&(c=m,u=p)}return u}},t.string.push([function(t){var o=t.toLowerCase(),r="transparent"===o?"#0000":n[o];return r?new e(r).toRgb():null},"name"])}var Uu=function(e){var t=e/255;return t<.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)},Wu=function(e){return.2126*Uu(e.r)+.7152*Uu(e.g)+.0722*Uu(e.b)};function $u(e){e.prototype.luminance=function(){return e=Wu(this.rgba),void 0===(t=2)&&(t=0),void 0===n&&(n=Math.pow(10,t)),Math.round(n*e)/n+0;var e,t,n},e.prototype.contrast=function(t){void 0===t&&(t="#FFF");var n,o,r,l,i,s,a,c=t instanceof e?t:new e(t);return l=this.rgba,i=c.toRgb(),n=(s=Wu(l))>(a=Wu(i))?(s+.05)/(a+.05):(a+.05)/(s+.05),void 0===(o=2)&&(o=0),void 0===r&&(r=Math.pow(10,o)),Math.floor(r*n)/r+0},e.prototype.isReadable=function(e,t){return void 0===e&&(e="#FFF"),void 0===t&&(t={}),this.contrast(e)>=(i=void 0===(l=(n=t).size)?"normal":l,"AAA"===(r=void 0===(o=n.level)?"AA":o)&&"normal"===i?7:"AA"===r&&"large"===i?3:4.5);var n,o,r,l,i}}var ju=n(3124),Ku=n.n(ju);const qu=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;function Yu(e,t){t=t||{};let n=1,o=1;function r(e){const t=e.match(/\n/g);t&&(n+=t.length);const r=e.lastIndexOf("\n");o=~r?e.length-r:o+e.length}function l(){const e={line:n,column:o};return function(t){return t.position=new i(e),m(),t}}function i(e){this.start=e,this.end={line:n,column:o},this.source=t.source}i.prototype.content=e;const s=[];function a(r){const l=new Error(t.source+":"+n+":"+o+": "+r);if(l.reason=r,l.filename=t.source,l.line=n,l.column=o,l.source=e,!t.silent)throw l;s.push(l)}function c(){return p(/^{\s*/)}function u(){return p(/^}/)}function d(){let t;const n=[];for(m(),f(n);e.length&&"}"!==e.charAt(0)&&(t=S()||w());)!1!==t&&(n.push(t),f(n));return n}function p(t){const n=t.exec(e);if(!n)return;const o=n[0];return r(o),e=e.slice(o.length),n}function m(){p(/^\s*/)}function f(e){let t;for(e=e||[];t=g();)!1!==t&&e.push(t);return e}function g(){const t=l();if("/"!==e.charAt(0)||"*"!==e.charAt(1))return;let n=2;for(;""!==e.charAt(n)&&("*"!==e.charAt(n)||"/"!==e.charAt(n+1));)++n;if(n+=2,""===e.charAt(n-1))return a("End of comment missing");const i=e.slice(2,n-2);return o+=2,r(i),e=e.slice(n),o+=2,t({type:"comment",comment:i})}function h(){const e=p(/^([^{]+)/);if(e)return Zu(e[0]).replace(/\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*\/+/g,"").replace(/"(?:\\"|[^"])*"|'(?:\\'|[^'])*'/g,(function(e){return e.replace(/,/g,"")})).split(/\s*(?![^(]*\)),\s*/).map((function(e){return e.replace(/\u200C/g,",")}))}function v(){const e=l();let t=p(/^(\*?[-#\/\*\\\w]+(\[[0-9a-z_-]+\])?)\s*/);if(!t)return;if(t=Zu(t[0]),!p(/^:\s*/))return a("property missing ':'");const n=p(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^\)]*?\)|[^};])+)/),o=e({type:"declaration",property:t.replace(qu,""),value:n?Zu(n[0]).replace(qu,""):""});return p(/^[;\s]*/),o}function b(){const e=[];if(!c())return a("missing '{'");let t;for(f(e);t=v();)!1!==t&&(e.push(t),f(e));return u()?e:a("missing '}'")}function k(){let e;const t=[],n=l();for(;e=p(/^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/);)t.push(e[1]),p(/^,\s*/);if(t.length)return n({type:"keyframe",values:t,declarations:b()})}const _=C("import"),y=C("charset"),E=C("namespace");function C(e){const t=new RegExp("^@"+e+"\\s*([^;]+);");return function(){const n=l(),o=p(t);if(!o)return;const r={type:e};return r[e]=o[1].trim(),n(r)}}function S(){if("@"===e[0])return function(){const e=l();let t=p(/^@([-\w]+)?keyframes\s*/);if(!t)return;const n=t[1];if(t=p(/^([-\w]+)\s*/),!t)return a("@keyframes missing name");const o=t[1];if(!c())return a("@keyframes missing '{'");let r,i=f();for(;r=k();)i.push(r),i=i.concat(f());return u()?e({type:"keyframes",name:o,vendor:n,keyframes:i}):a("@keyframes missing '}'")}()||function(){const e=l(),t=p(/^@media *([^{]+)/);if(!t)return;const n=Zu(t[1]);if(!c())return a("@media missing '{'");const o=f().concat(d());return u()?e({type:"media",media:n,rules:o}):a("@media missing '}'")}()||function(){const e=l(),t=p(/^@custom-media\s+(--[^\s]+)\s*([^{;]+);/);if(t)return e({type:"custom-media",name:Zu(t[1]),media:Zu(t[2])})}()||function(){const e=l(),t=p(/^@supports *([^{]+)/);if(!t)return;const n=Zu(t[1]);if(!c())return a("@supports missing '{'");const o=f().concat(d());return u()?e({type:"supports",supports:n,rules:o}):a("@supports missing '}'")}()||_()||y()||E()||function(){const e=l(),t=p(/^@([-\w]+)?document *([^{]+)/);if(!t)return;const n=Zu(t[1]),o=Zu(t[2]);if(!c())return a("@document missing '{'");const r=f().concat(d());return u()?e({type:"document",document:o,vendor:n,rules:r}):a("@document missing '}'")}()||function(){const e=l();if(!p(/^@page */))return;const t=h()||[];if(!c())return a("@page missing '{'");let n,o=f();for(;n=v();)o.push(n),o=o.concat(f());return u()?e({type:"page",selectors:t,declarations:o}):a("@page missing '}'")}()||function(){const e=l();if(!p(/^@host\s*/))return;if(!c())return a("@host missing '{'");const t=f().concat(d());return u()?e({type:"host",rules:t}):a("@host missing '}'")}()||function(){const e=l();if(!p(/^@font-face\s*/))return;if(!c())return a("@font-face missing '{'");let t,n=f();for(;t=v();)n.push(t),n=n.concat(f());return u()?e({type:"font-face",declarations:n}):a("@font-face missing '}'")}()}function w(){const e=l(),t=h();return t?(f(),e({type:"rule",selectors:t,declarations:b()})):a("selector missing")}return Qu(function(){const e=d();return{type:"stylesheet",stylesheet:{source:t.source,rules:e,parsingErrors:s}}}())}function Zu(e){return e?e.replace(/^\s+|\s+$/g,""):""}function Qu(e,t){const n=e&&"string"==typeof e.type,o=n?e:t;for(const t in e){const n=e[t];Array.isArray(n)?n.forEach((function(e){Qu(e,o)})):n&&"object"==typeof n&&Qu(n,o)}return n&&Object.defineProperty(e,"parent",{configurable:!0,writable:!0,enumerable:!1,value:t||null}),e}var Xu=n(8575),Ju=n.n(Xu),ed=td;function td(e){this.options=e||{}}td.prototype.emit=function(e){return e},td.prototype.visit=function(e){return this[e.type](e)},td.prototype.mapVisit=function(e,t){let n="";t=t||"";for(let o=0,r=e.length;o<r;o++)n+=this.visit(e[o]),t&&o<r-1&&(n+=this.emit(t));return n};var nd=od;function od(e){ed.call(this,e)}Ju()(od,ed),od.prototype.compile=function(e){return e.stylesheet.rules.map(this.visit,this).join("")},od.prototype.comment=function(e){return this.emit("",e.position)},od.prototype.import=function(e){return this.emit("@import "+e.import+";",e.position)},od.prototype.media=function(e){return this.emit("@media "+e.media,e.position)+this.emit("{")+this.mapVisit(e.rules)+this.emit("}")},od.prototype.document=function(e){const t="@"+(e.vendor||"")+"document "+e.document;return this.emit(t,e.position)+this.emit("{")+this.mapVisit(e.rules)+this.emit("}")},od.prototype.charset=function(e){return this.emit("@charset "+e.charset+";",e.position)},od.prototype.namespace=function(e){return this.emit("@namespace "+e.namespace+";",e.position)},od.prototype.supports=function(e){return this.emit("@supports "+e.supports,e.position)+this.emit("{")+this.mapVisit(e.rules)+this.emit("}")},od.prototype.keyframes=function(e){return this.emit("@"+(e.vendor||"")+"keyframes "+e.name,e.position)+this.emit("{")+this.mapVisit(e.keyframes)+this.emit("}")},od.prototype.keyframe=function(e){const t=e.declarations;return this.emit(e.values.join(","),e.position)+this.emit("{")+this.mapVisit(t)+this.emit("}")},od.prototype.page=function(e){const t=e.selectors.length?e.selectors.join(", "):"";return this.emit("@page "+t,e.position)+this.emit("{")+this.mapVisit(e.declarations)+this.emit("}")},od.prototype["font-face"]=function(e){return this.emit("@font-face",e.position)+this.emit("{")+this.mapVisit(e.declarations)+this.emit("}")},od.prototype.host=function(e){return this.emit("@host",e.position)+this.emit("{")+this.mapVisit(e.rules)+this.emit("}")},od.prototype["custom-media"]=function(e){return this.emit("@custom-media "+e.name+" "+e.media+";",e.position)},od.prototype.rule=function(e){const t=e.declarations;return t.length?this.emit(e.selectors.join(","),e.position)+this.emit("{")+this.mapVisit(t)+this.emit("}"):""},od.prototype.declaration=function(e){return this.emit(e.property+":"+e.value,e.position)+this.emit(";")};var rd=ld;function ld(e){e=e||{},ed.call(this,e),this.indentation=e.indent}Ju()(ld,ed),ld.prototype.compile=function(e){return this.stylesheet(e)},ld.prototype.stylesheet=function(e){return this.mapVisit(e.stylesheet.rules,"\n\n")},ld.prototype.comment=function(e){return this.emit(this.indent()+"/*"+e.comment+"*/",e.position)},ld.prototype.import=function(e){return this.emit("@import "+e.import+";",e.position)},ld.prototype.media=function(e){return this.emit("@media "+e.media,e.position)+this.emit(" {\n"+this.indent(1))+this.mapVisit(e.rules,"\n\n")+this.emit(this.indent(-1)+"\n}")},ld.prototype.document=function(e){const t="@"+(e.vendor||"")+"document "+e.document;return this.emit(t,e.position)+this.emit(" {\n"+this.indent(1))+this.mapVisit(e.rules,"\n\n")+this.emit(this.indent(-1)+"\n}")},ld.prototype.charset=function(e){return this.emit("@charset "+e.charset+";",e.position)},ld.prototype.namespace=function(e){return this.emit("@namespace "+e.namespace+";",e.position)},ld.prototype.supports=function(e){return this.emit("@supports "+e.supports,e.position)+this.emit(" {\n"+this.indent(1))+this.mapVisit(e.rules,"\n\n")+this.emit(this.indent(-1)+"\n}")},ld.prototype.keyframes=function(e){return this.emit("@"+(e.vendor||"")+"keyframes "+e.name,e.position)+this.emit(" {\n"+this.indent(1))+this.mapVisit(e.keyframes,"\n")+this.emit(this.indent(-1)+"}")},ld.prototype.keyframe=function(e){const t=e.declarations;return this.emit(this.indent())+this.emit(e.values.join(", "),e.position)+this.emit(" {\n"+this.indent(1))+this.mapVisit(t,"\n")+this.emit(this.indent(-1)+"\n"+this.indent()+"}\n")},ld.prototype.page=function(e){const t=e.selectors.length?e.selectors.join(", ")+" ":"";return this.emit("@page "+t,e.position)+this.emit("{\n")+this.emit(this.indent(1))+this.mapVisit(e.declarations,"\n")+this.emit(this.indent(-1))+this.emit("\n}")},ld.prototype["font-face"]=function(e){return this.emit("@font-face ",e.position)+this.emit("{\n")+this.emit(this.indent(1))+this.mapVisit(e.declarations,"\n")+this.emit(this.indent(-1))+this.emit("\n}")},ld.prototype.host=function(e){return this.emit("@host",e.position)+this.emit(" {\n"+this.indent(1))+this.mapVisit(e.rules,"\n\n")+this.emit(this.indent(-1)+"\n}")},ld.prototype["custom-media"]=function(e){return this.emit("@custom-media "+e.name+" "+e.media+";",e.position)},ld.prototype.rule=function(e){const t=this.indent(),n=e.declarations;return n.length?this.emit(e.selectors.map((function(e){return t+e})).join(",\n"),e.position)+this.emit(" {\n")+this.emit(this.indent(1))+this.mapVisit(n,"\n")+this.emit(this.indent(-1))+this.emit("\n"+this.indent()+"}"):""},ld.prototype.declaration=function(e){return this.emit(this.indent())+this.emit(e.property+": "+e.value,e.position)+this.emit(";")},ld.prototype.indent=function(e){return this.level=this.level||1,null!==e?(this.level+=e,""):Array(this.level).join(this.indentation||" ")};var id=function(e,t){try{const r=Yu(e);return n=Ku().map(r,(function(e){if(!e)return e;const n=t(e);return this.update(n)})),((o=o||{}).compress?new nd(o):new rd(o)).compile(n)}catch(e){return console.warn("Error while traversing the CSS: "+e),null}var n,o};function sd(e){return 0!==e.value.indexOf("data:")&&0!==e.value.indexOf("#")&&(t=e.value,!/^\/(?!\/)/.test(t)&&!function(e){return/^(?:https?:)?\/\//.test(e)}(e.value));var t}function ad(e,t){return new URL(e,t).toString()}var cd=e=>t=>{if("declaration"===t.type){const l=function(e){const t=/url\((\s*)(['"]?)(.+?)\2(\s*)\)/g;let n;const o=[];for(;null!==(n=t.exec(e));){const e={source:n[0],before:n[1],quote:n[2],value:n[3],after:n[4]};sd(e)&&o.push(e)}return o}(t.value).map((r=e,e=>({...e,newUrl:"url("+e.before+e.quote+ad(e.value,r)+e.quote+e.after+")"})));return{...t,value:(n=t.value,o=l,o.forEach((e=>{n=n.replace(e.source,e.newUrl)})),n)}}var n,o,r;return t};const ud=/^(body|html|:root).*$/;var dd=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return n=>"rule"===n.type?{...n,selectors:n.selectors.map((n=>t.includes(n.trim())?n:n.match(ud)?n.replace(/^(body|html|:root)/,e):e+" "+n))}:n},pd=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return(0,u.map)(e,(e=>{let{css:n,baseURL:o}=e;const r=[];return t&&r.push(dd(t)),o&&r.push(cd(o)),r.length?id(n,(0,d.compose)(r)):n}))};const md=".editor-styles-wrapper";function fd(e){return(0,s.useCallback)((e=>{if(!e)return;const{ownerDocument:t}=e,{defaultView:n,body:o}=t,r=t.querySelector(md);let l;if(r)l=n.getComputedStyle(r,null).getPropertyValue("background-color");else{const e=t.createElement("div");e.classList.add("editor-styles-wrapper"),o.appendChild(e),l=n.getComputedStyle(e,null).getPropertyValue("background-color"),o.removeChild(e)}const i=zu(l);i.luminance()>.5||0===i.alpha()?o.classList.remove("is-dark-theme"):o.classList.add("is-dark-theme")}),[e])}function gd(e){let{styles:t}=e;const n=(0,s.useMemo)((()=>pd(t,md)),[t]);return(0,s.createElement)(s.Fragment,null,(0,s.createElement)("style",{ref:fd(t)}),n.map(((e,t)=>(0,s.createElement)("style",{key:t},e))))}let hd;Hu([Gu,$u]);const vd=2e3;var bd=function(e){let{viewportWidth:t,__experimentalPadding:n,__experimentalMinHeight:o}=e;const[r,{width:l}]=(0,d.useResizeObserver)(),[i,{height:a}]=(0,d.useResizeObserver)(),{styles:c,assets:u}=(0,m.useSelect)((e=>{const t=e(Qn).getSettings();return{styles:t.styles,assets:t.__unstableResolvedAssets}}),[]),f=(0,s.useMemo)((()=>c?[...c,{css:"body{height:auto;overflow:hidden;}",__unstableType:"presets"}]:c),[c]);hd=hd||(0,d.pure)(Of);const g=l/t;return(0,s.createElement)("div",{className:"block-editor-block-preview__container"},r,(0,s.createElement)(p.Disabled,{className:"block-editor-block-preview__content",style:{transform:`scale(${g})`,height:a*g,maxHeight:a>vd?vd*g:void 0,minHeight:o}},(0,s.createElement)(mu,{head:(0,s.createElement)(gd,{styles:f}),assets:u,contentRef:(0,d.useRefEffect)((e=>{const{ownerDocument:{documentElement:t}}=e;t.classList.add("block-editor-block-preview__content-iframe"),t.style.position="absolute",t.style.width="100%",e.style.padding=n+"px",e.style.position="relative"}),[]),"aria-hidden":!0,tabIndex:-1,style:{position:"absolute",width:t,height:a,pointerEvents:"none",maxHeight:vd,minHeight:g<1&&o?o/g:o}},i,(0,s.createElement)(hd,{renderAppender:!1}))))},kd=(0,s.memo)((function(e){let{blocks:t,__experimentalPadding:n=0,viewportWidth:o=1200,__experimentalLive:r=!1,__experimentalOnClick:l,__experimentalMinHeight:i}=e;const a=(0,m.useSelect)((e=>e(Qn).getSettings()),[]),c=(0,s.useMemo)((()=>{const e={...a};return e.__experimentalBlockPatterns=[],e}),[a]),d=(0,s.useMemo)((()=>(0,u.castArray)(t)),[t]);return t&&0!==t.length?(0,s.createElement)(Kc,{value:d,settings:c},r?(0,s.createElement)(qc,{onClick:l}):(0,s.createElement)(bd,{viewportWidth:o,__experimentalPadding:n,__experimentalMinHeight:i})):null}));function _d(e){let{blocks:t,props:n={},__experimentalLayout:o}=e;const r=(0,m.useSelect)((e=>e(Qn).getSettings()),[]),l=(0,d.useDisabled)(),i=(0,d.useMergeRefs)([n.ref,l]),a=(0,s.useMemo)((()=>({...r,__experimentalBlockPatterns:[]})),[r]),p=(0,s.useMemo)((()=>(0,u.castArray)(t)),[t]),f=(0,s.createElement)(Kc,{value:p,settings:a},(0,s.createElement)(zf,{renderAppender:!1,__experimentalLayout:o}));return{...n,ref:i,className:c()(n.className,"block-editor-block-preview__live-content","components-disabled"),children:null!=t&&t.length?f:null}}var yd=function(e){var t,n;let{item:o}=e;const{name:l,title:i,icon:a,description:c,initialAttributes:u}=o,d=(0,r.getBlockType)(l),p=(0,r.isReusableBlock)(o);return(0,s.createElement)("div",{className:"block-editor-inserter__preview-container"},(0,s.createElement)("div",{className:"block-editor-inserter__preview"},p||null!=d&&d.example?(0,s.createElement)("div",{className:"block-editor-inserter__preview-content"},(0,s.createElement)(kd,{__experimentalPadding:16,viewportWidth:null!==(t=null===(n=d.example)||void 0===n?void 0:n.viewportWidth)&&void 0!==t?t:500,blocks:d.example?(0,r.getBlockFromExample)(o.name,{attributes:{...d.example.attributes,...u},innerBlocks:d.example.innerBlocks}):(0,r.createBlock)(l,u)})):(0,s.createElement)("div",{className:"block-editor-inserter__preview-content-missing"},(0,g.__)("No Preview Available."))),!p&&(0,s.createElement)($c,{title:i,icon:a,description:c}))},Ed=(0,s.createContext)(),Cd=(0,s.forwardRef)((function(e,t){let{isFirst:n,as:o,children:r,...l}=e;const a=(0,s.useContext)(Ed);return(0,s.createElement)(p.__unstableCompositeItem,i({ref:t,state:a,role:"option",focusable:!0},l),(e=>{const t={...e,tabIndex:n?0:e.tabIndex};return o?(0,s.createElement)(o,t,r):"function"==typeof r?r(t):(0,s.createElement)(p.Button,t,r)}))})),Sd=(0,s.createElement)(A.SVG,{width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(A.Path,{d:"M8 7h2V5H8v2zm0 6h2v-2H8v2zm0 6h2v-2H8v2zm6-14v2h2V5h-2zm0 8h2v-2h-2v2zm0 6h2v-2h-2v2z"}));function wd(e){let{count:t,icon:n}=e;return(0,s.createElement)("div",{className:"block-editor-block-draggable-chip-wrapper"},(0,s.createElement)("div",{className:"block-editor-block-draggable-chip"},(0,s.createElement)(p.Flex,{justify:"center",className:"block-editor-block-draggable-chip__content"},(0,s.createElement)(p.FlexItem,null,n?(0,s.createElement)(Wc,{icon:n}):(0,g.sprintf)(
|
11 |
/* translators: %d: Number of blocks. */
|
12 |
+
(0,g._n)("%d block","%d blocks",t),t)),(0,s.createElement)(p.FlexItem,null,(0,s.createElement)(Wc,{icon:Sd})))))}var Bd=e=>{let{isEnabled:t,blocks:n,icon:o,children:r}=e;const l={type:"inserter",blocks:n};return(0,s.createElement)(p.Draggable,{__experimentalTransferDataType:"wp-blocks",transferData:l,__experimentalDragComponent:(0,s.createElement)(wd,{count:n.length,icon:o})},(e=>{let{onDraggableStart:n,onDraggableEnd:o}=e;return r({draggable:t,onDragStart:t?n:void 0,onDragEnd:t?o:void 0})}))};function Id(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window;const{platform:t}=e.navigator;return-1!==t.indexOf("Mac")||["iPad","iPhone"].includes(t)}var xd=(0,s.memo)((function(e){let{className:t,isFirst:n,item:o,onSelect:l,onHover:a,isDraggable:u,...d}=e;const p=(0,s.useRef)(!1),m=o.icon?{backgroundColor:o.icon.background,color:o.icon.foreground}:{},f=(0,s.useMemo)((()=>[(0,r.createBlock)(o.name,o.initialAttributes,(0,r.createBlocksFromInnerBlocksTemplate)(o.innerBlocks))]),[o.name,o.initialAttributes,o.initialAttributes]);return(0,s.createElement)(Bd,{isEnabled:u&&!o.disabled,blocks:f,icon:o.icon},(e=>{let{draggable:r,onDragStart:u,onDragEnd:f}=e;return(0,s.createElement)("div",{className:"block-editor-block-types-list__list-item",draggable:r,onDragStart:e=>{p.current=!0,u&&(a(null),u(e))},onDragEnd:e=>{p.current=!1,f&&f(e)}},(0,s.createElement)(Cd,i({isFirst:n,className:c()("block-editor-block-types-list__item",t),disabled:o.isDisabled,onClick:e=>{e.preventDefault(),l(o,Id()?e.metaKey:e.ctrlKey),a(null)},onKeyDown:e=>{const{keyCode:t}=e;t===Tc.ENTER&&(e.preventDefault(),l(o,Id()?e.metaKey:e.ctrlKey),a(null))},onFocus:()=>{p.current||a(o)},onMouseEnter:()=>{p.current||a(o)},onMouseLeave:()=>a(null),onBlur:()=>a(null)},d),(0,s.createElement)("span",{className:"block-editor-block-types-list__item-icon",style:m},(0,s.createElement)(Wc,{icon:o.icon,showColors:!0})),(0,s.createElement)("span",{className:"block-editor-block-types-list__item-title"},o.title)))}))})),Td=(0,s.forwardRef)((function(e,t){const[n,o]=(0,s.useState)(!1);return(0,s.useEffect)((()=>{n&&(0,Ht.speak)((0,g.__)("Use left and right arrow keys to move through blocks"))}),[n]),(0,s.createElement)("div",i({ref:t,role:"listbox","aria-orientation":"horizontal",onFocus:()=>{o(!0)},onBlur:e=>{!e.currentTarget.contains(e.relatedTarget)&&o(!1)}},e))})),Nd=(0,s.forwardRef)((function(e,t){const n=(0,s.useContext)(Ed);return(0,s.createElement)(p.__unstableCompositeGroup,i({state:n,role:"presentation",ref:t},e))})),Pd=function(e){let{items:t=[],onSelect:n,onHover:o=(()=>{}),children:l,label:i,isDraggable:a=!0}=e;return(0,s.createElement)(Td,{className:"block-editor-block-types-list","aria-label":i},function(e,t){const n=[];for(let t=0,o=e.length;t<o;t+=3)n.push(e.slice(t,t+3));return n}(t).map(((e,t)=>(0,s.createElement)(Nd,{key:t},e.map(((e,l)=>(0,s.createElement)(xd,{key:e.id,item:e,className:(0,r.getBlockMenuDefaultClassName)(e.id),onSelect:n,onHover:o,isDraggable:a,isFirst:0===t&&0===l})))))),l)},Rd=function(e){let{title:t,icon:n,children:o}=e;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)("div",{className:"block-editor-inserter__panel-header"},(0,s.createElement)("h2",{className:"block-editor-inserter__panel-title"},t),(0,s.createElement)(p.Icon,{icon:n})),(0,s.createElement)("div",{className:"block-editor-inserter__panel-content"},o))},Md=(e,t)=>{const{categories:n,collections:o,items:l}=(0,m.useSelect)((t=>{const{getInserterItems:n}=t(Qn),{getCategories:o,getCollections:l}=t(r.store);return{categories:o(),collections:l(),items:n(e)}}),[e]);return[l,n,o,(0,s.useCallback)(((e,n)=>{let{name:o,initialAttributes:l,innerBlocks:i}=e;const s=(0,r.createBlock)(o,l,(0,r.createBlocksFromInnerBlocksTemplate)(i));t(s,void 0,n)}),[t])]},Ld=function(e){let{children:t}=e;const n=(0,p.__unstableUseCompositeState)({shift:!0,wrap:"horizontal"});return(0,s.createElement)(Ed.Provider,{value:n},t)};const Ad=[];var Dd=function(e){let{rootClientId:t,onInsert:n,onHover:o,showMostUsedBlocks:r}=e;const[l,i,a,c]=Md(t,n),p=(0,s.useMemo)((()=>(0,u.orderBy)(l,["frecency"],["desc"]).slice(0,6)),[l]),m=(0,s.useMemo)((()=>l.filter((e=>!e.category))),[l]),f=(0,s.useMemo)((()=>(0,u.flow)((e=>e.filter((e=>e.category&&"reusable"!==e.category))),(e=>(0,u.groupBy)(e,"category")))(l)),[l]),h=(0,s.useMemo)((()=>{const e={...a};return Object.keys(a).forEach((t=>{e[t]=l.filter((e=>(e=>e.name.split("/")[0])(e)===t)),0===e[t].length&&delete e[t]})),e}),[l,a]);(0,s.useEffect)((()=>()=>o(null)),[]);const v=(0,d.useAsyncList)(i),b=i.length===v.length,k=(0,s.useMemo)((()=>Object.entries(a)),[a]),_=(0,d.useAsyncList)(b?k:Ad);return(0,s.createElement)(Ld,null,(0,s.createElement)("div",null,r&&!!p.length&&(0,s.createElement)(Rd,{title:(0,g._x)("Most used","blocks")},(0,s.createElement)(Pd,{items:p,onSelect:c,onHover:o,label:(0,g._x)("Most used","blocks")})),(0,u.map)(v,(e=>{const t=f[e.slug];return t&&t.length?(0,s.createElement)(Rd,{key:e.slug,title:e.title,icon:e.icon},(0,s.createElement)(Pd,{items:t,onSelect:c,onHover:o,label:e.title})):null})),b&&m.length>0&&(0,s.createElement)(Rd,{className:"block-editor-inserter__uncategorized-blocks-panel",title:(0,g.__)("Uncategorized")},(0,s.createElement)(Pd,{items:m,onSelect:c,onHover:o,label:(0,g.__)("Uncategorized")})),(0,u.map)(_,(e=>{let[t,n]=e;const r=h[t];return r&&r.length?(0,s.createElement)(Rd,{key:t,title:n.title,icon:n.icon},(0,s.createElement)(Pd,{items:r,onSelect:c,onHover:o,label:n.title})):null}))))},Od=function(e){let{selectedCategory:t,patternCategories:n,onClickCategory:o,openPatternExplorer:r}=e;const l=(0,d.useViewportMatch)("medium","<"),i=c()("block-editor-inserter__panel-header","block-editor-inserter__panel-header-patterns");return(0,s.createElement)(p.Flex,{justify:"space-between",align:"start",gap:"4",className:i},(0,s.createElement)(p.FlexItem,{isBlock:!0},(0,s.createElement)(p.SelectControl,{className:"block-editor-inserter__panel-dropdown",label:(0,g.__)("Filter patterns"),hideLabelFromVision:!0,value:t.name,onChange:e=>{o(n.find((t=>e===t.name)))},onBlur:e=>{null!=e&&e.relatedTarget||e.stopPropagation()},options:(()=>{const e=[];return n.map((t=>e.push({value:t.name,label:t.label}))),e})()})),!l&&(0,s.createElement)(p.FlexItem,null,(0,s.createElement)(p.Button,{variant:"secondary",className:"block-editor-inserter__patterns-explorer-expand",label:(0,g.__)("Explore all patterns"),onClick:()=>r()},(0,g._x)("Explore","Label for showing all block patterns"))))},Fd=window.wp.notices,zd=(e,t)=>{const{patternCategories:n,patterns:o}=(0,m.useSelect)((e=>{const{__experimentalGetAllowedPatterns:n,getSettings:o}=e(Qn);return{patterns:n(t),patternCategories:o().__experimentalBlockPatternCategories}}),[t]),{createSuccessNotice:l}=(0,m.useDispatch)(Fd.store);return[o,n,(0,s.useCallback)(((t,n)=>{e((0,u.map)(n,(e=>(0,r.cloneBlock)(e))),t.name),l((0,g.sprintf)(
|
13 |
/* translators: %s: block pattern title. */
|
14 |
+
(0,g.__)('Block pattern "%s" inserted.'),t.title),{type:"snackbar"})}),[])]};function Vd(e){let{isDraggable:t,pattern:n,onClick:o,composite:r}=e;const{blocks:l,viewportWidth:a}=n,c=`block-editor-block-patterns-list__item-description-${(0,d.useInstanceId)(Vd)}`;return(0,s.createElement)(Bd,{isEnabled:t,blocks:l},(e=>{let{draggable:t,onDragStart:u,onDragEnd:d}=e;return(0,s.createElement)("div",{className:"block-editor-block-patterns-list__list-item","aria-label":n.title,"aria-describedby":n.description?c:void 0,draggable:t,onDragStart:u,onDragEnd:d},(0,s.createElement)(p.__unstableCompositeItem,i({role:"option",as:"div"},r,{className:"block-editor-block-patterns-list__item",onClick:()=>o(n,l)}),(0,s.createElement)(kd,{blocks:l,viewportWidth:a}),(0,s.createElement)("div",{className:"block-editor-block-patterns-list__item-title"},n.title),!!n.description&&(0,s.createElement)(p.VisuallyHidden,{id:c},n.description)))}))}function Hd(){return(0,s.createElement)("div",{className:"block-editor-block-patterns-list__item is-placeholder"})}var Gd=function(e){let{isDraggable:t,blockPatterns:n,shownPatterns:o,onClickPattern:r,orientation:l,label:a=(0,g.__)("Block Patterns")}=e;const c=(0,p.__unstableUseCompositeState)({orientation:l});return(0,s.createElement)(p.__unstableComposite,i({},c,{role:"listbox",className:"block-editor-block-patterns-list","aria-label":a}),n.map((e=>o.includes(e)?(0,s.createElement)(Vd,{key:e.name,pattern:e,onClick:r,isDraggable:t,composite:c}):(0,s.createElement)(Hd,{key:e.name}))))};function Ud(e){let{selectedCategory:t,patternCategories:n,onClickCategory:o}=e;const r="block-editor-block-patterns-explorer__sidebar";return(0,s.createElement)("div",{className:`${r}__categories-list`},n.map((e=>{let{name:n,label:l}=e;return(0,s.createElement)(p.Button,{key:n,label:l,className:`${r}__categories-list__item`,isPressed:t===n,onClick:()=>{o(n)}},l)})))}function Wd(e){let{filterValue:t,setFilterValue:n}=e;return(0,s.createElement)("div",{className:"block-editor-block-patterns-explorer__search"},(0,s.createElement)(p.SearchControl,{onChange:n,value:t,label:(0,g.__)("Search for patterns"),placeholder:(0,g.__)("Search")}))}var $d=function(e){let{selectedCategory:t,patternCategories:n,onClickCategory:o,filterValue:r,setFilterValue:l}=e;return(0,s.createElement)("div",{className:"block-editor-block-patterns-explorer__sidebar"},(0,s.createElement)(Wd,{filterValue:r,setFilterValue:l}),!r&&(0,s.createElement)(Ud,{selectedCategory:t,patternCategories:n,onClickCategory:o}))},jd=function(){return(0,s.createElement)("div",{className:"block-editor-inserter__no-results"},(0,s.createElement)(Ir,{className:"block-editor-inserter__no-results-icon",icon:Uc}),(0,s.createElement)("p",null,(0,g.__)("No results found.")))},Kd=function(e){let{rootClientId:t="",insertionIndex:n,clientId:o,isAppender:l,onSelect:i,shouldFocusBlock:a=!0}=e;const{getSelectedBlock:c}=(0,m.useSelect)(Qn),{destinationRootClientId:d,destinationIndex:p}=(0,m.useSelect)((e=>{const{getSelectedBlockClientId:r,getBlockRootClientId:i,getBlockIndex:s,getBlockOrder:a}=e(Qn),c=r();let u,d=t;return void 0!==n?u=n:o?u=s(o):!l&&c?(d=i(c),u=s(c)+1):u=a(d).length,{destinationRootClientId:d,destinationIndex:u}}),[t,n,o,l]),{replaceBlocks:f,insertBlocks:h,showInsertionPoint:v,hideInsertionPoint:b}=(0,m.useDispatch)(Qn),k=(0,s.useCallback)((function(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const o=c();!l&&o&&(0,r.isUnmodifiedDefaultBlock)(o)?f(o.clientId,e,null,a||n?0:null,t):h(e,p,d,!0,a||n?0:null,t);const s=(0,g.sprintf)(// translators: %d: the name of the block that has been added
|
15 |
+
(0,g._n)("%d block added.","%d blocks added.",(0,u.castArray)(e).length),(0,u.castArray)(e).length);(0,Ht.speak)(s),i&&i()}),[l,c,f,h,d,p,i,a]),_=(0,s.useCallback)((e=>{e?v(d,p):b()}),[v,b,d,p]);return[d,k,_]};const qd=e=>e.name||"",Yd=e=>e.title,Zd=e=>e.description||"",Qd=e=>e.keywords||[],Xd=e=>e.category,Jd=()=>null;function ep(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return e=(0,u.deburr)(e),e=e.replace(/^\//,""),e=e.toLowerCase(),e}const tp=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return(0,u.words)(ep(e))},np=(e,t)=>(0,u.differenceWith)(e,tp(t),((e,t)=>t.includes(e))),op=(e,t,n,o)=>0===tp(o).length?e:rp(e,o,{getCategory:e=>{var n;return null===(n=(0,u.find)(t,{slug:e.category}))||void 0===n?void 0:n.title},getCollection:e=>{var t;return null===(t=n[e.name.split("/")[0]])||void 0===t?void 0:t.title}}),rp=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const o=tp(t);if(0===o.length)return e;const r=e.map((e=>[e,lp(e,t,n)])).filter((e=>{let[,t]=e;return t>0}));return r.sort(((e,t)=>{let[,n]=e,[,o]=t;return o-n})),r.map((e=>{let[t]=e;return t}))};function lp(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{getName:o=qd,getTitle:r=Yd,getDescription:l=Zd,getKeywords:i=Qd,getCategory:s=Xd,getCollection:a=Jd}=n,c=o(e),d=r(e),p=l(e),m=i(e),f=s(e),g=a(e),h=ep(t),v=ep(d);let b=0;if(h===v)b+=30;else if(v.startsWith(h))b+=20;else{const e=[c,d,p,...m,f,g].join(" "),t=(0,u.words)(h);0===np(t,e).length&&(b+=10)}return 0!==b&&c.startsWith("core/")&&(b+=c!==e.id?1:2),b}function ip(e){let{filterValue:t,filteredBlockPatternsLength:n}=e;return t?(0,s.createElement)(p.__experimentalHeading,{level:2,lineHeight:"48px",className:"block-editor-block-patterns-explorer__search-results-count"},(0,g.sprintf)(
|
16 |
/* translators: %d: number of patterns. %s: block pattern search query */
|
17 |
+
(0,g._n)('%1$d pattern found for "%2$s"','%1$d patterns found for "%2$s"',n),n,t)):null}var sp=function(e){let{filterValue:t,selectedCategory:n,patternCategories:o}=e;const r=(0,d.useDebounce)(Ht.speak,500),[l,i]=Kd({shouldFocusBlock:!0}),[a,,c]=zd(i,l),u=(0,s.useMemo)((()=>o.map((e=>e.name))),[o]),p=(0,s.useMemo)((()=>t?rp(a,t):a.filter((e=>{var t,o;return"uncategorized"===n?!(null!==(t=e.categories)&&void 0!==t&&t.length)||e.categories.every((e=>!u.includes(e))):null===(o=e.categories)||void 0===o?void 0:o.includes(n)}))),[t,n,a]);(0,s.useEffect)((()=>{if(!t)return;const e=p.length,n=(0,g.sprintf)(
|
18 |
/* translators: %d: number of results. */
|
19 |
+
(0,g._n)("%d result found.","%d results found.",e),e);r(n)}),[t,r]);const m=(0,d.useAsyncList)(p,{step:2}),f=!(null==p||!p.length);return(0,s.createElement)("div",{className:"block-editor-block-patterns-explorer__list"},f&&(0,s.createElement)(ip,{filterValue:t,filteredBlockPatternsLength:p.length}),(0,s.createElement)(Ld,null,!f&&(0,s.createElement)(jd,null),f&&(0,s.createElement)(Gd,{shownPatterns:m,blockPatterns:p,onClickPattern:c,isDraggable:!1})))};function ap(e){let{initialCategory:t,patternCategories:n}=e;const[o,r]=(0,s.useState)(""),[l,i]=(0,s.useState)(null==t?void 0:t.name);return(0,s.createElement)("div",{className:"block-editor-block-patterns-explorer"},(0,s.createElement)($d,{selectedCategory:l,patternCategories:n,onClickCategory:i,filterValue:o,setFilterValue:r}),(0,s.createElement)(sp,{filterValue:o,selectedCategory:l,patternCategories:n}))}var cp=function(e){let{onModalClose:t,...n}=e;return(0,s.createElement)(p.Modal,{title:(0,g.__)("Patterns"),closeLabel:(0,g.__)("Close"),onRequestClose:t,isFullScreen:!0},(0,s.createElement)(ap,n))};function up(e){let{rootClientId:t,onInsert:n,selectedCategory:o,populatedCategories:r}=e;const[l,,i]=zd(n,t),a=(0,s.useCallback)((e=>{var t;if(null===(t=e.categories)||void 0===t||!t.length)return 1/0;const n=r.reduce(((e,t,n)=>{let{name:o}=t;return e[o]=n,e}),{});return Math.min(...e.categories.map((e=>void 0!==n[e]?n[e]:1/0)))}),[r]),c=(0,s.useMemo)((()=>l.filter((e=>{var t;return"uncategorized"===o.name?a(e)===1/0:null===(t=e.categories)||void 0===t?void 0:t.includes(o.name)}))),[l,o]),u=(0,s.useMemo)((()=>c.sort(((e,t)=>a(e)-a(t)))),[c,a]),p=(0,d.useAsyncList)(u);return c.length?(0,s.createElement)("div",{className:"block-editor-inserter__panel-content"},(0,s.createElement)(Gd,{shownPatterns:p,blockPatterns:c,onClickPattern:i,label:o.label,orientation:"vertical",isDraggable:!0})):null}var dp=function(e){let{rootClientId:t,onInsert:n,onClickCategory:o,selectedCategory:r}=e;const[l,i]=(0,s.useState)(!1),[a,c]=zd(),u=(0,s.useCallback)((e=>!(!e.categories||!e.categories.length)&&e.categories.some((e=>c.some((t=>t.name===e))))),[c]),d=(0,s.useMemo)((()=>{const e=c.filter((e=>a.some((t=>{var n;return null===(n=t.categories)||void 0===n?void 0:n.includes(e.name)})))).sort(((e,t)=>{let{name:n}=e,{name:o}=t;return[n,o].includes("featured")?"featured"===n?-1:1:0}));return a.some((e=>!u(e)))&&!e.find((e=>"uncategorized"===e.name))&&e.push({name:"uncategorized",label:(0,g._x)("Uncategorized")}),e}),[a,c]),p=r||d[0];return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Od,{selectedCategory:p,patternCategories:d,onClickCategory:o,openPatternExplorer:()=>i(!0)}),!l&&(0,s.createElement)(up,{rootClientId:t,onInsert:n,selectedCategory:p,populatedCategories:d}),l&&(0,s.createElement)(cp,{initialCategory:p,patternCategories:d,onModalClose:()=>i(!1)}))},pp=window.wp.url;function mp(e){let{onHover:t,onInsert:n,rootClientId:o}=e;const[r,,,l]=Md(o,n),i=(0,s.useMemo)((()=>r.filter((e=>{let{category:t}=e;return"reusable"===t}))),[r]);return 0===i.length?(0,s.createElement)(jd,null):(0,s.createElement)(Rd,{title:(0,g.__)("Reusable blocks")},(0,s.createElement)(Pd,{items:i,onSelect:l,onHover:t,label:(0,g.__)("Reusable blocks")}))}var fp=function(e){let{rootClientId:t,onInsert:n,onHover:o}=e;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(mp,{onHover:o,onInsert:n,rootClientId:t}),(0,s.createElement)("div",{className:"block-editor-inserter__manage-reusable-blocks-container"},(0,s.createElement)("a",{className:"block-editor-inserter__manage-reusable-blocks",href:(0,pp.addQueryArgs)("edit.php",{post_type:"wp_block"})},(0,g.__)("Manage Reusable blocks"))))};const{Fill:gp,Slot:hp}=(0,p.createSlotFill)("__unstableInserterMenuExtension");gp.Slot=hp;var vp=gp;const bp=[];var kp=function(e){let{filterValue:t,onSelect:n,onHover:o,rootClientId:r,clientId:l,isAppender:i,__experimentalInsertionIndex:a,maxBlockPatterns:c,maxBlockTypes:m,showBlockDirectory:f=!1,isDraggable:h=!0,shouldFocusBlock:v=!0,prioritizePatterns:b}=e;const k=(0,d.useDebounce)(Ht.speak,500),[_,y]=Kd({onSelect:n,rootClientId:r,clientId:l,isAppender:i,insertionIndex:a,shouldFocusBlock:v}),[E,C,S,w]=Md(_,y),[B,,I]=zd(y,_),x=(0,s.useMemo)((()=>{if(0===c)return[];const e=rp(B,t);return void 0!==c?e.slice(0,c):e}),[t,B,c]);let T=m;b&&x.length>2&&(T=0);const N=(0,s.useMemo)((()=>{if(0===T)return[];const e=op((0,u.orderBy)(E,["frecency"],["desc"]),C,S,t);return void 0!==T?e.slice(0,T):e}),[t,E,C,S,m]);(0,s.useEffect)((()=>{if(!t)return;const e=N.length+x.length,n=(0,g.sprintf)(
|
20 |
/* translators: %d: number of results. */
|
21 |
+
(0,g._n)("%d result found.","%d results found.",e),e);k(n)}),[t,k]);const P=(0,d.useAsyncList)(N,{step:9}),R=(0,d.useAsyncList)(P.length===N.length?x:bp),M=!(0,u.isEmpty)(N)||!(0,u.isEmpty)(x),L=!!N.length&&(0,s.createElement)(Rd,{title:(0,s.createElement)(p.VisuallyHidden,null,(0,g.__)("Blocks"))},(0,s.createElement)(Pd,{items:P,onSelect:w,onHover:o,label:(0,g.__)("Blocks"),isDraggable:h})),A=!!x.length&&(0,s.createElement)(Rd,{title:(0,s.createElement)(p.VisuallyHidden,null,(0,g.__)("Block Patterns"))},(0,s.createElement)("div",{className:"block-editor-inserter__quick-inserter-patterns"},(0,s.createElement)(Gd,{shownPatterns:R,blockPatterns:x,onClickPattern:I,isDraggable:h})));return(0,s.createElement)(Ld,null,!f&&!M&&(0,s.createElement)(jd,null),b?A:L,!!N.length&&!!x.length&&(0,s.createElement)("div",{className:"block-editor-inserter__quick-inserter-separator"}),b?L:A,f&&(0,s.createElement)(vp.Slot,{fillProps:{onSelect:w,onHover:o,filterValue:t,hasItems:M,rootClientId:_}},(e=>e.length?e:M?null:(0,s.createElement)(jd,null))))};const _p={name:"blocks",
|
22 |
/* translators: Blocks tab title in the block inserter. */
|
23 |
+
title:(0,g.__)("Blocks")},yp={name:"patterns",
|
24 |
/* translators: Patterns tab title in the block inserter. */
|
25 |
+
title:(0,g.__)("Patterns")},Ep={name:"reusable",
|
26 |
/* translators: Reusable blocks tab title in the block inserter. */
|
27 |
+
title:(0,g.__)("Reusable")};var Cp=function(e){let{children:t,showPatterns:n=!1,showReusableBlocks:o=!1,onSelect:r}=e;const l=(0,s.useMemo)((()=>{const e=[_p];return n&&e.push(yp),o&&e.push(Ep),e}),[_p,n,yp,o,Ep]);return(0,s.createElement)(p.TabPanel,{className:"block-editor-inserter__tabs",tabs:l,onSelect:r},t)},Sp=(0,s.forwardRef)((function(e,t){let{rootClientId:n,clientId:o,isAppender:r,__experimentalInsertionIndex:l,onSelect:i,showInserterHelpPanel:a,showMostUsedBlocks:c,__experimentalFilterValue:u="",shouldFocusBlock:d=!0}=e;const[f,h]=(0,s.useState)(u),[v,b]=(0,s.useState)(null),[k,_]=(0,s.useState)(null),[y,E,C]=Kd({rootClientId:n,clientId:o,isAppender:r,insertionIndex:l,shouldFocusBlock:d}),{showPatterns:S,hasReusableBlocks:w}=(0,m.useSelect)((e=>{var t;const{__experimentalGetAllowedPatterns:n,getSettings:o}=e(Qn);return{showPatterns:!!n(y).length,hasReusableBlocks:!(null===(t=o().__experimentalReusableBlocks)||void 0===t||!t.length)}}),[y]),B=(0,s.useCallback)(((e,t,n)=>{E(e,t,n),i()}),[E,i]),I=(0,s.useCallback)(((e,t)=>{E(e,{patternName:t}),i()}),[E,i]),x=(0,s.useCallback)((e=>{C(!!e),b(e)}),[C,b]),T=(0,s.useCallback)((e=>{_(e)}),[_]),N=(0,s.useMemo)((()=>(0,s.createElement)(s.Fragment,null,(0,s.createElement)("div",{className:"block-editor-inserter__block-list"},(0,s.createElement)(Dd,{rootClientId:y,onInsert:B,onHover:x,showMostUsedBlocks:c})),a&&(0,s.createElement)("div",{className:"block-editor-inserter__tips"},(0,s.createElement)(p.VisuallyHidden,{as:"h2"},(0,g.__)("A tip for using the block editor")),(0,s.createElement)(Gc,null)))),[y,B,x,f,c,a]),P=(0,s.useMemo)((()=>(0,s.createElement)(dp,{rootClientId:y,onInsert:I,onClickCategory:T,selectedCategory:k})),[y,I,T,k]),R=(0,s.useMemo)((()=>(0,s.createElement)(fp,{rootClientId:y,onInsert:B,onHover:x})),[y,B,x]),M=(0,s.useCallback)((e=>"blocks"===e.name?N:"patterns"===e.name?P:R),[N,P,R]),L=(0,s.useRef)();return(0,s.useImperativeHandle)(t,(()=>({focusSearch:()=>{L.current.focus()}}))),(0,s.createElement)("div",{className:"block-editor-inserter__menu"},(0,s.createElement)("div",{className:"block-editor-inserter__main-area"},(0,s.createElement)("div",{className:"block-editor-inserter__content"},(0,s.createElement)(p.SearchControl,{className:"block-editor-inserter__search",onChange:e=>{v&&b(null),h(e)},value:f,label:(0,g.__)("Search for blocks and patterns"),placeholder:(0,g.__)("Search"),ref:L}),!!f&&(0,s.createElement)(kp,{filterValue:f,onSelect:i,onHover:x,rootClientId:n,clientId:o,isAppender:r,__experimentalInsertionIndex:l,showBlockDirectory:!0,shouldFocusBlock:d}),!f&&(S||w)&&(0,s.createElement)(Cp,{showPatterns:S,showReusableBlocks:w},M),!f&&!S&&!w&&N)),a&&v&&(0,s.createElement)(yd,{item:v}))}));function wp(e){let{onSelect:t,rootClientId:n,clientId:o,isAppender:r,prioritizePatterns:l}=e;const[i,a]=(0,s.useState)(""),[u,d]=Kd({onSelect:t,rootClientId:n,clientId:o,isAppender:r}),[f]=Md(u,d),[h]=zd(d,u),{setInserterIsOpened:v,insertionIndex:b}=(0,m.useSelect)((e=>{const{getSettings:t,getBlockIndex:n,getBlockCount:r}=e(Qn),l=t(),i=n(o),s=r();return{setInserterIsOpened:l.__experimentalSetIsInserterOpened,insertionIndex:-1===i?s:i}}),[o]),k=h.length&&(!!i||l),_=k&&h.length>6||f.length>6;(0,s.useEffect)((()=>{v&&v(!1)}),[v]);let y=0;return k&&(y=l?4:2),(0,s.createElement)("div",{className:c()("block-editor-inserter__quick-inserter",{"has-search":_,"has-expand":v})},_&&(0,s.createElement)(p.SearchControl,{className:"block-editor-inserter__search",value:i,onChange:e=>{a(e)},label:(0,g.__)("Search for blocks and patterns"),placeholder:(0,g.__)("Search")}),(0,s.createElement)("div",{className:"block-editor-inserter__quick-inserter-results"},(0,s.createElement)(kp,{filterValue:i,onSelect:t,rootClientId:n,clientId:o,isAppender:r,maxBlockPatterns:y,maxBlockTypes:6,isDraggable:!1,prioritizePatterns:l})),v&&(0,s.createElement)(p.Button,{className:"block-editor-inserter__quick-inserter-expand",onClick:()=>{v({rootClientId:n,insertionIndex:b,filterValue:i})},"aria-label":(0,g.__)("Browse all. This will open the main inserter panel in the editor toolbar.")},(0,g.__)("Browse all")))}const Bp=e=>{let t,{onToggle:n,disabled:o,isOpen:r,blockTitle:l,hasSingleBlockType:a,toggleProps:c={},prioritizePatterns:u}=e;t=a?(0,g.sprintf)(// translators: %s: the name of the block when there is only one
|
28 |
+
(0,g._x)("Add %s","directly add the only allowed block"),l):u?(0,g.__)("Add pattern"):(0,g._x)("Add block","Generic label for block inserter button");const{onClick:d,...m}=c;return(0,s.createElement)(p.Button,i({icon:Vc,label:t,tooltipPosition:"bottom",onClick:function(e){n&&n(e),d&&d(e)},className:"block-editor-inserter__toggle","aria-haspopup":!a&&"true","aria-expanded":!a&&r,disabled:o},m))};class Ip extends s.Component{constructor(){super(...arguments),this.onToggle=this.onToggle.bind(this),this.renderToggle=this.renderToggle.bind(this),this.renderContent=this.renderContent.bind(this)}onToggle(e){const{onToggle:t}=this.props;t&&t(e)}renderToggle(e){let{onToggle:t,isOpen:n}=e;const{disabled:o,blockTitle:r,hasSingleBlockType:l,directInsertBlock:i,toggleProps:s,hasItems:a,renderToggle:c=Bp,prioritizePatterns:u}=this.props;return c({onToggle:t,isOpen:n,disabled:o||!a,blockTitle:r,hasSingleBlockType:l,directInsertBlock:i,toggleProps:s,prioritizePatterns:u})}renderContent(e){let{onClose:t}=e;const{rootClientId:n,clientId:o,isAppender:r,showInserterHelpPanel:l,__experimentalIsQuick:i,prioritizePatterns:a}=this.props;return i?(0,s.createElement)(wp,{onSelect:()=>{t()},rootClientId:n,clientId:o,isAppender:r,prioritizePatterns:a}):(0,s.createElement)(Sp,{onSelect:()=>{t()},rootClientId:n,clientId:o,isAppender:r,showInserterHelpPanel:l})}render(){const{position:e,hasSingleBlockType:t,directInsertBlock:n,insertOnlyAllowedBlock:o,__experimentalIsQuick:r,onSelectOrClose:l}=this.props;return t||n?this.renderToggle({onToggle:o}):(0,s.createElement)(p.Dropdown,{className:"block-editor-inserter",contentClassName:c()("block-editor-inserter__popover",{"is-quick":r}),position:e,onToggle:this.onToggle,expandOnMobile:!0,headerTitle:(0,g.__)("Add a block"),renderToggle:this.renderToggle,renderContent:this.renderContent,onClose:l})}}var xp=(0,d.compose)([(0,m.withSelect)(((e,t)=>{let{clientId:n,rootClientId:o}=t;const{getBlockRootClientId:l,hasInserterItems:i,__experimentalGetAllowedBlocks:s,__experimentalGetDirectInsertBlock:a,getBlockIndex:c,getBlockCount:d,getSettings:p}=e(Qn),{getBlockVariations:m}=e(r.store);o=o||l(n)||void 0;const f=s(o),g=a(o),h=c(n),v=d(),b=p(),k=1===(0,u.size)(f)&&0===(0,u.size)(m(f[0].name,"inserter"));let _=!1;return k&&(_=f[0]),{hasItems:i(o),hasSingleBlockType:k,blockTitle:_?_.title:"",allowedBlockType:_,directInsertBlock:g,rootClientId:o,prioritizePatterns:b.__experimentalPreferPatternsOnRoot&&!o&&h>0&&(h<v||0===v)}})),(0,m.withDispatch)(((e,t,n)=>{let{select:o}=n;return{insertOnlyAllowedBlock(){const{rootClientId:n,clientId:l,isAppender:i,hasSingleBlockType:s,allowedBlockType:a,directInsertBlock:c,onSelectOrClose:u}=t;if(!s&&!c)return;const{insertBlock:d}=e(Qn);let p;if(c){const e=function(e){const{getBlock:t,getPreviousBlockClientId:r}=o(Qn);if(!e||!l&&!n)return{};const i={};let s={};if(l){const e=t(l),n=t(r(l));(null==e?void 0:e.name)===(null==n?void 0:n.name)&&(s=(null==n?void 0:n.attributes)||{})}else{var a;const e=t(n);if(null!=e&&null!==(a=e.innerBlocks)&&void 0!==a&&a.length){const t=e.innerBlocks[e.innerBlocks.length-1];c&&(null==c?void 0:c.name)===t.name&&(s=t.attributes)}}return e.forEach((e=>{s.hasOwnProperty(e)&&(i[e]=s[e])})),i}(c.attributesToCopy);p=(0,r.createBlock)(c.name,{...c.attributes||{},...e})}else p=(0,r.createBlock)(a.name);d(p,function(){const{getBlockIndex:e,getBlockSelectionEnd:t,getBlockOrder:r,getBlockRootClientId:s}=o(Qn);if(l)return e(l);const a=t();return!i&&a&&s(a)===n?e(a)+1:r(n).length}(),n),u&&u();const m=(0,g.sprintf)(// translators: %s: the name of the block that has been added
|
29 |
+
(0,g.__)("%s block added"),a.title);(0,Ht.speak)(m)}}})),(0,d.ifCondition)((e=>{let{hasItems:t,isAppender:n,rootClientId:o,clientId:r}=e;return t||!n&&!o&&!r}))])(Ip),Tp=(0,d.compose)((0,m.withSelect)(((e,t)=>{const{getBlockCount:n,getSettings:o,getTemplateLock:r}=e(Qn),l=!n(t.rootClientId),{bodyPlaceholder:i}=o();return{showPrompt:l,isLocked:!!r(t.rootClientId),placeholder:i}})),(0,m.withDispatch)(((e,t)=>{const{insertDefaultBlock:n,startTyping:o}=e(Qn);return{onAppend(){const{rootClientId:e}=t;n(void 0,e),o()}}})))((function(e){let{isLocked:t,onAppend:n,showPrompt:o,placeholder:r,rootClientId:l}=e;if(t)return null;const i=(0,zc.decodeEntities)(r)||(0,g.__)("Type / to choose a block");return(0,s.createElement)("div",{"data-root-client-id":l||"",className:c()("block-editor-default-block-appender",{"has-visible-prompt":o})},(0,s.createElement)("p",{tabIndex:"0",role:"button","aria-label":(0,g.__)("Add default block"),className:"block-editor-default-block-appender__content",onKeyDown:e=>{Tc.ENTER!==e.keyCode&&Tc.SPACE!==e.keyCode||n()},onClick:()=>n(),onFocus:()=>{o&&n()}},o?i:"\ufeff"),(0,s.createElement)(xp,{rootClientId:l,position:"bottom right",isAppender:!0,__experimentalIsQuick:!0}))}));function Np(e,t){let{rootClientId:n,className:o,onFocus:r,tabIndex:l}=e;return(0,s.createElement)(xp,{position:"bottom center",rootClientId:n,__experimentalIsQuick:!0,renderToggle:e=>{let n,{onToggle:i,disabled:a,isOpen:u,blockTitle:d,hasSingleBlockType:m}=e;n=m?(0,g.sprintf)(// translators: %s: the name of the block when there is only one
|
30 |
+
(0,g._x)("Add %s","directly add the only allowed block"),d):(0,g._x)("Add block","Generic label for block inserter button");const f=!m;let h=(0,s.createElement)(p.Button,{ref:t,onFocus:r,tabIndex:l,className:c()(o,"block-editor-button-block-appender"),onClick:i,"aria-haspopup":f?"true":void 0,"aria-expanded":f?u:void 0,disabled:a,label:n},!m&&(0,s.createElement)(p.VisuallyHidden,{as:"span"},n),(0,s.createElement)(Ir,{icon:Vc}));return(f||m)&&(h=(0,s.createElement)(p.Tooltip,{text:n},h)),h},isAppender:!0})}const Pp=(0,s.forwardRef)(((e,t)=>(z()("wp.blockEditor.ButtonBlockerAppender",{alternative:"wp.blockEditor.ButtonBlockAppender",since:"5.9"}),Np(e,t))));var Rp=(0,s.forwardRef)(Np),Mp=(0,m.withSelect)(((e,t)=>{let{rootClientId:n}=t;const{canInsertBlockType:o,getTemplateLock:l,getSelectedBlockClientId:i}=e(Qn);return{isLocked:!!l(n),canInsertDefaultBlock:o((0,r.getDefaultBlockName)(),n),selectedBlockClientId:i()}}))((function(e){let t,{rootClientId:n,canInsertDefaultBlock:o,isLocked:r,renderAppender:l,className:i,selectedBlockClientId:a,tagName:u="div"}=e;if(r||!1===l)return null;if(l)t=(0,s.createElement)(l,null);else{if(a!==n&&(n||a))return null;t=o?(0,s.createElement)(Tp,{rootClientId:n}):(0,s.createElement)(Rp,{rootClientId:n,className:"block-list-appender__toggle"})}return(0,s.createElement)(u,{tabIndex:-1,className:c()("block-list-appender wp-block",i),contentEditable:!1,"data-block":!0},t)}));(0,s.createContext)();var Lp=function(e){let{previousClientId:t,nextClientId:n,children:o,__unstablePopoverSlot:r,__unstableContentRef:l,...a}=e;const{orientation:u,rootClientId:d,isVisible:f}=(0,m.useSelect)((e=>{var o;const{getBlockListSettings:r,getBlockRootClientId:l,isBlockVisible:i}=e(Qn),s=l(t);return{orientation:(null===(o=r(s))||void 0===o?void 0:o.orientation)||"vertical",rootClientId:s,isVisible:i(t)&&i(n)}}),[t]),h=_o(t),v=_o(n),b="vertical"===u,k=(0,s.useMemo)((()=>{if(!h&&!v||!f)return{};const e=h?h.getBoundingClientRect():null,t=v?v.getBoundingClientRect():null;if(b)return{width:h?h.offsetWidth:v.offsetWidth,height:t&&e?t.top-e.bottom:0};let n=0;return e&&t&&(n=(0,g.isRTL)()?e.left-t.right:t.left-e.right),{width:n,height:h?h.offsetHeight:v.offsetHeight}}),[h,v,b]),_=(0,s.useCallback)((()=>{if(!h&&!v||!f)return{};const{ownerDocument:e}=h||v,t=h?h.getBoundingClientRect():null,n=v?v.getBoundingClientRect():null;return b?(0,g.isRTL)()?{top:t?t.bottom:n.top,left:t?t.right:n.right,right:t?t.left:n.left,bottom:n?n.top:t.bottom,height:0,width:0,ownerDocument:e}:{top:t?t.bottom:n.top,left:t?t.left:n.left,right:t?t.right:n.right,bottom:n?n.top:t.bottom,height:0,width:0,ownerDocument:e}:(0,g.isRTL)()?{top:t?t.top:n.top,left:t?t.left:n.right,right:n?n.right:t.left,bottom:t?t.bottom:n.bottom,height:0,width:0,ownerDocument:e}:{top:t?t.top:n.top,left:t?t.right:n.left,right:n?n.left:t.right,bottom:t?t.bottom:n.bottom,height:0,width:0,ownerDocument:e}}),[h,v]),y=zo(l);return h&&v&&f?(0,s.createElement)(p.Popover,i({ref:y,animate:!1,getAnchorRect:_,focusOnMount:!1,__unstableSlotName:r||null,key:n+"--"+d},a,{className:c()("block-editor-block-popover",a.className),__unstableForcePosition:!0}),(0,s.createElement)("div",{style:k},o)):null};const Ap=(0,s.createContext)();function Dp(e){let{__unstablePopoverSlot:t,__unstableContentRef:n}=e;const{selectBlock:o,hideInsertionPoint:r}=(0,m.useDispatch)(Qn),l=(0,s.useContext)(Ap),i=(0,s.useRef)(),{orientation:a,previousClientId:u,nextClientId:f,rootClientId:g,isInserterShown:h}=(0,m.useSelect)((e=>{var t;const{getBlockOrder:n,getBlockListSettings:o,getBlockInsertionPoint:r,isBlockBeingDragged:l,getPreviousBlockClientId:i,getNextBlockClientId:s}=e(Qn),a=r(),c=n(a.rootClientId);if(!c.length)return{};let u=c[a.index-1],d=c[a.index];for(;l(u);)u=i(u);for(;l(d);)d=s(d);return{previousClientId:u,nextClientId:d,orientation:(null===(t=o(a.rootClientId))||void 0===t?void 0:t.orientation)||"vertical",rootClientId:a.rootClientId,isInserterShown:null==a?void 0:a.__unstableWithInserter}}),[]),v="vertical"===a,b=(0,d.useReducedMotion)(),k={start:{...v?{height:0,left:"50%",right:"50%",y:0}:{width:0,top:"50%",bottom:"50%",x:0},opacity:0},rest:{...v?{height:4,left:0,right:0,y:-2}:{width:4,top:0,bottom:0,x:-2},opacity:1,borderRadius:"2px",transition:{delay:h?.4:0}},hover:{...v?{height:4,left:0,right:0,y:-2}:{width:4,top:0,bottom:0,x:-2},opacity:1,borderRadius:"2px",transition:{delay:.4}}},_={start:{scale:b?1:0},rest:{scale:1,transition:{delay:.2}}},y=c()("block-editor-block-list__insertion-point","is-"+a);return(0,s.createElement)(Lp,{previousClientId:u,nextClientId:f,__unstablePopoverSlot:t,__unstableContentRef:n},(0,s.createElement)(p.__unstableMotion.div,{layout:!b,initial:b?"rest":"start",animate:"rest",whileHover:"hover",whileTap:"pressed",exit:"start",ref:i,tabIndex:-1,onClick:function(e){e.target===i.current&&f&&o(f,-1)},onFocus:function(e){e.target!==i.current&&(l.current=!0)},className:c()(y,{"is-with-inserter":h}),onHoverEnd:function(e){e.target!==i.current||l.current||r()}},(0,s.createElement)(p.__unstableMotion.div,{variants:k,className:"block-editor-block-list__insertion-point-indicator"}),h&&(0,s.createElement)(p.__unstableMotion.div,{variants:_,className:c()("block-editor-block-list__insertion-point-inserter")},(0,s.createElement)(xp,{position:"bottom center",clientId:f,rootClientId:g,__experimentalIsQuick:!0,onToggle:e=>{l.current=e},onSelectOrClose:()=>{l.current=!1}}))))}function Op(e){let{children:t,...n}=e;const o=(0,m.useSelect)((e=>e(Qn).isBlockInsertionPointVisible()),[]);return(0,s.createElement)(Ap.Provider,{value:(0,s.useRef)(!1)},o&&(0,s.createElement)(Dp,n),t)}function Fp(){const e=(0,s.useContext)(Ap),t=(0,m.useSelect)((e=>e(Qn).getSettings().hasReducedUI),[]),{getBlockListSettings:n,getBlockRootClientId:o,getBlockIndex:r,isBlockInsertionPointVisible:l,isMultiSelecting:i,getSelectedBlockClientIds:a,getTemplateLock:c}=(0,m.useSelect)(Qn),{showInsertionPoint:u,hideInsertionPoint:p}=(0,m.useDispatch)(Qn);return(0,d.useRefEffect)((o=>{if(!t)return o.addEventListener("mousemove",s),()=>{o.removeEventListener("mousemove",s)};function s(t){var o,s;if(e.current)return;if(i())return;if(!t.target.classList.contains("block-editor-block-list__layout"))return void(l()&&p());let d;if(t.target.classList.contains("is-root-container")||(d=(t.target.getAttribute("data-block")?t.target:t.target.closest("[data-block]")).getAttribute("data-block")),c(d))return;const m=(null===(o=n(d))||void 0===o?void 0:o.orientation)||"vertical",f=t.target.getBoundingClientRect(),g=t.clientY-f.top,h=t.clientX-f.left;let v=Array.from(t.target.children).find((e=>e.classList.contains("wp-block")&&"vertical"===m&&e.offsetTop>g||e.classList.contains("wp-block")&&"horizontal"===m&&e.offsetLeft>h));if(!v)return;if(!v.id&&(v=v.firstElementChild,!v))return;if(null===(s=v.parentElement)||void 0===s?void 0:s.closest(".block-editor-block-content-overlay"))return;const b=v.id.slice("block-".length);if(!b)return;if(a().includes(b))return;const k=v.getBoundingClientRect();if("horizontal"===m&&(t.clientY>k.bottom||t.clientY<k.top)||"vertical"===m&&(t.clientX>k.right||t.clientX<k.left))return void(l()&&p());const _=r(b);0!==_?u(d,_,{__unstableWithInserter:!0}):l()&&p()}}),[e,n,o,r,l,i,u,p,a])}const zp="undefined"==typeof window?e=>{setTimeout((()=>e(Date.now())),0)}:window.requestIdleCallback||window.requestAnimationFrame,Vp="undefined"==typeof window?clearTimeout:window.cancelIdleCallback||window.cancelAnimationFrame;function Hp(e){return(0,m.useSelect)((t=>{if(!e)return null;const{getBlockName:n,getBlockAttributes:o}=t(Qn),{getBlockType:l,getActiveBlockVariation:i}=t(r.store),s=n(e),a=l(s);if(!a)return null;const c=o(e),u=i(s,c),d={title:a.title,icon:a.icon,description:a.description,anchor:null==c?void 0:c.anchor};return u?{title:u.title||a.title,icon:u.icon||a.icon,description:u.description||a.description,anchor:null==c?void 0:c.anchor}:d}),[e])}function Gp(e,t){const{attributes:n,name:o,reusableBlockTitle:l}=(0,m.useSelect)((t=>{if(!e)return{};const{getBlockName:n,getBlockAttributes:o,__experimentalGetReusableBlockTitle:l}=t(Qn),i=n(e);if(!i)return{};const s=(0,r.isReusableBlock)((0,r.getBlockType)(i));return{attributes:o(e),name:i,reusableBlockTitle:s&&l(o(e).ref)}}),[e]),i=Hp(e);if(!o||!i)return null;const s=(0,r.getBlockType)(o),a=s?(0,r.__experimentalGetBlockLabel)(s,n):null,c=l||a,d=c&&c!==s.title?c:i.title;return t&&t>0?(0,u.truncate)(d,{length:t}):d}function Up(e){let{clientId:t,maximumLength:n}=e;return Gp(t,n)}var Wp=e=>{let{children:t,clientIds:n,cloneClassname:o,onDragStart:l,onDragEnd:i}=e;const{srcRootClientId:a,isDraggable:c,icon:u}=(0,m.useSelect)((e=>{var t;const{canMoveBlocks:o,getBlockRootClientId:l,getBlockName:i}=e(Qn),s=l(n[0]),a=i(n[0]);return{srcRootClientId:s,isDraggable:o(n,s),icon:null===(t=(0,r.getBlockType)(a))||void 0===t?void 0:t.icon}}),[n]),d=(0,s.useRef)(!1),[f,g,h]=function(){const e=(0,s.useRef)(null),t=(0,s.useRef)(null),n=(0,s.useRef)(null),o=(0,s.useRef)(null);return(0,s.useEffect)((()=>()=>{o.current&&(clearInterval(o.current),o.current=null)}),[]),[(0,s.useCallback)((r=>{e.current=r.clientY,n.current=(0,ul.getScrollContainer)(r.target),o.current=setInterval((()=>{if(n.current&&t.current){const e=n.current.scrollTop+t.current;n.current.scroll({top:e})}}),25)}),[]),(0,s.useCallback)((o=>{if(!n.current)return;const r=n.current.offsetHeight,l=e.current-n.current.offsetTop,i=o.clientY-n.current.offsetTop;if(o.clientY>l){const e=Math.max(r-l-50,0),n=Math.max(i-l-50,0)/e;t.current=25*n}else if(o.clientY<l){const e=Math.max(l-50,0),n=Math.max(l-i-50,0)/e;t.current=-25*n}else t.current=0}),[]),()=>{e.current=null,n.current=null,o.current&&(clearInterval(o.current),o.current=null)}]}(),{startDraggingBlocks:v,stopDraggingBlocks:b}=(0,m.useDispatch)(Qn);if((0,s.useEffect)((()=>()=>{d.current&&b()}),[]),!c)return t({isDraggable:!1});const k={type:"block",srcClientIds:n,srcRootClientId:a};return(0,s.createElement)(p.Draggable,{cloneClassname:o,__experimentalTransferDataType:"wp-blocks",transferData:k,onDragStart:e=>{v(n),d.current=!0,f(e),l&&l()},onDragOver:g,onDragEnd:()=>{b(),d.current=!1,h(),i&&i()},__experimentalDragComponent:(0,s.createElement)(wd,{count:n.length,icon:u})},(e=>{let{onDraggableStart:n,onDraggableEnd:o}=e;return t({draggable:!0,onDragStart:n,onDragEnd:o})}))},$p=function(e){let{clientId:t,rootClientId:n}=e;const o=Hp(t),l=(0,m.useSelect)((e=>{var o;const{getBlock:r,getBlockIndex:l,hasBlockMovingClientId:i,getBlockListSettings:s}=e(Qn),a=l(t),{name:c,attributes:u}=r(t);return{index:a,name:c,attributes:u,blockMovingMode:i(),orientation:null===(o=s(n))||void 0===o?void 0:o.orientation}}),[t,n]),{index:a,name:u,attributes:d,blockMovingMode:f,orientation:h}=l,{setNavigationMode:v,removeBlock:b}=(0,m.useDispatch)(Qn),k=(0,s.useRef)(),_=(0,r.getBlockType)(u),y=(0,r.__experimentalGetAccessibleBlockLabel)(_,d,a+1,h);(0,s.useEffect)((()=>{k.current.focus(),(0,Ht.speak)(y)}),[y]);const E=_o(t),{hasBlockMovingClientId:C,getBlockIndex:S,getBlockRootClientId:w,getClientIdsOfDescendants:B,getSelectedBlockClientId:I,getMultiSelectedBlocksEndClientId:x,getPreviousBlockClientId:T,getNextBlockClientId:N,isNavigationMode:P}=(0,m.useSelect)(Qn),{selectBlock:R,clearSelectedBlock:M,setBlockMovingClientId:L,moveBlockToPosition:A}=(0,m.useDispatch)(Qn),D=c()("block-editor-block-list__block-selection-button",{"is-block-moving-mode":!!f}),O=(0,g.__)("Drag");return(0,s.createElement)("div",{className:D},(0,s.createElement)(p.Flex,{justify:"center",className:"block-editor-block-list__block-selection-button__content"},(0,s.createElement)(p.FlexItem,null,(0,s.createElement)(Wc,{icon:null==o?void 0:o.icon,showColors:!0})),(0,s.createElement)(p.FlexItem,null,(0,s.createElement)(Wp,{clientIds:[t]},(e=>(0,s.createElement)(p.Button,i({icon:Sd,className:"block-selection-button_drag-handle","aria-hidden":"true",label:O,tabIndex:"-1"},e))))),(0,s.createElement)(p.FlexItem,null,(0,s.createElement)(p.Button,{ref:k,onClick:()=>v(!1),onKeyDown:function(e){const{keyCode:n}=e,o=n===Tc.UP,r=n===Tc.DOWN,l=n===Tc.LEFT,i=n===Tc.RIGHT,s=n===Tc.TAB,a=n===Tc.ESCAPE,c=n===Tc.ENTER,u=n===Tc.SPACE,d=e.shiftKey;if(n===Tc.BACKSPACE||n===Tc.DELETE)return b(t),void e.preventDefault();const p=I(),m=x(),f=T(m||p),g=N(m||p),h=s&&d||o,v=s&&!d||r,k=l,_=i;let y;if(h)y=f;else if(v)y=g;else if(k){var D;y=null!==(D=w(p))&&void 0!==D?D:p}else if(_){var O;y=null!==(O=B([p])[0])&&void 0!==O?O:p}const F=C();if(a&&P()&&(M(),e.preventDefault()),a&&F&&!e.defaultPrevented&&(L(null),e.preventDefault()),(c||u)&&F){const e=w(F),t=w(p),n=S(F);let o=S(p);n<o&&e===t&&(o-=1),A(F,e,t,o),R(F),L(null)}if(v||h||k||_)if(y)e.preventDefault(),R(y);else if(s&&p){let t;if(v){t=E;do{t=ul.focus.tabbable.findNext(t)}while(t&&E.contains(t));t||(t=E.ownerDocument.defaultView.frameElement,t=ul.focus.tabbable.findNext(t))}else t=ul.focus.tabbable.findPrevious(E);t&&(e.preventDefault(),t.focus(),M())}},label:y,showTooltip:!1,className:"block-selection-button_select-button"},(0,s.createElement)(Up,{clientId:t,maximumLength:35})))))};function jp(e){return Array.from(e.querySelectorAll("[data-toolbar-item]"))}var Kp=function(e){let{children:t,focusOnMount:n,__experimentalInitialIndex:o,__experimentalOnIndexChange:r,...l}=e;const a=(0,s.useRef)(),c=function(e){const[t,n]=(0,s.useState)(!0),o=(0,s.useCallback)((()=>{const t=!ul.focus.tabbable.find(e.current).some((e=>!("toolbarItem"in e.dataset)));t||z()("Using custom components as toolbar controls",{since:"5.6",alternative:"ToolbarItem, ToolbarButton or ToolbarDropdownMenu components",link:"https://developer.wordpress.org/block-editor/components/toolbar-button/#inside-blockcontrols"}),n(t)}),[]);return(0,s.useLayoutEffect)((()=>{const t=new window.MutationObserver(o);return t.observe(e.current,{childList:!0,subtree:!0}),()=>t.disconnect()}),[t]),t}(a);return function(e,t,n,o,r){const[l]=(0,s.useState)(t),[i]=(0,s.useState)(o),a=(0,s.useCallback)((()=>{!function(e){const[t]=ul.focus.tabbable.find(e);t&&t.focus({preventScroll:!0})}(e.current)}),[]);(0,tu.useShortcut)("core/block-editor/focus-toolbar",a),(0,s.useEffect)((()=>{l&&a()}),[n,l,a]),(0,s.useEffect)((()=>{let t=0;return i&&!l&&(t=window.requestAnimationFrame((()=>{const t=jp(e.current),n=i||0;var o;t[n]&&(o=e.current).contains(o.ownerDocument.activeElement)&&t[n].focus({preventScroll:!0})}))),()=>{if(window.cancelAnimationFrame(t),!r||!e.current)return;const n=jp(e.current).findIndex((e=>0===e.tabIndex));r(n)}}),[i,l])}(a,n,c,o,r),c?(0,s.createElement)(p.Toolbar,i({label:l["aria-label"],ref:a},l),t):(0,s.createElement)(p.NavigableMenu,i({orientation:"horizontal",role:"toolbar",ref:a},l),t)},qp=(0,s.createElement)(A.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(A.Path,{d:"M10.6 6L9.4 7l4.6 5-4.6 5 1.2 1 5.4-6z"})),Yp=(0,s.createElement)(A.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(A.Path,{d:"M14.6 7l-1.2-1L8 12l5.4 6 1.2-1-4.6-5z"})),Zp=(0,s.createElement)(A.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(A.Path,{d:"M6.5 12.4L12 8l5.5 4.4-.9 1.2L12 10l-4.5 3.6-1-1.2z"})),Qp=(0,s.createElement)(A.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(A.Path,{d:"M17.5 11.6L12 16l-5.5-4.4.9-1.2L12 14l4.5-3.6 1 1.2z"}));const Xp=(e,t)=>"up"===e?"horizontal"===t?(0,g.isRTL)()?qp:Yp:Zp:"down"===e?"horizontal"===t?(0,g.isRTL)()?Yp:qp:Qp:null,Jp=(e,t)=>"up"===e?"horizontal"===t?(0,g.isRTL)()?(0,g.__)("Move right"):(0,g.__)("Move left"):(0,g.__)("Move up"):"down"===e?"horizontal"===t?(0,g.isRTL)()?(0,g.__)("Move left"):(0,g.__)("Move right"):(0,g.__)("Move down"):null,em=(0,s.forwardRef)(((e,t)=>{let{clientIds:n,direction:o,orientation:l,...a}=e;const f=(0,d.useInstanceId)(em),h=(0,u.castArray)(n).length,{blockType:v,isDisabled:b,rootClientId:k,isFirst:_,isLast:y,firstIndex:E,orientation:C="vertical"}=(0,m.useSelect)((e=>{const{getBlockIndex:t,getBlockRootClientId:i,getBlockOrder:s,getBlock:a,getBlockListSettings:c}=e(Qn),d=(0,u.castArray)(n),p=(0,u.first)(d),m=i(p),f=t(p),g=t((0,u.last)(d)),h=s(m),v=a(p),b=0===f,k=g===h.length-1,{orientation:_}=c(m)||{};return{blockType:v?(0,r.getBlockType)(v.name):null,isDisabled:"up"===o?b:k,rootClientId:m,firstIndex:f,isFirst:b,isLast:k,orientation:l||_}}),[n,o]),{moveBlocksDown:S,moveBlocksUp:w}=(0,m.useDispatch)(Qn),B="up"===o?w:S,I=`block-editor-block-mover-button__description-${f}`;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.Button,i({ref:t,className:c()("block-editor-block-mover-button",`is-${o}-button`),icon:Xp(o,C),label:Jp(o,C),"aria-describedby":I},a,{onClick:b?null:e=>{B(n,k),a.onClick&&a.onClick(e)},disabled:b,__experimentalIsFocusable:!0})),(0,s.createElement)(p.VisuallyHidden,{id:I},function(e,t,n,o,r,l,i){const s=n+1,a=e=>"up"===e?"horizontal"===i?(0,g.isRTL)()?"right":"left":"up":"down"===e?"horizontal"===i?(0,g.isRTL)()?"left":"right":"down":null;if(e>1)return function(e,t,n,o,r){const l=t+1;return r<0&&n?(0,g.__)("Blocks cannot be moved up as they are already at the top"):r>0&&o?(0,g.__)("Blocks cannot be moved down as they are already at the bottom"):r<0&&!n?(0,g.sprintf)(// translators: 1: Number of selected blocks, 2: Position of selected blocks
|
31 |
(0,g._n)("Move %1$d block from position %2$d up by one place","Move %1$d blocks from position %2$d up by one place",e),e,l):r>0&&!o?(0,g.sprintf)(// translators: 1: Number of selected blocks, 2: Position of selected blocks
|
32 |
(0,g._n)("Move %1$d block from position %2$d down by one place","Move %1$d blocks from position %2$d down by one place",e),e,l):void 0}(e,n,o,r,l);if(o&&r)return(0,g.sprintf)(// translators: %s: Type of block (i.e. Text, Image etc)
|
33 |
(0,g.__)("Block %s is the only block, and cannot be moved"),t);if(l>0&&!r){const e=a("down");if("down"===e)return(0,g.sprintf)(// translators: 1: Type of block (i.e. Text, Image etc), 2: Position of selected block, 3: New position
|
42 |
(0,g.__)("Move %1$s block from position %2$d right to position %3$d"),t,s,s-1)}if(l<0&&o){const e=a("up");if("up"===e)return(0,g.sprintf)(// translators: 1: Type of block (i.e. Text, Image etc)
|
43 |
(0,g.__)("Block %1$s is at the beginning of the content and can’t be moved up"),t);if("left"===e)return(0,g.sprintf)(// translators: 1: Type of block (i.e. Text, Image etc)
|
44 |
(0,g.__)("Block %1$s is at the beginning of the content and can’t be moved left"),t);if("right"===e)return(0,g.sprintf)(// translators: 1: Type of block (i.e. Text, Image etc)
|
45 |
+
(0,g.__)("Block %1$s is at the beginning of the content and can’t be moved right"),t)}}(h,v&&v.title,E,_,y,"up"===o?-1:1,C)))})),tm=(0,s.forwardRef)(((e,t)=>(0,s.createElement)(em,i({direction:"up",ref:t},e)))),nm=(0,s.forwardRef)(((e,t)=>(0,s.createElement)(em,i({direction:"down",ref:t},e))));var om=function(e){let{clientIds:t,hideDragHandle:n}=e;const{canMove:o,rootClientId:r,isFirst:l,isLast:a,orientation:d}=(0,m.useSelect)((e=>{var n;const{getBlockIndex:o,getBlockListSettings:r,canMoveBlocks:l,getBlockOrder:i,getBlockRootClientId:s}=e(Qn),a=(0,u.castArray)(t),c=(0,u.first)(a),d=s((0,u.first)(a)),p=o(c),m=o((0,u.last)(a)),f=i(d);return{canMove:l(t,d),rootClientId:d,isFirst:0===p,isLast:m===f.length-1,orientation:null===(n=r(d))||void 0===n?void 0:n.orientation}}),[t]);if(!o||l&&a&&!r)return null;const f=(0,g.__)("Drag");return(0,s.createElement)(p.ToolbarGroup,{className:c()("block-editor-block-mover",{"is-horizontal":"horizontal"===d})},!n&&(0,s.createElement)(Wp,{clientIds:t},(e=>(0,s.createElement)(p.Button,i({icon:Sd,className:"block-editor-block-mover__drag-handle","aria-hidden":"true",label:f,tabIndex:"-1"},e)))),(0,s.createElement)("div",{className:"block-editor-block-mover__move-button-container"},(0,s.createElement)(p.ToolbarItem,null,(e=>(0,s.createElement)(tm,i({clientIds:t},e)))),(0,s.createElement)(p.ToolbarItem,null,(e=>(0,s.createElement)(nm,i({clientIds:t},e))))))};const{clearTimeout:rm,setTimeout:lm}=window,im=200;function sm(e){let{ref:t,isFocused:n,debounceTimeout:o=im,onChange:r=u.noop}=e;const[l,i]=(0,s.useState)(!1),a=(0,s.useRef)(),c=e=>{null!=t&&t.current&&i(e),r(e)},d=()=>{const e=a.current;e&&rm&&rm(e)};return(0,s.useEffect)((()=>()=>{c(!1),d()}),[]),{showMovers:l,debouncedShowMovers:e=>{e&&e.stopPropagation(),d(),l||c(!0)},debouncedHideMovers:e=>{e&&e.stopPropagation(),d(),a.current=lm((()=>{(()=>{const e=(null==t?void 0:t.current)&&t.current.matches(":hover");return!n&&!e})()&&c(!1)}),o)}}}function am(e){let{ref:t,debounceTimeout:n=im,onChange:o=u.noop}=e;const[r,l]=(0,s.useState)(!1),{showMovers:i,debouncedShowMovers:a,debouncedHideMovers:c}=sm({ref:t,debounceTimeout:n,isFocused:r,onChange:o}),d=(0,s.useRef)(!1),p=()=>(null==t?void 0:t.current)&&t.current.contains(t.current.ownerDocument.activeElement);return(0,s.useEffect)((()=>{const e=t.current,n=()=>{p()&&(l(!0),a())},o=()=>{p()||(l(!1),c())};return e&&!d.current&&(e.addEventListener("focus",n,!0),e.addEventListener("blur",o,!0),d.current=!0),()=>{e&&(e.removeEventListener("focus",n),e.removeEventListener("blur",o))}}),[t,d,l,a,c]),{showMovers:i,gestures:{onMouseMove:a,onMouseLeave:c}}}function cm(){const{selectBlock:e,toggleBlockHighlight:t}=(0,m.useDispatch)(Qn),{firstParentClientId:n,shouldHide:o,hasReducedUI:l}=(0,m.useSelect)((e=>{const{getBlockName:t,getBlockParents:n,getSelectedBlockClientId:o,getSettings:l}=e(Qn),{hasBlockSupport:i}=e(r.store),s=n(o()),a=s[s.length-1],c=t(a),u=(0,r.getBlockType)(c),d=l();return{firstParentClientId:a,shouldHide:!i(u,"__experimentalParentSelector",!0),hasReducedUI:d.hasReducedUI}}),[]),a=Hp(n),c=(0,s.useRef)(),{gestures:u}=am({ref:c,onChange(e){e&&l||t(n,e)}});return o||void 0===n?null:(0,s.createElement)("div",i({className:"block-editor-block-parent-selector",key:n,ref:c},u),(0,s.createElement)(p.ToolbarButton,{className:"block-editor-block-parent-selector__button",onClick:()=>e(n),label:(0,g.sprintf)(
|
46 |
/* translators: %s: Name of the block's parent. */
|
47 |
+
(0,g.__)("Select %s"),a.title),showTooltip:!0,icon:(0,s.createElement)(Wc,{icon:a.icon})}))}var um=(0,s.createElement)(A.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(A.Path,{d:"M20.2 8v11c0 .7-.6 1.2-1.2 1.2H6v1.5h13c1.5 0 2.7-1.2 2.7-2.8V8zM18 16.4V4.6c0-.9-.7-1.6-1.6-1.6H4.6C3.7 3 3 3.7 3 4.6v11.8c0 .9.7 1.6 1.6 1.6h11.8c.9 0 1.6-.7 1.6-1.6zm-13.5 0V4.6c0-.1.1-.1.1-.1h11.8c.1 0 .1.1.1.1v11.8c0 .1-.1.1-.1.1H4.6l-.1-.1z"}));function dm(e){let{blocks:t}=e;return(0,s.createElement)("div",{className:"block-editor-block-switcher__popover__preview__parent"},(0,s.createElement)("div",{className:"block-editor-block-switcher__popover__preview__container"},(0,s.createElement)(p.Popover,{className:"block-editor-block-switcher__preview__popover",position:"bottom right",focusOnMount:!1},(0,s.createElement)("div",{className:"block-editor-block-switcher__preview"},(0,s.createElement)("div",{className:"block-editor-block-switcher__preview-title"},(0,g.__)("Preview")),(0,s.createElement)(kd,{viewportWidth:500,blocks:t})))))}var pm=e=>{let{className:t,possibleBlockTransformations:n,onSelect:o,blocks:l}=e;const[i,a]=(0,s.useState)();return(0,s.createElement)(p.MenuGroup,{label:(0,g.__)("Transform to"),className:t},i&&(0,s.createElement)(dm,{blocks:(0,r.switchToBlockType)(l,i)}),n.map((e=>{const{name:t,icon:n,title:l,isDisabled:i}=e;return(0,s.createElement)(p.MenuItem,{key:t,className:(0,r.getBlockMenuDefaultClassName)(t),onClick:e=>{e.preventDefault(),o(t)},disabled:i,onMouseLeave:()=>a(null),onMouseEnter:()=>a(t)},(0,s.createElement)(Wc,{icon:n,showColors:!0}),l)})))},mm=(0,s.createElement)(A.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(A.Path,{d:"M16.7 7.1l-6.3 8.5-3.3-2.5-.9 1.2 4.5 3.4L17.9 8z"})),fm=window.wp.tokenList,gm=n.n(fm);function hm(e,t,n){const o=new(gm())(e);return t&&o.remove("is-style-"+t.name),o.add("is-style-"+n.name),o.value}function vm(e){return(0,u.find)(e,"isDefault")}function bm(e){let{clientId:t,onSwitch:n}=e;const{styles:o,block:l,blockType:i,className:a}=(0,m.useSelect)((e=>{const{getBlock:n}=e(Qn),o=n(t);if(!o)return{};const l=(0,r.getBlockType)(o.name),{getBlockStyles:i}=e(r.store);return{block:o,blockType:l,styles:i(o.name),className:o.attributes.className||""}}),[t]),{updateBlockAttributes:c}=(0,m.useDispatch)(Qn),d=function(e){return e&&0!==e.length?vm(e)?e:[{name:"default",label:(0,g._x)("Default","block style"),isDefault:!0},...e]:[]}(o),p=function(e,t){for(const n of new(gm())(t).values()){if(-1===n.indexOf("is-style-"))continue;const t=n.substring(9),o=(0,u.find)(e,{name:t});if(o)return o}return(0,u.find)(e,"isDefault")}(d,a),f=function(e,t){return(0,s.useMemo)((()=>{const n=null==t?void 0:t.example,o=null==t?void 0:t.name;return n&&o?(0,r.getBlockFromExample)(o,{attributes:n.attributes,innerBlocks:n.innerBlocks}):e?(0,r.cloneBlock)(e):void 0}),[null!=t&&t.example?null==e?void 0:e.name:e,t])}(l,i);return{onSelect:e=>{const o=hm(a,p,e);c(t,{className:o}),n()},stylesToRender:d,activeStyle:p,genericPreviewBlock:f,className:a}}function km(e){let{clientId:t,onSwitch:n=u.noop}=e;const{onSelect:o,stylesToRender:r,activeStyle:l}=bm({clientId:t,onSwitch:n});return r&&0!==r.length?(0,s.createElement)(s.Fragment,null,r.map((e=>{const t=e.label||e.name;return(0,s.createElement)(p.MenuItem,{key:e.name,icon:l.name===e.name?mm:null,onClick:()=>o(e)},(0,s.createElement)(p.__experimentalText,{as:"span",limit:18,ellipsizeMode:"tail",truncate:!0},t))}))):null}function _m(e){let{hoveredBlock:t,onSwitch:n}=e;const{clientId:o}=t;return(0,s.createElement)(p.MenuGroup,{label:(0,g.__)("Styles"),className:"block-editor-block-switcher__styles__menugroup"},(0,s.createElement)(km,{clientId:o,onSwitch:n}))}const ym=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new Set;const{clientId:o,name:r,innerBlocks:l=[]}=e;if(!n.has(o)){if(r===t)return e;for(const e of l){const o=ym(e,t,n);if(o)return o}}},Em=(e,t)=>{const n=((e,t)=>{const n=(0,r.__experimentalGetBlockAttributesNamesByRole)(e,"content");return null!=n&&n.length?n.reduce(((e,n)=>(t[n]&&(e[n]=t[n]),e)),{}):t})(t.name,t.attributes);e.attributes={...e.attributes,...n}};function Cm(e){let{patterns:t,onSelect:n}=e;return(0,s.createElement)("div",{className:"block-editor-block-switcher__popover__preview__parent"},(0,s.createElement)("div",{className:"block-editor-block-switcher__popover__preview__container"},(0,s.createElement)(p.Popover,{className:"block-editor-block-switcher__preview__popover",position:"bottom right"},(0,s.createElement)("div",{className:"block-editor-block-switcher__preview"},(0,s.createElement)("div",{className:"block-editor-block-switcher__preview-title"},(0,g.__)("Preview")),(0,s.createElement)(Sm,{patterns:t,onSelect:n})))))}function Sm(e){let{patterns:t,onSelect:n}=e;const o=(0,p.__unstableUseCompositeState)();return(0,s.createElement)(p.__unstableComposite,i({},o,{role:"listbox",className:"block-editor-block-switcher__preview-patterns-container","aria-label":(0,g.__)("Patterns list")}),t.map((e=>(0,s.createElement)(wm,{key:e.name,pattern:e,onSelect:n,composite:o}))))}function wm(e){let{pattern:t,onSelect:n,composite:o}=e;const r="block-editor-block-switcher__preview-patterns-container",l=(0,d.useInstanceId)(wm,`${r}-list__item-description`);return(0,s.createElement)("div",{className:`${r}-list__list-item`,"aria-label":t.title,"aria-describedby":t.description?l:void 0},(0,s.createElement)(p.__unstableCompositeItem,i({role:"option",as:"div"},o,{className:`${r}-list__item`,onClick:()=>n(t.transformedBlocks)}),(0,s.createElement)(kd,{blocks:t.transformedBlocks,viewportWidth:t.viewportWidth||500}),(0,s.createElement)("div",{className:`${r}-list__item-title`},t.title)),!!t.description&&(0,s.createElement)(p.VisuallyHidden,{id:l},t.description))}var Bm=function(e){let{blocks:t,patterns:n,onSelect:o}=e;const[l,i]=(0,s.useState)(!1),a=((e,t)=>(0,s.useMemo)((()=>e.reduce(((e,n)=>{const o=((e,t)=>{const n=t.map((e=>(0,r.cloneBlock)(e))),o=new Set;for(const t of e){let e=!1;for(const r of n){const n=ym(r,t.name,o);if(n){e=!0,o.add(n.clientId),Em(n,t);break}}if(!e)return}return n})(t,n.blocks);return o&&e.push({...n,transformedBlocks:o}),e}),[])),[e,t]))(n,t);return a.length?(0,s.createElement)(p.MenuGroup,{className:"block-editor-block-switcher__pattern__transforms__menugroup"},l&&(0,s.createElement)(Cm,{patterns:a,onSelect:o}),(0,s.createElement)(p.MenuItem,{onClick:e=>{e.preventDefault(),i(!l)},icon:qp},(0,g.__)("Patterns"))):null};const Im=e=>{let{clientIds:t,blocks:n}=e;const{replaceBlocks:o}=(0,m.useDispatch)(Qn),l=Hp(n[0].clientId),{possibleBlockTransformations:i,canRemove:a,hasBlockStyles:c,icon:d,blockTitle:f,patterns:h}=(0,m.useSelect)((e=>{var o;const{getBlockRootClientId:i,getBlockTransformItems:s,__experimentalGetPatternTransformItems:a}=e(Qn),{getBlockStyles:c,getBlockType:d}=e(r.store),{canRemoveBlocks:p}=e(Qn),m=i((0,u.castArray)(t)[0]),[{name:f}]=n,g=1===n.length,h=g&&c(f);let v;var b;g?v=null==l?void 0:l.icon:v=1===(0,u.uniq)(n.map((e=>{let{name:t}=e;return t}))).length?null===(b=d(f))||void 0===b?void 0:b.icon:um;return{possibleBlockTransformations:s(n,m),canRemove:p(t,m),hasBlockStyles:!(null==h||!h.length),icon:v,blockTitle:null===(o=d(f))||void 0===o?void 0:o.title,patterns:a(n,m)}}),[t,n,null==l?void 0:l.icon]),v=1===n.length&&(0,r.isReusableBlock)(n[0]),b=1===n.length&&(0,r.isTemplatePart)(n[0]),k=!!i.length&&a,_=!(null==h||!h.length)&&a;if(!c&&!k)return(0,s.createElement)(p.ToolbarGroup,null,(0,s.createElement)(p.ToolbarButton,{disabled:!0,className:"block-editor-block-switcher__no-switcher-icon",title:f,icon:(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Wc,{icon:d,showColors:!0}),(v||b)&&(0,s.createElement)("span",{className:"block-editor-block-switcher__toggle-text"},(0,s.createElement)(Up,{clientId:t,maximumLength:35})))}));const y=f,E=1===n.length?(0,g.sprintf)(
|
48 |
/* translators: %s: block title. */
|
49 |
(0,g.__)("%s: Change block type or style"),f):(0,g.sprintf)(
|
50 |
/* translators: %d: number of blocks. */
|
51 |
+
(0,g._n)("Change type of %d block","Change type of %d blocks",n.length),n.length),C=c||k||_;return(0,s.createElement)(p.ToolbarGroup,null,(0,s.createElement)(p.ToolbarItem,null,(e=>(0,s.createElement)(p.DropdownMenu,{className:"block-editor-block-switcher",label:y,popoverProps:{position:"bottom right",isAlternate:!0,className:"block-editor-block-switcher__popover"},icon:(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Wc,{icon:d,className:"block-editor-block-switcher__toggle",showColors:!0}),(v||b)&&(0,s.createElement)("span",{className:"block-editor-block-switcher__toggle-text"},(0,s.createElement)(Up,{clientId:t,maximumLength:35}))),toggleProps:{describedBy:E,...e},menuProps:{orientation:"both"}},(e=>{let{onClose:l}=e;return C&&(0,s.createElement)("div",{className:"block-editor-block-switcher__container"},_&&(0,s.createElement)(Bm,{blocks:n,patterns:h,onSelect:e=>{(e=>{o(t,e)})(e),l()}}),k&&(0,s.createElement)(pm,{className:"block-editor-block-switcher__transforms__menugroup",possibleBlockTransformations:i,blocks:n,onSelect:e=>{(e=>{o(t,(0,r.switchToBlockType)(n,e))})(e),l()}}),c&&(0,s.createElement)(_m,{hoveredBlock:n[0],onSwitch:l}))})))))};var xm=e=>{let{clientIds:t}=e;const n=(0,m.useSelect)((e=>e(Qn).getBlocksByClientId(t)),[t]);return!n.length||n.some((e=>!e))?null:(0,s.createElement)(Im,{clientIds:t,blocks:n})};const{Fill:Tm,Slot:Nm}=(0,p.createSlotFill)("__unstableBlockToolbarLastItem");Tm.Slot=Nm;var Pm=Tm,Rm=(0,s.createElement)(A.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(A.Path,{d:"M13 19h-2v-2h2v2zm0-6h-2v-2h2v2zm0-6h-2V5h2v2z"})),Mm=window.wp.blob;function Lm(e,t){if(t&&1===(null==e?void 0:e.length)&&0===e[0].type.indexOf("image/")){var n;const e=/<\s*img\b/gi;return 1!==(null===(n=t.match(e))||void 0===n?void 0:n.length)}return!1}function Am(){const{getBlockName:e}=(0,m.useSelect)(Qn),{getBlockType:t}=(0,m.useSelect)(r.store),{createSuccessNotice:n}=(0,m.useDispatch)(Fd.store);return(0,s.useCallback)(((o,r)=>{let l="";if(1===r.length){var i;const n=r[0],s=null===(i=t(e(n)))||void 0===i?void 0:i.title;l="copy"===o?(0,g.sprintf)(// Translators: Name of the block being copied, e.g. "Paragraph".
|
52 |
(0,g.__)('Copied "%s" to clipboard.'),s):(0,g.sprintf)(// Translators: Name of the block being cut, e.g. "Paragraph".
|
53 |
(0,g.__)('Moved "%s" to clipboard.'),s)}else l="copy"===o?(0,g.sprintf)(// Translators: %d: Number of blocks being copied.
|
54 |
(0,g._n)("Copied %d block to clipboard.","Copied %d blocks to clipboard.",r.length),r.length):(0,g.sprintf)(// Translators: %d: Number of blocks being cut.
|
55 |
+
(0,g._n)("Moved %d block to clipboard.","Moved %d blocks to clipboard.",r.length),r.length);n(l,{type:"snackbar"})}),[])}function Dm(){const{getBlocksByClientId:e,getSelectedBlockClientIds:t,hasMultiSelection:n,getSettings:o,__unstableIsFullySelected:l,__unstableIsSelectionCollapsed:i,__unstableIsSelectionMergeable:s,__unstableGetSelectedBlocksWithPartialSelection:a}=(0,m.useSelect)(Qn),{flashBlock:c,removeBlocks:u,replaceBlocks:p,__unstableDeleteSelection:f,__unstableExpandSelection:g}=(0,m.useDispatch)(Qn),h=Am();return(0,d.useRefEffect)((d=>{function m(m){const v=t();if(0===v.length)return;if(!n()){const{target:e}=m,{ownerDocument:t}=e;if("copy"===m.type||"cut"===m.type?(0,ul.documentHasUncollapsedSelection)(t):(0,ul.documentHasSelection)(t))return}if(!d.contains(m.target.ownerDocument.activeElement))return;const b=m.defaultPrevented;m.preventDefault();const k=s(),_=i()||l(),y=!_&&!k;if("copy"===m.type||"cut"===m.type)if(1===v.length&&c(v[0]),y)g();else{let t;if(h(m.type,v),_)t=e(v);else{const[n,o]=a();t=[n,...e(v.slice(1,v.length-1)),o]}const n=(0,r.serialize)(t);m.clipboardData.setData("text/plain",n),m.clipboardData.setData("text/html",n)}if("cut"===m.type)_&&!y?u(v):f();else if("paste"===m.type){if(b)return;const{__experimentalCanUserUseUnfilteredHTML:e}=o(),{plainText:t,html:n}=function(e){let{clipboardData:t}=e,n="",o="";try{n=t.getData("text/plain"),o=t.getData("text/html")}catch(e){try{o=t.getData("Text")}catch(e){return}}const r=(0,ul.getFilesFromDataTransfer)(t).filter((e=>{let{type:t}=e;return/^image\/(?:jpe?g|png|gif|webp)$/.test(t)}));return r.length&&!Lm(r,o)&&(o=r.map((e=>`<img src="${(0,Mm.createBlobURL)(e)}">`)).join(""),n=""),{html:o,plainText:n}}(m),l=(0,r.pasteHandler)({HTML:n,plainText:t,mode:"BLOCKS",canUserUseUnfilteredHTML:e});p(v,l,l.length-1,-1)}}return d.ownerDocument.addEventListener("copy",m),d.ownerDocument.addEventListener("cut",m),d.ownerDocument.addEventListener("paste",m),()=>{d.ownerDocument.removeEventListener("copy",m),d.ownerDocument.removeEventListener("cut",m),d.ownerDocument.removeEventListener("paste",m)}}),[])}var Om=function(e){let{children:t}=e;return(0,s.createElement)("div",{ref:Dm()},t)};function Fm(e){let{clientIds:t,children:n,__experimentalUpdateSelection:o}=e;const{canInsertBlockType:l,getBlockRootClientId:i,getBlocksByClientId:s,canMoveBlocks:a,canRemoveBlocks:c}=(0,m.useSelect)(Qn),{getDefaultBlockName:d,getGroupingBlockName:p}=(0,m.useSelect)(r.store),f=s(t),g=i(t[0]),h=(0,u.every)(f,(e=>!!e&&(0,r.hasBlockSupport)(e.name,"multiple",!0)&&l(e.name,g))),v=l(d(),g),b=a(t,g),k=c(t,g),{removeBlocks:_,replaceBlocks:y,duplicateBlocks:E,insertAfterBlock:C,insertBeforeBlock:S,flashBlock:w,setBlockMovingClientId:B,setNavigationMode:I,selectBlock:x}=(0,m.useDispatch)(Qn),T=Am();return n({canDuplicate:h,canInsertDefaultBlock:v,canMove:b,canRemove:k,rootClientId:g,blocks:f,onDuplicate:()=>E(t,o),onRemove:()=>_(t,o),onInsertBefore(){S((0,u.first)((0,u.castArray)(t)))},onInsertAfter(){C((0,u.last)((0,u.castArray)(t)))},onMoveTo(){I(!0),x(t[0]),B(t[0])},onGroup(){if(!f.length)return;const e=p(),n=(0,r.switchToBlockType)(f,e);n&&y(t,n)},onUngroup(){if(!f.length)return;const e=f[0].innerBlocks;e.length&&y(t,e)},onCopy(){const e=f.map((e=>{let{clientId:t}=e;return t}));1===f.length&&w(e[0]),T("copy",e)}})}var zm=(0,d.compose)([(0,m.withSelect)(((e,t)=>{let{clientId:n}=t;const{getBlock:o,getBlockMode:l,getSettings:i}=e(Qn),s=o(n),a=i().codeEditingEnabled;return{mode:l(n),blockType:s?(0,r.getBlockType)(s.name):null,isCodeEditingEnabled:a}})),(0,m.withDispatch)(((e,t)=>{let{onToggle:n=u.noop,clientId:o}=t;return{onToggleMode(){e(Qn).toggleBlockMode(o),n()}}}))])((function(e){let{blockType:t,mode:n,onToggleMode:o,small:l=!1,isCodeEditingEnabled:i=!0}=e;if(!(0,r.hasBlockSupport)(t,"html",!0)||!i)return null;const a="visual"===n?(0,g.__)("Edit as HTML"):(0,g.__)("Edit visually");return(0,s.createElement)(p.MenuItem,{onClick:o},!l&&a)})),Vm=(0,d.compose)((0,m.withSelect)(((e,t)=>{let{clientId:n}=t;const o=e(Qn).getBlock(n);return{block:o,shouldRender:o&&"core/html"===o.name}})),(0,m.withDispatch)(((e,t)=>{let{block:n}=t;return{onClick:()=>e(Qn).replaceBlocks(n.clientId,(0,r.rawHandler)({HTML:(0,r.getBlockContent)(n)}))}})))((function(e){let{shouldRender:t,onClick:n,small:o}=e;if(!t)return null;const r=(0,g.__)("Convert to Blocks");return(0,s.createElement)(p.MenuItem,{onClick:n},!o&&r)}));const{Fill:Hm,Slot:Gm}=(0,p.createSlotFill)("__unstableBlockSettingsMenuFirstItem");Hm.Slot=Gm;var Um=Hm;function Wm(e){let{clientIds:t,isGroupable:n,isUngroupable:o,blocksSelection:l,groupingBlockName:i,onClose:a=(()=>{})}=e;const{replaceBlocks:c}=(0,m.useDispatch)(Qn);return n||o?(0,s.createElement)(s.Fragment,null,n&&(0,s.createElement)(p.MenuItem,{onClick:()=>{(()=>{const e=(0,r.switchToBlockType)(l,i);e&&c(t,e)})(),a()}},(0,g._x)("Group","verb")),o&&(0,s.createElement)(p.MenuItem,{onClick:()=>{(()=>{const e=l[0].innerBlocks;e.length&&c(t,e)})(),a()}},(0,g._x)("Ungroup","Ungrouping blocks from within a Group block back into individual blocks within the Editor "))):null}function $m(){const{clientIds:e,isGroupable:t,isUngroupable:n,blocksSelection:o,groupingBlockName:l}=(0,m.useSelect)((e=>{var t;const{getBlockRootClientId:n,getBlocksByClientId:o,canInsertBlockType:l,getSelectedBlockClientIds:i}=e(Qn),{getGroupingBlockName:s}=e(r.store),a=i(),c=s(),u=l(c,null!=a&&a.length?n(a[0]):void 0),d=o(a),p=1===d.length&&(null===(t=d[0])||void 0===t?void 0:t.name)===c;return{clientIds:a,isGroupable:u&&d.length,isUngroupable:p&&!!d[0].innerBlocks.length,blocksSelection:d,groupingBlockName:c}}),[]);return{clientIds:e,isGroupable:t,isUngroupable:n,blocksSelection:o,groupingBlockName:l}}var jm=(0,s.createElement)(A.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(A.Path,{d:"M17 10h-1.2V7c0-2.1-1.7-3.8-3.8-3.8-2.1 0-3.8 1.7-3.8 3.8h1.5c0-1.2 1-2.2 2.2-2.2s2.2 1 2.2 2.2v3H7c-.6 0-1 .4-1 1v8c0 .6.4 1 1 1h10c.6 0 1-.4 1-1v-8c0-.6-.4-1-1-1z"})),Km=(0,s.createElement)(A.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(A.Path,{d:"M17 10h-1.2V7c0-2.1-1.7-3.8-3.8-3.8-2.1 0-3.8 1.7-3.8 3.8v3H7c-.6 0-1 .4-1 1v8c0 .6.4 1 1 1h10c.6 0 1-.4 1-1v-8c0-.6-.4-1-1-1zm-2.8 0H9.8V7c0-1.2 1-2.2 2.2-2.2s2.2 1 2.2 2.2v3z"}));function qm(e){return(0,m.useSelect)((t=>{const{canEditBlock:n,canMoveBlock:o,canRemoveBlock:r,canLockBlockType:l,getBlockName:i,getBlockRootClientId:s}=t(Qn),a=s(e),c=n(e),u=o(e,a),d=r(e,a);return{canEdit:c,canMove:u,canRemove:d,canLock:l(i(e)),isLocked:!c||!u||!d}}),[e])}function Ym(e){let{clientId:t,onClose:n}=e;const[o,l]=(0,s.useState)({move:!1,remove:!1}),{canEdit:i,canMove:a,canRemove:c}=qm(t),{isReusable:u}=(0,m.useSelect)((e=>{const{getBlockName:n}=e(Qn),o=n(t);return{isReusable:(0,r.isReusableBlock)((0,r.getBlockType)(o))}}),[t]),{updateBlockAttributes:f}=(0,m.useDispatch)(Qn),h=Hp(t),v=(0,d.useInstanceId)(Ym,"block-editor-block-lock-modal__options-title");(0,s.useEffect)((()=>{l({move:!a,remove:!c,...u?{edit:!i}:{}})}),[i,a,c,u]);const b=Object.values(o).every(Boolean),k=Object.values(o).some(Boolean)&&!b;return(0,s.createElement)(p.Modal,{title:(0,g.sprintf)(
|
56 |
/* translators: %s: Name of the block. */
|
57 |
+
(0,g.__)("Lock %s"),h.title),overlayClassName:"block-editor-block-lock-modal",closeLabel:(0,g.__)("Close"),onRequestClose:n},(0,s.createElement)("form",{onSubmit:e=>{e.preventDefault(),f([t],{lock:o}),n()}},(0,s.createElement)("p",null,(0,g.__)("Choose specific attributes to restrict or lock all available options.")),(0,s.createElement)("div",{role:"group","aria-labelledby":v,className:"block-editor-block-lock-modal__options"},(0,s.createElement)(p.CheckboxControl,{className:"block-editor-block-lock-modal__options-title",label:(0,s.createElement)("span",{id:v},(0,g.__)("Lock all")),checked:b,indeterminate:k,onChange:e=>l({move:e,remove:e,...u?{edit:e}:{}})}),(0,s.createElement)("ul",{className:"block-editor-block-lock-modal__checklist"},u&&(0,s.createElement)("li",{className:"block-editor-block-lock-modal__checklist-item"},(0,s.createElement)(p.CheckboxControl,{label:(0,s.createElement)(s.Fragment,null,(0,g.__)("Restrict editing"),(0,s.createElement)(p.Icon,{icon:o.edit?Km:jm})),checked:!!o.edit,onChange:e=>l((t=>({...t,edit:e})))})),(0,s.createElement)("li",{className:"block-editor-block-lock-modal__checklist-item"},(0,s.createElement)(p.CheckboxControl,{label:(0,s.createElement)(s.Fragment,null,(0,g.__)("Disable movement"),(0,s.createElement)(p.Icon,{icon:o.move?Km:jm})),checked:o.move,onChange:e=>l((t=>({...t,move:e})))})),(0,s.createElement)("li",{className:"block-editor-block-lock-modal__checklist-item"},(0,s.createElement)(p.CheckboxControl,{label:(0,s.createElement)(s.Fragment,null,(0,g.__)("Prevent removal"),(0,s.createElement)(p.Icon,{icon:o.remove?Km:jm})),checked:o.remove,onChange:e=>l((t=>({...t,remove:e})))})))),(0,s.createElement)(p.Flex,{className:"block-editor-block-lock-modal__actions",justify:"flex-end",expanded:!1},(0,s.createElement)(p.FlexItem,null,(0,s.createElement)(p.Button,{variant:"tertiary",onClick:n},(0,g.__)("Cancel"))),(0,s.createElement)(p.FlexItem,null,(0,s.createElement)(p.Button,{variant:"primary",type:"submit"},(0,g.__)("Apply"))))))}function Zm(e){let{clientId:t}=e;const{canLock:n,isLocked:o}=qm(t),[r,l]=(0,s.useReducer)((e=>!e),!1);if(!n)return null;const i=o?(0,g.__)("Unlock"):(0,g.__)("Lock");return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.MenuItem,{icon:o?jm:Km,onClick:l},i),r&&(0,s.createElement)(Ym,{clientId:t,onClose:l}))}const{Fill:Qm,Slot:Xm}=(0,p.createSlotFill)("BlockSettingsMenuControls");function Jm(e){let{...t}=e;return(0,s.createElement)(p.__experimentalStyleProvider,{document:document},(0,s.createElement)(Qm,t))}Jm.Slot=e=>{let{fillProps:t,clientIds:n=null}=e;const{selectedBlocks:o,selectedClientIds:r,canRemove:l}=(0,m.useSelect)((e=>{const{getBlocksByClientId:t,getSelectedBlockClientIds:o,canRemoveBlocks:r}=e(Qn),l=null!==n?n:o();return{selectedBlocks:(0,u.map)((0,u.compact)(t(l)),(e=>e.name)),selectedClientIds:l,canRemove:r(l)}}),[n]),a=1===r.length,c=$m(),{isGroupable:d,isUngroupable:f}=c,g=(d||f)&&l;return(0,s.createElement)(Xm,{fillProps:{...t,selectedBlocks:o,selectedClientIds:r}},(e=>!(null!=e&&e.length)>0&&!g&&!a?null:(0,s.createElement)(p.MenuGroup,null,a&&(0,s.createElement)(Zm,{clientId:r[0]}),e,g&&(0,s.createElement)(Wm,i({},c,{onClose:null==t?void 0:t.onClose})))))};var ef=Jm;const tf={className:"block-editor-block-settings-menu__popover",position:"bottom right",isAlternate:!0};function nf(e){let{blocks:t,onCopy:n}=e;const o=(0,d.useCopyToClipboard)((()=>(0,r.serialize)(t)),n);return(0,s.createElement)(p.MenuItem,{ref:o},(0,g.__)("Copy"))}var of=function(e){let{clientIds:t,__experimentalSelectBlock:n,children:o,...l}=e;const a=(0,u.castArray)(t),c=a.length,d=a[0],{firstParentClientId:f,hasReducedUI:h,onlyBlock:v,parentBlockType:b,previousBlockClientId:k,nextBlockClientId:_,selectedBlockClientIds:y}=(0,m.useSelect)((e=>{const{getBlockCount:t,getBlockName:n,getBlockParents:o,getPreviousBlockClientId:l,getNextBlockClientId:i,getSelectedBlockClientIds:s,getSettings:a}=e(Qn),c=o(d),u=c[c.length-1],p=n(u);return{firstParentClientId:u,hasReducedUI:a().hasReducedUI,onlyBlock:1===t(),parentBlockType:(0,r.getBlockType)(p),previousBlockClientId:l(d),nextBlockClientId:i(d),selectedBlockClientIds:s()}}),[d]),E=(0,m.useSelect)((e=>{const{getShortcutRepresentation:t}=e(tu.store);return{duplicate:t("core/block-editor/duplicate"),remove:t("core/block-editor/remove"),insertAfter:t("core/block-editor/insert-after"),insertBefore:t("core/block-editor/insert-before")}}),[]),{selectBlock:C,toggleBlockHighlight:S}=(0,m.useDispatch)(Qn),w=(0,s.useCallback)(n?async e=>{const t=await e;t&&t[0]&&n(t[0])}:u.noop,[n]),B=Gp(d,25),I=(0,s.useCallback)(n?()=>{const e=k||_;e&&y.includes(d)&&!y.includes(e)&&n(e)}:u.noop,[n,k,_,y]),x=(0,g.sprintf)(
|
58 |
/* translators: %s: block name */
|
59 |
+
(0,g.__)("Remove %s"),B),T=1===c?x:(0,g.__)("Remove blocks"),N=(0,s.useRef)(),{gestures:P}=am({ref:N,onChange(e){e&&h||S(f,e)}});return(0,s.createElement)(Fm,{clientIds:t,__experimentalUpdateSelection:!n},(e=>{let{canDuplicate:n,canInsertDefaultBlock:r,canMove:a,canRemove:m,onDuplicate:h,onInsertAfter:k,onInsertBefore:_,onRemove:y,onCopy:S,onMoveTo:B,blocks:x}=e;return(0,s.createElement)(p.DropdownMenu,i({icon:Rm,label:(0,g.__)("Options"),className:"block-editor-block-settings-menu",popoverProps:tf,noIcons:!0},l),(e=>{let{onClose:l}=e;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.MenuGroup,null,(0,s.createElement)(Um.Slot,{fillProps:{onClose:l}}),void 0!==f&&(0,s.createElement)(p.MenuItem,i({},P,{ref:N,icon:(0,s.createElement)(Wc,{icon:b.icon}),onClick:()=>C(f)}),(0,g.sprintf)(
|
60 |
/* translators: %s: Name of the block's parent. */
|
61 |
+
(0,g.__)("Select parent block (%s)"),b.title)),1===c&&(0,s.createElement)(Vm,{clientId:d}),(0,s.createElement)(nf,{blocks:x,onCopy:S}),n&&(0,s.createElement)(p.MenuItem,{onClick:(0,u.flow)(l,h,w),shortcut:E.duplicate},(0,g.__)("Duplicate")),r&&(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.MenuItem,{onClick:(0,u.flow)(l,_),shortcut:E.insertBefore},(0,g.__)("Insert before")),(0,s.createElement)(p.MenuItem,{onClick:(0,u.flow)(l,k),shortcut:E.insertAfter},(0,g.__)("Insert after"))),a&&!v&&(0,s.createElement)(p.MenuItem,{onClick:(0,u.flow)(l,B)},(0,g.__)("Move to")),1===c&&(0,s.createElement)(zm,{clientId:d,onToggle:l})),(0,s.createElement)(ef.Slot,{fillProps:{onClose:l},clientIds:t}),"function"==typeof o?o({onClose:l}):s.Children.map((e=>(0,s.cloneElement)(e,{onClose:l}))),m&&(0,s.createElement)(p.MenuGroup,null,(0,s.createElement)(p.MenuItem,{onClick:(0,u.flow)(l,y,I),shortcut:E.remove},T)))}))}))},rf=function(e){let{clientIds:t,...n}=e;return(0,s.createElement)(p.ToolbarGroup,null,(0,s.createElement)(p.ToolbarItem,null,(e=>(0,s.createElement)(of,i({clientIds:t,toggleProps:e},n)))))};function lf(e){let{clientId:t}=e;const n=Hp(t),{canEdit:o,canMove:r,canRemove:l,canLock:i}=qm(t),[a,c]=(0,s.useReducer)((e=>!e),!1);return i?o&&r&&l?null:(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.ToolbarGroup,{className:"block-editor-block-lock-toolbar"},(0,s.createElement)(p.ToolbarButton,{icon:Km,label:(0,g.sprintf)(
|
62 |
/* translators: %s: block name */
|
63 |
+
(0,g.__)("Unlock %s"),n.title),onClick:c})),a&&(0,s.createElement)(Ym,{clientId:t,onClose:c})):null}var sf=(0,s.createElement)(A.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(A.Path,{d:"M18 4h-7c-1.1 0-2 .9-2 2v3H6c-1.1 0-2 .9-2 2v7c0 1.1.9 2 2 2h7c1.1 0 2-.9 2-2v-3h3c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm-4.5 14c0 .3-.2.5-.5.5H6c-.3 0-.5-.2-.5-.5v-7c0-.3.2-.5.5-.5h3V13c0 1.1.9 2 2 2h2.5v3zm0-4.5H11c-.3 0-.5-.2-.5-.5v-2.5H13c.3 0 .5.2.5.5v2.5zm5-.5c0 .3-.2.5-.5.5h-3V11c0-1.1-.9-2-2-2h-2.5V6c0-.3.2-.5.5-.5h7c.3 0 .5.2.5.5v7z"})),af=(0,s.createElement)(A.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(A.Path,{d:"M9.2 6.5H4V8h5.2c.3 0 .5.2.5.5v7c0 .3-.2.5-.5.5H4v1.5h5.2c1.1 0 2-.9 2-2v-7c0-1.1-.8-2-2-2zM14.8 8H20V6.5h-5.2c-1.1 0-2 .9-2 2v7c0 1.1.9 2 2 2H20V16h-5.2c-.3 0-.5-.2-.5-.5v-7c-.1-.3.2-.5.5-.5z"})),cf=(0,s.createElement)(A.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(A.Path,{d:"M16 4v5.2c0 .3-.2.5-.5.5h-7c-.3.1-.5-.2-.5-.5V4H6.5v5.2c0 1.1.9 2 2 2h7c1.1 0 2-.9 2-2V4H16zm-.5 8.8h-7c-1.1 0-2 .9-2 2V20H8v-5.2c0-.3.2-.5.5-.5h7c.3 0 .5.2.5.5V20h1.5v-5.2c0-1.2-.9-2-2-2z"}));const uf={group:void 0,row:{type:"flex",flexWrap:"nowrap"},stack:{type:"flex",orientation:"vertical"}};var df=function(){const{blocksSelection:e,clientIds:t,groupingBlockName:n,isGroupable:o}=$m(),{replaceBlocks:l}=(0,m.useDispatch)(Qn),{canRemove:i,variations:a}=(0,m.useSelect)((e=>{const{canRemoveBlocks:o}=e(Qn),{getBlockVariations:l}=e(r.store);return{canRemove:o(t),variations:l(n,"transform")}}),[t,n]),c=function(){let o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"group";const i=(0,r.switchToBlockType)(e,n);i&&i.length>0&&(i[0].attributes.layout=uf[o],l(t,i))};if(!o||!i)return null;const u=!!a.find((e=>{let{name:t}=e;return"group-row"===t})),d=!!a.find((e=>{let{name:t}=e;return"group-stack"===t}));return(0,s.createElement)(p.ToolbarGroup,null,(0,s.createElement)(p.ToolbarButton,{icon:sf,label:(0,g._x)("Group","verb"),onClick:c}),u&&(0,s.createElement)(p.ToolbarButton,{icon:af,label:(0,g._x)("Row","single horizontal line"),onClick:()=>c("row")}),d&&(0,s.createElement)(p.ToolbarButton,{icon:cf,label:(0,g._x)("Stack","verb"),onClick:()=>c("stack")}))},pf=(0,s.createContext)(""),mf=e=>{let{hideDragHandle:t}=e;const{blockClientIds:n,blockClientId:o,blockType:l,hasFixedToolbar:a,hasReducedUI:u,isValid:f,isVisual:g}=(0,m.useSelect)((e=>{const{getBlockName:t,getBlockMode:n,getSelectedBlockClientIds:o,isBlockValid:l,getBlockRootClientId:i,getSettings:s}=e(Qn),a=o(),c=a[0],u=i(c),d=s();return{blockClientIds:a,blockClientId:c,blockType:c&&(0,r.getBlockType)(t(c)),hasFixedToolbar:d.hasFixedToolbar,hasReducedUI:d.hasReducedUI,rootClientId:u,isValid:a.every((e=>l(e))),isVisual:a.every((e=>"visual"===n(e)))}}),[]),{toggleBlockHighlight:h}=(0,m.useDispatch)(Qn),v=(0,s.useRef)(),{showMovers:b,gestures:k}=am({ref:v,onChange(e){e&&u||h(o,e)}}),_=(0,d.useViewportMatch)("medium","<")||a;if(l&&!(0,r.hasBlockSupport)(l,"__experimentalToolbar",!0))return null;const y=_||b;if(0===n.length)return null;const E=f&&g,C=n.length>1,S=c()("block-editor-block-toolbar",y&&"is-showing-movers");return(0,s.createElement)("div",{className:S},!C&&!_&&(0,s.createElement)(cm,{clientIds:n}),(0,s.createElement)("div",i({ref:v},k),(E||C)&&(0,s.createElement)(p.ToolbarGroup,{className:"block-editor-block-toolbar__block-controls"},(0,s.createElement)(xm,{clientIds:n}),!C&&(0,s.createElement)(lf,{clientId:n[0]}),(0,s.createElement)(om,{clientIds:n,hideDragHandle:t||u}))),E&&C&&(0,s.createElement)(df,null),E&&(0,s.createElement)(s.Fragment,null,(0,s.createElement)(so.Slot,{group:"parent",className:"block-editor-block-toolbar__slot"}),(0,s.createElement)(so.Slot,{group:"block",className:"block-editor-block-toolbar__slot"}),(0,s.createElement)(so.Slot,{className:"block-editor-block-toolbar__slot"}),(0,s.createElement)(so.Slot,{group:"inline",className:"block-editor-block-toolbar__slot"}),(0,s.createElement)(so.Slot,{group:"other",className:"block-editor-block-toolbar__slot"}),(0,s.createElement)(pf.Provider,{value:null==l?void 0:l.name},(0,s.createElement)(Pm.Slot,null))),(0,s.createElement)(rf,{clientIds:n}))},ff=function(e){let{focusOnMount:t,isFixed:n,...o}=e;const{blockType:l,hasParents:a,showParentSelector:u}=(0,m.useSelect)((e=>{const{getBlockName:t,getBlockParents:n,getSelectedBlockClientIds:o}=e(Qn),{getBlockType:l}=e(r.store),i=o(),s=i[0],a=n(s),c=l(t(a[a.length-1]));return{blockType:s&&l(t(s)),hasParents:a.length,showParentSelector:(0,r.hasBlockSupport)(c,"__experimentalParentSelector",!0)&&i.length<=1}}),[]);if(l&&!(0,r.hasBlockSupport)(l,"__experimentalToolbar",!0))return null;const d=c()("block-editor-block-contextual-toolbar",{"has-parent":a&&u,"is-fixed":n});return(0,s.createElement)(Kp,i({focusOnMount:t,className:d
|
64 |
+
/* translators: accessibility text for the block toolbar */,"aria-label":(0,g.__)("Block tools")},o),(0,s.createElement)(mf,{hideDragHandle:n}))};function gf(e){const{isNavigationMode:t,isMultiSelecting:n,hasMultiSelection:o,isTyping:r,getSettings:l,getLastMultiSelectedBlockClientId:i}=e(Qn);return{isNavigationMode:t(),isMultiSelecting:n(),isTyping:r(),hasFixedToolbar:l().hasFixedToolbar,lastClientId:o()?i():null}}function hf(e){let{clientId:t,rootClientId:n,isEmptyDefaultBlock:o,capturingClientId:r,__unstablePopoverSlot:l,__unstableContentRef:i}=e;const{isNavigationMode:a,isMultiSelecting:u,isTyping:p,hasFixedToolbar:f,lastClientId:g}=(0,m.useSelect)(gf,[]),h=(0,m.useSelect)((e=>{const{isBlockInsertionPointVisible:n,getBlockInsertionPoint:o,getBlockOrder:r}=e(Qn);if(!n())return!1;const l=o();return r(l.rootClientId)[l.index]===t}),[t]),v=(0,d.useViewportMatch)("medium"),b=(0,s.useRef)(!1),{stopTyping:k}=(0,m.useDispatch)(Qn),_=a,y=!a&&!f&&v&&!u&&!(!p&&!a&&o)&&!p,E=!(a||y||f||o);(0,tu.useShortcut)("core/block-editor/focus-toolbar",(()=>{b.current=!0,k(!0)}),{isDisabled:!E}),(0,s.useEffect)((()=>{b.current=!1}));const C=(0,s.useRef)();return _||y?(0,s.createElement)(Vo,{clientId:r||t,bottomClientId:g,className:c()("block-editor-block-list__block-popover",{"is-insertion-point-visible":h}),__unstablePopoverSlot:l,__unstableContentRef:i},y&&(0,s.createElement)(ff,{focusOnMount:b.current,__experimentalInitialIndex:C.current,__experimentalOnIndexChange:e=>{C.current=e},key:t}),_&&(0,s.createElement)($p,{clientId:t,rootClientId:n})):null}function vf(e){const{getSelectedBlockClientId:t,getFirstMultiSelectedBlockClientId:n,getBlockRootClientId:o,getBlock:l,getBlockParents:i,__experimentalGetBlockListSettingsForBlocks:s}=e(Qn),a=t()||n();if(!a)return;const{name:c,attributes:d={}}=l(a)||{},p=i(a),m=s(p),f=(0,u.find)(p,(e=>{var t;return null===(t=m[e])||void 0===t?void 0:t.__experimentalCaptureToolbars}));return{clientId:a,rootClientId:o(a),name:c,isEmptyDefaultBlock:c&&(0,r.isUnmodifiedDefaultBlock)({name:c,attributes:d}),capturingClientId:f}}function bf(e){let{__unstablePopoverSlot:t,__unstableContentRef:n}=e;const o=(0,m.useSelect)(vf,[]);if(!o)return null;const{clientId:r,rootClientId:l,name:i,isEmptyDefaultBlock:a,capturingClientId:c}=o;return i?(0,s.createElement)(hf,{clientId:r,rootClientId:l,isEmptyDefaultBlock:a,capturingClientId:c,__unstablePopoverSlot:t,__unstableContentRef:n}):null}function kf(e){let{children:t}=e;const n=(0,s.useContext)(Ap),o=(0,s.useContext)(p.Disabled.Context);return n||o?t:(z()('wp.components.Popover.Slot name="block-toolbar"',{alternative:"wp.blockEditor.BlockTools",since:"5.8"}),(0,s.createElement)(Op,{__unstablePopoverSlot:"block-toolbar"},(0,s.createElement)(bf,{__unstablePopoverSlot:"block-toolbar"}),t))}var _f=(0,d.createHigherOrderComponent)((e=>t=>{const{clientId:n}=to();return(0,s.createElement)(e,i({},t,{clientId:n}))}),"withClientId"),yf=_f((e=>{let{clientId:t,showSeparator:n,isFloating:o,onAddBlock:r,isToggle:l}=e;return(0,s.createElement)(Rp,{className:c()({"block-list-appender__toggle":l}),rootClientId:t,showSeparator:n,isFloating:o,onAddBlock:r})})),Ef=(0,d.compose)([_f,(0,m.withSelect)(((e,t)=>{let{clientId:n}=t;const{getBlockOrder:o}=e(Qn),r=o(n);return{lastBlockClientId:(0,u.last)(r)}}))])((e=>{let{clientId:t}=e;return(0,s.createElement)(Tp,{rootClientId:t})}));const Cf=new WeakMap;function Sf(e,t){const n=(0,m.useSelect)((e=>e(Qn).getSettings().mediaUpload),[]),{canInsertBlockType:o,getBlockIndex:l,getClientIdsOfDescendants:i}=(0,m.useSelect)(Qn),{insertBlocks:s,moveBlocksToPosition:a,updateBlockAttributes:c,clearSelectedBlock:u}=(0,m.useDispatch)(Qn),d=function(e,t,n,o,l,i,s){return a=>{const{srcRootClientId:c,srcClientIds:u,type:d,blocks:p}=function(e){let t={srcRootClientId:null,srcClientIds:null,srcIndex:null,type:null,blocks:null};if(!e.dataTransfer)return t;try{t=Object.assign(t,JSON.parse(e.dataTransfer.getData("wp-blocks")))}catch(e){return t}return t}(a);if("inserter"===d){s();const n=p.map((e=>(0,r.cloneBlock)(e)));i(n,t,e,!0,null)}if("block"===d){const r=n(u[0]);if(c===e&&r===t)return;if(u.includes(e)||o(u).some((t=>t===e)))return;const i=c===e,s=u.length;l(u,c,e,i&&r<t?t-s:t)}}}(e,t,l,i,a,s,u),p=function(e,t,n,o,l,i){return s=>{if(!n)return;const a=(0,r.findTransform)((0,r.getBlockTransforms)("from"),(t=>"files"===t.type&&l(t.blockName,e)&&t.isMatch(s)));if(a){const n=a.transform(s,o);i(n,t,e)}}}(e,t,n,c,o,s),f=function(e,t,n){return o=>{const l=(0,r.pasteHandler)({HTML:o,mode:"BLOCKS"});l.length&&n(l,t,e)}}(e,t,s);return e=>{const t=(0,ul.getFilesFromDataTransfer)(e.dataTransfer),n=e.dataTransfer.getData("text/html");n?f(n):t.length?p(t):d(e)}}function wf(e,t,n){const o="top"===n||"bottom"===n,{x:r,y:l}=e,i=o?r:l,s=o?l:r,a=o?t.left:t.top,c=o?t.right:t.bottom,u=t[n];let d;return d=i>=a&&i<=c?i:i<c?a:c,Math.sqrt((i-d)**2+(s-u)**2)}function Bf(e,t){let n,o,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:["top","bottom","left","right"];return r.forEach((r=>{const l=wf(e,t,r);(void 0===n||l<n)&&(n=l,o=r)})),[n,o]}function If(e,t,n){const o="horizontal"===n?["left","right"]:["top","bottom"],r=(0,g.isRTL)();let l,i;return e.forEach(((e,n)=>{const s=e.getBoundingClientRect(),[a,c]=Bf(t,s,o);(void 0===i||a<i)&&(i=a,l=n+("bottom"===c||!r&&"right"===c||r&&"left"===c?1:0))})),l}function xf(){let{rootClientId:e=""}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const[t,n]=(0,s.useState)(null),o=(0,m.useSelect)((t=>{const{getTemplateLock:n}=t(Qn);return"all"===n(e)}),[e]),{getBlockListSettings:r}=(0,m.useSelect)(Qn),{showInsertionPoint:l,hideInsertionPoint:i}=(0,m.useDispatch)(Qn),a=Sf(e,t),c=(0,d.useThrottle)((0,s.useCallback)(((t,o)=>{var i;const s=If(Array.from(o.children).filter((e=>e.classList.contains("wp-block"))),{x:t.clientX,y:t.clientY},null===(i=r(e))||void 0===i?void 0:i.orientation);n(void 0===s?0:s),null!==s&&l(e,s)}),[]),200);return(0,d.__experimentalUseDropZone)({isDisabled:o,onDrop:a,onDragOver(e){c(e,e.currentTarget)},onDragLeave(){c.cancel(),i(),n(null)},onDragEnd(){c.cancel(),i(),n(null)}})}function Tf(e){const{clientId:t,allowedBlocks:n,__experimentalDefaultBlock:o,__experimentalDirectInsert:l,template:i,templateLock:a,wrapperRef:c,templateInsertUpdatesSelection:d,__experimentalCaptureToolbars:p,__experimentalAppenderTagName:f,renderAppender:g,orientation:h,placeholder:v,__experimentalLayout:b}=e;!function(e,t,n,o,r,l,i,a){const{updateBlockListSettings:c}=(0,m.useDispatch)(Qn),{blockListSettings:u,parentLock:d}=(0,m.useSelect)((t=>{const n=t(Qn).getBlockRootClientId(e);return{blockListSettings:t(Qn).getBlockListSettings(e),parentLock:t(Qn).getTemplateLock(n)}}),[e]),p=(0,s.useMemo)((()=>t),t);(0,s.useLayoutEffect)((()=>{const t={allowedBlocks:p,templateLock:void 0===r?d:r};if(void 0!==l&&(t.__experimentalCaptureToolbars=l),void 0!==i)t.orientation=i;else{const e=Pr(null==a?void 0:a.type);t.orientation=e.getOrientation(a)}void 0!==n&&(t.__experimentalDefaultBlock=n),void 0!==o&&(t.__experimentalDirectInsert=o),Fo()(u,t)||c(e,t)}),[e,u,p,n,o,r,d,l,i,c,a])}(t,n,o,l,a,p,h,b),function(e,t,n,o){const{getSelectedBlocksInitialCaretPosition:l}=(0,m.useSelect)(Qn),{replaceInnerBlocks:i}=(0,m.useDispatch)(Qn),a=(0,m.useSelect)((t=>t(Qn).getBlocks(e)),[e]),c=(0,s.useRef)(null);(0,s.useLayoutEffect)((()=>{if((0===a.length||"all"===n)&&!(0,u.isEqual)(t,c.current)){c.current=t;const n=(0,r.synchronizeBlocksWithTemplate)(a,t);(0,u.isEqual)(n,a)||i(e,n,0===a.length&&o&&0!==n.length,l())}}),[a,t,n,e])}(t,i,a,d);const k=(0,m.useSelect)((e=>{const n=e(Qn).getBlock(t),o=(0,r.getBlockType)(n.name);if(o&&o.providesContext)return function(e,t){Cf.has(t)||Cf.set(t,new WeakMap);const n=Cf.get(t);if(!n.has(e)){const o=(0,u.mapValues)(t.providesContext,(t=>e[t]));n.set(e,o)}return n.get(e)}(n.attributes,o)}),[t]);return(0,s.createElement)(pl,{value:k},(0,s.createElement)(zf,{rootClientId:t,renderAppender:g,__experimentalAppenderTagName:f,__experimentalLayout:b,wrapperRef:c,placeholder:v}))}function Nf(e){return jc(e),(0,s.createElement)(Tf,e)}const Pf=(0,s.forwardRef)(((e,t)=>{const n=Rf({ref:t},e);return(0,s.createElement)("div",{className:"block-editor-inner-blocks"},(0,s.createElement)("div",n))}));function Rf(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{clientId:n}=to(),o=(0,d.useViewportMatch)("medium","<"),{__experimentalCaptureToolbars:l,hasOverlay:a}=(0,m.useSelect)((e=>{if(!n)return{};const{getBlockName:t,isBlockSelected:l,hasSelectedInnerBlock:i,isNavigationMode:s}=e(Qn),a=t(n),c=s()||o;return{__experimentalCaptureToolbars:e(r.store).hasBlockSupport(a,"__experimentalExposeControlsToChildren",!1),hasOverlay:"core/template"!==a&&!l(n)&&!i(n,!0)&&c}}),[n,o]),u=(0,d.useMergeRefs)([e.ref,xf({rootClientId:n})]),p={__experimentalCaptureToolbars:l,...t},f=p.value&&p.onChange?Nf:Tf;return{...e,ref:u,className:c()(e.className,"block-editor-block-list__layout",{"has-overlay":a}),children:n?(0,s.createElement)(f,i({},p,{clientId:n})):(0,s.createElement)(zf,t)}}Rf.save=r.__unstableGetInnerBlocksProps,Pf.DefaultBlockAppender=Ef,Pf.ButtonBlockAppender=yf,Pf.Content=()=>Rf.save().children;var Mf=Pf;const Lf=(0,s.createContext)(),Af=(0,s.createContext)();function Df(e){let{className:t,...n}=e;const[o,r]=(0,s.useState)(),l=(0,d.useViewportMatch)("medium"),{isOutlineMode:i,isFocusMode:a,isNavigationMode:u}=(0,m.useSelect)((e=>{const{getSettings:t,isNavigationMode:n}=e(Qn),{outlineMode:o,focusMode:r}=t();return{isOutlineMode:o,isFocusMode:r,isNavigationMode:n()}}),[]),{setBlockVisibility:p}=(0,m.useDispatch)(Qn),f=(0,s.useMemo)((()=>{const{IntersectionObserver:e}=window;if(e)return new e((e=>{const t={};for(const n of e)t[n.target.getAttribute("data-block")]=n.isIntersecting;p(t)}))}),[]),g=Rf({ref:(0,d.useMergeRefs)([Yc(),Fp(),r]),className:c()("is-root-container",t,{"is-outline-mode":i,"is-focus-mode":a&&l,"is-navigate-mode":u})},n);return(0,s.createElement)(Lf.Provider,{value:o},(0,s.createElement)(Af.Provider,{value:f},(0,s.createElement)("div",g)))}function Of(e){return function(){const e=(0,m.useSelect)((e=>e(Qn).getSettings().__experimentalBlockPatterns),[]);(0,s.useEffect)((()=>{if(null==e||!e.length)return;let t,n=-1;const o=()=>{n++,n>=e.length||((0,m.select)(Qn).__experimentalGetParsedPattern(e[n].name),t=zp(o))};return t=zp(o),()=>Vp(t)}),[e])}(),(0,s.createElement)(kf,null,(0,s.createElement)(eo,{value:Xn},(0,s.createElement)(Df,e)))}function Ff(e){let{placeholder:t,rootClientId:n,renderAppender:o,__experimentalAppenderTagName:r,__experimentalLayout:l=Rr}=e;const{order:i,selectedBlocks:a,visibleBlocks:c}=(0,m.useSelect)((e=>{const{getBlockOrder:t,getSelectedBlockClientIds:o,__unstableGetVisibleBlocks:r}=e(Qn);return{order:t(n),selectedBlocks:o(),visibleBlocks:r()}}),[n]);return(0,s.createElement)(Lr,{value:l},i.map((e=>(0,s.createElement)(m.AsyncModeProvider,{key:e,value:!c.has(e)&&!a.includes(e)},(0,s.createElement)(Fc,{rootClientId:n,clientId:e})))),i.length<1&&t,(0,s.createElement)(Mp,{tagName:r,rootClientId:n,renderAppender:o}))}function zf(e){return(0,s.createElement)(m.AsyncModeProvider,{value:!1},(0,s.createElement)(Ff,e))}function Vf(e){return[...e].sort(((t,n)=>e.filter((e=>e===n)).length-e.filter((e=>e===t)).length)).shift()}function Hf(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if("string"==typeof e)return e;const t=Object.values(e).map((e=>(0,p.__experimentalParseQuantityAndUnitFromRawValue)(e))),n=t.map((e=>{var t;return null!==(t=e[0])&&void 0!==t?t:""})),o=t.map((e=>e[1])),r=n.every((e=>e===n[0]))?n[0]:"",l=Vf(o),i=0===r||r?`${r}${l}`:void 0;return i}function Gf(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=Hf(e),n="string"!=typeof e&&isNaN(parseFloat(t));return n}function Uf(e){return!!e&&("string"==typeof e||!!Object.values(e).filter((e=>!!e||0===e)).length)}function Wf(e){let{onChange:t,values:n,...o}=e;const r=Hf(n),l=Uf(n)&&Gf(n),a=l?(0,g.__)("Mixed"):null;return(0,s.createElement)(p.__experimentalUnitControl,i({},o,{"aria-label":(0,g.__)("Border radius"),disableUnits:l,isOnly:!0,value:r,onChange:t,placeholder:a}))}Of.__unstableElementContext=Lf;const $f={topLeft:(0,g.__)("Top left"),topRight:(0,g.__)("Top right"),bottomLeft:(0,g.__)("Bottom left"),bottomRight:(0,g.__)("Bottom right")};function jf(e){let{onChange:t,values:n,...o}=e;const r="string"!=typeof n?n:{topLeft:n,topRight:n,bottomLeft:n,bottomRight:n};return(0,s.createElement)("div",{className:"components-border-radius-control__input-controls-wrapper"},Object.entries($f).map((e=>{let[n,l]=e;return(0,s.createElement)(p.Tooltip,{text:l,position:"top",key:n},(0,s.createElement)("div",{className:"components-border-radius-control__tooltip-wrapper"},(0,s.createElement)(p.__experimentalUnitControl,i({},o,{"aria-label":l,value:r[n],onChange:(a=n,e=>{t&&t({...r,[a]:e||void 0})})}))));var a})))}var Kf=(0,s.createElement)(A.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(A.Path,{d:"M15.6 7.2H14v1.5h1.6c2 0 3.7 1.7 3.7 3.7s-1.7 3.7-3.7 3.7H14v1.5h1.6c2.8 0 5.2-2.3 5.2-5.2 0-2.9-2.3-5.2-5.2-5.2zM4.7 12.4c0-2 1.7-3.7 3.7-3.7H10V7.2H8.4c-2.9 0-5.2 2.3-5.2 5.2 0 2.9 2.3 5.2 5.2 5.2H10v-1.5H8.4c-2 0-3.7-1.7-3.7-3.7zm4.6.9h5.3v-1.5H9.3v1.5z"})),qf=(0,s.createElement)(A.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(A.Path,{d:"M15.6 7.3h-.7l1.6-3.5-.9-.4-3.9 8.5H9v1.5h2l-1.3 2.8H8.4c-2 0-3.7-1.7-3.7-3.7s1.7-3.7 3.7-3.7H10V7.3H8.4c-2.9 0-5.2 2.3-5.2 5.2 0 2.9 2.3 5.2 5.2 5.2H9l-1.4 3.2.9.4 5.7-12.5h1.4c2 0 3.7 1.7 3.7 3.7s-1.7 3.7-3.7 3.7H14v1.5h1.6c2.9 0 5.2-2.3 5.2-5.2 0-2.9-2.4-5.2-5.2-5.2z"}));function Yf(e){let{isLinked:t,...n}=e;const o=t?(0,g.__)("Unlink Radii"):(0,g.__)("Link Radii");return(0,s.createElement)(p.Tooltip,{text:o},(0,s.createElement)(p.Button,i({},n,{className:"component-border-radius-control__linked-button",isPrimary:t,isSecondary:!t,isSmall:!0,icon:t?Kf:qf,iconSize:16,"aria-label":o})))}const Zf={topLeft:null,topRight:null,bottomLeft:null,bottomRight:null},Qf={px:100,em:20,rem:20};function Xf(e){let{onChange:t,values:n}=e;const[o,r]=(0,s.useState)(!Uf(n)||!Gf(n)),l=(0,p.__experimentalUseCustomUnits)({availableUnits:So("spacing.units")||["px","em","rem"]}),i=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if("string"==typeof e){const[,t]=(0,p.__experimentalParseQuantityAndUnitFromRawValue)(e);return t||"px"}return Vf(Object.values(e).map((e=>{const[,t]=(0,p.__experimentalParseQuantityAndUnitFromRawValue)(e);return t})))||"px"}(n),a=l&&l.find((e=>e.value===i)),c=(null==a?void 0:a.step)||1,[u]=(0,p.__experimentalParseQuantityAndUnitFromRawValue)(Hf(n));return(0,s.createElement)("fieldset",{className:"components-border-radius-control"},(0,s.createElement)("legend",null,(0,g.__)("Radius")),(0,s.createElement)("div",{className:"components-border-radius-control__wrapper"},o?(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Wf,{className:"components-border-radius-control__unit-control",values:n,min:0,onChange:t,units:l}),(0,s.createElement)(p.RangeControl,{className:"components-border-radius-control__range-control",value:null!=u?u:"",min:0,max:Qf[i],initialPosition:0,withInputField:!1,onChange:e=>{t(void 0!==e?`${e}${i}`:void 0)},step:c})):(0,s.createElement)(jf,{min:0,onChange:t,values:n||Zf,units:l}),(0,s.createElement)(Yf,{onClick:()=>r(!o),isLinked:o})))}function Jf(e){var t;const{attributes:{style:n},setAttributes:o}=e;return(0,s.createElement)(Xf,{values:null==n||null===(t=n.border)||void 0===t?void 0:t.radius,onChange:e=>{let t={...n,border:{...null==n?void 0:n.border,radius:e}};void 0!==e&&""!==e||(t=Io(t)),o({style:t})}})}Hu([Gu,$u]);const eg=(e,t,n)=>{if(t){const n=(0,u.find)(e,{slug:t});if(n)return n}return{color:n}},tg=(e,t)=>(0,u.find)(e,{color:t});function ng(e,t){if(e&&t)return`has-${(0,u.kebabCase)(t)}-${e}`}function og(){return{disableCustomColors:!So("color.custom"),disableCustomGradients:!So("color.customGradient")}}function rg(){const e=og(),t=So("color.palette.custom"),n=So("color.palette.theme"),o=So("color.palette.default"),r=So("color.defaultPalette");e.colors=(0,s.useMemo)((()=>{const e=[];return n&&n.length&&e.push({name:(0,g._x)("Theme","Indicates this palette comes from the theme."),colors:n}),r&&o&&o.length&&e.push({name:(0,g._x)("Default","Indicates this palette comes from WordPress."),colors:o}),t&&t.length&&e.push({name:(0,g._x)("Custom","Indicates this palette comes from the theme."),colors:t}),e}),[o,n,t]);const l=So("color.gradients.custom"),i=So("color.gradients.theme"),a=So("color.gradients.default"),c=So("color.defaultGradients");return e.gradients=(0,s.useMemo)((()=>{const e=[];return i&&i.length&&e.push({name:(0,g._x)("Theme","Indicates this palette comes from the theme."),gradients:i}),c&&a&&a.length&&e.push({name:(0,g._x)("Default","Indicates this palette comes from WordPress."),gradients:a}),l&&l.length&&e.push({name:(0,g._x)("Custom","Indicates this palette is created by the user."),gradients:l}),e}),[l,i,a]),e}const lg="__experimentalBorder",ig=["top","right","bottom","left"],sg=e=>{var t,n;return{...e,borderColor:void 0,style:{...e.style,border:{radius:null===(t=e.style)||void 0===t||null===(n=t.border)||void 0===n?void 0:n.radius}}}},ag=(e,t,n)=>{let o;return e.some((e=>e.colors.some((e=>e[t]===n&&(o=e,!0))))),o},cg=e=>{let{colors:t,namedColor:n,customColor:o}=e;if(n){const e=ag(t,"slug",n);if(e)return e}if(!o)return{color:void 0};return ag(t,"color",o)||{color:o}};function ug(e){const t=/var:preset\|color\|(.+)/.exec(e);return t&&t[1]?t[1]:null}function dg(e){const{attributes:t,clientId:n,setAttributes:o}=e,{style:l}=t,{colors:i}=rg(),a=pg(e.name),c=So("border.color")&&pg(e.name,"color"),u=So("border.radius")&&pg(e.name,"radius"),d=So("border.style")&&pg(e.name,"style"),m=So("border.width")&&pg(e.name,"width");if([!c,!u,!d,!m].every(Boolean)||!a)return null;const f=(0,r.getBlockSupport)(e.name,[lg,"__experimentalDefaultControls"]),h=(null==f?void 0:f.color)||(null==f?void 0:f.width),v=((e,t)=>{const{borderColor:n,style:o}=e,{border:r}=o||{};if(n){const{color:e}=cg({colors:t,namedColor:n});return e?{...r,color:e}:r}if(!r)return r;const l={...r};return ig.forEach((e=>{var n;const o=ug(null===(n=l[e])||void 0===n?void 0:n.color);if(o){const{color:n}=cg({colors:t,namedColor:o});l[e]={...l[e],color:n}}})),l})(t,i);return(0,s.createElement)(Do,{__experimentalGroup:"border"},(m||c)&&(0,s.createElement)(p.__experimentalToolsPanelItem,{hasValue:()=>(e=>{const{borderColor:t,style:n}=e.attributes;return(0,p.__experimentalIsDefinedBorder)(null==n?void 0:n.border)||!!t})(e),label:(0,g.__)("Border"),onDeselect:()=>(e=>{var t;let{attributes:n={},setAttributes:o}=e;const{style:r}=n;o({borderColor:void 0,style:{...r,border:Io({radius:null==r||null===(t=r.border)||void 0===t?void 0:t.radius})}})})(e),isShownByDefault:h,resetAllFilter:sg,panelId:n},(0,s.createElement)(p.__experimentalBorderBoxControl,{colors:i,enableAlpha:!0,onChange:e=>{var t;let n,r={...e};if((0,p.__experimentalHasSplitBorders)(e))r={top:{...e.top},right:{...e.right},bottom:{...e.bottom},left:{...e.left}},ig.forEach((t=>{var n;if(null!==(n=e[t])&&void 0!==n&&n.color){var o;const n=cg({colors:i,customColor:null===(o=e[t])||void 0===o?void 0:o.color});n.slug&&(r[t].color=`var:preset|color|${n.slug}`)}}));else if(null!=e&&e.color){const t=null==e?void 0:e.color,o=cg({colors:i,customColor:t});o.slug&&(n=o.slug,r.color=void 0)}const s=Io({...l,border:{radius:null==l||null===(t=l.border)||void 0===t?void 0:t.radius,...r}});o({style:s,borderColor:n})},popoverPlacement:"left-start",popoverOffset:40,showStyle:d,value:v,__experimentalHasMultipleOrigins:!0,__experimentalIsRenderedInSidebar:!0})),u&&(0,s.createElement)(p.__experimentalToolsPanelItem,{hasValue:()=>function(e){var t,n;const o=null===(t=e.attributes.style)||void 0===t||null===(n=t.border)||void 0===n?void 0:n.radius;return"object"==typeof o?Object.entries(o).some(Boolean):!!o}(e),label:(0,g.__)("Radius"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:mg(o,"radius")})}(e),isShownByDefault:null==f?void 0:f.radius,resetAllFilter:e=>{var t;return{...e,style:{...e.style,border:{...null===(t=e.style)||void 0===t?void 0:t.border,radius:void 0}}}},panelId:n},(0,s.createElement)(Jf,e)))}function pg(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"any";if("web"!==s.Platform.OS)return!1;const n=(0,r.getBlockSupport)(e,lg);return!!(!0===n||("any"===t?null!=n&&n.color||null!=n&&n.radius||null!=n&&n.width||null!=n&&n.style:null!=n&&n[t]))}function mg(e,t){return Io({...e,border:{...null==e?void 0:e.border,[t]:void 0}})}function fg(e,t,n){if(!pg(t,"color")||No(t,lg,"color"))return e;const o=gg(n),r=c()(e.className,o);return e.className=r||void 0,e}function gg(e){var t;const{borderColor:n,style:o}=e,r=ng("border-color",n);return c()({"has-border-color":n||(null==o||null===(t=o.border)||void 0===t?void 0:t.color),[r]:!!r})}const hg=(0,d.createHigherOrderComponent)((e=>t=>{var n,o,r,l,a,c,u,d,p;const{name:m,attributes:f}=t,{borderColor:g,style:h}=f,{colors:v}=rg();if(!pg(m,"color")||No(m,lg,"color"))return(0,s.createElement)(e,t);const{color:b}=cg({colors:v,namedColor:g}),{color:k}=cg({colors:v,namedColor:ug(null==h||null===(n=h.border)||void 0===n||null===(o=n.top)||void 0===o?void 0:o.color)}),{color:_}=cg({colors:v,namedColor:ug(null==h||null===(r=h.border)||void 0===r||null===(l=r.right)||void 0===l?void 0:l.color)}),{color:y}=cg({colors:v,namedColor:ug(null==h||null===(a=h.border)||void 0===a||null===(c=a.bottom)||void 0===c?void 0:c.color)}),{color:E}=cg({colors:v,namedColor:ug(null==h||null===(u=h.border)||void 0===u||null===(d=u.left)||void 0===d?void 0:d.color)}),C={borderTopColor:k||b,borderRightColor:_||b,borderBottomColor:y||b,borderLeftColor:E||b};let S=t.wrapperProps;return S={...t.wrapperProps,style:{...null===(p=t.wrapperProps)||void 0===p?void 0:p.style,...C}},(0,s.createElement)(e,i({},t,{wrapperProps:S}))}));function vg(e){if(e)return`has-${e}-gradient-background`}function bg(e,t){const n=(0,u.find)(e,["slug",t]);return n&&n.gradient}function kg(e,t){return(0,u.find)(e,["gradient",t])}function _g(e,t){const n=kg(e,t);return n&&n.slug}function yg(){let{gradientAttribute:e="gradient",customGradientAttribute:t="customGradient"}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{clientId:n}=to(),o=So("color.gradients.custom"),r=So("color.gradients.theme"),l=So("color.gradients.default"),i=(0,s.useMemo)((()=>[...o||[],...r||[],...l||[]]),[o,r,l]),{gradient:a,customGradient:c}=(0,m.useSelect)((o=>{const{getBlockAttributes:r}=o(Qn),l=r(n)||{};return{customGradient:l[t],gradient:l[e]}}),[n,e,t]),{updateBlockAttributes:u}=(0,m.useDispatch)(Qn),d=(0,s.useCallback)((o=>{const r=_g(i,o);u(n,r?{[e]:r,[t]:void 0}:{[e]:void 0,[t]:o})}),[i,n,u]),p=vg(a);let f;return f=a?bg(i,a):c,{gradientClass:p,gradientValue:f,setGradient:d}}(0,l.addFilter)("blocks.registerBlockType","core/border/addAttributes",(function(e){return pg(e,"color")?e.attributes.borderColor?e:{...e,attributes:{...e.attributes,borderColor:{type:"string"}}}:e})),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/border/addSaveProps",fg),(0,l.addFilter)("blocks.registerBlockType","core/border/addEditProps",(function(e){if(!pg(e,"color")||No(e,lg,"color"))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),fg(o,e,n)},e})),(0,l.addFilter)("editor.BlockListBlock","core/border/with-border-color-palette-styles",hg);const Eg=["colors","disableCustomColors","gradients","disableCustomGradients"];function Cg(e){let{colors:t,gradients:n,disableCustomColors:o,disableCustomGradients:r,__experimentalHasMultipleOrigins:l,__experimentalIsRenderedInSidebar:i,className:a,label:d,onColorChange:m,onGradientChange:f,colorValue:h,gradientValue:v,clearable:b,showTitle:k=!0,enableAlpha:_}=e;const y=m&&(!(0,u.isEmpty)(t)||!o),E=f&&(!(0,u.isEmpty)(n)||!r),[C,S]=(0,s.useState)(v?"gradient":!!y&&"color");return y||E?(0,s.createElement)(p.BaseControl,{className:c()("block-editor-color-gradient-control",a)},(0,s.createElement)("fieldset",{className:"block-editor-color-gradient-control__fieldset"},(0,s.createElement)(p.__experimentalVStack,{spacing:1},k&&(0,s.createElement)("legend",null,(0,s.createElement)("div",{className:"block-editor-color-gradient-control__color-indicator"},(0,s.createElement)(p.BaseControl.VisualLabel,null,d))),y&&E&&(0,s.createElement)(p.__experimentalToggleGroupControl,{value:C,onChange:S,label:(0,g.__)("Select color type"),hideLabelFromVision:!0,isBlock:!0},(0,s.createElement)(p.__experimentalToggleGroupControlOption,{value:"color",label:(0,g.__)("Solid")}),(0,s.createElement)(p.__experimentalToggleGroupControlOption,{value:"gradient",label:(0,g.__)("Gradient")})),("color"===C||!E)&&(0,s.createElement)(p.ColorPalette,{value:h,onChange:E?e=>{m(e),f()}:m,colors:t,disableCustomColors:o,__experimentalHasMultipleOrigins:l,__experimentalIsRenderedInSidebar:i,clearable:b,enableAlpha:_}),("gradient"===C||!y)&&(0,s.createElement)(p.GradientPicker,{value:v,onChange:y?e=>{f(e),m()}:f,gradients:n,disableCustomGradients:r,__experimentalHasMultipleOrigins:l,__experimentalIsRenderedInSidebar:i,clearable:b})))):null}function Sg(e){const t={};return t.colors=So("color.palette"),t.gradients=So("color.gradients"),t.disableCustomColors=!So("color.custom"),t.disableCustomGradients=!So("color.customGradient"),(0,s.createElement)(Cg,i({},t,e))}var wg=function(e){return(0,u.every)(Eg,(t=>e.hasOwnProperty(t)))?(0,s.createElement)(Cg,e):(0,s.createElement)(Sg,e)};const Bg=e=>{let{setting:t,children:n,panelId:o,...r}=e;return(0,s.createElement)(p.__experimentalToolsPanelItem,i({hasValue:()=>!!t.colorValue||!!t.gradientValue,label:t.label,onDeselect:()=>{t.colorValue?t.onColorChange():t.gradientValue&&t.onGradientChange()},isShownByDefault:void 0===t.isShownByDefault||t.isShownByDefault},r,{className:"block-editor-tools-panel-color-gradient-settings__item",panelId:o,resetAllFilter:t.resetAllFilter}),n)},Ig=e=>{let{colorValue:t,label:n}=e;return(0,s.createElement)(p.__experimentalHStack,{justify:"flex-start"},(0,s.createElement)(p.ColorIndicator,{className:"block-editor-panel-color-gradient-settings__color-indicator",colorValue:t}),(0,s.createElement)(p.FlexItem,null,n))},xg=e=>t=>{let{onToggle:n,isOpen:o}=t;const{colorValue:r,label:l}=e,i={onClick:n,className:c()("block-editor-panel-color-gradient-settings__dropdown",{"is-open":o}),"aria-expanded":o};return(0,s.createElement)(p.Button,i,(0,s.createElement)(Ig,{colorValue:r,label:l}))};function Tg(e){let t,{colors:n,disableCustomColors:o,disableCustomGradients:r,enableAlpha:l,gradients:a,settings:c,__experimentalHasMultipleOrigins:u,__experimentalIsRenderedInSidebar:d,...m}=e;return d&&(t={placement:"left-start",offset:36}),(0,s.createElement)(s.Fragment,null,c.map(((e,c)=>{var f;const g={clearable:!1,colorValue:e.colorValue,colors:n,disableCustomColors:o,disableCustomGradients:r,enableAlpha:l,gradientValue:e.gradientValue,gradients:a,label:e.label,onColorChange:e.onColorChange,onGradientChange:e.onGradientChange,showTitle:!1,__experimentalHasMultipleOrigins:u,__experimentalIsRenderedInSidebar:d,...e},h={colorValue:null!==(f=e.gradientValue)&&void 0!==f?f:e.colorValue,label:e.label};return e&&(0,s.createElement)(Bg,i({key:c,setting:e},m),(0,s.createElement)(p.Dropdown,{popoverProps:t,className:"block-editor-tools-panel-color-gradient-settings__dropdown",contentClassName:"block-editor-panel-color-gradient-settings__dropdown-content",renderToggle:xg(h),renderContent:()=>(0,s.createElement)(wg,g)}))})))}Hu([Gu,$u]);var Ng=function(e){let{backgroundColor:t,fallbackBackgroundColor:n,fallbackTextColor:o,fallbackLinkColor:r,fontSize:l,isLargeText:i,textColor:a,linkColor:c,enableAlphaChecker:u=!1}=e;const d=t||n;if(!d)return null;const m=a||o,f=c||r;if(!m&&!f)return null;const h=[{color:m,description:(0,g.__)("text color")},{color:f,description:(0,g.__)("link color")}],v=zu(d),b=v.alpha()<1,k=v.brightness(),_={level:"AA",size:i||!1!==i&&l>=24?"large":"small"};let y="",E="";for(const e of h){if(!e.color)continue;const t=zu(e.color),n=t.isReadable(v,_),o=t.alpha()<1;if(!n){if(b||o)continue;y=k<t.brightness()?(0,g.sprintf)(// translators: %s is a type of text color, e.g., "text color" or "link color".
|
65 |
(0,g.__)("This color combination may be hard for people to read. Try using a darker background color and/or a brighter %s."),e.description):(0,g.sprintf)(// translators: %s is a type of text color, e.g., "text color" or "link color".
|
66 |
+
(0,g.__)("This color combination may be hard for people to read. Try using a brighter background color and/or a darker %s."),e.description),E=(0,g.__)("This color combination may be hard for people to read.");break}o&&u&&(y=(0,g.__)("Transparent text may be hard for people to read."),E=(0,g.__)("Transparent text may be hard for people to read."))}return y?((0,Ht.speak)(E),(0,s.createElement)("div",{className:"block-editor-contrast-checker"},(0,s.createElement)(p.Notice,{spokenMessage:null,status:"warning",isDismissible:!1},y))):null};function Pg(e){return e.ownerDocument.defaultView.getComputedStyle(e)}function Rg(e){let{enableAlpha:t=!1,settings:n,clientId:o,enableContrastChecking:r=!0}=e;const[l,a]=(0,s.useState)(),[c,u]=(0,s.useState)(),[d,p]=(0,s.useState)(),m=ko(o);(0,s.useEffect)((()=>{var e;if(!r)return;if(!m.current)return;u(Pg(m.current).color);const t=null===(e=m.current)||void 0===e?void 0:e.querySelector("a");t&&t.innerText&&p(Pg(t).color);let n=m.current,o=Pg(n).backgroundColor;for(;"rgba(0, 0, 0, 0)"===o&&n.parentNode&&n.parentNode.nodeType===n.parentNode.ELEMENT_NODE;)n=n.parentNode,o=Pg(n).backgroundColor;a(o)}));const f=rg();return(0,s.createElement)(Do,{__experimentalGroup:"color"},(0,s.createElement)(Tg,i({enableAlpha:t,panelId:o,settings:n,__experimentalIsItemGroup:!1,__experimentalHasMultipleOrigins:!0,__experimentalIsRenderedInSidebar:!0},f)),r&&(0,s.createElement)(Ng,{backgroundColor:l,textColor:c,enableAlphaChecker:t,linkColor:d}))}const Mg="color",Lg=e=>{const t=(0,r.getBlockSupport)(e,Mg);return t&&(!0===t.link||!0===t.gradient||!1!==t.background||!1!==t.text)},Ag=e=>{if("web"!==s.Platform.OS)return!1;const t=(0,r.getBlockSupport)(e,Mg);return(0,u.isObject)(t)&&!!t.link},Dg=e=>{const t=(0,r.getBlockSupport)(e,Mg);return(0,u.isObject)(t)&&!!t.gradients},Og=e=>{const t=(0,r.getBlockSupport)(e,Mg);return t&&!1!==t.background},Fg=e=>{const t=(0,r.getBlockSupport)(e,Mg);return t&&!1!==t.text},zg=(e,t)=>Io(xo(t,e,void 0)),Vg=e=>({textColor:void 0,style:zg(["color","text"],e.style)}),Hg=e=>({style:zg(["elements","link","color","text"],e.style)}),Gg=e=>{var t;return{backgroundColor:void 0,gradient:void 0,style:{...e.style,color:{...null===(t=e.style)||void 0===t?void 0:t.color,background:void 0,gradient:void 0}}}};function Ug(e,t,n){var o,r,l,i,s,a;if(!Lg(t)||No(t,Mg))return e;const u=Dg(t),{backgroundColor:d,textColor:p,gradient:m,style:f}=n,g=e=>!No(t,Mg,e),h=g("text")?ng("color",p):void 0,v=g("gradients")?vg(m):void 0,b=g("background")?ng("background-color",d):void 0,k=g("background")||g("gradients"),_=d||(null==f||null===(o=f.color)||void 0===o?void 0:o.background)||u&&(m||(null==f||null===(r=f.color)||void 0===r?void 0:r.gradient)),y=c()(e.className,h,v,{[b]:!(u&&null!=f&&null!==(l=f.color)&&void 0!==l&&l.gradient||!b),"has-text-color":g("text")&&(p||(null==f||null===(i=f.color)||void 0===i?void 0:i.text)),"has-background":k&&_,"has-link-color":g("link")&&(null==f||null===(s=f.elements)||void 0===s||null===(a=s.link)||void 0===a?void 0:a.color)});return e.className=y||void 0,e}const Wg=(e,t)=>{const n=/var:preset\|color\|(.+)/.exec(t);return n&&n[1]?eg(e,n[1]).color:t};function $g(e){var t,n,o,l,i,a,c,u,d;const{name:p,attributes:m}=e,f=So("color.palette.custom"),h=So("color.palette.theme"),v=So("color.palette.default"),b=(0,s.useMemo)((()=>[...f||[],...h||[],...v||[]]),[f,h,v]),k=So("color.gradients.custom"),_=So("color.gradients.theme"),y=So("color.gradients.default"),E=(0,s.useMemo)((()=>[...k||[],..._||[],...y||[]]),[k,_,y]),C=So("color.custom"),S=So("color.customGradient"),w=So("color.background"),B=So("color.link"),I=So("color.text"),x=C||!h||(null==h?void 0:h.length)>0,T=S||!_||(null==_?void 0:_.length)>0,N=(0,s.useRef)(m);if((0,s.useEffect)((()=>{N.current=m}),[m]),!Lg(p))return null;const P=Ag(p)&&B&&x,R=Fg(p)&&I&&x,M=Og(p)&&w&&x,L=Dg(p)&&T;if(!(P||R||M||L))return null;const{style:A,textColor:D,backgroundColor:O,gradient:F}=m;let z;if(L&&F)z=bg(E,F);else if(L){var V;z=null==A||null===(V=A.color)||void 0===V?void 0:V.gradient}const H=t=>n=>{var o,r;const l=tg(b,n),i=t+"Color",s={...N.current.style,color:{...null===(o=N.current)||void 0===o||null===(r=o.style)||void 0===r?void 0:r.color,[t]:null!=l&&l.slug?void 0:n}},a=null!=l&&l.slug?l.slug:void 0,c={style:Io(s),[i]:a};e.setAttributes(c),N.current={...N.current,...c}},G=!("web"!==s.Platform.OS||F||null!=A&&null!==(t=A.color)&&void 0!==t&&t.gradient),U=(0,r.getBlockSupport)(e.name,[Mg,"__experimentalDefaultControls"]);return(0,s.createElement)(Rg,{enableContrastChecking:G,clientId:e.clientId,enableAlpha:!0,settings:[...R?[{label:(0,g.__)("Text"),onColorChange:H("text"),colorValue:eg(b,D,null==A||null===(n=A.color)||void 0===n?void 0:n.text).color,isShownByDefault:null==U?void 0:U.text,resetAllFilter:Vg}]:[],...M||L?[{label:(0,g.__)("Background"),onColorChange:M?H("background"):void 0,colorValue:eg(b,O,null==A||null===(o=A.color)||void 0===o?void 0:o.background).color,gradientValue:z,onGradientChange:L?t=>{const n=_g(E,t);let o;if(n){var r,l,i;const e={...null===(r=N.current)||void 0===r?void 0:r.style,color:{...null===(l=N.current)||void 0===l||null===(i=l.style)||void 0===i?void 0:i.color,gradient:void 0}};o={style:Io(e),gradient:n}}else{var s,a,c;const e={...null===(s=N.current)||void 0===s?void 0:s.style,color:{...null===(a=N.current)||void 0===a||null===(c=a.style)||void 0===c?void 0:c.color,gradient:t}};o={style:Io(e),gradient:void 0}}e.setAttributes(o),N.current={...N.current,...o}}:void 0,isShownByDefault:null==U?void 0:U.background,resetAllFilter:Gg}]:[],...P?[{label:(0,g.__)("Link"),onColorChange:t=>{var n;const o=tg(b,t),r=null!=o&&o.slug?`var:preset|color|${o.slug}`:t,l=Io(xo(null===(n=N.current)||void 0===n?void 0:n.style,["elements","link","color","text"],r));e.setAttributes({style:l}),N.current={...N.current,style:l}},colorValue:Wg(b,null==A||null===(l=A.elements)||void 0===l||null===(i=l.link)||void 0===i||null===(a=i.color)||void 0===a?void 0:a.text),clearable:!(null==A||null===(c=A.elements)||void 0===c||null===(u=c.link)||void 0===u||null===(d=u.color)||void 0===d||!d.text),isShownByDefault:null==U?void 0:U.link,resetAllFilter:Hg}]:[]]})}const jg=(0,d.createHigherOrderComponent)((e=>t=>{var n;const{name:o,attributes:r}=t,{backgroundColor:l,textColor:a}=r,c=So("color.palette.custom")||[],u=So("color.palette.theme")||[],d=So("color.palette.default")||[],p=(0,s.useMemo)((()=>[...c||[],...u||[],...d||[]]),[c,u,d]);if(!Lg(o)||No(o,Mg))return(0,s.createElement)(e,t);const m={};var f,g;a&&!No(o,Mg,"text")&&(m.color=null===(f=eg(p,a))||void 0===f?void 0:f.color),l&&!No(o,Mg,"background")&&(m.backgroundColor=null===(g=eg(p,l))||void 0===g?void 0:g.color);let h=t.wrapperProps;return h={...t.wrapperProps,style:{...m,...null===(n=t.wrapperProps)||void 0===n?void 0:n.style}},(0,s.createElement)(e,i({},t,{wrapperProps:h}))})),Kg={linkColor:[["style","elements","link","color","text"]],textColor:[["textColor"],["style","color","text"]],backgroundColor:[["backgroundColor"],["style","color","background"]],gradient:[["gradient"],["style","color","gradient"]]};(0,l.addFilter)("blocks.registerBlockType","core/color/addAttribute",(function(e){return Lg(e)?(e.attributes.backgroundColor||Object.assign(e.attributes,{backgroundColor:{type:"string"}}),e.attributes.textColor||Object.assign(e.attributes,{textColor:{type:"string"}}),Dg(e)&&!e.attributes.gradient&&Object.assign(e.attributes,{gradient:{type:"string"}}),e):e})),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/color/addSaveProps",Ug),(0,l.addFilter)("blocks.registerBlockType","core/color/addEditProps",(function(e){if(!Lg(e)||No(e,Mg))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),Ug(o,e,n)},e})),(0,l.addFilter)("editor.BlockListBlock","core/color/with-color-palette-styles",jg),(0,l.addFilter)("blocks.switchToBlockType.transformedBlock","core/color/addTransforms",(function(e,t,n,o){const r=e.name;return To({linkColor:Ag(r),textColor:Fg(r),backgroundColor:Og(r),gradient:Dg(r)},Kg,e,t,n,o)}));const qg=[{name:(0,g._x)("Regular","font style"),value:"normal"},{name:(0,g._x)("Italic","font style"),value:"italic"}],Yg=[{name:(0,g._x)("Thin","font weight"),value:"100"},{name:(0,g._x)("Extra Light","font weight"),value:"200"},{name:(0,g._x)("Light","font weight"),value:"300"},{name:(0,g._x)("Regular","font weight"),value:"400"},{name:(0,g._x)("Medium","font weight"),value:"500"},{name:(0,g._x)("Semi Bold","font weight"),value:"600"},{name:(0,g._x)("Bold","font weight"),value:"700"},{name:(0,g._x)("Extra Bold","font weight"),value:"800"},{name:(0,g._x)("Black","font weight"),value:"900"}],Zg=(e,t)=>e?t?(0,g.__)("Appearance"):(0,g.__)("Font style"):(0,g.__)("Font weight");function Qg(e){const{onChange:t,hasFontStyles:n=!0,hasFontWeights:o=!0,value:{fontStyle:r,fontWeight:l}}=e,i=n||o,a=Zg(n,o),c={key:"default",name:(0,g.__)("Default"),style:{fontStyle:void 0,fontWeight:void 0}},u=(0,s.useMemo)((()=>n&&o?(()=>{const e=[c];return qg.forEach((t=>{let{name:n,value:o}=t;Yg.forEach((t=>{let{name:r,value:l}=t;const i="normal"===o?r:(0,g.sprintf)(
|
67 |
/* translators: 1: Font weight name. 2: Font style name. */
|
68 |
+
(0,g.__)("%1$s %2$s"),r,n);e.push({key:`${o}-${l}`,name:i,style:{fontStyle:o,fontWeight:l}})}))})),e})():n?(()=>{const e=[c];return qg.forEach((t=>{let{name:n,value:o}=t;e.push({key:o,name:n,style:{fontStyle:o,fontWeight:void 0}})})),e})():(()=>{const e=[c];return Yg.forEach((t=>{let{name:n,value:o}=t;e.push({key:o,name:n,style:{fontStyle:void 0,fontWeight:o}})})),e})()),[e.options]),d=u.find((e=>e.style.fontStyle===r&&e.style.fontWeight===l))||u[0];return i&&(0,s.createElement)(p.CustomSelectControl,{className:"components-font-appearance-control",label:a,describedBy:d?n?o?(0,g.sprintf)(// translators: %s: Currently selected font appearance.
|
69 |
(0,g.__)("Currently selected font appearance: %s"),d.name):(0,g.sprintf)(// translators: %s: Currently selected font style.
|
70 |
(0,g.__)("Currently selected font style: %s"),d.name):(0,g.sprintf)(// translators: %s: Currently selected font weight.
|
71 |
+
(0,g.__)("Currently selected font weight: %s"),d.name):(0,g.__)("No selected font appearance"),options:u,value:d,onChange:e=>{let{selectedItem:n}=e;return t(n.style)}})}var Xg=e=>{let{value:t,onChange:n,__nextHasNoMarginBottom:o=!1,__unstableInputWidth:r="60px"}=e;const l=function(e){return void 0!==e&&""!==e}(t),i=l?t:"";o||z()("Bottom margin styles for wp.blockEditor.LineHeightControl",{since:"6.0",version:"6.4",hint:"Set the `__nextHasNoMarginBottom` prop to true to start opting into the new styles, which will become the default in a future version"});const a=o?void 0:{marginBottom:24};return(0,s.createElement)("div",{className:"block-editor-line-height-control",style:a},(0,s.createElement)(p.__experimentalNumberControl,{__unstableInputWidth:r,__unstableStateReducer:(e,t)=>{var n;const o=["insertText","insertFromPaste"].includes(null===(n=t.payload.event.nativeEvent)||void 0===n?void 0:n.inputType),r=((e,t)=>{if(l)return e;switch(`${e}`){case"0.1":return 1.6;case"0":return t?e:1.4;case"":return 1.5;default:return e}})(e.value,o);return{...e,value:r}},onChange:n,label:(0,g.__)("Line height"),placeholder:1.5,step:.1,value:i,min:0}))};const Jg="typography.lineHeight";function eh(e){var t;const{attributes:{style:n},setAttributes:o}=e;return(0,s.createElement)(Xg,{__unstableInputWidth:"100%",__nextHasNoMarginBottom:!0,value:null==n||null===(t=n.typography)||void 0===t?void 0:t.lineHeight,onChange:e=>{const t={...n,typography:{...null==n?void 0:n.typography,lineHeight:e}};o({style:Io(t)})}})}function th(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!So("typography.lineHeight");return!(0,r.hasBlockSupport)(e,Jg)||t}const nh="typography.__experimentalFontStyle",oh="typography.__experimentalFontWeight";function rh(e){var t,n;const{attributes:{style:o},setAttributes:r}=e,l=!lh(e),i=!ih(e),a=null==o||null===(t=o.typography)||void 0===t?void 0:t.fontStyle,c=null==o||null===(n=o.typography)||void 0===n?void 0:n.fontWeight;return(0,s.createElement)(Qg,{onChange:e=>{r({style:Io({...o,typography:{...null==o?void 0:o.typography,fontStyle:e.fontStyle,fontWeight:e.fontWeight}})})},hasFontStyles:l,hasFontWeights:i,value:{fontStyle:a,fontWeight:c}})}function lh(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=(0,r.hasBlockSupport)(e,nh),n=So("typography.fontStyle");return!t||!n}function ih(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=(0,r.hasBlockSupport)(e,oh),n=So("typography.fontWeight");return!t||!n}function sh(e){const t=lh(e),n=ih(e);return t&&n}function ah(e){let{value:t="",onChange:n,fontFamilies:o,...r}=e;const l=So("typography.fontFamilies");if(o||(o=l),(0,u.isEmpty)(o))return null;const a=[{value:"",label:(0,g.__)("Default")},...o.map((e=>{let{fontFamily:t,name:n}=e;return{value:t,label:n||t}}))];return(0,s.createElement)(p.SelectControl,i({label:(0,g.__)("Font family"),options:a,value:t,onChange:n,labelPosition:"top"},r))}const ch="typography.__experimentalFontFamily";function uh(e,t,n){if(!(0,r.hasBlockSupport)(t,ch))return e;if(No(t,Gh,"fontFamily"))return e;if(null==n||!n.fontFamily)return e;const o=new(gm())(e.className);o.add(`has-${(0,u.kebabCase)(null==n?void 0:n.fontFamily)}-font-family`);const l=o.value;return e.className=l||void 0,e}function dh(e){var t;let{setAttributes:n,attributes:{fontFamily:o}}=e;const r=So("typography.fontFamilies"),l=null===(t=(0,u.find)(r,(e=>{let{slug:t}=e;return o===t})))||void 0===t?void 0:t.fontFamily;return(0,s.createElement)(ah,{className:"block-editor-hooks-font-family-control",fontFamilies:r,value:l,onChange:function(e){const t=(0,u.find)(r,(t=>{let{fontFamily:n}=t;return n===e}));n({fontFamily:null==t?void 0:t.slug})}})}function ph(e){let{name:t}=e;const n=So("typography.fontFamilies");return!n||0===n.length||!(0,r.hasBlockSupport)(t,ch)}(0,l.addFilter)("blocks.registerBlockType","core/fontFamily/addAttribute",(function(e){return(0,r.hasBlockSupport)(e,ch)?(e.attributes.fontFamily||Object.assign(e.attributes,{fontFamily:{type:"string"}}),e):e})),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/fontFamily/addSaveProps",uh),(0,l.addFilter)("blocks.registerBlockType","core/fontFamily/addEditProps",(function(e){if(!(0,r.hasBlockSupport)(e,ch))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),uh(o,e,n)},e}));const mh=(e,t,n)=>{if(t){const n=(0,u.find)(e,{slug:t});if(n)return n}return{size:n}};function fh(e,t){return(0,u.find)(e,{size:t})||{size:t}}function gh(e){if(e)return`has-${(0,u.kebabCase)(e)}-font-size`}var hh=function(e){const t=So("typography.fontSizes"),n=!So("typography.customFontSize");return(0,s.createElement)(p.FontSizePicker,i({},e,{fontSizes:t,disableCustomFontSizes:n}))};const vh="typography.fontSize";function bh(e,t,n){if(!(0,r.hasBlockSupport)(t,vh))return e;if(No(t,Gh,"fontSize"))return e;const o=new(gm())(e.className);o.add(gh(n.fontSize));const l=o.value;return e.className=l||void 0,e}function kh(e){var t,n;const{attributes:{fontSize:o,style:r},setAttributes:l}=e,i=So("typography.fontSizes"),a=mh(i,o,null==r||null===(t=r.typography)||void 0===t?void 0:t.fontSize),c=(null==a?void 0:a.size)||(null==r||null===(n=r.typography)||void 0===n?void 0:n.fontSize)||o;return(0,s.createElement)(hh,{onChange:e=>{const t=fh(i,e).slug;l({style:Io({...r,typography:{...null==r?void 0:r.typography,fontSize:t?void 0:e}}),fontSize:t})},value:c,withReset:!1})}function _h(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=So("typography.fontSizes"),n=!(null==t||!t.length);return!(0,r.hasBlockSupport)(e,vh)||!n}const yh=(0,d.createHigherOrderComponent)((e=>t=>{var n,o;const l=So("typography.fontSizes"),{name:i,attributes:{fontSize:a,style:c},wrapperProps:u}=t;if(!(0,r.hasBlockSupport)(i,vh)||No(i,Gh,"fontSize")||!a||null!=c&&null!==(n=c.typography)&&void 0!==n&&n.fontSize)return(0,s.createElement)(e,t);const d=mh(l,a,null==c||null===(o=c.typography)||void 0===o?void 0:o.fontSize).size,p={...t,wrapperProps:{...u,style:{fontSize:d,...null==u?void 0:u.style}}};return(0,s.createElement)(e,p)}),"withFontSizeInlineStyles"),Eh={fontSize:[["fontSize"],["style","typography","fontSize"]]};(0,l.addFilter)("blocks.registerBlockType","core/font/addAttribute",(function(e){return(0,r.hasBlockSupport)(e,vh)?(e.attributes.fontSize||Object.assign(e.attributes,{fontSize:{type:"string"}}),e):e})),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/font/addSaveProps",bh),(0,l.addFilter)("blocks.registerBlockType","core/font/addEditProps",(function(e){if(!(0,r.hasBlockSupport)(e,vh))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),bh(o,e,n)},e})),(0,l.addFilter)("editor.BlockListBlock","core/font-size/with-font-size-inline-styles",yh),(0,l.addFilter)("blocks.switchToBlockType.transformedBlock","core/font-size/addTransforms",(function(e,t,n,o){const l=e.name;return To({fontSize:(0,r.hasBlockSupport)(l,vh)},Eh,e,t,n,o)}));var Ch=(0,s.createElement)(A.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(A.Path,{d:"M7 18v1h10v-1H7zm5-2c1.5 0 2.6-.4 3.4-1.2.8-.8 1.1-2 1.1-3.5V5H15v5.8c0 1.2-.2 2.1-.6 2.8-.4.7-1.2 1-2.4 1s-2-.3-2.4-1c-.4-.7-.6-1.6-.6-2.8V5H7.5v6.2c0 1.5.4 2.7 1.1 3.5.8.9 1.9 1.3 3.4 1.3z"})),Sh=(0,s.createElement)(A.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(A.Path,{d:"M9.1 9v-.5c0-.6.2-1.1.7-1.4.5-.3 1.2-.5 2-.5.7 0 1.4.1 2.1.3.7.2 1.4.5 2.1.9l.2-1.9c-.6-.3-1.2-.5-1.9-.7-.8-.1-1.6-.2-2.4-.2-1.5 0-2.7.3-3.6 1-.8.7-1.2 1.5-1.2 2.6V9h2zM20 12H4v1h8.3c.3.1.6.2.8.3.5.2.9.5 1.1.8.3.3.4.7.4 1.2 0 .7-.2 1.1-.8 1.5-.5.3-1.2.5-2.1.5-.8 0-1.6-.1-2.4-.3-.8-.2-1.5-.5-2.2-.8L7 18.1c.5.2 1.2.4 2 .6.8.2 1.6.3 2.4.3 1.7 0 3-.3 3.9-1 .9-.7 1.3-1.6 1.3-2.8 0-.9-.2-1.7-.7-2.2H20v-1z"}));const wh=[{name:(0,g.__)("Underline"),value:"underline",icon:Ch},{name:(0,g.__)("Strikethrough"),value:"line-through",icon:Sh}];function Bh(e){let{value:t,onChange:n}=e;return(0,s.createElement)("fieldset",{className:"block-editor-text-decoration-control"},(0,s.createElement)("legend",null,(0,g.__)("Decoration")),(0,s.createElement)("div",{className:"block-editor-text-decoration-control__buttons"},wh.map((e=>(0,s.createElement)(p.Button,{key:e.value,icon:e.icon,isSmall:!0,isPressed:e.value===t,onClick:()=>n(e.value===t?void 0:e.value),"aria-label":e.name})))))}const Ih="typography.__experimentalTextDecoration";function xh(e){var t;const{attributes:{style:n},setAttributes:o}=e;return(0,s.createElement)(Bh,{value:null==n||null===(t=n.typography)||void 0===t?void 0:t.textDecoration,onChange:function(e){o({style:Io({...n,typography:{...null==n?void 0:n.typography,textDecoration:e}})})}})}function Th(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!(0,r.hasBlockSupport)(e,Ih),n=So("typography.textDecoration");return t||!n}var Nh=(0,s.createElement)(A.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(A.Path,{d:"M6.1 6.8L2.1 18h1.6l1.1-3h4.3l1.1 3h1.6l-4-11.2H6.1zm-.8 6.8L7 8.9l1.7 4.7H5.3zm15.1-.7c-.4-.5-.9-.8-1.6-1 .4-.2.7-.5.8-.9.2-.4.3-.9.3-1.4 0-.9-.3-1.6-.8-2-.6-.5-1.3-.7-2.4-.7h-3.5V18h4.2c1.1 0 2-.3 2.6-.8.6-.6 1-1.4 1-2.4-.1-.8-.3-1.4-.6-1.9zm-5.7-4.7h1.8c.6 0 1.1.1 1.4.4.3.2.5.7.5 1.3 0 .6-.2 1.1-.5 1.3-.3.2-.8.4-1.4.4h-1.8V8.2zm4 8c-.4.3-.9.5-1.5.5h-2.6v-3.8h2.6c1.4 0 2 .6 2 1.9.1.6-.1 1-.5 1.4z"})),Ph=(0,s.createElement)(A.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(A.Path,{d:"M11 16.8c-.1-.1-.2-.3-.3-.5v-2.6c0-.9-.1-1.7-.3-2.2-.2-.5-.5-.9-.9-1.2-.4-.2-.9-.3-1.6-.3-.5 0-1 .1-1.5.2s-.9.3-1.2.6l.2 1.2c.4-.3.7-.4 1.1-.5.3-.1.7-.2 1-.2.6 0 1 .1 1.3.4.3.2.4.7.4 1.4-1.2 0-2.3.2-3.3.7s-1.4 1.1-1.4 2.1c0 .7.2 1.2.7 1.6.4.4 1 .6 1.8.6.9 0 1.7-.4 2.4-1.2.1.3.2.5.4.7.1.2.3.3.6.4.3.1.6.1 1.1.1h.1l.2-1.2h-.1c-.4.1-.6 0-.7-.1zM9.2 16c-.2.3-.5.6-.9.8-.3.1-.7.2-1.1.2-.4 0-.7-.1-.9-.3-.2-.2-.3-.5-.3-.9 0-.6.2-1 .7-1.3.5-.3 1.3-.4 2.5-.5v2zm10.6-3.9c-.3-.6-.7-1.1-1.2-1.5-.6-.4-1.2-.6-1.9-.6-.5 0-.9.1-1.4.3-.4.2-.8.5-1.1.8V6h-1.4v12h1.3l.2-1c.2.4.6.6 1 .8.4.2.9.3 1.4.3.7 0 1.2-.2 1.8-.5.5-.4 1-.9 1.3-1.5.3-.6.5-1.3.5-2.1-.1-.6-.2-1.3-.5-1.9zm-1.7 4c-.4.5-.9.8-1.6.8s-1.2-.2-1.7-.7c-.4-.5-.7-1.2-.7-2.1 0-.9.2-1.6.7-2.1.4-.5 1-.7 1.7-.7s1.2.3 1.6.8c.4.5.6 1.2.6 2s-.2 1.4-.6 2z"})),Rh=(0,s.createElement)(A.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(A.Path,{d:"M7.1 6.8L3.1 18h1.6l1.1-3h4.3l1.1 3h1.6l-4-11.2H7.1zm-.8 6.8L8 8.9l1.7 4.7H6.3zm14.5-1.5c-.3-.6-.7-1.1-1.2-1.5-.6-.4-1.2-.6-1.9-.6-.5 0-.9.1-1.4.3-.4.2-.8.5-1.1.8V6h-1.4v12h1.3l.2-1c.2.4.6.6 1 .8.4.2.9.3 1.4.3.7 0 1.2-.2 1.8-.5.5-.4 1-.9 1.3-1.5.3-.6.5-1.3.5-2.1-.1-.6-.2-1.3-.5-1.9zm-1.7 4c-.4.5-.9.8-1.6.8s-1.2-.2-1.7-.7c-.4-.5-.7-1.2-.7-2.1 0-.9.2-1.6.7-2.1.4-.5 1-.7 1.7-.7s1.2.3 1.6.8c.4.5.6 1.2.6 2 .1.8-.2 1.4-.6 2z"}));const Mh=[{name:(0,g.__)("Uppercase"),value:"uppercase",icon:Nh},{name:(0,g.__)("Lowercase"),value:"lowercase",icon:Ph},{name:(0,g.__)("Capitalize"),value:"capitalize",icon:Rh}];function Lh(e){let{value:t,onChange:n}=e;return(0,s.createElement)("fieldset",{className:"block-editor-text-transform-control"},(0,s.createElement)("legend",null,(0,g.__)("Letter case")),(0,s.createElement)("div",{className:"block-editor-text-transform-control__buttons"},Mh.map((e=>(0,s.createElement)(p.Button,{key:e.value,icon:e.icon,isSmall:!0,isPressed:t===e.value,"aria-label":e.name,onClick:()=>n(t===e.value?void 0:e.value)})))))}const Ah="typography.__experimentalTextTransform";function Dh(e){var t;const{attributes:{style:n},setAttributes:o}=e;return(0,s.createElement)(Lh,{value:null==n||null===(t=n.typography)||void 0===t?void 0:t.textTransform,onChange:function(e){o({style:Io({...n,typography:{...null==n?void 0:n.typography,textTransform:e}})})}})}function Oh(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!(0,r.hasBlockSupport)(e,Ah),n=So("typography.textTransform");return t||!n}function Fh(e){let{value:t,onChange:n,__unstableInputWidth:o="60px"}=e;const r=(0,p.__experimentalUseCustomUnits)({availableUnits:So("spacing.units")||["px","em","rem"],defaultValues:{px:2,em:.2,rem:.2}});return(0,s.createElement)(p.__experimentalUnitControl,{label:(0,g.__)("Letter spacing"),value:t,__unstableInputWidth:o,units:r,onChange:n})}const zh="typography.__experimentalLetterSpacing";function Vh(e){var t;const{attributes:{style:n},setAttributes:o}=e;return(0,s.createElement)(Fh,{value:null==n||null===(t=n.typography)||void 0===t?void 0:t.letterSpacing,onChange:function(e){o({style:Io({...n,typography:{...null==n?void 0:n.typography,letterSpacing:e}})})},__unstableInputWidth:"100%"})}function Hh(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!(0,r.hasBlockSupport)(e,zh),n=So("typography.letterSpacing");return t||!n}const Gh="typography",Uh=[Jg,vh,nh,oh,ch,Ih,Ah,zh];function Wh(e){const{clientId:t}=e,n=ph(e),o=_h(e),l=sh(e),i=th(e),a=Th(e),c=Oh(e),u=Hh(e),d=!lh(e),m=!ih(e),f=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=[sh(e),_h(e),th(e),ph(e),Th(e),Oh(e),Hh(e)];return t.filter(Boolean).length===t.length}(e),h=$h(e.name);if(f||!h)return null;const v=(0,r.getBlockSupport)(e.name,[Gh,"__experimentalDefaultControls"]),b=e=>t=>{var n;return{...t,style:{...t.style,typography:{...null===(n=t.style)||void 0===n?void 0:n.typography,[e]:void 0}}}};return(0,s.createElement)(Do,{__experimentalGroup:"typography"},!n&&(0,s.createElement)(p.__experimentalToolsPanelItem,{hasValue:()=>function(e){return!!e.attributes.fontFamily}(e),label:(0,g.__)("Font family"),onDeselect:()=>function(e){let{setAttributes:t}=e;t({fontFamily:void 0})}(e),isShownByDefault:null==v?void 0:v.fontFamily,resetAllFilter:e=>({...e,fontFamily:void 0}),panelId:t},(0,s.createElement)(dh,e)),!o&&(0,s.createElement)(p.__experimentalToolsPanelItem,{hasValue:()=>function(e){var t;const{fontSize:n,style:o}=e.attributes;return!!n||!(null==o||null===(t=o.typography)||void 0===t||!t.fontSize)}(e)
|
72 |
+
/* translators: Ensure translation is distinct from "Letter case" */,label:(0,g.__)("Font size"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({fontSize:void 0,style:Io({...o,typography:{...null==o?void 0:o.typography,fontSize:void 0}})})}(e),isShownByDefault:null==v?void 0:v.fontSize,resetAllFilter:e=>{var t;return{...e,fontSize:void 0,style:{...e.style,typography:{...null===(t=e.style)||void 0===t?void 0:t.typography,fontSize:void 0}}}},panelId:t},(0,s.createElement)(kh,e)),!l&&(0,s.createElement)(p.__experimentalToolsPanelItem,{className:"single-column",hasValue:()=>function(e){var t;const{fontStyle:n,fontWeight:o}=(null===(t=e.attributes.style)||void 0===t?void 0:t.typography)||{};return!!n||!!o}(e),label:Zg(d,m),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:Io({...o,typography:{...null==o?void 0:o.typography,fontStyle:void 0,fontWeight:void 0}})})}(e),isShownByDefault:null==v?void 0:v.fontAppearance,resetAllFilter:e=>{var t;return{...e,style:{...e.style,typography:{...null===(t=e.style)||void 0===t?void 0:t.typography,fontStyle:void 0,fontWeight:void 0}}}},panelId:t},(0,s.createElement)(rh,e)),!i&&(0,s.createElement)(p.__experimentalToolsPanelItem,{className:"single-column",hasValue:()=>function(e){var t,n;return!(null===(t=e.attributes.style)||void 0===t||null===(n=t.typography)||void 0===n||!n.lineHeight)}(e),label:(0,g.__)("Line height"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:Io({...o,typography:{...null==o?void 0:o.typography,lineHeight:void 0}})})}(e),isShownByDefault:null==v?void 0:v.lineHeight,resetAllFilter:b("lineHeight"),panelId:t},(0,s.createElement)(eh,e)),!a&&(0,s.createElement)(p.__experimentalToolsPanelItem,{className:"single-column",hasValue:()=>function(e){var t,n;return!(null===(t=e.attributes.style)||void 0===t||null===(n=t.typography)||void 0===n||!n.textDecoration)}(e),label:(0,g.__)("Decoration"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:Io({...o,typography:{...null==o?void 0:o.typography,textDecoration:void 0}})})}(e),isShownByDefault:null==v?void 0:v.textDecoration,resetAllFilter:b("textDecoration"),panelId:t},(0,s.createElement)(xh,e)),!c&&(0,s.createElement)(p.__experimentalToolsPanelItem,{className:"single-column",hasValue:()=>function(e){var t,n;return!(null===(t=e.attributes.style)||void 0===t||null===(n=t.typography)||void 0===n||!n.textTransform)}(e)
|
73 |
+
/* translators: Ensure translation is distinct from "Font size" */,label:(0,g.__)("Letter case"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:Io({...o,typography:{...null==o?void 0:o.typography,textTransform:void 0}})})}(e),isShownByDefault:null==v?void 0:v.textTransform,resetAllFilter:b("textTransform"),panelId:t},(0,s.createElement)(Dh,e)),!u&&(0,s.createElement)(p.__experimentalToolsPanelItem,{className:"single-column",hasValue:()=>function(e){var t,n;return!(null===(t=e.attributes.style)||void 0===t||null===(n=t.typography)||void 0===n||!n.letterSpacing)}(e),label:(0,g.__)("Letter spacing"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:Io({...o,typography:{...null==o?void 0:o.typography,letterSpacing:void 0}})})}(e),isShownByDefault:null==v?void 0:v.letterSpacing,resetAllFilter:b("letterSpacing"),panelId:t},(0,s.createElement)(Vh,e)))}const $h=e=>Uh.some((t=>(0,r.hasBlockSupport)(e,t))),jh=[...Uh,lg,Mg,Yo],Kh=e=>jh.some((t=>(0,r.hasBlockSupport)(e,t))),qh="var:";function Yh(e){var t;return null!=e&&null!==(t=e.startsWith)&&void 0!==t&&t.call(e,qh)?`var(--wp--${e.slice(qh.length).split("|").join("--")})`:e}function Zh(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=["spacing.blockGap"],n={};Object.keys(r.__EXPERIMENTAL_STYLE_PROPERTY).forEach((o=>{const l=r.__EXPERIMENTAL_STYLE_PROPERTY[o].value,i=r.__EXPERIMENTAL_STYLE_PROPERTY[o].properties;if((0,u.has)(e,l)&&"elements"!==(null==l?void 0:l[0])){const s=(0,u.get)(e,l);r.__EXPERIMENTAL_STYLE_PROPERTY[o].useEngine||(i&&"string"!=typeof s?Object.entries(i).forEach((e=>{const[t,o]=e,r=(0,u.get)(s,[o]);r&&(n[t]=Yh(r))})):t.includes(l.join("."))||(n[o]=Yh((0,u.get)(e,l))))}}));const o=cl(e);return o.forEach((e=>{n[e.key]=e.value})),n}const Qh={"__experimentalBorder.__experimentalSkipSerialization":["border"],"color.__experimentalSkipSerialization":[Mg],[`${Gh}.__experimentalSkipSerialization`]:[Gh],[`${Yo}.__experimentalSkipSerialization`]:["spacing"]},Xh={...Qh,[`${Yo}`]:["spacing.blockGap"]},Jh={gradients:"gradient"};function ev(e,t,n){let o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Xh;if(!Kh(t))return e;let{style:l}=n;return Object.entries(o).forEach((e=>{let[n,o]=e;const i=(0,r.getBlockSupport)(t,n);!0===i&&(l=(0,u.omit)(l,o)),Array.isArray(i)&&i.forEach((e=>{const t=Jh[e]||e;l=(0,u.omit)(l,[[...o,t]])}))})),e.style={...Zh(l),...e.style},e}const tv=(0,d.createHigherOrderComponent)((e=>t=>{const n=no();return(0,s.createElement)(s.Fragment,null,n&&(0,s.createElement)(s.Fragment,null,(0,s.createElement)($g,t),(0,s.createElement)(Wh,t),(0,s.createElement)(dg,t),(0,s.createElement)(Xo,t)),(0,s.createElement)(e,t))}),"withToolbarControls"),nv=(0,d.createHigherOrderComponent)((e=>t=>{var n,o;const l=`wp-elements-${(0,d.useInstanceId)(e)}`,a=No(t.name,Mg,"link")?(0,u.omit)(null===(n=t.attributes.style)||void 0===n?void 0:n.elements,["link"]):null===(o=t.attributes.style)||void 0===o?void 0:o.elements,p=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object.entries(t).map((t=>{let[n,o]=t;const l=Zh(o);return(0,u.isEmpty)(l)?"":[`.editor-styles-wrapper .${e} ${r.__EXPERIMENTAL_ELEMENTS[n]}{`,...Object.entries(l).map((e=>{let[t,n]=e;return`\t${(0,u.kebabCase)(t)}: ${n};`})),"}"].join("\n")})).join("\n")}(l,a),m=(0,s.useContext)(Of.__unstableElementContext);return(0,s.createElement)(s.Fragment,null,a&&m&&(0,s.createPortal)((0,s.createElement)("style",{dangerouslySetInnerHTML:{__html:p}}),m),(0,s.createElement)(e,i({},t,{className:a?c()(t.className,l):t.className})))}));(0,l.addFilter)("blocks.registerBlockType","core/style/addAttribute",(function(e){return Kh(e)?(e.attributes.style||Object.assign(e.attributes,{style:{type:"object"}}),e):e})),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/style/addSaveProps",ev),(0,l.addFilter)("blocks.registerBlockType","core/style/addEditProps",(function(e){if(!Kh(e))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),ev(o,e,n,Qh)},e})),(0,l.addFilter)("editor.BlockEdit","core/style/with-block-controls",tv),(0,l.addFilter)("editor.BlockListBlock","core/editor/with-elements-styles",nv),(0,l.addFilter)("blocks.registerBlockType","core/settings/addAttribute",(function(e){var t,n;return n=e,(0,r.hasBlockSupport)(n,"__experimentalSettings",!1)?(null!=e&&null!==(t=e.attributes)&&void 0!==t&&t.settings||(e.attributes={...e.attributes,settings:{type:"object"}}),e):e}));var ov=(0,s.createElement)(A.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(A.Path,{d:"M12 4 4 19h16L12 4zm0 3.2 5.5 10.3H12V7.2z"})),rv=function(e){let{colorPalette:t,duotonePalette:n,disableCustomColors:o,disableCustomDuotone:r,value:l,onChange:i}=e;return(0,s.createElement)(p.Dropdown,{popoverProps:{className:"block-editor-duotone-control__popover",headerTitle:(0,g.__)("Duotone"),isAlternate:!0},renderToggle:e=>{let{isOpen:t,onToggle:n}=e;return(0,s.createElement)(p.ToolbarButton,{showTooltip:!0,onClick:n,"aria-haspopup":"true","aria-expanded":t,onKeyDown:e=>{t||e.keyCode!==Tc.DOWN||(e.preventDefault(),n())},label:(0,g.__)("Apply duotone filter"),icon:l?(0,s.createElement)(p.DuotoneSwatch,{values:l}):(0,s.createElement)(Ir,{icon:ov})})},renderContent:()=>(0,s.createElement)(p.MenuGroup,{label:(0,g.__)("Duotone")},(0,s.createElement)("div",{className:"block-editor-duotone-control__description"},(0,g.__)("Create a two-tone color effect without losing your original image.")),(0,s.createElement)(p.DuotonePicker,{colorPalette:t,duotonePalette:n,disableCustomColors:o,disableCustomDuotone:r,value:l,onChange:i}))})};const lv=[];function iv(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t={r:[],g:[],b:[],a:[]};return e.forEach((e=>{const n=zu(e).toRgb();t.r.push(n.r/255),t.g.push(n.g/255),t.b.push(n.b/255),t.a.push(n.a)})),t}function sv(e){let{selector:t,id:n}=e;const o=`\n${t} {\n\tfilter: url( #${n} );\n}\n`;return(0,s.createElement)("style",null,o)}function av(e){let{id:t,values:n}=e;return(0,s.createElement)(p.SVG,{xmlnsXlink:"http://www.w3.org/1999/xlink",viewBox:"0 0 0 0",width:"0",height:"0",focusable:"false",role:"none",style:{visibility:"hidden",position:"absolute",left:"-9999px",overflow:"hidden"}},(0,s.createElement)("defs",null,(0,s.createElement)("filter",{id:t},(0,s.createElement)("feColorMatrix",{colorInterpolationFilters:"sRGB",type:"matrix",values:" .299 .587 .114 0 0 .299 .587 .114 0 0 .299 .587 .114 0 0 .299 .587 .114 0 0 "}),(0,s.createElement)("feComponentTransfer",{colorInterpolationFilters:"sRGB"},(0,s.createElement)("feFuncR",{type:"table",tableValues:n.r.join(" ")}),(0,s.createElement)("feFuncG",{type:"table",tableValues:n.g.join(" ")}),(0,s.createElement)("feFuncB",{type:"table",tableValues:n.b.join(" ")}),(0,s.createElement)("feFuncA",{type:"table",tableValues:n.a.join(" ")})),(0,s.createElement)("feComposite",{in2:"SourceGraphic",operator:"in"}))))}function cv(e){let{selector:t,id:n,values:o}=e;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(av,{id:n,values:o}),(0,s.createElement)(sv,{id:n,selector:t}))}function uv(e){let{presetSetting:t,defaultSetting:n}=e;const o=!So(n),r=So(`${t}.custom`)||lv,l=So(`${t}.theme`)||lv,i=So(`${t}.default`)||lv;return(0,s.useMemo)((()=>[...r,...l,...o?lv:i]),[o,r,l,i])}function dv(e){var t;let{attributes:n,setAttributes:o}=e;const r=null==n?void 0:n.style,l=null==r||null===(t=r.color)||void 0===t?void 0:t.duotone,i=uv({presetSetting:"color.duotone",defaultSetting:"color.defaultDuotone"}),a=uv({presetSetting:"color.palette",defaultSetting:"color.defaultPalette"}),c=!So("color.custom"),u=!So("color.customDuotone")||0===(null==a?void 0:a.length)&&c;return 0===(null==i?void 0:i.length)&&u?null:(0,s.createElement)(so,{group:"block",__experimentalShareWithChildBlocks:!0},(0,s.createElement)(rv,{duotonePalette:i,colorPalette:a,disableCustomDuotone:u,disableCustomColors:c,value:l,onChange:e=>{const t={...r,color:{...null==r?void 0:r.color,duotone:e}};o({style:t})}}))}Hu([Gu]);const pv=(0,d.createHigherOrderComponent)((e=>t=>{const n=(0,r.hasBlockSupport)(t.name,"color.__experimentalDuotone");return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(e,t),n&&(0,s.createElement)(dv,t))}),"withDuotoneControls"),mv=(0,d.createHigherOrderComponent)((e=>t=>{var n,o,l;const a=(0,r.getBlockSupport)(t.name,"color.__experimentalDuotone"),u=null==t||null===(n=t.attributes)||void 0===n||null===(o=n.style)||void 0===o||null===(l=o.color)||void 0===l?void 0:l.duotone;if(!a||!u)return(0,s.createElement)(e,t);const p=`wp-duotone-${(0,d.useInstanceId)(e)}`,m=function(e,t){const n=e.split(","),o=t.split(","),r=[];return n.forEach((e=>{o.forEach((t=>{r.push(`${e.trim()} ${t.trim()}`)}))})),r.join(", ")}(`.editor-styles-wrapper .${p}`,a),f=c()(null==t?void 0:t.className,p),g=(0,s.useContext)(Of.__unstableElementContext);return(0,s.createElement)(s.Fragment,null,g&&(0,s.createPortal)((0,s.createElement)(cv,{selector:m,id:p,values:iv(u)}),g),(0,s.createElement)(e,i({},t,{className:f})))}),"withDuotoneStyles");function fv(e){let{preset:t}=e;return(0,s.createElement)(av,{id:`wp-duotone-${t.slug}`,values:iv(t.colors)})}(0,l.addFilter)("blocks.registerBlockType","core/editor/duotone/add-attributes",(function(e){return(0,r.hasBlockSupport)(e,"color.__experimentalDuotone")?(e.attributes.style||Object.assign(e.attributes,{style:{type:"object"}}),e):e})),(0,l.addFilter)("editor.BlockEdit","core/editor/duotone/with-editor-controls",pv),(0,l.addFilter)("editor.BlockListBlock","core/editor/duotone/with-styles",mv);const gv="__experimentalLayout";function hv(e){let{setAttributes:t,attributes:n,name:o}=e;const{layout:l}=n,i=So("layout"),a=(0,m.useSelect)((e=>{const{getSettings:t}=e(Qn);return t().supportsLayout}),[]),c=(0,r.getBlockSupport)(o,gv,{}),{allowSwitching:u,allowEditing:d=!0,allowInheriting:f=!0,default:h}=c;if(!d)return null;const v=!(!f||!i||null!=l&&l.type&&"default"!==(null==l?void 0:l.type)&&(null==l||!l.inherit)),b=l||h||{},{inherit:k=!1,type:_="default"}=b;if("default"===_&&!a)return null;const y=Pr(_),E=e=>t({layout:e});return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Do,null,(0,s.createElement)(p.PanelBody,{title:(0,g.__)("Layout")},v&&(0,s.createElement)(p.ToggleControl,{label:(0,g.__)("Inherit default layout"),checked:!!k,onChange:()=>t({layout:{inherit:!k}})}),!k&&u&&(0,s.createElement)(vv,{type:_,onChange:e=>t({layout:{type:e}})}),!k&&y&&(0,s.createElement)(y.inspectorControls,{layout:b,onChange:E,layoutBlockSupport:c}))),!k&&y&&(0,s.createElement)(y.toolBarControls,{layout:b,onChange:E,layoutBlockSupport:c}))}function vv(e){let{type:t,onChange:n}=e;return(0,s.createElement)(p.ButtonGroup,null,Nr.map((e=>{let{name:o,label:r}=e;return(0,s.createElement)(p.Button,{key:o,isPressed:t===o,onClick:()=>n(o)},r)})))}const bv=(0,d.createHigherOrderComponent)((e=>t=>{const{name:n}=t;return[(0,r.hasBlockSupport)(n,gv)&&(0,s.createElement)(hv,i({key:"layout"},t)),(0,s.createElement)(e,i({key:"edit"},t))]}),"withInspectorControls"),kv=(0,d.createHigherOrderComponent)((e=>t=>{const{name:n,attributes:o}=t,l=(0,r.hasBlockSupport)(n,gv),a=(0,d.useInstanceId)(e),u=So("layout")||{},p=(0,s.useContext)(Of.__unstableElementContext),{layout:m}=o,{default:f}=(0,r.getBlockSupport)(n,gv)||{},g=null!=m&&m.inherit?u:m||f||{},h=c()(null==t?void 0:t.className,{[`wp-container-${a}`]:l});return(0,s.createElement)(s.Fragment,null,l&&p&&(0,s.createPortal)((0,s.createElement)(Dr,{blockName:n,selector:`.wp-container-${a}`,layout:g,style:null==o?void 0:o.style}),p),(0,s.createElement)(e,i({},t,{className:h})))}));function _v(e){var t;const n=(null===(t=e.style)||void 0===t?void 0:t.border)||{};return{className:gg(e)||void 0,style:Zh({border:n})}}function yv(e){const{colors:t}=rg(),n=_v(e),{borderColor:o}=e;if(o){const e=cg({colors:t,namedColor:o});n.style.borderColor=e.color}return n}function Ev(e){var t,n,o,r,l,i;const{backgroundColor:s,textColor:a,gradient:u,style:d}=e,p=ng("background-color",s),m=ng("color",a),f=vg(u),g=f||(null==d||null===(t=d.color)||void 0===t?void 0:t.gradient);return{className:c()(m,f,{[p]:!g&&!!p,"has-text-color":a||(null==d||null===(n=d.color)||void 0===n?void 0:n.text),"has-background":s||(null==d||null===(o=d.color)||void 0===o?void 0:o.background)||u||(null==d||null===(r=d.color)||void 0===r?void 0:r.gradient),"has-link-color":null==d||null===(l=d.elements)||void 0===l||null===(i=l.link)||void 0===i?void 0:i.color})||void 0,style:Zh({color:(null==d?void 0:d.color)||{}})}}(0,l.addFilter)("blocks.registerBlockType","core/layout/addAttribute",(function(e){return(0,u.has)(e.attributes,["layout","type"])||(0,r.hasBlockSupport)(e,gv)&&(e.attributes={...e.attributes,layout:{type:"object"}}),e})),(0,l.addFilter)("editor.BlockListBlock","core/editor/layout/with-layout-styles",kv),(0,l.addFilter)("editor.BlockEdit","core/editor/layout/with-inspector-controls",bv);const Cv={};function Sv(e){const{backgroundColor:t,textColor:n,gradient:o}=e,r=So("color.palette.custom")||[],l=So("color.palette.theme")||[],i=So("color.palette.default")||[],a=So("color.gradients")||Cv,c=(0,s.useMemo)((()=>[...r||[],...l||[],...i||[]]),[r,l,i]),u=(0,s.useMemo)((()=>[...(null==a?void 0:a.custom)||[],...(null==a?void 0:a.theme)||[],...(null==a?void 0:a.default)||[]]),[a]),d=Ev(e);if(t){const e=eg(c,t);d.style.backgroundColor=e.color}if(o&&(d.style.background=bg(u,o)),n){const e=eg(c,n);d.style.color=e.color}return d}function wv(e){const{style:t}=e;return{style:Zh({spacing:(null==t?void 0:t.spacing)||{}})}}function Bv(e){const[t,n]=(0,s.useState)(e);return(0,s.useEffect)((()=>{e&&n(e)}),[e]),t}const Iv=e=>(0,d.createHigherOrderComponent)((t=>n=>(0,s.createElement)(t,i({},n,{colors:e}))),"withCustomColorPalette"),xv=()=>(0,d.createHigherOrderComponent)((e=>t=>{const n=So("color.palette.custom"),o=So("color.palette.theme"),r=So("color.palette.default"),l=(0,s.useMemo)((()=>[...n||[],...o||[],...r||[]]),[n,o,r]);return(0,s.createElement)(e,i({},t,{colors:l}))}),"withEditorColorPalette");function Tv(e,t){const n=(0,u.reduce)(e,((e,t)=>({...e,...(0,u.isString)(t)?{[t]:(0,u.kebabCase)(t)}:t})),{});return(0,d.compose)([t,e=>class extends s.Component{constructor(e){super(e),this.setters=this.createSetters(),this.colorUtils={getMostReadableColor:this.getMostReadableColor.bind(this)},this.state={}}getMostReadableColor(e){const{colors:t}=this.props;return function(e,t){const n=zu(t);return(0,u.maxBy)(e,(e=>{let{color:t}=e;return n.contrast(t)})).color}(t,e)}createSetters(){return(0,u.reduce)(n,((e,t,n)=>{const o=(0,u.upperFirst)(n),r=`custom${o}`;return e[`set${o}`]=this.createSetColor(n,r),e}),{})}createSetColor(e,t){return n=>{const o=tg(this.props.colors,n);this.props.setAttributes({[e]:o&&o.slug?o.slug:void 0,[t]:o&&o.slug?void 0:n})}}static getDerivedStateFromProps(e,t){let{attributes:o,colors:r}=e;return(0,u.reduce)(n,((e,n,l)=>{const i=eg(r,o[l],o[`custom${(0,u.upperFirst)(l)}`]),s=t[l];return(null==s?void 0:s.color)===i.color&&s?e[l]=s:e[l]={...i,class:ng(n,i.slug)},e}),{})}render(){return(0,s.createElement)(e,i({},this.props,{colors:void 0},this.state,this.setters,{colorUtils:this.colorUtils}))}}])}function Nv(e){return function(){const t=Iv(e);for(var n=arguments.length,o=new Array(n),r=0;r<n;r++)o[r]=arguments[r];return(0,d.createHigherOrderComponent)(Tv(o,t),"withCustomColors")}}function Pv(){const e=xv();for(var t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];return(0,d.createHigherOrderComponent)(Tv(n,e),"withColors")}const Rv=[];var Mv=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];const o=(0,u.reduce)(t,((e,t)=>(e[t]=`custom${(0,u.upperFirst)(t)}`,e)),{});return(0,d.createHigherOrderComponent)((0,d.compose)([(0,d.createHigherOrderComponent)((e=>t=>{const n=So("typography.fontSizes")||Rv;return(0,s.createElement)(e,i({},t,{fontSizes:n}))}),"withFontSizes"),e=>class extends s.Component{constructor(e){super(e),this.setters=this.createSetters(),this.state={}}createSetters(){return(0,u.reduce)(o,((e,t,n)=>(e[`set${(0,u.upperFirst)(n)}`]=this.createSetFontSize(n,t),e)),{})}createSetFontSize(e,t){return n=>{const o=(0,u.find)(this.props.fontSizes,{size:Number(n)});this.props.setAttributes({[e]:o&&o.slug?o.slug:void 0,[t]:o&&o.slug?void 0:n})}}static getDerivedStateFromProps(e,t){let{attributes:n,fontSizes:r}=e;const l=(e,o)=>!t[o]||(n[o]?n[o]!==t[o].slug:t[o].size!==n[e]);if(!(0,u.some)(o,l))return null;const i=(0,u.reduce)((0,u.pickBy)(o,l),((e,t,o)=>{const l=n[o],i=mh(r,l,n[t]);return e[o]={...i,class:gh(l)},e}),{});return{...t,...i}}render(){return(0,s.createElement)(e,i({},this.props,{fontSizes:void 0},this.state,this.setters))}}]),"withFontSizes")},Lv=(0,s.createElement)(A.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(A.Path,{d:"M4 19.8h8.9v-1.5H4v1.5zm8.9-15.6H4v1.5h8.9V4.2zm-8.9 7v1.5h16v-1.5H4z"})),Av=(0,s.createElement)(A.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(A.Path,{d:"M16.4 4.2H7.6v1.5h8.9V4.2zM4 11.2v1.5h16v-1.5H4zm3.6 8.6h8.9v-1.5H7.6v1.5z"})),Dv=(0,s.createElement)(A.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(A.Path,{d:"M11.1 19.8H20v-1.5h-8.9v1.5zm0-15.6v1.5H20V4.2h-8.9zM4 12.8h16v-1.5H4v1.5z"}));const Ov=[{icon:Lv,title:(0,g.__)("Align text left"),align:"left"},{icon:Av,title:(0,g.__)("Align text center"),align:"center"},{icon:Dv,title:(0,g.__)("Align text right"),align:"right"}],Fv={position:"bottom right",isAlternate:!0};var zv=function(e){let{value:t,onChange:n,alignmentControls:o=Ov,label:r=(0,g.__)("Align"),describedBy:l=(0,g.__)("Change text alignment"),isCollapsed:a=!0,isToolbar:c}=e;function d(e){return()=>n(t===e?void 0:e)}const m=(0,u.find)(o,(e=>e.align===t)),f=c?p.ToolbarGroup:p.ToolbarDropdownMenu,h=c?{isCollapsed:a}:{};return(0,s.createElement)(f,i({icon:m?m.icon:(0,g.isRTL)()?Dv:Lv,label:r,toggleProps:{describedBy:l},popoverProps:Fv,controls:o.map((e=>{const{align:n}=e,o=t===n;return{...e,isActive:o,role:a?"menuitemradio":void 0,onClick:d(n)}}))},h))};const Vv=e=>(0,s.createElement)(zv,i({},e,{isToolbar:!1})),Hv=e=>(0,s.createElement)(zv,i({},e,{isToolbar:!0}));var Gv={name:"blocks",className:"block-editor-autocompleters__block",triggerPrefix:"/",useItems(e){const{rootClientId:t,selectedBlockName:n}=(0,m.useSelect)((e=>{const{getSelectedBlockClientId:t,getBlockName:n,getBlockInsertionPoint:o}=e(Qn),r=t();return{selectedBlockName:r?n(r):null,rootClientId:o().rootClientId}}),[]),[o,r,l]=Md(t,u.noop),i=(0,s.useMemo)((()=>(e.trim()?op(o,r,l,e):(0,u.orderBy)(o,["frecency"],["desc"])).filter((e=>e.name!==n)).slice(0,9)),[e,n,o,r,l]);return[(0,s.useMemo)((()=>i.map((e=>{const{title:t,icon:n,isDisabled:o}=e;return{key:`block-${e.id}`,value:e,label:(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Wc,{key:"icon",icon:n,showColors:!0}),t),isDisabled:o}}))),[i])]},allowContext:(e,t)=>!(/\S/.test(e)||/\S/.test(t)),getOptionCompletion(e){const{name:t,initialAttributes:n,innerBlocks:o}=e;return{action:"replace",value:(0,r.createBlock)(t,n,(0,r.createBlocksFromInnerBlocksTemplate)(o))}}},Uv=window.wp.apiFetch,Wv=n.n(Uv),$v=(0,s.createElement)(A.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(A.Path,{d:"M7 5.5h10a.5.5 0 01.5.5v12a.5.5 0 01-.5.5H7a.5.5 0 01-.5-.5V6a.5.5 0 01.5-.5zM17 4H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V6a2 2 0 00-2-2zm-1 3.75H8v1.5h8v-1.5zM8 11h8v1.5H8V11zm6 3.25H8v1.5h6v-1.5z"})),jv=(0,s.createElement)(A.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(A.Path,{d:"m7.3 9.7 1.4 1.4c.2-.2.3-.3.4-.5 0 0 0-.1.1-.1.3-.5.4-1.1.3-1.6L12 7 9 4 7.2 6.5c-.6-.1-1.1 0-1.6.3 0 0-.1 0-.1.1-.3.1-.4.2-.6.4l1.4 1.4L4 11v1h1l2.3-2.3zM4 20h9v-1.5H4V20zm0-5.5V16h16v-1.5H4z"})),Kv={name:"links",className:"block-editor-autocompleters__link",triggerPrefix:"[[",options:async e=>{let t=await Wv()({path:(0,pp.addQueryArgs)("/wp/v2/search",{per_page:10,search:e,type:"post",order_by:"menu_order"})});return t=t.filter((e=>""!==e.title)),t},getOptionKeywords:e=>[...e.title.split(/\s+/)],getOptionLabel:e=>(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Ir,{key:"icon",icon:"page"===e.subtype?$v:jv}),e.title),getOptionCompletion:e=>(0,s.createElement)("a",{href:e.url},e.title)};const qv=[];function Yv(e){let{completers:t=qv}=e;const{name:n}=to();return(0,s.useMemo)((()=>{let e=t;return(n===(0,r.getDefaultBlockName)()||(0,r.getBlockSupport)(n,"__experimentalSlashInserter",!1))&&(e=e.concat([Gv,Kv])),(0,l.hasFilter)("editor.Autocomplete.completers")&&(e===t&&(e=e.map(u.clone)),e=(0,l.applyFilters)("editor.Autocomplete.completers",e,n)),e}),[t,n])}var Zv=function(e){return(0,s.createElement)(p.Autocomplete,i({},e,{completers:Yv(e)}))},Qv=(0,s.createElement)(A.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(A.Path,{d:"M4.2 9h1.5V5.8H9V4.2H4.2V9zm14 9.2H15v1.5h4.8V15h-1.5v3.2zM15 4.2v1.5h3.2V9h1.5V4.2H15zM5.8 15H4.2v4.8H9v-1.5H5.8V15z"})),Xv=function(e){let{isActive:t,label:n=(0,g.__)("Toggle full height"),onToggle:o,isDisabled:r}=e;return(0,s.createElement)(p.ToolbarButton,{isActive:t,icon:Qv,label:n,onClick:()=>o(!t),disabled:r})},Jv=function(e){const{label:t=(0,g.__)("Change matrix alignment"),onChange:n=u.noop,value:o="center",isDisabled:r}=e,l=(0,s.createElement)(p.__experimentalAlignmentMatrixControl.Icon,{value:o});return(0,s.createElement)(p.Dropdown,{position:"bottom right",popoverProps:{isAlternate:!0},renderToggle:e=>{let{onToggle:n,isOpen:o}=e;return(0,s.createElement)(p.ToolbarButton,{onClick:n,"aria-haspopup":"true","aria-expanded":o,onKeyDown:e=>{o||e.keyCode!==Tc.DOWN||(e.preventDefault(),n())},label:t,icon:l,showTooltip:!0,disabled:r})},renderContent:()=>(0,s.createElement)(p.__experimentalAlignmentMatrixControl,{hasFocusBorder:!1,onChange:n,value:o})})},eb=(0,s.createElement)(A.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(A.Path,{d:"M10.8622 8.04053L14.2805 12.0286L10.8622 16.0167L9.72327 15.0405L12.3049 12.0286L9.72327 9.01672L10.8622 8.04053Z"})),tb=function(e){let{rootLabelText:t}=e;const{selectBlock:n,clearSelectedBlock:o}=(0,m.useDispatch)(Qn),{clientId:r,parents:l,hasSelection:i}=(0,m.useSelect)((e=>{const{getSelectionStart:t,getSelectedBlockClientId:n,getBlockParents:o}=e(Qn),r=n();return{parents:o(r),clientId:r,hasSelection:!!t().clientId}}),[]),a=t||(0,g.__)("Document");return(0,s.createElement)("ul",{className:"block-editor-block-breadcrumb",role:"list","aria-label":(0,g.__)("Block breadcrumb")},(0,s.createElement)("li",{className:i?void 0:"block-editor-block-breadcrumb__current","aria-current":i?void 0:"true"},i&&(0,s.createElement)(p.Button,{className:"block-editor-block-breadcrumb__button",variant:"tertiary",onClick:o},a),!i&&a,!!r&&(0,s.createElement)(Ir,{icon:eb,className:"block-editor-block-breadcrumb__separator"})),l.map((e=>(0,s.createElement)("li",{key:e},(0,s.createElement)(p.Button,{className:"block-editor-block-breadcrumb__button",variant:"tertiary",onClick:()=>n(e)},(0,s.createElement)(Up,{clientId:e,maximumLength:35})),(0,s.createElement)(Ir,{icon:eb,className:"block-editor-block-breadcrumb__separator"})))),!!r&&(0,s.createElement)("li",{className:"block-editor-block-breadcrumb__current","aria-current":"true"},(0,s.createElement)(Up,{clientId:r,maximumLength:35})))};function nb(e){return(0,m.useSelect)((t=>{const{isBlockSelected:n,hasSelectedInnerBlock:o,canEditBlock:r}=t(Qn);return!r(e)||!n(e)&&!o(e,!0)}),[e])}const ob=()=>(0,s.createElement)(p.SVG,{xmlns:"https://www.w3.org/2000/svg",viewBox:"0 0 20 20"},(0,s.createElement)(p.Path,{d:"M7.434 5l3.18 9.16H8.538l-.692-2.184H4.628l-.705 2.184H2L5.18 5h2.254zm-1.13 1.904h-.115l-1.148 3.593H7.44L6.304 6.904zM14.348 7.006c1.853 0 2.9.876 2.9 2.374v4.78h-1.79v-.914h-.114c-.362.64-1.123 1.022-2.031 1.022-1.346 0-2.292-.826-2.292-2.108 0-1.27.972-2.006 2.71-2.107l1.696-.102V9.38c0-.584-.42-.914-1.18-.914-.667 0-1.112.228-1.264.647h-1.701c.12-1.295 1.307-2.107 3.066-2.107zm1.079 4.1l-1.416.09c-.793.056-1.18.342-1.18.844 0 .52.45.837 1.091.837.857 0 1.505-.545 1.505-1.256v-.515z"})),rb=e=>{let{style:t,className:n}=e;return(0,s.createElement)("div",{className:"block-library-colors-selector__icon-container"},(0,s.createElement)("div",{className:`${n} block-library-colors-selector__state-selection`,style:t},(0,s.createElement)(ob,null)))},lb=e=>{let{TextColor:t,BackgroundColor:n}=e;return e=>{let{onToggle:o,isOpen:r}=e;return(0,s.createElement)(p.ToolbarGroup,null,(0,s.createElement)(p.ToolbarButton,{className:"components-toolbar__control block-library-colors-selector__toggle",label:(0,g.__)("Open Colors Selector"),onClick:o,onKeyDown:e=>{r||e.keyCode!==Tc.DOWN||(e.preventDefault(),o())},icon:(0,s.createElement)(n,null,(0,s.createElement)(t,null,(0,s.createElement)(rb,null)))}))}};var ib=e=>{let{children:t,...n}=e;return z()("wp.blockEditor.BlockColorsStyleSelector",{alternative:"block supports API",since:"6.1",version:"6.3"}),(0,s.createElement)(p.Dropdown,{position:"bottom right",className:"block-library-colors-selector",contentClassName:"block-library-colors-selector__popover",renderToggle:lb(n),renderContent:()=>t})},sb=(0,s.createElement)(A.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(A.Path,{d:"M13.8 5.2H3v1.5h10.8V5.2zm-3.6 12v1.5H21v-1.5H10.2zm7.2-6H6.6v1.5h10.8v-1.5z"}));const ab=pc(p.__experimentalTreeGridRow);function cb(e){let{isSelected:t,position:n,level:o,rowCount:r,children:l,className:a,path:u,...d}=e;const p=gc({isSelected:t,adjustScrolling:!1,enableAnimation:!0,triggerAnimationOnChange:u});return(0,s.createElement)(ab,i({ref:p,className:c()("block-editor-list-view-leaf",a),level:o,positionInSet:n,setSize:r},d),l)}function ub(e){let{onClick:t}=e;return(0,s.createElement)("span",{className:"block-editor-list-view__expander",onClick:e=>t(e,{forceToggle:!0}),"aria-hidden":"true"},(0,s.createElement)(Ir,{icon:eb}))}var db=(0,s.forwardRef)((function(e,t){let{className:n,block:{clientId:o},onClick:r,onToggleExpanded:l,tabIndex:i,onFocus:a,onDragStart:u,onDragEnd:d,draggable:m}=e;const f=Hp(o),{isLocked:g}=qm(o);return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.Button,{className:c()("block-editor-list-view-block-select-button",n),onClick:r,onKeyDown:function(e){e.keyCode!==Tc.ENTER&&e.keyCode!==Tc.SPACE||r(e)},ref:t,tabIndex:i,onFocus:a,onDragStart:e=>{e.dataTransfer.clearData(),null==u||u(e)},onDragEnd:d,draggable:m,href:`#block-${o}`,"aria-hidden":!0},(0,s.createElement)(ub,{onClick:l}),(0,s.createElement)(Wc,{icon:null==f?void 0:f.icon,showColors:!0}),(0,s.createElement)("span",{className:"block-editor-list-view-block-select-button__title"},(0,s.createElement)(Up,{clientId:o,maximumLength:35})),(null==f?void 0:f.anchor)&&(0,s.createElement)("span",{className:"block-editor-list-view-block-select-button__anchor"},f.anchor),g&&(0,s.createElement)("span",{className:"block-editor-list-view-block-select-button__lock"},(0,s.createElement)(Ir,{icon:Km}))))})),pb=(0,s.forwardRef)(((e,t)=>{let{onClick:n,onToggleExpanded:o,block:r,isSelected:l,position:a,siblingBlockCount:u,level:d,isExpanded:p,selectedClientIds:f,...g}=e;const{clientId:h}=r,{blockMovingClientId:v,selectedBlockInBlockEditor:b}=(0,m.useSelect)((e=>{const{hasBlockMovingClientId:t,getSelectedBlockClientId:n}=e(Qn);return{blockMovingClientId:t(),selectedBlockInBlockEditor:n()}}),[h]),k=v&&b===h,_=c()("block-editor-list-view-block-contents",{"is-dropping-before":k}),y=f.includes(h)?f:[h];return(0,s.createElement)(Wp,{clientIds:y},(e=>{let{draggable:c,onDragStart:m,onDragEnd:f}=e;return(0,s.createElement)(db,i({ref:t,className:_,block:r,onClick:n,onToggleExpanded:o,isSelected:l,position:a,siblingBlockCount:u,level:d,draggable:c,onDragStart:m,onDragEnd:f,isExpanded:p},g))}))}));const mb=(0,s.createContext)({}),fb=()=>(0,s.useContext)(mb);var gb=(0,s.memo)((function e(t){let{block:n,isDragged:o,isSelected:l,isBranchSelected:i,selectBlock:a,position:u,level:f,rowCount:h,siblingBlockCount:v,showBlockMovers:b,path:k,isExpanded:_,selectedClientIds:y,preventAnnouncement:E}=t;const C=(0,s.useRef)(null),[S,w]=(0,s.useState)(!1),{clientId:B}=n,I=l&&y[0]===B,x=l&&y[y.length-1]===B,{toggleBlockHighlight:T}=(0,m.useDispatch)(Qn),N=Hp(B),P=(0,m.useSelect)((e=>e(Qn).getBlockName(B)),[B]),R=(0,r.hasBlockSupport)(P,"__experimentalToolbar",!0),{isLocked:M}=qm(B),L=`list-view-block-select-button__${(0,d.useInstanceId)(e)}`,A=((e,t,n)=>(0,g.sprintf)(
|
74 |
/* translators: 1: The numerical position of the block. 2: The total number of blocks. 3. The level of nesting for the block. */
|
75 |
+
(0,g.__)("Block %1$d of %2$d, Level %3$d"),e,t,n))(u,v,f);let D=(0,g.__)("Link");N&&(D=M?(0,g.sprintf)(// translators: %s: The title of the block. This string indicates a link to select the locked block.
|
76 |
(0,g.__)("%s link (locked)"),N.title):(0,g.sprintf)(// translators: %s: The title of the block. This string indicates a link to select the block.
|
77 |
(0,g.__)("%s link"),N.title));const O=N?(0,g.sprintf)(// translators: %s: The title of the block.
|
78 |
+
(0,g.__)("Options for %s block"),N.title):(0,g.__)("Options"),{isTreeGridMounted:F,expand:z,collapse:V}=fb(),H=b&&v>0,G=c()("block-editor-list-view-block__mover-cell",{"is-visible":S||l}),U=c()("block-editor-list-view-block__menu-cell",{"is-visible":S||I});(0,s.useEffect)((()=>{!F&&l&&C.current.focus()}),[]);const W=(0,s.useCallback)((()=>{w(!0),T(B,!0)}),[B,w,T]),$=(0,s.useCallback)((()=>{w(!1),T(B,!1)}),[B,w,T]),j=(0,s.useCallback)((e=>{a(e,B),e.preventDefault()}),[B,a]),K=(0,s.useCallback)((e=>{a(void 0,e)}),[a]),q=(0,s.useCallback)((e=>{e.preventDefault(),e.stopPropagation(),!0===_?V(B):!1===_&&z(B)}),[B,z,V,_]);let Y;H?Y=2:R||(Y=3);const Z=c()({"is-selected":l,"is-first-selected":I,"is-last-selected":x,"is-branch-selected":i,"is-dragging":o,"has-single-cell":!R}),Q=y.includes(B)?y:[B];return(0,s.createElement)(cb,{className:Z,onMouseEnter:W,onMouseLeave:$,onFocus:W,onBlur:$,level:f,position:u,rowCount:h,path:k,id:`list-view-block-${B}`,"data-block":B,isExpanded:_,"aria-selected":!!l},(0,s.createElement)(p.__experimentalTreeGridCell,{className:"block-editor-list-view-block__contents-cell",colSpan:Y,ref:C,"aria-label":D,"aria-selected":!!l,"aria-expanded":_,"aria-describedby":L},(e=>{let{ref:t,tabIndex:o,onFocus:r}=e;return(0,s.createElement)("div",{className:"block-editor-list-view-block__contents-container"},(0,s.createElement)(pb,{block:n,onClick:j,onToggleExpanded:q,isSelected:l,position:u,siblingBlockCount:v,level:f,ref:t,tabIndex:o,onFocus:r,isExpanded:_,selectedClientIds:y,preventAnnouncement:E}),(0,s.createElement)("div",{className:"block-editor-list-view-block-select-button__description",id:L},A))})),H&&(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.__experimentalTreeGridCell,{className:G,withoutGridItem:!0},(0,s.createElement)(p.__experimentalTreeGridItem,null,(e=>{let{ref:t,tabIndex:n,onFocus:o}=e;return(0,s.createElement)(tm,{orientation:"vertical",clientIds:[B],ref:t,tabIndex:n,onFocus:o})})),(0,s.createElement)(p.__experimentalTreeGridItem,null,(e=>{let{ref:t,tabIndex:n,onFocus:o}=e;return(0,s.createElement)(nm,{orientation:"vertical",clientIds:[B],ref:t,tabIndex:n,onFocus:o})})))),R&&(0,s.createElement)(p.__experimentalTreeGridCell,{className:U,"aria-selected":!!l},(e=>{let{ref:t,tabIndex:n,onFocus:o}=e;return(0,s.createElement)(of,{clientIds:Q,icon:Rm,label:O,toggleProps:{ref:t,className:"block-editor-list-view-block__menu",tabIndex:n,onFocus:o},disableOpenOnArrowDown:!0,__experimentalSelectBlock:K})})))}));function hb(e,t,n,o){var r;return(null==n?void 0:n.includes(e.clientId))?0:(null!==(r=t[e.clientId])&&void 0!==r?r:o)?1+e.innerBlocks.reduce(vb(t,n,o),0):1}const vb=(e,t,n)=>(o,r)=>{var l;return(null==t?void 0:t.includes(r.clientId))?o:(null!==(l=e[r.clientId])&&void 0!==l?l:n)&&r.innerBlocks.length>0?o+hb(r,e,t,n):o+1};function bb(e){const{blocks:t,selectBlock:n,showBlockMovers:o,selectedClientIds:r,level:l=1,path:i="",isBranchSelected:a=!1,listPosition:c=0,fixedListWindow:d,isExpanded:p}=e,{expandedState:f,draggedClientIds:g}=fb(),h=(0,u.compact)(t),v=h.length;let b=c;return(0,s.createElement)(s.Fragment,null,h.map(((e,t)=>{var c;const{clientId:k,innerBlocks:_}=e;t>0&&(b+=hb(h[t-1],f,g,p));const{itemInView:y}=d,E=y(b),C=t+1,S=i.length>0?`${i}_${C}`:`${C}`,w=!(null==_||!_.length),B=w?null!==(c=f[k])&&void 0!==c?c:p:void 0,I=!(null==g||!g.includes(k)),x=I||E,T=((e,t)=>(0,u.isArray)(t)&&t.length?-1!==t.indexOf(e):t===e)(k,r),N=a||T&&w;return(0,s.createElement)(m.AsyncModeProvider,{key:k,value:!T},x&&(0,s.createElement)(gb,{block:e,selectBlock:n,isSelected:T,isBranchSelected:N,isDragged:I,level:l,position:C,rowCount:v,siblingBlockCount:v,showBlockMovers:o,path:S,isExpanded:B,listPosition:b,selectedClientIds:r}),!x&&(0,s.createElement)("tr",null,(0,s.createElement)("td",{className:"block-editor-list-view-placeholder"})),w&&B&&!I&&(0,s.createElement)(bb,{blocks:_,selectBlock:n,showBlockMovers:o,level:l+1,path:S,listPosition:b+1,fixedListWindow:d,isBranchSelected:N,selectedClientIds:r,isExpanded:p}))})))}bb.defaultProps={selectBlock:()=>{}};var kb=(0,s.memo)(bb);function _b(e){let{listViewRef:t,blockDropTarget:n}=e;const{rootClientId:o,clientId:r,dropPosition:l}=n||{},[i,a]=(0,s.useMemo)((()=>t.current?[o?t.current.querySelector(`[data-block="${o}"]`):void 0,r?t.current.querySelector(`[data-block="${r}"]`):void 0]:[]),[o,r]),c=a||i,u=(0,s.useCallback)((()=>{if(!i)return 0;const e=c.getBoundingClientRect();return i.querySelector(".block-editor-block-icon").getBoundingClientRect().right-e.left}),[i,c]),d=(0,s.useMemo)((()=>{if(!c)return{};const e=u();return{width:c.offsetWidth-e}}),[u,c]),m=(0,s.useCallback)((()=>{if(!c)return{};const e=c.ownerDocument,t=c.getBoundingClientRect(),n=u(),o={left:t.left+n,right:t.right,width:0,height:t.height,ownerDocument:e};return"top"===l?{...o,top:t.top,bottom:t.top}:"bottom"===l||"inside"===l?{...o,top:t.bottom,bottom:t.bottom}:{}}),[c,l,u]);return c?(0,s.createElement)(p.Popover,{animate:!1,getAnchorRect:m,focusOnMount:!1,className:"block-editor-list-view-drop-indicator"},(0,s.createElement)("div",{style:d,className:"block-editor-list-view-drop-indicator__line"})):null}function yb(e,t){return t.left<=e.x&&t.right>=e.x&&t.top<=e.y&&t.bottom>=e.y}const Eb=["top","bottom"];const Cb=(e,t)=>Array.isArray(t.clientIds)?{...e,...t.clientIds.reduce(((e,n)=>({...e,[n]:"expand"===t.type})),{})}:e;var Sb=(0,s.forwardRef)((function(e,t){let{id:n,blocks:o,showBlockMovers:l=!1,isExpanded:i=!1}=e;const{clientIdsTree:a,draggedClientIds:c,selectedClientIds:f}=function(e){return(0,m.useSelect)((t=>{const{getDraggedBlockClientIds:n,getSelectedBlockClientIds:o,__unstableGetClientIdsTree:r}=t(Qn);return{selectedClientIds:o(),draggedClientIds:n(),clientIdsTree:e||r()}}),[e])}(o),{visibleBlockCount:h}=(0,m.useSelect)((e=>{const{getGlobalBlockCount:t,getClientIdsOfDescendants:n}=e(Qn),o=(null==c?void 0:c.length)>0?n(c).length+1:0;return{visibleBlockCount:t()-o}}),[c]),{updateBlockSelection:v}=function(){const{clearSelectedBlock:e,multiSelect:t,selectBlock:n}=(0,m.useDispatch)(Qn),{getBlockName:o,getBlockParents:l,getBlockSelectionStart:i,getBlockSelectionEnd:a,getSelectedBlockClientIds:c,hasMultiSelection:d,hasSelectedBlock:p}=(0,m.useSelect)(Qn),{getBlockType:f}=(0,m.useSelect)(r.store);return{updateBlockSelection:(0,s.useCallback)((async(r,s,a)=>{if(null==r||!r.shiftKey)return await e(),void n(s);r.preventDefault();const m="keydown"===r.type&&(r.keyCode===Tc.UP||r.keyCode===Tc.DOWN||r.keyCode===Tc.HOME||r.keyCode===Tc.END);if(!m&&!p()&&!d())return void n(s,null);const h=c(),v=[...l(s),s];m&&!h.some((e=>v.includes(e)))&&await e();let b=i(),k=s;m&&(p()||d()||(b=s),a&&(k=a));const _=l(b),y=l(k),{start:E,end:C}=function(e,t,n,o){const r=[...n,e],l=[...o,t],i=Math.min(r.length,l.length)-1;return{start:r[i],end:l[i]}}(b,k,_,y);await t(E,C,null);const S=c();if((r.keyCode===Tc.HOME||r.keyCode===Tc.END)&&S.length>1)return;const w=(0,u.difference)(h,S);let B;if(1===w.length){var I;const e=null===(I=f(o(w[0])))||void 0===I?void 0:I.title;e&&(B=(0,g.sprintf)(
|
79 |
/* translators: %s: block name */
|
80 |
(0,g.__)("%s deselected."),e))}else w.length>1&&(B=(0,g.sprintf)(
|
81 |
/* translators: %s: number of deselected blocks */
|
82 |
+
(0,g.__)("%s blocks deselected."),w.length));B&&(0,Ht.speak)(B)}),[e,o,f,l,i,a,c,d,p,t,n])}}(),[b,k]=(0,s.useReducer)(Cb,{}),{ref:_,target:y}=function(){const{getBlockRootClientId:e,getBlockIndex:t,getBlockCount:n,getDraggedBlockClientIds:o,canInsertBlocks:r}=(0,m.useSelect)(Qn),[l,i]=(0,s.useState)(),{rootClientId:a,blockIndex:c}=l||{},u=Sf(a,c),p=o(),f=(0,d.useThrottle)((0,s.useCallback)(((o,l)=>{const s={x:o.clientX,y:o.clientY},a=!(null==p||!p.length),c=function(e,t){let n,o,r,l;for(const i of e){if(i.isDraggedBlock)continue;const s=i.element.getBoundingClientRect(),[a,c]=Bf(t,s,Eb),u=yb(t,s);if(void 0===r||a<r||u){r=a;const t=e.indexOf(i),d=e[t-1];if("top"===c&&d&&d.rootClientId===i.rootClientId&&!d.isDraggedBlock?(o=d,n="bottom",l=d.element.getBoundingClientRect()):(o=i,n=c,l=s),u)break}}if(!o)return;const i="bottom"===n;if(i&&o.canInsertDraggedBlocksAsChild&&(o.innerBlockCount>0||function(e,t){const n=t.left+t.width/2;return e.x>n}(t,l)))return{rootClientId:o.clientId,blockIndex:0,dropPosition:"inside"};if(!o.canInsertDraggedBlocksAsSibling)return;const s=i?1:0;return{rootClientId:o.rootClientId,clientId:o.clientId,blockIndex:o.blockIndex+s,dropPosition:n}}(Array.from(l.querySelectorAll("[data-block]")).map((o=>{const l=o.dataset.block,i=e(l);return{clientId:l,rootClientId:i,blockIndex:t(l),element:o,isDraggedBlock:!!a&&p.includes(l),innerBlockCount:n(l),canInsertDraggedBlocksAsSibling:!a||r(p,i),canInsertDraggedBlocksAsChild:!a||r(p,l)}})),s);c&&i(c)}),[p]),200);return{ref:(0,d.__experimentalUseDropZone)({onDrop:u,onDragOver(e){f(e,e.currentTarget)},onDragEnd(){f.cancel(),i(null)}}),target:l}}(),E=(0,s.useRef)(),C=(0,d.useMergeRefs)([E,_,t]),S=(0,s.useRef)(!1),{setSelectedTreeId:w}=function(e){let{firstSelectedBlockClientId:t,setExpandedState:n}=e;const[o,r]=(0,s.useState)(null),{selectedBlockParentClientIds:l}=(0,m.useSelect)((e=>{const{getBlockParents:n}=e(Qn);return{selectedBlockParentClientIds:n(t,!1)}}),[t]),i=Array.isArray(l)&&l.length?l:null;return(0,s.useEffect)((()=>{o!==t&&i&&n({type:"expand",clientIds:l})}),[t]),{setSelectedTreeId:r}}({firstSelectedBlockClientId:f[0],setExpandedState:k}),B=(0,s.useCallback)(((e,t)=>{v(e,t),w(t)}),[w,v]);(0,s.useEffect)((()=>{S.current=!0}),[]);const[I]=(0,d.__experimentalUseFixedWindowList)(E,36,h,{useWindowing:!0,windowOverscan:40}),x=(0,s.useCallback)((e=>{e&&k({type:"expand",clientIds:[e]})}),[k]),T=(0,s.useCallback)((e=>{e&&k({type:"collapse",clientIds:[e]})}),[k]),N=(0,s.useCallback)((e=>{var t;x(null==e||null===(t=e.dataset)||void 0===t?void 0:t.block)}),[x]),P=(0,s.useCallback)((e=>{var t;T(null==e||null===(t=e.dataset)||void 0===t?void 0:t.block)}),[T]),R=(0,s.useCallback)(((e,t,n)=>{var o,r;e.shiftKey&&v(e,null==t||null===(o=t.dataset)||void 0===o?void 0:o.block,null==n||null===(r=n.dataset)||void 0===r?void 0:r.block)}),[v]),M=(0,s.useMemo)((()=>({isTreeGridMounted:S.current,draggedClientIds:c,expandedState:b,expand:x,collapse:T})),[S.current,c,b,x,T]);return(0,s.createElement)(m.AsyncModeProvider,{value:!0},(0,s.createElement)(_b,{listViewRef:E,blockDropTarget:y}),(0,s.createElement)(p.__experimentalTreeGrid,{id:n,className:"block-editor-list-view-tree","aria-label":(0,g.__)("Block navigation structure"),ref:C,onCollapseRow:P,onExpandRow:N,onFocusRow:R},(0,s.createElement)(mb.Provider,{value:M},(0,s.createElement)(kb,{blocks:a,selectBlock:B,showBlockMovers:l,fixedListWindow:I,selectedClientIds:f,isExpanded:i}))))}));function wb(e){let{isEnabled:t,onToggle:n,isOpen:o,innerRef:r,...l}=e;return(0,s.createElement)(p.Button,i({},l,{ref:r,icon:sb,"aria-expanded":o,"aria-haspopup":"true",onClick:t?n:void 0
|
83 |
+
/* translators: button label text should, if possible, be under 16 characters. */,label:(0,g.__)("List view"),className:"block-editor-block-navigation","aria-disabled":!t}))}var Bb=(0,s.forwardRef)((function(e,t){let{isDisabled:n,...o}=e;z()("wp.blockEditor.BlockNavigationDropdown",{since:"6.1",alternative:"wp.components.Dropdown and wp.blockEditor.ListView"});const r=(0,m.useSelect)((e=>!!e(Qn).getBlockCount()),[])&&!n;return(0,s.createElement)(p.Dropdown,{contentClassName:"block-editor-block-navigation__popover",position:"bottom right",renderToggle:e=>{let{isOpen:n,onToggle:l}=e;return(0,s.createElement)(wb,i({},o,{innerRef:t,isOpen:n,onToggle:l,isEnabled:r}))},renderContent:()=>(0,s.createElement)("div",{className:"block-editor-block-navigation__container"},(0,s.createElement)("p",{className:"block-editor-block-navigation__label"},(0,g.__)("List view")),(0,s.createElement)(Sb,null))})}));function Ib(e){let{genericPreviewBlock:t,style:n,className:o,activeStyle:r}=e;const l=hm(o,r,n),i=(0,s.useMemo)((()=>({...t,title:n.label||n.name,description:n.description,initialAttributes:{...t.attributes,className:l+" block-editor-block-styles__block-preview-container"}})),[t,l]);return(0,s.createElement)(yd,{item:i,isStylePreview:!0})}function xb(e){let{children:t,scope:n,...o}=e;return(0,s.createElement)(p.Fill,{name:`BlockStylesPreviewPanel/${n}`},(0,s.createElement)("div",o,t))}function Tb(e){let{clientId:t,onSwitch:n=u.noop,onHoverClassName:o=u.noop,scope:r}=e;const{onSelect:l,stylesToRender:i,activeStyle:a,genericPreviewBlock:m,className:f}=bm({clientId:t,onSwitch:n}),[g,h]=(0,s.useState)(null),[v,b]=(0,s.useState)(0),k=(0,d.useViewportMatch)("medium","<");if((0,s.useLayoutEffect)((()=>{const e=document.querySelector(".interface-interface-skeleton__content"),t=(null==e?void 0:e.scrollTop)||0;b(t+16)}),[g]),!i||0===i.length)return null;const _=(0,u.debounce)(h,250),y=e=>{var t;g!==e?(_(e),o(null!==(t=null==e?void 0:e.name)&&void 0!==t?t:null)):_.cancel()};return(0,s.createElement)("div",{className:"block-editor-block-styles"},(0,s.createElement)("div",{className:"block-editor-block-styles__variants"},i.map((e=>{const t=e.label||e.name;return(0,s.createElement)(p.Button,{className:c()("block-editor-block-styles__item",{"is-active":a.name===e.name}),key:e.name,variant:"secondary",label:t,onMouseEnter:()=>y(e),onFocus:()=>y(e),onMouseLeave:()=>y(null),onBlur:()=>y(null),onClick:()=>(e=>{l(e),o(null),h(null),_.cancel()})(e),"aria-current":a.name===e.name},(0,s.createElement)(p.__experimentalText,{as:"span",limit:12,ellipsizeMode:"tail",className:"block-editor-block-styles__item-text",truncate:!0},t))}))),g&&!k&&(0,s.createElement)(xb,{scope:r,className:"block-editor-block-styles__preview-panel",style:{top:v},onMouseLeave:()=>y(null)},(0,s.createElement)(Ib,{activeStyle:a,className:f,genericPreviewBlock:m,style:g})))}Tb.Slot=function(e){let{scope:t}=e;return(0,s.createElement)(p.Slot,{name:`BlockStylesPreviewPanel/${t}`})};var Nb=Tb,Pb=(0,s.createElement)(A.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(A.Path,{d:"M18 5.5H6a.5.5 0 00-.5.5v3h13V6a.5.5 0 00-.5-.5zm.5 5H10v8h8a.5.5 0 00.5-.5v-7.5zm-10 0h-3V18a.5.5 0 00.5.5h2.5v-8zM6 4h12a2 2 0 012 2v12a2 2 0 01-2 2H6a2 2 0 01-2-2V6a2 2 0 012-2z"})),Rb=function(e){let{icon:t=Pb,label:n=(0,g.__)("Choose variation"),instructions:o=(0,g.__)("Select a variation to start with."),variations:r,onSelect:l,allowSkip:i}=e;const a=c()("block-editor-block-variation-picker",{"has-many-variations":r.length>4});return(0,s.createElement)(p.Placeholder,{icon:t,label:n,instructions:o,className:a},(0,s.createElement)("ul",{className:"block-editor-block-variation-picker__variations",role:"list","aria-label":(0,g.__)("Block variations")},r.map((e=>(0,s.createElement)("li",{key:e.name},(0,s.createElement)(p.Button,{variant:"secondary",icon:e.icon,iconSize:48,onClick:()=>l(e),className:"block-editor-block-variation-picker__variation",label:e.description||e.title}),(0,s.createElement)("span",{className:"block-editor-block-variation-picker__variation-label",role:"presentation"},e.title))))),i&&(0,s.createElement)("div",{className:"block-editor-block-variation-picker__skip"},(0,s.createElement)(p.Button,{variant:"link",onClick:()=>l()},(0,g.__)("Skip"))))},Mb=(0,s.createElement)(A.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(A.Path,{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-7.8 16.5H5c-.3 0-.5-.2-.5-.5v-6.2h6.8v6.7zm0-8.3H4.5V5c0-.3.2-.5.5-.5h6.2v6.7zm8.3 7.8c0 .3-.2.5-.5.5h-6.2v-6.8h6.8V19zm0-7.8h-6.8V4.5H19c.3 0 .5.2.5.5v6.2z",fillRule:"evenodd",clipRule:"evenodd"}));const Lb="carousel",Ab="grid",Db=e=>{let{onStartBlank:t,onBlockPatternSelect:n}=e;return(0,s.createElement)("div",{className:"block-editor-block-pattern-setup__actions"},t&&(0,s.createElement)(p.Button,{onClick:t},(0,g.__)("Start blank")),(0,s.createElement)(p.Button,{variant:"primary",onClick:n},(0,g.__)("Choose")))},Ob=e=>{let{handlePrevious:t,handleNext:n,activeSlide:o,totalSlides:r}=e;return(0,s.createElement)("div",{className:"block-editor-block-pattern-setup__navigation"},(0,s.createElement)(p.Button,{icon:Yp,label:(0,g.__)("Previous pattern"),onClick:t,disabled:0===o}),(0,s.createElement)(p.Button,{icon:qp,label:(0,g.__)("Next pattern"),onClick:n,disabled:o===r-1}))};var Fb=e=>{let{viewMode:t,setViewMode:n,handlePrevious:o,handleNext:r,activeSlide:l,totalSlides:i,onBlockPatternSelect:a,onStartBlank:c}=e;const u=t===Lb,d=(0,s.createElement)("div",{className:"block-editor-block-pattern-setup__display-controls"},(0,s.createElement)(p.Button,{icon:Ur,label:(0,g.__)("Carousel view"),onClick:()=>n(Lb),isPressed:u}),(0,s.createElement)(p.Button,{icon:Mb,label:(0,g.__)("Grid view"),onClick:()=>n(Ab),isPressed:t===Ab}));return(0,s.createElement)("div",{className:"block-editor-block-pattern-setup__toolbar"},u&&(0,s.createElement)(Ob,{handlePrevious:o,handleNext:r,activeSlide:l,totalSlides:i}),d,u&&(0,s.createElement)(Db,{onBlockPatternSelect:a,onStartBlank:c}))};const zb=e=>{let{viewMode:t,activeSlide:n,patterns:o,onBlockPatternSelect:r,height:l}=e;const a=(0,p.__unstableUseCompositeState)(),c="block-editor-block-pattern-setup__container";if(t===Lb){const e=new Map([[n,"active-slide"],[n-1,"previous-slide"],[n+1,"next-slide"]]);return(0,s.createElement)("div",{className:"block-editor-block-pattern-setup__carousel",style:{height:l}},(0,s.createElement)("div",{className:c},(0,s.createElement)("ul",{className:"carousel-container"},o.map(((t,n)=>(0,s.createElement)(Hb,{className:e.get(n)||"",key:t.name,pattern:t,minHeight:l}))))))}return(0,s.createElement)("div",{style:{height:l},className:"block-editor-block-pattern-setup__grid"},(0,s.createElement)(p.__unstableComposite,i({},a,{role:"listbox",className:c,"aria-label":(0,g.__)("Patterns list")}),o.map((e=>(0,s.createElement)(Vb,{key:e.name,pattern:e,onSelect:r,composite:a})))))};function Vb(e){let{pattern:t,onSelect:n,composite:o}=e;const r="block-editor-block-pattern-setup-list",{blocks:l,description:a,viewportWidth:c=700}=t,u=(0,d.useInstanceId)(Vb,`${r}__item-description`);return(0,s.createElement)("div",{className:`${r}__list-item`,"aria-label":t.title,"aria-describedby":t.description?u:void 0},(0,s.createElement)(p.__unstableCompositeItem,i({role:"option",as:"div"},o,{className:`${r}__item`,onClick:()=>n(l)}),(0,s.createElement)(kd,{blocks:l,viewportWidth:c})),!!a&&(0,s.createElement)(p.VisuallyHidden,{id:u},a))}function Hb(e){let{className:t,pattern:n,minHeight:o}=e;const{blocks:r,title:l,description:i}=n,a=(0,d.useInstanceId)(Hb,"block-editor-block-pattern-setup-list__item-description");return(0,s.createElement)("li",{className:`pattern-slide ${t}`,"aria-label":l,"aria-describedby":i?a:void 0},(0,s.createElement)(kd,{blocks:r,__experimentalMinHeight:o}),!!i&&(0,s.createElement)(p.VisuallyHidden,{id:a},i))}var Gb=e=>{let{clientId:t,blockName:n,filterPatternsFn:o,startBlankComponent:l,onBlockPatternSelect:i}=e;const[a,c]=(0,s.useState)(Lb),[u,p]=(0,s.useState)(0),[f,g]=(0,s.useState)(!1),{replaceBlock:h}=(0,m.useDispatch)(Qn),v=function(e,t,n){return(0,m.useSelect)((o=>{const{getBlockRootClientId:r,__experimentalGetPatternsByBlockTypes:l,__experimentalGetAllowedPatterns:i}=o(Qn),s=r(e);return n?i(s).filter(n):l(t,s)}),[e,t,n])}(t,n,o),[b,{height:k}]=(0,d.useResizeObserver)();if(null==v||!v.length||f)return l;const _=i||(e=>{const n=e.map((e=>(0,r.cloneBlock)(e)));h(t,n)}),y=l?()=>{g(!0)}:void 0;return(0,s.createElement)(s.Fragment,null,b,(0,s.createElement)("div",{className:`block-editor-block-pattern-setup view-mode-${a}`},(0,s.createElement)(zb,{viewMode:a,activeSlide:u,patterns:v,onBlockPatternSelect:_,height:k-120}),(0,s.createElement)(Fb,{viewMode:a,setViewMode:c,activeSlide:u,totalSlides:v.length,handleNext:()=>{p((e=>e+1))},handlePrevious:()=>{p((e=>e-1))},onBlockPatternSelect:()=>{_(v[u].blocks)},onStartBlank:y})))};function Ub(e){let{className:t,onSelectVariation:n,selectedValue:o,variations:r}=e;return(0,s.createElement)("fieldset",{className:t},(0,s.createElement)(p.VisuallyHidden,{as:"legend"},(0,g.__)("Transform to variation")),r.map((e=>(0,s.createElement)(p.Button,{key:e.name,icon:(0,s.createElement)(Wc,{icon:e.icon,showColors:!0}),isPressed:o===e.name,label:o===e.name?e.title:(0,g.sprintf)(
|
84 |
/* translators: %s: Name of the block variation */
|
85 |
+
(0,g.__)("Transform to %s"),e.title),onClick:()=>n(e.name),"aria-label":e.title,showTooltip:!0}))))}function Wb(e){let{className:t,onSelectVariation:n,selectedValue:o,variations:r}=e;const l=r.map((e=>{let{name:t,title:n,description:o}=e;return{value:t,label:n,info:o}}));return(0,s.createElement)(p.DropdownMenu,{className:t,label:(0,g.__)("Transform to variation"),text:(0,g.__)("Transform to variation"),popoverProps:{position:"bottom center",className:`${t}__popover`},icon:Qp,toggleProps:{iconPosition:"right"}},(()=>(0,s.createElement)("div",{className:`${t}__container`},(0,s.createElement)(p.MenuGroup,null,(0,s.createElement)(p.MenuItemsChoice,{choices:l,value:o,onSelect:n})))))}var $b=function(e){let{blockClientId:t}=e;const{updateBlockAttributes:n}=(0,m.useDispatch)(Qn),{activeBlockVariation:o,variations:l}=(0,m.useSelect)((e=>{const{getActiveBlockVariation:n,getBlockVariations:o}=e(r.store),{getBlockName:l,getBlockAttributes:i}=e(Qn),s=t&&l(t);return{activeBlockVariation:n(s,i(t)),variations:s&&o(s,"transform")}}),[t]),i=null==o?void 0:o.name,a=(0,s.useMemo)((()=>{const e=new Set;return!!l&&(l.forEach((t=>{var n;t.icon&&e.add((null===(n=t.icon)||void 0===n?void 0:n.src)||t.icon)})),e.size===l.length)}),[l]);if(null==l||!l.length)return null;const c=a?Ub:Wb;return(0,s.createElement)(c,{className:"block-editor-block-variation-transforms",onSelectVariation:e=>{n(t,{...l.find((t=>{let{name:n}=t;return n===e})).attributes})},selectedValue:i,variations:l})},jb=(0,d.createHigherOrderComponent)((e=>t=>{const n=So("color.palette"),o=!So("color.custom"),r=void 0===t.colors?n:t.colors,l=void 0===t.disableCustomColors?o:t.disableCustomColors,a=!(0,u.isEmpty)(r)||!l;return(0,s.createElement)(e,i({},t,{colors:r,disableCustomColors:l,hasColorsToChoose:a}))}),"withColorContext"),Kb=jb(p.ColorPalette);function qb(e){let{onChange:t,value:n,...o}=e;return(0,s.createElement)(wg,i({},o,{onColorChange:t,colorValue:n,gradients:[],disableCustomGradients:!0}))}var Yb=window.wp.date;const Zb=new Date(2022,0,25);function Qb(e){let{format:t,defaultFormat:n,onChange:o}=e;return(0,s.createElement)("fieldset",{className:"block-editor-date-format-picker"},(0,s.createElement)(p.VisuallyHidden,{as:"legend"},(0,g.__)("Date format")),(0,s.createElement)(p.ToggleControl,{label:(0,s.createElement)(s.Fragment,null,(0,g.__)("Default format"),(0,s.createElement)("span",{className:"block-editor-date-format-picker__default-format-toggle-control__hint"},(0,Yb.dateI18n)(n,Zb))),checked:!t,onChange:e=>o(e?null:n)}),t&&(0,s.createElement)(Xb,{format:t,onChange:o}))}function Xb(e){var t;let{format:n,onChange:o}=e;const r=(0,u.uniq)(["Y-m-d",(0,g._x)("n/j/Y","short date format"),(0,g._x)("n/j/Y g:i A","short date format with time"),(0,g._x)("M j, Y","medium date format"),(0,g._x)("M j, Y g:i A","medium date format with time"),(0,g._x)("F j, Y","long date format")]),l=r.map(((e,t)=>({key:`suggested-${t}`,name:(0,Yb.dateI18n)(e,Zb),format:e}))),i={key:"custom",name:(0,g.__)("Custom"),className:"block-editor-date-format-picker__custom-format-select-control__custom-option",__experimentalHint:(0,g.__)("Enter your own date format")},[a,c]=(0,s.useState)((()=>!!n&&!r.includes(n)));return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.BaseControl,{className:"block-editor-date-format-picker__custom-format-select-control"},(0,s.createElement)(p.CustomSelectControl,{label:(0,g.__)("Choose a format"),options:[...l,i],value:a?i:null!==(t=l.find((e=>e.format===n)))&&void 0!==t?t:i,onChange:e=>{let{selectedItem:t}=e;t===i?c(!0):(c(!1),o(t.format))}})),a&&(0,s.createElement)(p.TextControl,{label:(0,g.__)("Custom format"),hideLabelFromVision:!0,help:(0,s.createInterpolateElement)((0,g.__)("Enter a date or time <Link>format string</Link>."),{Link:(0,s.createElement)(p.ExternalLink,{href:(0,g.__)("https://wordpress.org/support/article/formatting-date-and-time/")})}),value:n,onChange:e=>o(e)}))}const Jb=["colors","disableCustomColors","gradients","disableCustomGradients"],ek=e=>{let{className:t,colors:n,gradients:o,disableCustomColors:r,disableCustomGradients:l,children:i,settings:a,title:f,showTitle:g=!0,__experimentalHasMultipleOrigins:h,__experimentalIsRenderedInSidebar:v,enableAlpha:b}=e;const k=(0,d.useInstanceId)(ek),{batch:_}=(0,m.useRegistry)();return(0,u.isEmpty)(n)&&(0,u.isEmpty)(o)&&r&&l&&(0,u.every)(a,(e=>(0,u.isEmpty)(e.colors)&&(0,u.isEmpty)(e.gradients)&&(void 0===e.disableCustomColors||e.disableCustomColors)&&(void 0===e.disableCustomGradients||e.disableCustomGradients)))?null:(0,s.createElement)(p.__experimentalToolsPanel,{className:c()("block-editor-panel-color-gradient-settings",t),label:g?f:void 0,resetAll:()=>{_((()=>{a.forEach((e=>{let{colorValue:t,gradientValue:n,onColorChange:o,onGradientChange:r}=e;t?o():n&&r()}))}))},panelId:k,__experimentalFirstVisibleItemClass:"first",__experimentalLastVisibleItemClass:"last"},(0,s.createElement)(Tg,{settings:a,panelId:k,colors:n,gradients:o,disableCustomColors:r,disableCustomGradients:l,__experimentalHasMultipleOrigins:h,__experimentalIsRenderedInSidebar:v,enableAlpha:b}),!!i&&(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.__experimentalSpacer,{marginY:4})," ",i))},tk=e=>{const t=og();return t.colors=So("color.palette"),t.gradients=So("color.gradients"),(0,s.createElement)(ek,i({},t,e))},nk=e=>{const t=rg();return(0,s.createElement)(ek,i({},t,e))};var ok=e=>(0,u.every)(Jb,(t=>e.hasOwnProperty(t)))?(0,s.createElement)(ek,e):e.__experimentalHasMultipleOrigins?(0,s.createElement)(nk,e):(0,s.createElement)(tk,e),rk=function(e,t){return(rk=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},lk=function(){return(lk=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)};function ik(e,t,n,o){void 0===o&&(o=0);var r=vk(e,t,o),l=r.width,i=r.height;return e>=t*n&&l>t*n?{width:t*n,height:t}:l>t*n?{width:e,height:e/n}:l>i*n?{width:i*n,height:i}:{width:l,height:l/n}}function sk(e,t,n,o,r){void 0===r&&(r=0);var l=vk(t.width,t.height,r),i=l.width,s=l.height;return{x:ak(e.x,i,n.width,o),y:ak(e.y,s,n.height,o)}}function ak(e,t,n,o){var r=t*o/2-n/2;return Math.min(r,Math.max(e,-r))}function ck(e,t){return Math.sqrt(Math.pow(e.y-t.y,2)+Math.pow(e.x-t.x,2))}function uk(e,t){return 180*Math.atan2(t.y-e.y,t.x-e.x)/Math.PI}function dk(e,t,n,o,r,l,i){void 0===l&&(l=0),void 0===i&&(i=!0);var s=i&&0===l?pk:mk,a={x:s(100,((t.width-n.width/r)/2-e.x/r)/t.width*100),y:s(100,((t.height-n.height/r)/2-e.y/r)/t.height*100),width:s(100,n.width/t.width*100/r),height:s(100,n.height/t.height*100/r)},c=Math.round(s(t.naturalWidth,a.width*t.naturalWidth/100)),u=Math.round(s(t.naturalHeight,a.height*t.naturalHeight/100)),d=t.naturalWidth>=t.naturalHeight*o?{width:Math.round(u*o),height:u}:{width:c,height:Math.round(c/o)};return{croppedAreaPercentages:a,croppedAreaPixels:lk(lk({},d),{x:Math.round(s(t.naturalWidth-d.width,a.x*t.naturalWidth/100)),y:Math.round(s(t.naturalHeight-d.height,a.y*t.naturalHeight/100))})}}function pk(e,t){return Math.min(e,Math.max(0,t))}function mk(e,t){return t}function fk(e,t,n){var o=t.width/t.naturalWidth,r=function(e,t,n){var o=t.width/t.naturalWidth;if(n)return n.height>n.width?n.height/o/e.height:n.width/o/e.width;var r=e.width/e.height;return t.naturalWidth>=t.naturalHeight*r?t.naturalHeight/e.height:t.naturalWidth/e.width}(e,t,n),l=o*r;return{crop:{x:((t.naturalWidth-e.width)/2-e.x)*l,y:((t.naturalHeight-e.height)/2-e.y)*l},zoom:r}}function gk(e,t){return{x:(t.x+e.x)/2,y:(t.y+e.y)/2}}function hk(e,t,n,o,r){var l=Math.cos,i=Math.sin,s=r*Math.PI/180;return[(e-n)*l(s)-(t-o)*i(s)+n,(e-n)*i(s)+(t-o)*l(s)+o]}function vk(e,t,n){var o=e/2,r=t/2,l=[hk(0,0,o,r,n),hk(e,0,o,r,n),hk(e,t,o,r,n),hk(0,t,o,r,n)],i=Math.min.apply(Math,l.map((function(e){return e[0]}))),s=Math.max.apply(Math,l.map((function(e){return e[0]}))),a=Math.min.apply(Math,l.map((function(e){return e[1]})));return{width:s-i,height:Math.max.apply(Math,l.map((function(e){return e[1]})))-a}}function bk(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.filter((function(e){return"string"==typeof e&&e.length>0})).join(" ").trim()}var kk=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.imageRef=null,n.videoRef=null,n.containerRef=null,n.styleRef=null,n.containerRect=null,n.mediaSize={width:0,height:0,naturalWidth:0,naturalHeight:0},n.dragStartPosition={x:0,y:0},n.dragStartCrop={x:0,y:0},n.lastPinchDistance=0,n.lastPinchRotation=0,n.rafDragTimeout=null,n.rafPinchTimeout=null,n.wheelTimer=null,n.state={cropSize:null,hasWheelJustStarted:!1},n.preventZoomSafari=function(e){return e.preventDefault()},n.cleanEvents=function(){document.removeEventListener("mousemove",n.onMouseMove),document.removeEventListener("mouseup",n.onDragStopped),document.removeEventListener("touchmove",n.onTouchMove),document.removeEventListener("touchend",n.onDragStopped)},n.clearScrollEvent=function(){n.containerRef&&n.containerRef.removeEventListener("wheel",n.onWheel),n.wheelTimer&&clearTimeout(n.wheelTimer)},n.onMediaLoad=function(){n.computeSizes(),n.emitCropData(),n.setInitialCrop(),n.props.onMediaLoaded&&n.props.onMediaLoaded(n.mediaSize)},n.setInitialCrop=function(){var e=n.props,t=e.initialCroppedAreaPixels,o=e.cropSize;if(t){var r=fk(t,n.mediaSize,o),l=r.crop,i=r.zoom;n.props.onCropChange(l),n.props.onZoomChange&&n.props.onZoomChange(i)}},n.computeSizes=function(){var e,t,o,r,l=n.imageRef||n.videoRef;if(l){n.mediaSize={width:l.offsetWidth,height:l.offsetHeight,naturalWidth:(null===(e=n.imageRef)||void 0===e?void 0:e.naturalWidth)||(null===(t=n.videoRef)||void 0===t?void 0:t.videoWidth)||0,naturalHeight:(null===(o=n.imageRef)||void 0===o?void 0:o.naturalHeight)||(null===(r=n.videoRef)||void 0===r?void 0:r.videoHeight)||0};var i=n.props.cropSize?n.props.cropSize:ik(l.offsetWidth,l.offsetHeight,n.props.aspect,n.props.rotation);n.setState({cropSize:i},n.recomputeCropPosition)}n.containerRef&&(n.containerRect=n.containerRef.getBoundingClientRect())},n.onMouseDown=function(e){e.preventDefault(),document.addEventListener("mousemove",n.onMouseMove),document.addEventListener("mouseup",n.onDragStopped),n.onDragStart(t.getMousePoint(e))},n.onMouseMove=function(e){return n.onDrag(t.getMousePoint(e))},n.onTouchStart=function(e){e.preventDefault(),document.addEventListener("touchmove",n.onTouchMove,{passive:!1}),document.addEventListener("touchend",n.onDragStopped),2===e.touches.length?n.onPinchStart(e):1===e.touches.length&&n.onDragStart(t.getTouchPoint(e.touches[0]))},n.onTouchMove=function(e){e.preventDefault(),2===e.touches.length?n.onPinchMove(e):1===e.touches.length&&n.onDrag(t.getTouchPoint(e.touches[0]))},n.onDragStart=function(e){var t,o,r=e.x,l=e.y;n.dragStartPosition={x:r,y:l},n.dragStartCrop=lk({},n.props.crop),null===(o=(t=n.props).onInteractionStart)||void 0===o||o.call(t)},n.onDrag=function(e){var t=e.x,o=e.y;n.rafDragTimeout&&window.cancelAnimationFrame(n.rafDragTimeout),n.rafDragTimeout=window.requestAnimationFrame((function(){if(n.state.cropSize&&void 0!==t&&void 0!==o){var e=t-n.dragStartPosition.x,r=o-n.dragStartPosition.y,l={x:n.dragStartCrop.x+e,y:n.dragStartCrop.y+r},i=n.props.restrictPosition?sk(l,n.mediaSize,n.state.cropSize,n.props.zoom,n.props.rotation):l;n.props.onCropChange(i)}}))},n.onDragStopped=function(){var e,t;n.cleanEvents(),n.emitCropData(),null===(t=(e=n.props).onInteractionEnd)||void 0===t||t.call(e)},n.onWheel=function(e){e.preventDefault();var o=t.getMousePoint(e),r=n.props.zoom-e.deltaY*n.props.zoomSpeed/200;n.setNewZoom(r,o),n.state.hasWheelJustStarted||n.setState({hasWheelJustStarted:!0},(function(){var e,t;return null===(t=(e=n.props).onInteractionStart)||void 0===t?void 0:t.call(e)})),n.wheelTimer&&clearTimeout(n.wheelTimer),n.wheelTimer=window.setTimeout((function(){return n.setState({hasWheelJustStarted:!1},(function(){var e,t;return null===(t=(e=n.props).onInteractionEnd)||void 0===t?void 0:t.call(e)}))}),250)},n.getPointOnContainer=function(e){var t=e.x,o=e.y;if(!n.containerRect)throw new Error("The Cropper is not mounted");return{x:n.containerRect.width/2-(t-n.containerRect.left),y:n.containerRect.height/2-(o-n.containerRect.top)}},n.getPointOnMedia=function(e){var t=e.x,o=e.y,r=n.props,l=r.crop,i=r.zoom;return{x:(t+l.x)/i,y:(o+l.y)/i}},n.setNewZoom=function(e,t){if(n.state.cropSize&&n.props.onZoomChange){var o=n.getPointOnContainer(t),r=n.getPointOnMedia(o),l=Math.min(n.props.maxZoom,Math.max(e,n.props.minZoom)),i={x:r.x*l-o.x,y:r.y*l-o.y},s=n.props.restrictPosition?sk(i,n.mediaSize,n.state.cropSize,l,n.props.rotation):i;n.props.onCropChange(s),n.props.onZoomChange(l)}},n.emitCropData=function(){if(n.state.cropSize){var e=dk(n.props.restrictPosition?sk(n.props.crop,n.mediaSize,n.state.cropSize,n.props.zoom,n.props.rotation):n.props.crop,n.mediaSize,n.state.cropSize,n.getAspect(),n.props.zoom,n.props.rotation,n.props.restrictPosition),t=e.croppedAreaPercentages,o=e.croppedAreaPixels;n.props.onCropComplete&&n.props.onCropComplete(t,o)}},n.recomputeCropPosition=function(){if(n.state.cropSize){var e=n.props.restrictPosition?sk(n.props.crop,n.mediaSize,n.state.cropSize,n.props.zoom,n.props.rotation):n.props.crop;n.props.onCropChange(e),n.emitCropData()}},n}return function(e,t){function __(){this.constructor=e}rk(e,t),e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)}(t,e),t.prototype.componentDidMount=function(){window.addEventListener("resize",this.computeSizes),this.containerRef&&(this.props.zoomWithScroll&&this.containerRef.addEventListener("wheel",this.onWheel,{passive:!1}),this.containerRef.addEventListener("gesturestart",this.preventZoomSafari),this.containerRef.addEventListener("gesturechange",this.preventZoomSafari)),this.props.disableAutomaticStylesInjection||(this.styleRef=document.createElement("style"),this.styleRef.setAttribute("type","text/css"),this.styleRef.innerHTML=".reactEasyCrop_Container {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n overflow: hidden;\n user-select: none;\n touch-action: none;\n cursor: move;\n}\n\n.reactEasyCrop_Image,\n.reactEasyCrop_Video {\n max-width: 100%;\n max-height: 100%;\n margin: auto;\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n will-change: transform; /* this improves performances and prevent painting issues on iOS Chrome */\n}\n\n.reactEasyCrop_CropArea {\n position: absolute;\n left: 50%;\n top: 50%;\n transform: translate(-50%, -50%);\n border: 1px solid rgba(255, 255, 255, 0.5);\n box-sizing: border-box;\n box-shadow: 0 0 0 9999em;\n color: rgba(0, 0, 0, 0.5);\n overflow: hidden;\n}\n\n.reactEasyCrop_CropAreaRound {\n border-radius: 50%;\n}\n\n.reactEasyCrop_CropAreaGrid::before {\n content: ' ';\n box-sizing: border-box;\n position: absolute;\n border: 1px solid rgba(255, 255, 255, 0.5);\n top: 0;\n bottom: 0;\n left: 33.33%;\n right: 33.33%;\n border-top: 0;\n border-bottom: 0;\n}\n\n.reactEasyCrop_CropAreaGrid::after {\n content: ' ';\n box-sizing: border-box;\n position: absolute;\n border: 1px solid rgba(255, 255, 255, 0.5);\n top: 33.33%;\n bottom: 33.33%;\n left: 0;\n right: 0;\n border-left: 0;\n border-right: 0;\n}\n",document.head.appendChild(this.styleRef)),this.imageRef&&this.imageRef.complete&&this.onMediaLoad()},t.prototype.componentWillUnmount=function(){window.removeEventListener("resize",this.computeSizes),this.containerRef&&(this.containerRef.removeEventListener("gesturestart",this.preventZoomSafari),this.containerRef.removeEventListener("gesturechange",this.preventZoomSafari)),this.styleRef&&this.styleRef.remove(),this.cleanEvents(),this.props.zoomWithScroll&&this.clearScrollEvent()},t.prototype.componentDidUpdate=function(e){e.rotation!==this.props.rotation?(this.computeSizes(),this.recomputeCropPosition()):e.aspect!==this.props.aspect?this.computeSizes():e.zoom!==this.props.zoom?this.recomputeCropPosition():e.cropSize!==this.props.cropSize&&this.computeSizes(),e.zoomWithScroll!==this.props.zoomWithScroll&&this.containerRef&&(this.props.zoomWithScroll?this.containerRef.addEventListener("wheel",this.onWheel,{passive:!1}):this.clearScrollEvent())},t.prototype.getAspect=function(){var e=this.props,t=e.cropSize,n=e.aspect;return t?t.width/t.height:n},t.prototype.onPinchStart=function(e){var n=t.getTouchPoint(e.touches[0]),o=t.getTouchPoint(e.touches[1]);this.lastPinchDistance=ck(n,o),this.lastPinchRotation=uk(n,o),this.onDragStart(gk(n,o))},t.prototype.onPinchMove=function(e){var n=this,o=t.getTouchPoint(e.touches[0]),r=t.getTouchPoint(e.touches[1]),l=gk(o,r);this.onDrag(l),this.rafPinchTimeout&&window.cancelAnimationFrame(this.rafPinchTimeout),this.rafPinchTimeout=window.requestAnimationFrame((function(){var e=ck(o,r),t=n.props.zoom*(e/n.lastPinchDistance);n.setNewZoom(t,l),n.lastPinchDistance=e;var i=uk(o,r),s=n.props.rotation+(i-n.lastPinchRotation);n.props.onRotationChange&&n.props.onRotationChange(s),n.lastPinchRotation=i}))},t.prototype.render=function(){var e=this,t=this.props,n=t.image,o=t.video,r=t.mediaProps,l=t.crop,i=l.x,s=l.y,a=t.rotation,c=t.zoom,u=t.cropShape,d=t.showGrid,p=t.style,m=p.containerStyle,f=p.cropAreaStyle,g=p.mediaStyle,h=t.classes,v=h.containerClassName,b=h.cropAreaClassName,k=h.mediaClassName;return Yl().createElement("div",{onMouseDown:this.onMouseDown,onTouchStart:this.onTouchStart,ref:function(t){return e.containerRef=t},"data-testid":"container",style:m,className:bk("reactEasyCrop_Container",v)},n?Yl().createElement("img",lk({alt:"",className:bk("reactEasyCrop_Image",k)},r,{src:n,ref:function(t){return e.imageRef=t},style:lk(lk({},g),{transform:"translate("+i+"px, "+s+"px) rotate("+a+"deg) scale("+c+")"}),onLoad:this.onMediaLoad})):o&&Yl().createElement("video",lk({autoPlay:!0,loop:!0,muted:!0,className:bk("reactEasyCrop_Video",k)},r,{src:o,ref:function(t){return e.videoRef=t},onLoadedMetadata:this.onMediaLoad,style:lk(lk({},g),{transform:"translate("+i+"px, "+s+"px) rotate("+a+"deg) scale("+c+")"}),controls:!1})),this.state.cropSize&&Yl().createElement("div",{style:lk(lk({},f),{width:this.state.cropSize.width,height:this.state.cropSize.height}),"data-testid":"cropper",className:bk("reactEasyCrop_CropArea","round"===u&&"reactEasyCrop_CropAreaRound",d&&"reactEasyCrop_CropAreaGrid",b)}))},t.defaultProps={zoom:1,rotation:0,aspect:4/3,maxZoom:3,minZoom:1,cropShape:"rect",showGrid:!0,style:{},classes:{},mediaProps:{},zoomSpeed:1,restrictPosition:!0,zoomWithScroll:!0},t.getMousePoint=function(e){return{x:Number(e.clientX),y:Number(e.clientY)}},t.getTouchPoint=function(e){return{x:Number(e.clientX),y:Number(e.clientY)}},t}(Yl().Component);const _k={position:"bottom right",isAlternate:!0};const yk=(0,s.createContext)({}),Ek=()=>(0,s.useContext)(yk);function Ck(e){let{id:t,url:n,naturalWidth:o,naturalHeight:r,isEditing:i,onFinishEditing:a,onSaveImage:c,children:u}=e;const d=function(e,t){const n=function(e){let{url:t,naturalWidth:n,naturalHeight:o}=e;const[r,i]=(0,s.useState)(),[a,c]=(0,s.useState)(),[u,d]=(0,s.useState)({x:0,y:0}),[p,m]=(0,s.useState)(),[f,g]=(0,s.useState)(),[h,v]=(0,s.useState)(),[b,k]=(0,s.useState)(),_=(0,s.useCallback)((()=>{d({x:0,y:0}),m(100),g(0),v(n/o),k(n/o)}),[n,o,d,m,g,v,k]),y=(0,s.useCallback)((()=>{const e=(f+90)%360;let r=n/o;if(f%180==90&&(r=o/n),0===e)return i(),g(e),v(1/h),void d({x:-u.y*r,y:u.x*r});const s=new window.Image;s.src=t,s.onload=function(t){const n=document.createElement("canvas");let o=0,l=0;e%180?(n.width=t.target.height,n.height=t.target.width):(n.width=t.target.width,n.height=t.target.height),90!==e&&180!==e||(o=n.width),270!==e&&180!==e||(l=n.height);const s=n.getContext("2d");s.translate(o,l),s.rotate(e*Math.PI/180),s.drawImage(t.target,0,0),n.toBlob((t=>{i(URL.createObjectURL(t)),g(e),v(1/h),d({x:-u.y*r,y:u.x*r})}))};const a=(0,l.applyFilters)("media.crossOrigin",void 0,t);"string"==typeof a&&(s.crossOrigin=a)}),[f,n,o,i,g,v,d]);return(0,s.useMemo)((()=>({editedUrl:r,setEditedUrl:i,crop:a,setCrop:c,position:u,setPosition:d,zoom:p,setZoom:m,rotation:f,setRotation:g,rotateClockwise:y,aspect:h,setAspect:v,defaultAspect:b,initializeTransformValues:_})),[r,i,a,c,u,d,p,m,f,g,y,h,v,b,_])}(e),{initializeTransformValues:o}=n;return(0,s.useEffect)((()=>{t&&o()}),[t,o]),n}({url:n,naturalWidth:o,naturalHeight:r},i),p=function(e){let{crop:t,rotation:n,height:o,width:r,aspect:l,url:i,id:a,onSaveImage:c,onFinishEditing:u}=e;const{createErrorNotice:d}=(0,m.useDispatch)(Fd.store),[p,f]=(0,s.useState)(!1),h=(0,s.useCallback)((()=>{f(!1),u()}),[f,u]),v=(0,s.useCallback)((()=>{f(!0);let e={};(t.width<99.9||t.height<99.9)&&(e=t),n>0&&(e.rotation=n),e.src=i,Wv()({path:`/wp/v2/media/${a}/edit`,method:"POST",data:e}).then((e=>{c({id:e.id,url:e.source_url,height:o&&r?r/l:void 0})})).catch((e=>{d((0,g.sprintf)(
|
|
|
|
|
|
|
86 |
/* translators: 1. Error message */
|
87 |
+
(0,g.__)("Could not edit image. %s"),(0,ul.__unstableStripHTML)(e.message)),{id:"image-editing-error",type:"snackbar"})})).finally((()=>{f(!1),u()}))}),[f,t,n,o,r,l,i,c,d,f,u]);return(0,s.useMemo)((()=>({isInProgress:p,apply:v,cancel:h})),[p,v,h])}({id:t,url:n,onSaveImage:c,onFinishEditing:a,...d}),f=(0,s.useMemo)((()=>({...d,...p})),[d,p]);return(0,s.createElement)(yk.Provider,{value:f},u)}function Sk(e){let{url:t,width:n,height:o,clientWidth:r,naturalHeight:l,naturalWidth:i}=e;const{isInProgress:a,editedUrl:u,position:d,zoom:m,aspect:f,setPosition:g,setCrop:h,setZoom:v,rotation:b}=Ek();let k=o||r*l/i;return b%180==90&&(k=r*i/l),(0,s.createElement)("div",{className:c()("wp-block-image__crop-area",{"is-applying":a}),style:{width:n||r,height:k}},(0,s.createElement)(kk,{image:u||t,disabled:a,minZoom:1,maxZoom:3,crop:d,zoom:m/100,aspect:f,onCropChange:g,onCropComplete:e=>{h(e)},onZoomChange:e=>{v(100*e)}}),a&&(0,s.createElement)(p.Spinner,null))}var wk=(0,s.createElement)(A.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(A.Path,{d:"M13.5 6C10.5 6 8 8.5 8 11.5c0 1.1.3 2.1.9 3l-3.4 3 1 1.1 3.4-2.9c1 .9 2.2 1.4 3.6 1.4 3 0 5.5-2.5 5.5-5.5C19 8.5 16.5 6 13.5 6zm0 9.5c-2.2 0-4-1.8-4-4s1.8-4 4-4 4 1.8 4 4-1.8 4-4 4z"}));function Bk(){const{isInProgress:e,zoom:t,setZoom:n}=Ek();return(0,s.createElement)(p.Dropdown,{contentClassName:"wp-block-image__zoom",popoverProps:_k,renderToggle:t=>{let{isOpen:n,onToggle:o}=t;return(0,s.createElement)(p.ToolbarButton,{icon:wk,label:(0,g.__)("Zoom"),onClick:o,"aria-expanded":n,disabled:e})},renderContent:()=>(0,s.createElement)(p.RangeControl,{label:(0,g.__)("Zoom"),min:100,max:300,value:Math.round(t),onChange:n})})}var Ik=(0,s.createElement)(A.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(A.Path,{d:"M18.5 5.5h-13c-1.1 0-2 .9-2 2v9c0 1.1.9 2 2 2h13c1.1 0 2-.9 2-2v-9c0-1.1-.9-2-2-2zm.5 11c0 .3-.2.5-.5.5h-13c-.3 0-.5-.2-.5-.5v-9c0-.3.2-.5.5-.5h13c.3 0 .5.2.5.5v9zM6.5 12H8v-2h2V8.5H6.5V12zm9.5 2h-2v1.5h3.5V12H16v2z"}));function xk(e){let{aspectRatios:t,isDisabled:n,label:o,onClick:r,value:l}=e;return(0,s.createElement)(p.MenuGroup,{label:o},t.map((e=>{let{title:t,aspect:o}=e;return(0,s.createElement)(p.MenuItem,{key:o,disabled:n,onClick:()=>{r(o)},role:"menuitemradio",isSelected:o===l,icon:o===l?mm:void 0},t)})))}function Tk(e){let{toggleProps:t}=e;const{isInProgress:n,aspect:o,setAspect:r,defaultAspect:l}=Ek();return(0,s.createElement)(p.DropdownMenu,{icon:Ik,label:(0,g.__)("Aspect Ratio"),popoverProps:_k,toggleProps:t,className:"wp-block-image__aspect-ratio"},(e=>{let{onClose:t}=e;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(xk,{isDisabled:n,onClick:e=>{r(e),t()},value:o,aspectRatios:[{title:(0,g.__)("Original"),aspect:l},{title:(0,g.__)("Square"),aspect:1}]}),(0,s.createElement)(xk,{label:(0,g.__)("Landscape"),isDisabled:n,onClick:e=>{r(e),t()},value:o,aspectRatios:[{title:(0,g.__)("16:10"),aspect:1.6},{title:(0,g.__)("16:9"),aspect:16/9},{title:(0,g.__)("4:3"),aspect:4/3},{title:(0,g.__)("3:2"),aspect:1.5}]}),(0,s.createElement)(xk,{label:(0,g.__)("Portrait"),isDisabled:n,onClick:e=>{r(e),t()},value:o,aspectRatios:[{title:(0,g.__)("10:16"),aspect:.625},{title:(0,g.__)("9:16"),aspect:9/16},{title:(0,g.__)("3:4"),aspect:3/4},{title:(0,g.__)("2:3"),aspect:2/3}]}))}))}var Nk=(0,s.createElement)(A.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(A.Path,{d:"M15.1 4.8l-3-2.5V4c-4.4 0-8 3.6-8 8 0 3.7 2.5 6.9 6 7.7.3.1.6.1 1 .2l.2-1.5c-.4 0-.7-.1-1.1-.2l-.1.2v-.2c-2.6-.8-4.5-3.3-4.5-6.2 0-3.6 2.9-6.5 6.5-6.5v1.8l3-2.5zM20 11c-.2-1.4-.7-2.7-1.6-3.8l-1.2.8c.7.9 1.1 2 1.3 3.1L20 11zm-1.5 1.8c-.1.5-.2 1.1-.4 1.6s-.5 1-.8 1.5l1.2.9c.4-.5.8-1.1 1-1.8s.5-1.3.5-2l-1.5-.2zm-5.6 5.6l.2 1.5c1.4-.2 2.7-.7 3.8-1.6l-.9-1.1c-.9.7-2 1.1-3.1 1.2z"}));function Pk(){const{isInProgress:e,rotateClockwise:t}=Ek();return(0,s.createElement)(p.ToolbarButton,{icon:Nk,label:(0,g.__)("Rotate"),onClick:t,disabled:e})}function Rk(){const{isInProgress:e,apply:t,cancel:n}=Ek();return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.ToolbarButton,{onClick:t,disabled:e},(0,g.__)("Apply")),(0,s.createElement)(p.ToolbarButton,{onClick:n},(0,g.__)("Cancel")))}function Mk(e){let{url:t,width:n,height:o,clientWidth:r,naturalHeight:l,naturalWidth:i}=e;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Sk,{url:t,width:n,height:o,clientWidth:r,naturalHeight:l,naturalWidth:i}),(0,s.createElement)(so,null,(0,s.createElement)(p.ToolbarGroup,null,(0,s.createElement)(Bk,null),(0,s.createElement)(p.ToolbarItem,null,(e=>(0,s.createElement)(Tk,{toggleProps:e}))),(0,s.createElement)(Pk,null)),(0,s.createElement)(p.ToolbarGroup,null,(0,s.createElement)(Rk,null))))}const Lk=[25,50,75,100];function Ak(e){let{imageWidth:t,imageHeight:n,imageSizeOptions:o=[],isResizable:r=!0,slug:l,width:i,height:a,onChange:c,onChangeImage:d=u.noop}=e;const{currentHeight:m,currentWidth:f,updateDimension:h,updateDimensions:v}=function(e,t,n,o,r){var l,i;const[a,c]=(0,s.useState)(null!==(l=null!=t?t:o)&&void 0!==l?l:""),[u,d]=(0,s.useState)(null!==(i=null!=e?e:n)&&void 0!==i?i:"");return(0,s.useEffect)((()=>{void 0===t&&void 0!==o&&c(o),void 0===e&&void 0!==n&&d(n)}),[o,n]),(0,s.useEffect)((()=>{void 0!==t&&Number.parseInt(t)!==Number.parseInt(a)&&c(t),void 0!==e&&Number.parseInt(e)!==Number.parseInt(u)&&d(e)}),[t,e]),{currentHeight:u,currentWidth:a,updateDimension:(e,t)=>{"width"===e?c(t):d(t),r({[e]:""===t?void 0:parseInt(t,10)})},updateDimensions:(e,t)=>{d(null!=e?e:n),c(null!=t?t:o),r({height:e,width:t})}}}(a,i,n,t,c);return(0,s.createElement)(s.Fragment,null,!(0,u.isEmpty)(o)&&(0,s.createElement)(p.SelectControl,{label:(0,g.__)("Image size"),value:l,options:o,onChange:d}),r&&(0,s.createElement)("div",{className:"block-editor-image-size-control"},(0,s.createElement)("p",{className:"block-editor-image-size-control__row"},(0,g.__)("Image dimensions")),(0,s.createElement)("div",{className:"block-editor-image-size-control__row"},(0,s.createElement)(p.TextControl,{type:"number",className:"block-editor-image-size-control__width",label:(0,g.__)("Width"),value:f,min:1,onChange:e=>h("width",e)}),(0,s.createElement)(p.TextControl,{type:"number",className:"block-editor-image-size-control__height",label:(0,g.__)("Height"),value:m,min:1,onChange:e=>h("height",e)})),(0,s.createElement)("div",{className:"block-editor-image-size-control__row"},(0,s.createElement)(p.ButtonGroup,{"aria-label":(0,g.__)("Image size presets")},Lk.map((e=>{const o=Math.round(t*(e/100)),r=Math.round(n*(e/100)),l=f===o&&m===r;return(0,s.createElement)(p.Button,{key:e,isSmall:!0,variant:l?"primary":void 0,isPressed:l,onClick:()=>v(r,o)},e,"%")}))),(0,s.createElement)(p.Button,{isSmall:!0,onClick:()=>v()},(0,g.__)("Reset")))))}var Dk=(0,s.createElement)(A.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -2 24 24"},(0,s.createElement)(A.Path,{d:"M6.734 16.106l2.176-2.38-1.093-1.028-3.846 4.158 3.846 4.157 1.093-1.027-2.176-2.38h2.811c1.125 0 2.25.03 3.374 0 1.428-.001 3.362-.25 4.963-1.277 1.66-1.065 2.868-2.906 2.868-5.859 0-2.479-1.327-4.896-3.65-5.93-1.82-.813-3.044-.8-4.806-.788l-.567.002v1.5c.184 0 .368 0 .553-.002 1.82-.007 2.704-.014 4.21.657 1.854.827 2.76 2.657 2.76 4.561 0 2.472-.973 3.824-2.178 4.596-1.258.807-2.864 1.04-4.163 1.04h-.02c-1.115.03-2.229 0-3.344 0H6.734z"})),Ok=e=>{let{value:t,onChange:n=u.noop,settings:o}=e;if(!o||!o.length)return null;const r=e=>o=>{n({...t,[e.id]:o})},l=o.map((e=>(0,s.createElement)(p.ToggleControl,{className:"block-editor-link-control__setting",key:e.id,label:e.title,onChange:r(e),checked:!!t&&!!t[e.id]})));return(0,s.createElement)("fieldset",{className:"block-editor-link-control__settings"},(0,s.createElement)(p.VisuallyHidden,{as:"legend"},(0,g.__)("Currently selected link settings")),l)},Fk=n(5425),zk=n.n(Fk);class Vk extends s.Component{constructor(e){super(e),this.onChange=this.onChange.bind(this),this.onFocus=this.onFocus.bind(this),this.onKeyDown=this.onKeyDown.bind(this),this.selectLink=this.selectLink.bind(this),this.handleOnClick=this.handleOnClick.bind(this),this.bindSuggestionNode=this.bindSuggestionNode.bind(this),this.autocompleteRef=e.autocompleteRef||(0,s.createRef)(),this.inputRef=(0,s.createRef)(),this.updateSuggestions=(0,u.debounce)(this.updateSuggestions.bind(this),200),this.suggestionNodes=[],this.isUpdatingSuggestions=!1,this.state={suggestions:[],showSuggestions:!1,selectedSuggestion:null,suggestionsListboxId:"",suggestionOptionIdPrefix:""}}componentDidUpdate(e){const{showSuggestions:t,selectedSuggestion:n}=this.state,{value:o,__experimentalShowInitialSuggestions:r=!1}=this.props;t&&null!==n&&this.suggestionNodes[n]&&!this.scrollingIntoView&&(this.scrollingIntoView=!0,zk()(this.suggestionNodes[n],this.autocompleteRef.current,{onlyScrollIfNeeded:!0}),this.props.setTimeout((()=>{this.scrollingIntoView=!1}),100)),e.value===o||this.props.disableSuggestions||this.isUpdatingSuggestions||(null!=o&&o.length?this.updateSuggestions(o):r&&this.updateSuggestions())}componentDidMount(){this.shouldShowInitialSuggestions()&&this.updateSuggestions()}componentWillUnmount(){var e,t;null===(e=this.suggestionsRequest)||void 0===e||null===(t=e.cancel)||void 0===t||t.call(e),delete this.suggestionsRequest}bindSuggestionNode(e){return t=>{this.suggestionNodes[e]=t}}shouldShowInitialSuggestions(){const{suggestions:e}=this.state,{__experimentalShowInitialSuggestions:t=!1,value:n}=this.props;return!this.isUpdatingSuggestions&&t&&!(n&&n.length)&&!(e&&e.length)}updateSuggestions(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";const{__experimentalFetchLinkSuggestions:n,__experimentalHandleURLSuggestions:o}=this.props;if(!n)return;const r=!(null!==(e=t)&&void 0!==e&&e.length);if(t=t.trim(),!r&&(t.length<2||!o&&(0,pp.isURL)(t)))return void this.setState({showSuggestions:!1,selectedSuggestion:null,loading:!1});this.isUpdatingSuggestions=!0,this.setState({selectedSuggestion:null,loading:!0});const l=n(t,{isInitialSuggestions:r});l.then((e=>{this.suggestionsRequest===l&&(this.setState({suggestions:e,loading:!1,showSuggestions:!!e.length}),e.length?this.props.debouncedSpeak((0,g.sprintf)(
|
88 |
/* translators: %s: number of results. */
|
89 |
+
(0,g._n)("%d result found, use up and down arrow keys to navigate.","%d results found, use up and down arrow keys to navigate.",e.length),e.length),"assertive"):this.props.debouncedSpeak((0,g.__)("No results."),"assertive"),this.isUpdatingSuggestions=!1)})).catch((()=>{this.suggestionsRequest===l&&(this.setState({loading:!1}),this.isUpdatingSuggestions=!1)})),this.suggestionsRequest=l}onChange(e){const t=e.target.value;this.props.onChange(t),this.props.disableSuggestions||this.updateSuggestions(t)}onFocus(){const{suggestions:e}=this.state,{disableSuggestions:t,value:n}=this.props;!n||t||this.isUpdatingSuggestions||e&&e.length||this.updateSuggestions(n)}onKeyDown(e){const{showSuggestions:t,selectedSuggestion:n,suggestions:o,loading:r}=this.state;if(!t||!o.length||r){switch(e.keyCode){case Tc.UP:0!==e.target.selectionStart&&(e.preventDefault(),e.target.setSelectionRange(0,0));break;case Tc.DOWN:this.props.value.length!==e.target.selectionStart&&(e.preventDefault(),e.target.setSelectionRange(this.props.value.length,this.props.value.length));break;case Tc.ENTER:e.preventDefault(),this.props.onSubmit&&this.props.onSubmit(null,e)}return}const l=this.state.suggestions[this.state.selectedSuggestion];switch(e.keyCode){case Tc.UP:{e.preventDefault();const t=n?n-1:o.length-1;this.setState({selectedSuggestion:t});break}case Tc.DOWN:{e.preventDefault();const t=null===n||n===o.length-1?0:n+1;this.setState({selectedSuggestion:t});break}case Tc.TAB:null!==this.state.selectedSuggestion&&(this.selectLink(l),this.props.speak((0,g.__)("Link selected.")));break;case Tc.ENTER:e.preventDefault(),null!==this.state.selectedSuggestion?(this.selectLink(l),this.props.onSubmit&&this.props.onSubmit(l,e)):this.props.onSubmit&&this.props.onSubmit(null,e)}}selectLink(e){this.props.onChange(e.url,e),this.setState({selectedSuggestion:null,showSuggestions:!1})}handleOnClick(e){this.selectLink(e),this.inputRef.current.focus()}static getDerivedStateFromProps(e,t){let{value:n,instanceId:o,disableSuggestions:r,__experimentalShowInitialSuggestions:l=!1}=e,{showSuggestions:i}=t,s=i;const a=n&&n.length;return l||a||(s=!1),!0===r&&(s=!1),{showSuggestions:s,suggestionsListboxId:`block-editor-url-input-suggestions-${o}`,suggestionOptionIdPrefix:`block-editor-url-input-suggestion-${o}`}}render(){return(0,s.createElement)(s.Fragment,null,this.renderControl(),this.renderSuggestions())}renderControl(){const{label:e=null,className:t,isFullWidth:n,instanceId:o,placeholder:r=(0,g.__)("Paste URL or type to search"),__experimentalRenderControl:l,value:i=""}=this.props,{loading:a,showSuggestions:u,selectedSuggestion:d,suggestionsListboxId:m,suggestionOptionIdPrefix:f}=this.state,h=`url-input-control-${o}`,v={id:h,label:e,className:c()("block-editor-url-input",t,{"is-full-width":n})},b={id:h,value:i,required:!0,className:"block-editor-url-input__input",type:"text",onChange:this.onChange,onFocus:this.onFocus,placeholder:r,onKeyDown:this.onKeyDown,role:"combobox","aria-label":e?void 0:(0,g.__)("URL"),"aria-expanded":u,"aria-autocomplete":"list","aria-owns":m,"aria-activedescendant":null!==d?`${f}-${d}`:void 0,ref:this.inputRef};return l?l(v,b,a):(0,s.createElement)(p.BaseControl,v,(0,s.createElement)("input",b),a&&(0,s.createElement)(p.Spinner,null))}renderSuggestions(){const{className:e,__experimentalRenderSuggestions:t,value:n="",__experimentalShowInitialSuggestions:o=!1}=this.props,{showSuggestions:r,suggestions:l,selectedSuggestion:a,suggestionsListboxId:d,suggestionOptionIdPrefix:m,loading:f}=this.state,g={id:d,ref:this.autocompleteRef,role:"listbox"},h=(e,t)=>({role:"option",tabIndex:"-1",id:`${m}-${t}`,ref:this.bindSuggestionNode(t),"aria-selected":t===a});return(0,u.isFunction)(t)&&r&&l.length?t({suggestions:l,selectedSuggestion:a,suggestionsListProps:g,buildSuggestionItemProps:h,isLoading:f,handleSuggestionClick:this.handleOnClick,isInitialSuggestions:o&&!(n&&n.length)}):!(0,u.isFunction)(t)&&r&&l.length?(0,s.createElement)(p.Popover,{position:"bottom",focusOnMount:!1},(0,s.createElement)("div",i({},g,{className:c()("block-editor-url-input__suggestions",`${e}__suggestions`)}),l.map(((e,t)=>(0,s.createElement)(p.Button,i({},h(0,t),{key:e.id,className:c()("block-editor-url-input__suggestion",{"is-selected":t===a}),onClick:()=>this.handleOnClick(e)}),e.title))))):null}}var Hk=(0,d.compose)(d.withSafeTimeout,p.withSpokenMessages,d.withInstanceId,(0,m.withSelect)(((e,t)=>{if((0,u.isFunction)(t.__experimentalFetchLinkSuggestions))return;const{getSettings:n}=e(Qn);return{__experimentalFetchLinkSuggestions:n().__experimentalFetchLinkSuggestions}})))(Vk),Gk=e=>{let t,{searchTerm:n,onClick:o,itemProps:r,isSelected:l,buttonText:a}=e;return n?(t=a?(0,u.isFunction)(a)?a(n):a:(0,s.createInterpolateElement)((0,g.sprintf)(
|
90 |
/* translators: %s: search term. */
|
91 |
+
(0,g.__)("Create: <mark>%s</mark>"),n),{mark:(0,s.createElement)("mark",null)}),(0,s.createElement)(p.Button,i({},r,{className:c()("block-editor-link-control__search-create block-editor-link-control__search-item",{"is-selected":l}),onClick:o}),(0,s.createElement)(Ir,{className:"block-editor-link-control__search-item-icon",icon:Vc}),(0,s.createElement)("span",{className:"block-editor-link-control__search-item-header"},(0,s.createElement)("span",{className:"block-editor-link-control__search-item-title"},t)))):null},Uk=(0,s.createElement)(A.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(A.Path,{d:"M12 3.3c-4.8 0-8.8 3.9-8.8 8.8 0 4.8 3.9 8.8 8.8 8.8 4.8 0 8.8-3.9 8.8-8.8s-4-8.8-8.8-8.8zm6.5 5.5h-2.6C15.4 7.3 14.8 6 14 5c2 .6 3.6 2 4.5 3.8zm.7 3.2c0 .6-.1 1.2-.2 1.8h-2.9c.1-.6.1-1.2.1-1.8s-.1-1.2-.1-1.8H19c.2.6.2 1.2.2 1.8zM12 18.7c-1-.7-1.8-1.9-2.3-3.5h4.6c-.5 1.6-1.3 2.9-2.3 3.5zm-2.6-4.9c-.1-.6-.1-1.1-.1-1.8 0-.6.1-1.2.1-1.8h5.2c.1.6.1 1.1.1 1.8s-.1 1.2-.1 1.8H9.4zM4.8 12c0-.6.1-1.2.2-1.8h2.9c-.1.6-.1 1.2-.1 1.8 0 .6.1 1.2.1 1.8H5c-.2-.6-.2-1.2-.2-1.8zM12 5.3c1 .7 1.8 1.9 2.3 3.5H9.7c.5-1.6 1.3-2.9 2.3-3.5zM10 5c-.8 1-1.4 2.3-1.8 3.8H5.5C6.4 7 8 5.6 10 5zM5.5 15.3h2.6c.4 1.5 1 2.8 1.8 3.7-1.8-.6-3.5-2-4.4-3.7zM14 19c.8-1 1.4-2.2 1.8-3.7h2.6C17.6 17 16 18.4 14 19z"})),Wk=e=>{let{itemProps:t,suggestion:n,isSelected:o=!1,onClick:r,isURL:l=!1,searchTerm:a="",shouldShowType:u=!1}=e;return(0,s.createElement)(p.Button,i({},t,{onClick:r,className:c()("block-editor-link-control__search-item",{"is-selected":o,"is-url":l,"is-entity":!l})}),l&&(0,s.createElement)(Ir,{className:"block-editor-link-control__search-item-icon",icon:Uk}),(0,s.createElement)("span",{className:"block-editor-link-control__search-item-header"},(0,s.createElement)("span",{className:"block-editor-link-control__search-item-title"},(0,s.createElement)(p.TextHighlight,{text:n.title,highlight:a})),(0,s.createElement)("span",{"aria-hidden":!l,className:"block-editor-link-control__search-item-info"},!l&&((0,pp.filterURLForDisplay)((0,pp.safeDecodeURI)(n.url))||""),l&&(0,g.__)("Press ENTER to add this link"))),u&&n.type&&(0,s.createElement)("span",{className:"block-editor-link-control__search-item-type"},function(e){return e.isFrontPage?"front page":"post_tag"===e.type?"tag":e.type}(n)))};const $k="__CREATE__",jk="mailto",Kk="internal",qk=["URL",jk,"tel",Kk],Yk=[{id:"opensInNewTab",title:(0,g.__)("Open in new tab")}];function Zk(e){let{instanceId:t,withCreateSuggestion:n,currentInputValue:o,handleSuggestionClick:r,suggestionsListProps:l,buildSuggestionItemProps:a,suggestions:u,selectedSuggestion:d,isLoading:m,isInitialSuggestions:f,createSuggestionButtonText:h,suggestionsQuery:v}=e;const b=c()("block-editor-link-control__search-results",{"is-loading":m}),k=1===u.length&&qk.includes(u[0].type),_=n&&!k&&!f,y=!(null!=v&&v.type),E=`block-editor-link-control-search-results-label-${t}`,C=f?(0,g.__)("Recently updated"):(0,g.sprintf)(
|
92 |
/* translators: %s: search term. */
|
|