WordPress/wp-includes/js/dist/block-editor.min.js
hellofromTonya cce69f5098 Editor: Update packages for 6.1 Beta 2.
Package updates for bug and regression fixes:

* @wordpress/block-directory: 3.15.3
* @wordpress/block-editor: 10.0.3
* @wordpress/block-library: 7.14.3
* @wordpress/block-serialization-default-parser: 4.17.1
* @wordpress/blocks: 11.16.3
* @wordpress/components: 21.0.3
* @wordpress/compose: 5.15.2
* @wordpress/core-data: 5.0.3
* @wordpress/customize-widgets: 3.14.3
* @wordpress/edit-post: 6.14.3
* @wordpress/edit-site: 4.14.4
* @wordpress/edit-widgets: 4.14.3
* @wordpress/editor: 12.16.3
* @wordpress/format-library: 3.15.3
* @wordpress/interface: 4.16.3
* @wordpress/list-reusable-blocks: 3.15.3
* @wordpress/nux: 5.15.3
* @wordpress/preferences: 2.9.3
* @wordpress/reusable-blocks: 3.15.3
* @wordpress/server-side-render: 3.15.3
* @wordpress/style-engine: 1.0.2
* @wordpress/widgets: 2.15.3

References:
* [https://github.com/WordPress/gutenberg/pull/44233 Gutenberg PR 44233] – Blocks: Fix searching of blocks when description is non-string
* [https://github.com/WordPress/gutenberg/pull/44301 Gutenberg PR 44301] – Block Toolbar: update position when moving blocks
* [https://github.com/WordPress/gutenberg/pull/44334 Gutenberg PR 44334] – Global Styles: Re-add styles that were removed, for classic themes
* [https://github.com/WordPress/gutenberg/pull/44351 Gutenberg PR 44351] – Comments block: Support nested comments settings in the comments blocks
* [https://github.com/WordPress/gutenberg/pull/44448 Gutenberg PR 44448] – Add a correct TS signature for useEntityRecords
* [https://github.com/WordPress/gutenberg/pull/44315 Gutenberg PR 44315] – Pullquote: fix transform to quote crash
* [https://github.com/WordPress/gutenberg/pull/44446 Gutenberg PR 44446] – Fix spacing property generation in flow layout type.
* [https://github.com/WordPress/gutenberg/pull/44408 Gutenberg PR 44408] – Upgrade react-easy-crop to bring in fix for site editor iframe
* [https://github.com/WordPress/gutenberg/pull/44406 Gutenberg PR 44406] – Style engine: kebab case preset slugs in the editor
* [https://github.com/WordPress/gutenberg/pull/44209 Gutenberg PR 44209] – Fixing padding on the post editor when RootPaddingAwareAlignments setting is enabled
* [https://github.com/WordPress/gutenberg/pull/42950 Gutenberg PR 42950] – Popover: fix limitShift logic by adding iframe offset correctly (and a custom shift limiter)
* [https://github.com/WordPress/gutenberg/pull/44337 Gutenberg PR 44337] – Submenu block href only if url is not empty
* [https://github.com/WordPress/gutenberg/pull/44291 Gutenberg PR 44291] – Add role=application to list view to prevent browse mode triggering in NVDA
* [https://github.com/WordPress/gutenberg/pull/44283 Gutenberg PR 44283] – Navigation block: Fix submenu colors for imported classic menus
* [https://github.com/WordPress/gutenberg/pull/44282 Gutenberg PR 44282] – Fix popover stacking in the customize widgets editor
* [https://github.com/WordPress/gutenberg/pull/44247 Gutenberg PR 44247] – Spacing presets: switch to using numbers instead of t-shirt sizes for labels
* [https://github.com/WordPress/gutenberg/pull/44299 Gutenberg PR 44299] – Backport template creation changes from core
* [https://github.com/WordPress/gutenberg/pull/44294 Gutenberg PR 44294] – [Block Library - Query Loop]: Fix broken preview in specific category template
* [https://github.com/WordPress/gutenberg/pull/44287 Gutenberg PR 44287] – [Block Library]: Rename Comments pagination inner blocks
* [https://github.com/WordPress/gutenberg/pull/44256 Gutenberg PR 44256] – Avoid showing the recursion warning in previews when replacing template parts
* [https://github.com/WordPress/gutenberg/pull/44265 Gutenberg PR 44265] – Blocks: officially deprecated the children and node matchers
* [https://github.com/WordPress/gutenberg/pull/44251 Gutenberg PR 44251] – Global styles: Remove the beta label from global styles header

Props bernhard-reiter, cbravobernal.
See #56467.
Built from https://develop.svn.wordpress.org/trunk@54335


git-svn-id: http://core.svn.wordpress.org/trunk@53894 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-09-27 17:32:52 +00:00

26 lines
556 KiB
JavaScript
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*! This file is auto-generated */
!function(){var e={6411:function(e,t){var n,o,r;
/*!
autosize 4.0.4
license: MIT
http://www.jacklmoore.com/autosize
*/o=[e,t],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&&p()},a=function(t){window.removeEventListener("resize",i,!1),e.removeEventListener("input",p,!1),e.removeEventListener("keyup",p,!1),e.removeEventListener("autosize:destroy",a,!1),e.removeEventListener("autosize:update",p,!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",a,!1),"onpropertychange"in e&&"oninput"in e&&e.addEventListener("keyup",p,!1),window.addEventListener("resize",i,!1),e.addEventListener("input",p,!1),e.addEventListener("autosize:update",p,!1),e.style.overflowX="hidden",e.style.wordWrap="break-word",r.set(e,{destroy:a,update:p}),s()}function s(){var n=window.getComputedStyle(e,null);"vertical"===n.resize?e.style.resize="none":"both"===n.resize&&(e.style.resize="horizontal"),t="content-box"===n.boxSizing?-(parseFloat(n.paddingTop)+parseFloat(n.paddingBottom)):parseFloat(n.borderTopWidth)+parseFloat(n.borderBottomWidth),isNaN(t)&&(t=0),p()}function c(t){var n=e.style.width;e.style.width="0px",e.offsetWidth,e.style.width=n,e.style.overflowY=t}function u(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}function d(){if(0!==e.scrollHeight){var o=u(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 p(){d();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"),d(),r="content-box"===n.boxSizing?Math.round(parseFloat(window.getComputedStyle(e,null).height)):e.offsetHeight):"hidden"!==n.overflowY&&(c("hidden"),d(),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 a(e){var t=r.get(e);t&&t.destroy()}function s(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,t)})),e}).destroy=function(e){return e&&Array.prototype.forEach.call(e.length?e:[e],a),e},c.update=function(e){return e&&Array.prototype.forEach.call(e.length?e:[e],s),e}),t.default=c,e.exports=t.default},void 0===(r="function"==typeof n?n.apply(t,o):n)||(e.exports=r)},4403:function(e,t){var n;
/*!
Copyright (c) 2018 Jed Watson.
Licensed under the MIT License (MIT), see
http://jedwatson.github.io/classnames
*/!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&&!n.toString.toString().includes("[native code]")){e.push(n.toString());continue}for(var a in n)o.call(n,a)&&n[a]&&e.push(a)}}}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,a=0,s=0;l<i;l++){var c=t[l];if(c.removed){if(c.value=e.join(o.slice(s,s+c.count)),s+=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(a,a+c.count);d=d.map((function(e,t){var n=o[s+t];return n.length>e.length?n:e})),c.value=e.join(d)}else c.value=e.join(n.slice(a,a+c.count));a+=c.count,c.added||(s+=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 a(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 s=(t=this.removeEmpty(this.tokenize(t))).length,c=e.length,u=1,d=s+c,p=[{newPos:-1,components:[]}],m=this.extractCommon(p[0],t,e,0);if(p[0].newPos+1>=s&&m+1>=c)return a([{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<s,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>=s&&f+1>=c)return a(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,a=i-o,s=0;i+1<r&&a+1<l&&this.equals(t[i+1],n[a+1]);)i++,a++,s++;return s&&e.components.push({count:s}),e.newPos=i,a},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,a=n.alignWithLeft,s=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=o.offset(e),f=o.outerHeight(e),g=o.outerWidth(e),h=void 0,v=void 0,b=void 0,_=void 0,k=void 0,y=void 0,E=void 0,C=void 0,w=void 0,S=void 0;p?(E=t,S=o.height(E),w=o.width(E),C={left:o.scrollLeft(E),top:o.scrollTop(E)},k={left:m.left-C.left-c,top:m.top-C.top-s},y={left:m.left+g-(C.left+w)+d,top:m.top+f-(C.top+S)+u},_=C):(h=o.offset(t),v=t.clientHeight,b=t.clientWidth,_={left:t.scrollLeft,top:t.scrollTop},k={left:m.left-(h.left+(parseFloat(o.css(t,"borderLeftWidth"))||0))-c,top:m.top-(h.top+(parseFloat(o.css(t,"borderTopWidth"))||0))-s},y={left:m.left+g-(h.left+b+(parseFloat(o.css(t,"borderRightWidth"))||0))+d,top:m.top+f-(h.top+v+(parseFloat(o.css(t,"borderBottomWidth"))||0))+u}),k.top<0||y.top>0?!0===i?o.scrollTop(t,_.top+k.top):!1===i?o.scrollTop(t,_.top+y.top):k.top<0?o.scrollTop(t,_.top+k.top):o.scrollTop(t,_.top+y.top):l||((i=void 0===i||!!i)?o.scrollTop(t,_.top+k.top):o.scrollTop(t,_.top+y.top)),r&&(k.left<0||y.left>0?!0===a?o.scrollLeft(t,_.left+k.left):!1===a?o.scrollLeft(t,_.left+y.left):k.left<0?o.scrollLeft(t,_.left+k.left):o.scrollLeft(t,_.left+y.left):l||((a=void 0===a||!!a)?o.scrollLeft(t,_.left+k.left):o.scrollLeft(t,_.left+y.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 a=new RegExp("^("+/[\-+]?(?:\d*\.|)\d+(?:[eE][\-+]?\d+|)/.source+")(?!px)[a-z%]+$","i"),s=/^(top|right|bottom|left)$/;var 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(a.test(n)&&!s.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 a=void 0;a="border"===r?r+n[i]+"Width":r+n[i],o+=parseFloat(c(e,a))||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 a=void 0!==r||l,s=r||i;if(-1===n)return a?s-f(e,["border","padding"],o):i;if(a){var u=2===n?-f(e,["border"],o):f(e,["margin"],o);return s+(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 _(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 k(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)&&k(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&&_(t,e,n?0:1)};var n="width"===e?["Left","Right"]:["Top","Bottom"];h[e]=function(t,o){if(void 0===o)return t&&_(t,e,-1);if(t){c(t);return d(t)&&(o+=f(t,["padding","border"],n)),k(t,e,o)}}})),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"===k(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(k(e,l))||0,o[l]=r+t[l]-n[l]);k(e,o)}(e,t)},isWindow:g,each:u,css:k,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){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(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="&nbsp;","TEXTAREA"===l.toUpperCase()&&i.setAttribute("rows","1");var a=o(e,"font-size");i.style.fontSize=a,i.style.padding="0px",i.style.border="0px";var s=document.body;s.appendChild(i),n=i.offsetHeight,s.removeChild(i)}return n}},7970:function(e,t,n){e.exports=n(195)},3110:function(e){"use strict";var t=!("undefined"==typeof window||!window.document||!window.document.createElement),n={canUseDOM:t,canUseWorkers:"undefined"!=typeof Worker,canUseEventListeners:t&&!(!window.addEventListener&&!window.attachEvent),canUseViewport:t&&!!window.screen,isInWorker:!t};e.exports=n},3812:function(e){var t,n,o,r,l,i,a,s,c,u,d,p,m,f,g,h=!1;function v(){if(!h){h=!0;var e=navigator.userAgent,v=/(?:MSIE.(\d+\.\d+))|(?:(?:Firefox|GranParadiso|Iceweasel).(\d+\.\d+))|(?:Opera(?:.+Version.|.)(\d+\.\d+))|(?:AppleWebKit.(\d+(?:\.\d+)?))|(?:Trident\/\d+\.\d+.*rv:(\d+\.\d+))/.exec(e),b=/(Mac OS X)|(Windows)|(Linux)/.exec(e);if(p=/\b(iPhone|iP[ao]d)/.exec(e),m=/\b(iP[ao]d)/.exec(e),u=/Android/i.exec(e),f=/FBAN\/\w+;/i.exec(e),g=/Mobile/i.exec(e),d=!!/Win64/.exec(e),v){(t=v[1]?parseFloat(v[1]):v[5]?parseFloat(v[5]):NaN)&&document&&document.documentMode&&(t=document.documentMode);var _=/(?:Trident\/(\d+.\d+))/.exec(e);i=_?parseFloat(_[1])+4:t,n=v[2]?parseFloat(v[2]):NaN,o=v[3]?parseFloat(v[3]):NaN,(r=v[4]?parseFloat(v[4]):NaN)?(v=/(?:Chrome\/(\d+\.\d+))/.exec(e),l=v&&v[1]?parseFloat(v[1]):NaN):l=NaN}else t=n=o=l=r=NaN;if(b){if(b[1]){var k=/(?:Mac OS X (\d+(?:[._]\d+)?))/.exec(e);a=!k||parseFloat(k[1].replace("_","."))}else a=!1;s=!!b[2],c=!!b[3]}else a=s=c=!1}}var b={ie:function(){return v()||t},ieCompatibilityMode:function(){return v()||i>t},ie64:function(){return b.ie()&&d},firefox:function(){return v()||n},opera:function(){return v()||o},webkit:function(){return v()||r},safari:function(){return b.webkit()},chrome:function(){return v()||l},windows:function(){return v()||s},osx:function(){return v()||a},linux:function(){return v()||c},iphone:function(){return v()||p},mobile:function(){return v()||p||m||u||g},nativeApp:function(){return v()||f},android:function(){return v()||u},ipad:function(){return v()||m}};e.exports=b},7939:function(e,t,n){"use strict";var o,r=n(3110);r.canUseDOM&&(o=document.implementation&&document.implementation.hasFeature&&!0!==document.implementation.hasFeature("",""))
/**
* Checks if an event is supported in the current execution environment.
*
* NOTE: This will not work correctly for non-generic events such as `change`,
* `reset`, `load`, `error`, and `select`.
*
* Borrows from Modernizr.
*
* @param {string} eventNameSuffix Event name, e.g. "click".
* @param {?boolean} capture Check if the capture phase is supported.
* @return {boolean} True if the event is supported.
* @internal
* @license Modernizr 3.0.0pre (Custom Build) | MIT
*/,e.exports=function(e,t){if(!r.canUseDOM||t&&!("addEventListener"in document))return!1;var n="on"+e,l=n in document;if(!l){var i=document.createElement("div");i.setAttribute(n,"return;"),l="function"==typeof i[n]}return!l&&o&&"wheel"===e&&(l=document.implementation.hasFeature("Events.wheel","3.0")),l}},195:function(e,t,n){"use strict";var o=n(3812),r=n(7939);function l(e){var t=0,n=0,o=0,r=0;return"detail"in e&&(n=e.detail),"wheelDelta"in e&&(n=-e.wheelDelta/120),"wheelDeltaY"in e&&(n=-e.wheelDeltaY/120),"wheelDeltaX"in e&&(t=-e.wheelDeltaX/120),"axis"in e&&e.axis===e.HORIZONTAL_AXIS&&(t=n,n=0),o=10*t,r=10*n,"deltaY"in e&&(r=e.deltaY),"deltaX"in e&&(o=e.deltaX),(o||r)&&e.deltaMode&&(1==e.deltaMode?(o*=40,r*=40):(o*=800,r*=800)),o&&!t&&(t=o<1?-1:1),r&&!n&&(n=r<1?-1:1),{spinX:t,spinY:n,pixelX:o,pixelY:r}}l.getEventType=function(){return o.firefox()?"DOMMouseScroll":r("wheel")?"wheel":"mousewheel"},e.exports=l},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 a=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 a.name="Invariant Violation",a}}function t(){return e}e.isRequired=e;var n={array:e,bigint: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 n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),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 a=n(9196),s=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),s=i(t,["onResize","maxRows","onChange","style","innerRef","children"]),c=this.state.lineHeight,u=n&&c?c*n:null;return a.createElement("textarea",l({},s,{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:s.number,maxRows:s.number,onResize:s.func,innerRef:s.any,async:s.bool},t}(a.Component);t.TextareaAutosize=a.forwardRef((function(e,t){return a.createElement(p,l({},e,{innerRef:t}))}))},773:function(e,t,n){"use strict";var o=n(5438);t.Z=o.TextareaAutosize},4793:function(e){var t={"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","Ấ":"A","Ắ":"A","Ẳ":"A","Ẵ":"A","Ặ":"A","Æ":"AE","Ầ":"A","Ằ":"A","Ȃ":"A","Ç":"C","Ḉ":"C","È":"E","É":"E","Ê":"E","Ë":"E","Ế":"E","Ḗ":"E","Ề":"E","Ḕ":"E","Ḝ":"E","Ȇ":"E","Ì":"I","Í":"I","Î":"I","Ï":"I","Ḯ":"I","Ȋ":"I","Ð":"D","Ñ":"N","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","Ố":"O","Ṍ":"O","Ṓ":"O","Ȏ":"O","Ù":"U","Ú":"U","Û":"U","Ü":"U","Ý":"Y","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","ấ":"a","ắ":"a","ẳ":"a","ẵ":"a","ặ":"a","æ":"ae","ầ":"a","ằ":"a","ȃ":"a","ç":"c","ḉ":"c","è":"e","é":"e","ê":"e","ë":"e","ế":"e","ḗ":"e","ề":"e","ḕ":"e","ḝ":"e","ȇ":"e","ì":"i","í":"i","î":"i","ï":"i","ḯ":"i","ȋ":"i","ð":"d","ñ":"n","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","ố":"o","ṍ":"o","ṓ":"o","ȏ":"o","ù":"u","ú":"u","û":"u","ü":"u","ý":"y","ÿ":"y","Ā":"A","ā":"a","Ă":"A","ă":"a","Ą":"A","ą":"a","Ć":"C","ć":"c","Ĉ":"C","ĉ":"c","Ċ":"C","ċ":"c","Č":"C","č":"c","C̆":"C","c̆":"c","Ď":"D","ď":"d","Đ":"D","đ":"d","Ē":"E","ē":"e","Ĕ":"E","ĕ":"e","Ė":"E","ė":"e","Ę":"E","ę":"e","Ě":"E","ě":"e","Ĝ":"G","Ǵ":"G","ĝ":"g","ǵ":"g","Ğ":"G","ğ":"g","Ġ":"G","ġ":"g","Ģ":"G","ģ":"g","Ĥ":"H","ĥ":"h","Ħ":"H","ħ":"h","Ḫ":"H","ḫ":"h","Ĩ":"I","ĩ":"i","Ī":"I","ī":"i","Ĭ":"I","ĭ":"i","Į":"I","į":"i","İ":"I","ı":"i","IJ":"IJ","ij":"ij","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","Ḱ":"K","ḱ":"k","K̆":"K","k̆":"k","Ĺ":"L","ĺ":"l","Ļ":"L","ļ":"l","Ľ":"L","ľ":"l","Ŀ":"L","ŀ":"l","Ł":"l","ł":"l","Ḿ":"M","ḿ":"m","M̆":"M","m̆":"m","Ń":"N","ń":"n","Ņ":"N","ņ":"n","Ň":"N","ň":"n","ʼn":"n","N̆":"N","n̆":"n","Ō":"O","ō":"o","Ŏ":"O","ŏ":"o","Ő":"O","ő":"o","Œ":"OE","œ":"oe","P̆":"P","p̆":"p","Ŕ":"R","ŕ":"r","Ŗ":"R","ŗ":"r","Ř":"R","ř":"r","R̆":"R","r̆":"r","Ȓ":"R","ȓ":"r","Ś":"S","ś":"s","Ŝ":"S","ŝ":"s","Ş":"S","Ș":"S","ș":"s","ş":"s","Š":"S","š":"s","Ţ":"T","ţ":"t","ț":"t","Ț":"T","Ť":"T","ť":"t","Ŧ":"T","ŧ":"t","T̆":"T","t̆":"t","Ũ":"U","ũ":"u","Ū":"U","ū":"u","Ŭ":"U","ŭ":"u","Ů":"U","ů":"u","Ű":"U","ű":"u","Ų":"U","ų":"u","Ȗ":"U","ȗ":"u","V̆":"V","v̆":"v","Ŵ":"W","ŵ":"w","Ẃ":"W","ẃ":"w","X̆":"X","x̆":"x","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Y̆":"Y","y̆":"y","Ź":"Z","ź":"z","Ż":"Z","ż":"z","Ž":"Z","ž":"z","ſ":"s","ƒ":"f","Ơ":"O","ơ":"o","Ư":"U","ư":"u","Ǎ":"A","ǎ":"a","Ǐ":"I","ǐ":"i","Ǒ":"O","ǒ":"o","Ǔ":"U","ǔ":"u","Ǖ":"U","ǖ":"u","Ǘ":"U","ǘ":"u","Ǚ":"U","ǚ":"u","Ǜ":"U","ǜ":"u","Ứ":"U","ứ":"u","Ṹ":"U","ṹ":"u","Ǻ":"A","ǻ":"a","Ǽ":"AE","ǽ":"ae","Ǿ":"O","ǿ":"o","Þ":"TH","þ":"th","Ṕ":"P","ṕ":"p","Ṥ":"S","ṥ":"s","X́":"X","x́":"x","Ѓ":"Г","ѓ":"г","Ќ":"К","ќ":"к","A̋":"A","a̋":"a","E̋":"E","e̋":"e","I̋":"I","i̋":"i","Ǹ":"N","ǹ":"n","Ồ":"O","ồ":"o","Ṑ":"O","ṑ":"o","Ừ":"U","ừ":"u","Ẁ":"W","ẁ":"w","Ỳ":"Y","ỳ":"y","Ȁ":"A","ȁ":"a","Ȅ":"E","ȅ":"e","Ȉ":"I","ȉ":"i","Ȍ":"O","ȍ":"o","Ȑ":"R","ȑ":"r","Ȕ":"U","ȕ":"u","B̌":"B","b̌":"b","Č̣":"C","č̣":"c","Ê̌":"E","ê̌":"e","F̌":"F","f̌":"f","Ǧ":"G","ǧ":"g","Ȟ":"H","ȟ":"h","J̌":"J","ǰ":"j","Ǩ":"K","ǩ":"k","M̌":"M","m̌":"m","P̌":"P","p̌":"p","Q̌":"Q","q̌":"q","Ř̩":"R","ř̩":"r","Ṧ":"S","ṧ":"s","V̌":"V","v̌":"v","W̌":"W","w̌":"w","X̌":"X","x̌":"x","Y̌":"Y","y̌":"y","A̧":"A","a̧":"a","B̧":"B","b̧":"b","Ḑ":"D","ḑ":"d","Ȩ":"E","ȩ":"e","Ɛ̧":"E","ɛ̧":"e","Ḩ":"H","ḩ":"h","I̧":"I","i̧":"i","Ɨ̧":"I","ɨ̧":"i","M̧":"M","m̧":"m","O̧":"O","o̧":"o","Q̧":"Q","q̧":"q","U̧":"U","u̧":"u","X̧":"X","x̧":"x","Z̧":"Z","z̧":"z"},n=Object.keys(t).join("|"),o=new RegExp(n,"g"),r=new RegExp(n,""),l=function(e){return e.replace(o,(function(e){return t[e]}))};e.exports=l,e.exports.has=function(e){return!!e.match(r)},e.exports.remove=l},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){a(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(),s(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(a(e))t=[];else if("[object Date]"===i(e))t=new Date(e.getTime?e.getTime():e);else if(function(e){return"[object RegExp]"===i(e)}(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 s(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 a=r(o);return e.push(o),t.push(a),s(l(o),(function(e){a[e]=n(o[e])})),e.pop(),t.pop(),a}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 a=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)},s=function(e,t){if(e.forEach)return e.forEach(t);for(var n=0;n<e.length;n++)t(e[n],n,e)};s(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 v_},AlignmentToolbar:function(){return b_},Autocomplete:function(){return x_},BlockAlignmentControl:function(){return Ml},BlockAlignmentToolbar:function(){return Ll},BlockBreadcrumb:function(){return R_},BlockColorsStyleSelector:function(){return z_},BlockContextProvider:function(){return $l},BlockControls:function(){return _o},BlockEdit:function(){return Zl},BlockEditorKeyboardShortcuts:function(){return $C},BlockEditorProvider:function(){return Hu},BlockFormatControls:function(){return bo},BlockIcon:function(){return Du},BlockInspector:function(){return VC},BlockList:function(){return sh},BlockMover:function(){return df},BlockNavigationDropdown:function(){return sk},BlockPreview:function(){return _p},BlockSelectionClearer:function(){return Wu},BlockSettingsMenu:function(){return wg},BlockSettingsMenuControls:function(){return _g},BlockStyles:function(){return mk},BlockTitle:function(){return Qm},BlockToolbar:function(){return Lg},BlockTools:function(){return GC},BlockVerticalAlignmentControl:function(){return qr},BlockVerticalAlignmentToolbar:function(){return Yr},ButtonBlockAppender:function(){return Fm},ButtonBlockerAppender:function(){return zm},ColorPalette:function(){return Pk},ColorPaletteControl:function(){return Mk},ContrastChecker:function(){return ov},CopyHandler:function(){return eg},DefaultBlockAppender:function(){return Dm},FontSizePicker:function(){return jv},InnerBlocks:function(){return rh},Inserter:function(){return Am},InspectorAdvancedControls:function(){return gr},InspectorControls:function(){return hr},JustifyContentControl:function(){return Xr},JustifyToolbar:function(){return Jr},LineHeightControl:function(){return Iv},MediaPlaceholder:function(){return IE},MediaReplaceFlow:function(){return yE},MediaUpload:function(){return vE},MediaUploadCheck:function(){return bE},MultiSelectScrollIntoView:function(){return KC},NavigableToolbar:function(){return gf},ObserveTyping:function(){return QC},PanelColorSettings:function(){return xE},PlainText:function(){return sC},RichText:function(){return lC},RichTextShortcut:function(){return dC},RichTextToolbarButton:function(){return pC},SETTINGS_DEFAULTS:function(){return v},SkipToSelectedBlock:function(){return NC},ToolSelector:function(){return gC},Typewriter:function(){return tw},URLInput:function(){return Ly},URLInputButton:function(){return _C},URLPopover:function(){return wE},Warning:function(){return Xl},WritingFlow:function(){return rd},__experimentalBlockAlignmentMatrixControl:function(){return M_},__experimentalBlockFullHeightAligmentControl:function(){return N_},__experimentalBlockPatternSetup:function(){return Bk},__experimentalBlockPatternsList:function(){return Hp},__experimentalBlockVariationPicker:function(){return gk},__experimentalBlockVariationTransforms:function(){return Tk},__experimentalBorderRadiusControl:function(){return Eh},__experimentalColorGradientControl:function(){return Xh},__experimentalColorGradientSettingsDropdown:function(){return nv},__experimentalDateFormatPicker:function(){return Ak},__experimentalDuotoneControl:function(){return Mb},__experimentalFontAppearanceControl:function(){return wv},__experimentalFontFamilyControl:function(){return Ov},__experimentalGetBorderClassesAndStyles:function(){return qb},__experimentalGetColorClassesAndStyles:function(){return Zb},__experimentalGetElementClassName:function(){return cw},__experimentalGetGapCSSValue:function(){return Fr},__experimentalGetGradientClass:function(){return Hh},__experimentalGetGradientObjectByGradientValue:function(){return Uh},__experimentalGetMatchingVariation:function(){return dw},__experimentalGetSpacingClassesAndStyles:function(){return Jb},__experimentalImageEditingProvider:function(){return py},__experimentalImageEditor:function(){return Ey},__experimentalImageSizeControl:function(){return Sy},__experimentalImageURLInputUI:function(){return IC},__experimentalInspectorPopoverHeader:function(){return iw},__experimentalLayoutStyle:function(){return yl},__experimentalLetterSpacingControl:function(){return fb},__experimentalLibrary:function(){return WC},__experimentalLinkControl:function(){return mE},__experimentalLinkControlSearchInput:function(){return nE},__experimentalLinkControlSearchItem:function(){return Gy},__experimentalLinkControlSearchResults:function(){return qy},__experimentalListView:function(){return ik},__experimentalPanelColorGradientSettings:function(){return Hk},__experimentalPreviewOptions:function(){return xC},__experimentalPublishDateTimePicker:function(){return aw},__experimentalRecursionProvider:function(){return ow},__experimentalResponsiveBlockControl:function(){return uC},__experimentalSpacingSizesControl:function(){return or},__experimentalTextDecorationControl:function(){return nb},__experimentalTextTransformControl:function(){return ub},__experimentalUnitControl:function(){return hC},__experimentalUseBlockOverlayActive:function(){return wu},__experimentalUseBlockPreview:function(){return kp},__experimentalUseBorderProps:function(){return Yb},__experimentalUseColorProps:function(){return Xb},__experimentalUseCustomSides:function(){return Ar},__experimentalUseGradient:function(){return jh},__experimentalUseHasRecursion:function(){return rw},__experimentalUseMultipleOriginColorsAndGradients:function(){return xh},__experimentalUseResizeCanvas:function(){return TC},__unstableBlockNameContext:function(){return Mg},__unstableBlockSettingsMenuFirstItem:function(){return ag},__unstableBlockToolbarLastItem:function(){return qf},__unstableDuotoneFilter:function(){return fp},__unstableDuotoneStylesheet:function(){return pp},__unstableDuotoneUnsetStylesheet:function(){return mp},__unstableEditorStyles:function(){return up},__unstableGetValuesFromColors:function(){return dp},__unstableIframe:function(){return ad},__unstableInserterMenuExtension:function(){return wm},__unstablePresetDuotoneFilter:function(){return gp},__unstableRichTextInputEvent:function(){return mC},__unstableUseBlockSelectionClearer:function(){return Uu},__unstableUseClipboardHandler:function(){return Jf},__unstableUseMouseMoveTypingReset:function(){return YC},__unstableUseTypewriter:function(){return ew},__unstableUseTypingObserver:function(){return ZC},createCustomColorsHOC:function(){return i_},getColorClassName:function(){return Bh},getColorObjectByAttributeValues:function(){return wh},getColorObjectByColorValue:function(){return Sh},getFontSize:function(){return Gv},getFontSizeClass:function(){return Wv},getFontSizeObjectByValue:function(){return Uv},getGradientSlugByValue:function(){return Wh},getGradientValueBySlug:function(){return Gh},getPxFromCssUnit:function(){return yw},getTypographyClassesAndStyles:function(){return e_},store:function(){return so},storeConfig:function(){return ao},transformStyles:function(){return ap},useBlockDisplayInformation:function(){return Ym},useBlockEditContext:function(){return mo},useBlockProps:function(){return Su},useCachedTruthy:function(){return t_},useInnerBlocksProps:function(){return oh},useSetting:function(){return qo},withColorContext:function(){return Nk},withColors:function(){return a_},withFontSizes:function(){return u_}});var e={};n.r(e),n.d(e,{__experimentalGetActiveBlockIdByBlockNames:function(){return Vt},__experimentalGetAllowedBlocks:function(){return _t},__experimentalGetAllowedPatterns:function(){return Ct},__experimentalGetBlockListSettingsForBlocks:function(){return Tt},__experimentalGetDirectInsertBlock:function(){return kt},__experimentalGetGlobalBlocksByName:function(){return ee},__experimentalGetLastBlockAttributeChanges:function(){return Mt},__experimentalGetParsedPattern:function(){return yt},__experimentalGetPatternTransformItems:function(){return St},__experimentalGetPatternsByBlockTypes:function(){return wt},__experimentalGetReusableBlockTitle:function(){return Nt},__unstableGetBlockWithoutInnerBlocks:function(){return K},__unstableGetClientIdWithClientIdsTree:function(){return Y},__unstableGetClientIdsTree:function(){return Z},__unstableGetContentLockingParent:function(){return Wt},__unstableGetEditorMode:function(){return At},__unstableGetSelectedBlocksWithPartialSelection:function(){return Re},__unstableGetTemporarilyEditingAsBlocks:function(){return jt},__unstableGetVisibleBlocks:function(){return Ut},__unstableHasActiveBlockOverlayActive:function(){return $t},__unstableIsFullySelected:function(){return Ne},__unstableIsLastBlockChangeIgnored:function(){return Pt},__unstableIsSelectionCollapsed:function(){return Pe},__unstableIsSelectionMergeable:function(){return Le},__unstableIsWithinBlockOverlay:function(){return Kt},__unstableSelectionHasUnmergeableBlock:function(){return Me},areInnerBlocksControlled:function(){return Ft},canEditBlock:function(){return ct},canInsertBlockType:function(){return ot},canInsertBlocks:function(){return rt},canLockBlockType:function(){return ut},canMoveBlock:function(){return at},canMoveBlocks:function(){return st},canRemoveBlock:function(){return lt},canRemoveBlocks:function(){return it},didAutomaticChange:function(){return Ot},getAdjacentBlockClientId:function(){return he},getBlock:function(){return $},getBlockAttributes:function(){return j},getBlockCount:function(){return ne},getBlockHierarchyRootClientId:function(){return fe},getBlockIndex:function(){return De},getBlockInsertionPoint:function(){return Ze},getBlockListSettings:function(){return Bt},getBlockMode:function(){return Ue},getBlockName:function(){return U},getBlockOrder:function(){return Ae},getBlockParents:function(){return pe},getBlockParentsByBlockName:function(){return me},getBlockRootClientId:function(){return de},getBlockSelectionEnd:function(){return ie},getBlockSelectionStart:function(){return le},getBlockTransformItems:function(){return vt},getBlocks:function(){return q},getBlocksByClientId:function(){return te},getClientIdsOfDescendants:function(){return Q},getClientIdsWithDescendants:function(){return X},getDraggedBlockClientIds:function(){return $e},getFirstMultiSelectedBlockClientId:function(){return Ce},getGlobalBlockCount:function(){return J},getInserterItems:function(){return ht},getLastMultiSelectedBlockClientId:function(){return we},getLowestCommonAncestorWithSelectedBlock:function(){return ge},getMultiSelectedBlockClientIds:function(){return ye},getMultiSelectedBlocks:function(){return Ee},getMultiSelectedBlocksEndClientId:function(){return Te},getMultiSelectedBlocksStartClientId:function(){return xe},getNextBlockClientId:function(){return be},getPreviousBlockClientId:function(){return ve},getSelectedBlock:function(){return ue},getSelectedBlockClientId:function(){return ce},getSelectedBlockClientIds:function(){return ke},getSelectedBlockCount:function(){return ae},getSelectedBlocksInitialCaretPosition:function(){return _e},getSelectionEnd:function(){return re},getSelectionStart:function(){return oe},getSettings:function(){return It},getTemplate:function(){return Je},getTemplateLock:function(){return et},hasBlockMovingClientId:function(){return Dt},hasInserterItems:function(){return bt},hasMultiSelection:function(){return Ve},hasSelectedBlock:function(){return se},hasSelectedInnerBlock:function(){return ze},isAncestorBeingDragged:function(){return qe},isAncestorMultiSelected:function(){return Ie},isBlockBeingDragged:function(){return Ke},isBlockHighlighted:function(){return zt},isBlockInsertionPointVisible:function(){return Qe},isBlockMultiSelected:function(){return Be},isBlockSelected:function(){return Oe},isBlockValid:function(){return W},isBlockVisible:function(){return Gt},isBlockWithinSelection:function(){return Fe},isCaretWithinFormattedText:function(){return Ye},isDraggingBlocks:function(){return je},isFirstMultiSelectedBlock:function(){return Se},isLastBlockChangePersistent:function(){return xt},isMultiSelecting:function(){return He},isNavigationMode:function(){return Rt},isSelectionEnabled:function(){return Ge},isTyping:function(){return We},isValidTemplate:function(){return Xe},wasBlockJustInserted:function(){return Ht}});var t={};n.r(t),n.d(t,{__unstableDeleteSelection:function(){return In},__unstableExpandSelection:function(){return Tn},__unstableMarkAutomaticChange:function(){return qn},__unstableMarkLastChangeAsPersistent:function(){return $n},__unstableMarkNextChangeAsNotPersistent:function(){return Kn},__unstableSaveReusableBlock:function(){return jn},__unstableSetEditorMode:function(){return Zn},__unstableSetTemporarilyEditingAsBlocks:function(){return lo},__unstableSplitSelection:function(){return xn},clearSelectedBlock:function(){return dn},duplicateBlocks:function(){return Xn},enterFormattedText:function(){return Fn},exitFormattedText:function(){return Vn},flashBlock:function(){return no},hideInsertionPoint:function(){return wn},insertAfterBlock:function(){return eo},insertBeforeBlock:function(){return Jn},insertBlock:function(){return yn},insertBlocks:function(){return En},insertDefaultBlock:function(){return Gn},mergeBlocks:function(){return Nn},moveBlockToPosition:function(){return kn},moveBlocksDown:function(){return vn},moveBlocksToPosition:function(){return _n},moveBlocksUp:function(){return bn},multiSelect:function(){return un},receiveBlocks:function(){return tn},removeBlock:function(){return Mn},removeBlocks:function(){return Pn},replaceBlock:function(){return gn},replaceBlocks:function(){return fn},replaceInnerBlocks:function(){return Ln},resetBlocks:function(){return Xt},resetSelection:function(){return en},selectBlock:function(){return rn},selectNextBlock:function(){return an},selectPreviousBlock:function(){return ln},selectionChange:function(){return Hn},setBlockMovingClientId:function(){return Qn},setBlockVisibility:function(){return ro},setHasControlledInnerBlocks:function(){return oo},setNavigationMode:function(){return Yn},setTemplateValidity:function(){return Sn},showInsertionPoint:function(){return Cn},startDraggingBlocks:function(){return On},startMultiSelect:function(){return sn},startTyping:function(){return An},stopDraggingBlocks:function(){return zn},stopMultiSelect:function(){return cn},stopTyping:function(){return Dn},synchronizeTemplate:function(){return Bn},toggleBlockHighlight:function(){return to},toggleBlockMode:function(){return Rn},toggleSelection:function(){return pn},updateBlock:function(){return on},updateBlockAttributes:function(){return nn},updateBlockListSettings:function(){return Un},updateSettings:function(){return Wn},validateBlocksToTemplate:function(){return Jt}});var r=window.wp.blocks,l=window.wp.hooks;function i(){return i=Object.assign?Object.assign.bind():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},i.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 a=window.wp.element,s=n(4403),c=n.n(s),u=window.lodash,d=window.wp.compose,p=window.wp.data,m=window.wp.components;var f={default:(0,m.createSlotFill)("BlockControls"),block:(0,m.createSlotFill)("BlockControlsBlock"),inline:(0,m.createSlotFill)("BlockFormatControls"),other:(0,m.createSlotFill)("BlockControlsOther"),parent:(0,m.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 _(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)}const k=e=>e;function y(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,y(r,o))})),n}function E(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return e.reduce(((e,n)=>Object.assign(e,{[n.clientId]:t},E(n.innerBlocks,n.clientId))),{})}function C(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:k;const n={},o=[...e];for(;o.length;){const{innerBlocks:e,...r}=o.shift();o.push(...e),n[r.clientId]=t(r)}return n}function w(e){return C(e,(e=>(0,u.omit)(e,"attributes")))}function S(e){return C(e,(e=>e.attributes))}function B(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)(Object.keys(e),Object.keys(t))}(e.attributes,t.attributes)}function I(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 x(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 T=(0,u.flow)(p.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=I(o,n.blocks);o.tree=x(o,{...o.tree,...e},n.rootClientId?[n.rootClientId]:[""],!0);break}case"UPDATE_BLOCK":o.tree=x(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=x(o,{...o.tree,...e},n.clientIds,!1);break}case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":{const e=I(o,n.blocks);o.tree=x(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=x(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=x(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):e.push(""),n.toRootClientId&&e.push(n.toRootClientId),o.tree=x(o,o.tree,e,!0);break}case"MOVE_BLOCKS_UP":case"MOVE_BLOCKS_DOWN":{const e=[n.rootClientId?n.rootClientId:""];o.tree=x(o,o.tree,e,!0);break}case"SAVE_REUSABLE_BLOCK_SUCCESS":{const e=Object.keys((0,u.omitBy)(o.attributes,((e,t)=>"core/block"!==o.byClientId[t].name||e.ref!==n.updatedId)));o.tree=x(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.tree={...l.tree,...(0,u.reduce)(o,((e,n,o)=>{const r=`controlled||${o}`;return t.tree[r]&&(e[r]=t.tree[r]),e}),{})}),l}),(e=>(t,n)=>{if("RESET_BLOCKS"===n.type){const e={...t,byClientId:w(n.blocks),attributes:S(n.blocks),order:y(n.blocks),parents:E(n.blocks),controlledInnerBlocks:{},visibility:{}},o=I(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 a;n="MARK_NEXT_CHANGE_AS_NOT_PERSISTENT"===r.type;const e=null===(a=null==o?void 0:o.isPersistentChange)||void 0===a||a;return o.isPersistentChange===e?o:{...l,isPersistentChange:e}}return l={...l,isPersistentChange:i?!n:!B(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,...w(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),...w(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=y(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=y(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]:_(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=n[0],l=e[o];if(!l.length||r===l[0])return e;const i=l.indexOf(r);return{...e,[o]:_(l,i,i-1,n.length)}}case"MOVE_BLOCKS_DOWN":{const{clientIds:n,rootClientId:o=""}=t,r=n[0],l=n[n.length-1],i=e[o];if(!i.length||l===i[i.length-1])return e;const a=i.indexOf(r);return{...e,[o]:_(i,a,a+1,n.length)}}case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":{const{clientIds:n}=t;if(!t.blocks)return e;const o=y(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,...E(t.blocks)};case"INSERT_BLOCKS":return{...e,...E(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),...E(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 N(){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 P=(0,p.combineReducers)({blocks:T,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:a}=l;return{selectionStart:i,selectionEnd:a};case"MULTI_SELECT":const{start:s,end:c}=l;return s===(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:s},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:N(r.selectionStart,l),selectionEnd:N(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;return"TOGGLE_SELECTION"===t.type?t.isSelectionEnabled: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;return"SET_TEMPLATE_VALIDITY"===t.type?{...e,isValid:t.isValid}:e},settings:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:v,t=arguments.length>1?arguments[1]:void 0;return"UPDATE_SETTINGS"===t.type?{...e,...t.settings}: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,p.select)(r.store).getActiveBlockVariation(l,o);let a=null!=i&&i.name?`${l}/${i.name}`:l;const s={name:a};return"core/block"===l&&(s.ref=o.ref,a+="/"+o.ref),{...e,insertUsage:{...e.insertUsage,[a]:{time:t.time,count:e.insertUsage[a]?e.insertUsage[a].count+1:1,insert:s}}}}),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},editorMode:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"edit",t=arguments.length>1?arguments[1]:void 0;return"INSERT_BLOCKS"===t.type&&"navigation"===e?"edit":"SET_EDITOR_MODE"===t.type?t.mode: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_EDITOR_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":case"UPDATE_BLOCK_LIST_SETTINGS":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":if(!n.blocks.length)return t;return{clientId:n.blocks[0].clientId,source:null===(e=n.meta)||void 0===e?void 0:e.source};case"RESET_BLOCKS":return{}}return t},temporarilyEditingAsBlocks:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0;return"SET_TEMPORARILY_EDITING_AS_BLOCKS"===t.type?t.temporarilyEditingAsBlocks:e}}),M={};function L(e){return[e]}function R(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 A(e,t){var n,o=t||L;function r(e){var t,o,r,l,i,a=n,s=!0;for(t=0;t<e.length;t++){if(o=e[t],!(i=o)||"object"!=typeof i){s=!1;break}a.has(o)?a=a.get(o):(r=new WeakMap,a.set(o,r),a=r)}return a.has(M)||((l=function(){var e={clear:function(){e.head=null}};return e}()).isUniqueByDependants=s,a.set(M,l)),a.get(M)}function l(){n=new WeakMap}function i(){var t,n,l,i,a,s=arguments.length;for(i=new Array(s),l=0;l<s;l++)i[l]=arguments[l];for((t=r(a=o.apply(null,i))).isUniqueByDependants||(t.lastDependants&&!R(a,t.lastDependants,0)&&t.clear(),t.lastDependants=a),n=t.head;n;){if(R(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 D=window.wp.primitives;var O=(0,a.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(D.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,F=window.wp.deprecated,V=n.n(F);function H(e){const{multiline:t,__unstableMultilineWrapperTags:n,__unstablePreserveWhiteSpace:o}=e;return{multilineTag:t,multilineWrapperTags:n,preserveWhiteSpace:o}}const G=[];function U(e,t){const n=e.blocks.byClientId[t],o="core/social-link";if("web"!==a.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 W(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 $(e,t){return e.blocks.byClientId[t]?e.blocks.tree[t]:null}const K=A(((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 q(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)||G}const Y=A(((e,t)=>({clientId:t,innerBlocks:Z(e,t)})),(e=>[e.blocks.order])),Z=A((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return(0,u.map)(Ae(e,t),(t=>Y(e,t)))}),(e=>[e.blocks.order])),Q=A(((e,t)=>{const n=[];for(const o of t)for(const t of Ae(e,o))n.push(t,...Q(e,[t]));return n}),(e=>[e.blocks.order])),X=A((e=>{const t=[];for(const n of Ae(e))t.push(n,...Q(e,[n]));return t}),(e=>[e.blocks.order])),J=A(((e,t)=>{const n=X(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])),ee=A(((e,t)=>{if(!t)return G;const n=X(e).filter((n=>e.blocks.byClientId[n].name===t));return n.length>0?n:G}),(e=>[e.blocks.order,e.blocks.byClientId])),te=A(((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 ne(e,t){return Ae(e,t).length}function oe(e){return e.selection.selectionStart}function re(e){return e.selection.selectionEnd}function le(e){return e.selection.selectionStart.clientId}function ie(e){return e.selection.selectionEnd.clientId}function ae(e){const t=ye(e).length;return t||(e.selection.selectionStart.clientId?1:0)}function se(e){const{selectionStart:t,selectionEnd:n}=e.selection;return!!t.clientId&&t.clientId===n.clientId}function ce(e){const{selectionStart:t,selectionEnd:n}=e.selection,{clientId:o}=t;return o&&o===n.clientId?o:null}function ue(e){const t=ce(e);return t?$(e,t):null}function de(e,t){return void 0!==e.blocks.parents[t]?e.blocks.parents[t]:null}const pe=A((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])),me=A((function(e,t,n){let o=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const r=pe(e,t,o);return(0,u.map)((0,u.filter)((0,u.map)(r,(t=>({id:t,name:U(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 fe(e,t){let n,o=t;do{n=o,o=e.blocks.parents[o]}while(o);return n}function ge(e,t){const n=ce(e),o=[...pe(e,t),t],r=[...pe(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 he(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;if(void 0===t&&(t=ce(e)),void 0===t&&(t=n<0?Ce(e):we(e)),!t)return null;const o=de(e,t);if(null===o)return null;const{order:r}=e.blocks,l=r[o],i=l.indexOf(t),a=i+1*n;return a<0||a===l.length?null:l[a]}function ve(e,t){return he(e,t,-1)}function be(e,t){return he(e,t,1)}function _e(e){return e.initialPosition}const ke=A((e=>{const{selectionStart:t,selectionEnd:n}=e.selection;if(void 0===t.clientId||void 0===n.clientId)return G;if(t.clientId===n.clientId)return[t.clientId];const o=de(e,t.clientId);if(null===o)return G;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 ye(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId===n.clientId?G:ke(e)}const Ee=A((e=>{const t=ye(e);return t.length?t.map((t=>$(e,t))):G}),(e=>[...ke.getDependants(e),e.blocks.byClientId,e.blocks.order,e.blocks.attributes]));function Ce(e){return ye(e)[0]||null}function we(e){const t=ye(e);return t[t.length-1]||null}function Se(e,t){return Ce(e)===t}function Be(e,t){return-1!==ye(e).indexOf(t)}const Ie=A(((e,t)=>{let n=t,o=!1;for(;n&&!o;)n=de(e,n),o=Be(e,n);return o}),(e=>[e.blocks.order,e.selection.selectionStart.clientId,e.selection.selectionEnd.clientId]));function xe(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId===n.clientId?null:t.clientId||null}function Te(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId===n.clientId?null:n.clientId||null}function Ne(e){const t=oe(e),n=re(e);return!t.attributeKey&&!n.attributeKey&&void 0===t.offset&&void 0===n.offset}function Pe(e){const t=oe(e),n=re(e);return!!t&&!!n&&t.clientId===n.clientId&&t.attributeKey===n.attributeKey&&t.offset===n.offset}function Me(e){return ke(e).some((t=>{const n=U(e,t);return!(0,r.getBlockType)(n).merge}))}function Le(e,t){const n=oe(e),o=re(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=de(e,n.clientId);if(l!==de(e,o.clientId))return!1;const i=Ae(e,l);let a,s;i.indexOf(n.clientId)>i.indexOf(o.clientId)?(a=o,s=n):(a=n,s=o);const c=t?s.clientId:a.clientId,u=t?a.clientId:s.clientId,d=U(e,c);if(!(0,r.getBlockType)(d).merge)return!1;const p=$(e,u);if(p.name===d)return!0;const m=(0,r.switchToBlockType)(p,d);return m&&m.length}const Re=e=>{const t=oe(e),n=re(e);if(t.clientId===n.clientId)return G;if(!t.attributeKey||!n.attributeKey||void 0===t.offset||void 0===n.offset)return G;const o=de(e,t.clientId);if(o!==de(e,n.clientId))return G;const l=Ae(e,o),i=l.indexOf(t.clientId),a=l.indexOf(n.clientId),[s,c]=i>a?[n,t]:[t,n],u=$(e,s.clientId),d=(0,r.getBlockType)(u.name),p=$(e,c.clientId),m=(0,r.getBlockType)(p.name),f=u.attributes[s.attributeKey],g=p.attributes[c.attributeKey],h=d.attributes[s.attributeKey],v=m.attributes[c.attributeKey];let b=(0,z.create)({html:f,...H(h)}),_=(0,z.create)({html:g,...H(v)});return b=(0,z.remove)(b,0,s.offset),_=(0,z.remove)(_,c.offset,_.text.length),[{...u,attributes:{...u.attributes,[s.attributeKey]:(0,z.toHTMLString)({value:b,...H(h)})}},{...p,attributes:{...p.attributes,[c.attributeKey]:(0,z.toHTMLString)({value:_,...H(v)})}}]};function Ae(e,t){return e.blocks.order[t||""]||G}function De(e,t){return Ae(e,de(e,t)).indexOf(t)}function Oe(e,t){const{selectionStart:n,selectionEnd:o}=e.selection;return n.clientId===o.clientId&&n.clientId===t}function ze(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return(0,u.some)(Ae(e,t),(t=>Oe(e,t)||Be(e,t)||n&&ze(e,t,n)))}function Fe(e,t){if(!t)return!1;const n=ye(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 je(e){return!!e.draggedBlocks.length}function $e(e){return e.draggedBlocks}function Ke(e,t){return e.draggedBlocks.includes(t)}function qe(e,t){if(!je(e))return!1;const n=pe(e,t);return(0,u.some)(n,(t=>Ke(e,t)))}function Ye(){return V()('wp.data.select( "core/block-editor" ).isCaretWithinFormattedText',{since:"6.1",version:"6.3"}),!1}function Ze(e){let t,n;const{insertionPoint:o,selection:{selectionEnd:r}}=e;if(null!==o)return o;const{clientId:l}=r;return l?(t=de(e,l)||void 0,n=De(e,r.clientId)+1):n=Ae(e).length,{rootClientId:t,index:n}}function Qe(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:void 0}const tt=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return"boolean"==typeof e?e:Array.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),a=tt(i,t,!0);if(!a)return!1;const s=!!et(e,o);if(s)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=U(e,o),g=tt(m,f);let h=!0;const v=n.ancestor;if(v){const t=[o,...pe(e,o)];h=(0,u.some)(t,(t=>tt(v,U(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:me.bind(null,e)}):b},ot=A(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,U(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 at(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 st(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return t.every((t=>at(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)(te(e,X(e)),{name:t.name}));const{time:i,count:a=0}=dt(e,o)||{},s={id:o,name:t.name,title:t.title,icon:t.icon,isDisabled:l,frecency:ft(i,a)};if("transform"===n)return s;const c=(0,r.getBlockVariations)(t.name,"inserter");return{...s,initialAttributes:{},description:t.description,category:t.category,keywords:t.keywords,variations:c,example:t.example,utility:1}}},ht=A((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=O;if("web"===a.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:s=0}=dt(e,l)||{},c=ft(i,s);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),s=nt(e,"core/block",t)?Lt(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,...s]}),((e,t)=>[e.blockListSettings[t],e.blocks.byClientId,e.blocks.order,e.preferences.insertUsage,e.settings.allowedBlockTypes,e.settings.templateLock,Lt(e),(0,r.getBlockTypes)()])),vt=A((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,a=gt(e,{buildScope:"transform"}),s=(0,r.getBlockTypes)().filter((t=>pt(e,t,o))).map(a),c=Object.fromEntries(Object.entries(s).map((e=>{let[,t]=e;return[t.name,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=A((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)&&Lt(e).length>0;return o}),((e,t)=>[e.blockListSettings[t],e.blocks.byClientId,e.settings.allowedBlockTypes,e.settings.templateLock,Lt(e),(0,r.getBlockTypes)()])),_t=A((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)()])),kt=A((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]])),yt=A(((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=A((e=>{const t=e.settings.__experimentalBlockPatterns,{allowedBlockTypes:n}=It(e),o=t.filter((e=>{let{inserter:t=!0}=e;return!!t})).map((t=>{let{name:n}=t;return yt(e,n)})),r=o.filter((e=>{let{blocks:t}=e;return((e,t)=>{if("boolean"==typeof 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)}));return r}),(e=>[e.settings.__experimentalBlockPatterns,e.settings.allowedBlockTypes])),Ct=A((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]])),wt=A((function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!t)return G;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)])),St=A((function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!t)return G;if(t.some((t=>{let{clientId:n,innerBlocks:o}=t;return o.length||Ft(e,n)})))return G;const o=Array.from(new Set(t.map((e=>{let{name:t}=e;return t}))));return wt(e,o,n)}),((e,t)=>[...wt.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=A((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=A(((e,t)=>{var n;const o=(0,u.find)(Lt(e),(e=>e.id===t));return o?null===(n=o.title)||void 0===n?void 0:n.raw:null}),(e=>[Lt(e)]));function Pt(e){return e.blocks.isIgnoredChange}function Mt(e){return e.lastBlockAttributesChange}function Lt(e){var t,n;return null!==(t=null==e||null===(n=e.settings)||void 0===n?void 0:n.__experimentalReusableBlocks)&&void 0!==t?t:G}function Rt(e){return"navigation"===e.editorMode}function At(e){return e.editorMode}function Dt(e){return e.hasBlockMovingClientId}function Ot(e){return!!e.automaticChangeStatus}function zt(e,t){return e.highlightedBlock===t}function Ft(e,t){return!!e.blocks.controlledInnerBlocks[t]}const Vt=A(((e,t)=>{if(!t.length)return null;const n=ce(e);if(t.includes(U(e,n)))return n;const o=ye(e),r=me(e,n||o[0],t);return r?r[r.length-1]:null}),((e,t)=>[e.selection.selectionStart.clientId,e.selection.selectionEnd.clientId,t]));function Ht(e,t,n){const{lastBlockInserted:o}=e;return o.clientId===t&&o.source===n}function Gt(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 Ut=A((e=>new Set(Object.keys(e.blocks.visibility).filter((t=>e.blocks.visibility[t])))),(e=>[e.blocks.visibility])),Wt=A(((e,t)=>{let n,o=t;for(;e.blocks.parents[o];)o=e.blocks.parents[o],"contentOnly"===et(e,o)&&(n=o);return n}),(e=>[e.blocks.parents,e.blockListSettings]));function jt(e){return e.temporarilyEditingAsBlocks}function $t(e,t){if(!ct(e,t))return!0;const n=At(e);if("zoom-out"===n&&!de(e,t))return!0;const o=(0,r.hasBlockSupport)(U(e,t),"__experimentalDisableBlockOverlay",!1);return("navigation"===n||!o&&Ft(e,t))&&!Oe(e,t)&&!ze(e,t,!0)}function Kt(e,t){let n=e.blocks.parents[t];for(;n;){if($t(e,n))return!0;n=e.blocks.parents[n]}return!1}var qt=window.wp.a11y;const Yt="†";function Zt(e){if(e)return Object.keys(e).find((t=>{const n=e[t];return"string"==typeof n&&-1!==n.indexOf(Yt)}))}const Qt=e=>Array.isArray(e)?e:[e],Xt=e=>t=>{let{dispatch:n}=t;n({type:"RESET_BLOCKS",blocks:e}),n(Jt(e))},Jt=e=>t=>{let{select:n,dispatch:o}=t;const l=n.getTemplate(),i=n.getTemplateLock(),a=!l||"all"!==i||(0,r.doBlocksMatchTemplate)(e,l);if(a!==n.isValidTemplate())return o.setTemplateValidity(a),a};function en(e,t,n){return{type:"RESET_SELECTION",selectionStart:e,selectionEnd:t,initialPosition:n}}function tn(e){return V()('wp.data.dispatch( "core/block-editor" ).receiveBlocks',{since:"5.9",alternative:"resetBlocks or insertBlocks"}),{type:"RECEIVE_BLOCKS",blocks:e}}function nn(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return{type:"UPDATE_BLOCK_ATTRIBUTES",clientIds:Qt(e),attributes:t,uniqueByBlock:n}}function on(e,t){return{type:"UPDATE_BLOCK",clientId:e,updates:t}}function rn(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return{type:"SELECT_BLOCK",initialPosition:t,clientId:e}}const ln=e=>t=>{let{select:n,dispatch:o}=t;const r=n.getPreviousBlockClientId(e);r&&o.selectBlock(r,-1)},an=e=>t=>{let{select:n,dispatch:o}=t;const r=n.getNextBlockClientId(e);r&&o.selectBlock(r)};function sn(){return{type:"START_MULTI_SELECT"}}function cn(){return{type:"STOP_MULTI_SELECT"}}const un=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,qt.speak)((0,g.sprintf)((0,g._n)("%s block selected.","%s blocks selected.",i),i),"assertive")}};function dn(){return{type:"CLEAR_SELECTED_BLOCK"}}function pn(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return{type:"TOGGLE_SELECTION",isSelectionEnabled:e}}function mn(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,a=l[n];return{...e,attributes:{...i,className:`${o||""} is-style-${a}`.trim()}}}))}const fn=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:a}=l;e=Qt(e),t=mn(Qt(t),i.getSettings());const s=i.getBlockRootClientId(e[0]);for(let e=0;e<t.length;e++){const n=t[e];if(!i.canInsertBlockType(n.name,s))return}a({type:"REPLACE_BLOCKS",clientIds:e,blocks:t,time:Date.now(),indexToSelect:n,initialPosition:o,meta:r}),a((e=>{let{select:t,dispatch:n}=e;if(t.getBlockCount()>0)return;const{__unstableHasCustomAppender:o}=t.getSettings();o||n.insertDefaultBlock()}))}};function gn(e,t){return fn(e,t)}const hn=e=>(t,n)=>o=>{let{select:r,dispatch:l}=o;r.canMoveBlocks(t,n)&&l({type:e,clientIds:Qt(t),rootClientId:n})},vn=hn("MOVE_BLOCKS_DOWN"),bn=hn("MOVE_BLOCKS_UP"),_n=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 kn(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 _n([e],t,n,o)}function yn(e,t,n,o,r){return En([e],t,n,o,0,r)}const En=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:a,dispatch:s}=i;null!==r&&"object"==typeof r&&(l=r,r=0,V()("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=mn(Qt(e),a.getSettings());const c=[];for(const t of e){a.canInsertBlockType(t.name,n)&&c.push(t)}c.length&&s({type:"INSERT_BLOCKS",blocks:c,index:t,rootClientId:n,time:Date.now(),updateSelection:o,initialPosition:o?r:null,meta:l})}};function Cn(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 wn(){return{type:"HIDE_INSERTION_POINT"}}function Sn(e){return{type:"SET_TEMPLATE_VALIDITY",isValid:e}}const Bn=()=>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)},In=e=>t=>{let{registry:n,select:o,dispatch:l}=t;const i=o.getSelectionStart(),a=o.getSelectionEnd();if(i.clientId===a.clientId)return;if(!i.attributeKey||!a.attributeKey||void 0===i.offset||void 0===a.offset)return!1;const s=o.getBlockRootClientId(i.clientId);if(s!==o.getBlockRootClientId(a.clientId))return;const c=o.getBlockOrder(s);let u,d;c.indexOf(i.clientId)>c.indexOf(a.clientId)?(u=a,d=i):(u=i,d=a);const p=e?d:u,m=o.getBlock(p.clientId),f=(0,r.getBlockType)(m.name);if(!f.merge)return;const g=u,h=d,v=o.getBlock(g.clientId),b=(0,r.getBlockType)(v.name),_=o.getBlock(h.clientId),k=(0,r.getBlockType)(_.name),y=v.attributes[g.attributeKey],E=_.attributes[h.attributeKey],C=b.attributes[g.attributeKey],w=k.attributes[h.attributeKey];let S=(0,z.create)({html:y,...H(C)}),B=(0,z.create)({html:E,...H(w)});S=(0,z.remove)(S,g.offset,S.text.length),B=(0,z.insert)(B,Yt,0,h.offset);const I=(0,r.cloneBlock)(v,{[g.attributeKey]:(0,z.toHTMLString)({value:S,...H(C)})}),x=(0,r.cloneBlock)(_,{[h.attributeKey]:(0,z.toHTMLString)({value:B,...H(w)})}),T=e?I:x,N=v.name===_.name?[T]:(0,r.switchToBlockType)(T,f.name);if(!N||!N.length)return;let P;if(e){const e=N.pop();P=f.merge(e.attributes,x.attributes)}else{const e=N.shift();P=f.merge(I.attributes,e.attributes)}const M=Zt(P),L=P[M],R=(0,z.create)({html:L,...H(f.attributes[M])}),A=R.text.indexOf(Yt),D=(0,z.remove)(R,A,A+1),O=(0,z.toHTMLString)({value:D,...H(f.attributes[M])});P[M]=O;const F=o.getSelectedBlockClientIds(),V=[...e?N:[],{...m,attributes:{...m.attributes,...P}},...e?[]:N];n.batch((()=>{l.selectionChange(m.clientId,M,A,A),l.replaceBlocks(F,V,0,o.getSelectedBlocksInitialCaretPosition())}))},xn=()=>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 a=t.getBlockOrder(i);let s,c;a.indexOf(o.clientId)>a.indexOf(l.clientId)?(s=l,c=o):(s=o,c=l);const u=s,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],_=g.attributes[d.attributeKey];let k=(0,z.create)({html:h,...H(b)}),y=(0,z.create)({html:v,...H(_)});k=(0,z.remove)(k,u.offset,k.text.length),y=(0,z.remove)(y,0,d.offset),n.replaceBlocks(t.getSelectedBlockClientIds(),[{...p,attributes:{...p.attributes,[u.attributeKey]:(0,z.toHTMLString)({value:k,...H(b)})}},(0,r.createBlock)((0,r.getDefaultBlockName)()),{...f,attributes:{...f.attributes,[d.attributeKey]:(0,z.toHTMLString)({value:y,...H(_)})}}],1,t.getSelectedBlocksInitialCaretPosition())},Tn=()=>e=>{let{select:t,dispatch:n}=e;const o=t.getSelectionStart(),r=t.getSelectionEnd();n.selectionChange({start:{clientId:o.clientId},end:{clientId:r.clientId}})},Nn=(e,t)=>n=>{let{registry:o,select:l,dispatch:i}=n;const a=[e,t];i({type:"MERGE_BLOCKS",blocks:a});const[s,c]=a,u=l.getBlock(s),d=(0,r.getBlockType)(u.name);if(!d)return;const p=l.getBlock(c);if(d&&!d.merge){const e=(0,r.switchToBlockType)(p,d.name);if(1!==(null==e?void 0:e.length))return void i.selectBlock(u.clientId);const[t]=e;return t.innerBlocks.length<1?void i.selectBlock(u.clientId):void o.batch((()=>{i.insertBlocks(t.innerBlocks,void 0,s),i.removeBlock(c),i.selectBlock(t.innerBlocks[0].clientId)}))}const m=(0,r.getBlockType)(p.name),{clientId:f,attributeKey:g,offset:h}=l.getSelectionStart(),v=(f===s?d:m).attributes[g],b=(f===s||f===c)&&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 _=(0,r.cloneBlock)(u),k=(0,r.cloneBlock)(p);if(b){const e=f===s?_:k,t=e.attributes[g],n=(0,z.insert)((0,z.create)({html:t,...H(v)}),Yt,h,h);e.attributes[g]=(0,z.toHTMLString)({value:n,...H(v)})}const y=u.name===p.name?[k]:(0,r.switchToBlockType)(k,u.name);if(!y||!y.length)return;const E=d.merge(_.attributes,y[0].attributes);if(b){const e=Zt(E),t=E[e],n=(0,z.create)({html:t,...H(d.attributes[e])}),o=n.text.indexOf(Yt),r=(0,z.remove)(n,o,o+1),l=(0,z.toHTMLString)({value:r,...H(d.attributes[e])});E[e]=l,i.selectionChange(u.clientId,e,o,o)}i.replaceBlocks([u.clientId,p.clientId],[{...u,attributes:{...u.attributes,...E}},...y.slice(1)],0)},Pn=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=Qt(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 Mn(e,t){return Pn([e],t)}function Ln(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 Rn(e){return{type:"TOGGLE_BLOCK_MODE",clientId:e}}function An(){return{type:"START_TYPING"}}function Dn(){return{type:"STOP_TYPING"}}function On(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return{type:"START_DRAGGING_BLOCKS",clientIds:e}}function zn(){return{type:"STOP_DRAGGING_BLOCKS"}}function Fn(){return V()('wp.data.dispatch( "core/block-editor" ).enterFormattedText',{since:"6.1",version:"6.3"}),{type:"DO_NOTHING"}}function Vn(){return V()('wp.data.dispatch( "core/block-editor" ).exitFormattedText',{since:"6.1",version:"6.3"}),{type:"DO_NOTHING"}}function Hn(e,t,n,o){return"string"==typeof e?{type:"SELECTION_CHANGE",clientId:e,attributeKey:t,startOffset:n,endOffset:o}:{type:"SELECTION_CHANGE",...e}}const Gn=(e,t,n)=>o=>{let{dispatch:l}=o;const i=(0,r.getDefaultBlockName)();if(!i)return;const a=(0,r.createBlock)(i,e);return l.insertBlock(a,n,t)};function Un(e,t){return{type:"UPDATE_BLOCK_LIST_SETTINGS",clientId:e,settings:t}}function Wn(e){return{type:"UPDATE_SETTINGS",settings:e}}function jn(e,t){return{type:"SAVE_REUSABLE_BLOCK_SUCCESS",id:e,updatedId:t}}function $n(){return{type:"MARK_LAST_CHANGE_AS_PERSISTENT"}}function Kn(){return{type:"MARK_NEXT_CHANGE_AS_NOT_PERSISTENT"}}const qn=()=>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"})}))},Yn=function(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return t=>{let{dispatch:n}=t;n.__unstableSetEditorMode(e?"navigation":"edit")}},Zn=e=>t=>{let{dispatch:n,select:o}=t;if("zoom-out"===e){const e=o.getBlockSelectionStart();e&&n.selectBlock(o.getBlockHierarchyRootClientId(e))}n({type:"SET_EDITOR_MODE",mode:e}),"navigation"===e?(0,qt.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.")):"edit"===e?(0,qt.speak)((0,g.__)("You are currently in edit mode. To return to the navigation mode, press Escape.")):"zoom-out"===e&&(0,qt.speak)((0,g.__)("You are currently in zoom-out mode."))},Qn=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,qt.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."))}},Xn=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(i.some((e=>!e)))return;const a=i.map((e=>e.name));if(a.some((e=>!(0,r.hasBlockSupport)(e,"multiple",!0))))return;const s=o.getBlockRootClientId(e[0]),c=Qt(e),u=o.getBlockIndex(c[c.length-1]),d=i.map((e=>(0,r.__experimentalCloneSanitizedBlock)(e)));return l.insertBlocks(d,u+1,s,t),d.length>1&&t&&l.multiSelect(d[0].clientId,d[d.length-1].clientId),d.map((e=>e.clientId))}},Jn=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)},eo=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 to(e,t){return{type:"TOGGLE_BLOCK_HIGHLIGHT",clientId:e,isHighlighted:t}}const no=e=>async t=>{let{dispatch:n}=t;n(to(e,!0)),await new Promise((e=>setTimeout(e,150))),n(to(e,!1))};function oo(e,t){return{type:"SET_HAS_CONTROLLED_INNER_BLOCKS",hasControlledInnerBlocks:t,clientId:e}}function ro(e){return{type:"SET_BLOCK_VISIBILITY",updates:e}}function lo(e){return{type:"SET_TEMPORARILY_EDITING_AS_BLOCKS",temporarilyEditingAsBlocks:e}}const io="core/block-editor",ao={reducer:P,selectors:e,actions:t},so=(0,p.createReduxStore)(io,{...ao,persist:["preferences"]});(0,p.registerStore)(io,{...ao,persist:["preferences"]});const co={name:"",isSelected:!1},uo=(0,a.createContext)(co),{Provider:po}=uo;function mo(){return(0,a.useContext)(uo)}function fo(){const{isSelected:e,clientId:t,name:n}=mo();return(0,p.useSelect)((o=>{if(e)return!0;const{getBlockName:r,isFirstMultiSelectedBlock:l,getMultiSelectedBlockClientIds:i}=o(so);return!!l(t)&&i().every((e=>r(e)===n))}),[t,e,n])}function go(e){let{group:t="default",controls:n,children:o,__experimentalShareWithChildBlocks:l=!1}=e;const i=function(e,t){const n=fo(),{clientId:o}=mo(),l=(0,p.useSelect)((e=>{const{getBlockName:n,hasSelectedInnerBlock:l}=e(so),{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,a.createElement)(m.__experimentalStyleProvider,{document:document},(0,a.createElement)(i,null,(e=>{const r=(0,u.isEmpty)(e)?null:e;return(0,a.createElement)(m.__experimentalToolbarContext.Provider,{value:r},"default"===t&&(0,a.createElement)(m.ToolbarGroup,{controls:n}),o)}))):null}function ho(e){let{group:t="default",...n}=e;const o=(0,a.useContext)(m.__experimentalToolbarContext),r=f[t].Slot,l=(0,m.__experimentalUseSlot)(r.__unstableName);return Boolean(l.fills&&l.fills.length)?"default"===t?(0,a.createElement)(r,i({},n,{bubblesVirtually:!0,fillProps:o})):(0,a.createElement)(m.ToolbarGroup,null,(0,a.createElement)(r,i({},n,{bubblesVirtually:!0,fillProps:o}))):null}const vo=go;vo.Slot=ho;const bo=e=>(0,a.createElement)(go,i({group:"inline"},e));bo.Slot=e=>(0,a.createElement)(ho,i({group:"inline"},e));var _o=vo;var ko=(0,a.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(D.Path,{d:"M9 9v6h11V9H9zM4 20h1.5V4H4v16z"}));var yo=(0,a.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(D.Path,{d:"M20 9h-7.2V4h-1.6v5H4v6h7.2v5h1.6v-5H20z"}));var Eo=(0,a.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(D.Path,{d:"M4 15h11V9H4v6zM18.5 4v16H20V4h-1.5z"}));var Co=(0,a.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(D.Path,{d:"M9 15h6V9H9v6zm-5 5h1.5V4H4v16zM18.5 4v16H20V4h-1.5z"}));var wo=(0,a.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(D.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"}));var So=(0,a.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(D.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 Bo(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return e.split(",").map((e=>`.editor-styles-wrapper ${e}${t?` ${t}`:""}`)).join(",")}function Io(e,t,n,o){var r,l;let i="";return null!=t&&null!==(r=t[n])&&void 0!==r&&null!==(l=r.spacingStyles)&&void 0!==l&&l.length&&o&&t[n].spacingStyles.forEach((t=>{i+=`${Bo(e,t.selector.trim())} { `,i+=Object.entries(t.rules).map((e=>{let[t,n]=e;return`${t}: ${n||o}`})).join("; "),i+="; }"})),i}function xo(e){const{contentSize:t,wideSize:n}=e,o={},r=/^(?!0)\d+(px|em|rem|vw|vh|%)?$/i;return r.test(t)&&(o.none=(0,g.sprintf)((0,g.__)("Max %s wide"),t)),r.test(n)&&(o.wide=(0,g.sprintf)((0,g.__)("Max %s wide"),n)),o}const To=(0,a.createContext)({refs:new Map,callbacks:new Map});function No(e){let{children:t}=e;const n=(0,a.useMemo)((()=>({refs:new Map,callbacks:new Map})),[]);return(0,a.createElement)(To.Provider,{value:n},t)}function Po(e){const{refs:t,callbacks:n}=(0,a.useContext)(To),o=(0,a.useRef)();return(0,a.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 Mo(e){const{refs:t}=(0,a.useContext)(To),n=(0,a.useRef)();return n.current=e,(0,a.useMemo)((()=>({get current(){let e=null;for(const[o,r]of t.entries())r===n.current&&o.current&&(e=o.current);return e}})),[])}function Lo(e){const{callbacks:t}=(0,a.useContext)(To),n=Mo(e),[o,r]=(0,a.useState)(null);return(0,a.useLayoutEffect)((()=>{if(e)return t.set(r,e),()=>{t.delete(r)}}),[e]),n.current||o}function Ro(e){return!(null==e||!e.includes)&&("0"===e||e.includes("var:preset|spacing|"))}function Ao(e,t){if(!Ro(e))return e;const n=Oo(e),o=t.find((e=>String(e.slug)===n));return null==o?void 0:o.size}function Do(e){if(!e)return;const t=e.match(/var:preset\|spacing\|(.+)/);return t?`var(--wp--preset--spacing--${t[1]})`:e}function Oo(e){if(!e)return;if("0"===e||"default"===e)return e;const t=e.match(/var:preset\|spacing\|(.+)/);return t?t[1]:void 0}const zo={all:(0,g.__)("All sides"),top:(0,g.__)("Top"),bottom:(0,g.__)("Bottom"),left:(0,g.__)("Left"),right:(0,g.__)("Right"),mixed:(0,g.__)("Mixed"),vertical:(0,g.__)("Vertical"),horizontal:(0,g.__)("Horizontal")},Fo={top:void 0,right:void 0,bottom:void 0,left:void 0},Vo=["top","right","bottom","left"];function Ho(e){return e.sort(((t,n)=>e.filter((e=>e===t)).length-e.filter((e=>e===n)).length)).pop()}function Go(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Vo;return Object.values(e).length>=1&&Object.values(e).length<t.length||new Set(Object.values(e)).size>1}function Uo(e){return null!=e&&!(0,u.isEmpty)(Object.values(e).filter((e=>!!e)))}var Wo=(0,a.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(D.Path,{d:"M14.5 13.8c-1.1 0-2.1.7-2.4 1.8H4V17h8.1c.3 1 1.3 1.8 2.4 1.8s2.1-.7 2.4-1.8H20v-1.5h-3.1c-.3-1-1.3-1.7-2.4-1.7zM11.9 7c-.3-1-1.3-1.8-2.4-1.8S7.4 6 7.1 7H4v1.5h3.1c.3 1 1.3 1.8 2.4 1.8s2.1-.7 2.4-1.8H20V7h-8.1z"}));const jo=["color","border","typography","spacing"],$o={"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},Ko={"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 qo(e){const{name:t,clientId:n}=mo(),o=(0,p.useSelect)((o=>{if(jo.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=>Ko[e]||e)(e);[...o(so).getBlockParents(n),n].forEach((e=>{const n=o(so).getBlockName(e);if((0,r.hasBlockSupport)(n,"__experimentalSettings",!1)){var a;const n=o(so).getBlockAttributes(e),r=null!==(a=(0,u.get)(n,`settings.blocks.${t}.${i}`))&&void 0!==a?a:(0,u.get)(n,`settings.${i}`);void 0!==r&&(l=r)}}));const a=o(so).getSettings();if(void 0===l){var s;const e=`__experimentalFeatures.${i}`,n=`__experimentalFeatures.blocks.${t}.${i}`;l=null!==(s=(0,u.get)(a,n))&&void 0!==s?s:(0,u.get)(a,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=$o[i]?$o[i](a):void 0;return void 0!==p?p:"typography.dropCap"===i||void 0}),[t,n,e]);return o}function Yo(e){var t;let{spacingSizes:n,value:o,side:r,onChange:l,isMixed:i=!1,type:s,minimumCustomValue:u}=e;o=function(e,t){if(Ro(e))return e;const n=t.find((t=>String(t.size)===String(e)));return null!=n&&n.slug?`var:preset|spacing|${n.slug}`:e}(o,n);let d=n;const f=n.length<=8,h=(0,p.useSelect)((e=>{const t=e(so).getSettings();return null==t?void 0:t.disableCustomSpacingSizes})),[v,b]=(0,a.useState)(!h&&void 0!==o&&!Ro(o)),_=(0,m.__experimentalUseCustomUnits)({availableUnits:qo("spacing.units")||["px","em","rem"]});let k=null;!f&&!v&&void 0!==o&&(!Ro(o)||Ro(o)&&i)?(d=[...n,{name:i?(0,g.__)("Mixed"):(0,g.sprintf)((0,g.__)("Custom (%s)"),o),slug:"custom",size:o}],k=d.length-1):i||(k=v?Ao(o,n):function(e,t){if(void 0===e)return 0;const n=0===parseFloat(e,10)?"0":Oo(e),o=t.findIndex((e=>String(e.slug)===n));return-1!==o?o:NaN}(o,n));const y=(0,a.useMemo)((()=>(0,m.__experimentalParseQuantityAndUnitFromRawValue)(k)),[k])[1]||_[0].value,E=e=>{var t;return void 0===o||null===(t=n[e])||void 0===t?void 0:t.name},C=parseInt(k,10),w=(e,t)=>{var o;const r=parseInt(e,10);if("selectList"===t){if(0===r)return;if(1===r)return"0"}else if(0===r)return"0";return`var:preset|spacing|${null===(o=n[e])||void 0===o?void 0:o.slug}`},S=i?(0,g.__)("Mixed"):null,B=i?(0,g.__)("Mixed"):E(k),I=d.map(((e,t)=>({key:t,name:e.name}))),x=n.map(((e,t)=>({value:t,label:void 0}))),T=(0,g.sprintf)((0,g.__)("%1$s %2$s"),zo[r],null==s?void 0:s.toLowerCase()),N=f&&!v&&void 0!==B;return(0,a.createElement)(a.Fragment,null,"all"!==r&&(0,a.createElement)(m.__experimentalHStack,{className:"components-spacing-sizes-control__side-labels"},(0,a.createElement)(m.__experimentalText,{className:"components-spacing-sizes-control__side-label"},zo[r]),N&&(0,a.createElement)(m.__experimentalText,{className:"components-spacing-sizes-control__hint-single"},B)),"all"===r&&N&&(0,a.createElement)(m.__experimentalText,{className:"components-spacing-sizes-control__hint-all"},B),!h&&(0,a.createElement)(m.Button,{label:v?(0,g.__)("Use size preset"):(0,g.__)("Set custom size"),icon:Wo,onClick:()=>{b(!v)},isPressed:v,isSmall:!0,className:c()({"components-spacing-sizes-control__custom-toggle-all":"all"===r,"components-spacing-sizes-control__custom-toggle-single":"all"!==r}),iconSize:24}),v&&(0,a.createElement)(a.Fragment,null,(0,a.createElement)(m.__experimentalUnitControl,{onChange:e=>l((e=>isNaN(parseFloat(e))?void 0:e)(e)),value:k,units:_,min:u,placeholder:S,disableUnits:i,label:T,hideLabelFromVision:!0,className:"components-spacing-sizes-control__custom-value-input",style:{gridColumn:"1"}}),(0,a.createElement)(m.RangeControl,{value:C,min:0,max:100,withInputField:!1,onChange:e=>{l([e,y].join(""))},className:"components-spacing-sizes-control__custom-value-range"})),f&&!v&&(0,a.createElement)(m.RangeControl,{className:"components-spacing-sizes-control__range-control",value:k,onChange:e=>l(w(e)),onMouseDown:e=>{var t;(null==e||null===(t=e.nativeEvent)||void 0===t?void 0:t.offsetX)<35&&void 0===o&&l("0")},withInputField:!1,"aria-valuenow":k,"aria-valuetext":null===(t=n[k])||void 0===t?void 0:t.name,renderTooltipContent:E,min:0,max:n.length-1,marks:x,label:T,hideLabelFromVision:!0}),!f&&!v&&(0,a.createElement)(m.CustomSelectControl,{className:"components-spacing-sizes-control__custom-select-control",value:I.find((e=>e.key===k))||"",onChange:e=>{l(w(e.selectedItem.key,"selectList"))},options:I,label:T,hideLabelFromVision:!0,__nextUnconstrainedWidth:!0}))}function Zo(e){let{onChange:t,values:n,sides:o,spacingSizes:r,type:l,minimumCustomValue:i}=e;const s=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Ho(Object.values(e))}(n),c=Uo(n)&&Go(n,o);return(0,a.createElement)(Yo,{value:s,onChange:e=>{const r=(0,m.__experimentalApplyValueToSides)(n,e,o);t(r)},side:"all",spacingSizes:r,isMixed:c,type:l,minimumCustomValue:i})}function Qo(e){let{values:t,sides:n,onChange:o,spacingSizes:r,type:l,minimumCustomValue:i}=e;const s=null!=n&&n.length?Vo.filter((e=>n.includes(e))):Vo,c=e=>n=>{const r={...t};r[e]=n,o(r)};return(0,a.createElement)(a.Fragment,null,s.map((e=>(0,a.createElement)(Yo,{value:t[e],label:zo[e],key:`spacing-sizes-control-${e}`,withInputField:!1,side:e,onChange:c(e),spacingSizes:r,type:l,minimumCustomValue:i}))))}const Xo=["vertical","horizontal"];function Jo(e){let{onChange:t,values:n,sides:o,spacingSizes:r,type:l,minimumCustomValue:i}=e;const s=e=>o=>{if(!t)return;const r={...n};"vertical"===e&&(r.top=o,r.bottom=o),"horizontal"===e&&(r.left=o,r.right=o),t(r)},c=null!=o&&o.length?Xo.filter((e=>o.includes(e))):Xo;return(0,a.createElement)(a.Fragment,null,c.map((e=>{const t="vertical"===e?n.top:n.left;return(0,a.createElement)(Yo,{value:t,onChange:s(e),label:zo[e],key:`spacing-sizes-control-${e}`,withInputField:!1,side:e,spacingSizes:r,type:l,minimumCustomValue:i})})))}var er=(0,a.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(D.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"}));var tr=(0,a.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(D.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 nr(e){let{isLinked:t,onClick:n}=e;const o=t?(0,g.__)("Unlink sides"):(0,g.__)("Link sides");return(0,a.createElement)(m.Tooltip,{text:o},(0,a.createElement)("span",{className:"component-spacing-sizes-control__linked-button"},(0,a.createElement)(m.Button,{isSmall:!0,icon:t?er:tr,iconSize:24,"aria-label":o,onClick:n})))}function or(e){let{inputProps:t,onChange:n,label:o=(0,g.__)("Spacing Control"),values:r,sides:l,splitOnAxis:s=!1,useSelect:c,minimumCustomValue:u=0}=e;const d=[{name:0,slug:"0",size:0},...qo("spacing.spacingSizes")||[]];d.length>8&&d.unshift({name:(0,g.__)("Default"),slug:"default",size:void 0});const p=r||Fo,f=Uo(r),h=1===(null==l?void 0:l.length),[v,b]=(0,a.useState)(!f||!Go(p,l)||h),_={...t,onChange:e=>{const t={...r,...e};n(t)},isLinked:v,sides:l,values:p,spacingSizes:d,useSelect:c,type:o,minimumCustomValue:u};return(0,a.createElement)("fieldset",{role:"region",className:"component-spacing-sizes-control"},(0,a.createElement)(m.__experimentalText,{as:"legend"},o),!h&&(0,a.createElement)(nr,{onClick:()=>{b(!v)},isLinked:v}),v&&(0,a.createElement)(Zo,i({"aria-label":o},_)),!v&&s&&(0,a.createElement)(Jo,_),!v&&!s&&(0,a.createElement)(Qo,_))}window.wp.warning;var rr={default:(0,m.createSlotFill)("InspectorControls"),advanced:(0,m.createSlotFill)("InspectorAdvancedControls"),border:(0,m.createSlotFill)("InspectorControlsBorder"),color:(0,m.createSlotFill)("InspectorControlsColor"),dimensions:(0,m.createSlotFill)("InspectorControlsDimensions"),typography:(0,m.createSlotFill)("InspectorControlsTypography")};function lr(e){var t;let{__experimentalGroup:n="default",children:o}=e;const r=fo(),l=null===(t=rr[n])||void 0===t?void 0:t.Fill;return l?r?(0,a.createElement)(m.__experimentalStyleProvider,{document:document},(0,a.createElement)(l,null,(e=>{const t=(0,u.isEmpty)(e)?null:e;return(0,a.createElement)(m.__experimentalToolsPanelContext.Provider,{value:t},o)}))):null:("undefined"!=typeof process&&process.env,null)}const ir=e=>e,ar=e=>{if(null===e||"object"!=typeof e||Array.isArray(e))return e;const t=(0,u.pickBy)((0,u.mapValues)(e,ar),ir);return(0,u.isEmpty)(t)?void 0:t};function sr(e,t,n){return(0,u.setWith)(e?(0,u.clone)(e):{},t,n,u.clone)}function cr(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 a=null===(i=o[0])||void 0===i?void 0:i.attributes;if(l.length>1&&o.length>1){if(!o[r])return n;var s;a=null===(s=o[r])||void 0===s?void 0:s.attributes}let c=n;return Object.entries(e).forEach((e=>{let[n,o]=e;o&&t[n].forEach((e=>{const t=(0,u.get)(a,e);t&&(c={...c,attributes:sr(c.attributes,e,t)})}))})),c}function ur(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 dr(e){let{children:t,group:n,label:o}=e;const{updateBlockAttributes:r}=(0,p.useDispatch)(so),{getBlockAttributes:l,getMultiSelectedBlockClientIds:i,getSelectedBlockClientId:s,hasMultiSelection:c}=(0,p.useSelect)(so),u=s(),d=(0,a.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:ar(r.style)},t[n]=r})),r(n,t,!0)}),[ar,l,i,c,u,r]);return(0,a.createElement)(m.__experimentalToolsPanel,{className:`${n}-block-support-panel`,label:o,resetAll:d,key:u,panelId:u,hasInnerWrapper:!0,shouldRenderPlaceholderItems:!0,__experimentalFirstVisibleItemClass:"first",__experimentalLastVisibleItemClass:"last"},t)}function pr(e){let{Slot:t,...n}=e;const o=(0,a.useContext)(m.__experimentalToolsPanelContext);return(0,a.createElement)(t,i({},n,{fillProps:o,bubblesVirtually:!0}))}function mr(e){var t;let{__experimentalGroup:n="default",label:o,...r}=e;const l=null===(t=rr[n])||void 0===t?void 0:t.Slot,s=(0,m.__experimentalUseSlot)(null==l?void 0:l.__unstableName);if(!l||!s)return"undefined"!=typeof process&&process.env,null;return Boolean(s.fills&&s.fills.length)?o?(0,a.createElement)(dr,{group:n,label:o},(0,a.createElement)(pr,i({},r,{Slot:l}))):(0,a.createElement)(l,i({},r,{bubblesVirtually:!0})):null}const fr=lr;fr.Slot=mr;const gr=e=>(0,a.createElement)(lr,i({},e,{__experimentalGroup:"advanced"}));gr.Slot=e=>(0,a.createElement)(mr,i({},e,{__experimentalGroup:"advanced"})),gr.slotName="InspectorAdvancedControls";var hr=fr,vr=window.wp.isShallowEqual,br=n.n(vr);var _r=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])};const kr=Number.MAX_SAFE_INTEGER;var yr=(0,a.forwardRef)((function(e,t){let{clientId:n,bottomClientId:o,children:r,__unstableRefreshSize:l,__unstableCoverTarget:s=!1,__unstablePopoverSlot:u,__unstableContentRef:p,...f}=e;const g=Lo(n),h=Lo(null!=o?o:n),v=(0,d.useMergeRefs)([t,_r(p)]),b=(0,a.useMemo)((()=>g&&h===g?{position:"absolute",width:g.offsetWidth,height:g.offsetHeight}:{}),[g,h,l]),[_,k]=(0,a.useReducer)((e=>(e+1)%kr),0);(0,a.useLayoutEffect)((()=>{if(!g)return;const e=new window.MutationObserver(k);return e.observe(g,{attributes:!0}),()=>{e.disconnect()}}),[g]);const y=(0,a.useMemo)((()=>{if(!(_<0||!g||o&&!h))return{getBoundingClientRect(){var e,t,n,o;const r=g.getBoundingClientRect(),l=null==h?void 0:h.getBoundingClientRect(),i=Math.min(r.left,null!==(e=null==l?void 0:l.left)&&void 0!==e?e:1/0),a=Math.min(r.top,null!==(t=null==l?void 0:l.top)&&void 0!==t?t:1/0),s=Math.max(r.right,null!==(n=l.right)&&void 0!==n?n:-1/0)-i,c=Math.max(r.bottom,null!==(o=l.bottom)&&void 0!==o?o:-1/0)-a;return new window.DOMRect(i,a,s,c)},ownerDocument:g.ownerDocument}}),[o,h,g,_]);return!g||o&&!h?null:(0,a.createElement)(m.Popover,i({ref:v,animate:!1,position:"top right left",focusOnMount:!1,anchor:y,__unstableSlotName:u||null,resize:!1,flip:!1,shift:!0},f,{className:c()("block-editor-block-popover",f.className)}),s&&(0,a.createElement)("div",{style:b},r),!s&&r)}));function Er(e){const t=(0,r.getBlockSupport)(e,Nr);return!!(!0===t||null!=t&&t.margin)}function Cr(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!qo("spacing.margin"),n=!Dr(e,"margin");return!Er(e)||t||n}function wr(e){var t,n;const{name:o,attributes:{style:r},setAttributes:l}=e,i=qo("spacing.spacingSizes"),s=(0,m.__experimentalUseCustomUnits)({availableUnits:qo("spacing.units")||["%","px","em","rem","vw"]}),c=Ar(o,"margin"),u=c&&c.some((e=>Mr.includes(e)));if(Cr(e))return null;const d=e=>{const t={...r,spacing:{...null==r?void 0:r.spacing,margin:e}};l({style:ar(t)})};return a.Platform.select({web:(0,a.createElement)(a.Fragment,null,(!i||0===(null==i?void 0:i.length))&&(0,a.createElement)(m.__experimentalBoxControl,{values:null==r||null===(t=r.spacing)||void 0===t?void 0:t.margin,onChange:d,label:(0,g.__)("Margin"),sides:c,units:s,allowReset:!1,splitOnAxis:u}),(null==i?void 0:i.length)>0&&(0,a.createElement)(or,{values:null==r||null===(n=r.spacing)||void 0===n?void 0:n.margin,onChange:d,label:(0,g.__)("Margin"),sides:c,units:s,allowReset:!1,splitOnAxis:!1})),native:null})}function Sr(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=qo("spacing.spacingSizes"),s=(0,a.useMemo)((()=>{const e=null!=l&&l.top?Ao(null==l?void 0:l.top,i):0,t=null!=l&&l.right?Ao(null==l?void 0:l.right,i):0,n=null!=l&&l.bottom?Ao(null==l?void 0:l.bottom,i):0,o=null!=l&&l.left?Ao(null==l?void 0:l.left,i):0;return{borderTopWidth:e,borderRightWidth:t,borderBottomWidth:n,borderLeftWidth:o,top:0!==e?`-${e}`:0,right:0!==t?`-${t}`:0,bottom:0!==n?`-${n}`:0,left:0!==o?`-${o}`:0}}),[l]),[c,u]=(0,a.useState)(!1),d=(0,a.useRef)(l),p=(0,a.useRef)(),m=()=>{p.current&&window.clearTimeout(p.current)};return(0,a.useEffect)((()=>(br()(l,d.current)||(u(!0),d.current=l,m(),p.current=setTimeout((()=>{u(!1)}),400)),()=>m())),[l]),c?(0,a.createElement)(yr,{clientId:o,__unstableCoverTarget:!0,__unstableRefreshSize:l},(0,a.createElement)("div",{className:"block-editor__padding-visualizer",style:s})):null}function Br(e){const t=(0,r.getBlockSupport)(e,Nr);return!!(!0===t||null!=t&&t.padding)}function Ir(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!qo("spacing.padding"),n=!Dr(e,"padding");return!Br(e)||t||n}function xr(e){var t,n;const{name:o,attributes:{style:r},setAttributes:l}=e,i=qo("spacing.spacingSizes"),s=(0,m.__experimentalUseCustomUnits)({availableUnits:qo("spacing.units")||["%","px","em","rem","vw"]}),c=Ar(o,"padding"),u=c&&c.some((e=>Mr.includes(e)));if(Ir(e))return null;const d=e=>{const t={...r,spacing:{...null==r?void 0:r.spacing,padding:e}};l({style:ar(t)})};return a.Platform.select({web:(0,a.createElement)(a.Fragment,null,(!i||0===(null==i?void 0:i.length))&&(0,a.createElement)(m.__experimentalBoxControl,{values:null==r||null===(t=r.spacing)||void 0===t?void 0:t.padding,onChange:d,label:(0,g.__)("Padding"),sides:c,units:s,allowReset:!1,splitOnAxis:u}),(null==i?void 0:i.length)>0&&(0,a.createElement)(or,{values:null==r||null===(n=r.spacing)||void 0===n?void 0:n.padding,onChange:d,label:(0,g.__)("Padding"),sides:c,units:s,allowReset:!1,splitOnAxis:u})),native:null})}function Tr(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,a.useMemo)((()=>({borderTopWidth:Ro(null==l?void 0:l.top)?Do(null==l?void 0:l.top):null==l?void 0:l.top,borderRightWidth:Ro(null==l?void 0:l.right)?Do(null==l?void 0:l.right):null==l?void 0:l.right,borderBottomWidth:Ro(null==l?void 0:l.bottom)?Do(null==l?void 0:l.bottom):null==l?void 0:l.bottom,borderLeftWidth:Ro(null==l?void 0:l.left)?Do(null==l?void 0:l.left):null==l?void 0:l.left})),[l]),[s,c]=(0,a.useState)(!1),u=(0,a.useRef)(l),d=(0,a.useRef)(),p=()=>{d.current&&window.clearTimeout(d.current)};return(0,a.useEffect)((()=>(br()(l,u.current)||(c(!0),u.current=l,p(),d.current=setTimeout((()=>{c(!1)}),400)),()=>p())),[l]),s?(0,a.createElement)(yr,{clientId:o,__unstableCoverTarget:!0,__unstableRefreshSize:l},(0,a.createElement)("div",{className:"block-editor__padding-visualizer",style:i})):null}const Nr="spacing",Pr=["top","right","bottom","left"],Mr=["vertical","horizontal"];function Lr(e){const t=Vr(e),n=Ir(e),o=Cr(e),l=Rr(e),i=function(e){if("web"!==a.Platform.OS)return!1;return Or(e)||Br(e)||Er(e)}(e.name),s=qo("spacing.spacingSizes");if(l||!i)return null;const u=(0,r.getBlockSupport)(e.name,[Nr,"__experimentalDefaultControls"]),d=e=>t=>{var n;return{...t,style:{...t.style,spacing:{...null===(n=t.style)||void 0===n?void 0:n.spacing,[e]:void 0}}}},p=c()({"tools-panel-item-spacing":s&&s.length>0});return(0,a.createElement)(a.Fragment,null,(0,a.createElement)(hr,{__experimentalGroup:"dimensions"},!n&&(0,a.createElement)(m.__experimentalToolsPanelItem,{className:p,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:ar({...o,spacing:{...null==o?void 0:o.spacing,padding:void 0}})})}(e),resetAllFilter:d("padding"),isShownByDefault:null==u?void 0:u.padding,panelId:e.clientId},(0,a.createElement)(xr,e)),!o&&(0,a.createElement)(m.__experimentalToolsPanelItem,{className:p,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:ar({...o,spacing:{...null==o?void 0:o.spacing,margin:void 0}})})}(e),resetAllFilter:d("margin"),isShownByDefault:null==u?void 0:u.margin,panelId:e.clientId},(0,a.createElement)(wr,e)),!t&&(0,a.createElement)(m.__experimentalToolsPanelItem,{className:p,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:d("blockGap"),isShownByDefault:null==u?void 0:u.blockGap,panelId:e.clientId},(0,a.createElement)(Hr,e))),!n&&(0,a.createElement)(Tr,e),!o&&(0,a.createElement)(Sr,e))}const Rr=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=Vr(e),n=Ir(e),o=Cr(e);return t&&n&&o};function Ar(e,t){var n;const o=(0,r.getBlockSupport)(e,Nr);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 Dr(e,t){const n=Ar(e,t);return!(n&&n.some((e=>Pr.includes(e)))&&n.some((e=>Mr.includes(e))))||(console.warn(`The ${t} support for the "${e}" block can not be configured to support both axial and arbitrary sides.`),!1)}function Or(e){const t=(0,r.getBlockSupport)(e,Nr);return!!(!0===t||null!=t&&t.blockGap)}function zr(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 Fr(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"0";const n=zr(e);if(!n)return null;const o=Do(null==n?void 0:n.top)||t,r=Do(null==n?void 0:n.left)||t;return o===r?o:`${o} ${r}`}function Vr(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!qo("spacing.blockGap");return!Or(e)||t}function Hr(e){var t;const{clientId:n,attributes:{style:o},name:r,setAttributes:l}=e,i=qo("spacing.spacingSizes"),s=(0,m.__experimentalUseCustomUnits)({availableUnits:qo("spacing.units")||["%","px","em","rem","vw"]}),c=Ar(r,"blockGap"),u=Mo(n);if(Vr(e))return null;const d=c&&c.some((e=>Mr.includes(e))),p=e=>{var t;let n=e;e&&d?n={...zr(e)}:null!=e&&e.hasOwnProperty("top")&&(n=e.top);const r={...o,spacing:{...null==o?void 0:o.spacing,blockGap:n}};l({style:ar(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 a;u.current&&i&&(null===(a=u.current.parentNode)||void 0===a||a.replaceChild(u.current,u.current))},f=zr(null==o||null===(t=o.spacing)||void 0===t?void 0:t.blockGap),h=d?{...f,right:null==f?void 0:f.left,bottom:null==f?void 0:f.top}:{top:null==f?void 0:f.top};return a.Platform.select({web:(0,a.createElement)(a.Fragment,null,(!i||0===(null==i?void 0:i.length))&&(d?(0,a.createElement)(m.__experimentalBoxControl,{label:(0,g.__)("Block spacing"),min:0,onChange:p,units:s,sides:c,values:h,allowReset:!1,splitOnAxis:d}):(0,a.createElement)(m.__experimentalUnitControl,{label:(0,g.__)("Block spacing"),__unstableInputWidth:"80px",min:0,onChange:p,units:s,value:h})),(null==i?void 0:i.length)>0&&(0,a.createElement)(or,{values:h,onChange:p,label:(0,g.__)("Block spacing"),sides:d?c:["top"],units:s,allowReset:!1,splitOnAxis:d})),native:null})}const Gr=(0,a.createElement)(m.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(m.Path,{d:"M15 4H9v11h6V4zM4 18.5V20h16v-1.5H4z"})),Ur=(0,a.createElement)(m.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(m.Path,{d:"M20 11h-5V4H9v7H4v1.5h5V20h6v-7.5h5z"})),Wr={top:{icon:(0,a.createElement)(m.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(m.Path,{d:"M9 20h6V9H9v11zM4 4v1.5h16V4H4z"})),title:(0,g._x)("Align top","Block vertical alignment setting")},center:{icon:Ur,title:(0,g._x)("Align middle","Block vertical alignment setting")},bottom:{icon:Gr,title:(0,g._x)("Align bottom","Block vertical alignment setting")}},jr=["top","center","bottom"],$r={isAlternate:!0};var Kr=function(e){let{value:t,onChange:n,controls:o=jr,isCollapsed:r=!0,isToolbar:l}=e;const s=Wr[t],c=Wr.top,u=l?m.ToolbarGroup:m.ToolbarDropdownMenu,d=l?{isCollapsed:r}:{popoverProps:{POPOVER_PROPS:$r}};return(0,a.createElement)(u,i({icon:s?s.icon:c.icon,label:(0,g._x)("Change vertical alignment","Block vertical alignment setting label"),controls:o.map((e=>{return{...Wr[e],isActive:t===e,role:r?"menuitemradio":void 0,onClick:(o=e,()=>n(t===o?void 0:o))};var o}))},d))};const qr=e=>(0,a.createElement)(Kr,i({},e,{isToolbar:!1})),Yr=e=>(0,a.createElement)(Kr,i({},e,{isToolbar:!0})),Zr={left:ko,center:yo,right:Eo,"space-between":Co};var Qr=function(e){let{allowedControls:t=["left","center","right","space-between"],isCollapsed:n=!0,onChange:o,value:r,popoverProps:l,isToolbar:s}=e;const c=e=>{o(e===r?void 0:e)},u=r?Zr[r]:Zr.left,d=[{name:"left",icon:ko,title:(0,g.__)("Justify items left"),isActive:"left"===r,onClick:()=>c("left")},{name:"center",icon:yo,title:(0,g.__)("Justify items center"),isActive:"center"===r,onClick:()=>c("center")},{name:"right",icon:Eo,title:(0,g.__)("Justify items right"),isActive:"right"===r,onClick:()=>c("right")},{name:"space-between",icon:Co,title:(0,g.__)("Space between items"),isActive:"space-between"===r,onClick:()=>c("space-between")}],p=s?m.ToolbarGroup:m.ToolbarDropdownMenu,f=s?{isCollapsed:n}:{};return(0,a.createElement)(p,i({icon:u,popoverProps:l,label:(0,g.__)("Change items justification"),controls:d.filter((e=>t.includes(e.name)))},f))};const Xr=e=>(0,a.createElement)(Qr,i({},e,{isToolbar:!1})),Jr=e=>(0,a.createElement)(Qr,i({},e,{isToolbar:!0})),el={left:"flex-start",right:"flex-end",center:"center","space-between":"space-between"},tl={left:"flex-start",right:"flex-end",center:"center"},nl={top:"flex-start",center:"center",bottom:"flex-end"},ol=["wrap","nowrap"];var rl={name:"flex",label:(0,g.__)("Flex"),inspectorControls:function(e){let{layout:t={},onChange:n,layoutBlockSupport:o={}}=e;const{allowOrientation:r=!0}=o;return(0,a.createElement)(a.Fragment,null,(0,a.createElement)(m.Flex,null,(0,a.createElement)(m.FlexItem,null,(0,a.createElement)(il,{layout:t,onChange:n})),(0,a.createElement)(m.FlexItem,null,r&&(0,a.createElement)(sl,{layout:t,onChange:n}))),(0,a.createElement)(al,{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,a.createElement)(_o,{group:"block",__experimentalShareWithChildBlocks:!0},(0,a.createElement)(il,{layout:t,onChange:n,isToolbar:!0}),r&&"vertical"!==(null==t?void 0:t.orientation)&&(0,a.createElement)(ll,{layout:t,onChange:n,isToolbar:!0}))},getLayoutStyle:function(e){var t,n;let{selector:o,layout:r,style:l,blockName:i,hasBlockGapSupport:a,layoutDefinitions:s}=e;const{orientation:c="horizontal"}=r,u=null!=l&&null!==(t=l.spacing)&&void 0!==t&&t.blockGap&&!ur(i,"spacing","blockGap")?Fr(null==l||null===(n=l.spacing)||void 0===n?void 0:n.blockGap,"0.5em"):void 0,d=el[r.justifyContent],p=ol.includes(r.flexWrap)?r.flexWrap:"wrap",m=nl[r.verticalAlignment],f=tl[r.justifyContent]||tl.left;let g="";const h=[];return p&&"wrap"!==p&&h.push(`flex-wrap: ${p}`),"horizontal"===c?(m&&h.push(`align-items: ${m}`),d&&h.push(`justify-content: ${d}`)):(h.push("flex-direction: column"),h.push(`align-items: ${f}`)),h.length&&(g=`${Bo(o)} {\n\t\t\t\t${h.join("; ")};\n\t\t\t}`),a&&u&&(g+=Io(o,s,"flex",u)),g},getOrientation(e){const{orientation:t="horizontal"}=e;return t},getAlignments(){return[]}};function ll(e){let{layout:t,onChange:n,isToolbar:o=!1}=e;const{verticalAlignment:r=nl.center}=t,l=e=>{n({...t,verticalAlignment:e})};if(o)return(0,a.createElement)(qr,{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,a.createElement)("fieldset",{className:"block-editor-hooks__flex-layout-vertical-alignment-control"},(0,a.createElement)("legend",null,(0,g.__)("Vertical alignment")),(0,a.createElement)("div",null,i.map(((e,t,n)=>(0,a.createElement)(m.Button,{key:e,label:n,icon:t,isPressed:r===e,onClick:()=>l(e)})))))}function il(e){let{layout:t,onChange:n,isToolbar:o=!1}=e;const{justifyContent:r="left",orientation:l="horizontal"}=t,i=e=>{n({...t,justifyContent:e})},s=["left","center","right"];if("horizontal"===l&&s.push("space-between"),o)return(0,a.createElement)(Xr,{allowedControls:s,value:r,onChange:i,popoverProps:{position:"bottom right",isAlternate:!0}});const c=[{value:"left",icon:ko,label:(0,g.__)("Justify items left")},{value:"center",icon:yo,label:(0,g.__)("Justify items center")},{value:"right",icon:Eo,label:(0,g.__)("Justify items right")}];return"horizontal"===l&&c.push({value:"space-between",icon:Co,label:(0,g.__)("Space between items")}),(0,a.createElement)("fieldset",{className:"block-editor-hooks__flex-layout-justification-controls"},(0,a.createElement)("legend",null,(0,g.__)("Justification")),(0,a.createElement)("div",null,c.map((e=>{let{value:t,icon:n,label:o}=e;return(0,a.createElement)(m.Button,{key:t,label:o,icon:n,isPressed:r===t,onClick:()=>i(t)})}))))}function al(e){let{layout:t,onChange:n}=e;const{flexWrap:o="wrap"}=t;return(0,a.createElement)(m.ToggleControl,{label:(0,g.__)("Allow to wrap to multiple lines"),onChange:e=>{n({...t,flexWrap:e?"wrap":"nowrap"})},checked:"wrap"===o})}function sl(e){let{layout:t,onChange:n}=e;const{orientation:o="horizontal"}=t;return(0,a.createElement)("fieldset",{className:"block-editor-hooks__flex-layout-orientation-controls"},(0,a.createElement)("legend",null,(0,g.__)("Orientation")),(0,a.createElement)(m.Button,{label:(0,g.__)("Horizontal"),icon:wo,isPressed:"horizontal"===o,onClick:()=>n({...t,orientation:"horizontal"})}),(0,a.createElement)(m.Button,{label:(0,g.__)("Vertical"),icon:So,isPressed:"vertical"===o,onClick:()=>n({...t,orientation:"vertical"})}))}var cl={name:"default",label:(0,g.__)("Flow"),inspectorControls:function(){return null},toolBarControls:function(){return null},getLayoutStyle:function(e){var t;let{selector:n,style:o,blockName:r,hasBlockGapSupport:l,layoutDefinitions:i}=e;const a=Fr(null==o||null===(t=o.spacing)||void 0===t?void 0:t.blockGap);let s="";ur(r,"spacing","blockGap")||(null!=a&&a.top?s=Fr(null==a?void 0:a.top):"string"==typeof a&&(s=Fr(a)));let c="";return l&&s&&(c+=Io(n,i,"default",s)),c},getOrientation(){return"vertical"},getAlignments(e){const t=xo(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}};var ul=function(e){let{icon:t,size:n=24,...o}=e;return(0,a.cloneElement)(t,{width:n,height:n,...o})};var dl=(0,a.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(D.Path,{d:"M7 9v6h10V9H7zM5 19.8h14v-1.5H5v1.5zM5 4.3v1.5h14V4.3H5z"}));var pl=(0,a.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(D.Path,{d:"M5 9v6h14V9H5zm11-4.8H8v1.5h8V4.2zM8 19.8h8v-1.5H8v1.5z"})),ml=window.wp.styleEngine,fl={name:"constrained",label:(0,g.__)("Constrained"),inspectorControls:function(e){let{layout:t,onChange:n}=e;const{wideSize:o,contentSize:r,justifyContent:l="center"}=t,i=[{value:"left",icon:ko,label:(0,g.__)("Justify items left")},{value:"center",icon:yo,label:(0,g.__)("Justify items center")},{value:"right",icon:Eo,label:(0,g.__)("Justify items right")}],s=(0,m.__experimentalUseCustomUnits)({availableUnits:qo("spacing.units")||["%","px","em","rem","vw"]});return(0,a.createElement)(a.Fragment,null,(0,a.createElement)("div",{className:"block-editor-hooks__layout-controls"},(0,a.createElement)("div",{className:"block-editor-hooks__layout-controls-unit"},(0,a.createElement)(m.__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:s}),(0,a.createElement)(ul,{icon:dl})),(0,a.createElement)("div",{className:"block-editor-hooks__layout-controls-unit"},(0,a.createElement)(m.__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:s}),(0,a.createElement)(ul,{icon:pl}))),(0,a.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.")),(0,a.createElement)(m.__experimentalToggleGroupControl,{__experimentalIsBorderless:!0,label:(0,g.__)("Justification"),value:l,onChange:e=>{n({...t,justifyContent:e})}},i.map((e=>{let{value:t,icon:n,label:o}=e;return(0,a.createElement)(m.__experimentalToggleGroupControlOptionIcon,{key:t,value:t,icon:n,label:o})}))))},toolBarControls:function(){return null},getLayoutStyle:function(e){var t,n;let{selector:o,layout:r={},style:l,blockName:i,hasBlockGapSupport:a,layoutDefinitions:s}=e;const{contentSize:c,wideSize:u,justifyContent:d}=r,p=Fr(null==l||null===(t=l.spacing)||void 0===t?void 0:t.blockGap);let m="";ur(i,"spacing","blockGap")||(null!=p&&p.top?m=Fr(null==p?void 0:p.top):"string"==typeof p&&(m=Fr(p)));const f="left"===d?"0 !important":"auto !important",g="right"===d?"0 !important":"auto !important";let h=c||u?`\n\t\t\t\t\t${Bo(o,"> :where(:not(.alignleft):not(.alignright):not(.alignfull))")} {\n\t\t\t\t\t\tmax-width: ${null!=c?c:u};\n\t\t\t\t\t\tmargin-left: ${f};\n\t\t\t\t\t\tmargin-right: ${g};\n\t\t\t\t\t}\n\t\t\t\t\t${Bo(o,"> .alignwide")} {\n\t\t\t\t\t\tmax-width: ${null!=u?u:c};\n\t\t\t\t\t}\n\t\t\t\t\t${Bo(o,"> .alignfull")} {\n\t\t\t\t\t\tmax-width: none;\n\t\t\t\t\t}\n\t\t\t\t`:"";if("left"===d?h+=`${Bo(o,"> :where(:not(.alignleft):not(.alignright):not(.alignfull))")}\n\t\t\t{ margin-left: ${f}; }`:"right"===d&&(h+=`${Bo(o,"> :where(:not(.alignleft):not(.alignright):not(.alignfull))")}\n\t\t\t{ margin-right: ${g}; }`),null!=l&&null!==(n=l.spacing)&&void 0!==n&&n.padding){(0,ml.getCSSRules)(l).forEach((e=>{"paddingRight"===e.key?h+=`\n\t\t\t\t\t${Bo(o,"> .alignfull")} {\n\t\t\t\t\t\tmargin-right: calc(${e.value} * -1);\n\t\t\t\t\t}\n\t\t\t\t\t`:"paddingLeft"===e.key&&(h+=`\n\t\t\t\t\t${Bo(o,"> .alignfull")} {\n\t\t\t\t\t\tmargin-left: calc(${e.value} * -1);\n\t\t\t\t\t}\n\t\t\t\t\t`)}))}return a&&m&&(h+=Io(o,s,"constrained",m)),h},getOrientation(){return"vertical"},getAlignments(e){const t=xo(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}};const gl=[cl,rl,fl];function hl(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default";return gl.find((t=>t.name===e))}const vl={type:"default"},bl=(0,a.createContext)(vl),_l=bl.Provider;function kl(){return(0,a.useContext)(bl)}function yl(e){let{layout:t={},css:n,...o}=e;const r=hl(t.type),l=null!==qo("spacing.blockGap");if(r){var i;if(n)return(0,a.createElement)("style",null,n);const e=null===(i=r.getLayoutStyle)||void 0===i?void 0:i.call(r,{hasBlockGapSupport:l,layout:t,...o});if(e)return(0,a.createElement)("style",null,e)}return null}const El=["none","left","center","right","wide","full"],Cl=["wide","full"];function wl(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:El;e.includes("none")||(e=["none",...e]);const{wideControlsEnabled:t=!1,themeSupportsLayout:n}=(0,p.useSelect)((e=>{const{getSettings:t}=e(so),n=t();return{wideControlsEnabled:n.alignWide,themeSupportsLayout:n.supportsLayout}}),[]),o=kl(),r=hl(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&&"constrained"!==r.name)return[];const{alignments:i=El}=o,a=e.filter((e=>(o.alignments||t||!Cl.includes(e))&&i.includes(e))).map((e=>({name:e})));return 1===a.length&&"none"===a[0].name?[]:a}var Sl=(0,a.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(D.Path,{d:"M5 15h14V9H5v6zm0 4.8h14v-1.5H5v1.5zM5 4.2v1.5h14V4.2H5z"}));var Bl=(0,a.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(D.Path,{d:"M4 9v6h14V9H4zm8-4.8H4v1.5h8V4.2zM4 19.8h8v-1.5H4v1.5z"}));var Il=(0,a.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(D.Path,{d:"M6 15h14V9H6v6zm6-10.8v1.5h8V4.2h-8zm0 15.6h8v-1.5h-8v1.5z"}));var xl=(0,a.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(D.Path,{d:"M5 4v11h14V4H5zm3 15.8h8v-1.5H8v1.5z"}));const Tl={none:{icon:Sl,title:(0,g._x)("None","Alignment option")},left:{icon:Bl,title:(0,g.__)("Align left")},center:{icon:dl,title:(0,g.__)("Align center")},right:{icon:Il,title:(0,g.__)("Align right")},wide:{icon:pl,title:(0,g.__)("Wide width")},full:{icon:xl,title:(0,g.__)("Full width")}},Nl={isAlternate:!0};var Pl=function(e){let{value:t,onChange:n,controls:o,isToolbar:r,isCollapsed:l=!0}=e;const s=wl(o);if(!!!s.length)return null;function u(e){n([t,"none"].includes(e)?void 0:e)}const d=Tl[t],p=Tl.none,f=r?m.ToolbarGroup:m.ToolbarDropdownMenu,h={icon:d?d.icon:p.icon,label:(0,g.__)("Align")},v=r?{isCollapsed:l,controls:s.map((e=>{let{name:n}=e;return{...Tl[n],isActive:t===n||!t&&"none"===n,role:l?"menuitemradio":void 0,onClick:()=>u(n)}}))}:{toggleProps:{describedBy:(0,g.__)("Change alignment")},popoverProps:Nl,children:e=>{let{onClose:n}=e;return(0,a.createElement)(a.Fragment,null,(0,a.createElement)(m.MenuGroup,{className:"block-editor-block-alignment-control__menu-group"},s.map((e=>{let{name:o,info:r}=e;const{icon:l,title:i}=Tl[o],s=o===t||!t&&"none"===o;return(0,a.createElement)(m.MenuItem,{key:o,icon:l,iconPosition:"left",className:c()("components-dropdown-menu__menu-item",{"is-active":s}),isSelected:s,onClick:()=>{u(o),n()},role:"menuitemradio",info:r},i)}))))}};return(0,a.createElement)(f,i({},h,v))};const Ml=e=>(0,a.createElement)(Pl,i({},e,{isToolbar:!1})),Ll=e=>(0,a.createElement)(Pl,i({},e,{isToolbar:!0})),Rl=["left","center","right","wide","full"],Al=["wide","full"];function Dl(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)?Rl.filter((t=>e.includes(t))):!0===e?[...Rl]:[],!o||!0===e&&!n?(0,u.without)(t,...Al):t}const Ol=(0,d.createHigherOrderComponent)((e=>t=>{const n=(0,a.createElement)(e,t),{name:o}=t,l=wl(Dl((0,r.getBlockSupport)(o,"align"),(0,r.hasBlockSupport)(o,"alignWide",!0))).map((e=>{let{name:t}=e;return t})),i=(0,p.useSelect)((e=>e(so).__unstableGetContentLockingParent(t.clientId)),[t.clientId]);if(!l.length||i)return n;return(0,a.createElement)(a.Fragment,null,(0,a.createElement)(_o,{group:"block",__experimentalShareWithChildBlocks:!0},(0,a.createElement)(Ml,{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:l})),n)}),"withToolbarControls"),zl=(0,d.createHigherOrderComponent)((e=>t=>{const{name:n,attributes:o}=t,{align:l}=o,s=wl(Dl((0,r.getBlockSupport)(n,"align"),(0,r.hasBlockSupport)(n,"alignWide",!0)));if(void 0===l)return(0,a.createElement)(e,t);let c=t.wrapperProps;return s.some((e=>e.name===l))&&(c={...c,"data-align":l}),(0,a.createElement)(e,i({},t,{wrapperProps:c}))}));(0,l.addFilter)("blocks.registerBlockType","core/align/addAttribute",(function(e){var t,n;return"type"in(null!==(t=null===(n=e.attributes)||void 0===n?void 0:n.align)&&void 0!==t?t:{})||(0,r.hasBlockSupport)(e,"align")&&(e.attributes={...e.attributes,align:{type:"string",enum:[...Rl,""]}}),e})),(0,l.addFilter)("editor.BlockListBlock","core/editor/align/with-data-align",zl),(0,l.addFilter)("editor.BlockEdit","core/editor/align/with-toolbar-controls",Ol),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/align/addAssignedAlign",(function(e,t,n){const{align:o}=n;return Dl((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){var t,n;return"type"in(null!==(t=null===(n=e.attributes)||void 0===n?void 0:n.lock)&&void 0!==t?t:{})||(e.attributes={...e.attributes,lock:{type:"object"}}),e}));const Fl=/[\s#]/g,Vl={type:"string",source:"attribute",attribute:"id",selector:"*"};const Hl=(0,d.createHigherOrderComponent)((e=>t=>{if((0,r.hasBlockSupport)(t.name,"anchor")&&t.isSelected){const n="web"===a.Platform.OS,o=(0,a.createElement)(m.TextControl,{className:"html-anchor-control",label:(0,g.__)("HTML anchor"),help:(0,a.createElement)(a.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, youll be able to link directly to this section of your page."),n&&(0,a.createElement)(m.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(Fl,"-"),t.setAttributes({anchor:e})},autoCapitalize:"none",autoComplete:"off"});return(0,a.createElement)(a.Fragment,null,(0,a.createElement)(e,t),n&&(0,a.createElement)(hr,{__experimentalGroup:"advanced"},o),!n&&"core/heading"===t.name&&(0,a.createElement)(hr,null,(0,a.createElement)(m.PanelBody,{title:(0,g.__)("Heading settings")},o)))}return(0,a.createElement)(e,t)}),"withInspectorControl");(0,l.addFilter)("blocks.registerBlockType","core/anchor/attribute",(function(e){var t,n;return"type"in(null!==(t=null===(n=e.attributes)||void 0===n?void 0:n.anchor)&&void 0!==t?t:{})||(0,r.hasBlockSupport)(e,"anchor")&&(e.attributes={...e.attributes,anchor:Vl}),e})),(0,l.addFilter)("editor.BlockEdit","core/editor/anchor/with-inspector-control",Hl),(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 Gl={type:"string",source:"attribute",attribute:"aria-label",selector:"*"};(0,l.addFilter)("blocks.registerBlockType","core/ariaLabel/attribute",(function(e){var t,n;return null!=e&&null!==(t=e.attributes)&&void 0!==t&&null!==(n=t.ariaLabel)&&void 0!==n&&n.type||(0,r.hasBlockSupport)(e,"ariaLabel")&&(e.attributes={...e.attributes,ariaLabel:Gl}),e})),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/ariaLabel/save-props",(function(e,t,n){return(0,r.hasBlockSupport)(t,"ariaLabel")&&(e["aria-label"]=""===n.ariaLabel?null:n.ariaLabel),e}));const Ul=(0,d.createHigherOrderComponent)((e=>t=>(0,r.hasBlockSupport)(t.name,"customClassName",!0)&&t.isSelected?(0,a.createElement)(a.Fragment,null,(0,a.createElement)(e,t),(0,a.createElement)(hr,{__experimentalGroup:"advanced"},(0,a.createElement)(m.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,a.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",Ul),(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=[...new Set([(0,r.getBlockDefaultClassName)(t.name),...e.className.split(" ")])].join(" ").trim():e.className=(0,r.getBlockDefaultClassName)(t.name)),e}));var Wl=window.wp.dom;const jl=(0,a.createContext)({});function $l(e){let{value:t,children:n}=e;const o=(0,a.useContext)(jl),r=(0,a.useMemo)((()=>({...o,...t})),[o,t]);return(0,a.createElement)(jl.Provider,{value:r,children:n})}var Kl=jl;const ql={};var Yl=(0,m.withFilters)("editor.BlockEdit")((e=>{const{attributes:t={},name:n}=e,o=(0,r.getBlockType)(n),l=(0,a.useContext)(Kl),s=(0,a.useMemo)((()=>o&&o.usesContext?(0,u.pick)(l,o.usesContext):ql),[o,l]);if(!o)return null;const d=o.edit||o.save;if(o.apiVersion>1)return(0,a.createElement)(d,i({},e,{context:s}));const p=(0,r.hasBlockSupport)(o,"className",!0)?(0,r.getBlockDefaultClassName)(n):null,m=c()(p,t.className,e.className);return(0,a.createElement)(d,i({},e,{context:s,className:m}))}));function Zl(e){const{name:t,isSelected:n,clientId:o}=e,r={name:t,isSelected:n,clientId:o};return(0,a.createElement)(po,{value:(0,a.useMemo)((()=>r),Object.values(r))},(0,a.createElement)(Yl,e))}var Ql=(0,a.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(D.Path,{d:"M11 13h2v-2h-2v2zm-6 0h2v-2H5v2zm12-2v2h2v-2h-2z"}));var Xl=function(e){let{className:t,actions:n,children:o,secondaryActions:r}=e;return(0,a.createElement)("div",{style:{display:"contents",all:"initial"}},(0,a.createElement)("div",{className:c()(t,"block-editor-warning")},(0,a.createElement)("div",{className:"block-editor-warning__contents"},(0,a.createElement)("p",{className:"block-editor-warning__message"},o),(a.Children.count(n)>0||r)&&(0,a.createElement)("div",{className:"block-editor-warning__actions"},a.Children.count(n)>0&&a.Children.map(n,((e,t)=>(0,a.createElement)("span",{key:t,className:"block-editor-warning__action"},e))),r&&(0,a.createElement)(m.DropdownMenu,{className:"block-editor-warning__secondary",icon:Ql,label:(0,g.__)("More options"),popoverProps:{position:"bottom left",className:"block-editor-warning__dropdown"},noIcons:!0},(()=>(0,a.createElement)(m.MenuGroup,null,r.map(((e,t)=>(0,a.createElement)(m.MenuItem,{onClick:e.onClick,key:t},e.title))))))))))},Jl=n(1973);function ei(e){let{title:t,rawContent:n,renderedContent:o,action:r,actionText:l,className:i}=e;return(0,a.createElement)("div",{className:i},(0,a.createElement)("div",{className:"block-editor-block-compare__content"},(0,a.createElement)("h2",{className:"block-editor-block-compare__heading"},t),(0,a.createElement)("div",{className:"block-editor-block-compare__html"},n),(0,a.createElement)("div",{className:"block-editor-block-compare__preview edit-post-visual-editor"},(0,a.createElement)(a.RawHTML,null,(0,Wl.safeHTML)(o)))),(0,a.createElement)("div",{className:"block-editor-block-compare__action"},(0,a.createElement)(m.Button,{variant:"secondary",tabIndex:"0",onClick:r},l)))}var ti=function(e){let{block:t,onKeep:n,onConvert:o,convertor:l,convertButtonText:i}=e;const s=(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=s,(0,Jl.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,a.createElement)("span",{key:t,className:n},e.value)})));var m,f;return(0,a.createElement)("div",{className:"block-editor-block-compare__wrapper"},(0,a.createElement)(ei,{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,a.createElement)(ei,{title:(0,g.__)("After Conversion"),className:"block-editor-block-compare__converted",action:o,actionText:i,rawContent:p,renderedContent:s}))};const ni=e=>(0,r.rawHandler)({HTML:e.originalContent});var oi=(0,d.compose)([(0,p.withSelect)(((e,t)=>{let{clientId:n}=t;return{block:e(so).getBlock(n)}})),(0,p.withDispatch)(((e,t)=>{let{block:n}=t;const{replaceBlock:o}=e(so);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,ni(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 s=!!(0,r.getBlockType)("core/html"),[c,u]=(0,a.useState)(!1),d=(0,a.useCallback)((()=>u(!0)),[]),p=(0,a.useCallback)((()=>u(!1)),[]),f=(0,a.useMemo)((()=>[{title:(0,g._x)("Resolve","imperative verb"),onClick:d},s&&{title:(0,g.__)("Convert to HTML"),onClick:t},{title:(0,g.__)("Convert to Classic Block"),onClick:o}].filter(Boolean)),[d,t,o]);return(0,a.createElement)(a.Fragment,null,(0,a.createElement)(Xl,{actions:[(0,a.createElement)(m.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,a.createElement)(m.Modal,{title:(0,g.__)("Resolve Block"),onRequestClose:p,className:"block-editor-block-compare"},(0,a.createElement)(ti,{block:i,onKeep:t,onConvert:n,convertor:ni,convertButtonText:(0,g.__)("Convert to Blocks")})))}));const ri=(0,a.createElement)(Xl,{className:"block-editor-block-list__block-crash-warning"},(0,g.__)("This block has encountered an error and cannot be previewed."));var li=()=>ri;class ii extends a.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 ai=ii,si=n(773);var ci=function(e){let{clientId:t}=e;const[n,o]=(0,a.useState)(""),l=(0,p.useSelect)((e=>e(so).getBlock(t)),[t]),{updateBlock:i}=(0,p.useDispatch)(so);return(0,a.useEffect)((()=>{o((0,r.getBlockContent)(l))}),[l]),(0,a.createElement)(si.Z,{className:"block-editor-block-list__block-html-textarea",value:n,onBlur:()=>{const e=(0,r.getBlockType)(l.name);if(!e)return;const a=(0,r.getBlockAttributes)(e,n,l.attributes),s=n||(0,r.getSaveContent)(e,a),[c]=n?(0,r.validateBlock)({...l,attributes:a,originalContent:s}):[!0];i(t,{attributes:a,originalContent:s,isValid:c}),n||o({content:s})},onChange:e=>o(e.target.value)})};let ui=Bi();const di=e=>Ei(e,ui);let pi=Bi();di.write=e=>Ei(e,pi);let mi=Bi();di.onStart=e=>Ei(e,mi);let fi=Bi();di.onFrame=e=>Ei(e,fi);let gi=Bi();di.onFinish=e=>Ei(e,gi);let hi=[];di.setTimeout=(e,t)=>{let n=di.now()+t,o=()=>{let e=hi.findIndex((e=>e.cancel==o));~e&&hi.splice(e,1),ki-=~e?1:0},r={time:n,handler:e,cancel:o};return hi.splice(vi(n),0,r),ki+=1,Ci(),r};let vi=e=>~(~hi.findIndex((t=>t.time>e))||~hi.length);di.cancel=e=>{mi.delete(e),fi.delete(e),gi.delete(e),ui.delete(e),pi.delete(e)},di.sync=e=>{yi=!0,di.batchedUpdates(e),yi=!1},di.throttle=e=>{let t;function n(){try{e(...t)}finally{t=null}}function o(...e){t=e,di.onStart(n)}return o.handler=e,o.cancel=()=>{mi.delete(n),t=null},o};let bi="undefined"!=typeof window?window.requestAnimationFrame:()=>{};di.use=e=>bi=e,di.now="undefined"!=typeof performance?()=>performance.now():Date.now,di.batchedUpdates=e=>e(),di.catch=console.error,di.frameLoop="always",di.advance=()=>{"demand"!==di.frameLoop?console.warn("Cannot call the manual advancement of rafz whilst frameLoop is not set as demand"):Si()};let _i=-1,ki=0,yi=!1;function Ei(e,t){yi?(t.delete(e),e(0)):(t.add(e),Ci())}function Ci(){_i<0&&(_i=0,"demand"!==di.frameLoop&&bi(wi))}function wi(){~_i&&(bi(wi),di.batchedUpdates(Si))}function Si(){let e=_i;_i=di.now();let t=vi(_i);t&&(Ii(hi.splice(0,t),(e=>e.handler())),ki-=t),ki?(mi.flush(),ui.flush(e?Math.min(64,_i-e):16.667),fi.flush(),pi.flush(),gi.flush()):_i=-1}function Bi(){let e=new Set,t=e;return{add(n){ki+=t!=e||e.has(n)?0:1,e.add(n)},delete(n){return ki-=t==e&&e.has(n)?1:0,e.delete(n)},flush(n){t.size&&(e=new Set,ki-=t.size,Ii(t,(t=>t(n)&&e.add(t))),ki+=e.size,t=e)}}}function Ii(e,t){e.forEach((e=>{try{t(e)}catch(e){di.catch(e)}}))}var xi=n(9196),Ti=n.n(xi);function Ni(){}const Pi={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 Mi(e,t){if(Pi.arr(e)){if(!Pi.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 Li=(e,t)=>e.forEach(t);function Ri(e,t,n){if(Pi.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 Ai=e=>Pi.und(e)?[]:Pi.arr(e)?e:[e];function Di(e,t){if(e.size){const n=Array.from(e);e.clear(),Li(n,t)}}const Oi=(e,...t)=>Di(e,(e=>e(...t))),zi=()=>"undefined"==typeof window||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent);let Fi,Vi,Hi=null,Gi=!1,Ui=Ni;const Wi=e=>{e.to&&(Vi=e.to),e.now&&(di.now=e.now),void 0!==e.colors&&(Hi=e.colors),null!=e.skipAnimation&&(Gi=e.skipAnimation),e.createStringInterpolator&&(Fi=e.createStringInterpolator),e.requestAnimationFrame&&di.use(e.requestAnimationFrame),e.batchedUpdates&&(di.batchedUpdates=e.batchedUpdates),e.willAdvance&&(Ui=e.willAdvance),e.frameLoop&&(di.frameLoop=e.frameLoop)};var ji=Object.freeze({__proto__:null,get createStringInterpolator(){return Fi},get to(){return Vi},get colors(){return Hi},get skipAnimation(){return Gi},get willAdvance(){return Ui},assign:Wi});const $i=new Set;let Ki=[],qi=[],Yi=0;const Zi={get idle(){return!$i.size&&!Ki.length},start(e){Yi>e.priority?($i.add(e),di.onStart(Qi)):(Xi(e),di(ea))},advance:ea,sort(e){if(Yi)di.onFrame((()=>Zi.sort(e)));else{const t=Ki.indexOf(e);~t&&(Ki.splice(t,1),Ji(e))}},clear(){Ki=[],$i.clear()}};function Qi(){$i.forEach(Xi),$i.clear(),di(ea)}function Xi(e){Ki.includes(e)||Ji(e)}function Ji(e){Ki.splice(function(e,t){const n=e.findIndex(t);return n<0?e.length:n}(Ki,(t=>t.priority>e.priority)),0,e)}function ea(e){const t=qi;for(let n=0;n<Ki.length;n++){const o=Ki[n];Yi=o.priority,o.idle||(Ui(o),o.advance(e),o.idle||t.push(o))}return Yi=0,qi=Ki,qi.length=0,Ki=t,Ki.length>0}const ta="[-+]?\\d*\\.?\\d+",na=ta+"%";function oa(...e){return"\\(\\s*("+e.join(")\\s*,\\s*(")+")\\s*\\)"}const ra=new RegExp("rgb"+oa(ta,ta,ta)),la=new RegExp("rgba"+oa(ta,ta,ta,ta)),ia=new RegExp("hsl"+oa(ta,na,na)),aa=new RegExp("hsla"+oa(ta,na,na,ta)),sa=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,ca=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,ua=/^#([0-9a-fA-F]{6})$/,da=/^#([0-9a-fA-F]{8})$/;function pa(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 ma(e,t,n){const o=n<.5?n*(1+t):n+t-n*t,r=2*n-o,l=pa(r,o,e+1/3),i=pa(r,o,e),a=pa(r,o,e-1/3);return Math.round(255*l)<<24|Math.round(255*i)<<16|Math.round(255*a)<<8}function fa(e){const t=parseInt(e,10);return t<0?0:t>255?255:t}function ga(e){return(parseFloat(e)%360+360)%360/360}function ha(e){const t=parseFloat(e);return t<0?0:t>1?255:Math.round(255*t)}function va(e){const t=parseFloat(e);return t<0?0:t>100?1:t/100}function ba(e){let t=function(e){let t;return"number"==typeof e?e>>>0===e&&e>=0&&e<=4294967295?e:null:(t=ua.exec(e))?parseInt(t[1]+"ff",16)>>>0:Hi&&void 0!==Hi[e]?Hi[e]:(t=ra.exec(e))?(fa(t[1])<<24|fa(t[2])<<16|fa(t[3])<<8|255)>>>0:(t=la.exec(e))?(fa(t[1])<<24|fa(t[2])<<16|fa(t[3])<<8|ha(t[4]))>>>0:(t=sa.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+"ff",16)>>>0:(t=da.exec(e))?parseInt(t[1],16)>>>0:(t=ca.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+t[4]+t[4],16)>>>0:(t=ia.exec(e))?(255|ma(ga(t[1]),va(t[2]),va(t[3])))>>>0:(t=aa.exec(e))?(ma(ga(t[1]),va(t[2]),va(t[3]))|ha(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 _a=(e,t,n)=>{if(Pi.fun(e))return e;if(Pi.arr(e))return _a({range:e,output:t,extrapolate:n});if(Pi.str(e.output[0]))return Fi(e);const o=e,r=o.output,l=o.range||[0,1],i=o.extrapolateLeft||o.extrapolate||"extend",a=o.extrapolateRight||o.extrapolate||"extend",s=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,a,s){let c=s?s(e):e;if(c<t){if("identity"===i)return c;"clamp"===i&&(c=t)}if(c>n){if("identity"===a)return c;"clamp"===a&&(c=n)}if(o===r)return o;if(t===n)return 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;return c}(e,l[t],l[t+1],r[t],r[t+1],s,i,a,o.map)}};function ka(){return ka=Object.assign?Object.assign.bind():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},ka.apply(this,arguments)}const ya=Symbol.for("FluidValue.get"),Ea=Symbol.for("FluidValue.observers"),Ca=e=>Boolean(e&&e[ya]),wa=e=>e&&e[ya]?e[ya]():e,Sa=e=>e[Ea]||null;function Ba(e,t){let n=e[Ea];n&&n.forEach((e=>{!function(e,t){e.eventObserved?e.eventObserved(t):e(t)}(e,t)}))}class Ia{constructor(e){if(this[ya]=void 0,this[Ea]=void 0,!e&&!(e=this.get))throw Error("Unknown getter");xa(this,e)}}const xa=(e,t)=>Pa(e,ya,t);function Ta(e,t){if(e[ya]){let n=e[Ea];n||Pa(e,Ea,n=new Set),n.has(t)||(n.add(t),e.observerAdded&&e.observerAdded(n.size,t))}return t}function Na(e,t){let n=e[Ea];if(n&&n.has(t)){const o=n.size-1;o?n.delete(t):e[Ea]=null,e.observerRemoved&&e.observerRemoved(o,t)}}const Pa=(e,t,n)=>Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0}),Ma=/[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,La=/(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi,Ra=new RegExp(`(${Ma.source})(%|[a-z]+)`,"i"),Aa=/rgba\(([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+)\)/gi,Da=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/,Oa=e=>{const[t,n]=za(e);if(!t||zi())return e;const o=window.getComputedStyle(document.documentElement).getPropertyValue(t);if(o)return o.trim();if(n&&n.startsWith("--")){const t=window.getComputedStyle(document.documentElement).getPropertyValue(n);return t||e}return n&&Da.test(n)?Oa(n):n||e},za=e=>{const t=Da.exec(e);if(!t)return[,];const[,n,o]=t;return[n,o]};let Fa;const Va=(e,t,n,o,r)=>`rgba(${Math.round(t)}, ${Math.round(n)}, ${Math.round(o)}, ${r})`,Ha=e=>{Fa||(Fa=Hi?new RegExp(`(${Object.keys(Hi).join("|")})(?!\\w)`,"g"):/^\b$/);const t=e.output.map((e=>wa(e).replace(Da,Oa).replace(La,ba).replace(Fa,ba))),n=t.map((e=>e.match(Ma).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]})))),r=o.map((t=>_a(ka({},e,{output:t}))));return e=>{var n;const o=!Ra.test(t[0])&&(null==(n=t.find((e=>Ra.test(e))))?void 0:n.replace(Ma,""));let l=0;return t[0].replace(Ma,(()=>`${r[l++](e)}${o||""}`)).replace(Aa,Va)}},Ga="react-spring: ",Ua=e=>{const t=e;let n=!1;if("function"!=typeof t)throw new TypeError(`${Ga}once requires a function parameter`);return(...e)=>{n||(t(...e),n=!0)}},Wa=Ua(console.warn);const ja=Ua(console.warn);function $a(e){return Pi.str(e)&&("#"==e[0]||/\d/.test(e)||!zi()&&Da.test(e)||e in(Hi||{}))}const Ka=zi()?xi.useEffect:xi.useLayoutEffect;function qa(){const e=(0,xi.useState)()[1],t=(()=>{const e=(0,xi.useRef)(!1);return Ka((()=>(e.current=!0,()=>{e.current=!1})),[]),e})();return()=>{t.current&&e(Math.random())}}const Ya=e=>(0,xi.useEffect)(e,Za),Za=[];function Qa(e){const t=(0,xi.useRef)();return(0,xi.useEffect)((()=>{t.current=e})),t.current}const Xa=Symbol.for("Animated:node"),Ja=e=>e&&e[Xa],es=(e,t)=>{return n=e,o=Xa,r=t,Object.defineProperty(n,o,{value:r,writable:!0,configurable:!0});var n,o,r},ts=e=>e&&e[Xa]&&e[Xa].getPayload();class ns{constructor(){this.payload=void 0,es(this,this)}getPayload(){return this.payload||[]}}class os extends ns{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,Pi.num(this._value)&&(this.lastPosition=this._value)}static create(e){return new os(e)}getPayload(){return[this]}getValue(){return this._value}setValue(e,t){return Pi.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,Pi.num(this._value)&&(this.elapsedTime=0,this.durationProgress=0,this.lastPosition=this._value,e&&(this.lastVelocity=null),this.v0=null)}}class rs extends os{constructor(e){super(0),this._string=null,this._toString=void 0,this._toString=_a({output:[e,e]})}static create(e){return new rs(e)}getValue(){let e=this._string;return null==e?this._string=this._toString(this._value):e}setValue(e){if(Pi.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=_a({output:[this.getValue(),e]})),this._value=0,super.reset()}}const ls={dependencies:null};class is extends ns{constructor(e){super(),this.source=e,this.setValue(e)}getValue(e){const t={};return Ri(this.source,((n,o)=>{var r;(r=n)&&r[Xa]===r?t[o]=n.getValue(e):Ca(n)?t[o]=wa(n):e||(t[o]=n)})),t}setValue(e){this.source=e,this.payload=this._makePayload(e)}reset(){this.payload&&Li(this.payload,(e=>e.reset()))}_makePayload(e){if(e){const t=new Set;return Ri(e,this._addToPayload,t),Array.from(t)}}_addToPayload(e){ls.dependencies&&Ca(e)&&ls.dependencies.add(e);const t=ts(e);t&&Li(t,(e=>this.add(e)))}}class as extends is{constructor(e){super(e)}static create(e){return new as(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(ss)),!0)}}function ss(e){return($a(e)?rs:os).create(e)}function cs(e){const t=Ja(e);return t?t.constructor:Pi.arr(e)?as:$a(e)?rs:os}function us(){return us=Object.assign?Object.assign.bind():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},us.apply(this,arguments)}const ds=(e,t)=>{const n=!Pi.fun(e)||e.prototype&&e.prototype.isReactComponent;return(0,xi.forwardRef)(((o,r)=>{const l=(0,xi.useRef)(null),i=n&&(0,xi.useCallback)((e=>{l.current=function(e,t){e&&(Pi.fun(e)?e(t):e.current=t);return t}(r,e)}),[r]),[a,s]=function(e,t){const n=new Set;ls.dependencies=n,e.style&&(e=us({},e,{style:t.createAnimatedStyle(e.style)}));return e=new is(e),ls.dependencies=null,[e,n]}(o,t),c=qa(),u=()=>{const e=l.current;if(n&&!e)return;!1===(!!e&&t.applyAnimatedValues(e,a.getValue(!0)))&&c()},d=new ps(u,s),p=(0,xi.useRef)();Ka((()=>(p.current=d,Li(s,(e=>Ta(e,d))),()=>{p.current&&(Li(p.current.deps,(e=>Na(e,p.current))),di.cancel(p.current.update))}))),(0,xi.useEffect)(u,[]),Ya((()=>()=>{const e=p.current;Li(e.deps,(t=>Na(t,e)))}));const m=t.getComponentProps(a.getValue());return xi.createElement(e,us({},m,{ref:i}))}))};class ps{constructor(e,t){this.update=e,this.deps=t}eventObserved(e){"change"==e.type&&di.write(this.update)}}const ms=Symbol.for("AnimatedComponent"),fs=e=>Pi.str(e)?e:e&&Pi.str(e.displayName)?e.displayName:Pi.fun(e)&&e.name||null;function gs(){return gs=Object.assign?Object.assign.bind():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},gs.apply(this,arguments)}function hs(e,...t){return Pi.fun(e)?e(...t):e}const vs=(e,t)=>!0===e||!!(t&&e&&(Pi.fun(e)?e(t):Ai(e).includes(t))),bs=(e,t)=>Pi.obj(e)?t&&e[t]:e,_s=(e,t)=>!0===e.default?e[t]:e.default?e.default[t]:void 0,ks=e=>e,ys=(e,t=ks)=>{let n=Es;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);Pi.und(n)||(o[r]=n)}return o},Es=["config","onProps","onStart","onChange","onPause","onResume","onRest"],Cs={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 ws(e){const t=function(e){const t={};let n=0;if(Ri(e,((e,o)=>{Cs[o]||(t[o]=e,n++)})),n)return t}(e);if(t){const n={to:t};return Ri(e,((e,o)=>o in t||(n[o]=e))),n}return gs({},e)}function Ss(e){return e=wa(e),Pi.arr(e)?e.map(Ss):$a(e)?ji.createStringInterpolator({range:[0,1],output:[e,e]})(1):e}function Bs(e){for(const t in e)return!0;return!1}function Is(e){return Pi.fun(e)||Pi.arr(e)&&Pi.obj(e[0])}function xs(e,t){var n;null==(n=e.ref)||n.delete(e),null==t||t.delete(e)}function Ts(e,t){var n;t&&e.ref!==t&&(null==(n=e.ref)||n.delete(e),t.add(e),e.ref=t)}const Ns=1.70158,Ps=1.525*Ns,Ms=Ns+1,Ls=2*Math.PI/3,Rs=2*Math.PI/4.5,As=e=>{const t=7.5625,n=2.75;return e<1/n?t*e*e:e<2/n?t*(e-=1.5/n)*e+.75:e<2.5/n?t*(e-=2.25/n)*e+.9375:t*(e-=2.625/n)*e+.984375},Ds={linear:e=>e,easeInQuad:e=>e*e,easeOutQuad:e=>1-(1-e)*(1-e),easeInOutQuad:e=>e<.5?2*e*e:1-Math.pow(-2*e+2,2)/2,easeInCubic:e=>e*e*e,easeOutCubic:e=>1-Math.pow(1-e,3),easeInOutCubic:e=>e<.5?4*e*e*e:1-Math.pow(-2*e+2,3)/2,easeInQuart:e=>e*e*e*e,easeOutQuart:e=>1-Math.pow(1-e,4),easeInOutQuart:e=>e<.5?8*e*e*e*e:1-Math.pow(-2*e+2,4)/2,easeInQuint:e=>e*e*e*e*e,easeOutQuint:e=>1-Math.pow(1-e,5),easeInOutQuint:e=>e<.5?16*e*e*e*e*e:1-Math.pow(-2*e+2,5)/2,easeInSine:e=>1-Math.cos(e*Math.PI/2),easeOutSine:e=>Math.sin(e*Math.PI/2),easeInOutSine:e=>-(Math.cos(Math.PI*e)-1)/2,easeInExpo:e=>0===e?0:Math.pow(2,10*e-10),easeOutExpo:e=>1===e?1:1-Math.pow(2,-10*e),easeInOutExpo:e=>0===e?0:1===e?1:e<.5?Math.pow(2,20*e-10)/2:(2-Math.pow(2,-20*e+10))/2,easeInCirc:e=>1-Math.sqrt(1-Math.pow(e,2)),easeOutCirc:e=>Math.sqrt(1-Math.pow(e-1,2)),easeInOutCirc:e=>e<.5?(1-Math.sqrt(1-Math.pow(2*e,2)))/2:(Math.sqrt(1-Math.pow(-2*e+2,2))+1)/2,easeInBack:e=>Ms*e*e*e-Ns*e*e,easeOutBack:e=>1+Ms*Math.pow(e-1,3)+Ns*Math.pow(e-1,2),easeInOutBack:e=>e<.5?Math.pow(2*e,2)*(7.189819*e-Ps)/2:(Math.pow(2*e-2,2)*((Ps+1)*(2*e-2)+Ps)+2)/2,easeInElastic:e=>0===e?0:1===e?1:-Math.pow(2,10*e-10)*Math.sin((10*e-10.75)*Ls),easeOutElastic:e=>0===e?0:1===e?1:Math.pow(2,-10*e)*Math.sin((10*e-.75)*Ls)+1,easeInOutElastic:e=>0===e?0:1===e?1:e<.5?-Math.pow(2,20*e-10)*Math.sin((20*e-11.125)*Rs)/2:Math.pow(2,-20*e+10)*Math.sin((20*e-11.125)*Rs)/2+1,easeInBounce:e=>1-As(1-e),easeOutBounce:As,easeInOutBounce:e=>e<.5?(1-As(1-2*e))/2:(1+As(2*e-1))/2},Os=gs({},{tension:170,friction:26},{mass:1,damping:1,easing:Ds.linear,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,Os)}}function Fs(e,t){if(Pi.und(t.decay)){const n=!Pi.und(t.tension)||!Pi.und(t.friction);!n&&Pi.und(t.frequency)&&Pi.und(t.damping)&&Pi.und(t.mass)||(e.duration=void 0,e.decay=void 0),n&&(e.frequency=void 0)}else e.duration=void 0}const Vs=[];class Hs{constructor(){this.changed=!1,this.values=Vs,this.toValues=null,this.fromValues=Vs,this.to=void 0,this.from=void 0,this.config=new zs,this.immediate=!1}}function Gs(e,{key:t,props:n,defaultProps:o,state:r,actions:l}){return new Promise(((i,a)=>{var s;let c,u,d=vs(null!=(s=n.cancel)?s:null==o?void 0:o.cancel,t);if(d)f();else{Pi.und(n.pause)||(r.paused=vs(n.pause,t));let e=null==o?void 0:o.pause;!0!==e&&(e=r.paused||vs(e,t)),c=hs(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-di.now()}function m(){c>0&&!ji.skipAnimation?(r.delayed=!0,u=di.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(gs({},n,{callId:e,cancel:d}),i)}catch(e){a(e)}}}))}const Us=(e,t)=>1==t.length?t[0]:t.some((e=>e.cancelled))?$s(e.get()):t.every((e=>e.noop))?Ws(e.get()):js(e.get(),t.every((e=>e.finished))),Ws=e=>({value:e,noop:!0,finished:!0,cancelled:!1}),js=(e,t,n=!1)=>({value:e,finished:t,cancelled:n}),$s=e=>({value:e,cancelled:!0,finished:!1});function Ks(e,t,n,o){const{callId:r,parentId:l,onRest:i}=t,{asyncTo:a,promise:s}=n;return l||e!==a||t.reset?n.promise=(async()=>{n.asyncId=r,n.asyncTo=e;const c=ys(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)&&$s(o)||r!==n.asyncId&&js(o,!1);if(t)throw e.result=t,d(e),e},f=(e,t)=>{const l=new Ys,i=new Zs;return(async()=>{if(ji.skipAnimation)throw qs(n),i.result=js(o,!1),d(i),i;m(l);const a=Pi.obj(e)?gs({},e):gs({},t,{to:e});a.parentId=r,Ri(c,((e,t)=>{Pi.und(a[t])&&(a[t]=e)}));const s=await o.start(a);return m(l),n.paused&&await new Promise((e=>{n.resumeQueue.add(e)})),s})()};let g;if(ji.skipAnimation)return qs(n),js(o,!1);try{let t;t=Pi.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=js(o.get(),!0,!1)}catch(e){if(e instanceof Ys)g=e.result;else{if(!(e instanceof Zs))throw e;g=e.result}}finally{r==n.asyncId&&(n.asyncId=l,n.asyncTo=l?a:void 0,n.promise=l?s:void 0)}return Pi.fun(i)&&di.batchedUpdates((()=>{i(g,o,o.item)})),g})():s}function qs(e,t){Di(e.timeouts,(e=>e.cancel())),e.pauseQueue.clear(),e.resumeQueue.clear(),e.asyncId=e.asyncTo=e.promise=void 0,t&&(e.cancelId=t)}class Ys 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 Zs extends Error{constructor(){super("SkipAnimationSignal"),this.result=void 0}}const Qs=e=>e instanceof Js;let Xs=1;class Js extends Ia{constructor(...e){super(...e),this.id=Xs++,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=Ja(this);return e&&e.getValue()}to(...e){return ji.to(this,e)}interpolate(...e){return Wa(`${Ga}The "interpolate" function is deprecated in v9 (use "to" instead)`),ji.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){Ba(this,{type:"change",parent:this,value:e,idle:t})}_onPriorityChange(e){this.idle||Zi.sort(this),Ba(this,{type:"priority",parent:this,priority:e})}}const ec=Symbol.for("SpringPhase"),tc=e=>(1&e[ec])>0,nc=e=>(2&e[ec])>0,oc=e=>(4&e[ec])>0,rc=(e,t)=>t?e[ec]|=3:e[ec]&=-3,lc=(e,t)=>t?e[ec]|=4:e[ec]&=-5;class ic extends Js{constructor(e,t){if(super(),this.key=void 0,this.animation=new Hs,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,!Pi.und(e)||!Pi.und(t)){const n=Pi.obj(e)?gs({},e):gs({},t,{from:e});Pi.und(n.default)&&(n.default=!0),this.start(n)}}get idle(){return!(nc(this)||this._state.asyncTo)||oc(this)}get goal(){return wa(this.animation.to)}get velocity(){const e=Ja(this);return e instanceof os?e.lastVelocity||0:e.getPayload().map((e=>e.lastVelocity||0))}get hasAnimated(){return tc(this)}get isAnimating(){return nc(this)}get isPaused(){return oc(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=ts(o.to);!i&&Ca(o.to)&&(l=Ai(wa(o.to))),o.values.forEach(((a,s)=>{if(a.done)return;const c=a.constructor==rs?1:i?i[s].lastPosition:l[s];let u=o.immediate,d=c;if(!u){if(d=a.lastPosition,r.tension<=0)return void(a.done=!0);let t=a.elapsedTime+=e;const n=o.fromValues[s],l=null!=a.v0?a.v0:a.v0=Pi.arr(r.velocity)?r.velocity[s]:r.velocity;let i;const p=r.precision||(n==c?.005:Math.min(1,.001*Math.abs(c-n)));if(Pi.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(a.lastPosition-d)<=p,i=l*o}else{i=null==a.lastVelocity?l:a.lastVelocity;const t=r.restVelocity||p/10,o=r.clamp?0:r.bounce,s=!Pi.und(o),m=n==c?a.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)>t,f||(u=Math.abs(c-d)<=p,!u));++e){s&&(g=d==c||d>c==m,g&&(i=-i*o,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,a.durationProgress>0&&(a.elapsedTime=r.duration*a.durationProgress,t=a.elapsedTime+=e)),o=(r.progress||0)+t/this._memoizedDuration,o=o>1?1:o<0?0:o,a.durationProgress=o),d=n+r.easing(o)*(c-n),i=(d-a.lastPosition)/e,u=1==o}a.lastVelocity=i,Number.isNaN(d)&&(console.warn("Got NaN while animating:",this),u=!0)}i&&!i[s].done&&(u=!1),u?a.done=!0:t=!1,a.setValue(d,r.round)&&(n=!0)}));const a=Ja(this),s=a.getValue();if(t){const e=wa(o.to);s===e&&!n||r.decay?n&&r.decay&&this._onChange(s):(a.setValue(e),this._onChange(e)),this._stop()}else n&&this._onChange(s)}set(e){return di.batchedUpdates((()=>{this._stop(),this._focus(e),this._set(e)})),this}pause(){this._update({pause:!0})}resume(){this._update({pause:!1})}finish(){if(nc(this)){const{to:e,config:t}=this.animation;di.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 Pi.und(e)?(n=this.queue||[],this.queue=[]):n=[Pi.obj(e)?e:gs({},t,{to:e})],Promise.all(n.map((e=>this._update(e)))).then((e=>Us(this,e)))}stop(e){const{to:t}=this.animation;return this._focus(this.get()),qs(this._state,e&&this._lastCallId),di.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=Pi.obj(n)?n[t]:n,(null==n||Is(n))&&(n=void 0),o=Pi.obj(o)?o[t]:o,null==o&&(o=void 0);const r={to:n,from:o};return tc(this)||(e.reverse&&([n,o]=[o,n]),o=wa(o),Pi.und(o)?Ja(this)||this._set(n):this._set(o)),r}_update(e,t){let n=gs({},e);const{key:o,defaultProps:r}=this;n.default&&Object.assign(r,ys(n,((e,t)=>/^on/.test(t)?bs(e,o):e))),mc(this,n,"onProps"),fc(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 Gs(++this._lastCallId,{key:o,props:n,defaultProps:r,state:i,actions:{pause:()=>{oc(this)||(lc(this,!0),Oi(i.pauseQueue),fc(this,"onPause",js(this,ac(this,this.animation.to)),this))},resume:()=>{oc(this)&&(lc(this,!1),nc(this)&&this._resume(),Oi(i.resumeQueue),fc(this,"onResume",js(this,ac(this,this.animation.to)),this))},start:this._merge.bind(this,l)}}).then((e=>{if(n.loop&&e.finished&&(!t||!e.noop)){const e=sc(n);if(e)return this._update(e,!0)}return e}))}_merge(e,t,n){if(t.cancel)return this.stop(!0),n($s(this));const o=!Pi.und(e.to),r=!Pi.und(e.from);if(o||r){if(!(t.callId>this._lastToId))return n($s(this));this._lastToId=t.callId}const{key:l,defaultProps:i,animation:a}=this,{to:s,from:c}=a;let{to:u=s,from:d=c}=e;!r||o||t.default&&!Pi.und(u)||(u=d),t.reverse&&([u,d]=[d,u]);const p=!Mi(d,c);p&&(a.from=d),d=wa(d);const m=!Mi(u,s);m&&this._focus(u);const f=Is(t.to),{config:g}=a,{decay:h,velocity:v}=g;(o||r)&&(g.velocity=0),t.config&&!f&&function(e,t,n){n&&(Fs(n=gs({},n),t),t=gs({},n,t)),Fs(e,t),Object.assign(e,t);for(const t in Os)null==e[t]&&(e[t]=Os[t]);let{mass:o,frequency:r,damping:l}=e;Pi.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,hs(t.config,l),t.config!==i.config?hs(i.config,l):void 0);let b=Ja(this);if(!b||Pi.und(u))return n(js(this,!0));const _=Pi.und(t.reset)?r&&!t.default:!Pi.und(d)&&vs(t.reset,l),k=_?d:this.get(),y=Ss(u),E=Pi.num(y)||Pi.arr(y)||$a(y),C=!f&&(!E||vs(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 w=b.constructor;let S=Ca(u),B=!1;if(!S){const e=_||!tc(this)&&p;(m||e)&&(B=Mi(Ss(k),y),S=!B),(Mi(a.immediate,C)||C)&&Mi(g.decay,h)&&Mi(g.velocity,v)||(S=!0)}if(B&&nc(this)&&(a.changed&&!_?S=!0:S||this._stop(s)),!f&&((S||Ca(s))&&(a.values=b.getPayload(),a.toValues=Ca(u)?null:w==rs?[1]:Ai(y)),a.immediate!=C&&(a.immediate=C,C||_||this._set(s)),S)){const{onRest:e}=a;Li(pc,(e=>mc(this,t,e)));const o=js(this,ac(this,s));Oi(this._pendingCalls,o),this._pendingCalls.add(n),a.changed&&di.batchedUpdates((()=>{a.changed=!_,null==e||e(o,this),_?hs(i.onRest,o):null==a.onStart||a.onStart(o,this)}))}_&&this._set(k),f?n(Ks(t.to,t,this._state,this)):S?this._start():nc(this)&&!m?this._pendingCalls.add(n):n(Ws(k))}_focus(e){const t=this.animation;e!==t.to&&(Sa(this)&&this._detach(),t.to=e,Sa(this)&&this._attach())}_attach(){let e=0;const{to:t}=this.animation;Ca(t)&&(Ta(t,this),Qs(t)&&(e=t.priority+1)),this.priority=e}_detach(){const{to:e}=this.animation;Ca(e)&&Na(e,this)}_set(e,t=!0){const n=wa(e);if(!Pi.und(n)){const e=Ja(this);if(!e||!Mi(n,e.getValue())){const o=cs(n);e&&e.constructor==o?e.setValue(n):es(this,o.create(n)),e&&di.batchedUpdates((()=>{this._onChange(n,t)}))}}return Ja(this)}_onStart(){const e=this.animation;e.changed||(e.changed=!0,fc(this,"onStart",js(this,ac(this,e.to)),this))}_onChange(e,t){t||(this._onStart(),hs(this.animation.onChange,e,this)),hs(this.defaultProps.onChange,e,this),super._onChange(e,t)}_start(){const e=this.animation;Ja(this).reset(wa(e.to)),e.immediate||(e.fromValues=e.values.map((e=>e.lastPosition))),nc(this)||(rc(this,!0),oc(this)||this._resume())}_resume(){ji.skipAnimation?this.finish():Zi.start(this)}_stop(e,t){if(nc(this)){rc(this,!1);const n=this.animation;Li(n.values,(e=>{e.done=!0})),n.toValues&&(n.onChange=n.onPause=n.onResume=void 0),Ba(this,{type:"idle",parent:this});const o=t?$s(this.get()):js(this.get(),ac(this,null!=e?e:n.to));Oi(this._pendingCalls,o),n.changed&&(n.changed=!1,fc(this,"onRest",o,this))}}}function ac(e,t){const n=Ss(t);return Mi(Ss(e.get()),n)}function sc(e,t=e.loop,n=e.to){let o=hs(t);if(o){const r=!0!==o&&ws(o),l=(r||e).reverse,i=!r||r.reset;return cc(gs({},e,{loop:t,default:!1,pause:void 0,to:!l||Is(n)?n:void 0,from:i?e.from:void 0,reset:i},r))}}function cc(e){const{to:t,from:n}=e=ws(e),o=new Set;return Pi.obj(t)&&dc(t,o),Pi.obj(n)&&dc(n,o),e.keys=o.size?Array.from(o):null,e}function uc(e){const t=cc(e);return Pi.und(t.default)&&(t.default=ys(t)),t}function dc(e,t){Ri(e,((e,n)=>null!=e&&t.add(n)))}const pc=["onStart","onRest","onChange","onPause","onResume"];function mc(e,t,n){e.animation[n]=t[n]!==_s(t,n)?bs(t[n],e.key):void 0}function fc(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 gc=["onStart","onChange","onRest"];let hc=1;class vc{constructor(e,t){this.id=hc++,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(gs({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];Pi.und(n)||this.springs[t].set(n)}}update(e){return e&&this.queue.push(cc(e)),this}start(e){let{queue:t}=this;return e?t=Ai(e).map(cc):this.queue=[],this._flush?this._flush(this,t):(wc(this,t),bc(this,t))}stop(e,t){if(e!==!!e&&(t=e),t){const n=this.springs;Li(Ai(t),(t=>n[t].stop(!!e)))}else qs(this._state,this._lastAsyncId),this.each((t=>t.stop(!!e)));return this}pause(e){if(Pi.und(e))this.start({pause:!0});else{const t=this.springs;Li(Ai(e),(e=>t[e].pause()))}return this}resume(e){if(Pi.und(e))this.start({pause:!1});else{const t=this.springs;Li(Ai(e),(e=>t[e].resume()))}return this}each(e){Ri(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,Di(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&&Di(t,(([e,t])=>{t.value=i,e(t,this,this._item)})),l&&(this._started=!1,Di(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)}di.onFrame(this._onFrame)}}function bc(e,t){return Promise.all(t.map((t=>_c(e,t)))).then((t=>Us(e,t)))}async function _c(e,t,n){const{keys:o,to:r,from:l,loop:i,onRest:a,onResolve:s}=t,c=Pi.obj(t.default)&&t.default;i&&(t.loop=!1),!1===r&&(t.to=null),!1===l&&(t.from=null);const u=Pi.arr(r)||Pi.fun(r)?r:void 0;u?(t.to=void 0,t.onRest=void 0,c&&(c.onRest=void 0)):Li(gc,(n=>{const o=t[n];if(Pi.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===_s(t,"cancel");(u||m&&d.asyncId)&&p.push(Gs(++e._lastAsyncId,{props:t,state:d,actions:{pause:Ni,resume:Ni,start(t,n){m?(qs(d,e._lastAsyncId),n($s(e))):(t.onRest=a,n(Ks(u,t,d,e)))}}})),d.paused&&await new Promise((e=>{d.resumeQueue.add(e)}));const f=Us(e,await Promise.all(p));if(i&&f.finished&&(!n||!f.noop)){const n=sc(t,i,r);if(n)return wc(e,[n]),_c(e,n,!0)}return s&&di.batchedUpdates((()=>s(f,e,e.item))),f}function kc(e,t){const n=gs({},e.springs);return t&&Li(Ai(t),(e=>{Pi.und(e.keys)&&(e=cc(e)),Pi.obj(e.to)||(e=gs({},e,{to:void 0})),Cc(n,e,(e=>Ec(e)))})),yc(e,n),n}function yc(e,t){Ri(t,((t,n)=>{e.springs[n]||(e.springs[n]=t,Ta(t,e))}))}function Ec(e,t){const n=new ic;return n.key=e,t&&Ta(n,t),n}function Cc(e,t,n){t.keys&&Li(t.keys,(o=>{(e[o]||(e[o]=n(o)))._prepareNode(t)}))}function wc(e,t){Li(t,(t=>{Cc(e.springs,t,(t=>Ec(t,e)))}))}function Sc(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 Bc=["children"],Ic=e=>{let{children:t}=e,n=Sc(e,Bc);const o=(0,xi.useContext)(xc),r=n.pause||!!o.pause,l=n.immediate||!!o.immediate;n=function(e,t){const[n]=(0,xi.useState)((()=>({inputs:t,result:e()}))),o=(0,xi.useRef)(),r=o.current;let l=r;if(l){const n=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));n||(l={inputs:t,result:e()})}else l=n;return(0,xi.useEffect)((()=>{o.current=l,r==n&&(n.inputs=n.result=void 0)}),[l]),l.result}((()=>({pause:r,immediate:l})),[r,l]);const{Provider:i}=xc;return xi.createElement(i,{value:n},t)},xc=(Tc=Ic,Nc={},Object.assign(Tc,xi.createContext(Nc)),Tc.Provider._context=Tc,Tc.Consumer._context=Tc,Tc);var Tc,Nc;Ic.Provider=xc.Provider,Ic.Consumer=xc.Consumer;const Pc=()=>{const e=[],t=function(t){ja(`${Ga}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 Li(e,((e,r)=>{if(Pi.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 Li(e,(e=>e.pause(...arguments))),this},t.resume=function(){return Li(e,(e=>e.resume(...arguments))),this},t.set=function(t){Li(e,(e=>e.set(t)))},t.start=function(t){const n=[];return Li(e,((e,o)=>{if(Pi.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 Li(e,(e=>e.stop(...arguments))),this},t.update=function(t){return Li(e,((e,n)=>e.update(this._getProps(t,e,n)))),this};const n=function(e,t,n){return Pi.fun(e)?e(n,t):e};return t._getProps=n,t};function Mc(e,t,n){const o=Pi.fun(t)&&t;o&&!n&&(n=[]);const r=(0,xi.useMemo)((()=>o||3==arguments.length?Pc():void 0),[]),l=(0,xi.useRef)(0),i=qa(),a=(0,xi.useMemo)((()=>({ctrls:[],queue:[],flush(e,t){const n=kc(e,t);return l.current>0&&!a.queue.length&&!Object.keys(n).some((t=>!e.springs[t]))?bc(e,t):new Promise((o=>{yc(e,n),a.queue.push((()=>{o(bc(e,t))})),i()}))}})),[]),s=(0,xi.useRef)([...a.ctrls]),c=[],u=Qa(e)||0;function d(e,n){for(let r=e;r<n;r++){const e=s.current[r]||(s.current[r]=new vc(null,a.flush)),n=o?o(r,e):t[r];n&&(c[r]=uc(n))}}(0,xi.useMemo)((()=>{Li(s.current.slice(e,u),(e=>{xs(e,r),e.stop(!0)})),s.current.length=e,d(u,e)}),[e]),(0,xi.useMemo)((()=>{d(0,Math.min(u,e))}),n);const p=s.current.map(((e,t)=>kc(e,c[t]))),m=(0,xi.useContext)(Ic),f=Qa(m),g=m!==f&&Bs(m);Ka((()=>{l.current++,a.ctrls=s.current;const{queue:e}=a;e.length&&(a.queue=[],Li(e,(e=>e()))),Li(s.current,((e,t)=>{null==r||r.add(e),g&&e.start({default:m});const n=c[t];n&&(Ts(e,n.ref),e.ref?e.queue.push(n):e.start(n))}))})),Ya((()=>()=>{Li(a.ctrls,(e=>e.stop(!0)))}));const h=p.map((e=>gs({},e)));return r?[h,r]:h}function Lc(e,t){const n=Pi.fun(e),[[o],r]=Mc(1,n?e:[e],n?t||[]:t);return n||2==arguments.length?[o,r]:o}let Rc;!function(e){e.MOUNT="mount",e.ENTER="enter",e.UPDATE="update",e.LEAVE="leave"}(Rc||(Rc={}));class Ac extends Js{constructor(e,t){super(),this.key=void 0,this.idle=!0,this.calc=void 0,this._active=new Set,this.source=e,this.calc=_a(...t);const n=this._get(),o=cs(n);es(this,o.create(n))}advance(e){const t=this._get();Mi(t,this.get())||(Ja(this).setValue(t),this._onChange(t,this.idle)),!this.idle&&Oc(this._active)&&zc(this)}_get(){const e=Pi.arr(this.source)?this.source.map(wa):Ai(wa(this.source));return this.calc(...e)}_start(){this.idle&&!Oc(this._active)&&(this.idle=!1,Li(ts(this),(e=>{e.done=!1})),ji.skipAnimation?(di.batchedUpdates((()=>this.advance())),zc(this)):Zi.start(this))}_attach(){let e=1;Li(Ai(this.source),(t=>{Ca(t)&&Ta(t,this),Qs(t)&&(t.idle||this._active.add(t),e=Math.max(e,t.priority+1))})),this.priority=e,this._start()}_detach(){Li(Ai(this.source),(e=>{Ca(e)&&Na(e,this)})),this._active.clear(),zc(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=Ai(this.source).reduce(((e,t)=>Math.max(e,(Qs(t)?t.priority:0)+1)),0))}}function Dc(e){return!1!==e.idle}function Oc(e){return!e.size||Array.from(e).every(Dc)}function zc(e){e.idle||(e.idle=!0,Li(ts(e),(e=>{e.done=!0})),Ba(e,{type:"idle",parent:e}))}ji.assign({createStringInterpolator:Ha,to:(e,t)=>new Ac(e,t)});Zi.advance;var Fc=window.ReactDOM;function Vc(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 Hc=["style","children","scrollTop","scrollLeft"],Gc=/^--/;function Uc(e,t){return null==t||"boolean"==typeof t||""===t?"":"number"!=typeof t||0===t||Gc.test(e)||jc.hasOwnProperty(e)&&jc[e]?(""+t).trim():t+"px"}const Wc={};let jc={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 $c=["Webkit","Ms","Moz","O"];jc=Object.keys(jc).reduce(((e,t)=>($c.forEach((n=>e[((e,t)=>e+t.charAt(0).toUpperCase()+t.substring(1))(n,t)]=e[t])),e)),jc);const Kc=["x","y","z"],qc=/^(matrix|translate|scale|rotate|skew)/,Yc=/^(translate)/,Zc=/^(rotate|skew)/,Qc=(e,t)=>Pi.num(e)&&0!==e?e+t:e,Xc=(e,t)=>Pi.arr(e)?e.every((e=>Xc(e,t))):Pi.num(e)?e===t:parseFloat(e)===t;class Jc extends is{constructor(e){let{x:t,y:n,z:o}=e,r=Vc(e,Kc);const l=[],i=[];(t||n||o)&&(l.push([t||0,n||0,o||0]),i.push((e=>[`translate3d(${e.map((e=>Qc(e,"px"))).join(",")})`,Xc(e,0)]))),Ri(r,((e,t)=>{if("transform"===t)l.push([e||""]),i.push((e=>[e,""===e]));else if(qc.test(t)){if(delete r[t],Pi.und(e))return;const n=Yc.test(t)?"px":Zc.test(t)?"deg":"";l.push(Ai(e)),i.push("rotate3d"===t?([e,t,o,r])=>[`rotate3d(${e},${t},${o},${Qc(r,n)})`,Xc(r,0)]:e=>[`${t}(${e.map((e=>Qc(e,n))).join(",")})`,Xc(e,t.startsWith("scale")?1:0)])}})),l.length&&(r.transform=new eu(l,i)),super(r)}}class eu extends Ia{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 Li(this.inputs,((n,o)=>{const r=wa(n[0]),[l,i]=this.transforms[o](Pi.arr(r)?r:n.map(wa));e+=" "+l,t=t&&i})),t?"none":e}observerAdded(e){1==e&&Li(this.inputs,(e=>Li(e,(e=>Ca(e)&&Ta(e,this)))))}observerRemoved(e){0==e&&Li(this.inputs,(e=>Li(e,(e=>Ca(e)&&Na(e,this)))))}eventObserved(e){"change"==e.type&&(this._value=null),Ba(this,e)}}const tu=["scrollTop","scrollLeft"];ji.assign({batchedUpdates:Fc.unstable_batchedUpdates,createStringInterpolator:Ha,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 nu=((e,{applyAnimatedValues:t=(()=>!1),createAnimatedStyle:n=(e=>new is(e)),getComponentProps:o=(e=>e)}={})=>{const r={applyAnimatedValues:t,createAnimatedStyle:n,getComponentProps:o},l=e=>{const t=fs(e)||"Anonymous";return(e=Pi.str(e)?l[e]||(l[e]=ds(e,r)):e[ms]||(e[ms]=ds(e,r))).displayName=`Animated(${t})`,e};return Ri(e,((t,n)=>{Pi.arr(e)&&(n=fs(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:a}=o,s=Vc(o,Hc),c=Object.values(s),u=Object.keys(s).map((t=>n||e.hasAttribute(t)?t:Wc[t]||(Wc[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=Uc(t,r[t]);Gc.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!==a&&(e.scrollLeft=a)},createAnimatedStyle:e=>new Jc(e),getComponentProps:e=>Vc(e,tu)}),ou=nu.animated,ru=e=>e+1,lu=e=>({top:e.offsetTop,left:e.offsetLeft});var iu=function(e){let{isSelected:t,adjustScrolling:n,enableAnimation:o,triggerAnimationOnChange:r}=e;const l=(0,a.useRef)(),i=(0,d.useReducedMotion)()||!o,[s,c]=(0,a.useReducer)(ru,0),[u,p]=(0,a.useReducer)(ru,0),[m,f]=(0,a.useState)({x:0,y:0}),g=(0,a.useMemo)((()=>l.current?lu(l.current):null),[r]),h=(0,a.useMemo)((()=>{if(!n||!l.current)return()=>{};const e=(0,Wl.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]);return(0,a.useLayoutEffect)((()=>{s&&p()}),[s]),(0,a.useLayoutEffect)((()=>{if(!g)return;if(i)return void h();l.current.style.transform=void 0;const e=lu(l.current);c(),f({x:Math.round(g.left-e.left),y:Math.round(g.top-e.top)})}),[r]),Lc({from:{x:m.x,y:m.y},to:{x:0,y:0},reset:s!==u,config:{mass:5,tension:2e3,friction:200},immediate:i,onChange:function(e){let{value:n}=e;if(!l.current)return;let{x:o,y:r}=n;o=Math.round(o),r=Math.round(r);const i=0===o&&0===r;l.current.style.transformOrigin="center center",l.current.style.transform=i?void 0:`translate3d(${o}px,${r}px,0)`,l.current.style.zIndex=t?"1":"",h()}}),l};const au=".block-editor-block-list__block",su=".block-list-appender",cu=".block-editor-button-block-appender";function uu(e,t){return t.closest([au,su,cu].join(","))===e}function du(e){for(;e&&e.nodeType!==e.ELEMENT_NODE;)e=e.parentNode;if(!e)return;const t=e.closest(au);return t?t.id.slice("block-".length):void 0}function pu(e){const t=(0,a.useRef)(),n=function(e){return(0,p.useSelect)((t=>{const{getSelectedBlocksInitialCaretPosition:n,__unstableGetEditorMode:o,isBlockSelected:r}=t(so);if(r(e)&&"edit"===o())return n()}),[e])}(e),{isBlockSelected:o,isMultiSelecting:r}=(0,p.useSelect)(so);return(0,a.useEffect)((()=>{if(!o(e)||r())return;if(null==n)return;if(!t.current)return;const{ownerDocument:l}=t.current;if(uu(t.current,l.activeElement))return;const i=Wl.focus.tabbable.find(t.current).filter((e=>(0,Wl.isTextField)(e))),a=-1===n,s=i[a?i.length-1:0]||t.current;if(uu(t.current,s)){if(!t.current.getAttribute("contenteditable")){const e=Wl.focus.tabbable.findNext(t.current);if(e&&uu(t.current,e)&&(0,Wl.isFormElement)(e))return void e.focus()}(0,Wl.placeCaretAtHorizontalEdge)(s,a)}else t.current.focus()}),[n,e]),t}function mu(e){if(e.defaultPrevented)return;const t="mouseover"===e.type?"add":"remove";e.preventDefault(),e.currentTarget.classList[t]("is-hovered")}function fu(){const e=(0,p.useSelect)((e=>{const{getSettings:t}=e(so);return t().outlineMode}),[]);return(0,d.useRefEffect)((t=>{if(e)return t.addEventListener("mouseout",mu),t.addEventListener("mouseover",mu),()=>{t.removeEventListener("mouseout",mu),t.removeEventListener("mouseover",mu),t.classList.remove("is-hovered")}}),[e])}function gu(e){return(0,p.useSelect)((t=>{const{isBlockBeingDragged:n,isBlockHighlighted:o,isBlockSelected:l,isBlockMultiSelected:i,getBlockName:a,getSettings:s,hasSelectedInnerBlock:u,isTyping:d,__unstableIsFullySelected:p,__unstableSelectionHasUnmergeableBlock:m}=t(so),{outlineMode:f}=s(),g=n(e),h=l(e),v=a(e),b=u(e,!0),_=i(e);return c()({"is-selected":h,"is-highlighted":o(e),"is-multi-selected":_,"is-partially-selected":_&&!p()&&!m(),"is-reusable":(0,r.isReusableBlock)((0,r.getBlockType)(v)),"is-dragging":g,"has-child-selected":b,"remove-outline":h&&f&&d()})}),[e])}function hu(e){return(0,p.useSelect)((t=>{const n=t(so).getBlockName(e),o=(0,r.getBlockType)(n);if((null==o?void 0:o.apiVersion)>1)return(0,r.getBlockDefaultClassName)(n)}),[e])}function vu(e){return(0,p.useSelect)((t=>{const{getBlockName:n,getBlockAttributes:o}=t(so),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 bu(e){return(0,p.useSelect)((t=>{const{hasBlockMovingClientId:n,canInsertBlockType:o,getBlockName:r,getBlockRootClientId:l,isBlockSelected:i}=t(so);if(!i(e))return;const a=n();return a?c()("is-block-moving-mode",{"can-insert-moving-block":o(r(a),l(e))}):void 0}),[e])}function _u(e){const{isBlockSelected:t}=(0,p.useSelect)(so),{selectBlock:n,selectionChange:o}=(0,p.useDispatch)(so);return(0,d.useRefEffect)((r=>{function l(l){r.parentElement.closest('[contenteditable="true"]')||(t(e)?l.target.isContentEditable||o(e):uu(r,l.target)&&n(e))}return r.addEventListener("focusin",l),()=>{r.removeEventListener("focusin",l)}}),[t,n])}var ku=window.wp.keycodes;function yu(e){const t=(0,p.useSelect)((t=>t(so).isBlockSelected(e)),[e]),{getBlockRootClientId:n,getBlockIndex:o}=(0,p.useSelect)(so),{insertDefaultBlock:r,removeBlock:l}=(0,p.useDispatch)(so);return(0,d.useRefEffect)((i=>{if(t)return i.addEventListener("keydown",a),i.addEventListener("dragstart",s),()=>{i.removeEventListener("keydown",a),i.removeEventListener("dragstart",s)};function a(t){const{keyCode:a,target:s}=t;a!==ku.ENTER&&a!==ku.BACKSPACE&&a!==ku.DELETE||s!==i||(0,Wl.isTextField)(s)||(t.preventDefault(),a===ku.ENTER?r({},n(e),o(e)+1):l(e))}function s(e){e.preventDefault()}}),[e,t,n,o,r,l])}function Eu(e){const{isNavigationMode:t,isBlockSelected:n}=(0,p.useSelect)(so),{setNavigationMode:o,selectBlock:r}=(0,p.useDispatch)(so);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 Cu(){const e=(0,a.useContext)(ih);return(0,d.useRefEffect)((t=>{if(e)return e.observe(t),()=>{e.unobserve(t)}}),[e])}function wu(e){return(0,p.useSelect)((t=>{const{__unstableHasActiveBlockOverlayActive:n}=t(so);return n(e)}),[e])}function Su(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{__unstableIsHtml:t}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{clientId:n,className:o,wrapperProps:l={},isAligned:i}=(0,a.useContext)(Bu),{index:s,mode:u,name:m,blockApiVersion:f,blockTitle:h,isPartOfSelection:v,adjustScrolling:b,enableAnimation:_}=(0,p.useSelect)((e=>{const{getBlockIndex:t,getBlockMode:o,getBlockName:l,isTyping:i,getGlobalBlockCount:a,isBlockSelected:s,isBlockMultiSelected:c,isAncestorMultiSelected:u,isFirstMultiSelectedBlock:d}=e(so),p=s(n),m=c(n)||u(n),f=l(n),g=(0,r.getBlockType)(f);return{index:t(n),mode:o(n),name:f,blockApiVersion:(null==g?void 0:g.apiVersion)||1,blockTitle:null==g?void 0:g.title,isPartOfSelection:p||m,adjustScrolling:p||d(n),enableAnimation:!i()&&a()<=200}}),[n]),k=wu(n),y=(0,g.sprintf)((0,g.__)("Block: %s"),h),E="html"!==u||t?"":"-visual",C=(0,d.useMergeRefs)([e.ref,pu(n),Po(n),_u(n),yu(n),Eu(n),fu(),Cu(),iu({isSelected:v,adjustScrolling:b,enableAnimation:_,triggerAnimationOnChange:s}),(0,d.useDisabled)({isDisabled:!k})]),w=mo();return f<2&&n===w.clientId&&"undefined"!=typeof process&&process.env,{tabIndex:0,...l,...e,ref:C,id:`block-${n}${E}`,role:"document","aria-label":y,"data-block":n,"data-type":m,"data-title":h,className:c()(c()("block-editor-block-list__block",{"wp-block":!i,"has-block-overlay":k}),o,e.className,l.className,gu(n),hu(n),vu(n),bu(n)),style:{...l.style,...e.style}}}Su.save=r.__unstableGetBlockProps;const Bu=(0,a.createContext)();function Iu(e){let{children:t,isHtml:n,...o}=e;return(0,a.createElement)("div",Su(o,{__unstableIsHtml:n}),t)}const xu=(0,p.withSelect)(((e,t)=>{let{clientId:n,rootClientId:o}=t;const{isBlockSelected:r,getBlockMode:l,isSelectionEnabled:i,getTemplateLock:a,__unstableGetBlockWithoutInnerBlocks:s,canRemoveBlock:c,canMoveBlock:u}=e(so),d=s(n),p=r(n),m=a(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}})),Tu=(0,p.withDispatch)(((e,t,n)=>{let{select:o}=n;const{updateBlockAttributes:l,insertBlocks:i,mergeBlocks:a,replaceBlocks:s,toggleSelection:c,__unstableMarkLastChangeAsPersistent:u}=e(so);return{setAttributes(e){const{getMultiSelectedBlockClientIds:n}=o(so),r=n(),{clientId:i}=t,a=r.length?r:[i];l(a,e)},onInsertBlocks(e,n){const{rootClientId:o}=t;i(e,n,o)},onInsertBlocksAfter(e){const{clientId:n,rootClientId:r}=t,{getBlockIndex:l}=o(so),a=l(n);i(e,a+1,r)},onMerge(e){const{clientId:n,rootClientId:l}=t,{getPreviousBlockClientId:i,getNextBlockClientId:c,getBlock:u}=o(so);if(e){const e=c(n);e&&a(n,e)}else{const e=i(n);if(e)a(e,n);else if(l){const e=(0,r.switchToBlockType)(u(l),"*");e&&e.length&&s(l,e,0)}}},onReplace(e,n,o){e.length&&!(0,r.isUnmodifiedDefaultBlock)(e[e.length-1])&&u(),s([t.clientId],e,n,o)},toggleSelection(e){c(e)}}}));var Nu=(0,d.compose)(d.pure,xu,Tu,(0,d.ifCondition)((e=>{let{block:t}=e;return!!t})),(0,m.withFilters)("editor.BlockListBlock"))((function(e){var t;let{block:{__unstableBlockSource:n},mode:o,isLocked:l,canRemove:i,clientId:s,isSelected:u,isSelectionEnabled:d,className:m,name:f,isValid:g,attributes:h,wrapperProps:v,setAttributes:b,onReplace:_,onInsertBlocksAfter:k,onMerge:y,toggleSelection:E}=e;const{themeSupportsLayout:C,hasContentLockedParent:w,isContentBlock:S,isContentLocking:B,isTemporarilyEditingAsBlocks:I}=(0,p.useSelect)((e=>{const{getSettings:t,__unstableGetContentLockingParent:n,getTemplateLock:o,__unstableGetTemporarilyEditingAsBlocks:l}=e(so),i=!!n(s);return{themeSupportsLayout:t().supportsLayout,isContentBlock:e(r.store).__experimentalHasContentRoleAttribute(f),hasContentLockedParent:i,isContentLocking:"contentOnly"===o(s)&&!i,isTemporarilyEditingAsBlocks:l()===s}}),[f,s]),{removeBlock:x}=(0,p.useDispatch)(so),T=(0,a.useCallback)((()=>x(s)),[s]);let N=(0,a.createElement)(Zl,{name:f,isSelected:u,attributes:h,setAttributes:b,insertBlocksAfter:l?void 0:k,onReplace:i?_:void 0,onRemove:i?T:void 0,mergeBlocks:i?y:void 0,clientId:s,isSelectionEnabled:d,toggleSelection:E});const P=(0,r.getBlockType)(f);w&&!S&&(v={...v,tabIndex:-1}),null!=P&&P.getEditWrapperProps&&(v=function(e,t){const n={...e,...t};return null!=e&&e.className&&null!=t&&t.className&&(n.className=c()(e.className,t.className)),null!=e&&e.style&&null!=t&&t.style&&(n.style={...e.style,...t.style}),n}(v,P.getEditWrapperProps(h)));const M=v&&!!v["data-align"]&&!C;let L;if(M&&(N=(0,a.createElement)("div",{className:"wp-block","data-align":v["data-align"]},N)),g)L="html"===o?(0,a.createElement)(a.Fragment,null,(0,a.createElement)("div",{style:{display:"none"}},N),(0,a.createElement)(Iu,{isHtml:!0},(0,a.createElement)(ci,{clientId:s}))):(null==P?void 0:P.apiVersion)>1?N:(0,a.createElement)(Iu,v,N);else{const e=n?(0,r.serializeRawBlock)(n):(0,r.getSaveContent)(P,h);L=(0,a.createElement)(Iu,{className:"has-warning"},(0,a.createElement)(oi,{clientId:s}),(0,a.createElement)(a.RawHTML,null,(0,Wl.safeHTML)(e)))}const{"data-align":R,...A}=null!==(t=v)&&void 0!==t?t:{},D={clientId:s,className:c()({"is-content-locked":B,"is-content-locked-temporarily-editing-as-blocks":I,"is-content-block":w&&S},R&&C&&`align${R}`,m),wrapperProps:A,isAligned:M},O=(0,a.useMemo)((()=>D),Object.values(D));return(0,a.createElement)(Bu.Provider,{value:O},(0,a.createElement)(ai,{fallback:(0,a.createElement)(Iu,{className:"has-warning"},(0,a.createElement)(li,null))},L))})),Pu=window.wp.htmlEntities;var Mu=(0,a.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(D.Path,{d:"M18 11.2h-5.2V6h-1.6v5.2H6v1.6h5.2V18h1.6v-5.2H18z"}));const Lu=[(0,a.createInterpolateElement)((0,g.__)("While writing, you can press <kbd>/</kbd> to quickly insert new blocks."),{kbd:(0,a.createElement)("kbd",null)}),(0,a.createInterpolateElement)((0,g.__)("Indent a list by pressing <kbd>space</kbd> at the beginning of a line."),{kbd:(0,a.createElement)("kbd",null)}),(0,a.createInterpolateElement)((0,g.__)("Outdent a list by pressing <kbd>backspace</kbd> at the beginning of a line."),{kbd:(0,a.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 Ru=function(){const[e]=(0,a.useState)(Math.floor(Math.random()*Lu.length));return(0,a.createElement)(m.Tip,null,Lu[e])};var Au=(0,a.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(D.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"}));var Du=(0,a.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:Au});const l=(0,a.createElement)(m.Icon,{icon:n&&n.src?n.src:n}),i=o?{backgroundColor:n&&n.background,color:n&&n.foreground}:{};return(0,a.createElement)("span",{style:i,className:c()("block-editor-block-icon",r,{"has-colors":o})},l)}));var Ou=function(e){let{title:t,icon:n,description:o,blockType:r}=e;return r&&(V()("`blockType` property in `BlockCard component`",{since:"5.7",alternative:"`title, icon and description` properties"}),({title:t,icon:n,description:o}=r)),(0,a.createElement)("div",{className:"block-editor-block-card"},(0,a.createElement)(Du,{icon:n,showColors:!0}),(0,a.createElement)("div",{className:"block-editor-block-card__content"},(0,a.createElement)("h2",{className:"block-editor-block-card__title"},t),(0,a.createElement)("span",{className:"block-editor-block-card__description"},o)))};const zu=(0,d.createHigherOrderComponent)((e=>(0,p.withRegistry)((t=>{let{useSubRegistry:n=!0,registry:o,...r}=t;if(!n)return(0,a.createElement)(e,i({registry:o},r));const[l,s]=(0,a.useState)(null);return(0,a.useEffect)((()=>{const e=(0,p.createRegistry)({},o);e.registerStore(io,ao),s(e)}),[o]),l?(0,a.createElement)(p.RegistryProvider,{value:l},(0,a.createElement)(e,i({registry:l},r))):null}))),"withRegistryProvider");const Fu=()=>{};function Vu(e){let{clientId:t=null,value:n,selection:o,onChange:l=Fu,onInput:i=Fu}=e;const s=(0,p.useRegistry)(),{resetBlocks:c,resetSelection:u,replaceInnerBlocks:d,setHasControlledInnerBlocks:m,__unstableMarkNextChangeAsNotPersistent:f}=s.dispatch(so),{getBlockName:g,getBlocks:h}=s.select(so),v=(0,p.useSelect)((e=>!t||e(so).areInnerBlocksControlled(t)),[t]),b=(0,a.useRef)({incoming:null,outgoing:[]}),_=(0,a.useRef)(!1),k=()=>{n&&(f(),t?s.batch((()=>{m(t,!0);const e=n.map((e=>(0,r.cloneBlock)(e)));_.current&&(b.current.incoming=e),f(),d(t,e)})):(_.current&&(b.current.incoming=n),c(n)))},y=(0,a.useRef)(i),E=(0,a.useRef)(l);(0,a.useEffect)((()=>{y.current=i,E.current=l}),[i,l]),(0,a.useEffect)((()=>{b.current.outgoing.includes(n)?b.current.outgoing[b.current.outgoing.length-1]===n&&(b.current.outgoing=[]):h(t)!==n&&(b.current.outgoing=[],k(),o&&u(o.selectionStart,o.selectionEnd,o.initialPosition))}),[n,t]),(0,a.useEffect)((()=>{v||(b.current.outgoing=[],k())}),[v]),(0,a.useEffect)((()=>{const{getSelectionStart:e,getSelectionEnd:n,getSelectedBlocksInitialCaretPosition:o,isLastBlockChangePersistent:r,__unstableIsLastBlockChangeIgnored:l,areInnerBlocksControlled:i}=s.select(so);let a=h(t),c=r(),u=!1;_.current=!0;const d=s.subscribe((()=>{if(null!==t&&null===g(t))return;if(!(!t||i(t)))return;const s=r(),d=h(t),p=d!==a;if(a=d,p&&(b.current.incoming||l()))return b.current.incoming=null,void(c=s);if(p||u&&!p&&s&&!c){c=s,b.current.outgoing.push(a);(c?E.current:y.current)(a,{selection:{selectionStart:e(),selectionEnd:n(),initialPosition:o()}})}u=p}));return()=>d()}),[s,t])}var Hu=zu((function(e){const{children:t,settings:n}=e,{updateSettings:o}=(0,p.useDispatch)(so);return(0,a.useEffect)((()=>{o(n)}),[n]),Vu(e),(0,a.createElement)(No,null,t)}));function Gu(e){let{onClick:t}=e;return(0,a.createElement)("div",{tabIndex:0,role:"button",onClick:t,onKeyPress:t},(0,a.createElement)(m.Disabled,null,(0,a.createElement)(sh,null)))}function Uu(){const{hasSelectedBlock:e,hasMultiSelection:t}=(0,p.useSelect)(so),{clearSelectedBlock:n}=(0,p.useDispatch)(so);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 Wu(e){return(0,a.createElement)("div",i({ref:Uu()},e))}function ju(e){const{isMultiSelecting:t,getMultiSelectedBlockClientIds:n,hasMultiSelection:o,getSelectedBlockClientId:r,getSelectedBlocksInitialCaretPosition:l,__unstableIsFullySelected:i}=e(so);return{isMultiSelecting:t(),multiSelectedBlockClientIds:n(),hasMultiSelection:o(),selectedBlockClientId:r(),initialPosition:l(),isFullSelection:i()}}function $u(){const{initialPosition:e,isMultiSelecting:t,multiSelectedBlockClientIds:n,hasMultiSelection:o,selectedBlockClientId:r,isFullSelection:l}=(0,p.useSelect)(ju,[]);return(0,d.useRefEffect)((r=>{const{ownerDocument:i}=r,{defaultView:a}=i;if(null==e)return;if(!o||t)return;const{length:s}=n;s<2||l&&(r.contentEditable=!0,r.focus(),a.getSelection().removeAllRanges())}),[o,t,n,r,e,l])}function Ku(e,t,n,o){let r,l=Wl.focus.focusable.find(n);return t&&l.reverse(),l=l.slice(l.indexOf(e)+1),o&&(r=e.getBoundingClientRect()),l.find((function(e){if(!Wl.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 qu(){const{getMultiSelectedBlocksStartClientId:e,getMultiSelectedBlocksEndClientId:t,getSettings:n,hasMultiSelection:o,__unstableIsFullySelected:r}=(0,p.useSelect)(so),{selectBlock:l}=(0,p.useDispatch)(so);return(0,d.useRefEffect)((i=>{let a;function s(){a=null}function c(s){const{keyCode:c,target:u}=s,d=c===ku.UP,p=c===ku.DOWN,m=c===ku.LEFT,f=c===ku.RIGHT,g=d||m,h=m||f,v=d||p,b=h||v,_=s.shiftKey,k=_||s.ctrlKey||s.altKey||s.metaKey,y=v?Wl.isVerticalEdge:Wl.isHorizontalEdge,{ownerDocument:E}=i,{defaultView:C}=E;if(o()){if(!r())return;if(s.defaultPrevented)return;if(!b)return;if(_)return;return s.preventDefault(),void(g?l(e()):l(t(),-1))}if(v?a||(a=(0,Wl.computeCaretRect)(C)):a=null,s.defaultPrevented)return;if(!b)return;if(!function(e,t,n){if((t===ku.UP||t===ku.DOWN)&&!n)return!0;const{tagName:o}=e;if("INPUT"===o)return["button","checkbox","color","file","image","radio","reset","submit"].includes(e.getAttribute("type"));return"TEXTAREA"!==o}(u,c,k))return;const w=(0,Wl.isRTL)(u)?!g:g,{keepCaretInsideBlock:S}=n();if(_)(function(e,t){const n=Ku(e,t,i);return n&&du(n)})(u,g)&&y(u,g)&&(i.contentEditable=!0,i.focus());else if(v&&(0,Wl.isVerticalEdge)(u,g)&&!S){const e=Ku(u,g,i,!0);e&&((0,Wl.placeCaretAtVerticalEdge)(e,g,a),s.preventDefault())}else if(h&&C.getSelection().isCollapsed&&(0,Wl.isHorizontalEdge)(u,w)&&!S){const e=Ku(u,w,i);(0,Wl.placeCaretAtHorizontalEdge)(e,g),s.preventDefault()}}return i.addEventListener("mousedown",s),i.addEventListener("keydown",c),()=>{i.removeEventListener("mousedown",s),i.removeEventListener("keydown",c)}}),[])}var Yu=window.wp.keyboardShortcuts;function Zu(){const{getBlockOrder:e,getSelectedBlockClientIds:t,getBlockRootClientId:n}=(0,p.useSelect)(so),{multiSelect:o,selectBlock:r}=(0,p.useDispatch)(so),l=(0,Yu.__unstableUseShortcutEventMatch)();return(0,d.useRefEffect)((i=>{function a(a){if(!l("core/block-editor/select-all",a))return;const s=t();if(s.length<2&&!(0,Wl.isEntirelySelected)(a.target))return;a.preventDefault();const[c]=s,u=n(c),d=e(u);s.length!==d.length?o(d[0],d[d.length-1]):u&&(i.ownerDocument.defaultView.getSelection().removeAllRanges(),r(u))}return i.addEventListener("keydown",a),()=>{i.removeEventListener("keydown",a)}}),[])}function Qu(e,t){e.contentEditable=t,t&&e.focus()}function Xu(){const{startMultiSelect:e,stopMultiSelect:t}=(0,p.useDispatch)(so),{isSelectionEnabled:n,hasMultiSelection:o,isDraggingBlocks:r}=(0,p.useSelect)(so);return(0,d.useRefEffect)((l=>{const{ownerDocument:i}=l,{defaultView:a}=i;let s,c;function u(){t(),a.removeEventListener("mouseup",u),c=a.requestAnimationFrame((()=>{if(o())return;Qu(l,!1);const e=a.getSelection();if(e.rangeCount){const{commonAncestorContainer:t}=e.getRangeAt(0);s.contains(t)&&s.focus()}}))}function d(t){let{buttons:o,target:c}=t;r()||1===o&&c.getAttribute("contenteditable")&&n()&&(s=i.activeElement,e(),a.addEventListener("mouseup",u),Qu(l,!0))}return l.addEventListener("mouseout",d),()=>{l.removeEventListener("mouseout",d),a.removeEventListener("mouseup",u),a.cancelAnimationFrame(c)}}),[e,t,n,o])}function Ju(e,t){e.contentEditable=t,t&&e.focus()}function ed(){const{multiSelect:e,selectBlock:t,selectionChange:n}=(0,p.useDispatch)(so),{getBlockParents:o,getBlockSelectionStart:r}=(0,p.useSelect)(so);return(0,d.useRefEffect)((n=>{const{ownerDocument:l}=n,{defaultView:i}=l;function a(l){const a=i.getSelection();if(!a.rangeCount)return;const s=l.shiftKey&&"mouseup"===l.type;if(a.isCollapsed&&!s)return void Ju(n,!1);let c=du(function(e){const{anchorNode:t,anchorOffset:n}=e;return t.nodeType===t.TEXT_NODE||0===n?t:t.childNodes[n-1]}(a)),u=du(function(e){const{focusNode:t,focusOffset:n}=e;return t.nodeType===t.TEXT_NODE||n===t.childNodes.length?t:t.childNodes[n]}(a));if(s){const e=r(),t=du(l.target),n=t!==u;(c===u&&a.isCollapsed||!u||n)&&(u=t),c!==e&&(c=e)}if(void 0===c&&void 0===u)return void Ju(n,!1);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])}}function s(){l.addEventListener("selectionchange",a),i.addEventListener("mouseup",a)}function c(){l.removeEventListener("selectionchange",a),i.removeEventListener("mouseup",a)}function u(){c(),s()}return s(),n.addEventListener("focusin",u),()=>{c(),n.removeEventListener("focusin",u)}}),[e,t,n,o])}function td(){const{selectBlock:e}=(0,p.useDispatch)(so),{isSelectionEnabled:t,getBlockSelectionStart:n,hasMultiSelection:o}=(0,p.useSelect)(so);return(0,d.useRefEffect)((r=>{function l(l){if(!t()||0!==l.button)return;const i=n(),a=du(l.target);l.shiftKey?i!==a&&(r.contentEditable=!0,r.focus()):o()&&e(a)}return r.addEventListener("mousedown",l),()=>{r.removeEventListener("mousedown",l)}}),[e,t,n,o])}function nd(){const{__unstableIsFullySelected:e,getSelectedBlockClientIds:t,__unstableIsSelectionMergeable:n,hasMultiSelection:o}=(0,p.useSelect)(so),{replaceBlocks:l,__unstableSplitSelection:i,removeBlocks:a,__unstableDeleteSelection:s,__unstableExpandSelection:c}=(0,p.useDispatch)(so);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===ku.ENTER?(u.contentEditable=!1,d.preventDefault(),e()?l(t(),(0,r.createBlock)((0,r.getDefaultBlockName)())):i()):d.keyCode===ku.BACKSPACE||d.keyCode===ku.DELETE?(u.contentEditable=!1,d.preventDefault(),e()?a(t()):n()?s(d.keyCode===ku.DELETE):c()):1!==d.key.length||d.metaKey||d.ctrlKey||(u.contentEditable=!1,n()?s(d.keyCode===ku.DELETE):(d.preventDefault(),u.ownerDocument.defaultView.getSelection().removeAllRanges())))}function m(e){o()&&(u.contentEditable=!1,n()?s():(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 od(){const[e,t,n]=function(){const e=(0,a.useRef)(),t=(0,a.useRef)(),n=(0,a.useRef)(),o=(0,a.useRef)(),{hasMultiSelection:r,getSelectedBlockClientId:l,getBlockCount:i}=(0,p.useSelect)(so),{setNavigationMode:s}=(0,p.useDispatch)(so),c=(0,p.useSelect)((e=>e(so).isNavigationMode()),[])?void 0:"0",u=(0,a.useRef)();function m(t){if(u.current)u.current=null;else if(r())e.current.focus();else if(l())o.current.focus();else{s(!0);const n=t.target.compareDocumentPosition(e.current)&t.target.DOCUMENT_POSITION_FOLLOWING?"findNext":"findPrevious";Wl.focus.tabbable[n](t.target).focus()}}const f=(0,a.createElement)("div",{ref:t,tabIndex:c,onFocus:m}),g=(0,a.createElement)("div",{ref:n,tabIndex:c,onFocus:m}),h=(0,d.useRefEffect)((a=>{function c(e){if(e.defaultPrevented)return;if(e.keyCode===ku.ESCAPE)return e.preventDefault(),void s(!0);if(e.keyCode!==ku.TAB)return;const o=e.shiftKey,i=o?"findPrevious":"findNext";if(!r()&&!l())return void(e.target===a&&s(!0));if(((0,Wl.isFormElement)(e.target)||e.target.getAttribute("data-block")===l())&&(0,Wl.isFormElement)(Wl.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}=a;e.relatedTarget||t.activeElement!==t.body||0!==i()||a.focus()}function p(o){var r;if(o.keyCode!==ku.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=Wl.focus.tabbable[l](o.target);i!==t.current&&i!==n.current||(o.preventDefault(),i.focus({preventScroll:!0}))}const{ownerDocument:m}=a,{defaultView:f}=m;return f.addEventListener("keydown",p),a.addEventListener("keydown",c),a.addEventListener("focusout",d),()=>{f.removeEventListener("keydown",p),a.removeEventListener("keydown",c),a.removeEventListener("focusout",d)}}),[]);return[f,(0,d.useMergeRefs)([e,h]),g]}(),o=(0,p.useSelect)((e=>e(so).hasMultiSelection()),[]);return[e,(0,d.useMergeRefs)([t,nd(),Xu(),ed(),td(),$u(),Zu(),qu(),(0,d.useRefEffect)((e=>{if(e.tabIndex=-1,e.contentEditable=o,o)return e.classList.add("has-multi-selection"),e.setAttribute("aria-label",(0,g.__)("Multiple selected blocks")),()=>{e.classList.remove("has-multi-selection"),e.removeAttribute("aria-label")}}),[o])]),n]}var rd=(0,a.forwardRef)((function(e,t){let{children:n,...o}=e;const[r,l,s]=od();return(0,a.createElement)(a.Fragment,null,r,(0,a.createElement)("div",i({},o,{ref:(0,d.useMergeRefs)([l,t]),className:c()(o.className,"block-editor-writing-flow")}),n),s)}));const ld="editor-styles-wrapper";function id(e){return(0,a.useMemo)((()=>{const t=document.implementation.createHTMLDocument("");return t.body.innerHTML=e,Array.from(t.body.children)}),[e])}var ad=(0,a.forwardRef)((function(e,t){let{contentRef:n,children:o,head:r,tabIndex:l=0,assets:s,isZoomedOut:u,...p}=e;const[,f]=(0,a.useReducer)((()=>({}))),[h,v]=(0,a.useState)(),[b,_]=(0,a.useState)([]),k=id(null==s?void 0:s.styles),y=id(null==s?void 0:s.scripts),E=Uu(),[C,w,S]=od(),[B,{height:I}]=(0,d.useResizeObserver)(),x=(0,d.useRefEffect)((e=>{let t;function n(e){e.preventDefault()}function o(){const{contentDocument:o,ownerDocument:r}=e,{readyState:l,documentElement:i}=o;return t=o,("interactive"===l||"complete"===l)&&(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)}(o),v(o),E(i),_(Array.from(r.body.classList).filter((e=>e.startsWith("admin-color-")||e.startsWith("post-type-")||"wp-embed-responsive"===e))),o.dir=r.dir,i.removeChild(o.head),i.removeChild(o.body),t.addEventListener("dragover",n,!1),t.addEventListener("drop",n,!1),!0)}return e.addEventListener("load",o),()=>{var r,l;e.removeEventListener("load",o),null===(r=t)||void 0===r||r.removeEventListener("dragover",n),null===(l=t)||void 0===l||l.removeEventListener("drop",n)}}),[]),T=(0,d.useRefEffect)((e=>{y.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((()=>{f()}))}),[]),N=(0,d.useMergeRefs)([n,E,w]),P=(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&&function e(t){return Array.from(t).find((t=>{let{selectorText:n,conditionText:o,cssRules:r}=t;return o?e(r):n&&(n.includes(`.${ld}`)||n.includes(".wp-block"))}))}(o)&&!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,a.createElement)(a.Fragment,null,(0,a.createElement)("style",null,"body{margin:0}"),k.map((e=>{let{tagName:t,href:n,id:o,rel:r,media:l,textContent:i}=e;const s=t.toLowerCase();return"style"===s?(0,a.createElement)(s,{id:o,key:o},i):(0,a.createElement)(s,{href:n,id:o,rel:r,media:l,key:o})})),r),(0,a.createElement)(a.Fragment,null,l>=0&&C,(0,a.createElement)("iframe",i({},p,{ref:(0,d.useMergeRefs)([t,x]),tabIndex:l,srcDoc:"<!doctype html>",title:(0,g.__)("Editor canvas")}),h&&(0,a.createPortal)((0,a.createElement)(a.Fragment,null,(0,a.createElement)("head",{ref:T},r,(0,a.createElement)("style",null,`html { transition: background 5s; ${u?"background: #2f2f2f; transition: background 0s;":""} }`)),(0,a.createElement)("body",{ref:N,className:c()("block-editor-iframe__body",ld,...b,{"is-zoomed-out":u}),style:u?{marginBottom:`-${.55*I-100}px`}:{}},B,(0,a.createElement)("div",{style:{display:"none"},ref:P}),(0,a.createElement)(m.__experimentalStyleProvider,{document:h},o))),h.documentElement)),l>=0&&S)})),sd={grad:.9,turn:360,rad:360/(2*Math.PI)},cd=function(e){return"string"==typeof e?e.length>0:"number"==typeof e},ud=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=Math.pow(10,t)),Math.round(n*e)/n+0},dd=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=1),e>n?n:e>t?e:t},pd=function(e){return(e=isFinite(e)?e%360:0)>0?e:e+360},md=function(e){return{r:dd(e.r,0,255),g:dd(e.g,0,255),b:dd(e.b,0,255),a:dd(e.a)}},fd=function(e){return{r:ud(e.r),g:ud(e.g),b:ud(e.b),a:ud(e.a,3)}},gd=/^#([0-9a-f]{3,8})$/i,hd=function(e){var t=e.toString(16);return t.length<2?"0"+t:t},vd=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),a=i?l===t?(n-o)/i:l===n?2+(o-t)/i:4+(t-n)/i:0;return{h:60*(a<0?a+6:a),s:l?i/l*100:0,v:l/255*100,a:r}},bd=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),a=o*(1-(t-l)*n),s=o*(1-(1-t+l)*n),c=l%6;return{r:255*[o,a,i,i,s,o][c],g:255*[s,o,o,a,i,i][c],b:255*[i,i,s,o,o,a][c],a:r}},_d=function(e){return{h:pd(e.h),s:dd(e.s,0,100),l:dd(e.l,0,100),a:dd(e.a)}},kd=function(e){return{h:ud(e.h),s:ud(e.s),l:ud(e.l),a:ud(e.a,3)}},yd=function(e){return bd((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},Ed=function(e){return{h:(t=vd(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},Cd=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,wd=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Sd=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Bd=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Id={string:[[function(e){var t=gd.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?ud(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?ud(parseInt(e.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(e){var t=Sd.exec(e)||Bd.exec(e);return t?t[2]!==t[4]||t[4]!==t[6]?null:md({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=Cd.exec(e)||wd.exec(e);if(!t)return null;var n,o,r=_d({h:(n=t[1],o=t[2],void 0===o&&(o="deg"),Number(n)*(sd[o]||1)),s:Number(t[3]),l:Number(t[4]),a:void 0===t[5]?1:Number(t[5])/(t[6]?100:1)});return yd(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 cd(t)&&cd(n)&&cd(o)?md({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(!cd(t)||!cd(n)||!cd(o))return null;var i=_d({h:Number(t),s:Number(n),l:Number(o),a:Number(l)});return yd(i)},"hsl"],[function(e){var t=e.h,n=e.s,o=e.v,r=e.a,l=void 0===r?1:r;if(!cd(t)||!cd(n)||!cd(o))return null;var i=function(e){return{h:pd(e.h),s:dd(e.s,0,100),v:dd(e.v,0,100),a:dd(e.a)}}({h:Number(t),s:Number(n),v:Number(o),a:Number(l)});return bd(i)},"hsv"]]},xd=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]},Td=function(e){return"string"==typeof e?xd(e.trim(),Id.string):"object"==typeof e&&null!==e?xd(e,Id.object):[null,void 0]},Nd=function(e,t){var n=Ed(e);return{h:n.h,s:dd(n.s+100*t,0,100),l:n.l,a:n.a}},Pd=function(e){return(299*e.r+587*e.g+114*e.b)/1e3/255},Md=function(e,t){var n=Ed(e);return{h:n.h,s:n.s,l:dd(n.l+100*t,0,100),a:n.a}},Ld=function(){function e(e){this.parsed=Td(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 ud(Pd(this.rgba),2)},e.prototype.isDark=function(){return Pd(this.rgba)<.5},e.prototype.isLight=function(){return Pd(this.rgba)>=.5},e.prototype.toHex=function(){return t=(e=fd(this.rgba)).r,n=e.g,o=e.b,l=(r=e.a)<1?hd(ud(255*r)):"","#"+hd(t)+hd(n)+hd(o)+l;var e,t,n,o,r,l},e.prototype.toRgb=function(){return fd(this.rgba)},e.prototype.toRgbString=function(){return t=(e=fd(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 kd(Ed(this.rgba))},e.prototype.toHslString=function(){return t=(e=kd(Ed(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=vd(this.rgba),{h:ud(e.h),s:ud(e.s),v:ud(e.v),a:ud(e.a,3)};var e},e.prototype.invert=function(){return Rd({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),Rd(Nd(this.rgba,e))},e.prototype.desaturate=function(e){return void 0===e&&(e=.1),Rd(Nd(this.rgba,-e))},e.prototype.grayscale=function(){return Rd(Nd(this.rgba,-1))},e.prototype.lighten=function(e){return void 0===e&&(e=.1),Rd(Md(this.rgba,e))},e.prototype.darken=function(e){return void 0===e&&(e=.1),Rd(Md(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?Rd({r:(t=this.rgba).r,g:t.g,b:t.b,a:e}):ud(this.rgba.a,3);var t},e.prototype.hue=function(e){var t=Ed(this.rgba);return"number"==typeof e?Rd({h:e,s:t.s,l:t.l,a:t.a}):ud(t.h)},e.prototype.isEqual=function(e){return this.toHex()===Rd(e).toHex()},e}(),Rd=function(e){return e instanceof Ld?e:new Ld(e)},Ad=[],Dd=function(e){e.forEach((function(e){Ad.indexOf(e)<0&&(e(Ld,Id),Ad.push(e))}))};function Od(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,a=o[this.toHex()];if(a)return a;if(null==t?void 0:t.closest){var s=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=s,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 zd=function(e){var t=e/255;return t<.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)},Fd=function(e){return.2126*zd(e.r)+.7152*zd(e.g)+.0722*zd(e.b)};function Vd(e){e.prototype.luminance=function(){return e=Fd(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,a,s,c=t instanceof e?t:new e(t);return l=this.rgba,i=c.toRgb(),n=(a=Fd(l))>(s=Fd(i))?(a+.05)/(s+.05):(s+.05)/(a+.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 Hd=n(3124),Gd=n.n(Hd);const Ud=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;function Wd(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 a=[];function s(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;a.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=w()||S());)!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 s("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 jd(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=jd(t[0]),!p(/^:\s*/))return s("property missing ':'");const n=p(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^\)]*?\)|[^};])+)/),o=e({type:"declaration",property:t.replace(Ud,""),value:n?jd(n[0]).replace(Ud,""):""});return p(/^[;\s]*/),o}function b(){const e=[];if(!c())return s("missing '{'");let t;for(f(e);t=v();)!1!==t&&(e.push(t),f(e));return u()?e:s("missing '}'")}function _(){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 k=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 w(){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 s("@keyframes missing name");const o=t[1];if(!c())return s("@keyframes missing '{'");let r,i=f();for(;r=_();)i.push(r),i=i.concat(f());return u()?e({type:"keyframes",name:o,vendor:n,keyframes:i}):s("@keyframes missing '}'")}()||function(){const e=l(),t=p(/^@media *([^{]+)/);if(!t)return;const n=jd(t[1]);if(!c())return s("@media missing '{'");const o=f().concat(d());return u()?e({type:"media",media:n,rules:o}):s("@media missing '}'")}()||function(){const e=l(),t=p(/^@custom-media\s+(--[^\s]+)\s*([^{;]+);/);if(t)return e({type:"custom-media",name:jd(t[1]),media:jd(t[2])})}()||function(){const e=l(),t=p(/^@supports *([^{]+)/);if(!t)return;const n=jd(t[1]);if(!c())return s("@supports missing '{'");const o=f().concat(d());return u()?e({type:"supports",supports:n,rules:o}):s("@supports missing '}'")}()||k()||y()||E()||function(){const e=l(),t=p(/^@([-\w]+)?document *([^{]+)/);if(!t)return;const n=jd(t[1]),o=jd(t[2]);if(!c())return s("@document missing '{'");const r=f().concat(d());return u()?e({type:"document",document:o,vendor:n,rules:r}):s("@document missing '}'")}()||function(){const e=l();if(!p(/^@page */))return;const t=h()||[];if(!c())return s("@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}):s("@page missing '}'")}()||function(){const e=l();if(!p(/^@host\s*/))return;if(!c())return s("@host missing '{'");const t=f().concat(d());return u()?e({type:"host",rules:t}):s("@host missing '}'")}()||function(){const e=l();if(!p(/^@font-face\s*/))return;if(!c())return s("@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}):s("@font-face missing '}'")}()}function S(){const e=l(),t=h();return t?(f(),e({type:"rule",selectors:t,declarations:b()})):s("selector missing")}return $d(function(){const e=d();return{type:"stylesheet",stylesheet:{source:t.source,rules:e,parsingErrors:a}}}())}function jd(e){return e?e.replace(/^\s+|\s+$/g,""):""}function $d(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){$d(e,o)})):n&&"object"==typeof n&&$d(n,o)}return n&&Object.defineProperty(e,"parent",{configurable:!0,writable:!0,enumerable:!1,value:t||null}),e}var Kd=n(8575),qd=n.n(Kd),Yd=Zd;function Zd(e){this.options=e||{}}Zd.prototype.emit=function(e){return e},Zd.prototype.visit=function(e){return this[e.type](e)},Zd.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 Qd=Xd;function Xd(e){Yd.call(this,e)}qd()(Xd,Yd),Xd.prototype.compile=function(e){return e.stylesheet.rules.map(this.visit,this).join("")},Xd.prototype.comment=function(e){return this.emit("",e.position)},Xd.prototype.import=function(e){return this.emit("@import "+e.import+";",e.position)},Xd.prototype.media=function(e){return this.emit("@media "+e.media,e.position)+this.emit("{")+this.mapVisit(e.rules)+this.emit("}")},Xd.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("}")},Xd.prototype.charset=function(e){return this.emit("@charset "+e.charset+";",e.position)},Xd.prototype.namespace=function(e){return this.emit("@namespace "+e.namespace+";",e.position)},Xd.prototype.supports=function(e){return this.emit("@supports "+e.supports,e.position)+this.emit("{")+this.mapVisit(e.rules)+this.emit("}")},Xd.prototype.keyframes=function(e){return this.emit("@"+(e.vendor||"")+"keyframes "+e.name,e.position)+this.emit("{")+this.mapVisit(e.keyframes)+this.emit("}")},Xd.prototype.keyframe=function(e){const t=e.declarations;return this.emit(e.values.join(","),e.position)+this.emit("{")+this.mapVisit(t)+this.emit("}")},Xd.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("}")},Xd.prototype["font-face"]=function(e){return this.emit("@font-face",e.position)+this.emit("{")+this.mapVisit(e.declarations)+this.emit("}")},Xd.prototype.host=function(e){return this.emit("@host",e.position)+this.emit("{")+this.mapVisit(e.rules)+this.emit("}")},Xd.prototype["custom-media"]=function(e){return this.emit("@custom-media "+e.name+" "+e.media+";",e.position)},Xd.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("}"):""},Xd.prototype.declaration=function(e){return this.emit(e.property+":"+e.value,e.position)+this.emit(";")};var Jd=ep;function ep(e){e=e||{},Yd.call(this,e),this.indentation=e.indent}qd()(ep,Yd),ep.prototype.compile=function(e){return this.stylesheet(e)},ep.prototype.stylesheet=function(e){return this.mapVisit(e.stylesheet.rules,"\n\n")},ep.prototype.comment=function(e){return this.emit(this.indent()+"/*"+e.comment+"*/",e.position)},ep.prototype.import=function(e){return this.emit("@import "+e.import+";",e.position)},ep.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}")},ep.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}")},ep.prototype.charset=function(e){return this.emit("@charset "+e.charset+";",e.position)},ep.prototype.namespace=function(e){return this.emit("@namespace "+e.namespace+";",e.position)},ep.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}")},ep.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)+"}")},ep.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")},ep.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}")},ep.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}")},ep.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}")},ep.prototype["custom-media"]=function(e){return this.emit("@custom-media "+e.name+" "+e.media+";",e.position)},ep.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()+"}"):""},ep.prototype.declaration=function(e){return this.emit(this.indent())+this.emit(e.property+": "+e.value,e.position)+this.emit(";")},ep.prototype.indent=function(e){return this.level=this.level||1,null!==e?(this.level+=e,""):Array(this.level).join(this.indentation||" ")};var tp=function(e,t){try{const r=Wd(e),l=Gd().map(r,(function(e){if(!e)return e;const n=t(e);return this.update(n)}));return n=l,((o=o||{}).compress?new Qd(o):new Jd(o)).compile(n)}catch(e){return console.warn("Error while traversing the CSS: "+e),null}var n,o};function np(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 op(e,t){return new URL(e,t).toString()}var rp=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]};np(e)&&o.push(e)}return o}(t.value).map((r=e,e=>({...e,newUrl:"url("+e.before+e.quote+op(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 lp=/^(body|html|:root).*$/;var ip=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return n=>{const o=n=>t.includes(n.trim())?n:n.match(lp)?n.replace(/^(body|html|:root)/,e):e+" "+n;return"rule"===n.type?{...n,selectors:n.selectors.map(o)}:n}};var ap=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(ip(t)),o&&r.push(rp(o)),r.length?tp(n,(0,d.compose)(r)):n}))};const sp=".editor-styles-wrapper";function cp(e){return(0,a.useCallback)((e=>{if(!e)return;const{ownerDocument:t}=e,{defaultView:n,body:o}=t,r=t.querySelector(sp);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=Rd(l);i.luminance()>.5||0===i.alpha()?o.classList.remove("is-dark-theme"):o.classList.add("is-dark-theme")}),[e])}function up(e){let{styles:t}=e;const n=(0,a.useMemo)((()=>ap(t,sp)),[t]);return(0,a.createElement)(a.Fragment,null,(0,a.createElement)("style",{ref:cp(t)}),n.map(((e,t)=>(0,a.createElement)("style",{key:t},e))))}function dp(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t={r:[],g:[],b:[],a:[]};return e.forEach((e=>{const n=Rd(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 pp(e){let{selector:t,id:n}=e;const o=`\n${t} {\n\tfilter: url( #${n} );\n}\n`;return(0,a.createElement)("style",null,o)}function mp(e){let{selector:t}=e;const n=`\n${t} {\n\tfilter: none;\n}\n`;return(0,a.createElement)("style",null,n)}function fp(e){let{id:t,colors:n}=e;const o=dp(n);return(0,a.createElement)(m.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,a.createElement)("defs",null,(0,a.createElement)("filter",{id:t},(0,a.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,a.createElement)("feComponentTransfer",{colorInterpolationFilters:"sRGB"},(0,a.createElement)("feFuncR",{type:"table",tableValues:o.r.join(" ")}),(0,a.createElement)("feFuncG",{type:"table",tableValues:o.g.join(" ")}),(0,a.createElement)("feFuncB",{type:"table",tableValues:o.b.join(" ")}),(0,a.createElement)("feFuncA",{type:"table",tableValues:o.a.join(" ")})),(0,a.createElement)("feComposite",{in2:"SourceGraphic",operator:"in"}))))}function gp(e){let{preset:t}=e;return(0,a.createElement)(fp,{id:`wp-duotone-${t.slug}`,colors:t.colors})}let hp;Dd([Od,Vd]);const vp=2e3;var bp=function(e){let{viewportWidth:t,__experimentalPadding:n,__experimentalMinHeight:o}=e;const[r,{width:l}]=(0,d.useResizeObserver)(),[i,{height:s}]=(0,d.useResizeObserver)(),{styles:c,assets:u,duotone:f}=(0,p.useSelect)((e=>{var t,n;const o=e(so).getSettings();return{styles:o.styles,assets:o.__unstableResolvedAssets,duotone:null===(t=o.__experimentalFeatures)||void 0===t||null===(n=t.color)||void 0===n?void 0:n.duotone}}),[]),g=(0,a.useMemo)((()=>c?[...c,{css:"body{height:auto;overflow:hidden;}",__unstableType:"presets"}]:c),[c]),h=(0,a.useMemo)((()=>{var e,t;return[...null!==(e=null==f?void 0:f.default)&&void 0!==e?e:[],...null!==(t=null==f?void 0:f.theme)&&void 0!==t?t:[]]}),[f]);hp=hp||(0,d.pure)(sh);const v=l/t;return(0,a.createElement)("div",{className:"block-editor-block-preview__container"},r,(0,a.createElement)(m.Disabled,{className:"block-editor-block-preview__content",style:{transform:`scale(${v})`,height:s*v,maxHeight:s>vp?vp*v:void 0,minHeight:o}},(0,a.createElement)(ad,{head:(0,a.createElement)(up,{styles:g}),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.boxSizing="border-box",e.style.position="absolute",e.style.width="100%"}),[]),"aria-hidden":!0,tabIndex:-1,style:{position:"absolute",width:t,height:s,pointerEvents:"none",maxHeight:vp,minHeight:0!==v&&v<1&&o?o/v:o}},i,h.map((e=>(0,a.createElement)(gp,{preset:e,key:e.slug}))),(0,a.createElement)(hp,{renderAppender:!1}))))};var _p=(0,a.memo)((function(e){let{blocks:t,__experimentalPadding:n=0,viewportWidth:o=1200,__experimentalLive:r=!1,__experimentalOnClick:l,__experimentalMinHeight:i}=e;const s=(0,p.useSelect)((e=>e(so).getSettings()),[]),c=(0,a.useMemo)((()=>{const e={...s};return e.__experimentalBlockPatterns=[],e}),[s]),d=(0,a.useMemo)((()=>(0,u.castArray)(t)),[t]);return t&&0!==t.length?(0,a.createElement)(Hu,{value:d,settings:c},r?(0,a.createElement)(Gu,{onClick:l}):(0,a.createElement)(bp,{viewportWidth:o,__experimentalPadding:n,__experimentalMinHeight:i})):null}));function kp(e){let{blocks:t,props:n={},__experimentalLayout:o}=e;const r=(0,p.useSelect)((e=>e(so).getSettings()),[]),l=(0,d.useDisabled)(),i=(0,d.useMergeRefs)([n.ref,l]),s=(0,a.useMemo)((()=>({...r,__experimentalBlockPatterns:[]})),[r]),m=(0,a.useMemo)((()=>(0,u.castArray)(t)),[t]),f=(0,a.createElement)(Hu,{value:m,settings:s},(0,a.createElement)(uh,{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 yp=function(e){var t;let{item:n}=e;const{name:o,title:l,icon:i,description:s,initialAttributes:c,example:u}=n,d=(0,r.isReusableBlock)(n);return(0,a.createElement)("div",{className:"block-editor-inserter__preview-container"},(0,a.createElement)("div",{className:"block-editor-inserter__preview"},d||u?(0,a.createElement)("div",{className:"block-editor-inserter__preview-content"},(0,a.createElement)(_p,{__experimentalPadding:16,viewportWidth:null!==(t=null==u?void 0:u.viewportWidth)&&void 0!==t?t:500,blocks:u?(0,r.getBlockFromExample)(o,{attributes:{...u.attributes,...c},innerBlocks:u.innerBlocks}):(0,r.createBlock)(o,c)})):(0,a.createElement)("div",{className:"block-editor-inserter__preview-content-missing"},(0,g.__)("No Preview Available."))),!d&&(0,a.createElement)(Ou,{title:l,icon:i,description:s}))};var Ep=(0,a.createContext)();var Cp=(0,a.forwardRef)((function(e,t){let{isFirst:n,as:o,children:r,...l}=e;const s=(0,a.useContext)(Ep);return(0,a.createElement)(m.__unstableCompositeItem,i({ref:t,state:s,role:"option",focusable:!0},l),(e=>{const t={...e,tabIndex:n?0:e.tabIndex};return o?(0,a.createElement)(o,t,r):"function"==typeof r?r(t):(0,a.createElement)(m.Button,t,r)}))}));var wp=(0,a.createElement)(D.SVG,{width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(D.Path,{d:"M8 7h2V5H8v2zm0 6h2v-2H8v2zm0 6h2v-2H8v2zm6-14v2h2V5h-2zm0 8h2v-2h-2v2zm0 6h2v-2h-2v2z"}));function Sp(e){let{count:t,icon:n}=e;return(0,a.createElement)("div",{className:"block-editor-block-draggable-chip-wrapper"},(0,a.createElement)("div",{className:"block-editor-block-draggable-chip","data-testid":"block-draggable-chip"},(0,a.createElement)(m.Flex,{justify:"center",className:"block-editor-block-draggable-chip__content"},(0,a.createElement)(m.FlexItem,null,n?(0,a.createElement)(Du,{icon:n}):(0,g.sprintf)((0,g._n)("%d block","%d blocks",t),t)),(0,a.createElement)(m.FlexItem,null,(0,a.createElement)(Du,{icon:wp})))))}var Bp=e=>{let{isEnabled:t,blocks:n,icon:o,children:r}=e;const l={type:"inserter",blocks:n};return(0,a.createElement)(m.Draggable,{__experimentalTransferDataType:"wp-blocks",transferData:l,__experimentalDragComponent:(0,a.createElement)(Sp,{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})}))};var Ip=(0,a.memo)((function(e){let{className:t,isFirst:n,item:o,onSelect:l,onHover:s,isDraggable:u,...d}=e;const p=(0,a.useRef)(!1),f=o.icon?{backgroundColor:o.icon.background,color:o.icon.foreground}:{},g=(0,a.useMemo)((()=>[(0,r.createBlock)(o.name,o.initialAttributes,(0,r.createBlocksFromInnerBlocksTemplate)(o.innerBlocks))]),[o.name,o.initialAttributes,o.initialAttributes]);return(0,a.createElement)(Bp,{isEnabled:u&&!o.disabled,blocks:g,icon:o.icon},(e=>{let{draggable:r,onDragStart:u,onDragEnd:g}=e;return(0,a.createElement)("div",{className:"block-editor-block-types-list__list-item",draggable:r,onDragStart:e=>{p.current=!0,u&&(s(null),u(e))},onDragEnd:e=>{p.current=!1,g&&g(e)}},(0,a.createElement)(Cp,i({isFirst:n,className:c()("block-editor-block-types-list__item",t),disabled:o.isDisabled,onClick:e=>{e.preventDefault(),l(o,(0,ku.isAppleOS)()?e.metaKey:e.ctrlKey),s(null)},onKeyDown:e=>{const{keyCode:t}=e;t===ku.ENTER&&(e.preventDefault(),l(o,(0,ku.isAppleOS)()?e.metaKey:e.ctrlKey),s(null))},onFocus:()=>{p.current||s(o)},onMouseEnter:()=>{p.current||s(o)},onMouseLeave:()=>s(null),onBlur:()=>s(null)},d),(0,a.createElement)("span",{className:"block-editor-block-types-list__item-icon",style:f},(0,a.createElement)(Du,{icon:o.icon,showColors:!0})),(0,a.createElement)("span",{className:"block-editor-block-types-list__item-title"},(0,a.createElement)(m.__experimentalTruncate,{numberOfLines:3},o.title))))}))}));var xp=(0,a.forwardRef)((function(e,t){const[n,o]=(0,a.useState)(!1);return(0,a.useEffect)((()=>{n&&(0,qt.speak)((0,g.__)("Use left and right arrow keys to move through blocks"))}),[n]),(0,a.createElement)("div",i({ref:t,role:"listbox","aria-orientation":"horizontal",onFocus:()=>{o(!0)},onBlur:e=>{!e.currentTarget.contains(e.relatedTarget)&&o(!1)}},e))}));var Tp=(0,a.forwardRef)((function(e,t){const n=(0,a.useContext)(Ep);return(0,a.createElement)(m.__unstableCompositeGroup,i({state:n,role:"presentation",ref:t},e))}));var Np=function(e){let{items:t=[],onSelect:n,onHover:o=(()=>{}),children:l,label:i,isDraggable:s=!0}=e;return(0,a.createElement)(xp,{className:"block-editor-block-types-list","aria-label":i},function(e,t){const n=[];for(let o=0,r=e.length;o<r;o+=t)n.push(e.slice(o,o+t));return n}(t,3).map(((e,t)=>(0,a.createElement)(Tp,{key:t},e.map(((e,l)=>(0,a.createElement)(Ip,{key:e.id,item:e,className:(0,r.getBlockMenuDefaultClassName)(e.id),onSelect:n,onHover:o,isDraggable:s&&!e.isDisabled,isFirst:0===t&&0===l})))))),l)};var Pp=function(e){let{title:t,icon:n,children:o}=e;return(0,a.createElement)(a.Fragment,null,(0,a.createElement)("div",{className:"block-editor-inserter__panel-header"},(0,a.createElement)("h2",{className:"block-editor-inserter__panel-title"},t),(0,a.createElement)(m.Icon,{icon:n})),(0,a.createElement)("div",{className:"block-editor-inserter__panel-content"},o))};var Mp=(e,t)=>{const{categories:n,collections:o,items:l}=(0,p.useSelect)((t=>{const{getInserterItems:n}=t(so),{getCategories:o,getCollections:l}=t(r.store);return{categories:o(),collections:l(),items:n(e)}}),[e]);return[l,n,o,(0,a.useCallback)(((e,n)=>{let{name:o,initialAttributes:l,innerBlocks:i}=e;const a=(0,r.createBlock)(o,l,(0,r.createBlocksFromInnerBlocksTemplate)(i));t(a,void 0,n)}),[t])]};var Lp=function(e){let{children:t}=e;const n=(0,m.__unstableUseCompositeState)({shift:!0,wrap:"horizontal"});return(0,a.createElement)(Ep.Provider,{value:n},t)};const Rp=[];var Ap=function(e){let{rootClientId:t,onInsert:n,onHover:o,showMostUsedBlocks:r}=e;const[l,i,s,c]=Mp(t,n),p=(0,a.useMemo)((()=>(0,u.orderBy)(l,["frecency"],["desc"]).slice(0,6)),[l]),m=(0,a.useMemo)((()=>l.filter((e=>!e.category))),[l]),f=(0,a.useMemo)((()=>(0,u.flow)((e=>e.filter((e=>e.category&&"reusable"!==e.category))),(e=>(0,u.groupBy)(e,"category")))(l)),[l]),h=(0,a.useMemo)((()=>{const e={...s};return Object.keys(s).forEach((t=>{e[t]=l.filter((e=>(e=>e.name.split("/")[0])(e)===t)),0===e[t].length&&delete e[t]})),e}),[l,s]);(0,a.useEffect)((()=>()=>o(null)),[]);const v=(0,d.useAsyncList)(i),b=i.length===v.length,_=(0,a.useMemo)((()=>Object.entries(s)),[s]),k=(0,d.useAsyncList)(b?_:Rp);return(0,a.createElement)(Lp,null,(0,a.createElement)("div",null,r&&!!p.length&&(0,a.createElement)(Pp,{title:(0,g._x)("Most used","blocks")},(0,a.createElement)(Np,{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,a.createElement)(Pp,{key:e.slug,title:e.title,icon:e.icon},(0,a.createElement)(Np,{items:t,onSelect:c,onHover:o,label:e.title})):null})),b&&m.length>0&&(0,a.createElement)(Pp,{className:"block-editor-inserter__uncategorized-blocks-panel",title:(0,g.__)("Uncategorized")},(0,a.createElement)(Np,{items:m,onSelect:c,onHover:o,label:(0,g.__)("Uncategorized")})),(0,u.map)(k,(e=>{let[t,n]=e;const r=h[t];return r&&r.length?(0,a.createElement)(Pp,{key:t,title:n.title,icon:n.icon},(0,a.createElement)(Np,{items:r,onSelect:c,onHover:o,label:n.title})):null}))))};var Dp=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,a.createElement)(m.Flex,{justify:"space-between",align:"start",gap:"4",className:i},(0,a.createElement)(m.FlexItem,{isBlock:!0},(0,a.createElement)(m.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,a.createElement)(m.FlexItem,null,(0,a.createElement)(m.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"))))},Op=window.wp.notices;var zp=(e,t)=>{const{patternCategories:n,patterns:o}=(0,p.useSelect)((e=>{const{__experimentalGetAllowedPatterns:n,getSettings:o}=e(so);return{patterns:n(t),patternCategories:o().__experimentalBlockPatternCategories}}),[t]),{createSuccessNotice:l}=(0,p.useDispatch)(Op.store),i=(0,a.useCallback)(((t,n)=>{e((0,u.map)(n,(e=>(0,r.cloneBlock)(e))),t.name),l((0,g.sprintf)((0,g.__)('Block pattern "%s" inserted.'),t.title),{type:"snackbar"})}),[]);return[o,n,i]};function Fp(e){let{isDraggable:t,pattern:n,onClick:o,composite:r}=e;const{blocks:l,viewportWidth:s}=n,c=`block-editor-block-patterns-list__item-description-${(0,d.useInstanceId)(Fp)}`;return(0,a.createElement)(Bp,{isEnabled:t,blocks:l},(e=>{let{draggable:t,onDragStart:u,onDragEnd:d}=e;return(0,a.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,a.createElement)(m.__unstableCompositeItem,i({role:"option",as:"div"},r,{className:"block-editor-block-patterns-list__item",onClick:()=>o(n,l)}),(0,a.createElement)(_p,{blocks:l,viewportWidth:s}),(0,a.createElement)("div",{className:"block-editor-block-patterns-list__item-title"},n.title),!!n.description&&(0,a.createElement)(m.VisuallyHidden,{id:c},n.description)))}))}function Vp(){return(0,a.createElement)("div",{className:"block-editor-block-patterns-list__item is-placeholder"})}var Hp=function(e){let{isDraggable:t,blockPatterns:n,shownPatterns:o,onClickPattern:r,orientation:l,label:s=(0,g.__)("Block Patterns")}=e;const c=(0,m.__unstableUseCompositeState)({orientation:l});return(0,a.createElement)(m.__unstableComposite,i({},c,{role:"listbox",className:"block-editor-block-patterns-list","aria-label":s}),n.map((e=>o.includes(e)?(0,a.createElement)(Fp,{key:e.name,pattern:e,onClick:r,isDraggable:t,composite:c}):(0,a.createElement)(Vp,{key:e.name}))))};function Gp(e){let{selectedCategory:t,patternCategories:n,onClickCategory:o}=e;const r="block-editor-block-patterns-explorer__sidebar";return(0,a.createElement)("div",{className:`${r}__categories-list`},n.map((e=>{let{name:n,label:l}=e;return(0,a.createElement)(m.Button,{key:n,label:l,className:`${r}__categories-list__item`,isPressed:t===n,onClick:()=>{o(n)}},l)})))}function Up(e){let{filterValue:t,setFilterValue:n}=e;return(0,a.createElement)("div",{className:"block-editor-block-patterns-explorer__search"},(0,a.createElement)(m.SearchControl,{onChange:n,value:t,label:(0,g.__)("Search for patterns"),placeholder:(0,g.__)("Search")}))}var Wp=function(e){let{selectedCategory:t,patternCategories:n,onClickCategory:o,filterValue:r,setFilterValue:l}=e;return(0,a.createElement)("div",{className:"block-editor-block-patterns-explorer__sidebar"},(0,a.createElement)(Up,{filterValue:r,setFilterValue:l}),!r&&(0,a.createElement)(Gp,{selectedCategory:t,patternCategories:n,onClickCategory:o}))};var jp=function(){return(0,a.createElement)("div",{className:"block-editor-inserter__no-results"},(0,a.createElement)(ul,{className:"block-editor-inserter__no-results-icon",icon:Au}),(0,a.createElement)("p",null,(0,g.__)("No results found.")))};var $p=function(e){let{rootClientId:t="",insertionIndex:n,clientId:o,isAppender:l,onSelect:i,shouldFocusBlock:s=!0}=e;const{getSelectedBlock:c}=(0,p.useSelect)(so),{destinationRootClientId:d,destinationIndex:m}=(0,p.useSelect)((e=>{const{getSelectedBlockClientId:r,getBlockRootClientId:i,getBlockIndex:a,getBlockOrder:s}=e(so),c=r();let u,d=t;return void 0!==n?u=n:o?u=a(o):!l&&c?(d=i(c),u=a(c)+1):u=s(d).length,{destinationRootClientId:d,destinationIndex:u}}),[t,n,o,l]),{replaceBlocks:f,insertBlocks:h,showInsertionPoint:v,hideInsertionPoint:b}=(0,p.useDispatch)(so),_=(0,a.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,s||n?0:null,t):h(e,m,d,!0,s||n?0:null,t);const a=(0,g.sprintf)((0,g._n)("%d block added.","%d blocks added.",(0,u.castArray)(e).length),(0,u.castArray)(e).length);(0,qt.speak)(a),i&&i()}),[l,c,f,h,d,m,i,s]),k=(0,a.useCallback)((e=>{e?v(d,m):b()}),[v,b,d,m]);return[d,_,k]};function Kp(e){return e.toLowerCase()}var qp=[/([a-z0-9])([A-Z])/g,/([A-Z])([A-Z][a-z])/g],Yp=/[^A-Z0-9]+/gi;function Zp(e,t){void 0===t&&(t={});for(var n=t.splitRegexp,o=void 0===n?qp:n,r=t.stripRegexp,l=void 0===r?Yp:r,i=t.transform,a=void 0===i?Kp:i,s=t.delimiter,c=void 0===s?" ":s,u=Qp(Qp(e,o,"$1\0$2"),l,"\0"),d=0,p=u.length;"\0"===u.charAt(d);)d++;for(;"\0"===u.charAt(p-1);)p--;return u.slice(d,p).split("\0").map(a).join(c)}function Qp(e,t,n){return t instanceof RegExp?e.replace(t,n):t.reduce((function(e,t){return e.replace(t,n)}),e)}var Xp=n(4793),Jp=n.n(Xp);const em=e=>e.name||"",tm=e=>e.title,nm=e=>e.description||"",om=e=>e.keywords||[],rm=e=>e.category,lm=()=>null;function im(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return e=Jp()(e),e=e.replace(/^\//,""),e=e.toLowerCase(),e}function am(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return Zp(e).split(" ").filter(Boolean)}const sm=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return am(im(e))},cm=(e,t)=>e.filter((e=>!sm(t).some((t=>t.includes(e))))),um=(e,t,n,o)=>{if(0===sm(o).length)return e;return dm(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}})},dm=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=sm(t);if(0===o.length)return e;const r=e.map((e=>[e,pm(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 pm(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{getName:o=em,getTitle:r=tm,getDescription:l=nm,getKeywords:i=om,getCategory:a=rm,getCollection:s=lm}=n,c=o(e),u=r(e),d=l(e),p=i(e),m=a(e),f=s(e),g=im(t),h=im(u);let v=0;if(g===h)v+=30;else if(h.startsWith(g))v+=20;else{const e=[c,u,d,...p,m,f].join(" "),t=am(g);0===cm(t,e).length&&(v+=10)}if(0!==v&&c.startsWith("core/")){v+=c!==e.id?1:2}return v}function mm(e){let{filterValue:t,filteredBlockPatternsLength:n}=e;return t?(0,a.createElement)(m.__experimentalHeading,{level:2,lineHeight:"48px",className:"block-editor-block-patterns-explorer__search-results-count"},(0,g.sprintf)((0,g._n)('%1$d pattern found for "%2$s"','%1$d patterns found for "%2$s"',n),n,t)):null}var fm=function(e){let{filterValue:t,selectedCategory:n,patternCategories:o}=e;const r=(0,d.useDebounce)(qt.speak,500),[l,i]=$p({shouldFocusBlock:!0}),[s,,c]=zp(i,l),u=(0,a.useMemo)((()=>o.map((e=>e.name))),[o]),p=(0,a.useMemo)((()=>t?dm(s,t):s.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,s]);(0,a.useEffect)((()=>{if(!t)return;const e=p.length,n=(0,g.sprintf)((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,a.createElement)("div",{className:"block-editor-block-patterns-explorer__list"},f&&(0,a.createElement)(mm,{filterValue:t,filteredBlockPatternsLength:p.length}),(0,a.createElement)(Lp,null,!f&&(0,a.createElement)(jp,null),f&&(0,a.createElement)(Hp,{shownPatterns:m,blockPatterns:p,onClickPattern:c,isDraggable:!1})))};function gm(e){let{initialCategory:t,patternCategories:n}=e;const[o,r]=(0,a.useState)(""),[l,i]=(0,a.useState)(null==t?void 0:t.name);return(0,a.createElement)("div",{className:"block-editor-block-patterns-explorer"},(0,a.createElement)(Wp,{selectedCategory:l,patternCategories:n,onClickCategory:i,filterValue:o,setFilterValue:r}),(0,a.createElement)(fm,{filterValue:o,selectedCategory:l,patternCategories:n}))}var hm=function(e){let{onModalClose:t,...n}=e;return(0,a.createElement)(m.Modal,{title:(0,g.__)("Patterns"),closeLabel:(0,g.__)("Close"),onRequestClose:t,isFullScreen:!0},(0,a.createElement)(gm,n))};function vm(e){let{rootClientId:t,onInsert:n,selectedCategory:o,populatedCategories:r}=e;const[l,,i]=zp(n,t),s=(0,a.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,a.useMemo)((()=>l.filter((e=>{var t;return"uncategorized"===o.name?s(e)===1/0:null===(t=e.categories)||void 0===t?void 0:t.includes(o.name)}))),[l,o]),u=(0,a.useMemo)((()=>c.sort(((e,t)=>s(e)-s(t)))),[c,s]),p=(0,d.useAsyncList)(u);return c.length?(0,a.createElement)("div",{className:"block-editor-inserter__panel-content"},(0,a.createElement)(Hp,{shownPatterns:p,blockPatterns:c,onClickPattern:i,label:o.label,orientation:"vertical",isDraggable:!0})):null}var bm=function(e){let{rootClientId:t,onInsert:n,onClickCategory:o,selectedCategory:r}=e;const[l,i]=(0,a.useState)(!1),[s,c]=zp(),u=(0,a.useCallback)((e=>!(!e.categories||!e.categories.length)&&e.categories.some((e=>c.some((t=>t.name===e))))),[c]),d=(0,a.useMemo)((()=>{const e=c.filter((e=>s.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 s.some((e=>!u(e)))&&!e.find((e=>"uncategorized"===e.name))&&e.push({name:"uncategorized",label:(0,g._x)("Uncategorized")}),e}),[s,c]),p=r||d[0];return(0,a.createElement)(a.Fragment,null,(0,a.createElement)(Dp,{selectedCategory:p,patternCategories:d,onClickCategory:o,openPatternExplorer:()=>i(!0)}),!l&&(0,a.createElement)(vm,{rootClientId:t,onInsert:n,selectedCategory:p,populatedCategories:d}),l&&(0,a.createElement)(hm,{initialCategory:p,patternCategories:d,onModalClose:()=>i(!1)}))},_m=window.wp.url;function km(e){let{onHover:t,onInsert:n,rootClientId:o}=e;const[r,,,l]=Mp(o,n),i=(0,a.useMemo)((()=>r.filter((e=>{let{category:t}=e;return"reusable"===t}))),[r]);return 0===i.length?(0,a.createElement)(jp,null):(0,a.createElement)(Pp,{title:(0,g.__)("Reusable blocks")},(0,a.createElement)(Np,{items:i,onSelect:l,onHover:t,label:(0,g.__)("Reusable blocks")}))}var ym=function(e){let{rootClientId:t,onInsert:n,onHover:o}=e;return(0,a.createElement)(a.Fragment,null,(0,a.createElement)(km,{onHover:o,onInsert:n,rootClientId:t}),(0,a.createElement)("div",{className:"block-editor-inserter__manage-reusable-blocks-container"},(0,a.createElement)("a",{className:"block-editor-inserter__manage-reusable-blocks",href:(0,_m.addQueryArgs)("edit.php",{post_type:"wp_block"})},(0,g.__)("Manage Reusable blocks"))))};const{Fill:Em,Slot:Cm}=(0,m.createSlotFill)("__unstableInserterMenuExtension");Em.Slot=Cm;var wm=Em;const Sm=[];var Bm=function(e){let{filterValue:t,onSelect:n,onHover:o,rootClientId:r,clientId:l,isAppender:i,__experimentalInsertionIndex:s,maxBlockPatterns:c,maxBlockTypes:p,showBlockDirectory:f=!1,isDraggable:h=!0,shouldFocusBlock:v=!0,prioritizePatterns:b}=e;const _=(0,d.useDebounce)(qt.speak,500),[k,y]=$p({onSelect:n,rootClientId:r,clientId:l,isAppender:i,insertionIndex:s,shouldFocusBlock:v}),[E,C,w,S]=Mp(k,y),[B,,I]=zp(y,k),x=(0,a.useMemo)((()=>{if(0===c)return[];const e=dm(B,t);return void 0!==c?e.slice(0,c):e}),[t,B,c]);let T=p;b&&x.length>2&&(T=0);const N=(0,a.useMemo)((()=>{if(0===T)return[];const e=um((0,u.orderBy)(E,["frecency"],["desc"]),C,w,t);return void 0!==T?e.slice(0,T):e}),[t,E,C,w,p]);(0,a.useEffect)((()=>{if(!t)return;const e=N.length+x.length,n=(0,g.sprintf)((0,g._n)("%d result found.","%d results found.",e),e);_(n)}),[t,_]);const P=(0,d.useAsyncList)(N,{step:9}),M=(0,d.useAsyncList)(P.length===N.length?x:Sm),L=!(0,u.isEmpty)(N)||!(0,u.isEmpty)(x),R=!!N.length&&(0,a.createElement)(Pp,{title:(0,a.createElement)(m.VisuallyHidden,null,(0,g.__)("Blocks"))},(0,a.createElement)(Np,{items:P,onSelect:S,onHover:o,label:(0,g.__)("Blocks"),isDraggable:h})),A=!!x.length&&(0,a.createElement)(Pp,{title:(0,a.createElement)(m.VisuallyHidden,null,(0,g.__)("Block Patterns"))},(0,a.createElement)("div",{className:"block-editor-inserter__quick-inserter-patterns"},(0,a.createElement)(Hp,{shownPatterns:M,blockPatterns:x,onClickPattern:I,isDraggable:h})));return(0,a.createElement)(Lp,null,!f&&!L&&(0,a.createElement)(jp,null),b?A:R,!!N.length&&!!x.length&&(0,a.createElement)("div",{className:"block-editor-inserter__quick-inserter-separator"}),b?R:A,f&&(0,a.createElement)(wm.Slot,{fillProps:{onSelect:S,onHover:o,filterValue:t,hasItems:L,rootClientId:k}},(e=>e.length?e:L?null:(0,a.createElement)(jp,null))))};const Im={name:"blocks",title:(0,g.__)("Blocks")},xm={name:"patterns",title:(0,g.__)("Patterns")},Tm={name:"reusable",title:(0,g.__)("Reusable")};var Nm=function(e){let{children:t,showPatterns:n=!1,showReusableBlocks:o=!1,onSelect:r,prioritizePatterns:l}=e;const i=(0,a.useMemo)((()=>{const e=[];return l&&n&&e.push(xm),e.push(Im),!l&&n&&e.push(xm),o&&e.push(Tm),e}),[l,Im,n,xm,o,Tm]);return(0,a.createElement)(m.TabPanel,{className:"block-editor-inserter__tabs",tabs:i,onSelect:r},t)};var Pm=(0,a.forwardRef)((function(e,t){let{rootClientId:n,clientId:o,isAppender:r,__experimentalInsertionIndex:l,onSelect:i,showInserterHelpPanel:s,showMostUsedBlocks:u,__experimentalFilterValue:d="",shouldFocusBlock:f=!0,prioritizePatterns:h}=e;const[v,b]=(0,a.useState)(d),[_,k]=(0,a.useState)(null),[y,E]=(0,a.useState)(null),[C,w,S]=$p({rootClientId:n,clientId:o,isAppender:r,insertionIndex:l,shouldFocusBlock:f}),{showPatterns:B,hasReusableBlocks:I}=(0,p.useSelect)((e=>{var t;const{__experimentalGetAllowedPatterns:n,getSettings:o}=e(so);return{showPatterns:!!n(C).length,hasReusableBlocks:!(null===(t=o().__experimentalReusableBlocks)||void 0===t||!t.length)}}),[C]),x=(0,a.useCallback)(((e,t,n)=>{w(e,t,n),i()}),[w,i]),T=(0,a.useCallback)(((e,t)=>{w(e,{patternName:t}),i()}),[w,i]),N=(0,a.useCallback)((e=>{S(!!e),k(e)}),[S,k]),P=(0,a.useCallback)((e=>{E(e)}),[E]),M=(0,a.useMemo)((()=>(0,a.createElement)(a.Fragment,null,(0,a.createElement)("div",{className:"block-editor-inserter__block-list"},(0,a.createElement)(Ap,{rootClientId:C,onInsert:x,onHover:N,showMostUsedBlocks:u})),s&&(0,a.createElement)("div",{className:"block-editor-inserter__tips"},(0,a.createElement)(m.VisuallyHidden,{as:"h2"},(0,g.__)("A tip for using the block editor")),(0,a.createElement)(Ru,null)))),[C,x,N,v,u,s]),L=(0,a.useMemo)((()=>(0,a.createElement)(bm,{rootClientId:C,onInsert:T,onClickCategory:P,selectedCategory:y})),[C,T,P,y]),R=(0,a.useMemo)((()=>(0,a.createElement)(ym,{rootClientId:C,onInsert:x,onHover:N})),[C,x,N]),A=(0,a.useCallback)((e=>"blocks"===e.name?M:"patterns"===e.name?L:R),[M,L,R]),D=(0,a.useRef)();(0,a.useImperativeHandle)(t,(()=>({focusSearch:()=>{D.current.focus()}})));const O=!v&&(B||I);return(0,a.createElement)("div",{className:"block-editor-inserter__menu"},(0,a.createElement)("div",{className:c()("block-editor-inserter__main-area",{"show-as-tabs":O})},(0,a.createElement)(m.SearchControl,{className:"block-editor-inserter__search",onChange:e=>{_&&k(null),b(e)},value:v,label:(0,g.__)("Search for blocks and patterns"),placeholder:(0,g.__)("Search"),ref:D}),!!v&&(0,a.createElement)("div",{className:"block-editor-inserter__no-tab-container"},(0,a.createElement)(Bm,{filterValue:v,onSelect:i,onHover:N,rootClientId:n,clientId:o,isAppender:r,__experimentalInsertionIndex:l,showBlockDirectory:!0,shouldFocusBlock:f})),O&&(0,a.createElement)(Nm,{showPatterns:B,showReusableBlocks:I,prioritizePatterns:h},A),!v&&!O&&(0,a.createElement)("div",{className:"block-editor-inserter__no-tab-container"},M)),s&&_&&(0,a.createElement)(yp,{item:_}))}));function Mm(e){let{onSelect:t,rootClientId:n,clientId:o,isAppender:r,prioritizePatterns:l}=e;const[i,s]=(0,a.useState)(""),[u,d]=$p({onSelect:t,rootClientId:n,clientId:o,isAppender:r}),[f]=Mp(u,d),[h]=zp(d,u),{setInserterIsOpened:v,insertionIndex:b}=(0,p.useSelect)((e=>{const{getSettings:t,getBlockIndex:n,getBlockCount:r}=e(so),l=t(),i=n(o),a=r();return{setInserterIsOpened:l.__experimentalSetIsInserterOpened,insertionIndex:-1===i?a:i}}),[o]),_=h.length&&(!!i||l),k=_&&h.length>6||f.length>6;(0,a.useEffect)((()=>{v&&v(!1)}),[v]);let y=0;return _&&(y=l?4:2),(0,a.createElement)("div",{className:c()("block-editor-inserter__quick-inserter",{"has-search":k,"has-expand":v})},k&&(0,a.createElement)(m.SearchControl,{className:"block-editor-inserter__search",value:i,onChange:e=>{s(e)},label:(0,g.__)("Search for blocks and patterns"),placeholder:(0,g.__)("Search")}),(0,a.createElement)("div",{className:"block-editor-inserter__quick-inserter-results"},(0,a.createElement)(Bm,{filterValue:i,onSelect:t,rootClientId:n,clientId:o,isAppender:r,maxBlockPatterns:y,maxBlockTypes:6,isDraggable:!1,prioritizePatterns:l})),v&&(0,a.createElement)(m.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 Lm=e=>{let t,{onToggle:n,disabled:o,isOpen:r,blockTitle:l,hasSingleBlockType:s,toggleProps:c={},prioritizePatterns:u}=e;t=s?(0,g.sprintf)((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,...p}=c;return(0,a.createElement)(m.Button,i({icon:Mu,label:t,tooltipPosition:"bottom",onClick:function(e){n&&n(e),d&&d(e)},className:"block-editor-inserter__toggle","aria-haspopup":!s&&"true","aria-expanded":!s&&r,disabled:o},p))};class Rm extends a.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:a,hasItems:s,renderToggle:c=Lm,prioritizePatterns:u}=this.props;return c({onToggle:t,isOpen:n,disabled:o||!s,blockTitle:r,hasSingleBlockType:l,directInsertBlock:i,toggleProps:a,prioritizePatterns:u})}renderContent(e){let{onClose:t}=e;const{rootClientId:n,clientId:o,isAppender:r,showInserterHelpPanel:l,__experimentalIsQuick:i,prioritizePatterns:s}=this.props;return i?(0,a.createElement)(Mm,{onSelect:()=>{t()},rootClientId:n,clientId:o,isAppender:r,prioritizePatterns:s}):(0,a.createElement)(Pm,{onSelect:()=>{t()},rootClientId:n,clientId:o,isAppender:r,showInserterHelpPanel:l,prioritizePatterns:s})}render(){const{position:e,hasSingleBlockType:t,directInsertBlock:n,insertOnlyAllowedBlock:o,__experimentalIsQuick:r,onSelectOrClose:l}=this.props;return t||n?this.renderToggle({onToggle:o}):(0,a.createElement)(m.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 Am=(0,d.compose)([(0,p.withSelect)(((e,t)=>{var n;let{clientId:o,rootClientId:l}=t;const{getBlockRootClientId:i,hasInserterItems:a,__experimentalGetAllowedBlocks:s,__experimentalGetDirectInsertBlock:c,getSettings:u}=e(so),{getBlockVariations:d}=e(r.store);l=l||i(o)||void 0;const p=s(l),m=c(l),f=u(),g=1===(null==p?void 0:p.length)&&0===(null===(n=d(p[0].name,"inserter"))||void 0===n?void 0:n.length);let h=!1;return g&&(h=p[0]),{hasItems:a(l),hasSingleBlockType:g,blockTitle:h?h.title:"",allowedBlockType:h,directInsertBlock:m,rootClientId:l,prioritizePatterns:f.__experimentalPreferPatternsOnRoot&&!l}})),(0,p.withDispatch)(((e,t,n)=>{let{select:o}=n;return{insertOnlyAllowedBlock(){const{rootClientId:n,clientId:l,isAppender:i,hasSingleBlockType:a,allowedBlockType:s,directInsertBlock:c,onSelectOrClose:u}=t;if(!a&&!c)return;const{insertBlock:d}=e(so);let p;if(c){const e=function(e){const{getBlock:t,getPreviousBlockClientId:r}=o(so);if(!e||!l&&!n)return{};const i={};let a={};if(l){const e=t(l),n=t(r(l));(null==e?void 0:e.name)===(null==n?void 0:n.name)&&(a=(null==n?void 0:n.attributes)||{})}else{var s;const e=t(n);if(null!=e&&null!==(s=e.innerBlocks)&&void 0!==s&&s.length){const t=e.innerBlocks[e.innerBlocks.length-1];c&&(null==c?void 0:c.name)===t.name&&(a=t.attributes)}}return e.forEach((e=>{a.hasOwnProperty(e)&&(i[e]=a[e])})),i}(c.attributesToCopy);p=(0,r.createBlock)(c.name,{...c.attributes||{},...e})}else p=(0,r.createBlock)(s.name);d(p,function(){const{getBlockIndex:e,getBlockSelectionEnd:t,getBlockOrder:r,getBlockRootClientId:a}=o(so);if(l)return e(l);const s=t();return!i&&s&&a(s)===n?e(s)+1:r(n).length}(),n),u&&u();const m=(0,g.sprintf)((0,g.__)("%s block added"),s.title);(0,qt.speak)(m)}}})),(0,d.ifCondition)((e=>{let{hasItems:t,isAppender:n,rootClientId:o,clientId:r}=e;return t||!n&&!o&&!r}))])(Rm);var Dm=(0,d.compose)((0,p.withSelect)(((e,t)=>{const{getBlockCount:n,getSettings:o,getTemplateLock:r}=e(so),l=!n(t.rootClientId),{bodyPlaceholder:i}=o();return{showPrompt:l,isLocked:!!r(t.rootClientId),placeholder:i}})),(0,p.withDispatch)(((e,t)=>{const{insertDefaultBlock:n,startTyping:o}=e(so);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,Pu.decodeEntities)(r)||(0,g.__)("Type / to choose a block");return(0,a.createElement)("div",{"data-root-client-id":l||"",className:c()("block-editor-default-block-appender",{"has-visible-prompt":o})},(0,a.createElement)("p",{tabIndex:"0",role:"button","aria-label":(0,g.__)("Add default block"),className:"block-editor-default-block-appender__content",onKeyDown:e=>{ku.ENTER!==e.keyCode&&ku.SPACE!==e.keyCode||n()},onClick:()=>n(),onFocus:()=>{o&&n()}},o?i:"\ufeff"),(0,a.createElement)(Am,{rootClientId:l,position:"bottom right",isAppender:!0,__experimentalIsQuick:!0}))}));function Om(e,t){let{rootClientId:n,className:o,onFocus:r,tabIndex:l}=e;return(0,a.createElement)(Am,{position:"bottom center",rootClientId:n,__experimentalIsQuick:!0,renderToggle:e=>{let n,{onToggle:i,disabled:s,isOpen:u,blockTitle:d,hasSingleBlockType:p}=e;n=p?(0,g.sprintf)((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=!p;let h=(0,a.createElement)(m.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:s,label:n},!p&&(0,a.createElement)(m.VisuallyHidden,{as:"span"},n),(0,a.createElement)(ul,{icon:Mu}));return(f||p)&&(h=(0,a.createElement)(m.Tooltip,{text:n},h)),h},isAppender:!0})}const zm=(0,a.forwardRef)(((e,t)=>(V()("wp.blockEditor.ButtonBlockerAppender",{alternative:"wp.blockEditor.ButtonBlockAppender",since:"5.9"}),Om(e,t))));var Fm=(0,a.forwardRef)(Om);var Vm=function(e){let{rootClientId:t,renderAppender:n,className:o,tagName:l="div"}=e;const{hideInserter:i,canInsertDefaultBlock:s,selectedBlockClientId:u}=(0,p.useSelect)((e=>{const{canInsertBlockType:n,getTemplateLock:o,getSelectedBlockClientId:l,__unstableGetEditorMode:i}=e(so);return{hideInserter:!!o(t)||"zoom-out"===i(),canInsertDefaultBlock:n((0,r.getDefaultBlockName)(),t),selectedBlockClientId:l()}}),[t]);if(i||!1===n)return null;let d;if(n)d=(0,a.createElement)(n,null);else{if(!(u===t||!t&&!u))return null;d=s?(0,a.createElement)(Dm,{rootClientId:t}):(0,a.createElement)(Fm,{rootClientId:t,className:"block-list-appender__toggle"})}return(0,a.createElement)(l,{tabIndex:-1,className:c()("block-list-appender wp-block",o),contentEditable:!1,"data-block":!0},d)};const Hm=Number.MAX_SAFE_INTEGER;(0,a.createContext)();var Gm=function(e){let{previousClientId:t,nextClientId:n,children:o,__unstablePopoverSlot:r,__unstableContentRef:l,...s}=e;const[u,d]=(0,a.useReducer)((e=>(e+1)%Hm),0),{orientation:f,rootClientId:h,isVisible:v}=(0,p.useSelect)((e=>{var o;const{getBlockListSettings:r,getBlockRootClientId:l,isBlockVisible:i}=e(so),a=l(null!=t?t:n);return{orientation:(null===(o=r(a))||void 0===o?void 0:o.orientation)||"vertical",rootClientId:a,isVisible:i(t)&&i(n)}}),[t,n]),b=Lo(t),_=Lo(n),k="vertical"===f,y=(0,a.useMemo)((()=>{if(u<0||!b&&!_||!v)return{};const e=b?b.getBoundingClientRect():null,t=_?_.getBoundingClientRect():null;if(k)return{width:e?e.width:t.width,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:e?e.height:t.height}}),[b,_,k,u,v]),E=(0,a.useMemo)((()=>{if(u<0||!b&&!_||!v)return;const{ownerDocument:e}=b||_;return{ownerDocument:e,getBoundingClientRect(){const e=b?b.getBoundingClientRect():null,t=_?_.getBoundingClientRect():null;let n=0,o=0;return k?(o=e?e.bottom:t.top,n=(0,g.isRTL)()?e?e.right:t.right:e?e.left:t.left):(o=e?e.top:t.top,n=(0,g.isRTL)()?e?e.left:t.right:e?e.right:t.left),new window.DOMRect(n,o,0,0)}}}),[b,_,u,k,v]),C=_r(l);return(0,a.useLayoutEffect)((()=>{if(!b)return;const e=new window.MutationObserver(d);return e.observe(b,{attributes:!0}),()=>{e.disconnect()}}),[b]),(0,a.useLayoutEffect)((()=>{if(!_)return;const e=new window.MutationObserver(d);return e.observe(_,{attributes:!0}),()=>{e.disconnect()}}),[_]),(0,a.useLayoutEffect)((()=>{if(b)return b.ownerDocument.defaultView.addEventListener("resize",d),()=>{b.ownerDocument.defaultView.removeEventListener("resize",d)}}),[b]),(b||_)&&v?(0,a.createElement)(m.Popover,i({ref:C,animate:!1,anchor:E,focusOnMount:!1,__unstableSlotName:r||null,key:n+"--"+h},s,{className:c()("block-editor-block-popover","block-editor-block-popover__inbetween",s.className),resize:!1,flip:!1,placement:"bottom-start"}),(0,a.createElement)("div",{className:"block-editor-block-popover__inbetween-container",style:y},o)):null};const Um=(0,a.createContext)();function Wm(e){let{__unstablePopoverSlot:t,__unstableContentRef:n}=e;const{selectBlock:o,hideInsertionPoint:r}=(0,p.useDispatch)(so),l=(0,a.useContext)(Um),i=(0,a.useRef)(),{orientation:s,previousClientId:u,nextClientId:f,rootClientId:g,isInserterShown:h}=(0,p.useSelect)((e=>{var t;const{getBlockOrder:n,getBlockListSettings:o,getBlockInsertionPoint:r,isBlockBeingDragged:l,getPreviousBlockClientId:i,getNextBlockClientId:a}=e(so),s=r(),c=n(s.rootClientId);if(!c.length)return{};let u=c[s.index-1],d=c[s.index];for(;l(u);)u=i(u);for(;l(d);)d=a(d);return{previousClientId:u,nextClientId:d,orientation:(null===(t=o(s.rootClientId))||void 0===t?void 0:t.orientation)||"vertical",rootClientId:s.rootClientId,isInserterShown:null==s?void 0:s.__unstableWithInserter}}),[]),v="vertical"===s,b=(0,d.useReducedMotion)();const _={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}}},k={start:{scale:b?1:0},rest:{scale:1,transition:{delay:.2}}},y=c()("block-editor-block-list__insertion-point","is-"+s);return(0,a.createElement)(Gm,{previousClientId:u,nextClientId:f,__unstablePopoverSlot:t,__unstableContentRef:n},(0,a.createElement)(m.__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,a.createElement)(m.__unstableMotion.div,{variants:_,className:"block-editor-block-list__insertion-point-indicator","data-testid":"block-list-insertion-point-indicator"}),h&&(0,a.createElement)(m.__unstableMotion.div,{variants:k,className:c()("block-editor-block-list__insertion-point-inserter")},(0,a.createElement)(Am,{position:"bottom center",clientId:f,rootClientId:g,__experimentalIsQuick:!0,onToggle:e=>{l.current=e},onSelectOrClose:()=>{l.current=!1}}))))}function jm(e){return(0,p.useSelect)((e=>e(so).isBlockInsertionPointVisible()),[])&&(0,a.createElement)(Wm,e)}function $m(){const e=(0,a.useContext)(Um),t=(0,p.useSelect)((e=>e(so).getSettings().hasReducedUI||"zoom-out"===e(so).__unstableGetEditorMode()),[]),{getBlockListSettings:n,getBlockRootClientId:o,getBlockIndex:r,isBlockInsertionPointVisible:l,isMultiSelecting:i,getSelectedBlockClientIds:s,getTemplateLock:c,__unstableIsWithinBlockOverlay:u}=(0,p.useSelect)(so),{showInsertionPoint:m,hideInsertionPoint:f}=(0,p.useDispatch)(so);return(0,d.useRefEffect)((o=>{if(!t)return o.addEventListener("mousemove",a),()=>{o.removeEventListener("mousemove",a)};function a(t){var o;if(e.current)return;if(i())return;if(!t.target.classList.contains("block-editor-block-list__layout"))return void(l()&&f());let a;if(!t.target.classList.contains("is-root-container")){a=(t.target.getAttribute("data-block")?t.target:t.target.closest("[data-block]")).getAttribute("data-block")}if(c(a))return;const d=(null===(o=n(a))||void 0===o?void 0:o.orientation)||"vertical",p=t.target.getBoundingClientRect(),g=t.clientY-p.top,h=t.clientX-p.left;let v=Array.from(t.target.children).find((e=>e.classList.contains("wp-block")&&"vertical"===d&&e.offsetTop>g||e.classList.contains("wp-block")&&"horizontal"===d&&e.offsetLeft>h));if(!v)return;if(!v.id&&(v=v.firstElementChild,!v))return;const b=v.id.slice("block-".length);if(!b||u(b))return;if(s().includes(b))return;const _=v.getBoundingClientRect();if("horizontal"===d&&(t.clientY>_.bottom||t.clientY<_.top)||"vertical"===d&&(t.clientX>_.right||t.clientX<_.left))return void(l()&&f());const k=r(b);0!==k?m(a,k,{__unstableWithInserter:!0}):l()&&f()}}),[e,n,o,r,l,i,m,f,s,t])}const Km="undefined"==typeof window?e=>{setTimeout((()=>e(Date.now())),0)}:window.requestIdleCallback||window.requestAnimationFrame,qm="undefined"==typeof window?clearTimeout:window.cancelIdleCallback||window.cancelAnimationFrame;function Ym(e){return(0,p.useSelect)((t=>{if(!e)return null;const{getBlockName:n,getBlockAttributes:o}=t(so),{getBlockType:l,getActiveBlockVariation:i}=t(r.store),a=n(e),s=l(a);if(!s)return null;const c=o(e),u=i(a,c),d={title:s.title,icon:s.icon,description:s.description,anchor:null==c?void 0:c.anchor};return u?{title:u.title||s.title,icon:u.icon||s.icon,description:u.description||s.description,anchor:null==c?void 0:c.anchor}:d}),[e])}function Zm(e){let{clientId:t,maximumLength:n,context:o}=e;const{attributes:l,name:i,reusableBlockTitle:a}=(0,p.useSelect)((e=>{if(!t)return{};const{getBlockName:n,getBlockAttributes:o,__experimentalGetReusableBlockTitle:l}=e(so),i=n(t);if(!i)return{};const a=(0,r.isReusableBlock)((0,r.getBlockType)(i));return{attributes:o(t),name:i,reusableBlockTitle:a&&l(o(t).ref)}}),[t]),s=Ym(t);if(!i||!s)return null;const c=(0,r.getBlockType)(i),u=c?(0,r.__experimentalGetBlockLabel)(c,l,o):null,d=a||u,m=d&&d!==c.title?d:s.title;if(n&&n>0&&m.length>n){const e="...";return m.slice(0,n-e.length)+e}return m}function Qm(e){let{clientId:t,maximumLength:n,context:o}=e;return Zm({clientId:t,maximumLength:n,context:o})}var Xm=e=>{let{children:t,clientIds:n,cloneClassname:o,onDragStart:l,onDragEnd:i}=e;const{srcRootClientId:s,isDraggable:c,icon:u}=(0,p.useSelect)((e=>{var t;const{canMoveBlocks:o,getBlockRootClientId:l,getBlockName:i}=e(so),a=l(n[0]),s=i(n[0]);return{srcRootClientId:a,isDraggable:o(n,a),icon:null===(t=(0,r.getBlockType)(s))||void 0===t?void 0:t.icon}}),[n]),d=(0,a.useRef)(!1),[f,g,h]=function(){const e=(0,a.useRef)(null),t=(0,a.useRef)(null),n=(0,a.useRef)(null),o=(0,a.useRef)(null);return(0,a.useEffect)((()=>()=>{o.current&&(clearInterval(o.current),o.current=null)}),[]),[(0,a.useCallback)((r=>{e.current=r.clientY,n.current=(0,Wl.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,a.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,p.useDispatch)(so);if((0,a.useEffect)((()=>()=>{d.current&&b()}),[]),!c)return t({isDraggable:!1});const _={type:"block",srcClientIds:n,srcRootClientId:s};return(0,a.createElement)(m.Draggable,{cloneClassname:o,__experimentalTransferDataType:"wp-blocks",transferData:_,onDragStart:e=>{v(n),d.current=!0,f(e),l&&l()},onDragOver:g,onDragEnd:()=>{b(),d.current=!1,h(),i&&i()},__experimentalDragComponent:(0,a.createElement)(Sp,{count:n.length,icon:u})},(e=>{let{onDraggableStart:n,onDraggableEnd:o}=e;return t({draggable:!0,onDragStart:n,onDragEnd:o})}))};var Jm=(0,a.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(D.Path,{d:"M10.6 6L9.4 7l4.6 5-4.6 5 1.2 1 5.4-6z"}));var ef=(0,a.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(D.Path,{d:"M14.6 7l-1.2-1L8 12l5.4 6 1.2-1-4.6-5z"}));var tf=(0,a.createElement)(D.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,a.createElement)(D.Path,{d:"M6.5 12.4L12 8l5.5 4.4-.9 1.2L12 10l-4.5 3.6-1-1.2z"}));var nf=(0,a.createElement)(D.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,a.createElement)(D.Path,{d:"M17.5 11.6L12 16l-5.5-4.4.9-1.2L12 14l4.5-3.6 1 1.2z"}));const of=(e,t)=>"up"===e?"horizontal"===t?(0,g.isRTL)()?"right":"left":"up":"down"===e?"horizontal"===t?(0,g.isRTL)()?"left":"right":"down":null;function rf(e,t,n,o,r,l,i){const a=n+1;if(e>1)return function(e,t,n,o,r,l){const i=t+1;if(n&&o)return(0,g.__)("All blocks are selected, and cannot be moved");if(r>0&&!o){const t=of("down",l);if("down"===t)return(0,g.sprintf)((0,g.__)("Move %1$d blocks from position %2$d down by one place"),e,i);if("left"===t)return(0,g.sprintf)((0,g.__)("Move %1$d blocks from position %2$d left by one place"),e,i);if("right"===t)return(0,g.sprintf)((0,g.__)("Move %1$d blocks from position %2$d right by one place"),e,i)}if(r>0&&o){const e=of("down",l);if("down"===e)return(0,g.__)("Blocks cannot be moved down as they are already at the bottom");if("left"===e)return(0,g.__)("Blocks cannot be moved left as they are already are at the leftmost position");if("right"===e)return(0,g.__)("Blocks cannot be moved right as they are already are at the rightmost position")}if(r<0&&!n){const t=of("up",l);if("up"===t)return(0,g.sprintf)((0,g.__)("Move %1$d blocks from position %2$d up by one place"),e,i);if("left"===t)return(0,g.sprintf)((0,g.__)("Move %1$d blocks from position %2$d left by one place"),e,i);if("right"===t)return(0,g.sprintf)((0,g.__)("Move %1$d blocks from position %2$d right by one place"),e,i)}if(r<0&&n){const e=of("up",l);if("up"===e)return(0,g.__)("Blocks cannot be moved up as they are already at the top");if("left"===e)return(0,g.__)("Blocks cannot be moved left as they are already are at the leftmost position");if("right"===e)return(0,g.__)("Blocks cannot be moved right as they are already are at the rightmost position")}}(e,n,o,r,l,i);if(o&&r)return(0,g.sprintf)((0,g.__)("Block %s is the only block, and cannot be moved"),t);if(l>0&&!r){const e=of("down",i);if("down"===e)return(0,g.sprintf)((0,g.__)("Move %1$s block from position %2$d down to position %3$d"),t,a,a+1);if("left"===e)return(0,g.sprintf)((0,g.__)("Move %1$s block from position %2$d left to position %3$d"),t,a,a+1);if("right"===e)return(0,g.sprintf)((0,g.__)("Move %1$s block from position %2$d right to position %3$d"),t,a,a+1)}if(l>0&&r){const e=of("down",i);if("down"===e)return(0,g.sprintf)((0,g.__)("Block %1$s is at the end of the content and cant be moved down"),t);if("left"===e)return(0,g.sprintf)((0,g.__)("Block %1$s is at the end of the content and cant be moved left"),t);if("right"===e)return(0,g.sprintf)((0,g.__)("Block %1$s is at the end of the content and cant be moved right"),t)}if(l<0&&!o){const e=of("up",i);if("up"===e)return(0,g.sprintf)((0,g.__)("Move %1$s block from position %2$d up to position %3$d"),t,a,a-1);if("left"===e)return(0,g.sprintf)((0,g.__)("Move %1$s block from position %2$d left to position %3$d"),t,a,a-1);if("right"===e)return(0,g.sprintf)((0,g.__)("Move %1$s block from position %2$d right to position %3$d"),t,a,a-1)}if(l<0&&o){const e=of("up",i);if("up"===e)return(0,g.sprintf)((0,g.__)("Block %1$s is at the beginning of the content and cant be moved up"),t);if("left"===e)return(0,g.sprintf)((0,g.__)("Block %1$s is at the beginning of the content and cant be moved left"),t);if("right"===e)return(0,g.sprintf)((0,g.__)("Block %1$s is at the beginning of the content and cant be moved right"),t)}}const lf=(e,t)=>"up"===e?"horizontal"===t?(0,g.isRTL)()?Jm:ef:tf:"down"===e?"horizontal"===t?(0,g.isRTL)()?ef:Jm:nf:null,af=(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,sf=(0,a.forwardRef)(((e,t)=>{let{clientIds:n,direction:o,orientation:l,...s}=e;const u=(0,d.useInstanceId)(sf),f=Array.isArray(n)?n:[n],g=f.length,{blockType:h,isDisabled:v,rootClientId:b,isFirst:_,isLast:k,firstIndex:y,orientation:E="vertical"}=(0,p.useSelect)((e=>{const{getBlockIndex:t,getBlockRootClientId:n,getBlockOrder:i,getBlock:a,getBlockListSettings:s}=e(so),c=f[0],u=n(c),d=t(c),p=t(f[f.length-1]),m=i(u),g=a(c),h=0===d,v=p===m.length-1,{orientation:b}=s(u)||{};return{blockType:g?(0,r.getBlockType)(g.name):null,isDisabled:"up"===o?h:v,rootClientId:u,firstIndex:d,isFirst:h,isLast:v,orientation:l||b}}),[n,o]),{moveBlocksDown:C,moveBlocksUp:w}=(0,p.useDispatch)(so),S="up"===o?w:C,B=`block-editor-block-mover-button__description-${u}`;return(0,a.createElement)(a.Fragment,null,(0,a.createElement)(m.Button,i({ref:t,className:c()("block-editor-block-mover-button",`is-${o}-button`),icon:lf(o,E),label:af(o,E),"aria-describedby":B},s,{onClick:v?null:e=>{S(n,b),s.onClick&&s.onClick(e)},disabled:v,__experimentalIsFocusable:!0})),(0,a.createElement)(m.VisuallyHidden,{id:B},rf(g,h&&h.title,y,_,k,"up"===o?-1:1,E)))})),cf=(0,a.forwardRef)(((e,t)=>(0,a.createElement)(sf,i({direction:"up",ref:t},e)))),uf=(0,a.forwardRef)(((e,t)=>(0,a.createElement)(sf,i({direction:"down",ref:t},e))));var df=function(e){let{clientIds:t,hideDragHandle:n}=e;const{canMove:o,rootClientId:r,isFirst:l,isLast:s,orientation:u}=(0,p.useSelect)((e=>{var n;const{getBlockIndex:o,getBlockListSettings:r,canMoveBlocks:l,getBlockOrder:i,getBlockRootClientId:a}=e(so),s=Array.isArray(t)?t:[t],c=s[0],u=a(c),d=o(c),p=o(s[s.length-1]),m=i(u);return{canMove:l(t,u),rootClientId:u,isFirst:0===d,isLast:p===m.length-1,orientation:null===(n=r(u))||void 0===n?void 0:n.orientation}}),[t]);if(!o||l&&s&&!r)return null;const d=(0,g.__)("Drag");return(0,a.createElement)(m.ToolbarGroup,{className:c()("block-editor-block-mover",{"is-horizontal":"horizontal"===u})},!n&&(0,a.createElement)(Xm,{clientIds:t},(e=>(0,a.createElement)(m.Button,i({icon:wp,className:"block-editor-block-mover__drag-handle","aria-hidden":"true",label:d,tabIndex:"-1"},e)))),(0,a.createElement)("div",{className:"block-editor-block-mover__move-button-container"},(0,a.createElement)(m.ToolbarItem,null,(e=>(0,a.createElement)(cf,i({clientIds:t},e)))),(0,a.createElement)(m.ToolbarItem,null,(e=>(0,a.createElement)(uf,i({clientIds:t},e))))))};var pf=function(e){let{clientId:t,rootClientId:n}=e;const o=Ym(t),l=(0,p.useSelect)((e=>{var o;const{getBlock:r,getBlockIndex:l,hasBlockMovingClientId:i,getBlockListSettings:a,__unstableGetEditorMode:s}=e(so),c=l(t),{name:u,attributes:d}=r(t);return{index:c,name:u,attributes:d,blockMovingMode:i(),orientation:null===(o=a(n))||void 0===o?void 0:o.orientation,editorMode:s()}}),[t,n]),{index:s,name:u,attributes:d,blockMovingMode:f,orientation:h,editorMode:v}=l,{setNavigationMode:b,removeBlock:_}=(0,p.useDispatch)(so),k=(0,a.useRef)(),y=(0,r.getBlockType)(u),E=(0,r.__experimentalGetAccessibleBlockLabel)(y,d,s+1,h);(0,a.useEffect)((()=>{k.current.focus(),(0,qt.speak)(E)}),[E]);const C=Lo(t),{hasBlockMovingClientId:w,getBlockIndex:S,getBlockRootClientId:B,getClientIdsOfDescendants:I,getSelectedBlockClientId:x,getMultiSelectedBlocksEndClientId:T,getPreviousBlockClientId:N,getNextBlockClientId:P}=(0,p.useSelect)(so),{selectBlock:M,clearSelectedBlock:L,setBlockMovingClientId:R,moveBlockToPosition:A}=(0,p.useDispatch)(so),D=c()("block-editor-block-list__block-selection-button",{"is-block-moving-mode":!!f}),O=(0,g.__)("Drag");return(0,a.createElement)("div",{className:D},(0,a.createElement)(m.Flex,{justify:"center",className:"block-editor-block-list__block-selection-button__content"},(0,a.createElement)(m.FlexItem,null,(0,a.createElement)(Du,{icon:null==o?void 0:o.icon,showColors:!0})),(0,a.createElement)(m.FlexItem,null,"zoom-out"===v&&(0,a.createElement)(df,{clientIds:[t],hideDragHandle:!0}),"navigation"===v&&(0,a.createElement)(Xm,{clientIds:[t]},(e=>(0,a.createElement)(m.Button,i({icon:wp,className:"block-selection-button_drag-handle","aria-hidden":"true",label:O,tabIndex:"-1"},e))))),(0,a.createElement)(m.FlexItem,null,(0,a.createElement)(m.Button,{ref:k,onClick:"navigation"===v?()=>b(!1):void 0,onKeyDown:function(e){const{keyCode:n}=e,o=n===ku.UP,r=n===ku.DOWN,l=n===ku.LEFT,i=n===ku.RIGHT,a=n===ku.TAB,s=n===ku.ESCAPE,c=n===ku.ENTER,u=n===ku.SPACE,d=e.shiftKey;if(n===ku.BACKSPACE||n===ku.DELETE)return _(t),void e.preventDefault();const p=x(),m=T(),f=N(m||p),g=P(m||p),h=a&&d||o,v=a&&!d||r,b=l,k=i;let y;if(h)y=f;else if(v)y=g;else if(b){var E;y=null!==(E=B(p))&&void 0!==E?E:p}else if(k){var D;y=null!==(D=I([p])[0])&&void 0!==D?D:p}const O=w();if(s&&O&&!e.defaultPrevented&&(R(null),e.preventDefault()),(c||u)&&O){const e=B(O),t=B(p),n=S(O);let o=S(p);n<o&&e===t&&(o-=1),A(O,e,t,o),M(O),R(null)}if(v||h||b||k)if(y)e.preventDefault(),M(y);else if(a&&p){let t;if(v){t=C;do{t=Wl.focus.tabbable.findNext(t)}while(t&&C.contains(t));t||(t=C.ownerDocument.defaultView.frameElement,t=Wl.focus.tabbable.findNext(t))}else t=Wl.focus.tabbable.findPrevious(C);t&&(e.preventDefault(),t.focus(),L())}},label:E,showTooltip:!1,className:"block-selection-button_select-button"},(0,a.createElement)(Qm,{clientId:t,maximumLength:35})))))};function mf(e){return Array.from(e.querySelectorAll("[data-toolbar-item]"))}function ff(e,t,n,o,r){const[l]=(0,a.useState)(t),[i]=(0,a.useState)(o),s=(0,a.useCallback)((()=>{!function(e){const[t]=Wl.focus.tabbable.find(e);t&&t.focus({preventScroll:!0})}(e.current)}),[]);(0,Yu.useShortcut)("core/block-editor/focus-toolbar",s),(0,a.useEffect)((()=>{l&&s()}),[n,l,s]),(0,a.useEffect)((()=>{let t=0;return i&&!l&&(t=window.requestAnimationFrame((()=>{const t=mf(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=mf(e.current).findIndex((e=>0===e.tabIndex));r(n)}}),[i,l])}var gf=function(e){let{children:t,focusOnMount:n,__experimentalInitialIndex:o,__experimentalOnIndexChange:r,...l}=e;const s=(0,a.useRef)(),c=function(e){const[t,n]=(0,a.useState)(!0),o=(0,a.useCallback)((()=>{const t=!Wl.focus.tabbable.find(e.current).some((e=>!("toolbarItem"in e.dataset)));t||V()("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,a.useLayoutEffect)((()=>{const t=new window.MutationObserver(o);return t.observe(e.current,{childList:!0,subtree:!0}),()=>t.disconnect()}),[t]),t}(s);return ff(s,n,c,o,r),c?(0,a.createElement)(m.Toolbar,i({label:l["aria-label"],ref:s},l),t):(0,a.createElement)(m.NavigableMenu,i({orientation:"horizontal",role:"toolbar",ref:s},l),t)};const{clearTimeout:hf,setTimeout:vf}=window,bf=()=>{},_f=200;function kf(e){let{ref:t,isFocused:n,debounceTimeout:o=_f,onChange:r=bf}=e;const[l,i]=(0,a.useState)(!1),s=(0,a.useRef)(),c=e=>{null!=t&&t.current&&i(e),r(e)},u=()=>{const e=(null==t?void 0:t.current)&&t.current.matches(":hover");return!n&&!e},d=()=>{const e=s.current;e&&hf&&hf(e)};return(0,a.useEffect)((()=>()=>{c(!1),d()}),[]),{showMovers:l,debouncedShowMovers:e=>{e&&e.stopPropagation(),d(),l||c(!0)},debouncedHideMovers:e=>{e&&e.stopPropagation(),d(),s.current=vf((()=>{u()&&c(!1)}),o)}}}function yf(e){let{ref:t,debounceTimeout:n=_f,onChange:o=bf}=e;const[r,l]=(0,a.useState)(!1),{showMovers:i,debouncedShowMovers:s,debouncedHideMovers:c}=kf({ref:t,debounceTimeout:n,isFocused:r,onChange:o}),u=(0,a.useRef)(!1),d=()=>(null==t?void 0:t.current)&&t.current.contains(t.current.ownerDocument.activeElement);return(0,a.useEffect)((()=>{const e=t.current,n=()=>{d()&&(l(!0),s())},o=()=>{d()||(l(!1),c())};return e&&!u.current&&(e.addEventListener("focus",n,!0),e.addEventListener("blur",o,!0),u.current=!0),()=>{e&&(e.removeEventListener("focus",n),e.removeEventListener("blur",o))}}),[t,u,l,s,c]),{showMovers:i,gestures:{onMouseMove:s,onMouseLeave:c}}}function Ef(){const{selectBlock:e,toggleBlockHighlight:t}=(0,p.useDispatch)(so),{firstParentClientId:n,shouldHide:o,hasReducedUI:l}=(0,p.useSelect)((e=>{const{getBlockName:t,getBlockParents:n,getSelectedBlockClientId:o,getSettings:l}=e(so),{hasBlockSupport:i}=e(r.store),a=n(o()),s=a[a.length-1],c=t(s),u=(0,r.getBlockType)(c),d=l();return{firstParentClientId:s,shouldHide:!i(u,"__experimentalParentSelector",!0),hasReducedUI:d.hasReducedUI}}),[]),s=Ym(n),c=(0,a.useRef)(),{gestures:u}=yf({ref:c,onChange(e){e&&l||t(n,e)}});return o||void 0===n?null:(0,a.createElement)("div",i({className:"block-editor-block-parent-selector",key:n,ref:c},u),(0,a.createElement)(m.ToolbarButton,{className:"block-editor-block-parent-selector__button",onClick:()=>e(n),label:(0,g.sprintf)((0,g.__)("Select %s"),s.title),showTooltip:!0,icon:(0,a.createElement)(Du,{icon:s.icon})}))}var Cf=(0,a.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(D.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 wf(e){let{blocks:t}=e;return(0,a.createElement)("div",{className:"block-editor-block-switcher__popover__preview__parent"},(0,a.createElement)("div",{className:"block-editor-block-switcher__popover__preview__container"},(0,a.createElement)(m.Popover,{className:"block-editor-block-switcher__preview__popover",position:"bottom right",focusOnMount:!1},(0,a.createElement)("div",{className:"block-editor-block-switcher__preview"},(0,a.createElement)("div",{className:"block-editor-block-switcher__preview-title"},(0,g.__)("Preview")),(0,a.createElement)(_p,{viewportWidth:500,blocks:t})))))}function Sf(e){let{restTransformations:t,onSelect:n,setHoveredTransformItemName:o}=e;return t.map((e=>(0,a.createElement)(Bf,{key:e.name,item:e,onSelect:n,setHoveredTransformItemName:o})))}function Bf(e){let{item:t,onSelect:n,setHoveredTransformItemName:o}=e;const{name:l,icon:i,title:s,isDisabled:c}=t;return(0,a.createElement)(m.MenuItem,{className:(0,r.getBlockMenuDefaultClassName)(l),onClick:e=>{e.preventDefault(),n(l)},disabled:c,onMouseLeave:()=>o(null),onMouseEnter:()=>o(l)},(0,a.createElement)(Du,{icon:i,showColors:!0}),s)}var If=e=>{let{className:t,possibleBlockTransformations:n,onSelect:o,blocks:l}=e;const[i,s]=(0,a.useState)(),{priorityTextTransformations:c,restTransformations:u}=function(e){const t={"core/paragraph":1,"core/heading":2,"core/list":3,"core/quote":4},n=(0,a.useMemo)((()=>{const n=Object.keys(t);return e.reduce(((e,t)=>{const{name:o}=t;return n.includes(o)?e.priorityTextTransformations.push(t):e.restTransformations.push(t),e}),{priorityTextTransformations:[],restTransformations:[]})}),[e]);return n.priorityTextTransformations.sort(((e,n)=>{let{name:o}=e,{name:r}=n;return t[o]<t[r]?-1:1})),n}(n),d=c.length&&u.length,p=!!u.length&&(0,a.createElement)(Sf,{restTransformations:u,onSelect:o,setHoveredTransformItemName:s});return(0,a.createElement)(a.Fragment,null,(0,a.createElement)(m.MenuGroup,{label:(0,g.__)("Transform to"),className:t},i&&(0,a.createElement)(wf,{blocks:(0,r.switchToBlockType)(l,i)}),c.map((e=>(0,a.createElement)(Bf,{key:e.name,item:e,onSelect:o,setHoveredTransformItemName:s}))),!d&&p),!!d&&(0,a.createElement)(m.MenuGroup,{className:t},p))};var xf=(0,a.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(D.Path,{d:"M16.7 7.1l-6.3 8.5-3.3-2.5-.9 1.2 4.5 3.4L17.9 8z"})),Tf=window.wp.tokenList,Nf=n.n(Tf);function Pf(e,t,n){const o=new(Nf())(e);return t&&o.remove("is-style-"+t.name),o.add("is-style-"+n.name),o.value}function Mf(e){return(0,u.find)(e,"isDefault")}function Lf(e){let{clientId:t,onSwitch:n}=e;const{styles:o,block:l,blockType:i,className:s}=(0,p.useSelect)((e=>{const{getBlock:n}=e(so),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,p.useDispatch)(so),d=function(e){return e&&0!==e.length?Mf(e)?e:[{name:"default",label:(0,g._x)("Default","block style"),isDefault:!0},...e]:[]}(o),m=function(e,t){for(const n of new(Nf())(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,s),f=function(e,t){return(0,a.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=Pf(s,m,e);c(t,{className:o}),n()},stylesToRender:d,activeStyle:m,genericPreviewBlock:f,className:s}}const Rf=()=>{};function Af(e){let{clientId:t,onSwitch:n=Rf}=e;const{onSelect:o,stylesToRender:r,activeStyle:l}=Lf({clientId:t,onSwitch:n});return r&&0!==r.length?(0,a.createElement)(a.Fragment,null,r.map((e=>{const t=e.label||e.name;return(0,a.createElement)(m.MenuItem,{key:e.name,icon:l.name===e.name?xf:null,onClick:()=>o(e)},(0,a.createElement)(m.__experimentalText,{as:"span",limit:18,ellipsizeMode:"tail",truncate:!0},t))}))):null}function Df(e){let{hoveredBlock:t,onSwitch:n}=e;const{clientId:o}=t;return(0,a.createElement)(m.MenuGroup,{label:(0,g.__)("Styles"),className:"block-editor-block-switcher__styles__menugroup"},(0,a.createElement)(Af,{clientId:o,onSwitch:n}))}const Of=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=Of(e,t,n);if(o)return o}}},zf=(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}};var Ff=(e,t)=>(0,a.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=Of(r,t.name,o);if(n){e=!0,o.add(n.clientId),zf(n,t);break}}if(!e)return}return n})(t,n.blocks);return o&&e.push({...n,transformedBlocks:o}),e}),[])),[e,t]);function Vf(e){let{patterns:t,onSelect:n}=e;return(0,a.createElement)("div",{className:"block-editor-block-switcher__popover__preview__parent"},(0,a.createElement)("div",{className:"block-editor-block-switcher__popover__preview__container"},(0,a.createElement)(m.Popover,{className:"block-editor-block-switcher__preview__popover",position:"bottom right"},(0,a.createElement)("div",{className:"block-editor-block-switcher__preview"},(0,a.createElement)("div",{className:"block-editor-block-switcher__preview-title"},(0,g.__)("Preview")),(0,a.createElement)(Hf,{patterns:t,onSelect:n})))))}function Hf(e){let{patterns:t,onSelect:n}=e;const o=(0,m.__unstableUseCompositeState)();return(0,a.createElement)(m.__unstableComposite,i({},o,{role:"listbox",className:"block-editor-block-switcher__preview-patterns-container","aria-label":(0,g.__)("Patterns list")}),t.map((e=>(0,a.createElement)(Gf,{key:e.name,pattern:e,onSelect:n,composite:o}))))}function Gf(e){let{pattern:t,onSelect:n,composite:o}=e;const r="block-editor-block-switcher__preview-patterns-container",l=(0,d.useInstanceId)(Gf,`${r}-list__item-description`);return(0,a.createElement)("div",{className:`${r}-list__list-item`,"aria-label":t.title,"aria-describedby":t.description?l:void 0},(0,a.createElement)(m.__unstableCompositeItem,i({role:"option",as:"div"},o,{className:`${r}-list__item`,onClick:()=>n(t.transformedBlocks)}),(0,a.createElement)(_p,{blocks:t.transformedBlocks,viewportWidth:t.viewportWidth||500}),(0,a.createElement)("div",{className:`${r}-list__item-title`},t.title)),!!t.description&&(0,a.createElement)(m.VisuallyHidden,{id:l},t.description))}var Uf=function(e){let{blocks:t,patterns:n,onSelect:o}=e;const[r,l]=(0,a.useState)(!1),i=Ff(n,t);return i.length?(0,a.createElement)(m.MenuGroup,{className:"block-editor-block-switcher__pattern__transforms__menugroup"},r&&(0,a.createElement)(Vf,{patterns:i,onSelect:o}),(0,a.createElement)(m.MenuItem,{onClick:e=>{e.preventDefault(),l(!r)},icon:Jm},(0,g.__)("Patterns"))):null};const Wf=e=>{let{clientIds:t,blocks:n}=e;const{replaceBlocks:o}=(0,p.useDispatch)(so),l=Ym(n[0].clientId),{possibleBlockTransformations:i,canRemove:s,hasBlockStyles:c,icon:d,patterns:f}=(0,p.useSelect)((e=>{const{getBlockRootClientId:o,getBlockTransformItems:i,__experimentalGetPatternTransformItems:a}=e(so),{getBlockStyles:s,getBlockType:c}=e(r.store),{canRemoveBlocks:d}=e(so),p=o((0,u.castArray)(t)[0]),[{name:m}]=n,f=1===n.length,g=f&&s(m);let h;if(f)h=null==l?void 0:l.icon;else{var v;h=1===new Set(n.map((e=>{let{name:t}=e;return t}))).size?null===(v=c(m))||void 0===v?void 0:v.icon:Cf}return{possibleBlockTransformations:i(n,p),canRemove:d(t,p),hasBlockStyles:!(null==g||!g.length),icon:h,patterns:a(n,p)}}),[t,n,null==l?void 0:l.icon]),h=Zm({clientId:Array.isArray(t)?t[0]:t,maximumLength:35}),v=1===n.length&&(0,r.isReusableBlock)(n[0]),b=1===n.length&&(0,r.isTemplatePart)(n[0]),_=!!i.length&&s&&!b,k=!(null==f||!f.length)&&s;if(!c&&!_)return(0,a.createElement)(m.ToolbarGroup,null,(0,a.createElement)(m.ToolbarButton,{disabled:!0,className:"block-editor-block-switcher__no-switcher-icon",title:h,icon:(0,a.createElement)(a.Fragment,null,(0,a.createElement)(Du,{icon:d,showColors:!0}),(v||b)&&(0,a.createElement)("span",{className:"block-editor-block-switcher__toggle-text"},h))}));const y=h,E=1===n.length?(0,g.sprintf)((0,g.__)("%s: Change block type or style"),h):(0,g.sprintf)((0,g._n)("Change type of %d block","Change type of %d blocks",n.length),n.length),C=c||_||k;return(0,a.createElement)(m.ToolbarGroup,null,(0,a.createElement)(m.ToolbarItem,null,(e=>(0,a.createElement)(m.DropdownMenu,{className:"block-editor-block-switcher",label:y,popoverProps:{position:"bottom right",isAlternate:!0,className:"block-editor-block-switcher__popover"},icon:(0,a.createElement)(a.Fragment,null,(0,a.createElement)(Du,{icon:d,className:"block-editor-block-switcher__toggle",showColors:!0}),(v||b)&&(0,a.createElement)("span",{className:"block-editor-block-switcher__toggle-text"},h)),toggleProps:{describedBy:E,...e},menuProps:{orientation:"both"}},(e=>{let{onClose:l}=e;return C&&(0,a.createElement)("div",{className:"block-editor-block-switcher__container"},k&&(0,a.createElement)(Uf,{blocks:n,patterns:f,onSelect:e=>{(e=>{o(t,e)})(e),l()}}),_&&(0,a.createElement)(If,{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,a.createElement)(Df,{hoveredBlock:n[0],onSwitch:l}))})))))};var jf=e=>{let{clientIds:t}=e;const n=(0,p.useSelect)((e=>e(so).getBlocksByClientId(t)),[t]);return!n.length||n.some((e=>!e))?null:(0,a.createElement)(Wf,{clientIds:t,blocks:n})};const{Fill:$f,Slot:Kf}=(0,m.createSlotFill)("__unstableBlockToolbarLastItem");$f.Slot=Kf;var qf=$f;var Yf=(0,a.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(D.Path,{d:"M13 19h-2v-2h2v2zm0-6h-2v-2h2v2zm0-6h-2V5h2v2z"})),Zf=window.wp.blob;function Qf(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;if(1!==(null===(n=t.match(e))||void 0===n?void 0:n.length))return!0;const o=/<\s*img\b[^>]*\bsrc="file:\/\//i;if(t.match(o))return!0}return!1}function Xf(){const{getBlockName:e}=(0,p.useSelect)(so),{getBlockType:t}=(0,p.useSelect)(r.store),{createSuccessNotice:n}=(0,p.useDispatch)(Op.store);return(0,a.useCallback)(((o,r)=>{let l="";if(1===r.length){var i;const n=r[0],a=null===(i=t(e(n)))||void 0===i?void 0:i.title;l="copy"===o?(0,g.sprintf)((0,g.__)('Copied "%s" to clipboard.'),a):(0,g.sprintf)((0,g.__)('Moved "%s" to clipboard.'),a)}else l="copy"===o?(0,g.sprintf)((0,g._n)("Copied %d block to clipboard.","Copied %d blocks to clipboard.",r.length),r.length):(0,g.sprintf)((0,g._n)("Moved %d block to clipboard.","Moved %d blocks to clipboard.",r.length),r.length);n(l,{type:"snackbar"})}),[])}function Jf(){const{getBlocksByClientId:e,getSelectedBlockClientIds:t,hasMultiSelection:n,getSettings:o,__unstableIsFullySelected:l,__unstableIsSelectionCollapsed:i,__unstableIsSelectionMergeable:a,__unstableGetSelectedBlocksWithPartialSelection:s}=(0,p.useSelect)(so),{flashBlock:c,removeBlocks:u,replaceBlocks:m,__unstableDeleteSelection:f,__unstableExpandSelection:g}=(0,p.useDispatch)(so),h=Xf();return(0,d.useRefEffect)((d=>{function p(p){const v=t();if(0===v.length)return;if(!n()){const{target:e}=p,{ownerDocument:t}=e;if("copy"===p.type||"cut"===p.type?(0,Wl.documentHasUncollapsedSelection)(t):(0,Wl.documentHasSelection)(t))return}if(!d.contains(p.target.ownerDocument.activeElement))return;const b=p.defaultPrevented;p.preventDefault();const _=a(),k=i()||l(),y=!k&&!_;if("copy"===p.type||"cut"===p.type)if(1===v.length&&c(v[0]),y)g();else{let t;if(h(p.type,v),k)t=e(v);else{const[n,o]=s();t=[n,...e(v.slice(1,v.length-1)),o]}const n=p.clipboardData.getData("__unstableWrapperBlockName");n&&(t=(0,r.createBlock)(n,JSON.parse(p.clipboardData.getData("__unstableWrapperBlockAttributes")),t));const o=(0,r.serialize)(t);p.clipboardData.setData("text/plain",function(e){e=e.replace(/<br>/g,"\n");return(0,Wl.__unstableStripHTML)(e).trim().replace(/\n\n+/g,"\n\n")}(o)),p.clipboardData.setData("text/html",o)}if("cut"===p.type)k&&!y?u(v):f();else if("paste"===p.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,Wl.getFilesFromDataTransfer)(t).filter((e=>{let{type:t}=e;return/^image\/(?:jpe?g|png|gif|webp)$/.test(t)}));return r.length&&!Qf(r,o)&&(o=r.map((e=>`<img src="${(0,Zf.createBlobURL)(e)}">`)).join(""),n=""),{html:o,plainText:n}}(p),l=(0,r.pasteHandler)({HTML:n,plainText:t,mode:"BLOCKS",canUserUseUnfilteredHTML:e});m(v,l,l.length-1,-1)}}return d.ownerDocument.addEventListener("copy",p),d.ownerDocument.addEventListener("cut",p),d.ownerDocument.addEventListener("paste",p),()=>{d.ownerDocument.removeEventListener("copy",p),d.ownerDocument.removeEventListener("cut",p),d.ownerDocument.removeEventListener("paste",p)}}),[])}var eg=function(e){let{children:t}=e;return(0,a.createElement)("div",{ref:Jf()},t)};function tg(e){let{clientIds:t,children:n,__experimentalUpdateSelection:o}=e;const{canInsertBlockType:l,getBlockRootClientId:i,getBlocksByClientId:a,canMoveBlocks:s,canRemoveBlocks:c}=(0,p.useSelect)(so),{getDefaultBlockName:u,getGroupingBlockName:d}=(0,p.useSelect)(r.store),m=a(t),f=i(t[0]),g=m.every((e=>!!e&&(0,r.hasBlockSupport)(e.name,"multiple",!0)&&l(e.name,f))),h=l(u(),f),v=s(t,f),b=c(t,f),{removeBlocks:_,replaceBlocks:k,duplicateBlocks:y,insertAfterBlock:E,insertBeforeBlock:C,flashBlock:w,setBlockMovingClientId:S,setNavigationMode:B,selectBlock:I}=(0,p.useDispatch)(so),x=Xf();return n({canDuplicate:g,canInsertDefaultBlock:h,canMove:v,canRemove:b,rootClientId:f,blocks:m,onDuplicate(){return y(t,o)},onRemove(){return _(t,o)},onInsertBefore(){const e=Array.isArray(t)?t[0]:e;C(e)},onInsertAfter(){const e=Array.isArray(t)?t[t.length-1]:e;E(e)},onMoveTo(){B(!0),I(t[0]),S(t[0])},onGroup(){if(!m.length)return;const e=d(),n=(0,r.switchToBlockType)(m,e);n&&k(t,n)},onUngroup(){if(!m.length)return;const e=m[0].innerBlocks;e.length&&k(t,e)},onCopy(){const e=m.map((e=>{let{clientId:t}=e;return t}));1===m.length&&w(e[0]),x("copy",e)}})}const ng=()=>{};var og=(0,d.compose)([(0,p.withSelect)(((e,t)=>{let{clientId:n}=t;const{getBlock:o,getBlockMode:l,getSettings:i}=e(so),a=o(n),s=i().codeEditingEnabled;return{mode:l(n),blockType:a?(0,r.getBlockType)(a.name):null,isCodeEditingEnabled:s}})),(0,p.withDispatch)(((e,t)=>{let{onToggle:n=ng,clientId:o}=t;return{onToggleMode(){e(so).toggleBlockMode(o),n()}}}))])((function(e){let{blockType:t,mode:n,onToggleMode:o,small:l=!1,isCodeEditingEnabled:i=!0}=e;if(!t||!(0,r.hasBlockSupport)(t,"html",!0)||!i)return null;const s="visual"===n?(0,g.__)("Edit as HTML"):(0,g.__)("Edit visually");return(0,a.createElement)(m.MenuItem,{onClick:o},!l&&s)}));var rg=(0,d.compose)((0,p.withSelect)(((e,t)=>{let{clientId:n}=t;const o=e(so).getBlock(n);return{block:o,shouldRender:o&&"core/html"===o.name}})),(0,p.withDispatch)(((e,t)=>{let{block:n}=t;return{onClick:()=>e(so).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,a.createElement)(m.MenuItem,{onClick:n},!o&&r)}));const{Fill:lg,Slot:ig}=(0,m.createSlotFill)("__unstableBlockSettingsMenuFirstItem");lg.Slot=ig;var ag=lg;function sg(){const{clientIds:e,isGroupable:t,isUngroupable:n,blocksSelection:o,groupingBlockName:l}=(0,p.useSelect)((e=>{var t;const{getBlockRootClientId:n,getBlocksByClientId:o,canInsertBlockType:l,getSelectedBlockClientIds:i}=e(so),{getGroupingBlockName:a}=e(r.store),s=i(),c=a(),u=l(c,null!=s&&s.length?n(s[0]):void 0),d=o(s),p=1===d.length&&(null===(t=d[0])||void 0===t?void 0:t.name)===c;return{clientIds:s,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}}function cg(e){let{clientIds:t,isGroupable:n,isUngroupable:o,blocksSelection:l,groupingBlockName:i,onClose:s=(()=>{})}=e;const{replaceBlocks:c}=(0,p.useDispatch)(so);return n||o?(0,a.createElement)(a.Fragment,null,n&&(0,a.createElement)(m.MenuItem,{onClick:()=>{(()=>{const e=(0,r.switchToBlockType)(l,i);e&&c(t,e)})(),s()}},(0,g._x)("Group","verb")),o&&(0,a.createElement)(m.MenuItem,{onClick:()=>{(()=>{const e=l[0].innerBlocks;e.length&&c(t,e)})(),s()}},(0,g._x)("Ungroup","Ungrouping blocks from within a Group block back into individual blocks within the Editor "))):null}function ug(e){return(0,p.useSelect)((t=>{const{canEditBlock:n,canMoveBlock:o,canRemoveBlock:r,canLockBlockType:l,getBlockName:i,getBlockRootClientId:a,getTemplateLock:s}=t(so),c=a(e),u=n(e),d=o(e,c),p=r(e,c);return{canEdit:u,canMove:d,canRemove:p,canLock:l(i(e)),isContentLocked:"contentOnly"===s(e),isLocked:!u||!d||!p}}),[e])}var dg=(0,a.createElement)(D.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,a.createElement)(D.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"}));var pg=(0,a.createElement)(D.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,a.createElement)(D.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 mg(e){return e.remove&&e.move?"all":!(!e.remove||e.move)&&"insert"}function fg(e){let{clientId:t,onClose:n}=e;const[o,l]=(0,a.useState)({move:!1,remove:!1}),{canEdit:i,canMove:s,canRemove:c}=ug(t),{isReusable:u,templateLock:f,hasTemplateLock:h}=(0,p.useSelect)((e=>{var n,o;const{getBlockName:l,getBlockAttributes:i}=e(so),a=l(t),s=(0,r.getBlockType)(a);return{isReusable:(0,r.isReusableBlock)(s),templateLock:null===(n=i(t))||void 0===n?void 0:n.templateLock,hasTemplateLock:!(null==s||null===(o=s.attributes)||void 0===o||!o.templateLock)}}),[t]),[v,b]=(0,a.useState)(!!f),{updateBlockAttributes:_}=(0,p.useDispatch)(so),k=Ym(t),y=(0,d.useInstanceId)(fg,"block-editor-block-lock-modal__options-title");(0,a.useEffect)((()=>{l({move:!s,remove:!c,...u?{edit:!i}:{}})}),[i,s,c,u]);const E=Object.values(o).every(Boolean),C=Object.values(o).some(Boolean)&&!E;return(0,a.createElement)(m.Modal,{title:(0,g.sprintf)((0,g.__)("Lock %s"),k.title),overlayClassName:"block-editor-block-lock-modal",closeLabel:(0,g.__)("Close"),onRequestClose:n},(0,a.createElement)("p",null,(0,g.__)("Choose specific attributes to restrict or lock all available options.")),(0,a.createElement)("form",{onSubmit:e=>{e.preventDefault(),_([t],{lock:o,templateLock:v?mg(o):void 0}),n()}},(0,a.createElement)("div",{role:"group","aria-labelledby":y,className:"block-editor-block-lock-modal__options"},(0,a.createElement)(m.CheckboxControl,{className:"block-editor-block-lock-modal__options-title",label:(0,a.createElement)("span",{id:y},(0,g.__)("Lock all")),checked:E,indeterminate:C,onChange:e=>l({move:e,remove:e,...u?{edit:e}:{}})}),(0,a.createElement)("ul",{className:"block-editor-block-lock-modal__checklist"},u&&(0,a.createElement)("li",{className:"block-editor-block-lock-modal__checklist-item"},(0,a.createElement)(m.CheckboxControl,{label:(0,a.createElement)(a.Fragment,null,(0,g.__)("Restrict editing"),(0,a.createElement)(m.Icon,{icon:o.edit?pg:dg})),checked:!!o.edit,onChange:e=>l((t=>({...t,edit:e})))})),(0,a.createElement)("li",{className:"block-editor-block-lock-modal__checklist-item"},(0,a.createElement)(m.CheckboxControl,{label:(0,a.createElement)(a.Fragment,null,(0,g.__)("Disable movement"),(0,a.createElement)(m.Icon,{icon:o.move?pg:dg})),checked:o.move,onChange:e=>l((t=>({...t,move:e})))})),(0,a.createElement)("li",{className:"block-editor-block-lock-modal__checklist-item"},(0,a.createElement)(m.CheckboxControl,{label:(0,a.createElement)(a.Fragment,null,(0,g.__)("Prevent removal"),(0,a.createElement)(m.Icon,{icon:o.remove?pg:dg})),checked:o.remove,onChange:e=>l((t=>({...t,remove:e})))}))),h&&(0,a.createElement)(m.ToggleControl,{className:"block-editor-block-lock-modal__template-lock",label:(0,g.__)("Apply to all blocks inside"),checked:v,disabled:o.move&&!o.remove,onChange:()=>b(!v)})),(0,a.createElement)(m.Flex,{className:"block-editor-block-lock-modal__actions",justify:"flex-end",expanded:!1},(0,a.createElement)(m.FlexItem,null,(0,a.createElement)(m.Button,{variant:"tertiary",onClick:n},(0,g.__)("Cancel"))),(0,a.createElement)(m.FlexItem,null,(0,a.createElement)(m.Button,{variant:"primary",type:"submit"},(0,g.__)("Apply"))))))}function gg(e){let{clientId:t}=e;const{canLock:n,isLocked:o}=ug(t),[r,l]=(0,a.useReducer)((e=>!e),!1);if(!n)return null;const i=o?(0,g.__)("Unlock"):(0,g.__)("Lock");return(0,a.createElement)(a.Fragment,null,(0,a.createElement)(m.MenuItem,{icon:o?dg:pg,onClick:l},i),r&&(0,a.createElement)(fg,{clientId:t,onClose:l}))}const{Fill:hg,Slot:vg}=(0,m.createSlotFill)("BlockSettingsMenuControls");function bg(e){let{...t}=e;return(0,a.createElement)(m.__experimentalStyleProvider,{document:document},(0,a.createElement)(hg,t))}bg.Slot=e=>{let{fillProps:t,clientIds:n=null,__unstableDisplayLocation:o}=e;const{selectedBlocks:r,selectedClientIds:l,canRemove:s}=(0,p.useSelect)((e=>{const{getBlocksByClientId:t,getSelectedBlockClientIds:o,canRemoveBlocks:r}=e(so),l=null!==n?n:o();return{selectedBlocks:(0,u.map)(t(l).filter(Boolean),(e=>e.name)),selectedClientIds:l,canRemove:r(l)}}),[n]),{canLock:c}=ug(l[0]),d=1===l.length&&c,f=sg(),{isGroupable:g,isUngroupable:h}=f,v=(g||h)&&s;return(0,a.createElement)(vg,{fillProps:{...t,__unstableDisplayLocation:o,selectedBlocks:r,selectedClientIds:l}},(e=>!(null!=e&&e.length)>0&&!v&&!d?null:(0,a.createElement)(m.MenuGroup,null,d&&(0,a.createElement)(gg,{clientId:l[0]}),e,v&&(0,a.createElement)(cg,i({},f,{onClose:null==t?void 0:t.onClose})))))};var _g=bg;const kg=()=>{},yg={className:"block-editor-block-settings-menu__popover",position:"bottom right",isAlternate:!0};function Eg(e){let{blocks:t,onCopy:n}=e;const o=(0,d.useCopyToClipboard)((()=>(0,r.serialize)(t)),n),l=t.length>1?(0,g.__)("Copy blocks"):(0,g.__)("Copy block");return(0,a.createElement)(m.MenuItem,{ref:o},l)}var Cg=function(e){let{clientIds:t,__experimentalSelectBlock:n,children:o,__unstableDisplayLocation:l,...s}=e;const c=(0,u.castArray)(t),d=c.length,f=c[0],{firstParentClientId:h,hasReducedUI:v,onlyBlock:b,parentBlockType:_,previousBlockClientId:k,nextBlockClientId:y,selectedBlockClientIds:E}=(0,p.useSelect)((e=>{const{getBlockCount:t,getBlockName:n,getBlockParents:o,getPreviousBlockClientId:l,getNextBlockClientId:i,getSelectedBlockClientIds:a,getSettings:s}=e(so),c=o(f),u=c[c.length-1],d=n(u);return{firstParentClientId:u,hasReducedUI:s().hasReducedUI,onlyBlock:1===t(),parentBlockType:(0,r.getBlockType)(d),previousBlockClientId:l(f),nextBlockClientId:i(f),selectedBlockClientIds:a()}}),[f]),C=(0,p.useSelect)((e=>{const{getShortcutRepresentation:t}=e(Yu.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:w,toggleBlockHighlight:S}=(0,p.useDispatch)(so),B=(0,a.useCallback)(n?async e=>{const t=await e;t&&t[0]&&n(t[0])}:kg,[n]),I=Zm({clientId:f,maximumLength:25}),x=(0,a.useCallback)(n?()=>{const e=k||y;e&&E.includes(f)&&!E.includes(e)&&n(e)}:kg,[n,k,y,E]),T=(0,g.sprintf)((0,g.__)("Remove %s"),I),N=1===d?T:(0,g.__)("Remove blocks"),P=(0,a.useRef)(),{gestures:M}=yf({ref:P,onChange(e){e&&v||S(h,e)}});return(0,a.createElement)(tg,{clientIds:t,__experimentalUpdateSelection:!n},(e=>{let{canDuplicate:n,canInsertDefaultBlock:r,canMove:c,canRemove:p,onDuplicate:v,onInsertAfter:k,onInsertBefore:y,onRemove:E,onCopy:S,onMoveTo:I,blocks:T}=e;return(0,a.createElement)(m.DropdownMenu,i({icon:Yf,label:(0,g.__)("Options"),className:"block-editor-block-settings-menu",popoverProps:yg,noIcons:!0},s),(e=>{let{onClose:s}=e;return(0,a.createElement)(a.Fragment,null,(0,a.createElement)(m.MenuGroup,null,(0,a.createElement)(ag.Slot,{fillProps:{onClose:s}}),void 0!==h&&(0,a.createElement)(m.MenuItem,i({},M,{ref:P,icon:(0,a.createElement)(Du,{icon:_.icon}),onClick:()=>w(h)}),(0,g.sprintf)((0,g.__)("Select parent block (%s)"),_.title)),1===d&&(0,a.createElement)(rg,{clientId:f}),(0,a.createElement)(Eg,{blocks:T,onCopy:S}),n&&(0,a.createElement)(m.MenuItem,{onClick:(0,u.flow)(s,v,B),shortcut:C.duplicate},(0,g.__)("Duplicate")),r&&(0,a.createElement)(a.Fragment,null,(0,a.createElement)(m.MenuItem,{onClick:(0,u.flow)(s,y),shortcut:C.insertBefore},(0,g.__)("Insert before")),(0,a.createElement)(m.MenuItem,{onClick:(0,u.flow)(s,k),shortcut:C.insertAfter},(0,g.__)("Insert after"))),c&&!b&&(0,a.createElement)(m.MenuItem,{onClick:(0,u.flow)(s,I)},(0,g.__)("Move to")),1===d&&(0,a.createElement)(og,{clientId:f,onToggle:s})),(0,a.createElement)(_g.Slot,{fillProps:{onClose:s},clientIds:t,__unstableDisplayLocation:l}),"function"==typeof o?o({onClose:s}):a.Children.map((e=>(0,a.cloneElement)(e,{onClose:s}))),p&&(0,a.createElement)(m.MenuGroup,null,(0,a.createElement)(m.MenuItem,{onClick:(0,u.flow)(s,E,x),shortcut:C.remove},N)))}))}))};var wg=function(e){let{clientIds:t,...n}=e;return(0,a.createElement)(m.ToolbarGroup,null,(0,a.createElement)(m.ToolbarItem,null,(e=>(0,a.createElement)(Cg,i({clientIds:t,toggleProps:e},n)))))};function Sg(e){let{clientId:t}=e;const n=Ym(t),{canEdit:o,canMove:r,canRemove:l,canLock:i}=ug(t),[s,c]=(0,a.useReducer)((e=>!e),!1);return i?o&&r&&l?null:(0,a.createElement)(a.Fragment,null,(0,a.createElement)(m.ToolbarGroup,{className:"block-editor-block-lock-toolbar"},(0,a.createElement)(m.ToolbarButton,{icon:pg,label:(0,g.sprintf)((0,g.__)("Unlock %s"),n.title),onClick:c})),s&&(0,a.createElement)(fg,{clientId:t,onClose:c})):null}var Bg=(0,a.createElement)(D.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,a.createElement)(D.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"}));var Ig=(0,a.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(D.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"}));var xg=(0,a.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(D.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 Tg={group:{type:"constrained"},row:{type:"flex",flexWrap:"nowrap"},stack:{type:"flex",orientation:"vertical"}};var Ng=function(){const{blocksSelection:e,clientIds:t,groupingBlockName:n,isGroupable:o}=sg(),{replaceBlocks:l}=(0,p.useDispatch)(so),{canRemove:i,variations:s}=(0,p.useSelect)((e=>{const{canRemoveBlocks:o}=e(so),{getBlockVariations:l}=e(r.store);return{canRemove:o(t),variations:l(n,"transform")}}),[t,n]),c=o=>{const i=(0,r.switchToBlockType)(e,n);"string"!=typeof o&&(o="group"),i&&i.length>0&&(i[0].attributes.layout=Tg[o],l(t,i))};if(!o||!i)return null;const u=!!s.find((e=>{let{name:t}=e;return"group-row"===t})),d=!!s.find((e=>{let{name:t}=e;return"group-stack"===t}));return(0,a.createElement)(m.ToolbarGroup,null,(0,a.createElement)(m.ToolbarButton,{icon:Bg,label:(0,g._x)("Group","verb"),onClick:c}),u&&(0,a.createElement)(m.ToolbarButton,{icon:Ig,label:(0,g._x)("Row","single horizontal line"),onClick:()=>c("row")}),d&&(0,a.createElement)(m.ToolbarButton,{icon:xg,label:(0,g._x)("Stack","verb"),onClick:()=>c("stack")}))};function Pg(e){let{clientIds:t}=e;const n=1===t.length?t[0]:void 0,o=(0,p.useSelect)((e=>!!n&&"html"===e(so).getBlockMode(n)),[n]),{toggleBlockMode:r}=(0,p.useDispatch)(so);return o?(0,a.createElement)(m.ToolbarGroup,null,(0,a.createElement)(m.ToolbarButton,{onClick:()=>{r(n)}},(0,g.__)("Edit visually"))):null}var Mg=(0,a.createContext)("");var Lg=e=>{let{hideDragHandle:t}=e;const{blockClientIds:n,blockClientId:o,blockType:l,hasFixedToolbar:s,hasReducedUI:u,isValid:f,isVisual:g,isContentLocked:h}=(0,p.useSelect)((e=>{const{getBlockName:t,getBlockMode:n,getSelectedBlockClientIds:o,isBlockValid:l,getBlockRootClientId:i,getSettings:a,__unstableGetContentLockingParent:s}=e(so),c=o(),u=c[0],d=i(u),p=a();return{blockClientIds:c,blockClientId:u,blockType:u&&(0,r.getBlockType)(t(u)),hasFixedToolbar:p.hasFixedToolbar,hasReducedUI:p.hasReducedUI,rootClientId:d,isValid:c.every((e=>l(e))),isVisual:c.every((e=>"visual"===n(e))),isContentLocked:!!s(u)}}),[]),{toggleBlockHighlight:v}=(0,p.useDispatch)(so),b=(0,a.useRef)(),{showMovers:_,gestures:k}=yf({ref:b,onChange(e){e&&u||v(o,e)}}),y=(0,d.useViewportMatch)("medium","<")||s;if(l&&!(0,r.hasBlockSupport)(l,"__experimentalToolbar",!0))return null;const E=y||_;if(0===n.length)return null;const C=f&&g,w=n.length>1,S=c()("block-editor-block-toolbar",E&&"is-showing-movers");return(0,a.createElement)("div",{className:S},!w&&!y&&!h&&(0,a.createElement)(Ef,null),(0,a.createElement)("div",i({ref:b},k),(C||w)&&!h&&(0,a.createElement)(m.ToolbarGroup,{className:"block-editor-block-toolbar__block-controls"},(0,a.createElement)(jf,{clientIds:n}),!w&&(0,a.createElement)(Sg,{clientId:n[0]}),(0,a.createElement)(df,{clientIds:n,hideDragHandle:t||u}))),C&&w&&(0,a.createElement)(Ng,null),C&&(0,a.createElement)(a.Fragment,null,(0,a.createElement)(_o.Slot,{group:"parent",className:"block-editor-block-toolbar__slot"}),(0,a.createElement)(_o.Slot,{group:"block",className:"block-editor-block-toolbar__slot"}),(0,a.createElement)(_o.Slot,{className:"block-editor-block-toolbar__slot"}),(0,a.createElement)(_o.Slot,{group:"inline",className:"block-editor-block-toolbar__slot"}),(0,a.createElement)(_o.Slot,{group:"other",className:"block-editor-block-toolbar__slot"}),(0,a.createElement)(Mg.Provider,{value:null==l?void 0:l.name},(0,a.createElement)(qf.Slot,null))),(0,a.createElement)(Pg,{clientIds:n}),!h&&(0,a.createElement)(wg,{clientIds:n}))};var Rg=function(e){let{focusOnMount:t,isFixed:n,...o}=e;const{blockType:l,hasParents:s,showParentSelector:u}=(0,p.useSelect)((e=>{const{getBlockName:t,getBlockParents:n,getSelectedBlockClientIds:o,__unstableGetContentLockingParent:l}=e(so),{getBlockType:i}=e(r.store),a=o(),s=a[0],c=n(s),u=i(t(c[c.length-1]));return{blockType:s&&i(t(s)),hasParents:c.length,showParentSelector:u&&(0,r.hasBlockSupport)(u,"__experimentalParentSelector",!0)&&a.length<=1&&!l(s)}}),[]);if(l&&!(0,r.hasBlockSupport)(l,"__experimentalToolbar",!0))return null;const d=c()("block-editor-block-contextual-toolbar",{"has-parent":s&&u,"is-fixed":n});return(0,a.createElement)(gf,i({focusOnMount:t,className:d,"aria-label":(0,g.__)("Block tools")},o),(0,a.createElement)(Lg,{hideDragHandle:n}))};const Ag={flip:!1,shift:!0},Dg={flip:!0,shift:!1};function Og(e,t,n){if(!e||!t)return Ag;const o=t.getBoundingClientRect(),r=e.getBoundingClientRect(),l=e.ownerDocument.documentElement.clientHeight,i=o.top-r.top>n,a=o.height>l-n;return i||a?Ag:Dg}function zg(e){const{__unstableGetEditorMode:t,isMultiSelecting:n,hasMultiSelection:o,isTyping:r,getSettings:l,getLastMultiSelectedBlockClientId:i}=e(so);return{editorMode:t(),isMultiSelecting:n(),isTyping:r(),hasFixedToolbar:l().hasFixedToolbar,lastClientId:o()?i():null}}function Fg(e){let{clientId:t,rootClientId:n,isEmptyDefaultBlock:o,capturingClientId:r,__unstablePopoverSlot:l,__unstableContentRef:s}=e;const{editorMode:u,isMultiSelecting:m,isTyping:f,hasFixedToolbar:g,lastClientId:h}=(0,p.useSelect)(zg,[]),v=(0,p.useSelect)((e=>{const{isBlockInsertionPointVisible:n,getBlockInsertionPoint:o,getBlockOrder:r}=e(so);if(!n())return!1;const l=o();return r(l.rootClientId)[l.index]===t}),[t]),b=(0,d.useViewportMatch)("medium"),_=(0,a.useRef)(!1),{stopTyping:k}=(0,p.useDispatch)(so),y="navigation"===u||"zoom-out"===u,E="edit"===u&&!g&&b&&!m&&!(!f&&"edit"===u&&o)&&!f,C="edit"===u&&!E&&!g&&!o;(0,Yu.useShortcut)("core/block-editor/focus-toolbar",(()=>{_.current=!0,k(!0)}),{isDisabled:!C}),(0,a.useEffect)((()=>{_.current=!1}));const w=(0,a.useRef)(),S=function(e){let{contentElement:t,clientId:n}=e;const o=Lo(n),[r,l]=(0,a.useState)(0),[i,s]=(0,a.useState)((()=>Og(t,o,r))),c=(0,p.useSelect)((e=>e(so).getBlockIndex(n)),[n]),u=(0,d.useRefEffect)((e=>{l(e.offsetHeight)}),[]),m=(0,a.useCallback)((()=>s(Og(t,o,r))),[t,o,r]);return(0,a.useLayoutEffect)(m,[c,m]),(0,a.useLayoutEffect)((()=>{var e,n,r;if(!t||!o)return;const l=null==t||null===(e=t.ownerDocument)||void 0===e?void 0:e.defaultView;let i;null==l||null===(n=l.addEventHandler)||void 0===n||n.call(l,"resize",m);const a=null==o||null===(r=o.ownerDocument)||void 0===r?void 0:r.defaultView;return a.ResizeObserver&&(i=new a.ResizeObserver(m),i.observe(o)),()=>{var e;null==l||null===(e=l.removeEventHandler)||void 0===e||e.call(l,"resize",m),i&&i.disconnect()}}),[m,t,o]),{...i,ref:u}}({contentElement:null==s?void 0:s.current,clientId:t});return y||E?(0,a.createElement)(yr,i({clientId:r||t,bottomClientId:h,className:c()("block-editor-block-list__block-popover",{"is-insertion-point-visible":v}),__unstablePopoverSlot:l,__unstableContentRef:s,resize:!1},S),E&&(0,a.createElement)(Rg,{focusOnMount:_.current,__experimentalInitialIndex:w.current,__experimentalOnIndexChange:e=>{w.current=e},key:t}),y&&(0,a.createElement)(pf,{clientId:t,rootClientId:n})):null}function Vg(e){const{getSelectedBlockClientId:t,getFirstMultiSelectedBlockClientId:n,getBlockRootClientId:o,getBlock:l,getBlockParents:i,__experimentalGetBlockListSettingsForBlocks:a}=e(so),s=t()||n();if(!s)return;const{name:c,attributes:d={}}=l(s)||{},p=i(s),m=a(p),f=(0,u.find)(p,(e=>{var t;return null===(t=m[e])||void 0===t?void 0:t.__experimentalCaptureToolbars}));return{clientId:s,rootClientId:o(s),name:c,isEmptyDefaultBlock:c&&(0,r.isUnmodifiedDefaultBlock)({name:c,attributes:d}),capturingClientId:f}}function Hg(e){let{__unstablePopoverSlot:t,__unstableContentRef:n}=e;const o=(0,p.useSelect)(Vg,[]);if(!o)return null;const{clientId:r,rootClientId:l,name:i,isEmptyDefaultBlock:s,capturingClientId:c}=o;return i?(0,a.createElement)(Fg,{clientId:r,rootClientId:l,isEmptyDefaultBlock:s,capturingClientId:c,__unstablePopoverSlot:t,__unstableContentRef:n}):null}function Gg(e){let{children:t}=e;const n=(0,a.useContext)(Um),o=(0,a.useContext)(m.Disabled.Context);return n||o?t:(V()('wp.components.Popover.Slot name="block-toolbar"',{alternative:"wp.blockEditor.BlockTools",since:"5.8"}),(0,a.createElement)(jm,{__unstablePopoverSlot:"block-toolbar"},(0,a.createElement)(Hg,{__unstablePopoverSlot:"block-toolbar"}),t))}var Ug=(0,d.createHigherOrderComponent)((e=>t=>{const{clientId:n}=mo();return(0,a.createElement)(e,i({},t,{clientId:n}))}),"withClientId");var Wg=Ug((e=>{let{clientId:t,showSeparator:n,isFloating:o,onAddBlock:r,isToggle:l}=e;return(0,a.createElement)(Fm,{className:c()({"block-list-appender__toggle":l}),rootClientId:t,showSeparator:n,isFloating:o,onAddBlock:r})}));var jg=(0,d.compose)([Ug,(0,p.withSelect)(((e,t)=>{let{clientId:n}=t;const{getBlockOrder:o}=e(so),r=o(n);return{lastBlockClientId:r[r.length-1]}}))])((e=>{let{clientId:t}=e;return(0,a.createElement)(Dm,{rootClientId:t})}));const $g=new WeakMap;const Kg=new WeakMap;function qg(e,t,n,o,l,i,a){return s=>{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}(s);if("inserter"===d){a();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,a=u.length;l(u,c,e,i&&r<t?t-a:t)}}}function Yg(e,t){const n=(0,p.useSelect)((e=>e(so).getSettings().mediaUpload),[]),{canInsertBlockType:o,getBlockIndex:l,getClientIdsOfDescendants:i}=(0,p.useSelect)(so),{insertBlocks:a,moveBlocksToPosition:s,updateBlockAttributes:c,clearSelectedBlock:u}=(0,p.useDispatch)(so),d=qg(e,t,l,i,s,a,u),m=function(e,t,n,o,l,i){return a=>{if(!n)return;const s=(0,r.findTransform)((0,r.getBlockTransforms)("from"),(t=>"files"===t.type&&l(t.blockName,e)&&t.isMatch(a)));if(s){const n=s.transform(a,o);i(n,t,e)}}}(e,t,n,c,o,a),f=function(e,t,n){return o=>{const l=(0,r.pasteHandler)({HTML:o,mode:"BLOCKS"});l.length&&n(l,t,e)}}(e,t,a);return e=>{const t=(0,Wl.getFilesFromDataTransfer)(e.dataTransfer),n=e.dataTransfer.getData("text/html");n?f(n):t.length?m(t):d(e)}}function Zg(e,t,n){const o="top"===n||"bottom"===n,{x:r,y:l}=e,i=o?r:l,a=o?l:r,s=o?t.left:t.top,c=o?t.right:t.bottom,u=t[n];let d;return d=i>=s&&i<=c?i:i<c?s:c,Math.sqrt((i-d)**2+(a-u)**2)}function Qg(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=Zg(e,t,r);(void 0===n||l<n)&&(n=l,o=r)})),[n,o]}function Xg(e,t,n){const o="horizontal"===n?["left","right"]:["top","bottom"],r=(0,g.isRTL)();let l,i;return e.forEach(((e,n)=>{const a=e.getBoundingClientRect(),[s,c]=Qg(t,a,o);if(void 0===i||s<i){i=s,l=n+("bottom"===c||!r&&"right"===c||r&&"left"===c?1:0)}})),l}function Jg(){let{rootClientId:e=""}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const[t,n]=(0,a.useState)(null),o=(0,p.useSelect)((t=>{const{getTemplateLock:n,__unstableIsWithinBlockOverlay:o,__unstableHasActiveBlockOverlayActive:r}=t(so),l=n(e);return["all","contentOnly"].some((e=>e===l))||r(e)||o(e)}),[e]),{getBlockListSettings:r}=(0,p.useSelect)(so),{showInsertionPoint:l,hideInsertionPoint:i}=(0,p.useDispatch)(so),s=Yg(e,t),c=(0,d.useThrottle)((0,a.useCallback)(((t,o)=>{var i;const a=Xg(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===a?0:a),null!==a&&l(e,a)}),[]),200);return(0,d.__experimentalUseDropZone)({isDisabled:o,onDrop:s,onDragOver(e){c(e,e.currentTarget)},onDragLeave(){c.cancel(),i(),n(null)},onDragEnd(){c.cancel(),i(),n(null)}})}function eh(e){const{clientId:t,allowedBlocks:n,__experimentalDefaultBlock:o,__experimentalDirectInsert:l,template:i,templateLock:s,wrapperRef:c,templateInsertUpdatesSelection:d,__experimentalCaptureToolbars:m,__experimentalAppenderTagName:f,renderAppender:g,orientation:h,placeholder:v,__experimentalLayout:b}=e;!function(e,t,n,o,r,l,i,s){const{updateBlockListSettings:c}=(0,p.useDispatch)(so),u=(0,p.useRegistry)(),{blockListSettings:d,parentLock:m}=(0,p.useSelect)((t=>{const n=t(so).getBlockRootClientId(e);return{blockListSettings:t(so).getBlockListSettings(e),parentLock:t(so).getTemplateLock(n)}}),[e]),f=(0,a.useMemo)((()=>t),t);(0,a.useLayoutEffect)((()=>{const t={allowedBlocks:f,templateLock:void 0===r||"contentOnly"===m?m:r};if(void 0!==l&&(t.__experimentalCaptureToolbars=l),void 0!==i)t.orientation=i;else{const e=hl(null==s?void 0:s.type);t.orientation=e.getOrientation(s)}void 0!==n&&(t.__experimentalDefaultBlock=n),void 0!==o&&(t.__experimentalDirectInsert=o),br()(d,t)||($g.get(u)||$g.set(u,[]),$g.get(u).push([e,t]),window.queueMicrotask((()=>{var e;null!==(e=$g.get(u))&&void 0!==e&&e.length&&u.batch((()=>{$g.get(u).forEach((e=>{c(...e)})),$g.set(u,[])}))})))}),[e,d,f,n,o,r,m,l,i,c,s,u])}(t,n,o,l,s,m,h,b),function(e,t,n,o){const{getSelectedBlocksInitialCaretPosition:l}=(0,p.useSelect)(so),{replaceInnerBlocks:i}=(0,p.useDispatch)(so),s=(0,p.useSelect)((t=>t(so).getBlocks(e)),[e]),{getBlocks:c}=(0,p.useSelect)(so),d=(0,a.useRef)(null);(0,a.useLayoutEffect)((()=>{window.queueMicrotask((()=>{const a=c(e),s=0===a.length||"all"===n||"contentOnly"===n,p=!(0,u.isEqual)(t,d.current);if(!s||!p)return;d.current=t;const m=(0,r.synchronizeBlocksWithTemplate)(a,t);(0,u.isEqual)(m,a)||i(e,m,0===a.length&&o&&0!==m.length,l())}))}),[s,t,n,e])}(t,i,s,d);const _=(0,p.useSelect)((e=>{const n=e(so).getBlock(t);if(!n)return;const o=(0,r.getBlockType)(n.name);return o&&o.providesContext?function(e,t){Kg.has(t)||Kg.set(t,new WeakMap);const n=Kg.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):void 0}),[t]);return(0,a.createElement)($l,{value:_},(0,a.createElement)(uh,{rootClientId:t,renderAppender:g,__experimentalAppenderTagName:f,__experimentalLayout:b,wrapperRef:c,placeholder:v}))}function th(e){return Vu(e),(0,a.createElement)(eh,e)}const nh=(0,a.forwardRef)(((e,t)=>{const n=oh({ref:t},e);return(0,a.createElement)("div",{className:"block-editor-inner-blocks"},(0,a.createElement)("div",n))}));function oh(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{clientId:n}=mo(),o=(0,d.useViewportMatch)("medium","<"),{__experimentalCaptureToolbars:l,hasOverlay:s}=(0,p.useSelect)((e=>{if(!n)return{};const{getBlockName:t,isBlockSelected:l,hasSelectedInnerBlock:i,__unstableGetEditorMode:a}=e(so),s=t(n),c="navigation"===a()||o;return{__experimentalCaptureToolbars:e(r.store).hasBlockSupport(s,"__experimentalExposeControlsToChildren",!1),hasOverlay:"core/template"!==s&&!l(n)&&!i(n,!0)&&c}}),[n,o]),u=(0,d.useMergeRefs)([e.ref,Jg({rootClientId:n})]),m={__experimentalCaptureToolbars:l,...t},f=m.value&&m.onChange?th:eh;return{...e,ref:u,className:c()(e.className,"block-editor-block-list__layout",{"has-overlay":s}),children:n?(0,a.createElement)(f,i({},m,{clientId:n})):(0,a.createElement)(uh,t)}}oh.save=r.__unstableGetInnerBlocksProps,nh.DefaultBlockAppender=jg,nh.ButtonBlockAppender=Wg,nh.Content=()=>oh.save().children;var rh=nh;const lh=(0,a.createContext)(),ih=(0,a.createContext)();function ah(e){let{className:t,...n}=e;const[o,r]=(0,a.useState)(),l=(0,d.useViewportMatch)("medium"),{isOutlineMode:i,isFocusMode:s,editorMode:u}=(0,p.useSelect)((e=>{const{getSettings:t,__unstableGetEditorMode:n}=e(so),{outlineMode:o,focusMode:r}=t();return{isOutlineMode:o,isFocusMode:r,editorMode:n()}}),[]),{setBlockVisibility:m}=(0,p.useDispatch)(so),f=(0,a.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}m(t)}))}),[]),g=oh({ref:(0,d.useMergeRefs)([Uu(),$m(),r]),className:c()("is-root-container",t,{"is-outline-mode":i,"is-focus-mode":s&&l,"is-navigate-mode":"navigation"===u})},n);return(0,a.createElement)(lh.Provider,{value:o},(0,a.createElement)(ih.Provider,{value:f},(0,a.createElement)("div",g)))}function sh(e){return function(){const e=(0,p.useSelect)((e=>e(so).getSettings().__experimentalBlockPatterns),[]);(0,a.useEffect)((()=>{if(null==e||!e.length)return;let t,n=-1;const o=()=>{n++,n>=e.length||((0,p.select)(so).__experimentalGetParsedPattern(e[n].name),t=Km(o))};return t=Km(o),()=>qm(t)}),[e])}(),(0,a.createElement)(Gg,null,(0,a.createElement)(po,{value:co},(0,a.createElement)(ah,e)))}function ch(e){let{placeholder:t,rootClientId:n,renderAppender:o,__experimentalAppenderTagName:r,__experimentalLayout:l=vl}=e;const{order:i,selectedBlocks:s,visibleBlocks:c}=(0,p.useSelect)((e=>{const{getBlockOrder:t,getSelectedBlockClientIds:o,__unstableGetVisibleBlocks:r}=e(so);return{order:t(n),selectedBlocks:o(),visibleBlocks:r()}}),[n]);return(0,a.createElement)(_l,{value:l},i.map((e=>(0,a.createElement)(p.AsyncModeProvider,{key:e,value:!c.has(e)&&!s.includes(e)},(0,a.createElement)(Nu,{rootClientId:n,clientId:e})))),i.length<1&&t,(0,a.createElement)(Vm,{tagName:r,rootClientId:n,renderAppender:o}))}function uh(e){return(0,a.createElement)(p.AsyncModeProvider,{value:!1},(0,a.createElement)(ch,e))}function dh(e){return[...e].sort(((t,n)=>e.filter((e=>e===n)).length-e.filter((e=>e===t)).length)).shift()}function ph(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{flat:t,...n}=e;return t||dh(Object.values(n).filter(Boolean))||"px"}function mh(){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,m.__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=dh(o),i=0===r||r?`${r}${l}`:void 0;return i}function fh(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=mh(e),n="string"!=typeof e&&isNaN(parseFloat(t));return n}function gh(e){if(!e)return!1;if("string"==typeof e)return!0;return!!Object.values(e).filter((e=>!!e||0===e)).length}function hh(e){let{onChange:t,selectedUnits:n,setSelectedUnits:o,values:r,...l}=e,s=mh(r);void 0===s&&(s=ph(n));const c=gh(r)&&fh(r),u=c?(0,g.__)("Mixed"):null;return(0,a.createElement)(m.__experimentalUnitControl,i({},l,{"aria-label":(0,g.__)("Border radius"),disableUnits:c,isOnly:!0,value:s,onChange:e=>{const n=!isNaN(parseFloat(e));t(n?e:void 0)},onUnitChange:e=>{o({topLeft:e,topRight:e,bottomLeft:e,bottomRight:e})},placeholder:u}))}sh.__unstableElementContext=lh;const vh={topLeft:(0,g.__)("Top left"),topRight:(0,g.__)("Top right"),bottomLeft:(0,g.__)("Bottom left"),bottomRight:(0,g.__)("Bottom right")};function bh(e){let{onChange:t,selectedUnits:n,setSelectedUnits:o,values:r,...l}=e;const s=e=>n=>{if(!t)return;const o=!isNaN(parseFloat(n))?n:void 0;t({...c,[e]:o})},c="string"!=typeof r?r:{topLeft:r,topRight:r,bottomLeft:r,bottomRight:r};return(0,a.createElement)("div",{className:"components-border-radius-control__input-controls-wrapper"},Object.entries(vh).map((e=>{let[t,r]=e;const[u,d]=(0,m.__experimentalParseQuantityAndUnitFromRawValue)(c[t]),p=c[t]?d:n[t]||n.flat;return(0,a.createElement)(m.Tooltip,{text:r,position:"top",key:t},(0,a.createElement)("div",{className:"components-border-radius-control__tooltip-wrapper"},(0,a.createElement)(m.__experimentalUnitControl,i({},l,{"aria-label":r,value:[u,p].join(""),onChange:s(t),onUnitChange:(f=t,e=>{const t={...n};t[f]=e,o(t)})}))));var f})))}function _h(e){let{isLinked:t,...n}=e;const o=t?(0,g.__)("Unlink radii"):(0,g.__)("Link radii");return(0,a.createElement)(m.Tooltip,{text:o},(0,a.createElement)("span",null,(0,a.createElement)(m.Button,i({},n,{className:"component-border-radius-control__linked-button",isSmall:!0,icon:t?er:tr,iconSize:24,"aria-label":o}))))}const kh={topLeft:void 0,topRight:void 0,bottomLeft:void 0,bottomRight:void 0},yh={px:100,em:20,rem:20};function Eh(e){let{onChange:t,values:n}=e;const[o,r]=(0,a.useState)(!gh(n)||!fh(n)),[l,i]=(0,a.useState)({flat:"string"==typeof n?(0,m.__experimentalParseQuantityAndUnitFromRawValue)(n)[1]:void 0,topLeft:(0,m.__experimentalParseQuantityAndUnitFromRawValue)(null==n?void 0:n.topLeft)[1],topRight:(0,m.__experimentalParseQuantityAndUnitFromRawValue)(null==n?void 0:n.topRight)[1],bottomLeft:(0,m.__experimentalParseQuantityAndUnitFromRawValue)(null==n?void 0:n.bottomLeft)[1],bottomRight:(0,m.__experimentalParseQuantityAndUnitFromRawValue)(null==n?void 0:n.bottomRight)[1]}),s=(0,m.__experimentalUseCustomUnits)({availableUnits:qo("spacing.units")||["px","em","rem"]}),c=ph(l),u=s&&s.find((e=>e.value===c)),d=(null==u?void 0:u.step)||1,[p]=(0,m.__experimentalParseQuantityAndUnitFromRawValue)(mh(n));return(0,a.createElement)("fieldset",{className:"components-border-radius-control"},(0,a.createElement)(m.BaseControl.VisualLabel,{as:"legend"},(0,g.__)("Radius")),(0,a.createElement)("div",{className:"components-border-radius-control__wrapper"},o?(0,a.createElement)(a.Fragment,null,(0,a.createElement)(hh,{className:"components-border-radius-control__unit-control",values:n,min:0,onChange:t,selectedUnits:l,setSelectedUnits:i,units:s}),(0,a.createElement)(m.RangeControl,{label:(0,g.__)("Border radius"),hideLabelFromVision:!0,className:"components-border-radius-control__range-control",value:null!=p?p:"",min:0,max:yh[c],initialPosition:0,withInputField:!1,onChange:e=>{t(void 0!==e?`${e}${c}`:void 0)},step:d})):(0,a.createElement)(bh,{min:0,onChange:t,selectedUnits:l,setSelectedUnits:i,values:n||kh,units:s}),(0,a.createElement)(_h,{onClick:()=>r(!o),isLinked:o})))}function Ch(e){var t;const{attributes:{style:n},setAttributes:o}=e;return(0,a.createElement)(Eh,{values:null==n||null===(t=n.border)||void 0===t?void 0:t.radius,onChange:e=>{const t=ar({...n,border:{...null==n?void 0:n.border,radius:e}});o({style:t})}})}Dd([Od,Vd]);const wh=(e,t,n)=>{if(t){const n=(0,u.find)(e,{slug:t});if(n)return n}return{color:n}},Sh=(e,t)=>(0,u.find)(e,{color:t});function Bh(e,t){if(e&&t)return`has-${(0,u.kebabCase)(t)}-${e}`}function Ih(){return{disableCustomColors:!qo("color.custom"),disableCustomGradients:!qo("color.customGradient")}}function xh(){const e=Ih(),t=qo("color.palette.custom"),n=qo("color.palette.theme"),o=qo("color.palette.default"),r=qo("color.defaultPalette");e.colors=(0,a.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=qo("color.gradients.custom"),i=qo("color.gradients.theme"),s=qo("color.gradients.default"),c=qo("color.defaultGradients");return e.gradients=(0,a.useMemo)((()=>{const e=[];return i&&i.length&&e.push({name:(0,g._x)("Theme","Indicates this palette comes from the theme."),gradients:i}),c&&s&&s.length&&e.push({name:(0,g._x)("Default","Indicates this palette comes from WordPress."),gradients:s}),l&&l.length&&e.push({name:(0,g._x)("Custom","Indicates this palette is created by the user."),gradients:l}),e}),[l,i,s]),e}const Th="__experimentalBorder",Nh=["top","right","bottom","left"],Ph=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}}}},Mh=(e,t,n)=>{let o;return e.some((e=>e.colors.some((e=>e[t]===n&&(o=e,!0))))),o},Lh=e=>{let{colors:t,namedColor:n,customColor:o}=e;if(n){const e=Mh(t,"slug",n);if(e)return e}if(!o)return{color:void 0};const r=Mh(t,"color",o);return r||{color:o}};function Rh(e){const t=/var:preset\|color\|(.+)/.exec(e);return t&&t[1]?t[1]:null}function Ah(e){const{attributes:t,clientId:n,setAttributes:o}=e,{style:l}=t,{colors:i}=xh(),s=Dh(e.name),c=qo("border.color")&&Dh(e.name,"color"),u=qo("border.radius")&&Dh(e.name,"radius"),d=qo("border.style")&&Dh(e.name,"style"),p=qo("border.width")&&Dh(e.name,"width");if([!c,!u,!d,!p].every(Boolean)||!s)return null;const f=(0,r.getBlockSupport)(e.name,[Th,"__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}=Lh({colors:t,namedColor:n});return e?{...r,color:e}:r}if(!r)return r;const l={...r};return Nh.forEach((e=>{var n;const o=Rh(null===(n=l[e])||void 0===n?void 0:n.color);if(o){const{color:n}=Lh({colors:t,namedColor:o});l[e]={...l[e],color:n}}})),l})(t,i);return(0,a.createElement)(hr,{__experimentalGroup:"border"},(p||c)&&(0,a.createElement)(m.__experimentalToolsPanelItem,{hasValue:()=>(e=>{const{borderColor:t,style:n}=e.attributes;return(0,m.__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:ar({radius:null==r||null===(t=r.border)||void 0===t?void 0:t.radius})}})})(e),isShownByDefault:h,resetAllFilter:Ph,panelId:n},(0,a.createElement)(m.__experimentalBorderBoxControl,{colors:i,enableAlpha:!0,enableStyle:d,onChange:e=>{var t;let n,r={...e};if((0,m.__experimentalHasSplitBorders)(e))r={top:{...e.top},right:{...e.right},bottom:{...e.bottom},left:{...e.left}},Nh.forEach((t=>{var n;if(null!==(n=e[t])&&void 0!==n&&n.color){var o;const n=Lh({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=Lh({colors:i,customColor:t});o.slug&&(n=o.slug,r.color=void 0)}const a=ar({...l,border:{radius:null==l||null===(t=l.border)||void 0===t?void 0:t.radius,...r}});o({style:a,borderColor:n})},popoverOffset:40,popoverPlacement:"left-start",value:v,__experimentalHasMultipleOrigins:!0,__experimentalIsRenderedInSidebar:!0})),u&&(0,a.createElement)(m.__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:Oh(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,a.createElement)(Ch,e)))}function Dh(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"any";if("web"!==a.Platform.OS)return!1;const n=(0,r.getBlockSupport)(e,Th);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 Oh(e,t){return ar({...e,border:{...null==e?void 0:e.border,[t]:void 0}})}function zh(e,t,n){if(!Dh(t,"color")||ur(t,Th,"color"))return e;const o=Fh(n),r=c()(e.className,o);return e.className=r||void 0,e}function Fh(e){var t;const{borderColor:n,style:o}=e,r=Bh("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 Vh=(0,d.createHigherOrderComponent)((e=>t=>{var n,o,r,l,s,c,u,d,p;const{name:m,attributes:f}=t,{borderColor:g,style:h}=f,{colors:v}=xh();if(!Dh(m,"color")||ur(m,Th,"color"))return(0,a.createElement)(e,t);const{color:b}=Lh({colors:v,namedColor:g}),{color:_}=Lh({colors:v,namedColor:Rh(null==h||null===(n=h.border)||void 0===n||null===(o=n.top)||void 0===o?void 0:o.color)}),{color:k}=Lh({colors:v,namedColor:Rh(null==h||null===(r=h.border)||void 0===r||null===(l=r.right)||void 0===l?void 0:l.color)}),{color:y}=Lh({colors:v,namedColor:Rh(null==h||null===(s=h.border)||void 0===s||null===(c=s.bottom)||void 0===c?void 0:c.color)}),{color:E}=Lh({colors:v,namedColor:Rh(null==h||null===(u=h.border)||void 0===u||null===(d=u.left)||void 0===d?void 0:d.color)}),C={borderTopColor:_||b,borderRightColor:k||b,borderBottomColor:y||b,borderLeftColor:E||b};let w=t.wrapperProps;return w={...t.wrapperProps,style:{...null===(p=t.wrapperProps)||void 0===p?void 0:p.style,...C}},(0,a.createElement)(e,i({},t,{wrapperProps:w}))}));function Hh(e){if(e)return`has-${e}-gradient-background`}function Gh(e,t){const n=(0,u.find)(e,["slug",t]);return n&&n.gradient}function Uh(e,t){return(0,u.find)(e,["gradient",t])}function Wh(e,t){const n=Uh(e,t);return n&&n.slug}function jh(){let{gradientAttribute:e="gradient",customGradientAttribute:t="customGradient"}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{clientId:n}=mo(),o=qo("color.gradients.custom"),r=qo("color.gradients.theme"),l=qo("color.gradients.default"),i=(0,a.useMemo)((()=>[...o||[],...r||[],...l||[]]),[o,r,l]),{gradient:s,customGradient:c}=(0,p.useSelect)((o=>{const{getBlockAttributes:r}=o(so),l=r(n)||{};return{customGradient:l[t],gradient:l[e]}}),[n,e,t]),{updateBlockAttributes:u}=(0,p.useDispatch)(so),d=(0,a.useCallback)((o=>{const r=Wh(i,o);u(n,r?{[e]:r,[t]:void 0}:{[e]:void 0,[t]:o})}),[i,n,u]),m=Hh(s);let f;return f=s?Gh(i,s):c,{gradientClass:m,gradientValue:f,setGradient:d}}(0,l.addFilter)("blocks.registerBlockType","core/border/addAttributes",(function(e){return Dh(e,"color")?e.attributes.borderColor?e:{...e,attributes:{...e.attributes,borderColor:{type:"string"}}}:e})),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/border/addSaveProps",zh),(0,l.addFilter)("blocks.registerBlockType","core/border/addEditProps",(function(e){if(!Dh(e,"color")||ur(e,Th,"color"))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),zh(o,e,n)},e})),(0,l.addFilter)("editor.BlockListBlock","core/border/with-border-color-palette-styles",Vh);const $h=["colors","disableCustomColors","gradients","disableCustomGradients"],Kh={name:"color",title:"Solid",value:"color"},qh={name:"gradient",title:"Gradient",value:"gradient"},Yh=[Kh,qh];function Zh(e){let{colors:t,gradients:n,disableCustomColors:o,disableCustomGradients:r,__experimentalHasMultipleOrigins:l,__experimentalIsRenderedInSidebar:i,className:s,label:d,onColorChange:p,onGradientChange:f,colorValue:g,gradientValue:h,clearable:v,showTitle:b=!0,enableAlpha:_}=e;const k=p&&(!(0,u.isEmpty)(t)||!o),y=f&&(!(0,u.isEmpty)(n)||!r);if(!k&&!y)return null;const E={[Kh.value]:(0,a.createElement)(m.ColorPalette,{value:g,onChange:y?e=>{p(e),f()}:p,colors:t,disableCustomColors:o,__experimentalHasMultipleOrigins:l,__experimentalIsRenderedInSidebar:i,clearable:v,enableAlpha:_}),[qh.value]:(0,a.createElement)(m.GradientPicker,{__nextHasNoMargin:!0,value:h,onChange:k?e=>{f(e),p()}:f,gradients:n,disableCustomGradients:r,__experimentalHasMultipleOrigins:l,__experimentalIsRenderedInSidebar:i,clearable:v})},C=e=>(0,a.createElement)("div",{className:"block-editor-color-gradient-control__panel"},E[e]);return(0,a.createElement)(m.BaseControl,{__nextHasNoMarginBottom:!0,className:c()("block-editor-color-gradient-control",s)},(0,a.createElement)("fieldset",{className:"block-editor-color-gradient-control__fieldset"},(0,a.createElement)(m.__experimentalVStack,{spacing:1},b&&(0,a.createElement)("legend",null,(0,a.createElement)("div",{className:"block-editor-color-gradient-control__color-indicator"},(0,a.createElement)(m.BaseControl.VisualLabel,null,d))),k&&y&&(0,a.createElement)(m.TabPanel,{className:"block-editor-color-gradient-control__tabs",tabs:Yh,initialTabName:h?qh.value:!!k&&Kh.value},(e=>C(e.value))),!y&&C(Kh.value),!k&&C(qh.value))))}function Qh(e){const t={};return t.colors=qo("color.palette"),t.gradients=qo("color.gradients"),t.disableCustomColors=!qo("color.custom"),t.disableCustomGradients=!qo("color.customGradient"),(0,a.createElement)(Zh,i({},t,e))}var Xh=function(e){return(0,u.every)($h,(t=>e.hasOwnProperty(t)))?(0,a.createElement)(Zh,e):(0,a.createElement)(Qh,e)};const Jh=e=>{let{setting:t,children:n,panelId:o,...r}=e;return(0,a.createElement)(m.__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)},ev=e=>{let{colorValue:t,label:n}=e;return(0,a.createElement)(m.__experimentalHStack,{justify:"flex-start"},(0,a.createElement)(m.ColorIndicator,{className:"block-editor-panel-color-gradient-settings__color-indicator",colorValue:t}),(0,a.createElement)(m.FlexItem,{className:"block-editor-panel-color-gradient-settings__color-name",title:n},n))},tv=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,a.createElement)(m.Button,i,(0,a.createElement)(ev,{colorValue:r,label:l}))};function nv(e){let t,{colors:n,disableCustomColors:o,disableCustomGradients:r,enableAlpha:l,gradients:s,settings:c,__experimentalHasMultipleOrigins:u,__experimentalIsRenderedInSidebar:d,...p}=e;return d&&(t={placement:"left-start",offset:36,shift:!0}),(0,a.createElement)(a.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:s,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,a.createElement)(Jh,i({key:c,setting:e},p),(0,a.createElement)(m.Dropdown,{popoverProps:t,className:"block-editor-tools-panel-color-gradient-settings__dropdown",renderToggle:tv(h),renderContent:()=>(0,a.createElement)(m.__experimentalDropdownContentWrapper,{paddingSize:"none"},(0,a.createElement)("div",{className:"block-editor-panel-color-gradient-settings__dropdown-content"},(0,a.createElement)(Xh,g)))}))})))}Dd([Od,Vd]);var ov=function(e){let{backgroundColor:t,fallbackBackgroundColor:n,fallbackTextColor:o,fallbackLinkColor:r,fontSize:l,isLargeText:i,textColor:s,linkColor:c,enableAlphaChecker:u=!1}=e;const d=t||n;if(!d)return null;const p=s||o,f=c||r;if(!p&&!f)return null;const h=[{color:p,description:(0,g.__)("text color")},{color:f,description:(0,g.__)("link color")}],v=Rd(d),b=v.alpha()<1,_=v.brightness(),k={level:"AA",size:i||!1!==i&&l>=24?"large":"small"};let y="",E="";for(const e of h){if(!e.color)continue;const t=Rd(e.color),n=t.isReadable(v,k),o=t.alpha()<1;if(!n){if(b||o)continue;y=_<t.brightness()?(0,g.sprintf)((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)((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,qt.speak)(E),(0,a.createElement)("div",{className:"block-editor-contrast-checker"},(0,a.createElement)(m.Notice,{spokenMessage:null,status:"warning",isDismissible:!1},y))):null};function rv(e){return e.ownerDocument.defaultView.getComputedStyle(e)}function lv(e){let{enableAlpha:t=!1,settings:n,clientId:o,enableContrastChecking:r=!0}=e;const[l,s]=(0,a.useState)(),[c,u]=(0,a.useState)(),[d,p]=(0,a.useState)(),m=Mo(o),f=n.filter((e=>null==e?void 0:e.colorValue));(0,a.useEffect)((()=>{var e;if(!r||!f.length)return;if(!m.current)return;u(rv(m.current).color);const t=null===(e=m.current)||void 0===e?void 0:e.querySelector("a");t&&t.innerText&&p(rv(t).color);let n=m.current,o=rv(n).backgroundColor;for(;"rgba(0, 0, 0, 0)"===o&&n.parentNode&&n.parentNode.nodeType===n.parentNode.ELEMENT_NODE;)n=n.parentNode,o=rv(n).backgroundColor;s(o)}));const g=xh();return(0,a.createElement)(hr,{__experimentalGroup:"color"},(0,a.createElement)(nv,i({enableAlpha:t,panelId:o,settings:n,__experimentalIsItemGroup:!1,__experimentalHasMultipleOrigins:!0,__experimentalIsRenderedInSidebar:!0},g)),r&&(0,a.createElement)(ov,{backgroundColor:l,textColor:c,enableAlphaChecker:t,linkColor:d}))}const iv="color",av=e=>{const t=(0,r.getBlockSupport)(e,iv);return t&&(!0===t.link||!0===t.gradient||!1!==t.background||!1!==t.text)},sv=e=>{if("web"!==a.Platform.OS)return!1;const t=(0,r.getBlockSupport)(e,iv);return null!==t&&"object"==typeof t&&!!t.link},cv=e=>{const t=(0,r.getBlockSupport)(e,iv);return null!==t&&"object"==typeof t&&!!t.gradients},uv=e=>{const t=(0,r.getBlockSupport)(e,iv);return t&&!1!==t.background},dv=e=>{const t=(0,r.getBlockSupport)(e,iv);return t&&!1!==t.text},pv=(e,t)=>ar(sr(t,e,void 0)),mv=e=>({textColor:void 0,style:pv(["color","text"],e.style)}),fv=e=>({style:pv(["elements","link","color","text"],e.style)}),gv=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 hv(e,t,n){var o,r,l,i,a,s;if(!av(t)||ur(t,iv))return e;const u=cv(t),{backgroundColor:d,textColor:p,gradient:m,style:f}=n,g=e=>!ur(t,iv,e),h=g("text")?Bh("color",p):void 0,v=g("gradients")?Hh(m):void 0,b=g("background")?Bh("background-color",d):void 0,_=g("background")||g("gradients"),k=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===(a=f.elements)||void 0===a||null===(s=a.link)||void 0===s?void 0:s.color)});return e.className=y||void 0,e}const vv=(e,t)=>{const n=/var:preset\|color\|(.+)/.exec(t);return n&&n[1]?wh(e,n[1]).color:t};function bv(e){var t,n,o,l,i,s,c,u,d;const{name:p,attributes:m}=e,f=qo("color.palette.custom"),h=qo("color.palette.theme"),v=qo("color.palette.default"),b=(0,a.useMemo)((()=>[...f||[],...h||[],...v||[]]),[f,h,v]),_=qo("color.gradients.custom"),k=qo("color.gradients.theme"),y=qo("color.gradients.default"),E=(0,a.useMemo)((()=>[..._||[],...k||[],...y||[]]),[_,k,y]),C=qo("color.custom"),w=qo("color.customGradient"),S=qo("color.background"),B=qo("color.link"),I=qo("color.text"),x=C||!h||(null==h?void 0:h.length)>0,T=w||!k||(null==k?void 0:k.length)>0,N=(0,a.useRef)(m);if((0,a.useEffect)((()=>{N.current=m}),[m]),!av(p))return null;const P=sv(p)&&B&&x,M=dv(p)&&I&&x,L=uv(p)&&S&&x,R=cv(p)&&T;if(!(P||M||L||R))return null;const{style:A,textColor:D,backgroundColor:O,gradient:z}=m;let F;if(R&&z)F=Gh(E,z);else if(R){var V;F=null==A||null===(V=A.color)||void 0===V?void 0:V.gradient}const H=t=>n=>{var o,r;const l=Sh(b,n),i=t+"Color",a={...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}},s=null!=l&&l.slug?l.slug:void 0,c={style:ar(a),[i]:s};e.setAttributes(c),N.current={...N.current,...c}},G=(0,r.getBlockSupport)(e.name,[iv,"__experimentalDefaultControls"]),U=!("web"!==a.Platform.OS||z||null!=A&&null!==(t=A.color)&&void 0!==t&&t.gradient||!1===(0,r.getBlockSupport)(e.name,[iv,"enableContrastChecker"]));return(0,a.createElement)(lv,{enableContrastChecking:U,clientId:e.clientId,enableAlpha:!0,settings:[...M?[{label:(0,g.__)("Text"),onColorChange:H("text"),colorValue:wh(b,D,null==A||null===(n=A.color)||void 0===n?void 0:n.text).color,isShownByDefault:null==G?void 0:G.text,resetAllFilter:mv}]:[],...L||R?[{label:(0,g.__)("Background"),onColorChange:L?H("background"):void 0,colorValue:wh(b,O,null==A||null===(o=A.color)||void 0===o?void 0:o.background).color,gradientValue:F,onGradientChange:R?t=>{const n=Wh(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:ar(e),gradient:n}}else{var a,s,c;const e={...null===(a=N.current)||void 0===a?void 0:a.style,color:{...null===(s=N.current)||void 0===s||null===(c=s.style)||void 0===c?void 0:c.color,gradient:t}};o={style:ar(e),gradient:void 0}}e.setAttributes(o),N.current={...N.current,...o}}:void 0,isShownByDefault:null==G?void 0:G.background,resetAllFilter:gv}]:[],...P?[{label:(0,g.__)("Link"),onColorChange:t=>{var n;const o=Sh(b,t),r=null!=o&&o.slug?`var:preset|color|${o.slug}`:t,l=ar(sr(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:vv(b,null==A||null===(l=A.elements)||void 0===l||null===(i=l.link)||void 0===i||null===(s=i.color)||void 0===s?void 0:s.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==G?void 0:G.link,resetAllFilter:fv}]:[]]})}const _v=(0,d.createHigherOrderComponent)((e=>t=>{var n;const{name:o,attributes:r}=t,{backgroundColor:l,textColor:s}=r,c=qo("color.palette.custom")||[],u=qo("color.palette.theme")||[],d=qo("color.palette.default")||[],p=(0,a.useMemo)((()=>[...c||[],...u||[],...d||[]]),[c,u,d]);if(!av(o)||ur(o,iv))return(0,a.createElement)(e,t);const m={};var f,g;s&&!ur(o,iv,"text")&&(m.color=null===(f=wh(p,s))||void 0===f?void 0:f.color);l&&!ur(o,iv,"background")&&(m.backgroundColor=null===(g=wh(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,a.createElement)(e,i({},t,{wrapperProps:h}))})),kv={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 av(e)?(e.attributes.backgroundColor||Object.assign(e.attributes,{backgroundColor:{type:"string"}}),e.attributes.textColor||Object.assign(e.attributes,{textColor:{type:"string"}}),cv(e)&&!e.attributes.gradient&&Object.assign(e.attributes,{gradient:{type:"string"}}),e):e})),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/color/addSaveProps",hv),(0,l.addFilter)("blocks.registerBlockType","core/color/addEditProps",(function(e){if(!av(e)||ur(e,iv))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),hv(o,e,n)},e})),(0,l.addFilter)("editor.BlockListBlock","core/color/with-color-palette-styles",_v),(0,l.addFilter)("blocks.switchToBlockType.transformedBlock","core/color/addTransforms",(function(e,t,n,o){const r=e.name;return cr({linkColor:sv(r),textColor:dv(r),backgroundColor:uv(r),gradient:cv(r)},kv,e,t,n,o)}));const yv=[{name:(0,g._x)("Regular","font style"),value:"normal"},{name:(0,g._x)("Italic","font style"),value:"italic"}],Ev=[{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"}],Cv=(e,t)=>e?t?(0,g.__)("Appearance"):(0,g.__)("Font style"):(0,g.__)("Font weight");function wv(e){const{onChange:t,hasFontStyles:n=!0,hasFontWeights:o=!0,value:{fontStyle:r,fontWeight:l},...s}=e,c=n||o,u=Cv(n,o),d={key:"default",name:(0,g.__)("Default"),style:{fontStyle:void 0,fontWeight:void 0}},p=(0,a.useMemo)((()=>n&&o?(()=>{const e=[d];return yv.forEach((t=>{let{name:n,value:o}=t;Ev.forEach((t=>{let{name:r,value:l}=t;const i="normal"===o?r:(0,g.sprintf)((0,g.__)("%1$s %2$s"),r,n);e.push({key:`${o}-${l}`,name:i,style:{fontStyle:o,fontWeight:l}})}))})),e})():n?(()=>{const e=[d];return yv.forEach((t=>{let{name:n,value:o}=t;e.push({key:o,name:n,style:{fontStyle:o,fontWeight:void 0}})})),e})():(()=>{const e=[d];return Ev.forEach((t=>{let{name:n,value:o}=t;e.push({key:o,name:n,style:{fontStyle:void 0,fontWeight:o}})})),e})()),[e.options]),f=p.find((e=>e.style.fontStyle===r&&e.style.fontWeight===l))||p[0];return c&&(0,a.createElement)(m.CustomSelectControl,i({},s,{className:"components-font-appearance-control",label:u,describedBy:f?n?o?(0,g.sprintf)((0,g.__)("Currently selected font appearance: %s"),f.name):(0,g.sprintf)((0,g.__)("Currently selected font style: %s"),f.name):(0,g.sprintf)((0,g.__)("Currently selected font weight: %s"),f.name):(0,g.__)("No selected font appearance"),options:p,value:f,onChange:e=>{let{selectedItem:n}=e;return t(n.style)},__nextUnconstrainedWidth:!0}))}const Sv=1.5,Bv=.1;var Iv=e=>{let{value:t,onChange:n,__nextHasNoMarginBottom:o=!1,__unstableInputWidth:r="60px",...l}=e;const s=function(e){return void 0!==e&&""!==e}(t),c=s?t:"";o||V()("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 u=o?void 0:{marginBottom:24};return(0,a.createElement)("div",{className:"block-editor-line-height-control",style:u},(0,a.createElement)(m.__experimentalNumberControl,i({},l,{__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(s)return e;switch(`${e}`){case"0.1":return 1.6;case"0":return t?e:1.4;case"":return Sv;default:return e}})(e.value,o);return{...e,value:r}},onChange:n,label:(0,g.__)("Line height"),placeholder:Sv,step:Bv,value:c,min:0})))};const xv="typography.lineHeight";function Tv(e){var t;const{attributes:{style:n},setAttributes:o}=e;return(0,a.createElement)(Iv,{__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:ar(t)})},size:"__unstable-large"})}function Nv(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!qo("typography.lineHeight");return!(0,r.hasBlockSupport)(e,xv)||t}const Pv="typography.__experimentalFontStyle",Mv="typography.__experimentalFontWeight";function Lv(e){var t,n;const{attributes:{style:o},setAttributes:r}=e,l=!Rv(e),i=!Av(e),s=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,a.createElement)(wv,{onChange:e=>{r({style:ar({...o,typography:{...null==o?void 0:o.typography,fontStyle:e.fontStyle,fontWeight:e.fontWeight}})})},hasFontStyles:l,hasFontWeights:i,value:{fontStyle:s,fontWeight:c},size:"__unstable-large"})}function Rv(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=(0,r.hasBlockSupport)(e,Pv),n=qo("typography.fontStyle");return!t||!n}function Av(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=(0,r.hasBlockSupport)(e,Mv),n=qo("typography.fontWeight");return!t||!n}function Dv(e){const t=Rv(e),n=Av(e);return t&&n}function Ov(e){let{value:t="",onChange:n,fontFamilies:o,...r}=e;const l=qo("typography.fontFamilies");if(o||(o=l),(0,u.isEmpty)(o))return null;const s=[{value:"",label:(0,g.__)("Default")},...o.map((e=>{let{fontFamily:t,name:n}=e;return{value:t,label:n||t}}))];return(0,a.createElement)(m.SelectControl,i({label:(0,g.__)("Font"),options:s,value:t,onChange:n,labelPosition:"top"},r))}const zv="typography.__experimentalFontFamily";function Fv(e,t,n){if(!(0,r.hasBlockSupport)(t,zv))return e;if(ur(t,bb,"fontFamily"))return e;if(null==n||!n.fontFamily)return e;const o=new(Nf())(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 Vv(e){var t;let{setAttributes:n,attributes:{fontFamily:o}}=e;const r=qo("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,a.createElement)(Ov,{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})},size:"__unstable-large",__nextHasNoMarginBottom:!0})}function Hv(e){let{name:t}=e;const n=qo("typography.fontFamilies");return!n||0===n.length||!(0,r.hasBlockSupport)(t,zv)}(0,l.addFilter)("blocks.registerBlockType","core/fontFamily/addAttribute",(function(e){return(0,r.hasBlockSupport)(e,zv)?(e.attributes.fontFamily||Object.assign(e.attributes,{fontFamily:{type:"string"}}),e):e})),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/fontFamily/addSaveProps",Fv),(0,l.addFilter)("blocks.registerBlockType","core/fontFamily/addEditProps",(function(e){if(!(0,r.hasBlockSupport)(e,zv))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),Fv(o,e,n)},e}));const Gv=(e,t,n)=>{if(t){const n=(0,u.find)(e,{slug:t});if(n)return n}return{size:n}};function Uv(e,t){const n=(0,u.find)(e,{size:t});return n||{size:t}}function Wv(e){if(e)return`has-${(0,u.kebabCase)(e)}-font-size`}var jv=function(e){const t=qo("typography.fontSizes"),n=!qo("typography.customFontSize");return(0,a.createElement)(m.FontSizePicker,i({},e,{fontSizes:t,disableCustomFontSizes:n}))};const $v="typography.fontSize";function Kv(e,t,n){if(!(0,r.hasBlockSupport)(t,$v))return e;if(ur(t,bb,"fontSize"))return e;const o=new(Nf())(e.className);o.add(Wv(n.fontSize));const l=o.value;return e.className=l||void 0,e}function qv(e){var t,n;const{attributes:{fontSize:o,style:r},setAttributes:l}=e,i=qo("typography.fontSizes"),s=Gv(i,o,null==r||null===(t=r.typography)||void 0===t?void 0:t.fontSize),c=(null==s?void 0:s.size)||(null==r||null===(n=r.typography)||void 0===n?void 0:n.fontSize)||o;return(0,a.createElement)(jv,{onChange:e=>{const t=Uv(i,e).slug;l({style:ar({...r,typography:{...null==r?void 0:r.typography,fontSize:t?void 0:e}}),fontSize:t})},value:c,withReset:!1,size:"__unstable-large",__nextHasNoMarginBottom:!0})}function Yv(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=qo("typography.fontSizes"),n=!(null==t||!t.length);return!(0,r.hasBlockSupport)(e,$v)||!n}const Zv=(0,d.createHigherOrderComponent)((e=>t=>{var n,o;const l=qo("typography.fontSizes"),{name:i,attributes:{fontSize:s,style:c},wrapperProps:u}=t;if(!(0,r.hasBlockSupport)(i,$v)||ur(i,bb,"fontSize")||!s||null!=c&&null!==(n=c.typography)&&void 0!==n&&n.fontSize)return(0,a.createElement)(e,t);const d=Gv(l,s,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,a.createElement)(e,p)}),"withFontSizeInlineStyles"),Qv={fontSize:[["fontSize"],["style","typography","fontSize"]]};(0,l.addFilter)("blocks.registerBlockType","core/font/addAttribute",(function(e){return(0,r.hasBlockSupport)(e,$v)?(e.attributes.fontSize||Object.assign(e.attributes,{fontSize:{type:"string"}}),e):e})),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/font/addSaveProps",Kv),(0,l.addFilter)("blocks.registerBlockType","core/font/addEditProps",(function(e){if(!(0,r.hasBlockSupport)(e,$v))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),Kv(o,e,n)},e})),(0,l.addFilter)("editor.BlockListBlock","core/font-size/with-font-size-inline-styles",Zv),(0,l.addFilter)("blocks.switchToBlockType.transformedBlock","core/font-size/addTransforms",(function(e,t,n,o){const l=e.name;return cr({fontSize:(0,r.hasBlockSupport)(l,$v)},Qv,e,t,n,o)}));var Xv=(0,a.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(D.Path,{d:"M7 11.5h10V13H7z"}));var Jv=(0,a.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(D.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"}));var eb=(0,a.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(D.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 tb=[{name:(0,g.__)("None"),value:"none",icon:Xv},{name:(0,g.__)("Underline"),value:"underline",icon:Jv},{name:(0,g.__)("Strikethrough"),value:"line-through",icon:eb}];function nb(e){let{value:t,onChange:n,className:o}=e;return(0,a.createElement)("fieldset",{className:c()("block-editor-text-decoration-control",o)},(0,a.createElement)(m.BaseControl.VisualLabel,{as:"legend"},(0,g.__)("Decoration")),(0,a.createElement)("div",{className:"block-editor-text-decoration-control__buttons"},tb.map((e=>(0,a.createElement)(m.Button,{key:e.value,icon:e.icon,label:e.name,isPressed:e.value===t,onClick:()=>{n(e.value===t?void 0:e.value)}})))))}const ob="typography.__experimentalTextDecoration";function rb(e){var t;const{attributes:{style:n},setAttributes:o}=e;return(0,a.createElement)(nb,{value:null==n||null===(t=n.typography)||void 0===t?void 0:t.textDecoration,onChange:function(e){o({style:ar({...n,typography:{...null==n?void 0:n.typography,textDecoration:e}})})},size:"__unstable-large"})}function lb(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!(0,r.hasBlockSupport)(e,ob),n=qo("typography.textDecoration");return t||!n}var ib=(0,a.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(D.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"}));var ab=(0,a.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(D.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"}));var sb=(0,a.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(D.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 cb=[{name:(0,g.__)("None"),value:"none",icon:Xv},{name:(0,g.__)("Uppercase"),value:"uppercase",icon:ib},{name:(0,g.__)("Lowercase"),value:"lowercase",icon:ab},{name:(0,g.__)("Capitalize"),value:"capitalize",icon:sb}];function ub(e){let{className:t,value:n,onChange:o}=e;return(0,a.createElement)("fieldset",{className:c()("block-editor-text-transform-control",t)},(0,a.createElement)(m.BaseControl.VisualLabel,{as:"legend"},(0,g.__)("Letter case")),(0,a.createElement)("div",{className:"block-editor-text-transform-control__buttons"},cb.map((e=>(0,a.createElement)(m.Button,{key:e.value,icon:e.icon,label:e.name,isPressed:e.value===n,onClick:()=>{o(e.value===n?void 0:e.value)}})))))}const db="typography.__experimentalTextTransform";function pb(e){var t;const{attributes:{style:n},setAttributes:o}=e;return(0,a.createElement)(ub,{value:null==n||null===(t=n.typography)||void 0===t?void 0:t.textTransform,onChange:function(e){o({style:ar({...n,typography:{...null==n?void 0:n.typography,textTransform:e}})})},size:"__unstable-large"})}function mb(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!(0,r.hasBlockSupport)(e,db),n=qo("typography.textTransform");return t||!n}function fb(e){let{value:t,onChange:n,__unstableInputWidth:o="60px",...r}=e;const l=(0,m.__experimentalUseCustomUnits)({availableUnits:qo("spacing.units")||["px","em","rem"],defaultValues:{px:2,em:.2,rem:.2}});return(0,a.createElement)(m.__experimentalUnitControl,i({},r,{label:(0,g.__)("Letter spacing"),value:t,__unstableInputWidth:o,units:l,onChange:n}))}const gb="typography.__experimentalLetterSpacing";function hb(e){var t;const{attributes:{style:n},setAttributes:o}=e;return(0,a.createElement)(fb,{value:null==n||null===(t=n.typography)||void 0===t?void 0:t.letterSpacing,onChange:function(e){o({style:ar({...n,typography:{...null==n?void 0:n.typography,letterSpacing:e}})})},__unstableInputWidth:"100%",size:"__unstable-large"})}function vb(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!(0,r.hasBlockSupport)(e,gb),n=qo("typography.letterSpacing");return t||!n}const bb="typography",_b=[xv,$v,Pv,Mv,zv,ob,db,gb];function kb(e){const{clientId:t}=e,n=Hv(e),o=Yv(e),l=Dv(e),i=Nv(e),s=lb(e),c=mb(e),u=vb(e),d=!Rv(e),p=!Av(e),f=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=[Dv(e),Yv(e),Nv(e),Hv(e),lb(e),mb(e),vb(e)];return t.filter(Boolean).length===t.length}(e),h=yb(e.name);if(f||!h)return null;const v=(0,r.getBlockSupport)(e.name,[bb,"__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,a.createElement)(hr,{__experimentalGroup:"typography"},!n&&(0,a.createElement)(m.__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,a.createElement)(Vv,e)),!o&&(0,a.createElement)(m.__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),label:(0,g.__)("Font size"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({fontSize:void 0,style:ar({...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,a.createElement)(qv,e)),!l&&(0,a.createElement)(m.__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:Cv(d,p),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:ar({...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,a.createElement)(Lv,e)),!i&&(0,a.createElement)(m.__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:ar({...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,a.createElement)(Tv,e)),!u&&(0,a.createElement)(m.__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:ar({...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,a.createElement)(hb,e)),!s&&(0,a.createElement)(m.__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:ar({...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,a.createElement)(rb,e)),!c&&(0,a.createElement)(m.__experimentalToolsPanelItem,{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),label:(0,g.__)("Letter case"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:ar({...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,a.createElement)(pb,e)))}const yb=e=>_b.some((t=>(0,r.hasBlockSupport)(e,t)));const Eb=[..._b,Th,iv,Nr],Cb=e=>Eb.some((t=>(0,r.hasBlockSupport)(e,t)));function wb(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t={};return(0,ml.getCSSRules)(e).forEach((e=>{t[e.key]=e.value})),t}const Sb={"__experimentalBorder.__experimentalSkipSerialization":["border"],"color.__experimentalSkipSerialization":[iv],[`${bb}.__experimentalSkipSerialization`]:[bb],[`${Nr}.__experimentalSkipSerialization`]:["spacing"]},Bb={...Sb,[`${Nr}`]:["spacing.blockGap"]},Ib={gradients:"gradient"};function xb(e,t,n){let o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Bb;if(!Cb(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=Ib[e]||e;l=(0,u.omit)(l,[[...o,t]])}))})),e.style={...wb(l),...e.style},e}const Tb=(0,d.createHigherOrderComponent)((e=>t=>{const n=fo();return(0,a.createElement)(a.Fragment,null,n&&(0,a.createElement)(a.Fragment,null,(0,a.createElement)(bv,t),(0,a.createElement)(kb,t),(0,a.createElement)(Ah,t),(0,a.createElement)(Lr,t)),(0,a.createElement)(e,t))}),"withToolbarControls"),Nb=(0,d.createHigherOrderComponent)((e=>t=>{var n,o;const l=`wp-elements-${(0,d.useInstanceId)(e)}`,s=ur(t.name,iv,"link"),u=(0,a.useMemo)((()=>{var e;const n=null===(e=t.attributes.style)||void 0===e?void 0:e.elements,o=[];if(n&&Object.keys(n).length>0){var i;const e={...n,link:{...n.link,color:s||null===(i=n.link)||void 0===i?void 0:i.color}};for(const[t,n]of Object.entries(e)){const e=(0,ml.compileCSS)(n,{selector:`.editor-styles-wrapper .${l} ${r.__EXPERIMENTAL_ELEMENTS[t]}`});e&&o.push(e)}}return o.length>0?o:void 0}),[null===(n=t.attributes.style)||void 0===n?void 0:n.elements]),p=(0,a.useContext)(sh.__unstableElementContext);return(0,a.createElement)(a.Fragment,null,u&&p&&(0,a.createPortal)((0,a.createElement)("style",{dangerouslySetInnerHTML:{__html:u}}),p),(0,a.createElement)(e,i({},t,{className:null!==(o=t.attributes.style)&&void 0!==o&&o.elements?c()(t.className,l):t.className})))}));(0,l.addFilter)("blocks.registerBlockType","core/style/addAttribute",(function(e){return Cb(e)?(e.attributes.style||Object.assign(e.attributes,{style:{type:"object"}}),e):e})),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/style/addSaveProps",xb),(0,l.addFilter)("blocks.registerBlockType","core/style/addEditProps",(function(e){if(!Cb(e))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),xb(o,e,n,Sb)},e})),(0,l.addFilter)("editor.BlockEdit","core/style/with-block-controls",Tb),(0,l.addFilter)("editor.BlockListBlock","core/editor/with-elements-styles",Nb);(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 Pb=(0,a.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(D.Path,{d:"M12 4 4 19h16L12 4zm0 3.2 5.5 10.3H12V7.2z"}));var Mb=function(e){let t,{colorPalette:n,duotonePalette:o,disableCustomColors:r,disableCustomDuotone:l,value:i,onChange:s}=e;return t="unset"===i?(0,a.createElement)(m.ColorIndicator,{className:"block-editor-duotone-control__unset-indicator"}):i?(0,a.createElement)(m.DuotoneSwatch,{values:i}):(0,a.createElement)(ul,{icon:Pb}),(0,a.createElement)(m.Dropdown,{popoverProps:{className:"block-editor-duotone-control__popover",headerTitle:(0,g.__)("Duotone"),isAlternate:!0},renderToggle:e=>{let{isOpen:n,onToggle:o}=e;return(0,a.createElement)(m.ToolbarButton,{showTooltip:!0,onClick:o,"aria-haspopup":"true","aria-expanded":n,onKeyDown:e=>{n||e.keyCode!==ku.DOWN||(e.preventDefault(),o())},label:(0,g.__)("Apply duotone filter"),icon:t})},renderContent:()=>(0,a.createElement)(m.MenuGroup,{label:(0,g.__)("Duotone")},(0,a.createElement)("div",{className:"block-editor-duotone-control__description"},(0,g.__)("Create a two-tone color effect without losing your original image.")),(0,a.createElement)(m.DuotonePicker,{colorPalette:n,duotonePalette:o,disableCustomColors:r,disableCustomDuotone:l,value:i,onChange:s}))})};const Lb=[];function Rb(e){let{selector:t,id:n,colors:o}=e;return"unset"===o?(0,a.createElement)(mp,{selector:t}):(0,a.createElement)(a.Fragment,null,(0,a.createElement)(fp,{id:n,colors:o}),(0,a.createElement)(pp,{id:n,selector:t}))}function Ab(e){let{presetSetting:t,defaultSetting:n}=e;const o=!qo(n),r=qo(`${t}.custom`)||Lb,l=qo(`${t}.theme`)||Lb,i=qo(`${t}.default`)||Lb;return(0,a.useMemo)((()=>[...r,...l,...o?Lb:i]),[o,r,l,i])}function Db(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=Ab({presetSetting:"color.duotone",defaultSetting:"color.defaultDuotone"}),s=Ab({presetSetting:"color.palette",defaultSetting:"color.defaultPalette"}),c=!qo("color.custom"),u=!qo("color.customDuotone")||0===(null==s?void 0:s.length)&&c;return 0===(null==i?void 0:i.length)&&u?null:(0,a.createElement)(_o,{group:"block",__experimentalShareWithChildBlocks:!0},(0,a.createElement)(Mb,{duotonePalette:i,colorPalette:s,disableCustomDuotone:u,disableCustomColors:c,value:l,onChange:e=>{const t={...r,color:{...null==r?void 0:r.color,duotone:e}};o({style:t})}}))}Dd([Od]);const Ob=(0,d.createHigherOrderComponent)((e=>t=>{const n=(0,r.hasBlockSupport)(t.name,"color.__experimentalDuotone"),o=(0,p.useSelect)((e=>e(so).__unstableGetContentLockingParent(t.clientId)),[t.clientId]);return(0,a.createElement)(a.Fragment,null,(0,a.createElement)(e,t),n&&!o&&(0,a.createElement)(Db,t))}),"withDuotoneControls");const zb=(0,d.createHigherOrderComponent)((e=>t=>{var n,o,l;const s=(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(!s||!u)return(0,a.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}`,s),f=c()(null==t?void 0:t.className,p),g=(0,a.useContext)(sh.__unstableElementContext);return(0,a.createElement)(a.Fragment,null,g&&(0,a.createPortal)((0,a.createElement)(Rb,{selector:m,id:p,colors:u}),g),(0,a.createElement)(e,i({},t,{className:f})))}),"withDuotoneStyles");(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",Ob),(0,l.addFilter)("editor.BlockListBlock","core/editor/duotone/with-styles",zb);const Fb="__experimentalLayout";function Vb(e){let{setAttributes:t,attributes:n,name:o}=e;const{layout:l}=n,i=qo("layout"),s=(0,p.useSelect)((e=>{const{getSettings:t}=e(so);return t().supportsLayout}),[]),c=(0,r.getBlockSupport)(o,Fb,{}),{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)&&"constrained"!==(null==l?void 0:l.type)&&(null==l||!l.inherit)),b=l||h||{},{inherit:_=!1,type:k="default",contentSize:y=null}=b;if(("default"===k||"constrained"===k)&&!s)return null;const E=hl(k),C=hl("constrained"),w=!b.type&&(y||_),S=!!_||!!y,B=e=>t({layout:e});return(0,a.createElement)(a.Fragment,null,(0,a.createElement)(hr,null,(0,a.createElement)(m.PanelBody,{title:(0,g.__)("Layout")},v&&(0,a.createElement)(a.Fragment,null,(0,a.createElement)(m.ToggleControl,{className:"block-editor-hooks__toggle-control",label:(0,g.__)("Inner blocks use content width"),checked:"constrained"===(null==E?void 0:E.name)||S,onChange:()=>t({layout:{type:"constrained"===(null==E?void 0:E.name)||S?"default":"constrained"}}),help:"constrained"===(null==E?void 0:E.name)||S?(0,g.__)("Nested blocks use content width with options for full and wide widths."):(0,g.__)("Nested blocks will fill the width of this container. Toggle to constrain.")})),!_&&u&&(0,a.createElement)(Hb,{type:k,onChange:e=>t({layout:{type:e}})}),E&&"default"!==E.name&&(0,a.createElement)(E.inspectorControls,{layout:b,onChange:B,layoutBlockSupport:c}),C&&w&&(0,a.createElement)(C.inspectorControls,{layout:b,onChange:B,layoutBlockSupport:c}))),!_&&E&&(0,a.createElement)(E.toolBarControls,{layout:b,onChange:B,layoutBlockSupport:c}))}function Hb(e){let{type:t,onChange:n}=e;return(0,a.createElement)(m.ButtonGroup,null,gl.map((e=>{let{name:o,label:r}=e;return(0,a.createElement)(m.Button,{key:o,isPressed:t===o,onClick:()=>n(o)},r)})))}const Gb=(0,d.createHigherOrderComponent)((e=>t=>{const{name:n}=t;return[(0,r.hasBlockSupport)(n,Fb)&&(0,a.createElement)(Vb,i({key:"layout"},t)),(0,a.createElement)(e,i({key:"edit"},t))]}),"withInspectorControls"),Ub=(0,d.createHigherOrderComponent)((e=>t=>{const{name:n,attributes:o}=t,l=(0,r.hasBlockSupport)(n,Fb),s=(0,p.useSelect)((e=>{const{getSettings:t}=e(so);return!!t().disableLayoutStyles})),m=l&&!s,f=(0,d.useInstanceId)(e),g=qo("layout")||{},h=(0,a.useContext)(sh.__unstableElementContext),{layout:v}=o,{default:b}=(0,r.getBlockSupport)(n,Fb)||{},_=null!=v&&v.inherit||null!=v&&v.contentSize||null!=v&&v.wideSize?{...v,type:"constrained"}:v||b||{},k=l?function(e,t){var n;const o=(0,p.useSelect)((e=>{var t;const{getSettings:n}=e(so);return null===(t=n().__experimentalFeatures)||void 0===t?void 0:t.useRootPaddingAwareAlignments}),[]),r=[];var l;return null!=t&&null!==(n=t[(null==e?void 0:e.type)||"default"])&&void 0!==n&&n.className&&r.push(null==t||null===(l=t[(null==e?void 0:e.type)||"default"])||void 0===l?void 0:l.className),(null!=e&&e.inherit||null!=e&&e.contentSize||"constrained"===(null==e?void 0:e.type))&&o&&r.push("has-global-padding"),null!=e&&e.orientation&&r.push(`is-${(0,u.kebabCase)(e.orientation)}`),null!=e&&e.justifyContent&&r.push(`is-content-justification-${(0,u.kebabCase)(e.justifyContent)}`),null!=e&&e.flexWrap&&"nowrap"===e.flexWrap&&r.push("is-nowrap"),r}(_,null==g?void 0:g.definitions):null,y=`.${(0,r.getBlockDefaultClassName)(n)}.wp-container-${f}`,E=null!==qo("spacing.blockGap");let C;if(m){var w;const e=hl((null==_?void 0:_.type)||"default");C=null==e||null===(w=e.getLayoutStyle)||void 0===w?void 0:w.call(e,{blockName:n,selector:y,layout:_,layoutDefinitions:null==g?void 0:g.definitions,style:null==o?void 0:o.style,hasBlockGapSupport:E})}const S=c()(null==t?void 0:t.className,{[`wp-container-${f}`]:m&&!!C},k);return(0,a.createElement)(a.Fragment,null,m&&h&&!!C&&(0,a.createPortal)((0,a.createElement)(yl,{blockName:n,selector:y,css:C,layout:_,style:null==o?void 0:o.style}),h),(0,a.createElement)(e,i({},t,{className:S})))}));function Wb(e){let{clientId:t,stopEditingAsBlock:n}=e;const o=(0,p.useSelect)((e=>{const{isBlockSelected:n,hasSelectedInnerBlock:o}=e(so);return n(t)||o(t,!0)}),[t]);return(0,a.useEffect)((()=>{o||n()}),[o]),null}(0,l.addFilter)("blocks.registerBlockType","core/layout/addAttribute",(function(e){var t,n;return"type"in(null!==(t=null===(n=e.attributes)||void 0===n?void 0:n.layout)&&void 0!==t?t:{})||(0,r.hasBlockSupport)(e,Fb)&&(e.attributes={...e.attributes,layout:{type:"object"}}),e})),(0,l.addFilter)("editor.BlockListBlock","core/editor/layout/with-layout-styles",Ub),(0,l.addFilter)("editor.BlockEdit","core/editor/layout/with-inspector-controls",Gb);const jb=(0,d.createHigherOrderComponent)((e=>t=>{const{getBlockListSettings:n,getSettings:o}=(0,p.useSelect)(so),r=(0,a.useRef)(),{templateLock:l,isLockedByParent:s,isEditingAsBlocks:u}=(0,p.useSelect)((e=>{const{__unstableGetContentLockingParent:n,getTemplateLock:o,__unstableGetTemporarilyEditingAsBlocks:r}=e(so);return{templateLock:o(t.clientId),isLockedByParent:!!n(t.clientId),isEditingAsBlocks:r()===t.clientId}}),[t.clientId]),{updateSettings:d,updateBlockListSettings:f,__unstableSetTemporarilyEditingAsBlocks:h}=(0,p.useDispatch)(so),v=!s&&"contentOnly"===l,{__unstableMarkNextChangeAsNotPersistent:b,updateBlockAttributes:_}=(0,p.useDispatch)(so),k=(0,a.useCallback)((()=>{b(),_(t.clientId,{templateLock:"contentOnly"}),f(t.clientId,{...n(t.clientId),templateLock:"contentOnly"}),d({focusMode:r.current}),h()}),[t.clientId,r,d,f,n,b,_,h]);return v||u?(0,a.createElement)(a.Fragment,null,u&&!v&&(0,a.createElement)(Wb,{clientId:t.clientId,stopEditingAsBlock:k}),(0,a.createElement)(_o,{group:"other"},(0,a.createElement)(m.ToolbarButton,{onClick:()=>{u&&!v?k():(b(),_(t.clientId,{templateLock:void 0}),f(t.clientId,{...n(t.clientId),templateLock:!1}),r.current=o().focusMode,d({focusMode:!0}),h(t.clientId))}},u&&!v?(0,g.__)("Done"):(0,g.__)("Modify"))),(0,a.createElement)(e,i({},t,{className:c()(t.className,u&&"is-content-locked-editing-as-blocks")}))):(0,a.createElement)(e,t)}),"withToolbarControls");(0,l.addFilter)("editor.BlockEdit","core/style/with-block-controls",jb);const $b="metadata";function Kb(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const n=(0,r.getBlockSupport)(e,"__experimentalMetadata");return!!(!0===n||null!=n&&n[t])}function qb(e){var t;const n=(null===(t=e.style)||void 0===t?void 0:t.border)||{};return{className:Fh(e)||void 0,style:wb({border:n})}}function Yb(e){const{colors:t}=xh(),n=qb(e),{borderColor:o}=e;if(o){const e=Lh({colors:t,namedColor:o});n.style.borderColor=e.color}return n}function Zb(e){var t,n,o,r,l,i;const{backgroundColor:a,textColor:s,gradient:u,style:d}=e,p=Bh("background-color",a),m=Bh("color",s),f=Hh(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":s||(null==d||null===(n=d.color)||void 0===n?void 0:n.text),"has-background":a||(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:wb({color:(null==d?void 0:d.color)||{}})}}(0,l.addFilter)("blocks.registerBlockType","core/metadata/addMetaAttribute",(function(e){var t,n;return null!=e&&null!==(t=e.attributes)&&void 0!==t&&null!==(n=t.metadata)&&void 0!==n&&n.type||Kb(e,"name",!1)&&(e.attributes={...e.attributes,[$b]:{type:"object"}}),e})),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/metadata/save-props",(function(e,t,n){return Kb(t)&&(e.metadata=n.metadata),e})),(0,l.addFilter)("blocks.registerBlockType","core/metadata/addLabelCallback",(function(e){return e.__experimentalLabel||Kb(e,"name",!1)&&(e.__experimentalLabel=(e,t)=>{let{context:n}=t;const{metadata:o}=e;if("list-view"===n&&null!=o&&o.name)return o.name}),e}));const Qb={};function Xb(e){const{backgroundColor:t,textColor:n,gradient:o}=e,r=qo("color.palette.custom")||[],l=qo("color.palette.theme")||[],i=qo("color.palette.default")||[],s=qo("color.gradients")||Qb,c=(0,a.useMemo)((()=>[...r||[],...l||[],...i||[]]),[r,l,i]),u=(0,a.useMemo)((()=>[...(null==s?void 0:s.custom)||[],...(null==s?void 0:s.theme)||[],...(null==s?void 0:s.default)||[]]),[s]),d=Zb(e);if(t){const e=wh(c,t);d.style.backgroundColor=e.color}if(o&&(d.style.background=Gh(u,o)),n){const e=wh(c,n);d.style.color=e.color}return d}function Jb(e){const{style:t}=e;return{style:wb({spacing:(null==t?void 0:t.spacing)||{}})}}function e_(e){var t;const n=wb({typography:(null==e||null===(t=e.style)||void 0===t?void 0:t.typography)||{}}),o=null!=e&&e.fontFamily?`has-${(0,u.kebabCase)(e.fontFamily)}-font-family`:"";return{className:c()(o,Wv(null==e?void 0:e.fontSize)),style:n}}function t_(e){const[t,n]=(0,a.useState)(e);return(0,a.useEffect)((()=>{e&&n(e)}),[e]),t}const n_=e=>{let[t,...n]=e;return t.toUpperCase()+n.join("")},o_=e=>(0,d.createHigherOrderComponent)((t=>n=>(0,a.createElement)(t,i({},n,{colors:e}))),"withCustomColorPalette"),r_=()=>(0,d.createHigherOrderComponent)((e=>t=>{const n=qo("color.palette.custom"),o=qo("color.palette.theme"),r=qo("color.palette.default"),l=(0,a.useMemo)((()=>[...n||[],...o||[],...r||[]]),[n,o,r]);return(0,a.createElement)(e,i({},t,{colors:l}))}),"withEditorColorPalette");function l_(e,t){const n=(0,u.reduce)(e,((e,t)=>({...e,..."string"==typeof t?{[t]:(0,u.kebabCase)(t)}:t})),{});return(0,d.compose)([t,e=>class extends a.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=Rd(t),o=e=>{let{color:t}=e;return n.contrast(t)},r=Math.max(...e.map(o));return e.find((e=>o(e)===r)).color}(t,e)}createSetters(){return(0,u.reduce)(n,((e,t,n)=>{const o=n_(n),r=`custom${o}`;return e[`set${o}`]=this.createSetColor(n,r),e}),{})}createSetColor(e,t){return n=>{const o=Sh(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=wh(r,o[l],o[`custom${n_(l)}`]),a=t[l];return(null==a?void 0:a.color)===i.color&&a?e[l]=a:e[l]={...i,class:Bh(n,i.slug)},e}),{})}render(){return(0,a.createElement)(e,i({},this.props,{colors:void 0},this.state,this.setters,{colorUtils:this.colorUtils}))}}])}function i_(e){return function(){const t=o_(e);for(var n=arguments.length,o=new Array(n),r=0;r<n;r++)o[r]=arguments[r];return(0,d.createHigherOrderComponent)(l_(o,t),"withCustomColors")}}function a_(){const e=r_();for(var t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];return(0,d.createHigherOrderComponent)(l_(n,e),"withColors")}const s_=[],c_=e=>{let[t,...n]=e;return t.toUpperCase()+n.join("")};var u_=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${c_(t)}`,e)),{});return(0,d.createHigherOrderComponent)((0,d.compose)([(0,d.createHigherOrderComponent)((e=>t=>{const n=qo("typography.fontSizes")||s_;return(0,a.createElement)(e,i({},t,{fontSizes:n}))}),"withFontSizes"),e=>class extends a.Component{constructor(e){super(e),this.setters=this.createSetters(),this.state={}}createSetters(){return(0,u.reduce)(o,((e,t,n)=>(e[`set${c_(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=Gv(r,l,n[t]);return e[o]={...i,class:Wv(l)},e}),{});return{...t,...i}}render(){return(0,a.createElement)(e,i({},this.props,{fontSizes:void 0},this.state,this.setters))}}]),"withFontSizes")};var d_=(0,a.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(D.Path,{d:"M4 19.8h8.9v-1.5H4v1.5zm8.9-15.6H4v1.5h8.9V4.2zm-8.9 7v1.5h16v-1.5H4z"}));var p_=(0,a.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(D.Path,{d:"M16.4 4.2H7.6v1.5h8.9V4.2zM4 11.2v1.5h16v-1.5H4zm3.6 8.6h8.9v-1.5H7.6v1.5z"}));var m_=(0,a.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(D.Path,{d:"M11.1 19.8H20v-1.5h-8.9v1.5zm0-15.6v1.5H20V4.2h-8.9zM4 12.8h16v-1.5H4v1.5z"}));const f_=[{icon:d_,title:(0,g.__)("Align text left"),align:"left"},{icon:p_,title:(0,g.__)("Align text center"),align:"center"},{icon:m_,title:(0,g.__)("Align text right"),align:"right"}],g_={position:"bottom right",isAlternate:!0};var h_=function(e){let{value:t,onChange:n,alignmentControls:o=f_,label:r=(0,g.__)("Align"),describedBy:l=(0,g.__)("Change text alignment"),isCollapsed:s=!0,isToolbar:c}=e;function d(e){return()=>n(t===e?void 0:e)}const p=(0,u.find)(o,(e=>e.align===t)),f=c?m.ToolbarGroup:m.ToolbarDropdownMenu,h=c?{isCollapsed:s}:{toggleProps:{describedBy:l},popoverProps:g_};return(0,a.createElement)(f,i({icon:p?p.icon:(0,g.isRTL)()?m_:d_,label:r,controls:o.map((e=>{const{align:n}=e,o=t===n;return{...e,isActive:o,role:s?"menuitemradio":void 0,onClick:d(n)}}))},h))};const v_=e=>(0,a.createElement)(h_,i({},e,{isToolbar:!1})),b_=e=>(0,a.createElement)(h_,i({},e,{isToolbar:!0})),__=()=>{};var k_={name:"blocks",className:"block-editor-autocompleters__block",triggerPrefix:"/",useItems(e){const{rootClientId:t,selectedBlockName:n}=(0,p.useSelect)((e=>{const{getSelectedBlockClientId:t,getBlockName:n,getBlockInsertionPoint:o}=e(so),r=t();return{selectedBlockName:r?n(r):null,rootClientId:o().rootClientId}}),[]),[o,r,l]=Mp(t,__),i=(0,a.useMemo)((()=>(e.trim()?um(o,r,l,e):(0,u.orderBy)(o,["frecency"],["desc"])).filter((e=>e.name!==n)).slice(0,9)),[e,n,o,r,l]),s=(0,a.useMemo)((()=>i.map((e=>{const{title:t,icon:n,isDisabled:o}=e;return{key:`block-${e.id}`,value:e,label:(0,a.createElement)(a.Fragment,null,(0,a.createElement)(Du,{key:"icon",icon:n,showColors:!0}),t),isDisabled:o}}))),[i]);return[s]},allowContext(e,t){return!(/\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))}}},y_=window.wp.apiFetch,E_=n.n(y_);var C_=(0,a.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(D.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"}));var w_=(0,a.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(D.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"}));var S_={name:"links",className:"block-editor-autocompleters__link",triggerPrefix:"[[",options:async e=>{let t=await E_()({path:(0,_m.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){return[...e.title.split(/\s+/)]},getOptionLabel(e){return(0,a.createElement)(a.Fragment,null,(0,a.createElement)(ul,{key:"icon",icon:"page"===e.subtype?C_:w_}),e.title)},getOptionCompletion(e){return(0,a.createElement)("a",{href:e.url},e.title)}};const B_=[];function I_(e){let{completers:t=B_}=e;const{name:n}=mo();return(0,a.useMemo)((()=>{let e=[...t,S_];return(n===(0,r.getDefaultBlockName)()||(0,r.getBlockSupport)(n,"__experimentalSlashInserter",!1))&&(e=[...e,k_]),(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 x_=function(e){return(0,a.createElement)(m.Autocomplete,i({},e,{completers:I_(e)}))};var T_=(0,a.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(D.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"}));var N_=function(e){let{isActive:t,label:n=(0,g.__)("Toggle full height"),onToggle:o,isDisabled:r}=e;return(0,a.createElement)(m.ToolbarButton,{isActive:t,icon:T_,label:n,onClick:()=>o(!t),disabled:r})};const P_=()=>{};var M_=function(e){const{label:t=(0,g.__)("Change matrix alignment"),onChange:n=P_,value:o="center",isDisabled:r}=e,l=(0,a.createElement)(m.__experimentalAlignmentMatrixControl.Icon,{value:o});return(0,a.createElement)(m.Dropdown,{position:"bottom right",popoverProps:{isAlternate:!0},renderToggle:e=>{let{onToggle:n,isOpen:o}=e;return(0,a.createElement)(m.ToolbarButton,{onClick:n,"aria-haspopup":"true","aria-expanded":o,onKeyDown:e=>{o||e.keyCode!==ku.DOWN||(e.preventDefault(),n())},label:t,icon:l,showTooltip:!0,disabled:r})},renderContent:()=>(0,a.createElement)(m.__experimentalAlignmentMatrixControl,{hasFocusBorder:!1,onChange:n,value:o})})};var L_=(0,a.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(D.Path,{d:"M10.8622 8.04053L14.2805 12.0286L10.8622 16.0167L9.72327 15.0405L12.3049 12.0286L9.72327 9.01672L10.8622 8.04053Z"}));var R_=function(e){let{rootLabelText:t}=e;const{selectBlock:n,clearSelectedBlock:o}=(0,p.useDispatch)(so),{clientId:r,parents:l,hasSelection:i}=(0,p.useSelect)((e=>{const{getSelectionStart:t,getSelectedBlockClientId:n,getBlockParents:o}=e(so),r=n();return{parents:o(r),clientId:r,hasSelection:!!t().clientId}}),[]),s=t||(0,g.__)("Document");return(0,a.createElement)("ul",{className:"block-editor-block-breadcrumb",role:"list","aria-label":(0,g.__)("Block breadcrumb")},(0,a.createElement)("li",{className:i?void 0:"block-editor-block-breadcrumb__current","aria-current":i?void 0:"true"},i&&(0,a.createElement)(m.Button,{className:"block-editor-block-breadcrumb__button",variant:"tertiary",onClick:o},s),!i&&s,!!r&&(0,a.createElement)(ul,{icon:L_,className:"block-editor-block-breadcrumb__separator"})),l.map((e=>(0,a.createElement)("li",{key:e},(0,a.createElement)(m.Button,{className:"block-editor-block-breadcrumb__button",variant:"tertiary",onClick:()=>n(e)},(0,a.createElement)(Qm,{clientId:e,maximumLength:35})),(0,a.createElement)(ul,{icon:L_,className:"block-editor-block-breadcrumb__separator"})))),!!r&&(0,a.createElement)("li",{className:"block-editor-block-breadcrumb__current","aria-current":"true"},(0,a.createElement)(Qm,{clientId:r,maximumLength:35})))};const A_=()=>(0,a.createElement)(m.SVG,{xmlns:"https://www.w3.org/2000/svg",viewBox:"0 0 20 20"},(0,a.createElement)(m.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"})),D_=e=>{let{style:t,className:n}=e;return(0,a.createElement)("div",{className:"block-library-colors-selector__icon-container"},(0,a.createElement)("div",{className:`${n} block-library-colors-selector__state-selection`,style:t},(0,a.createElement)(A_,null)))},O_=e=>{let{TextColor:t,BackgroundColor:n}=e;return e=>{let{onToggle:o,isOpen:r}=e;return(0,a.createElement)(m.ToolbarGroup,null,(0,a.createElement)(m.ToolbarButton,{className:"components-toolbar__control block-library-colors-selector__toggle",label:(0,g.__)("Open Colors Selector"),onClick:o,onKeyDown:e=>{r||e.keyCode!==ku.DOWN||(e.preventDefault(),o())},icon:(0,a.createElement)(n,null,(0,a.createElement)(t,null,(0,a.createElement)(D_,null)))}))}};var z_=e=>{let{children:t,...n}=e;return V()("wp.blockEditor.BlockColorsStyleSelector",{alternative:"block supports API",since:"6.1",version:"6.3"}),(0,a.createElement)(m.Dropdown,{position:"bottom right",className:"block-library-colors-selector",contentClassName:"block-library-colors-selector__popover",renderToggle:O_(n),renderContent:()=>t})};var F_=(0,a.createElement)(D.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,a.createElement)(D.Path,{d:"M13.8 5.2H3v1.5h10.8V5.2zm-3.6 12v1.5H21v-1.5H10.2zm7.2-6H6.6v1.5h10.8v-1.5z"}));const V_=ou(m.__experimentalTreeGridRow);function H_(e){let{isSelected:t,position:n,level:o,rowCount:r,children:l,className:s,path:u,...d}=e;const p=iu({isSelected:t,adjustScrolling:!1,enableAnimation:!0,triggerAnimationOnChange:u});return(0,a.createElement)(V_,i({ref:p,className:c()("block-editor-list-view-leaf",s),level:o,positionInSet:n,setSize:r},d),l)}var G_=(0,a.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(D.Path,{d:"m13.1 16-3.4-4 3.4-4 1.1 1-2.6 3 2.6 3-1.1 1z"}));function U_(e){let{onClick:t}=e;return(0,a.createElement)("span",{className:"block-editor-list-view__expander",onClick:e=>t(e,{forceToggle:!0}),"aria-hidden":"true"},(0,a.createElement)(ul,{icon:(0,g.isRTL)()?G_:L_}))}var W_=(0,a.forwardRef)((function(e,t){let{className:n,block:{clientId:o},onClick:r,onToggleExpanded:l,tabIndex:i,onFocus:s,onDragStart:u,onDragEnd:d,draggable:p}=e;const f=Ym(o),g=Zm({clientId:o,context:"list-view"}),{isLocked:h}=ug(o);return(0,a.createElement)(a.Fragment,null,(0,a.createElement)(m.Button,{className:c()("block-editor-list-view-block-select-button",n),onClick:r,onKeyDown:function(e){e.keyCode!==ku.ENTER&&e.keyCode!==ku.SPACE||r(e)},ref:t,tabIndex:i,onFocus:s,onDragStart:e=>{e.dataTransfer.clearData(),null==u||u(e)},onDragEnd:d,draggable:p,href:`#block-${o}`,"aria-hidden":!0},(0,a.createElement)(U_,{onClick:l}),(0,a.createElement)(Du,{icon:null==f?void 0:f.icon,showColors:!0}),(0,a.createElement)(m.__experimentalHStack,{alignment:"center",className:"block-editor-list-view-block-select-button__label-wrapper",justify:"flex-start",spacing:1},(0,a.createElement)("span",{className:"block-editor-list-view-block-select-button__title"},(0,a.createElement)(m.__experimentalTruncate,{ellipsizeMode:"auto"},g)),(null==f?void 0:f.anchor)&&(0,a.createElement)("span",{className:"block-editor-list-view-block-select-button__anchor-wrapper"},(0,a.createElement)(m.__experimentalTruncate,{className:"block-editor-list-view-block-select-button__anchor",ellipsizeMode:"auto"},f.anchor)),h&&(0,a.createElement)("span",{className:"block-editor-list-view-block-select-button__lock"},(0,a.createElement)(ul,{icon:pg})))))}));const j_=(0,a.forwardRef)(((e,t)=>{let{onClick:n,onToggleExpanded:o,block:r,isSelected:l,position:s,siblingBlockCount:u,level:d,isExpanded:m,selectedClientIds:f,...g}=e;const{clientId:h}=r,{blockMovingClientId:v,selectedBlockInBlockEditor:b}=(0,p.useSelect)((e=>{const{hasBlockMovingClientId:t,getSelectedBlockClientId:n}=e(so);return{blockMovingClientId:t(),selectedBlockInBlockEditor:n()}}),[h]),_=v&&b===h,k=c()("block-editor-list-view-block-contents",{"is-dropping-before":_}),y=f.includes(h)?f:[h];return(0,a.createElement)(Xm,{clientIds:y},(e=>{let{draggable:c,onDragStart:p,onDragEnd:f}=e;return(0,a.createElement)(W_,i({ref:t,className:k,block:r,onClick:n,onToggleExpanded:o,isSelected:l,position:s,siblingBlockCount:u,level:d,draggable:c,onDragStart:p,onDragEnd:f,isExpanded:m},g))}))}));var $_=j_;const K_=(0,a.createContext)({}),q_=()=>(0,a.useContext)(K_);var Y_=(0,a.memo)((function e(t){let{block:n,isDragged:o,isSelected:l,isBranchSelected:i,selectBlock:s,position:u,level:f,rowCount:h,siblingBlockCount:v,showBlockMovers:b,path:_,isExpanded:k,selectedClientIds:y,preventAnnouncement:E}=t;const C=(0,a.useRef)(null),[w,S]=(0,a.useState)(!1),{clientId:B}=n,{isLocked:I,isContentLocked:x}=ug(B),T=(0,p.useSelect)((e=>!l&&(!!x&&e(so).hasSelectedInnerBlock(B,!0))),[x,B,l]),N=T||l&&y[0]===B,P=T||l&&y[y.length-1]===B,{toggleBlockHighlight:M}=(0,p.useDispatch)(so),L=Ym(B),R=(0,p.useSelect)((e=>e(so).getBlockName(B)),[B]),A=(0,r.hasBlockSupport)(R,"__experimentalToolbar",!0),D=`list-view-block-select-button__${(0,d.useInstanceId)(e)}`,O=((e,t,n)=>(0,g.sprintf)((0,g.__)("Block %1$d of %2$d, Level %3$d"),e,t,n))(u,v,f);let z=(0,g.__)("Link");L&&(z=I?(0,g.sprintf)((0,g.__)("%s link (locked)"),L.title):(0,g.sprintf)((0,g.__)("%s link"),L.title));const F=L?(0,g.sprintf)((0,g.__)("Options for %s block"),L.title):(0,g.__)("Options"),{isTreeGridMounted:V,expand:H,collapse:G}=q_(),U=b&&v>0,W=c()("block-editor-list-view-block__mover-cell",{"is-visible":w||l}),j=c()("block-editor-list-view-block__menu-cell",{"is-visible":w||N});(0,a.useEffect)((()=>{!V&&l&&C.current.focus()}),[]);const $=(0,a.useCallback)((()=>{S(!0),M(B,!0)}),[B,S,M]),K=(0,a.useCallback)((()=>{S(!1),M(B,!1)}),[B,S,M]),q=(0,a.useCallback)((e=>{s(e,B),e.preventDefault()}),[B,s]),Y=(0,a.useCallback)((e=>{s(void 0,e)}),[s]),Z=(0,a.useCallback)((e=>{e.preventDefault(),e.stopPropagation(),!0===k?G(B):!1===k&&H(B)}),[B,H,G,k]);let Q;U?Q=2:A||(Q=3);const X=c()({"is-selected":l||T,"is-first-selected":N,"is-last-selected":P,"is-branch-selected":i,"is-dragging":o,"has-single-cell":!A}),J=y.includes(B)?y:[B];return(0,a.createElement)(H_,{className:X,onMouseEnter:$,onMouseLeave:K,onFocus:$,onBlur:K,level:f,position:u,rowCount:h,path:_,id:`list-view-block-${B}`,"data-block":B,isExpanded:x?void 0:k,"aria-selected":!!l||T},(0,a.createElement)(m.__experimentalTreeGridCell,{className:"block-editor-list-view-block__contents-cell",colSpan:Q,ref:C,"aria-label":z,"aria-selected":!!l||T,"aria-expanded":x?void 0:k,"aria-describedby":D},(e=>{let{ref:t,tabIndex:o,onFocus:r}=e;return(0,a.createElement)("div",{className:"block-editor-list-view-block__contents-container"},(0,a.createElement)($_,{block:n,onClick:q,onToggleExpanded:Z,isSelected:l,position:u,siblingBlockCount:v,level:f,ref:t,tabIndex:o,onFocus:r,isExpanded:k,selectedClientIds:y,preventAnnouncement:E}),(0,a.createElement)("div",{className:"block-editor-list-view-block-select-button__description",id:D},O))})),U&&(0,a.createElement)(a.Fragment,null,(0,a.createElement)(m.__experimentalTreeGridCell,{className:W,withoutGridItem:!0},(0,a.createElement)(m.__experimentalTreeGridItem,null,(e=>{let{ref:t,tabIndex:n,onFocus:o}=e;return(0,a.createElement)(cf,{orientation:"vertical",clientIds:[B],ref:t,tabIndex:n,onFocus:o})})),(0,a.createElement)(m.__experimentalTreeGridItem,null,(e=>{let{ref:t,tabIndex:n,onFocus:o}=e;return(0,a.createElement)(uf,{orientation:"vertical",clientIds:[B],ref:t,tabIndex:n,onFocus:o})})))),A&&(0,a.createElement)(m.__experimentalTreeGridCell,{className:j,"aria-selected":!!l||T},(e=>{let{ref:t,tabIndex:n,onFocus:o}=e;return(0,a.createElement)(Cg,{clientIds:J,icon:Yf,label:F,toggleProps:{ref:t,className:"block-editor-list-view-block__menu",tabIndex:n,onFocus:o},disableOpenOnArrowDown:!0,__experimentalSelectBlock:Y})})))}));function Z_(e,t,n,o){var r;if(null==n?void 0:n.includes(e.clientId))return 0;return(null!==(r=t[e.clientId])&&void 0!==r?r:o)?1+e.innerBlocks.reduce(Q_(t,n,o),0):1}const Q_=(e,t,n)=>(o,r)=>{var l;if(null==t?void 0:t.includes(r.clientId))return o;return(null!==(l=e[r.clientId])&&void 0!==l?l:n)&&r.innerBlocks.length>0?o+Z_(r,e,t,n):o+1};function X_(e){const{blocks:t,selectBlock:n,showBlockMovers:o,selectedClientIds:r,level:l=1,path:i="",isBranchSelected:s=!1,listPosition:c=0,fixedListWindow:u,isExpanded:d,parentId:m,shouldShowInnerBlocks:f=!0}=e,g=(0,p.useSelect)((e=>!(!m||"contentOnly"!==e(so).getTemplateLock(m))),[m]),{expandedState:h,draggedClientIds:v}=q_();if(g)return null;const b=t.filter(Boolean),_=b.length;let k=c;return(0,a.createElement)(a.Fragment,null,b.map(((e,t)=>{var c;const{clientId:m,innerBlocks:g}=e;t>0&&(k+=Z_(b[t-1],h,v,d));const{itemInView:y}=u,E=y(k),C=t+1,w=i.length>0?`${i}_${C}`:`${C}`,S=!(null==g||!g.length),B=S&&f?null!==(c=h[m])&&void 0!==c?c:d:void 0,I=!(null==v||!v.includes(m)),x=I||E,T=((e,t)=>Array.isArray(t)&&t.length?-1!==t.indexOf(e):t===e)(m,r),N=s||T&&S;return(0,a.createElement)(p.AsyncModeProvider,{key:m,value:!T},x&&(0,a.createElement)(Y_,{block:e,selectBlock:n,isSelected:T,isBranchSelected:N,isDragged:I,level:l,position:C,rowCount:_,siblingBlockCount:_,showBlockMovers:o,path:w,isExpanded:B,listPosition:k,selectedClientIds:r}),!x&&(0,a.createElement)("tr",null,(0,a.createElement)("td",{className:"block-editor-list-view-placeholder"})),S&&B&&!I&&(0,a.createElement)(X_,{parentId:m,blocks:g,selectBlock:n,showBlockMovers:o,level:l+1,path:w,listPosition:k+1,fixedListWindow:u,isBranchSelected:N,selectedClientIds:r,isExpanded:d}))})))}X_.defaultProps={selectBlock:()=>{}};var J_=(0,a.memo)(X_);function ek(e){let{listViewRef:t,blockDropTarget:n}=e;const{rootClientId:o,clientId:r,dropPosition:l}=n||{},[i,s]=(0,a.useMemo)((()=>{if(!t.current)return[];return[o?t.current.querySelector(`[data-block="${o}"]`):void 0,r?t.current.querySelector(`[data-block="${r}"]`):void 0]}),[o,r]),c=s||i,u=(0,a.useCallback)((()=>{if(!i)return 0;const e=c.getBoundingClientRect();return i.querySelector(".block-editor-block-icon").getBoundingClientRect().right-e.left}),[i,c]),d=(0,a.useMemo)((()=>{if(!c)return{};const e=u();return{width:c.offsetWidth-e}}),[u,c]),p=(0,a.useMemo)((()=>{if(c&&("top"===l||"bottom"===l||"inside"===l))return{ownerDocument:c.ownerDocument,getBoundingClientRect(){const e=c.getBoundingClientRect(),t=u(),n=e.left+t,o=e.right;let r=0,i=0;"top"===l?(r=e.top,i=e.top):(r=e.bottom,i=e.bottom);const a=o-n,s=i-r;return new window.DOMRect(n,r,a,s)}}}),[c,l,u]);return c?(0,a.createElement)(m.Popover,{animate:!1,anchor:p,focusOnMount:!1,className:"block-editor-list-view-drop-indicator"},(0,a.createElement)("div",{style:d,className:"block-editor-list-view-drop-indicator__line"})):null}function tk(){const{clearSelectedBlock:e,multiSelect:t,selectBlock:n}=(0,p.useDispatch)(so),{getBlockName:o,getBlockParents:l,getBlockSelectionStart:i,getBlockSelectionEnd:s,getSelectedBlockClientIds:c,hasMultiSelection:u,hasSelectedBlock:d}=(0,p.useSelect)(so),{getBlockType:m}=(0,p.useSelect)(r.store),f=(0,a.useCallback)((async(r,a,s)=>{if(null==r||!r.shiftKey)return void n(a);r.preventDefault();const p="keydown"===r.type&&(r.keyCode===ku.UP||r.keyCode===ku.DOWN||r.keyCode===ku.HOME||r.keyCode===ku.END);if(!p&&!d()&&!u())return void n(a,null);const f=c(),h=[...l(a),a];p&&!f.some((e=>h.includes(e)))&&await e();let v=i(),b=a;p&&(d()||u()||(v=a),s&&(b=s));const _=l(v),k=l(b),{start:y,end:E}=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]}}(v,b,_,k);await t(y,E,null);const C=c();if((r.keyCode===ku.HOME||r.keyCode===ku.END)&&C.length>1)return;const w=f.filter((e=>!C.includes(e)));let S;if(1===w.length){var B;const e=null===(B=m(o(w[0])))||void 0===B?void 0:B.title;e&&(S=(0,g.sprintf)((0,g.__)("%s deselected."),e))}else w.length>1&&(S=(0,g.sprintf)((0,g.__)("%s blocks deselected."),w.length));S&&(0,qt.speak)(S)}),[e,o,m,l,i,s,c,u,d,t,n]);return{updateBlockSelection:f}}function nk(e,t){return t.left<=e.x&&t.right>=e.x&&t.top<=e.y&&t.bottom>=e.y}const ok=["top","bottom"];function rk(){const{getBlockRootClientId:e,getBlockIndex:t,getBlockCount:n,getDraggedBlockClientIds:o,canInsertBlocks:r}=(0,p.useSelect)(so),[l,i]=(0,a.useState)(),{rootClientId:s,blockIndex:c}=l||{},u=Yg(s,c),m=o(),f=(0,d.useThrottle)((0,a.useCallback)(((o,l)=>{const a={x:o.clientX,y:o.clientY},s=!(null==m||!m.length),c=function(e,t){let n,o,r,l;for(const i of e){if(i.isDraggedBlock)continue;const a=i.element.getBoundingClientRect(),[s,c]=Qg(t,a,ok),u=nk(t,a);if(void 0===r||s<r||u){r=s;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=a),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 a=i?1:0;return{rootClientId:o.rootClientId,clientId:o.clientId,blockIndex:o.blockIndex+a,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:!!s&&m.includes(l),innerBlockCount:n(l),canInsertDraggedBlocksAsSibling:!s||r(m,i),canInsertDraggedBlocksAsChild:!s||r(m,l)}})),a);c&&i(c)}),[m]),200);return{ref:(0,d.__experimentalUseDropZone)({onDrop:u,onDragOver(e){f(e,e.currentTarget)},onDragEnd(){f.cancel(),i(null)}}),target:l}}const lk=(e,t)=>Array.isArray(t.clientIds)?{...e,...t.clientIds.reduce(((e,n)=>({...e,[n]:"expand"===t.type})),{})}:e;var ik=(0,a.forwardRef)((function(e,t){let{id:n,blocks:o,showBlockMovers:r=!1,isExpanded:l=!1}=e;const{clientIdsTree:i,draggedClientIds:s,selectedClientIds:c}=function(e){return(0,p.useSelect)((t=>{const{getDraggedBlockClientIds:n,getSelectedBlockClientIds:o,__unstableGetClientIdsTree:r}=t(so);return{selectedClientIds:o(),draggedClientIds:n(),clientIdsTree:e||r()}}),[e])}(o),{visibleBlockCount:u,shouldShowInnerBlocks:f}=(0,p.useSelect)((e=>{const{getGlobalBlockCount:t,getClientIdsOfDescendants:n,__unstableGetEditorMode:o}=e(so),r=(null==s?void 0:s.length)>0?n(s).length+1:0;return{visibleBlockCount:t()-r,shouldShowInnerBlocks:"zoom-out"!==o()}}),[s]),{updateBlockSelection:h}=tk(),[v,b]=(0,a.useReducer)(lk,{}),{ref:_,target:k}=rk(),y=(0,a.useRef)(),E=(0,d.useMergeRefs)([y,_,t]),C=(0,a.useRef)(!1),{setSelectedTreeId:w}=function(e){let{firstSelectedBlockClientId:t,setExpandedState:n}=e;const[o,r]=(0,a.useState)(null),{selectedBlockParentClientIds:l}=(0,p.useSelect)((e=>{const{getBlockParents:n}=e(so);return{selectedBlockParentClientIds:n(t,!1)}}),[t]),i=Array.isArray(l)&&l.length?l:null;return(0,a.useEffect)((()=>{o!==t&&i&&n({type:"expand",clientIds:l})}),[t]),{setSelectedTreeId:r}}({firstSelectedBlockClientId:c[0],setExpandedState:b}),S=(0,a.useCallback)(((e,t)=>{h(e,t),w(t)}),[w,h]);(0,a.useEffect)((()=>{C.current=!0}),[]);const[B]=(0,d.__experimentalUseFixedWindowList)(y,36,u,{useWindowing:!0,windowOverscan:40}),I=(0,a.useCallback)((e=>{e&&b({type:"expand",clientIds:[e]})}),[b]),x=(0,a.useCallback)((e=>{e&&b({type:"collapse",clientIds:[e]})}),[b]),T=(0,a.useCallback)((e=>{var t;I(null==e||null===(t=e.dataset)||void 0===t?void 0:t.block)}),[I]),N=(0,a.useCallback)((e=>{var t;x(null==e||null===(t=e.dataset)||void 0===t?void 0:t.block)}),[x]),P=(0,a.useCallback)(((e,t,n)=>{var o,r;e.shiftKey&&h(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)}),[h]),M=(0,a.useMemo)((()=>({isTreeGridMounted:C.current,draggedClientIds:s,expandedState:v,expand:I,collapse:x})),[C.current,s,v,I,x]);return(0,a.createElement)(p.AsyncModeProvider,{value:!0},(0,a.createElement)(ek,{listViewRef:y,blockDropTarget:k}),(0,a.createElement)(m.__experimentalTreeGrid,{id:n,className:"block-editor-list-view-tree","aria-label":(0,g.__)("Block navigation structure"),ref:E,onCollapseRow:N,onExpandRow:T,onFocusRow:P,applicationAriaLabel:(0,g.__)("Block navigation structure")},(0,a.createElement)(K_.Provider,{value:M},(0,a.createElement)(J_,{blocks:i,selectBlock:S,showBlockMovers:r,fixedListWindow:B,selectedClientIds:c,isExpanded:l,shouldShowInnerBlocks:f}))))}));function ak(e){let{isEnabled:t,onToggle:n,isOpen:o,innerRef:r,...l}=e;return(0,a.createElement)(m.Button,i({},l,{ref:r,icon:F_,"aria-expanded":o,"aria-haspopup":"true",onClick:t?n:void 0,label:(0,g.__)("List view"),className:"block-editor-block-navigation","aria-disabled":!t}))}var sk=(0,a.forwardRef)((function(e,t){let{isDisabled:n,...o}=e;V()("wp.blockEditor.BlockNavigationDropdown",{since:"6.1",alternative:"wp.components.Dropdown and wp.blockEditor.ListView"});const r=(0,p.useSelect)((e=>!!e(so).getBlockCount()),[])&&!n;return(0,a.createElement)(m.Dropdown,{contentClassName:"block-editor-block-navigation__popover",position:"bottom right",renderToggle:e=>{let{isOpen:n,onToggle:l}=e;return(0,a.createElement)(ak,i({},o,{innerRef:t,isOpen:n,onToggle:l,isEnabled:r}))},renderContent:()=>(0,a.createElement)("div",{className:"block-editor-block-navigation__container"},(0,a.createElement)("p",{className:"block-editor-block-navigation__label"},(0,g.__)("List view")),(0,a.createElement)(ik,null))})}));function ck(e){var t;let{genericPreviewBlock:n,style:o,className:l,activeStyle:i}=e;const s=null===(t=(0,r.getBlockType)(n.name))||void 0===t?void 0:t.example,c=Pf(l,i,o),u=(0,a.useMemo)((()=>({...n,title:o.label||o.name,description:o.description,initialAttributes:{...n.attributes,className:c+" block-editor-block-styles__block-preview-container"},example:s})),[n,c]);return(0,a.createElement)(yp,{item:u,isStylePreview:!0})}function uk(e){let{children:t,scope:n,...o}=e;return(0,a.createElement)(m.Fill,{name:`BlockStylesPreviewPanel/${n}`},(0,a.createElement)("div",o,t))}const dk=()=>{};function pk(e){let{clientId:t,onSwitch:n=dk,onHoverClassName:o=dk,scope:r}=e;const{onSelect:l,stylesToRender:i,activeStyle:s,genericPreviewBlock:p,className:f}=Lf({clientId:t,onSwitch:n}),[g,h]=(0,a.useState)(null),[v,b]=(0,a.useState)(0),_=(0,d.useViewportMatch)("medium","<");if((0,a.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 k=(0,u.debounce)(h,250),y=e=>{var t;g!==e?(k(e),o(null!==(t=null==e?void 0:e.name)&&void 0!==t?t:null)):k.cancel()};return(0,a.createElement)("div",{className:"block-editor-block-styles"},(0,a.createElement)("div",{className:"block-editor-block-styles__variants"},i.map((e=>{const t=e.label||e.name;return(0,a.createElement)(m.Button,{className:c()("block-editor-block-styles__item",{"is-active":s.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),k.cancel()})(e),"aria-current":s.name===e.name},(0,a.createElement)(m.__experimentalTruncate,{numberOfLines:1,className:"block-editor-block-styles__item-text"},t))}))),g&&!_&&(0,a.createElement)(uk,{scope:r,className:"block-editor-block-styles__preview-panel",style:{top:v},onMouseLeave:()=>y(null)},(0,a.createElement)(ck,{activeStyle:s,className:f,genericPreviewBlock:p,style:g})))}pk.Slot=function(e){let{scope:t}=e;return(0,a.createElement)(m.Slot,{name:`BlockStylesPreviewPanel/${t}`})};var mk=pk;var fk=(0,a.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(D.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"}));var gk=function(e){let{icon:t=fk,label:n=(0,g.__)("Choose variation"),instructions:o=(0,g.__)("Select a variation to start with."),variations:r,onSelect:l,allowSkip:i}=e;const s=c()("block-editor-block-variation-picker",{"has-many-variations":r.length>4});return(0,a.createElement)(m.Placeholder,{icon:t,label:n,instructions:o,className:s},(0,a.createElement)("ul",{className:"block-editor-block-variation-picker__variations",role:"list","aria-label":(0,g.__)("Block variations")},r.map((e=>(0,a.createElement)("li",{key:e.name},(0,a.createElement)(m.Button,{variant:"secondary",icon:e.icon,iconSize:48,onClick:()=>l(e),className:"block-editor-block-variation-picker__variation",label:e.description||e.title}),(0,a.createElement)("span",{className:"block-editor-block-variation-picker__variation-label",role:"presentation"},e.title))))),i&&(0,a.createElement)("div",{className:"block-editor-block-variation-picker__skip"},(0,a.createElement)(m.Button,{variant:"link",onClick:()=>l()},(0,g.__)("Skip"))))};var hk=(0,a.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(D.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 vk="carousel",bk="grid",_k=e=>{let{onBlockPatternSelect:t}=e;return(0,a.createElement)("div",{className:"block-editor-block-pattern-setup__actions"},(0,a.createElement)(m.Button,{variant:"primary",onClick:t},(0,g.__)("Choose")))},kk=e=>{let{handlePrevious:t,handleNext:n,activeSlide:o,totalSlides:r}=e;return(0,a.createElement)("div",{className:"block-editor-block-pattern-setup__navigation"},(0,a.createElement)(m.Button,{icon:ef,label:(0,g.__)("Previous pattern"),onClick:t,disabled:0===o}),(0,a.createElement)(m.Button,{icon:Jm,label:(0,g.__)("Next pattern"),onClick:n,disabled:o===r-1}))};var yk=e=>{let{viewMode:t,setViewMode:n,handlePrevious:o,handleNext:r,activeSlide:l,totalSlides:i,onBlockPatternSelect:s}=e;const c=t===vk,u=(0,a.createElement)("div",{className:"block-editor-block-pattern-setup__display-controls"},(0,a.createElement)(m.Button,{icon:xl,label:(0,g.__)("Carousel view"),onClick:()=>n(vk),isPressed:c}),(0,a.createElement)(m.Button,{icon:hk,label:(0,g.__)("Grid view"),onClick:()=>n(bk),isPressed:t===bk}));return(0,a.createElement)("div",{className:"block-editor-block-pattern-setup__toolbar"},c&&(0,a.createElement)(kk,{handlePrevious:o,handleNext:r,activeSlide:l,totalSlides:i}),u,c&&(0,a.createElement)(_k,{onBlockPatternSelect:s}))};var Ek=function(e,t,n){return(0,p.useSelect)((o=>{const{getBlockRootClientId:r,__experimentalGetPatternsByBlockTypes:l,__experimentalGetAllowedPatterns:i}=o(so),a=r(e);return n?i(a).filter(n):l(t,a)}),[e,t,n])};const Ck=e=>{let{viewMode:t,activeSlide:n,patterns:o,onBlockPatternSelect:r}=e;const l=(0,m.__unstableUseCompositeState)(),s="block-editor-block-pattern-setup__container";if(t===vk){const e=new Map([[n,"active-slide"],[n-1,"previous-slide"],[n+1,"next-slide"]]);return(0,a.createElement)("div",{className:"block-editor-block-pattern-setup__carousel"},(0,a.createElement)("div",{className:s},(0,a.createElement)("ul",{className:"carousel-container"},o.map(((t,n)=>(0,a.createElement)(Sk,{className:e.get(n)||"",key:t.name,pattern:t}))))))}return(0,a.createElement)("div",{className:"block-editor-block-pattern-setup__grid"},(0,a.createElement)(m.__unstableComposite,i({},l,{role:"listbox",className:s,"aria-label":(0,g.__)("Patterns list")}),o.map((e=>(0,a.createElement)(wk,{key:e.name,pattern:e,onSelect:r,composite:l})))))};function wk(e){let{pattern:t,onSelect:n,composite:o}=e;const r="block-editor-block-pattern-setup-list",{blocks:l,description:s,viewportWidth:c=700}=t,u=(0,d.useInstanceId)(wk,`${r}__item-description`);return(0,a.createElement)("div",{className:`${r}__list-item`,"aria-label":t.title,"aria-describedby":t.description?u:void 0},(0,a.createElement)(m.__unstableCompositeItem,i({role:"option",as:"div"},o,{className:`${r}__item`,onClick:()=>n(l)}),(0,a.createElement)(_p,{blocks:l,viewportWidth:c})),!!s&&(0,a.createElement)(m.VisuallyHidden,{id:u},s))}function Sk(e){let{className:t,pattern:n,minHeight:o}=e;const{blocks:r,title:l,description:i}=n,s=(0,d.useInstanceId)(Sk,"block-editor-block-pattern-setup-list__item-description");return(0,a.createElement)("li",{className:`pattern-slide ${t}`,"aria-label":l,"aria-describedby":i?s:void 0},(0,a.createElement)(_p,{blocks:r,__experimentalMinHeight:o}),!!i&&(0,a.createElement)(m.VisuallyHidden,{id:s},i))}var Bk=e=>{let{clientId:t,blockName:n,filterPatternsFn:o,onBlockPatternSelect:l}=e;const[i,s]=(0,a.useState)(vk),[c,u]=(0,a.useState)(0),{replaceBlock:d}=(0,p.useDispatch)(so),m=Ek(t,n,o);if(null==m||!m.length)return null;const f=l||(e=>{const n=e.map((e=>(0,r.cloneBlock)(e)));d(t,n)});return(0,a.createElement)(a.Fragment,null,(0,a.createElement)("div",{className:`block-editor-block-pattern-setup view-mode-${i}`},(0,a.createElement)(Ck,{viewMode:i,activeSlide:c,patterns:m,onBlockPatternSelect:f}),(0,a.createElement)(yk,{viewMode:i,setViewMode:s,activeSlide:c,totalSlides:m.length,handleNext:()=>{u((e=>e+1))},handlePrevious:()=>{u((e=>e-1))},onBlockPatternSelect:()=>{f(m[c].blocks)}})))};function Ik(e){let{className:t,onSelectVariation:n,selectedValue:o,variations:r}=e;return(0,a.createElement)("fieldset",{className:t},(0,a.createElement)(m.VisuallyHidden,{as:"legend"},(0,g.__)("Transform to variation")),r.map((e=>(0,a.createElement)(m.Button,{key:e.name,icon:(0,a.createElement)(Du,{icon:e.icon,showColors:!0}),isPressed:o===e.name,label:o===e.name?e.title:(0,g.sprintf)((0,g.__)("Transform to %s"),e.title),onClick:()=>n(e.name),"aria-label":e.title,showTooltip:!0}))))}function xk(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,a.createElement)(m.DropdownMenu,{className:t,label:(0,g.__)("Transform to variation"),text:(0,g.__)("Transform to variation"),popoverProps:{position:"bottom center",className:`${t}__popover`},icon:nf,toggleProps:{iconPosition:"right"}},(()=>(0,a.createElement)("div",{className:`${t}__container`},(0,a.createElement)(m.MenuGroup,null,(0,a.createElement)(m.MenuItemsChoice,{choices:l,value:o,onSelect:n})))))}var Tk=function(e){let{blockClientId:t}=e;const{updateBlockAttributes:n}=(0,p.useDispatch)(so),{activeBlockVariation:o,variations:l}=(0,p.useSelect)((e=>{const{getActiveBlockVariation:n,getBlockVariations:o}=e(r.store),{getBlockName:l,getBlockAttributes:i}=e(so),a=t&&l(t);return{activeBlockVariation:n(a,i(t)),variations:a&&o(a,"transform")}}),[t]),i=null==o?void 0:o.name,s=(0,a.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=s?Ik:xk;return(0,a.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})},Nk=(0,d.createHigherOrderComponent)((e=>t=>{const n=qo("color.palette"),o=!qo("color.custom"),r=void 0===t.colors?n:t.colors,l=void 0===t.disableCustomColors?o:t.disableCustomColors,s=!(0,u.isEmpty)(r)||!l;return(0,a.createElement)(e,i({},t,{colors:r,disableCustomColors:l,hasColorsToChoose:s}))}),"withColorContext"),Pk=Nk(m.ColorPalette);function Mk(e){let{onChange:t,value:n,...o}=e;return(0,a.createElement)(Xh,i({},o,{onColorChange:t,colorValue:n,gradients:[],disableCustomGradients:!0}))}var Lk=window.wp.date;const Rk=new Date(2022,0,25);function Ak(e){let{format:t,defaultFormat:n,onChange:o}=e;return(0,a.createElement)("fieldset",{className:"block-editor-date-format-picker"},(0,a.createElement)(m.VisuallyHidden,{as:"legend"},(0,g.__)("Date format")),(0,a.createElement)(m.ToggleControl,{label:(0,a.createElement)(a.Fragment,null,(0,g.__)("Default format"),(0,a.createElement)("span",{className:"block-editor-date-format-picker__default-format-toggle-control__hint"},(0,Lk.dateI18n)(n,Rk))),checked:!t,onChange:e=>o(e?null:n)}),t&&(0,a.createElement)(Dk,{format:t,onChange:o}))}function Dk(e){var t;let{format:n,onChange:o}=e;const r=[...new Set(["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"),(0,g._x)("M j","short date format without the year")])],l=r.map(((e,t)=>({key:`suggested-${t}`,name:(0,Lk.dateI18n)(e,Rk),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")},[s,c]=(0,a.useState)((()=>!!n&&!r.includes(n)));return(0,a.createElement)(a.Fragment,null,(0,a.createElement)(m.BaseControl,{className:"block-editor-date-format-picker__custom-format-select-control"},(0,a.createElement)(m.CustomSelectControl,{__nextUnconstrainedWidth:!0,label:(0,g.__)("Choose a format"),options:[...l,i],value:s?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))}})),s&&(0,a.createElement)(m.TextControl,{label:(0,g.__)("Custom format"),hideLabelFromVision:!0,help:(0,a.createInterpolateElement)((0,g.__)("Enter a date or time <Link>format string</Link>."),{Link:(0,a.createElement)(m.ExternalLink,{href:(0,g.__)("https://wordpress.org/support/article/formatting-date-and-time/")})}),value:n,onChange:e=>o(e)}))}const Ok=["colors","disableCustomColors","gradients","disableCustomGradients"],zk=e=>{let{className:t,colors:n,gradients:o,disableCustomColors:r,disableCustomGradients:l,children:i,settings:s,title:f,showTitle:g=!0,__experimentalHasMultipleOrigins:h,__experimentalIsRenderedInSidebar:v,enableAlpha:b}=e;const _=(0,d.useInstanceId)(zk),{batch:k}=(0,p.useRegistry)();return(0,u.isEmpty)(n)&&(0,u.isEmpty)(o)&&r&&l&&(0,u.every)(s,(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,a.createElement)(m.__experimentalToolsPanel,{className:c()("block-editor-panel-color-gradient-settings",t),label:g?f:void 0,resetAll:()=>{k((()=>{s.forEach((e=>{let{colorValue:t,gradientValue:n,onColorChange:o,onGradientChange:r}=e;t?o():n&&r()}))}))},panelId:_,__experimentalFirstVisibleItemClass:"first",__experimentalLastVisibleItemClass:"last"},(0,a.createElement)(nv,{settings:s,panelId:_,colors:n,gradients:o,disableCustomColors:r,disableCustomGradients:l,__experimentalHasMultipleOrigins:h,__experimentalIsRenderedInSidebar:v,enableAlpha:b}),!!i&&(0,a.createElement)(a.Fragment,null,(0,a.createElement)(m.__experimentalSpacer,{marginY:4})," ",i))},Fk=e=>{const t=Ih();return t.colors=qo("color.palette"),t.gradients=qo("color.gradients"),(0,a.createElement)(zk,i({},t,e))},Vk=e=>{const t=xh();return(0,a.createElement)(zk,i({},t,e))};var Hk=e=>(0,u.every)(Ok,(t=>e.hasOwnProperty(t)))?(0,a.createElement)(zk,e):e.__experimentalHasMultipleOrigins?(0,a.createElement)(Vk,e):(0,a.createElement)(Fk,e),Gk=function(e,t){return Gk=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},Gk(e,t)};var Uk=function(){return Uk=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},Uk.apply(this,arguments)};Object.create;Object.create;var Wk=n(7970),jk=n.n(Wk);function $k(e,t,n,o,r,l){void 0===l&&(l=0);var i=oy(e,t,l),a=i.width,s=i.height,c=Math.min(a,n),u=Math.min(s,o);return c>u*r?{width:u*r,height:u}:{width:c,height:c/r}}function Kk(e,t,n,o,r){void 0===r&&(r=0);var l=oy(t.width,t.height,r),i=l.width,a=l.height;return{x:qk(e.x,i,n.width,o),y:qk(e.y,a,n.height,o)}}function qk(e,t,n,o){var r=t*o/2-n/2;return ry(e,-r,r)}function Yk(e,t){return Math.sqrt(Math.pow(e.y-t.y,2)+Math.pow(e.x-t.x,2))}function Zk(e,t){return 180*Math.atan2(t.y-e.y,t.x-e.x)/Math.PI}function Qk(e,t,n,o,r,l,i){void 0===l&&(l=0),void 0===i&&(i=!0);var a=i?Xk:Jk,s=oy(t.width,t.height,l),c=oy(t.naturalWidth,t.naturalHeight,l),u={x:a(100,((s.width-n.width/r)/2-e.x/r)/s.width*100),y:a(100,((s.height-n.height/r)/2-e.y/r)/s.height*100),width:a(100,n.width/s.width*100/r),height:a(100,n.height/s.height*100/r)},d=Math.round(a(c.width,u.width*c.width/100)),p=Math.round(a(c.height,u.height*c.height/100)),m=c.width>=c.height*o?{width:Math.round(p*o),height:p}:{width:d,height:Math.round(d/o)};return{croppedAreaPercentages:u,croppedAreaPixels:Uk(Uk({},m),{x:Math.round(a(c.width-m.width,u.x*c.width/100)),y:Math.round(a(c.height-m.height,u.y*c.height/100))})}}function Xk(e,t){return Math.min(e,Math.max(0,t))}function Jk(e,t){return t}function ey(e,t,n,o,r,l){var i=oy(t.width,t.height,n),a=ry(o.width/i.width*(100/e.width),r,l);return{crop:{x:a*i.width/2-o.width/2-i.width*a*(e.x/100),y:a*i.height/2-o.height/2-i.height*a*(e.y/100)},zoom:a}}function ty(e,t,n,o,r,l){void 0===n&&(n=0);var i=oy(t.naturalWidth,t.naturalHeight,n),a=ry(function(e,t,n){var o=function(e){return e.width>e.height?e.width/e.naturalWidth:e.height/e.naturalHeight}(t);return n.height>n.width?n.height/(e.height*o):n.width/(e.width*o)}(e,t,o),r,l),s=o.height>o.width?o.height/e.height:o.width/e.width;return{crop:{x:((i.width-e.width)/2-e.x)*s,y:((i.height-e.height)/2-e.y)*s},zoom:a}}function ny(e,t){return{x:(t.x+e.x)/2,y:(t.y+e.y)/2}}function oy(e,t,n){var o=n*Math.PI/180;return{width:Math.abs(Math.cos(o)*e)+Math.abs(Math.sin(o)*t),height:Math.abs(Math.sin(o)*e)+Math.abs(Math.cos(o)*t)}}function ry(e,t,n){return Math.min(Math.max(e,t),n)}function ly(){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 iy=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.imageRef=Ti().createRef(),n.videoRef=Ti().createRef(),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.currentDoc=document,n.currentWindow=window,n.state={cropSize:null,hasWheelJustStarted:!1},n.preventZoomSafari=function(e){return e.preventDefault()},n.cleanEvents=function(){n.currentDoc.removeEventListener("mousemove",n.onMouseMove),n.currentDoc.removeEventListener("mouseup",n.onDragStopped),n.currentDoc.removeEventListener("touchmove",n.onTouchMove),n.currentDoc.removeEventListener("touchend",n.onDragStopped)},n.clearScrollEvent=function(){n.containerRef&&n.containerRef.removeEventListener("wheel",n.onWheel),n.wheelTimer&&clearTimeout(n.wheelTimer)},n.onMediaLoad=function(){var e=n.computeSizes();e&&(n.emitCropData(),n.setInitialCrop(e)),n.props.onMediaLoaded&&n.props.onMediaLoaded(n.mediaSize)},n.setInitialCrop=function(e){if(n.props.initialCroppedAreaPercentages){var t=ey(n.props.initialCroppedAreaPercentages,n.mediaSize,n.props.rotation,e,n.props.minZoom,n.props.maxZoom),o=t.crop,r=t.zoom;n.props.onCropChange(o),n.props.onZoomChange&&n.props.onZoomChange(r)}else if(n.props.initialCroppedAreaPixels){var l=ty(n.props.initialCroppedAreaPixels,n.mediaSize,n.props.rotation,e,n.props.minZoom,n.props.maxZoom);o=l.crop,r=l.zoom;n.props.onCropChange(o),n.props.onZoomChange&&n.props.onZoomChange(r)}},n.computeSizes=function(){var e,t,o,r,l,i,a=n.imageRef.current||n.videoRef.current;if(a&&n.containerRef){n.containerRect=n.containerRef.getBoundingClientRect();var s=n.containerRect.width/n.containerRect.height,c=(null===(e=n.imageRef.current)||void 0===e?void 0:e.naturalWidth)||(null===(t=n.videoRef.current)||void 0===t?void 0:t.videoWidth)||0,u=(null===(o=n.imageRef.current)||void 0===o?void 0:o.naturalHeight)||(null===(r=n.videoRef.current)||void 0===r?void 0:r.videoHeight)||0,d=c/u,p=void 0;if(a.offsetWidth<c||a.offsetHeight<u)switch(n.props.objectFit){default:case"contain":p=s>d?{width:n.containerRect.height*d,height:n.containerRect.height}:{width:n.containerRect.width,height:n.containerRect.width/d};break;case"horizontal-cover":p={width:n.containerRect.width,height:n.containerRect.width/d};break;case"vertical-cover":p={width:n.containerRect.height*d,height:n.containerRect.height};break;case"auto-cover":p=c>u?{width:n.containerRect.width,height:n.containerRect.width/d}:{width:n.containerRect.height*d,height:n.containerRect.height}}else p={width:a.offsetWidth,height:a.offsetHeight};n.mediaSize=Uk(Uk({},p),{naturalWidth:c,naturalHeight:u}),n.props.setMediaSize&&n.props.setMediaSize(n.mediaSize);var m=n.props.cropSize?n.props.cropSize:$k(n.mediaSize.width,n.mediaSize.height,n.containerRect.width,n.containerRect.height,n.props.aspect,n.props.rotation);return(null===(l=n.state.cropSize)||void 0===l?void 0:l.height)===m.height&&(null===(i=n.state.cropSize)||void 0===i?void 0:i.width)===m.width||n.props.onCropSizeChange&&n.props.onCropSizeChange(m),n.setState({cropSize:m},n.recomputeCropPosition),n.props.setCropSize&&n.props.setCropSize(m),m}},n.onMouseDown=function(e){e.preventDefault(),n.currentDoc.addEventListener("mousemove",n.onMouseMove),n.currentDoc.addEventListener("mouseup",n.onDragStopped),n.onDragStart(t.getMousePoint(e))},n.onMouseMove=function(e){return n.onDrag(t.getMousePoint(e))},n.onTouchStart=function(e){n.props.onTouchRequest&&!n.props.onTouchRequest(e)||(n.currentDoc.addEventListener("touchmove",n.onTouchMove,{passive:!1}),n.currentDoc.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=Uk({},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&&n.currentWindow.cancelAnimationFrame(n.rafDragTimeout),n.rafDragTimeout=n.currentWindow.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?Kk(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){if(!n.props.onWheelRequest||n.props.onWheelRequest(e)){e.preventDefault();var o=t.getMousePoint(e),r=jk()(e).pixelY,l=n.props.zoom-r*n.props.zoomSpeed/200;n.setNewZoom(l,o,{shouldUpdatePosition:!0}),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=n.currentWindow.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,o){var r=(void 0===o?{}:o).shouldUpdatePosition,l=void 0===r||r;if(n.state.cropSize&&n.props.onZoomChange){var i=n.getPointOnContainer(t),a=n.getPointOnMedia(i),s=ry(e,n.props.minZoom,n.props.maxZoom),c={x:a.x*s-i.x,y:a.y*s-i.y};if(l){var u=n.props.restrictPosition?Kk(c,n.mediaSize,n.state.cropSize,s,n.props.rotation):c;n.props.onCropChange(u)}n.props.onZoomChange(s)}},n.getCropData=function(){return n.state.cropSize?Qk(n.props.restrictPosition?Kk(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):null},n.emitCropData=function(){var e=n.getCropData();if(e){var t=e.croppedAreaPercentages,o=e.croppedAreaPixels;n.props.onCropComplete&&n.props.onCropComplete(t,o),n.props.onCropAreaChange&&n.props.onCropAreaChange(t,o)}},n.emitCropAreaChange=function(){var e=n.getCropData();if(e){var t=e.croppedAreaPercentages,o=e.croppedAreaPixels;n.props.onCropAreaChange&&n.props.onCropAreaChange(t,o)}},n.recomputeCropPosition=function(){if(n.state.cropSize){var e=n.props.restrictPosition?Kk(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 n(){this.constructor=e}Gk(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}(t,e),t.prototype.componentDidMount=function(){this.containerRef&&(this.containerRef.ownerDocument&&(this.currentDoc=this.containerRef.ownerDocument),this.currentDoc.defaultView&&(this.currentWindow=this.currentDoc.defaultView),this.currentWindow.addEventListener("resize",this.computeSizes),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=this.currentDoc.createElement("style"),this.styleRef.setAttribute("type","text/css"),this.props.nonce&&this.styleRef.setAttribute("nonce",this.props.nonce),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 display: flex;\n justify-content: center;\n align-items: center;\n}\n\n.reactEasyCrop_Image,\n.reactEasyCrop_Video {\n will-change: transform; /* this improves performances and prevent painting issues on iOS Chrome */\n}\n\n.reactEasyCrop_Contain {\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}\n.reactEasyCrop_Cover_Horizontal {\n width: 100%;\n height: auto;\n}\n.reactEasyCrop_Cover_Vertical {\n width: auto;\n height: 100%;\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",this.currentDoc.head.appendChild(this.styleRef)),this.imageRef.current&&this.imageRef.current.complete&&this.onMediaLoad(),this.props.setImageRef&&this.props.setImageRef(this.imageRef),this.props.setVideoRef&&this.props.setVideoRef(this.videoRef)},t.prototype.componentWillUnmount=function(){var e;this.currentWindow.removeEventListener("resize",this.computeSizes),this.containerRef&&(this.containerRef.removeEventListener("gesturestart",this.preventZoomSafari),this.containerRef.removeEventListener("gesturechange",this.preventZoomSafari)),this.styleRef&&(null===(e=this.styleRef.parentNode)||void 0===e||e.removeChild(this.styleRef)),this.cleanEvents(),this.props.zoomWithScroll&&this.clearScrollEvent()},t.prototype.componentDidUpdate=function(e){var t,n,o,r,l,i,a,s,c;e.rotation!==this.props.rotation?(this.computeSizes(),this.recomputeCropPosition()):e.aspect!==this.props.aspect?this.computeSizes():e.zoom!==this.props.zoom?this.recomputeCropPosition():(null===(t=e.cropSize)||void 0===t?void 0:t.height)!==(null===(n=this.props.cropSize)||void 0===n?void 0:n.height)||(null===(o=e.cropSize)||void 0===o?void 0:o.width)!==(null===(r=this.props.cropSize)||void 0===r?void 0:r.width)?this.computeSizes():(null===(l=e.crop)||void 0===l?void 0:l.x)===(null===(i=this.props.crop)||void 0===i?void 0:i.x)&&(null===(a=e.crop)||void 0===a?void 0:a.y)===(null===(s=this.props.crop)||void 0===s?void 0:s.y)||this.emitCropAreaChange(),e.zoomWithScroll!==this.props.zoomWithScroll&&this.containerRef&&(this.props.zoomWithScroll?this.containerRef.addEventListener("wheel",this.onWheel,{passive:!1}):this.clearScrollEvent()),e.video!==this.props.video&&(null===(c=this.videoRef.current)||void 0===c||c.load())},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=Yk(n,o),this.lastPinchRotation=Zk(n,o),this.onDragStart(ny(n,o))},t.prototype.onPinchMove=function(e){var n=this,o=t.getTouchPoint(e.touches[0]),r=t.getTouchPoint(e.touches[1]),l=ny(o,r);this.onDrag(l),this.rafPinchTimeout&&this.currentWindow.cancelAnimationFrame(this.rafPinchTimeout),this.rafPinchTimeout=this.currentWindow.requestAnimationFrame((function(){var e=Yk(o,r),t=n.props.zoom*(e/n.lastPinchDistance);n.setNewZoom(t,l,{shouldUpdatePosition:!1}),n.lastPinchDistance=e;var i=Zk(o,r),a=n.props.rotation+(i-n.lastPinchRotation);n.props.onRotationChange&&n.props.onRotationChange(a),n.lastPinchRotation=i}))},t.prototype.render=function(){var e=this,t=this.props,n=t.image,o=t.video,r=t.mediaProps,l=t.transform,i=t.crop,a=i.x,s=i.y,c=t.rotation,u=t.zoom,d=t.cropShape,p=t.showGrid,m=t.style,f=m.containerStyle,g=m.cropAreaStyle,h=m.mediaStyle,v=t.classes,b=v.containerClassName,_=v.cropAreaClassName,k=v.mediaClassName,y=t.objectFit;return Ti().createElement("div",{onMouseDown:this.onMouseDown,onTouchStart:this.onTouchStart,ref:function(t){return e.containerRef=t},"data-testid":"container",style:f,className:ly("reactEasyCrop_Container",b)},n?Ti().createElement("img",Uk({alt:"",className:ly("reactEasyCrop_Image","contain"===y&&"reactEasyCrop_Contain","horizontal-cover"===y&&"reactEasyCrop_Cover_Horizontal","vertical-cover"===y&&"reactEasyCrop_Cover_Vertical","auto-cover"===y&&(this.mediaSize.naturalWidth>this.mediaSize.naturalHeight?"reactEasyCrop_Cover_Horizontal":"reactEasyCrop_Cover_Vertical"),k)},r,{src:n,ref:this.imageRef,style:Uk(Uk({},h),{transform:l||"translate("+a+"px, "+s+"px) rotate("+c+"deg) scale("+u+")"}),onLoad:this.onMediaLoad})):o&&Ti().createElement("video",Uk({autoPlay:!0,loop:!0,muted:!0,className:ly("reactEasyCrop_Video","contain"===y&&"reactEasyCrop_Contain","horizontal-cover"===y&&"reactEasyCrop_Cover_Horizontal","vertical-cover"===y&&"reactEasyCrop_Cover_Vertical","auto-cover"===y&&(this.mediaSize.naturalWidth>this.mediaSize.naturalHeight?"reactEasyCrop_Cover_Horizontal":"reactEasyCrop_Cover_Vertical"),k)},r,{ref:this.videoRef,onLoadedMetadata:this.onMediaLoad,style:Uk(Uk({},h),{transform:l||"translate("+a+"px, "+s+"px) rotate("+c+"deg) scale("+u+")"}),controls:!1}),(Array.isArray(o)?o:[{src:o}]).map((function(e){return Ti().createElement("source",Uk({key:e.src},e))}))),this.state.cropSize&&Ti().createElement("div",{style:Uk(Uk({},g),{width:this.state.cropSize.width,height:this.state.cropSize.height}),"data-testid":"cropper",className:ly("reactEasyCrop_CropArea","round"===d&&"reactEasyCrop_CropAreaRound",p&&"reactEasyCrop_CropAreaGrid",_)}))},t.defaultProps={zoom:1,rotation:0,aspect:4/3,maxZoom:3,minZoom:1,cropShape:"rect",objectFit:"contain",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}(Ti().Component),ay=iy;const sy={position:"bottom right",isAlternate:!0};function cy(e,t){const n=function(e){let{url:t,naturalWidth:n,naturalHeight:o}=e;const[r,i]=(0,a.useState)(),[s,c]=(0,a.useState)(),[u,d]=(0,a.useState)({x:0,y:0}),[p,m]=(0,a.useState)(),[f,g]=(0,a.useState)(),[h,v]=(0,a.useState)(),[b,_]=(0,a.useState)(),k=(0,a.useCallback)((()=>{d({x:0,y:0}),m(100),g(0),v(n/o),_(n/o)}),[n,o,d,m,g,v,_]),y=(0,a.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 a=new window.Image;a.src=t,a.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 a=n.getContext("2d");a.translate(o,l),a.rotate(e*Math.PI/180),a.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 s=(0,l.applyFilters)("media.crossOrigin",void 0,t);"string"==typeof s&&(a.crossOrigin=s)}),[f,n,o,i,g,v,d]);return(0,a.useMemo)((()=>({editedUrl:r,setEditedUrl:i,crop:s,setCrop:c,position:u,setPosition:d,zoom:p,setZoom:m,rotation:f,setRotation:g,rotateClockwise:y,aspect:h,setAspect:v,defaultAspect:b,initializeTransformValues:k})),[r,i,s,c,u,d,p,m,f,g,y,h,v,b,k])}(e),{initializeTransformValues:o}=n;return(0,a.useEffect)((()=>{t&&o()}),[t,o]),n}const uy=(0,a.createContext)({}),dy=()=>(0,a.useContext)(uy);function py(e){let{id:t,url:n,naturalWidth:o,naturalHeight:r,isEditing:l,onFinishEditing:i,onSaveImage:s,children:c}=e;const u=cy({url:n,naturalWidth:o,naturalHeight:r},l),d=function(e){let{crop:t,rotation:n,height:o,width:r,aspect:l,url:i,id:s,onSaveImage:c,onFinishEditing:u}=e;const{createErrorNotice:d}=(0,p.useDispatch)(Op.store),[m,f]=(0,a.useState)(!1),h=(0,a.useCallback)((()=>{f(!1),u()}),[f,u]),v=(0,a.useCallback)((()=>{f(!0);let e={};(t.width<99.9||t.height<99.9)&&(e=t),n>0&&(e.rotation=n),e.src=i,E_()({path:`/wp/v2/media/${s}/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)((0,g.__)("Could not edit image. %s"),(0,Wl.__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,a.useMemo)((()=>({isInProgress:m,apply:v,cancel:h})),[m,v,h])}({id:t,url:n,onSaveImage:s,onFinishEditing:i,...u}),m=(0,a.useMemo)((()=>({...u,...d})),[u,d]);return(0,a.createElement)(uy.Provider,{value:m},c)}function my(e){let{url:t,width:n,height:o,clientWidth:r,naturalHeight:l,naturalWidth:i,borderProps:s}=e;const{isInProgress:u,editedUrl:d,position:p,zoom:f,aspect:g,setPosition:h,setCrop:v,setZoom:b,rotation:_}=dy();let k=o||r*l/i;return _%180==90&&(k=r*i/l),(0,a.createElement)("div",{className:c()("wp-block-image__crop-area",null==s?void 0:s.className,{"is-applying":u}),style:{...null==s?void 0:s.style,width:n||r,height:k}},(0,a.createElement)(ay,{image:d||t,disabled:u,minZoom:1,maxZoom:3,crop:p,zoom:f/100,aspect:g,onCropChange:h,onCropComplete:e=>{v(e)},onZoomChange:e=>{b(100*e)}}),u&&(0,a.createElement)(m.Spinner,null))}var fy=(0,a.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(D.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 gy(){const{isInProgress:e,zoom:t,setZoom:n}=dy();return(0,a.createElement)(m.Dropdown,{contentClassName:"wp-block-image__zoom",popoverProps:sy,renderToggle:t=>{let{isOpen:n,onToggle:o}=t;return(0,a.createElement)(m.ToolbarButton,{icon:fy,label:(0,g.__)("Zoom"),onClick:o,"aria-expanded":n,disabled:e})},renderContent:()=>(0,a.createElement)(m.RangeControl,{label:(0,g.__)("Zoom"),min:100,max:300,value:Math.round(t),onChange:n})})}var hy=(0,a.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(D.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 vy(e){let{aspectRatios:t,isDisabled:n,label:o,onClick:r,value:l}=e;return(0,a.createElement)(m.MenuGroup,{label:o},t.map((e=>{let{title:t,aspect:o}=e;return(0,a.createElement)(m.MenuItem,{key:o,disabled:n,onClick:()=>{r(o)},role:"menuitemradio",isSelected:o===l,icon:o===l?xf:void 0},t)})))}function by(e){let{toggleProps:t}=e;const{isInProgress:n,aspect:o,setAspect:r,defaultAspect:l}=dy();return(0,a.createElement)(m.DropdownMenu,{icon:hy,label:(0,g.__)("Aspect Ratio"),popoverProps:sy,toggleProps:t,className:"wp-block-image__aspect-ratio"},(e=>{let{onClose:t}=e;return(0,a.createElement)(a.Fragment,null,(0,a.createElement)(vy,{isDisabled:n,onClick:e=>{r(e),t()},value:o,aspectRatios:[{title:(0,g.__)("Original"),aspect:l},{title:(0,g.__)("Square"),aspect:1}]}),(0,a.createElement)(vy,{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,a.createElement)(vy,{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 _y=(0,a.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(D.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 ky(){const{isInProgress:e,rotateClockwise:t}=dy();return(0,a.createElement)(m.ToolbarButton,{icon:_y,label:(0,g.__)("Rotate"),onClick:t,disabled:e})}function yy(){const{isInProgress:e,apply:t,cancel:n}=dy();return(0,a.createElement)(a.Fragment,null,(0,a.createElement)(m.ToolbarButton,{onClick:t,disabled:e},(0,g.__)("Apply")),(0,a.createElement)(m.ToolbarButton,{onClick:n},(0,g.__)("Cancel")))}function Ey(e){let{url:t,width:n,height:o,clientWidth:r,naturalHeight:l,naturalWidth:i,borderProps:s}=e;return(0,a.createElement)(a.Fragment,null,(0,a.createElement)(my,{borderProps:s,url:t,width:n,height:o,clientWidth:r,naturalHeight:l,naturalWidth:i}),(0,a.createElement)(_o,null,(0,a.createElement)(m.ToolbarGroup,null,(0,a.createElement)(gy,null),(0,a.createElement)(m.ToolbarItem,null,(e=>(0,a.createElement)(by,{toggleProps:e}))),(0,a.createElement)(ky,null)),(0,a.createElement)(m.ToolbarGroup,null,(0,a.createElement)(yy,null))))}const Cy=[25,50,75,100],wy=()=>{};function Sy(e){let{imageSizeHelp:t,imageWidth:n,imageHeight:o,imageSizeOptions:r=[],isResizable:l=!0,slug:i,width:s,height:c,onChange:d,onChangeImage:p=wy}=e;const{currentHeight:f,currentWidth:h,updateDimension:v,updateDimensions:b}=function(e,t,n,o,r){var l,i;const[s,c]=(0,a.useState)(null!==(l=null!=t?t:o)&&void 0!==l?l:""),[u,d]=(0,a.useState)(null!==(i=null!=e?e:n)&&void 0!==i?i:"");return(0,a.useEffect)((()=>{void 0===t&&void 0!==o&&c(o),void 0===e&&void 0!==n&&d(n)}),[o,n]),(0,a.useEffect)((()=>{void 0!==t&&Number.parseInt(t)!==Number.parseInt(s)&&c(t),void 0!==e&&Number.parseInt(e)!==Number.parseInt(u)&&d(e)}),[t,e]),{currentHeight:u,currentWidth:s,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})}}}(c,s,o,n,d);return(0,a.createElement)(a.Fragment,null,!(0,u.isEmpty)(r)&&(0,a.createElement)(m.SelectControl,{label:(0,g.__)("Image size"),value:i,options:r,onChange:p,help:t}),l&&(0,a.createElement)("div",{className:"block-editor-image-size-control"},(0,a.createElement)("p",{className:"block-editor-image-size-control__row"},(0,g.__)("Image dimensions")),(0,a.createElement)("div",{className:"block-editor-image-size-control__row"},(0,a.createElement)(m.TextControl,{type:"number",className:"block-editor-image-size-control__width",label:(0,g.__)("Width"),value:h,min:1,onChange:e=>v("width",e)}),(0,a.createElement)(m.TextControl,{type:"number",className:"block-editor-image-size-control__height",label:(0,g.__)("Height"),value:f,min:1,onChange:e=>v("height",e)})),(0,a.createElement)("div",{className:"block-editor-image-size-control__row"},(0,a.createElement)(m.ButtonGroup,{"aria-label":(0,g.__)("Image size presets")},Cy.map((e=>{const t=Math.round(n*(e/100)),r=Math.round(o*(e/100)),l=h===t&&f===r;return(0,a.createElement)(m.Button,{key:e,isSmall:!0,variant:l?"primary":void 0,isPressed:l,onClick:()=>b(r,t)},e,"%")}))),(0,a.createElement)(m.Button,{isSmall:!0,onClick:()=>b()},(0,g.__)("Reset")))))}var By=(0,a.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -2 24 24"},(0,a.createElement)(D.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"}));const Iy=()=>{};var xy=e=>{let{value:t,onChange:n=Iy,settings:o}=e;if(!o||!o.length)return null;const r=e=>o=>{n({...t,[e.id]:o})},l=o.map((e=>(0,a.createElement)(m.ToggleControl,{className:"block-editor-link-control__setting",key:e.id,label:e.title,onChange:r(e),checked:!!t&&!!t[e.id]})));return(0,a.createElement)("fieldset",{className:"block-editor-link-control__settings"},(0,a.createElement)(m.VisuallyHidden,{as:"legend"},(0,g.__)("Currently selected link settings")),l)},Ty=n(5425),Ny=n.n(Ty);function Py(e){return"function"==typeof e}class My extends a.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,a.createRef)(),this.inputRef=(0,a.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,Ny()(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,_m.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)((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 ku.UP:0!==e.target.selectionStart&&(e.preventDefault(),e.target.setSelectionRange(0,0));break;case ku.DOWN:this.props.value.length!==e.target.selectionStart&&(e.preventDefault(),e.target.setSelectionRange(this.props.value.length,this.props.value.length));break;case ku.ENTER:e.preventDefault(),this.props.onSubmit&&this.props.onSubmit(null,e)}return}const l=this.state.suggestions[this.state.selectedSuggestion];switch(e.keyCode){case ku.UP:{e.preventDefault();const t=n?n-1:o.length-1;this.setState({selectedSuggestion:t});break}case ku.DOWN:{e.preventDefault();const t=null===n||n===o.length-1?0:n+1;this.setState({selectedSuggestion:t});break}case ku.TAB:null!==this.state.selectedSuggestion&&(this.selectLink(l),this.props.speak((0,g.__)("Link selected.")));break;case ku.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,a=i;const s=n&&n.length;return l||s||(a=!1),!0===r&&(a=!1),{showSuggestions:a,suggestionsListboxId:`block-editor-url-input-suggestions-${o}`,suggestionOptionIdPrefix:`block-editor-url-input-suggestion-${o}`}}render(){return(0,a.createElement)(a.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:s,showSuggestions:u,selectedSuggestion:d,suggestionsListboxId:p,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-controls":p,"aria-activedescendant":null!==d?`${f}-${d}`:void 0,ref:this.inputRef};return l?l(v,b,s):(0,a.createElement)(m.BaseControl,v,(0,a.createElement)("input",b),s&&(0,a.createElement)(m.Spinner,null))}renderSuggestions(){const{className:e,__experimentalRenderSuggestions:t,value:n="",__experimentalShowInitialSuggestions:o=!1}=this.props,{showSuggestions:r,suggestions:l,selectedSuggestion:s,suggestionsListboxId:u,suggestionOptionIdPrefix:d,loading:p}=this.state,f={id:u,ref:this.autocompleteRef,role:"listbox"},g=(e,t)=>({role:"option",tabIndex:"-1",id:`${d}-${t}`,ref:this.bindSuggestionNode(t),"aria-selected":t===s});return Py(t)&&r&&l.length?t({suggestions:l,selectedSuggestion:s,suggestionsListProps:f,buildSuggestionItemProps:g,isLoading:p,handleSuggestionClick:this.handleOnClick,isInitialSuggestions:o&&!(n&&n.length)}):!Py(t)&&r&&l.length?(0,a.createElement)(m.Popover,{position:"bottom",focusOnMount:!1},(0,a.createElement)("div",i({},f,{className:c()("block-editor-url-input__suggestions",`${e}__suggestions`)}),l.map(((e,t)=>(0,a.createElement)(m.Button,i({},g(0,t),{key:e.id,className:c()("block-editor-url-input__suggestion",{"is-selected":t===s}),onClick:()=>this.handleOnClick(e)}),e.title))))):null}}var Ly=(0,d.compose)(d.withSafeTimeout,m.withSpokenMessages,d.withInstanceId,(0,p.withSelect)(((e,t)=>{if(Py(t.__experimentalFetchLinkSuggestions))return;const{getSettings:n}=e(so);return{__experimentalFetchLinkSuggestions:n().__experimentalFetchLinkSuggestions}})))(My);var Ry=e=>{let t,{searchTerm:n,onClick:o,itemProps:r,isSelected:l,buttonText:s}=e;return n?(t=s?"function"==typeof s?s(n):s:(0,a.createInterpolateElement)((0,g.sprintf)((0,g.__)("Create: <mark>%s</mark>"),n),{mark:(0,a.createElement)("mark",null)}),(0,a.createElement)(m.Button,i({},r,{className:c()("block-editor-link-control__search-create block-editor-link-control__search-item",{"is-selected":l}),onClick:o}),(0,a.createElement)(ul,{className:"block-editor-link-control__search-item-icon",icon:Mu}),(0,a.createElement)("span",{className:"block-editor-link-control__search-item-header"},(0,a.createElement)("span",{className:"block-editor-link-control__search-item-title"},t)))):null};var Ay=(0,a.createElement)(D.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,a.createElement)(D.Path,{d:"M18 4H6c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm.5 14c0 .3-.2.5-.5.5H6c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h12c.3 0 .5.2.5.5v12zM7 11h2V9H7v2zm0 4h2v-2H7v2zm3-4h7V9h-7v2zm0 4h7v-2h-7v2z"}));var Dy=(0,a.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(D.Path,{d:"M20.1 11.2l-6.7-6.7c-.1-.1-.3-.2-.5-.2H5c-.4-.1-.8.3-.8.7v7.8c0 .2.1.4.2.5l6.7 6.7c.2.2.5.4.7.5s.6.2.9.2c.3 0 .6-.1.9-.2.3-.1.5-.3.8-.5l5.6-5.6c.4-.4.7-1 .7-1.6.1-.6-.2-1.2-.6-1.6zM19 13.4L13.4 19c-.1.1-.2.1-.3.2-.2.1-.4.1-.6 0-.1 0-.2-.1-.3-.2l-6.5-6.5V5.8h6.8l6.5 6.5c.2.2.2.4.2.6 0 .1 0 .3-.2.5zM9 8c-.6 0-1 .4-1 1s.4 1 1 1 1-.4 1-1-.4-1-1-1z"}));var Oy=(0,a.createElement)(D.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,a.createElement)(D.Path,{d:"M6 5.5h3a.5.5 0 01.5.5v3a.5.5 0 01-.5.5H6a.5.5 0 01-.5-.5V6a.5.5 0 01.5-.5zM4 6a2 2 0 012-2h3a2 2 0 012 2v3a2 2 0 01-2 2H6a2 2 0 01-2-2V6zm11-.5h3a.5.5 0 01.5.5v3a.5.5 0 01-.5.5h-3a.5.5 0 01-.5-.5V6a.5.5 0 01.5-.5zM13 6a2 2 0 012-2h3a2 2 0 012 2v3a2 2 0 01-2 2h-3a2 2 0 01-2-2V6zm5 8.5h-3a.5.5 0 00-.5.5v3a.5.5 0 00.5.5h3a.5.5 0 00.5-.5v-3a.5.5 0 00-.5-.5zM15 13a2 2 0 00-2 2v3a2 2 0 002 2h3a2 2 0 002-2v-3a2 2 0 00-2-2h-3zm-9 1.5h3a.5.5 0 01.5.5v3a.5.5 0 01-.5.5H6a.5.5 0 01-.5-.5v-3a.5.5 0 01.5-.5zM4 15a2 2 0 012-2h3a2 2 0 012 2v3a2 2 0 01-2 2H6a2 2 0 01-2-2v-3z",fillRule:"evenodd",clipRule:"evenodd"}));var zy=(0,a.createElement)(D.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,a.createElement)(D.Path,{d:"M19 6.2h-5.9l-.6-1.1c-.3-.7-1-1.1-1.8-1.1H5c-1.1 0-2 .9-2 2v11.8c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V8.2c0-1.1-.9-2-2-2zm.5 11.6c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h5.8c.2 0 .4.1.4.3l1 2H19c.3 0 .5.2.5.5v9.5z"}));var Fy=(0,a.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(D.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"}));const Vy={post:Ay,page:C_,post_tag:Dy,category:Oy,attachment:zy};function Hy(e){let{isURL:t,suggestion:n}=e,o=null;return t?o=Fy:n.type in Vy&&(o=Vy[n.type]),o?(0,a.createElement)(ul,{className:"block-editor-link-control__search-item-icon",icon:o}):null}var Gy=e=>{let{itemProps:t,suggestion:n,isSelected:o=!1,onClick:r,isURL:l=!1,searchTerm:s="",shouldShowType:u=!1}=e;return(0,a.createElement)(m.Button,i({},t,{onClick:r,className:c()("block-editor-link-control__search-item",{"is-selected":o,"is-url":l,"is-entity":!l})}),(0,a.createElement)(Hy,{suggestion:n,isURL:l}),(0,a.createElement)("span",{className:"block-editor-link-control__search-item-header"},(0,a.createElement)("span",{className:"block-editor-link-control__search-item-title"},(0,a.createElement)(m.TextHighlight,{text:n.title,highlight:s})),(0,a.createElement)("span",{"aria-hidden":!l,className:"block-editor-link-control__search-item-info"},!l&&((0,_m.filterURLForDisplay)((0,_m.safeDecodeURI)(n.url))||""),l&&(0,g.__)("Press ENTER to add this link"))),u&&n.type&&(0,a.createElement)("span",{className:"block-editor-link-control__search-item-type"},function(e){if(e.isFrontPage)return"front page";return"post_tag"===e.type?"tag":e.type}(n)))};const Uy="__CREATE__",Wy="mailto",jy="internal",$y=["URL",Wy,"tel",jy],Ky=[{id:"opensInNewTab",title:(0,g.__)("Open in new tab")}];function qy(e){let{instanceId:t,withCreateSuggestion:n,currentInputValue:o,handleSuggestionClick:r,suggestionsListProps:l,buildSuggestionItemProps:s,suggestions:u,selectedSuggestion:d,isLoading:p,isInitialSuggestions:f,createSuggestionButtonText:h,suggestionsQuery:v}=e;const b=c()("block-editor-link-control__search-results",{"is-loading":p}),_=1===u.length&&$y.includes(u[0].type),k=n&&!_&&!f,y=!(null!=v&&v.type),E=`block-editor-link-control-search-results-label-${t}`,C=f?(0,g.__)("Recently updated"):(0,g.sprintf)((0,g.__)('Search results for "%s"'),o),w=(0,a.createElement)(f?a.Fragment:m.VisuallyHidden,{},(0,a.createElement)("span",{className:"block-editor-link-control__search-results-label",id:E},C));return(0,a.createElement)("div",{className:"block-editor-link-control__search-results-wrapper"},w,(0,a.createElement)("div",i({},l,{className:b,"aria-labelledby":E}),u.map(((e,t)=>k&&Uy===e.type?(0,a.createElement)(Ry,{searchTerm:o,buttonText:h,onClick:()=>r(e),key:e.type,itemProps:s(e,t),isSelected:t===d}):Uy===e.type?null:(0,a.createElement)(Gy,{key:`${e.id}-${e.type}`,itemProps:s(e,t),suggestion:e,index:t,onClick:()=>{r(e)},isSelected:t===d,isURL:$y.includes(e.type),searchTerm:o,shouldShowType:y,isFrontPage:null==e?void 0:e.isFrontPage})))))}function Yy(e){const t=null==e?void 0:e.startsWith("#");return(0,_m.isURL)(e)||e&&e.includes("www.")||t}const Zy=()=>Promise.resolve([]),Qy=e=>{let t="URL";const n=(0,_m.getProtocol)(e)||"";return n.includes("mailto")&&(t=Wy),n.includes("tel")&&(t="tel"),null!=e&&e.startsWith("#")&&(t=jy),Promise.resolve([{id:e,title:e,url:"URL"===t?(0,_m.prependHTTP)(e):e,type:t}])};function Xy(e,t,n,o){const{fetchSearchSuggestions:r,pageOnFront:l}=(0,p.useSelect)((e=>{const{getSettings:t}=e(so);return{pageOnFront:t().pageOnFront,fetchSearchSuggestions:t().__experimentalFetchLinkSuggestions}}),[]),i=t?Qy:Zy;return(0,a.useCallback)(((t,a)=>{let{isInitialSuggestions:s}=a;return Yy(t)?i(t,{isInitialSuggestions:s}):(async(e,t,n,o,r,l,i)=>{const{isInitialSuggestions:a}=t;let s=!1,c=await Promise.all([n(e,t),o(e)]);c[0]=c[0].map((e=>Number(e.id)===i?(s=!0,e.isFrontPage=!0,e):e));const u=!e.includes(" ");return c=!s&&u&&l&&!a?c[0].concat(c[1]):c[0],a||Yy(e)||!r?c:c.concat({title:e,url:e,type:Uy})})(t,{...e,isInitialSuggestions:s},r,i,n,o,l)}),[i,r,n])}const Jy=()=>Promise.resolve([]),eE=()=>{},tE=(0,a.forwardRef)(((e,t)=>{let{value:n,children:o,currentLink:r={},className:l=null,placeholder:i=null,withCreateSuggestion:s=!1,onCreateSuggestion:u=eE,onChange:p=eE,onSelect:m=eE,showSuggestions:f=!0,renderSuggestions:h=(e=>(0,a.createElement)(qy,e)),fetchSuggestions:v=null,allowDirectEntry:b=!0,showInitialSuggestions:_=!1,suggestionsQuery:k={},withURLSuggestion:y=!0,createSuggestionButtonText:E,useLabel:C=!1}=e;const w=Xy(k,b,s,y),S=f?v||w:Jy,B=(0,d.useInstanceId)(tE),[I,x]=(0,a.useState)(),T=async e=>{let t=e;if(Uy!==e.type){if(b||t&&Object.keys(t).length>=1){const{id:e,url:n,...o}=r;m({...o,...t},t)}}else try{var n;t=await u(e.title),null!==(n=t)&&void 0!==n&&n.url&&m(t)}catch(e){}},N=c()(l,{"has-no-label":!C});return(0,a.createElement)("div",{className:"block-editor-link-control__search-input-container"},(0,a.createElement)(Ly,{label:C?"URL":void 0,className:N,value:n,onChange:(e,t)=>{p(e),x(t)},placeholder:null!=i?i:(0,g.__)("Search or type url"),__experimentalRenderSuggestions:f?e=>h({...e,instanceId:B,withCreateSuggestion:s,currentInputValue:n,createSuggestionButtonText:E,suggestionsQuery:k,handleSuggestionClick:t=>{e.handleSuggestionClick&&e.handleSuggestionClick(t),T(t)}}):null,__experimentalFetchLinkSuggestions:S,__experimentalHandleURLSuggestions:!0,__experimentalShowInitialSuggestions:_,onSubmit:(e,t)=>{var o;const r=e||I;r||null!=n&&null!==(o=n.trim())&&void 0!==o&&o.length?T(r||{url:n}):t.preventDefault()},ref:t}),o)}));var nE=tE;var oE=(0,a.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(D.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"}));var rE=(0,a.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(D.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:lE,Fill:iE}=(0,m.createSlotFill)("BlockEditorLinkControlViewer");function aE(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}`)}}var sE=function(e){const[t,n]=(0,a.useReducer)(aE,{richData:null,isFetching:!1}),{fetchRichUrlData:o}=(0,p.useSelect)((e=>{const{getSettings:t}=e(so);return{fetchRichUrlData:t().__experimentalFetchRichUrlData}}),[]);return(0,a.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};function cE(e){var t;let{value:n,onEditClick:o,hasRichPreviews:r=!1,hasUnlinkControl:l=!1,onRemove:i}=e;const s=r?null==n?void 0:n.url:null,{richData:u,isFetching:d}=sE(s),p=u&&Object.keys(u).length,f=n&&(0,_m.filterURLForDisplay)((0,_m.safeDecodeURI)(n.url),16)||"",h=(null==u?void 0:u.title)||(null==n?void 0:n.title)||f,v=!(null!=n&&null!==(t=n.url)&&void 0!==t&&t.length);let b;return b=null!=u&&u.icon?(0,a.createElement)("img",{src:null==u?void 0:u.icon,alt:""}):v?(0,a.createElement)(ul,{icon:oE,size:32}):(0,a.createElement)(ul,{icon:Fy}),(0,a.createElement)("div",{"aria-label":(0,g.__)("Currently selected"),className:c()("block-editor-link-control__search-item",{"is-current":!0,"is-rich":p,"is-fetching":!!d,"is-preview":!0,"is-error":v})},(0,a.createElement)("div",{className:"block-editor-link-control__search-item-top"},(0,a.createElement)("span",{className:"block-editor-link-control__search-item-header"},(0,a.createElement)("span",{className:c()("block-editor-link-control__search-item-icon",{"is-image":null==u?void 0:u.icon})},b),(0,a.createElement)("span",{className:"block-editor-link-control__search-item-details"},v?(0,a.createElement)("span",{className:"block-editor-link-control__search-item-error-notice"},(0,g.__)("Link is empty")):(0,a.createElement)(a.Fragment,null,(0,a.createElement)(m.ExternalLink,{className:"block-editor-link-control__search-item-title",href:n.url},(0,Wl.__unstableStripHTML)(h)),(null==n?void 0:n.url)&&(0,a.createElement)("span",{className:"block-editor-link-control__search-item-info"},f)))),(0,a.createElement)(m.Button,{icon:rE,label:(0,g.__)("Edit"),className:"block-editor-link-control__search-item-action",onClick:o,iconSize:24}),l&&(0,a.createElement)(m.Button,{icon:tr,label:(0,g.__)("Unlink"),className:"block-editor-link-control__search-item-action block-editor-link-control__unlink",onClick:i,iconSize:24}),(0,a.createElement)(lE,{fillProps:n})),!!(p&&(null!=u&&u.image||null!=u&&u.description)||d)&&(0,a.createElement)("div",{className:"block-editor-link-control__search-item-bottom"},((null==u?void 0:u.image)||d)&&(0,a.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,a.createElement)("img",{src:null==u?void 0:u.image,alt:""})),((null==u?void 0:u.description)||d)&&(0,a.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,a.createElement)(m.__experimentalText,{truncate:!0,numberOfLines:"2"},u.description))))}const uE=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}}},dE=()=>{};function pE(e){var t,n,o;let{searchInputPlaceholder:r,value:l,settings:i=Ky,onChange:s=dE,onRemove:u,noDirectEntry:d=!1,showSuggestions:p=!0,showInitialSuggestions:f,forceIsEditingLink:h,createSuggestion:v,withCreateSuggestion:b,inputValue:_="",suggestionsQuery:k={},noURLSuggestion:y=!1,createSuggestionButtonText:E,hasRichPreviews:C=!1,hasTextControl:w=!1,renderControlBottom:S=null}=e;void 0===b&&v&&(b=!0);const B=(0,a.useRef)(!0),I=(0,a.useRef)(),x=(0,a.useRef)(),[T,N]=(0,a.useState)((null==l?void 0:l.url)||""),[P,M]=(0,a.useState)((null==l?void 0:l.title)||""),L=_||T,[R,A]=(0,a.useState)(void 0!==h?h:!l||!l.url),D=(0,a.useRef)(!1),O=!(null!=L&&null!==(t=L.trim())&&void 0!==t&&t.length),{createPage:z,isCreatingPage:F,errorMessage:V}=function(e){const t=(0,a.useRef)(),[n,o]=(0,a.useState)(!1),[r,l]=(0,a.useState)(null);return(0,a.useEffect)((()=>()=>{t.current&&t.current.cancel()}),[]),{createPage:async function(n){o(!0),l(null);try{return t.current=uE(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}}(v);function H(){var e;D.current=!(null===(e=I.current)||void 0===e||!e.contains(I.current.ownerDocument.activeElement)),A(!1)}(0,a.useEffect)((()=>{void 0!==h&&h!==R&&A(h)}),[h]),(0,a.useEffect)((()=>{if(B.current)return void(B.current=!1);const e=null!=x&&x.current?1:0;(Wl.focus.focusable.find(I.current)[e]||I.current).focus(),D.current=!1}),[R,F]),(0,a.useEffect)((()=>{null!=l&&l.title&&l.title!==P&&M(l.title),null!=l&&l.url&&N(l.url)}),[l]);const G=()=>{L===(null==l?void 0:l.url)&&P===(null==l?void 0:l.title)||s({...l,url:L,title:P}),H()},U=u&&l&&!R&&!F,W=!(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,a.createElement)("div",{tabIndex:-1,ref:I,className:"block-editor-link-control"},F&&(0,a.createElement)("div",{className:"block-editor-link-control__loading"},(0,a.createElement)(m.Spinner,null)," ",(0,g.__)("Creating"),"…"),(R||!l)&&!F&&(0,a.createElement)(a.Fragment,null,(0,a.createElement)("div",{className:c()({"block-editor-link-control__search-input-wrapper":!0,"has-text-control":j})},j&&(0,a.createElement)(m.TextControl,{ref:x,className:"block-editor-link-control__field block-editor-link-control__text-content",label:"Text",value:P,onChange:M,onKeyDown:e=>{const{keyCode:t}=e;t!==ku.ENTER||O||(e.preventDefault(),G())}}),(0,a.createElement)(nE,{currentLink:l,className:"block-editor-link-control__field block-editor-link-control__search-input",placeholder:r,value:L,withCreateSuggestion:b,onCreateSuggestion:z,onChange:N,onSelect:e=>{s({...e,title:P||(null==e?void 0:e.title)}),H()},showInitialSuggestions:f,allowDirectEntry:!d,showSuggestions:p,suggestionsQuery:k,withURLSuggestion:!y,createSuggestionButtonText:E,useLabel:j},(0,a.createElement)("div",{className:"block-editor-link-control__search-actions"},(0,a.createElement)(m.Button,{onClick:G,label:(0,g.__)("Submit"),icon:By,className:"block-editor-link-control__search-submit",disabled:O})))),V&&(0,a.createElement)(m.Notice,{className:"block-editor-link-control__search-error",status:"error",isDismissible:!1},V)),l&&!R&&!F&&(0,a.createElement)(cE,{key:null==l?void 0:l.url,value:l,onEditClick:()=>A(!0),hasRichPreviews:C,hasUnlinkControl:U,onRemove:u}),W&&(0,a.createElement)("div",{className:"block-editor-link-control__tools"},(0,a.createElement)(xy,{value:l,settings:i,onChange:s})),S&&S())}pE.ViewerFill=iE;var mE=pE;var fE=(0,a.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(D.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"}));var gE=(0,a.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(D.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"}));var hE=(0,a.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(D.Path,{d:"M19 3H5c-.6 0-1 .4-1 1v7c0 .5.4 1 1 1h14c.5 0 1-.4 1-1V4c0-.6-.4-1-1-1zM5.5 10.5v-.4l1.8-1.3 1.3.8c.3.2.7.2.9-.1L11 8.1l2.4 2.4H5.5zm13 0h-2.9l-4-4c-.3-.3-.8-.3-1.1 0L8.9 8l-1.2-.8c-.3-.2-.6-.2-.9 0l-1.3 1V4.5h13v6zM4 20h9v-1.5H4V20zm0-4h16v-1.5H4V16z"}));var vE=(0,m.withFilters)("editor.MediaUpload")((()=>null));var bE=function(e){let{fallback:t=null,children:n}=e;const o=(0,p.useSelect)((e=>{const{getSettings:t}=e(so);return!!t().mediaUpload}),[]);return o?n:t};const _E=()=>{};let kE=0;var yE=(0,d.compose)([(0,p.withDispatch)((e=>{const{createNotice:t,removeNotice:n}=e(Op.store);return{createNotice:t,removeNotice:n}})),(0,m.withFilters)("editor.MediaReplaceFlow")])((e=>{let{mediaURL:t,mediaId:n,mediaIds:o,allowedTypes:r,accept:l,onError:i,onSelect:s,onSelectURL:c,onToggleFeaturedImage:u,useFeaturedImage:d,onFilesUpload:f=_E,name:h=(0,g.__)("Replace"),createNotice:v,removeNotice:b,children:_,multiple:k=!1,addToGallery:y,handleUpload:E=!0}=e;const C=(0,p.useSelect)((e=>e(so).getSettings().mediaUpload),[]),w=(0,a.useRef)(),S="block-editor/media-replace-flow/error-notice/"+ ++kE,B=e=>{const t=(0,Wl.__unstableStripHTML)(e);i?i(t):setTimeout((()=>{v("error",t,{speak:!0,id:S,isDismissible:!0})}),1e3)},I=(e,t)=>{d&&u&&u(),t(),s(e),(0,qt.speak)((0,g.__)("The media file has been replaced")),b(S)},x=e=>{e.keyCode===ku.DOWN&&(e.preventDefault(),e.target.click())},T=k&&!(!r||0===r.length)&&r.every((e=>"image"===e||e.startsWith("image/")));return(0,a.createElement)(m.Dropdown,{popoverProps:{isAlternate:!0},contentClassName:"block-editor-media-replace-flow__options",renderToggle:e=>{let{isOpen:t,onToggle:n}=e;return(0,a.createElement)(m.ToolbarButton,{ref:w,"aria-expanded":t,"aria-haspopup":"true",onClick:n,onKeyDown:x},h)},renderContent:e=>{let{onClose:i}=e;return(0,a.createElement)(a.Fragment,null,(0,a.createElement)(m.NavigableMenu,{className:"block-editor-media-replace-flow__media-upload-menu"},(0,a.createElement)(a.Fragment,null,(0,a.createElement)(vE,{gallery:T,addToGallery:y,multiple:k,value:k?o:n,onSelect:e=>I(e,i),allowedTypes:r,render:e=>{let{open:t}=e;return(0,a.createElement)(m.MenuItem,{icon:fE,onClick:t},(0,g.__)("Open Media Library"))}}),(0,a.createElement)(bE,null,(0,a.createElement)(m.FormFileUpload,{onChange:e=>{((e,t)=>{const n=e.target.files;if(!E)return t(),s(n);f(n),C({allowedTypes:r,filesList:n,onFileChange:e=>{let[n]=e;I(n,t)},onError:B})})(e,i)},accept:l,multiple:k,render:e=>{let{openFileDialog:t}=e;return(0,a.createElement)(m.MenuItem,{icon:gE,onClick:()=>{t()}},(0,g.__)("Upload"))}}))),u&&(0,a.createElement)(m.MenuItem,{icon:hE,onClick:u,isPressed:d},(0,g.__)("Use featured image")),_),c&&(0,a.createElement)("form",{className:"block-editor-media-flow__url-input"},(0,a.createElement)("span",{className:"block-editor-media-replace-flow__image-url-label"},(0,g.__)("Current media URL:")),(0,a.createElement)(m.Tooltip,{text:t,position:"bottom"},(0,a.createElement)("div",null,(0,a.createElement)(mE,{value:{url:t},settings:[],showSuggestions:!1,onChange:e=>{let{url:t}=e;c(t),w.current.focus()}})))))}})}));function EE(e){let{url:t,urlLabel:n,className:o}=e;const r=c()(o,"block-editor-url-popover__link-viewer-url");return t?(0,a.createElement)(m.ExternalLink,{className:r,href:t},n||(0,_m.filterURLForDisplay)((0,_m.safeDecodeURI)(t))):(0,a.createElement)("span",{className:r})}function CE(e){let{additionalControls:t,children:n,renderSettings:o,position:r="bottom center",focusOnMount:l="firstElement",...s}=e;const[c,u]=(0,a.useState)(!1),d=!!o&&c;return(0,a.createElement)(m.Popover,i({className:"block-editor-url-popover",focusOnMount:l,position:r,shift:!0},s),(0,a.createElement)("div",{className:"block-editor-url-popover__input-container"},(0,a.createElement)("div",{className:"block-editor-url-popover__row"},n,!!o&&(0,a.createElement)(m.Button,{className:"block-editor-url-popover__settings-toggle",icon:nf,label:(0,g.__)("Link settings"),onClick:()=>{u(!c)},"aria-expanded":c})),d&&(0,a.createElement)("div",{className:"block-editor-url-popover__row block-editor-url-popover__settings"},o())),t&&!d&&(0,a.createElement)("div",{className:"block-editor-url-popover__additional-controls"},t))}CE.LinkEditor=function(e){let{autocompleteRef:t,className:n,onChangeInputValue:o,value:r,...l}=e;return(0,a.createElement)("form",i({className:c()("block-editor-url-popover__link-editor",n)},l),(0,a.createElement)(Ly,{value:r,onChange:o,autocompleteRef:t}),(0,a.createElement)(m.Button,{icon:By,label:(0,g.__)("Apply"),type:"submit"}))},CE.LinkViewer=function(e){let{className:t,linkClassName:n,onEditLinkClick:o,url:r,urlLabel:l,...s}=e;return(0,a.createElement)("div",i({className:c()("block-editor-url-popover__link-viewer",t)},s),(0,a.createElement)(EE,{url:r,urlLabel:l,className:n}),o&&(0,a.createElement)(m.Button,{icon:rE,label:(0,g.__)("Edit"),onClick:o}))};var wE=CE;const SE=()=>{},BE=e=>{let{src:t,onChange:n,onSubmit:o,onClose:r}=e;return(0,a.createElement)(wE,{onClose:r},(0,a.createElement)("form",{className:"block-editor-media-placeholder__url-input-form",onSubmit:o},(0,a.createElement)("input",{className:"block-editor-media-placeholder__url-input-field",type:"text","aria-label":(0,g.__)("URL"),placeholder:(0,g.__)("Paste or type URL"),onChange:n,value:t}),(0,a.createElement)(m.Button,{className:"block-editor-media-placeholder__url-input-submit-button",icon:By,label:(0,g.__)("Apply"),type:"submit"})))};var IE=(0,m.withFilters)("editor.MediaPlaceholder")((function(e){let{value:t={},allowedTypes:n,className:o,icon:r,labels:l={},mediaPreview:i,notices:s,isAppender:u,accept:d,addToGallery:f,multiple:h=!1,handleUpload:v=!0,disableDropZone:b,disableMediaButtons:_,onError:k,onSelect:y,onCancel:E,onSelectURL:C,onToggleFeaturedImage:w,onDoubleClick:S,onFilesPreUpload:B=SE,onHTMLDrop:I=SE,children:x,mediaLibraryButton:T,placeholder:N,style:P}=e;const M=(0,p.useSelect)((e=>{const{getSettings:t}=e(so);return t().mediaUpload}),[]),[L,R]=(0,a.useState)(""),[A,D]=(0,a.useState)(!1);(0,a.useEffect)((()=>{var e;R(null!==(e=null==t?void 0:t.src)&&void 0!==e?e:"")}),[null==t?void 0:t.src]);const O=e=>{R(e.target.value)},z=()=>{D(!0)},F=()=>{D(!1)},V=e=>{e.preventDefault(),L&&C&&(C(L),F())},H=e=>{if(!v)return y(e);let o;if(B(e),h)if(f){let e=[];o=n=>{const o=(null!=t?t:[]).filter((t=>t.id?!e.some((e=>{let{id:n}=e;return Number(n)===Number(t.id)})):!e.some((e=>{let{urlSlug:n}=e;return t.url.includes(n)}))));y(o.concat(n)),e=n.map((e=>{const t=e.url.lastIndexOf("."),n=e.url.slice(0,t);return{id:e.id,urlSlug:n}}))}}else o=y;else o=e=>{let[t]=e;return y(t)};M({allowedTypes:n,filesList:e,onFileChange:o,onError:k})},G=e=>{H(e.target.files)},U=null!=N?N:e=>{let{instructions:t,title:d}=l;if(M||C||(t=(0,g.__)("To edit this block, you need permission to upload media.")),void 0===t||void 0===d){const e=null!=n?n:[],[o]=e,r=1===e.length,l=r&&"audio"===o,i=r&&"image"===o,a=r&&"video"===o;void 0===t&&M&&(t=(0,g.__)("Upload a media file or pick one from your media library."),l?t=(0,g.__)("Upload an audio file, pick one from your media library, or add one with a URL."):i?t=(0,g.__)("Upload an image file, pick one from your media library, or add one with a URL."):a&&(t=(0,g.__)("Upload a video file, pick one from your media library, or add one with a URL."))),void 0===d&&(d=(0,g.__)("Media"),l?d=(0,g.__)("Audio"):i?d=(0,g.__)("Image"):a&&(d=(0,g.__)("Video")))}const p=c()("block-editor-media-placeholder",o,{"is-appender":u});return(0,a.createElement)(m.Placeholder,{icon:r,label:d,instructions:t,className:p,notices:s,onDoubleClick:S,preview:i,style:P},e,x)},W=()=>b?null:(0,a.createElement)(m.DropZone,{onFilesDrop:H,onHTMLDrop:I}),j=()=>E&&(0,a.createElement)(m.Button,{className:"block-editor-media-placeholder__cancel-button",title:(0,g.__)("Cancel"),variant:"link",onClick:E},(0,g.__)("Cancel")),$=()=>C&&(0,a.createElement)("div",{className:"block-editor-media-placeholder__url-input-container"},(0,a.createElement)(m.Button,{className:"block-editor-media-placeholder__button",onClick:z,isPressed:A,variant:"tertiary"},(0,g.__)("Insert from URL")),A&&(0,a.createElement)(BE,{src:L,onChange:O,onSubmit:V,onClose:F})),K=()=>w&&(0,a.createElement)("div",{className:"block-editor-media-placeholder__url-input-container"},(0,a.createElement)(m.Button,{className:"block-editor-media-placeholder__button",onClick:w,variant:"tertiary"},(0,g.__)("Use featured image")));return _?(0,a.createElement)(bE,null,W()):(0,a.createElement)(bE,{fallback:U($())},(()=>{const e=null!=T?T:e=>{let{open:t}=e;return(0,a.createElement)(m.Button,{variant:"tertiary",onClick:()=>{t()}},(0,g.__)("Media Library"))},o=(0,a.createElement)(vE,{addToGallery:f,gallery:h&&!(!n||0===n.length)&&n.every((e=>"image"===e||e.startsWith("image/"))),multiple:h,onSelect:y,allowedTypes:n,mode:"browse",value:Array.isArray(t)?t.map((e=>{let{id:t}=e;return t})):t.id,render:e});if(M&&u)return(0,a.createElement)(a.Fragment,null,W(),(0,a.createElement)(m.FormFileUpload,{onChange:G,accept:d,multiple:h,render:e=>{let{openFileDialog:t}=e;const n=(0,a.createElement)(a.Fragment,null,(0,a.createElement)(m.Button,{variant:"primary",className:c()("block-editor-media-placeholder__button","block-editor-media-placeholder__upload-button"),onClick:t},(0,g.__)("Upload")),o,$(),K(),j());return U(n)}}));if(M){const e=(0,a.createElement)(a.Fragment,null,W(),(0,a.createElement)(m.FormFileUpload,{variant:"primary",className:c()("block-editor-media-placeholder__button","block-editor-media-placeholder__upload-button"),onChange:G,accept:d,multiple:h},(0,g.__)("Upload")),o,$(),K(),j());return U(e)}return U(o)})())}));var xE=e=>{let{colorSettings:t,...n}=e;const o=t.map((e=>{if(!e)return e;const{value:t,onChange:n,...o}=e;return{...o,colorValue:t,onColorChange:n}}));return(0,a.createElement)(Hk,i({settings:o,gradients:[],disableCustomGradients:!0},n))};const TE={position:"bottom right",isAlternate:!0};var NE=()=>(0,a.createElement)(a.Fragment,null,["bold","italic","link"].map((e=>(0,a.createElement)(m.Slot,{name:`RichText.ToolbarControls.${e}`,key:e}))),(0,a.createElement)(m.Slot,{name:"RichText.ToolbarControls"},(e=>{if(!e.length)return null;const t=e.map((e=>{let[{props:t}]=e;return t})).some((e=>{let{isActive:t}=e;return t}));return(0,a.createElement)(m.ToolbarItem,null,(n=>(0,a.createElement)(m.DropdownMenu,{icon:nf,label:(0,g.__)("More"),toggleProps:{...n,className:c()(n.className,{"is-pressed":t}),describedBy:(0,g.__)("Displays more block tools")},controls:(0,u.orderBy)(e.map((e=>{let[{props:t}]=e;return t})),"title"),popoverProps:TE})))})));function PE(e){let{value:t,editableContentElement:n,activeFormats:o}=e;const r=o[o.length-1],l=null==r?void 0:r.type,i=(0,p.useSelect)((e=>e(z.store).getFormatType(l)),[l]),s=(0,z.useAnchor)({editableContentElement:n,value:t,settings:i});return(0,a.createElement)(ME,{popoverAnchor:s})}function ME(e){let{popoverAnchor:t}=e;return(0,a.createElement)(m.Popover,{position:"top center",focusOnMount:!1,anchor:t,className:"block-editor-rich-text__inline-format-toolbar",__unstableSlotName:"block-toolbar"},(0,a.createElement)("div",{className:"block-editor-rich-text__inline-format-toolbar-group"},(0,a.createElement)(m.ToolbarGroup,null,(0,a.createElement)(NE,null))))}var LE=e=>{let{inline:t,editableContentElement:n,value:o}=e;const r=(0,p.useSelect)((e=>e(so).getSettings().hasInlineToolbar),[]);if(t)return(0,a.createElement)(ME,{popoverAnchor:n});if(r){const e=(0,z.getActiveFormats)(o);return(0,z.isCollapsed)(o)&&!e.length?null:(0,a.createElement)(PE,{editableContentElement:n,value:o,activeFormats:e})}return(0,a.createElement)(_o,{group:"inline"},(0,a.createElement)(NE,null))};function RE(){const{didAutomaticChange:e,getSettings:t}=(0,p.useSelect)(so);return(0,d.useRefEffect)((n=>{function o(n){const{keyCode:o}=n;n.defaultPrevented||o!==ku.DELETE&&o!==ku.BACKSPACE&&o!==ku.ESCAPE||e()&&(n.preventDefault(),t().__experimentalUndo())}return n.addEventListener("keydown",o),()=>{n.removeEventListener("keydown",o)}}),[])}function AE(e){return e.filter((e=>{let{type:t}=e;return/^image\/(?:jpe?g|png|gif|webp)$/.test(t)})).map((e=>`<img src="${(0,Zf.createBlobURL)(e)}">`)).join("")}var DE=window.wp.shortcode;function OE(e,t){if(null!=t&&t.length){let n=e.formats.length;for(;n--;)e.formats[n]=[...t,...e.formats[n]||[]]}}function zE(e){if(!0===e||"p"===e||"li"===e)return!0===e?"p":e}function FE(e){let{allowedFormats:t,formattingControls:n,disableFormats:o}=e;return o?FE.EMPTY_ARRAY:t||n?t||(V()("wp.blockEditor.RichText formattingControls prop",{since:"5.4",alternative:"allowedFormats",version:"6.2"}),n.map((e=>`core/${e}`))):void 0}FE.EMPTY_ARRAY=[];function VE(e){let{value:t,pastedBlocks:n=[],onReplace:o,onSplit:r,onSplitMiddle:l,multilineTag:i}=e;if(!o||!r)return;const{start:a=0,end:s=0}=t,c={...t,start:a,end:s},u=[],[d,p]=(0,z.split)(c),m=n.length>0;let f=-1;const g=(0,z.isEmpty)(d)&&!(0,z.isEmpty)(p);m&&(0,z.isEmpty)(d)||(u.push(r((0,z.toHTMLString)({value:d,multilineTag:i}),!g)),f+=1),m?(u.push(...n),f+=n.length):l&&u.push(l()),(m||l)&&(0,z.isEmpty)(p)||u.push(r((0,z.toHTMLString)({value:p,multilineTag:i}),g));o(u,m?f:1,m?-1:0)}function HE(e,t){return t?(0,z.replace)(e,/\n+/g,z.__UNSTABLE_LINE_SEPARATOR):(0,z.replace)(e,new RegExp(z.__UNSTABLE_LINE_SEPARATOR,"g"),"\n")}function GE(e){const t=(0,a.useRef)(e);return t.current=e,(0,d.useRefEffect)((e=>{function n(e){const{isSelected:n,disableFormats:o,onChange:l,value:i,formatTypes:a,tagName:s,onReplace:c,onSplit:u,onSplitMiddle:d,__unstableEmbedURLOnPaste:p,multilineTag:m,preserveWhiteSpace:f,pastePlainText:g}=t.current;if(!n)return;const{clipboardData:h}=e;let v="",b="";try{v=h.getData("text/plain"),b=h.getData("text/html")}catch(e){try{b=h.getData("Text")}catch(e){return}}if(b=function(e){const t="\x3c!--StartFragment--\x3e",n=e.indexOf(t);if(!(n>-1))return e;e=e.substring(n+t.length);const o="\x3c!--EndFragment--\x3e",r=e.indexOf(o);r>-1&&(e=e.substring(0,r));return e}(b),b=function(e){const t="<meta charset='utf-8'>";if(e.startsWith(t))return e.slice(t.length);return e}(b),e.preventDefault(),window.console.log("Received HTML:\n\n",b),window.console.log("Received plain text:\n\n",v),o)return void l((0,z.insert)(i,v));const _=a.reduce(((e,t)=>{let{__unstablePasteRule:n}=t;return n&&e===i&&(e=n(i,{html:b,plainText:v})),e}),i);if(_!==i)return void l(_);const k=[...(0,Wl.getFilesFromDataTransfer)(h)];if("true"===h.getData("rich-text")){const e=h.getData("rich-text-multi-line-tag")||void 0;let t=(0,z.create)({html:b,multilineTag:e,multilineWrapperTags:"li"===e?["ul","ol"]:void 0,preserveWhiteSpace:f});return t=HE(t,!!m),OE(t,i.activeFormats),void l((0,z.insert)(i,t))}if(g)return void l((0,z.insert)(i,(0,z.create)({text:v})));if(null!=k&&k.length&&!Qf(k,b)){const e=(0,r.pasteHandler)({HTML:AE(k),mode:"BLOCKS",tagName:s,preserveWhiteSpace:f});return window.console.log("Received items:\n\n",k),void(c&&(0,z.isEmpty)(i)?c(e):VE({value:i,pastedBlocks:e,onReplace:c,onSplit:u,onSplitMiddle:d,multilineTag:m}))}let y=c&&u?"AUTO":"INLINE";var E;"AUTO"===y&&(0,z.isEmpty)(i)&&(E=v,(0,DE.regexp)(".*").test(E))&&(y="BLOCKS"),p&&(0,z.isEmpty)(i)&&(0,_m.isURL)(v.trim())&&(y="BLOCKS");const C=(0,r.pasteHandler)({HTML:b,plainText:v,mode:y,tagName:s,preserveWhiteSpace:f});if("string"==typeof C){let e=(0,z.create)({html:C});e=HE(e,!!m),OE(e,i.activeFormats),l((0,z.insert)(i,e))}else C.length>0&&(c&&(0,z.isEmpty)(i)?c(C,C.length-1,-1):VE({value:i,pastedBlocks:C,onReplace:c,onSplit:u,onSplitMiddle:d,multilineTag:m}))}return e.addEventListener("paste",n),()=>{e.removeEventListener("paste",n)}}),[])}const UE=["`",'"',"'","“”",""];function WE(e){const{__unstableMarkLastChangeAsPersistent:t,__unstableMarkAutomaticChange:n}=(0,p.useDispatch)(so),o=(0,a.useRef)(e);return o.current=e,(0,d.useRefEffect)((e=>{function r(r){const{inputType:i,data:a}=r,{value:s,onChange:c}=o.current;if("insertText"!==i)return;if((0,z.isCollapsed)(s))return;const u=(0,l.applyFilters)("blockEditor.wrapSelectionSettings",UE).find((e=>{let[t,n]=e;return t===a||n===a}));if(!u)return;const[d,p=d]=u,m=s.start,f=s.end+d.length;let g=(0,z.insert)(s,d,m,m);g=(0,z.insert)(g,p,f,f),t(),c(g),n();const h={};for(const e in r)h[e]=r[e];h.data=p;const{ownerDocument:v}=e,{defaultView:b}=v,_=new b.InputEvent("input",h);r.target.dispatchEvent(_),r.preventDefault()}return e.addEventListener("beforeinput",r),()=>{e.removeEventListener("beforeinput",r)}}),[])}function jE(e){let t=e.length;for(;t--;){const n=Zt(e[t].attributes);if(n)return e[t].attributes[n]=e[t].attributes[n].replace(Yt,""),e[t].clientId;const o=jE(e[t].innerBlocks);if(o)return o}}function $E(e){const{__unstableMarkLastChangeAsPersistent:t,__unstableMarkAutomaticChange:n}=(0,p.useDispatch)(so),o=(0,a.useRef)(e);return o.current=e,(0,d.useRefEffect)((e=>{function l(){const{value:e,onReplace:t,selectionChange:l}=o.current;if(!t)return;const{start:i,text:a}=e;if(" "!==a.slice(i-1,i))return;const s=a.slice(0,i).trim(),c=(0,r.getBlockTransforms)("from").filter((e=>{let{type:t}=e;return"prefix"===t})),u=(0,r.findTransform)(c,(e=>{let{prefix:t}=e;return s===t}));if(!u)return;const d=(0,z.toHTMLString)({value:(0,z.insert)(e,Yt,0,i)}),p=u.transform(d);l(jE([p])),t([p]),n()}function i(e){const{inputType:r,type:i}=e,{value:a,onChange:s,__unstableAllowPrefixTransformations:c,formatTypes:u}=o.current;if("insertText"!==r&&"compositionend"!==i)return;c&&l&&l();const d=u.reduce(((e,t)=>{let{__unstableInputRule:n}=t;return n&&(e=n(e)),e}),function(e){const t="tales of gutenberg",{start:n,text:o}=e;return n<t.length||o.slice(n-t.length,n).toLowerCase()!==t?e:(0,z.insert)(e," 🐡🐢🦀🐤🦋🐘🐧🐹🦁🦄🦍🐼🐿🎃🐴🐝🐆🦕🦔🌱🍇π🍌🐉💧🥨🌌🍂🍠🥦🥚🥝🎟🥥🥒🛵🥖🍒🍯🎾🎲🐺🐚🐮⌛️")}(a));d!==a&&(t(),s({...d,activeFormats:a.activeFormats}),n())}return e.addEventListener("input",i),e.addEventListener("compositionend",i),()=>{e.removeEventListener("input",i),e.removeEventListener("compositionend",i)}}),[])}function KE(e){const{__unstableMarkAutomaticChange:t}=(0,p.useDispatch)(so),n=(0,a.useRef)(e);return n.current=e,(0,d.useRefEffect)((e=>{function o(e){if(e.defaultPrevented)return;const{removeEditorOnlyFormats:o,value:l,onReplace:i,onSplit:a,onSplitMiddle:s,multilineTag:c,onChange:u,disableLineBreaks:d,onSplitAtEnd:p}=n.current;if(e.keyCode!==ku.ENTER)return;e.preventDefault();const m={...l};m.formats=o(l);const f=i&&a;if(i){const e=(0,r.getBlockTransforms)("from").filter((e=>{let{type:t}=e;return"enter"===t})),n=(0,r.findTransform)(e,(e=>e.regExp.test(m.text)));n&&(i([n.transform({content:m.text})]),t())}if(c)e.shiftKey?d||u((0,z.insert)(m,"\n")):f&&(0,z.__unstableIsEmptyLine)(m)?VE({value:m,onReplace:i,onSplit:a,onSplitMiddle:s,multilineTag:c}):u((0,z.__unstableInsertLineSeparator)(m));else{const{text:t,start:n,end:o}=m,r=p&&n===o&&o===t.length;e.shiftKey||!f&&!r?d||u((0,z.insert)(m,"\n")):!f&&r?p():f&&VE({value:m,onReplace:i,onSplit:a,onSplitMiddle:s,multilineTag:c})}}return e.addEventListener("keydown",o),()=>{e.removeEventListener("keydown",o)}}),[])}function qE(e){return e(z.store).getFormatTypes()}const YE=new Set(["a","audio","button","details","embed","iframe","input","label","select","textarea","video"]);function ZE(e,t){return"object"!=typeof e?{[t]:e}:Object.fromEntries(Object.entries(e).map((e=>{let[n,o]=e;return[`${t}.${n}`,o]})))}function QE(e,t){return e[t]?e[t]:Object.keys(e).filter((e=>e.startsWith(t+"."))).reduce(((n,o)=>(n[o.slice(t.length+1)]=e[o],n)),{})}function XE(e){return(0,d.useRefEffect)((t=>{function n(t){for(const n of e.current)n(t)}return t.addEventListener("keydown",n),()=>{t.removeEventListener("keydown",n)}}),[])}function JE(e){return(0,d.useRefEffect)((t=>{function n(t){for(const n of e.current)n(t)}return t.addEventListener("input",n),()=>{t.removeEventListener("input",n)}}),[])}function eC(){const{isMultiSelecting:e}=(0,p.useSelect)(so);return(0,d.useRefEffect)((t=>{function n(){if(!e())return;const n=t.parentElement.closest('[contenteditable="true"]');n&&n.focus()}return t.addEventListener("focus",n),()=>{t.removeEventListener("focus",n)}}),[])}function tC(e){let{formatTypes:t,onChange:n,onFocus:o,value:r,forwardedRef:l}=e;return t.map((e=>{const{name:t,edit:i}=e;if(!i)return null;const s=(0,z.getActiveFormat)(r,t);let c=void 0!==s;const d=(0,z.getActiveObject)(r),p=void 0!==d&&d.type===t;if("core/link"===t&&!(0,z.isCollapsed)(r)){const e=r.formats,t=(0,u.find)(e[r.start],{type:"core/link"}),n=(0,u.find)(e[r.end-1],{type:"core/link"});t&&n&&t===n||(c=!1)}return(0,a.createElement)(i,{key:t,isActive:c,activeAttributes:c&&s.attributes||{},isObjectActive:p,activeObjectAttributes:p&&d.attributes||{},value:r,onChange:n,onFocus:o,contentRef:l})}))}const nC=(0,a.createContext)(),oC=(0,a.createContext)();const rC=(0,a.forwardRef)((function e(t,n){let{children:o,tagName:l="div",value:s="",onChange:u,isSelected:f,multiline:g,inlineToolbar:h,wrapperClassName:v,autocompleters:b,onReplace:_,placeholder:k,allowedFormats:y,formattingControls:E,withoutInteractiveFormatting:C,onRemove:w,onMerge:S,onSplit:B,__unstableOnSplitAtEnd:I,__unstableOnSplitMiddle:x,identifier:T,preserveWhiteSpace:N,__unstablePastePlainText:P,__unstableEmbedURLOnPaste:M,__unstableDisableFormats:L,disableLineBreaks:R,unstableOnFocus:A,__unstableAllowPrefixTransformations:D,...O}=t;g&&V()("wp.blockEditor.RichText multiline prop",{since:"6.1",version:"6.3",alternative:"nested blocks (InnerBlocks)",link:"https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/nested-blocks-inner-blocks/"});const F=(0,d.useInstanceId)(e);T=T||F,O=function(e){const{__unstableMobileNoFocusOnMount:t,deleteEnter:n,placeholderTextColor:o,textAlign:r,selectionColor:l,tagsToEliminate:i,rootTagsToEliminate:a,disableEditingMenu:s,fontSize:c,fontFamily:u,fontWeight:d,fontStyle:p,minWidth:m,maxWidth:f,setRef:g,disableSuggestions:h,disableAutocorrection:v,...b}=e;return b}(O);const H=(0,a.useRef)(),{clientId:G}=mo(),{selectionStart:U,selectionEnd:W,isSelected:j}=(0,p.useSelect)((e=>{const{getSelectionStart:t,getSelectionEnd:n}=e(so),o=t(),r=n();let l;return void 0===f?l=o.clientId===G&&r.clientId===G&&o.attributeKey===T:f&&(l=o.clientId===G),{selectionStart:l?o.offset:void 0,selectionEnd:l?r.offset:void 0,isSelected:l}})),{selectionChange:$}=(0,p.useDispatch)(so),K=zE(g),q=FE({allowedFormats:y,formattingControls:E,disableFormats:L}),Y=!q||q.length>0;let Z=s,Q=u;Array.isArray(s)&&(V()("wp.blockEditor.RichText value prop as children type",{since:"6.1",version:"6.3",alternative:"value prop as string",link:"https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/introducing-attributes-and-editable-fields/"}),Z=r.children.toHTML(s),Q=e=>u(r.children.fromDOM((0,z.__unstableCreateElement)(document,e).childNodes)));const X=(0,a.useCallback)(((e,t)=>{const n={},o=void 0===e&&void 0===t;("number"==typeof e||o)&&(n.start={clientId:G,attributeKey:T,offset:e}),("number"==typeof t||o)&&(n.end={clientId:G,attributeKey:T,offset:t}),$(n)}),[G,T]),{formatTypes:J,prepareHandlers:ee,valueHandlers:te,changeHandlers:ne,dependencies:oe}=function(e){let{clientId:t,identifier:n,withoutInteractiveFormatting:o,allowedFormats:r}=e;const l=(0,p.useSelect)(qE,[]),i=(0,a.useMemo)((()=>l.filter((e=>{let{name:t,tagName:n}=e;return!(r&&!r.includes(t)||o&&YE.has(n))}))),[l,r,YE]),s=(0,p.useSelect)((e=>i.reduce(((o,r)=>r.__experimentalGetPropsForEditableTreePreparation?{...o,...ZE(r.__experimentalGetPropsForEditableTreePreparation(e,{richTextIdentifier:n,blockClientId:t}),r.name)}:o),{})),[i,t,n]),c=(0,p.useDispatch)(),u=[],d=[],m=[],f=[];for(const e in s)f.push(s[e]);return i.forEach((e=>{if(e.__experimentalCreatePrepareEditableTree){const o=e.__experimentalCreatePrepareEditableTree(QE(s,e.name),{richTextIdentifier:n,blockClientId:t});e.__experimentalCreateOnChangeEditableValue?d.push(o):u.push(o)}if(e.__experimentalCreateOnChangeEditableValue){let o={};e.__experimentalGetPropsForEditableTreeChangeHandler&&(o=e.__experimentalGetPropsForEditableTreeChangeHandler(c,{richTextIdentifier:n,blockClientId:t}));const r=QE(s,e.name);m.push(e.__experimentalCreateOnChangeEditableValue({..."object"==typeof r?r:{},...o},{richTextIdentifier:n,blockClientId:t}))}})),{formatTypes:i,prepareHandlers:u,valueHandlers:d,changeHandlers:m,dependencies:f}}({clientId:G,identifier:T,withoutInteractiveFormatting:C,allowedFormats:q});function re(e){return J.forEach((t=>{t.__experimentalCreatePrepareEditableTree&&(e=(0,z.removeFormat)(e,t.name,0,e.text.length))})),e.formats}const{value:le,onChange:ie,ref:ae}=(0,z.__unstableUseRichText)({value:Z,onChange(e,t){let{__unstableFormats:n,__unstableText:o}=t;Q(e),Object.values(ne).forEach((e=>{e(n,o)}))},selectionStart:U,selectionEnd:W,onSelectionChange:X,placeholder:k,__unstableIsSelected:j,__unstableMultilineTag:K,__unstableDisableFormats:L,preserveWhiteSpace:N,__unstableDependencies:[...oe,l],__unstableAfterParse:function(e){return te.reduce(((t,n)=>n(t,e.text)),e.formats)},__unstableBeforeSerialize:re,__unstableAddInvisibleFormats:function(e){return ee.reduce(((t,n)=>n(t,e.text)),e.formats)}}),se=function(e){return(0,m.__unstableUseAutocompleteProps)({...e,completers:I_(e)})}({onReplace:_,completers:b,record:le,onChange:ie});!function(e){let{html:t,value:n}=e;const o=(0,a.useRef)(),r=n.activeFormats&&!!n.activeFormats.length,{__unstableMarkLastChangeAsPersistent:l}=(0,p.useDispatch)(so);(0,a.useLayoutEffect)((()=>{if(o.current){if(o.current!==n.text){const e=window.setTimeout((()=>{l()}),1e3);return o.current=n.text,()=>{window.clearTimeout(e)}}l()}else o.current=n.text}),[t,r])}({html:Z,value:le});const ce=(0,a.useRef)(new Set),ue=(0,a.useRef)(new Set);function de(){var e;null===(e=H.current)||void 0===e||e.focus()}const pe=l;return(0,a.createElement)(a.Fragment,null,j&&(0,a.createElement)(nC.Provider,{value:ce},(0,a.createElement)(oC.Provider,{value:ue},(0,a.createElement)(m.Popover.__unstableSlotNameProvider,{value:"__unstable-block-tools-after"},o&&o({value:le,onChange:ie,onFocus:de}),(0,a.createElement)(tC,{value:le,onChange:ie,onFocus:de,formatTypes:J,forwardedRef:H})))),j&&Y&&(0,a.createElement)(LE,{inline:h,editableContentElement:H.current,value:le}),(0,a.createElement)(pe,i({role:"textbox","aria-multiline":!R,"aria-label":k},O,se,{ref:(0,d.useMergeRefs)([n,se.ref,O.ref,ae,WE({value:le,onChange:ie}),$E({value:le,onChange:ie,__unstableAllowPrefixTransformations:D,formatTypes:J,onReplace:_,selectionChange:$}),(0,d.useRefEffect)((e=>{function t(e){(ku.isKeyboardEvent.primary(e,"z")||ku.isKeyboardEvent.primary(e,"y")||ku.isKeyboardEvent.primaryShift(e,"z"))&&e.preventDefault()}return e.addEventListener("keydown",t),()=>{e.addEventListener("keydown",t)}}),[]),XE(ce),JE(ue),RE(),GE({isSelected:j,disableFormats:L,onChange:ie,value:le,formatTypes:J,tagName:l,onReplace:_,onSplit:B,onSplitMiddle:x,__unstableEmbedURLOnPaste:M,multilineTag:K,preserveWhiteSpace:N,pastePlainText:P}),KE({removeEditorOnlyFormats:re,value:le,onReplace:_,onSplit:B,onSplitMiddle:x,multilineTag:K,onChange:ie,disableLineBreaks:R,onSplitAtEnd:I}),eC(),H]),contentEditable:!0,suppressContentEditableWarning:!0,className:c()("block-editor-rich-text__editable",O.className,"rich-text"),onFocus:A,onKeyDown:function(e){const{keyCode:t}=e;if(!e.defaultPrevented&&(t===ku.DELETE||t===ku.BACKSPACE)){const{start:n,end:o,text:r}=le,l=t===ku.BACKSPACE,i=le.activeFormats&&!!le.activeFormats.length;if(!(0,z.isCollapsed)(le)||i||l&&0!==n||!l&&o!==r.length)return;S&&S(!l),w&&(0,z.isEmpty)(le)&&l&&w(!l),e.preventDefault()}}})))}));rC.Content=e=>{let{value:t,tagName:n,multiline:o,...l}=e;Array.isArray(t)&&(V()("wp.blockEditor.RichText value prop as children type",{since:"6.1",version:"6.3",alternative:"value prop as string",link:"https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/introducing-attributes-and-editable-fields/"}),t=r.children.toHTML(t));const i=zE(o);!t&&i&&(t=`<${i}></${i}>`);const s=(0,a.createElement)(a.RawHTML,null,t);if(n){const{format:e,...t}=l;return(0,a.createElement)(n,t,s)}return s},rC.isEmpty=e=>!e||0===e.length;var lC=rC;const iC=(0,a.forwardRef)(((e,t)=>(0,a.createElement)(lC,i({ref:t},e,{__unstableDisableFormats:!0,preserveWhiteSpace:!0}))));iC.Content=e=>{let{value:t="",tagName:n="div",...o}=e;return(0,a.createElement)(n,o,t)};var aC=iC;var sC=(0,a.forwardRef)(((e,t)=>{let{__experimentalVersion:n,...o}=e;if(2===n)return(0,a.createElement)(aC,i({ref:t},o));const{className:r,onChange:l,...s}=o;return(0,a.createElement)(si.Z,i({ref:t,className:c()("block-editor-plain-text",r),onChange:e=>l(e.target.value)},s))}));function cC(e){let{property:t,viewport:n,desc:o}=e;const r=(0,d.useInstanceId)(cC),l=o||(0,g.sprintf)((0,g._x)("Controls the %1$s property for %2$s viewports.","Text labelling a interface as controlling a given layout property (eg: margin) for a given screen size."),t,n.label);return(0,a.createElement)(a.Fragment,null,(0,a.createElement)("span",{"aria-describedby":`rbc-desc-${r}`},n.label),(0,a.createElement)(m.VisuallyHidden,{as:"span",id:`rbc-desc-${r}`},l))}var uC=function(e){const{title:t,property:n,toggleLabel:o,onIsResponsiveChange:r,renderDefaultControl:l,renderResponsiveControls:i,isResponsive:s=!1,defaultLabel:u={id:"all",label:(0,g.__)("All")},viewports:d=[{id:"small",label:(0,g.__)("Small screens")},{id:"medium",label:(0,g.__)("Medium screens")},{id:"large",label:(0,g.__)("Large screens")}]}=e;if(!t||!n||!l)return null;const p=o||(0,g.sprintf)((0,g.__)("Use the same %s on all screensizes."),n),f=(0,g.__)("Toggle between using the same value for all screen sizes or using a unique value per screen size."),h=l((0,a.createElement)(cC,{property:n,viewport:u}),u);return(0,a.createElement)("fieldset",{className:"block-editor-responsive-block-control"},(0,a.createElement)("legend",{className:"block-editor-responsive-block-control__title"},t),(0,a.createElement)("div",{className:"block-editor-responsive-block-control__inner"},(0,a.createElement)(m.ToggleControl,{className:"block-editor-responsive-block-control__toggle",label:p,checked:!s,onChange:r,help:f}),(0,a.createElement)("div",{className:c()("block-editor-responsive-block-control__group",{"is-responsive":s})},!s&&h,s&&(i?i(d):d.map((e=>(0,a.createElement)(a.Fragment,{key:e.id},l((0,a.createElement)(cC,{property:n,viewport:e}),e))))))))};function dC(e){let{character:t,type:n,onUse:o}=e;const r=(0,a.useContext)(nC),l=(0,a.useRef)();return l.current=o,(0,a.useEffect)((()=>{function e(e){ku.isKeyboardEvent[n](e,t)&&(l.current(),e.preventDefault())}return r.current.add(e),()=>{r.current.delete(e)}}),[t,n]),null}function pC(e){let t,{name:n,shortcutType:o,shortcutCharacter:r,...l}=e,s="RichText.ToolbarControls";return n&&(s+=`.${n}`),o&&r&&(t=ku.displayShortcut[o](r)),(0,a.createElement)(m.Fill,{name:s},(0,a.createElement)(m.ToolbarButton,i({},l,{shortcut:t})))}function mC(e){let{inputType:t,onInput:n}=e;const o=(0,a.useContext)(oC),r=(0,a.useRef)();return r.current=n,(0,a.useEffect)((()=>{function e(e){e.inputType===t&&(r.current(),e.preventDefault())}return o.current.add(e),()=>{o.current.delete(e)}}),[t]),null}const fC=(0,a.createElement)(m.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},(0,a.createElement)(m.Path,{d:"M9.4 20.5L5.2 3.8l14.6 9-2 .3c-.2 0-.4.1-.7.1-.9.2-1.6.3-2.2.5-.8.3-1.4.5-1.8.8-.4.3-.8.8-1.3 1.5-.4.5-.8 1.2-1.2 2l-.3.6-.9 1.9zM7.6 7.1l2.4 9.3c.2-.4.5-.8.7-1.1.6-.8 1.1-1.4 1.6-1.8.5-.4 1.3-.8 2.2-1.1l1.2-.3-8.1-5z"}));var gC=(0,a.forwardRef)((function(e,t){const n=(0,p.useSelect)((e=>e(so).__unstableGetEditorMode()),[]),{__unstableSetEditorMode:o}=(0,p.useDispatch)(so);return(0,a.createElement)(m.Dropdown,{renderToggle:o=>{let{isOpen:r,onToggle:l}=o;return(0,a.createElement)(m.Button,i({},e,{ref:t,icon:"navigation"===n?fC:rE,"aria-expanded":r,"aria-haspopup":"true",onClick:l,label:(0,g.__)("Tools")}))},position:"bottom right",renderContent:()=>(0,a.createElement)(a.Fragment,null,(0,a.createElement)(m.NavigableMenu,{role:"menu","aria-label":(0,g.__)("Tools")},(0,a.createElement)(m.MenuItemsChoice,{value:"navigation"===n?"navigation":"edit",onSelect:o,choices:[{value:"edit",label:(0,a.createElement)(a.Fragment,null,(0,a.createElement)(ul,{icon:rE}),(0,g.__)("Edit"))},{value:"navigation",label:(0,a.createElement)(a.Fragment,null,fC,(0,g.__)("Select"))}]})),(0,a.createElement)("div",{className:"block-editor-tool-selector__help"},(0,g.__)("Tools provide different interactions for selecting, navigating, and editing blocks. Toggle between select and edit by pressing Escape and Enter.")))})}));function hC(e){let{units:t,...n}=e;const o=(0,m.__experimentalUseCustomUnits)({availableUnits:qo("spacing.units")||["%","px","em","rem","vw"],units:t});return(0,a.createElement)(m.__experimentalUnitControl,i({units:o},n))}var vC=(0,a.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(D.Path,{d:"M20 10.8H6.7l4.1-4.5-1.1-1.1-5.8 6.3 5.8 5.8 1.1-1.1-4-3.9H20z"}));class bC extends a.Component{constructor(){super(...arguments),this.toggle=this.toggle.bind(this),this.submitLink=this.submitLink.bind(this),this.state={expanded:!1}}toggle(){this.setState({expanded:!this.state.expanded})}submitLink(e){e.preventDefault(),this.toggle()}render(){const{url:e,onChange:t}=this.props,{expanded:n}=this.state,o=e?(0,g.__)("Edit link"):(0,g.__)("Insert link");return(0,a.createElement)("div",{className:"block-editor-url-input__button"},(0,a.createElement)(m.Button,{icon:er,label:o,onClick:this.toggle,className:"components-toolbar__control",isPressed:!!e}),n&&(0,a.createElement)("form",{className:"block-editor-url-input__button-modal",onSubmit:this.submitLink},(0,a.createElement)("div",{className:"block-editor-url-input__button-modal-line"},(0,a.createElement)(m.Button,{className:"block-editor-url-input__back",icon:vC,label:(0,g.__)("Close"),onClick:this.toggle}),(0,a.createElement)(Ly,{value:e||"",onChange:t}),(0,a.createElement)(m.Button,{icon:By,label:(0,g.__)("Submit"),type:"submit"}))))}}var _C=bC;var kC=(0,a.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(D.Path,{d:"M13 11.8l6.1-6.3-1-1-6.1 6.2-6.1-6.2-1 1 6.1 6.3-6.5 6.7 1 1 6.5-6.6 6.5 6.6 1-1z"}));const yC="none",EC="custom",CC="media",wC="attachment",SC=["noreferrer","noopener"],BC=(0,a.createElement)(m.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,a.createElement)(m.Path,{d:"M0,0h24v24H0V0z",fill:"none"}),(0,a.createElement)(m.Path,{d:"m19 5v14h-14v-14h14m0-2h-14c-1.1 0-2 0.9-2 2v14c0 1.1 0.9 2 2 2h14c1.1 0 2-0.9 2-2v-14c0-1.1-0.9-2-2-2z"}),(0,a.createElement)(m.Path,{d:"m14.14 11.86l-3 3.87-2.14-2.59-3 3.86h12l-3.86-5.14z"})),IC=e=>{let{linkDestination:t,onChangeUrl:n,url:o,mediaType:r="image",mediaUrl:l,mediaLink:i,linkTarget:s,linkClass:c,rel:d}=e;const[p,f]=(0,a.useState)(!1),[h,v]=(0,a.useState)(null),b=(0,a.useCallback)((()=>{f(!0)})),[_,k]=(0,a.useState)(!1),[y,E]=(0,a.useState)(null),C=(0,a.useRef)(null),w=(0,a.useCallback)((()=>{t!==CC&&t!==wC||E(""),k(!0)})),S=(0,a.useCallback)((()=>{k(!1)})),B=(0,a.useCallback)((()=>{E(null),S(),f(!1)})),I=(0,a.useCallback)((()=>e=>{const t=C.current;t&&t.contains(e.target)||(f(!1),E(null),S())})),x=(0,a.useCallback)((()=>e=>{if(y){var t;const e=(null===(t=N().find((e=>e.url===y)))||void 0===t?void 0:t.linkDestination)||EC;n({href:y,linkDestination:e})}S(),E(null),e.preventDefault()})),T=(0,a.useCallback)((()=>{n({linkDestination:yC,href:""})})),N=()=>{const e=[{linkDestination:CC,title:(0,g.__)("Media File"),url:"image"===r?l:void 0,icon:BC}];return"image"===r&&i&&e.push({linkDestination:wC,title:(0,g.__)("Attachment Page"),url:"image"===r?i:void 0,icon:(0,a.createElement)(m.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,a.createElement)(m.Path,{d:"M0 0h24v24H0V0z",fill:"none"}),(0,a.createElement)(m.Path,{d:"M14 2H6c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8l-6-6zM6 20V4h7v5h5v11H6z"}))}),e},P=(0,a.createElement)(a.Fragment,null,(0,a.createElement)(m.ToggleControl,{label:(0,g.__)("Open in new tab"),onChange:e=>{const t=(e=>{const t=e?"_blank":void 0;let n;if(t){const e=(null!=d?d:"").split(" ");SC.forEach((t=>{e.includes(t)||e.push(t)})),n=e.join(" ")}else{const e=(null!=d?d:"").split(" ").filter((e=>!1===SC.includes(e)));n=e.length?e.join(" "):void 0}return{linkTarget:t,rel:n}})(e);n(t)},checked:"_blank"===s}),(0,a.createElement)(m.TextControl,{label:(0,g.__)("Link Rel"),value:null!=d?d:"",onChange:e=>{n({rel:e})}}),(0,a.createElement)(m.TextControl,{label:(0,g.__)("Link CSS Class"),value:c||"",onChange:e=>{n({linkClass:e})}})),M=null!==y?y:o,L=((0,u.find)(N(),["linkDestination",t])||{}).title;return(0,a.createElement)(a.Fragment,null,(0,a.createElement)(m.ToolbarButton,{icon:er,className:"components-toolbar__control",label:o?(0,g.__)("Edit link"):(0,g.__)("Insert link"),"aria-expanded":p,onClick:b,ref:v}),p&&(0,a.createElement)(wE,{anchor:h,onFocusOutside:I(),onClose:B,renderSettings:()=>P,additionalControls:!M&&(0,a.createElement)(m.NavigableMenu,null,(0,u.map)(N(),(e=>(0,a.createElement)(m.MenuItem,{key:e.linkDestination,icon:e.icon,onClick:()=>{E(null),(e=>{const t=N();let o;o=e?((0,u.find)(t,(t=>t.url===e))||{linkDestination:EC}).linkDestination:yC,n({linkDestination:o,href:e})})(e.url),S()}},e.title))))},(!o||_)&&(0,a.createElement)(wE.LinkEditor,{className:"block-editor-format-toolbar__link-container-content",value:M,onChangeInputValue:E,onSubmit:x(),autocompleteRef:C}),o&&!_&&(0,a.createElement)(a.Fragment,null,(0,a.createElement)(wE.LinkViewer,{className:"block-editor-format-toolbar__link-container-content",url:o,onEditLinkClick:w,urlLabel:L}),(0,a.createElement)(m.Button,{icon:kC,label:(0,g.__)("Remove link"),onClick:T}))))};function xC(e){let{children:t,className:n,isEnabled:o=!0,deviceType:r,setDeviceType:l}=e;if((0,d.useViewportMatch)("small","<"))return null;const i={className:c()(n,"block-editor-post-preview__dropdown-content"),position:"bottom left"},s={variant:"tertiary",className:"block-editor-post-preview__button-toggle",disabled:!o,children:(0,g.__)("View")},u={"aria-label":(0,g.__)("View options")};return(0,a.createElement)(m.DropdownMenu,{className:"block-editor-post-preview__dropdown",popoverProps:i,toggleProps:s,menuProps:u,icon:null},(()=>(0,a.createElement)(a.Fragment,null,(0,a.createElement)(m.MenuGroup,null,(0,a.createElement)(m.MenuItem,{className:"block-editor-post-preview__button-resize",onClick:()=>l("Desktop"),icon:"Desktop"===r&&xf},(0,g.__)("Desktop")),(0,a.createElement)(m.MenuItem,{className:"block-editor-post-preview__button-resize",onClick:()=>l("Tablet"),icon:"Tablet"===r&&xf},(0,g.__)("Tablet")),(0,a.createElement)(m.MenuItem,{className:"block-editor-post-preview__button-resize",onClick:()=>l("Mobile"),icon:"Mobile"===r&&xf},(0,g.__)("Mobile"))),t)))}function TC(e){const[t,n]=(0,a.useState)(window.innerWidth);(0,a.useEffect)((()=>{if("Desktop"===e)return;const t=()=>n(window.innerWidth);return window.addEventListener("resize",t),()=>{window.removeEventListener("resize",t)}}),[e]);const o=e=>{let n;switch(e){case"Tablet":n=780;break;case"Mobile":n=360;break;default:return null}return n<t?n:t};return(e=>{const t="Mobile"===e?"768px":"1024px";switch(e){case"Tablet":case"Mobile":return{width:o(e),margin:(window.innerHeight<800?36:72)+"px auto",height:t,borderRadius:"2px 2px 2px 2px",border:"1px solid #ddd",overflowY:"auto"};default:return null}})(e)}var NC=(0,p.withSelect)((e=>({selectedBlockClientId:e(so).getBlockSelectionStart()})))((e=>{let{selectedBlockClientId:t}=e;const n=Mo(t);return t?(0,a.createElement)(m.Button,{variant:"secondary",className:"block-editor-skip-to-selected-block",onClick:()=>{n.current.focus()}},(0,g.__)("Skip to the selected block")):null})),PC=window.wp.wordcount;var MC=(0,p.withSelect)((e=>{const{getMultiSelectedBlocks:t}=e(so);return{blocks:t()}}))((function(e){let{blocks:t}=e;const n=(0,PC.count)((0,r.serialize)(t),"words");return(0,a.createElement)("div",{className:"block-editor-multi-selection-inspector__card"},(0,a.createElement)(Du,{icon:Cf,showColors:!0}),(0,a.createElement)("div",{className:"block-editor-multi-selection-inspector__card-content"},(0,a.createElement)("div",{className:"block-editor-multi-selection-inspector__card-title"},(0,g.sprintf)((0,g._n)("%d block","%d blocks",t.length),t.length)),(0,a.createElement)("div",{className:"block-editor-multi-selection-inspector__card-description"},(0,g.sprintf)((0,g._n)("%d word","%d words",n),n))))}));function LC(e){let{blockName:t}=e;const{preferredStyle:n,onUpdatePreferredStyleVariations:o,styles:l}=(0,p.useSelect)((e=>{var n,o;const l=e(so).getSettings().__experimentalPreferredStyleVariations;return{preferredStyle:null==l||null===(n=l.value)||void 0===n?void 0:n[t],onUpdatePreferredStyleVariations:null!==(o=null==l?void 0:l.onChange)&&void 0!==o?o:null,styles:e(r.store).getBlockStyles(t)}}),[t]),i=(0,a.useMemo)((()=>[{label:(0,g.__)("Not set"),value:""},...l.map((e=>{let{label:t,name:n}=e;return{label:t,value:n}}))]),[l]),s=(0,a.useMemo)((()=>{var e;return null===(e=Mf(l))||void 0===e?void 0:e.name}),[l]),c=(0,a.useCallback)((e=>{o(t,e)}),[t,o]);return n&&n!==s?o&&(0,a.createElement)("div",{className:"default-style-picker__default-switcher"},(0,a.createElement)(m.SelectControl,{options:i,value:n||"",label:(0,g.__)("Default Style"),onChange:c})):null}function RC(e,t){const n=(0,a.useMemo)((()=>e.reduce(((e,t)=>(Object.entries(t.attributes).some((e=>{let[,{__experimentalRole:t}]=e;return"content"===t}))&&(e[t.name]=!0),e)),{})),[e]),o=(0,a.useCallback)((e=>!!n[e]),[e]);return(0,a.useMemo)((()=>AC([t],o)),[t,o])}function AC(e,t){const n=[];for(const o of e)t(o.name)&&n.push(o),n.push(...AC(o.innerBlocks,t));return n}function DC(e){let{blockTypes:t,block:n,selectedBlock:o}=e;const{selectBlock:r}=(0,p.useDispatch)(so),l=t.find((e=>{let{name:t}=e;return t===n.name})),i=o&&o.clientId===n.clientId;return(0,a.createElement)(m.Button,{isPressed:i,onClick:()=>r(n.clientId)},(0,a.createElement)(m.__experimentalHStack,{justify:"flex-start"},(0,a.createElement)(Du,{icon:l.icon}),(0,a.createElement)(m.FlexItem,null,l.title)))}function OC(e){let{topLevelLockedBlock:t}=e;const{blockTypes:n,block:o,selectedBlock:l}=(0,p.useSelect)((e=>({blockTypes:e(r.store).getBlockTypes(),block:e(so).getBlock(t),selectedBlock:e(so).getSelectedBlock()})),[t]),i=Ym(t),s=RC(n,o);return(0,a.createElement)("div",{className:"block-editor-block-inspector"},(0,a.createElement)(Ou,i),(0,a.createElement)(Tk,{blockClientId:t}),(0,a.createElement)(m.__experimentalVStack,{spacing:1,padding:4,className:"block-editor-block-inspector__block-buttons-container"},(0,a.createElement)("h2",{className:"block-editor-block-card__title"},(0,g.__)("Content")),s.map((e=>(0,a.createElement)(DC,{selectedBlock:l,key:e.clientId,block:e,blockTypes:n})))))}const zC=e=>{let{clientId:t,blockName:n}=e;const o=(0,p.useSelect)((e=>{const{getBlockStyles:t}=e(r.store),o=t(n);return o&&o.length>0}),[n]),l=Ym(t);return(0,a.createElement)("div",{className:"block-editor-block-inspector"},(0,a.createElement)(Ou,l),(0,a.createElement)(Tk,{blockClientId:t}),o&&(0,a.createElement)("div",null,(0,a.createElement)(m.PanelBody,{title:(0,g.__)("Styles")},(0,a.createElement)(mk,{scope:"core/block-inspector",clientId:t}),(0,r.hasBlockSupport)(n,"defaultStylePicker",!0)&&(0,a.createElement)(LC,{blockName:n}))),(0,a.createElement)(hr.Slot,null),(0,a.createElement)(hr.Slot,{__experimentalGroup:"color",label:(0,g.__)("Color"),className:"color-block-support-panel__inner-wrapper"}),(0,a.createElement)(hr.Slot,{__experimentalGroup:"typography",label:(0,g.__)("Typography")}),(0,a.createElement)(hr.Slot,{__experimentalGroup:"dimensions",label:(0,g.__)("Dimensions")}),(0,a.createElement)(hr.Slot,{__experimentalGroup:"border",label:(0,g.__)("Border")}),(0,a.createElement)("div",null,(0,a.createElement)(FC,null)),(0,a.createElement)(NC,{key:"back"}))},FC=()=>{const e=(0,m.__experimentalUseSlot)(gr.slotName);return Boolean(e.fills&&e.fills.length)?(0,a.createElement)(m.PanelBody,{className:"block-editor-block-inspector__advanced",title:(0,g.__)("Advanced"),initialOpen:!1},(0,a.createElement)(hr.Slot,{__experimentalGroup:"advanced"})):null};var VC=e=>{let{showNoBlockSelectedMessage:t=!0}=e;const{count:n,selectedBlockName:o,selectedBlockClientId:l,blockType:i,topLevelLockedBlock:s}=(0,p.useSelect)((e=>{const{getSelectedBlockClientId:t,getSelectedBlockCount:n,getBlockName:o,__unstableGetContentLockingParent:l,getTemplateLock:i}=e(so),a=t(),s=a&&o(a),c=s&&(0,r.getBlockType)(s);return{count:n(),selectedBlockClientId:a,selectedBlockName:s,blockType:c,topLevelLockedBlock:"contentOnly"===i(a)?a:l(a)}}),[]);if(n>1)return(0,a.createElement)("div",{className:"block-editor-block-inspector"},(0,a.createElement)(MC,null),(0,a.createElement)(hr.Slot,null),(0,a.createElement)(hr.Slot,{__experimentalGroup:"color",label:(0,g.__)("Color"),className:"color-block-support-panel__inner-wrapper"}),(0,a.createElement)(hr.Slot,{__experimentalGroup:"typography",label:(0,g.__)("Typography")}),(0,a.createElement)(hr.Slot,{__experimentalGroup:"dimensions",label:(0,g.__)("Dimensions")}),(0,a.createElement)(hr.Slot,{__experimentalGroup:"border",label:(0,g.__)("Border")}));const c=o===(0,r.getUnregisteredTypeHandlerName)();return i&&l&&!c?s?(0,a.createElement)(OC,{topLevelLockedBlock:s}):(0,a.createElement)(zC,{clientId:l,blockName:i.name}):t?(0,a.createElement)("span",{className:"block-editor-block-inspector__no-blocks"},(0,g.__)("No block selected.")):null};var HC=function(e){let{__unstableContentRef:t}=e;const[n,o]=(0,a.useState)(!1),r=(0,p.useSelect)((e=>e(so).getBlockOrder()),[]);return(0,a.useEffect)((()=>{const e=setTimeout((()=>{o(!0)}),500);return()=>{clearTimeout(e)}}),[]),n?r.map(((e,n)=>n===r.length-1?null:(0,a.createElement)(Gm,{key:e,previousClientId:e,nextClientId:r[n+1],__unstableContentRef:t},(0,a.createElement)("div",{className:"block-editor-block-list__insertion-point-inserter is-with-inserter"},(0,a.createElement)(Am,{position:"bottom center",clientId:r[n+1],__experimentalIsQuick:!0}))))):null};function GC(e){let{children:t,__unstableContentRef:n,...o}=e;const r=(0,d.useViewportMatch)("medium"),{hasFixedToolbar:l,isZoomOutMode:s}=(0,p.useSelect)((e=>{const{__unstableGetEditorMode:t,getSettings:n}=e(so);return{isZoomOutMode:"zoom-out"===t(),hasFixedToolbar:n().hasFixedToolbar}}),[]),c=(0,Yu.__unstableUseShortcutEventMatch)(),{getSelectedBlockClientIds:u,getBlockRootClientId:f}=(0,p.useSelect)(so),{duplicateBlocks:g,removeBlocks:h,insertAfterBlock:v,insertBeforeBlock:b,clearSelectedBlock:_,moveBlocksUp:k,moveBlocksDown:y}=(0,p.useDispatch)(so);const E=_r(n),C=_r(n);return(0,a.createElement)("div",i({},o,{onKeyDown:function(e){if(!e.defaultPrevented)if(c("core/block-editor/move-up",e)){const t=u();if(t.length){e.preventDefault();const n=f(t[0]);k(t,n)}}else if(c("core/block-editor/move-down",e)){const t=u();if(t.length){e.preventDefault();const n=f(t[0]);y(t,n)}}else if(c("core/block-editor/duplicate",e)){const t=u();t.length&&(e.preventDefault(),g(t))}else if(c("core/block-editor/remove",e)){const t=u();t.length&&(e.preventDefault(),h(t))}else if(c("core/block-editor/insert-after",e)){const t=u();t.length&&(e.preventDefault(),v(t[t.length-1]))}else if(c("core/block-editor/insert-before",e)){const t=u();t.length&&(e.preventDefault(),b(t[0]))}else if(c("core/block-editor/unselect",e)){u().length&&(e.preventDefault(),_(),e.target.ownerDocument.defaultView.getSelection().removeAllRanges(),null==n||n.current.focus())}}}),(0,a.createElement)(Um.Provider,{value:(0,a.useRef)(!1)},!s&&(0,a.createElement)(jm,{__unstableContentRef:n}),!s&&(l||!r)&&(0,a.createElement)(Rg,{isFixed:!0}),(0,a.createElement)(Hg,{__unstableContentRef:n}),(0,a.createElement)(m.Popover.Slot,{name:"block-toolbar",ref:E}),t,(0,a.createElement)(m.Popover.Slot,{name:"__unstable-block-tools-after",ref:C}),s&&(0,a.createElement)(HC,{__unstableContentRef:n})))}const UC=()=>{};var WC=(0,a.forwardRef)((function(e,t){let{rootClientId:n,clientId:o,isAppender:r,showInserterHelpPanel:l,showMostUsedBlocks:i=!1,__experimentalInsertionIndex:s,__experimentalFilterValue:c,onSelect:u=UC,shouldFocusBlock:d=!1}=e;const{destinationRootClientId:m,prioritizePatterns:f}=(0,p.useSelect)((e=>{const{getBlockRootClientId:t,getSettings:r}=e(so);return{destinationRootClientId:n||t(o)||void 0,prioritizePatterns:r().__experimentalPreferPatternsOnRoot}}),[o,n]);return(0,a.createElement)(Pm,{onSelect:u,rootClientId:m,clientId:o,isAppender:r,showInserterHelpPanel:l,showMostUsedBlocks:i,__experimentalInsertionIndex:s,__experimentalFilterValue:c,shouldFocusBlock:d,prioritizePatterns:f,ref:t})}));function jC(){return null}jC.Register=function(){const{registerShortcut:e}=(0,p.useDispatch)(Yu.store);return(0,a.useEffect)((()=>{e({name:"core/block-editor/duplicate",category:"block",description:(0,g.__)("Duplicate the selected block(s)."),keyCombination:{modifier:"primaryShift",character:"d"}}),e({name:"core/block-editor/remove",category:"block",description:(0,g.__)("Remove the selected block(s)."),keyCombination:{modifier:"access",character:"z"}}),e({name:"core/block-editor/insert-before",category:"block",description:(0,g.__)("Insert a new block before the selected block(s)."),keyCombination:{modifier:"primaryAlt",character:"t"}}),e({name:"core/block-editor/insert-after",category:"block",description:(0,g.__)("Insert a new block after the selected block(s)."),keyCombination:{modifier:"primaryAlt",character:"y"}}),e({name:"core/block-editor/delete-multi-selection",category:"block",description:(0,g.__)("Delete selection."),keyCombination:{character:"del"},aliases:[{character:"backspace"}]}),e({name:"core/block-editor/select-all",category:"selection",description:(0,g.__)("Select all text when typing. Press again to select all blocks."),keyCombination:{modifier:"primary",character:"a"}}),e({name:"core/block-editor/unselect",category:"selection",description:(0,g.__)("Clear selection."),keyCombination:{character:"escape"}}),e({name:"core/block-editor/focus-toolbar",category:"global",description:(0,g.__)("Navigate to the nearest toolbar."),keyCombination:{modifier:"alt",character:"F10"}}),e({name:"core/block-editor/move-up",category:"block",description:(0,g.__)("Move the selected block(s) up."),keyCombination:{modifier:"secondary",character:"t"}}),e({name:"core/block-editor/move-down",category:"block",description:(0,g.__)("Move the selected block(s) down."),keyCombination:{modifier:"secondary",character:"y"}})}),[e]),null};var $C=jC;function KC(){return V()("wp.blockEditor.MultiSelectScrollIntoView",{hint:"This behaviour is now built-in.",since:"5.8"}),null}const qC=new Set([ku.UP,ku.RIGHT,ku.DOWN,ku.LEFT,ku.ENTER,ku.BACKSPACE]);function YC(){const e=(0,p.useSelect)((e=>e(so).isTyping()),[]),{stopTyping:t}=(0,p.useDispatch)(so);return(0,d.useRefEffect)((n=>{if(!e)return;const{ownerDocument:o}=n;let r,l;function i(e){const{clientX:n,clientY:o}=e;r&&l&&(r!==n||l!==o)&&t(),r=n,l=o}return o.addEventListener("mousemove",i),()=>{o.removeEventListener("mousemove",i)}}),[e,t])}function ZC(){const{isTyping:e,hasInlineToolbar:t}=(0,p.useSelect)((e=>{const{isTyping:t,getSettings:n}=e(so);return{isTyping:t(),hasInlineToolbar:n().hasInlineToolbar}}),[]),{startTyping:n,stopTyping:o}=(0,p.useDispatch)(so),r=YC(),l=(0,d.useRefEffect)((r=>{const{ownerDocument:l}=r,{defaultView:i}=l,a=i.getSelection();if(e){let c;function u(e){const{target:t}=e;c=i.setTimeout((()=>{(0,Wl.isTextField)(t)||o()}))}function d(e){const{keyCode:t}=e;t!==ku.ESCAPE&&t!==ku.TAB||o()}function p(){a.isCollapsed||o()}return r.addEventListener("focus",u),r.addEventListener("keydown",d),t||l.addEventListener("selectionchange",p),()=>{i.clearTimeout(c),r.removeEventListener("focus",u),r.removeEventListener("keydown",d),l.removeEventListener("selectionchange",p)}}function s(e){const{type:t,target:o}=e;(0,Wl.isTextField)(o)&&r.contains(o)&&("keydown"!==t||function(e){const{keyCode:t,shiftKey:n}=e;return!n&&qC.has(t)}(e))&&n()}return r.addEventListener("keypress",s),r.addEventListener("keydown",s),()=>{r.removeEventListener("keypress",s),r.removeEventListener("keydown",s)}}),[e,t,n,o]);return(0,d.useMergeRefs)([r,l])}var QC=function(e){let{children:t}=e;return(0,a.createElement)("div",{ref:ZC()},t)};const XC=-1!==window.navigator.userAgent.indexOf("Trident"),JC=new Set([ku.UP,ku.DOWN,ku.LEFT,ku.RIGHT]);function ew(){const e=(0,p.useSelect)((e=>e(so).hasSelectedBlock()),[]);return(0,d.useRefEffect)((t=>{if(!e)return;const{ownerDocument:n}=t,{defaultView:o}=n;let r,l,i;function a(){r||(r=o.requestAnimationFrame((()=>{p(),r=null})))}function s(e){l&&o.cancelAnimationFrame(l),l=o.requestAnimationFrame((()=>{c(e),l=null}))}function c(e){let{keyCode:r}=e;if(!m())return;const l=(0,Wl.computeCaretRect)(o);if(!l)return;if(!i)return void(i=l);if(JC.has(r))return void(i=l);const a=l.top-i.top;if(0===a)return;const s=(0,Wl.getScrollContainer)(t);if(!s)return;const c=s===n.body,u=c?o.scrollY:s.scrollTop,d=c?0:s.getBoundingClientRect().top,p=c?i.top/o.innerHeight:(i.top-d)/(o.innerHeight-d);if(0===u&&p<.75&&function(){const e=t.querySelectorAll('[contenteditable="true"]');return e[e.length-1]===n.activeElement}())return void(i=l);const f=c?o.innerHeight:s.clientHeight;i.top+i.height>d+f||i.top<d?i=l:c?o.scrollBy(0,a):s.scrollTop+=a}function u(){n.addEventListener("selectionchange",d)}function d(){n.removeEventListener("selectionchange",d),p()}function p(){m()&&(i=(0,Wl.computeCaretRect)(o))}function m(){return t.contains(n.activeElement)&&n.activeElement.isContentEditable}return o.addEventListener("scroll",a,!0),o.addEventListener("resize",a,!0),t.addEventListener("keydown",s),t.addEventListener("keyup",c),t.addEventListener("mousedown",u),t.addEventListener("touchstart",u),()=>{o.removeEventListener("scroll",a,!0),o.removeEventListener("resize",a,!0),t.removeEventListener("keydown",s),t.removeEventListener("keyup",c),t.removeEventListener("mousedown",u),t.removeEventListener("touchstart",u),n.removeEventListener("selectionchange",d),o.cancelAnimationFrame(r),o.cancelAnimationFrame(l)}}),[e])}var tw=XC?e=>e.children:function(e){let{children:t}=e;return(0,a.createElement)("div",{ref:ew(),className:"block-editor__typewriter"},t)};const nw=(0,a.createContext)({});function ow(e){let{children:t,uniqueId:n,blockName:o=""}=e;const r=(0,a.useContext)(nw),{name:l}=mo();o=o||l;const i=(0,a.useMemo)((()=>function(e,t,n){const o={...e,[t]:e[t]?new Set(e[t]):new Set};return o[t].add(n),o}(r,o,n)),[r,o,n]);return(0,a.createElement)(nw.Provider,{value:i},t)}function rw(e){var t;let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const o=(0,a.useContext)(nw),{name:r}=mo();return n=n||r,Boolean(null===(t=o[n])||void 0===t?void 0:t.has(e))}var lw=(0,a.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(D.Path,{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"}));function iw(e){let{title:t,help:n,actions:o=[],onClose:r}=e;return(0,a.createElement)(m.__experimentalVStack,{className:"block-editor-inspector-popover-header",spacing:4},(0,a.createElement)(m.__experimentalHStack,{alignment:"center"},(0,a.createElement)(m.__experimentalHeading,{className:"block-editor-inspector-popover-header__heading",level:2,size:13},t),(0,a.createElement)(m.__experimentalSpacer,null),o.map((e=>{let{label:t,icon:n,onClick:o}=e;return(0,a.createElement)(m.Button,{key:t,className:"block-editor-inspector-popover-header__action",label:t,icon:n,variant:!n&&"tertiary",onClick:o},!n&&t)})),r&&(0,a.createElement)(m.Button,{className:"block-editor-inspector-popover-header__action",label:(0,g.__)("Close"),icon:lw,onClick:r})),n&&(0,a.createElement)(m.__experimentalText,null,n))}var aw=(0,a.forwardRef)((function(e,t){let{onClose:n,onChange:o,...r}=e;return(0,a.createElement)("div",{ref:t,className:"block-editor-publish-date-time-picker"},(0,a.createElement)(iw,{title:(0,g.__)("Publish"),actions:[{label:(0,g.__)("Now"),onClick:()=>null==o?void 0:o(null)}],onClose:n}),(0,a.createElement)(m.DateTimePicker,i({startOfWeek:(0,Lk.getSettings)().l10n.startOfWeek,__nextRemoveHelpButton:!0,__nextRemoveResetButton:!0,onChange:o},r)))}));const sw={button:"wp-element-button",caption:"wp-element-caption"},cw=e=>sw[e]?sw[e]:"";function uw(e,t){return Object.entries(t).every((t=>{let[n,o]=t;return"object"==typeof o&&"object"==typeof e[n]?uw(e[n],o):e[n]===o}))}const dw=(e,t)=>{if(!t||!e)return;const n=t.filter((t=>{let{attributes:n}=t;return!(!n||!Object.keys(n).length)&&uw(e,n)}));return 1===n.length?n[0]:void 0};function pw(e){const t=null==e?void 0:e.trim().match(/^(0?[-.]?\d*\.?\d+)(r?e[m|x]|v[h|w|min|max]+|p[x|t|c]|[c|m]m|%|in|ch|Q|lh)$/);return isNaN(e)||isNaN(parseFloat(e))?t?{value:parseFloat(t[1])||t[1],unit:t[2]}:{value:e,unit:void 0}:{value:parseFloat(e),unit:"px"}}function mw(e,t){const n=e.split(/[(),]/g).filter(Boolean),o=n.slice(1).map((e=>pw(bw(e,t)).value)).filter(Boolean);switch(n[0]){case"min":return Math.min(...o)+"px";case"max":return Math.max(...o)+"px";case"clamp":return 3!==o.length?null:o[1]<o[0]?o[0]+"px":o[1]>o[2]?o[2]+"px":o[1]+"px";case"calc":return o[0]+"px"}}function fw(e){for(;;){const t=e,n=/(max|min|calc|clamp)\(([^()]*)\)/g.exec(e)||[];if(n[0]){const t=mw(n[0]);e=e.replace(n[0],t)}if(e===t||parseFloat(e))break}return pw(e)}function gw(e){for(let t=0;t<e.length;t++)if(["+","-","/","*"].includes(e[t]))return!0;return!1}function hw(e){let t=!1;const n=e.split(/[+-/*/]/g).filter(Boolean);for(const o of n){const n=pw(bw(o));if(!parseFloat(n.value)){t=!0;break}e=e.replace(o,n.value)}return t?null:(o=e,Function(`'use strict'; return (${o})`)()).toFixed(0)+"px";var o}function vw(e,t){const n=96,o=.01,r=Object.assign({},{fontSize:16,lineHeight:16,width:375,height:812,type:"font"},t),l={em:r.fontSize,rem:r.fontSize,vh:r.height*o,vw:r.width*o,vmin:(r.width<r.height?r.width:r.height)*o,vmax:(r.width>r.height?r.width:r.height)*o,"%":("font"===r.type?r.fontSize:r.width)*o,ch:8,ex:7.15625,lh:r.lineHeight},i={in:n,cm:37.79527559055118,mm:3.7795275590551185,pt:1.3333333333333333,pc:16,px:1,Q:.9448818897637794};return l[e.unit]?(l[e.unit]*e.value).toFixed(0)+"px":i[e.unit]?(i[e.unit]*e.value).toFixed(0)+"px":null}function bw(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(Number.isFinite(e))return e.toFixed(0)+"px";if(void 0===e)return null;let n=pw(e);return n.unit||(n=fw(e)),gw(e)&&!n.unit?hw(e):vw(n,t)}const _w={};function kw(e){let t="";return e.hasOwnProperty("fontSize")&&(t=":"+e.width),e.hasOwnProperty("lineHeight")&&(t=":"+e.lineHeight),e.hasOwnProperty("width")&&(t=":"+e.width),e.hasOwnProperty("height")&&(t=":"+e.height),e.hasOwnProperty("type")&&(t=":"+e.type),t}var yw=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=e+kw(t);return _w[n]||(_w[n]=bw(e,t)),_w[n]}}(),(window.wp=window.wp||{}).blockEditor=o}();