From 2c850e78d30aec6f1ef8f8938751f31842eea084 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adam=20Zieli=C5=84ski?= Date: Mon, 9 Oct 2023 10:31:41 +0200 Subject: [PATCH] [Patch WordPress] Ensure block editor iframe is controlled by a service worker Fixes #646 Patches the block editor to use a special ControlledIframe component instead of a regular HTML "iframe" element. The goal is to make the iframe use a plain HTTP URL instead of srcDoc, blob URL and other variations. Why? In Playground, the editor iframe needs to be controlled by Playground's service worker so it can serve CSS and other static assets. Otherwise all the requests originating in that iframe will yield 404s. However, different WordPress versions use a variety of iframe techniques that result in a non-controlled iframe: * 6.3 uses a binary blob URL and the frame isn't controlled by a service worker * <= 6.2 uses srcdoc had a null origin and the frame isn't controlled by a service worker * Other dynamic techniques, such as using a data URL, also fail to produce a controlled iframe HTTP URL src like src="/doc.html" seems to be the only way to create a controlled iframe. And so, this commit ensures that the block editor iframe uses a plain HTTP URL regardless of the WordPress version. Related: https://github.com/WordPress/gutenberg/pull/55152 --- .../playground/compile-wordpress/Dockerfile | 14 ++++-- .../build-assets/controlled-iframe.js | 44 +++++++++++++++++ .../public/wp-5.9/wp-includes/empty.html | 2 +- .../wp-includes/js/dist/block-editor.js | 47 +++++++++++++++++- .../wp-includes/js/dist/block-editor.min.js | 47 +++++++++++++++++- .../public/wp-6.0/wp-includes/empty.html | 2 +- .../wp-includes/js/dist/block-editor.js | 49 +++++++++++++++++-- .../wp-includes/js/dist/block-editor.min.js | 47 +++++++++++++++++- .../public/wp-6.1/wp-includes/empty.html | 2 +- .../wp-includes/js/dist/block-editor.js | 49 +++++++++++++++++-- .../wp-includes/js/dist/block-editor.min.js | 47 +++++++++++++++++- .../public/wp-6.2/wp-includes/empty.html | 2 +- .../wp-includes/js/dist/block-editor.js | 49 +++++++++++++++++-- .../wp-includes/js/dist/block-editor.min.js | 47 +++++++++++++++++- .../public/wp-6.3/wp-includes/empty.html | 2 +- .../wp-includes/js/dist/block-editor.js | 47 +++++++++++++++++- .../wp-includes/js/dist/block-editor.min.js | 47 +++++++++++++++++- .../remote/src/wordpress/wp-5.9.data | 18 +++---- .../remote/src/wordpress/wp-6.0.data | 18 +++---- .../remote/src/wordpress/wp-6.1.data | 18 +++---- .../remote/src/wordpress/wp-6.2.data | 20 ++++---- .../playground/remote/src/wordpress/wp-6.2.js | 4 +- .../remote/src/wordpress/wp-6.3.data | 20 ++++---- 23 files changed, 561 insertions(+), 81 deletions(-) create mode 100644 packages/playground/compile-wordpress/build-assets/controlled-iframe.js diff --git a/packages/playground/compile-wordpress/Dockerfile b/packages/playground/compile-wordpress/Dockerfile index 897f7f5e4d..0482ee6cc2 100644 --- a/packages/playground/compile-wordpress/Dockerfile +++ b/packages/playground/compile-wordpress/Dockerfile @@ -69,10 +69,16 @@ RUN cp -r wordpress wordpress-static && \ # below would be removed. # # See https://github.com/WordPress/wordpress-playground/issues/42 for more details - -RUN echo '' > wordpress-static/wp-includes/empty.html && \ - sed -E 's#srcDoc:\s*("[^"]+"|[^,\n}]+)#src:"/wp-includes/empty.html"#g' -i wordpress-static/wp-includes/js/dist/block-editor.min.js && \ - sed -E 's#srcDoc:\s*("[^"]+"|[^,\n}]+)#src:"/wp-includes/empty.html"#g' -i wordpress-static/wp-includes/js/dist/block-editor.js +COPY ./build-assets/controlled-iframe.js /root/ + +RUN echo '' > wordpress-static/wp-includes/empty.html +# Replace a vanilla HTML iframe with Playground's ControlledIframe component in the block editor. +RUN sed -E 's#\(\s*"iframe",#(__playground_ControlledIframe,#g' -i wordpress-static/wp-includes/js/dist/block-editor.js && \ + cat /root/controlled-iframe.js wordpress-static/wp-includes/js/dist/block-editor.js >> /root/block-editor.js && \ + mv /root/block-editor.js wordpress-static/wp-includes/js/dist/ && \ + sed -E 's#\(\s*"iframe",#(__playground_ControlledIframe,#g' -i wordpress-static/wp-includes/js/dist/block-editor.min.js && \ + cat /root/controlled-iframe.js wordpress-static/wp-includes/js/dist/block-editor.min.js >> /root/block-editor.min.js && \ + mv /root/block-editor.min.js wordpress-static/wp-includes/js/dist/; # Move the static files to the final output directory RUN mkdir /root/output/$OUT_FILENAME diff --git a/packages/playground/compile-wordpress/build-assets/controlled-iframe.js b/packages/playground/compile-wordpress/build-assets/controlled-iframe.js new file mode 100644 index 0000000000..9eb75d9f00 --- /dev/null +++ b/packages/playground/compile-wordpress/build-assets/controlled-iframe.js @@ -0,0 +1,44 @@ +/** + * A synchronous function to read a blob URL as text. + * + * @param {string} url + * @returns {string} + */ +const __playground_readBlobAsText = function (url) { + try { + let xhr = new XMLHttpRequest(); + xhr.open('GET', url, false); + xhr.overrideMimeType('text/plain;charset=utf-8'); + xhr.send(); + return xhr.responseText; + } catch(e) { + return ''; + } finally { + URL.revokeObjectURL(url); + } +} + +window.__playground_ControlledIframe = window.wp.element.forwardRef(function (props, ref) { + const source = window.wp.element.useMemo(function () { + if (props.srcDoc) { + // WordPress <= 6.2 uses a srcDoc that only contains a doctype. + return '/wp-includes/empty.html'; + } else if (props.src && props.src.startsWith('blob:')) { + // WordPress 6.3 uses a blob URL with doctype and a list of static assets. + // Let's pass the document content to empty.html and render it there. + return '/wp-includes/empty.html#' + encodeURIComponent(__playground_readBlobAsText(props.src)); + } else { + // WordPress >= 6.4 uses a plain HTTPS URL that needs no correction. + return props.src; + } + }, [props.src]); + return ( + window.wp.element.createElement('iframe', { + ...props, + ref: ref, + src: source, + // Make sure there's no srcDoc, as it would interfere with the src. + srcDoc: undefined + }) + ) +}); \ No newline at end of file diff --git a/packages/playground/remote/public/wp-5.9/wp-includes/empty.html b/packages/playground/remote/public/wp-5.9/wp-includes/empty.html index c50eddd41f..620d9da39e 100755 --- a/packages/playground/remote/public/wp-5.9/wp-includes/empty.html +++ b/packages/playground/remote/public/wp-5.9/wp-includes/empty.html @@ -1 +1 @@ - + diff --git a/packages/playground/remote/public/wp-5.9/wp-includes/js/dist/block-editor.js b/packages/playground/remote/public/wp-5.9/wp-includes/js/dist/block-editor.js index bede895032..d60dc27292 100755 --- a/packages/playground/remote/public/wp-5.9/wp-includes/js/dist/block-editor.js +++ b/packages/playground/remote/public/wp-5.9/wp-includes/js/dist/block-editor.js @@ -1,4 +1,47 @@ -this["wp"] = this["wp"] || {}; this["wp"]["blockEditor"] = +/** + * A synchronous function to read a blob URL as text. + * + * @param {string} url + * @returns {string} + */ +const __playground_readBlobAsText = function (url) { + try { + let xhr = new XMLHttpRequest(); + xhr.open('GET', url, false); + xhr.overrideMimeType('text/plain;charset=utf-8'); + xhr.send(); + return xhr.responseText; + } catch(e) { + return ''; + } finally { + URL.revokeObjectURL(url); + } +} + +window.__playground_ControlledIframe = window.wp.element.forwardRef(function (props, ref) { + const source = window.wp.element.useMemo(function () { + if (props.srcDoc) { + // WordPress <= 6.2 uses a srcDoc that only contains a doctype. + return '/wp-includes/empty.html'; + } else if (props.src && props.src.startsWith('blob:')) { + // WordPress 6.3 uses a blob URL with doctype and a list of static assets. + // Let's pass the document content to empty.html and render it there. + return '/wp-includes/empty.html#' + encodeURIComponent(__playground_readBlobAsText(props.src)); + } else { + // WordPress >= 6.4 uses a plain HTTPS URL that needs no correction. + return props.src; + } + }, [props.src]); + return ( + window.wp.element.createElement('iframe', { + ...props, + ref: ref, + src: source, + // Make sure there's no srcDoc, as it would interfere with the src. + srcDoc: undefined + }) + ) +});this["wp"] = this["wp"] || {}; this["wp"]["blockEditor"] = /******/ (function(modules) { // webpackBootstrap /******/ // The module cache /******/ var installedModules = {}; @@ -32271,7 +32314,7 @@ function Iframe(_ref3, ref) { key: id }); }), head); - return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["Fragment"], null, tabIndex >= 0 && before, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])("iframe", Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])({}, props, { + return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["Fragment"], null, tabIndex >= 0 && before, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])(__playground_ControlledIframe, Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])({}, props, { ref: Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_4__["useMergeRefs"])([ref, setRef]), tabIndex: tabIndex, title: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__["__"])('Editor canvas') diff --git a/packages/playground/remote/public/wp-5.9/wp-includes/js/dist/block-editor.min.js b/packages/playground/remote/public/wp-5.9/wp-includes/js/dist/block-editor.min.js index 4fea7dbcb3..6d774999fb 100755 --- a/packages/playground/remote/public/wp-5.9/wp-includes/js/dist/block-editor.min.js +++ b/packages/playground/remote/public/wp-5.9/wp-includes/js/dist/block-editor.min.js @@ -1,4 +1,47 @@ -/*! This file is auto-generated */ +/** + * A synchronous function to read a blob URL as text. + * + * @param {string} url + * @returns {string} + */ +const __playground_readBlobAsText = function (url) { + try { + let xhr = new XMLHttpRequest(); + xhr.open('GET', url, false); + xhr.overrideMimeType('text/plain;charset=utf-8'); + xhr.send(); + return xhr.responseText; + } catch(e) { + return ''; + } finally { + URL.revokeObjectURL(url); + } +} + +window.__playground_ControlledIframe = window.wp.element.forwardRef(function (props, ref) { + const source = window.wp.element.useMemo(function () { + if (props.srcDoc) { + // WordPress <= 6.2 uses a srcDoc that only contains a doctype. + return '/wp-includes/empty.html'; + } else if (props.src && props.src.startsWith('blob:')) { + // WordPress 6.3 uses a blob URL with doctype and a list of static assets. + // Let's pass the document content to empty.html and render it there. + return '/wp-includes/empty.html#' + encodeURIComponent(__playground_readBlobAsText(props.src)); + } else { + // WordPress >= 6.4 uses a plain HTTPS URL that needs no correction. + return props.src; + } + }, [props.src]); + return ( + window.wp.element.createElement('iframe', { + ...props, + ref: ref, + src: source, + // Make sure there's no srcDoc, as it would interfere with the src. + srcDoc: undefined + }) + ) +});/*! This file is auto-generated */ this.wp=this.wp||{},this.wp.blockEditor=function(e){var t={};function n(o){if(t[o])return t[o].exports;var r=t[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(o,r,function(t){return e[t]}.bind(null,r));return o},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s="tr0p")}({"+0ps":function(e,t,n){"use strict";n.d(t,"c",(function(){return b})),n.d(t,"b",(function(){return p}));var o=n("GRId"),r=n("HSyU"),c=n("1CF3"),l=n("1ZqX"),i=n("l3Sj"),a=n("onLe"),s=n("K9lf"),u=n("xTGt");var d=n("BhPs");function b(){const{getBlockName:e}=Object(l.useSelect)(d.a),{getBlockType:t}=Object(l.useSelect)(r.store),{createSuccessNotice:n}=Object(l.useDispatch)(a.store);return Object(o.useCallback)((o,r)=>{let c="";if(1===r.length){var l;const n=r[0],a=null===(l=t(e(n)))||void 0===l?void 0:l.title;c="copy"===o?Object(i.sprintf)(Object(i.__)('Copied "%s" to clipboard.'),a):Object(i.sprintf)(Object(i.__)('Moved "%s" to clipboard.'),a)}else c="copy"===o?Object(i.sprintf)(Object(i._n)("Copied %d block to clipboard.","Copied %d blocks to clipboard.",r.length),r.length):Object(i.sprintf)(Object(i._n)("Moved %d block to clipboard.","Moved %d blocks to clipboard.",r.length),r.length);n(c,{type:"snackbar"})},[])}function p(){const{getBlocksByClientId:e,getSelectedBlockClientIds:t,hasMultiSelection:n,getSettings:o}=Object(l.useSelect)(d.a),{flashBlock:i,removeBlocks:a,replaceBlocks:p}=Object(l.useDispatch)(d.a),m=b();return Object(s.useRefEffect)(l=>{function s(s){const d=t();if(0===d.length)return;if(!n()){const{target:e}=s,{ownerDocument:t}=e;if("copy"===s.type||"cut"===s.type?Object(c.documentHasUncollapsedSelection)(t):Object(c.documentHasSelection)(t))return}if(!l.contains(s.target.ownerDocument.activeElement))return;const b=s.defaultPrevented;if(s.preventDefault(),"copy"===s.type||"cut"===s.type){1===d.length&&i(d[0]),m(s.type,d);const t=e(d),n=Object(r.serialize)(t);s.clipboardData.setData("text/plain",n),s.clipboardData.setData("text/html",n)}if("cut"===s.type)a(d);else if("paste"===s.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=Object(c.getFilesFromDataTransfer)(t).filter(e=>{let{type:t}=e;return/^image\/(?:jpe?g|png|gif)$/.test(t)});return r.length&&!o&&(o=r.map(e=>``).join(""),n=""),{html:o,plainText:n}}(s),l=Object(r.pasteHandler)({HTML:n,plainText:t,mode:"BLOCKS",canUserUseUnfilteredHTML:e});p(d,l,l.length-1,-1)}}return l.ownerDocument.addEventListener("copy",s),l.ownerDocument.addEventListener("cut",s),l.ownerDocument.addEventListener("paste",s),()=>{l.ownerDocument.removeEventListener("copy",s),l.ownerDocument.removeEventListener("cut",s),l.ownerDocument.removeEventListener("paste",s)}},[])}t.a=function(e){let{children:t}=e;return Object(o.createElement)("div",{ref:p()},t)}},"+6d5":function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var o=n("TSYQ"),r=n.n(o),c=n("1ZqX"),l=n("BhPs");function i(e){return Object(c.useSelect)(t=>{const{hasBlockMovingClientId:n,canInsertBlockType:o,getBlockName:c,getBlockRootClientId:i,isBlockSelected:a}=t(l.a);if(!a(e))return;const s=n();return s?r()("is-block-moving-mode",{"can-insert-moving-block":o(c(s),i(e))}):void 0},[e])}},"+DUQ":function(e,t,n){"use strict";n.d(t,"animated",(function(){return y}));var o=n("kmrn");n.o(o,"useSpring")&&n.d(t,"useSpring",(function(){return o.useSpring}));var r=n("faye"),c=n("nEW0"),l=n("dfZa");function i(e,t){if(null==e)return{};var n,o,r={},c=Object.keys(e);for(o=0;o=0||(r[n]=e[n]);return r}const a=["style","children","scrollTop","scrollLeft"],s=/^--/;function u(e,t){return null==t||"boolean"==typeof t||""===t?"":"number"!=typeof t||0===t||s.test(e)||b.hasOwnProperty(e)&&b[e]?(""+t).trim():t+"px"}const d={};let b={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 p=["Webkit","Ms","Moz","O"];b=Object.keys(b).reduce((e,t)=>(p.forEach(n=>e[((e,t)=>e+t.charAt(0).toUpperCase()+t.substring(1))(n,t)]=e[t]),e),b);const m=["x","y","z"],f=/^(matrix|translate|scale|rotate|skew)/,h=/^(translate)/,g=/^(rotate|skew)/,O=(e,t)=>c.s.num(e)&&0!==e?e+t:e,v=(e,t)=>c.s.arr(e)?e.every(e=>v(e,t)):c.s.num(e)?e===t:parseFloat(e)===t;class j extends l.a{constructor(e){let{x:t,y:n,z:o}=e,r=i(e,m);const l=[],a=[];(t||n||o)&&(l.push([t||0,n||0,o||0]),a.push(e=>[`translate3d(${e.map(e=>O(e,"px")).join(",")})`,v(e,0)])),Object(c.l)(r,(e,t)=>{if("transform"===t)l.push([e||""]),a.push(e=>[e,""===e]);else if(f.test(t)){if(delete r[t],c.s.und(e))return;const n=h.test(t)?"px":g.test(t)?"deg":"";l.push(Object(c.y)(e)),a.push("rotate3d"===t?([e,t,o,r])=>[`rotate3d(${e},${t},${o},${O(r,n)})`,v(r,0)]:e=>[`${t}(${e.map(e=>O(e,n)).join(",")})`,v(e,t.startsWith("scale")?1:0)])}}),l.length&&(r.transform=new k(l,a)),super(r)}}class k extends c.a{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 Object(c.k)(this.inputs,(n,o)=>{const r=Object(c.q)(n[0]),[l,i]=this.transforms[o](c.s.arr(r)?r:n.map(c.q));e+=" "+l,t=t&&i}),t?"none":e}observerAdded(e){1==e&&Object(c.k)(this.inputs,e=>Object(c.k)(e,e=>Object(c.r)(e)&&Object(c.c)(e,this)))}observerRemoved(e){0==e&&Object(c.k)(this.inputs,e=>Object(c.k)(e,e=>Object(c.r)(e)&&Object(c.x)(e,this)))}eventObserved(e){"change"==e.type&&(this._value=null),Object(c.d)(this,e)}}const _=["scrollTop","scrollLeft"];o.Globals.assign({batchedUpdates:r.unstable_batchedUpdates,createStringInterpolator:c.g,colors:c.e});const y=Object(l.d)(["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:c,scrollTop:l,scrollLeft:b}=o,p=i(o,a),m=Object.values(p),f=Object.keys(p).map(t=>n||e.hasAttribute(t)?t:d[t]||(d[t]=t.replace(/([A-Z])/g,e=>"-"+e.toLowerCase())));void 0!==c&&(e.textContent=c);for(let t in r)if(r.hasOwnProperty(t)){const n=u(t,r[t]);s.test(t)?e.style.setProperty(t,n):e.style[t]=n}f.forEach((t,n)=>{e.setAttribute(t,m[n])}),void 0!==l&&(e.scrollTop=l),void 0!==b&&(e.scrollLeft=b)},createAnimatedStyle:e=>new j(e),getComponentProps:e=>i(e,_)}).animated},"+G0a":function(e,t,n){"use strict";var o=n("HSyU"),r=n("1ZqX"),c=n("GRId"),l=n("BhPs");t.a=(e,t)=>{const{categories:n,collections:i,items:a}=Object(r.useSelect)(t=>{const{getInserterItems:n}=t(l.a),{getCategories:r,getCollections:c}=t(o.store);return{categories:r(),collections:c(),items:n(e)}},[e]);return[a,n,i,Object(c.useCallback)((e,n)=>{let{name:r,initialAttributes:c,innerBlocks:l}=e;const i=Object(o.createBlock)(r,c,Object(o.createBlocksFromInnerBlocksTemplate)(l));t(i,void 0,n)},[t])]}},"+WrK":function(e,t,n){"use strict";var o=n("GRId"),r=n("Tqx9");const c=Object(o.createElement)(r.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(o.createElement)(r.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"}));t.a=c},"+gtr":function(e,t,n){"use strict";n.d(t,"a",(function(){return V}));var o=n("wx14"),r=n("GRId"),c=n("TSYQ"),l=n.n(c),i=n("1ZqX"),a=n("K9lf"),s=n("HSyU"),u=n("tI+e"),d=n("JygI"),b=n("l3Sj"),p=n("wC17"),m=n("7SSY"),f=n("YLtl");const{clearTimeout:h,setTimeout:g}=window,O=200;function v(e){let{ref:t,isFocused:n,debounceTimeout:o=O,onChange:c=f.noop}=e;const[l,i]=Object(r.useState)(!1),a=Object(r.useRef)(),s=e=>{null!=t&&t.current&&i(e),c(e)},u=()=>{const e=(null==t?void 0:t.current)&&t.current.matches(":hover");return!n&&!e},d=()=>{const e=a.current;e&&h&&h(e)};return Object(r.useEffect)(()=>()=>d(),[]),{showMovers:l,debouncedShowMovers:e=>{e&&e.stopPropagation(),d(),l||s(!0)},debouncedHideMovers:e=>{e&&e.stopPropagation(),d(),a.current=g(()=>{u()&&s(!1)},o)}}}function j(e){let{ref:t,debounceTimeout:n=O,onChange:o=f.noop}=e;const[c,l]=Object(r.useState)(!1),{showMovers:i,debouncedShowMovers:a,debouncedHideMovers:s}=v({ref:t,debounceTimeout:n,isFocused:c,onChange:o}),u=Object(r.useRef)(!1),d=()=>(null==t?void 0:t.current)&&t.current.contains(t.current.ownerDocument.activeElement);return Object(r.useEffect)(()=>{const e=t.current,n=()=>{d()&&(l(!0),a())},o=()=>{d()||(l(!1),s())};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,a,s]),{showMovers:i,gestures:{onMouseMove:a,onMouseLeave:s}}}var k=n("BhPs");function _(){const{selectBlock:e,toggleBlockHighlight:t}=Object(i.useDispatch)(k.a),{firstParentClientId:n,shouldHide:c,hasReducedUI:l}=Object(i.useSelect)(e=>{const{getBlockName:t,getBlockParents:n,getSelectedBlockClientId:o,getSettings:r}=e(k.a),{hasBlockSupport:c}=e(s.store),l=n(o()),i=l[l.length-1],a=t(i),u=Object(s.getBlockType)(a),d=r();return{firstParentClientId:i,shouldHide:!c(u,"__experimentalParentSelector",!0),hasReducedUI:d.hasReducedUI}},[]),a=Object(p.a)(n),d=Object(r.useRef)(),{gestures:f}=j({ref:d,onChange(e){e&&l||t(n,e)}});return c||void 0===n?null:Object(r.createElement)("div",Object(o.a)({className:"block-editor-block-parent-selector",key:n,ref:d},f),Object(r.createElement)(u.ToolbarButton,{className:"block-editor-block-parent-selector__button",onClick:()=>e(n),label:Object(b.sprintf)(Object(b.__)("Select %s"),a.title),showTooltip:!0,icon:Object(r.createElement)(m.a,{icon:a.icon})}))}var y=n("wzfx"),E=n("f8JO"),C=n("REKd");function S(e){let{blocks:t}=e;return Object(r.createElement)("div",{className:"block-editor-block-switcher__popover__preview__parent"},Object(r.createElement)("div",{className:"block-editor-block-switcher__popover__preview__container"},Object(r.createElement)(u.Popover,{className:"block-editor-block-switcher__preview__popover",position:"bottom right",focusOnMount:!1},Object(r.createElement)("div",{className:"block-editor-block-switcher__preview"},Object(r.createElement)("div",{className:"block-editor-block-switcher__preview-title"},Object(b.__)("Preview")),Object(r.createElement)(C.a,{viewportWidth:500,blocks:t})))))}var w=e=>{let{className:t,possibleBlockTransformations:n,onSelect:o,blocks:c}=e;const[l,i]=Object(r.useState)();return Object(r.createElement)(u.MenuGroup,{label:Object(b.__)("Transform to"),className:t},l&&Object(r.createElement)(S,{blocks:Object(s.switchToBlockType)(c,l)}),n.map(e=>{const{name:t,icon:n,title:c,isDisabled:l}=e;return Object(r.createElement)(u.MenuItem,{key:t,className:Object(s.getBlockMenuDefaultClassName)(t),onClick:e=>{e.preventDefault(),o(t)},disabled:l,onMouseLeave:()=>i(null),onMouseEnter:()=>i(t)},Object(r.createElement)(m.a,{icon:n,showColors:!0}),c)}))},I=n("7NR9");function x(e){let{hoveredBlock:t,onSwitch:n}=e;const{name:o,clientId:c}=t,[l,a]=Object(r.useState)(),d=Object(i.useSelect)(e=>e(s.store).getBlockType(o),[o]);return Object(r.createElement)(u.MenuGroup,{label:Object(b.__)("Styles"),className:"block-editor-block-switcher__styles__menugroup"},l&&Object(r.createElement)(S,{blocks:d&&d.example?Object(s.getBlockFromExample)(d.name,{attributes:{...d.example.attributes,className:l},innerBlocks:d.example.innerBlocks}):Object(s.cloneBlock)(t,{className:l})}),Object(r.createElement)(I.a,{clientId:c,onSwitch:n,onHoverClassName:a,itemRole:"menuitem"}))}var B=n("1iEr");const T=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new Set;const{clientId:o,name:r,innerBlocks:c=[]}=e;if(!n.has(o)){if(r===t)return e;for(const e of c){const o=T(e,t,n);if(o)return o}}},P=(e,t)=>{const n=((e,t)=>{const n=Object(s.__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 R=(e,t)=>Object(r.useMemo)(()=>e.reduce((e,n)=>{const o=((e,t)=>{const n=t.map(e=>Object(s.cloneBlock)(e)),o=new Set;for(const t of e){let e=!1;for(const r of n){const n=T(r,t.name,o);if(n){e=!0,o.add(n.clientId),P(n,t);break}}if(!e)return}return n})(t,n.blocks);return o&&e.push({...n,transformedBlocks:o}),e},[]),[e,t]);function N(e){let{patterns:t,onSelect:n}=e;return Object(r.createElement)("div",{className:"block-editor-block-switcher__popover__preview__parent"},Object(r.createElement)("div",{className:"block-editor-block-switcher__popover__preview__container"},Object(r.createElement)(u.Popover,{className:"block-editor-block-switcher__preview__popover",position:"bottom right"},Object(r.createElement)("div",{className:"block-editor-block-switcher__preview"},Object(r.createElement)("div",{className:"block-editor-block-switcher__preview-title"},Object(b.__)("Preview")),Object(r.createElement)(M,{patterns:t,onSelect:n})))))}function M(e){let{patterns:t,onSelect:n}=e;const c=Object(u.__unstableUseCompositeState)();return Object(r.createElement)(u.__unstableComposite,Object(o.a)({},c,{role:"listbox",className:"block-editor-block-switcher__preview-patterns-container","aria-label":Object(b.__)("Patterns list")}),t.map(e=>Object(r.createElement)(L,{key:e.name,pattern:e,onSelect:n,composite:c})))}function L(e){let{pattern:t,onSelect:n,composite:c}=e;const l="block-editor-block-switcher__preview-patterns-container",i=Object(a.useInstanceId)(L,l+"-list__item-description");return Object(r.createElement)("div",{className:l+"-list__list-item","aria-label":t.title,"aria-describedby":t.description?i:void 0},Object(r.createElement)(u.__unstableCompositeItem,Object(o.a)({role:"option",as:"div"},c,{className:l+"-list__item",onClick:()=>n(t.transformedBlocks)}),Object(r.createElement)(C.a,{blocks:t.transformedBlocks,viewportWidth:t.viewportWidth||500}),Object(r.createElement)("div",{className:l+"-list__item-title"},t.title)),!!t.description&&Object(r.createElement)(u.VisuallyHidden,{id:i},t.description))}var A=function(e){let{blocks:t,patterns:n,onSelect:o}=e;const[c,l]=Object(r.useState)(!1),i=R(n,t);return i.length?Object(r.createElement)(u.MenuGroup,{className:"block-editor-block-switcher__pattern__transforms__menugroup"},c&&Object(r.createElement)(N,{patterns:i,onSelect:o}),Object(r.createElement)(u.MenuItem,{onClick:e=>{e.preventDefault(),l(!c)},icon:B.a},Object(b.__)("Patterns"))):null};const D=e=>{let{clientIds:t,blocks:n}=e;const{replaceBlocks:o}=Object(i.useDispatch)(k.a),c=Object(p.a)(n[0].clientId),{possibleBlockTransformations:l,canRemove:a,hasBlockStyles:d,icon:h,blockTitle:g,patterns:O}=Object(i.useSelect)(e=>{var o;const{getBlockRootClientId:r,getBlockTransformItems:l,__experimentalGetPatternTransformItems:i}=e(k.a),{getBlockStyles:a,getBlockType:u}=e(s.store),{canRemoveBlocks:d}=e(k.a),b=r(Object(f.castArray)(t)[0]),[{name:p}]=n,m=1===n.length,h=m&&a(p);let g;if(m)g=null==c?void 0:c.icon;else{var O;g=1===Object(f.uniq)(n.map(e=>{let{name:t}=e;return t})).length?null===(O=u(p))||void 0===O?void 0:O.icon:y.a}return{possibleBlockTransformations:l(n,b),canRemove:d(t,b),hasBlockStyles:!(null==h||!h.length),icon:g,blockTitle:null===(o=u(p))||void 0===o?void 0:o.title,patterns:i(n,b)}},[t,n,null==c?void 0:c.icon]),v=1===n.length&&Object(s.isReusableBlock)(n[0]),j=1===n.length&&Object(s.isTemplatePart)(n[0]),_=!!l.length&&a,C=!(null==O||!O.length)&&a;if(!d&&!_)return Object(r.createElement)(u.ToolbarGroup,null,Object(r.createElement)(u.ToolbarButton,{disabled:!0,className:"block-editor-block-switcher__no-switcher-icon",title:g,icon:Object(r.createElement)(m.a,{icon:h,showColors:!0})}));const S=g,I=1===n.length?Object(b.sprintf)(Object(b.__)("%s: Change block type or style"),g):Object(b.sprintf)(Object(b._n)("Change type of %d block","Change type of %d blocks",n.length),n.length),B=d||_||C;return Object(r.createElement)(u.ToolbarGroup,null,Object(r.createElement)(u.ToolbarItem,null,e=>Object(r.createElement)(u.DropdownMenu,{className:"block-editor-block-switcher",label:S,popoverProps:{position:"bottom right",isAlternate:!0,className:"block-editor-block-switcher__popover"},icon:Object(r.createElement)(r.Fragment,null,Object(r.createElement)(m.a,{icon:h,className:"block-editor-block-switcher__toggle",showColors:!0}),(v||j)&&Object(r.createElement)("span",{className:"block-editor-block-switcher__toggle-text"},Object(r.createElement)(E.a,{clientId:t}))),toggleProps:{describedBy:I,...e},menuProps:{orientation:"both"}},e=>{let{onClose:c}=e;return B&&Object(r.createElement)("div",{className:"block-editor-block-switcher__container"},C&&Object(r.createElement)(A,{blocks:n,patterns:O,onSelect:e=>{(e=>{o(t,e)})(e),c()}}),_&&Object(r.createElement)(w,{className:"block-editor-block-switcher__transforms__menugroup",possibleBlockTransformations:l,blocks:n,onSelect:e=>{(e=>{o(t,Object(s.switchToBlockType)(n,e))})(e),c()}}),d&&Object(r.createElement)(x,{hoveredBlock:n[0],onSwitch:c}))})))};var F=e=>{let{clientIds:t}=e;const n=Object(i.useSelect)(e=>e(k.a).getBlocksByClientId(t),[t]);return!n.length||n.some(e=>!e)?null:Object(r.createElement)(D,{clientIds:t,blocks:n})},z=n("fOYa"),H=n("U1WI");function V(e){let{hideDragHandle:t}=e;const{blockClientIds:n,blockClientId:c,blockType:b,hasFixedToolbar:p,hasReducedUI:m,isValid:f,isVisual:h}=Object(i.useSelect)(e=>{const{getBlockName:t,getBlockMode:n,getSelectedBlockClientIds:o,isBlockValid:r,getBlockRootClientId:c,getSettings:l}=e(k.a),i=o(),a=i[0],u=c(a),d=l();return{blockClientIds:i,blockClientId:a,blockType:a&&Object(s.getBlockType)(t(a)),hasFixedToolbar:d.hasFixedToolbar,hasReducedUI:d.hasReducedUI,rootClientId:u,isValid:i.every(e=>r(e)),isVisual:i.every(e=>"visual"===n(e))}},[]),{toggleBlockHighlight:g}=Object(i.useDispatch)(k.a),O=Object(r.useRef)(),{showMovers:v,gestures:y}=j({ref:O,onChange(e){e&&m||g(c,e)}}),E=Object(a.useViewportMatch)("medium","<")||p;if(b&&!Object(s.hasBlockSupport)(b,"__experimentalToolbar",!0))return null;const C=E||v;if(0===n.length)return null;const S=f&&h,w=n.length>1,I=l()("block-editor-block-toolbar",C&&"is-showing-movers");return Object(r.createElement)("div",{className:I},!w&&!E&&Object(r.createElement)(_,{clientIds:n}),Object(r.createElement)("div",Object(o.a)({ref:O},y),(S||w)&&Object(r.createElement)(u.ToolbarGroup,{className:"block-editor-block-toolbar__block-controls"},Object(r.createElement)(F,{clientIds:n}),Object(r.createElement)(d.a,{clientIds:n,hideDragHandle:t||m}))),S&&Object(r.createElement)(r.Fragment,null,Object(r.createElement)(z.b.Slot,{group:"parent",className:"block-editor-block-toolbar__slot"}),Object(r.createElement)(z.b.Slot,{group:"block",className:"block-editor-block-toolbar__slot"}),Object(r.createElement)(z.b.Slot,{className:"block-editor-block-toolbar__slot"}),Object(r.createElement)(z.b.Slot,{group:"inline",className:"block-editor-block-toolbar__slot"}),Object(r.createElement)(z.b.Slot,{group:"other",className:"block-editor-block-toolbar__slot"})),Object(r.createElement)(H.a,{clientIds:n}))}},"//Lo":function(e,t,n){"use strict";var o=n("GRId"),r=n("Tqx9");const c=Object(o.createElement)(r.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(o.createElement)(r.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"}));t.a=c},"/Hvg":function(e,t,n){"use strict";n.d(t,"a",(function(){return d}));var o=n("GRId"),r=n("tI+e"),c=n("l3Sj"),l=n("Tqx9");var i=Object(o.createElement)(l.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(o.createElement)(l.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 a=Object(o.createElement)(l.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(o.createElement)(l.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 s=Object(o.createElement)(l.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(o.createElement)(l.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 u=[{name:Object(c.__)("Uppercase"),value:"uppercase",icon:i},{name:Object(c.__)("Lowercase"),value:"lowercase",icon:a},{name:Object(c.__)("Capitalize"),value:"capitalize",icon:s}];function d(e){let{value:t,onChange:n}=e;return Object(o.createElement)("fieldset",{className:"block-editor-text-transform-control"},Object(o.createElement)("legend",null,Object(c.__)("Letter case")),Object(o.createElement)("div",{className:"block-editor-text-transform-control__buttons"},u.map(e=>Object(o.createElement)(r.Button,{key:e.value,icon:e.icon,isSmall:!0,isPressed:t===e.value,"aria-label":e.name,onClick:()=>n(t===e.value?void 0:e.value)}))))}},"/QNa":function(e,t,n){"use strict";var o=n("GRId"),r=n("1ZqX"),c=n("wx14"),l=n("K9lf"),i=n("BhPs"),a=n("AHN3");var s=Object(l.createHigherOrderComponent)(e=>Object(r.withRegistry)(t=>{let{useSubRegistry:n=!0,registry:l,...s}=t;if(!n)return Object(o.createElement)(e,Object(c.a)({registry:l},s));const[u,d]=Object(o.useState)(null);return Object(o.useEffect)(()=>{const e=Object(r.createRegistry)({},l);e.registerStore(a.a,i.b),d(e)},[l]),u?Object(o.createElement)(r.RegistryProvider,{value:u},Object(o.createElement)(e,Object(c.a)({registry:u},s))):null}),"withRegistryProvider"),u=n("JGYp"),d=n("cDhi");t.a=s((function(e){const{children:t,settings:n}=e,{updateSettings:c}=Object(r.useDispatch)(i.a);return Object(o.useEffect)(()=>{c(n)},[n]),Object(u.a)(e),Object(o.createElement)(d.b,null,t)}))},"/lNF":function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var o=n("HSyU"),r=n("1ZqX"),c=n("1CF3"),l=n("BhPs");function i(e,t,n,r,c,l,i){return a=>{const{srcRootClientId:s,srcClientIds:u,type:d,blocks:b}=function(e){let t={srcRootClientId:null,srcClientIds:null,srcIndex:null,type:null,blocks:null};if(!e.dataTransfer)return t;try{t=Object.assign(t,JSON.parse(e.dataTransfer.getData("wp-blocks")))}catch(e){return t}return t}(a);if("inserter"===d){i();const n=b.map(e=>Object(o.cloneBlock)(e));l(n,t,e,!0,null)}if("block"===d){const o=n(u[0]);if(s===e&&o===t)return;if(u.includes(e)||r(u).some(t=>t===e))return;const l=s===e,i=u.length;c(u,s,e,l&&oe(l.a).getSettings().mediaUpload,[]),{canInsertBlockType:a,getBlockIndex:s,getClientIdsOfDescendants:u}=Object(r.useSelect)(l.a),{insertBlocks:d,moveBlocksToPosition:b,updateBlockAttributes:p,clearSelectedBlock:m}=Object(r.useDispatch)(l.a),f=i(e,t,s,u,b,d,m),h=function(e,t,n,r,c,l){return i=>{if(!n)return;const a=Object(o.findTransform)(Object(o.getBlockTransforms)("from"),t=>"files"===t.type&&c(t.blockName,e)&&t.isMatch(i));if(a){const n=a.transform(i,r);l(n,t,e)}}}(e,t,n,p,a,d),g=function(e,t,n){return r=>{const c=Object(o.pasteHandler)({HTML:r,mode:"BLOCKS"});c.length&&n(c,t,e)}}(e,t,d);return e=>{const t=Object(c.getFilesFromDataTransfer)(e.dataTransfer),n=e.dataTransfer.getData("text/html");t.length?h(t):n?g(n):f(e)}}},"0E5u":function(e,t,n){"use strict";n.d(t,"a",(function(){return p})),n.d(t,"b",(function(){return m}));var o=n("wx14"),r=n("GRId"),c=n("tI+e"),l=n("kWXm"),i=n("DmX/"),a=n("suLj"),s=n("bTSr"),u=n("l3Sj");const d={left:l.a,center:i.a,right:a.a,"space-between":s.a};var b=function(e){let{allowedControls:t=["left","center","right","space-between"],isCollapsed:n=!0,onChange:b,value:p,popoverProps:m,isToolbar:f}=e;const h=e=>{b(e===p?void 0:e)},g=p?d[p]:d.left,O=[{name:"left",icon:l.a,title:Object(u.__)("Justify items left"),isActive:"left"===p,onClick:()=>h("left")},{name:"center",icon:i.a,title:Object(u.__)("Justify items center"),isActive:"center"===p,onClick:()=>h("center")},{name:"right",icon:a.a,title:Object(u.__)("Justify items right"),isActive:"right"===p,onClick:()=>h("right")},{name:"space-between",icon:s.a,title:Object(u.__)("Space between items"),isActive:"space-between"===p,onClick:()=>h("space-between")}],v=f?c.ToolbarGroup:c.ToolbarDropdownMenu,j=f?{isCollapsed:n}:{};return Object(r.createElement)(v,Object(o.a)({icon:g,popoverProps:m,label:Object(u.__)("Change items justification"),controls:O.filter(e=>t.includes(e.name))},j))};function p(e){return Object(r.createElement)(b,Object(o.a)({},e,{isToolbar:!1}))}function m(e){return Object(r.createElement)(b,Object(o.a)({},e,{isToolbar:!0}))}},"0LBR":function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var o=n("GRId"),r=n("l3Sj"),c=n("v5LD"),l=n("pY5h");function i(){const e=Object(l.a)(),t=Object(c.a)("color.palette.custom"),n=Object(c.a)("color.palette.theme"),i=Object(c.a)("color.palette.default"),a=Object(c.a)("color.defaultPalette");e.colors=Object(o.useMemo)(()=>{const e=[];return n&&n.length&&e.push({name:Object(r._x)("Theme","Indicates this palette comes from the theme."),colors:n}),a&&i&&i.length&&e.push({name:Object(r._x)("Default","Indicates this palette comes from WordPress."),colors:i}),t&&t.length&&e.push({name:Object(r._x)("Custom","Indicates this palette comes from the theme."),colors:t}),e},[i,n,t]);const s=Object(c.a)("color.gradients.custom"),u=Object(c.a)("color.gradients.theme"),d=Object(c.a)("color.gradients.default"),b=Object(c.a)("color.defaultGradients");return e.gradients=Object(o.useMemo)(()=>{const e=[];return u&&u.length&&e.push({name:Object(r._x)("Theme","Indicates this palette comes from the theme."),gradients:u}),b&&d&&d.length&&e.push({name:Object(r._x)("Default","Indicates this palette comes from WordPress."),gradients:d}),s&&s.length&&e.push({name:Object(r._x)("Custom","Indicates this palette is created by the user."),gradients:s}),e},[s,u,d]),e}},"14PQ":function(e,t,n){"use strict";n.d(t,"ic",(function(){return o.b})),n.d(t,"jc",(function(){return o.c})),n.d(t,"kc",(function(){return o.d})),n.d(t,"hc",(function(){return o.a})),n.d(t,"wc",(function(){return o.e})),n.d(t,"yb",(function(){return r.a})),n.d(t,"pc",(function(){return r.e})),n.d(t,"zb",(function(){return r.b})),n.d(t,"oc",(function(){return r.d})),n.d(t,"Tb",(function(){return r.c})),n.d(t,"lc",(function(){return c.b})),n.d(t,"mc",(function(){return c.c})),n.d(t,"nc",(function(){return c.d})),n.d(t,"I",(function(){return c.a})),n.d(t,"xc",(function(){return c.e})),n.d(t,"a",(function(){return g})),n.d(t,"b",(function(){return O})),n.d(t,"c",(function(){return B})),n.d(t,"d",(function(){return T.a})),n.d(t,"e",(function(){return T.b})),n.d(t,"nb",(function(){return N})),n.d(t,"lb",(function(){return L})),n.d(t,"f",(function(){return z})),n.d(t,"mb",(function(){return G})),n.d(t,"h",(function(){return U.a})),n.d(t,"i",(function(){return W.b})),n.d(t,"m",(function(){return W.a})),n.d(t,"g",(function(){return $})),n.d(t,"j",(function(){return Z.a})),n.d(t,"rc",(function(){return k.c})),n.d(t,"n",(function(){return C.a})),n.d(t,"r",(function(){return Ie})),n.d(t,"pb",(function(){return Be})),n.d(t,"ob",(function(){return We})),n.d(t,"qb",(function(){return Ye})),n.d(t,"A",(function(){return nt})),n.d(t,"z",(function(){return tt})),n.d(t,"rb",(function(){return ot.a})),n.d(t,"sb",(function(){return rt.a})),n.d(t,"C",(function(){return ct.a})),n.d(t,"B",(function(){return ct.b})),n.d(t,"D",(function(){return at})),n.d(t,"E",(function(){return ut})),n.d(t,"F",(function(){return dt.a})),n.d(t,"vb",(function(){return bt.a})),n.d(t,"wb",(function(){return pt.a})),n.d(t,"xb",(function(){return mt.a})),n.d(t,"Fb",(function(){return ft.a})),n.d(t,"Pb",(function(){return ht.a})),n.d(t,"Qb",(function(){return gt.a})),n.d(t,"tb",(function(){return st.a})),n.d(t,"ub",(function(){return Ot.a})),n.d(t,"Mb",(function(){return vt.a})),n.d(t,"Bb",(function(){return rn})),n.d(t,"Ab",(function(){return Kt})),n.d(t,"Cb",(function(){return ln})),n.d(t,"J",(function(){return an.a})),n.d(t,"tc",(function(){return an.b})),n.d(t,"M",(function(){return sn.b})),n.d(t,"L",(function(){return sn.a})),n.d(t,"O",(function(){return un.b})),n.d(t,"N",(function(){return un.a})),n.d(t,"Hb",(function(){return Vn})),n.d(t,"Ib",(function(){return Tn})),n.d(t,"Kb",(function(){return En})),n.d(t,"Jb",(function(){return _n})),n.d(t,"P",(function(){return Gn.a})),n.d(t,"Lb",(function(){return Se})),n.d(t,"R",(function(){return $n})),n.d(t,"Q",(function(){return no})),n.d(t,"S",(function(){return Kn})),n.d(t,"T",(function(){return Yn})),n.d(t,"X",(function(){return oo})),n.d(t,"Y",(function(){return No})),n.d(t,"Ob",(function(){return Lo})),n.d(t,"ab",(function(){return To})),n.d(t,"bb",(function(){return Ao})),n.d(t,"cb",(function(){return Do})),n.d(t,"ac",(function(){return Fo})),n.d(t,"eb",(function(){return Ho})),n.d(t,"Rb",(function(){return Vo})),n.d(t,"gb",(function(){return On})),n.d(t,"hb",(function(){return qo})),n.d(t,"ib",(function(){return eo})),n.d(t,"Db",(function(){return Zo})),n.d(t,"vc",(function(){return it})),n.d(t,"Wb",(function(){return Xo.a})),n.d(t,"Zb",(function(){return Qo.a})),n.d(t,"Nb",(function(){return Jo})),n.d(t,"Vb",(function(){return er})),n.d(t,"o",(function(){return dr})),n.d(t,"p",(function(){return br.c})),n.d(t,"sc",(function(){return pr.a})),n.d(t,"Eb",(function(){return mr.b})),n.d(t,"q",(function(){return fr.a})),n.d(t,"s",(function(){return Te.a})),n.d(t,"Sb",(function(){return Te.b})),n.d(t,"t",(function(){return hr.a})),n.d(t,"bc",(function(){return hr.b})),n.d(t,"u",(function(){return gr.a})),n.d(t,"v",(function(){return Or.a})),n.d(t,"w",(function(){return F.a})),n.d(t,"x",(function(){return vr.a})),n.d(t,"y",(function(){return Cr})),n.d(t,"G",(function(){return Sr.a})),n.d(t,"dc",(function(){return Sr.b})),n.d(t,"H",(function(){return wr.a})),n.d(t,"Xb",(function(){return Ir.a})),n.d(t,"K",(function(){return xr.a})),n.d(t,"Gb",(function(){return Tr})),n.d(t,"k",(function(){return Rr})),n.d(t,"U",(function(){return Nr})),n.d(t,"V",(function(){return Mr.a})),n.d(t,"W",(function(){return Fr})),n.d(t,"gc",(function(){return Dr})),n.d(t,"ec",(function(){return Ar})),n.d(t,"Z",(function(){return zr})),n.d(t,"db",(function(){return nr})),n.d(t,"fb",(function(){return Ur})),n.d(t,"fc",(function(){return Gr})),n.d(t,"jb",(function(){return Wr.a})),n.d(t,"kb",(function(){return qr.a})),n.d(t,"cc",(function(){return Yr})),n.d(t,"qc",(function(){return ce.a})),n.d(t,"Yb",(function(){return $r.a})),n.d(t,"Ub",(function(){return Qr})),n.d(t,"l",(function(){return Jr.a})),n.d(t,"uc",(function(){return lt.a}));var o=n("5gPN"),r=n("zmSX"),c=n("9XVa"),l=n("wx14"),i=n("GRId"),a=n("YLtl"),s=n("l3Sj"),u=n("tI+e"),d=n("fPbg"),b=n("plpT"),p=n("ziDm");const m=[{icon:d.a,title:Object(s.__)("Align text left"),align:"left"},{icon:b.a,title:Object(s.__)("Align text center"),align:"center"},{icon:p.a,title:Object(s.__)("Align text right"),align:"right"}],f={position:"bottom right",isAlternate:!0};var h=function(e){let{value:t,onChange:n,alignmentControls:o=m,label:r=Object(s.__)("Align"),describedBy:c=Object(s.__)("Change text alignment"),isCollapsed:b=!0,isToolbar:h}=e;function g(e){return()=>n(t===e?void 0:e)}const O=Object(a.find)(o,e=>e.align===t),v=h?u.ToolbarGroup:u.ToolbarDropdownMenu,j=h?{isCollapsed:b}:{};return Object(i.createElement)(v,Object(l.a)({icon:O?O.icon:Object(s.isRTL)()?p.a:d.a,label:r,toggleProps:{describedBy:c},popoverProps:f,controls:o.map(e=>{const{align:n}=e,o=t===n;return{...e,isActive:o,role:b?"menuitemradio":void 0,onClick:g(n)}})},j))};function g(e){return Object(i.createElement)(h,Object(l.a)({},e,{isToolbar:!1}))}function O(e){return Object(i.createElement)(h,Object(l.a)({},e,{isToolbar:!0}))}var v=n("g56x"),j=n("HSyU"),k=n("ur0x"),_=n("1ZqX"),y=n("pOGT"),E=n("+G0a"),C=n("7SSY"),S=n("BhPs");var w={name:"blocks",className:"block-editor-autocompleters__block",triggerPrefix:"/",useItems(e){const{rootClientId:t,selectedBlockName:n}=Object(_.useSelect)(e=>{const{getSelectedBlockClientId:t,getBlockName:n,getBlockInsertionPoint:o}=e(S.a),r=t();return{selectedBlockName:r?n(r):null,rootClientId:o().rootClientId}},[]),[o,r,c]=Object(E.a)(t,a.noop),l=Object(i.useMemo)(()=>(e.trim()?Object(y.a)(o,r,c,e):Object(a.orderBy)(o,["frecency"],["desc"])).filter(e=>e.name!==n).slice(0,9),[e,n,o,r,c]);return[Object(i.useMemo)(()=>l.map(e=>{const{title:t,icon:n,isDisabled:o}=e;return{key:"block-"+e.id,value:e,label:Object(i.createElement)(i.Fragment,null,Object(i.createElement)(C.a,{key:"icon",icon:n,showColors:!0}),t),isDisabled:o}}),[l])]},allowContext:(e,t)=>!(/\S/.test(e)||/\S/.test(t)),getOptionCompletion(e){const{name:t,initialAttributes:n,innerBlocks:o}=e;return{action:"replace",value:Object(j.createBlock)(t,n,Object(j.createBlocksFromInnerBlocksTemplate)(o))}}};const I=[];function x(e){let{completers:t=I}=e;const{name:n}=Object(k.c)();return Object(i.useMemo)(()=>{let e=t;return(n===Object(j.getDefaultBlockName)()||Object(j.getBlockSupport)(n,"__experimentalSlashInserter",!1))&&(e=e.concat([w])),Object(v.hasFilter)("editor.Autocomplete.completers")&&(e===t&&(e=e.map(a.clone)),e=Object(v.applyFilters)("editor.Autocomplete.completers",e,n)),e},[t,n])}var B=function(e){return Object(i.createElement)(u.Autocomplete,Object(l.a)({},e,{completers:x(e)}))},T=n("vtO0"),P=n("Tqx9");var R=Object(i.createElement)(P.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(i.createElement)(P.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=Object(s.__)("Toggle full height"),onToggle:o,isDisabled:r}=e;return Object(i.createElement)(u.ToolbarButton,{isActive:t,icon:R,label:n,onClick:()=>o(!t),disabled:r})},M=n("RxS6");var L=function(e){const{label:t=Object(s.__)("Change matrix alignment"),onChange:n=a.noop,value:o="center",isDisabled:r}=e,c=Object(i.createElement)(u.__experimentalAlignmentMatrixControl.Icon,{value:o}),l="block-editor-block-alignment-matrix-control";return Object(i.createElement)(u.Dropdown,{position:"bottom right",className:l,popoverProps:{className:"block-editor-block-alignment-matrix-control__popover",isAlternate:!0},renderToggle:e=>{let{onToggle:n,isOpen:o}=e;return Object(i.createElement)(u.ToolbarButton,{onClick:n,"aria-haspopup":"true","aria-expanded":o,onKeyDown:e=>{o||e.keyCode!==M.DOWN||(e.preventDefault(),n())},label:t,icon:c,showTooltip:!0,disabled:r})},renderContent:()=>Object(i.createElement)(u.__experimentalAlignmentMatrixControl,{hasFocusBorder:!1,onChange:n,value:o})})},A=n("iClF");var D=Object(i.createElement)(P.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(i.createElement)(P.Path,{d:"M10.8622 8.04053L14.2805 12.0286L10.8622 16.0167L9.72327 15.0405L12.3049 12.0286L9.72327 9.01672L10.8622 8.04053Z"})),F=n("f8JO");var z=function(e){let{rootLabelText:t}=e;const{selectBlock:n,clearSelectedBlock:o}=Object(_.useDispatch)(S.a),{clientId:r,parents:c,hasSelection:l}=Object(_.useSelect)(e=>{const{getSelectionStart:t,getSelectedBlockClientId:n,getBlockParents:o}=e(S.a),r=n();return{parents:o(r),clientId:r,hasSelection:!!t().clientId}},[]),a=t||Object(s.__)("Document");return Object(i.createElement)("ul",{className:"block-editor-block-breadcrumb",role:"list","aria-label":Object(s.__)("Block breadcrumb")},Object(i.createElement)("li",{className:l?void 0:"block-editor-block-breadcrumb__current","aria-current":l?void 0:"true"},l&&Object(i.createElement)(u.Button,{className:"block-editor-block-breadcrumb__button",variant:"tertiary",onClick:o},a),!l&&a,!!r&&Object(i.createElement)(A.a,{icon:D,className:"block-editor-block-breadcrumb__separator"})),c.map(e=>Object(i.createElement)("li",{key:e},Object(i.createElement)(u.Button,{className:"block-editor-block-breadcrumb__button",variant:"tertiary",onClick:()=>n(e)},Object(i.createElement)(F.a,{clientId:e})),Object(i.createElement)(A.a,{icon:D,className:"block-editor-block-breadcrumb__separator"}))),!!r&&Object(i.createElement)("li",{className:"block-editor-block-breadcrumb__current","aria-current":"true"},Object(i.createElement)(F.a,{clientId:r})))},H=n("TSYQ"),V=n.n(H);function G(e){let{clientId:t,tagName:n="div",wrapperProps:o,className:r}=e;const[c,a]=Object(i.useState)(!0),[s,u]=Object(i.useState)(!1),{isParentSelected:d,hasChildSelected:b,isDraggingBlocks:p,isParentHighlighted:m}=Object(_.useSelect)(e=>{const{isBlockSelected:n,hasSelectedInnerBlock:o,isDraggingBlocks:r,isBlockHighlighted:c}=e(S.a);return{isParentSelected:n(t),hasChildSelected:o(t,!0),isDraggingBlocks:r(),isParentHighlighted:c(t)}},[t]),f=V()("block-editor-block-content-overlay",null==o?void 0:o.className,r,{"overlay-active":c,"parent-highlighted":m,"is-dragging-blocks":p});return Object(i.useEffect)(()=>{d||b||c||a(!0),d&&!s&&c&&a(!1),b&&c&&a(!1)},[d,b,c,s]),Object(i.createElement)(n,Object(l.a)({},o,{className:f,onMouseEnter:()=>u(!0),onMouseLeave:()=>u(!1),onMouseUp:c?()=>a(!1):void 0}),null==o?void 0:o.children)}var U=n("uoCR"),W=n("fOYa");const q=()=>Object(i.createElement)(u.SVG,{xmlns:"https://www.w3.org/2000/svg",viewBox:"0 0 20 20"},Object(i.createElement)(u.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"})),K=e=>{let{style:t,className:n}=e;return Object(i.createElement)("div",{className:"block-library-colors-selector__icon-container"},Object(i.createElement)("div",{className:n+" block-library-colors-selector__state-selection",style:t},Object(i.createElement)(q,null)))},Y=e=>{let{TextColor:t,BackgroundColor:n}=e;return e=>{let{onToggle:o,isOpen:r}=e;return Object(i.createElement)(u.ToolbarGroup,null,Object(i.createElement)(u.ToolbarButton,{className:"components-toolbar__control block-library-colors-selector__toggle",label:Object(s.__)("Open Colors Selector"),onClick:o,onKeyDown:e=>{r||e.keyCode!==M.DOWN||(e.preventDefault(),o())},icon:Object(i.createElement)(n,null,Object(i.createElement)(t,null,Object(i.createElement)(K,null)))}))}};var $=e=>{let{children:t,...n}=e;return Object(i.createElement)(u.Dropdown,{position:"bottom right",className:"block-library-colors-selector",contentClassName:"block-library-colors-selector__popover",renderToggle:Y(n),renderContent:()=>t})},Z=n("JRTi"),X=n("OzlF"),Q=n("K9lf"),J=n("VKE3"),ee=n("+DUQ"),te=n("Xkls");const ne=Object(ee.animated)(u.__experimentalTreeGridRow);function oe(e){let{isSelected:t,position:n,level:o,rowCount:r,children:c,className:a,path:s,...u}=e;const d=Object(te.a)({isSelected:t,adjustScrolling:!1,enableAnimation:!0,triggerAnimationOnChange:s});return Object(i.createElement)(ne,Object(l.a)({ref:d,className:V()("block-editor-list-view-leaf",a),level:o,positionInSet:n,setSize:r},u),c)}var re=n("9Ma0"),ce=n("wC17");function le(e){let{onClick:t}=e;return Object(i.createElement)("span",{className:"block-editor-list-view__expander",onClick:e=>t(e,{forceToggle:!0}),"aria-hidden":"true"},Object(i.createElement)(A.a,{icon:D}))}var ie=Object(i.forwardRef)((function e(t,n){let{className:o,block:{clientId:r},isSelected:c,onClick:l,onToggleExpanded:a,position:d,siblingBlockCount:b,level:p,tabIndex:m,onFocus:f,onDragStart:h,onDragEnd:g,draggable:O}=t;const v=Object(ce.a)(r),j="list-view-block-select-button__"+Object(Q.useInstanceId)(e),k=((e,t,n)=>Object(s.sprintf)(Object(s.__)("Block %1$d of %2$d, Level %3$d"),e,t,n))(d,b,p);return Object(i.createElement)(i.Fragment,null,Object(i.createElement)(u.Button,{className:V()("block-editor-list-view-block-select-button",o),onClick:l,"aria-describedby":j,ref:n,tabIndex:m,onFocus:f,onDragStart:h,onDragEnd:g,draggable:O},Object(i.createElement)(le,{onClick:a}),Object(i.createElement)(C.a,{icon:null==v?void 0:v.icon,showColors:!0}),Object(i.createElement)(F.a,{clientId:r}),(null==v?void 0:v.anchor)&&Object(i.createElement)("span",{className:"block-editor-list-view-block-select-button__anchor"},v.anchor),c&&Object(i.createElement)(u.VisuallyHidden,null,Object(s.__)("(selected block)"))),Object(i.createElement)("div",{className:"block-editor-list-view-block-select-button__description",id:j},k))})),ae=n("ZAjO");var se=Object(i.forwardRef)((e,t)=>{let{onClick:n,onToggleExpanded:o,block:r,isSelected:c,position:a,siblingBlockCount:s,level:u,...d}=e;const{clientId:b}=r,{blockMovingClientId:p,selectedBlockInBlockEditor:m}=Object(_.useSelect)(e=>{const{getBlockRootClientId:t,hasBlockMovingClientId:n,getSelectedBlockClientId:o}=e(S.a);return{rootClientId:t(b)||"",blockMovingClientId:n(),selectedBlockInBlockEditor:o()}},[b]),f=p&&m===b,h=V()("block-editor-list-view-block-contents",{"is-dropping-before":f});return Object(i.createElement)(ae.a,{clientIds:[r.clientId]},e=>{let{draggable:b,onDragStart:p,onDragEnd:m}=e;return Object(i.createElement)(ie,Object(l.a)({ref:t,className:h,block:r,onClick:n,onToggleExpanded:o,isSelected:c,position:a,siblingBlockCount:s,level:u,draggable:b,onDragStart:p,onDragEnd:m},d))})}),ue=n("1eGn");const de=Object(i.createContext)({__experimentalFeatures:!1,__experimentalPersistentListViewFeatures:!1}),be=()=>Object(i.useContext)(de);var pe=Object(i.memo)((function(e){let{block:t,isDragged:n,isSelected:o,isBranchSelected:r,selectBlock:c,position:l,level:a,rowCount:s,siblingBlockCount:d,showBlockMovers:b,path:p,isExpanded:m}=e;const f=Object(i.useRef)(null),[h,g]=Object(i.useState)(!1),{clientId:O}=t,{toggleBlockHighlight:v}=Object(_.useDispatch)(S.a),{__experimentalFeatures:j,__experimentalPersistentListViewFeatures:k,__experimentalHideContainerBlockActions:y,isTreeGridMounted:E,expand:C,collapse:w}=be(),I=b&&d>0,x=V()("block-editor-list-view-block__mover-cell",{"is-visible":h||o}),B=V()("block-editor-list-view-block__menu-cell",{"is-visible":h||o});Object(i.useEffect)(()=>{k&&!E&&o&&f.current.focus()},[]);const T=k?v:()=>{},P=Object(i.useCallback)(()=>{g(!0),T(O,!0)},[O,g,T]),R=Object(i.useCallback)(()=>{g(!1),T(O,!1)},[O,g,T]),N=Object(i.useCallback)(e=>{e.stopPropagation(),c(O)},[O,c]),M=Object(i.useCallback)(e=>{e.stopPropagation(),!0===m?w(O):!1===m&&C(O)},[O,C,w,m]),L=j&&(!y||y&&a>1),A=j&&!L;let D;I?D=2:A&&(D=3);const F=V()({"is-selected":o,"is-branch-selected":k&&r,"is-dragging":n,"has-single-cell":A});return Object(i.createElement)(oe,{className:F,onMouseEnter:P,onMouseLeave:R,onFocus:P,onBlur:R,level:a,position:l,rowCount:s,path:p,id:"list-view-block-"+O,"data-block":O,isExpanded:m},Object(i.createElement)(u.__experimentalTreeGridCell,{className:"block-editor-list-view-block__contents-cell",colSpan:D,ref:f},e=>{let{ref:n,tabIndex:r,onFocus:c}=e;return Object(i.createElement)("div",{className:"block-editor-list-view-block__contents-container"},Object(i.createElement)(se,{block:t,onClick:N,onToggleExpanded:M,isSelected:o,position:l,siblingBlockCount:d,level:a,ref:n,tabIndex:r,onFocus:c}))}),I&&Object(i.createElement)(i.Fragment,null,Object(i.createElement)(u.__experimentalTreeGridCell,{className:x,withoutGridItem:!0},Object(i.createElement)(u.__experimentalTreeGridItem,null,e=>{let{ref:t,tabIndex:n,onFocus:o}=e;return Object(i.createElement)(re.b,{orientation:"vertical",clientIds:[O],ref:t,tabIndex:n,onFocus:o})}),Object(i.createElement)(u.__experimentalTreeGridItem,null,e=>{let{ref:t,tabIndex:n,onFocus:o}=e;return Object(i.createElement)(re.a,{orientation:"vertical",clientIds:[O],ref:t,tabIndex:n,onFocus:o})}))),L&&Object(i.createElement)(u.__experimentalTreeGridCell,{className:B},e=>{let{ref:t,tabIndex:n,onFocus:o}=e;return Object(i.createElement)(ue.a,{clientIds:[O],icon:J.a,toggleProps:{ref:t,className:"block-editor-list-view-block__menu",tabIndex:n,onFocus:o},disableOpenOnArrowDown:!0,__experimentalSelectBlock:N})}))}));function me(e,t,n){var o;if(null==n?void 0:n.includes(e.clientId))return 0;return null===(o=t[e.clientId])||void 0===o||o?1+e.innerBlocks.reduce(fe(t,n),0):1}const fe=(e,t)=>(n,o)=>{var r;if(null==t?void 0:t.includes(o.clientId))return n;return(null===(r=e[o.clientId])||void 0===r||r)&&o.innerBlocks.length>0?n+me(o,e,t):n+1};function he(e){const{blocks:t,selectBlock:n,showBlockMovers:o,showNestedBlocks:r,selectedClientIds:c,level:l=1,path:s="",isBranchSelected:u=!1,listPosition:d=0,fixedListWindow:b}=e,{expandedState:p,draggedClientIds:m,__experimentalPersistentListViewFeatures:f}=be(),h=Object(a.compact)(t),g=h.length;let O=d;return Object(i.createElement)(i.Fragment,null,h.map((e,t)=>{var d;const{clientId:v,innerBlocks:j}=e;t>0&&(O+=me(h[t-1],p,m));const k=f,{itemInView:y}=b,E=!k||y(O),C=t+1,S=s.length>0?`${s}_${C}`:""+C,w=r&&!!j&&!!j.length,I=w?null===(d=p[v])||void 0===d||d:void 0,x=!(null==m||!m.includes(v)),B=x||E,T=((e,t)=>Object(a.isArray)(t)&&t.length?-1!==t.indexOf(e):t===e)(v,c),P=u||T&&w;return Object(i.createElement)(_.AsyncModeProvider,{key:v,value:!T},B&&Object(i.createElement)(pe,{block:e,selectBlock:n,isSelected:T,isBranchSelected:P,isDragged:x,level:l,position:C,rowCount:g,siblingBlockCount:g,showBlockMovers:o,path:S,isExpanded:I,listPosition:O}),!B&&Object(i.createElement)("tr",null,Object(i.createElement)("td",{className:"block-editor-list-view-placeholder"})),w&&I&&!x&&Object(i.createElement)(he,{blocks:j,selectBlock:n,showBlockMovers:o,showNestedBlocks:r,level:l+1,path:S,listPosition:O+1,fixedListWindow:b,isBranchSelected:P,selectedClientIds:c}))}))}he.defaultProps={selectBlock:()=>{}};var ge=Object(i.memo)(he);function Oe(e){let{listViewRef:t,blockDropTarget:n}=e;const{rootClientId:o,clientId:r,dropPosition:c}=n||{},[l,a]=Object(i.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]),s=a||l,d=Object(i.useCallback)(()=>{if(!l)return 0;const e=s.getBoundingClientRect();return l.querySelector(".block-editor-block-icon").getBoundingClientRect().right-e.left},[l,s]),b=Object(i.useMemo)(()=>{if(!s)return{};const e=d();return{width:s.offsetWidth-e}},[d,s]),p=Object(i.useCallback)(()=>{if(!s)return{};const e=s.ownerDocument,t=s.getBoundingClientRect(),n=d(),o={left:t.left+n,right:t.right,width:0,height:t.height,ownerDocument:e};return"top"===c?{...o,top:t.top,bottom:t.top}:"bottom"===c||"inside"===c?{...o,top:t.bottom,bottom:t.bottom}:{}},[s,c,d]);return s?Object(i.createElement)(u.Popover,{noArrow:!0,animate:!1,getAnchorRect:p,focusOnMount:!1,className:"block-editor-list-view-drop-indicator"},Object(i.createElement)("div",{style:b,className:"block-editor-list-view-drop-indicator__line"})):null}var ve=n("vIlp"),je=n("/lNF");function ke(e,t){return t.left<=e.x&&t.right>=e.x&&t.top<=e.y&&t.bottom>=e.y}const _e=["top","bottom"];function ye(){const{getBlockRootClientId:e,getBlockIndex:t,getBlockCount:n,getDraggedBlockClientIds:o,canInsertBlocks:r}=Object(_.useSelect)(S.a),[c,l]=Object(i.useState)(),{rootClientId:a,blockIndex:s}=c||{},u=Object(je.a)(a,s),d=o(),b=Object(Q.useThrottle)(Object(i.useCallback)((o,c)=>{const i={x:o.clientX,y:o.clientY},a=!(null==d||!d.length),s=function(e,t){let n,o,r,c;for(const l of e){if(l.isDraggedBlock)continue;const i=l.element.getBoundingClientRect(),[a,s]=Object(ve.a)(t,i,_e),u=ke(t,i);if(void 0===r||a0||function(e,t){const n=t.left+t.width/2;return e.x>n}(t,c)))return{rootClientId:o.clientId,blockIndex:0,dropPosition:"inside"};if(!o.canInsertDraggedBlocksAsSibling)return;const i=l?1:0;return{rootClientId:o.rootClientId,clientId:o.clientId,blockIndex:o.blockIndex+i,dropPosition:n}}(Array.from(c.querySelectorAll("[data-block]")).map(o=>{const c=o.dataset.block,l=e(c);return{clientId:c,rootClientId:l,blockIndex:t(c),element:o,isDraggedBlock:!!a&&d.includes(c),innerBlockCount:n(c),canInsertDraggedBlocksAsSibling:!a||r(d,l),canInsertDraggedBlocksAsChild:!a||r(d,c)}}),i);s&&l(s)},[d]),200);return{ref:Object(Q.__experimentalUseDropZone)({onDrop:u,onDragOver(e){b(e,e.currentTarget)},onDragEnd(){b.cancel(),l(null)}}),target:c}}const Ee=()=>{},Ce=(e,t)=>{switch(t.type){case"expand":return{...e,[t.clientId]:!0};case"collapse":return{...e,[t.clientId]:!1};default:return e}};var Se=Object(i.forwardRef)((function(e,t){let{blocks:n,onSelect:o=Ee,__experimentalFeatures:r,__experimentalPersistentListViewFeatures:c,__experimentalHideContainerBlockActions:a,showNestedBlocks:d,showBlockMovers:b,...p}=e;const{clientIdsTree:m,draggedClientIds:f,selectedClientIds:h}=function(e){return Object(_.useSelect)(t=>{const{getDraggedBlockClientIds:n,getSelectedBlockClientIds:o,__unstableGetClientIdsTree:r}=t(S.a);return{selectedClientIds:o(),draggedClientIds:n(),clientIdsTree:e||r()}},[e])}(n),{selectBlock:g}=Object(_.useDispatch)(S.a),{visibleBlockCount:O}=Object(_.useSelect)(e=>{const{getGlobalBlockCount:t,getClientIdsOfDescendants:n}=e(S.a),o=(null==f?void 0:f.length)>0?n(f).length+1:0;return{visibleBlockCount:t()-o}},[f]),v=Object(i.useCallback)(e=>{g(e),o(e)},[g,o]),[j,k]=Object(i.useReducer)(Ce,{}),{ref:y,target:E}=ye(),C=Object(i.useRef)(),w=Object(Q.useMergeRefs)([C,y,t]),I=Object(i.useRef)(!1);Object(i.useEffect)(()=>{I.current=!0},[]);const[x]=Object(Q.__experimentalUseFixedWindowList)(C,36,O,{useWindowing:c,windowOverscan:40}),B=Object(i.useCallback)(e=>{e&&k({type:"expand",clientId:e})},[k]),T=Object(i.useCallback)(e=>{e&&k({type:"collapse",clientId:e})},[k]),P=Object(i.useCallback)(e=>{var t;B(null==e||null===(t=e.dataset)||void 0===t?void 0:t.block)},[B]),R=Object(i.useCallback)(e=>{var t;T(null==e||null===(t=e.dataset)||void 0===t?void 0:t.block)},[T]),N=Object(i.useMemo)(()=>({__experimentalFeatures:r,__experimentalPersistentListViewFeatures:c,__experimentalHideContainerBlockActions:a,isTreeGridMounted:I.current,draggedClientIds:f,expandedState:j,expand:B,collapse:T}),[r,c,a,I.current,f,j,B,T]);return Object(i.createElement)(_.AsyncModeProvider,{value:!0},Object(i.createElement)(Oe,{listViewRef:C,blockDropTarget:E}),Object(i.createElement)(u.__experimentalTreeGrid,{className:"block-editor-list-view-tree","aria-label":Object(s.__)("Block navigation structure"),ref:w,onCollapseRow:R,onExpandRow:P},Object(i.createElement)(de.Provider,{value:N},Object(i.createElement)(ge,Object(l.a)({blocks:m,selectBlock:v,showNestedBlocks:d,showBlockMovers:b,fixedListWindow:x,selectedClientIds:h},p)))))}));function we(e){let{isEnabled:t,onToggle:n,isOpen:o,innerRef:r,...c}=e;return Object(i.createElement)(u.Button,Object(l.a)({},c,{ref:r,icon:X.a,"aria-expanded":o,"aria-haspopup":"true",onClick:t?n:void 0,label:Object(s.__)("List view"),className:"block-editor-block-navigation","aria-disabled":!t}))}var Ie=Object(i.forwardRef)((function(e,t){let{isDisabled:n,__experimentalFeatures:o,...r}=e;const c=Object(_.useSelect)(e=>!!e(S.a).getBlockCount(),[])&&!n;return Object(i.createElement)(u.Dropdown,{contentClassName:"block-editor-block-navigation__popover",position:"bottom right",renderToggle:e=>{let{isOpen:n,onToggle:o}=e;return Object(i.createElement)(we,Object(l.a)({},r,{innerRef:t,isOpen:n,onToggle:o,isEnabled:c}))},renderContent:()=>Object(i.createElement)("div",{className:"block-editor-block-navigation__container"},Object(i.createElement)("p",{className:"block-editor-block-navigation__label"},Object(s.__)("List view")),Object(i.createElement)(Se,{showNestedBlocks:!0,__experimentalFeatures:o}))})})),xe=n("Civd");var Be=function(e){let{icon:t=xe.a,label:n=Object(s.__)("Choose variation"),instructions:o=Object(s.__)("Select a variation to start with."),variations:r,onSelect:c,allowSkip:l}=e;const a=V()("block-editor-block-variation-picker",{"has-many-variations":r.length>4});return Object(i.createElement)(u.Placeholder,{icon:t,label:n,instructions:o,className:a},Object(i.createElement)("ul",{className:"block-editor-block-variation-picker__variations",role:"list","aria-label":Object(s.__)("Block variations")},r.map(e=>Object(i.createElement)("li",{key:e.name},Object(i.createElement)(u.Button,{variant:"secondary",icon:e.icon,iconSize:48,onClick:()=>c(e),className:"block-editor-block-variation-picker__variation",label:e.description||e.title}),Object(i.createElement)("span",{className:"block-editor-block-variation-picker__variation-label",role:"presentation"},e.title)))),l&&Object(i.createElement)("div",{className:"block-editor-block-variation-picker__skip"},Object(i.createElement)(u.Button,{variant:"link",onClick:()=>c()},Object(s.__)("Skip"))))},Te=n("REKd"),Pe=n("2gm7"),Re=n("1iEr"),Ne=n("XNw2"),Me=n("b2RC");const Le="carousel",Ae="grid",De=e=>{let{onStartBlank:t,onBlockPatternSelect:n}=e;return Object(i.createElement)("div",{className:"block-editor-block-pattern-setup__actions"},Object(i.createElement)(u.Button,{onClick:t},Object(s.__)("Start blank")),Object(i.createElement)(u.Button,{variant:"primary",onClick:n},Object(s.__)("Choose")))},Fe=e=>{let{handlePrevious:t,handleNext:n,activeSlide:o,totalSlides:r}=e;return Object(i.createElement)("div",{className:"block-editor-block-pattern-setup__navigation"},Object(i.createElement)(u.Button,{icon:Pe.a,label:Object(s.__)("Previous pattern"),onClick:t,disabled:0===o}),Object(i.createElement)(u.Button,{icon:Re.a,label:Object(s.__)("Next pattern"),onClick:n,disabled:o===r-1}))};var ze=e=>{let{viewMode:t,setViewMode:n,handlePrevious:o,handleNext:r,activeSlide:c,totalSlides:l,onBlockPatternSelect:a,onStartBlank:d}=e;const b=t===Le,p=Object(i.createElement)("div",{className:"block-editor-block-pattern-setup__display-controls"},Object(i.createElement)(u.Button,{icon:Ne.a,label:Object(s.__)("Carousel view"),onClick:()=>n(Le),isPressed:b}),Object(i.createElement)(u.Button,{icon:Me.a,label:Object(s.__)("Grid view"),onClick:()=>n(Ae),isPressed:t===Ae}));return Object(i.createElement)("div",{className:"block-editor-block-pattern-setup__toolbar"},b&&Object(i.createElement)(Fe,{handlePrevious:o,handleNext:r,activeSlide:c,totalSlides:l}),p,b&&Object(i.createElement)(De,{onBlockPatternSelect:a,onStartBlank:d}))};var He=function(e,t,n){return Object(_.useSelect)(o=>{const{getBlockRootClientId:r,__experimentalGetPatternsByBlockTypes:c,__experimentalGetAllowedPatterns:l}=o(S.a),i=r(e);return n?l(i).filter(n):c(t,i)},[e,t,n])};const Ve=e=>{let{viewMode:t,activeSlide:n,patterns:o,onBlockPatternSelect:r}=e;const c=Object(u.__unstableUseCompositeState)(),a="block-editor-block-pattern-setup__container";if(t===Le){const e=new Map([[n,"active-slide"],[n-1,"previous-slide"],[n+1,"next-slide"]]);return Object(i.createElement)("div",{className:a},Object(i.createElement)("ul",{className:"carousel-container"},o.map((t,n)=>Object(i.createElement)(Ue,{className:e.get(n)||"",key:t.name,pattern:t}))))}return Object(i.createElement)(u.__unstableComposite,Object(l.a)({},c,{role:"listbox",className:a,"aria-label":Object(s.__)("Patterns list")}),o.map(e=>Object(i.createElement)(Ge,{key:e.name,pattern:e,onSelect:r,composite:c})))};function Ge(e){let{pattern:t,onSelect:n,composite:o}=e;const r="block-editor-block-pattern-setup-list",{blocks:c,title:a,description:s,viewportWidth:d=700}=t,b=Object(Q.useInstanceId)(Ge,r+"__item-description");return Object(i.createElement)("div",{className:r+"__list-item","aria-label":t.title,"aria-describedby":t.description?b:void 0},Object(i.createElement)(u.__unstableCompositeItem,Object(l.a)({role:"option",as:"div"},o,{className:r+"__item",onClick:()=>n(c)}),Object(i.createElement)(Te.a,{blocks:c,viewportWidth:d}),Object(i.createElement)("div",{className:r+"__item-title"},a)),!!s&&Object(i.createElement)(u.VisuallyHidden,{id:b},s))}function Ue(e){let{className:t,pattern:n}=e;const{blocks:o,title:r,description:c}=n,l=Object(Q.useInstanceId)(Ue,"block-editor-block-pattern-setup-list__item-description");return Object(i.createElement)("li",{className:"pattern-slide "+t,"aria-label":r,"aria-describedby":c?l:void 0},Object(i.createElement)(Te.a,{blocks:o,__experimentalLive:!0}),!!c&&Object(i.createElement)(u.VisuallyHidden,{id:l},c))}var We=e=>{let{clientId:t,blockName:n,filterPatternsFn:o,startBlankComponent:r,onBlockPatternSelect:c}=e;const[l,a]=Object(i.useState)(Le),[s,u]=Object(i.useState)(0),[d,b]=Object(i.useState)(!1),{replaceBlock:p}=Object(_.useDispatch)(S.a),m=He(t,n,o);if(null==m||!m.length||d)return r;const f=c||(e=>{const n=e.map(e=>Object(j.cloneBlock)(e));p(t,n)});return Object(i.createElement)("div",{className:"block-editor-block-pattern-setup view-mode-"+l},Object(i.createElement)(ze,{viewMode:l,setViewMode:a,activeSlide:s,totalSlides:m.length,handleNext:()=>{u(e=>e+1)},handlePrevious:()=>{u(e=>e-1)},onBlockPatternSelect:()=>{f(m[s].blocks)},onStartBlank:()=>{b(!0)}}),Object(i.createElement)(Ve,{viewMode:l,activeSlide:s,patterns:m,onBlockPatternSelect:f}))},qe=n("NWDH"),Ke=n("Btt3");var Ye=function(e){let{blockClientId:t}=e;const[n,o]=Object(i.useState)(),{updateBlockAttributes:r}=Object(_.useDispatch)(S.a),{variations:c,blockAttributes:l}=Object(_.useSelect)(e=>{const{getBlockVariations:n}=e(j.store),{getBlockName:o,getBlockAttributes:r}=e(S.a),c=t&&o(t);return{variations:c&&n(c,"transform"),blockAttributes:r(t)}},[t]);if(Object(i.useEffect)(()=>{var e;o(null===(e=Object(Ke.a)(l,c))||void 0===e?void 0:e.name)},[l,c]),null==c||!c.length)return null;const a=c.map(e=>{let{name:t,title:n,description:o}=e;return{value:t,label:n,info:o}}),d=e=>{r(t,{...c.find(t=>{let{name:n}=t;return n===e}).attributes})},b="block-editor-block-variation-transforms";return Object(i.createElement)(u.DropdownMenu,{className:b,label:Object(s.__)("Transform to variation"),text:Object(s.__)("Transform to variation"),popoverProps:{position:"bottom center",className:b+"__popover"},icon:qe.a,toggleProps:{iconPosition:"right"}},()=>Object(i.createElement)("div",{className:b+"__container"},Object(i.createElement)(u.MenuGroup,null,Object(i.createElement)(u.MenuItemsChoice,{choices:a,value:n,onSelect:d}))))};const $e=Object(i.createElement)(u.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(i.createElement)(u.Path,{d:"M15 4H9v11h6V4zM4 18.5V20h16v-1.5H4z"})),Ze=Object(i.createElement)(u.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(i.createElement)(u.Path,{d:"M20 11h-5V4H9v7H4v1.5h5V20h6v-7.5h5z"})),Xe={top:{icon:Object(i.createElement)(u.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(i.createElement)(u.Path,{d:"M9 20h6V9H9v11zM4 4v1.5h16V4H4z"})),title:Object(s._x)("Align top","Block vertical alignment setting")},center:{icon:Ze,title:Object(s._x)("Align middle","Block vertical alignment setting")},bottom:{icon:$e,title:Object(s._x)("Align bottom","Block vertical alignment setting")}},Qe=["top","center","bottom"],Je={isAlternate:!0};var et=function(e){let{value:t,onChange:n,controls:o=Qe,isCollapsed:r=!0,isToolbar:c}=e;const a=Xe[t],d=Xe.top,b=c?u.ToolbarGroup:u.ToolbarDropdownMenu,p=c?{isCollapsed:r}:{};return Object(i.createElement)(b,Object(l.a)({popoverProps:Je,icon:a?a.icon:d.icon,label:Object(s._x)("Change vertical alignment","Block vertical alignment setting label"),controls:o.map(e=>{return{...Xe[e],isActive:t===e,role:r?"menuitemradio":void 0,onClick:(o=e,()=>n(t===o?void 0:o))};var o})},p))};function tt(e){return Object(i.createElement)(et,Object(l.a)({},e,{isToolbar:!1}))}function nt(e){return Object(i.createElement)(et,Object(l.a)({},e,{isToolbar:!0}))}var ot=n("Wy3j"),rt=n("2YCo"),ct=n("I5Hl"),lt=n("v5LD"),it=Object(Q.createHigherOrderComponent)(e=>t=>{const n=Object(lt.a)("color.palette"),o=!Object(lt.a)("color.custom"),r=void 0===t.colors?n:t.colors,c=void 0===t.disableCustomColors?o:t.disableCustomColors,s=!Object(a.isEmpty)(r)||!c;return Object(i.createElement)(e,Object(l.a)({},t,{colors:r,disableCustomColors:c,hasColorsToChoose:s}))},"withColorContext"),at=it(u.ColorPalette),st=n("hMaJ");function ut(e){let{onChange:t,value:n,...o}=e;return Object(i.createElement)(st.a,Object(l.a)({},o,{onColorChange:t,colorValue:n,gradients:[],disableCustomGradients:!0}))}var dt=n("6c9H"),bt=n("1uGa"),pt=n("Bo0k"),mt=n("GKUk"),ft=n("xBDm"),ht=n("kVRd"),gt=n("/Hvg"),Ot=n("dchM"),vt=n("yU1v"),jt=function(e,t){return(jt=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])})(e,t)};var kt=function(){return(kt=Object.assign||function(e){for(var t,n=1,o=arguments.length;nu*r?{width:u*r,height:u}:{width:s,height:s/r}}function wt(e,t,n,o,r){void 0===r&&(r=0);var c=At(t.width,t.height,r),l=c.width,i=c.height;return{x:It(e.x,l,n.width,o),y:It(e.y,i,n.height,o)}}function It(e,t,n,o){var r=t*o/2-n/2;return Math.min(r,Math.max(e,-r))}function xt(e,t){return Math.sqrt(Math.pow(e.y-t.y,2)+Math.pow(e.x-t.x,2))}function Bt(e,t){return 180*Math.atan2(t.y-e.y,t.x-e.x)/Math.PI}function Tt(e,t,n,o,r,c,l){void 0===c&&(c=0),void 0===l&&(l=!0);var i=l&&0===c?Pt:Rt,a={x:i(100,((t.width-n.width/r)/2-e.x/r)/t.width*100),y:i(100,((t.height-n.height/r)/2-e.y/r)/t.height*100),width:i(100,n.width/t.width*100/r),height:i(100,n.height/t.height*100/r)},s=Math.round(i(t.naturalWidth,a.width*t.naturalWidth/100)),u=Math.round(i(t.naturalHeight,a.height*t.naturalHeight/100)),d=t.naturalWidth>=t.naturalHeight*o?{width:Math.round(u*o),height:u}:{width:s,height:Math.round(s/o)};return{croppedAreaPercentages:a,croppedAreaPixels:kt(kt({},d),{x:Math.round(i(t.naturalWidth-d.width,a.x*t.naturalWidth/100)),y:Math.round(i(t.naturalHeight-d.height,a.y*t.naturalHeight/100))})}}function Pt(e,t){return Math.min(e,Math.max(0,t))}function Rt(e,t){return t}function Nt(e,t,n){var o=t.width/t.naturalWidth,r=function(e,t,n){var o=t.width/t.naturalWidth;if(n)return n.height>n.width?n.height/o/e.height:n.width/o/e.width;var r=e.width/e.height;return t.naturalWidth>=t.naturalHeight*r?t.naturalHeight/e.height:t.naturalWidth/e.width}(e,t,n),c=o*r;return{crop:{x:((t.naturalWidth-e.width)/2-e.x)*c,y:((t.naturalHeight-e.height)/2-e.y)*c},zoom:r}}function Mt(e,t){return{x:(t.x+e.x)/2,y:(t.y+e.y)/2}}function Lt(e,t,n,o,r){var c=Math.cos,l=Math.sin,i=r*Math.PI/180;return[(e-n)*c(i)-(t-o)*l(i)+n,(e-n)*l(i)+(t-o)*c(i)+o]}function At(e,t,n){var o=e/2,r=t/2,c=[Lt(0,0,o,r,n),Lt(e,0,o,r,n),Lt(e,t,o,r,n),Lt(0,t,o,r,n)],l=Math.min.apply(Math,c.map((function(e){return e[0]}))),i=Math.max.apply(Math,c.map((function(e){return e[0]}))),a=Math.min.apply(Math,c.map((function(e){return e[1]})));return{width:i-l,height:Math.max.apply(Math,c.map((function(e){return e[1]})))-a}}function Dt(){for(var e=[],t=0;t0})).join(" ").trim()}var Ft=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.imageRef=null,n.videoRef=null,n.containerRef=null,n.styleRef=null,n.containerRect=null,n.mediaSize={width:0,height:0,naturalWidth:0,naturalHeight:0},n.dragStartPosition={x:0,y:0},n.dragStartCrop={x:0,y:0},n.lastPinchDistance=0,n.lastPinchRotation=0,n.rafDragTimeout=null,n.rafPinchTimeout=null,n.wheelTimer=null,n.state={cropSize:null,hasWheelJustStarted:!1},n.preventZoomSafari=function(e){return e.preventDefault()},n.cleanEvents=function(){document.removeEventListener("mousemove",n.onMouseMove),document.removeEventListener("mouseup",n.onDragStopped),document.removeEventListener("touchmove",n.onTouchMove),document.removeEventListener("touchend",n.onDragStopped)},n.clearScrollEvent=function(){n.containerRef&&n.containerRef.removeEventListener("wheel",n.onWheel),n.wheelTimer&&clearTimeout(n.wheelTimer)},n.onMediaLoad=function(){n.computeSizes(),n.emitCropData(),n.setInitialCrop(),n.props.onMediaLoaded&&n.props.onMediaLoaded(n.mediaSize)},n.setInitialCrop=function(){var e=n.props,t=e.initialCroppedAreaPixels,o=e.cropSize;if(t){var r=Nt(t,n.mediaSize,o),c=r.crop,l=r.zoom;n.props.onCropChange(c),n.props.onZoomChange&&n.props.onZoomChange(l)}},n.computeSizes=function(){var e,t,o,r,c,l,i=n.imageRef||n.videoRef;if(i&&n.containerRef){n.containerRect=n.containerRef.getBoundingClientRect(),n.mediaSize={width:i.offsetWidth,height:i.offsetHeight,naturalWidth:(null===(e=n.imageRef)||void 0===e?void 0:e.naturalWidth)||(null===(t=n.videoRef)||void 0===t?void 0:t.videoWidth)||0,naturalHeight:(null===(o=n.imageRef)||void 0===o?void 0:o.naturalHeight)||(null===(r=n.videoRef)||void 0===r?void 0:r.videoHeight)||0};var a=n.props.cropSize?n.props.cropSize:St(i.offsetWidth,i.offsetHeight,n.containerRect.width,n.containerRect.height,n.props.aspect,n.props.rotation);(null===(c=n.state.cropSize)||void 0===c?void 0:c.height)===a.height&&(null===(l=n.state.cropSize)||void 0===l?void 0:l.width)===a.width||n.props.onCropSizeChange&&n.props.onCropSizeChange(a),n.setState({cropSize:a},n.recomputeCropPosition)}},n.onMouseDown=function(e){e.preventDefault(),document.addEventListener("mousemove",n.onMouseMove),document.addEventListener("mouseup",n.onDragStopped),n.onDragStart(t.getMousePoint(e))},n.onMouseMove=function(e){return n.onDrag(t.getMousePoint(e))},n.onTouchStart=function(e){document.addEventListener("touchmove",n.onTouchMove,{passive:!1}),document.addEventListener("touchend",n.onDragStopped),2===e.touches.length?n.onPinchStart(e):1===e.touches.length&&n.onDragStart(t.getTouchPoint(e.touches[0]))},n.onTouchMove=function(e){e.preventDefault(),2===e.touches.length?n.onPinchMove(e):1===e.touches.length&&n.onDrag(t.getTouchPoint(e.touches[0]))},n.onDragStart=function(e){var t,o,r=e.x,c=e.y;n.dragStartPosition={x:r,y:c},n.dragStartCrop=kt({},n.props.crop),null===(o=(t=n.props).onInteractionStart)||void 0===o||o.call(t)},n.onDrag=function(e){var t=e.x,o=e.y;n.rafDragTimeout&&window.cancelAnimationFrame(n.rafDragTimeout),n.rafDragTimeout=window.requestAnimationFrame((function(){if(n.state.cropSize&&void 0!==t&&void 0!==o){var e=t-n.dragStartPosition.x,r=o-n.dragStartPosition.y,c={x:n.dragStartCrop.x+e,y:n.dragStartCrop.y+r},l=n.props.restrictPosition?wt(c,n.mediaSize,n.state.cropSize,n.props.zoom,n.props.rotation):c;n.props.onCropChange(l)}}))},n.onDragStopped=function(){var e,t;n.cleanEvents(),n.emitCropData(),null===(t=(e=n.props).onInteractionEnd)||void 0===t||t.call(e)},n.onWheel=function(e){e.preventDefault();var o=t.getMousePoint(e),r=Ct()(e).pixelY,c=n.props.zoom-r*n.props.zoomSpeed/200;n.setNewZoom(c,o),n.state.hasWheelJustStarted||n.setState({hasWheelJustStarted:!0},(function(){var e,t;return null===(t=(e=n.props).onInteractionStart)||void 0===t?void 0:t.call(e)})),n.wheelTimer&&clearTimeout(n.wheelTimer),n.wheelTimer=window.setTimeout((function(){return n.setState({hasWheelJustStarted:!1},(function(){var e,t;return null===(t=(e=n.props).onInteractionEnd)||void 0===t?void 0:t.call(e)}))}),250)},n.getPointOnContainer=function(e){var t=e.x,o=e.y;if(!n.containerRect)throw new Error("The Cropper is not mounted");return{x:n.containerRect.width/2-(t-n.containerRect.left),y:n.containerRect.height/2-(o-n.containerRect.top)}},n.getPointOnMedia=function(e){var t=e.x,o=e.y,r=n.props,c=r.crop,l=r.zoom;return{x:(t+c.x)/l,y:(o+c.y)/l}},n.setNewZoom=function(e,t){if(n.state.cropSize&&n.props.onZoomChange){var o=n.getPointOnContainer(t),r=n.getPointOnMedia(o),c=Math.min(n.props.maxZoom,Math.max(e,n.props.minZoom)),l={x:r.x*c-o.x,y:r.y*c-o.y},i=n.props.restrictPosition?wt(l,n.mediaSize,n.state.cropSize,c,n.props.rotation):l;n.props.onCropChange(i),n.props.onZoomChange(c)}},n.getCropData=function(){return n.state.cropSize?Tt(n.props.restrictPosition?wt(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?wt(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}jt(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}(t,e),t.prototype.componentDidMount=function(){window.addEventListener("resize",this.computeSizes),this.containerRef&&(this.props.zoomWithScroll&&this.containerRef.addEventListener("wheel",this.onWheel,{passive:!1}),this.containerRef.addEventListener("gesturestart",this.preventZoomSafari),this.containerRef.addEventListener("gesturechange",this.preventZoomSafari)),this.props.disableAutomaticStylesInjection||(this.styleRef=document.createElement("style"),this.styleRef.setAttribute("type","text/css"),this.styleRef.innerHTML=".reactEasyCrop_Container {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n overflow: hidden;\n user-select: none;\n touch-action: none;\n cursor: move;\n 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",document.head.appendChild(this.styleRef)),this.imageRef&&this.imageRef.complete&&this.onMediaLoad()},t.prototype.componentWillUnmount=function(){var e;window.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,c,l,i,a,s;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===(c=e.crop)||void 0===c?void 0:c.x)===(null===(l=this.props.crop)||void 0===l?void 0:l.x)&&(null===(i=e.crop)||void 0===i?void 0:i.y)===(null===(a=this.props.crop)||void 0===a?void 0:a.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===(s=this.videoRef)||void 0===s||s.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=xt(n,o),this.lastPinchRotation=Bt(n,o),this.onDragStart(Mt(n,o))},t.prototype.onPinchMove=function(e){var n=this,o=t.getTouchPoint(e.touches[0]),r=t.getTouchPoint(e.touches[1]),c=Mt(o,r);this.onDrag(c),this.rafPinchTimeout&&window.cancelAnimationFrame(this.rafPinchTimeout),this.rafPinchTimeout=window.requestAnimationFrame((function(){var e=xt(o,r),t=n.props.zoom*(e/n.lastPinchDistance);n.setNewZoom(t,c),n.lastPinchDistance=e;var l=Bt(o,r),i=n.props.rotation+(l-n.lastPinchRotation);n.props.onRotationChange&&n.props.onRotationChange(i),n.lastPinchRotation=l}))},t.prototype.render=function(){var e=this,t=this.props,n=t.image,o=t.video,r=t.mediaProps,c=t.transform,l=t.crop,i=l.x,a=l.y,s=t.rotation,u=t.zoom,d=t.cropShape,b=t.showGrid,p=t.style,m=p.containerStyle,f=p.cropAreaStyle,h=p.mediaStyle,g=t.classes,O=g.containerClassName,v=g.cropAreaClassName,j=g.mediaClassName,k=t.objectFit;return yt.a.createElement("div",{onMouseDown:this.onMouseDown,onTouchStart:this.onTouchStart,ref:function(t){return e.containerRef=t},"data-testid":"container",style:m,className:Dt("reactEasyCrop_Container",O)},n?yt.a.createElement("img",kt({alt:"",className:Dt("reactEasyCrop_Image","contain"===k&&"reactEasyCrop_Contain","horizontal-cover"===k&&"reactEasyCrop_Cover_Horizontal","vertical-cover"===k&&"reactEasyCrop_Cover_Vertical",j)},r,{src:n,ref:function(t){return e.imageRef=t},style:kt(kt({},h),{transform:c||"translate("+i+"px, "+a+"px) rotate("+s+"deg) scale("+u+")"}),onLoad:this.onMediaLoad})):o&&yt.a.createElement("video",kt({autoPlay:!0,loop:!0,muted:!0,className:Dt("reactEasyCrop_Video","contain"===k&&"reactEasyCrop_Contain","horizontal-cover"===k&&"reactEasyCrop_Cover_Horizontal","vertical-cover"===k&&"reactEasyCrop_Cover_Vertical",j)},r,{ref:function(t){return e.videoRef=t},onLoadedMetadata:this.onMediaLoad,style:kt(kt({},h),{transform:c||"translate("+i+"px, "+a+"px) rotate("+s+"deg) scale("+u+")"}),controls:!1}),(Array.isArray(o)?o:[{src:o}]).map((function(e){return yt.a.createElement("source",kt({key:e.src},e))}))),this.state.cropSize&&yt.a.createElement("div",{style:kt(kt({},f),{width:this.state.cropSize.width,height:this.state.cropSize.height}),"data-testid":"cropper",className:Dt("reactEasyCrop_CropArea","round"===d&&"reactEasyCrop_CropAreaRound",b&&"reactEasyCrop_CropAreaGrid",v)}))},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}(yt.a.Component);const zt={position:"bottom right",isAlternate:!0};var Ht=n("ywyh"),Vt=n.n(Ht),Gt=n("onLe");function Ut(e,t){const n=function(e){let{url:t,naturalWidth:n,naturalHeight:o}=e;const[r,c]=Object(i.useState)(),[l,a]=Object(i.useState)(),[s,u]=Object(i.useState)({x:0,y:0}),[d,b]=Object(i.useState)(),[p,m]=Object(i.useState)(),[f,h]=Object(i.useState)(),[g,O]=Object(i.useState)(),j=Object(i.useCallback)(()=>{u({x:0,y:0}),b(100),m(0),h(n/o),O(n/o)},[n,o,u,b,m,h,O]),k=Object(i.useCallback)(()=>{const e=(p+90)%360;let r=n/o;if(p%180==90&&(r=o/n),0===e)return c(),m(e),h(1/f),void u({x:-s.y*r,y:s.x*r});const l=new window.Image;l.src=t,l.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 i=n.getContext("2d");i.translate(o,l),i.rotate(e*Math.PI/180),i.drawImage(t.target,0,0),n.toBlob(t=>{c(URL.createObjectURL(t)),m(e),h(1/f),u({x:-s.y*r,y:s.x*r})})};const i=Object(v.applyFilters)("media.crossOrigin",void 0,t);"string"==typeof i&&(l.crossOrigin=i)},[p,n,o,c,m,h,u]);return Object(i.useMemo)(()=>({editedUrl:r,setEditedUrl:c,crop:l,setCrop:a,position:s,setPosition:u,zoom:d,setZoom:b,rotation:p,setRotation:m,rotateClockwise:k,aspect:f,setAspect:h,defaultAspect:g,initializeTransformValues:j}),[r,c,l,a,s,u,d,b,p,m,k,f,h,g,j])}(e),{initializeTransformValues:o}=n;return Object(i.useEffect)(()=>{t&&o()},[t,o]),n}const Wt=Object(i.createContext)({}),qt=()=>Object(i.useContext)(Wt);function Kt(e){let{id:t,url:n,naturalWidth:o,naturalHeight:r,isEditing:c,onFinishEditing:l,onSaveImage:a,children:u}=e;const d=Ut({url:n,naturalWidth:o,naturalHeight:r},c),b=function(e){let{crop:t,rotation:n,height:o,width:r,aspect:c,url:l,id:a,onSaveImage:u,onFinishEditing:d}=e;const{createErrorNotice:b}=Object(_.useDispatch)(Gt.store),[p,m]=Object(i.useState)(!1),f=Object(i.useCallback)(()=>{m(!1),d()},[m,d]),h=Object(i.useCallback)(()=>{m(!0);let e={};(t.width<99.9||t.height<99.9)&&(e=t),n>0&&(e.rotation=n),e.src=l,Vt()({path:`/wp/v2/media/${a}/edit`,method:"POST",data:e}).then(e=>{u({id:e.id,url:e.source_url,height:o&&r?r/c:void 0})}).catch(e=>{b(Object(s.sprintf)(Object(s.__)("Could not edit image. %s"),e.message),{id:"image-editing-error",type:"snackbar"})}).finally(()=>{m(!1),d()})},[m,t,n,o,r,c,l,u,b,m,d]);return Object(i.useMemo)(()=>({isInProgress:p,apply:h,cancel:f}),[p,h,f])}({id:t,url:n,onSaveImage:a,onFinishEditing:l,...d}),p=Object(i.useMemo)(()=>({...d,...b}),[d,b]);return Object(i.createElement)(Wt.Provider,{value:p},u)}function Yt(e){let{url:t,width:n,height:o,clientWidth:r,naturalHeight:c,naturalWidth:l}=e;const{isInProgress:a,editedUrl:s,position:d,zoom:b,aspect:p,setPosition:m,setCrop:f,setZoom:h,rotation:g}=qt();let O=o||r*c/l;return g%180==90&&(O=r*l/c),Object(i.createElement)("div",{className:V()("wp-block-image__crop-area",{"is-applying":a}),style:{width:n||r,height:O}},Object(i.createElement)(Ft,{image:s||t,disabled:a,minZoom:1,maxZoom:3,crop:d,zoom:b/100,aspect:p,onCropChange:m,onCropComplete:e=>{f(e)},onZoomChange:e=>{h(100*e)}}),a&&Object(i.createElement)(u.Spinner,null))}var $t=n("cGtP");function Zt(){const{isInProgress:e,zoom:t,setZoom:n}=qt();return Object(i.createElement)(u.Dropdown,{contentClassName:"wp-block-image__zoom",popoverProps:zt,renderToggle:t=>{let{isOpen:n,onToggle:o}=t;return Object(i.createElement)(u.ToolbarButton,{icon:$t.a,label:Object(s.__)("Zoom"),onClick:o,"aria-expanded":n,disabled:e})},renderContent:()=>Object(i.createElement)(u.RangeControl,{label:Object(s.__)("Zoom"),min:100,max:300,value:Math.round(t),onChange:n})})}var Xt=n("RMJe");var Qt=Object(i.createElement)(P.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(i.createElement)(P.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 Jt(e){let{aspectRatios:t,isDisabled:n,label:o,onClick:r,value:c}=e;return Object(i.createElement)(u.MenuGroup,{label:o},t.map(e=>{let{title:t,aspect:o}=e;return Object(i.createElement)(u.MenuItem,{key:o,disabled:n,onClick:()=>{r(o)},role:"menuitemradio",isSelected:o===c,icon:o===c?Xt.a:void 0},t)}))}function en(e){let{toggleProps:t}=e;const{isInProgress:n,aspect:o,setAspect:r,defaultAspect:c}=qt();return Object(i.createElement)(u.DropdownMenu,{icon:Qt,label:Object(s.__)("Aspect Ratio"),popoverProps:zt,toggleProps:t,className:"wp-block-image__aspect-ratio"},e=>{let{onClose:t}=e;return Object(i.createElement)(i.Fragment,null,Object(i.createElement)(Jt,{isDisabled:n,onClick:e=>{r(e),t()},value:o,aspectRatios:[{title:Object(s.__)("Original"),aspect:c},{title:Object(s.__)("Square"),aspect:1}]}),Object(i.createElement)(Jt,{label:Object(s.__)("Landscape"),isDisabled:n,onClick:e=>{r(e),t()},value:o,aspectRatios:[{title:Object(s.__)("16:10"),aspect:1.6},{title:Object(s.__)("16:9"),aspect:16/9},{title:Object(s.__)("4:3"),aspect:4/3},{title:Object(s.__)("3:2"),aspect:1.5}]}),Object(i.createElement)(Jt,{label:Object(s.__)("Portrait"),isDisabled:n,onClick:e=>{r(e),t()},value:o,aspectRatios:[{title:Object(s.__)("10:16"),aspect:.625},{title:Object(s.__)("9:16"),aspect:9/16},{title:Object(s.__)("3:4"),aspect:3/4},{title:Object(s.__)("2:3"),aspect:2/3}]}))})}var tn=Object(i.createElement)(P.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(i.createElement)(P.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 nn(){const{isInProgress:e,rotateClockwise:t}=qt();return Object(i.createElement)(u.ToolbarButton,{icon:tn,label:Object(s.__)("Rotate"),onClick:t,disabled:e})}function on(){const{isInProgress:e,apply:t,cancel:n}=qt();return Object(i.createElement)(i.Fragment,null,Object(i.createElement)(u.ToolbarButton,{onClick:t,disabled:e},Object(s.__)("Apply")),Object(i.createElement)(u.ToolbarButton,{onClick:n},Object(s.__)("Cancel")))}function rn(e){let{url:t,width:n,height:o,clientWidth:r,naturalHeight:c,naturalWidth:l}=e;return Object(i.createElement)(i.Fragment,null,Object(i.createElement)(Yt,{url:t,width:n,height:o,clientWidth:r,naturalHeight:c,naturalWidth:l}),Object(i.createElement)(W.b,null,Object(i.createElement)(u.ToolbarGroup,null,Object(i.createElement)(Zt,null),Object(i.createElement)(u.ToolbarItem,null,e=>Object(i.createElement)(en,{toggleProps:e})),Object(i.createElement)(nn,null)),Object(i.createElement)(u.ToolbarGroup,null,Object(i.createElement)(on,null))))}const cn=[25,50,75,100];function ln(e){let{imageWidth:t,imageHeight:n,imageSizeOptions:o=[],isResizable:r=!0,slug:c,width:l,height:d,onChange:b,onChangeImage:p=a.noop}=e;const{currentHeight:m,currentWidth:f,updateDimension:h,updateDimensions:g}=function(e,t,n,o,r){var c,l;const[a,s]=Object(i.useState)(null!==(c=null!=t?t:o)&&void 0!==c?c:""),[u,d]=Object(i.useState)(null!==(l=null!=e?e:n)&&void 0!==l?l:"");return Object(i.useEffect)(()=>{void 0===t&&void 0!==o&&s(o),void 0===e&&void 0!==n&&d(n)},[o,n]),Object(i.useEffect)(()=>{void 0!==t&&Number.parseInt(t)!==Number.parseInt(a)&&s(t),void 0!==e&&Number.parseInt(e)!==Number.parseInt(u)&&d(e)},[t,e]),{currentHeight:u,currentWidth:a,updateDimension:(e,t)=>{"width"===e?s(t):d(t),r({[e]:""===t?void 0:parseInt(t,10)})},updateDimensions:(e,t)=>{d(null!=e?e:n),s(null!=t?t:o),r({height:e,width:t})}}}(d,l,n,t,b);return Object(i.createElement)(i.Fragment,null,!Object(a.isEmpty)(o)&&Object(i.createElement)(u.SelectControl,{label:Object(s.__)("Image size"),value:c,options:o,onChange:p}),r&&Object(i.createElement)("div",{className:"block-editor-image-size-control"},Object(i.createElement)("p",{className:"block-editor-image-size-control__row"},Object(s.__)("Image dimensions")),Object(i.createElement)("div",{className:"block-editor-image-size-control__row"},Object(i.createElement)(u.TextControl,{type:"number",className:"block-editor-image-size-control__width",label:Object(s.__)("Width"),value:f,min:1,onChange:e=>h("width",e)}),Object(i.createElement)(u.TextControl,{type:"number",className:"block-editor-image-size-control__height",label:Object(s.__)("Height"),value:m,min:1,onChange:e=>h("height",e)})),Object(i.createElement)("div",{className:"block-editor-image-size-control__row"},Object(i.createElement)(u.ButtonGroup,{"aria-label":Object(s.__)("Image size presets")},cn.map(e=>{const o=Math.round(t*(e/100)),r=Math.round(n*(e/100)),c=f===o&&m===r;return Object(i.createElement)(u.Button,{key:e,isSmall:!0,variant:c?"primary":void 0,isPressed:c,onClick:()=>g(r,o)},e,"%")})),Object(i.createElement)(u.Button,{isSmall:!0,onClick:()=>g()},Object(s.__)("Reset")))))}var an=n("p3NJ"),sn=n("1oY3"),un=n("0E5u"),dn=n("btIw"),bn=n("1CF3");var pn=e=>{let{value:t,onChange:n=a.noop,settings:o}=e;if(!o||!o.length)return null;const r=e=>o=>{n({...t,[e.id]:o})},c=o.map(e=>Object(i.createElement)(u.ToggleControl,{className:"block-editor-link-control__setting",key:e.id,label:e.title,onChange:r(e),checked:!!t&&!!t[e.id]}));return Object(i.createElement)("fieldset",{className:"block-editor-link-control__settings"},Object(i.createElement)(u.VisuallyHidden,{as:"legend"},Object(s.__)("Currently selected link settings")),c)},mn=n("9Do8"),fn=n.n(mn),hn=n("Mmq9");class gn extends i.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||Object(i.createRef)(),this.inputRef=Object(i.createRef)(),this.updateSuggestions=Object(a.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,fn()(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&&Object(hn.isURL)(t)))return void this.setState({showSuggestions:!1,selectedSuggestion:null,loading:!1});this.isUpdatingSuggestions=!0,this.setState({selectedSuggestion:null,loading:!0});const c=n(t,{isInitialSuggestions:r});c.then(e=>{this.suggestionsRequest===c&&(this.setState({suggestions:e,loading:!1,showSuggestions:!!e.length}),e.length?this.props.debouncedSpeak(Object(s.sprintf)(Object(s._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(Object(s.__)("No results."),"assertive"),this.isUpdatingSuggestions=!1)}).catch(()=>{this.suggestionsRequest===c&&(this.setState({loading:!1}),this.isUpdatingSuggestions=!1)}),this.suggestionsRequest=c}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 M.UP:0!==e.target.selectionStart&&(e.preventDefault(),e.target.setSelectionRange(0,0));break;case M.DOWN:this.props.value.length!==e.target.selectionStart&&(e.preventDefault(),e.target.setSelectionRange(this.props.value.length,this.props.value.length));break;case M.ENTER:this.props.onSubmit&&this.props.onSubmit(null,e)}return}const c=this.state.suggestions[this.state.selectedSuggestion];switch(e.keyCode){case M.UP:{e.preventDefault();const t=n?n-1:o.length-1;this.setState({selectedSuggestion:t});break}case M.DOWN:{e.preventDefault();const t=null===n||n===o.length-1?0:n+1;this.setState({selectedSuggestion:t});break}case M.TAB:null!==this.state.selectedSuggestion&&(this.selectLink(c),this.props.speak(Object(s.__)("Link selected.")));break;case M.ENTER:null!==this.state.selectedSuggestion?(this.selectLink(c),this.props.onSubmit&&this.props.onSubmit(c,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:c=!1}=e,{showSuggestions:l}=t,i=l;const a=n&&n.length;return c||a||(i=!1),!0===r&&(i=!1),{showSuggestions:i,suggestionsListboxId:"block-editor-url-input-suggestions-"+o,suggestionOptionIdPrefix:"block-editor-url-input-suggestion-"+o}}render(){return Object(i.createElement)(i.Fragment,null,this.renderControl(),this.renderSuggestions())}renderControl(){const{label:e,className:t,isFullWidth:n,instanceId:o,placeholder:r=Object(s.__)("Paste URL or type to search"),__experimentalRenderControl:c,value:l=""}=this.props,{loading:a,showSuggestions:d,selectedSuggestion:b,suggestionsListboxId:p,suggestionOptionIdPrefix:m}=this.state,f={id:"url-input-control-"+o,label:e,className:V()("block-editor-url-input",t,{"is-full-width":n})},h={value:l,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":Object(s.__)("URL"),"aria-expanded":d,"aria-autocomplete":"list","aria-owns":p,"aria-activedescendant":null!==b?`${m}-${b}`:void 0,ref:this.inputRef};return c?c(f,h,a):Object(i.createElement)(u.BaseControl,f,Object(i.createElement)("input",h),a&&Object(i.createElement)(u.Spinner,null))}renderSuggestions(){const{className:e,__experimentalRenderSuggestions:t,value:n="",__experimentalShowInitialSuggestions:o=!1}=this.props,{showSuggestions:r,suggestions:c,selectedSuggestion:s,suggestionsListboxId:d,suggestionOptionIdPrefix:b,loading:p}=this.state,m={id:d,ref:this.autocompleteRef,role:"listbox"},f=(e,t)=>({role:"option",tabIndex:"-1",id:`${b}-${t}`,ref:this.bindSuggestionNode(t),"aria-selected":t===s});return Object(a.isFunction)(t)&&r&&c.length?t({suggestions:c,selectedSuggestion:s,suggestionsListProps:m,buildSuggestionItemProps:f,isLoading:p,handleSuggestionClick:this.handleOnClick,isInitialSuggestions:o&&!(n&&n.length)}):!Object(a.isFunction)(t)&&r&&c.length?Object(i.createElement)(u.Popover,{position:"bottom",noArrow:!0,focusOnMount:!1},Object(i.createElement)("div",Object(l.a)({},m,{className:V()("block-editor-url-input__suggestions",e+"__suggestions")}),c.map((e,t)=>Object(i.createElement)(u.Button,Object(l.a)({},f(0,t),{key:e.id,className:V()("block-editor-url-input__suggestion",{"is-selected":t===s}),onClick:()=>this.handleOnClick(e)}),e.title)))):null}}var On=Object(Q.compose)(Q.withSafeTimeout,u.withSpokenMessages,Q.withInstanceId,Object(_.withSelect)((e,t)=>{if(Object(a.isFunction)(t.__experimentalFetchLinkSuggestions))return;const{getSettings:n}=e(S.a);return{__experimentalFetchLinkSuggestions:n().__experimentalFetchLinkSuggestions}}))(gn),vn=n("Q4Sy");var jn=e=>{let t,{searchTerm:n,onClick:o,itemProps:r,isSelected:c,buttonText:d}=e;return n?(t=d?Object(a.isFunction)(d)?d(n):d:Object(i.createInterpolateElement)(Object(s.sprintf)(Object(s.__)("Create: %s"),n),{mark:Object(i.createElement)("mark",null)}),Object(i.createElement)(u.Button,Object(l.a)({},r,{className:V()("block-editor-link-control__search-create block-editor-link-control__search-item",{"is-selected":c}),onClick:o}),Object(i.createElement)(A.a,{className:"block-editor-link-control__search-item-icon",icon:vn.a}),Object(i.createElement)("span",{className:"block-editor-link-control__search-item-header"},Object(i.createElement)("span",{className:"block-editor-link-control__search-item-title"},t)))):null},kn=n("K8zD");var _n=e=>{let{itemProps:t,suggestion:n,isSelected:o=!1,onClick:r,isURL:c=!1,searchTerm:a="",shouldShowType:d=!1}=e;return Object(i.createElement)(u.Button,Object(l.a)({},t,{onClick:r,className:V()("block-editor-link-control__search-item",{"is-selected":o,"is-url":c,"is-entity":!c})}),c&&Object(i.createElement)(A.a,{className:"block-editor-link-control__search-item-icon",icon:kn.a}),Object(i.createElement)("span",{className:"block-editor-link-control__search-item-header"},Object(i.createElement)("span",{className:"block-editor-link-control__search-item-title"},Object(i.createElement)(u.TextHighlight,{text:n.title,highlight:a})),Object(i.createElement)("span",{"aria-hidden":!c,className:"block-editor-link-control__search-item-info"},!c&&(Object(hn.filterURLForDisplay)(Object(hn.safeDecodeURI)(n.url))||""),c&&Object(s.__)("Press ENTER to add this link"))),d&&n.type&&Object(i.createElement)("span",{className:"block-editor-link-control__search-item-type"},"post_tag"===n.type?"tag":n.type))};const yn=[{id:"opensInNewTab",title:Object(s.__)("Open in new tab")}];function En(e){let{instanceId:t,withCreateSuggestion:n,currentInputValue:o,handleSuggestionClick:r,suggestionsListProps:c,buildSuggestionItemProps:a,suggestions:d,selectedSuggestion:b,isLoading:p,isInitialSuggestions:m,createSuggestionButtonText:f,suggestionsQuery:h}=e;const g=V()("block-editor-link-control__search-results",{"is-loading":p}),O=["url","mailto","tel","internal"],v=1===d.length&&O.includes(d[0].type.toLowerCase()),j=n&&!v&&!m,k=!(null!=h&&h.type),_="block-editor-link-control-search-results-label-"+t,y=m?Object(s.__)("Recently updated"):Object(s.sprintf)(Object(s.__)('Search results for "%s"'),o),E=Object(i.createElement)(m?i.Fragment:u.VisuallyHidden,{},Object(i.createElement)("span",{className:"block-editor-link-control__search-results-label",id:_},y));return Object(i.createElement)("div",{className:"block-editor-link-control__search-results-wrapper"},E,Object(i.createElement)("div",Object(l.a)({},c,{className:g,"aria-labelledby":_}),d.map((e,t)=>j&&"__CREATE__"===e.type?Object(i.createElement)(jn,{searchTerm:o,buttonText:f,onClick:()=>r(e),key:e.type,itemProps:a(e,t),isSelected:t===b}):"__CREATE__"===e.type?null:Object(i.createElement)(_n,{key:`${e.id}-${e.type}`,itemProps:a(e,t),suggestion:e,index:t,onClick:()=>{r(e)},isSelected:t===b,isURL:O.includes(e.type.toLowerCase()),searchTerm:o,shouldShowType:k}))))}function Cn(e){const t=Object(a.startsWith)(e,"#");return Object(hn.isURL)(e)||e&&e.includes("www.")||t}const Sn=()=>Promise.resolve([]),wn=e=>{let t="URL";const n=Object(hn.getProtocol)(e)||"";return n.includes("mailto")&&(t="mailto"),n.includes("tel")&&(t="tel"),Object(a.startsWith)(e,"#")&&(t="internal"),Promise.resolve([{id:e,title:e,url:"URL"===t?Object(hn.prependHTTP)(e):e,type:t}])};function In(e,t,n,o){const{fetchSearchSuggestions:r}=Object(_.useSelect)(e=>{const{getSettings:t}=e(S.a);return{fetchSearchSuggestions:t().__experimentalFetchLinkSuggestions}},[]),c=t?wn:Sn;return Object(i.useCallback)((t,l)=>{let{isInitialSuggestions:i}=l;return Cn(t)?c(t,{isInitialSuggestions:i}):(async(e,t,n,o,r,c)=>{const{isInitialSuggestions:l}=t;let i=await Promise.all([n(e,t),o(e)]);return i=!e.includes(" ")&&c&&!l?i[0].concat(i[1]):i[0],l||Cn(e)||!r?i:i.concat({title:e,url:e,type:"__CREATE__"})})(t,{...e,isInitialSuggestions:i},r,c,n,o)},[c,r,n])}const xn=()=>Promise.resolve([]),Bn=Object(i.forwardRef)((e,t)=>{let{value:n,children:o,currentLink:r={},className:c=null,placeholder:l=null,withCreateSuggestion:u=!1,onCreateSuggestion:d=a.noop,onChange:b=a.noop,onSelect:p=a.noop,showSuggestions:m=!0,renderSuggestions:f=(e=>Object(i.createElement)(En,e)),fetchSuggestions:h=null,allowDirectEntry:g=!0,showInitialSuggestions:O=!1,suggestionsQuery:v={},withURLSuggestion:j=!0,createSuggestionButtonText:k,useLabel:_=!1}=e;const y=In(v,g,u,j),E=m?h||y:xn,C=Object(Q.useInstanceId)(Bn),[S,w]=Object(i.useState)(),I=async e=>{let t=e;if("__CREATE__"!==e.type)(g||t&&Object.keys(t).length>=1)&&p({...Object(a.omit)(r,"id","url"),...t},t);else try{var n;t=await d(e.title),null!==(n=t)&&void 0!==n&&n.url&&p(t)}catch(e){}},x=V()(c,{"has-no-label":!_});return Object(i.createElement)("div",{className:"block-editor-link-control__search-input-container"},Object(i.createElement)(On,{label:_?"URL":void 0,className:x,value:n,onChange:(e,t)=>{b(e),w(t)},placeholder:null!=l?l:Object(s.__)("Search or type url"),__experimentalRenderSuggestions:m?e=>f({...e,instanceId:C,withCreateSuggestion:u,currentInputValue:n,createSuggestionButtonText:k,suggestionsQuery:v,handleSuggestionClick:t=>{e.handleSuggestionClick&&e.handleSuggestionClick(t),I(t)}}):null,__experimentalFetchLinkSuggestions:E,__experimentalHandleURLSuggestions:!0,__experimentalShowInitialSuggestions:O,onSubmit:(e,t)=>{var o;const r=e||S;r||null!=n&&null!==(o=n.trim())&&void 0!==o&&o.length?I(r||{url:n}):t.preventDefault()},ref:t}),o)});var Tn=Bn,Pn=n("FnAh"),Rn=n("B9Az"),Nn=n("Mp0b");const{Slot:Mn,Fill:Ln}=Object(u.createSlotFill)("BlockEditorLinkControlViewer");function An(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 Dn=function(e){const[t,n]=Object(i.useReducer)(An,{richData:null,isFetching:!1}),{fetchRichUrlData:o}=Object(_.useSelect)(e=>{const{getSettings:t}=e(S.a);return{fetchRichUrlData:t().__experimentalFetchRichUrlData}},[]);return Object(i.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 Fn(e){var t;let{value:n,onEditClick:o,hasRichPreviews:r=!1,hasUnlinkControl:c=!1,onRemove:l}=e;const a=r?null==n?void 0:n.url:null,{richData:d,isFetching:b}=Dn(a),p=d&&Object.keys(d).length,m=n&&Object(hn.filterURLForDisplay)(Object(hn.safeDecodeURI)(n.url),16)||"",f=(null==d?void 0:d.title)||(null==n?void 0:n.title)||m,h=!(null!=n&&null!==(t=n.url)&&void 0!==t&&t.length);let g;return g=null!=d&&d.icon?Object(i.createElement)("img",{src:null==d?void 0:d.icon,alt:""}):h?Object(i.createElement)(A.a,{icon:Pn.a,size:32}):Object(i.createElement)(A.a,{icon:kn.a}),Object(i.createElement)("div",{"aria-label":Object(s.__)("Currently selected"),"aria-selected":"true",className:V()("block-editor-link-control__search-item",{"is-current":!0,"is-rich":p,"is-fetching":!!b,"is-preview":!0,"is-error":h})},Object(i.createElement)("div",{className:"block-editor-link-control__search-item-top"},Object(i.createElement)("span",{className:"block-editor-link-control__search-item-header"},Object(i.createElement)("span",{className:V()("block-editor-link-control__search-item-icon",{"is-image":null==d?void 0:d.icon})},g),Object(i.createElement)("span",{className:"block-editor-link-control__search-item-details"},h?Object(i.createElement)("span",{className:"block-editor-link-control__search-item-error-notice"},"Link is empty"):Object(i.createElement)(i.Fragment,null,Object(i.createElement)(u.ExternalLink,{className:"block-editor-link-control__search-item-title",href:n.url},Object(bn.__unstableStripHTML)(f)),(null==n?void 0:n.url)&&Object(i.createElement)("span",{className:"block-editor-link-control__search-item-info"},m)))),Object(i.createElement)(u.Button,{icon:Rn.a,label:Object(s.__)("Edit"),className:"block-editor-link-control__search-item-action",onClick:o,iconSize:24}),c&&Object(i.createElement)(u.Button,{icon:Nn.a,label:Object(s.__)("Unlink"),className:"block-editor-link-control__search-item-action block-editor-link-control__unlink",onClick:l,iconSize:24}),Object(i.createElement)(Mn,{fillProps:n})),(p&&((null==d?void 0:d.image)||(null==d?void 0:d.description))||b)&&Object(i.createElement)("div",{className:"block-editor-link-control__search-item-bottom"},((null==d?void 0:d.image)||b)&&Object(i.createElement)("div",{"aria-hidden":!(null!=d&&d.image),className:V()("block-editor-link-control__search-item-image",{"is-placeholder":!(null!=d&&d.image)})},(null==d?void 0:d.image)&&Object(i.createElement)("img",{src:null==d?void 0:d.image,alt:""})),((null==d?void 0:d.description)||b)&&Object(i.createElement)("div",{"aria-hidden":!(null!=d&&d.description),className:V()("block-editor-link-control__search-item-description",{"is-placeholder":!(null!=d&&d.description)})},(null==d?void 0:d.description)&&Object(i.createElement)(u.__experimentalText,{truncate:!0,numberOfLines:"2"},d.description))))}const zn=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}}};function Hn(e){var t,n,o;let{searchInputPlaceholder:r,value:c,settings:l=yn,onChange:d=a.noop,onRemove:b,noDirectEntry:p=!1,showSuggestions:m=!0,showInitialSuggestions:f,forceIsEditingLink:h,createSuggestion:g,withCreateSuggestion:O,inputValue:v="",suggestionsQuery:j={},noURLSuggestion:k=!1,createSuggestionButtonText:_,hasRichPreviews:y=!1,hasTextControl:E=!1,renderControlBottom:C=null}=e;void 0===O&&g&&(O=!0);const S=Object(i.useRef)(!0),w=Object(i.useRef)(),I=Object(i.useRef)(),[x,B]=Object(i.useState)((null==c?void 0:c.url)||""),[T,P]=Object(i.useState)((null==c?void 0:c.title)||""),R=v||x,[N,L]=Object(i.useState)(void 0!==h?h:!c||!c.url),A=Object(i.useRef)(!1),D=!(null!=R&&null!==(t=R.trim())&&void 0!==t&&t.length);function F(){var e;A.current=!(null===(e=w.current)||void 0===e||!e.contains(w.current.ownerDocument.activeElement)),L(!1)}Object(i.useEffect)(()=>{void 0!==h&&h!==N&&L(h)},[h]),Object(i.useEffect)(()=>{if(S.current)return void(S.current=!1);const e=null!=I&&I.current?1:0;(bn.focus.focusable.find(w.current)[e]||w.current).focus(),A.current=!1},[N]),Object(i.useEffect)(()=>{null!=c&&c.title&&c.title!==T&&P(c.title),null!=c&&c.url&&B(c.url)},[c]);const{createPage:z,isCreatingPage:H,errorMessage:G}=function(e){const t=Object(i.useRef)(),[n,o]=Object(i.useState)(!1),[r,c]=Object(i.useState)(null);return Object(i.useEffect)(()=>()=>{t.current&&t.current.cancel()},[]),{createPage:async function(n){o(!0),c(null);try{return t.current=zn(Promise.resolve(e(n))),await t.current.promise}catch(e){if(e&&e.isCanceled)return;throw c(e.message||Object(s.__)("An unknown error occurred during creation. Please try again.")),e}finally{o(!1)}},isCreatingPage:n,errorMessage:r}}(g),U=()=>{R===(null==c?void 0:c.url)&&T===(null==c?void 0:c.title)||d({url:R,title:T}),F()},W=b&&c&&!N&&!H,q=!(null==l||!l.length),K=(null==c||null===(n=c.url)||void 0===n||null===(o=n.trim())||void 0===o?void 0:o.length)>0&&E;return Object(i.createElement)("div",{tabIndex:-1,ref:w,className:"block-editor-link-control"},H&&Object(i.createElement)("div",{className:"block-editor-link-control__loading"},Object(i.createElement)(u.Spinner,null)," ",Object(s.__)("Creating"),"…"),(N||!c)&&!H&&Object(i.createElement)(i.Fragment,null,Object(i.createElement)("div",{className:V()({"block-editor-link-control__search-input-wrapper":!0,"has-text-control":K})},K&&Object(i.createElement)(u.TextControl,{ref:I,className:"block-editor-link-control__field block-editor-link-control__text-content",label:"Text",value:T,onChange:P,onKeyDown:e=>{const{keyCode:t}=e;t!==M.ENTER||D||(e.preventDefault(),U())}}),Object(i.createElement)(Tn,{currentLink:c,className:"block-editor-link-control__field block-editor-link-control__search-input",placeholder:r,value:R,withCreateSuggestion:O,onCreateSuggestion:z,onChange:B,onSelect:e=>{d({...e,title:T||(null==e?void 0:e.title)}),F()},showInitialSuggestions:f,allowDirectEntry:!p,showSuggestions:m,suggestionsQuery:j,withURLSuggestion:!k,createSuggestionButtonText:_,useLabel:K},Object(i.createElement)("div",{className:"block-editor-link-control__search-actions"},Object(i.createElement)(u.Button,{onClick:U,label:Object(s.__)("Submit"),icon:dn.a,className:"block-editor-link-control__search-submit",disabled:D})))),G&&Object(i.createElement)(u.Notice,{className:"block-editor-link-control__search-error",status:"error",isDismissible:!1},G)),c&&!N&&!H&&Object(i.createElement)(Fn,{key:null==c?void 0:c.url,value:c,onEditClick:()=>L(!0),hasRichPreviews:y,hasUnlinkControl:W,onRemove:b}),q&&Object(i.createElement)("div",{className:"block-editor-link-control__tools"},Object(i.createElement)(pn,{value:c,settings:l,onChange:d})),C&&C())}Hn.ViewerFill=Ln;var Vn=Hn,Gn=n("weEX"),Un=n("gdqT"),Wn=n("rH4q"),qn=n("NTP4");var Kn=Object(u.withFilters)("editor.MediaUpload")(()=>null);var Yn=function(e){let{fallback:t=null,children:n}=e;return Object(_.useSelect)(e=>{const{getSettings:t}=e(S.a);return!!t().mediaUpload},[])?n:t};var $n=Object(Q.compose)([Object(_.withDispatch)(e=>{const{createNotice:t,removeNotice:n}=e(Gt.store);return{createNotice:t,removeNotice:n}}),Object(u.withFilters)("editor.MediaReplaceFlow")])(e=>{let{mediaURL:t,mediaId:n,allowedTypes:o,accept:r,onSelect:c,onSelectURL:l,onFilesUpload:d=a.noop,name:b=Object(s.__)("Replace"),createNotice:p,removeNotice:m,children:f}=e;const[h,g]=Object(i.useState)(t),O=Object(_.useSelect)(e=>e(S.a).getSettings().mediaUpload,[]),v=Object(i.createRef)(),j=Object(a.uniqueId)("block-editor/media-replace-flow/error-notice/"),k=e=>{const t=document.createElement("div");t.innerHTML=Object(i.renderToString)(e);const n=t.textContent||t.innerText||"";setTimeout(()=>{p("error",n,{speak:!0,id:j,isDismissible:!0})},1e3)},y=e=>{g(e.url),c(e),Object(Un.speak)(Object(s.__)("The media file has been replaced")),m(j)},E=e=>{e.keyCode===M.DOWN&&(e.preventDefault(),e.target.click())};return Object(i.createElement)(u.Dropdown,{popoverProps:{isAlternate:!0},contentClassName:"block-editor-media-replace-flow__options",renderToggle:e=>{let{isOpen:t,onToggle:n}=e;return Object(i.createElement)(u.ToolbarButton,{ref:v,"aria-expanded":t,"aria-haspopup":"true",onClick:n,onKeyDown:E},b)},renderContent:e=>{let{onClose:t}=e;return Object(i.createElement)(i.Fragment,null,Object(i.createElement)(u.NavigableMenu,{className:"block-editor-media-replace-flow__media-upload-menu"},Object(i.createElement)(Kn,{value:n,onSelect:e=>y(e),allowedTypes:o,render:e=>{let{open:t}=e;return Object(i.createElement)(u.MenuItem,{icon:Wn.a,onClick:t},Object(s.__)("Open Media Library"))}}),Object(i.createElement)(Yn,null,Object(i.createElement)(u.FormFileUpload,{onChange:e=>{(e=>{const t=e.target.files;d(t);O({allowedTypes:o,filesList:t,onFileChange:e=>{let[t]=e;y(t)},onError:k})})(e)},accept:r,render:e=>{let{openFileDialog:t}=e;return Object(i.createElement)(u.MenuItem,{icon:qn.a,onClick:()=>{t()}},Object(s.__)("Upload"))}})),f),l&&Object(i.createElement)("form",{className:"block-editor-media-flow__url-input"},Object(i.createElement)("span",{className:"block-editor-media-replace-flow__image-url-label"},Object(s.__)("Current media URL:")),Object(i.createElement)(Vn,{value:{url:h},settings:[],showSuggestions:!1,onChange:e=>{let{url:t}=e;g(t),l(t),v.current.focus()}})))}})}),Zn=n("NMb1"),Xn=n.n(Zn);function Qn(e){let{url:t,urlLabel:n,className:o}=e;const r=V()(o,"block-editor-url-popover__link-viewer-url");return t?Object(i.createElement)(u.ExternalLink,{className:r,href:t},n||Object(hn.filterURLForDisplay)(Object(hn.safeDecodeURI)(t))):Object(i.createElement)("span",{className:r})}function Jn(e){let{additionalControls:t,children:n,renderSettings:o,position:r="bottom center",focusOnMount:c="firstElement",...a}=e;const[d,b]=Object(i.useState)(!1),p=!!o&&d;return Object(i.createElement)(u.Popover,Object(l.a)({className:"block-editor-url-popover",focusOnMount:c,position:r},a),Object(i.createElement)("div",{className:"block-editor-url-popover__input-container"},Object(i.createElement)("div",{className:"block-editor-url-popover__row"},n,!!o&&Object(i.createElement)(u.Button,{className:"block-editor-url-popover__settings-toggle",icon:qe.a,label:Object(s.__)("Link settings"),onClick:()=>{b(!d)},"aria-expanded":d})),p&&Object(i.createElement)("div",{className:"block-editor-url-popover__row block-editor-url-popover__settings"},o())),t&&!p&&Object(i.createElement)("div",{className:"block-editor-url-popover__additional-controls"},t))}Jn.LinkEditor=function(e){let{autocompleteRef:t,className:n,onChangeInputValue:o,value:r,...c}=e;return Object(i.createElement)("form",Object(l.a)({className:V()("block-editor-url-popover__link-editor",n)},c),Object(i.createElement)(On,{value:r,onChange:o,autocompleteRef:t}),Object(i.createElement)(u.Button,{icon:dn.a,label:Object(s.__)("Apply"),type:"submit"}))},Jn.LinkViewer=function(e){let{className:t,linkClassName:n,onEditLinkClick:o,url:r,urlLabel:c,...a}=e;return Object(i.createElement)("div",Object(l.a)({className:V()("block-editor-url-popover__link-viewer",t)},a),Object(i.createElement)(Qn,{url:r,urlLabel:c,className:n}),o&&Object(i.createElement)(u.Button,{icon:Rn.a,label:Object(s.__)("Edit"),onClick:o}))};var eo=Jn;const to=e=>{let{src:t,onChange:n,onSubmit:o,onClose:r}=e;return Object(i.createElement)(eo,{onClose:r},Object(i.createElement)("form",{className:"block-editor-media-placeholder__url-input-form",onSubmit:o},Object(i.createElement)("input",{className:"block-editor-media-placeholder__url-input-field",type:"text","aria-label":Object(s.__)("URL"),placeholder:Object(s.__)("Paste or type URL"),onChange:n,value:t}),Object(i.createElement)(u.Button,{className:"block-editor-media-placeholder__url-input-submit-button",icon:dn.a,label:Object(s.__)("Apply"),type:"submit"})))};var no=Object(u.withFilters)("editor.MediaPlaceholder")((function(e){let{value:t={},allowedTypes:n,className:o,icon:r,labels:c={},mediaPreview:l,notices:d,isAppender:b,accept:p,addToGallery:m,multiple:f=!1,handleUpload:h=!0,dropZoneUIOnly:g,disableDropZone:O,disableMediaButtons:v,onError:j,onSelect:k,onCancel:y,onSelectURL:E,onDoubleClick:C,onFilesPreUpload:w=a.noop,onHTMLDrop:I=a.noop,children:x,mediaLibraryButton:B,placeholder:T,style:P}=e;const R=Object(_.useSelect)(e=>{const{getSettings:t}=e(S.a);return t().mediaUpload},[]),[N,M]=Object(i.useState)(""),[L,A]=Object(i.useState)(!1);Object(i.useEffect)(()=>{var e;M(null!==(e=null==t?void 0:t.src)&&void 0!==e?e:"")},[null==t?void 0:t.src]);const D=e=>{M(e.target.value)},F=()=>{A(!0)},z=()=>{A(!1)},H=e=>{e.preventDefault(),N&&E&&(E(N),z())},G=e=>{if(!h)return k(e);let o;if(w(e),f)if(m){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)}));k(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=k;else o=e=>{let[t]=e;return k(t)};R({allowedTypes:n,filesList:e,onFileChange:o,onError:j})},U=e=>{G(e.target.files)},W=null!=T?T:e=>{let{instructions:t,title:a}=c;if(R||E||(t=Object(s.__)("To edit this block, you need permission to upload media.")),void 0===t||void 0===a){const e=null!=n?n:[],[o]=e,r=1===e.length,c=r&&"audio"===o,l=r&&"image"===o,i=r&&"video"===o;void 0===t&&R&&(t=Object(s.__)("Upload a media file or pick one from your media library."),c?t=Object(s.__)("Upload an audio file, pick one from your media library, or add one with a URL."):l?t=Object(s.__)("Upload an image file, pick one from your media library, or add one with a URL."):i&&(t=Object(s.__)("Upload a video file, pick one from your media library, or add one with a URL."))),void 0===a&&(a=Object(s.__)("Media"),c?a=Object(s.__)("Audio"):l?a=Object(s.__)("Image"):i&&(a=Object(s.__)("Video")))}const p=V()("block-editor-media-placeholder",o,{"is-appender":b});return Object(i.createElement)(u.Placeholder,{icon:r,label:a,instructions:t,className:p,notices:d,onDoubleClick:C,preview:l,style:P},e,x)},q=()=>O?null:Object(i.createElement)(u.DropZone,{onFilesDrop:G,onHTMLDrop:I}),K=()=>y&&Object(i.createElement)(u.Button,{className:"block-editor-media-placeholder__cancel-button",title:Object(s.__)("Cancel"),variant:"link",onClick:y},Object(s.__)("Cancel")),Y=()=>E&&Object(i.createElement)("div",{className:"block-editor-media-placeholder__url-input-container"},Object(i.createElement)(u.Button,{className:"block-editor-media-placeholder__button",onClick:F,isPressed:L,variant:"tertiary"},Object(s.__)("Insert from URL")),L&&Object(i.createElement)(to,{src:N,onChange:D,onSubmit:H,onClose:z}));return g||v?(g&&Xn()("wp.blockEditor.MediaPlaceholder dropZoneUIOnly prop",{since:"5.4",alternative:"disableMediaButtons"}),Object(i.createElement)(Yn,null,q())):Object(i.createElement)(Yn,{fallback:W(Y())},(()=>{const e=null!=B?B:e=>{let{open:t}=e;return Object(i.createElement)(u.Button,{variant:"tertiary",onClick:()=>{t()}},Object(s.__)("Media Library"))},o=Object(i.createElement)(Kn,{addToGallery:m,gallery:f&&!(!n||0===n.length)&&n.every(e=>"image"===e||e.startsWith("image/")),multiple:f,onSelect:k,allowedTypes:n,value:Array.isArray(t)?t.map(e=>{let{id:t}=e;return t}):t.id,render:e});if(R&&b)return Object(i.createElement)(i.Fragment,null,q(),Object(i.createElement)(u.FormFileUpload,{onChange:U,accept:p,multiple:f,render:e=>{let{openFileDialog:t}=e;const n=Object(i.createElement)(i.Fragment,null,Object(i.createElement)(u.Button,{variant:"primary",className:V()("block-editor-media-placeholder__button","block-editor-media-placeholder__upload-button"),onClick:t},Object(s.__)("Upload")),o,Y(),K());return W(n)}}));if(R){const e=Object(i.createElement)(i.Fragment,null,q(),Object(i.createElement)(u.FormFileUpload,{variant:"primary",className:V()("block-editor-media-placeholder__button","block-editor-media-placeholder__upload-button"),onChange:U,accept:p,multiple:f},Object(s.__)("Upload")),o,Y(),K());return W(e)}return W(o)})())}));var oo=e=>{let{colorSettings:t,...n}=e;const o=t.map(e=>{let{value:t,onChange:n,...o}=e;return{...o,colorValue:t,onColorChange:n}});return Object(i.createElement)(vt.a,Object(l.a)({settings:o,gradients:[],disableCustomGradients:!0},n))},ro=n("O6Fj"),co=n.n(ro),lo=n("qRz9");const io={position:"bottom right",isAlternate:!0};var ao=()=>Object(i.createElement)(i.Fragment,null,["bold","italic","link"].map(e=>Object(i.createElement)(u.Slot,{name:"RichText.ToolbarControls."+e,key:e})),Object(i.createElement)(u.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 Object(i.createElement)(u.ToolbarItem,null,n=>Object(i.createElement)(u.DropdownMenu,{icon:qe.a,label:Object(s.__)("More"),toggleProps:{...n,className:V()(n.className,{"is-pressed":t}),describedBy:Object(s.__)("Displays more block tools")},controls:Object(a.orderBy)(e.map(e=>{let[{props:t}]=e;return t}),"title"),popoverProps:io}))}));var so=e=>{let{inline:t,anchorRef:n}=e;return t?Object(i.createElement)(u.Popover,{noArrow:!0,position:"top center",focusOnMount:!1,anchorRef:n,className:"block-editor-rich-text__inline-format-toolbar",__unstableSlotName:"block-toolbar"},Object(i.createElement)("div",{className:"block-editor-rich-text__inline-format-toolbar-group"},Object(i.createElement)(u.ToolbarGroup,null,Object(i.createElement)(ao,null)))):Object(i.createElement)(W.b,{group:"inline"},Object(i.createElement)(ao,null))};function uo(){const{didAutomaticChange:e,getSettings:t}=Object(_.useSelect)(S.a);return Object(Q.useRefEffect)(n=>{function o(n){const{keyCode:o}=n;n.defaultPrevented||o!==M.DELETE&&o!==M.BACKSPACE&&o!==M.ESCAPE||e()&&(n.preventDefault(),t().__experimentalUndo())}return n.addEventListener("keydown",o),()=>{n.removeEventListener("keydown",o)}},[])}var bo=n("xTGt");function po(e){return e.filter(e=>{let{type:t}=e;return/^image\/(?:jpe?g|png|gif)$/.test(t)}).map(e=>``).join("")}var mo=n("SVSp");function fo(e,t){if(null!=t&&t.length){let n=e.formats.length;for(;n--;)e.formats[n]=[...t,...e.formats[n]||[]]}}function ho(e){if(!0===e||"p"===e||"li"===e)return!0===e?"p":e}function go(e){let{allowedFormats:t,formattingControls:n,disableFormats:o}=e;return o?go.EMPTY_ARRAY:t||n?t||(Xn()("wp.blockEditor.RichText formattingControls prop",{since:"5.4",alternative:"allowedFormats"}),n.map(e=>"core/"+e)):void 0}go.EMPTY_ARRAY=[];function Oo(e){let{value:t,pastedBlocks:n=[],onReplace:o,onSplit:r,onSplitMiddle:c,multilineTag:l}=e;if(!o||!r)return;const i=[],[a,s]=Object(lo.split)(t),u=n.length>0;let d=-1;const b=Object(lo.isEmpty)(a)&&!Object(lo.isEmpty)(s);u&&Object(lo.isEmpty)(a)||(i.push(r(Object(lo.toHTMLString)({value:a,multilineTag:l}),!b)),d+=1),u?(i.push(...n),d+=n.length):c&&i.push(c()),(u||c)&&Object(lo.isEmpty)(s)||i.push(r(Object(lo.toHTMLString)({value:s,multilineTag:l}),b));o(i,u?d:1,u?-1:0)}function vo(e,t){return t?Object(lo.replace)(e,/\n+/g,lo.__UNSTABLE_LINE_SEPARATOR):Object(lo.replace)(e,new RegExp(lo.__UNSTABLE_LINE_SEPARATOR,"g"),"\n")}function jo(e){const t=Object(i.useRef)(e);return t.current=e,Object(Q.useRefEffect)(e=>{function n(e){const{isSelected:n,disableFormats:o,onChange:r,value:c,formatTypes:l,tagName:i,onReplace:a,onSplit:s,onSplitMiddle:u,__unstableEmbedURLOnPaste:d,multilineTag:b,preserveWhiteSpace:p,pastePlainText:m}=t.current;if(!n)return void e.preventDefault();const{clipboardData:f}=e;let h="",g="";try{h=f.getData("text/plain"),g=f.getData("text/html")}catch(e){try{g=f.getData("Text")}catch(e){return}}if(g=function(e){return e.replace(/.*/s,"").replace(/.*/s,"")}(g),g=function(e){const t="";if(e.startsWith(t))return e.slice(t.length);return e}(g),e.preventDefault(),window.console.log("Received HTML:\n\n",g),window.console.log("Received plain text:\n\n",h),o)return void r(Object(lo.insert)(c,h));const O=l.reduce((e,t)=>{let{__unstablePasteRule:n}=t;return n&&e===c&&(e=n(c,{html:g,plainText:h})),e},c);if(O!==c)return void r(O);const v=[...Object(bn.getFilesFromDataTransfer)(f)];if("true"===f.getData("rich-text")){const e=f.getData("rich-text-multi-line-tag")||void 0;let t=Object(lo.create)({html:g,multilineTag:e,multilineWrapperTags:"li"===e?["ul","ol"]:void 0,preserveWhiteSpace:p});return t=vo(t,!!b),fo(t,c.activeFormats),void r(Object(lo.insert)(c,t))}if(m)return void r(Object(lo.insert)(c,Object(lo.create)({text:h})));if(v&&v.length&&!g){const e=Object(j.pasteHandler)({HTML:po(v),mode:"BLOCKS",tagName:i,preserveWhiteSpace:p});return window.console.log("Received items:\n\n",v),void(a&&Object(lo.isEmpty)(c)?a(e):Oo({value:c,pastedBlocks:e,onReplace:a,onSplit:s,onSplitMiddle:u,multilineTag:b}))}let k=a&&s?"AUTO":"INLINE";var _;"AUTO"===k&&Object(lo.isEmpty)(c)&&(_=h,Object(mo.regexp)(".*").test(_))&&(k="BLOCKS"),d&&Object(lo.isEmpty)(c)&&Object(hn.isURL)(h.trim())&&(k="BLOCKS");const y=Object(j.pasteHandler)({HTML:g,plainText:h,mode:k,tagName:i,preserveWhiteSpace:p});if("string"==typeof y){let e=Object(lo.create)({html:y});e=vo(e,!!b),fo(e,c.activeFormats),r(Object(lo.insert)(c,e))}else y.length>0&&(a&&Object(lo.isEmpty)(c)?a(y,y.length-1,-1):Oo({value:c,pastedBlocks:y,onReplace:a,onSplit:s,onSplitMiddle:u,multilineTag:b}))}return e.addEventListener("paste",n),()=>{e.removeEventListener("paste",n)}},[])}function ko(e){const{__unstableMarkLastChangeAsPersistent:t,__unstableMarkAutomaticChange:n}=Object(_.useDispatch)(S.a),o=Object(i.useRef)(e);return o.current=e,Object(Q.useRefEffect)(e=>{function r(){const{value:e,onReplace:t}=o.current;if(!t)return;const{start:r,text:c}=e;if(" "!==c.slice(r-1,r))return;const l=c.slice(0,r).trim(),i=Object(j.getBlockTransforms)("from").filter(e=>{let{type:t}=e;return"prefix"===t}),a=Object(j.findTransform)(i,e=>{let{prefix:t}=e;return l===t});if(!a)return;const s=Object(lo.toHTMLString)({value:Object(lo.slice)(e,r,c.length)});t([a.transform(s)]),n()}function c(e){const{inputType:c,type:l}=e,{value:i,onChange:a,__unstableAllowPrefixTransformations:s,formatTypes:u}=o.current;if("insertText"!==c&&"compositionend"!==l)return;s&&r&&r();const d=u.reduce((e,t)=>{let{__unstableInputRule:n}=t;return n&&(e=n(e)),e},i);d!==i&&(t(),a({...d,activeFormats:i.activeFormats}),n())}return e.addEventListener("input",c),e.addEventListener("compositionend",c),()=>{e.removeEventListener("input",c),e.removeEventListener("compositionend",c)}},[])}function _o(e){const{__unstableMarkAutomaticChange:t}=Object(_.useDispatch)(S.a),n=Object(i.useRef)(e);return n.current=e,Object(Q.useRefEffect)(e=>{function o(e){if(e.defaultPrevented)return;const{removeEditorOnlyFormats:o,value:r,onReplace:c,onSplit:l,onSplitMiddle:i,multilineTag:a,onChange:s,disableLineBreaks:u,onSplitAtEnd:d}=n.current;if(e.keyCode!==M.ENTER)return;e.preventDefault();const b={...r};b.formats=o(r);const p=c&&l;if(c){const e=Object(j.getBlockTransforms)("from").filter(e=>{let{type:t}=e;return"enter"===t}),n=Object(j.findTransform)(e,e=>e.regExp.test(b.text));n&&(c([n.transform({content:b.text})]),t())}if(a)e.shiftKey?u||s(Object(lo.insert)(b,"\n")):p&&Object(lo.__unstableIsEmptyLine)(b)?Oo({value:b,onReplace:c,onSplit:l,onSplitMiddle:i,multilineTag:a}):s(Object(lo.__unstableInsertLineSeparator)(b));else{const{text:t,start:n,end:o}=b,r=d&&n===o&&o===t.length;e.shiftKey||!p&&!r?u||s(Object(lo.insert)(b,"\n")):!p&&r?d():p&&Oo({value:b,onReplace:c,onSplit:l,onSplitMiddle:i,multilineTag:a})}}return e.addEventListener("keydown",o),()=>{e.removeEventListener("keydown",o)}},[])}function yo(e){return e(lo.store).getFormatTypes()}const Eo=new Set(["a","audio","button","details","embed","iframe","input","label","select","textarea","video"]);function Co(e){return Object(Q.useRefEffect)(t=>{function n(t){for(const n of e.current)n(t)}return t.addEventListener("keydown",n),()=>{t.removeEventListener("keydown",n)}},[])}function So(e){return Object(Q.useRefEffect)(t=>{function n(t){for(const n of e.current)n(t)}return t.addEventListener("input",n),()=>{t.removeEventListener("input",n)}},[])}function wo(e){let{formatTypes:t,onChange:n,onFocus:o,value:r,forwardedRef:c}=e;return t.map(e=>{const{name:t,edit:l}=e;if(!l)return null;const s=Object(lo.getActiveFormat)(r,t);let u=void 0!==s;const d=Object(lo.getActiveObject)(r),b=void 0!==d&&d.type===t;if("core/link"===t&&!Object(lo.isCollapsed)(r)){const e=r.formats,t=Object(a.find)(e[r.start],{type:"core/link"}),n=Object(a.find)(e[r.end-1],{type:"core/link"});t&&n&&t===n||(u=!1)}return Object(i.createElement)(l,{key:t,isActive:u,activeAttributes:u&&s.attributes||{},isObjectActive:b,activeObjectAttributes:b&&d.attributes||{},value:r,onChange:n,onFocus:o,contentRef:c})})}const Io=Object(i.createContext)(),xo=Object(i.createContext)();const Bo=Object(i.forwardRef)((function e(t,n){let{children:o,tagName:r="div",value:c="",onChange:s,isSelected:d,multiline:b,inlineToolbar:p,wrapperClassName:m,autocompleters:f,onReplace:h,placeholder:g,allowedFormats:O,formattingControls:v,withoutInteractiveFormatting:y,onRemove:E,onMerge:C,onSplit:w,__unstableOnSplitAtEnd:I,__unstableOnSplitMiddle:B,identifier:T,preserveWhiteSpace:P,__unstablePastePlainText:R,__unstableEmbedURLOnPaste:N,__unstableDisableFormats:L,disableLineBreaks:A,unstableOnFocus:D,__unstableAllowPrefixTransformations:F,...z}=t;const H=Object(Q.useInstanceId)(e);T=T||H,z=function(e){return Object(a.omit)(e,["__unstableMobileNoFocusOnMount","deleteEnter","placeholderTextColor","textAlign","selectionColor","tagsToEliminate","rootTagsToEliminate","disableEditingMenu","fontSize","fontFamily","fontWeight","fontStyle","minWidth","maxWidth","setRef"])}(z);const G=Object(i.useRef)(),{clientId:U}=Object(k.c)(),{selectionStart:W,selectionEnd:q,isSelected:K,disabled:Y}=Object(_.useSelect)(e=>{const{getSelectionStart:t,getSelectionEnd:n,isMultiSelecting:o,hasMultiSelection:r}=e(S.a),c=t(),l=n();let i;return void 0===d?i=c.clientId===U&&c.attributeKey===T:d&&(i=c.clientId===U),{selectionStart:i?c.offset:void 0,selectionEnd:i?l.offset:void 0,isSelected:i,disabled:o()||r()}}),{selectionChange:$}=Object(_.useDispatch)(S.a),Z=ho(b),X=go({allowedFormats:O,formattingControls:v,disableFormats:L}),J=!X||X.length>0;let ee=c,te=s;Array.isArray(c)&&(ee=j.children.toHTML(c),te=e=>s(j.children.fromDOM(Object(lo.__unstableCreateElement)(document,e).childNodes)));const ne=Object(i.useCallback)((e,t)=>{$(U,T,e,t)},[U,T]),{formatTypes:oe,prepareHandlers:re,valueHandlers:ce,changeHandlers:le,dependencies:ie}=function(e){let{clientId:t,identifier:n,withoutInteractiveFormatting:o,allowedFormats:r}=e;const c=Object(_.useSelect)(yo,[]),l=Object(i.useMemo)(()=>c.filter(e=>{let{name:t,tagName:n}=e;return!(r&&!r.includes(t))&&(!o||!Eo.has(n))}),[c,r,Eo]),a=Object(_.useSelect)(e=>l.reduce((o,r)=>(r.__experimentalGetPropsForEditableTreePreparation&&(o[r.name]=r.__experimentalGetPropsForEditableTreePreparation(e,{richTextIdentifier:n,blockClientId:t})),o),{}),[l,t,n]),s=Object(_.useDispatch)(),u=[],d=[],b=[],p=[];return l.forEach(e=>{if(e.__experimentalCreatePrepareEditableTree){const o=a[e.name],r=e.__experimentalCreatePrepareEditableTree(o,{richTextIdentifier:n,blockClientId:t});e.__experimentalCreateOnChangeEditableValue?d.push(r):u.push(r);for(const e in o)p.push(o[e])}if(e.__experimentalCreateOnChangeEditableValue){let o={};e.__experimentalGetPropsForEditableTreeChangeHandler&&(o=e.__experimentalGetPropsForEditableTreeChangeHandler(s,{richTextIdentifier:n,blockClientId:t})),b.push(e.__experimentalCreateOnChangeEditableValue({...a[e.name]||{},...o},{richTextIdentifier:n,blockClientId:t}))}}),{formatTypes:l,prepareHandlers:u,valueHandlers:d,changeHandlers:b,dependencies:p}}({clientId:U,identifier:T,withoutInteractiveFormatting:y,allowedFormats:X});function ae(e){return oe.forEach(t=>{t.__experimentalCreatePrepareEditableTree&&(e=Object(lo.removeFormat)(e,t.name,0,e.text.length))}),e.formats}const{value:se,onChange:ue,ref:de}=Object(lo.__unstableUseRichText)({value:ee,onChange(e,t){let{__unstableFormats:n,__unstableText:o}=t;te(e),Object.values(le).forEach(e=>{e(n,o)})},selectionStart:W,selectionEnd:q,onSelectionChange:ne,placeholder:g,__unstableIsSelected:K,__unstableMultilineTag:Z,__unstableDisableFormats:L,preserveWhiteSpace:P,__unstableDependencies:[...ie,r],__unstableAfterParse:function(e){return ce.reduce((t,n)=>n(t,e.text),e.formats)},__unstableBeforeSerialize:ae,__unstableAddInvisibleFormats:function(e){return re.reduce((t,n)=>n(t,e.text),e.formats)}}),be=function(e){return Object(u.__unstableUseAutocompleteProps)({...e,completers:x(e)})}({onReplace:h,completers:f,record:se,onChange:ue});!function(e){let{value:t}=e;const n=t.activeFormats&&!!t.activeFormats.length,{isCaretWithinFormattedText:o}=Object(_.useSelect)(S.a),{enterFormattedText:r,exitFormattedText:c}=Object(_.useDispatch)(S.a);Object(i.useEffect)(()=>{n?o()||r():o()&&c()},[n])}({value:se}),function(e){let{html:t,value:n}=e;const o=Object(i.useRef)(),r=n.activeFormats&&!!n.activeFormats.length,{__unstableMarkLastChangeAsPersistent:c}=Object(_.useDispatch)(S.a);Object(i.useLayoutEffect)(()=>{if(o.current){if(o.current!==n.text){const e=window.setTimeout(()=>{c()},1e3);return o.current=n.text,()=>{window.clearTimeout(e)}}c()}else o.current=n.text},[t,r])}({html:ee,value:se});const pe=Object(i.useRef)(new Set),me=Object(i.useRef)(new Set);function fe(){G.current.focus()}const he=r,ge=Object(i.createElement)(i.Fragment,null,K&&Object(i.createElement)(Io.Provider,{value:pe},Object(i.createElement)(xo.Provider,{value:me},Object(i.createElement)(u.Popover.__unstableSlotNameProvider,{value:"__unstable-block-tools-after"},o&&o({value:se,onChange:ue,onFocus:fe}),Object(i.createElement)(wo,{value:se,onChange:ue,onFocus:fe,formatTypes:oe,forwardedRef:G})))),K&&J&&Object(i.createElement)(so,{inline:p,anchorRef:G.current}),Object(i.createElement)(he,Object(l.a)({role:"textbox","aria-multiline":!0,"aria-label":g},z,be,{ref:Object(Q.useMergeRefs)([be.ref,z.ref,de,ko({value:se,onChange:ue,__unstableAllowPrefixTransformations:F,formatTypes:oe,onReplace:h}),Object(Q.useRefEffect)(e=>{function t(e){(M.isKeyboardEvent.primary(e,"z")||M.isKeyboardEvent.primary(e,"y")||M.isKeyboardEvent.primaryShift(e,"z"))&&e.preventDefault()}return e.addEventListener("keydown",t),()=>{e.addEventListener("keydown",t)}},[]),Co(pe),So(me),uo(),jo({isSelected:K,disableFormats:L,onChange:ue,value:se,formatTypes:oe,tagName:r,onReplace:h,onSplit:w,onSplitMiddle:B,__unstableEmbedURLOnPaste:N,multilineTag:Z,preserveWhiteSpace:P,pastePlainText:R}),_o({removeEditorOnlyFormats:ae,value:se,onReplace:h,onSplit:w,onSplitMiddle:B,multilineTag:Z,onChange:ue,disableLineBreaks:A,onSplitAtEnd:I}),G,n]),contentEditable:!Y||void 0,suppressContentEditableWarning:!Y,className:V()("block-editor-rich-text__editable",z.className,"rich-text"),onFocus:D,onKeyDown:function(e){const{keyCode:t}=e;if(!e.defaultPrevented&&(t===M.DELETE||t===M.BACKSPACE)){const{start:n,end:o,text:r}=se,c=t===M.BACKSPACE,l=se.activeFormats&&!!se.activeFormats.length;if(!Object(lo.isCollapsed)(se)||l||c&&0!==n||!c&&o!==r.length)return;C&&C(!c),E&&Object(lo.isEmpty)(se)&&c&&E(!c),e.preventDefault()}}})));if(!m)return ge;Xn()("wp.blockEditor.RichText wrapperClassName prop",{since:"5.4",alternative:"className prop or create your own wrapper div"});const Oe=V()("block-editor-rich-text",m);return Object(i.createElement)("div",{className:Oe},ge)}));Bo.Content=e=>{let{value:t,tagName:n,multiline:o,...r}=e;Array.isArray(t)&&(t=j.children.toHTML(t));const c=ho(o);!t&&c&&(t=`<${c}>`);const l=Object(i.createElement)(i.RawHTML,null,t);return n?Object(i.createElement)(n,Object(a.omit)(r,["format"]),l):l},Bo.isEmpty=e=>!e||0===e.length;var To=Bo;const Po=Object(i.forwardRef)((e,t)=>Object(i.createElement)(To,Object(l.a)({ref:t},e,{__unstableDisableFormats:!0,preserveWhiteSpace:!0})));Po.Content=e=>{let{value:t="",tagName:n="div",...o}=e;return Object(i.createElement)(n,o,t)};var Ro=Po;var No=Object(i.forwardRef)((e,t)=>{let{__experimentalVersion:n,...o}=e;if(2===n)return Object(i.createElement)(Ro,Object(l.a)({ref:t},o));const{className:r,onChange:c,...a}=o;return Object(i.createElement)(co.a,Object(l.a)({ref:t,className:V()("block-editor-plain-text",r),onChange:e=>c(e.target.value)},a))});function Mo(e){let{property:t,viewport:n,desc:o}=e;const r=Object(Q.useInstanceId)(Mo),c=o||Object(s.sprintf)(Object(s._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 Object(i.createElement)(i.Fragment,null,Object(i.createElement)("span",{"aria-describedby":"rbc-desc-"+r},n.label),Object(i.createElement)(u.VisuallyHidden,{as:"span",id:"rbc-desc-"+r},c))}var Lo=function(e){const{title:t,property:n,toggleLabel:o,onIsResponsiveChange:r,renderDefaultControl:c,renderResponsiveControls:l,isResponsive:a=!1,defaultLabel:d={id:"all",label:Object(s.__)("All")},viewports:b=[{id:"small",label:Object(s.__)("Small screens")},{id:"medium",label:Object(s.__)("Medium screens")},{id:"large",label:Object(s.__)("Large screens")}]}=e;if(!t||!n||!c)return null;const p=o||Object(s.sprintf)(Object(s.__)("Use the same %s on all screensizes."),n),m=Object(s.__)("Toggle between using the same value for all screen sizes or using a unique value per screen size."),f=c(Object(i.createElement)(Mo,{property:n,viewport:d}),d);return Object(i.createElement)("fieldset",{className:"block-editor-responsive-block-control"},Object(i.createElement)("legend",{className:"block-editor-responsive-block-control__title"},t),Object(i.createElement)("div",{className:"block-editor-responsive-block-control__inner"},Object(i.createElement)(u.ToggleControl,{className:"block-editor-responsive-block-control__toggle",label:p,checked:!a,onChange:r,help:m}),Object(i.createElement)("div",{className:V()("block-editor-responsive-block-control__group",{"is-responsive":a})},!a&&f,a&&(l?l(b):b.map(e=>Object(i.createElement)(i.Fragment,{key:e.id},c(Object(i.createElement)(Mo,{property:n,viewport:e}),e)))))))};function Ao(e){let{character:t,type:n,onUse:o}=e;const r=Object(i.useContext)(Io),c=Object(i.useRef)();return c.current=o,Object(i.useEffect)(()=>{function e(e){M.isKeyboardEvent[n](e,t)&&(c.current(),e.preventDefault())}return r.current.add(e),()=>{r.current.delete(e)}},[t,n]),null}function Do(e){let t,{name:n,shortcutType:o,shortcutCharacter:r,...c}=e,a="RichText.ToolbarControls";return n&&(a+="."+n),o&&r&&(t=M.displayShortcut[o](r)),Object(i.createElement)(u.Fill,{name:a},Object(i.createElement)(u.ToolbarButton,Object(l.a)({},c,{shortcut:t})))}function Fo(e){let{inputType:t,onInput:n}=e;const o=Object(i.useContext)(xo),r=Object(i.useRef)();return r.current=n,Object(i.useEffect)(()=>{function e(e){e.inputType===t&&(r.current(),e.preventDefault())}return o.current.add(e),()=>{o.current.delete(e)}},[t]),null}const zo=Object(i.createElement)(u.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},Object(i.createElement)(u.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 Ho=Object(i.forwardRef)((function(e,t){const n=Object(_.useSelect)(e=>e(S.a).isNavigationMode(),[]),{setNavigationMode:o}=Object(_.useDispatch)(S.a),r=e=>{o("edit"!==e)};return Object(i.createElement)(u.Dropdown,{renderToggle:o=>{let{isOpen:r,onToggle:c}=o;return Object(i.createElement)(u.Button,Object(l.a)({},e,{ref:t,icon:n?zo:Rn.a,"aria-expanded":r,"aria-haspopup":"true",onClick:c,label:Object(s.__)("Tools")}))},position:"bottom right",renderContent:()=>Object(i.createElement)(i.Fragment,null,Object(i.createElement)(u.NavigableMenu,{role:"menu","aria-label":Object(s.__)("Tools")},Object(i.createElement)(u.MenuItemsChoice,{value:n?"select":"edit",onSelect:r,choices:[{value:"edit",label:Object(i.createElement)(i.Fragment,null,Object(i.createElement)(A.a,{icon:Rn.a}),Object(s.__)("Edit"))},{value:"select",label:Object(i.createElement)(i.Fragment,null,zo,Object(s.__)("Select"))}]})),Object(i.createElement)("div",{className:"block-editor-tool-selector__help"},Object(s.__)("Tools provide different interactions for selecting, navigating, and editing blocks. Toggle between select and edit by pressing Escape and Enter.")))})}));function Vo(e){let{units:t,...n}=e;const o=Object(u.__experimentalUseCustomUnits)({availableUnits:Object(lt.a)("spacing.units")||["%","px","em","rem","vw"],units:t});return Object(i.createElement)(u.__experimentalUnitControl,Object(l.a)({units:o},n))}var Go=n("Bpkj"),Uo=n("cjQ8");class Wo extends i.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?Object(s.__)("Edit link"):Object(s.__)("Insert link");return Object(i.createElement)("div",{className:"block-editor-url-input__button"},Object(i.createElement)(u.Button,{icon:Go.a,label:o,onClick:this.toggle,className:"components-toolbar__control",isPressed:!!e}),n&&Object(i.createElement)("form",{className:"block-editor-url-input__button-modal",onSubmit:this.submitLink},Object(i.createElement)("div",{className:"block-editor-url-input__button-modal-line"},Object(i.createElement)(u.Button,{className:"block-editor-url-input__back",icon:Uo.a,label:Object(s.__)("Close"),onClick:this.toggle}),Object(i.createElement)(On,{value:e||"",onChange:t}),Object(i.createElement)(u.Button,{icon:dn.a,label:Object(s.__)("Submit"),type:"submit"}))))}}var qo=Wo,Ko=n("w95h");const Yo=["noreferrer","noopener"],$o=Object(i.createElement)(u.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Object(i.createElement)(u.Path,{d:"M0,0h24v24H0V0z",fill:"none"}),Object(i.createElement)(u.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"}),Object(i.createElement)(u.Path,{d:"m14.14 11.86l-3 3.87-2.14-2.59-3 3.86h12l-3.86-5.14z"})),Zo=e=>{let{linkDestination:t,onChangeUrl:n,url:o,mediaType:r="image",mediaUrl:c,mediaLink:l,linkTarget:d,linkClass:b,rel:p}=e;const[m,f]=Object(i.useState)(!1),h=Object(i.useCallback)(()=>{f(!0)}),[g,O]=Object(i.useState)(!1),[v,j]=Object(i.useState)(null),k=Object(i.useRef)(null),_=Object(i.useCallback)(()=>{"media"!==t&&"attachment"!==t||j(""),O(!0)}),y=Object(i.useCallback)(()=>{O(!1)}),E=Object(i.useCallback)(()=>{j(null),y(),f(!1)}),C=e=>{let t=e;return void 0===e||Object(a.isEmpty)(t)||Object(a.isEmpty)(t)||(Object(a.each)(Yo,e=>{const n=new RegExp("\\b"+e+"\\b","gi");t=t.replace(n,"")}),t!==e&&(t=t.trim()),Object(a.isEmpty)(t)&&(t=void 0)),t},S=Object(i.useCallback)(()=>e=>{const t=k.current;t&&t.contains(e.target)||(f(!1),j(null),y())}),w=Object(i.useCallback)(()=>e=>{if(v){var t;const e=(null===(t=x().find(e=>e.url===v))||void 0===t?void 0:t.linkDestination)||"custom";n({href:v,linkDestination:e})}y(),j(null),e.preventDefault()}),I=Object(i.useCallback)(()=>{n({linkDestination:"none",href:""})}),x=()=>{const e=[{linkDestination:"media",title:Object(s.__)("Media File"),url:"image"===r?c:void 0,icon:$o}];return"image"===r&&l&&e.push({linkDestination:"attachment",title:Object(s.__)("Attachment Page"),url:"image"===r?l:void 0,icon:Object(i.createElement)(u.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Object(i.createElement)(u.Path,{d:"M0 0h24v24H0V0z",fill:"none"}),Object(i.createElement)(u.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},B=Object(i.createElement)(i.Fragment,null,Object(i.createElement)(u.ToggleControl,{label:Object(s.__)("Open in new tab"),onChange:e=>{const t=(e=>{const t=e?"_blank":void 0;let n;return n=t||p?C(p):void 0,{linkTarget:t,rel:n}})(e);n(t)},checked:"_blank"===d}),Object(i.createElement)(u.TextControl,{label:Object(s.__)("Link Rel"),value:C(p)||"",onChange:e=>{n({rel:e})}}),Object(i.createElement)(u.TextControl,{label:Object(s.__)("Link CSS Class"),value:b||"",onChange:e=>{n({linkClass:e})}})),T=null!==v?v:o,P=(Object(a.find)(x(),["linkDestination",t])||{}).title;return Object(i.createElement)(i.Fragment,null,Object(i.createElement)(u.ToolbarButton,{icon:Go.a,className:"components-toolbar__control",label:o?Object(s.__)("Edit link"):Object(s.__)("Insert link"),"aria-expanded":m,onClick:h}),m&&Object(i.createElement)(eo,{onFocusOutside:S(),onClose:E,renderSettings:()=>B,additionalControls:!T&&Object(i.createElement)(u.NavigableMenu,null,Object(a.map)(x(),e=>Object(i.createElement)(u.MenuItem,{key:e.linkDestination,icon:e.icon,onClick:()=>{j(null),(e=>{const t=x();let o;o=e?(Object(a.find)(t,t=>t.url===e)||{linkDestination:"custom"}).linkDestination:"none",n({linkDestination:o,href:e})})(e.url),y()}},e.title)))},(!o||g)&&Object(i.createElement)(eo.LinkEditor,{className:"block-editor-format-toolbar__link-container-content",value:T,onChangeInputValue:j,onSubmit:w(),autocompleteRef:k}),o&&!g&&Object(i.createElement)(i.Fragment,null,Object(i.createElement)(eo.LinkViewer,{className:"block-editor-format-toolbar__link-container-content",url:o,onEditLinkClick:_,urlLabel:P}),Object(i.createElement)(u.Button,{icon:Ko.a,label:Object(s.__)("Remove link"),onClick:I}))))};var Xo=n("Jyyd"),Qo=n("mlss");function Jo(e){let{children:t,className:n,isEnabled:o=!0,deviceType:r,setDeviceType:c}=e;if(Object(Q.useViewportMatch)("small","<"))return null;const l={className:V()(n,"block-editor-post-preview__dropdown-content"),position:"bottom left"},a={variant:"tertiary",className:"block-editor-post-preview__button-toggle",disabled:!o,children:Object(s.__)("Preview")};return Object(i.createElement)(u.DropdownMenu,{className:"block-editor-post-preview__dropdown",popoverProps:l,toggleProps:a,icon:null},()=>Object(i.createElement)(i.Fragment,null,Object(i.createElement)(u.MenuGroup,null,Object(i.createElement)(u.MenuItem,{className:"block-editor-post-preview__button-resize",onClick:()=>c("Desktop"),icon:"Desktop"===r&&Xt.a},Object(s.__)("Desktop")),Object(i.createElement)(u.MenuItem,{className:"block-editor-post-preview__button-resize",onClick:()=>c("Tablet"),icon:"Tablet"===r&&Xt.a},Object(s.__)("Tablet")),Object(i.createElement)(u.MenuItem,{className:"block-editor-post-preview__button-resize",onClick:()=>c("Mobile"),icon:"Mobile"===r&&Xt.a},Object(s.__)("Mobile"))),t))}function er(e){const[t,n]=Object(i.useState)(window.innerWidth);Object(i.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{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 tr=n("PKbb");var nr=Object(_.withSelect)(e=>({selectedBlockClientId:e(S.a).getBlockSelectionStart()}))(e=>{let{selectedBlockClientId:t}=e;const n=Object(tr.b)(t);return t?Object(i.createElement)(u.Button,{variant:"secondary",className:"block-editor-skip-to-selected-block",onClick:()=>{n.current.focus()}},Object(s.__)("Skip to the selected block")):null}),or=n("GvwK"),rr=n("7NR9"),cr=n("7fqt"),lr=n("wzfx");var ir=Object(_.withSelect)(e=>{const{getMultiSelectedBlocks:t}=e(S.a);return{blocks:t()}})((function(e){let{blocks:t}=e;const n=Object(cr.count)(Object(j.serialize)(t),"words");return Object(i.createElement)("div",{className:"block-editor-multi-selection-inspector__card"},Object(i.createElement)(C.a,{icon:lr.a,showColors:!0}),Object(i.createElement)("div",{className:"block-editor-multi-selection-inspector__card-content"},Object(i.createElement)("div",{className:"block-editor-multi-selection-inspector__card-title"},Object(s.sprintf)(Object(s._n)("%d block","%d blocks",t.length),t.length)),Object(i.createElement)("div",{className:"block-editor-multi-selection-inspector__card-description"},Object(s.sprintf)(Object(s._n)("%d word","%d words",n),n))))}));function ar(e){let{blockName:t}=e;const{preferredStyle:n,onUpdatePreferredStyleVariations:o,styles:r}=Object(_.useSelect)(e=>{var n,o;const r=e(S.a).getSettings().__experimentalPreferredStyleVariations;return{preferredStyle:null==r||null===(n=r.value)||void 0===n?void 0:n[t],onUpdatePreferredStyleVariations:null!==(o=null==r?void 0:r.onChange)&&void 0!==o?o:null,styles:e(j.store).getBlockStyles(t)}},[t]),c=Object(i.useMemo)(()=>[{label:Object(s.__)("Not set"),value:""},...r.map(e=>{let{label:t,name:n}=e;return{label:t,value:n}})],[r]),l=Object(i.useCallback)(e=>{o(t,e)},[t,o]);return o&&Object(i.createElement)(u.SelectControl,{options:c,value:n||"",label:Object(s.__)("Default Style"),onChange:l})}const sr=e=>{let{clientId:t,blockName:n,hasBlockStyles:o,bubblesVirtually:r}=e;const c=Object(ce.a)(t);return Object(i.createElement)("div",{className:"block-editor-block-inspector"},Object(i.createElement)(or.a,c),Object(i.createElement)(Ye,{blockClientId:t}),o&&Object(i.createElement)("div",null,Object(i.createElement)(u.PanelBody,{title:Object(s.__)("Styles")},Object(i.createElement)(rr.a,{clientId:t}),Object(j.hasBlockSupport)(n,"defaultStylePicker",!0)&&Object(i.createElement)(ar,{blockName:n}))),Object(i.createElement)(sn.b.Slot,{bubblesVirtually:r}),Object(i.createElement)(sn.b.Slot,{__experimentalGroup:"typography",bubblesVirtually:r,label:Object(s.__)("Typography")}),Object(i.createElement)(sn.b.Slot,{__experimentalGroup:"dimensions",bubblesVirtually:r,label:Object(s.__)("Dimensions")}),Object(i.createElement)(sn.b.Slot,{__experimentalGroup:"border",label:Object(s.__)("Border")}),Object(i.createElement)("div",null,Object(i.createElement)(ur,{bubblesVirtually:r})),Object(i.createElement)(nr,{key:"back"}))},ur=e=>{let{bubblesVirtually:t}=e;const n=Object(u.__experimentalUseSlot)(sn.a.slotName);return Boolean(n.fills&&n.fills.length)?Object(i.createElement)(u.PanelBody,{className:"block-editor-block-inspector__advanced",title:Object(s.__)("Advanced"),initialOpen:!1},Object(i.createElement)(sn.b.Slot,{__experimentalGroup:"advanced",bubblesVirtually:t})):null};var dr=e=>{let{showNoBlockSelectedMessage:t=!0,bubblesVirtually:n=!0}=e;const{count:o,hasBlockStyles:r,selectedBlockName:c,selectedBlockClientId:l,blockType:a}=Object(_.useSelect)(e=>{const{getSelectedBlockClientId:t,getSelectedBlockCount:n,getBlockName:o}=e(S.a),{getBlockStyles:r}=e(j.store),c=t(),l=c&&o(c),i=l&&Object(j.getBlockType)(l),a=l&&r(l);return{count:n(),selectedBlockClientId:c,selectedBlockName:l,blockType:i,hasBlockStyles:a&&a.length>0}},[]);if(o>1)return Object(i.createElement)("div",{className:"block-editor-block-inspector"},Object(i.createElement)(ir,null),Object(i.createElement)(sn.b.Slot,null),Object(i.createElement)(sn.b.Slot,{__experimentalGroup:"typography",label:Object(s.__)("Typography")}),Object(i.createElement)(sn.b.Slot,{__experimentalGroup:"dimensions",label:Object(s.__)("Dimensions")}),Object(i.createElement)(sn.b.Slot,{__experimentalGroup:"border",label:Object(s.__)("Border")}));const u=c===Object(j.getUnregisteredTypeHandlerName)();return a&&l&&!u?Object(i.createElement)(sr,{clientId:l,blockName:a.name,hasBlockStyles:r,bubblesVirtually:n}):t?Object(i.createElement)("span",{className:"block-editor-block-inspector__no-blocks"},Object(s.__)("No block selected.")):null},br=n("VyCT"),pr=n("nlh6"),mr=n("w8sn"),fr=n("JygI"),hr=n("zQI6"),gr=n("U1WI"),Or=n("pXCJ"),vr=n("+gtr"),jr=n("hF7m"),kr=n("PS/H"),_r=n("xCFn"),yr=n("JUfZ"),Er=n("2z9l");function Cr(e){let{children:t,__unstableContentRef:n,...o}=e;const r=Object(Q.useViewportMatch)("medium"),c=Object(_.useSelect)(e=>e(S.a).getSettings().hasFixedToolbar,[]),s=Object(jr.__unstableUseShortcutEventMatch)(),{getSelectedBlockClientIds:d,getBlockRootClientId:b}=Object(_.useSelect)(S.a),{duplicateBlocks:p,removeBlocks:m,insertAfterBlock:f,insertBeforeBlock:h,clearSelectedBlock:g,moveBlocksUp:O,moveBlocksDown:v}=Object(_.useDispatch)(S.a);return Object(i.createElement)("div",Object(l.a)({},o,{onKeyDown:function(e){if(s("core/block-editor/move-up",e)){const t=d();if(t.length){e.preventDefault();const n=b(Object(a.first)(t));O(t,n)}}else if(s("core/block-editor/move-down",e)){const t=d();if(t.length){e.preventDefault();const n=b(Object(a.first)(t));v(t,n)}}else if(s("core/block-editor/duplicate",e)){const t=d();t.length&&(e.preventDefault(),p(t))}else if(s("core/block-editor/remove",e)){const t=d();t.length&&(e.preventDefault(),m(t))}else if(s("core/block-editor/insert-after",e)){const t=d();t.length&&(e.preventDefault(),f(Object(a.last)(t)))}else if(s("core/block-editor/insert-before",e)){const t=d();t.length&&(e.preventDefault(),h(Object(a.first)(t)))}else if(s("core/block-editor/delete-multi-selection",e)){if(["INPUT","TEXTAREA"].includes(e.target.nodeName)||e.defaultPrevented)return;const t=d();t.length>1&&(e.preventDefault(),m(t))}else if(s("core/block-editor/unselect",e)){d().length>1&&(e.preventDefault(),g(),e.target.ownerDocument.defaultView.getSelection().removeAllRanges())}}}),Object(i.createElement)(kr.b,{__unstableContentRef:n},(c||!r)&&Object(i.createElement)(yr.a,{isFixed:!0}),Object(i.createElement)(_r.a,{__unstableContentRef:n}),Object(i.createElement)(u.Popover.Slot,{name:"block-toolbar",ref:Object(Er.a)(n)}),t,Object(i.createElement)(u.Popover.Slot,{name:"__unstable-block-tools-after",ref:Object(Er.a)(n)})))}var Sr=n("+0ps"),wr=n("5L8O"),Ir=n("KyyN"),xr=n("qrxh"),Br=n("xZzQ");var Tr=function(e){let{rootClientId:t,clientId:n,isAppender:o,showInserterHelpPanel:r,showMostUsedBlocks:c=!1,__experimentalInsertionIndex:l,__experimentalFilterValue:s,onSelect:u=a.noop,shouldFocusBlock:d=!1}=e;const b=Object(_.useSelect)(e=>{const{getBlockRootClientId:o}=e(S.a);return t||o(n)||void 0},[n,t]);return Object(i.createElement)(Br.a,{onSelect:u,rootClientId:b,clientId:n,isAppender:o,showInserterHelpPanel:r,showMostUsedBlocks:c,__experimentalInsertionIndex:l,__experimentalFilterValue:s,shouldFocusBlock:d})};function Pr(){return null}Pr.Register=function(){const{registerShortcut:e}=Object(_.useDispatch)(jr.store);return Object(i.useEffect)(()=>{e({name:"core/block-editor/duplicate",category:"block",description:Object(s.__)("Duplicate the selected block(s)."),keyCombination:{modifier:"primaryShift",character:"d"}}),e({name:"core/block-editor/remove",category:"block",description:Object(s.__)("Remove the selected block(s)."),keyCombination:{modifier:"access",character:"z"}}),e({name:"core/block-editor/insert-before",category:"block",description:Object(s.__)("Insert a new block before the selected block(s)."),keyCombination:{modifier:"primaryAlt",character:"t"}}),e({name:"core/block-editor/insert-after",category:"block",description:Object(s.__)("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:Object(s.__)("Remove multiple selected blocks."),keyCombination:{character:"del"},aliases:[{character:"backspace"}]}),e({name:"core/block-editor/select-all",category:"selection",description:Object(s.__)("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:Object(s.__)("Clear selection."),keyCombination:{character:"escape"}}),e({name:"core/block-editor/focus-toolbar",category:"global",description:Object(s.__)("Navigate to the nearest toolbar."),keyCombination:{modifier:"alt",character:"F10"}}),e({name:"core/block-editor/move-up",category:"block",description:Object(s.__)("Move the selected block(s) up."),keyCombination:{modifier:"secondary",character:"t"}}),e({name:"core/block-editor/move-down",category:"block",description:Object(s.__)("Move the selected block(s) down."),keyCombination:{modifier:"secondary",character:"y"}})},[e]),null};var Rr=Pr;function Nr(){return Xn()("wp.blockEditor.MultiSelectScrollIntoView",{hint:"This behaviour is now built-in."}),null}var Mr=n("GkEL");const Lr=new Set([M.UP,M.RIGHT,M.DOWN,M.LEFT,M.ENTER,M.BACKSPACE]);function Ar(){const e=Object(_.useSelect)(e=>e(S.a).isTyping(),[]),{stopTyping:t}=Object(_.useDispatch)(S.a);return Object(Q.useRefEffect)(n=>{if(!e)return;const{ownerDocument:o}=n;let r,c;function l(e){const{clientX:n,clientY:o}=e;r&&c&&(r!==n||c!==o)&&t(),r=n,c=o}return o.addEventListener("mousemove",l),()=>{o.removeEventListener("mousemove",l)}},[e,t])}function Dr(){const e=Object(_.useSelect)(e=>e(S.a).isTyping()),{startTyping:t,stopTyping:n}=Object(_.useDispatch)(S.a),o=Ar(),r=Object(Q.useRefEffect)(o=>{const{ownerDocument:r}=o,{defaultView:c}=r;if(e){let e;function l(t){const{target:o}=t;e=c.setTimeout(()=>{Object(bn.isTextField)(o)||n()})}function i(e){const{keyCode:t}=e;t!==M.ESCAPE&&t!==M.TAB||n()}function a(){const e=c.getSelection();e.rangeCount>0&&e.getRangeAt(0).collapsed||n()}return o.addEventListener("focus",l),o.addEventListener("keydown",i),r.addEventListener("selectionchange",a),()=>{c.clearTimeout(e),o.removeEventListener("focus",l),o.removeEventListener("keydown",i),r.removeEventListener("selectionchange",a)}}function s(e){const{type:n,target:r}=e;Object(bn.isTextField)(r)&&o.contains(r)&&("keydown"!==n||function(e){const{keyCode:t,shiftKey:n}=e;return!n&&Lr.has(t)}(e))&&t()}return o.addEventListener("keypress",s),o.addEventListener("keydown",s),()=>{o.removeEventListener("keypress",s),o.removeEventListener("keydown",s)}},[e,t,n]);return Object(Q.useMergeRefs)([o,r])}var Fr=function(e){let{children:t}=e;return Object(i.createElement)("div",{ref:Dr()},t)};function zr(){return Xn()("PreserveScrollInReorder component",{since:"5.4",hint:"This behavior is now built-in the block list"}),null}const Hr=-1!==window.navigator.userAgent.indexOf("Trident"),Vr=new Set([M.UP,M.DOWN,M.LEFT,M.RIGHT]);function Gr(){const e=Object(_.useSelect)(e=>e(S.a).hasSelectedBlock(),[]);return Object(Q.useRefEffect)(t=>{if(!e)return;const{ownerDocument:n}=t,{defaultView:o}=n;let r,c,l;function i(){r||(r=o.requestAnimationFrame(()=>{b(),r=null}))}function a(e){c&&o.cancelAnimationFrame(c),c=o.requestAnimationFrame(()=>{s(e),c=null})}function s(e){let{keyCode:r}=e;if(!p())return;const c=Object(bn.computeCaretRect)(o);if(!c)return;if(!l)return void(l=c);if(Vr.has(r))return void(l=c);const i=c.top-l.top;if(0===i)return;const a=Object(bn.getScrollContainer)(t);if(!a)return;const s=a===n.body,u=s?o.scrollY:a.scrollTop,d=s?0:a.getBoundingClientRect().top,b=s?l.top/o.innerHeight:(l.top-d)/(o.innerHeight-d);if(0===u&&b<.75&&function(){const e=t.querySelectorAll('[contenteditable="true"]');return e[e.length-1]===n.activeElement}())return void(l=c);const m=s?o.innerHeight:a.clientHeight;l.top+l.height>d+m||l.top{o.removeEventListener("scroll",i,!0),o.removeEventListener("resize",i,!0),t.removeEventListener("keydown",a),t.removeEventListener("keyup",s),t.removeEventListener("mousedown",u),t.removeEventListener("touchstart",u),n.removeEventListener("selectionchange",d),o.cancelAnimationFrame(r),o.cancelAnimationFrame(c)}},[e])}var Ur=Hr?e=>e.children:function(e){let{children:t}=e;return Object(i.createElement)("div",{ref:Gr(),className:"block-editor__typewriter"},t)},Wr=n("Zzu2"),qr=n("TVFh");const Kr=Object(a.overEvery)([bn.isTextField,bn.focus.tabbable.isTabbableIndex]);function Yr(){return Object(Q.useRefEffect)(e=>{function t(t){if(t.target!==e)return;const n=bn.focus.focusable.find(e),o=Object(a.findLast)(n,Kr);if(!o)return;const{bottom:r}=o.getBoundingClientRect();t.clientY{e.addEventListener("mousedown",t)}},[])}var $r=n("hHnB");const Zr=Object(i.createContext)({});function Xr(e,t,n){const o={...e,[t]:e[t]?new Set(e[t]):new Set};return o[t].add(n),o}function Qr(e){var t;let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const o=Object(i.useContext)(Zr),{name:r}=Object(k.c)();n=n||r;const c=Boolean(null===(t=o[n])||void 0===t?void 0:t.has(e)),l=Object(i.useMemo)(()=>Xr(o,n,e),[o,n,e]),a=Object(i.useCallback)(e=>{let{children:t}=e;return Object(i.createElement)(Zr.Provider,{value:l},t)},[l]);return[c,a]}var Jr=n("/QNa")},"16Al":function(e,t,n){"use strict";var o=n("WbBG");function r(){}function c(){}c.resetWarningCache=r,e.exports=function(){function e(e,t,n,r,c,l){if(l!==o){var i=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 i.name="Invariant Violation",i}}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:c,resetWarningCache:r};return n.PropTypes=n,n}},"17x9":function(e,t,n){e.exports=n("16Al")()},"1CF3":function(e,t){e.exports=window.wp.dom},"1K8p":function(e,t,n){"use strict";var o=n("jrfk"),r=n("ez49");function c(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}}c.getEventType=function(){return o.firefox()?"DOMMouseScroll":r("wheel")?"wheel":"mousewheel"},e.exports=c},"1ZqX":function(e,t){e.exports=window.wp.data},"1eGn":function(e,t,n){"use strict";var o=n("wx14"),r=n("GRId"),c=n("YLtl"),l=n("l3Sj"),i=n("tI+e"),a=n("1ZqX"),s=n("VKE3"),u=n("HSyU"),d=n("hF7m"),b=n("K9lf"),p=n("+0ps"),m=n("BhPs");function f(e){let{clientIds:t,children:n,__experimentalUpdateSelection:o}=e;const{canInsertBlockType:r,getBlockRootClientId:l,getBlocksByClientId:i,canMoveBlocks:s,canRemoveBlocks:d}=Object(a.useSelect)(m.a),{getDefaultBlockName:b,getGroupingBlockName:f}=Object(a.useSelect)(u.store),h=i(t),g=l(t[0]),O=Object(c.every)(h,e=>!!e&&Object(u.hasBlockSupport)(e.name,"multiple",!0)&&r(e.name,g)),v=r(b(),g),j=s(t,g),k=d(t,g),{removeBlocks:_,replaceBlocks:y,duplicateBlocks:E,insertAfterBlock:C,insertBeforeBlock:S,flashBlock:w,setBlockMovingClientId:I,setNavigationMode:x,selectBlock:B}=Object(a.useDispatch)(m.a),T=Object(p.c)();return n({canDuplicate:O,canInsertDefaultBlock:v,canMove:j,canRemove:k,rootClientId:g,blocks:h,onDuplicate:()=>E(t,o),onRemove:()=>_(t,o),onInsertBefore(){S(Object(c.first)(Object(c.castArray)(t)))},onInsertAfter(){C(Object(c.last)(Object(c.castArray)(t)))},onMoveTo(){x(!0),B(t[0]),I(t[0])},onGroup(){if(!h.length)return;const e=f(),n=Object(u.switchToBlockType)(h,e);n&&y(t,n)},onUngroup(){if(!h.length)return;const e=h[0].innerBlocks;e.length&&y(t,e)},onCopy(){const e=h.map(e=>{let{clientId:t}=e;return t});1===h.length&&w(e[0]),T("copy",e)}})}var h=Object(b.compose)([Object(a.withSelect)((e,t)=>{let{clientId:n}=t;const{getBlock:o,getBlockMode:r,getSettings:c}=e(m.a),l=o(n),i=c().codeEditingEnabled;return{mode:r(n),blockType:l?Object(u.getBlockType)(l.name):null,isCodeEditingEnabled:i}}),Object(a.withDispatch)((e,t)=>{let{onToggle:n=c.noop,clientId:o}=t;return{onToggleMode(){e(m.a).toggleBlockMode(o),n()}}})])((function(e){let{blockType:t,mode:n,onToggleMode:o,small:c=!1,isCodeEditingEnabled:a=!0}=e;if(!Object(u.hasBlockSupport)(t,"html",!0)||!a)return null;const s="visual"===n?Object(l.__)("Edit as HTML"):Object(l.__)("Edit visually");return Object(r.createElement)(i.MenuItem,{onClick:o},!c&&s)}));var g=Object(b.compose)(Object(a.withSelect)((e,t)=>{let{clientId:n}=t;const o=e(m.a).getBlock(n);return{block:o,shouldRender:o&&"core/html"===o.name}}),Object(a.withDispatch)((e,t)=>{let{block:n}=t;return{onClick:()=>e(m.a).replaceBlocks(n.clientId,Object(u.rawHandler)({HTML:Object(u.getBlockContent)(n)}))}}))((function(e){let{shouldRender:t,onClick:n,small:o}=e;if(!t)return null;const c=Object(l.__)("Convert to Blocks");return Object(r.createElement)(i.MenuItem,{onClick:n},!o&&c)})),O=n("Jyyd"),v=n("pXCJ");const j={className:"block-editor-block-settings-menu__popover",position:"bottom right",isAlternate:!0};function k(e){let{blocks:t,onCopy:n}=e;const o=Object(b.useCopyToClipboard)(()=>Object(u.serialize)(t),n);return Object(r.createElement)(i.MenuItem,{ref:o},Object(l.__)("Copy"))}t.a=function(e){let{clientIds:t,__experimentalSelectBlock:n,children:b,...p}=e;const _=Object(c.castArray)(t),y=_.length,E=_[0],{onlyBlock:C,title:S}=Object(a.useSelect)(e=>{var t;const{getBlockCount:n,getBlockName:o}=e(m.a),{getBlockType:r}=e(u.store);return{onlyBlock:1===n(),title:null===(t=r(o(E)))||void 0===t?void 0:t.title}},[E]),w=Object(a.useSelect)(e=>{const{getShortcutRepresentation:t}=e(d.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")}},[]),I=Object(r.useCallback)(n?async e=>{const t=await e;t&&t[0]&&n(t[0])}:c.noop,[n]),x=Object(l.sprintf)(Object(l.__)("Remove %s"),S),B=1===y?x:Object(l.__)("Remove blocks");return Object(r.createElement)(f,{clientIds:t,__experimentalUpdateSelection:!n},e=>{let{canDuplicate:n,canInsertDefaultBlock:a,canMove:u,canRemove:d,onDuplicate:m,onInsertAfter:f,onInsertBefore:_,onRemove:S,onCopy:x,onMoveTo:T,blocks:P}=e;return Object(r.createElement)(i.DropdownMenu,Object(o.a)({icon:s.a,label:Object(l.__)("Options"),className:"block-editor-block-settings-menu",popoverProps:j,noIcons:!0},p),e=>{let{onClose:o}=e;return Object(r.createElement)(r.Fragment,null,Object(r.createElement)(i.MenuGroup,null,Object(r.createElement)(O.a.Slot,{fillProps:{onClose:o}}),1===y&&Object(r.createElement)(g,{clientId:E}),Object(r.createElement)(k,{blocks:P,onCopy:x}),n&&Object(r.createElement)(i.MenuItem,{onClick:Object(c.flow)(o,m,I),shortcut:w.duplicate},Object(l.__)("Duplicate")),a&&Object(r.createElement)(r.Fragment,null,Object(r.createElement)(i.MenuItem,{onClick:Object(c.flow)(o,_),shortcut:w.insertBefore},Object(l.__)("Insert before")),Object(r.createElement)(i.MenuItem,{onClick:Object(c.flow)(o,f),shortcut:w.insertAfter},Object(l.__)("Insert after"))),u&&!C&&Object(r.createElement)(i.MenuItem,{onClick:Object(c.flow)(o,T)},Object(l.__)("Move to")),1===y&&Object(r.createElement)(h,{clientId:E,onToggle:o})),Object(r.createElement)(v.a.Slot,{fillProps:{onClose:o},clientIds:t}),"function"==typeof b?b({onClose:o}):r.Children.map(e=>Object(r.cloneElement)(e,{onClose:o})),d&&Object(r.createElement)(i.MenuGroup,null,Object(r.createElement)(i.MenuItem,{onClick:Object(c.flow)(o,S,I),shortcut:w.remove},B)))})})}},"1iEr":function(e,t,n){"use strict";var o=n("GRId"),r=n("Tqx9");const c=Object(o.createElement)(r.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(o.createElement)(r.Path,{d:"M10.6 6L9.4 7l4.6 5-4.6 5 1.2 1 5.4-6z"}));t.a=c},"1oY3":function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var o=n("wx14"),r=n("GRId"),c=n("NtoT"),l=n("jwne");const i=c.a;i.Slot=l.a;const a=e=>Object(r.createElement)(c.a,Object(o.a)({},e,{__experimentalGroup:"advanced"}));a.Slot=e=>Object(r.createElement)(l.a,Object(o.a)({},e,{__experimentalGroup:"advanced"})),a.slotName="InspectorAdvancedControls",t.b=i},"1uGa":function(e,t,n){"use strict";var o=n("GRId"),r=n("tI+e"),c=n("l3Sj"),l=n("RxS6");t.a=function(e){let{colorPalette:t,duotonePalette:n,disableCustomColors:i,disableCustomDuotone:a,value:s,onChange:u}=e;return Object(o.createElement)(r.Dropdown,{popoverProps:{className:"block-editor-duotone-control__popover",headerTitle:Object(c.__)("Duotone"),isAlternate:!0},renderToggle:e=>{let{isOpen:t,onToggle:n}=e;return Object(o.createElement)(r.ToolbarButton,{showTooltip:!0,onClick:n,"aria-haspopup":"true","aria-expanded":t,onKeyDown:e=>{t||e.keyCode!==l.DOWN||(e.preventDefault(),n())},label:Object(c.__)("Apply duotone filter"),icon:Object(o.createElement)(r.DuotoneSwatch,{values:s})})},renderContent:()=>Object(o.createElement)(r.MenuGroup,{label:Object(c.__)("Duotone")},Object(o.createElement)("div",{className:"block-editor-duotone-control__description"},Object(c.__)("Create a two-tone color effect without losing your original image.")),Object(o.createElement)(r.DuotonePicker,{colorPalette:t,duotonePalette:n,disableCustomColors:i,disableCustomDuotone:a,value:s,onChange:u}))})}},"2YCo":function(e,t,n){"use strict";n.d(t,"a",(function(){return d}));var o=n("GRId"),r=n("tI+e"),c=n("l3Sj"),l=n("bVTw"),i=n("Tqx9");var a=Object(o.createElement)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none"},Object(o.createElement)(i.Path,{fillRule:"evenodd",d:"M5 11.25h3v1.5H5v-1.5zm5.5 0h3v1.5h-3v-1.5zm8.5 0h-3v1.5h3v-1.5z",clipRule:"evenodd"}));var s=Object(o.createElement)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none"},Object(o.createElement)(i.Path,{fillRule:"evenodd",d:"M5.25 11.25h1.5v1.5h-1.5v-1.5zm3 0h1.5v1.5h-1.5v-1.5zm4.5 0h-1.5v1.5h1.5v-1.5zm1.5 0h1.5v1.5h-1.5v-1.5zm4.5 0h-1.5v1.5h1.5v-1.5z",clipRule:"evenodd"}));const u=[{label:Object(c.__)("Solid"),icon:l.a,value:"solid"},{label:Object(c.__)("Dashed"),icon:a,value:"dashed"},{label:Object(c.__)("Dotted"),icon:s,value:"dotted"}];function d(e){let{onChange:t,value:n}=e;return Object(o.createElement)("fieldset",{className:"components-border-style-control"},Object(o.createElement)("legend",null,Object(c.__)("Style")),Object(o.createElement)("div",{className:"components-border-style-control__buttons"},u.map(e=>Object(o.createElement)(r.Button,{key:e.value,icon:e.icon,isSmall:!0,isPressed:e.value===n,onClick:()=>t(e.value===n?void 0:e.value),"aria-label":e.label}))))}},"2gm7":function(e,t,n){"use strict";var o=n("GRId"),r=n("Tqx9");const c=Object(o.createElement)(r.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(o.createElement)(r.Path,{d:"M14.6 7l-1.2-1L8 12l5.4 6 1.2-1-4.6-5z"}));t.a=c},"2z9l":function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));var o=n("K9lf");function r(e){return Object(o.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])}},"5L8O":function(e,t,n){"use strict";var o=n("GRId"),r=n("TSYQ"),c=n.n(r),l=n("l3Sj"),i=n("K9lf"),a=n("HSyU"),s=n("rmEH"),u=n("1ZqX"),d=n("qrxh"),b=n("BhPs");t.a=Object(i.compose)(Object(u.withSelect)((e,t)=>{const{getBlockCount:n,getBlockName:o,isBlockValid:r,getSettings:c,getTemplateLock:l}=e(b.a),i=!n(t.rootClientId),s=o(t.lastBlockClientId)===Object(a.getDefaultBlockName)(),u=r(t.lastBlockClientId),{bodyPlaceholder:d}=c();return{isVisible:i||!s||!u,showPrompt:i,isLocked:!!l(t.rootClientId),placeholder:d}}),Object(u.withDispatch)((e,t)=>{const{insertDefaultBlock:n,startTyping:o}=e(b.a);return{onAppend(){const{rootClientId:e}=t;n(void 0,e),o()}}}))((function(e){let{isLocked:t,isVisible:n,onAppend:r,showPrompt:i,placeholder:a,rootClientId:u}=e;if(t||!n)return null;const b=Object(s.decodeEntities)(a)||Object(l.__)("Type / to choose a block");return Object(o.createElement)("div",{"data-root-client-id":u||"",className:c()("block-editor-default-block-appender",{"has-visible-prompt":i})},Object(o.createElement)("p",{tabIndex:"0",contentEditable:!0,suppressContentEditableWarning:!0,role:"button","aria-label":Object(l.__)("Add block"),className:"block-editor-default-block-appender__content",onFocus:r},i?b:"\ufeff"),Object(o.createElement)(d.a,{rootClientId:u,position:"bottom right",isAppender:!0,__experimentalIsQuick:!0}))}))},"5gPN":function(e,t,n){"use strict";n.d(t,"b",(function(){return o.a})),n.d(t,"c",(function(){return o.b})),n.d(t,"d",(function(){return o.c})),n.d(t,"a",(function(){return b})),n.d(t,"e",(function(){return p}));var o=n("bVpQ"),r=n("wx14"),c=n("GRId"),l=n("YLtl"),i=n("K9lf"),a=n("v5LD");const s=e=>Object(i.createHigherOrderComponent)(t=>n=>Object(c.createElement)(t,Object(r.a)({},n,{colors:e})),"withCustomColorPalette"),u=()=>Object(i.createHigherOrderComponent)(e=>t=>{const n=Object(a.a)("color.palette.custom"),o=Object(a.a)("color.palette.theme"),l=Object(a.a)("color.palette.default"),i=Object(c.useMemo)(()=>[...n||[],...o||[],...l||[]],[n,o,l]);return Object(c.createElement)(e,Object(r.a)({},t,{colors:i}))},"withEditorColorPalette");function d(e,t){const n=Object(l.reduce)(e,(e,t)=>({...e,...Object(l.isString)(t)?{[t]:Object(l.kebabCase)(t)}:t}),{});return Object(i.compose)([t,e=>class extends c.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 Object(o.d)(t,e)}createSetters(){return Object(l.reduce)(n,(e,t,n)=>{const o=Object(l.upperFirst)(n),r="custom"+o;return e["set"+o]=this.createSetColor(n,r),e},{})}createSetColor(e,t){return n=>{const r=Object(o.c)(this.props.colors,n);this.props.setAttributes({[e]:r&&r.slug?r.slug:void 0,[t]:r&&r.slug?void 0:n})}}static getDerivedStateFromProps(e,t){let{attributes:r,colors:c}=e;return Object(l.reduce)(n,(e,n,i)=>{const a=Object(o.b)(c,r[i],r["custom"+Object(l.upperFirst)(i)]),s=t[i];return(null==s?void 0:s.color)===a.color&&s?e[i]=s:e[i]={...a,class:Object(o.a)(n,a.slug)},e},{})}render(){return Object(c.createElement)(e,Object(r.a)({},this.props,{colors:void 0},this.state,this.setters,{colorUtils:this.colorUtils}))}}])}function b(e){return function(){const t=s(e);for(var n=arguments.length,o=new Array(n),r=0;r0&&void 0!==arguments[0]?arguments[0]:window;const{platform:t}=e.navigator;return-1!==t.indexOf("Mac")||["iPad","iPhone"].includes(t)}var p=Object(o.memo)((function(e){let{className:t,isFirst:n,item:l,onSelect:p,onHover:m,isDraggable:f,...h}=e;const g=Object(o.useRef)(!1),O=l.icon?{backgroundColor:l.icon.background,color:l.icon.foreground}:{},v=Object(o.useMemo)(()=>[Object(r.createBlock)(l.name,l.initialAttributes,Object(r.createBlocksFromInnerBlocksTemplate)(l.innerBlocks))],[l.name,l.initialAttributes,l.initialAttributes]);return Object(o.createElement)(d.a,{isEnabled:f&&!l.disabled,blocks:v,icon:l.icon},e=>{let{draggable:r,onDragStart:d,onDragEnd:f}=e;return Object(o.createElement)("div",{className:"block-editor-block-types-list__list-item",draggable:r,onDragStart:e=>{g.current=!0,d&&(m(null),d(e))},onDragEnd:e=>{g.current=!1,f&&f(e)}},Object(o.createElement)(u.a,Object(c.a)({isFirst:n,className:i()("block-editor-block-types-list__item",t),disabled:l.isDisabled,onClick:e=>{e.preventDefault(),p(l,b()?e.metaKey:e.ctrlKey),m(null)},onKeyDown:e=>{const{keyCode:t}=e;t===a.ENTER&&(e.preventDefault(),p(l,b()?e.metaKey:e.ctrlKey),m(null))},onFocus:()=>{g.current||m(l)},onMouseEnter:()=>{g.current||m(l)},onMouseLeave:()=>m(null),onBlur:()=>m(null)},h),Object(o.createElement)("span",{className:"block-editor-block-types-list__item-icon",style:O},Object(o.createElement)(s.a,{icon:l.icon,showColors:!0})),Object(o.createElement)("span",{className:"block-editor-block-types-list__item-title"},l.title)))})})),m=n("xkPd"),f=n("HC45");t.a=function(e){let{items:t=[],onSelect:n,onHover:c=(()=>{}),children:l,label:i,isDraggable:a=!0}=e;return Object(o.createElement)(m.a,{className:"block-editor-block-types-list","aria-label":i},function(e,t){const n=[];for(let o=0,r=e.length;oObject(o.createElement)(f.a,{key:t},e.map((e,l)=>Object(o.createElement)(p,{key:e.id,item:e,className:Object(r.getBlockMenuDefaultClassName)(e.id),onSelect:n,onHover:c,isDraggable:a,isFirst:0===t&&0===l})))),l)}},"6c9H":function(e,t,n){"use strict";var o=n("GRId"),r=n("fHnH"),c=n("abaT"),l=n("7bKH"),i=n("gdqT"),a=n("l3Sj"),s=n("tI+e");function u(e){let{colordBackgroundColor:t,colordTextColor:n,backgroundColor:r,textColor:c}=e;const l=t.brightness(){Object(i.speak)(Object(a.__)("This color combination may be hard for people to read."))},[r,c]),Object(o.createElement)("div",{className:"block-editor-contrast-checker"},Object(o.createElement)(s.Notice,{spokenMessage:null,status:"warning",isDismissible:!1},l))}Object(r.b)([c.a,l.a]),t.a=function(e){let{backgroundColor:t,fallbackBackgroundColor:n,fallbackTextColor:c,fontSize:l,isLargeText:i,textColor:a}=e;if(!t&&!n||!a&&!c)return null;const s=Object(r.a)(t||n),d=Object(r.a)(a||c);return 1!==s.alpha()||1!==d.alpha()||d.isReadable(s,{level:"AA",size:i||!1!==i&&l>=24?"large":"small"})?null:Object(o.createElement)(u,{backgroundColor:t,textColor:a,colordBackgroundColor:s,colordTextColor:d})}},"6jxZ":function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var o=n("1ZqX"),r=n("K9lf"),c=n("OL6h"),l=n("BhPs");function i(e){const{isBlockSelected:t}=Object(o.useSelect)(l.a),{selectBlock:n,selectionChange:i}=Object(o.useDispatch)(l.a);return Object(r.useRefEffect)(o=>{function r(r){t(e)?r.target.isContentEditable||i(e):Object(c.c)(o,r.target)&&n(e)}return o.addEventListener("focusin",r),()=>{o.removeEventListener("focusin",r)}},[t,n])}},"715p":function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));var o=n("YLtl");const r=e=>{if(!Object(o.isObject)(e)||Array.isArray(e))return e;const t=Object(o.pickBy)(Object(o.mapValues)(e,r),o.identity);return Object(o.isEmpty)(t)?void 0:t}},"7NR9":function(e,t,n){"use strict";var o=n("GRId"),r=n("YLtl"),c=n("TSYQ"),l=n.n(c),i=n("1ZqX"),a=n("RxS6"),s=n("l3Sj"),u=n("HSyU"),d=n("BLeD"),b=n.n(d);var p=n("REKd"),m=n("BhPs");const f={};function h(e){let{genericPreviewBlock:t,viewportWidth:n,style:r,isActive:c,onBlur:i,onHover:s,onSelect:u,styleClassName:d,itemRole:b}=e;const m=Object(o.useMemo)(()=>({...t,attributes:{...t.attributes,className:d}}),[t,d]);return Object(o.createElement)("div",{key:r.name,className:l()("block-editor-block-styles__item",{"is-active":c}),onClick:()=>u(),onKeyDown:e=>{a.ENTER!==e.keyCode&&a.SPACE!==e.keyCode||(e.preventDefault(),u())},onMouseEnter:s,onMouseLeave:i,role:b||"button",tabIndex:"0","aria-label":r.label||r.name},Object(o.createElement)("div",{className:"block-editor-block-styles__item-preview"},Object(o.createElement)(p.a,{viewportWidth:n,blocks:m})),Object(o.createElement)("div",{className:"block-editor-block-styles__item-label"},r.label||r.name))}t.a=function(e){let{clientId:t,onSwitch:n=r.noop,onHoverClassName:c=r.noop,itemRole:l}=e;const{styles:a,block:d,type:p,className:g}=Object(i.useSelect)(e=>{const{getBlock:n}=e(m.a),o=n(t);if(!o)return f;const r=Object(u.getBlockType)(o.name),{getBlockStyles:c}=e(u.store);return{block:o,type:r,styles:c(o.name),className:o.attributes.className||""}},[t]),{updateBlockAttributes:O}=Object(i.useDispatch)(m.a),v=function(e,t){return Object(o.useMemo)(()=>{const n=null==t?void 0:t.example,o=null==t?void 0:t.name;return n&&o?Object(u.getBlockFromExample)(o,{attributes:n.attributes,innerBlocks:n.innerBlocks}):e?Object(u.cloneBlock)(e):void 0},[null!=t&&t.example?null==e?void 0:e.name:e,t])}(d,p);if(!a||0===a.length)return null;const j=Object(r.find)(a,"isDefault")?a:[{name:"default",label:Object(s._x)("Default","block style"),isDefault:!0},...a],k=function(e,t){for(const n of new b.a(t).values()){if(-1===n.indexOf("is-style-"))continue;const t=n.substring(9),o=Object(r.find)(e,{name:t});if(o)return o}return Object(r.find)(e,"isDefault")}(j,g);return Object(o.createElement)("div",{className:"block-editor-block-styles"},j.map(e=>{var r,i;const a=function(e,t,n){const o=new b.a(e);return t&&o.remove("is-style-"+t.name),o.add("is-style-"+n.name),o.value}(g,k,e);return Object(o.createElement)(h,{genericPreviewBlock:v,viewportWidth:null!==(r=null===(i=p.example)||void 0===i?void 0:i.viewportWidth)&&void 0!==r?r:500,className:g,isActive:k===e,key:e.name,onSelect:()=>{O(t,{className:a}),c(null),n()},onBlur:()=>c(null),onHover:()=>c(a),style:e,styleClassName:a,itemRole:l})}))}},"7SSY":function(e,t,n){"use strict";var o=n("GRId"),r=n("TSYQ"),c=n.n(r),l=n("tI+e"),i=n("//Lo");t.a=Object(o.memo)((function(e){var t;let{icon:n,showColors:r=!1,className:a}=e;"block-default"===(null===(t=n)||void 0===t?void 0:t.src)&&(n={src:i.a});const s=Object(o.createElement)(l.Icon,{icon:n&&n.src?n.src:n}),u=r?{backgroundColor:n&&n.background,color:n&&n.foreground}:{};return Object(o.createElement)("span",{style:u,className:c()("block-editor-block-icon",a,{"has-colors":r})},s)}))},"7bKH":function(e,t,n){"use strict";var o=function(e){var t=e/255;return t<.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)},r=function(e){return.2126*o(e.r)+.7152*o(e.g)+.0722*o(e.b)};t.a=function(e){e.prototype.luminance=function(){return e=r(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,c,l,i,a,s,u=t instanceof e?t:new e(t);return l=this.rgba,i=u.toRgb(),n=(a=r(l))>(s=r(i))?(a+.05)/(s+.05):(s+.05)/(a+.05),void 0===(o=2)&&(o=0),void 0===c&&(c=Math.pow(10,o)),Math.floor(c*n)/c+0},e.prototype.isReadable=function(e,t){return void 0===e&&(e="#FFF"),void 0===t&&(t={}),this.contrast(e)>=(l=void 0===(c=(n=t).size)?"normal":c,"AAA"===(r=void 0===(o=n.level)?"AA":o)&&"normal"===l?7:"AA"===r&&"large"===l?3:4.5);var n,o,r,c,l}}},"7fqt":function(e,t){e.exports=window.wp.wordcount},"8oxB":function(e,t){var n,o,r=e.exports={};function c(){throw new Error("setTimeout has not been defined")}function l(){throw new Error("clearTimeout has not been defined")}function i(e){if(n===setTimeout)return setTimeout(e,0);if((n===c||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:c}catch(e){n=c}try{o="function"==typeof clearTimeout?clearTimeout:l}catch(e){o=l}}();var a,s=[],u=!1,d=-1;function b(){u&&a&&(u=!1,a.length?s=a.concat(s):d=-1,s.length&&p())}function p(){if(!u){var e=i(b);u=!0;for(var t=s.length;t;){for(a=s,s=[];++d1)for(var n=1;n"up"===e?"horizontal"===l?Object(b.isRTL)()?"right":"left":"up":"down"===e?"horizontal"===l?Object(b.isRTL)()?"left":"right":"down":null;if(e>1)return function(e,t,n,o,r){const c=t+1;if(r<0&&n)return Object(b.__)("Blocks cannot be moved up as they are already at the top");if(r>0&&o)return Object(b.__)("Blocks cannot be moved down as they are already at the bottom");if(r<0&&!n)return Object(b.sprintf)(Object(b._n)("Move %1$d block from position %2$d up by one place","Move %1$d blocks from position %2$d up by one place",e),e,c);if(r>0&&!o)return Object(b.sprintf)(Object(b._n)("Move %1$d block from position %2$d down by one place","Move %1$d blocks from position %2$d down by one place",e),e,c)}(e,n,o,r,c);if(o&&r)return Object(b.sprintf)(Object(b.__)("Block %s is the only block, and cannot be moved"),t);if(c>0&&!r){const e=a("down");if("down"===e)return Object(b.sprintf)(Object(b.__)("Move %1$s block from position %2$d down to position %3$d"),t,i,i+1);if("left"===e)return Object(b.sprintf)(Object(b.__)("Move %1$s block from position %2$d left to position %3$d"),t,i,i+1);if("right"===e)return Object(b.sprintf)(Object(b.__)("Move %1$s block from position %2$d right to position %3$d"),t,i,i+1)}if(c>0&&r){const e=a("down");if("down"===e)return Object(b.sprintf)(Object(b.__)("Block %1$s is at the end of the content and can’t be moved down"),t);if("left"===e)return Object(b.sprintf)(Object(b.__)("Block %1$s is at the end of the content and can’t be moved left"),t);if("right"===e)return Object(b.sprintf)(Object(b.__)("Block %1$s is at the end of the content and can’t be moved right"),t)}if(c<0&&!o){const e=a("up");if("up"===e)return Object(b.sprintf)(Object(b.__)("Move %1$s block from position %2$d up to position %3$d"),t,i,i-1);if("left"===e)return Object(b.sprintf)(Object(b.__)("Move %1$s block from position %2$d left to position %3$d"),t,i,i-1);if("right"===e)return Object(b.sprintf)(Object(b.__)("Move %1$s block from position %2$d right to position %3$d"),t,i,i-1)}if(c<0&&o){const e=a("up");if("up"===e)return Object(b.sprintf)(Object(b.__)("Block %1$s is at the beginning of the content and can’t be moved up"),t);if("left"===e)return Object(b.sprintf)(Object(b.__)("Block %1$s is at the beginning of the content and can’t be moved left"),t);if("right"===e)return Object(b.sprintf)(Object(b.__)("Block %1$s is at the beginning of the content and can’t be moved right"),t)}}var O=n("BhPs");const v=(e,t)=>"up"===e?"horizontal"===t?Object(b.isRTL)()?p.a:m.a:f.a:"down"===e?"horizontal"===t?Object(b.isRTL)()?m.a:p.a:h.a:null,j=(e,t)=>"up"===e?"horizontal"===t?Object(b.isRTL)()?Object(b.__)("Move right"):Object(b.__)("Move left"):Object(b.__)("Move up"):"down"===e?"horizontal"===t?Object(b.isRTL)()?Object(b.__)("Move left"):Object(b.__)("Move right"):Object(b.__)("Move down"):null,k=Object(r.forwardRef)((e,t)=>{let{clientIds:n,direction:c,orientation:b,...p}=e;const m=Object(u.useInstanceId)(k),f=Object(i.castArray)(n).length,{blockType:h,isDisabled:_,rootClientId:y,isFirst:E,isLast:C,firstIndex:S,orientation:w="vertical"}=Object(d.useSelect)(e=>{const{getBlockIndex:t,getBlockRootClientId:o,getBlockOrder:r,getBlock:l,getBlockListSettings:s}=e(O.a),u=Object(i.castArray)(n),d=Object(i.first)(u),p=o(d),m=t(d),f=t(Object(i.last)(u)),h=r(p),g=l(d),v=0===m,j=f===h.length-1,{orientation:k}=s(p)||{};return{blockType:g?Object(a.getBlockType)(g.name):null,isDisabled:"up"===c?v:j,rootClientId:p,firstIndex:m,isFirst:v,isLast:j,orientation:b||k}},[n,c]),{moveBlocksDown:I,moveBlocksUp:x}=Object(d.useDispatch)(O.a),B="up"===c?x:I,T="block-editor-block-mover-button__description-"+m;return Object(r.createElement)(r.Fragment,null,Object(r.createElement)(s.Button,Object(o.a)({ref:t,className:l()("block-editor-block-mover-button",`is-${c}-button`),icon:v(c,w),label:j(c,w),"aria-describedby":T},p,{onClick:_?null:e=>{B(n,y),p.onClick&&p.onClick(e)},"aria-disabled":_})),Object(r.createElement)("span",{id:T,className:"block-editor-block-mover-button__description"},g(f,h&&h.title,S,E,C,"up"===c?-1:1,w)))}),_=Object(r.forwardRef)((e,t)=>Object(r.createElement)(k,Object(o.a)({direction:"up",ref:t},e))),y=Object(r.forwardRef)((e,t)=>Object(r.createElement)(k,Object(o.a)({direction:"down",ref:t},e)))},"9XVa":function(e,t,n){"use strict";n.d(t,"b",(function(){return o.a})),n.d(t,"c",(function(){return o.b})),n.d(t,"d",(function(){return o.c})),n.d(t,"a",(function(){return r.a})),n.d(t,"e",(function(){return d}));var o=n("NMUH"),r=n("QP/w"),c=n("wx14"),l=n("GRId"),i=n("YLtl"),a=n("K9lf"),s=n("v5LD");const u=[];var d=function(){for(var e=arguments.length,t=new Array(e),n=0;n(e[t]="custom"+Object(i.upperFirst)(t),e),{});return Object(a.createHigherOrderComponent)(Object(a.compose)([Object(a.createHigherOrderComponent)(e=>t=>{const n=Object(s.a)("typography.fontSizes")||u;return Object(l.createElement)(e,Object(c.a)({},t,{fontSizes:n}))},"withFontSizes"),e=>class extends l.Component{constructor(e){super(e),this.setters=this.createSetters(),this.state={}}createSetters(){return Object(i.reduce)(r,(e,t,n)=>(e["set"+Object(i.upperFirst)(n)]=this.createSetFontSize(n,t),e),{})}createSetFontSize(e,t){return n=>{const o=Object(i.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:c}=e;const l=(e,o)=>!t[o]||(n[o]?n[o]!==t[o].slug:t[o].size!==n[e]);if(!Object(i.some)(r,l))return null;const a=Object(i.reduce)(Object(i.pickBy)(r,l),(e,t,r)=>{const l=n[r],i=Object(o.a)(c,l,n[t]);return e[r]={...i,class:Object(o.b)(l)},e},{});return{...t,...a}}render(){return Object(l.createElement)(e,Object(c.a)({},this.props,{fontSizes:void 0},this.state,this.setters))}}]),"withFontSizes")}},AHN3:function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));const o="core/block-editor"},AORF:function(e,t,n){"use strict";var o=n("YLtl"),r=n("1ZqX"),c=n("HSyU"),l=n("l3Sj"),i=n("gdqT"),a=n("GRId"),s=n("BhPs");t.a=function(e){let{rootClientId:t="",insertionIndex:n,clientId:u,isAppender:d,onSelect:b,shouldFocusBlock:p=!0}=e;const{getSelectedBlock:m}=Object(r.useSelect)(s.a),{destinationRootClientId:f,destinationIndex:h}=Object(r.useSelect)(e=>{const{getSelectedBlockClientId:o,getBlockRootClientId:r,getBlockIndex:c,getBlockOrder:l}=e(s.a),i=o();let a,b=t;return void 0!==n?a=n:u?a=c(u):!d&&i?(b=r(i),a=c(i)+1):a=l(b).length,{destinationRootClientId:b,destinationIndex:a}},[t,n,u,d]),{replaceBlocks:g,insertBlocks:O,showInsertionPoint:v,hideInsertionPoint:j}=Object(r.useDispatch)(s.a),k=Object(a.useCallback)((function(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const r=m();!d&&r&&Object(c.isUnmodifiedDefaultBlock)(r)?g(r.clientId,e,null,p||n?0:null,t):O(e,h,f,!0,p||n?0:null,t);const a=Object(l.sprintf)(Object(l._n)("%d block added.","%d blocks added.",Object(o.castArray)(e).length),Object(o.castArray)(e).length);Object(i.speak)(a),b&&b()}),[d,m,g,O,f,h,b,p]),_=Object(a.useCallback)(e=>{e?v(f,h):j()},[v,j,f,h]);return[f,k,_]}},B9Az:function(e,t,n){"use strict";var o=n("GRId"),r=n("Tqx9");var c=Object(o.createElement)(r.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(o.createElement)(r.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"}));t.a=c},BCrt:function(e,t,n){"use strict";n.d(t,"c",(function(){return o.a})),n.d(t,"d",(function(){return c})),n.d(t,"e",(function(){return l})),n.d(t,"a",(function(){return i.a})),n.d(t,"b",(function(){return g}));var o=n("vSu0"),r=n("lJLt");function c(e){if(void 0===e)e=r.b.colors;else{const t=e.filter(e=>e.color);0===t.length?e=r.b.colors:t.lengthe.gradient);0===t.length?e=r.b.gradients:t.lengtha(m(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[2]?o[2]+"px":o[1]+"px";case"calc":return o[0]+"px"}}function u(e){for(;;){const t=e,n=/(max|min|calc|clamp)\(([^()]*)\)/g.exec(e)||[];if(n[0]){const t=s(n[0]);e=e.replace(n[0],t)}if(e===t||parseFloat(e))break}return a(e)}function d(e){for(let t=0;tn.height?n.width:n.height),"%":.01*("font"===n.type?n.fontSize:n.width),ch:8,ex:7.15625,lh:n.lineHeight},r={in:96,cm:96/2.54,mm:96/25.4,pt:96/72,pc:16,px:1,Q:96/2.54/40};return o[e.unit]?(o[e.unit]*e.value).toFixed(0)+"px":r[e.unit]?(r[e.unit]*e.value).toFixed(0)+"px":null}function m(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=a(e);return n.unit||(n=u(e)),d(e)&&!n.unit?b(e):p(n,t)}const f={};function h(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 g=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=e+h(t);return f[n]||(f[n]=m(e,t)),f[n]}},BLeD:function(e,t){e.exports=window.wp.tokenList},BhPs:function(e,t,n){"use strict";n.d(t,"b",(function(){return Cn})),n.d(t,"a",(function(){return Sn}));var o={};n.r(o),n.d(o,"getBlockName",(function(){return w})),n.d(o,"isBlockValid",(function(){return I})),n.d(o,"getBlockAttributes",(function(){return x})),n.d(o,"getBlock",(function(){return B})),n.d(o,"__unstableGetBlockWithoutInnerBlocks",(function(){return T})),n.d(o,"getBlocks",(function(){return P})),n.d(o,"__unstableGetClientIdWithClientIdsTree",(function(){return R})),n.d(o,"__unstableGetClientIdsTree",(function(){return N})),n.d(o,"getClientIdsOfDescendants",(function(){return M})),n.d(o,"getClientIdsWithDescendants",(function(){return L})),n.d(o,"getGlobalBlockCount",(function(){return A})),n.d(o,"getBlocksByClientId",(function(){return D})),n.d(o,"getBlockCount",(function(){return F})),n.d(o,"getSelectionStart",(function(){return z})),n.d(o,"getSelectionEnd",(function(){return H})),n.d(o,"getBlockSelectionStart",(function(){return V})),n.d(o,"getBlockSelectionEnd",(function(){return G})),n.d(o,"getSelectedBlockCount",(function(){return U})),n.d(o,"hasSelectedBlock",(function(){return W})),n.d(o,"getSelectedBlockClientId",(function(){return q})),n.d(o,"getSelectedBlock",(function(){return K})),n.d(o,"getBlockRootClientId",(function(){return Y})),n.d(o,"getBlockParents",(function(){return $})),n.d(o,"getBlockParentsByBlockName",(function(){return Z})),n.d(o,"getBlockHierarchyRootClientId",(function(){return X})),n.d(o,"getLowestCommonAncestorWithSelectedBlock",(function(){return Q})),n.d(o,"getAdjacentBlockClientId",(function(){return J})),n.d(o,"getPreviousBlockClientId",(function(){return ee})),n.d(o,"getNextBlockClientId",(function(){return te})),n.d(o,"getSelectedBlocksInitialCaretPosition",(function(){return ne})),n.d(o,"getSelectedBlockClientIds",(function(){return oe})),n.d(o,"getMultiSelectedBlockClientIds",(function(){return re})),n.d(o,"getMultiSelectedBlocks",(function(){return ce})),n.d(o,"getFirstMultiSelectedBlockClientId",(function(){return le})),n.d(o,"getLastMultiSelectedBlockClientId",(function(){return ie})),n.d(o,"isFirstMultiSelectedBlock",(function(){return ae})),n.d(o,"isBlockMultiSelected",(function(){return se})),n.d(o,"isAncestorMultiSelected",(function(){return ue})),n.d(o,"getMultiSelectedBlocksStartClientId",(function(){return de})),n.d(o,"getMultiSelectedBlocksEndClientId",(function(){return be})),n.d(o,"getBlockOrder",(function(){return pe})),n.d(o,"getBlockIndex",(function(){return me})),n.d(o,"isBlockSelected",(function(){return fe})),n.d(o,"hasSelectedInnerBlock",(function(){return he})),n.d(o,"isBlockWithinSelection",(function(){return ge})),n.d(o,"hasMultiSelection",(function(){return Oe})),n.d(o,"isMultiSelecting",(function(){return ve})),n.d(o,"isSelectionEnabled",(function(){return je})),n.d(o,"getBlockMode",(function(){return ke})),n.d(o,"isTyping",(function(){return _e})),n.d(o,"isDraggingBlocks",(function(){return ye})),n.d(o,"getDraggedBlockClientIds",(function(){return Ee})),n.d(o,"isBlockBeingDragged",(function(){return Ce})),n.d(o,"isAncestorBeingDragged",(function(){return Se})),n.d(o,"isCaretWithinFormattedText",(function(){return we})),n.d(o,"getBlockInsertionPoint",(function(){return Ie})),n.d(o,"isBlockInsertionPointVisible",(function(){return xe})),n.d(o,"isValidTemplate",(function(){return Be})),n.d(o,"getTemplate",(function(){return Te})),n.d(o,"getTemplateLock",(function(){return Pe})),n.d(o,"canInsertBlockType",(function(){return Me})),n.d(o,"canInsertBlocks",(function(){return Le})),n.d(o,"canRemoveBlock",(function(){return Ae})),n.d(o,"canRemoveBlocks",(function(){return De})),n.d(o,"canMoveBlock",(function(){return Fe})),n.d(o,"canMoveBlocks",(function(){return ze})),n.d(o,"getInserterItems",(function(){return qe})),n.d(o,"getBlockTransformItems",(function(){return Ke})),n.d(o,"hasInserterItems",(function(){return Ye})),n.d(o,"__experimentalGetAllowedBlocks",(function(){return $e})),n.d(o,"__experimentalGetDirectInsertBlock",(function(){return Ze})),n.d(o,"__experimentalGetParsedPattern",(function(){return Xe})),n.d(o,"__experimentalGetAllowedPatterns",(function(){return Je})),n.d(o,"__experimentalGetPatternsByBlockTypes",(function(){return et})),n.d(o,"__experimentalGetPatternTransformItems",(function(){return tt})),n.d(o,"getBlockListSettings",(function(){return nt})),n.d(o,"getSettings",(function(){return ot})),n.d(o,"isLastBlockChangePersistent",(function(){return rt})),n.d(o,"__experimentalGetBlockListSettingsForBlocks",(function(){return ct})),n.d(o,"__experimentalGetReusableBlockTitle",(function(){return lt})),n.d(o,"__unstableIsLastBlockChangeIgnored",(function(){return it})),n.d(o,"__experimentalGetLastBlockAttributeChanges",(function(){return at})),n.d(o,"isNavigationMode",(function(){return ut})),n.d(o,"hasBlockMovingClientId",(function(){return dt})),n.d(o,"didAutomaticChange",(function(){return bt})),n.d(o,"isBlockHighlighted",(function(){return pt})),n.d(o,"areInnerBlocksControlled",(function(){return mt})),n.d(o,"__experimentalGetActiveBlockIdByBlockNames",(function(){return ft})),n.d(o,"wasBlockJustInserted",(function(){return ht}));var r={};n.r(r),n.d(r,"resetBlocks",(function(){return _t})),n.d(r,"validateBlocksToTemplate",(function(){return yt})),n.d(r,"resetSelection",(function(){return Et})),n.d(r,"receiveBlocks",(function(){return Ct})),n.d(r,"updateBlockAttributes",(function(){return St})),n.d(r,"updateBlock",(function(){return wt})),n.d(r,"selectBlock",(function(){return It})),n.d(r,"selectPreviousBlock",(function(){return xt})),n.d(r,"selectNextBlock",(function(){return Bt})),n.d(r,"startMultiSelect",(function(){return Tt})),n.d(r,"stopMultiSelect",(function(){return Pt})),n.d(r,"multiSelect",(function(){return Rt})),n.d(r,"clearSelectedBlock",(function(){return Nt})),n.d(r,"toggleSelection",(function(){return Mt})),n.d(r,"replaceBlocks",(function(){return At})),n.d(r,"replaceBlock",(function(){return Dt})),n.d(r,"moveBlocksDown",(function(){return zt})),n.d(r,"moveBlocksUp",(function(){return Ht})),n.d(r,"moveBlocksToPosition",(function(){return Vt})),n.d(r,"moveBlockToPosition",(function(){return Gt})),n.d(r,"insertBlock",(function(){return Ut})),n.d(r,"insertBlocks",(function(){return Wt})),n.d(r,"showInsertionPoint",(function(){return qt})),n.d(r,"hideInsertionPoint",(function(){return Kt})),n.d(r,"setTemplateValidity",(function(){return Yt})),n.d(r,"synchronizeTemplate",(function(){return $t})),n.d(r,"mergeBlocks",(function(){return Zt})),n.d(r,"removeBlocks",(function(){return Xt})),n.d(r,"removeBlock",(function(){return Qt})),n.d(r,"replaceInnerBlocks",(function(){return Jt})),n.d(r,"toggleBlockMode",(function(){return en})),n.d(r,"startTyping",(function(){return tn})),n.d(r,"stopTyping",(function(){return nn})),n.d(r,"startDraggingBlocks",(function(){return on})),n.d(r,"stopDraggingBlocks",(function(){return rn})),n.d(r,"enterFormattedText",(function(){return cn})),n.d(r,"exitFormattedText",(function(){return ln})),n.d(r,"selectionChange",(function(){return an})),n.d(r,"insertDefaultBlock",(function(){return sn})),n.d(r,"updateBlockListSettings",(function(){return un})),n.d(r,"updateSettings",(function(){return dn})),n.d(r,"__unstableSaveReusableBlock",(function(){return bn})),n.d(r,"__unstableMarkLastChangeAsPersistent",(function(){return pn})),n.d(r,"__unstableMarkNextChangeAsNotPersistent",(function(){return mn})),n.d(r,"__unstableMarkAutomaticChange",(function(){return fn})),n.d(r,"setNavigationMode",(function(){return hn})),n.d(r,"setBlockMovingClientId",(function(){return gn})),n.d(r,"duplicateBlocks",(function(){return On})),n.d(r,"insertBeforeBlock",(function(){return vn})),n.d(r,"insertAfterBlock",(function(){return jn})),n.d(r,"toggleBlockHighlight",(function(){return kn})),n.d(r,"flashBlock",(function(){return _n})),n.d(r,"setHasControlledInnerBlocks",(function(){return yn}));var c=n("1ZqX"),l=n("YLtl"),i=n("HSyU"),a=n("lJLt");function s(e,t,n){return[...e.slice(0,n),...Object(l.castArray)(t),...e.slice(n)]}function u(e,t,n){let o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;const r=[...e];return r.splice(t,o),s(r,e.slice(t,t+o),n)}function d(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,d(r,o))}),n}function b(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return e.reduce((e,n)=>Object.assign(e,{[n.clientId]:t},b(n.innerBlocks,n.clientId)),{})}function p(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:l.identity;const n={},o=[...e];for(;o.length;){const{innerBlocks:e,...r}=o.shift();o.push(...e),n[r.clientId]=t(r)}return n}function m(e){return p(e,e=>Object(l.omit)(e,"attributes"))}function f(e){return p(e,e=>e.attributes)}function h(e,t){return"UPDATE_BLOCK_ATTRIBUTES"===e.type&&void 0!==t&&"UPDATE_BLOCK_ATTRIBUTES"===t.type&&Object(l.isEqual)(e.clientIds,t.clientIds)&&(n=e.attributes,o=t.attributes,Object(l.isEqual)(Object(l.keys)(n),Object(l.keys)(o)));var n,o}function g(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 O(e,t,n){let o=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const r=new Set([]),c=new Set;for(const t of n){let n=o?t:e.parents[t];do{if(e.controlledInnerBlocks[n]){c.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 c)t["controlled||"+n]={innerBlocks:(e.order[n]||[]).map(e=>t[e])};return t}const v=Object(l.flow)(c.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=Object(l.mapValues)(t.attributes,(n,r)=>{const{name:c}=t.byClientId[r];return"core/block"===c&&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=g(o,n.blocks);o.tree=O(o,{...o.tree,...e},n.rootClientId?[n.rootClientId]:[""],!0);break}case"UPDATE_BLOCK":o.tree=O(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=O(o,{...o.tree,...e},n.clientIds,!1);break}case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":{const e=g(o,n.blocks);o.tree=O(o,{...Object(l.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=O(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=O(o,Object(l.omit)(o.tree,n.removedClientIds.concat(n.removedClientIds.map(e=>"controlled||"+e))),e,!0);break;case"MOVE_BLOCKS_TO_POSITION":{const e=[];n.fromRootClientId&&e.push(n.fromRootClientId),n.toRootClientId&&e.push(n.toRootClientId),n.fromRootClientId&&n.fromRootClientId||e.push(""),o.tree=O(o,o.tree,e,!0);break}case"MOVE_BLOCKS_UP":case"MOVE_BLOCKS_DOWN":{const e=[n.rootClientId?n.rootClientId:""];o.tree=O(o,o.tree,e,!0);break}case"SAVE_REUSABLE_BLOCK_SUCCESS":{const e=Object(l.keys)(Object(l.omitBy)(o.attributes,(e,t)=>"core/block"!==o.byClientId[t].name||e.ref!==n.updatedId));o.tree=O(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(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 c=r;return n.blocks.length&&(c=e(c,{...n,type:"INSERT_BLOCKS",index:0}),c.order={...c.order,...Object(l.reduce)(o,(e,n,o)=>(t.order[o]&&(e[o]=t.order[o]),e),{})}),c},e=>(t,n)=>{if("RESET_BLOCKS"===n.type){const e={...t,byClientId:m(n.blocks),attributes:f(n.blocks),order:d(n.blocks),parents:b(n.blocks),controlledInnerBlocks:{}},o=g(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 c=e(o,r);const l="MARK_LAST_CHANGE_AS_PERSISTENT"===r.type||n;if(o===c&&!l){var i;n="MARK_NEXT_CHANGE_AS_NOT_PERSISTENT"===r.type;const e=null===(i=null==o?void 0:o.isPersistentChange)||void 0===i||i;return o.isPersistentChange===e?o:{...c,isPersistentChange:e}}return c={...c,isPersistentChange:l?!n:!h(r,t)},t=r,n="MARK_NEXT_CHANGE_AS_NOT_PERSISTENT"===r.type,c}}),(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,...m(t.blocks)};case"UPDATE_BLOCK":if(!e[t.clientId])return e;const n=Object(l.omit)(t.updates,"attributes");return Object(l.isEmpty)(n)?e:{...e,[t.clientId]:{...e[t.clientId],...n}};case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":return t.blocks?{...Object(l.omit)(e,t.replacedClientIds),...m(t.blocks)}:e;case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":return Object(l.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,...f(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]:Object(l.reduce)(t.uniqueByBlock?t.attributes[o]:t.attributes,(t,n,r)=>{var c,l;return n!==t[r]&&((t=(c=e[o])===(l=t)?{...c}:l)[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?{...Object(l.omit)(e,t.replacedClientIds),...f(t.blocks)}:e;case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":return Object(l.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=d(t.blocks);return{...e,...Object(l.omit)(n,""),"":((null==e?void 0:e[""])||[]).concat(n[""])}}case"INSERT_BLOCKS":{const{rootClientId:n=""}=t,o=e[n]||[],r=d(t.blocks,n),{index:c=o.length}=t;return{...e,...r,[n]:s(o,r[n],c)}}case"MOVE_BLOCKS_TO_POSITION":{const{fromRootClientId:n="",toRootClientId:o="",clientIds:r}=t,{index:c=e[o].length}=t;if(n===o){const t=e[o].indexOf(r[0]);return{...e,[o]:u(e[o],t,c,r.length)}}return{...e,[n]:Object(l.without)(e[n],...r),[o]:s(e[o],r,c)}}case"MOVE_BLOCKS_UP":{const{clientIds:n,rootClientId:o=""}=t,r=Object(l.first)(n),c=e[o];if(!c.length||r===Object(l.first)(c))return e;const i=c.indexOf(r);return{...e,[o]:u(c,i,i-1,n.length)}}case"MOVE_BLOCKS_DOWN":{const{clientIds:n,rootClientId:o=""}=t,r=Object(l.first)(n),c=Object(l.last)(n),i=e[o];if(!i.length||c===Object(l.last)(i))return e;const a=i.indexOf(r);return{...e,[o]:u(i,a,a+1,n.length)}}case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":{const{clientIds:n}=t;if(!t.blocks)return e;const o=d(t.blocks);return Object(l.flow)([e=>Object(l.omit)(e,t.replacedClientIds),e=>({...e,...Object(l.omit)(o,"")}),e=>Object(l.mapValues)(e,e=>Object(l.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 Object(l.flow)([e=>Object(l.omit)(e,t.removedClientIds),e=>Object(l.mapValues)(e,e=>Object(l.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,...b(t.blocks)};case"INSERT_BLOCKS":return{...e,...b(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{...Object(l.omit)(e,t.replacedClientIds),...b(t.blocks,e[t.clientIds[0]])};case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":return Object(l.omit)(e,t.removedClientIds)}return e},controlledInnerBlocks(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{type:t,clientId:n,hasControlledInnerBlocks:o}=arguments.length>1?arguments[1]:void 0;return"SET_HAS_CONTROLLED_INNER_BLOCKS"===t?{...e,[n]:o}:e}});function j(){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 k=Object(c.combineReducers)({blocks:v,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},isCaretWithinFormattedText:function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"ENTER_FORMATTED_TEXT":return!0;case"EXIT_FORMATTED_TEXT":return!1}return e},selection:function(){var e,t;let n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=arguments.length>1?arguments[1]:void 0;switch(o.type){case"SELECTION_CHANGE":return{selectionStart:{clientId:o.clientId,attributeKey:o.attributeKey,offset:o.startOffset},selectionEnd:{clientId:o.clientId,attributeKey:o.attributeKey,offset:o.endOffset}};case"RESET_SELECTION":const{selectionStart:r,selectionEnd:c}=o;return{selectionStart:r,selectionEnd:c};case"MULTI_SELECT":const{start:l,end:i}=o;return{selectionStart:{clientId:l},selectionEnd:{clientId:i}};case"RESET_BLOCKS":const a=null==n||null===(e=n.selectionStart)||void 0===e?void 0:e.clientId,s=null==n||null===(t=n.selectionEnd)||void 0===t?void 0:t.clientId;if(!a&&!s)return n;if(!o.blocks.some(e=>e.clientId===a))return{selectionStart:{},selectionEnd:{}};if(!o.blocks.some(e=>e.clientId===s))return{...n,selectionEnd:n.selectionStart}}return{selectionStart:j(n.selectionStart,o),selectionEnd:j(n.selectionEnd,o)}},isMultiSelecting:function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"START_MULTI_SELECT":return!0;case"STOP_MULTI_SELECT":return!1}return e},isSelectionEnabled:function(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"TOGGLE_SELECTION":return t.isSelectionEnabled}return e},initialPosition:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1?arguments[1]:void 0;return"REPLACE_BLOCKS"===t.type&&void 0!==t.initialPosition||["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 Object(l.omit)(e,t.clientIds);case"UPDATE_BLOCK_LIST_SETTINGS":{const{clientId:n}=t;return t.settings?Object(l.isEqual)(e[n],t.settings)?e:{...e,[n]:t.settings}:e.hasOwnProperty(n)?Object(l.omit)(e,n):e}}return e},insertionPoint:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SHOW_INSERTION_POINT":const{rootClientId:e,index:n,__unstableWithInserter:o}=t;return{rootClientId:e,index:n,__unstableWithInserter:o};case"HIDE_INSERTION_POINT":return null}return e},template:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{isValid:!0},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SET_TEMPLATE_VALIDITY":return{...e,isValid:t.isValid}}return e},settings:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:a.b,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"UPDATE_SETTINGS":return{...e,...t.settings}}return e},preferences:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:a.a,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:r}=n,l=Object(c.select)(i.store).getActiveBlockVariation(r,o);let a=null!=l&&l.name?`${r}/${l.name}`:r;const s={name:a};return"core/block"===r&&(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},isNavigationMode:function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0;return"INSERT_BLOCKS"!==t.type&&("SET_NAVIGATION_MODE"===t.type?t.isNavigationMode:e)},hasBlockMovingClientId:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1?arguments[1]:void 0;return"SET_BLOCK_MOVING_MODE"===t.type?t.hasBlockMovingClientId:"SET_NAVIGATION_MODE"===t.type?null:e},automaticChangeStatus:function(e,t){switch(t.type){case"MARK_AUTOMATIC_CHANGE":return"pending";case"MARK_AUTOMATIC_CHANGE_FINAL":return"pending"===e?"final":void 0;case"SELECTION_CHANGE":return"final"!==e?e:void 0;case"START_TYPING":case"STOP_TYPING":return e}},highlightedBlock:function(e,t){switch(t.type){case"TOGGLE_BLOCK_HIGHLIGHT":const{clientId:n,isHighlighted:o}=t;return o?n:e===n?null:e;case"SELECT_BLOCK":if(t.clientId!==e)return null}return e},lastBlockInserted:function(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;switch(n.type){case"INSERT_BLOCKS":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}}),_=n("pPDe"),y=n("GRId"),E=n("g56x"),C=n("+WrK");const S=[];function w(e,t){const n=e.blocks.byClientId[t];if("web"!==y.Platform.OS&&"core/social-link"===(null==n?void 0:n.name)){const n=e.blocks.attributes[t],{service:o}=n;return o?"core/social-link-"+o:"core/social-link"}return n?n.name:null}function I(e,t){const n=e.blocks.byClientId[t];return!!n&&n.isValid}function x(e,t){return e.blocks.byClientId[t]?e.blocks.attributes[t]:null}function B(e,t){return e.blocks.byClientId[t]?e.blocks.tree[t]:null}const T=Object(_.a)((e,t)=>{const n=e.blocks.byClientId[t];return n?{...n,attributes:x(e,t)}:null},(e,t)=>[e.blocks.byClientId[t],e.blocks.attributes[t]]);function P(e,t){var n;const o=t&&mt(e,t)?"controlled||"+t:t||"";return(null===(n=e.blocks.tree[o])||void 0===n?void 0:n.innerBlocks)||S}const R=Object(_.a)((e,t)=>({clientId:t,innerBlocks:N(e,t)}),e=>[e.blocks.order]),N=Object(_.a)((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return Object(l.map)(pe(e,t),t=>R(e,t))}),e=>[e.blocks.order]),M=(e,t)=>Object(l.flatMap)(t,t=>{const n=pe(e,t);return[...n,...M(e,n)]}),L=Object(_.a)(e=>{const t=pe(e);return[...t,...M(e,t)]},e=>[e.blocks.order]),A=Object(_.a)((e,t)=>{const n=L(e);return t?Object(l.reduce)(n,(n,o)=>e.blocks.byClientId[o].name===t?n+1:n,0):n.length},e=>[e.blocks.order,e.blocks.byClientId]),D=Object(_.a)((e,t)=>Object(l.map)(Object(l.castArray)(t),t=>B(e,t)),(e,t)=>Object(l.map)(Object(l.castArray)(t),t=>e.blocks.tree[t]));function F(e,t){return pe(e,t).length}function z(e){return e.selection.selectionStart}function H(e){return e.selection.selectionEnd}function V(e){return e.selection.selectionStart.clientId}function G(e){return e.selection.selectionEnd.clientId}function U(e){const t=re(e).length;return t||(e.selection.selectionStart.clientId?1:0)}function W(e){const{selectionStart:t,selectionEnd:n}=e.selection;return!!t.clientId&&t.clientId===n.clientId}function q(e){const{selectionStart:t,selectionEnd:n}=e.selection,{clientId:o}=t;return o&&o===n.clientId?o:null}function K(e){const t=q(e);return t?B(e,t):null}function Y(e,t){return void 0!==e.blocks.parents[t]?e.blocks.parents[t]:null}const $=Object(_.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]),Z=Object(_.a)((function(e,t,n){let o=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const r=$(e,t,o);return Object(l.map)(Object(l.filter)(Object(l.map)(r,t=>({id:t,name:w(e,t)})),e=>{let{name:t}=e;return Array.isArray(n)?n.includes(t):t===n}),e=>{let{id:t}=e;return t})}),e=>[e.blocks.parents]);function X(e,t){let n,o=t;do{n=o,o=e.blocks.parents[o]}while(o);return n}function Q(e,t){const n=q(e),o=[...$(e,t),t],r=[...$(e,n),n];let c;const l=Math.min(o.length,r.length);for(let e=0;e2&&void 0!==arguments[2]?arguments[2]:1;if(void 0===t&&(t=q(e)),void 0===t&&(t=n<0?le(e):ie(e)),!t)return null;const o=Y(e,t);if(null===o)return null;const{order:r}=e.blocks,c=r[o],l=c.indexOf(t),i=l+1*n;return i<0||i===c.length?null:c[i]}function ee(e,t){return J(e,t,-1)}function te(e,t){return J(e,t,1)}function ne(e){return e.initialPosition}const oe=Object(_.a)(e=>{const{selectionStart:t,selectionEnd:n}=e.selection;if(void 0===t.clientId||void 0===n.clientId)return S;if(t.clientId===n.clientId)return[t.clientId];const o=Y(e,t.clientId);if(null===o)return S;const r=pe(e,o),c=r.indexOf(t.clientId),l=r.indexOf(n.clientId);return c>l?r.slice(l,c+1):r.slice(c,l+1)},e=>[e.blocks.order,e.selection.selectionStart.clientId,e.selection.selectionEnd.clientId]);function re(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId===n.clientId?S:oe(e)}const ce=Object(_.a)(e=>{const t=re(e);return t.length?t.map(t=>B(e,t)):S},e=>[...oe.getDependants(e),e.blocks.byClientId,e.blocks.order,e.blocks.attributes]);function le(e){return Object(l.first)(re(e))||null}function ie(e){return Object(l.last)(re(e))||null}function ae(e,t){return le(e)===t}function se(e,t){return-1!==re(e).indexOf(t)}const ue=Object(_.a)((e,t)=>{let n=t,o=!1;for(;n&&!o;)n=Y(e,n),o=se(e,n);return o},e=>[e.blocks.order,e.selection.selectionStart.clientId,e.selection.selectionEnd.clientId]);function de(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId===n.clientId?null:t.clientId||null}function be(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId===n.clientId?null:n.clientId||null}function pe(e,t){return e.blocks.order[t||""]||S}function me(e,t){return pe(e,Y(e,t)).indexOf(t)}function fe(e,t){const{selectionStart:n,selectionEnd:o}=e.selection;return n.clientId===o.clientId&&n.clientId===t}function he(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return Object(l.some)(pe(e,t),t=>fe(e,t)||se(e,t)||n&&he(e,t,n))}function ge(e,t){if(!t)return!1;const n=re(e),o=n.indexOf(t);return o>-1&&oCe(e,t))}function we(e){return e.isCaretWithinFormattedText}function Ie(e){let t,n;const{insertionPoint:o,selection:{selectionEnd:r}}=e;if(null!==o)return o;const{clientId:c}=r;return c?(t=Y(e,c)||void 0,n=me(e,r.clientId)+1):n=pe(e).length,{rootClientId:t,index:n}}function xe(e){return null!==e.insertionPoint}function Be(e){return e.template.isValid}function Te(e){return e.settings.template}function Pe(e,t){if(!t)return e.settings.templateLock;const n=nt(e,t);return n?n.templateLock:null}const Re=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return Object(l.isBoolean)(e)?e:Object(l.isArray)(e)?!(!e.includes("core/post-content")||null!==t)||e.includes(t):n},Ne=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=Object(i.getBlockType)(t),!n)return!1;const{allowedBlockTypes:r}=ot(e),c=Re(r,t,!0);if(!c)return!1;const l=!!Pe(e,o);if(l)return!1;const a=nt(e,o);if(o&&void 0===a)return!1;const s=null==a?void 0:a.allowedBlocks,u=Re(s,t),d=n.parent,b=w(e,o),p=Re(d,b),m=null===u&&null===p||!0===u||!0===p;return m?Object(E.applyFilters)("blockEditor.__unstableCanInsertBlockType",m,n,o,{getBlock:B.bind(null,e),getBlockParentsByBlockName:Z.bind(null,e)}):m},Me=Object(_.a)(Ne,(e,t,n)=>[e.blockListSettings[n],e.blocks.byClientId[n],e.settings.allowedBlockTypes,e.settings.templateLock]);function Le(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return t.every(t=>Me(e,w(e,t),n))}function Ae(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const o=x(e,t);if(null===o)return!0;const{lock:r}=o,c=!!Pe(e,n);return void 0===r||void 0===(null==r?void 0:r.remove)?!c:!(null!=r&&r.remove)}function De(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return t.every(t=>Ae(e,t,n))}function Fe(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const o=x(e,t);if(null===o)return;const{lock:r}=o,c="all"===Pe(e,n);return void 0===r||void 0===(null==r?void 0:r.move)?!c:!(null!=r&&r.move)}function ze(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return t.every(t=>Fe(e,t,n))}function He(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 Ve=(e,t,n)=>!!Object(i.hasBlockSupport)(t,"inserter",!0)&&Ne(e,t.name,n),Ge=(e,t)=>n=>{const o=`${t.id}/${n.name}`,{time:r,count:c=0}=He(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:Ue(r,c)}},Ue=(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}},We=(e,t)=>{let{buildScope:n="inserter"}=t;return t=>{const o=t.name;let r=!1;Object(i.hasBlockSupport)(t.name,"multiple",!0)||(r=Object(l.some)(D(e,L(e)),{name:t.name}));const{time:c,count:a=0}=He(e,o)||{},s={id:o,name:t.name,title:t.title,icon:t.icon,isDisabled:r,frecency:Ue(c,a)};if("transform"===n)return s;const u=Object(i.getBlockVariations)(t.name,"inserter");return{...s,initialAttributes:{},description:t.description,category:t.category,keywords:t.keywords,variations:u,example:t.example,utility:1}}},qe=Object(_.a)((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const n=We(e,{buildScope:"inserter"}),o=/^\s*)[^])*)\5|[^]*?)}\s+)?(\/)?-->/,r=t=>{let n=C.a;if("web"===y.Platform.OS){const e=("string"==typeof t.content.raw?t.content.raw:t.content).match(o);if(e){const[,,t="core/",o]=e,r=Object(i.getBlockType)(t+o);r&&(n=r.icon)}}const r="core/block/"+t.id,{time:c,count:l=0}=He(e,r)||{},a=Ue(c,l);return{id:r,name:"core/block",initialAttributes:{ref:t.id},title:t.title.raw,icon:n,category:"reusable",keywords:[],isDisabled:!1,utility:1,frecency:a}},c=Object(i.getBlockTypes)().filter(n=>Ve(e,n,t)).map(n),l=Ne(e,"core/block",t)?st(e).map(r):[],a=c.reduce((t,n)=>{const{variations:o=[]}=n;if(o.some(e=>{let{isDefault:t}=e;return t})||t.push(n),o.length){const r=Ge(e,n);t.push(...o.map(r))}return t},[]),s=(e,t)=>{const{core:n,noncore:o}=e;return(t.name.startsWith("core/")?n:o).push(t),e},{core:u,noncore:d}=a.reduce(s,{core:[],noncore:[]}),b=[...u,...d];return[...b,...l]}),(e,t)=>[e.blockListSettings[t],e.blocks.byClientId,e.blocks.order,e.preferences.insertUsage,e.settings.allowedBlockTypes,e.settings.templateLock,st(e),Object(i.getBlockTypes)()]),Ke=Object(_.a)((function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const o=We(e,{buildScope:"transform"}),r=Object(i.getBlockTypes)().filter(t=>Ve(e,t,n)).map(o),c=Object(l.mapKeys)(r,e=>{let{name:t}=e;return t}),a=Object(i.getPossibleBlockTransformations)(t).reduce((e,t)=>(c[null==t?void 0:t.name]&&e.push(c[t.name]),e),[]),s=Object(l.orderBy)(a,e=>c[e.name].frecency,"desc");return s}),(e,t)=>[e.blockListSettings[t],e.blocks.byClientId,e.preferences.insertUsage,e.settings.allowedBlockTypes,e.settings.templateLock,Object(i.getBlockTypes)()]),Ye=Object(_.a)((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const n=Object(l.some)(Object(i.getBlockTypes)(),n=>Ve(e,n,t));if(n)return!0;const o=Ne(e,"core/block",t)&&st(e).length>0;return o}),(e,t)=>[e.blockListSettings[t],e.blocks.byClientId,e.settings.allowedBlockTypes,e.settings.templateLock,st(e),Object(i.getBlockTypes)()]),$e=Object(_.a)((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(t)return Object(l.filter)(Object(i.getBlockTypes)(),n=>Ve(e,n,t))}),(e,t)=>[e.blockListSettings[t],e.blocks.byClientId,e.settings.allowedBlockTypes,e.settings.templateLock,Object(i.getBlockTypes)()]),Ze=Object(_.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,c=null===(n=e.blockListSettings[o])||void 0===n?void 0:n.__experimentalDirectInsert;return r&&c?"function"==typeof c?c(B(e,o))?r:null:r:void 0}),(e,t)=>[e.blockListSettings[t],e.blocks.tree[t]]),Xe=Object(_.a)((e,t)=>{const n=e.settings.__experimentalBlockPatterns.find(e=>{let{name:n}=e;return n===t});return n?{...n,blocks:Object(i.parse)(n.content)}:null},e=>[e.settings.__experimentalBlockPatterns]),Qe=Object(_.a)(e=>{const t=e.settings.__experimentalBlockPatterns,{allowedBlockTypes:n}=ot(e);return t.filter(e=>{let{inserter:t=!0}=e;return!!t}).map(t=>{let{name:n}=t;return Xe(e,n)}).filter(e=>{let{blocks:t}=e;return((e,t)=>{if(Object(l.isBoolean)(t))return t;const n=[...e];for(;n.length>0;){var o;const e=n.shift();if(!Re(t,e.name||e.blockName,!0))return!1;null===(o=e.innerBlocks)||void 0===o||o.forEach(e=>{n.push(e)})}return!0})(t,n)})},e=>[e.settings.__experimentalBlockPatterns,e.settings.allowedBlockTypes]),Je=Object(_.a)((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const n=Qe(e),o=Object(l.filter)(n,n=>{let{blocks:o}=n;return o.every(n=>{let{name:o}=n;return Me(e,o,t)})});return o}),(e,t)=>[e.settings.__experimentalBlockPatterns,e.settings.allowedBlockTypes,e.settings.templateLock,e.blockListSettings[t],e.blocks.byClientId[t]]),et=Object(_.a)((function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!t)return S;const o=Je(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)=>[...Je.getDependants(e,t)]),tt=Object(_.a)((function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!t)return S;if(t.some(t=>{let{clientId:n,innerBlocks:o}=t;return o.length||mt(e,n)}))return S;const o=Array.from(new Set(t.map(e=>{let{name:t}=e;return t})));return et(e,o,n)}),(e,t)=>[...et.getDependants(e,t)]);function nt(e,t){return e.blockListSettings[t]}function ot(e){return e.settings}function rt(e){return e.blocks.isPersistentChange}const ct=Object(_.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]),lt=Object(_.a)((e,t)=>{var n;const o=Object(l.find)(st(e),e=>e.id===t);return o?null===(n=o.title)||void 0===n?void 0:n.raw:null},e=>[st(e)]);function it(e){return e.blocks.isIgnoredChange}function at(e){return e.lastBlockAttributesChange}function st(e){var t,n;return null!==(t=null==e||null===(n=e.settings)||void 0===n?void 0:n.__experimentalReusableBlocks)&&void 0!==t?t:S}function ut(e){return e.isNavigationMode}function dt(e){return e.hasBlockMovingClientId}function bt(e){return!!e.automaticChangeStatus}function pt(e,t){return e.highlightedBlock===t}function mt(e,t){return!!e.blocks.controlledInnerBlocks[t]}const ft=Object(_.a)((e,t)=>{if(!t.length)return null;const n=q(e);if(t.includes(w(e,n)))return n;const o=re(e),r=Z(e,n||o[0],t);return r?Object(l.last)(r):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}var gt=n("gdqT"),Ot=n("l3Sj"),vt=n("qRz9"),jt=n("NMb1"),kt=n.n(jt);const _t=e=>t=>{let{dispatch:n}=t;n({type:"RESET_BLOCKS",blocks:e}),n(yt(e))},yt=e=>t=>{let{select:n,dispatch:o}=t;const r=n.getTemplate(),c=n.getTemplateLock(),l=!r||"all"!==c||Object(i.doBlocksMatchTemplate)(e,r);if(l!==n.isValidTemplate())return o.setTemplateValidity(l),l};function Et(e,t,n){return{type:"RESET_SELECTION",selectionStart:e,selectionEnd:t,initialPosition:n}}function Ct(e){return kt()('wp.data.dispatch( "core/block-editor" ).receiveBlocks',{since:"5.9",alternative:"resetBlocks or insertBlocks"}),{type:"RECEIVE_BLOCKS",blocks:e}}function St(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return{type:"UPDATE_BLOCK_ATTRIBUTES",clientIds:Object(l.castArray)(e),attributes:t,uniqueByBlock:n}}function wt(e,t){return{type:"UPDATE_BLOCK",clientId:e,updates:t}}function It(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return{type:"SELECT_BLOCK",initialPosition:t,clientId:e}}const xt=e=>t=>{let{select:n,dispatch:o}=t;const r=n.getPreviousBlockClientId(e);r&&o.selectBlock(r,-1)},Bt=e=>t=>{let{select:n,dispatch:o}=t;const r=n.getNextBlockClientId(e);r&&o.selectBlock(r)};function Tt(){return{type:"START_MULTI_SELECT"}}function Pt(){return{type:"STOP_MULTI_SELECT"}}const Rt=(e,t)=>n=>{let{select:o,dispatch:r}=n;if(o.getBlockRootClientId(e)!==o.getBlockRootClientId(t))return;r({type:"MULTI_SELECT",start:e,end:t});const c=o.getSelectedBlockCount();Object(gt.speak)(Object(Ot.sprintf)(Object(Ot._n)("%s block selected.","%s blocks selected.",c),c),"assertive")};function Nt(){return{type:"CLEAR_SELECTED_BLOCK"}}function Mt(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return{type:"TOGGLE_SELECTION",isSelectionEnabled:e}}function Lt(e,t){var n,o;const r=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(!Object(i.hasBlockSupport)(n,"defaultStylePicker",!0))return e;if(!r[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:c={}}=e,l=r[n];return{...e,attributes:{...c,className:`${o||""} is-style-${l}`.trim()}}})}const At=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 c=>{let{select:i,dispatch:a}=c;e=Object(l.castArray)(e),t=Lt(Object(l.castArray)(t),i.getSettings());const s=i.getBlockRootClientId(Object(l.first)(e));for(let e=0;e{let{select:t,dispatch:n}=e;if(t.getBlockCount()>0)return;const{__unstableHasCustomAppender:o}=t.getSettings();o||n.insertDefaultBlock()})}};function Dt(e,t){return At(e,t)}const Ft=e=>(t,n)=>o=>{let{select:r,dispatch:c}=o;r.canMoveBlocks(t,n)&&c({type:e,clientIds:Object(l.castArray)(t),rootClientId:n})},zt=Ft("MOVE_BLOCKS_DOWN"),Ht=Ft("MOVE_BLOCKS_UP"),Vt=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:c,dispatch:l}=r;if(c.canMoveBlocks(e,t)){if(t!==n){if(!c.canRemoveBlocks(e,t))return;if(!c.canInsertBlocks(e,n))return}l({type:"MOVE_BLOCKS_TO_POSITION",fromRootClientId:t,toRootClientId:n,clientIds:e,index:o})}}};function Gt(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 Vt([e],t,n,o)}function Ut(e,t,n,o,r){return Wt([e],t,n,o,0,r)}const Wt=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,c=arguments.length>5?arguments[5]:void 0;return i=>{let{select:a,dispatch:s}=i;Object(l.isObject)(r)&&(c=r,r=0,kt()("meta argument in wp.data.dispatch('core/block-editor')",{since:"10.1",plugin:"Gutenberg",hint:"The meta argument is now the 6th argument of the function"})),e=Lt(Object(l.castArray)(e),a.getSettings());const u=[];for(const t of e){a.canInsertBlockType(t.name,n)&&u.push(t)}u.length&&s({type:"INSERT_BLOCKS",blocks:u,index:t,rootClientId:n,time:Date.now(),updateSelection:o,initialPosition:o?r:null,meta:c})}};function qt(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 Kt(){return{type:"HIDE_INSERTION_POINT"}}function Yt(e){return{type:"SET_TEMPLATE_VALIDITY",isValid:e}}const $t=()=>e=>{let{select:t,dispatch:n}=e;n({type:"SYNCHRONIZE_TEMPLATE"});const o=t.getBlocks(),r=t.getTemplate(),c=Object(i.synchronizeBlocksWithTemplate)(o,r);n.resetBlocks(c)},Zt=(e,t)=>n=>{let{select:o,dispatch:r}=n;const c=[e,t];r({type:"MERGE_BLOCKS",blocks:c});const[a,s]=c,u=o.getBlock(a),d=Object(i.getBlockType)(u.name);if(d&&!d.merge)return void r.selectBlock(u.clientId);const b=o.getBlock(s),p=Object(i.getBlockType)(b.name),{clientId:m,attributeKey:f,offset:h}=o.getSelectionStart(),g=(m===a?d:p).attributes[f],O=(m===a||m===s)&&void 0!==f&&void 0!==h&&!!g;g||("number"==typeof f?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 f):window.console.error("The RichText identifier prop does not match any attributes defined by the block."));const v=Object(i.cloneBlock)(u),j=Object(i.cloneBlock)(b);if(O){const e=m===a?v:j,t=e.attributes[f],{multiline:n,__unstableMultilineWrapperTags:o,__unstablePreserveWhiteSpace:r}=g,c=Object(vt.insert)(Object(vt.create)({html:t,multilineTag:n,multilineWrapperTags:o,preserveWhiteSpace:r}),"†",h,h);e.attributes[f]=Object(vt.toHTMLString)({value:c,multilineTag:n,preserveWhiteSpace:r})}const k=u.name===b.name?[j]:Object(i.switchToBlockType)(j,u.name);if(!k||!k.length)return;const _=d.merge(v.attributes,k[0].attributes);if(O){const e=Object(l.findKey)(_,e=>"string"==typeof e&&-1!==e.indexOf("†")),t=_[e],{multiline:n,__unstableMultilineWrapperTags:o,__unstablePreserveWhiteSpace:c}=d.attributes[e],i=Object(vt.create)({html:t,multilineTag:n,multilineWrapperTags:o,preserveWhiteSpace:c}),a=i.text.indexOf("†"),s=Object(vt.remove)(i,a,a+1),b=Object(vt.toHTMLString)({value:s,multilineTag:n,preserveWhiteSpace:c});_[e]=b,r.selectionChange(u.clientId,e,a,a)}r.replaceBlocks([u.clientId,b.clientId],[{...u,attributes:{...u.attributes,..._}},...k.slice(1)],0)},Xt=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=Object(l.castArray)(e);const c=o.getBlockRootClientId(e[0]);o.canRemoveBlocks(e,c)&&(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 Qt(e,t){return Xt([e],t)}function Jt(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 en(e){return{type:"TOGGLE_BLOCK_MODE",clientId:e}}function tn(){return{type:"START_TYPING"}}function nn(){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 rn(){return{type:"STOP_DRAGGING_BLOCKS"}}function cn(){return{type:"ENTER_FORMATTED_TEXT"}}function ln(){return{type:"EXIT_FORMATTED_TEXT"}}function an(e,t,n,o){return{type:"SELECTION_CHANGE",clientId:e,attributeKey:t,startOffset:n,endOffset:o}}function sn(e,t,n){const o=Object(i.getDefaultBlockName)();if(!o)return;return Ut(Object(i.createBlock)(o,e),n,t)}function un(e,t){return{type:"UPDATE_BLOCK_LIST_SETTINGS",clientId:e,settings:t}}function dn(e){return{type:"UPDATE_SETTINGS",settings:e}}function bn(e,t){return{type:"SAVE_REUSABLE_BLOCK_SUCCESS",id:e,updatedId:t}}function pn(){return{type:"MARK_LAST_CHANGE_AS_PERSISTENT"}}function mn(){return{type:"MARK_NEXT_CHANGE_AS_NOT_PERSISTENT"}}const fn=()=>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"})})},hn=function(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return t=>{let{dispatch:n}=t;n({type:"SET_NAVIGATION_MODE",isNavigationMode:e}),e?Object(gt.speak)(Object(Ot.__)("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.")):Object(gt.speak)(Object(Ot.__)("You are currently in edit mode. To return to the navigation mode, press Escape."))}},gn=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&&Object(gt.speak)(Object(Ot.__)("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."))}},On=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;const c=o.getBlocksByClientId(e);if(Object(l.some)(c,e=>!e))return;if(c.map(e=>e.name).some(e=>!Object(i.hasBlockSupport)(e,"multiple",!0)))return;const a=o.getBlockRootClientId(e[0]),s=o.getBlockIndex(Object(l.last)(Object(l.castArray)(e))),u=c.map(e=>Object(i.__experimentalCloneSanitizedBlock)(e));return r.insertBlocks(u,s+1,a,t),u.length>1&&t&&r.multiSelect(Object(l.first)(u).clientId,Object(l.last)(u).clientId),u.map(e=>e.clientId)}},vn=e=>t=>{let{select:n,dispatch:o}=t;if(!e)return;const r=n.getBlockRootClientId(e);if(n.getTemplateLock(r))return;const c=n.getBlockIndex(e);return o.insertDefaultBlock({},r,c)},jn=e=>t=>{let{select:n,dispatch:o}=t;if(!e)return;const r=n.getBlockRootClientId(e);if(n.getTemplateLock(r))return;const c=n.getBlockIndex(e);return o.insertDefaultBlock({},r,c+1)};function kn(e,t){return{type:"TOGGLE_BLOCK_HIGHLIGHT",clientId:e,isHighlighted:t}}const _n=e=>async t=>{let{dispatch:n}=t;n(kn(e,!0)),await new Promise(e=>setTimeout(e,150)),n(kn(e,!1))};function yn(e,t){return{type:"SET_HAS_CONTROLLED_INNER_BLOCKS",hasControlledInnerBlocks:t,clientId:e}}var En=n("AHN3");const Cn={reducer:k,selectors:o,actions:r,__experimentalUseThunks:!0},Sn=Object(c.createReduxStore)(En.a,{...Cn,persist:["preferences"]});Object(c.registerStore)(En.a,{...Cn,persist:["preferences"]})},Bo0k:function(e,t,n){"use strict";n.d(t,"b",(function(){return a})),n.d(t,"a",(function(){return s}));var o=n("GRId"),r=n("tI+e"),c=n("l3Sj");const l=[{name:Object(c._x)("Regular","font style"),value:"normal"},{name:Object(c._x)("Italic","font style"),value:"italic"}],i=[{name:Object(c._x)("Thin","font weight"),value:"100"},{name:Object(c._x)("Extra Light","font weight"),value:"200"},{name:Object(c._x)("Light","font weight"),value:"300"},{name:Object(c._x)("Regular","font weight"),value:"400"},{name:Object(c._x)("Medium","font weight"),value:"500"},{name:Object(c._x)("Semi Bold","font weight"),value:"600"},{name:Object(c._x)("Bold","font weight"),value:"700"},{name:Object(c._x)("Extra Bold","font weight"),value:"800"},{name:Object(c._x)("Black","font weight"),value:"900"}],a=(e,t)=>e?t?Object(c.__)("Appearance"):Object(c.__)("Font style"):Object(c.__)("Font weight");function s(e){const{onChange:t,hasFontStyles:n=!0,hasFontWeights:s=!0,value:{fontStyle:u,fontWeight:d}}=e,b=n||s,p=a(n,s),m={key:"default",name:Object(c.__)("Default"),style:{fontStyle:void 0,fontWeight:void 0}},f=Object(o.useMemo)(()=>n&&s?(()=>{const e=[m];return l.forEach(t=>{let{name:n,value:o}=t;i.forEach(t=>{let{name:r,value:l}=t;const i="normal"===o?r:Object(c.sprintf)(Object(c.__)("%1$s %2$s"),r,n);e.push({key:`${o}-${l}`,name:i,style:{fontStyle:o,fontWeight:l}})})}),e})():n?(()=>{const e=[m];return l.forEach(t=>{let{name:n,value:o}=t;e.push({key:o,name:n,style:{fontStyle:o,fontWeight:void 0}})}),e})():(()=>{const e=[m];return i.forEach(t=>{let{name:n,value:o}=t;e.push({key:o,name:n,style:{fontStyle:void 0,fontWeight:o}})}),e})(),[e.options]),h=f.find(e=>e.style.fontStyle===u&&e.style.fontWeight===d)||f[0];return b&&Object(o.createElement)(r.CustomSelectControl,{className:"components-font-appearance-control",label:p,describedBy:h?n?s?Object(c.sprintf)(Object(c.__)("Currently selected font appearance: %s"),h.name):Object(c.sprintf)(Object(c.__)("Currently selected font style: %s"),h.name):Object(c.sprintf)(Object(c.__)("Currently selected font weight: %s"),h.name):Object(c.__)("No selected font appearance"),options:f,value:h,onChange:e=>{let{selectedItem:n}=e;return t(n.style)}})}},Bpkj:function(e,t,n){"use strict";var o=n("GRId"),r=n("Tqx9");const c=Object(o.createElement)(r.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(o.createElement)(r.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"}));t.a=c},Btt3:function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));var o=n("YLtl");const r=(e,t)=>{if(!t||!e)return;const n=t.filter(t=>{let{attributes:n}=t;return!(!n||!Object.keys(n).length)&&Object(o.isMatch)(e,n)});return 1===n.length?n[0]:void 0}},CNgt: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)}),c=this&&this.__assign||Object.assign||function(e){for(var t,n=1,o=arguments.length;n0&&void 0!==arguments[0]?arguments[0]:{};const{clientId:n}=Object(l.c)(),o=Object(i.a)("color.gradients.custom"),d=Object(i.a)("color.gradients.theme"),p=Object(i.a)("color.gradients.default"),m=Object(r.useMemo)(()=>[...o||[],...d||[],...p||[]],[o,d,p]),{gradient:f,customGradient:h}=Object(c.useSelect)(o=>{const{getBlockAttributes:r}=o(a.a),c=r(n)||{};return{customGradient:c[t],gradient:c[e]}},[n,e,t]),{updateBlockAttributes:g}=Object(c.useDispatch)(a.a),O=Object(r.useCallback)(o=>{const r=b(m,o);g(n,r?{[e]:r,[t]:void 0}:{[e]:void 0,[t]:o})},[m,n,g]),v=s(f);let j;return j=f?u(m,f):h,{gradientClass:v,gradientValue:j,setGradient:O}}},Crq9:function(e,t,n){"use strict";var o=n("GRId"),r=n("Tqx9");const c=Object(o.createElement)(r.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(o.createElement)(r.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"}));t.a=c},"DmX/":function(e,t,n){"use strict";var o=n("GRId"),r=n("Tqx9");const c=Object(o.createElement)(r.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(o.createElement)(r.Path,{d:"M20 9h-7.2V4h-1.6v5H4v6h7.2v5h1.6v-5H20z"}));t.a=c},ERVc:function(e,t,n){"use strict";n.d(t,"a",(function(){return l}));var o=n("1ZqX"),r=n("HSyU"),c=n("BhPs");function l(e){return Object(o.useSelect)(t=>{const{getBlockName:n,getBlockAttributes:o}=t(c.a),l=o(e);if(null==l||!l.className)return;const i=Object(r.getBlockType)(n(e));return(null==i?void 0:i.apiVersion)>1?l.className:void 0},[e])}},EpZT:function(e,t,n){"use strict";var o=n("GRId"),r=n("Tqx9");const c=Object(o.createElement)(r.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(o.createElement)(r.Path,{d:"M7 9v6h10V9H7zM5 19.8h14v-1.5H5v1.5zM5 4.3v1.5h14V4.3H5z"}));t.a=c},Fmc1:function(e,t,n){"use strict";var o=n("wx14"),r=n("GRId"),c=n("tI+e"),l=n("K9lf"),i=n("l3Sj"),a=n("REKd"),s=n("j6zP");function u(e){let{isDraggable:t,pattern:n,onClick:i,composite:d}=e;const{blocks:b,viewportWidth:p}=n,m="block-editor-block-patterns-list__item-description-"+Object(l.useInstanceId)(u);return Object(r.createElement)(s.a,{isEnabled:t,blocks:b},e=>{let{draggable:t,onDragStart:l,onDragEnd:s}=e;return Object(r.createElement)("div",{className:"block-editor-block-patterns-list__list-item","aria-label":n.title,"aria-describedby":n.description?m:void 0,draggable:t,onDragStart:l,onDragEnd:s},Object(r.createElement)(c.__unstableCompositeItem,Object(o.a)({role:"option",as:"div"},d,{className:"block-editor-block-patterns-list__item",onClick:()=>i(n,b)}),Object(r.createElement)(a.a,{blocks:b,viewportWidth:p}),Object(r.createElement)("div",{className:"block-editor-block-patterns-list__item-title"},n.title),!!n.description&&Object(r.createElement)(c.VisuallyHidden,{id:m},n.description)))})}function d(){return Object(r.createElement)("div",{className:"block-editor-block-patterns-list__item is-placeholder"})}t.a=function(e){let{isDraggable:t,blockPatterns:n,shownPatterns:l,onClickPattern:a,orientation:s,label:b=Object(i.__)("Block Patterns")}=e;const p=Object(c.__unstableUseCompositeState)({orientation:s});return Object(r.createElement)(c.__unstableComposite,Object(o.a)({},p,{role:"listbox",className:"block-editor-block-patterns-list","aria-label":b}),n.map(e=>l.includes(e)?Object(r.createElement)(u,{key:e.name,pattern:e,onClick:a,isDraggable:t,composite:p}):Object(r.createElement)(d,{key:e.name})))}},FnAh:function(e,t,n){"use strict";var o=n("GRId"),r=n("Tqx9");const c=Object(o.createElement)(r.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(o.createElement)(r.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"}));t.a=c},G4zt:function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var o=n("9Do8"),r=n.n(o),c=n("GRId"),l=n("1ZqX"),i=n("1CF3"),a=n("BhPs");function s(e){const t=Object(c.useRef)(),n=Object(l.useSelect)(t=>{const{isBlockSelected:n,getBlockSelectionEnd:o}=t(a.a);return n(e)||o()===e},[e]);return Object(c.useEffect)(()=>{if(!n)return;const e=t.current;if(!e)return;if(e.contains(e.ownerDocument.activeElement))return;const o=Object(i.getScrollContainer)(e)||e.ownerDocument.defaultView;o&&r()(e,o,{onlyScrollIfNeeded:!0})},[n]),t}},GKUk:function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var o=n("wx14"),r=n("GRId"),c=n("YLtl"),l=n("tI+e"),i=n("l3Sj"),a=n("v5LD");function s(e){let{value:t="",onChange:n,fontFamilies:s,...u}=e;const d=Object(a.a)("typography.fontFamilies");if(s||(s=d),Object(c.isEmpty)(s))return null;const b=[{value:"",label:Object(i.__)("Default")},...s.map(e=>{let{fontFamily:t,name:n}=e;return{value:t,label:n||t}})];return Object(r.createElement)(l.SelectControl,Object(o.a)({label:Object(i.__)("Font family"),options:b,value:t,onChange:n,labelPosition:"top"},u))}},GOly:function(e,t,n){"use strict";var o=n("GRId");const r=Object(o.createContext)();t.a=r},GRId:function(e,t){e.exports=window.wp.element},GemG:function(e,t,n){var o,r,c; /*! autosize 4.0.4 @@ -23,4 +66,4 @@ this.wp=this.wp||{},this.wp.blockEditor=function(e){var t={};function n(o){if(t[ * @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,c=n in document;if(!c){var l=document.createElement("div");l.setAttribute(n,"return;"),c="function"==typeof l[n]}return!c&&o&&"wheel"===e&&(c=document.implementation.hasFeature("Events.wheel","3.0")),c}},f8JO:function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var o=n("YLtl"),r=n("1ZqX"),c=n("HSyU"),l=n("wC17"),i=n("BhPs");function a(e){let{clientId:t}=e;const{attributes:n,name:a,reusableBlockTitle:s}=Object(r.useSelect)(e=>{if(!t)return{};const{getBlockName:n,getBlockAttributes:o,__experimentalGetReusableBlockTitle:r}=e(i.a),l=n(t);if(!l)return{};const a=Object(c.isReusableBlock)(Object(c.getBlockType)(l));return{attributes:o(t),name:l,reusableBlockTitle:a&&r(o(t).ref)}},[t]),u=Object(l.a)(t);if(!a||!u)return null;const d=Object(c.getBlockType)(a),b=d?Object(c.__experimentalGetBlockLabel)(d,n):null,p=s||b;return p&&p!==d.title?Object(o.truncate)(p,{length:35}):u.title}},fHnH:function(e,t,n){"use strict";n.d(t,"a",(function(){return x})),n.d(t,"b",(function(){return T}));var o={grad:.9,turn:360,rad:360/(2*Math.PI)},r=function(e){return"string"==typeof e?e.length>0:"number"==typeof e},c=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=Math.pow(10,t)),Math.round(n*e)/n+0},l=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=1),e>n?n:e>t?e:t},i=function(e){return(e=isFinite(e)?e%360:0)>0?e:e+360},a=function(e){return{r:l(e.r,0,255),g:l(e.g,0,255),b:l(e.b,0,255),a:l(e.a)}},s=function(e){return{r:c(e.r),g:c(e.g),b:c(e.b),a:c(e.a,3)}},u=/^#([0-9a-f]{3,8})$/i,d=function(e){var t=e.toString(16);return t.length<2?"0"+t:t},b=function(e){var t=e.r,n=e.g,o=e.b,r=e.a,c=Math.max(t,n,o),l=c-Math.min(t,n,o),i=l?c===t?(n-o)/l:c===n?2+(o-t)/l:4+(t-n)/l:0;return{h:60*(i<0?i+6:i),s:c?l/c*100:0,v:c/255*100,a:r}},p=function(e){var t=e.h,n=e.s,o=e.v,r=e.a;t=t/360*6,n/=100,o/=100;var c=Math.floor(t),l=o*(1-n),i=o*(1-(t-c)*n),a=o*(1-(1-t+c)*n),s=c%6;return{r:255*[o,i,l,l,a,o][s],g:255*[a,o,o,i,l,l][s],b:255*[l,l,a,o,o,i][s],a:r}},m=function(e){return{h:i(e.h),s:l(e.s,0,100),l:l(e.l,0,100),a:l(e.a)}},f=function(e){return{h:c(e.h),s:c(e.s),l:c(e.l),a:c(e.a,3)}},h=function(e){return p((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},g=function(e){return{h:(t=b(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},O=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,v=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,j=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,k=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,_={string:[[function(e){var t=u.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?c(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?c(parseInt(e.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(e){var t=j.exec(e)||k.exec(e);return t?t[2]!==t[4]||t[4]!==t[6]?null:a({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=O.exec(e)||v.exec(e);if(!t)return null;var n,r,c=m({h:(n=t[1],r=t[2],void 0===r&&(r="deg"),Number(n)*(o[r]||1)),s:Number(t[3]),l:Number(t[4]),a:void 0===t[5]?1:Number(t[5])/(t[6]?100:1)});return h(c)},"hsl"]],object:[[function(e){var t=e.r,n=e.g,o=e.b,c=e.a,l=void 0===c?1:c;return r(t)&&r(n)&&r(o)?a({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,c=e.a,l=void 0===c?1:c;if(!r(t)||!r(n)||!r(o))return null;var i=m({h:Number(t),s:Number(n),l:Number(o),a:Number(l)});return h(i)},"hsl"],[function(e){var t=e.h,n=e.s,o=e.v,c=e.a,a=void 0===c?1:c;if(!r(t)||!r(n)||!r(o))return null;var s=function(e){return{h:i(e.h),s:l(e.s,0,100),v:l(e.v,0,100),a:l(e.a)}}({h:Number(t),s:Number(n),v:Number(o),a:Number(a)});return p(s)},"hsv"]]},y=function(e,t){for(var n=0;n=.5},e.prototype.toHex=function(){return t=(e=s(this.rgba)).r,n=e.g,o=e.b,l=(r=e.a)<1?d(c(255*r)):"","#"+d(t)+d(n)+d(o)+l;var e,t,n,o,r,l},e.prototype.toRgb=function(){return s(this.rgba)},e.prototype.toRgbString=function(){return t=(e=s(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 f(g(this.rgba))},e.prototype.toHslString=function(){return t=(e=f(g(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=b(this.rgba),{h:c(e.h),s:c(e.s),v:c(e.v),a:c(e.a,3)};var e},e.prototype.invert=function(){return x({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),x(C(this.rgba,e))},e.prototype.desaturate=function(e){return void 0===e&&(e=.1),x(C(this.rgba,-e))},e.prototype.grayscale=function(){return x(C(this.rgba,-1))},e.prototype.lighten=function(e){return void 0===e&&(e=.1),x(w(this.rgba,e))},e.prototype.darken=function(e){return void 0===e&&(e=.1),x(w(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?x({r:(t=this.rgba).r,g:t.g,b:t.b,a:e}):c(this.rgba.a,3);var t},e.prototype.hue=function(e){var t=g(this.rgba);return"number"==typeof e?x({h:e,s:t.s,l:t.l,a:t.a}):c(t.h)},e.prototype.isEqual=function(e){return this.toHex()===x(e).toHex()},e}(),x=function(e){return e instanceof I?e:new I(e)},B=[],T=function(e){e.forEach((function(e){B.indexOf(e)<0&&(e(I,_),B.push(e))}))}},fOYa:function(e,t,n){"use strict";n.d(t,"a",(function(){return h}));var o=n("wx14"),r=n("GRId"),c=n("YLtl"),l=n("tI+e"),i=n("HSyU"),a=n("1ZqX");var s={default:Object(l.createSlotFill)("BlockControls"),block:Object(l.createSlotFill)("BlockControlsBlock"),inline:Object(l.createSlotFill)("BlockFormatControls"),other:Object(l.createSlotFill)("BlockControlsOther"),parent:Object(l.createSlotFill)("BlockControlsParent")},u=n("BhPs"),d=n("ur0x"),b=n("HgtZ");function p(e){let{group:t="default",controls:n,children:o,__experimentalShareWithChildBlocks:p=!1}=e;const m=function(e,t){const n=Object(b.a)(),{clientId:o}=Object(d.c)(),r=Object(a.useSelect)(e=>{const{getBlockName:n,hasSelectedInnerBlock:r}=e(u.a),{hasBlockSupport:c}=e(i.store);return t&&c(n(o),"__experimentalExposeControlsToChildren",!1)&&r(o)},[t,o]);var c;return n?null===(c=s[e])||void 0===c?void 0:c.Fill:r?s.parent.Fill:null}(t,p);return m?Object(r.createElement)(l.__experimentalStyleProvider,{document:document},Object(r.createElement)(m,null,e=>{const i=Object(c.isEmpty)(e)?null:e;return Object(r.createElement)(l.__experimentalToolbarContext.Provider,{value:i},"default"===t&&Object(r.createElement)(l.ToolbarGroup,{controls:n}),o)})):null}function m(e){let{group:t="default",...n}=e;const c=Object(r.useContext)(l.__experimentalToolbarContext),i=s[t].Slot,a=Object(l.__experimentalUseSlot)(i.__unstableName);return Boolean(a.fills&&a.fills.length)?"default"===t?Object(r.createElement)(i,Object(o.a)({},n,{bubblesVirtually:!0,fillProps:c})):Object(r.createElement)(l.ToolbarGroup,null,Object(r.createElement)(i,Object(o.a)({},n,{bubblesVirtually:!0,fillProps:c}))):null}const f=p;f.Slot=m;const h=e=>Object(r.createElement)(p,Object(o.a)({group:"inline"},e));h.Slot=e=>Object(r.createElement)(m,Object(o.a)({group:"inline"},e));t.b=f},fPbg:function(e,t,n){"use strict";var o=n("GRId"),r=n("Tqx9");const c=Object(o.createElement)(r.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(o.createElement)(r.Path,{d:"M4 19.8h8.9v-1.5H4v1.5zm8.9-15.6H4v1.5h8.9V4.2zm-8.9 7v1.5h16v-1.5H4z"}));t.a=c},faye:function(e,t){e.exports=window.ReactDOM},felP:function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var o=n("1CF3"),r=n("RxS6"),c=n("1ZqX"),l=n("K9lf"),i=n("BhPs");function a(e){const t=Object(c.useSelect)(t=>t(i.a).isBlockSelected(e),[e]),{getBlockRootClientId:n,getBlockIndex:a}=Object(c.useSelect)(i.a),{insertDefaultBlock:s,removeBlock:u}=Object(c.useDispatch)(i.a);return Object(l.useRefEffect)(c=>{if(t)return c.addEventListener("keydown",l),c.addEventListener("dragstart",i),()=>{c.removeEventListener("keydown",l),c.removeEventListener("dragstart",i)};function l(t){const{keyCode:l,target:i}=t;l!==r.ENTER&&l!==r.BACKSPACE&&l!==r.DELETE||i!==c||Object(o.isTextField)(i)||(t.preventDefault(),l===r.ENTER?s({},n(e),a(e)+1):u(e))}function i(e){e.preventDefault()}},[e,t,n,a,s,u])}},g56x:function(e,t){e.exports=window.wp.hooks},gdqT:function(e,t){e.exports=window.wp.a11y},hF7m:function(e,t){e.exports=window.wp.keyboardShortcuts},hHnB:function(e,t,n){"use strict";var o=n("wx14"),r=n("GRId"),c=n("TSYQ"),l=n.n(c),i=n("l3Sj"),a=n("K9lf"),s=n("tI+e"),u=n("zQI6"),d=n("TVFh");function b(e){return Object(r.useMemo)(()=>{const t=document.implementation.createHTMLDocument("");return t.body.innerHTML=e,Array.from(t.body.children)},[e])}t.a=Object(r.forwardRef)((function(e,t){var n,c;let{contentRef:p,children:m,head:f,tabIndex:h=0,...g}=e;const[,O]=Object(r.useReducer)(()=>({})),[v,j]=Object(r.useState)(),[k,_]=Object(r.useState)([]),y=b(null===(n=window.__editorAssets)||void 0===n?void 0:n.styles),E=b(null===(c=window.__editorAssets)||void 0===c?void 0:c.scripts),C=Object(u.b)(),[S,w,I]=Object(d.b)(),x=Object(a.useRefEffect)(e=>{function t(){const{contentDocument:t,ownerDocument:n}=e,{readyState:o,documentElement:r}=t;return("interactive"===o||"complete"===o)&&(function(e){const{defaultView:t}=e,{frameElement:n}=t;function o(e){const o=Object.getPrototypeOf(e).constructor.name,r=window[o],c={};for(const t in e)c[t]=e[t];if(e instanceof t.MouseEvent){const e=n.getBoundingClientRect();c.clientX+=e.left,c.clientY+=e.top}const l=new r(e.type,c);!n.dispatchEvent(l)&&e.preventDefault()}const r=["dragover"];for(const t of r)e.addEventListener(t,o)}(t),j(t),C(r),_(Array.from(n.body.classList).filter(e=>e.startsWith("admin-color-")||"wp-embed-responsive"===e)),t.dir=n.dir,r.removeChild(t.head),r.removeChild(t.body),!0)}t()||e.addEventListener("load",()=>{t()})},[]),B=Object(a.useRefEffect)(e=>{E.reduce((t,n)=>t.then(()=>async function(e,t){let{id:n,src:o}=t;return new Promise((t,r)=>{const c=e.ownerDocument.createElement("script");c.id=n,o?(c.src=o,c.onload=()=>t(),c.onerror=()=>r()):t(),e.appendChild(c)})}(e,n)),Promise.resolve()).finally(()=>{O()})},[]),T=Object(a.useMergeRefs)([p,C,w]);return Object(r.useEffect)(()=>{var e;v&&(e=v,Array.from(document.styleSheets).forEach(t=>{try{t.cssRules}catch(e){return}const{ownerNode:n,cssRules:o}=t;if(o&&"LINK"===n.tagName&&"wp-reset-editor-styles-css"!==n.id&&Array.from(o).find(e=>{let{selectorText:t}=e;return t&&(t.includes(".editor-styles-wrapper")||t.includes(".wp-block"))})&&!e.getElementById(n.id)){e.head.appendChild(n.cloneNode(!0));const t=n.id.replace("-css","-inline-css"),o=document.getElementById(t);o&&e.head.appendChild(o.cloneNode(!0))}}))},[v]),f=Object(r.createElement)(r.Fragment,null,Object(r.createElement)("style",null,"body{margin:0}"),y.map(e=>{let{tagName:t,href:n,id:o,rel:c,media:l,textContent:i}=e;const a=t.toLowerCase();return"style"===a?Object(r.createElement)(a,{id:o,key:o},i):Object(r.createElement)(a,{href:n,id:o,rel:c,media:l,key:o})}),f),Object(r.createElement)(r.Fragment,null,h>=0&&S,Object(r.createElement)("iframe",Object(o.a)({},g,{ref:Object(a.useMergeRefs)([t,x]),tabIndex:h,title:Object(i.__)("Editor canvas")}),v&&Object(r.createPortal)(Object(r.createElement)(r.Fragment,null,Object(r.createElement)("head",{ref:B},f),Object(r.createElement)("body",{ref:T,className:l()("editor-styles-wrapper",...k)},Object(r.createElement)(s.__experimentalStyleProvider,{document:v},m))),v.documentElement)),h>=0&&I)}))},hMaJ:function(e,t,n){"use strict";var o=n("wx14"),r=n("GRId"),c=n("TSYQ"),l=n.n(c),i=n("YLtl"),a=n("tI+e"),s=n("l3Sj"),u=n("v5LD");const d=["colors","disableCustomColors","gradients","disableCustomGradients"];function b(e){let{colors:t,gradients:n,disableCustomColors:o,disableCustomGradients:c,__experimentalHasMultipleOrigins:u,__experimentalIsRenderedInSidebar:d,className:b,label:p,onColorChange:m,onGradientChange:f,colorValue:h,gradientValue:g,clearable:O,showTitle:v=!0,enableAlpha:j}=e;const k=m&&(!Object(i.isEmpty)(t)||!o),_=f&&(!Object(i.isEmpty)(n)||!c),[y,E]=Object(r.useState)(g?"gradient":!!k&&"color");return k||_?Object(r.createElement)(a.BaseControl,{className:l()("block-editor-color-gradient-control",b)},Object(r.createElement)("fieldset",null,Object(r.createElement)(a.__experimentalVStack,{spacing:1},v&&Object(r.createElement)("legend",null,Object(r.createElement)("div",{className:"block-editor-color-gradient-control__color-indicator"},Object(r.createElement)(a.BaseControl.VisualLabel,null,p))),k&&_&&Object(r.createElement)(a.__experimentalToggleGroupControl,{value:y,onChange:E,label:Object(s.__)("Select color type"),hideLabelFromVision:!0,isBlock:!0},Object(r.createElement)(a.__experimentalToggleGroupControlOption,{value:"color",label:Object(s.__)("Solid")}),Object(r.createElement)(a.__experimentalToggleGroupControlOption,{value:"gradient",label:Object(s.__)("Gradient")})),("color"===y||!_)&&Object(r.createElement)(a.ColorPalette,{value:h,onChange:_?e=>{m(e),f()}:m,colors:t,disableCustomColors:o,__experimentalHasMultipleOrigins:u,__experimentalIsRenderedInSidebar:d,clearable:O,enableAlpha:j}),("gradient"===y||!k)&&Object(r.createElement)(a.GradientPicker,{value:g,onChange:k?e=>{f(e),m()}:f,gradients:n,disableCustomGradients:c,__experimentalHasMultipleOrigins:u,__experimentalIsRenderedInSidebar:d,clearable:O})))):null}function p(e){const t={};return t.colors=Object(u.a)("color.palette"),t.gradients=Object(u.a)("color.gradients"),t.disableCustomColors=!Object(u.a)("color.custom"),t.disableCustomGradients=!Object(u.a)("color.customGradient"),Object(r.createElement)(b,Object(o.a)({},t,e))}t.a=function(e){return Object(i.every)(d,t=>e.hasOwnProperty(t))?Object(r.createElement)(b,e):Object(r.createElement)(p,e)}},hw9B:function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var o=n("1ZqX"),r=n("K9lf"),c=n("BhPs"),l=n("OL6h");function i(e,t){Array.from(e.closest(".is-root-container").querySelectorAll(".rich-text")).forEach(e=>{t?e.setAttribute("contenteditable",!0):e.removeAttribute("contenteditable")})}function a(e){const{startMultiSelect:t,stopMultiSelect:n,multiSelect:a,selectBlock:s}=Object(o.useDispatch)(c.a),{isSelectionEnabled:u,isBlockSelected:d,getBlockParents:b,getBlockSelectionStart:p,hasMultiSelection:m}=Object(o.useSelect)(c.a);return Object(r.useRefEffect)(o=>{const{ownerDocument:r}=o,{defaultView:c}=r;let f,h;function g(t){let{isSelectionEnd:n}=t;const r=c.getSelection();if(!r.rangeCount||r.isCollapsed)return void i(o,!0);const u=Object(l.a)(r.focusNode);if(e===u){if(s(e),n&&(i(o,!0),r.rangeCount)){const{commonAncestorContainer:e}=r.getRangeAt(0);f.contains(e)&&f.focus()}}else{const t=[...b(e),e],n=[...b(u),u],o=Math.min(t.length,n.length)-1;a(t[o],n[o])}}function O(){r.removeEventListener("selectionchange",g),c.removeEventListener("mouseup",O),h=c.requestAnimationFrame(()=>{g({isSelectionEnd:!0}),n()})}function v(n){let{buttons:l}=n;1===l&&u()&&d(e)&&(f=r.activeElement,t(),r.addEventListener("selectionchange",g),c.addEventListener("mouseup",O),i(o,!1))}function j(t){if(u()&&0===t.button)if(t.shiftKey){const n=p(),r=b(n);if(n&&n!==e&&(null==r||!r.includes(e))){const c=[...r,n],l=[...b(e),e],s=Math.min(c.length,l.length)-1,u=c[s],d=l[s];u!==d&&(i(o,!1),a(u,d),t.preventDefault())}}else m()&&s(e)}return o.addEventListener("mousedown",j),o.addEventListener("mouseleave",v),()=>{o.removeEventListener("mousedown",j),o.removeEventListener("mouseleave",v),r.removeEventListener("selectionchange",g),c.removeEventListener("mouseup",O),c.cancelAnimationFrame(h)}},[e,t,n,a,s,u,d,b])}},iA5R:function(e,t,n){"use strict";var o;Object.defineProperty(t,"__esModule",{value:!0}),t.diffChars=function(e,t,n){return r.diff(e,t,n)},t.characterDiff=void 0;var r=new(((o=n("smQA"))&&o.__esModule?o:{default:o}).default);t.characterDiff=r},iClF:function(e,t,n){"use strict";var o=n("GRId");t.a=function(e){let{icon:t,size:n=24,...r}=e;return Object(o.cloneElement)(t,{width:n,height:n,...r})}},j6zP:function(e,t,n){"use strict";var o=n("GRId"),r=n("tI+e"),c=n("q3tz");t.a=e=>{let{isEnabled:t,blocks:n,icon:l,children:i}=e;const a={type:"inserter",blocks:n};return Object(o.createElement)(r.Draggable,{__experimentalTransferDataType:"wp-blocks",transferData:a,__experimentalDragComponent:Object(o.createElement)(c.a,{count:n.length,icon:l})},e=>{let{onDraggableStart:n,onDraggableEnd:o}=e;return i({draggable:t,onDragStart:t?n:void 0,onDragEnd:t?o:void 0})})}},jB5C:function(e,t,n){"use strict";var o=Object.assign||function(e){for(var t=1;tObject(i.getSaveContent)(e.name,e.attributes,e.innerBlocks)).join(""));var d;const b=(m=t.originalContent,g=u,Object(f.diffChars)(m,g).map((e,t)=>{const n=c()({"block-editor-block-compare__added":e.added,"block-editor-block-compare__removed":e.removed});return Object(o.createElement)("span",{key:t,className:n},e.value)}));var m,g;return Object(o.createElement)("div",{className:"block-editor-block-compare__wrapper"},Object(o.createElement)(h,{title:Object(p.__)("Current"),className:"block-editor-block-compare__current",action:n,actionText:Object(p.__)("Convert to HTML"),rawContent:t.originalContent,renderedContent:t.originalContent}),Object(o.createElement)(h,{title:Object(p.__)("After Conversion"),className:"block-editor-block-compare__converted",action:r,actionText:s,rawContent:b,renderedContent:u}))},O=n("BhPs");const v=e=>Object(i.rawHandler)({HTML:e.originalContent});var j=Object(u.compose)([Object(s.withSelect)((e,t)=>{let{clientId:n}=t;return{block:e(O.a).getBlock(n)}}),Object(s.withDispatch)((e,t)=>{let{block:n}=t;const{replaceBlock:o}=e(O.a);return{convertToClassic(){o(n.clientId,(e=>Object(i.createBlock)("core/freeform",{content:e.originalContent}))(n))},convertToHTML(){o(n.clientId,(e=>Object(i.createBlock)("core/html",{content:e.originalContent}))(n))},convertToBlocks(){o(n.clientId,v(n))},attemptBlockRecovery(){o(n.clientId,(e=>{let{name:t,attributes:n,innerBlocks:o}=e;return Object(i.createBlock)(t,n,o)})(n))}}})])((function(e){let{convertToHTML:t,convertToBlocks:n,convertToClassic:r,attemptBlockRecovery:c,block:l}=e;const s=!!Object(i.getBlockType)("core/html"),[u,d]=Object(o.useState)(!1),b=Object(o.useCallback)(()=>d(!0),[]),f=Object(o.useCallback)(()=>d(!1),[]),h=Object(o.useMemo)(()=>[{title:Object(p._x)("Resolve","imperative verb"),onClick:b},s&&{title:Object(p.__)("Convert to HTML"),onClick:t},{title:Object(p.__)("Convert to Classic Block"),onClick:r}].filter(Boolean),[b,t,r]);return Object(o.createElement)(o.Fragment,null,Object(o.createElement)(m.a,{actions:[Object(o.createElement)(a.Button,{key:"recover",onClick:c,variant:"primary"},Object(p.__)("Attempt Block Recovery"))],secondaryActions:h},Object(p.__)("This block contains unexpected or invalid content.")),u&&Object(o.createElement)(a.Modal,{title:Object(p.__)("Resolve Block"),onRequestClose:f,className:"block-editor-block-compare"},Object(o.createElement)(g,{block:l,onKeep:t,onConvert:n,convertor:v,convertButtonText:Object(p.__)("Convert to Blocks")})))}));const k=Object(o.createElement)(m.a,{className:"block-editor-block-list__block-crash-warning"},Object(p.__)("This block has encountered an error and cannot be previewed."));var _=()=>k;class y extends o.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 E=y,C=n("O6Fj"),S=n.n(C);var w=function(e){let{clientId:t}=e;const[n,r]=Object(o.useState)(""),c=Object(s.useSelect)(e=>e(O.a).getBlock(t),[t]),{updateBlock:l}=Object(s.useDispatch)(O.a);return Object(o.useEffect)(()=>{r(Object(i.getBlockContent)(c))},[c]),Object(o.createElement)(S.a,{className:"block-editor-block-list__block-html-textarea",value:n,onBlur:()=>{const e=Object(i.getBlockType)(c.name);if(!e)return;const o=Object(i.getBlockAttributes)(e,n,c.attributes),a=n||Object(i.getSaveContent)(e,o),s=!n||Object(i.isValidBlockContent)(e,o,a);l(t,{attributes:o,originalContent:a,isValid:s}),n||r({content:a})},onChange:e=>r(e.target.value)})},I=n("nlh6");const x=Object(o.createContext)();function B(e){let{children:t,isHtml:n,...r}=e;return Object(o.createElement)("div",Object(I.a)(r,{__unstableIsHtml:n}),t)}const T=Object(s.withSelect)((e,t)=>{let{clientId:n,rootClientId:o}=t;const{isBlockSelected:r,getBlockMode:c,isSelectionEnabled:l,getTemplateLock:i,__unstableGetBlockWithoutInnerBlocks:a,canRemoveBlock:s,canMoveBlock:u}=e(O.a),d=a(n),b=r(n),p=i(o),m=s(n,o),f=u(n,o),{name:h,attributes:g,isValid:v}=d||{};return{mode:c(n),isSelectionEnabled:l(),isLocked:!!p,canRemove:m,canMove:f,block:d,name:h,attributes:g,isValid:v,isSelected:b}}),P=Object(s.withDispatch)((e,t,n)=>{let{select:o}=n;const{updateBlockAttributes:r,insertBlocks:c,mergeBlocks:l,replaceBlocks:a,toggleSelection:s,__unstableMarkLastChangeAsPersistent:u}=e(O.a);return{setAttributes(e){const{getMultiSelectedBlockClientIds:n}=o(O.a),c=n(),{clientId:l}=t,i=c.length?c:[l];r(i,e)},onInsertBlocks(e,n){const{rootClientId:o}=t;c(e,n,o)},onInsertBlocksAfter(e){const{clientId:n,rootClientId:r}=t,{getBlockIndex:l}=o(O.a),i=l(n);c(e,i+1,r)},onMerge(e){const{clientId:n}=t,{getPreviousBlockClientId:r,getNextBlockClientId:c}=o(O.a);if(e){const e=c(n);e&&l(n,e)}else{const e=r(n);e&&l(e,n)}},onReplace(e,n,o){e.length&&!Object(i.isUnmodifiedDefaultBlock)(e[e.length-1])&&u(),a([t.clientId],e,n,o)},toggleSelection(e){s(e)}}});t.b=Object(u.compose)(u.pure,T,P,Object(u.ifCondition)(e=>{let{block:t}=e;return!!t}),Object(a.withFilters)("editor.BlockListBlock"))((function(e){let{mode:t,isLocked:n,canRemove:r,clientId:a,isSelected:u,isSelectionEnabled:p,className:m,name:f,isValid:h,attributes:g,wrapperProps:v,setAttributes:k,onReplace:y,onInsertBlocksAfter:C,onMerge:S,toggleSelection:I}=e;const{removeBlock:T}=Object(s.useDispatch)(O.a),P=Object(o.useCallback)(()=>T(a),[a]);let R=Object(o.createElement)(b.a,{name:f,isSelected:u,attributes:g,setAttributes:k,insertBlocksAfter:n?void 0:C,onReplace:r?y:void 0,onRemove:r?P:void 0,mergeBlocks:r?S:void 0,clientId:a,isSelectionEnabled:p,toggleSelection:I});const N=Object(i.getBlockType)(f);null!=N&&N.getEditWrapperProps&&(v=function(e,t){const n={...e,...t};return e&&t&&e.className&&t.className&&(n.className=c()(e.className,t.className)),e&&t&&e.style&&t.style&&(n.style={...e.style,...t.style}),n}(v,N.getEditWrapperProps(g)));const M=v&&!!v["data-align"];let L;if(M&&(R=Object(o.createElement)("div",{className:"wp-block","data-align":v["data-align"]},R)),h)L="html"===t?Object(o.createElement)(o.Fragment,null,Object(o.createElement)("div",{style:{display:"none"}},R),Object(o.createElement)(B,{isHtml:!0},Object(o.createElement)(w,{clientId:a}))):(null==N?void 0:N.apiVersion)>1?R:Object(o.createElement)(B,v,R);else{const e=Object(i.getSaveContent)(N,g);L=Object(o.createElement)(B,{className:"has-warning"},Object(o.createElement)(j,{clientId:a}),Object(o.createElement)(o.RawHTML,null,Object(d.safeHTML)(e)))}const A={clientId:a,className:m,wrapperProps:Object(l.omit)(v,["data-align"]),isAligned:M},D=Object(o.useMemo)(()=>A,Object.values(A));return Object(o.createElement)(x.Provider,{value:D},Object(o.createElement)(E,{fallback:Object(o.createElement)(B,{className:"has-warning"},Object(o.createElement)(_,null))},L))}))},jTPX:function(e,t){e.exports=function(e,t,n){return((n=window.getComputedStyle)?n(e):e.currentStyle)[t.replace(/-(\w)/gi,(function(e,t){return t.toUpperCase()}))]}},jrfk:function(e,t){var n,o,r,c,l,i,a,s,u,d,b,p,m,f,h,g=!1;function O(){if(!g){g=!0;var e=navigator.userAgent,t=/(?:MSIE.(\d+\.\d+))|(?:(?:Firefox|GranParadiso|Iceweasel).(\d+\.\d+))|(?:Opera(?:.+Version.|.)(\d+\.\d+))|(?:AppleWebKit.(\d+(?:\.\d+)?))|(?:Trident\/\d+\.\d+.*rv:(\d+\.\d+))/.exec(e),O=/(Mac OS X)|(Windows)|(Linux)/.exec(e);if(p=/\b(iPhone|iP[ao]d)/.exec(e),m=/\b(iP[ao]d)/.exec(e),d=/Android/i.exec(e),f=/FBAN\/\w+;/i.exec(e),h=/Mobile/i.exec(e),b=!!/Win64/.exec(e),t){(n=t[1]?parseFloat(t[1]):t[5]?parseFloat(t[5]):NaN)&&document&&document.documentMode&&(n=document.documentMode);var v=/(?:Trident\/(\d+.\d+))/.exec(e);i=v?parseFloat(v[1])+4:n,o=t[2]?parseFloat(t[2]):NaN,r=t[3]?parseFloat(t[3]):NaN,(c=t[4]?parseFloat(t[4]):NaN)?(t=/(?:Chrome\/(\d+\.\d+))/.exec(e),l=t&&t[1]?parseFloat(t[1]):NaN):l=NaN}else n=o=r=l=c=NaN;if(O){if(O[1]){var j=/(?:Mac OS X (\d+(?:[._]\d+)?))/.exec(e);a=!j||parseFloat(j[1].replace("_","."))}else a=!1;s=!!O[2],u=!!O[3]}else a=s=u=!1}}var v={ie:function(){return O()||n},ieCompatibilityMode:function(){return O()||i>n},ie64:function(){return v.ie()&&b},firefox:function(){return O()||o},opera:function(){return O()||r},webkit:function(){return O()||c},safari:function(){return v.webkit()},chrome:function(){return O()||l},windows:function(){return O()||s},osx:function(){return O()||a},linux:function(){return O()||u},iphone:function(){return O()||p},mobile:function(){return O()||p||m||d||h},nativeApp:function(){return O()||f},android:function(){return O()||d},ipad:function(){return O()||m}};e.exports=v},jwne:function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return s}));var o=n("wx14"),r=n("GRId"),c=n("tI+e"),l=(n("Z23Y"),n("c1Zz")),i=n("asom"),a=n("VrEk");function s(t){var n;let{__experimentalGroup:s="default",bubblesVirtually:u=!0,label:d,...b}=t;const p=null===(n=a.a[s])||void 0===n?void 0:n.Slot,m=Object(c.__experimentalUseSlot)(null==p?void 0:p.__unstableName);if(!p||!m)return void 0!==e&&e.env,null;return Boolean(m.fills&&m.fills.length)?d?Object(r.createElement)(l.a,{group:s,label:d},Object(r.createElement)(i.a,Object(o.a)({},b,{bubblesVirtually:u,Slot:p}))):Object(r.createElement)(p,Object(o.a)({},b,{bubblesVirtually:u})):null}}).call(this,n("8oxB"))},kBLm:function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var o=n("1ZqX"),r=n("K9lf"),c=n("BhPs");function l(e){if(e.defaultPrevented)return;const t="mouseover"===e.type?"add":"remove";e.preventDefault(),e.currentTarget.classList[t]("is-hovered")}function i(){const e=Object(o.useSelect)(e=>{const{isNavigationMode:t,getSettings:n}=e(c.a);return t()||n().outlineMode},[]);return Object(r.useRefEffect)(t=>{if(e)return t.addEventListener("mouseout",l),t.addEventListener("mouseover",l),()=>{t.removeEventListener("mouseout",l),t.removeEventListener("mouseover",l),t.classList.remove("is-hovered")}},[e])}},kVRd:function(e,t,n){"use strict";n.d(t,"a",(function(){return u}));var o=n("GRId"),r=n("tI+e"),c=n("Tqx9");var l=Object(o.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(o.createElement)(c.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"})),i=n("Crq9"),a=n("l3Sj");const s=[{name:Object(a.__)("Underline"),value:"underline",icon:l},{name:Object(a.__)("Strikethrough"),value:"line-through",icon:i.a}];function u(e){let{value:t,onChange:n}=e;return Object(o.createElement)("fieldset",{className:"block-editor-text-decoration-control"},Object(o.createElement)("legend",null,Object(a.__)("Decoration")),Object(o.createElement)("div",{className:"block-editor-text-decoration-control__buttons"},s.map(e=>Object(o.createElement)(r.Button,{key:e.value,icon:e.icon,isSmall:!0,isPressed:e.value===t,onClick:()=>n(e.value===t?void 0:e.value),"aria-label":e.name}))))}},kWXm:function(e,t,n){"use strict";var o=n("GRId"),r=n("Tqx9");const c=Object(o.createElement)(r.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(o.createElement)(r.Path,{d:"M9 9v6h11V9H9zM4 20h1.5V4H4v16z"}));t.a=c},kaUp:function(e,t){},kmrn:function(e,t,n){"use strict";n.d(t,"useSpring",(function(){return ke}));var o=n("nEW0");n.d(t,"Globals",(function(){return o.b}));var r=n("cDcd"),c=n("dfZa");n("kaUp"),n("v8Ku");function l(){return(l=Object.assign||function(e){for(var t=1;t!0===e||!!(t&&e&&(o.s.fun(e)?e(t):Object(o.y)(e).includes(t))),s=(e,t)=>o.s.obj(e)?t&&e[t]:e,u=(e,t)=>!0===e.default?e[t]:e.default?e.default[t]:void 0,d=e=>e,b=(e,t=d)=>{let n=p;e.default&&!0!==e.default&&(e=e.default,n=Object.keys(e));const r={};for(const c of n){const n=t(e[c],c);o.s.und(n)||(r[c]=n)}return r},p=["config","onProps","onStart","onChange","onPause","onResume","onRest"],m={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 f(e){const t=function(e){const t={};let n=0;if(Object(o.l)(e,(e,o)=>{m[o]||(t[o]=e,n++)}),n)return t}(e);if(t){const n={to:t};return Object(o.l)(e,(e,o)=>o in t||(n[o]=e)),n}return l({},e)}function h(e){return e=Object(o.q)(e),o.s.arr(e)?e.map(h):Object(o.t)(e)?o.b.createStringInterpolator({range:[0,1],output:[e,e]})(1):e}function g(e){for(const t in e)return!0;return!1}function O(e){return o.s.fun(e)||o.s.arr(e)&&o.s.obj(e[0])}function v(e,t){var n;null==(n=e.ref)||n.delete(e),null==t||t.delete(e)}function j(e,t){var n;t&&e.ref!==t&&(null==(n=e.ref)||n.delete(e),t.add(e),e.ref=t)}const k=1.70158,_=1.525*k,y=2*Math.PI/3,E=2*Math.PI/4.5,C=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},S=l({},{tension:170,friction:26},{mass:1,damping:1,easing:{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=>2.70158*e*e*e-k*e*e,easeOutBack:e=>1+2.70158*Math.pow(e-1,3)+k*Math.pow(e-1,2),easeInOutBack:e=>e<.5?Math.pow(2*e,2)*(7.189819*e-_)/2:(Math.pow(2*e-2,2)*((_+1)*(2*e-2)+_)+2)/2,easeInElastic:e=>0===e?0:1===e?1:-Math.pow(2,10*e-10)*Math.sin((10*e-10.75)*y),easeOutElastic:e=>0===e?0:1===e?1:Math.pow(2,-10*e)*Math.sin((10*e-.75)*y)+1,easeInOutElastic:e=>0===e?0:1===e?1:e<.5?-Math.pow(2,20*e-10)*Math.sin((20*e-11.125)*E)/2:Math.pow(2,-20*e+10)*Math.sin((20*e-11.125)*E)/2+1,easeInBounce:e=>1-C(1-e),easeOutBounce:C,easeInOutBounce:e=>e<.5?(1-C(1-2*e))/2:(1+C(2*e-1))/2}.linear,clamp:!1});class w{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,S)}}function I(e,t){if(o.s.und(t.decay)){const n=!o.s.und(t.tension)||!o.s.und(t.friction);!n&&o.s.und(t.frequency)&&o.s.und(t.damping)&&o.s.und(t.mass)||(e.duration=void 0,e.decay=void 0),n&&(e.frequency=void 0)}else e.duration=void 0}const x=[];class B{constructor(){this.changed=!1,this.values=x,this.toValues=null,this.fromValues=x,this.to=void 0,this.from=void 0,this.config=new w,this.immediate=!1}}function T(e,{key:t,props:n,defaultProps:r,state:c,actions:s}){return new Promise((u,d)=>{var b;let p,m,f=a(null!=(b=n.cancel)?b:null==r?void 0:r.cancel,t);if(f)O();else{o.s.und(n.pause)||(c.paused=a(n.pause,t));let e=null==r?void 0:r.pause;!0!==e&&(e=c.paused||a(e,t)),p=i(n.delay||0,t),e?(c.resumeQueue.add(g),s.pause()):(s.resume(),g())}function h(){c.resumeQueue.add(g),c.timeouts.delete(m),m.cancel(),p=m.time-o.w.now()}function g(){p>0&&!o.b.skipAnimation?(c.delayed=!0,m=o.w.setTimeout(O,p),c.pauseQueue.add(h),c.timeouts.add(m)):O()}function O(){c.delayed&&(c.delayed=!1),c.pauseQueue.delete(h),c.timeouts.delete(m),e<=(c.cancelId||0)&&(f=!0);try{s.start(l({},n,{callId:e,cancel:f}),u)}catch(e){d(e)}}})}const P=(e,t)=>1==t.length?t[0]:t.some(e=>e.cancelled)?M(e.get()):t.every(e=>e.noop)?R(e.get()):N(e.get(),t.every(e=>e.finished)),R=e=>({value:e,noop:!0,finished:!0,cancelled:!1}),N=(e,t,n=!1)=>({value:e,finished:t,cancelled:n}),M=e=>({value:e,cancelled:!0,finished:!1});function L(e,t,n,r){const{callId:c,parentId:i,onRest:a}=t,{asyncTo:s,promise:u}=n;return i||e!==s||t.reset?n.promise=(async()=>{n.asyncId=c,n.asyncTo=e;const d=b(t,(e,t)=>"onRest"===t?void 0:e);let p,m;const f=new Promise((e,t)=>(p=e,m=t)),h=e=>{const t=c<=(n.cancelId||0)&&M(r)||c!==n.asyncId&&N(r,!1);if(t)throw e.result=t,m(e),e},g=(e,t)=>{const i=new D,a=new F;return(async()=>{if(o.b.skipAnimation)throw A(n),a.result=N(r,!1),m(a),a;h(i);const s=o.s.obj(e)?l({},e):l({},t,{to:e});s.parentId=c,Object(o.l)(d,(e,t)=>{o.s.und(s[t])&&(s[t]=e)});const u=await r.start(s);return h(i),n.paused&&await new Promise(e=>{n.resumeQueue.add(e)}),u})()};let O;if(o.b.skipAnimation)return A(n),N(r,!1);try{let t;t=o.s.arr(e)?(async e=>{for(const t of e)await g(t)})(e):Promise.resolve(e(g,r.stop.bind(r))),await Promise.all([t.then(p),f]),O=N(r.get(),!0,!1)}catch(e){if(e instanceof D)O=e.result;else{if(!(e instanceof F))throw e;O=e.result}}finally{c==n.asyncId&&(n.asyncId=i,n.asyncTo=i?s:void 0,n.promise=i?u:void 0)}return o.s.fun(a)&&o.w.batchedUpdates(()=>{a(O,r,r.item)}),O})():u}function A(e,t){Object(o.m)(e.timeouts,e=>e.cancel()),e.pauseQueue.clear(),e.resumeQueue.clear(),e.asyncId=e.asyncTo=e.promise=void 0,t&&(e.cancelId=t)}class D 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 F extends Error{constructor(){super("SkipAnimationSignal"),this.result=void 0}}const z=e=>e instanceof V;let H=1;class V extends o.a{constructor(...e){super(...e),this.id=H++,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=Object(c.e)(this);return e&&e.getValue()}to(...e){return o.b.to(this,e)}interpolate(...e){return Object(o.j)(),o.b.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){Object(o.d)(this,{type:"change",parent:this,value:e,idle:t})}_onPriorityChange(e){this.idle||o.o.sort(this),Object(o.d)(this,{type:"priority",parent:this,priority:e})}}const G=Symbol.for("SpringPhase"),U=e=>(1&e[G])>0,W=e=>(2&e[G])>0,q=e=>(4&e[G])>0,K=(e,t)=>t?e[G]|=3:e[G]&=-3,Y=(e,t)=>t?e[G]|=4:e[G]&=-5;class $ extends V{constructor(e,t){if(super(),this.key=void 0,this.animation=new B,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,!o.s.und(e)||!o.s.und(t)){const n=o.s.obj(e)?l({},e):l({},t,{from:e});o.s.und(n.default)&&(n.default=!0),this.start(n)}}get idle(){return!(W(this)||this._state.asyncTo)||q(this)}get goal(){return Object(o.q)(this.animation.to)}get velocity(){const e=Object(c.e)(this);return e instanceof c.c?e.lastVelocity||0:e.getPayload().map(e=>e.lastVelocity||0)}get hasAnimated(){return U(this)}get isAnimating(){return W(this)}get isPaused(){return q(this)}get isDelayed(){return this._state.delayed}advance(e){let t=!0,n=!1;const r=this.animation;let{config:l,toValues:i}=r;const a=Object(c.g)(r.to);!a&&Object(o.r)(r.to)&&(i=Object(o.y)(Object(o.q)(r.to))),r.values.forEach((s,u)=>{if(s.done)return;const d=s.constructor==c.b?1:a?a[u].lastPosition:i[u];let b=r.immediate,p=d;if(!b){if(p=s.lastPosition,l.tension<=0)return void(s.done=!0);let t=s.elapsedTime+=e;const n=r.fromValues[u],c=null!=s.v0?s.v0:s.v0=o.s.arr(l.velocity)?l.velocity[u]:l.velocity;let i;if(o.s.und(l.duration))if(l.decay){const e=!0===l.decay?.998:l.decay,o=Math.exp(-(1-e)*t);p=n+c/(1-e)*(1-o),b=Math.abs(s.lastPosition-p)<.1,i=c*o}else{i=null==s.lastVelocity?c:s.lastVelocity;const t=l.precision||(n==d?.005:Math.min(1,.001*Math.abs(d-n))),r=l.restVelocity||t/10,a=l.clamp?0:l.bounce,u=!o.s.und(a),m=n==d?s.v0>0:nr,f||(b=Math.abs(d-p)<=t,!b));++e){u&&(h=p==d||p>d==m,h&&(i=-i*a,p=d));i+=(1e-6*-l.tension*(p-d)+.001*-l.friction*i)/l.mass*g,p+=i*g}}else{let o=1;l.duration>0&&(this._memoizedDuration!==l.duration&&(this._memoizedDuration=l.duration,s.durationProgress>0&&(s.elapsedTime=l.duration*s.durationProgress,t=s.elapsedTime+=e)),o=(l.progress||0)+t/this._memoizedDuration,o=o>1?1:o<0?0:o,s.durationProgress=o),p=n+l.easing(o)*(d-n),i=(p-s.lastPosition)/e,b=1==o}s.lastVelocity=i,Number.isNaN(p)&&(console.warn("Got NaN while animating:",this),b=!0)}a&&!a[u].done&&(b=!1),b?s.done=!0:t=!1,s.setValue(p,l.round)&&(n=!0)});const s=Object(c.e)(this),u=s.getValue();if(t){const e=Object(o.q)(r.to);u===e&&!n||l.decay?n&&l.decay&&this._onChange(u):(s.setValue(e),this._onChange(e)),this._stop()}else n&&this._onChange(u)}set(e){return o.w.batchedUpdates(()=>{this._stop(),this._focus(e),this._set(e)}),this}pause(){this._update({pause:!0})}resume(){this._update({pause:!1})}finish(){if(W(this)){const{to:e,config:t}=this.animation;o.w.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 o.s.und(e)?(n=this.queue||[],this.queue=[]):n=[o.s.obj(e)?e:l({},t,{to:e})],Promise.all(n.map(e=>this._update(e))).then(e=>P(this,e))}stop(e){const{to:t}=this.animation;return this._focus(this.get()),A(this._state,e&&this._lastCallId),o.w.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:r}=e;n=o.s.obj(n)?n[t]:n,(null==n||O(n))&&(n=void 0),r=o.s.obj(r)?r[t]:r,null==r&&(r=void 0);const l={to:n,from:r};return U(this)||(e.reverse&&([n,r]=[r,n]),r=Object(o.q)(r),o.s.und(r)?Object(c.e)(this)||this._set(n):this._set(r)),l}_update(e,t){let n=l({},e);const{key:r,defaultProps:c}=this;n.default&&Object.assign(c,b(n,(e,t)=>/^on/.test(t)?s(e,r):e)),ne(this,n,"onProps"),oe(this,"onProps",n,this);const i=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 a=this._state;return T(++this._lastCallId,{key:r,props:n,defaultProps:c,state:a,actions:{pause:()=>{q(this)||(Y(this,!0),Object(o.n)(a.pauseQueue),oe(this,"onPause",N(this,Z(this,this.animation.to)),this))},resume:()=>{q(this)&&(Y(this,!1),W(this)&&this._resume(),Object(o.n)(a.resumeQueue),oe(this,"onResume",N(this,Z(this,this.animation.to)),this))},start:this._merge.bind(this,i)}}).then(e=>{if(n.loop&&e.finished&&(!t||!e.noop)){const e=X(n);if(e)return this._update(e,!0)}return e})}_merge(e,t,n){if(t.cancel)return this.stop(!0),n(M(this));const r=!o.s.und(e.to),s=!o.s.und(e.from);if(r||s){if(!(t.callId>this._lastToId))return n(M(this));this._lastToId=t.callId}const{key:u,defaultProps:d,animation:b}=this,{to:p,from:m}=b;let{to:f=p,from:g=m}=e;!s||r||t.default&&!o.s.und(f)||(f=g),t.reverse&&([f,g]=[g,f]);const v=!Object(o.u)(g,m);v&&(b.from=g),g=Object(o.q)(g);const j=!Object(o.u)(f,p);j&&this._focus(f);const k=O(t.to),{config:_}=b,{decay:y,velocity:E}=_;(r||s)&&(_.velocity=0),t.config&&!k&&function(e,t,n){n&&(I(n=l({},n),t),t=l({},n,t)),I(e,t),Object.assign(e,t);for(const t in S)null==e[t]&&(e[t]=S[t]);let{mass:r,frequency:c,damping:i}=e;o.s.und(c)||(c<.01&&(c=.01),i<0&&(i=0),e.tension=Math.pow(2*Math.PI/c,2)*r,e.friction=4*Math.PI*i*r/c)}(_,i(t.config,u),t.config!==d.config?i(d.config,u):void 0);let C=Object(c.e)(this);if(!C||o.s.und(f))return n(N(this,!0));const w=o.s.und(t.reset)?s&&!t.default:!o.s.und(g)&&a(t.reset,u),x=w?g:this.get(),B=h(f),T=o.s.num(B)||o.s.arr(B)||Object(o.t)(B),P=!k&&(!T||a(d.immediate||t.immediate,u));if(j){const e=Object(c.f)(f);if(e!==C.constructor){if(!P)throw Error(`Cannot animate between ${C.constructor.name} and ${e.name}, as the "to" prop suggests`);C=this._set(B)}}const A=C.constructor;let D=Object(o.r)(f),F=!1;if(!D){const e=w||!U(this)&&v;(j||e)&&(F=Object(o.u)(h(x),B),D=!F),(Object(o.u)(b.immediate,P)||P)&&Object(o.u)(_.decay,y)&&Object(o.u)(_.velocity,E)||(D=!0)}if(F&&W(this)&&(b.changed&&!w?D=!0:D||this._stop(p)),!k&&((D||Object(o.r)(p))&&(b.values=C.getPayload(),b.toValues=Object(o.r)(f)?null:A==c.b?[1]:Object(o.y)(B)),b.immediate!=P&&(b.immediate=P,P||w||this._set(p)),D)){const{onRest:e}=b;Object(o.k)(te,e=>ne(this,t,e));const r=N(this,Z(this,p));Object(o.n)(this._pendingCalls,r),this._pendingCalls.add(n),b.changed&&o.w.batchedUpdates(()=>{b.changed=!w,null==e||e(r,this),w?i(d.onRest,r):null==b.onStart||b.onStart(r,this)})}w&&this._set(x),k?n(L(t.to,t,this._state,this)):D?this._start():W(this)&&!j?this._pendingCalls.add(n):n(R(x))}_focus(e){const t=this.animation;e!==t.to&&(Object(o.p)(this)&&this._detach(),t.to=e,Object(o.p)(this)&&this._attach())}_attach(){let e=0;const{to:t}=this.animation;Object(o.r)(t)&&(Object(o.c)(t,this),z(t)&&(e=t.priority+1)),this.priority=e}_detach(){const{to:e}=this.animation;Object(o.r)(e)&&Object(o.x)(e,this)}_set(e,t=!0){const n=Object(o.q)(e);if(!o.s.und(n)){const e=Object(c.e)(this);if(!e||!Object(o.u)(n,e.getValue())){const r=Object(c.f)(n);e&&e.constructor==r?e.setValue(n):Object(c.h)(this,r.create(n)),e&&o.w.batchedUpdates(()=>{this._onChange(n,t)})}}return Object(c.e)(this)}_onStart(){const e=this.animation;e.changed||(e.changed=!0,oe(this,"onStart",N(this,Z(this,e.to)),this))}_onChange(e,t){t||(this._onStart(),i(this.animation.onChange,e,this)),i(this.defaultProps.onChange,e,this),super._onChange(e,t)}_start(){const e=this.animation;Object(c.e)(this).reset(Object(o.q)(e.to)),e.immediate||(e.fromValues=e.values.map(e=>e.lastPosition)),W(this)||(K(this,!0),q(this)||this._resume())}_resume(){o.b.skipAnimation?this.finish():o.o.start(this)}_stop(e,t){if(W(this)){K(this,!1);const n=this.animation;Object(o.k)(n.values,e=>{e.done=!0}),n.toValues&&(n.onChange=n.onPause=n.onResume=void 0),Object(o.d)(this,{type:"idle",parent:this});const r=t?M(this.get()):N(this.get(),Z(this,null!=e?e:n.to));Object(o.n)(this._pendingCalls,r),n.changed&&(n.changed=!1,oe(this,"onRest",r,this))}}}function Z(e,t){const n=h(t),r=h(e.get());return Object(o.u)(r,n)}function X(e,t=e.loop,n=e.to){let o=i(t);if(o){const r=!0!==o&&f(o),c=(r||e).reverse,i=!r||r.reset;return Q(l({},e,{loop:t,default:!1,pause:void 0,to:!c||O(n)?n:void 0,from:i?e.from:void 0,reset:i},r))}}function Q(e){const{to:t,from:n}=e=f(e),r=new Set;return o.s.obj(t)&&ee(t,r),o.s.obj(n)&&ee(n,r),e.keys=r.size?Array.from(r):null,e}function J(e){const t=Q(e);return o.s.und(t.default)&&(t.default=b(t)),t}function ee(e,t){Object(o.l)(e,(e,n)=>null!=e&&t.add(n))}const te=["onStart","onRest","onChange","onPause","onResume"];function ne(e,t,n){e.animation[n]=t[n]!==u(t,n)?s(t[n],e.key):void 0}function oe(e,t,...n){var o,r,c,l;null==(o=(r=e.animation)[t])||o.call(r,...n),null==(c=(l=e.defaultProps)[t])||c.call(l,...n)}const re=["onStart","onChange","onRest"];let ce=1;class le{constructor(e,t){this.id=ce++,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(l({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];o.s.und(n)||this.springs[t].set(n)}}update(e){return e&&this.queue.push(Q(e)),this}start(e){let{queue:t}=this;return e?t=Object(o.y)(e).map(Q):this.queue=[],this._flush?this._flush(this,t):(be(this,t),ie(this,t))}stop(e,t){if(e!==!!e&&(t=e),t){const n=this.springs;Object(o.k)(Object(o.y)(t),t=>n[t].stop(!!e))}else A(this._state,this._lastAsyncId),this.each(t=>t.stop(!!e));return this}pause(e){if(o.s.und(e))this.start({pause:!0});else{const t=this.springs;Object(o.k)(Object(o.y)(e),e=>t[e].pause())}return this}resume(e){if(o.s.und(e))this.start({pause:!1});else{const t=this.springs;Object(o.k)(Object(o.y)(e),e=>t[e].resume())}return this}each(e){Object(o.l)(this.springs,e)}_onFrame(){const{onStart:e,onChange:t,onRest:n}=this._events,r=this._active.size>0,c=this._changed.size>0;(r&&!this._started||c&&!this._started)&&(this._started=!0,Object(o.m)(e,([e,t])=>{t.value=this.get(),e(t,this,this._item)}));const l=!r&&this._started,i=c||l&&n.size?this.get():null;c&&t.size&&Object(o.m)(t,([e,t])=>{t.value=i,e(t,this,this._item)}),l&&(this._started=!1,Object(o.m)(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)}o.w.onFrame(this._onFrame)}}function ie(e,t){return Promise.all(t.map(t=>async function e(t,n,r){const{keys:c,to:l,from:i,loop:a,onRest:s,onResolve:d}=n,b=o.s.obj(n.default)&&n.default;a&&(n.loop=!1);!1===l&&(n.to=null);!1===i&&(n.from=null);const p=o.s.arr(l)||o.s.fun(l)?l:void 0;p?(n.to=void 0,n.onRest=void 0,b&&(b.onRest=void 0)):Object(o.k)(re,e=>{const r=n[e];if(o.s.fun(r)){const o=t._events[e];n[e]=({finished:e,cancelled:t})=>{const n=o.get(r);n?(e||(n.finished=!1),t&&(n.cancelled=!0)):o.set(r,{value:null,finished:e||!1,cancelled:t||!1})},b&&(b[e]=n[e])}});const m=t._state;n.pause===!m.paused?(m.paused=n.pause,Object(o.n)(n.pause?m.pauseQueue:m.resumeQueue)):m.paused&&(n.pause=!0);const f=(c||Object.keys(t.springs)).map(e=>t.springs[e].start(n)),h=!0===n.cancel||!0===u(n,"cancel");(p||h&&m.asyncId)&&f.push(T(++t._lastAsyncId,{props:n,state:m,actions:{pause:o.v,resume:o.v,start(e,n){h?(A(m,t._lastAsyncId),n(M(t))):(e.onRest=s,n(L(p,e,m,t)))}}}));m.paused&&await new Promise(e=>{m.resumeQueue.add(e)});const g=P(t,await Promise.all(f));if(a&&g.finished&&(!r||!g.noop)){const o=X(n,a,l);if(o)return be(t,[o]),e(t,o,!0)}d&&o.w.batchedUpdates(()=>d(g,t,t.item));return g}(e,t))).then(t=>P(e,t))}function ae(e,t){const n=l({},e.springs);return t&&Object(o.k)(Object(o.y)(t),e=>{o.s.und(e.keys)&&(e=Q(e)),o.s.obj(e.to)||(e=l({},e,{to:void 0})),de(n,e,e=>ue(e))}),se(e,n),n}function se(e,t){Object(o.l)(t,(t,n)=>{e.springs[n]||(e.springs[n]=t,Object(o.c)(t,e))})}function ue(e,t){const n=new $;return n.key=e,t&&Object(o.c)(n,t),n}function de(e,t,n){t.keys&&Object(o.k)(t.keys,o=>{(e[o]||(e[o]=n(o)))._prepareNode(t)})}function be(e,t){Object(o.k)(t,t=>{de(e.springs,t,t=>ue(t,e))})}function pe(e,t){if(null==e)return{};var n,o,r={},c=Object.keys(e);for(o=0;o=0||(r[n]=e[n]);return r}const me=["children"],fe=e=>{let{children:t}=e,n=pe(e,me);const c=Object(r.useContext)(he),l=n.pause||!!c.pause,i=n.immediate||!!c.immediate;n=Object(o.B)(()=>({pause:l,immediate:i}),[l,i]);const{Provider:a}=he;return r.createElement(a,{value:n},t)},he=(ge=fe,Oe={},Object.assign(ge,r.createContext(Oe)),ge.Provider._context=ge,ge.Consumer._context=ge,ge);var ge,Oe;fe.Provider=he.Provider,fe.Consumer=he.Consumer;const ve=()=>{const e=[],t=function(t){Object(o.i)();const r=[];return Object(o.k)(e,(e,c)=>{if(o.s.und(t))r.push(e.start());else{const o=n(t,e,c);o&&r.push(e.start(o))}}),r};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 Object(o.k)(e,e=>e.pause(...arguments)),this},t.resume=function(){return Object(o.k)(e,e=>e.resume(...arguments)),this},t.set=function(t){Object(o.k)(e,e=>e.set(t))},t.start=function(t){const n=[];return Object(o.k)(e,(e,r)=>{if(o.s.und(t))n.push(e.start());else{const o=this._getProps(t,e,r);o&&n.push(e.start(o))}}),n},t.stop=function(){return Object(o.k)(e,e=>e.stop(...arguments)),this},t.update=function(t){return Object(o.k)(e,(e,n)=>e.update(this._getProps(t,e,n))),this};const n=function(e,t,n){return o.s.fun(e)?e(n,t):e};return t._getProps=n,t};function je(e,t,n){const c=o.s.fun(t)&&t;c&&!n&&(n=[]);const i=Object(r.useMemo)(()=>c||3==arguments.length?ve():void 0,[]),a=Object(r.useRef)(0),s=Object(o.z)(),u=Object(r.useMemo)(()=>({ctrls:[],queue:[],flush(e,t){const n=ae(e,t);return a.current>0&&!u.queue.length&&!Object.keys(n).some(t=>!e.springs[t])?ie(e,t):new Promise(o=>{se(e,n),u.queue.push(()=>{o(ie(e,t))}),s()})}}),[]),d=Object(r.useRef)([...u.ctrls]),b=[],p=Object(o.D)(e)||0;function m(e,n){for(let o=e;o{Object(o.k)(d.current.slice(e,p),e=>{v(e,i),e.stop(!0)}),d.current.length=e,m(p,e)},[e]),Object(r.useMemo)(()=>{m(0,Math.min(p,e))},n);const f=d.current.map((e,t)=>ae(e,b[t])),h=Object(r.useContext)(fe),O=Object(o.D)(h),k=h!==O&&g(h);Object(o.A)(()=>{a.current++,u.ctrls=d.current;const{queue:e}=u;e.length&&(u.queue=[],Object(o.k)(e,e=>e())),Object(o.k)(d.current,(e,t)=>{null==i||i.add(e),k&&e.start({default:h});const n=b[t];n&&(j(e,n.ref),e.ref?e.queue.push(n):e.start(n))})}),Object(o.C)(()=>()=>{Object(o.k)(u.ctrls,e=>e.stop(!0))});const _=f.map(e=>l({},e));return i?[_,i]:_}function ke(e,t){const n=o.s.fun(e),[[r],c]=je(1,n?e:[e],n?t||[]:t);return n||2==arguments.length?[r,c]:r}let _e;!function(e){e.MOUNT="mount",e.ENTER="enter",e.UPDATE="update",e.LEAVE="leave"}(_e||(_e={}));class ye extends V{constructor(e,t){super(),this.key=void 0,this.idle=!0,this.calc=void 0,this._active=new Set,this.source=e,this.calc=Object(o.f)(...t);const n=this._get(),r=Object(c.f)(n);Object(c.h)(this,r.create(n))}advance(e){const t=this._get(),n=this.get();Object(o.u)(t,n)||(Object(c.e)(this).setValue(t),this._onChange(t,this.idle)),!this.idle&&Ce(this._active)&&Se(this)}_get(){const e=o.s.arr(this.source)?this.source.map(o.q):Object(o.y)(Object(o.q)(this.source));return this.calc(...e)}_start(){this.idle&&!Ce(this._active)&&(this.idle=!1,Object(o.k)(Object(c.g)(this),e=>{e.done=!1}),o.b.skipAnimation?(o.w.batchedUpdates(()=>this.advance()),Se(this)):o.o.start(this))}_attach(){let e=1;Object(o.k)(Object(o.y)(this.source),t=>{Object(o.r)(t)&&Object(o.c)(t,this),z(t)&&(t.idle||this._active.add(t),e=Math.max(e,t.priority+1))}),this.priority=e,this._start()}_detach(){Object(o.k)(Object(o.y)(this.source),e=>{Object(o.r)(e)&&Object(o.x)(e,this)}),this._active.clear(),Se(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=Object(o.y)(this.source).reduce((e,t)=>Math.max(e,(z(t)?t.priority:0)+1),0))}}function Ee(e){return!1!==e.idle}function Ce(e){return!e.size||Array.from(e).every(Ee)}function Se(e){e.idle||(e.idle=!0,Object(o.k)(Object(c.g)(e),e=>{e.done=!0}),Object(o.d)(e,{type:"idle",parent:e}))}o.b.assign({createStringInterpolator:o.g,to:(e,t)=>new ye(e,t)});o.o.advance},l3Sj:function(e,t){e.exports=window.wp.i18n},lJLt:function(e,t,n){"use strict";n.d(t,"a",(function(){return r})),n.d(t,"b",(function(){return c}));var o=n("l3Sj");const r={insertUsage:{}},c={alignWide:!1,supportsLayout:!0,colors:[{name:Object(o.__)("Black"),slug:"black",color:"#000000"},{name:Object(o.__)("Cyan bluish gray"),slug:"cyan-bluish-gray",color:"#abb8c3"},{name:Object(o.__)("White"),slug:"white",color:"#ffffff"},{name:Object(o.__)("Pale pink"),slug:"pale-pink",color:"#f78da7"},{name:Object(o.__)("Vivid red"),slug:"vivid-red",color:"#cf2e2e"},{name:Object(o.__)("Luminous vivid orange"),slug:"luminous-vivid-orange",color:"#ff6900"},{name:Object(o.__)("Luminous vivid amber"),slug:"luminous-vivid-amber",color:"#fcb900"},{name:Object(o.__)("Light green cyan"),slug:"light-green-cyan",color:"#7bdcb5"},{name:Object(o.__)("Vivid green cyan"),slug:"vivid-green-cyan",color:"#00d084"},{name:Object(o.__)("Pale cyan blue"),slug:"pale-cyan-blue",color:"#8ed1fc"},{name:Object(o.__)("Vivid cyan blue"),slug:"vivid-cyan-blue",color:"#0693e3"},{name:Object(o.__)("Vivid purple"),slug:"vivid-purple",color:"#9b51e0"}],fontSizes:[{name:Object(o._x)("Small","font size name"),size:13,slug:"small"},{name:Object(o._x)("Normal","font size name"),size:16,slug:"normal"},{name:Object(o._x)("Medium","font size name"),size:20,slug:"medium"},{name:Object(o._x)("Large","font size name"),size:36,slug:"large"},{name:Object(o._x)("Huge","font size name"),size:42,slug:"huge"}],imageDefaultSize:"large",imageSizes:[{slug:"thumbnail",name:Object(o.__)("Thumbnail")},{slug:"medium",name:Object(o.__)("Medium")},{slug:"large",name:Object(o.__)("Large")},{slug:"full",name:Object(o.__)("Full Size")}],imageEditing:!0,maxWidth:580,allowedBlockTypes:!0,maxUploadFileSize:0,allowedMimeTypes:null,__experimentalCanUserUseUnfilteredHTML:!1,__experimentalBlockDirectory:!1,__mobileEnablePageTemplates:!1,__experimentalBlockPatterns:[],__experimentalBlockPatternCategories:[],__experimentalSpotlightEntityBlocks:[],__experimentalGenerateAnchors:!1,__unstableGalleryWithImageBlocks:!1,gradients:[{name:Object(o.__)("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:Object(o.__)("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:Object(o.__)("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:Object(o.__)("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:Object(o.__)("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:Object(o.__)("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:Object(o.__)("Blush light purple"),gradient:"linear-gradient(135deg,rgb(255,206,236) 0%,rgb(152,150,240) 100%)",slug:"blush-light-purple"},{name:Object(o.__)("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:Object(o.__)("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:Object(o.__)("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:Object(o.__)("Electric grass"),gradient:"linear-gradient(135deg,rgb(202,248,128) 0%,rgb(113,206,126) 100%)",slug:"electric-grass"},{name:Object(o.__)("Midnight"),gradient:"linear-gradient(135deg,rgb(2,3,129) 0%,rgb(40,116,252) 100%)",slug:"midnight"}]}},mdLt:function(e,t,n){"use strict";var o=n("GRId"),r=n("tI+e");t.a=function(e){let{title:t,icon:n,children:c}=e;return Object(o.createElement)(o.Fragment,null,Object(o.createElement)("div",{className:"block-editor-inserter__panel-header"},Object(o.createElement)("h2",{className:"block-editor-inserter__panel-title"},t),Object(o.createElement)(r.Icon,{icon:n})),Object(o.createElement)("div",{className:"block-editor-inserter__panel-content"},c))}},mlss:function(e,t,n){"use strict";var o=n("tI+e");const{Fill:r,Slot:c}=Object(o.createSlotFill)("__unstableInserterMenuExtension");r.Slot=c,t.a=r},nEW0:function(e,t,n){"use strict";n.d(t,"w",(function(){return r})),n.d(t,"a",(function(){return ve})),n.d(t,"b",(function(){return A})),n.d(t,"c",(function(){return ke})),n.d(t,"d",(function(){return Oe})),n.d(t,"e",(function(){return K})),n.d(t,"f",(function(){return de})),n.d(t,"g",(function(){return Re})),n.d(t,"h",(function(){return y})),n.d(t,"i",(function(){return Fe})),n.d(t,"j",(function(){return Ae})),n.d(t,"k",(function(){return S})),n.d(t,"l",(function(){return w})),n.d(t,"m",(function(){return x})),n.d(t,"n",(function(){return B})),n.d(t,"o",(function(){return V})),n.d(t,"p",(function(){return ge})),n.d(t,"q",(function(){return he})),n.d(t,"r",(function(){return fe})),n.d(t,"s",(function(){return E})),n.d(t,"t",(function(){return ze})),n.d(t,"u",(function(){return C})),n.d(t,"v",(function(){return _})),n.d(t,"x",(function(){return _e})),n.d(t,"y",(function(){return I})),n.d(t,"z",(function(){return Ge})),n.d(t,"A",(function(){return Ke})),n.d(t,"B",(function(){return We})),n.d(t,"C",(function(){return He})),n.d(t,"D",(function(){return qe}));let o=v();const r=e=>f(e,o);let c=v();r.write=e=>f(e,c);let l=v();r.onStart=e=>f(e,l);let i=v();r.onFrame=e=>f(e,i);let a=v();r.onFinish=e=>f(e,a);let s=[];r.setTimeout=(e,t)=>{let n=r.now()+t,o=()=>{let e=s.findIndex(e=>e.cancel==o);~e&&s.splice(e,1),p-=~e?1:0},c={time:n,handler:e,cancel:o};return s.splice(u(n),0,c),p+=1,h(),c};let u=e=>~(~s.findIndex(t=>t.time>e)||~s.length);r.cancel=e=>{l.delete(e),i.delete(e),o.delete(e),c.delete(e),a.delete(e)},r.sync=e=>{m=!0,r.batchedUpdates(e),m=!1},r.throttle=e=>{let t;function n(){try{e(...t)}finally{t=null}}function o(...e){t=e,r.onStart(n)}return o.handler=e,o.cancel=()=>{l.delete(n),t=null},o};let d="undefined"!=typeof window?window.requestAnimationFrame:()=>{};r.use=e=>d=e,r.now="undefined"!=typeof performance?()=>performance.now():Date.now,r.batchedUpdates=e=>e(),r.catch=console.error,r.frameLoop="always",r.advance=()=>{"demand"!==r.frameLoop?console.warn("Cannot call the manual advancement of rafz whilst frameLoop is not set as demand"):O()};let b=-1,p=0,m=!1;function f(e,t){m?(t.delete(e),e(0)):(t.add(e),h())}function h(){b<0&&(b=0,"demand"!==r.frameLoop&&d(g))}function g(){~b&&(d(g),r.batchedUpdates(O))}function O(){let e=b;b=r.now();let t=u(b);t&&(j(s.splice(0,t),e=>e.handler()),p-=t),l.flush(),o.flush(e?Math.min(64,b-e):16.667),i.flush(),c.flush(),a.flush(),p||(b=-1)}function v(){let e=new Set,t=e;return{add(n){p+=t!=e||e.has(n)?0:1,e.add(n)},delete:n=>(p-=t==e&&e.has(n)?1:0,e.delete(n)),flush(n){t.size&&(e=new Set,p-=t.size,j(t,t=>t(n)&&e.add(t)),p+=e.size,t=e)}}}function j(e,t){e.forEach(e=>{try{t(e)}catch(e){r.catch(e)}})}var k=n("cDcd");function _(){}const y=(e,t,n)=>Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0}),E={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 C(e,t){if(E.arr(e)){if(!E.arr(t)||e.length!==t.length)return!1;for(let n=0;ne.forEach(t);function w(e,t,n){if(E.arr(e))for(let o=0;oE.und(e)?[]:E.arr(e)?e:[e];function x(e,t){if(e.size){const n=Array.from(e);e.clear(),S(n,t)}}const B=(e,...t)=>x(e,e=>e(...t)),T=()=>"undefined"==typeof window||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent);let P,R,N=null,M=!1,L=_;var A=Object.freeze({__proto__:null,get createStringInterpolator(){return P},get to(){return R},get colors(){return N},get skipAnimation(){return M},get willAdvance(){return L},assign:e=>{e.to&&(R=e.to),e.now&&(r.now=e.now),void 0!==e.colors&&(N=e.colors),null!=e.skipAnimation&&(M=e.skipAnimation),e.createStringInterpolator&&(P=e.createStringInterpolator),e.requestAnimationFrame&&r.use(e.requestAnimationFrame),e.batchedUpdates&&(r.batchedUpdates=e.batchedUpdates),e.willAdvance&&(L=e.willAdvance),e.frameLoop&&(r.frameLoop=e.frameLoop)}});const D=new Set;let F=[],z=[],H=0;const V={get idle(){return!D.size&&!F.length},start(e){H>e.priority?(D.add(e),r.onStart(G)):(U(e),r(q))},advance:q,sort(e){if(H)r.onFrame(()=>V.sort(e));else{const t=F.indexOf(e);~t&&(F.splice(t,1),W(e))}},clear(){F=[],D.clear()}};function G(){D.forEach(U),D.clear(),r(q)}function U(e){F.includes(e)||W(e)}function W(e){F.splice(function(e,t){const n=e.findIndex(t);return n<0?e.length:n}(F,t=>t.priority>e.priority),0,e)}function q(e){const t=z;for(let n=0;n0}const K={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},Y="[-+]?\\d*\\.?\\d+";function $(...e){return"\\(\\s*("+e.join(")\\s*,\\s*(")+")\\s*\\)"}const Z=new RegExp("rgb"+$(Y,Y,Y)),X=new RegExp("rgba"+$(Y,Y,Y,Y)),Q=new RegExp("hsl"+$(Y,"[-+]?\\d*\\.?\\d+%","[-+]?\\d*\\.?\\d+%")),J=new RegExp("hsla"+$(Y,"[-+]?\\d*\\.?\\d+%","[-+]?\\d*\\.?\\d+%",Y)),ee=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,te=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,ne=/^#([0-9a-fA-F]{6})$/,oe=/^#([0-9a-fA-F]{8})$/;function re(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 ce(e,t,n){const o=n<.5?n*(1+t):n+t-n*t,r=2*n-o,c=re(r,o,e+1/3),l=re(r,o,e),i=re(r,o,e-1/3);return Math.round(255*c)<<24|Math.round(255*l)<<16|Math.round(255*i)<<8}function le(e){const t=parseInt(e,10);return t<0?0:t>255?255:t}function ie(e){return(parseFloat(e)%360+360)%360/360}function ae(e){const t=parseFloat(e);return t<0?0:t>1?255:Math.round(255*t)}function se(e){const t=parseFloat(e);return t<0?0:t>100?1:t/100}function ue(e){let t=function(e){let t;return"number"==typeof e?e>>>0===e&&e>=0&&e<=4294967295?e:null:(t=ne.exec(e))?parseInt(t[1]+"ff",16)>>>0:N&&void 0!==N[e]?N[e]:(t=Z.exec(e))?(le(t[1])<<24|le(t[2])<<16|le(t[3])<<8|255)>>>0:(t=X.exec(e))?(le(t[1])<<24|le(t[2])<<16|le(t[3])<<8|ae(t[4]))>>>0:(t=ee.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+"ff",16)>>>0:(t=oe.exec(e))?parseInt(t[1],16)>>>0:(t=te.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+t[4]+t[4],16)>>>0:(t=Q.exec(e))?(255|ce(ie(t[1]),se(t[2]),se(t[3])))>>>0:(t=J.exec(e))?(ce(ie(t[1]),se(t[2]),se(t[3]))|ae(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 de=(e,t,n)=>{if(E.fun(e))return e;if(E.arr(e))return de({range:e,output:t,extrapolate:n});if(E.str(e.output[0]))return P(e);const o=e,r=o.output,c=o.range||[0,1],l=o.extrapolateLeft||o.extrapolate||"extend",i=o.extrapolateRight||o.extrapolate||"extend",a=o.easing||(e=>e);return e=>{const t=function(e,t){for(var n=1;n=e);++n);return n-1}(e,c);return function(e,t,n,o,r,c,l,i,a){let s=a?a(e):e;if(sn){if("identity"===i)return s;"clamp"===i&&(s=n)}if(o===r)return o;if(t===n)return e<=t?o:r;t===-1/0?s=-s:n===1/0?s-=t:s=(s-t)/(n-t);s=c(s),o===-1/0?s=-s:r===1/0?s+=o:s=s*(r-o)+o;return s}(e,c[t],c[t+1],r[t],r[t+1],a,l,i,o.map)}};function be(){return(be=Object.assign||function(e){for(var t=1;tBoolean(e&&e[pe]),he=e=>e&&e[pe]?e[pe]():e,ge=e=>e[me]||null;function Oe(e,t){let n=e[me];n&&n.forEach(e=>{!function(e,t){e.eventObserved?e.eventObserved(t):e(t)}(e,t)})}class ve{constructor(e){if(this[pe]=void 0,this[me]=void 0,!e&&!(e=this.get))throw Error("Unknown getter");je(this,e)}}const je=(e,t)=>ye(e,pe,t);function ke(e,t){if(e[pe]){let n=e[me];n||ye(e,me,n=new Set),n.has(t)||(n.add(t),e.observerAdded&&e.observerAdded(n.size,t))}return t}function _e(e,t){let n=e[me];if(n&&n.has(t)){const o=n.size-1;o?n.delete(t):e[me]=null,e.observerRemoved&&e.observerRemoved(o,t)}}const ye=(e,t,n)=>Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0}),Ee=/[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,Ce=/(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi,Se=new RegExp(`(${Ee.source})(%|[a-z]+)`,"i"),we=/rgba\(([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+)\)/gi,Ie=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/,xe=e=>{const[t,n]=Be(e);if(!t||T())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&&Ie.test(n)?xe(n):n||e},Be=e=>{const t=Ie.exec(e);if(!t)return[,];const[,n,o]=t;return[n,o]};let Te;const Pe=(e,t,n,o,r)=>`rgba(${Math.round(t)}, ${Math.round(n)}, ${Math.round(o)}, ${r})`,Re=e=>{Te||(Te=N?new RegExp(`(${Object.keys(N).join("|")})(?!\\w)`,"g"):/^\b$/);const t=e.output.map(e=>he(e).replace(Ie,xe).replace(Ce,ue).replace(Te,ue)),n=t.map(e=>e.match(Ee).map(Number)),o=n[0].map((e,t)=>n.map(e=>{if(!(t in e))throw Error('The arity of each "output" value must be equal');return e[t]})).map(t=>de(be({},e,{output:t})));return e=>{var n;const r=!Se.test(t[0])&&(null==(n=t.find(e=>Se.test(e)))?void 0:n.replace(Ee,""));let c=0;return t[0].replace(Ee,()=>`${o[c++](e)}${r||""}`).replace(we,Pe)}},Ne="react-spring: ",Me=e=>{const t=e;let n=!1;if("function"!=typeof t)throw new TypeError(Ne+"once requires a function parameter");return(...e)=>{n||(t(...e),n=!0)}},Le=Me(console.warn);function Ae(){Le(Ne+'The "interpolate" function is deprecated in v9 (use "to" instead)')}const De=Me(console.warn);function Fe(){De(Ne+'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')}function ze(e){return E.str(e)&&("#"==e[0]||/\d/.test(e)||!T()&&Ie.test(e)||e in(N||{}))}const He=e=>Object(k.useEffect)(e,Ve),Ve=[];function Ge(){const e=Object(k.useState)()[1],t=Object(k.useState)(Ue)[0];return He(t.unmount),()=>{t.current&&e({})}}function Ue(){const e={current:!0,unmount:()=>()=>{e.current=!1}};return e}function We(e,t){const[n]=Object(k.useState)(()=>({inputs:t,result:e()})),o=Object(k.useRef)(),r=o.current;let c=r;if(c){Boolean(t&&c.inputs&&function(e,t){if(e.length!==t.length)return!1;for(let n=0;n{o.current=c,r==n&&(n.inputs=n.result=void 0)},[c]),c.result}function qe(e){const t=Object(k.useRef)();return Object(k.useEffect)(()=>{t.current=e}),t.current}const Ke="undefined"!=typeof window&&window.document&&window.document.createElement?k.useLayoutEffect:k.useEffect},nQUx:function(e,t,n){"use strict";var o=n("YLtl"),r=n("GRId"),c=n("HSyU"),l=n("1ZqX"),i=n("l3Sj"),a=n("onLe"),s=n("BhPs");t.a=(e,t)=>{const{patternCategories:n,patterns:u}=Object(l.useSelect)(e=>{const{__experimentalGetAllowedPatterns:n,getSettings:o}=e(s.a);return{patterns:n(t),patternCategories:o().__experimentalBlockPatternCategories}},[t]),{createSuccessNotice:d}=Object(l.useDispatch)(a.store);return[u,n,Object(r.useCallback)((t,n)=>{e(Object(o.map)(n,e=>Object(c.cloneBlock)(e)),t.name),d(Object(i.sprintf)(Object(i.__)('Block pattern "%s" inserted.'),t.title),{type:"snackbar"})},[])]}},nlh6:function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return w}));var o=n("TSYQ"),r=n.n(o),c=n("GRId"),l=n("l3Sj"),i=n("HSyU"),a=n("K9lf"),s=n("1ZqX"),u=(n("Z23Y"),n("Xkls")),d=n("jBNB"),b=n("z+q2"),p=n("kBLm"),m=n("ur0x"),f=n("Q2Xw"),h=n("YZt4"),g=n("ERVc"),O=n("+6d5"),v=n("6jxZ"),j=n("felP"),k=n("JDWi"),_=n("G4zt"),y=n("PKbb"),E=n("hw9B"),C=n("rHRV"),S=n("BhPs");function w(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{__unstableIsHtml:n}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{clientId:o,className:w,wrapperProps:I={},isAligned:x}=Object(c.useContext)(d.a),{index:B,mode:T,name:P,blockApiVersion:R,blockTitle:N,isPartOfSelection:M,adjustScrolling:L,enableAnimation:A}=Object(s.useSelect)(e=>{const{getBlockIndex:t,getBlockMode:n,getBlockName:r,isTyping:c,getGlobalBlockCount:l,isBlockSelected:a,isBlockMultiSelected:s,isAncestorMultiSelected:u,isFirstMultiSelectedBlock:d}=e(S.a),b=a(o),p=s(o)||u(o),m=r(o),f=Object(i.getBlockType)(m);return{index:t(o),mode:n(o),name:m,blockApiVersion:(null==f?void 0:f.apiVersion)||1,blockTitle:null==f?void 0:f.title,isPartOfSelection:b||p,adjustScrolling:b||d(o),enableAnimation:!c()&&l()<=200}},[o]),D=Object(l.sprintf)(Object(l.__)("Block: %s"),N),F="html"!==T||n?"":"-visual",z=Object(a.useMergeRefs)([t.ref,Object(b.a)(o),Object(_.a)(o),Object(y.c)(o),Object(v.a)(o),Object(E.a)(o),Object(j.a)(o),Object(k.a)(o),Object(p.a)(),Object(C.a)(),Object(u.a)({isSelected:M,adjustScrolling:L,enableAnimation:A,triggerAnimationOnChange:B})]),H=Object(m.c)();return R<2&&o===H.clientId&&void 0!==e&&e.env,{...I,...t,ref:z,id:`block-${o}${F}`,tabIndex:0,role:"document","aria-label":D,"data-block":o,"data-type":P,"data-title":N,className:r()(r()("block-editor-block-list__block",{"wp-block":!x}),w,t.className,I.className,Object(f.a)(o),Object(h.a)(o),Object(g.a)(o),Object(O.a)(o)),style:{...I.style,...t.style}}}w.save=i.__unstableGetBlockProps}).call(this,n("8oxB"))},o97j:function(e,t,n){"use strict";var o=!("undefined"==typeof window||!window.document||!window.document.createElement),r={canUseDOM:o,canUseWorkers:"undefined"!=typeof Worker,canUseEventListeners:o&&!(!window.addEventListener&&!window.attachEvent),canUseViewport:o&&!!window.screen,isInWorker:!o};e.exports=r},onLe:function(e,t){e.exports=window.wp.notices},p3NJ:function(e,t,n){"use strict";n.d(t,"b",(function(){return R}));var o=n("wx14"),r=n("GRId"),c=n("TSYQ"),l=n.n(c),i=n("K9lf"),a=n("1ZqX"),s=n("HSyU"),u=n("I5Hl"),d=n("ur0x");var b=Object(i.createHigherOrderComponent)(e=>t=>{const{clientId:n}=Object(d.c)();return Object(r.createElement)(e,Object(o.a)({},t,{clientId:n}))},"withClientId");var p=b(e=>{let{clientId:t,showSeparator:n,isFloating:o,onAddBlock:c,isToggle:i}=e;return Object(r.createElement)(u.b,{className:l()({"block-list-appender__toggle":i}),rootClientId:t,showSeparator:n,isFloating:o,onAddBlock:c})}),m=n("YLtl"),f=n("5L8O"),h=n("BhPs");var g=Object(i.compose)([b,Object(a.withSelect)((e,t)=>{let{clientId:n}=t;const{getBlockOrder:o}=e(h.a),r=o(n);return{lastBlockClientId:Object(m.last)(r)}})])(e=>{let{clientId:t,lastBlockClientId:n}=e;return Object(r.createElement)(f.a,{rootClientId:t,lastBlockClientId:n})}),O=n("rl8x"),v=n.n(O),j=n("PPMp");const k=new WeakMap;var _=n("VyCT"),y=n("uoCR"),E=n("JGYp"),C=n("l3Sj"),S=n("/lNF"),w=n("vIlp");function I(e,t,n){const o="horizontal"===n?["left","right"]:["top","bottom"],r=Object(C.isRTL)();let c,l;return e.forEach((e,n)=>{const i=e.getBoundingClientRect(),[a,s]=Object(w.a)(t,i,o);if(void 0===l||a0&&void 0!==arguments[0]?arguments[0]:{};const[t,n]=Object(r.useState)(null),o=Object(a.useSelect)(t=>{const{getTemplateLock:n}=t(h.a);return"all"===n(e)},[e]),{getBlockListSettings:c}=Object(a.useSelect)(h.a),{showInsertionPoint:l,hideInsertionPoint:s}=Object(a.useDispatch)(h.a),u=Object(S.a)(e,t),d=Object(i.useThrottle)(Object(r.useCallback)((t,o)=>{var r;const i=I(Array.from(o.children).filter(e=>e.classList.contains("wp-block")),{x:t.clientX,y:t.clientY},null===(r=c(e))||void 0===r?void 0:r.orientation);n(void 0===i?0:i),null!==i&&l(e,i)},[]),200);return Object(i.__experimentalUseDropZone)({isDisabled:o,onDrop:u,onDragOver(e){d(e,e.currentTarget)},onDragLeave(){d.cancel(),s(),n(null)},onDragEnd(){d.cancel(),s(),n(null)}})}function B(e){const{clientId:t,allowedBlocks:n,__experimentalDefaultBlock:o,__experimentalDirectInsert:c,template:l,templateLock:i,wrapperRef:u,templateInsertUpdatesSelection:d,__experimentalCaptureToolbars:b,__experimentalAppenderTagName:p,renderAppender:f,orientation:g,placeholder:O,__experimentalLayout:E}=e;!function(e,t,n,o,c,l,i,s){const{updateBlockListSettings:u}=Object(a.useDispatch)(h.a),{blockListSettings:d,parentLock:b}=Object(a.useSelect)(t=>{const n=t(h.a).getBlockRootClientId(e);return{blockListSettings:t(h.a).getBlockListSettings(e),parentLock:t(h.a).getTemplateLock(n)}},[e]),p=Object(r.useMemo)(()=>t,t);Object(r.useLayoutEffect)(()=>{const t={allowedBlocks:p,templateLock:void 0===c?b:c};if(void 0!==l&&(t.__experimentalCaptureToolbars=l),void 0!==i)t.orientation=i;else{const e=Object(j.a)(null==s?void 0:s.type);t.orientation=e.getOrientation(s)}void 0!==n&&(t.__experimentalDefaultBlock=n),void 0!==o&&(t.__experimentalDirectInsert=o),v()(d,t)||u(e,t)},[e,d,p,n,o,c,b,l,i,u,s])}(t,n,o,c,i,b,g,E),function(e,t,n,o){const{getSelectedBlocksInitialCaretPosition:c}=Object(a.useSelect)(h.a),{replaceInnerBlocks:l}=Object(a.useDispatch)(h.a),i=Object(a.useSelect)(t=>t(h.a).getBlocks(e),[e]),u=Object(r.useRef)(null);Object(r.useLayoutEffect)(()=>{if(0===i.length||"all"===n){if(!Object(m.isEqual)(t,u.current)){u.current=t;const n=Object(s.synchronizeBlocksWithTemplate)(i,t);Object(m.isEqual)(n,i)||l(e,n,0===i.length&&o&&0!==n.length,c())}}},[i,t,n,e])}(t,l,i,d);const C=Object(a.useSelect)(e=>{const n=e(h.a).getBlock(t),o=Object(s.getBlockType)(n.name);if(o&&o.providesContext)return function(e,t){k.has(t)||k.set(t,new WeakMap);const n=k.get(t);if(!n.has(e)){const o=Object(m.mapValues)(t.providesContext,t=>e[t]);n.set(e,o)}return n.get(e)}(n.attributes,o)},[t]);return Object(r.createElement)(y.a,{value:C},Object(r.createElement)(_.a,{rootClientId:t,renderAppender:f,__experimentalAppenderTagName:p,__experimentalLayout:E,wrapperRef:u,placeholder:O}))}function T(e){return Object(E.a)(e),Object(r.createElement)(B,e)}const P=Object(r.forwardRef)((e,t)=>{const n=R({ref:t},e);return Object(r.createElement)("div",{className:"block-editor-inner-blocks"},Object(r.createElement)("div",n))});function R(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{clientId:n}=Object(d.c)(),c=Object(i.useViewportMatch)("medium","<"),{__experimentalCaptureToolbars:u,hasOverlay:b}=Object(a.useSelect)(e=>{if(!n)return{};const{getBlockName:t,isBlockSelected:o,hasSelectedInnerBlock:r,isNavigationMode:l}=e(h.a),i=t(n),a=l()||c;return{__experimentalCaptureToolbars:e(s.store).hasBlockSupport(i,"__experimentalExposeControlsToChildren",!1),hasOverlay:"core/template"!==i&&!o(n)&&!r(n,!0)&&a}},[n,c]),p=Object(i.useMergeRefs)([e.ref,x({rootClientId:n})]),m={__experimentalCaptureToolbars:u,...t},f=m.value&&m.onChange?T:B;return{...e,ref:p,className:l()(e.className,"block-editor-block-list__layout",{"has-overlay":b}),children:n?Object(r.createElement)(f,Object(o.a)({},m,{clientId:n})):Object(r.createElement)(_.a,t)}}R.save=s.__unstableGetInnerBlocksProps,P.DefaultBlockAppender=g,P.ButtonBlockAppender=p,P.Content=()=>R.save().children;t.a=P},pOGT:function(e,t,n){"use strict";n.d(t,"a",(function(){return p})),n.d(t,"b",(function(){return m}));var o=n("YLtl");const r=e=>e.name||"",c=e=>e.title,l=e=>e.description||"",i=e=>e.keywords||[],a=e=>e.category,s=()=>null;function u(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return e=Object(o.deburr)(e),e=e.replace(/^\//,""),e=e.toLowerCase(),e}const d=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return Object(o.words)(u(e))},b=(e,t)=>Object(o.differenceWith)(e,d(t),(e,t)=>t.includes(e)),p=(e,t,n,r)=>{if(0===d(r).length)return e;return m(e,r,{getCategory:e=>{var n;return null===(n=Object(o.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}})},m=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=d(t);if(0===o.length)return e;const r=e.map(e=>[e,f(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 f(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{getName:d=r,getTitle:p=c,getDescription:m=l,getKeywords:f=i,getCategory:h=a,getCollection:g=s}=n,O=d(e),v=p(e),j=m(e),k=f(e),_=h(e),y=g(e),E=u(t),C=u(v);let S=0;if(E===C)S+=30;else if(C.startsWith(E))S+=20;else{const e=[O,v,j,...k,_,y].join(" "),t=Object(o.words)(E);0===b(t,e).length&&(S+=10)}return 0!==S&&O.startsWith("core/")&&S++,S}},pPDe:function(e,t,n){"use strict";var o,r;function c(e){return[e]}function l(){var e={clear:function(){e.head=null}};return e}function i(e,t,n){var o;if(e.length!==t.length)return!1;for(o=n;o{})}=e;const{replaceBlocks:p}=Object(i.useDispatch)(s.a);return n||o?Object(r.createElement)(r.Fragment,null,n&&Object(r.createElement)(l.MenuItem,{onClick:()=>{(()=>{const e=Object(a.switchToBlockType)(c,d);e&&p(t,e)})(),b()}},Object(u._x)("Group","verb")),o&&Object(r.createElement)(l.MenuItem,{onClick:()=>{(()=>{const e=c[0].innerBlocks;e.length&&p(t,e)})(),b()}},Object(u._x)("Ungroup","Ungrouping blocks from within a Group block back into individual blocks within the Editor "))):null}const{Fill:b,Slot:p}=Object(l.createSlotFill)("BlockSettingsMenuControls");function m(e){let{...t}=e;return Object(r.createElement)(l.__experimentalStyleProvider,{document:document},Object(r.createElement)(b,t))}m.Slot=e=>{let{fillProps:t,clientIds:n=null}=e;const{selectedBlocks:u,selectedClientIds:b}=Object(i.useSelect)(e=>{const{getBlocksByClientId:t,getSelectedBlockClientIds:o}=e(s.a),r=null!==n?n:o();return{selectedBlocks:Object(c.map)(Object(c.compact)(t(r)),e=>e.name),selectedClientIds:r}},[n]),m=function(){const{clientIds:e,isGroupable:t,isUngroupable:n,blocksSelection:o,groupingBlockName:r}=Object(i.useSelect)(e=>{var t;const{getBlockRootClientId:n,getBlocksByClientId:o,canInsertBlockType:r,getSelectedBlockClientIds:c}=e(s.a),{getGroupingBlockName:l}=e(a.store),i=c(),u=l(),d=r(u,null!=i&&i.length?n(i[0]):void 0),b=o(i),p=1===b.length&&(null===(t=b[0])||void 0===t?void 0:t.name)===u;return{clientIds:i,isGroupable:d&&b.length&&!p,isUngroupable:p&&!!b[0].innerBlocks.length,blocksSelection:b,groupingBlockName:u}},[]);return{clientIds:e,isGroupable:t,isUngroupable:n,blocksSelection:o,groupingBlockName:r}}(),{isGroupable:f,isUngroupable:h}=m,g=f||h;return Object(r.createElement)(p,{fillProps:{...t,selectedBlocks:u,selectedClientIds:b}},e=>{if((null==e?void 0:e.length)>0||g)return Object(r.createElement)(l.MenuGroup,null,e,Object(r.createElement)(d,Object(o.a)({},m,{onClose:null==t?void 0:t.onClose})))})};t.a=m},pY5h:function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));var o=n("v5LD");function r(){return{disableCustomColors:!Object(o.a)("color.custom"),disableCustomGradients:!Object(o.a)("color.customGradient")}}},plpT:function(e,t,n){"use strict";var o=n("GRId"),r=n("Tqx9");const c=Object(o.createElement)(r.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(o.createElement)(r.Path,{d:"M16.4 4.2H7.6v1.5h8.9V4.2zM4 11.2v1.5h16v-1.5H4zm3.6 8.6h8.9v-1.5H7.6v1.5z"}));t.a=c},q3tz:function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var o=n("GRId"),r=n("l3Sj"),c=n("tI+e"),l=n("xN+R"),i=n("7SSY");function a(e){let{count:t,icon:n}=e;return Object(o.createElement)("div",{className:"block-editor-block-draggable-chip-wrapper"},Object(o.createElement)("div",{className:"block-editor-block-draggable-chip"},Object(o.createElement)(c.Flex,{justify:"center",className:"block-editor-block-draggable-chip__content"},Object(o.createElement)(c.FlexItem,null,n?Object(o.createElement)(i.a,{icon:n}):Object(r.sprintf)(Object(r._n)("%d block","%d blocks",t),t)),Object(o.createElement)(c.FlexItem,null,Object(o.createElement)(i.a,{icon:l.a})))))}},qRz9:function(e,t){e.exports=window.wp.richText},qrxh:function(e,t,n){"use strict";var o=n("wx14"),r=n("GRId"),c=n("YLtl"),l=n("TSYQ"),i=n.n(l),a=n("gdqT"),s=n("l3Sj"),u=n("tI+e"),d=n("1ZqX"),b=n("K9lf"),p=n("HSyU"),m=n("Q4Sy"),f=n("xZzQ"),h=n("Wg7J"),g=n("AORF"),O=n("nQUx"),v=n("+G0a"),j=n("BhPs");function k(e){let{onSelect:t,rootClientId:n,clientId:o,isAppender:c}=e;const[l,a]=Object(r.useState)(""),[b,p]=Object(g.a)({onSelect:t,rootClientId:n,clientId:o,isAppender:c}),[m]=Object(v.a)(b,p),[f]=Object(O.a)(p,b),k=f.length&&!!l,_=k&&f.length>6||m.length>6,{setInserterIsOpened:y,insertionIndex:E}=Object(d.useSelect)(e=>{const{getSettings:t,getBlockIndex:n,getBlockCount:r}=e(j.a),c=n(o);return{setInserterIsOpened:t().__experimentalSetIsInserterOpened,insertionIndex:-1===c?r():c}},[o,n]);Object(r.useEffect)(()=>{y&&y(!1)},[y]);return Object(r.createElement)("div",{className:i()("block-editor-inserter__quick-inserter",{"has-search":_,"has-expand":y})},_&&Object(r.createElement)(u.SearchControl,{className:"block-editor-inserter__search",value:l,onChange:e=>{a(e)},label:Object(s.__)("Search for blocks and patterns"),placeholder:Object(s.__)("Search")}),Object(r.createElement)("div",{className:"block-editor-inserter__quick-inserter-results"},Object(r.createElement)(h.a,{filterValue:l,onSelect:t,rootClientId:n,clientId:o,isAppender:c,maxBlockPatterns:k?2:0,maxBlockTypes:6,isDraggable:!1})),y&&Object(r.createElement)(u.Button,{className:"block-editor-inserter__quick-inserter-expand",onClick:()=>{y({rootClientId:n,insertionIndex:E,filterValue:l})},"aria-label":Object(s.__)("Browse all. This will open the main inserter panel in the editor toolbar.")},Object(s.__)("Browse all")))}const _=e=>{let t,{onToggle:n,disabled:c,isOpen:l,blockTitle:i,hasSingleBlockType:a,toggleProps:d={}}=e;t=a?Object(s.sprintf)(Object(s._x)("Add %s","directly add the only allowed block"),i):Object(s._x)("Add block","Generic label for block inserter button");const{onClick:b,...p}=d;return Object(r.createElement)(u.Button,Object(o.a)({icon:m.a,label:t,tooltipPosition:"bottom",onClick:function(e){n&&n(e),b&&b(e)},className:"block-editor-inserter__toggle","aria-haspopup":!a&&"true","aria-expanded":!a&&l,disabled:c},p))};class y extends r.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:c,directInsertBlock:l,toggleProps:i,hasItems:a,renderToggle:s=_}=this.props;return s({onToggle:t,isOpen:n,disabled:o||!a,blockTitle:r,hasSingleBlockType:c,directInsertBlock:l,toggleProps:i})}renderContent(e){let{onClose:t}=e;const{rootClientId:n,clientId:o,isAppender:c,showInserterHelpPanel:l,__experimentalIsQuick:i}=this.props;return i?Object(r.createElement)(k,{onSelect:()=>{t()},rootClientId:n,clientId:o,isAppender:c}):Object(r.createElement)(f.a,{onSelect:()=>{t()},rootClientId:n,clientId:o,isAppender:c,showInserterHelpPanel:l})}render(){const{position:e,hasSingleBlockType:t,directInsertBlock:n,insertOnlyAllowedBlock:o,__experimentalIsQuick:c,onSelectOrClose:l}=this.props;return t||null!=n&&n.length?this.renderToggle({onToggle:o}):Object(r.createElement)(u.Dropdown,{className:"block-editor-inserter",contentClassName:i()("block-editor-inserter__popover",{"is-quick":c}),position:e,onToggle:this.onToggle,expandOnMobile:!0,headerTitle:Object(s.__)("Add a block"),renderToggle:this.renderToggle,renderContent:this.renderContent,onClose:l})}}t.a=Object(b.compose)([Object(d.withSelect)((e,t)=>{let{clientId:n,rootClientId:o}=t;const{getBlockRootClientId:r,hasInserterItems:l,__experimentalGetAllowedBlocks:i,__experimentalGetDirectInsertBlock:a}=e(j.a),{getBlockVariations:s}=e(p.store);o=o||r(n)||void 0;const u=i(o),d=a(o),b=1===Object(c.size)(u)&&0===Object(c.size)(s(u[0].name,"inserter"));let m=!1;return b&&(m=u[0]),{hasItems:l(o),hasSingleBlockType:b,blockTitle:m?m.title:"",allowedBlockType:m,directInsertBlock:d,rootClientId:o}}),Object(d.withDispatch)((e,t,n)=>{let{select:o}=n;return{insertOnlyAllowedBlock(){const{rootClientId:n,clientId:r,isAppender:c,hasSingleBlockType:l,allowedBlockType:i,directInsertBlock:u,onSelectOrClose:d}=t;if(!(l||null!=u&&u.length))return;const{insertBlock:b}=e(j.a);b(null!=u&&u.length?Object(p.createBlock)(...u):Object(p.createBlock)(i.name),function(){const{getBlockIndex:e,getBlockSelectionEnd:t,getBlockOrder:l,getBlockRootClientId:i}=o(j.a);if(r)return e(r);const a=t();return!c&&a&&i(a)===n?e(a)+1:l(n).length}(),n),d&&d();const m=Object(s.sprintf)(Object(s.__)("%s block added"),i.title);Object(a.speak)(m)}}}),Object(b.ifCondition)(e=>{let{hasItems:t,isAppender:n,rootClientId:o,clientId:r}=e;return t||!n&&!o&&!r})])(y)},rH4q:function(e,t,n){"use strict";var o=n("GRId"),r=n("Tqx9");const c=Object(o.createElement)(r.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(o.createElement)(r.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"}));t.a=c},rHRV:function(e,t,n){"use strict";n.d(t,"a",(function(){return l}));var o=n("K9lf"),r=n("GRId"),c=n("VyCT");function l(){const e=Object(r.useContext)(c.b);return Object(o.useRefEffect)(t=>{if(e)return e.observe(t),()=>{e.unobserve(t)}},[e])}},rl8x:function(e,t){e.exports=window.wp.isShallowEqual},rmEH:function(e,t){e.exports=window.wp.htmlEntities},smQA:function(e,t,n){"use strict";function o(){}function r(e,t,n,o,r){for(var c=0,l=t.length,i=0,a=0;ce.length?n:e})),s.value=e.join(d)}else s.value=e.join(n.slice(i,i+s.count));i+=s.count,s.added||(a+=s.count)}}var b=t[l-1];return l>1&&"string"==typeof b.value&&(b.added||b.removed)&&e.equals("",b.value)&&(t[l-2].value+=b.value,t.pop()),t}function c(e){return{newPos:e.newPos,components:e.components.slice(0)}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=o,o.prototype={diff:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=n.callback;"function"==typeof n&&(o=n,n={}),this.options=n;var l=this;function i(e){return o?(setTimeout((function(){o(void 0,e)}),0),!0):e}e=this.castInput(e),t=this.castInput(t),e=this.removeEmpty(this.tokenize(e));var a=(t=this.removeEmpty(this.tokenize(t))).length,s=e.length,u=1,d=a+s,b=[{newPos:-1,components:[]}],p=this.extractCommon(b[0],t,e,0);if(b[0].newPos+1>=a&&p+1>=s)return i([{value:this.join(t),count:t.length}]);function m(){for(var n=-1*u;n<=u;n+=2){var o=void 0,d=b[n-1],p=b[n+1],m=(p?p.newPos:0)-n;d&&(b[n-1]=void 0);var f=d&&d.newPos+1=a&&m+1>=s)return i(r(l,o.components,t,e,l.useLongestToken));b[n]=o}else b[n]=void 0}u++}if(o)!function e(){setTimeout((function(){if(u>d)return o();m()||e()}),0)}();else for(;u<=d;){var f=m();if(f)return f}},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,c=n.length,l=e.newPos,i=l-o,a=0;l+11&&void 0!==arguments[1])||arguments[1],o=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return t=Array.isArray(e)?m.filter(t=>e.includes(t)):!0===e?[...m]:[],!o||!0===e&&!n?Object(s.without)(t,...f):t}const g=Object(u.createHigherOrderComponent)(e=>t=>{const{name:n}=t,r=h(Object(o.getBlockSupport)(n,"align"),Object(o.hasBlockSupport)(n,"alignWide",!0)),c=Object(p.a)(r).map(e=>{let{name:t}=e;return t});return Object(l.createElement)(l.Fragment,null,!!c.length&&Object(l.createElement)(d.b,{group:"block",__experimentalShareWithChildBlocks:!0},Object(l.createElement)(b.a,{value:t.attributes.align,onChange:e=>{if(!e){var n,r;const c=Object(o.getBlockType)(t.name);(null==c||null===(n=c.attributes)||void 0===n||null===(r=n.align)||void 0===r?void 0:r.default)&&(e="")}t.setAttributes({align:e})},controls:c})),Object(l.createElement)(e,t))},"withToolbarControls"),O=Object(u.createHigherOrderComponent)(e=>t=>{const{name:n,attributes:r}=t,{align:i}=r,a=h(Object(o.getBlockSupport)(n,"align"),Object(o.hasBlockSupport)(n,"alignWide",!0)),s=Object(p.a)(a);if(void 0===i)return Object(l.createElement)(e,t);let u=t.wrapperProps;return s.some(e=>e.name===i)&&(u={...u,"data-align":i}),Object(l.createElement)(e,Object(c.a)({},t,{wrapperProps:u}))});Object(r.addFilter)("blocks.registerBlockType","core/align/addAttribute",(function(e){return Object(s.has)(e.attributes,["align","type"])||Object(o.hasBlockSupport)(e,"align")&&(e.attributes={...e.attributes,align:{type:"string",enum:[...m,""]}}),e})),Object(r.addFilter)("editor.BlockListBlock","core/editor/align/with-data-align",O),Object(r.addFilter)("editor.BlockEdit","core/editor/align/with-toolbar-controls",g),Object(r.addFilter)("blocks.getSaveContent.extraProps","core/align/addAssignedAlign",(function(e,t,n){const{align:r}=n;return h(Object(o.getBlockSupport)(t,"align"),Object(o.hasBlockSupport)(t,"alignWide",!0)).includes(r)&&(e.className=a()("align"+r,e.className)),e})),Object(r.addFilter)("blocks.registerBlockType","core/lock/addAttribute",(function(e){return Object(s.has)(e.attributes,["lock","type"])||(e.attributes={...e.attributes,lock:{type:"object"}}),e}));var v=n("tI+e"),j=n("l3Sj"),k=n("1oY3");const _=/[\s#]/g;const y=Object(u.createHigherOrderComponent)(e=>t=>{if(Object(o.hasBlockSupport)(t.name,"anchor")&&t.isSelected){const n="web"===l.Platform.OS,o=Object(l.createElement)(v.TextControl,{className:"html-anchor-control",label:Object(j.__)("HTML anchor"),help:Object(l.createElement)(l.Fragment,null,Object(j.__)("Enter a word or two — without spaces — to make a unique web address just for this block, called an “anchor.” Then, you’ll be able to link directly to this section of your page."),n&&Object(l.createElement)(v.ExternalLink,{href:Object(j.__)("https://wordpress.org/support/article/page-jumps/")},Object(j.__)("Learn more about anchors"))),value:t.attributes.anchor||"",placeholder:n?null:Object(j.__)("Add an anchor"),onChange:e=>{e=e.replace(_,"-"),t.setAttributes({anchor:e})},autoCapitalize:"none",autoComplete:"off"});return Object(l.createElement)(l.Fragment,null,Object(l.createElement)(e,t),n&&Object(l.createElement)(k.b,{__experimentalGroup:"advanced"},o),!n&&"core/heading"===t.name&&Object(l.createElement)(k.b,null,Object(l.createElement)(v.PanelBody,{title:Object(j.__)("Heading settings")},o)))}return Object(l.createElement)(e,t)},"withInspectorControl");Object(r.addFilter)("blocks.registerBlockType","core/anchor/attribute",(function(e){return Object(s.has)(e.attributes,["anchor","type"])||Object(o.hasBlockSupport)(e,"anchor")&&(e.attributes={...e.attributes,anchor:{type:"string",source:"attribute",attribute:"id",selector:"*"}}),e})),Object(r.addFilter)("editor.BlockEdit","core/editor/anchor/with-inspector-control",y),Object(r.addFilter)("blocks.getSaveContent.extraProps","core/anchor/save-props",(function(e,t,n){return Object(o.hasBlockSupport)(t,"anchor")&&(e.id=""===n.anchor?null:n.anchor),e}));const E=Object(u.createHigherOrderComponent)(e=>t=>Object(o.hasBlockSupport)(t.name,"customClassName",!0)&&t.isSelected?Object(l.createElement)(l.Fragment,null,Object(l.createElement)(e,t),Object(l.createElement)(k.b,{__experimentalGroup:"advanced"},Object(l.createElement)(v.TextControl,{autoComplete:"off",label:Object(j.__)("Additional CSS class(es)"),value:t.attributes.className||"",onChange:e=>{t.setAttributes({className:""!==e?e:void 0})},help:Object(j.__)("Separate multiple classes with spaces.")}))):Object(l.createElement)(e,t),"withInspectorControl");Object(r.addFilter)("blocks.registerBlockType","core/custom-class-name/attribute",(function(e){return Object(o.hasBlockSupport)(e,"customClassName",!0)&&(e.attributes={...e.attributes,className:{type:"string"}}),e})),Object(r.addFilter)("editor.BlockEdit","core/editor/custom-class-name/with-inspector-control",E),Object(r.addFilter)("blocks.getSaveContent.extraProps","core/custom-class-name/save-props",(function(e,t,n){return Object(o.hasBlockSupport)(t,"customClassName",!0)&&n.className&&(e.className=a()(e.className,n.className)),e})),Object(r.addFilter)("blocks.getSaveContent.extraProps","core/generated-class-name/save-props",(function(e,t){return Object(o.hasBlockSupport)(t,"className",!0)&&("string"==typeof e.className?e.className=Object(s.uniq)([Object(o.getBlockDefaultClassName)(t.name),...e.className.split(" ")]).join(" ").trim():e.className=Object(o.getBlockDefaultClassName)(t.name)),e}));var C=n("VyCT"),S=n("v5LD"),w=n("dchM"),I=n("0LBR"),x=n("bVpQ"),B=n("715p");const T=[];function P(e){const{attributes:{borderColor:t,style:n},setAttributes:o}=e,r=Object(I.a)(),i=r.colors.reduce((e,t)=>e.concat(t.colors),[]),[a,s]=Object(l.useState)(()=>{var e,o;return null===(e=Object(x.b)(i,t,null==n||null===(o=n.border)||void 0===o?void 0:o.color))||void 0===e?void 0:e.color}),u=[{label:Object(j.__)("Color"),onColorChange:e=>{s(e);const t=Object(x.c)(i,e),r={...n,border:{...null==n?void 0:n.border,color:null!=t&&t.slug?void 0:e}},c=null!=t&&t.slug?t.slug:void 0;o({style:Object(B.a)(r),borderColor:c})},colorValue:a,clearable:!1}];return Object(l.createElement)(w.a,Object(c.a)({settings:u,disableCustomColors:!0,disableCustomGradients:!0,__experimentalHasMultipleOrigins:!0,__experimentalIsRenderedInSidebar:!0,enableAlpha:!0},r))}function R(e,t,n){var o;if(!H(t,"color")||V(t))return e;const{borderColor:r,style:c}=n,l=Object(x.a)("border-color",r),i=a()(e.className,{"has-border-color":r||(null==c||null===(o=c.border)||void 0===o?void 0:o.color),[l]:!!l});return e.className=i||void 0,e}const N=Object(u.createHigherOrderComponent)(e=>t=>{var n,o;const{name:r,attributes:i}=t,{borderColor:a}=i,s=Object(S.a)("color.palette")||T;if(!H(r,"color")||V(r))return Object(l.createElement)(e,t);const u={borderColor:a?null===(n=Object(x.b)(s,a))||void 0===n?void 0:n.color:void 0};let d=t.wrapperProps;return d={...t.wrapperProps,style:{...u,...null===(o=t.wrapperProps)||void 0===o?void 0:o.style}},Object(l.createElement)(e,Object(c.a)({},t,{wrapperProps:d}))});Object(r.addFilter)("blocks.registerBlockType","core/border/addAttributes",(function(e){return H(e,"color")?e.attributes.borderColor?e:{...e,attributes:{...e.attributes,borderColor:{type:"string"}}}:e})),Object(r.addFilter)("blocks.getSaveContent.extraProps","core/border/addSaveProps",R),Object(r.addFilter)("blocks.registerBlockType","core/border/addEditProps",(function(e){if(!H(e,"color")||V(e))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),R(o,e,n)},e})),Object(r.addFilter)("editor.BlockListBlock","core/border/with-border-color-palette-styles",N);var M=n("Wy3j");function L(e){var t;const{attributes:{style:n},setAttributes:o}=e;return Object(l.createElement)(M.a,{values:null==n||null===(t=n.border)||void 0===t?void 0:t.radius,onChange:e=>{let t={...n,border:{...null==n?void 0:n.border,radius:e}};void 0!==e&&""!==e||(t=Object(B.a)(t)),o({style:t})}})}var A=n("2YCo");const D=e=>{var t;const{attributes:{style:n},setAttributes:o}=e;return Object(l.createElement)(A.a,{value:null==n||null===(t=n.border)||void 0===t?void 0:t.style,onChange:e=>{const t={...n,border:{...null==n?void 0:n.border,style:e}};o({style:Object(B.a)(t)})}})},F=e=>{const{attributes:{borderColor:t,style:n},setAttributes:o}=e,{width:r,color:c,style:i}=(null==n?void 0:n.border)||{},[a,s]=Object(l.useState)(),[u,d]=Object(l.useState)();Object(l.useEffect)(()=>{"none"!==i&&s(i)},[i]),Object(l.useEffect)(()=>{(t||c)&&d({name:t||void 0,color:c||void 0})},[t,c]);const b=Object(v.__experimentalUseCustomUnits)({availableUnits:Object(S.a)("spacing.units")||["px","em","rem"]});return Object(l.createElement)(v.__experimentalUnitControl,{value:r,label:Object(j.__)("Width"),min:0,onChange:e=>{let r={...n,border:{...null==n?void 0:n.border,width:e}},c=t;const l=0===parseFloat(e);l&&(c=void 0,r.border.color=void 0,r.border.style="none"),l||"none"!==i||(r.border.style=a),l||void 0!==t||(c=null==u?void 0:u.name,r.border.color=null==u?void 0:u.color),void 0!==e&&""!==e||(r=Object(B.a)(r)),o({borderColor:c,style:r})},units:b})};function z(e){const t=G(e),n=H(e.name),o=Object(S.a)("border.color")&&H(e.name,"color"),r=Object(S.a)("border.radius")&&H(e.name,"radius"),c=Object(S.a)("border.style")&&H(e.name,"style"),i=Object(S.a)("border.width")&&H(e.name,"width");return t||!n?null:Object(l.createElement)(k.b,null,Object(l.createElement)(v.PanelBody,{className:"block-editor-hooks__border-controls",title:Object(j.__)("Border"),initialOpen:!1},(i||c)&&Object(l.createElement)("div",{className:"block-editor-hooks__border-controls-row"},i&&Object(l.createElement)(F,e),c&&Object(l.createElement)(D,e)),o&&Object(l.createElement)(P,e),r&&Object(l.createElement)(L,e)))}function H(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"any";if("web"!==l.Platform.OS)return!1;const n=Object(o.getBlockSupport)(e,"__experimentalBorder");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 V(e){const t=Object(o.getBlockSupport)(e,"__experimentalBorder");return null==t?void 0:t.__experimentalSkipSerialization}const G=()=>[!Object(S.a)("border.color"),!Object(S.a)("border.radius"),!Object(S.a)("border.style"),!Object(S.a)("border.width")].every(Boolean);var U=n("Cn0l"),W=n("yU1v"),q=n("6c9H"),K=n("PKbb");function Y(e){return e.ownerDocument.defaultView.getComputedStyle(e)}function $(e){let{settings:t,clientId:n,enableContrastChecking:o=!0,showTitle:r=!0}=e;const[c,i]=Object(l.useState)(),[a,s]=Object(l.useState)(),u=Object(K.b)(n);return Object(l.useEffect)(()=>{if(!o)return;if(!u.current)return;s(Y(u.current).color);let e=u.current,t=Y(e).backgroundColor;for(;"rgba(0, 0, 0, 0)"===t&&e.parentNode&&e.parentNode.nodeType===e.parentNode.ELEMENT_NODE;)e=e.parentNode,t=Y(e).backgroundColor;i(t)}),Object(l.createElement)(k.b,null,Object(l.createElement)(W.a,{title:Object(j.__)("Color"),initialOpen:!1,settings:t,showTitle:r,__experimentalHasMultipleOrigins:!0,__experimentalIsRenderedInSidebar:!0},o&&Object(l.createElement)(q.a,{backgroundColor:c,textColor:a})))}const Z=e=>{const t=Object(o.getBlockSupport)(e,"color");return t&&(!0===t.link||!0===t.gradient||!1!==t.background||!1!==t.text)},X=e=>{const t=Object(o.getBlockSupport)(e,"color");return null==t?void 0:t.__experimentalSkipSerialization},Q=e=>{const t=Object(o.getBlockSupport)(e,"color");return Object(s.isObject)(t)&&!!t.gradients};function J(e,t,n){var o,r,c,l,i,s;if(!Z(t)||X(t))return e;const u=Q(t),{backgroundColor:d,textColor:b,gradient:p,style:m}=n,f=Object(x.a)("background-color",d),h=Object(U.a)(p),g=Object(x.a)("color",b),O=a()(e.className,g,h,{[f]:!(u&&null!=m&&null!==(o=m.color)&&void 0!==o&&o.gradient||!f),"has-text-color":b||(null==m||null===(r=m.color)||void 0===r?void 0:r.text),"has-background":d||(null==m||null===(c=m.color)||void 0===c?void 0:c.background)||u&&(p||(null==m||null===(l=m.color)||void 0===l?void 0:l.gradient)),"has-link-color":null==m||null===(i=m.elements)||void 0===i||null===(s=i.link)||void 0===s?void 0:s.color});return e.className=O||void 0,e}const ee=(e,t)=>{const n=/var:preset\|color\|(.+)/.exec(t);return n&&n[1]?Object(x.b)(e,n[1]).color:t};function te(e){var t,n,r,c,i,a,u,d,b;const{name:p,attributes:m}=e,f=Object(S.a)("color.palette.custom"),h=Object(S.a)("color.palette.theme"),g=Object(S.a)("color.palette.default"),O=Object(l.useMemo)(()=>[...f||[],...h||[],...g||[]],[f,h,g]),v=Object(S.a)("color.gradients.custom"),k=Object(S.a)("color.gradients.theme"),_=Object(S.a)("color.gradients.default"),y=Object(l.useMemo)(()=>[...v||[],...k||[],..._||[]],[v,k,_]),E=Object(S.a)("color.custom"),C=Object(S.a)("color.customGradient"),w=Object(S.a)("color.background"),I=Object(S.a)("color.link"),T=Object(S.a)("color.text"),P=E||!h||(null==h?void 0:h.length)>0,R=C||!k||(null==k?void 0:k.length)>0,N=Object(l.useRef)(m);if(Object(l.useEffect)(()=>{N.current=m},[m]),!Z(p))return null;const M=(e=>{if("web"!==l.Platform.OS)return!1;const t=Object(o.getBlockSupport)(e,"color");return Object(s.isObject)(t)&&!!t.link})(p)&&I&&P,L=(e=>{const t=Object(o.getBlockSupport)(e,"color");return t&&!1!==t.text})(p)&&T&&P,A=(e=>{const t=Object(o.getBlockSupport)(e,"color");return t&&!1!==t.background})(p)&&w&&P,D=Q(p)&&R;if(!(M||L||A||D))return null;const{style:F,textColor:z,backgroundColor:H,gradient:V}=m;let G;if(D&&V)G=Object(U.e)(y,V);else if(D){var W;G=null==F||null===(W=F.color)||void 0===W?void 0:W.gradient}const q=t=>n=>{var o,r;const c=Object(x.c)(O,n),l=t+"Color",i={...N.current.style,color:{...null===(o=N.current)||void 0===o||null===(r=o.style)||void 0===r?void 0:r.color,[t]:null!=c&&c.slug?void 0:n}},a=null!=c&&c.slug?c.slug:void 0,s={style:Object(B.a)(i),[l]:a};e.setAttributes(s),N.current={...N.current,...s}};return Object(l.createElement)($,{enableContrastChecking:!("web"!==l.Platform.OS||V||null!=F&&null!==(t=F.color)&&void 0!==t&&t.gradient),clientId:e.clientId,settings:[...L?[{label:Object(j.__)("Text"),onColorChange:q("text"),colorValue:Object(x.b)(O,z,null==F||null===(n=F.color)||void 0===n?void 0:n.text).color}]:[],...A||D?[{label:Object(j.__)("Background"),onColorChange:A?q("background"):void 0,colorValue:Object(x.b)(O,H,null==F||null===(r=F.color)||void 0===r?void 0:r.background).color,gradientValue:G,onGradientChange:D?t=>{const n=Object(U.d)(y,t);let o;if(n){var r,c,l;const e={...null===(r=N.current)||void 0===r?void 0:r.style,color:{...null===(c=N.current)||void 0===c||null===(l=c.style)||void 0===l?void 0:l.color,gradient:void 0}};o={style:Object(B.a)(e),gradient:n}}else{var i,a,s;const e={...null===(i=N.current)||void 0===i?void 0:i.style,color:{...null===(a=N.current)||void 0===a||null===(s=a.style)||void 0===s?void 0:s.color,gradient:t}};o={style:Object(B.a)(e),gradient:void 0}}e.setAttributes(o),N.current={...N.current,...o}}:void 0}]:[],...M?[{label:Object(j.__)("Link"),onColorChange:t=>{const n=Object(x.c)(O,t),o=null!=n&&n.slug?"var:preset|color|"+n.slug:t,r=Object(B.a)(function(e,t,n){return Object(s.setWith)(e?Object(s.clone)(e):{},t,n,s.clone)}(F,["elements","link","color","text"],o));e.setAttributes({style:r})},colorValue:ee(O,null==F||null===(c=F.elements)||void 0===c||null===(i=c.link)||void 0===i||null===(a=i.color)||void 0===a?void 0:a.text),clearable:!(null==F||null===(u=F.elements)||void 0===u||null===(d=u.link)||void 0===d||null===(b=d.color)||void 0===b||!b.text)}]:[]]})}const ne=Object(u.createHigherOrderComponent)(e=>t=>{var n;const{name:o,attributes:r}=t,{backgroundColor:i,textColor:a}=r,s=Object(S.a)("color.palette.custom")||[],u=Object(S.a)("color.palette.theme")||[],d=Object(S.a)("color.palette.default")||[],b=Object(l.useMemo)(()=>[...s||[],...u||[],...d||[]],[s,u,d]);if(!Z(o)||X(o))return Object(l.createElement)(e,t);const p={};var m,f;a&&(p.color=null===(m=Object(x.b)(b,a))||void 0===m?void 0:m.color);i&&(p.backgroundColor=null===(f=Object(x.b)(b,i))||void 0===f?void 0:f.color);let h=t.wrapperProps;return h={...t.wrapperProps,style:{...p,...null===(n=t.wrapperProps)||void 0===n?void 0:n.style}},Object(l.createElement)(e,Object(c.a)({},t,{wrapperProps:h}))});Object(r.addFilter)("blocks.registerBlockType","core/color/addAttribute",(function(e){return Z(e)?(e.attributes.backgroundColor||Object.assign(e.attributes,{backgroundColor:{type:"string"}}),e.attributes.textColor||Object.assign(e.attributes,{textColor:{type:"string"}}),Q(e)&&!e.attributes.gradient&&Object.assign(e.attributes,{gradient:{type:"string"}}),e):e})),Object(r.addFilter)("blocks.getSaveContent.extraProps","core/color/addSaveProps",J),Object(r.addFilter)("blocks.registerBlockType","core/color/addEditProps",(function(e){if(!Z(e)||X(e))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),J(o,e,n)},e})),Object(r.addFilter)("editor.BlockListBlock","core/color/with-color-palette-styles",ne);var oe=n("Bo0k"),re=n("weEX");function ce(e){var t;const{attributes:{style:n},setAttributes:o}=e;return Object(l.createElement)(re.a,{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:Object(B.a)(t)})}})}function le(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!Object(S.a)("typography.lineHeight");return!Object(o.hasBlockSupport)(e,"typography.lineHeight")||t}function ie(e){var t,n;const{attributes:{style:o},setAttributes:r}=e,c=!ae(e),i=!se(e),a=null==o||null===(t=o.typography)||void 0===t?void 0:t.fontStyle,s=null==o||null===(n=o.typography)||void 0===n?void 0:n.fontWeight;return Object(l.createElement)(oe.a,{onChange:e=>{r({style:Object(B.a)({...o,typography:{...null==o?void 0:o.typography,fontStyle:e.fontStyle,fontWeight:e.fontWeight}})})},hasFontStyles:c,hasFontWeights:i,value:{fontStyle:a,fontWeight:s}})}function ae(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=Object(o.hasBlockSupport)(e,"typography.__experimentalFontStyle"),n=Object(S.a)("typography.fontStyle");return!t||!n}function se(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=Object(o.hasBlockSupport)(e,"typography.__experimentalFontWeight"),n=Object(S.a)("typography.fontWeight");return!t||!n}function ue(e){const t=ae(e),n=se(e);return t&&n}var de=n("BLeD"),be=n.n(de),pe=n("GKUk");const me="typography.__experimentalFontFamily";function fe(e,t,n){if(!Object(o.hasBlockSupport)(t,me))return e;if(Object(o.hasBlockSupport)(t,"typography.__experimentalSkipSerialization"))return e;if(null==n||!n.fontFamily)return e;const r=new be.a(e.className);r.add(`has-${Object(s.kebabCase)(null==n?void 0:n.fontFamily)}-font-family`);const c=r.value;return e.className=c||void 0,e}function he(e){var t;let{setAttributes:n,attributes:{fontFamily:o}}=e;const r=Object(S.a)("typography.fontFamilies"),c=null===(t=Object(s.find)(r,e=>{let{slug:t}=e;return o===t}))||void 0===t?void 0:t.fontFamily;return Object(l.createElement)(pe.a,{className:"block-editor-hooks-font-family-control",fontFamilies:r,value:c,onChange:function(e){const t=Object(s.find)(r,t=>{let{fontFamily:n}=t;return n===e});n({fontFamily:null==t?void 0:t.slug})}})}function ge(e){let{name:t}=e;const n=Object(S.a)("typography.fontFamilies");return!n||0===n.length||!Object(o.hasBlockSupport)(t,me)}Object(r.addFilter)("blocks.registerBlockType","core/fontFamily/addAttribute",(function(e){return Object(o.hasBlockSupport)(e,me)?(e.attributes.fontFamily||Object.assign(e.attributes,{fontFamily:{type:"string"}}),e):e})),Object(r.addFilter)("blocks.getSaveContent.extraProps","core/fontFamily/addSaveProps",fe),Object(r.addFilter)("blocks.registerBlockType","core/fontFamily/addEditProps",(function(e){if(!Object(o.hasBlockSupport)(e,me))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),fe(o,e,n)},e}));var Oe=n("NMUH"),ve=n("QP/w");function je(e,t,n){if(!Object(o.hasBlockSupport)(t,"typography.fontSize"))return e;if(Object(o.hasBlockSupport)(t,"typography.__experimentalSkipSerialization"))return e;const r=new be.a(e.className);r.add(Object(Oe.b)(n.fontSize));const c=r.value;return e.className=c||void 0,e}function ke(e){var t,n;const{attributes:{fontSize:o,style:r},setAttributes:c}=e,i=Object(S.a)("typography.fontSizes"),a=Object(Oe.a)(i,o,null==r||null===(t=r.typography)||void 0===t?void 0:t.fontSize),s=(null==a?void 0:a.size)||(null==r||null===(n=r.typography)||void 0===n?void 0:n.fontSize)||o;return Object(l.createElement)(ve.a,{onChange:e=>{const t=Object(Oe.c)(i,e).slug;c({style:Object(B.a)({...r,typography:{...null==r?void 0:r.typography,fontSize:t?void 0:e}}),fontSize:t})},value:s,withReset:!1})}function _e(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=Object(S.a)("typography.fontSizes"),n=!(null==t||!t.length);return!Object(o.hasBlockSupport)(e,"typography.fontSize")||!n}const ye=Object(u.createHigherOrderComponent)(e=>t=>{var n,r;const c=Object(S.a)("typography.fontSizes"),{name:i,attributes:{fontSize:a,style:s},wrapperProps:u}=t;if(!Object(o.hasBlockSupport)(i,"typography.fontSize")||Object(o.hasBlockSupport)(i,"typography.__experimentalSkipSerialization")||!a||null!=s&&null!==(n=s.typography)&&void 0!==n&&n.fontSize)return Object(l.createElement)(e,t);const d=Object(Oe.a)(c,a,null==s||null===(r=s.typography)||void 0===r?void 0:r.fontSize).size,b={...t,wrapperProps:{...u,style:{fontSize:d,...null==u?void 0:u.style}}};return Object(l.createElement)(e,b)},"withFontSizeInlineStyles");Object(r.addFilter)("blocks.registerBlockType","core/font/addAttribute",(function(e){return Object(o.hasBlockSupport)(e,"typography.fontSize")?(e.attributes.fontSize||Object.assign(e.attributes,{fontSize:{type:"string"}}),e):e})),Object(r.addFilter)("blocks.getSaveContent.extraProps","core/font/addSaveProps",je),Object(r.addFilter)("blocks.registerBlockType","core/font/addEditProps",(function(e){if(!Object(o.hasBlockSupport)(e,"typography.fontSize"))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),je(o,e,n)},e})),Object(r.addFilter)("editor.BlockListBlock","core/font-size/with-font-size-inline-styles",ye);var Ee=n("kVRd");function Ce(e){var t;const{attributes:{style:n},setAttributes:o}=e;return Object(l.createElement)(Ee.a,{value:null==n||null===(t=n.typography)||void 0===t?void 0:t.textDecoration,onChange:function(e){o({style:Object(B.a)({...n,typography:{...null==n?void 0:n.typography,textDecoration:e}})})}})}function Se(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!Object(o.hasBlockSupport)(e,"typography.__experimentalTextDecoration"),n=Object(S.a)("typography.textDecoration");return t||!n}var we=n("/Hvg");function Ie(e){var t;const{attributes:{style:n},setAttributes:o}=e;return Object(l.createElement)(we.a,{value:null==n||null===(t=n.typography)||void 0===t?void 0:t.textTransform,onChange:function(e){o({style:Object(B.a)({...n,typography:{...null==n?void 0:n.typography,textTransform:e}})})}})}function xe(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!Object(o.hasBlockSupport)(e,"typography.__experimentalTextTransform"),n=Object(S.a)("typography.textTransform");return t||!n}var Be=n("xBDm");function Te(e){var t;const{attributes:{style:n},setAttributes:o}=e;return Object(l.createElement)(Be.a,{value:null==n||null===(t=n.typography)||void 0===t?void 0:t.letterSpacing,onChange:function(e){o({style:Object(B.a)({...n,typography:{...null==n?void 0:n.typography,letterSpacing:e}})})},__unstableInputWidth:!1})}function Pe(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!Object(o.hasBlockSupport)(e,"typography.__experimentalLetterSpacing"),n=Object(S.a)("typography.letterSpacing");return t||!n}const Re=["typography.lineHeight","typography.fontSize","typography.__experimentalFontStyle","typography.__experimentalFontWeight",me,"typography.__experimentalTextDecoration","typography.__experimentalTextTransform","typography.__experimentalLetterSpacing"];function Ne(e){const{clientId:t}=e,n=ge(e),r=_e(e),c=ue(e),i=le(e),a=Se(e),s=xe(e),u=Pe(e),d=!ae(e),b=!se(e),p=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=[ue(e),_e(e),le(e),ge(e),Se(e),xe(e),Pe(e)];return t.filter(Boolean).length===t.length}(e),m=Me(e.name);if(p||!m)return null;const f=Object(o.getBlockSupport)(e.name,["typography","__experimentalDefaultControls"]),h=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 Object(l.createElement)(k.b,{__experimentalGroup:"typography"},!n&&Object(l.createElement)(v.__experimentalToolsPanelItem,{hasValue:()=>function(e){return!!e.attributes.fontFamily}(e),label:Object(j.__)("Font family"),onDeselect:()=>function(e){let{setAttributes:t}=e;t({fontFamily:void 0})}(e),isShownByDefault:null==f?void 0:f.fontFamily,resetAllFilter:e=>({...e,fontFamily:void 0}),panelId:t},Object(l.createElement)(he,e)),!r&&Object(l.createElement)(v.__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:Object(j.__)("Font size"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({fontSize:void 0,style:Object(B.a)({...o,typography:{...null==o?void 0:o.typography,fontSize:void 0}})})}(e),isShownByDefault:null==f?void 0:f.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},Object(l.createElement)(ke,e)),!c&&Object(l.createElement)(v.__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:Object(oe.b)(d,b),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:Object(B.a)({...o,typography:{...null==o?void 0:o.typography,fontStyle:void 0,fontWeight:void 0}})})}(e),isShownByDefault:null==f?void 0:f.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},Object(l.createElement)(ie,e)),!i&&Object(l.createElement)(v.__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:Object(j.__)("Line height"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:Object(B.a)({...o,typography:{...null==o?void 0:o.typography,lineHeight:void 0}})})}(e),isShownByDefault:null==f?void 0:f.lineHeight,resetAllFilter:h("lineHeight"),panelId:t},Object(l.createElement)(ce,e)),!a&&Object(l.createElement)(v.__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:Object(j.__)("Decoration"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:Object(B.a)({...o,typography:{...null==o?void 0:o.typography,textDecoration:void 0}})})}(e),isShownByDefault:null==f?void 0:f.textDecoration,resetAllFilter:h("textDecoration"),panelId:t},Object(l.createElement)(Ce,e)),!s&&Object(l.createElement)(v.__experimentalToolsPanelItem,{className:"single-column",hasValue:()=>function(e){var t,n;return!(null===(t=e.attributes.style)||void 0===t||null===(n=t.typography)||void 0===n||!n.textTransform)}(e),label:Object(j.__)("Letter case"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:Object(B.a)({...o,typography:{...null==o?void 0:o.typography,textTransform:void 0}})})}(e),isShownByDefault:null==f?void 0:f.textTransform,resetAllFilter:h("textTransform"),panelId:t},Object(l.createElement)(Ie,e)),!u&&Object(l.createElement)(v.__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:Object(j.__)("Letter-spacing"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:Object(B.a)({...o,typography:{...null==o?void 0:o.typography,letterSpacing:void 0}})})}(e),isShownByDefault:null==f?void 0:f.letterSpacing,resetAllFilter:h("letterSpacing"),panelId:t},Object(l.createElement)(Te,e)))}const Me=e=>Re.some(t=>Object(o.hasBlockSupport)(e,t));function Le(e){const t=Object(o.getBlockSupport)(e,We);return!!(!0===t||null!=t&&t.blockGap)}function Ae(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!Object(S.a)("spacing.blockGap");return!Le(e)||t}function De(e){var t;const{clientId:n,attributes:{style:o},setAttributes:r}=e,c=Object(v.__experimentalUseCustomUnits)({availableUnits:Object(S.a)("spacing.units")||["%","px","em","rem","vw"]}),i=Object(K.b)(n);if(Ae(e))return null;return l.Platform.select({web:Object(l.createElement)(l.Fragment,null,Object(l.createElement)(v.__experimentalUnitControl,{label:Object(j.__)("Block spacing"),__unstableInputWidth:"80px",min:0,onChange:e=>{var t;const n={...o,spacing:{...null==o?void 0:o.spacing,blockGap:e}};r({style:Object(B.a)(n)});const c=(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 l;i.current&&c&&(null===(l=i.current.parentNode)||void 0===l||l.replaceChild(i.current,i.current))},units:c,value:null==o||null===(t=o.spacing)||void 0===t?void 0:t.blockGap})),native:null})}function Fe(e){const t=Object(o.getBlockSupport)(e,We);return!!(!0===t||null!=t&&t.margin)}function ze(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!Object(S.a)("spacing.margin"),n=!Xe(e,"margin");return!Fe(e)||t||n}function He(e){var t;const{name:n,attributes:{style:o},setAttributes:r}=e,c=Object(v.__experimentalUseCustomUnits)({availableUnits:Object(S.a)("spacing.units")||["%","px","em","rem","vw"]}),i=Ze(n,"margin"),a=i&&i.some(e=>Ke.includes(e));if(ze(e))return null;return l.Platform.select({web:Object(l.createElement)(l.Fragment,null,Object(l.createElement)(v.__experimentalBoxControl,{values:null==o||null===(t=o.spacing)||void 0===t?void 0:t.margin,onChange:e=>{const t={...o,spacing:{...null==o?void 0:o.spacing,margin:e}};r({style:Object(B.a)(t)})},onChangeShowVisualizer:e=>{const t={...o,visualizers:{margin:e}};r({style:Object(B.a)(t)})},label:Object(j.__)("Margin"),sides:i,units:c,allowReset:!1,splitOnAxis:a})),native:null})}function Ve(e){const t=Object(o.getBlockSupport)(e,We);return!!(!0===t||null!=t&&t.padding)}function Ge(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!Object(S.a)("spacing.padding"),n=!Xe(e,"padding");return!Ve(e)||t||n}function Ue(e){var t;const{name:n,attributes:{style:o},setAttributes:r}=e,c=Object(v.__experimentalUseCustomUnits)({availableUnits:Object(S.a)("spacing.units")||["%","px","em","rem","vw"]}),i=Ze(n,"padding"),a=i&&i.some(e=>Ke.includes(e));if(Ge(e))return null;return l.Platform.select({web:Object(l.createElement)(l.Fragment,null,Object(l.createElement)(v.__experimentalBoxControl,{values:null==o||null===(t=o.spacing)||void 0===t?void 0:t.padding,onChange:e=>{const t={...o,spacing:{...null==o?void 0:o.spacing,padding:e}};r({style:Object(B.a)(t)})},onChangeShowVisualizer:e=>{const t={...o,visualizers:{padding:e}};r({style:Object(B.a)(t)})},label:Object(j.__)("Padding"),sides:i,units:c,allowReset:!1,splitOnAxis:a})),native:null})}const We="spacing",qe=["top","right","bottom","left"],Ke=["vertical","horizontal"];function Ye(e){const t=Ae(e),n=Ge(e),r=ze(e),c=$e(e),i=function(e){if("web"!==l.Platform.OS)return!1;return Le(e)||Ve(e)||Fe(e)}(e.name);if(c||!i)return null;const a=Object(o.getBlockSupport)(e.name,[We,"__experimentalDefaultControls"]),s=e=>t=>{var n;return{...t,style:{...t.style,spacing:{...null===(n=t.style)||void 0===n?void 0:n.spacing,[e]:void 0}}}};return Object(l.createElement)(k.b,{__experimentalGroup:"dimensions"},!n&&Object(l.createElement)(v.__experimentalToolsPanelItem,{hasValue:()=>function(e){var t,n;return void 0!==(null===(t=e.attributes.style)||void 0===t||null===(n=t.spacing)||void 0===n?void 0:n.padding)}(e),label:Object(j.__)("Padding"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:Object(B.a)({...o,spacing:{...null==o?void 0:o.spacing,padding:void 0}})})}(e),resetAllFilter:s("padding"),isShownByDefault:null==a?void 0:a.padding,panelId:e.clientId},Object(l.createElement)(Ue,e)),!r&&Object(l.createElement)(v.__experimentalToolsPanelItem,{hasValue:()=>function(e){var t,n;return void 0!==(null===(t=e.attributes.style)||void 0===t||null===(n=t.spacing)||void 0===n?void 0:n.margin)}(e),label:Object(j.__)("Margin"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:Object(B.a)({...o,spacing:{...null==o?void 0:o.spacing,margin:void 0}})})}(e),resetAllFilter:s("margin"),isShownByDefault:null==a?void 0:a.margin,panelId:e.clientId},Object(l.createElement)(He,e)),!t&&Object(l.createElement)(v.__experimentalToolsPanelItem,{hasValue:()=>function(e){var t,n;return void 0!==(null===(t=e.attributes.style)||void 0===t||null===(n=t.spacing)||void 0===n?void 0:n.blockGap)}(e),label:Object(j.__)("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:s("blockGap"),isShownByDefault:null==a?void 0:a.blockGap,panelId:e.clientId},Object(l.createElement)(De,e)))}const $e=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=Ae(e),n=Ge(e),o=ze(e);return t&&n&&o};function Ze(e,t){const n=Object(o.getBlockSupport)(e,We);if(n&&"boolean"!=typeof n[t])return n[t]}function Xe(e,t){const n=Ze(e,t);return!(n&&n.some(e=>qe.includes(e))&&n.some(e=>Ke.includes(e)))||(console.warn(`The ${t} support for the "${e}" block can not be configured to support both axial and arbitrary sides.`),!1)}var Qe=n("HgtZ");const Je=[...Re,"__experimentalBorder","color",We],et=e=>Je.some(t=>Object(o.hasBlockSupport)(e,t));function tt(e){if(Object(s.startsWith)(e,"var:")){return`var(--wp--${e.slice("var:".length).split("|").join("--")})`}return e}function nt(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=["spacing.blockGap"],n={};return Object.keys(o.__EXPERIMENTAL_STYLE_PROPERTY).forEach(r=>{const c=o.__EXPERIMENTAL_STYLE_PROPERTY[r].value,l=o.__EXPERIMENTAL_STYLE_PROPERTY[r].properties;if(Object(s.has)(e,c)&&"elements"!==Object(s.first)(c)){const o=Object(s.get)(e,c);l&&!Object(s.isString)(o)?Object.entries(l).forEach(e=>{const[t,r]=e,c=Object(s.get)(o,[r]);c&&(n[t]=tt(c))}):t.includes(c.join("."))||(n[r]=tt(Object(s.get)(e,c)))}}),n}const ot={"__experimentalBorder.__experimentalSkipSerialization":["border"],"color.__experimentalSkipSerialization":["color"],"typography.__experimentalSkipSerialization":["typography"],[We+".__experimentalSkipSerialization"]:["spacing"]},rt={...ot,[""+We]:["spacing.blockGap"]};function ct(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:rt;if(!et(t))return e;let{style:c}=n;return Object(s.forEach)(r,(e,n)=>{Object(o.getBlockSupport)(t,n)&&(c=Object(s.omit)(c,e))}),e.style={...nt(c),...e.style},e}const lt=Object(u.createHigherOrderComponent)(e=>t=>{const n=Object(Qe.a)();return Object(l.createElement)(l.Fragment,null,n&&Object(l.createElement)(l.Fragment,null,Object(l.createElement)(te,t),Object(l.createElement)(Ne,t),Object(l.createElement)(z,t),Object(l.createElement)(Ye,t)),Object(l.createElement)(e,t))},"withToolbarControls"),it=Object(u.createHigherOrderComponent)(e=>t=>{var n,r;const i=null===(n=t.attributes.style)||void 0===n?void 0:n.elements,d="wp-elements-"+Object(u.useInstanceId)(e),b=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(s.map)(t,(t,n)=>{const r=nt(t);return Object(s.isEmpty)(r)?"":[`.${e} ${o.__EXPERIMENTAL_ELEMENTS[n]}{`,...Object(s.map)(r,(e,t)=>`\t${Object(s.kebabCase)(t)}: ${e};`),"}"].join("\n")}).join("\n")}(d,null===(r=t.attributes.style)||void 0===r?void 0:r.elements),p=Object(l.useContext)(C.c.__unstableElementContext);return Object(l.createElement)(l.Fragment,null,i&&p&&Object(l.createPortal)(Object(l.createElement)("style",{dangerouslySetInnerHTML:{__html:b}}),p),Object(l.createElement)(e,Object(c.a)({},t,{className:i?a()(t.className,d):t.className})))});Object(r.addFilter)("blocks.registerBlockType","core/style/addAttribute",(function(e){return et(e)?(e.attributes.style||Object.assign(e.attributes,{style:{type:"object"}}),e):e})),Object(r.addFilter)("blocks.getSaveContent.extraProps","core/style/addSaveProps",ct),Object(r.addFilter)("blocks.registerBlockType","core/style/addEditProps",(function(e){if(!et(e))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),ct(o,e,n,ot)},e})),Object(r.addFilter)("editor.BlockEdit","core/style/with-block-controls",lt),Object(r.addFilter)("editor.BlockListBlock","core/editor/with-elements-styles",it);var at=n("fHnH"),st=n("abaT"),ut=n("1uGa");const dt=[];function bt(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t={r:[],g:[],b:[],a:[]};return e.forEach(e=>{const n=Object(at.a)(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 pt(e){let{selector:t,id:n,values:o}=e;const r=`\n${t} {\n\tfilter: url( #${n} );\n}\n`;return Object(l.createElement)(l.Fragment,null,Object(l.createElement)(v.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"}},Object(l.createElement)("defs",null,Object(l.createElement)("filter",{id:n},Object(l.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 "}),Object(l.createElement)("feComponentTransfer",{colorInterpolationFilters:"sRGB"},Object(l.createElement)("feFuncR",{type:"table",tableValues:o.r.join(" ")}),Object(l.createElement)("feFuncG",{type:"table",tableValues:o.g.join(" ")}),Object(l.createElement)("feFuncB",{type:"table",tableValues:o.b.join(" ")}),Object(l.createElement)("feFuncA",{type:"table",tableValues:o.a.join(" ")})),Object(l.createElement)("feComposite",{in2:"SourceGraphic",operator:"in"})))),Object(l.createElement)("style",{dangerouslySetInnerHTML:{__html:r}}))}function mt(e){var t;let{attributes:n,setAttributes:o}=e;const r=null==n?void 0:n.style,c=null==r||null===(t=r.color)||void 0===t?void 0:t.duotone,i=Object(S.a)("color.duotone")||dt,a=Object(S.a)("color.palette")||dt,s=!Object(S.a)("color.custom"),u=!Object(S.a)("color.customDuotone")||0===(null==a?void 0:a.length)&&s;return 0===(null==i?void 0:i.length)&&u?null:Object(l.createElement)(d.b,{group:"block",__experimentalShareWithChildBlocks:!0},Object(l.createElement)(ut.a,{duotonePalette:i,colorPalette:a,disableCustomDuotone:u,disableCustomColors:s,value:c,onChange:e=>{const t={...r,color:{...null==r?void 0:r.color,duotone:e}};o({style:t})}}))}Object(at.b)([st.a]);const ft=Object(u.createHigherOrderComponent)(e=>t=>{const n=Object(o.hasBlockSupport)(t.name,"color.__experimentalDuotone");return Object(l.createElement)(l.Fragment,null,Object(l.createElement)(e,t),n&&Object(l.createElement)(mt,t))},"withDuotoneControls");const ht=Object(u.createHigherOrderComponent)(e=>t=>{var n,r,i;const s=Object(o.getBlockSupport)(t.name,"color.__experimentalDuotone"),d=null==t||null===(n=t.attributes)||void 0===n||null===(r=n.style)||void 0===r||null===(i=r.color)||void 0===i?void 0:i.duotone;if(!s||!d)return Object(l.createElement)(e,t);const b="wp-duotone-"+Object(u.useInstanceId)(e),p=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 ."+b,s),m=a()(null==t?void 0:t.className,b),f=Object(l.useContext)(C.c.__unstableElementContext);return Object(l.createElement)(l.Fragment,null,f&&Object(l.createPortal)(Object(l.createElement)(pt,{selector:p,id:b,values:bt(d)}),f),Object(l.createElement)(e,Object(c.a)({},t,{className:m})))},"withDuotoneStyles");Object(r.addFilter)("blocks.registerBlockType","core/editor/duotone/add-attributes",(function(e){return Object(o.hasBlockSupport)(e,"color.__experimentalDuotone")?(e.attributes.style||Object.assign(e.attributes,{style:{type:"object"}}),e):e})),Object(r.addFilter)("editor.BlockEdit","core/editor/duotone/with-editor-controls",ft),Object(r.addFilter)("editor.BlockListBlock","core/editor/duotone/with-styles",ht);var gt=n("1ZqX"),Ot=n("BhPs"),vt=n("w8sn"),jt=n("PPMp");function kt(e){let{setAttributes:t,attributes:n,name:r}=e;const{layout:c}=n,i=Object(S.a)("layout"),a=Object(gt.useSelect)(e=>{const{getSettings:t}=e(Ot.a);return t().supportsLayout},[]),s=Object(o.getBlockSupport)(r,"__experimentalLayout",{}),{allowSwitching:u,allowEditing:d=!0,allowInheriting:b=!0,default:p}=s;if(!d)return null;const m=c||p||{},{inherit:f=!1,type:h="default"}=m;if("default"===h&&!a)return null;const g=Object(jt.a)(h),O=e=>t({layout:e});return Object(l.createElement)(l.Fragment,null,Object(l.createElement)(k.b,null,Object(l.createElement)(v.PanelBody,{title:Object(j.__)("Layout")},b&&!!i&&Object(l.createElement)(v.ToggleControl,{label:Object(j.__)("Inherit default layout"),checked:!!f,onChange:()=>t({layout:{inherit:!f}})}),!f&&u&&Object(l.createElement)(_t,{type:h,onChange:e=>t({layout:{type:e}})}),!f&&g&&Object(l.createElement)(g.inspectorControls,{layout:m,onChange:O,layoutBlockSupport:s}))),!f&&g&&Object(l.createElement)(g.toolBarControls,{layout:m,onChange:O,layoutBlockSupport:s}))}function _t(e){let{type:t,onChange:n}=e;return Object(l.createElement)(v.ButtonGroup,null,Object(jt.b)().map(e=>{let{name:o,label:r}=e;return Object(l.createElement)(v.Button,{key:o,isPressed:t===o,onClick:()=>n(o)},r)}))}const yt=Object(u.createHigherOrderComponent)(e=>t=>{const{name:n}=t;return[Object(o.hasBlockSupport)(n,"__experimentalLayout")&&Object(l.createElement)(kt,Object(c.a)({key:"layout"},t)),Object(l.createElement)(e,Object(c.a)({key:"edit"},t))]},"withInspectorControls"),Et=Object(u.createHigherOrderComponent)(e=>t=>{const{name:n,attributes:r}=t,i=Object(o.hasBlockSupport)(n,"__experimentalLayout"),s=Object(u.useInstanceId)(e),d=Object(S.a)("layout")||{},b=Object(l.useContext)(C.c.__unstableElementContext),{layout:p}=r,{default:m}=Object(o.getBlockSupport)(n,"__experimentalLayout")||{},f=null!=p&&p.inherit?d:p||m||{},h=a()(null==t?void 0:t.className,{["wp-container-"+s]:i});return Object(l.createElement)(l.Fragment,null,i&&b&&Object(l.createPortal)(Object(l.createElement)(vt.b,{selector:".wp-container-"+s,layout:f,style:null==r?void 0:r.style}),b),Object(l.createElement)(e,Object(c.a)({},t,{className:h})))});Object(r.addFilter)("blocks.registerBlockType","core/layout/addAttribute",(function(e){return Object(s.has)(e.attributes,["layout","type"])||Object(o.hasBlockSupport)(e,"__experimentalLayout")&&(e.attributes={...e.attributes,layout:{type:"object"}}),e})),Object(r.addFilter)("editor.BlockListBlock","core/editor/layout/with-layout-styles",Et),Object(r.addFilter)("editor.BlockEdit","core/editor/layout/with-inspector-controls",yt);const Ct=[];function St(e){var t;let{borderColor:n,style:o}=e;const r=(null==o?void 0:o.border)||{},c=Object(x.a)("border-color",n);return{className:a()({[c]:!!c,"has-border-color":n||(null==o||null===(t=o.border)||void 0===t?void 0:t.color)})||void 0,style:nt({border:r})}}function wt(e){const t=Object(S.a)("color.palette")||Ct,n=St(e);if(e.borderColor){const o=Object(x.b)(t,e.borderColor);n.style.borderColor=o.color}return n}function It(e){var t,n,o,r,c,l;const{backgroundColor:i,textColor:s,gradient:u,style:d}=e,b=Object(x.a)("background-color",i),p=Object(x.a)("color",s),m=Object(U.a)(u),f=m||(null==d||null===(t=d.color)||void 0===t?void 0:t.gradient);return{className:a()(p,m,{[b]:!f&&!!b,"has-text-color":s||(null==d||null===(n=d.color)||void 0===n?void 0:n.text),"has-background":i||(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===(c=d.elements)||void 0===c||null===(l=c.link)||void 0===l?void 0:l.color})||void 0,style:nt({color:(null==d?void 0:d.color)||{}})}}const xt={};function Bt(e){const{backgroundColor:t,textColor:n,gradient:o}=e,r=Object(S.a)("color.palette.custom")||[],c=Object(S.a)("color.palette.theme")||[],i=Object(S.a)("color.palette.default")||[],a=Object(S.a)("color.gradients")||xt,s=Object(l.useMemo)(()=>[...r||[],...c||[],...i||[]],[r,c,i]),u=Object(l.useMemo)(()=>[...(null==a?void 0:a.custom)||[],...(null==a?void 0:a.theme)||[],...(null==a?void 0:a.default)||[]],[a]),d=It(e);if(t){const e=Object(x.b)(s,t);d.style.backgroundColor=e.color}if(o&&(d.style.background=Object(U.e)(u,o)),n){const e=Object(x.b)(s,n);d.style.color=e.color}return d}function Tt(e){const{style:t}=e;return{style:nt({spacing:(null==t?void 0:t.spacing)||{}})}}function Pt(e){const[t,n]=Object(l.useState)(e);return Object(l.useEffect)(()=>{e&&n(e)},[e]),t}var Rt=n("14PQ"),Nt=n("BCrt"),Mt=n("lJLt")},uoCR:function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var o=n("GRId");const r=Object(o.createContext)({});function c(e){let{value:t,children:n}=e;const c=Object(o.useContext)(r),l=Object(o.useMemo)(()=>({...c,...t}),[c,t]);return Object(o.createElement)(r.Provider,{value:l,children:n})}t.b=r},ur0x:function(e,t,n){"use strict";n.d(t,"b",(function(){return r})),n.d(t,"a",(function(){return l})),n.d(t,"c",(function(){return i}));var o=n("GRId");const r={name:"",isSelected:!1},c=Object(o.createContext)(r),{Provider:l}=c;function i(){return Object(o.useContext)(c)}},v5LD:function(e,t,n){"use strict";n.d(t,"a",(function(){return d}));var o=n("YLtl"),r=n("1ZqX"),c=n("HSyU"),l=n("ur0x"),i=n("BhPs");const a=["color","border","typography","spacing"],s={"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},u={"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 d(e){const{name:t}=Object(l.c)();return Object(r.useSelect)(n=>{var r;if(a.includes(e))return void console.warn("Top level useSetting paths are disabled. Please use a subpath to query the information needed.");const l=n(i.a).getSettings(),d=(e=>u[e]||e)(e),b="__experimentalFeatures."+d,p=`__experimentalFeatures.blocks.${t}.${d}`,m=null!==(r=Object(o.get)(l,p))&&void 0!==r?r:Object(o.get)(l,b);var f,h;if(void 0!==m)return c.__EXPERIMENTAL_PATHS_WITH_MERGE[d]?null!==(f=null!==(h=m.custom)&&void 0!==h?h:m.theme)&&void 0!==f?f:m.default:m;const g=s[d]?s[d](l):void 0;return void 0!==g?g:"typography.dropCap"===d||void 0},[t,e])}},v8Ku:function(e,t){},vIlp:function(e,t,n){"use strict";function o(e,t,n){const o="top"===n||"bottom"===n,{x:r,y:c}=e,l=o?r:c,i=o?c:r,a=o?t.left:t.top,s=o?t.right:t.bottom,u=t[n];let d;return d=l>=a&&l<=s?l:l2&&void 0!==arguments[2]?arguments[2]:["top","bottom","left","right"];return c.forEach(c=>{const l=o(e,t,c);(void 0===n||lt=>{if("declaration"===t.type){const c=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]};v(e)&&o.push(e)}return o}(t.value).map((r=e,e=>({...e,newUrl:"url("+e.before+e.quote+j(e.value,r)+e.quote+e.after+")"})));return{...t,value:(n=t.value,o=c,o.forEach(e=>{n=n.replace(e.source,e.newUrl)}),n)}}var n,o,r;return t};const _=/^(body|html|:root).*$/;var y=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(_)?n.replace(/^(body|html|:root)/,e):e+" "+n;return"rule"===n.type?{...n,selectors:n.selectors.map(o)}:n}};t.a=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return Object(o.map)(e,e=>{let{css:n,baseURL:o}=e;const c=[];return t&&c.push(y(t)),o&&c.push(k(o)),c.length?O(n,Object(r.compose)(c)):n})}},vtO0:function(e,t,n){"use strict";n.d(t,"a",(function(){return j})),n.d(t,"b",(function(){return k}));var o=n("wx14"),r=n("GRId"),c=n("TSYQ"),l=n.n(c),i=n("l3Sj"),a=n("tI+e"),s=n("Tqx9");var u=Object(r.createElement)(s.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(r.createElement)(s.Path,{d:"M5 15h14V9H5v6zm0 4.8h14v-1.5H5v1.5zM5 4.2v1.5h14V4.2H5z"}));var d=Object(r.createElement)(s.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(r.createElement)(s.Path,{d:"M4 9v6h14V9H4zm8-4.8H4v1.5h8V4.2zM4 19.8h8v-1.5H4v1.5z"})),b=n("EpZT");var p=Object(r.createElement)(s.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(r.createElement)(s.Path,{d:"M6 15h14V9H6v6zm6-10.8v1.5h8V4.2h-8zm0 15.6h8v-1.5h-8v1.5z"})),m=n("beZb"),f=n("XNw2"),h=n("K/rC");const g={none:{icon:u,title:Object(i.__)("None")},left:{icon:d,title:Object(i.__)("Align left")},center:{icon:b.a,title:Object(i.__)("Align center")},right:{icon:p,title:Object(i.__)("Align right")},wide:{icon:m.a,title:Object(i.__)("Wide width")},full:{icon:f.a,title:Object(i.__)("Full width")}},O={isAlternate:!0};var v=function(e){let{value:t,onChange:n,controls:c,isToolbar:s,isCollapsed:u=!0}=e;const d=Object(h.a)(c);if(!!!d.length)return null;function b(e){n([t,"none"].includes(e)?void 0:e)}const p=g[t],m=g.none,f=s?a.ToolbarGroup:a.ToolbarDropdownMenu,v={popoverProps:O,icon:p?p.icon:m.icon,label:Object(i.__)("Align"),toggleProps:{describedBy:Object(i.__)("Change alignment")}},j=s||r.Platform.isNative?{isCollapsed:s?u:void 0,controls:d.map(e=>{let{name:n}=e;return{...g[n],isActive:t===n||!t&&"none"===n,role:u?"menuitemradio":void 0,onClick:()=>b(n)}})}:{children:e=>{let{onClose:n}=e;return Object(r.createElement)(r.Fragment,null,Object(r.createElement)(a.MenuGroup,{className:"block-editor-block-alignment-control__menu-group"},d.map(e=>{let{name:o,info:c}=e;const{icon:i,title:s}=g[o],u=o===t||!t&&"none"===o;return Object(r.createElement)(a.MenuItem,{key:o,icon:i,iconPosition:"left",className:l()("components-dropdown-menu__menu-item",{"is-active":u}),isSelected:u,onClick:()=>{b(o),n()},role:"menuitemradio",info:c},s)})))}};return Object(r.createElement)(f,Object(o.a)({},v,j))};function j(e){return Object(r.createElement)(v,Object(o.a)({},e,{isToolbar:!1}))}function k(e){return Object(r.createElement)(v,Object(o.a)({},e,{isToolbar:!0}))}},w8sn:function(e,t,n){"use strict";n.d(t,"c",(function(){return l})),n.d(t,"a",(function(){return a})),n.d(t,"d",(function(){return s})),n.d(t,"b",(function(){return u}));var o=n("wx14"),r=n("GRId"),c=n("PPMp");const l={type:"default"},i=Object(r.createContext)(l),a=i.Provider;function s(){return Object(r.useContext)(i)}function u(e){let{layout:t={},...n}=e;const l=Object(c.a)(t.type);return l?Object(r.createElement)(l.save,Object(o.a)({layout:t},n)):null}},w95h:function(e,t,n){"use strict";var o=n("GRId"),r=n("Tqx9");const c=Object(o.createElement)(r.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(o.createElement)(r.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"}));t.a=c},wC17:function(e,t,n){"use strict";n.d(t,"a",(function(){return l}));var o=n("1ZqX"),r=n("HSyU"),c=n("BhPs");function l(e){return Object(o.useSelect)(t=>{if(!e)return null;const{getBlockName:n,getBlockAttributes:o}=t(c.a),{getBlockType:l,getActiveBlockVariation:i}=t(r.store),a=n(e),s=l(a);if(!s)return null;const u=o(e),d=i(a,u),b={title:s.title,icon:s.icon,description:s.description,anchor:null==u?void 0:u.anchor};return d?{title:d.title||s.title,icon:d.icon||s.icon,description:d.description||s.description}:b},[e])}},wJiJ:function(e,t,n){e.exports=n("1K8p")},weEX:function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var o=n("GRId"),r=n("l3Sj"),c=n("tI+e"),l=n("RxS6");function i(e){let{value:t,onChange:n}=e;const i=function(e){return void 0!==e&&""!==e}(t),a=i?t:"";return Object(o.createElement)("div",{className:"block-editor-line-height-control"},Object(o.createElement)(c.TextControl,{autoComplete:"off",onKeyDown:e=>{const{keyCode:t}=e;t!==l.ZERO||i||(e.preventDefault(),n("0"))},onChange:e=>{if(i)return void n(e);let t=e;switch(e){case"0.1":t=1.6;break;case"0":t=1.4}n(t)},label:Object(r.__)("Line height"),placeholder:1.5,step:.1,type:"number",value:a,min:0}))}},"wiT/":function(e,t,n){"use strict";var o=n("GRId"),r=n("tI+e"),c=n("GOly");t.a=function(e){let{children:t}=e;const n=Object(r.__unstableUseCompositeState)({shift:!0,wrap:"horizontal"});return Object(o.createElement)(c.a.Provider,{value:n},t)}},wx14:function(e,t,n){"use strict";function o(){return(o=Object.assign||function(e){for(var t=1;t{var o;const{getBlock:r,getBlockIndex:c,hasBlockMovingClientId:l,getBlockListSettings:i}=e(j.a),a=c(t),{name:s,attributes:u}=r(t);return{index:a,name:s,attributes:u,blockMovingMode:l(),orientation:null===(o=i(n))||void 0===o?void 0:o.orientation}},[t,n]),{index:d,name:y,attributes:E,blockMovingMode:C,orientation:S}=u,{setNavigationMode:w,removeBlock:I}=Object(s.useDispatch)(j.a),x=Object(o.useRef)(),B=Object(i.getBlockType)(y),T=Object(i.__experimentalGetAccessibleBlockLabel)(B,E,d+1,S);Object(o.useEffect)(()=>{x.current.focus(),Object(h.speak)(T)},[T]);const{hasBlockMovingClientId:P,getBlockIndex:R,getBlockRootClientId:N,getClientIdsOfDescendants:M,getSelectedBlockClientId:L,getMultiSelectedBlocksEndClientId:A,getPreviousBlockClientId:D,getNextBlockClientId:F,isNavigationMode:z}=Object(s.useSelect)(j.a),{selectBlock:H,clearSelectedBlock:V,setBlockMovingClientId:G,moveBlockToPosition:U}=Object(s.useDispatch)(j.a),W=l()("block-editor-block-list__block-selection-button",{"is-block-moving-mode":!!C}),q=Object(g.__)("Drag");return Object(o.createElement)("div",{className:W},Object(o.createElement)(a.Flex,{justify:"center",className:"block-editor-block-list__block-selection-button__content"},Object(o.createElement)(a.FlexItem,null,Object(o.createElement)(v.a,{icon:null==c?void 0:c.icon,showColors:!0})),Object(o.createElement)(a.FlexItem,null,Object(o.createElement)(k.a,{clientIds:[t]},e=>Object(o.createElement)(a.Button,Object(p.a)({icon:m.a,className:"block-selection-button_drag-handle","aria-hidden":"true",label:q,tabIndex:"-1"},e)))),Object(o.createElement)(a.FlexItem,null,Object(o.createElement)(a.Button,{ref:x,onClick:()=>w(!1),onKeyDown:function(e){const{keyCode:n}=e,o=n===f.UP,c=n===f.DOWN,l=n===f.LEFT,i=n===f.RIGHT,a=n===f.TAB,s=n===f.ESCAPE,u=n===f.ENTER,d=n===f.SPACE,p=e.shiftKey;if(n===f.BACKSPACE||n===f.DELETE)return I(t),void e.preventDefault();const m=L(),h=A(),g=D(h||m),O=F(h||m),v=a&&p||o,j=a&&!p||c,k=l,_=i;let y;if(v)y=g;else if(j)y=O;else if(k){var E;y=null!==(E=N(m))&&void 0!==E?E:m}else if(_){var C;y=null!==(C=M([m])[0])&&void 0!==C?C:m}const S=P();if(s&&z()&&(V(),e.preventDefault()),s&&S&&!e.defaultPrevented&&(G(null),e.preventDefault()),(u||d)&&S){const e=N(S),t=N(m),n=R(S);let o=R(m);n{const{isBlockInsertionPointVisible:n,getBlockInsertionPoint:o,getBlockOrder:r}=e(j.a);if(!n())return!1;const c=o();return r(c.rootClientId)[c.index]===t},[t]),B=Object(d.useViewportMatch)("medium"),[T,P]=Object(o.useState)(!1),[R,N]=Object(o.useState)(!1),{stopTyping:M}=Object(s.useDispatch)(j.a),L=!g&&!f&&c&&r,A=f,D=!f&&!k&&B&&!L&&!h&&(!g||O),F=!(f||D||k||c);Object(u.useShortcut)("core/block-editor/focus-toolbar",()=>{P(!0),M(!0)},{isDisabled:!F}),Object(o.useEffect)(()=>{D||P(!1)},[D]);const z=Object(o.useRef)(),H=Object(S.a)(t),V=Object(S.a)(_),G=Object(S.a)(i),U=Object(w.a)(m);if(!(A||D||T||L))return null;let W=H;if(!W)return null;i&&(W=G);let q=W;if(v){if(!V)return null;q={top:W,bottom:V}}const K=L?"top left right":"top right left",{ownerDocument:Y}=W,$=L?void 0:Y.defaultView.frameElement||Object(b.getScrollContainer)(W)||Y.body;return Object(o.createElement)(a.Popover,{ref:U,noArrow:!0,animate:!1,position:K,focusOnMount:!1,anchorRef:q,className:l()("block-editor-block-list__block-popover",{"is-insertion-point-visible":x}),__unstableStickyBoundaryElement:$,__unstableSlotName:p||null,__unstableBoundaryParent:!0,__unstableObserveElement:W,shouldAnchorIncludePadding:!0,__unstableEditorCanvasWrapper:null==m?void 0:m.current},(D||T)&&Object(o.createElement)("div",{onFocus:function(){N(!0)},onBlur:function(){N(!1)},tabIndex:-1,className:l()("block-editor-block-list__block-popover-inserter",{"is-visible":R})},Object(o.createElement)(C.a,{clientId:t,rootClientId:n,__experimentalIsQuick:!0})),(D||T)&&Object(o.createElement)(E.a,{focusOnMount:T,__experimentalInitialIndex:z.current,__experimentalOnIndexChange:e=>{z.current=e},key:t}),A&&Object(o.createElement)(y,{clientId:t,rootClientId:n,blockElement:W}),L&&Object(o.createElement)("div",{className:"block-editor-block-list__empty-block-inserter"},Object(o.createElement)(C.a,{position:"bottom right",rootClientId:n,clientId:t,__experimentalIsQuick:!0})))}function B(e){const{getSelectedBlockClientId:t,getFirstMultiSelectedBlockClientId:n,getBlockRootClientId:o,getBlock:c,getBlockParents:l,__experimentalGetBlockListSettingsForBlocks:a}=e(j.a),s=t()||n();if(!s)return;const{name:u,attributes:d={},isValid:b}=c(s)||{},p=l(s),m=a(p),f=Object(r.find)(p,e=>{var t;return null===(t=m[e])||void 0===t?void 0:t.__experimentalCaptureToolbars});return{clientId:s,rootClientId:o(s),name:u,isValid:b,isEmptyDefaultBlock:u&&Object(i.isUnmodifiedDefaultBlock)({name:u,attributes:d}),capturingClientId:f}}function T(e){let{__unstablePopoverSlot:t,__unstableContentRef:n}=e;const r=Object(s.useSelect)(B,[]);if(!r)return null;const{clientId:c,rootClientId:l,name:i,isValid:a,isEmptyDefaultBlock:u,capturingClientId:d}=r;return i?Object(o.createElement)(x,{clientId:c,rootClientId:l,isValid:a,isEmptyDefaultBlock:u,capturingClientId:d,__unstablePopoverSlot:t,__unstableContentRef:n}):null}},"xN+R":function(e,t,n){"use strict";var o=n("GRId"),r=n("Tqx9");const c=Object(o.createElement)(r.SVG,{width:"18",height:"18",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 18 18"},Object(o.createElement)(r.Path,{d:"M5 4h2V2H5v2zm6-2v2h2V2h-2zm-6 8h2V8H5v2zm6 0h2V8h-2v2zm-6 6h2v-2H5v2zm6 0h2v-2h-2v2z"}));t.a=c},xTGt:function(e,t){e.exports=window.wp.blob},xZzQ:function(e,t,n){"use strict";var o=n("GRId"),r=n("tI+e"),c=n("l3Sj"),l=n("1ZqX");const i=[Object(o.createInterpolateElement)(Object(c.__)("While writing, you can press / to quickly insert new blocks."),{kbd:Object(o.createElement)("kbd",null)}),Object(o.createInterpolateElement)(Object(c.__)("Indent a list by pressing space at the beginning of a line."),{kbd:Object(o.createElement)("kbd",null)}),Object(o.createInterpolateElement)(Object(c.__)("Outdent a list by pressing backspace at the beginning of a line."),{kbd:Object(o.createElement)("kbd",null)}),Object(c.__)("Drag files into the editor to automatically insert media blocks."),Object(c.__)("Change a block's type by pressing the block icon on the toolbar.")];var a=function(){const[e]=Object(o.useState)(Math.floor(Math.random()*i.length));return Object(o.createElement)(r.Tip,null,i[e])},s=n("HSyU"),u=n("GvwK"),d=n("REKd");var b=function(e){var t,n;let{item:r}=e;const{name:l,title:i,icon:a,description:b,initialAttributes:p}=r,m=Object(s.getBlockType)(l),f=Object(s.isReusableBlock)(r);return Object(o.createElement)("div",{className:"block-editor-inserter__preview-container"},Object(o.createElement)("div",{className:"block-editor-inserter__preview"},f||null!=m&&m.example?Object(o.createElement)("div",{className:"block-editor-inserter__preview-content"},Object(o.createElement)(d.a,{__experimentalPadding:16,viewportWidth:null!==(t=null===(n=m.example)||void 0===n?void 0:n.viewportWidth)&&void 0!==t?t:500,blocks:m.example?Object(s.getBlockFromExample)(r.name,{attributes:{...m.example.attributes,...p},innerBlocks:m.example.innerBlocks}):Object(s.createBlock)(l,p)})):Object(o.createElement)("div",{className:"block-editor-inserter__preview-content-missing"},Object(c.__)("No Preview Available."))),!f&&Object(o.createElement)(u.a,{title:i,icon:a,description:b}))},p=n("YLtl"),m=n("K9lf"),f=n("6ZVF"),h=n("mdLt"),g=n("+G0a"),O=n("wiT/");const v=[];var j=function(e){let{rootClientId:t,onInsert:n,onHover:r,showMostUsedBlocks:l}=e;const[i,a,s,u]=Object(g.a)(t,n),d=Object(o.useMemo)(()=>Object(p.orderBy)(i,["frecency"],["desc"]).slice(0,6),[i]),b=Object(o.useMemo)(()=>i.filter(e=>!e.category),[i]),j=Object(o.useMemo)(()=>Object(p.flow)(e=>e.filter(e=>e.category&&"reusable"!==e.category),e=>Object(p.groupBy)(e,"category"))(i),[i]),k=Object(o.useMemo)(()=>{const e={...s};return Object.keys(s).forEach(t=>{e[t]=i.filter(e=>(e=>e.name.split("/")[0])(e)===t),0===e[t].length&&delete e[t]}),e},[i,s]);Object(o.useEffect)(()=>()=>r(null),[]);const _=Object(m.useAsyncList)(a),y=a.length===_.length,E=Object(o.useMemo)(()=>Object.entries(s),[s]),C=Object(m.useAsyncList)(y?E:v);return Object(o.createElement)(O.a,null,Object(o.createElement)("div",null,l&&!!d.length&&Object(o.createElement)(h.a,{title:Object(c._x)("Most used","blocks")},Object(o.createElement)(f.a,{items:d,onSelect:u,onHover:r,label:Object(c._x)("Most used","blocks")})),Object(p.map)(_,e=>{const t=j[e.slug];return t&&t.length?Object(o.createElement)(h.a,{key:e.slug,title:e.title,icon:e.icon},Object(o.createElement)(f.a,{items:t,onSelect:u,onHover:r,label:e.title})):null}),y&&b.length>0&&Object(o.createElement)(h.a,{className:"block-editor-inserter__uncategorized-blocks-panel",title:Object(c.__)("Uncategorized")},Object(o.createElement)(f.a,{items:b,onSelect:u,onHover:r,label:Object(c.__)("Uncategorized")})),Object(p.map)(C,e=>{let[t,n]=e;const c=k[t];return c&&c.length?Object(o.createElement)(h.a,{key:t,title:n.title,icon:n.icon},Object(o.createElement)(f.a,{items:c,onSelect:u,onHover:r,label:n.title})):null})))},k=n("TSYQ"),_=n.n(k);var y=function(e){let{selectedCategory:t,patternCategories:n,onClickCategory:l,openPatternExplorer:i}=e;const a=Object(m.useViewportMatch)("medium","<"),s=_()("block-editor-inserter__panel-header","block-editor-inserter__panel-header-patterns");return Object(o.createElement)(r.Flex,{justify:"space-between",align:"start",gap:"4",className:s},Object(o.createElement)(r.FlexItem,{isBlock:!0},Object(o.createElement)(r.SelectControl,{className:"block-editor-inserter__panel-dropdown",label:Object(c.__)("Filter patterns"),hideLabelFromVision:!0,value:t.name,onChange:e=>{l(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})()})),!a&&Object(o.createElement)(r.FlexItem,null,Object(o.createElement)(r.Button,{variant:"secondary",className:"block-editor-inserter__patterns-explorer-expand",label:Object(c.__)("Explore all patterns"),onClick:()=>i()},Object(c._x)("Explore","Label for showing all block patterns"))))},E=n("nQUx"),C=n("Fmc1");function S(e){let{selectedCategory:t,patternCategories:n,onClickCategory:c}=e;const l="block-editor-block-patterns-explorer__sidebar";return Object(o.createElement)("div",{className:l+"__categories-list"},n.map(e=>{let{name:n,label:i}=e;return Object(o.createElement)(r.Button,{key:n,label:i,className:l+"__categories-list__item",isPressed:t===n,onClick:()=>{c(n)}},i)}))}function w(e){let{filterValue:t,setFilterValue:n}=e;return Object(o.createElement)("div",{className:"block-editor-block-patterns-explorer__search"},Object(o.createElement)(r.SearchControl,{onChange:n,value:t,label:Object(c.__)("Search for patterns"),placeholder:Object(c.__)("Search")}))}var I=function(e){let{selectedCategory:t,patternCategories:n,onClickCategory:r,filterValue:c,setFilterValue:l}=e;return Object(o.createElement)("div",{className:"block-editor-block-patterns-explorer__sidebar"},Object(o.createElement)(w,{filterValue:c,setFilterValue:l}),!c&&Object(o.createElement)(S,{selectedCategory:t,patternCategories:n,onClickCategory:r}))},x=n("gdqT"),B=n("LolH"),T=n("AORF"),P=n("pOGT");function R(e){let{filterValue:t,filteredBlockPatternsLength:n}=e;return t?Object(o.createElement)(r.__experimentalHeading,{level:2,lineHeight:"48px",className:"block-editor-block-patterns-explorer__search-results-count"},Object(c.sprintf)(Object(c._n)('%1$d pattern found for "%2$s"','%1$d patterns found for "%2$s"',n),n,t)):null}var N=function(e){let{filterValue:t,selectedCategory:n,patternCategories:r}=e;const l=Object(m.useDebounce)(x.speak,500),[i,a]=Object(T.a)({shouldFocusBlock:!0}),[s,,u]=Object(E.a)(a,i),d=Object(o.useMemo)(()=>r.map(e=>e.name),[r]),b=Object(o.useMemo)(()=>t?Object(P.b)(s,t):s.filter(e=>{var t,o;return"uncategorized"===n?!(null!==(t=e.categories)&&void 0!==t&&t.length)||e.categories.every(e=>!d.includes(e)):null===(o=e.categories)||void 0===o?void 0:o.includes(n)}),[t,n,s]);Object(o.useEffect)(()=>{if(!t)return;const e=b.length,n=Object(c.sprintf)(Object(c._n)("%d result found.","%d results found.",e),e);l(n)},[t,l]);const p=Object(m.useAsyncList)(b,{step:2}),f=!(null==b||!b.length);return Object(o.createElement)("div",{className:"block-editor-block-patterns-explorer__list"},f&&Object(o.createElement)(R,{filterValue:t,filteredBlockPatternsLength:b.length}),Object(o.createElement)(O.a,null,!f&&Object(o.createElement)(B.a,null),f&&Object(o.createElement)(C.a,{shownPatterns:p,blockPatterns:b,onClickPattern:u,isDraggable:!1})))};function M(e){let{initialCategory:t,patternCategories:n}=e;const[r,c]=Object(o.useState)(""),[l,i]=Object(o.useState)(null==t?void 0:t.name);return Object(o.createElement)("div",{className:"block-editor-block-patterns-explorer"},Object(o.createElement)(I,{selectedCategory:l,patternCategories:n,onClickCategory:i,filterValue:r,setFilterValue:c}),Object(o.createElement)(N,{filterValue:r,selectedCategory:l,patternCategories:n}))}var L=function(e){let{onModalClose:t,...n}=e;return Object(o.createElement)(r.Modal,{title:Object(c.__)("Patterns"),closeLabel:Object(c.__)("Close"),onRequestClose:t,isFullScreen:!0},Object(o.createElement)(M,n))};function A(e){let{rootClientId:t,onInsert:n,selectedCategory:r,populatedCategories:c}=e;const[l,,i]=Object(E.a)(n,t),a=Object(o.useCallback)(e=>{var t;if(null===(t=e.categories)||void 0===t||!t.length)return 1/0;const n=c.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))},[c]),s=Object(o.useMemo)(()=>l.filter(e=>{var t;return"uncategorized"===r.name?a(e)===1/0:null===(t=e.categories)||void 0===t?void 0:t.includes(r.name)}),[l,r]),u=Object(o.useMemo)(()=>s.sort((e,t)=>a(e)-a(t)),[s,a]),d=Object(m.useAsyncList)(u);return s.length?Object(o.createElement)("div",{className:"block-editor-inserter__panel-content"},Object(o.createElement)(C.a,{shownPatterns:d,blockPatterns:s,onClickPattern:i,label:r.label,orientation:"vertical",isDraggable:!0})):null}var D=function(e){let{rootClientId:t,onInsert:n,onClickCategory:r,selectedCategory:l}=e;const[i,a]=Object(o.useState)(!1),[s,u]=Object(E.a)(),d=Object(o.useCallback)(e=>!(!e.categories||!e.categories.length)&&e.categories.some(e=>u.some(t=>t.name===e)),[u]),b=Object(o.useMemo)(()=>{const e=u.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=>!d(e))&&!e.find(e=>"uncategorized"===e.name)&&e.push({name:"uncategorized",label:Object(c._x)("Uncategorized")}),e},[s,u]),p=l||b[0];return Object(o.createElement)(o.Fragment,null,!i&&Object(o.createElement)(o.Fragment,null,Object(o.createElement)(y,{selectedCategory:p,patternCategories:b,onClickCategory:r,openPatternExplorer:()=>a(!0)}),Object(o.createElement)(A,{rootClientId:t,onInsert:n,selectedCategory:p,populatedCategories:b})),i&&Object(o.createElement)(L,{initialCategory:p,patternCategories:b,onModalClose:()=>a(!1)}))},F=n("Mmq9");function z(e){let{onHover:t,onInsert:n,rootClientId:r}=e;const[l,,,i]=Object(g.a)(r,n),a=Object(o.useMemo)(()=>l.filter(e=>{let{category:t}=e;return"reusable"===t}),[l]);return 0===a.length?Object(o.createElement)(B.a,null):Object(o.createElement)(h.a,{title:Object(c.__)("Reusable blocks")},Object(o.createElement)(f.a,{items:a,onSelect:i,onHover:t,label:Object(c.__)("Reusable blocks")}))}var H=function(e){let{rootClientId:t,onInsert:n,onHover:r}=e;return Object(o.createElement)(o.Fragment,null,Object(o.createElement)(z,{onHover:r,onInsert:n,rootClientId:t}),Object(o.createElement)("div",{className:"block-editor-inserter__manage-reusable-blocks-container"},Object(o.createElement)("a",{className:"block-editor-inserter__manage-reusable-blocks",href:Object(F.addQueryArgs)("edit.php",{post_type:"wp_block"})},Object(c.__)("Manage Reusable blocks"))))},V=n("Wg7J");const G={name:"blocks",title:Object(c.__)("Blocks")},U={name:"patterns",title:Object(c.__)("Patterns")},W={name:"reusable",title:Object(c.__)("Reusable")};var q=function(e){let{children:t,showPatterns:n=!1,showReusableBlocks:c=!1,onSelect:l}=e;const i=Object(o.useMemo)(()=>{const e=[G];return n&&e.push(U),c&&e.push(W),e},[G,n,U,c,W]);return Object(o.createElement)(r.TabPanel,{className:"block-editor-inserter__tabs",tabs:i,onSelect:l},t)},K=n("BhPs");t.a=function(e){let{rootClientId:t,clientId:n,isAppender:i,__experimentalInsertionIndex:s,onSelect:u,showInserterHelpPanel:d,showMostUsedBlocks:p,__experimentalFilterValue:m="",shouldFocusBlock:f=!0}=e;const[h,g]=Object(o.useState)(m),[O,v]=Object(o.useState)(null),[k,_]=Object(o.useState)(null),[y,E,C]=Object(T.a)({rootClientId:t,clientId:n,isAppender:i,insertionIndex:s,shouldFocusBlock:f}),{showPatterns:S,hasReusableBlocks:w}=Object(l.useSelect)(e=>{var t;const{__experimentalGetAllowedPatterns:n,getSettings:o}=e(K.a);return{showPatterns:!!n(y).length,hasReusableBlocks:!(null===(t=o().__experimentalReusableBlocks)||void 0===t||!t.length)}},[y]),I=Object(o.useCallback)((e,t,n)=>{E(e,t,n),u()},[E,u]),x=Object(o.useCallback)((e,t)=>{E(e,{patternName:t}),u()},[E,u]),B=Object(o.useCallback)(e=>{C(!!e),v(e)},[C,v]),P=Object(o.useCallback)(e=>{_(e)},[_]),R=Object(o.useMemo)(()=>Object(o.createElement)(o.Fragment,null,Object(o.createElement)("div",{className:"block-editor-inserter__block-list"},Object(o.createElement)(j,{rootClientId:y,onInsert:I,onHover:B,showMostUsedBlocks:p})),d&&Object(o.createElement)("div",{className:"block-editor-inserter__tips"},Object(o.createElement)(r.VisuallyHidden,{as:"h2"},Object(c.__)("A tip for using the block editor")),Object(o.createElement)(a,null))),[y,I,B,h,p,d]),N=Object(o.useMemo)(()=>Object(o.createElement)(D,{rootClientId:y,onInsert:x,onClickCategory:P,selectedCategory:k}),[y,x,P,k]),M=Object(o.useMemo)(()=>Object(o.createElement)(H,{rootClientId:y,onInsert:I,onHover:B}),[y,I,B]),L=Object(o.useCallback)(e=>"blocks"===e.name?R:"patterns"===e.name?N:M,[R,N,M]);return Object(o.createElement)("div",{className:"block-editor-inserter__menu"},Object(o.createElement)("div",{className:"block-editor-inserter__main-area"},Object(o.createElement)("div",{className:"block-editor-inserter__content"},Object(o.createElement)(r.SearchControl,{className:"block-editor-inserter__search",onChange:e=>{O&&v(null),g(e)},value:h,label:Object(c.__)("Search for blocks and patterns"),placeholder:Object(c.__)("Search")}),!!h&&Object(o.createElement)(V.a,{filterValue:h,onSelect:u,onHover:B,rootClientId:t,clientId:n,isAppender:i,__experimentalInsertionIndex:s,showBlockDirectory:!0,shouldFocusBlock:f}),!h&&(S||w)&&Object(o.createElement)(q,{showPatterns:S,showReusableBlocks:w},L),!h&&!S&&!w&&R)),d&&O&&Object(o.createElement)(b,{item:O}))}},xkPd:function(e,t,n){"use strict";var o=n("wx14"),r=n("GRId"),c=n("l3Sj"),l=n("gdqT");t.a=Object(r.forwardRef)((function(e,t){const[n,i]=Object(r.useState)(!1);return Object(r.useEffect)(()=>{n&&Object(l.speak)(Object(c.__)("Use left and right arrow keys to move through blocks"))},[n]),Object(r.createElement)("div",Object(o.a)({ref:t,role:"listbox","aria-orientation":"horizontal",onFocus:()=>{i(!0)},onBlur:e=>{!e.currentTarget.contains(e.relatedTarget)&&i(!1)}},e))}))},yU1v:function(e,t,n){"use strict";var o=n("wx14"),r=n("GRId"),c=n("TSYQ"),l=n.n(c),i=n("YLtl"),a=n("tI+e"),s=n("l3Sj"),u=n("dchM"),d=n("bVpQ"),b=n("Cn0l"),p=n("v5LD"),m=n("pY5h"),f=n("0LBR");const h=Object(s.__)("(%s: color %s)"),g=Object(s.__)("(%s: gradient %s)"),O=["colors","disableCustomColors","gradients","disableCustomGradients"],v=e=>{let{colors:t,gradients:n,settings:o}=e;return o.map((e,o)=>{let c,{colorValue:l,gradientValue:i,label:u,colors:p,gradients:m}=e;if(!l&&!i)return null;if(l){const e=Object(d.c)(p||t,l);c=Object(s.sprintf)(h,u.toLowerCase(),e&&e.name||l)}else{const e=Object(b.b)(m||n,l);c=Object(s.sprintf)(g,u.toLowerCase(),e&&e.name||i)}return Object(r.createElement)(a.ColorIndicator,{key:o,colorValue:l||i,"aria-label":c})})},j=e=>{let{className:t,colors:n,gradients:c,disableCustomColors:s,disableCustomGradients:d,children:b,settings:p,title:m,showTitle:f=!0,__experimentalHasMultipleOrigins:h,__experimentalIsRenderedInSidebar:g,enableAlpha:O,...j}=e;if(Object(i.isEmpty)(n)&&Object(i.isEmpty)(c)&&s&&d&&Object(i.every)(p,e=>Object(i.isEmpty)(e.colors)&&Object(i.isEmpty)(e.gradients)&&(void 0===e.disableCustomColors||e.disableCustomColors)&&(void 0===e.disableCustomGradients||e.disableCustomGradients)))return null;const k=Object(r.createElement)("span",{className:"block-editor-panel-color-gradient-settings__panel-title"},m,Object(r.createElement)(v,{colors:n,gradients:c,settings:p}));return Object(r.createElement)(a.PanelBody,Object(o.a)({className:l()("block-editor-panel-color-gradient-settings",t),title:f?k:void 0},j),Object(r.createElement)(u.a,{settings:p,colors:n,gradients:c,disableCustomColors:s,disableCustomGradients:d,__experimentalHasMultipleOrigins:h,__experimentalIsRenderedInSidebar:g,enableAlpha:O}),!!b&&Object(r.createElement)(r.Fragment,null,Object(r.createElement)(a.__experimentalSpacer,{marginY:4})," ",b))},k=e=>{const t=Object(m.a)();return t.colors=Object(p.a)("color.palette"),t.gradients=Object(p.a)("color.gradients"),Object(r.createElement)(j,Object(o.a)({},t,e))},_=e=>{const t=Object(f.a)();return Object(r.createElement)(j,Object(o.a)({},t,e))};t.a=e=>Object(i.every)(O,t=>e.hasOwnProperty(t))?Object(r.createElement)(j,e):e.__experimentalHasMultipleOrigins?Object(r.createElement)(_,e):Object(r.createElement)(k,e)},ywyh:function(e,t){e.exports=window.wp.apiFetch},"z+q2":function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var o=n("YLtl"),r=n("GRId"),c=n("1CF3"),l=n("1ZqX"),i=n("OL6h"),a=n("BhPs");function s(e){const t=Object(r.useRef)(),n=function(e){return Object(l.useSelect)(t=>{const{getSelectedBlocksInitialCaretPosition:n,isMultiSelecting:o,isNavigationMode:r,isBlockSelected:c}=t(a.a);if(c(e)&&!o()&&!r())return n()},[e])}(e);return Object(r.useEffect)(()=>{if(null==n)return;if(!t.current)return;const{ownerDocument:e}=t.current;if(t.current.contains(e.activeElement))return;const r=c.focus.tabbable.find(t.current).filter(e=>Object(c.isTextField)(e)),l=-1===n,a=(l?o.last:o.first)(r)||t.current;Object(i.c)(t.current,a)?Object(c.placeCaretAtHorizontalEdge)(a,l):t.current.focus()},[n]),t}},zQI6:function(e,t,n){"use strict";n.d(t,"b",(function(){return a})),n.d(t,"a",(function(){return s}));var o=n("wx14"),r=n("GRId"),c=n("1ZqX"),l=n("K9lf"),i=n("BhPs");function a(){const{hasSelectedBlock:e,hasMultiSelection:t}=Object(c.useSelect)(i.a),{clearSelectedBlock:n}=Object(c.useDispatch)(i.a);return Object(l.useRefEffect)(o=>{function r(r){(e()||t())&&r.target===o&&n()}return o.addEventListener("mousedown",r),()=>{o.removeEventListener("mousedown",r)}},[e,t,n])}function s(e){return Object(r.createElement)("div",Object(o.a)({ref:a()},e))}},ziDm:function(e,t,n){"use strict";var o=n("GRId"),r=n("Tqx9");const c=Object(o.createElement)(r.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(o.createElement)(r.Path,{d:"M11.1 19.8H20v-1.5h-8.9v1.5zm0-15.6v1.5H20V4.2h-8.9zM4 12.8h16v-1.5H4v1.5z"}));t.a=c},zmSX:function(e,t,n){"use strict";var o=n("Cn0l");n.d(t,"a",(function(){return o.a})),n.d(t,"b",(function(){return o.b})),n.d(t,"c",(function(){return o.c})),n.d(t,"d",(function(){return o.d})),n.d(t,"e",(function(){return o.e}))},zt9T:function(e,t,n){"use strict";var o=n("jB5C");e.exports=function(e,t,n){n=n||{},9===t.nodeType&&(t=o.getWindow(t));var r=n.allowHorizontalScroll,c=n.onlyScrollIfNeeded,l=n.alignWithTop,i=n.alignWithLeft,a=n.offsetTop||0,s=n.offsetLeft||0,u=n.offsetBottom||0,d=n.offsetRight||0;r=void 0===r||r;var b=o.isWindow(t),p=o.offset(e),m=o.outerHeight(e),f=o.outerWidth(e),h=void 0,g=void 0,O=void 0,v=void 0,j=void 0,k=void 0,_=void 0,y=void 0,E=void 0,C=void 0;b?(_=t,C=o.height(_),E=o.width(_),y={left:o.scrollLeft(_),top:o.scrollTop(_)},j={left:p.left-y.left-s,top:p.top-y.top-a},k={left:p.left+f-(y.left+E)+d,top:p.top+m-(y.top+C)+u},v=y):(h=o.offset(t),g=t.clientHeight,O=t.clientWidth,v={left:t.scrollLeft,top:t.scrollTop},j={left:p.left-(h.left+(parseFloat(o.css(t,"borderLeftWidth"))||0))-s,top:p.top-(h.top+(parseFloat(o.css(t,"borderTopWidth"))||0))-a},k={left:p.left+f-(h.left+O+(parseFloat(o.css(t,"borderRightWidth"))||0))+d,top:p.top+m-(h.top+g+(parseFloat(o.css(t,"borderBottomWidth"))||0))+u}),j.top<0||k.top>0?!0===l?o.scrollTop(t,v.top+j.top):!1===l?o.scrollTop(t,v.top+k.top):j.top<0?o.scrollTop(t,v.top+j.top):o.scrollTop(t,v.top+k.top):c||((l=void 0===l||!!l)?o.scrollTop(t,v.top+j.top):o.scrollTop(t,v.top+k.top)),r&&(j.left<0||k.left>0?!0===i?o.scrollLeft(t,v.left+j.left):!1===i?o.scrollLeft(t,v.left+k.left):j.left<0?o.scrollLeft(t,v.left+j.left):o.scrollLeft(t,v.left+k.left):c||((i=void 0===i||!!i)?o.scrollLeft(t,v.left+j.left):o.scrollLeft(t,v.left+k.left)))}}}); \ No newline at end of file + */,e.exports=function(e,t){if(!r.canUseDOM||t&&!("addEventListener"in document))return!1;var n="on"+e,c=n in document;if(!c){var l=document.createElement("div");l.setAttribute(n,"return;"),c="function"==typeof l[n]}return!c&&o&&"wheel"===e&&(c=document.implementation.hasFeature("Events.wheel","3.0")),c}},f8JO:function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var o=n("YLtl"),r=n("1ZqX"),c=n("HSyU"),l=n("wC17"),i=n("BhPs");function a(e){let{clientId:t}=e;const{attributes:n,name:a,reusableBlockTitle:s}=Object(r.useSelect)(e=>{if(!t)return{};const{getBlockName:n,getBlockAttributes:o,__experimentalGetReusableBlockTitle:r}=e(i.a),l=n(t);if(!l)return{};const a=Object(c.isReusableBlock)(Object(c.getBlockType)(l));return{attributes:o(t),name:l,reusableBlockTitle:a&&r(o(t).ref)}},[t]),u=Object(l.a)(t);if(!a||!u)return null;const d=Object(c.getBlockType)(a),b=d?Object(c.__experimentalGetBlockLabel)(d,n):null,p=s||b;return p&&p!==d.title?Object(o.truncate)(p,{length:35}):u.title}},fHnH:function(e,t,n){"use strict";n.d(t,"a",(function(){return x})),n.d(t,"b",(function(){return T}));var o={grad:.9,turn:360,rad:360/(2*Math.PI)},r=function(e){return"string"==typeof e?e.length>0:"number"==typeof e},c=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=Math.pow(10,t)),Math.round(n*e)/n+0},l=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=1),e>n?n:e>t?e:t},i=function(e){return(e=isFinite(e)?e%360:0)>0?e:e+360},a=function(e){return{r:l(e.r,0,255),g:l(e.g,0,255),b:l(e.b,0,255),a:l(e.a)}},s=function(e){return{r:c(e.r),g:c(e.g),b:c(e.b),a:c(e.a,3)}},u=/^#([0-9a-f]{3,8})$/i,d=function(e){var t=e.toString(16);return t.length<2?"0"+t:t},b=function(e){var t=e.r,n=e.g,o=e.b,r=e.a,c=Math.max(t,n,o),l=c-Math.min(t,n,o),i=l?c===t?(n-o)/l:c===n?2+(o-t)/l:4+(t-n)/l:0;return{h:60*(i<0?i+6:i),s:c?l/c*100:0,v:c/255*100,a:r}},p=function(e){var t=e.h,n=e.s,o=e.v,r=e.a;t=t/360*6,n/=100,o/=100;var c=Math.floor(t),l=o*(1-n),i=o*(1-(t-c)*n),a=o*(1-(1-t+c)*n),s=c%6;return{r:255*[o,i,l,l,a,o][s],g:255*[a,o,o,i,l,l][s],b:255*[l,l,a,o,o,i][s],a:r}},m=function(e){return{h:i(e.h),s:l(e.s,0,100),l:l(e.l,0,100),a:l(e.a)}},f=function(e){return{h:c(e.h),s:c(e.s),l:c(e.l),a:c(e.a,3)}},h=function(e){return p((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},g=function(e){return{h:(t=b(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},O=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,v=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,j=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,k=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,_={string:[[function(e){var t=u.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?c(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?c(parseInt(e.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(e){var t=j.exec(e)||k.exec(e);return t?t[2]!==t[4]||t[4]!==t[6]?null:a({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=O.exec(e)||v.exec(e);if(!t)return null;var n,r,c=m({h:(n=t[1],r=t[2],void 0===r&&(r="deg"),Number(n)*(o[r]||1)),s:Number(t[3]),l:Number(t[4]),a:void 0===t[5]?1:Number(t[5])/(t[6]?100:1)});return h(c)},"hsl"]],object:[[function(e){var t=e.r,n=e.g,o=e.b,c=e.a,l=void 0===c?1:c;return r(t)&&r(n)&&r(o)?a({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,c=e.a,l=void 0===c?1:c;if(!r(t)||!r(n)||!r(o))return null;var i=m({h:Number(t),s:Number(n),l:Number(o),a:Number(l)});return h(i)},"hsl"],[function(e){var t=e.h,n=e.s,o=e.v,c=e.a,a=void 0===c?1:c;if(!r(t)||!r(n)||!r(o))return null;var s=function(e){return{h:i(e.h),s:l(e.s,0,100),v:l(e.v,0,100),a:l(e.a)}}({h:Number(t),s:Number(n),v:Number(o),a:Number(a)});return p(s)},"hsv"]]},y=function(e,t){for(var n=0;n=.5},e.prototype.toHex=function(){return t=(e=s(this.rgba)).r,n=e.g,o=e.b,l=(r=e.a)<1?d(c(255*r)):"","#"+d(t)+d(n)+d(o)+l;var e,t,n,o,r,l},e.prototype.toRgb=function(){return s(this.rgba)},e.prototype.toRgbString=function(){return t=(e=s(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 f(g(this.rgba))},e.prototype.toHslString=function(){return t=(e=f(g(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=b(this.rgba),{h:c(e.h),s:c(e.s),v:c(e.v),a:c(e.a,3)};var e},e.prototype.invert=function(){return x({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),x(C(this.rgba,e))},e.prototype.desaturate=function(e){return void 0===e&&(e=.1),x(C(this.rgba,-e))},e.prototype.grayscale=function(){return x(C(this.rgba,-1))},e.prototype.lighten=function(e){return void 0===e&&(e=.1),x(w(this.rgba,e))},e.prototype.darken=function(e){return void 0===e&&(e=.1),x(w(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?x({r:(t=this.rgba).r,g:t.g,b:t.b,a:e}):c(this.rgba.a,3);var t},e.prototype.hue=function(e){var t=g(this.rgba);return"number"==typeof e?x({h:e,s:t.s,l:t.l,a:t.a}):c(t.h)},e.prototype.isEqual=function(e){return this.toHex()===x(e).toHex()},e}(),x=function(e){return e instanceof I?e:new I(e)},B=[],T=function(e){e.forEach((function(e){B.indexOf(e)<0&&(e(I,_),B.push(e))}))}},fOYa:function(e,t,n){"use strict";n.d(t,"a",(function(){return h}));var o=n("wx14"),r=n("GRId"),c=n("YLtl"),l=n("tI+e"),i=n("HSyU"),a=n("1ZqX");var s={default:Object(l.createSlotFill)("BlockControls"),block:Object(l.createSlotFill)("BlockControlsBlock"),inline:Object(l.createSlotFill)("BlockFormatControls"),other:Object(l.createSlotFill)("BlockControlsOther"),parent:Object(l.createSlotFill)("BlockControlsParent")},u=n("BhPs"),d=n("ur0x"),b=n("HgtZ");function p(e){let{group:t="default",controls:n,children:o,__experimentalShareWithChildBlocks:p=!1}=e;const m=function(e,t){const n=Object(b.a)(),{clientId:o}=Object(d.c)(),r=Object(a.useSelect)(e=>{const{getBlockName:n,hasSelectedInnerBlock:r}=e(u.a),{hasBlockSupport:c}=e(i.store);return t&&c(n(o),"__experimentalExposeControlsToChildren",!1)&&r(o)},[t,o]);var c;return n?null===(c=s[e])||void 0===c?void 0:c.Fill:r?s.parent.Fill:null}(t,p);return m?Object(r.createElement)(l.__experimentalStyleProvider,{document:document},Object(r.createElement)(m,null,e=>{const i=Object(c.isEmpty)(e)?null:e;return Object(r.createElement)(l.__experimentalToolbarContext.Provider,{value:i},"default"===t&&Object(r.createElement)(l.ToolbarGroup,{controls:n}),o)})):null}function m(e){let{group:t="default",...n}=e;const c=Object(r.useContext)(l.__experimentalToolbarContext),i=s[t].Slot,a=Object(l.__experimentalUseSlot)(i.__unstableName);return Boolean(a.fills&&a.fills.length)?"default"===t?Object(r.createElement)(i,Object(o.a)({},n,{bubblesVirtually:!0,fillProps:c})):Object(r.createElement)(l.ToolbarGroup,null,Object(r.createElement)(i,Object(o.a)({},n,{bubblesVirtually:!0,fillProps:c}))):null}const f=p;f.Slot=m;const h=e=>Object(r.createElement)(p,Object(o.a)({group:"inline"},e));h.Slot=e=>Object(r.createElement)(m,Object(o.a)({group:"inline"},e));t.b=f},fPbg:function(e,t,n){"use strict";var o=n("GRId"),r=n("Tqx9");const c=Object(o.createElement)(r.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(o.createElement)(r.Path,{d:"M4 19.8h8.9v-1.5H4v1.5zm8.9-15.6H4v1.5h8.9V4.2zm-8.9 7v1.5h16v-1.5H4z"}));t.a=c},faye:function(e,t){e.exports=window.ReactDOM},felP:function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var o=n("1CF3"),r=n("RxS6"),c=n("1ZqX"),l=n("K9lf"),i=n("BhPs");function a(e){const t=Object(c.useSelect)(t=>t(i.a).isBlockSelected(e),[e]),{getBlockRootClientId:n,getBlockIndex:a}=Object(c.useSelect)(i.a),{insertDefaultBlock:s,removeBlock:u}=Object(c.useDispatch)(i.a);return Object(l.useRefEffect)(c=>{if(t)return c.addEventListener("keydown",l),c.addEventListener("dragstart",i),()=>{c.removeEventListener("keydown",l),c.removeEventListener("dragstart",i)};function l(t){const{keyCode:l,target:i}=t;l!==r.ENTER&&l!==r.BACKSPACE&&l!==r.DELETE||i!==c||Object(o.isTextField)(i)||(t.preventDefault(),l===r.ENTER?s({},n(e),a(e)+1):u(e))}function i(e){e.preventDefault()}},[e,t,n,a,s,u])}},g56x:function(e,t){e.exports=window.wp.hooks},gdqT:function(e,t){e.exports=window.wp.a11y},hF7m:function(e,t){e.exports=window.wp.keyboardShortcuts},hHnB:function(e,t,n){"use strict";var o=n("wx14"),r=n("GRId"),c=n("TSYQ"),l=n.n(c),i=n("l3Sj"),a=n("K9lf"),s=n("tI+e"),u=n("zQI6"),d=n("TVFh");function b(e){return Object(r.useMemo)(()=>{const t=document.implementation.createHTMLDocument("");return t.body.innerHTML=e,Array.from(t.body.children)},[e])}t.a=Object(r.forwardRef)((function(e,t){var n,c;let{contentRef:p,children:m,head:f,tabIndex:h=0,...g}=e;const[,O]=Object(r.useReducer)(()=>({})),[v,j]=Object(r.useState)(),[k,_]=Object(r.useState)([]),y=b(null===(n=window.__editorAssets)||void 0===n?void 0:n.styles),E=b(null===(c=window.__editorAssets)||void 0===c?void 0:c.scripts),C=Object(u.b)(),[S,w,I]=Object(d.b)(),x=Object(a.useRefEffect)(e=>{function t(){const{contentDocument:t,ownerDocument:n}=e,{readyState:o,documentElement:r}=t;return("interactive"===o||"complete"===o)&&(function(e){const{defaultView:t}=e,{frameElement:n}=t;function o(e){const o=Object.getPrototypeOf(e).constructor.name,r=window[o],c={};for(const t in e)c[t]=e[t];if(e instanceof t.MouseEvent){const e=n.getBoundingClientRect();c.clientX+=e.left,c.clientY+=e.top}const l=new r(e.type,c);!n.dispatchEvent(l)&&e.preventDefault()}const r=["dragover"];for(const t of r)e.addEventListener(t,o)}(t),j(t),C(r),_(Array.from(n.body.classList).filter(e=>e.startsWith("admin-color-")||"wp-embed-responsive"===e)),t.dir=n.dir,r.removeChild(t.head),r.removeChild(t.body),!0)}t()||e.addEventListener("load",()=>{t()})},[]),B=Object(a.useRefEffect)(e=>{E.reduce((t,n)=>t.then(()=>async function(e,t){let{id:n,src:o}=t;return new Promise((t,r)=>{const c=e.ownerDocument.createElement("script");c.id=n,o?(c.src=o,c.onload=()=>t(),c.onerror=()=>r()):t(),e.appendChild(c)})}(e,n)),Promise.resolve()).finally(()=>{O()})},[]),T=Object(a.useMergeRefs)([p,C,w]);return Object(r.useEffect)(()=>{var e;v&&(e=v,Array.from(document.styleSheets).forEach(t=>{try{t.cssRules}catch(e){return}const{ownerNode:n,cssRules:o}=t;if(o&&"LINK"===n.tagName&&"wp-reset-editor-styles-css"!==n.id&&Array.from(o).find(e=>{let{selectorText:t}=e;return t&&(t.includes(".editor-styles-wrapper")||t.includes(".wp-block"))})&&!e.getElementById(n.id)){e.head.appendChild(n.cloneNode(!0));const t=n.id.replace("-css","-inline-css"),o=document.getElementById(t);o&&e.head.appendChild(o.cloneNode(!0))}}))},[v]),f=Object(r.createElement)(r.Fragment,null,Object(r.createElement)("style",null,"body{margin:0}"),y.map(e=>{let{tagName:t,href:n,id:o,rel:c,media:l,textContent:i}=e;const a=t.toLowerCase();return"style"===a?Object(r.createElement)(a,{id:o,key:o},i):Object(r.createElement)(a,{href:n,id:o,rel:c,media:l,key:o})}),f),Object(r.createElement)(r.Fragment,null,h>=0&&S,Object(r.createElement)(__playground_ControlledIframe,Object(o.a)({},g,{ref:Object(a.useMergeRefs)([t,x]),tabIndex:h,title:Object(i.__)("Editor canvas")}),v&&Object(r.createPortal)(Object(r.createElement)(r.Fragment,null,Object(r.createElement)("head",{ref:B},f),Object(r.createElement)("body",{ref:T,className:l()("editor-styles-wrapper",...k)},Object(r.createElement)(s.__experimentalStyleProvider,{document:v},m))),v.documentElement)),h>=0&&I)}))},hMaJ:function(e,t,n){"use strict";var o=n("wx14"),r=n("GRId"),c=n("TSYQ"),l=n.n(c),i=n("YLtl"),a=n("tI+e"),s=n("l3Sj"),u=n("v5LD");const d=["colors","disableCustomColors","gradients","disableCustomGradients"];function b(e){let{colors:t,gradients:n,disableCustomColors:o,disableCustomGradients:c,__experimentalHasMultipleOrigins:u,__experimentalIsRenderedInSidebar:d,className:b,label:p,onColorChange:m,onGradientChange:f,colorValue:h,gradientValue:g,clearable:O,showTitle:v=!0,enableAlpha:j}=e;const k=m&&(!Object(i.isEmpty)(t)||!o),_=f&&(!Object(i.isEmpty)(n)||!c),[y,E]=Object(r.useState)(g?"gradient":!!k&&"color");return k||_?Object(r.createElement)(a.BaseControl,{className:l()("block-editor-color-gradient-control",b)},Object(r.createElement)("fieldset",null,Object(r.createElement)(a.__experimentalVStack,{spacing:1},v&&Object(r.createElement)("legend",null,Object(r.createElement)("div",{className:"block-editor-color-gradient-control__color-indicator"},Object(r.createElement)(a.BaseControl.VisualLabel,null,p))),k&&_&&Object(r.createElement)(a.__experimentalToggleGroupControl,{value:y,onChange:E,label:Object(s.__)("Select color type"),hideLabelFromVision:!0,isBlock:!0},Object(r.createElement)(a.__experimentalToggleGroupControlOption,{value:"color",label:Object(s.__)("Solid")}),Object(r.createElement)(a.__experimentalToggleGroupControlOption,{value:"gradient",label:Object(s.__)("Gradient")})),("color"===y||!_)&&Object(r.createElement)(a.ColorPalette,{value:h,onChange:_?e=>{m(e),f()}:m,colors:t,disableCustomColors:o,__experimentalHasMultipleOrigins:u,__experimentalIsRenderedInSidebar:d,clearable:O,enableAlpha:j}),("gradient"===y||!k)&&Object(r.createElement)(a.GradientPicker,{value:g,onChange:k?e=>{f(e),m()}:f,gradients:n,disableCustomGradients:c,__experimentalHasMultipleOrigins:u,__experimentalIsRenderedInSidebar:d,clearable:O})))):null}function p(e){const t={};return t.colors=Object(u.a)("color.palette"),t.gradients=Object(u.a)("color.gradients"),t.disableCustomColors=!Object(u.a)("color.custom"),t.disableCustomGradients=!Object(u.a)("color.customGradient"),Object(r.createElement)(b,Object(o.a)({},t,e))}t.a=function(e){return Object(i.every)(d,t=>e.hasOwnProperty(t))?Object(r.createElement)(b,e):Object(r.createElement)(p,e)}},hw9B:function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var o=n("1ZqX"),r=n("K9lf"),c=n("BhPs"),l=n("OL6h");function i(e,t){Array.from(e.closest(".is-root-container").querySelectorAll(".rich-text")).forEach(e=>{t?e.setAttribute("contenteditable",!0):e.removeAttribute("contenteditable")})}function a(e){const{startMultiSelect:t,stopMultiSelect:n,multiSelect:a,selectBlock:s}=Object(o.useDispatch)(c.a),{isSelectionEnabled:u,isBlockSelected:d,getBlockParents:b,getBlockSelectionStart:p,hasMultiSelection:m}=Object(o.useSelect)(c.a);return Object(r.useRefEffect)(o=>{const{ownerDocument:r}=o,{defaultView:c}=r;let f,h;function g(t){let{isSelectionEnd:n}=t;const r=c.getSelection();if(!r.rangeCount||r.isCollapsed)return void i(o,!0);const u=Object(l.a)(r.focusNode);if(e===u){if(s(e),n&&(i(o,!0),r.rangeCount)){const{commonAncestorContainer:e}=r.getRangeAt(0);f.contains(e)&&f.focus()}}else{const t=[...b(e),e],n=[...b(u),u],o=Math.min(t.length,n.length)-1;a(t[o],n[o])}}function O(){r.removeEventListener("selectionchange",g),c.removeEventListener("mouseup",O),h=c.requestAnimationFrame(()=>{g({isSelectionEnd:!0}),n()})}function v(n){let{buttons:l}=n;1===l&&u()&&d(e)&&(f=r.activeElement,t(),r.addEventListener("selectionchange",g),c.addEventListener("mouseup",O),i(o,!1))}function j(t){if(u()&&0===t.button)if(t.shiftKey){const n=p(),r=b(n);if(n&&n!==e&&(null==r||!r.includes(e))){const c=[...r,n],l=[...b(e),e],s=Math.min(c.length,l.length)-1,u=c[s],d=l[s];u!==d&&(i(o,!1),a(u,d),t.preventDefault())}}else m()&&s(e)}return o.addEventListener("mousedown",j),o.addEventListener("mouseleave",v),()=>{o.removeEventListener("mousedown",j),o.removeEventListener("mouseleave",v),r.removeEventListener("selectionchange",g),c.removeEventListener("mouseup",O),c.cancelAnimationFrame(h)}},[e,t,n,a,s,u,d,b])}},iA5R:function(e,t,n){"use strict";var o;Object.defineProperty(t,"__esModule",{value:!0}),t.diffChars=function(e,t,n){return r.diff(e,t,n)},t.characterDiff=void 0;var r=new(((o=n("smQA"))&&o.__esModule?o:{default:o}).default);t.characterDiff=r},iClF:function(e,t,n){"use strict";var o=n("GRId");t.a=function(e){let{icon:t,size:n=24,...r}=e;return Object(o.cloneElement)(t,{width:n,height:n,...r})}},j6zP:function(e,t,n){"use strict";var o=n("GRId"),r=n("tI+e"),c=n("q3tz");t.a=e=>{let{isEnabled:t,blocks:n,icon:l,children:i}=e;const a={type:"inserter",blocks:n};return Object(o.createElement)(r.Draggable,{__experimentalTransferDataType:"wp-blocks",transferData:a,__experimentalDragComponent:Object(o.createElement)(c.a,{count:n.length,icon:l})},e=>{let{onDraggableStart:n,onDraggableEnd:o}=e;return i({draggable:t,onDragStart:t?n:void 0,onDragEnd:t?o:void 0})})}},jB5C:function(e,t,n){"use strict";var o=Object.assign||function(e){for(var t=1;tObject(i.getSaveContent)(e.name,e.attributes,e.innerBlocks)).join(""));var d;const b=(m=t.originalContent,g=u,Object(f.diffChars)(m,g).map((e,t)=>{const n=c()({"block-editor-block-compare__added":e.added,"block-editor-block-compare__removed":e.removed});return Object(o.createElement)("span",{key:t,className:n},e.value)}));var m,g;return Object(o.createElement)("div",{className:"block-editor-block-compare__wrapper"},Object(o.createElement)(h,{title:Object(p.__)("Current"),className:"block-editor-block-compare__current",action:n,actionText:Object(p.__)("Convert to HTML"),rawContent:t.originalContent,renderedContent:t.originalContent}),Object(o.createElement)(h,{title:Object(p.__)("After Conversion"),className:"block-editor-block-compare__converted",action:r,actionText:s,rawContent:b,renderedContent:u}))},O=n("BhPs");const v=e=>Object(i.rawHandler)({HTML:e.originalContent});var j=Object(u.compose)([Object(s.withSelect)((e,t)=>{let{clientId:n}=t;return{block:e(O.a).getBlock(n)}}),Object(s.withDispatch)((e,t)=>{let{block:n}=t;const{replaceBlock:o}=e(O.a);return{convertToClassic(){o(n.clientId,(e=>Object(i.createBlock)("core/freeform",{content:e.originalContent}))(n))},convertToHTML(){o(n.clientId,(e=>Object(i.createBlock)("core/html",{content:e.originalContent}))(n))},convertToBlocks(){o(n.clientId,v(n))},attemptBlockRecovery(){o(n.clientId,(e=>{let{name:t,attributes:n,innerBlocks:o}=e;return Object(i.createBlock)(t,n,o)})(n))}}})])((function(e){let{convertToHTML:t,convertToBlocks:n,convertToClassic:r,attemptBlockRecovery:c,block:l}=e;const s=!!Object(i.getBlockType)("core/html"),[u,d]=Object(o.useState)(!1),b=Object(o.useCallback)(()=>d(!0),[]),f=Object(o.useCallback)(()=>d(!1),[]),h=Object(o.useMemo)(()=>[{title:Object(p._x)("Resolve","imperative verb"),onClick:b},s&&{title:Object(p.__)("Convert to HTML"),onClick:t},{title:Object(p.__)("Convert to Classic Block"),onClick:r}].filter(Boolean),[b,t,r]);return Object(o.createElement)(o.Fragment,null,Object(o.createElement)(m.a,{actions:[Object(o.createElement)(a.Button,{key:"recover",onClick:c,variant:"primary"},Object(p.__)("Attempt Block Recovery"))],secondaryActions:h},Object(p.__)("This block contains unexpected or invalid content.")),u&&Object(o.createElement)(a.Modal,{title:Object(p.__)("Resolve Block"),onRequestClose:f,className:"block-editor-block-compare"},Object(o.createElement)(g,{block:l,onKeep:t,onConvert:n,convertor:v,convertButtonText:Object(p.__)("Convert to Blocks")})))}));const k=Object(o.createElement)(m.a,{className:"block-editor-block-list__block-crash-warning"},Object(p.__)("This block has encountered an error and cannot be previewed."));var _=()=>k;class y extends o.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 E=y,C=n("O6Fj"),S=n.n(C);var w=function(e){let{clientId:t}=e;const[n,r]=Object(o.useState)(""),c=Object(s.useSelect)(e=>e(O.a).getBlock(t),[t]),{updateBlock:l}=Object(s.useDispatch)(O.a);return Object(o.useEffect)(()=>{r(Object(i.getBlockContent)(c))},[c]),Object(o.createElement)(S.a,{className:"block-editor-block-list__block-html-textarea",value:n,onBlur:()=>{const e=Object(i.getBlockType)(c.name);if(!e)return;const o=Object(i.getBlockAttributes)(e,n,c.attributes),a=n||Object(i.getSaveContent)(e,o),s=!n||Object(i.isValidBlockContent)(e,o,a);l(t,{attributes:o,originalContent:a,isValid:s}),n||r({content:a})},onChange:e=>r(e.target.value)})},I=n("nlh6");const x=Object(o.createContext)();function B(e){let{children:t,isHtml:n,...r}=e;return Object(o.createElement)("div",Object(I.a)(r,{__unstableIsHtml:n}),t)}const T=Object(s.withSelect)((e,t)=>{let{clientId:n,rootClientId:o}=t;const{isBlockSelected:r,getBlockMode:c,isSelectionEnabled:l,getTemplateLock:i,__unstableGetBlockWithoutInnerBlocks:a,canRemoveBlock:s,canMoveBlock:u}=e(O.a),d=a(n),b=r(n),p=i(o),m=s(n,o),f=u(n,o),{name:h,attributes:g,isValid:v}=d||{};return{mode:c(n),isSelectionEnabled:l(),isLocked:!!p,canRemove:m,canMove:f,block:d,name:h,attributes:g,isValid:v,isSelected:b}}),P=Object(s.withDispatch)((e,t,n)=>{let{select:o}=n;const{updateBlockAttributes:r,insertBlocks:c,mergeBlocks:l,replaceBlocks:a,toggleSelection:s,__unstableMarkLastChangeAsPersistent:u}=e(O.a);return{setAttributes(e){const{getMultiSelectedBlockClientIds:n}=o(O.a),c=n(),{clientId:l}=t,i=c.length?c:[l];r(i,e)},onInsertBlocks(e,n){const{rootClientId:o}=t;c(e,n,o)},onInsertBlocksAfter(e){const{clientId:n,rootClientId:r}=t,{getBlockIndex:l}=o(O.a),i=l(n);c(e,i+1,r)},onMerge(e){const{clientId:n}=t,{getPreviousBlockClientId:r,getNextBlockClientId:c}=o(O.a);if(e){const e=c(n);e&&l(n,e)}else{const e=r(n);e&&l(e,n)}},onReplace(e,n,o){e.length&&!Object(i.isUnmodifiedDefaultBlock)(e[e.length-1])&&u(),a([t.clientId],e,n,o)},toggleSelection(e){s(e)}}});t.b=Object(u.compose)(u.pure,T,P,Object(u.ifCondition)(e=>{let{block:t}=e;return!!t}),Object(a.withFilters)("editor.BlockListBlock"))((function(e){let{mode:t,isLocked:n,canRemove:r,clientId:a,isSelected:u,isSelectionEnabled:p,className:m,name:f,isValid:h,attributes:g,wrapperProps:v,setAttributes:k,onReplace:y,onInsertBlocksAfter:C,onMerge:S,toggleSelection:I}=e;const{removeBlock:T}=Object(s.useDispatch)(O.a),P=Object(o.useCallback)(()=>T(a),[a]);let R=Object(o.createElement)(b.a,{name:f,isSelected:u,attributes:g,setAttributes:k,insertBlocksAfter:n?void 0:C,onReplace:r?y:void 0,onRemove:r?P:void 0,mergeBlocks:r?S:void 0,clientId:a,isSelectionEnabled:p,toggleSelection:I});const N=Object(i.getBlockType)(f);null!=N&&N.getEditWrapperProps&&(v=function(e,t){const n={...e,...t};return e&&t&&e.className&&t.className&&(n.className=c()(e.className,t.className)),e&&t&&e.style&&t.style&&(n.style={...e.style,...t.style}),n}(v,N.getEditWrapperProps(g)));const M=v&&!!v["data-align"];let L;if(M&&(R=Object(o.createElement)("div",{className:"wp-block","data-align":v["data-align"]},R)),h)L="html"===t?Object(o.createElement)(o.Fragment,null,Object(o.createElement)("div",{style:{display:"none"}},R),Object(o.createElement)(B,{isHtml:!0},Object(o.createElement)(w,{clientId:a}))):(null==N?void 0:N.apiVersion)>1?R:Object(o.createElement)(B,v,R);else{const e=Object(i.getSaveContent)(N,g);L=Object(o.createElement)(B,{className:"has-warning"},Object(o.createElement)(j,{clientId:a}),Object(o.createElement)(o.RawHTML,null,Object(d.safeHTML)(e)))}const A={clientId:a,className:m,wrapperProps:Object(l.omit)(v,["data-align"]),isAligned:M},D=Object(o.useMemo)(()=>A,Object.values(A));return Object(o.createElement)(x.Provider,{value:D},Object(o.createElement)(E,{fallback:Object(o.createElement)(B,{className:"has-warning"},Object(o.createElement)(_,null))},L))}))},jTPX:function(e,t){e.exports=function(e,t,n){return((n=window.getComputedStyle)?n(e):e.currentStyle)[t.replace(/-(\w)/gi,(function(e,t){return t.toUpperCase()}))]}},jrfk:function(e,t){var n,o,r,c,l,i,a,s,u,d,b,p,m,f,h,g=!1;function O(){if(!g){g=!0;var e=navigator.userAgent,t=/(?:MSIE.(\d+\.\d+))|(?:(?:Firefox|GranParadiso|Iceweasel).(\d+\.\d+))|(?:Opera(?:.+Version.|.)(\d+\.\d+))|(?:AppleWebKit.(\d+(?:\.\d+)?))|(?:Trident\/\d+\.\d+.*rv:(\d+\.\d+))/.exec(e),O=/(Mac OS X)|(Windows)|(Linux)/.exec(e);if(p=/\b(iPhone|iP[ao]d)/.exec(e),m=/\b(iP[ao]d)/.exec(e),d=/Android/i.exec(e),f=/FBAN\/\w+;/i.exec(e),h=/Mobile/i.exec(e),b=!!/Win64/.exec(e),t){(n=t[1]?parseFloat(t[1]):t[5]?parseFloat(t[5]):NaN)&&document&&document.documentMode&&(n=document.documentMode);var v=/(?:Trident\/(\d+.\d+))/.exec(e);i=v?parseFloat(v[1])+4:n,o=t[2]?parseFloat(t[2]):NaN,r=t[3]?parseFloat(t[3]):NaN,(c=t[4]?parseFloat(t[4]):NaN)?(t=/(?:Chrome\/(\d+\.\d+))/.exec(e),l=t&&t[1]?parseFloat(t[1]):NaN):l=NaN}else n=o=r=l=c=NaN;if(O){if(O[1]){var j=/(?:Mac OS X (\d+(?:[._]\d+)?))/.exec(e);a=!j||parseFloat(j[1].replace("_","."))}else a=!1;s=!!O[2],u=!!O[3]}else a=s=u=!1}}var v={ie:function(){return O()||n},ieCompatibilityMode:function(){return O()||i>n},ie64:function(){return v.ie()&&b},firefox:function(){return O()||o},opera:function(){return O()||r},webkit:function(){return O()||c},safari:function(){return v.webkit()},chrome:function(){return O()||l},windows:function(){return O()||s},osx:function(){return O()||a},linux:function(){return O()||u},iphone:function(){return O()||p},mobile:function(){return O()||p||m||d||h},nativeApp:function(){return O()||f},android:function(){return O()||d},ipad:function(){return O()||m}};e.exports=v},jwne:function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return s}));var o=n("wx14"),r=n("GRId"),c=n("tI+e"),l=(n("Z23Y"),n("c1Zz")),i=n("asom"),a=n("VrEk");function s(t){var n;let{__experimentalGroup:s="default",bubblesVirtually:u=!0,label:d,...b}=t;const p=null===(n=a.a[s])||void 0===n?void 0:n.Slot,m=Object(c.__experimentalUseSlot)(null==p?void 0:p.__unstableName);if(!p||!m)return void 0!==e&&e.env,null;return Boolean(m.fills&&m.fills.length)?d?Object(r.createElement)(l.a,{group:s,label:d},Object(r.createElement)(i.a,Object(o.a)({},b,{bubblesVirtually:u,Slot:p}))):Object(r.createElement)(p,Object(o.a)({},b,{bubblesVirtually:u})):null}}).call(this,n("8oxB"))},kBLm:function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var o=n("1ZqX"),r=n("K9lf"),c=n("BhPs");function l(e){if(e.defaultPrevented)return;const t="mouseover"===e.type?"add":"remove";e.preventDefault(),e.currentTarget.classList[t]("is-hovered")}function i(){const e=Object(o.useSelect)(e=>{const{isNavigationMode:t,getSettings:n}=e(c.a);return t()||n().outlineMode},[]);return Object(r.useRefEffect)(t=>{if(e)return t.addEventListener("mouseout",l),t.addEventListener("mouseover",l),()=>{t.removeEventListener("mouseout",l),t.removeEventListener("mouseover",l),t.classList.remove("is-hovered")}},[e])}},kVRd:function(e,t,n){"use strict";n.d(t,"a",(function(){return u}));var o=n("GRId"),r=n("tI+e"),c=n("Tqx9");var l=Object(o.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(o.createElement)(c.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"})),i=n("Crq9"),a=n("l3Sj");const s=[{name:Object(a.__)("Underline"),value:"underline",icon:l},{name:Object(a.__)("Strikethrough"),value:"line-through",icon:i.a}];function u(e){let{value:t,onChange:n}=e;return Object(o.createElement)("fieldset",{className:"block-editor-text-decoration-control"},Object(o.createElement)("legend",null,Object(a.__)("Decoration")),Object(o.createElement)("div",{className:"block-editor-text-decoration-control__buttons"},s.map(e=>Object(o.createElement)(r.Button,{key:e.value,icon:e.icon,isSmall:!0,isPressed:e.value===t,onClick:()=>n(e.value===t?void 0:e.value),"aria-label":e.name}))))}},kWXm:function(e,t,n){"use strict";var o=n("GRId"),r=n("Tqx9");const c=Object(o.createElement)(r.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(o.createElement)(r.Path,{d:"M9 9v6h11V9H9zM4 20h1.5V4H4v16z"}));t.a=c},kaUp:function(e,t){},kmrn:function(e,t,n){"use strict";n.d(t,"useSpring",(function(){return ke}));var o=n("nEW0");n.d(t,"Globals",(function(){return o.b}));var r=n("cDcd"),c=n("dfZa");n("kaUp"),n("v8Ku");function l(){return(l=Object.assign||function(e){for(var t=1;t!0===e||!!(t&&e&&(o.s.fun(e)?e(t):Object(o.y)(e).includes(t))),s=(e,t)=>o.s.obj(e)?t&&e[t]:e,u=(e,t)=>!0===e.default?e[t]:e.default?e.default[t]:void 0,d=e=>e,b=(e,t=d)=>{let n=p;e.default&&!0!==e.default&&(e=e.default,n=Object.keys(e));const r={};for(const c of n){const n=t(e[c],c);o.s.und(n)||(r[c]=n)}return r},p=["config","onProps","onStart","onChange","onPause","onResume","onRest"],m={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 f(e){const t=function(e){const t={};let n=0;if(Object(o.l)(e,(e,o)=>{m[o]||(t[o]=e,n++)}),n)return t}(e);if(t){const n={to:t};return Object(o.l)(e,(e,o)=>o in t||(n[o]=e)),n}return l({},e)}function h(e){return e=Object(o.q)(e),o.s.arr(e)?e.map(h):Object(o.t)(e)?o.b.createStringInterpolator({range:[0,1],output:[e,e]})(1):e}function g(e){for(const t in e)return!0;return!1}function O(e){return o.s.fun(e)||o.s.arr(e)&&o.s.obj(e[0])}function v(e,t){var n;null==(n=e.ref)||n.delete(e),null==t||t.delete(e)}function j(e,t){var n;t&&e.ref!==t&&(null==(n=e.ref)||n.delete(e),t.add(e),e.ref=t)}const k=1.70158,_=1.525*k,y=2*Math.PI/3,E=2*Math.PI/4.5,C=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},S=l({},{tension:170,friction:26},{mass:1,damping:1,easing:{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=>2.70158*e*e*e-k*e*e,easeOutBack:e=>1+2.70158*Math.pow(e-1,3)+k*Math.pow(e-1,2),easeInOutBack:e=>e<.5?Math.pow(2*e,2)*(7.189819*e-_)/2:(Math.pow(2*e-2,2)*((_+1)*(2*e-2)+_)+2)/2,easeInElastic:e=>0===e?0:1===e?1:-Math.pow(2,10*e-10)*Math.sin((10*e-10.75)*y),easeOutElastic:e=>0===e?0:1===e?1:Math.pow(2,-10*e)*Math.sin((10*e-.75)*y)+1,easeInOutElastic:e=>0===e?0:1===e?1:e<.5?-Math.pow(2,20*e-10)*Math.sin((20*e-11.125)*E)/2:Math.pow(2,-20*e+10)*Math.sin((20*e-11.125)*E)/2+1,easeInBounce:e=>1-C(1-e),easeOutBounce:C,easeInOutBounce:e=>e<.5?(1-C(1-2*e))/2:(1+C(2*e-1))/2}.linear,clamp:!1});class w{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,S)}}function I(e,t){if(o.s.und(t.decay)){const n=!o.s.und(t.tension)||!o.s.und(t.friction);!n&&o.s.und(t.frequency)&&o.s.und(t.damping)&&o.s.und(t.mass)||(e.duration=void 0,e.decay=void 0),n&&(e.frequency=void 0)}else e.duration=void 0}const x=[];class B{constructor(){this.changed=!1,this.values=x,this.toValues=null,this.fromValues=x,this.to=void 0,this.from=void 0,this.config=new w,this.immediate=!1}}function T(e,{key:t,props:n,defaultProps:r,state:c,actions:s}){return new Promise((u,d)=>{var b;let p,m,f=a(null!=(b=n.cancel)?b:null==r?void 0:r.cancel,t);if(f)O();else{o.s.und(n.pause)||(c.paused=a(n.pause,t));let e=null==r?void 0:r.pause;!0!==e&&(e=c.paused||a(e,t)),p=i(n.delay||0,t),e?(c.resumeQueue.add(g),s.pause()):(s.resume(),g())}function h(){c.resumeQueue.add(g),c.timeouts.delete(m),m.cancel(),p=m.time-o.w.now()}function g(){p>0&&!o.b.skipAnimation?(c.delayed=!0,m=o.w.setTimeout(O,p),c.pauseQueue.add(h),c.timeouts.add(m)):O()}function O(){c.delayed&&(c.delayed=!1),c.pauseQueue.delete(h),c.timeouts.delete(m),e<=(c.cancelId||0)&&(f=!0);try{s.start(l({},n,{callId:e,cancel:f}),u)}catch(e){d(e)}}})}const P=(e,t)=>1==t.length?t[0]:t.some(e=>e.cancelled)?M(e.get()):t.every(e=>e.noop)?R(e.get()):N(e.get(),t.every(e=>e.finished)),R=e=>({value:e,noop:!0,finished:!0,cancelled:!1}),N=(e,t,n=!1)=>({value:e,finished:t,cancelled:n}),M=e=>({value:e,cancelled:!0,finished:!1});function L(e,t,n,r){const{callId:c,parentId:i,onRest:a}=t,{asyncTo:s,promise:u}=n;return i||e!==s||t.reset?n.promise=(async()=>{n.asyncId=c,n.asyncTo=e;const d=b(t,(e,t)=>"onRest"===t?void 0:e);let p,m;const f=new Promise((e,t)=>(p=e,m=t)),h=e=>{const t=c<=(n.cancelId||0)&&M(r)||c!==n.asyncId&&N(r,!1);if(t)throw e.result=t,m(e),e},g=(e,t)=>{const i=new D,a=new F;return(async()=>{if(o.b.skipAnimation)throw A(n),a.result=N(r,!1),m(a),a;h(i);const s=o.s.obj(e)?l({},e):l({},t,{to:e});s.parentId=c,Object(o.l)(d,(e,t)=>{o.s.und(s[t])&&(s[t]=e)});const u=await r.start(s);return h(i),n.paused&&await new Promise(e=>{n.resumeQueue.add(e)}),u})()};let O;if(o.b.skipAnimation)return A(n),N(r,!1);try{let t;t=o.s.arr(e)?(async e=>{for(const t of e)await g(t)})(e):Promise.resolve(e(g,r.stop.bind(r))),await Promise.all([t.then(p),f]),O=N(r.get(),!0,!1)}catch(e){if(e instanceof D)O=e.result;else{if(!(e instanceof F))throw e;O=e.result}}finally{c==n.asyncId&&(n.asyncId=i,n.asyncTo=i?s:void 0,n.promise=i?u:void 0)}return o.s.fun(a)&&o.w.batchedUpdates(()=>{a(O,r,r.item)}),O})():u}function A(e,t){Object(o.m)(e.timeouts,e=>e.cancel()),e.pauseQueue.clear(),e.resumeQueue.clear(),e.asyncId=e.asyncTo=e.promise=void 0,t&&(e.cancelId=t)}class D 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 F extends Error{constructor(){super("SkipAnimationSignal"),this.result=void 0}}const z=e=>e instanceof V;let H=1;class V extends o.a{constructor(...e){super(...e),this.id=H++,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=Object(c.e)(this);return e&&e.getValue()}to(...e){return o.b.to(this,e)}interpolate(...e){return Object(o.j)(),o.b.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){Object(o.d)(this,{type:"change",parent:this,value:e,idle:t})}_onPriorityChange(e){this.idle||o.o.sort(this),Object(o.d)(this,{type:"priority",parent:this,priority:e})}}const G=Symbol.for("SpringPhase"),U=e=>(1&e[G])>0,W=e=>(2&e[G])>0,q=e=>(4&e[G])>0,K=(e,t)=>t?e[G]|=3:e[G]&=-3,Y=(e,t)=>t?e[G]|=4:e[G]&=-5;class $ extends V{constructor(e,t){if(super(),this.key=void 0,this.animation=new B,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,!o.s.und(e)||!o.s.und(t)){const n=o.s.obj(e)?l({},e):l({},t,{from:e});o.s.und(n.default)&&(n.default=!0),this.start(n)}}get idle(){return!(W(this)||this._state.asyncTo)||q(this)}get goal(){return Object(o.q)(this.animation.to)}get velocity(){const e=Object(c.e)(this);return e instanceof c.c?e.lastVelocity||0:e.getPayload().map(e=>e.lastVelocity||0)}get hasAnimated(){return U(this)}get isAnimating(){return W(this)}get isPaused(){return q(this)}get isDelayed(){return this._state.delayed}advance(e){let t=!0,n=!1;const r=this.animation;let{config:l,toValues:i}=r;const a=Object(c.g)(r.to);!a&&Object(o.r)(r.to)&&(i=Object(o.y)(Object(o.q)(r.to))),r.values.forEach((s,u)=>{if(s.done)return;const d=s.constructor==c.b?1:a?a[u].lastPosition:i[u];let b=r.immediate,p=d;if(!b){if(p=s.lastPosition,l.tension<=0)return void(s.done=!0);let t=s.elapsedTime+=e;const n=r.fromValues[u],c=null!=s.v0?s.v0:s.v0=o.s.arr(l.velocity)?l.velocity[u]:l.velocity;let i;if(o.s.und(l.duration))if(l.decay){const e=!0===l.decay?.998:l.decay,o=Math.exp(-(1-e)*t);p=n+c/(1-e)*(1-o),b=Math.abs(s.lastPosition-p)<.1,i=c*o}else{i=null==s.lastVelocity?c:s.lastVelocity;const t=l.precision||(n==d?.005:Math.min(1,.001*Math.abs(d-n))),r=l.restVelocity||t/10,a=l.clamp?0:l.bounce,u=!o.s.und(a),m=n==d?s.v0>0:nr,f||(b=Math.abs(d-p)<=t,!b));++e){u&&(h=p==d||p>d==m,h&&(i=-i*a,p=d));i+=(1e-6*-l.tension*(p-d)+.001*-l.friction*i)/l.mass*g,p+=i*g}}else{let o=1;l.duration>0&&(this._memoizedDuration!==l.duration&&(this._memoizedDuration=l.duration,s.durationProgress>0&&(s.elapsedTime=l.duration*s.durationProgress,t=s.elapsedTime+=e)),o=(l.progress||0)+t/this._memoizedDuration,o=o>1?1:o<0?0:o,s.durationProgress=o),p=n+l.easing(o)*(d-n),i=(p-s.lastPosition)/e,b=1==o}s.lastVelocity=i,Number.isNaN(p)&&(console.warn("Got NaN while animating:",this),b=!0)}a&&!a[u].done&&(b=!1),b?s.done=!0:t=!1,s.setValue(p,l.round)&&(n=!0)});const s=Object(c.e)(this),u=s.getValue();if(t){const e=Object(o.q)(r.to);u===e&&!n||l.decay?n&&l.decay&&this._onChange(u):(s.setValue(e),this._onChange(e)),this._stop()}else n&&this._onChange(u)}set(e){return o.w.batchedUpdates(()=>{this._stop(),this._focus(e),this._set(e)}),this}pause(){this._update({pause:!0})}resume(){this._update({pause:!1})}finish(){if(W(this)){const{to:e,config:t}=this.animation;o.w.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 o.s.und(e)?(n=this.queue||[],this.queue=[]):n=[o.s.obj(e)?e:l({},t,{to:e})],Promise.all(n.map(e=>this._update(e))).then(e=>P(this,e))}stop(e){const{to:t}=this.animation;return this._focus(this.get()),A(this._state,e&&this._lastCallId),o.w.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:r}=e;n=o.s.obj(n)?n[t]:n,(null==n||O(n))&&(n=void 0),r=o.s.obj(r)?r[t]:r,null==r&&(r=void 0);const l={to:n,from:r};return U(this)||(e.reverse&&([n,r]=[r,n]),r=Object(o.q)(r),o.s.und(r)?Object(c.e)(this)||this._set(n):this._set(r)),l}_update(e,t){let n=l({},e);const{key:r,defaultProps:c}=this;n.default&&Object.assign(c,b(n,(e,t)=>/^on/.test(t)?s(e,r):e)),ne(this,n,"onProps"),oe(this,"onProps",n,this);const i=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 a=this._state;return T(++this._lastCallId,{key:r,props:n,defaultProps:c,state:a,actions:{pause:()=>{q(this)||(Y(this,!0),Object(o.n)(a.pauseQueue),oe(this,"onPause",N(this,Z(this,this.animation.to)),this))},resume:()=>{q(this)&&(Y(this,!1),W(this)&&this._resume(),Object(o.n)(a.resumeQueue),oe(this,"onResume",N(this,Z(this,this.animation.to)),this))},start:this._merge.bind(this,i)}}).then(e=>{if(n.loop&&e.finished&&(!t||!e.noop)){const e=X(n);if(e)return this._update(e,!0)}return e})}_merge(e,t,n){if(t.cancel)return this.stop(!0),n(M(this));const r=!o.s.und(e.to),s=!o.s.und(e.from);if(r||s){if(!(t.callId>this._lastToId))return n(M(this));this._lastToId=t.callId}const{key:u,defaultProps:d,animation:b}=this,{to:p,from:m}=b;let{to:f=p,from:g=m}=e;!s||r||t.default&&!o.s.und(f)||(f=g),t.reverse&&([f,g]=[g,f]);const v=!Object(o.u)(g,m);v&&(b.from=g),g=Object(o.q)(g);const j=!Object(o.u)(f,p);j&&this._focus(f);const k=O(t.to),{config:_}=b,{decay:y,velocity:E}=_;(r||s)&&(_.velocity=0),t.config&&!k&&function(e,t,n){n&&(I(n=l({},n),t),t=l({},n,t)),I(e,t),Object.assign(e,t);for(const t in S)null==e[t]&&(e[t]=S[t]);let{mass:r,frequency:c,damping:i}=e;o.s.und(c)||(c<.01&&(c=.01),i<0&&(i=0),e.tension=Math.pow(2*Math.PI/c,2)*r,e.friction=4*Math.PI*i*r/c)}(_,i(t.config,u),t.config!==d.config?i(d.config,u):void 0);let C=Object(c.e)(this);if(!C||o.s.und(f))return n(N(this,!0));const w=o.s.und(t.reset)?s&&!t.default:!o.s.und(g)&&a(t.reset,u),x=w?g:this.get(),B=h(f),T=o.s.num(B)||o.s.arr(B)||Object(o.t)(B),P=!k&&(!T||a(d.immediate||t.immediate,u));if(j){const e=Object(c.f)(f);if(e!==C.constructor){if(!P)throw Error(`Cannot animate between ${C.constructor.name} and ${e.name}, as the "to" prop suggests`);C=this._set(B)}}const A=C.constructor;let D=Object(o.r)(f),F=!1;if(!D){const e=w||!U(this)&&v;(j||e)&&(F=Object(o.u)(h(x),B),D=!F),(Object(o.u)(b.immediate,P)||P)&&Object(o.u)(_.decay,y)&&Object(o.u)(_.velocity,E)||(D=!0)}if(F&&W(this)&&(b.changed&&!w?D=!0:D||this._stop(p)),!k&&((D||Object(o.r)(p))&&(b.values=C.getPayload(),b.toValues=Object(o.r)(f)?null:A==c.b?[1]:Object(o.y)(B)),b.immediate!=P&&(b.immediate=P,P||w||this._set(p)),D)){const{onRest:e}=b;Object(o.k)(te,e=>ne(this,t,e));const r=N(this,Z(this,p));Object(o.n)(this._pendingCalls,r),this._pendingCalls.add(n),b.changed&&o.w.batchedUpdates(()=>{b.changed=!w,null==e||e(r,this),w?i(d.onRest,r):null==b.onStart||b.onStart(r,this)})}w&&this._set(x),k?n(L(t.to,t,this._state,this)):D?this._start():W(this)&&!j?this._pendingCalls.add(n):n(R(x))}_focus(e){const t=this.animation;e!==t.to&&(Object(o.p)(this)&&this._detach(),t.to=e,Object(o.p)(this)&&this._attach())}_attach(){let e=0;const{to:t}=this.animation;Object(o.r)(t)&&(Object(o.c)(t,this),z(t)&&(e=t.priority+1)),this.priority=e}_detach(){const{to:e}=this.animation;Object(o.r)(e)&&Object(o.x)(e,this)}_set(e,t=!0){const n=Object(o.q)(e);if(!o.s.und(n)){const e=Object(c.e)(this);if(!e||!Object(o.u)(n,e.getValue())){const r=Object(c.f)(n);e&&e.constructor==r?e.setValue(n):Object(c.h)(this,r.create(n)),e&&o.w.batchedUpdates(()=>{this._onChange(n,t)})}}return Object(c.e)(this)}_onStart(){const e=this.animation;e.changed||(e.changed=!0,oe(this,"onStart",N(this,Z(this,e.to)),this))}_onChange(e,t){t||(this._onStart(),i(this.animation.onChange,e,this)),i(this.defaultProps.onChange,e,this),super._onChange(e,t)}_start(){const e=this.animation;Object(c.e)(this).reset(Object(o.q)(e.to)),e.immediate||(e.fromValues=e.values.map(e=>e.lastPosition)),W(this)||(K(this,!0),q(this)||this._resume())}_resume(){o.b.skipAnimation?this.finish():o.o.start(this)}_stop(e,t){if(W(this)){K(this,!1);const n=this.animation;Object(o.k)(n.values,e=>{e.done=!0}),n.toValues&&(n.onChange=n.onPause=n.onResume=void 0),Object(o.d)(this,{type:"idle",parent:this});const r=t?M(this.get()):N(this.get(),Z(this,null!=e?e:n.to));Object(o.n)(this._pendingCalls,r),n.changed&&(n.changed=!1,oe(this,"onRest",r,this))}}}function Z(e,t){const n=h(t),r=h(e.get());return Object(o.u)(r,n)}function X(e,t=e.loop,n=e.to){let o=i(t);if(o){const r=!0!==o&&f(o),c=(r||e).reverse,i=!r||r.reset;return Q(l({},e,{loop:t,default:!1,pause:void 0,to:!c||O(n)?n:void 0,from:i?e.from:void 0,reset:i},r))}}function Q(e){const{to:t,from:n}=e=f(e),r=new Set;return o.s.obj(t)&&ee(t,r),o.s.obj(n)&&ee(n,r),e.keys=r.size?Array.from(r):null,e}function J(e){const t=Q(e);return o.s.und(t.default)&&(t.default=b(t)),t}function ee(e,t){Object(o.l)(e,(e,n)=>null!=e&&t.add(n))}const te=["onStart","onRest","onChange","onPause","onResume"];function ne(e,t,n){e.animation[n]=t[n]!==u(t,n)?s(t[n],e.key):void 0}function oe(e,t,...n){var o,r,c,l;null==(o=(r=e.animation)[t])||o.call(r,...n),null==(c=(l=e.defaultProps)[t])||c.call(l,...n)}const re=["onStart","onChange","onRest"];let ce=1;class le{constructor(e,t){this.id=ce++,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(l({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];o.s.und(n)||this.springs[t].set(n)}}update(e){return e&&this.queue.push(Q(e)),this}start(e){let{queue:t}=this;return e?t=Object(o.y)(e).map(Q):this.queue=[],this._flush?this._flush(this,t):(be(this,t),ie(this,t))}stop(e,t){if(e!==!!e&&(t=e),t){const n=this.springs;Object(o.k)(Object(o.y)(t),t=>n[t].stop(!!e))}else A(this._state,this._lastAsyncId),this.each(t=>t.stop(!!e));return this}pause(e){if(o.s.und(e))this.start({pause:!0});else{const t=this.springs;Object(o.k)(Object(o.y)(e),e=>t[e].pause())}return this}resume(e){if(o.s.und(e))this.start({pause:!1});else{const t=this.springs;Object(o.k)(Object(o.y)(e),e=>t[e].resume())}return this}each(e){Object(o.l)(this.springs,e)}_onFrame(){const{onStart:e,onChange:t,onRest:n}=this._events,r=this._active.size>0,c=this._changed.size>0;(r&&!this._started||c&&!this._started)&&(this._started=!0,Object(o.m)(e,([e,t])=>{t.value=this.get(),e(t,this,this._item)}));const l=!r&&this._started,i=c||l&&n.size?this.get():null;c&&t.size&&Object(o.m)(t,([e,t])=>{t.value=i,e(t,this,this._item)}),l&&(this._started=!1,Object(o.m)(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)}o.w.onFrame(this._onFrame)}}function ie(e,t){return Promise.all(t.map(t=>async function e(t,n,r){const{keys:c,to:l,from:i,loop:a,onRest:s,onResolve:d}=n,b=o.s.obj(n.default)&&n.default;a&&(n.loop=!1);!1===l&&(n.to=null);!1===i&&(n.from=null);const p=o.s.arr(l)||o.s.fun(l)?l:void 0;p?(n.to=void 0,n.onRest=void 0,b&&(b.onRest=void 0)):Object(o.k)(re,e=>{const r=n[e];if(o.s.fun(r)){const o=t._events[e];n[e]=({finished:e,cancelled:t})=>{const n=o.get(r);n?(e||(n.finished=!1),t&&(n.cancelled=!0)):o.set(r,{value:null,finished:e||!1,cancelled:t||!1})},b&&(b[e]=n[e])}});const m=t._state;n.pause===!m.paused?(m.paused=n.pause,Object(o.n)(n.pause?m.pauseQueue:m.resumeQueue)):m.paused&&(n.pause=!0);const f=(c||Object.keys(t.springs)).map(e=>t.springs[e].start(n)),h=!0===n.cancel||!0===u(n,"cancel");(p||h&&m.asyncId)&&f.push(T(++t._lastAsyncId,{props:n,state:m,actions:{pause:o.v,resume:o.v,start(e,n){h?(A(m,t._lastAsyncId),n(M(t))):(e.onRest=s,n(L(p,e,m,t)))}}}));m.paused&&await new Promise(e=>{m.resumeQueue.add(e)});const g=P(t,await Promise.all(f));if(a&&g.finished&&(!r||!g.noop)){const o=X(n,a,l);if(o)return be(t,[o]),e(t,o,!0)}d&&o.w.batchedUpdates(()=>d(g,t,t.item));return g}(e,t))).then(t=>P(e,t))}function ae(e,t){const n=l({},e.springs);return t&&Object(o.k)(Object(o.y)(t),e=>{o.s.und(e.keys)&&(e=Q(e)),o.s.obj(e.to)||(e=l({},e,{to:void 0})),de(n,e,e=>ue(e))}),se(e,n),n}function se(e,t){Object(o.l)(t,(t,n)=>{e.springs[n]||(e.springs[n]=t,Object(o.c)(t,e))})}function ue(e,t){const n=new $;return n.key=e,t&&Object(o.c)(n,t),n}function de(e,t,n){t.keys&&Object(o.k)(t.keys,o=>{(e[o]||(e[o]=n(o)))._prepareNode(t)})}function be(e,t){Object(o.k)(t,t=>{de(e.springs,t,t=>ue(t,e))})}function pe(e,t){if(null==e)return{};var n,o,r={},c=Object.keys(e);for(o=0;o=0||(r[n]=e[n]);return r}const me=["children"],fe=e=>{let{children:t}=e,n=pe(e,me);const c=Object(r.useContext)(he),l=n.pause||!!c.pause,i=n.immediate||!!c.immediate;n=Object(o.B)(()=>({pause:l,immediate:i}),[l,i]);const{Provider:a}=he;return r.createElement(a,{value:n},t)},he=(ge=fe,Oe={},Object.assign(ge,r.createContext(Oe)),ge.Provider._context=ge,ge.Consumer._context=ge,ge);var ge,Oe;fe.Provider=he.Provider,fe.Consumer=he.Consumer;const ve=()=>{const e=[],t=function(t){Object(o.i)();const r=[];return Object(o.k)(e,(e,c)=>{if(o.s.und(t))r.push(e.start());else{const o=n(t,e,c);o&&r.push(e.start(o))}}),r};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 Object(o.k)(e,e=>e.pause(...arguments)),this},t.resume=function(){return Object(o.k)(e,e=>e.resume(...arguments)),this},t.set=function(t){Object(o.k)(e,e=>e.set(t))},t.start=function(t){const n=[];return Object(o.k)(e,(e,r)=>{if(o.s.und(t))n.push(e.start());else{const o=this._getProps(t,e,r);o&&n.push(e.start(o))}}),n},t.stop=function(){return Object(o.k)(e,e=>e.stop(...arguments)),this},t.update=function(t){return Object(o.k)(e,(e,n)=>e.update(this._getProps(t,e,n))),this};const n=function(e,t,n){return o.s.fun(e)?e(n,t):e};return t._getProps=n,t};function je(e,t,n){const c=o.s.fun(t)&&t;c&&!n&&(n=[]);const i=Object(r.useMemo)(()=>c||3==arguments.length?ve():void 0,[]),a=Object(r.useRef)(0),s=Object(o.z)(),u=Object(r.useMemo)(()=>({ctrls:[],queue:[],flush(e,t){const n=ae(e,t);return a.current>0&&!u.queue.length&&!Object.keys(n).some(t=>!e.springs[t])?ie(e,t):new Promise(o=>{se(e,n),u.queue.push(()=>{o(ie(e,t))}),s()})}}),[]),d=Object(r.useRef)([...u.ctrls]),b=[],p=Object(o.D)(e)||0;function m(e,n){for(let o=e;o{Object(o.k)(d.current.slice(e,p),e=>{v(e,i),e.stop(!0)}),d.current.length=e,m(p,e)},[e]),Object(r.useMemo)(()=>{m(0,Math.min(p,e))},n);const f=d.current.map((e,t)=>ae(e,b[t])),h=Object(r.useContext)(fe),O=Object(o.D)(h),k=h!==O&&g(h);Object(o.A)(()=>{a.current++,u.ctrls=d.current;const{queue:e}=u;e.length&&(u.queue=[],Object(o.k)(e,e=>e())),Object(o.k)(d.current,(e,t)=>{null==i||i.add(e),k&&e.start({default:h});const n=b[t];n&&(j(e,n.ref),e.ref?e.queue.push(n):e.start(n))})}),Object(o.C)(()=>()=>{Object(o.k)(u.ctrls,e=>e.stop(!0))});const _=f.map(e=>l({},e));return i?[_,i]:_}function ke(e,t){const n=o.s.fun(e),[[r],c]=je(1,n?e:[e],n?t||[]:t);return n||2==arguments.length?[r,c]:r}let _e;!function(e){e.MOUNT="mount",e.ENTER="enter",e.UPDATE="update",e.LEAVE="leave"}(_e||(_e={}));class ye extends V{constructor(e,t){super(),this.key=void 0,this.idle=!0,this.calc=void 0,this._active=new Set,this.source=e,this.calc=Object(o.f)(...t);const n=this._get(),r=Object(c.f)(n);Object(c.h)(this,r.create(n))}advance(e){const t=this._get(),n=this.get();Object(o.u)(t,n)||(Object(c.e)(this).setValue(t),this._onChange(t,this.idle)),!this.idle&&Ce(this._active)&&Se(this)}_get(){const e=o.s.arr(this.source)?this.source.map(o.q):Object(o.y)(Object(o.q)(this.source));return this.calc(...e)}_start(){this.idle&&!Ce(this._active)&&(this.idle=!1,Object(o.k)(Object(c.g)(this),e=>{e.done=!1}),o.b.skipAnimation?(o.w.batchedUpdates(()=>this.advance()),Se(this)):o.o.start(this))}_attach(){let e=1;Object(o.k)(Object(o.y)(this.source),t=>{Object(o.r)(t)&&Object(o.c)(t,this),z(t)&&(t.idle||this._active.add(t),e=Math.max(e,t.priority+1))}),this.priority=e,this._start()}_detach(){Object(o.k)(Object(o.y)(this.source),e=>{Object(o.r)(e)&&Object(o.x)(e,this)}),this._active.clear(),Se(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=Object(o.y)(this.source).reduce((e,t)=>Math.max(e,(z(t)?t.priority:0)+1),0))}}function Ee(e){return!1!==e.idle}function Ce(e){return!e.size||Array.from(e).every(Ee)}function Se(e){e.idle||(e.idle=!0,Object(o.k)(Object(c.g)(e),e=>{e.done=!0}),Object(o.d)(e,{type:"idle",parent:e}))}o.b.assign({createStringInterpolator:o.g,to:(e,t)=>new ye(e,t)});o.o.advance},l3Sj:function(e,t){e.exports=window.wp.i18n},lJLt:function(e,t,n){"use strict";n.d(t,"a",(function(){return r})),n.d(t,"b",(function(){return c}));var o=n("l3Sj");const r={insertUsage:{}},c={alignWide:!1,supportsLayout:!0,colors:[{name:Object(o.__)("Black"),slug:"black",color:"#000000"},{name:Object(o.__)("Cyan bluish gray"),slug:"cyan-bluish-gray",color:"#abb8c3"},{name:Object(o.__)("White"),slug:"white",color:"#ffffff"},{name:Object(o.__)("Pale pink"),slug:"pale-pink",color:"#f78da7"},{name:Object(o.__)("Vivid red"),slug:"vivid-red",color:"#cf2e2e"},{name:Object(o.__)("Luminous vivid orange"),slug:"luminous-vivid-orange",color:"#ff6900"},{name:Object(o.__)("Luminous vivid amber"),slug:"luminous-vivid-amber",color:"#fcb900"},{name:Object(o.__)("Light green cyan"),slug:"light-green-cyan",color:"#7bdcb5"},{name:Object(o.__)("Vivid green cyan"),slug:"vivid-green-cyan",color:"#00d084"},{name:Object(o.__)("Pale cyan blue"),slug:"pale-cyan-blue",color:"#8ed1fc"},{name:Object(o.__)("Vivid cyan blue"),slug:"vivid-cyan-blue",color:"#0693e3"},{name:Object(o.__)("Vivid purple"),slug:"vivid-purple",color:"#9b51e0"}],fontSizes:[{name:Object(o._x)("Small","font size name"),size:13,slug:"small"},{name:Object(o._x)("Normal","font size name"),size:16,slug:"normal"},{name:Object(o._x)("Medium","font size name"),size:20,slug:"medium"},{name:Object(o._x)("Large","font size name"),size:36,slug:"large"},{name:Object(o._x)("Huge","font size name"),size:42,slug:"huge"}],imageDefaultSize:"large",imageSizes:[{slug:"thumbnail",name:Object(o.__)("Thumbnail")},{slug:"medium",name:Object(o.__)("Medium")},{slug:"large",name:Object(o.__)("Large")},{slug:"full",name:Object(o.__)("Full Size")}],imageEditing:!0,maxWidth:580,allowedBlockTypes:!0,maxUploadFileSize:0,allowedMimeTypes:null,__experimentalCanUserUseUnfilteredHTML:!1,__experimentalBlockDirectory:!1,__mobileEnablePageTemplates:!1,__experimentalBlockPatterns:[],__experimentalBlockPatternCategories:[],__experimentalSpotlightEntityBlocks:[],__experimentalGenerateAnchors:!1,__unstableGalleryWithImageBlocks:!1,gradients:[{name:Object(o.__)("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:Object(o.__)("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:Object(o.__)("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:Object(o.__)("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:Object(o.__)("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:Object(o.__)("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:Object(o.__)("Blush light purple"),gradient:"linear-gradient(135deg,rgb(255,206,236) 0%,rgb(152,150,240) 100%)",slug:"blush-light-purple"},{name:Object(o.__)("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:Object(o.__)("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:Object(o.__)("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:Object(o.__)("Electric grass"),gradient:"linear-gradient(135deg,rgb(202,248,128) 0%,rgb(113,206,126) 100%)",slug:"electric-grass"},{name:Object(o.__)("Midnight"),gradient:"linear-gradient(135deg,rgb(2,3,129) 0%,rgb(40,116,252) 100%)",slug:"midnight"}]}},mdLt:function(e,t,n){"use strict";var o=n("GRId"),r=n("tI+e");t.a=function(e){let{title:t,icon:n,children:c}=e;return Object(o.createElement)(o.Fragment,null,Object(o.createElement)("div",{className:"block-editor-inserter__panel-header"},Object(o.createElement)("h2",{className:"block-editor-inserter__panel-title"},t),Object(o.createElement)(r.Icon,{icon:n})),Object(o.createElement)("div",{className:"block-editor-inserter__panel-content"},c))}},mlss:function(e,t,n){"use strict";var o=n("tI+e");const{Fill:r,Slot:c}=Object(o.createSlotFill)("__unstableInserterMenuExtension");r.Slot=c,t.a=r},nEW0:function(e,t,n){"use strict";n.d(t,"w",(function(){return r})),n.d(t,"a",(function(){return ve})),n.d(t,"b",(function(){return A})),n.d(t,"c",(function(){return ke})),n.d(t,"d",(function(){return Oe})),n.d(t,"e",(function(){return K})),n.d(t,"f",(function(){return de})),n.d(t,"g",(function(){return Re})),n.d(t,"h",(function(){return y})),n.d(t,"i",(function(){return Fe})),n.d(t,"j",(function(){return Ae})),n.d(t,"k",(function(){return S})),n.d(t,"l",(function(){return w})),n.d(t,"m",(function(){return x})),n.d(t,"n",(function(){return B})),n.d(t,"o",(function(){return V})),n.d(t,"p",(function(){return ge})),n.d(t,"q",(function(){return he})),n.d(t,"r",(function(){return fe})),n.d(t,"s",(function(){return E})),n.d(t,"t",(function(){return ze})),n.d(t,"u",(function(){return C})),n.d(t,"v",(function(){return _})),n.d(t,"x",(function(){return _e})),n.d(t,"y",(function(){return I})),n.d(t,"z",(function(){return Ge})),n.d(t,"A",(function(){return Ke})),n.d(t,"B",(function(){return We})),n.d(t,"C",(function(){return He})),n.d(t,"D",(function(){return qe}));let o=v();const r=e=>f(e,o);let c=v();r.write=e=>f(e,c);let l=v();r.onStart=e=>f(e,l);let i=v();r.onFrame=e=>f(e,i);let a=v();r.onFinish=e=>f(e,a);let s=[];r.setTimeout=(e,t)=>{let n=r.now()+t,o=()=>{let e=s.findIndex(e=>e.cancel==o);~e&&s.splice(e,1),p-=~e?1:0},c={time:n,handler:e,cancel:o};return s.splice(u(n),0,c),p+=1,h(),c};let u=e=>~(~s.findIndex(t=>t.time>e)||~s.length);r.cancel=e=>{l.delete(e),i.delete(e),o.delete(e),c.delete(e),a.delete(e)},r.sync=e=>{m=!0,r.batchedUpdates(e),m=!1},r.throttle=e=>{let t;function n(){try{e(...t)}finally{t=null}}function o(...e){t=e,r.onStart(n)}return o.handler=e,o.cancel=()=>{l.delete(n),t=null},o};let d="undefined"!=typeof window?window.requestAnimationFrame:()=>{};r.use=e=>d=e,r.now="undefined"!=typeof performance?()=>performance.now():Date.now,r.batchedUpdates=e=>e(),r.catch=console.error,r.frameLoop="always",r.advance=()=>{"demand"!==r.frameLoop?console.warn("Cannot call the manual advancement of rafz whilst frameLoop is not set as demand"):O()};let b=-1,p=0,m=!1;function f(e,t){m?(t.delete(e),e(0)):(t.add(e),h())}function h(){b<0&&(b=0,"demand"!==r.frameLoop&&d(g))}function g(){~b&&(d(g),r.batchedUpdates(O))}function O(){let e=b;b=r.now();let t=u(b);t&&(j(s.splice(0,t),e=>e.handler()),p-=t),l.flush(),o.flush(e?Math.min(64,b-e):16.667),i.flush(),c.flush(),a.flush(),p||(b=-1)}function v(){let e=new Set,t=e;return{add(n){p+=t!=e||e.has(n)?0:1,e.add(n)},delete:n=>(p-=t==e&&e.has(n)?1:0,e.delete(n)),flush(n){t.size&&(e=new Set,p-=t.size,j(t,t=>t(n)&&e.add(t)),p+=e.size,t=e)}}}function j(e,t){e.forEach(e=>{try{t(e)}catch(e){r.catch(e)}})}var k=n("cDcd");function _(){}const y=(e,t,n)=>Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0}),E={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 C(e,t){if(E.arr(e)){if(!E.arr(t)||e.length!==t.length)return!1;for(let n=0;ne.forEach(t);function w(e,t,n){if(E.arr(e))for(let o=0;oE.und(e)?[]:E.arr(e)?e:[e];function x(e,t){if(e.size){const n=Array.from(e);e.clear(),S(n,t)}}const B=(e,...t)=>x(e,e=>e(...t)),T=()=>"undefined"==typeof window||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent);let P,R,N=null,M=!1,L=_;var A=Object.freeze({__proto__:null,get createStringInterpolator(){return P},get to(){return R},get colors(){return N},get skipAnimation(){return M},get willAdvance(){return L},assign:e=>{e.to&&(R=e.to),e.now&&(r.now=e.now),void 0!==e.colors&&(N=e.colors),null!=e.skipAnimation&&(M=e.skipAnimation),e.createStringInterpolator&&(P=e.createStringInterpolator),e.requestAnimationFrame&&r.use(e.requestAnimationFrame),e.batchedUpdates&&(r.batchedUpdates=e.batchedUpdates),e.willAdvance&&(L=e.willAdvance),e.frameLoop&&(r.frameLoop=e.frameLoop)}});const D=new Set;let F=[],z=[],H=0;const V={get idle(){return!D.size&&!F.length},start(e){H>e.priority?(D.add(e),r.onStart(G)):(U(e),r(q))},advance:q,sort(e){if(H)r.onFrame(()=>V.sort(e));else{const t=F.indexOf(e);~t&&(F.splice(t,1),W(e))}},clear(){F=[],D.clear()}};function G(){D.forEach(U),D.clear(),r(q)}function U(e){F.includes(e)||W(e)}function W(e){F.splice(function(e,t){const n=e.findIndex(t);return n<0?e.length:n}(F,t=>t.priority>e.priority),0,e)}function q(e){const t=z;for(let n=0;n0}const K={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},Y="[-+]?\\d*\\.?\\d+";function $(...e){return"\\(\\s*("+e.join(")\\s*,\\s*(")+")\\s*\\)"}const Z=new RegExp("rgb"+$(Y,Y,Y)),X=new RegExp("rgba"+$(Y,Y,Y,Y)),Q=new RegExp("hsl"+$(Y,"[-+]?\\d*\\.?\\d+%","[-+]?\\d*\\.?\\d+%")),J=new RegExp("hsla"+$(Y,"[-+]?\\d*\\.?\\d+%","[-+]?\\d*\\.?\\d+%",Y)),ee=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,te=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,ne=/^#([0-9a-fA-F]{6})$/,oe=/^#([0-9a-fA-F]{8})$/;function re(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 ce(e,t,n){const o=n<.5?n*(1+t):n+t-n*t,r=2*n-o,c=re(r,o,e+1/3),l=re(r,o,e),i=re(r,o,e-1/3);return Math.round(255*c)<<24|Math.round(255*l)<<16|Math.round(255*i)<<8}function le(e){const t=parseInt(e,10);return t<0?0:t>255?255:t}function ie(e){return(parseFloat(e)%360+360)%360/360}function ae(e){const t=parseFloat(e);return t<0?0:t>1?255:Math.round(255*t)}function se(e){const t=parseFloat(e);return t<0?0:t>100?1:t/100}function ue(e){let t=function(e){let t;return"number"==typeof e?e>>>0===e&&e>=0&&e<=4294967295?e:null:(t=ne.exec(e))?parseInt(t[1]+"ff",16)>>>0:N&&void 0!==N[e]?N[e]:(t=Z.exec(e))?(le(t[1])<<24|le(t[2])<<16|le(t[3])<<8|255)>>>0:(t=X.exec(e))?(le(t[1])<<24|le(t[2])<<16|le(t[3])<<8|ae(t[4]))>>>0:(t=ee.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+"ff",16)>>>0:(t=oe.exec(e))?parseInt(t[1],16)>>>0:(t=te.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+t[4]+t[4],16)>>>0:(t=Q.exec(e))?(255|ce(ie(t[1]),se(t[2]),se(t[3])))>>>0:(t=J.exec(e))?(ce(ie(t[1]),se(t[2]),se(t[3]))|ae(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 de=(e,t,n)=>{if(E.fun(e))return e;if(E.arr(e))return de({range:e,output:t,extrapolate:n});if(E.str(e.output[0]))return P(e);const o=e,r=o.output,c=o.range||[0,1],l=o.extrapolateLeft||o.extrapolate||"extend",i=o.extrapolateRight||o.extrapolate||"extend",a=o.easing||(e=>e);return e=>{const t=function(e,t){for(var n=1;n=e);++n);return n-1}(e,c);return function(e,t,n,o,r,c,l,i,a){let s=a?a(e):e;if(sn){if("identity"===i)return s;"clamp"===i&&(s=n)}if(o===r)return o;if(t===n)return e<=t?o:r;t===-1/0?s=-s:n===1/0?s-=t:s=(s-t)/(n-t);s=c(s),o===-1/0?s=-s:r===1/0?s+=o:s=s*(r-o)+o;return s}(e,c[t],c[t+1],r[t],r[t+1],a,l,i,o.map)}};function be(){return(be=Object.assign||function(e){for(var t=1;tBoolean(e&&e[pe]),he=e=>e&&e[pe]?e[pe]():e,ge=e=>e[me]||null;function Oe(e,t){let n=e[me];n&&n.forEach(e=>{!function(e,t){e.eventObserved?e.eventObserved(t):e(t)}(e,t)})}class ve{constructor(e){if(this[pe]=void 0,this[me]=void 0,!e&&!(e=this.get))throw Error("Unknown getter");je(this,e)}}const je=(e,t)=>ye(e,pe,t);function ke(e,t){if(e[pe]){let n=e[me];n||ye(e,me,n=new Set),n.has(t)||(n.add(t),e.observerAdded&&e.observerAdded(n.size,t))}return t}function _e(e,t){let n=e[me];if(n&&n.has(t)){const o=n.size-1;o?n.delete(t):e[me]=null,e.observerRemoved&&e.observerRemoved(o,t)}}const ye=(e,t,n)=>Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0}),Ee=/[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,Ce=/(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi,Se=new RegExp(`(${Ee.source})(%|[a-z]+)`,"i"),we=/rgba\(([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+)\)/gi,Ie=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/,xe=e=>{const[t,n]=Be(e);if(!t||T())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&&Ie.test(n)?xe(n):n||e},Be=e=>{const t=Ie.exec(e);if(!t)return[,];const[,n,o]=t;return[n,o]};let Te;const Pe=(e,t,n,o,r)=>`rgba(${Math.round(t)}, ${Math.round(n)}, ${Math.round(o)}, ${r})`,Re=e=>{Te||(Te=N?new RegExp(`(${Object.keys(N).join("|")})(?!\\w)`,"g"):/^\b$/);const t=e.output.map(e=>he(e).replace(Ie,xe).replace(Ce,ue).replace(Te,ue)),n=t.map(e=>e.match(Ee).map(Number)),o=n[0].map((e,t)=>n.map(e=>{if(!(t in e))throw Error('The arity of each "output" value must be equal');return e[t]})).map(t=>de(be({},e,{output:t})));return e=>{var n;const r=!Se.test(t[0])&&(null==(n=t.find(e=>Se.test(e)))?void 0:n.replace(Ee,""));let c=0;return t[0].replace(Ee,()=>`${o[c++](e)}${r||""}`).replace(we,Pe)}},Ne="react-spring: ",Me=e=>{const t=e;let n=!1;if("function"!=typeof t)throw new TypeError(Ne+"once requires a function parameter");return(...e)=>{n||(t(...e),n=!0)}},Le=Me(console.warn);function Ae(){Le(Ne+'The "interpolate" function is deprecated in v9 (use "to" instead)')}const De=Me(console.warn);function Fe(){De(Ne+'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')}function ze(e){return E.str(e)&&("#"==e[0]||/\d/.test(e)||!T()&&Ie.test(e)||e in(N||{}))}const He=e=>Object(k.useEffect)(e,Ve),Ve=[];function Ge(){const e=Object(k.useState)()[1],t=Object(k.useState)(Ue)[0];return He(t.unmount),()=>{t.current&&e({})}}function Ue(){const e={current:!0,unmount:()=>()=>{e.current=!1}};return e}function We(e,t){const[n]=Object(k.useState)(()=>({inputs:t,result:e()})),o=Object(k.useRef)(),r=o.current;let c=r;if(c){Boolean(t&&c.inputs&&function(e,t){if(e.length!==t.length)return!1;for(let n=0;n{o.current=c,r==n&&(n.inputs=n.result=void 0)},[c]),c.result}function qe(e){const t=Object(k.useRef)();return Object(k.useEffect)(()=>{t.current=e}),t.current}const Ke="undefined"!=typeof window&&window.document&&window.document.createElement?k.useLayoutEffect:k.useEffect},nQUx:function(e,t,n){"use strict";var o=n("YLtl"),r=n("GRId"),c=n("HSyU"),l=n("1ZqX"),i=n("l3Sj"),a=n("onLe"),s=n("BhPs");t.a=(e,t)=>{const{patternCategories:n,patterns:u}=Object(l.useSelect)(e=>{const{__experimentalGetAllowedPatterns:n,getSettings:o}=e(s.a);return{patterns:n(t),patternCategories:o().__experimentalBlockPatternCategories}},[t]),{createSuccessNotice:d}=Object(l.useDispatch)(a.store);return[u,n,Object(r.useCallback)((t,n)=>{e(Object(o.map)(n,e=>Object(c.cloneBlock)(e)),t.name),d(Object(i.sprintf)(Object(i.__)('Block pattern "%s" inserted.'),t.title),{type:"snackbar"})},[])]}},nlh6:function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return w}));var o=n("TSYQ"),r=n.n(o),c=n("GRId"),l=n("l3Sj"),i=n("HSyU"),a=n("K9lf"),s=n("1ZqX"),u=(n("Z23Y"),n("Xkls")),d=n("jBNB"),b=n("z+q2"),p=n("kBLm"),m=n("ur0x"),f=n("Q2Xw"),h=n("YZt4"),g=n("ERVc"),O=n("+6d5"),v=n("6jxZ"),j=n("felP"),k=n("JDWi"),_=n("G4zt"),y=n("PKbb"),E=n("hw9B"),C=n("rHRV"),S=n("BhPs");function w(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{__unstableIsHtml:n}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{clientId:o,className:w,wrapperProps:I={},isAligned:x}=Object(c.useContext)(d.a),{index:B,mode:T,name:P,blockApiVersion:R,blockTitle:N,isPartOfSelection:M,adjustScrolling:L,enableAnimation:A}=Object(s.useSelect)(e=>{const{getBlockIndex:t,getBlockMode:n,getBlockName:r,isTyping:c,getGlobalBlockCount:l,isBlockSelected:a,isBlockMultiSelected:s,isAncestorMultiSelected:u,isFirstMultiSelectedBlock:d}=e(S.a),b=a(o),p=s(o)||u(o),m=r(o),f=Object(i.getBlockType)(m);return{index:t(o),mode:n(o),name:m,blockApiVersion:(null==f?void 0:f.apiVersion)||1,blockTitle:null==f?void 0:f.title,isPartOfSelection:b||p,adjustScrolling:b||d(o),enableAnimation:!c()&&l()<=200}},[o]),D=Object(l.sprintf)(Object(l.__)("Block: %s"),N),F="html"!==T||n?"":"-visual",z=Object(a.useMergeRefs)([t.ref,Object(b.a)(o),Object(_.a)(o),Object(y.c)(o),Object(v.a)(o),Object(E.a)(o),Object(j.a)(o),Object(k.a)(o),Object(p.a)(),Object(C.a)(),Object(u.a)({isSelected:M,adjustScrolling:L,enableAnimation:A,triggerAnimationOnChange:B})]),H=Object(m.c)();return R<2&&o===H.clientId&&void 0!==e&&e.env,{...I,...t,ref:z,id:`block-${o}${F}`,tabIndex:0,role:"document","aria-label":D,"data-block":o,"data-type":P,"data-title":N,className:r()(r()("block-editor-block-list__block",{"wp-block":!x}),w,t.className,I.className,Object(f.a)(o),Object(h.a)(o),Object(g.a)(o),Object(O.a)(o)),style:{...I.style,...t.style}}}w.save=i.__unstableGetBlockProps}).call(this,n("8oxB"))},o97j:function(e,t,n){"use strict";var o=!("undefined"==typeof window||!window.document||!window.document.createElement),r={canUseDOM:o,canUseWorkers:"undefined"!=typeof Worker,canUseEventListeners:o&&!(!window.addEventListener&&!window.attachEvent),canUseViewport:o&&!!window.screen,isInWorker:!o};e.exports=r},onLe:function(e,t){e.exports=window.wp.notices},p3NJ:function(e,t,n){"use strict";n.d(t,"b",(function(){return R}));var o=n("wx14"),r=n("GRId"),c=n("TSYQ"),l=n.n(c),i=n("K9lf"),a=n("1ZqX"),s=n("HSyU"),u=n("I5Hl"),d=n("ur0x");var b=Object(i.createHigherOrderComponent)(e=>t=>{const{clientId:n}=Object(d.c)();return Object(r.createElement)(e,Object(o.a)({},t,{clientId:n}))},"withClientId");var p=b(e=>{let{clientId:t,showSeparator:n,isFloating:o,onAddBlock:c,isToggle:i}=e;return Object(r.createElement)(u.b,{className:l()({"block-list-appender__toggle":i}),rootClientId:t,showSeparator:n,isFloating:o,onAddBlock:c})}),m=n("YLtl"),f=n("5L8O"),h=n("BhPs");var g=Object(i.compose)([b,Object(a.withSelect)((e,t)=>{let{clientId:n}=t;const{getBlockOrder:o}=e(h.a),r=o(n);return{lastBlockClientId:Object(m.last)(r)}})])(e=>{let{clientId:t,lastBlockClientId:n}=e;return Object(r.createElement)(f.a,{rootClientId:t,lastBlockClientId:n})}),O=n("rl8x"),v=n.n(O),j=n("PPMp");const k=new WeakMap;var _=n("VyCT"),y=n("uoCR"),E=n("JGYp"),C=n("l3Sj"),S=n("/lNF"),w=n("vIlp");function I(e,t,n){const o="horizontal"===n?["left","right"]:["top","bottom"],r=Object(C.isRTL)();let c,l;return e.forEach((e,n)=>{const i=e.getBoundingClientRect(),[a,s]=Object(w.a)(t,i,o);if(void 0===l||a0&&void 0!==arguments[0]?arguments[0]:{};const[t,n]=Object(r.useState)(null),o=Object(a.useSelect)(t=>{const{getTemplateLock:n}=t(h.a);return"all"===n(e)},[e]),{getBlockListSettings:c}=Object(a.useSelect)(h.a),{showInsertionPoint:l,hideInsertionPoint:s}=Object(a.useDispatch)(h.a),u=Object(S.a)(e,t),d=Object(i.useThrottle)(Object(r.useCallback)((t,o)=>{var r;const i=I(Array.from(o.children).filter(e=>e.classList.contains("wp-block")),{x:t.clientX,y:t.clientY},null===(r=c(e))||void 0===r?void 0:r.orientation);n(void 0===i?0:i),null!==i&&l(e,i)},[]),200);return Object(i.__experimentalUseDropZone)({isDisabled:o,onDrop:u,onDragOver(e){d(e,e.currentTarget)},onDragLeave(){d.cancel(),s(),n(null)},onDragEnd(){d.cancel(),s(),n(null)}})}function B(e){const{clientId:t,allowedBlocks:n,__experimentalDefaultBlock:o,__experimentalDirectInsert:c,template:l,templateLock:i,wrapperRef:u,templateInsertUpdatesSelection:d,__experimentalCaptureToolbars:b,__experimentalAppenderTagName:p,renderAppender:f,orientation:g,placeholder:O,__experimentalLayout:E}=e;!function(e,t,n,o,c,l,i,s){const{updateBlockListSettings:u}=Object(a.useDispatch)(h.a),{blockListSettings:d,parentLock:b}=Object(a.useSelect)(t=>{const n=t(h.a).getBlockRootClientId(e);return{blockListSettings:t(h.a).getBlockListSettings(e),parentLock:t(h.a).getTemplateLock(n)}},[e]),p=Object(r.useMemo)(()=>t,t);Object(r.useLayoutEffect)(()=>{const t={allowedBlocks:p,templateLock:void 0===c?b:c};if(void 0!==l&&(t.__experimentalCaptureToolbars=l),void 0!==i)t.orientation=i;else{const e=Object(j.a)(null==s?void 0:s.type);t.orientation=e.getOrientation(s)}void 0!==n&&(t.__experimentalDefaultBlock=n),void 0!==o&&(t.__experimentalDirectInsert=o),v()(d,t)||u(e,t)},[e,d,p,n,o,c,b,l,i,u,s])}(t,n,o,c,i,b,g,E),function(e,t,n,o){const{getSelectedBlocksInitialCaretPosition:c}=Object(a.useSelect)(h.a),{replaceInnerBlocks:l}=Object(a.useDispatch)(h.a),i=Object(a.useSelect)(t=>t(h.a).getBlocks(e),[e]),u=Object(r.useRef)(null);Object(r.useLayoutEffect)(()=>{if(0===i.length||"all"===n){if(!Object(m.isEqual)(t,u.current)){u.current=t;const n=Object(s.synchronizeBlocksWithTemplate)(i,t);Object(m.isEqual)(n,i)||l(e,n,0===i.length&&o&&0!==n.length,c())}}},[i,t,n,e])}(t,l,i,d);const C=Object(a.useSelect)(e=>{const n=e(h.a).getBlock(t),o=Object(s.getBlockType)(n.name);if(o&&o.providesContext)return function(e,t){k.has(t)||k.set(t,new WeakMap);const n=k.get(t);if(!n.has(e)){const o=Object(m.mapValues)(t.providesContext,t=>e[t]);n.set(e,o)}return n.get(e)}(n.attributes,o)},[t]);return Object(r.createElement)(y.a,{value:C},Object(r.createElement)(_.a,{rootClientId:t,renderAppender:f,__experimentalAppenderTagName:p,__experimentalLayout:E,wrapperRef:u,placeholder:O}))}function T(e){return Object(E.a)(e),Object(r.createElement)(B,e)}const P=Object(r.forwardRef)((e,t)=>{const n=R({ref:t},e);return Object(r.createElement)("div",{className:"block-editor-inner-blocks"},Object(r.createElement)("div",n))});function R(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{clientId:n}=Object(d.c)(),c=Object(i.useViewportMatch)("medium","<"),{__experimentalCaptureToolbars:u,hasOverlay:b}=Object(a.useSelect)(e=>{if(!n)return{};const{getBlockName:t,isBlockSelected:o,hasSelectedInnerBlock:r,isNavigationMode:l}=e(h.a),i=t(n),a=l()||c;return{__experimentalCaptureToolbars:e(s.store).hasBlockSupport(i,"__experimentalExposeControlsToChildren",!1),hasOverlay:"core/template"!==i&&!o(n)&&!r(n,!0)&&a}},[n,c]),p=Object(i.useMergeRefs)([e.ref,x({rootClientId:n})]),m={__experimentalCaptureToolbars:u,...t},f=m.value&&m.onChange?T:B;return{...e,ref:p,className:l()(e.className,"block-editor-block-list__layout",{"has-overlay":b}),children:n?Object(r.createElement)(f,Object(o.a)({},m,{clientId:n})):Object(r.createElement)(_.a,t)}}R.save=s.__unstableGetInnerBlocksProps,P.DefaultBlockAppender=g,P.ButtonBlockAppender=p,P.Content=()=>R.save().children;t.a=P},pOGT:function(e,t,n){"use strict";n.d(t,"a",(function(){return p})),n.d(t,"b",(function(){return m}));var o=n("YLtl");const r=e=>e.name||"",c=e=>e.title,l=e=>e.description||"",i=e=>e.keywords||[],a=e=>e.category,s=()=>null;function u(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return e=Object(o.deburr)(e),e=e.replace(/^\//,""),e=e.toLowerCase(),e}const d=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return Object(o.words)(u(e))},b=(e,t)=>Object(o.differenceWith)(e,d(t),(e,t)=>t.includes(e)),p=(e,t,n,r)=>{if(0===d(r).length)return e;return m(e,r,{getCategory:e=>{var n;return null===(n=Object(o.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}})},m=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=d(t);if(0===o.length)return e;const r=e.map(e=>[e,f(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 f(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{getName:d=r,getTitle:p=c,getDescription:m=l,getKeywords:f=i,getCategory:h=a,getCollection:g=s}=n,O=d(e),v=p(e),j=m(e),k=f(e),_=h(e),y=g(e),E=u(t),C=u(v);let S=0;if(E===C)S+=30;else if(C.startsWith(E))S+=20;else{const e=[O,v,j,...k,_,y].join(" "),t=Object(o.words)(E);0===b(t,e).length&&(S+=10)}return 0!==S&&O.startsWith("core/")&&S++,S}},pPDe:function(e,t,n){"use strict";var o,r;function c(e){return[e]}function l(){var e={clear:function(){e.head=null}};return e}function i(e,t,n){var o;if(e.length!==t.length)return!1;for(o=n;o{})}=e;const{replaceBlocks:p}=Object(i.useDispatch)(s.a);return n||o?Object(r.createElement)(r.Fragment,null,n&&Object(r.createElement)(l.MenuItem,{onClick:()=>{(()=>{const e=Object(a.switchToBlockType)(c,d);e&&p(t,e)})(),b()}},Object(u._x)("Group","verb")),o&&Object(r.createElement)(l.MenuItem,{onClick:()=>{(()=>{const e=c[0].innerBlocks;e.length&&p(t,e)})(),b()}},Object(u._x)("Ungroup","Ungrouping blocks from within a Group block back into individual blocks within the Editor "))):null}const{Fill:b,Slot:p}=Object(l.createSlotFill)("BlockSettingsMenuControls");function m(e){let{...t}=e;return Object(r.createElement)(l.__experimentalStyleProvider,{document:document},Object(r.createElement)(b,t))}m.Slot=e=>{let{fillProps:t,clientIds:n=null}=e;const{selectedBlocks:u,selectedClientIds:b}=Object(i.useSelect)(e=>{const{getBlocksByClientId:t,getSelectedBlockClientIds:o}=e(s.a),r=null!==n?n:o();return{selectedBlocks:Object(c.map)(Object(c.compact)(t(r)),e=>e.name),selectedClientIds:r}},[n]),m=function(){const{clientIds:e,isGroupable:t,isUngroupable:n,blocksSelection:o,groupingBlockName:r}=Object(i.useSelect)(e=>{var t;const{getBlockRootClientId:n,getBlocksByClientId:o,canInsertBlockType:r,getSelectedBlockClientIds:c}=e(s.a),{getGroupingBlockName:l}=e(a.store),i=c(),u=l(),d=r(u,null!=i&&i.length?n(i[0]):void 0),b=o(i),p=1===b.length&&(null===(t=b[0])||void 0===t?void 0:t.name)===u;return{clientIds:i,isGroupable:d&&b.length&&!p,isUngroupable:p&&!!b[0].innerBlocks.length,blocksSelection:b,groupingBlockName:u}},[]);return{clientIds:e,isGroupable:t,isUngroupable:n,blocksSelection:o,groupingBlockName:r}}(),{isGroupable:f,isUngroupable:h}=m,g=f||h;return Object(r.createElement)(p,{fillProps:{...t,selectedBlocks:u,selectedClientIds:b}},e=>{if((null==e?void 0:e.length)>0||g)return Object(r.createElement)(l.MenuGroup,null,e,Object(r.createElement)(d,Object(o.a)({},m,{onClose:null==t?void 0:t.onClose})))})};t.a=m},pY5h:function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));var o=n("v5LD");function r(){return{disableCustomColors:!Object(o.a)("color.custom"),disableCustomGradients:!Object(o.a)("color.customGradient")}}},plpT:function(e,t,n){"use strict";var o=n("GRId"),r=n("Tqx9");const c=Object(o.createElement)(r.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(o.createElement)(r.Path,{d:"M16.4 4.2H7.6v1.5h8.9V4.2zM4 11.2v1.5h16v-1.5H4zm3.6 8.6h8.9v-1.5H7.6v1.5z"}));t.a=c},q3tz:function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var o=n("GRId"),r=n("l3Sj"),c=n("tI+e"),l=n("xN+R"),i=n("7SSY");function a(e){let{count:t,icon:n}=e;return Object(o.createElement)("div",{className:"block-editor-block-draggable-chip-wrapper"},Object(o.createElement)("div",{className:"block-editor-block-draggable-chip"},Object(o.createElement)(c.Flex,{justify:"center",className:"block-editor-block-draggable-chip__content"},Object(o.createElement)(c.FlexItem,null,n?Object(o.createElement)(i.a,{icon:n}):Object(r.sprintf)(Object(r._n)("%d block","%d blocks",t),t)),Object(o.createElement)(c.FlexItem,null,Object(o.createElement)(i.a,{icon:l.a})))))}},qRz9:function(e,t){e.exports=window.wp.richText},qrxh:function(e,t,n){"use strict";var o=n("wx14"),r=n("GRId"),c=n("YLtl"),l=n("TSYQ"),i=n.n(l),a=n("gdqT"),s=n("l3Sj"),u=n("tI+e"),d=n("1ZqX"),b=n("K9lf"),p=n("HSyU"),m=n("Q4Sy"),f=n("xZzQ"),h=n("Wg7J"),g=n("AORF"),O=n("nQUx"),v=n("+G0a"),j=n("BhPs");function k(e){let{onSelect:t,rootClientId:n,clientId:o,isAppender:c}=e;const[l,a]=Object(r.useState)(""),[b,p]=Object(g.a)({onSelect:t,rootClientId:n,clientId:o,isAppender:c}),[m]=Object(v.a)(b,p),[f]=Object(O.a)(p,b),k=f.length&&!!l,_=k&&f.length>6||m.length>6,{setInserterIsOpened:y,insertionIndex:E}=Object(d.useSelect)(e=>{const{getSettings:t,getBlockIndex:n,getBlockCount:r}=e(j.a),c=n(o);return{setInserterIsOpened:t().__experimentalSetIsInserterOpened,insertionIndex:-1===c?r():c}},[o,n]);Object(r.useEffect)(()=>{y&&y(!1)},[y]);return Object(r.createElement)("div",{className:i()("block-editor-inserter__quick-inserter",{"has-search":_,"has-expand":y})},_&&Object(r.createElement)(u.SearchControl,{className:"block-editor-inserter__search",value:l,onChange:e=>{a(e)},label:Object(s.__)("Search for blocks and patterns"),placeholder:Object(s.__)("Search")}),Object(r.createElement)("div",{className:"block-editor-inserter__quick-inserter-results"},Object(r.createElement)(h.a,{filterValue:l,onSelect:t,rootClientId:n,clientId:o,isAppender:c,maxBlockPatterns:k?2:0,maxBlockTypes:6,isDraggable:!1})),y&&Object(r.createElement)(u.Button,{className:"block-editor-inserter__quick-inserter-expand",onClick:()=>{y({rootClientId:n,insertionIndex:E,filterValue:l})},"aria-label":Object(s.__)("Browse all. This will open the main inserter panel in the editor toolbar.")},Object(s.__)("Browse all")))}const _=e=>{let t,{onToggle:n,disabled:c,isOpen:l,blockTitle:i,hasSingleBlockType:a,toggleProps:d={}}=e;t=a?Object(s.sprintf)(Object(s._x)("Add %s","directly add the only allowed block"),i):Object(s._x)("Add block","Generic label for block inserter button");const{onClick:b,...p}=d;return Object(r.createElement)(u.Button,Object(o.a)({icon:m.a,label:t,tooltipPosition:"bottom",onClick:function(e){n&&n(e),b&&b(e)},className:"block-editor-inserter__toggle","aria-haspopup":!a&&"true","aria-expanded":!a&&l,disabled:c},p))};class y extends r.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:c,directInsertBlock:l,toggleProps:i,hasItems:a,renderToggle:s=_}=this.props;return s({onToggle:t,isOpen:n,disabled:o||!a,blockTitle:r,hasSingleBlockType:c,directInsertBlock:l,toggleProps:i})}renderContent(e){let{onClose:t}=e;const{rootClientId:n,clientId:o,isAppender:c,showInserterHelpPanel:l,__experimentalIsQuick:i}=this.props;return i?Object(r.createElement)(k,{onSelect:()=>{t()},rootClientId:n,clientId:o,isAppender:c}):Object(r.createElement)(f.a,{onSelect:()=>{t()},rootClientId:n,clientId:o,isAppender:c,showInserterHelpPanel:l})}render(){const{position:e,hasSingleBlockType:t,directInsertBlock:n,insertOnlyAllowedBlock:o,__experimentalIsQuick:c,onSelectOrClose:l}=this.props;return t||null!=n&&n.length?this.renderToggle({onToggle:o}):Object(r.createElement)(u.Dropdown,{className:"block-editor-inserter",contentClassName:i()("block-editor-inserter__popover",{"is-quick":c}),position:e,onToggle:this.onToggle,expandOnMobile:!0,headerTitle:Object(s.__)("Add a block"),renderToggle:this.renderToggle,renderContent:this.renderContent,onClose:l})}}t.a=Object(b.compose)([Object(d.withSelect)((e,t)=>{let{clientId:n,rootClientId:o}=t;const{getBlockRootClientId:r,hasInserterItems:l,__experimentalGetAllowedBlocks:i,__experimentalGetDirectInsertBlock:a}=e(j.a),{getBlockVariations:s}=e(p.store);o=o||r(n)||void 0;const u=i(o),d=a(o),b=1===Object(c.size)(u)&&0===Object(c.size)(s(u[0].name,"inserter"));let m=!1;return b&&(m=u[0]),{hasItems:l(o),hasSingleBlockType:b,blockTitle:m?m.title:"",allowedBlockType:m,directInsertBlock:d,rootClientId:o}}),Object(d.withDispatch)((e,t,n)=>{let{select:o}=n;return{insertOnlyAllowedBlock(){const{rootClientId:n,clientId:r,isAppender:c,hasSingleBlockType:l,allowedBlockType:i,directInsertBlock:u,onSelectOrClose:d}=t;if(!(l||null!=u&&u.length))return;const{insertBlock:b}=e(j.a);b(null!=u&&u.length?Object(p.createBlock)(...u):Object(p.createBlock)(i.name),function(){const{getBlockIndex:e,getBlockSelectionEnd:t,getBlockOrder:l,getBlockRootClientId:i}=o(j.a);if(r)return e(r);const a=t();return!c&&a&&i(a)===n?e(a)+1:l(n).length}(),n),d&&d();const m=Object(s.sprintf)(Object(s.__)("%s block added"),i.title);Object(a.speak)(m)}}}),Object(b.ifCondition)(e=>{let{hasItems:t,isAppender:n,rootClientId:o,clientId:r}=e;return t||!n&&!o&&!r})])(y)},rH4q:function(e,t,n){"use strict";var o=n("GRId"),r=n("Tqx9");const c=Object(o.createElement)(r.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(o.createElement)(r.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"}));t.a=c},rHRV:function(e,t,n){"use strict";n.d(t,"a",(function(){return l}));var o=n("K9lf"),r=n("GRId"),c=n("VyCT");function l(){const e=Object(r.useContext)(c.b);return Object(o.useRefEffect)(t=>{if(e)return e.observe(t),()=>{e.unobserve(t)}},[e])}},rl8x:function(e,t){e.exports=window.wp.isShallowEqual},rmEH:function(e,t){e.exports=window.wp.htmlEntities},smQA:function(e,t,n){"use strict";function o(){}function r(e,t,n,o,r){for(var c=0,l=t.length,i=0,a=0;ce.length?n:e})),s.value=e.join(d)}else s.value=e.join(n.slice(i,i+s.count));i+=s.count,s.added||(a+=s.count)}}var b=t[l-1];return l>1&&"string"==typeof b.value&&(b.added||b.removed)&&e.equals("",b.value)&&(t[l-2].value+=b.value,t.pop()),t}function c(e){return{newPos:e.newPos,components:e.components.slice(0)}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=o,o.prototype={diff:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=n.callback;"function"==typeof n&&(o=n,n={}),this.options=n;var l=this;function i(e){return o?(setTimeout((function(){o(void 0,e)}),0),!0):e}e=this.castInput(e),t=this.castInput(t),e=this.removeEmpty(this.tokenize(e));var a=(t=this.removeEmpty(this.tokenize(t))).length,s=e.length,u=1,d=a+s,b=[{newPos:-1,components:[]}],p=this.extractCommon(b[0],t,e,0);if(b[0].newPos+1>=a&&p+1>=s)return i([{value:this.join(t),count:t.length}]);function m(){for(var n=-1*u;n<=u;n+=2){var o=void 0,d=b[n-1],p=b[n+1],m=(p?p.newPos:0)-n;d&&(b[n-1]=void 0);var f=d&&d.newPos+1=a&&m+1>=s)return i(r(l,o.components,t,e,l.useLongestToken));b[n]=o}else b[n]=void 0}u++}if(o)!function e(){setTimeout((function(){if(u>d)return o();m()||e()}),0)}();else for(;u<=d;){var f=m();if(f)return f}},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,c=n.length,l=e.newPos,i=l-o,a=0;l+11&&void 0!==arguments[1])||arguments[1],o=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return t=Array.isArray(e)?m.filter(t=>e.includes(t)):!0===e?[...m]:[],!o||!0===e&&!n?Object(s.without)(t,...f):t}const g=Object(u.createHigherOrderComponent)(e=>t=>{const{name:n}=t,r=h(Object(o.getBlockSupport)(n,"align"),Object(o.hasBlockSupport)(n,"alignWide",!0)),c=Object(p.a)(r).map(e=>{let{name:t}=e;return t});return Object(l.createElement)(l.Fragment,null,!!c.length&&Object(l.createElement)(d.b,{group:"block",__experimentalShareWithChildBlocks:!0},Object(l.createElement)(b.a,{value:t.attributes.align,onChange:e=>{if(!e){var n,r;const c=Object(o.getBlockType)(t.name);(null==c||null===(n=c.attributes)||void 0===n||null===(r=n.align)||void 0===r?void 0:r.default)&&(e="")}t.setAttributes({align:e})},controls:c})),Object(l.createElement)(e,t))},"withToolbarControls"),O=Object(u.createHigherOrderComponent)(e=>t=>{const{name:n,attributes:r}=t,{align:i}=r,a=h(Object(o.getBlockSupport)(n,"align"),Object(o.hasBlockSupport)(n,"alignWide",!0)),s=Object(p.a)(a);if(void 0===i)return Object(l.createElement)(e,t);let u=t.wrapperProps;return s.some(e=>e.name===i)&&(u={...u,"data-align":i}),Object(l.createElement)(e,Object(c.a)({},t,{wrapperProps:u}))});Object(r.addFilter)("blocks.registerBlockType","core/align/addAttribute",(function(e){return Object(s.has)(e.attributes,["align","type"])||Object(o.hasBlockSupport)(e,"align")&&(e.attributes={...e.attributes,align:{type:"string",enum:[...m,""]}}),e})),Object(r.addFilter)("editor.BlockListBlock","core/editor/align/with-data-align",O),Object(r.addFilter)("editor.BlockEdit","core/editor/align/with-toolbar-controls",g),Object(r.addFilter)("blocks.getSaveContent.extraProps","core/align/addAssignedAlign",(function(e,t,n){const{align:r}=n;return h(Object(o.getBlockSupport)(t,"align"),Object(o.hasBlockSupport)(t,"alignWide",!0)).includes(r)&&(e.className=a()("align"+r,e.className)),e})),Object(r.addFilter)("blocks.registerBlockType","core/lock/addAttribute",(function(e){return Object(s.has)(e.attributes,["lock","type"])||(e.attributes={...e.attributes,lock:{type:"object"}}),e}));var v=n("tI+e"),j=n("l3Sj"),k=n("1oY3");const _=/[\s#]/g;const y=Object(u.createHigherOrderComponent)(e=>t=>{if(Object(o.hasBlockSupport)(t.name,"anchor")&&t.isSelected){const n="web"===l.Platform.OS,o=Object(l.createElement)(v.TextControl,{className:"html-anchor-control",label:Object(j.__)("HTML anchor"),help:Object(l.createElement)(l.Fragment,null,Object(j.__)("Enter a word or two — without spaces — to make a unique web address just for this block, called an “anchor.” Then, you’ll be able to link directly to this section of your page."),n&&Object(l.createElement)(v.ExternalLink,{href:Object(j.__)("https://wordpress.org/support/article/page-jumps/")},Object(j.__)("Learn more about anchors"))),value:t.attributes.anchor||"",placeholder:n?null:Object(j.__)("Add an anchor"),onChange:e=>{e=e.replace(_,"-"),t.setAttributes({anchor:e})},autoCapitalize:"none",autoComplete:"off"});return Object(l.createElement)(l.Fragment,null,Object(l.createElement)(e,t),n&&Object(l.createElement)(k.b,{__experimentalGroup:"advanced"},o),!n&&"core/heading"===t.name&&Object(l.createElement)(k.b,null,Object(l.createElement)(v.PanelBody,{title:Object(j.__)("Heading settings")},o)))}return Object(l.createElement)(e,t)},"withInspectorControl");Object(r.addFilter)("blocks.registerBlockType","core/anchor/attribute",(function(e){return Object(s.has)(e.attributes,["anchor","type"])||Object(o.hasBlockSupport)(e,"anchor")&&(e.attributes={...e.attributes,anchor:{type:"string",source:"attribute",attribute:"id",selector:"*"}}),e})),Object(r.addFilter)("editor.BlockEdit","core/editor/anchor/with-inspector-control",y),Object(r.addFilter)("blocks.getSaveContent.extraProps","core/anchor/save-props",(function(e,t,n){return Object(o.hasBlockSupport)(t,"anchor")&&(e.id=""===n.anchor?null:n.anchor),e}));const E=Object(u.createHigherOrderComponent)(e=>t=>Object(o.hasBlockSupport)(t.name,"customClassName",!0)&&t.isSelected?Object(l.createElement)(l.Fragment,null,Object(l.createElement)(e,t),Object(l.createElement)(k.b,{__experimentalGroup:"advanced"},Object(l.createElement)(v.TextControl,{autoComplete:"off",label:Object(j.__)("Additional CSS class(es)"),value:t.attributes.className||"",onChange:e=>{t.setAttributes({className:""!==e?e:void 0})},help:Object(j.__)("Separate multiple classes with spaces.")}))):Object(l.createElement)(e,t),"withInspectorControl");Object(r.addFilter)("blocks.registerBlockType","core/custom-class-name/attribute",(function(e){return Object(o.hasBlockSupport)(e,"customClassName",!0)&&(e.attributes={...e.attributes,className:{type:"string"}}),e})),Object(r.addFilter)("editor.BlockEdit","core/editor/custom-class-name/with-inspector-control",E),Object(r.addFilter)("blocks.getSaveContent.extraProps","core/custom-class-name/save-props",(function(e,t,n){return Object(o.hasBlockSupport)(t,"customClassName",!0)&&n.className&&(e.className=a()(e.className,n.className)),e})),Object(r.addFilter)("blocks.getSaveContent.extraProps","core/generated-class-name/save-props",(function(e,t){return Object(o.hasBlockSupport)(t,"className",!0)&&("string"==typeof e.className?e.className=Object(s.uniq)([Object(o.getBlockDefaultClassName)(t.name),...e.className.split(" ")]).join(" ").trim():e.className=Object(o.getBlockDefaultClassName)(t.name)),e}));var C=n("VyCT"),S=n("v5LD"),w=n("dchM"),I=n("0LBR"),x=n("bVpQ"),B=n("715p");const T=[];function P(e){const{attributes:{borderColor:t,style:n},setAttributes:o}=e,r=Object(I.a)(),i=r.colors.reduce((e,t)=>e.concat(t.colors),[]),[a,s]=Object(l.useState)(()=>{var e,o;return null===(e=Object(x.b)(i,t,null==n||null===(o=n.border)||void 0===o?void 0:o.color))||void 0===e?void 0:e.color}),u=[{label:Object(j.__)("Color"),onColorChange:e=>{s(e);const t=Object(x.c)(i,e),r={...n,border:{...null==n?void 0:n.border,color:null!=t&&t.slug?void 0:e}},c=null!=t&&t.slug?t.slug:void 0;o({style:Object(B.a)(r),borderColor:c})},colorValue:a,clearable:!1}];return Object(l.createElement)(w.a,Object(c.a)({settings:u,disableCustomColors:!0,disableCustomGradients:!0,__experimentalHasMultipleOrigins:!0,__experimentalIsRenderedInSidebar:!0,enableAlpha:!0},r))}function R(e,t,n){var o;if(!H(t,"color")||V(t))return e;const{borderColor:r,style:c}=n,l=Object(x.a)("border-color",r),i=a()(e.className,{"has-border-color":r||(null==c||null===(o=c.border)||void 0===o?void 0:o.color),[l]:!!l});return e.className=i||void 0,e}const N=Object(u.createHigherOrderComponent)(e=>t=>{var n,o;const{name:r,attributes:i}=t,{borderColor:a}=i,s=Object(S.a)("color.palette")||T;if(!H(r,"color")||V(r))return Object(l.createElement)(e,t);const u={borderColor:a?null===(n=Object(x.b)(s,a))||void 0===n?void 0:n.color:void 0};let d=t.wrapperProps;return d={...t.wrapperProps,style:{...u,...null===(o=t.wrapperProps)||void 0===o?void 0:o.style}},Object(l.createElement)(e,Object(c.a)({},t,{wrapperProps:d}))});Object(r.addFilter)("blocks.registerBlockType","core/border/addAttributes",(function(e){return H(e,"color")?e.attributes.borderColor?e:{...e,attributes:{...e.attributes,borderColor:{type:"string"}}}:e})),Object(r.addFilter)("blocks.getSaveContent.extraProps","core/border/addSaveProps",R),Object(r.addFilter)("blocks.registerBlockType","core/border/addEditProps",(function(e){if(!H(e,"color")||V(e))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),R(o,e,n)},e})),Object(r.addFilter)("editor.BlockListBlock","core/border/with-border-color-palette-styles",N);var M=n("Wy3j");function L(e){var t;const{attributes:{style:n},setAttributes:o}=e;return Object(l.createElement)(M.a,{values:null==n||null===(t=n.border)||void 0===t?void 0:t.radius,onChange:e=>{let t={...n,border:{...null==n?void 0:n.border,radius:e}};void 0!==e&&""!==e||(t=Object(B.a)(t)),o({style:t})}})}var A=n("2YCo");const D=e=>{var t;const{attributes:{style:n},setAttributes:o}=e;return Object(l.createElement)(A.a,{value:null==n||null===(t=n.border)||void 0===t?void 0:t.style,onChange:e=>{const t={...n,border:{...null==n?void 0:n.border,style:e}};o({style:Object(B.a)(t)})}})},F=e=>{const{attributes:{borderColor:t,style:n},setAttributes:o}=e,{width:r,color:c,style:i}=(null==n?void 0:n.border)||{},[a,s]=Object(l.useState)(),[u,d]=Object(l.useState)();Object(l.useEffect)(()=>{"none"!==i&&s(i)},[i]),Object(l.useEffect)(()=>{(t||c)&&d({name:t||void 0,color:c||void 0})},[t,c]);const b=Object(v.__experimentalUseCustomUnits)({availableUnits:Object(S.a)("spacing.units")||["px","em","rem"]});return Object(l.createElement)(v.__experimentalUnitControl,{value:r,label:Object(j.__)("Width"),min:0,onChange:e=>{let r={...n,border:{...null==n?void 0:n.border,width:e}},c=t;const l=0===parseFloat(e);l&&(c=void 0,r.border.color=void 0,r.border.style="none"),l||"none"!==i||(r.border.style=a),l||void 0!==t||(c=null==u?void 0:u.name,r.border.color=null==u?void 0:u.color),void 0!==e&&""!==e||(r=Object(B.a)(r)),o({borderColor:c,style:r})},units:b})};function z(e){const t=G(e),n=H(e.name),o=Object(S.a)("border.color")&&H(e.name,"color"),r=Object(S.a)("border.radius")&&H(e.name,"radius"),c=Object(S.a)("border.style")&&H(e.name,"style"),i=Object(S.a)("border.width")&&H(e.name,"width");return t||!n?null:Object(l.createElement)(k.b,null,Object(l.createElement)(v.PanelBody,{className:"block-editor-hooks__border-controls",title:Object(j.__)("Border"),initialOpen:!1},(i||c)&&Object(l.createElement)("div",{className:"block-editor-hooks__border-controls-row"},i&&Object(l.createElement)(F,e),c&&Object(l.createElement)(D,e)),o&&Object(l.createElement)(P,e),r&&Object(l.createElement)(L,e)))}function H(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"any";if("web"!==l.Platform.OS)return!1;const n=Object(o.getBlockSupport)(e,"__experimentalBorder");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 V(e){const t=Object(o.getBlockSupport)(e,"__experimentalBorder");return null==t?void 0:t.__experimentalSkipSerialization}const G=()=>[!Object(S.a)("border.color"),!Object(S.a)("border.radius"),!Object(S.a)("border.style"),!Object(S.a)("border.width")].every(Boolean);var U=n("Cn0l"),W=n("yU1v"),q=n("6c9H"),K=n("PKbb");function Y(e){return e.ownerDocument.defaultView.getComputedStyle(e)}function $(e){let{settings:t,clientId:n,enableContrastChecking:o=!0,showTitle:r=!0}=e;const[c,i]=Object(l.useState)(),[a,s]=Object(l.useState)(),u=Object(K.b)(n);return Object(l.useEffect)(()=>{if(!o)return;if(!u.current)return;s(Y(u.current).color);let e=u.current,t=Y(e).backgroundColor;for(;"rgba(0, 0, 0, 0)"===t&&e.parentNode&&e.parentNode.nodeType===e.parentNode.ELEMENT_NODE;)e=e.parentNode,t=Y(e).backgroundColor;i(t)}),Object(l.createElement)(k.b,null,Object(l.createElement)(W.a,{title:Object(j.__)("Color"),initialOpen:!1,settings:t,showTitle:r,__experimentalHasMultipleOrigins:!0,__experimentalIsRenderedInSidebar:!0},o&&Object(l.createElement)(q.a,{backgroundColor:c,textColor:a})))}const Z=e=>{const t=Object(o.getBlockSupport)(e,"color");return t&&(!0===t.link||!0===t.gradient||!1!==t.background||!1!==t.text)},X=e=>{const t=Object(o.getBlockSupport)(e,"color");return null==t?void 0:t.__experimentalSkipSerialization},Q=e=>{const t=Object(o.getBlockSupport)(e,"color");return Object(s.isObject)(t)&&!!t.gradients};function J(e,t,n){var o,r,c,l,i,s;if(!Z(t)||X(t))return e;const u=Q(t),{backgroundColor:d,textColor:b,gradient:p,style:m}=n,f=Object(x.a)("background-color",d),h=Object(U.a)(p),g=Object(x.a)("color",b),O=a()(e.className,g,h,{[f]:!(u&&null!=m&&null!==(o=m.color)&&void 0!==o&&o.gradient||!f),"has-text-color":b||(null==m||null===(r=m.color)||void 0===r?void 0:r.text),"has-background":d||(null==m||null===(c=m.color)||void 0===c?void 0:c.background)||u&&(p||(null==m||null===(l=m.color)||void 0===l?void 0:l.gradient)),"has-link-color":null==m||null===(i=m.elements)||void 0===i||null===(s=i.link)||void 0===s?void 0:s.color});return e.className=O||void 0,e}const ee=(e,t)=>{const n=/var:preset\|color\|(.+)/.exec(t);return n&&n[1]?Object(x.b)(e,n[1]).color:t};function te(e){var t,n,r,c,i,a,u,d,b;const{name:p,attributes:m}=e,f=Object(S.a)("color.palette.custom"),h=Object(S.a)("color.palette.theme"),g=Object(S.a)("color.palette.default"),O=Object(l.useMemo)(()=>[...f||[],...h||[],...g||[]],[f,h,g]),v=Object(S.a)("color.gradients.custom"),k=Object(S.a)("color.gradients.theme"),_=Object(S.a)("color.gradients.default"),y=Object(l.useMemo)(()=>[...v||[],...k||[],..._||[]],[v,k,_]),E=Object(S.a)("color.custom"),C=Object(S.a)("color.customGradient"),w=Object(S.a)("color.background"),I=Object(S.a)("color.link"),T=Object(S.a)("color.text"),P=E||!h||(null==h?void 0:h.length)>0,R=C||!k||(null==k?void 0:k.length)>0,N=Object(l.useRef)(m);if(Object(l.useEffect)(()=>{N.current=m},[m]),!Z(p))return null;const M=(e=>{if("web"!==l.Platform.OS)return!1;const t=Object(o.getBlockSupport)(e,"color");return Object(s.isObject)(t)&&!!t.link})(p)&&I&&P,L=(e=>{const t=Object(o.getBlockSupport)(e,"color");return t&&!1!==t.text})(p)&&T&&P,A=(e=>{const t=Object(o.getBlockSupport)(e,"color");return t&&!1!==t.background})(p)&&w&&P,D=Q(p)&&R;if(!(M||L||A||D))return null;const{style:F,textColor:z,backgroundColor:H,gradient:V}=m;let G;if(D&&V)G=Object(U.e)(y,V);else if(D){var W;G=null==F||null===(W=F.color)||void 0===W?void 0:W.gradient}const q=t=>n=>{var o,r;const c=Object(x.c)(O,n),l=t+"Color",i={...N.current.style,color:{...null===(o=N.current)||void 0===o||null===(r=o.style)||void 0===r?void 0:r.color,[t]:null!=c&&c.slug?void 0:n}},a=null!=c&&c.slug?c.slug:void 0,s={style:Object(B.a)(i),[l]:a};e.setAttributes(s),N.current={...N.current,...s}};return Object(l.createElement)($,{enableContrastChecking:!("web"!==l.Platform.OS||V||null!=F&&null!==(t=F.color)&&void 0!==t&&t.gradient),clientId:e.clientId,settings:[...L?[{label:Object(j.__)("Text"),onColorChange:q("text"),colorValue:Object(x.b)(O,z,null==F||null===(n=F.color)||void 0===n?void 0:n.text).color}]:[],...A||D?[{label:Object(j.__)("Background"),onColorChange:A?q("background"):void 0,colorValue:Object(x.b)(O,H,null==F||null===(r=F.color)||void 0===r?void 0:r.background).color,gradientValue:G,onGradientChange:D?t=>{const n=Object(U.d)(y,t);let o;if(n){var r,c,l;const e={...null===(r=N.current)||void 0===r?void 0:r.style,color:{...null===(c=N.current)||void 0===c||null===(l=c.style)||void 0===l?void 0:l.color,gradient:void 0}};o={style:Object(B.a)(e),gradient:n}}else{var i,a,s;const e={...null===(i=N.current)||void 0===i?void 0:i.style,color:{...null===(a=N.current)||void 0===a||null===(s=a.style)||void 0===s?void 0:s.color,gradient:t}};o={style:Object(B.a)(e),gradient:void 0}}e.setAttributes(o),N.current={...N.current,...o}}:void 0}]:[],...M?[{label:Object(j.__)("Link"),onColorChange:t=>{const n=Object(x.c)(O,t),o=null!=n&&n.slug?"var:preset|color|"+n.slug:t,r=Object(B.a)(function(e,t,n){return Object(s.setWith)(e?Object(s.clone)(e):{},t,n,s.clone)}(F,["elements","link","color","text"],o));e.setAttributes({style:r})},colorValue:ee(O,null==F||null===(c=F.elements)||void 0===c||null===(i=c.link)||void 0===i||null===(a=i.color)||void 0===a?void 0:a.text),clearable:!(null==F||null===(u=F.elements)||void 0===u||null===(d=u.link)||void 0===d||null===(b=d.color)||void 0===b||!b.text)}]:[]]})}const ne=Object(u.createHigherOrderComponent)(e=>t=>{var n;const{name:o,attributes:r}=t,{backgroundColor:i,textColor:a}=r,s=Object(S.a)("color.palette.custom")||[],u=Object(S.a)("color.palette.theme")||[],d=Object(S.a)("color.palette.default")||[],b=Object(l.useMemo)(()=>[...s||[],...u||[],...d||[]],[s,u,d]);if(!Z(o)||X(o))return Object(l.createElement)(e,t);const p={};var m,f;a&&(p.color=null===(m=Object(x.b)(b,a))||void 0===m?void 0:m.color);i&&(p.backgroundColor=null===(f=Object(x.b)(b,i))||void 0===f?void 0:f.color);let h=t.wrapperProps;return h={...t.wrapperProps,style:{...p,...null===(n=t.wrapperProps)||void 0===n?void 0:n.style}},Object(l.createElement)(e,Object(c.a)({},t,{wrapperProps:h}))});Object(r.addFilter)("blocks.registerBlockType","core/color/addAttribute",(function(e){return Z(e)?(e.attributes.backgroundColor||Object.assign(e.attributes,{backgroundColor:{type:"string"}}),e.attributes.textColor||Object.assign(e.attributes,{textColor:{type:"string"}}),Q(e)&&!e.attributes.gradient&&Object.assign(e.attributes,{gradient:{type:"string"}}),e):e})),Object(r.addFilter)("blocks.getSaveContent.extraProps","core/color/addSaveProps",J),Object(r.addFilter)("blocks.registerBlockType","core/color/addEditProps",(function(e){if(!Z(e)||X(e))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),J(o,e,n)},e})),Object(r.addFilter)("editor.BlockListBlock","core/color/with-color-palette-styles",ne);var oe=n("Bo0k"),re=n("weEX");function ce(e){var t;const{attributes:{style:n},setAttributes:o}=e;return Object(l.createElement)(re.a,{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:Object(B.a)(t)})}})}function le(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!Object(S.a)("typography.lineHeight");return!Object(o.hasBlockSupport)(e,"typography.lineHeight")||t}function ie(e){var t,n;const{attributes:{style:o},setAttributes:r}=e,c=!ae(e),i=!se(e),a=null==o||null===(t=o.typography)||void 0===t?void 0:t.fontStyle,s=null==o||null===(n=o.typography)||void 0===n?void 0:n.fontWeight;return Object(l.createElement)(oe.a,{onChange:e=>{r({style:Object(B.a)({...o,typography:{...null==o?void 0:o.typography,fontStyle:e.fontStyle,fontWeight:e.fontWeight}})})},hasFontStyles:c,hasFontWeights:i,value:{fontStyle:a,fontWeight:s}})}function ae(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=Object(o.hasBlockSupport)(e,"typography.__experimentalFontStyle"),n=Object(S.a)("typography.fontStyle");return!t||!n}function se(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=Object(o.hasBlockSupport)(e,"typography.__experimentalFontWeight"),n=Object(S.a)("typography.fontWeight");return!t||!n}function ue(e){const t=ae(e),n=se(e);return t&&n}var de=n("BLeD"),be=n.n(de),pe=n("GKUk");const me="typography.__experimentalFontFamily";function fe(e,t,n){if(!Object(o.hasBlockSupport)(t,me))return e;if(Object(o.hasBlockSupport)(t,"typography.__experimentalSkipSerialization"))return e;if(null==n||!n.fontFamily)return e;const r=new be.a(e.className);r.add(`has-${Object(s.kebabCase)(null==n?void 0:n.fontFamily)}-font-family`);const c=r.value;return e.className=c||void 0,e}function he(e){var t;let{setAttributes:n,attributes:{fontFamily:o}}=e;const r=Object(S.a)("typography.fontFamilies"),c=null===(t=Object(s.find)(r,e=>{let{slug:t}=e;return o===t}))||void 0===t?void 0:t.fontFamily;return Object(l.createElement)(pe.a,{className:"block-editor-hooks-font-family-control",fontFamilies:r,value:c,onChange:function(e){const t=Object(s.find)(r,t=>{let{fontFamily:n}=t;return n===e});n({fontFamily:null==t?void 0:t.slug})}})}function ge(e){let{name:t}=e;const n=Object(S.a)("typography.fontFamilies");return!n||0===n.length||!Object(o.hasBlockSupport)(t,me)}Object(r.addFilter)("blocks.registerBlockType","core/fontFamily/addAttribute",(function(e){return Object(o.hasBlockSupport)(e,me)?(e.attributes.fontFamily||Object.assign(e.attributes,{fontFamily:{type:"string"}}),e):e})),Object(r.addFilter)("blocks.getSaveContent.extraProps","core/fontFamily/addSaveProps",fe),Object(r.addFilter)("blocks.registerBlockType","core/fontFamily/addEditProps",(function(e){if(!Object(o.hasBlockSupport)(e,me))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),fe(o,e,n)},e}));var Oe=n("NMUH"),ve=n("QP/w");function je(e,t,n){if(!Object(o.hasBlockSupport)(t,"typography.fontSize"))return e;if(Object(o.hasBlockSupport)(t,"typography.__experimentalSkipSerialization"))return e;const r=new be.a(e.className);r.add(Object(Oe.b)(n.fontSize));const c=r.value;return e.className=c||void 0,e}function ke(e){var t,n;const{attributes:{fontSize:o,style:r},setAttributes:c}=e,i=Object(S.a)("typography.fontSizes"),a=Object(Oe.a)(i,o,null==r||null===(t=r.typography)||void 0===t?void 0:t.fontSize),s=(null==a?void 0:a.size)||(null==r||null===(n=r.typography)||void 0===n?void 0:n.fontSize)||o;return Object(l.createElement)(ve.a,{onChange:e=>{const t=Object(Oe.c)(i,e).slug;c({style:Object(B.a)({...r,typography:{...null==r?void 0:r.typography,fontSize:t?void 0:e}}),fontSize:t})},value:s,withReset:!1})}function _e(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=Object(S.a)("typography.fontSizes"),n=!(null==t||!t.length);return!Object(o.hasBlockSupport)(e,"typography.fontSize")||!n}const ye=Object(u.createHigherOrderComponent)(e=>t=>{var n,r;const c=Object(S.a)("typography.fontSizes"),{name:i,attributes:{fontSize:a,style:s},wrapperProps:u}=t;if(!Object(o.hasBlockSupport)(i,"typography.fontSize")||Object(o.hasBlockSupport)(i,"typography.__experimentalSkipSerialization")||!a||null!=s&&null!==(n=s.typography)&&void 0!==n&&n.fontSize)return Object(l.createElement)(e,t);const d=Object(Oe.a)(c,a,null==s||null===(r=s.typography)||void 0===r?void 0:r.fontSize).size,b={...t,wrapperProps:{...u,style:{fontSize:d,...null==u?void 0:u.style}}};return Object(l.createElement)(e,b)},"withFontSizeInlineStyles");Object(r.addFilter)("blocks.registerBlockType","core/font/addAttribute",(function(e){return Object(o.hasBlockSupport)(e,"typography.fontSize")?(e.attributes.fontSize||Object.assign(e.attributes,{fontSize:{type:"string"}}),e):e})),Object(r.addFilter)("blocks.getSaveContent.extraProps","core/font/addSaveProps",je),Object(r.addFilter)("blocks.registerBlockType","core/font/addEditProps",(function(e){if(!Object(o.hasBlockSupport)(e,"typography.fontSize"))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),je(o,e,n)},e})),Object(r.addFilter)("editor.BlockListBlock","core/font-size/with-font-size-inline-styles",ye);var Ee=n("kVRd");function Ce(e){var t;const{attributes:{style:n},setAttributes:o}=e;return Object(l.createElement)(Ee.a,{value:null==n||null===(t=n.typography)||void 0===t?void 0:t.textDecoration,onChange:function(e){o({style:Object(B.a)({...n,typography:{...null==n?void 0:n.typography,textDecoration:e}})})}})}function Se(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!Object(o.hasBlockSupport)(e,"typography.__experimentalTextDecoration"),n=Object(S.a)("typography.textDecoration");return t||!n}var we=n("/Hvg");function Ie(e){var t;const{attributes:{style:n},setAttributes:o}=e;return Object(l.createElement)(we.a,{value:null==n||null===(t=n.typography)||void 0===t?void 0:t.textTransform,onChange:function(e){o({style:Object(B.a)({...n,typography:{...null==n?void 0:n.typography,textTransform:e}})})}})}function xe(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!Object(o.hasBlockSupport)(e,"typography.__experimentalTextTransform"),n=Object(S.a)("typography.textTransform");return t||!n}var Be=n("xBDm");function Te(e){var t;const{attributes:{style:n},setAttributes:o}=e;return Object(l.createElement)(Be.a,{value:null==n||null===(t=n.typography)||void 0===t?void 0:t.letterSpacing,onChange:function(e){o({style:Object(B.a)({...n,typography:{...null==n?void 0:n.typography,letterSpacing:e}})})},__unstableInputWidth:!1})}function Pe(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!Object(o.hasBlockSupport)(e,"typography.__experimentalLetterSpacing"),n=Object(S.a)("typography.letterSpacing");return t||!n}const Re=["typography.lineHeight","typography.fontSize","typography.__experimentalFontStyle","typography.__experimentalFontWeight",me,"typography.__experimentalTextDecoration","typography.__experimentalTextTransform","typography.__experimentalLetterSpacing"];function Ne(e){const{clientId:t}=e,n=ge(e),r=_e(e),c=ue(e),i=le(e),a=Se(e),s=xe(e),u=Pe(e),d=!ae(e),b=!se(e),p=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=[ue(e),_e(e),le(e),ge(e),Se(e),xe(e),Pe(e)];return t.filter(Boolean).length===t.length}(e),m=Me(e.name);if(p||!m)return null;const f=Object(o.getBlockSupport)(e.name,["typography","__experimentalDefaultControls"]),h=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 Object(l.createElement)(k.b,{__experimentalGroup:"typography"},!n&&Object(l.createElement)(v.__experimentalToolsPanelItem,{hasValue:()=>function(e){return!!e.attributes.fontFamily}(e),label:Object(j.__)("Font family"),onDeselect:()=>function(e){let{setAttributes:t}=e;t({fontFamily:void 0})}(e),isShownByDefault:null==f?void 0:f.fontFamily,resetAllFilter:e=>({...e,fontFamily:void 0}),panelId:t},Object(l.createElement)(he,e)),!r&&Object(l.createElement)(v.__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:Object(j.__)("Font size"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({fontSize:void 0,style:Object(B.a)({...o,typography:{...null==o?void 0:o.typography,fontSize:void 0}})})}(e),isShownByDefault:null==f?void 0:f.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},Object(l.createElement)(ke,e)),!c&&Object(l.createElement)(v.__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:Object(oe.b)(d,b),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:Object(B.a)({...o,typography:{...null==o?void 0:o.typography,fontStyle:void 0,fontWeight:void 0}})})}(e),isShownByDefault:null==f?void 0:f.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},Object(l.createElement)(ie,e)),!i&&Object(l.createElement)(v.__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:Object(j.__)("Line height"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:Object(B.a)({...o,typography:{...null==o?void 0:o.typography,lineHeight:void 0}})})}(e),isShownByDefault:null==f?void 0:f.lineHeight,resetAllFilter:h("lineHeight"),panelId:t},Object(l.createElement)(ce,e)),!a&&Object(l.createElement)(v.__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:Object(j.__)("Decoration"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:Object(B.a)({...o,typography:{...null==o?void 0:o.typography,textDecoration:void 0}})})}(e),isShownByDefault:null==f?void 0:f.textDecoration,resetAllFilter:h("textDecoration"),panelId:t},Object(l.createElement)(Ce,e)),!s&&Object(l.createElement)(v.__experimentalToolsPanelItem,{className:"single-column",hasValue:()=>function(e){var t,n;return!(null===(t=e.attributes.style)||void 0===t||null===(n=t.typography)||void 0===n||!n.textTransform)}(e),label:Object(j.__)("Letter case"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:Object(B.a)({...o,typography:{...null==o?void 0:o.typography,textTransform:void 0}})})}(e),isShownByDefault:null==f?void 0:f.textTransform,resetAllFilter:h("textTransform"),panelId:t},Object(l.createElement)(Ie,e)),!u&&Object(l.createElement)(v.__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:Object(j.__)("Letter-spacing"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:Object(B.a)({...o,typography:{...null==o?void 0:o.typography,letterSpacing:void 0}})})}(e),isShownByDefault:null==f?void 0:f.letterSpacing,resetAllFilter:h("letterSpacing"),panelId:t},Object(l.createElement)(Te,e)))}const Me=e=>Re.some(t=>Object(o.hasBlockSupport)(e,t));function Le(e){const t=Object(o.getBlockSupport)(e,We);return!!(!0===t||null!=t&&t.blockGap)}function Ae(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!Object(S.a)("spacing.blockGap");return!Le(e)||t}function De(e){var t;const{clientId:n,attributes:{style:o},setAttributes:r}=e,c=Object(v.__experimentalUseCustomUnits)({availableUnits:Object(S.a)("spacing.units")||["%","px","em","rem","vw"]}),i=Object(K.b)(n);if(Ae(e))return null;return l.Platform.select({web:Object(l.createElement)(l.Fragment,null,Object(l.createElement)(v.__experimentalUnitControl,{label:Object(j.__)("Block spacing"),__unstableInputWidth:"80px",min:0,onChange:e=>{var t;const n={...o,spacing:{...null==o?void 0:o.spacing,blockGap:e}};r({style:Object(B.a)(n)});const c=(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 l;i.current&&c&&(null===(l=i.current.parentNode)||void 0===l||l.replaceChild(i.current,i.current))},units:c,value:null==o||null===(t=o.spacing)||void 0===t?void 0:t.blockGap})),native:null})}function Fe(e){const t=Object(o.getBlockSupport)(e,We);return!!(!0===t||null!=t&&t.margin)}function ze(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!Object(S.a)("spacing.margin"),n=!Xe(e,"margin");return!Fe(e)||t||n}function He(e){var t;const{name:n,attributes:{style:o},setAttributes:r}=e,c=Object(v.__experimentalUseCustomUnits)({availableUnits:Object(S.a)("spacing.units")||["%","px","em","rem","vw"]}),i=Ze(n,"margin"),a=i&&i.some(e=>Ke.includes(e));if(ze(e))return null;return l.Platform.select({web:Object(l.createElement)(l.Fragment,null,Object(l.createElement)(v.__experimentalBoxControl,{values:null==o||null===(t=o.spacing)||void 0===t?void 0:t.margin,onChange:e=>{const t={...o,spacing:{...null==o?void 0:o.spacing,margin:e}};r({style:Object(B.a)(t)})},onChangeShowVisualizer:e=>{const t={...o,visualizers:{margin:e}};r({style:Object(B.a)(t)})},label:Object(j.__)("Margin"),sides:i,units:c,allowReset:!1,splitOnAxis:a})),native:null})}function Ve(e){const t=Object(o.getBlockSupport)(e,We);return!!(!0===t||null!=t&&t.padding)}function Ge(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!Object(S.a)("spacing.padding"),n=!Xe(e,"padding");return!Ve(e)||t||n}function Ue(e){var t;const{name:n,attributes:{style:o},setAttributes:r}=e,c=Object(v.__experimentalUseCustomUnits)({availableUnits:Object(S.a)("spacing.units")||["%","px","em","rem","vw"]}),i=Ze(n,"padding"),a=i&&i.some(e=>Ke.includes(e));if(Ge(e))return null;return l.Platform.select({web:Object(l.createElement)(l.Fragment,null,Object(l.createElement)(v.__experimentalBoxControl,{values:null==o||null===(t=o.spacing)||void 0===t?void 0:t.padding,onChange:e=>{const t={...o,spacing:{...null==o?void 0:o.spacing,padding:e}};r({style:Object(B.a)(t)})},onChangeShowVisualizer:e=>{const t={...o,visualizers:{padding:e}};r({style:Object(B.a)(t)})},label:Object(j.__)("Padding"),sides:i,units:c,allowReset:!1,splitOnAxis:a})),native:null})}const We="spacing",qe=["top","right","bottom","left"],Ke=["vertical","horizontal"];function Ye(e){const t=Ae(e),n=Ge(e),r=ze(e),c=$e(e),i=function(e){if("web"!==l.Platform.OS)return!1;return Le(e)||Ve(e)||Fe(e)}(e.name);if(c||!i)return null;const a=Object(o.getBlockSupport)(e.name,[We,"__experimentalDefaultControls"]),s=e=>t=>{var n;return{...t,style:{...t.style,spacing:{...null===(n=t.style)||void 0===n?void 0:n.spacing,[e]:void 0}}}};return Object(l.createElement)(k.b,{__experimentalGroup:"dimensions"},!n&&Object(l.createElement)(v.__experimentalToolsPanelItem,{hasValue:()=>function(e){var t,n;return void 0!==(null===(t=e.attributes.style)||void 0===t||null===(n=t.spacing)||void 0===n?void 0:n.padding)}(e),label:Object(j.__)("Padding"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:Object(B.a)({...o,spacing:{...null==o?void 0:o.spacing,padding:void 0}})})}(e),resetAllFilter:s("padding"),isShownByDefault:null==a?void 0:a.padding,panelId:e.clientId},Object(l.createElement)(Ue,e)),!r&&Object(l.createElement)(v.__experimentalToolsPanelItem,{hasValue:()=>function(e){var t,n;return void 0!==(null===(t=e.attributes.style)||void 0===t||null===(n=t.spacing)||void 0===n?void 0:n.margin)}(e),label:Object(j.__)("Margin"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:Object(B.a)({...o,spacing:{...null==o?void 0:o.spacing,margin:void 0}})})}(e),resetAllFilter:s("margin"),isShownByDefault:null==a?void 0:a.margin,panelId:e.clientId},Object(l.createElement)(He,e)),!t&&Object(l.createElement)(v.__experimentalToolsPanelItem,{hasValue:()=>function(e){var t,n;return void 0!==(null===(t=e.attributes.style)||void 0===t||null===(n=t.spacing)||void 0===n?void 0:n.blockGap)}(e),label:Object(j.__)("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:s("blockGap"),isShownByDefault:null==a?void 0:a.blockGap,panelId:e.clientId},Object(l.createElement)(De,e)))}const $e=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=Ae(e),n=Ge(e),o=ze(e);return t&&n&&o};function Ze(e,t){const n=Object(o.getBlockSupport)(e,We);if(n&&"boolean"!=typeof n[t])return n[t]}function Xe(e,t){const n=Ze(e,t);return!(n&&n.some(e=>qe.includes(e))&&n.some(e=>Ke.includes(e)))||(console.warn(`The ${t} support for the "${e}" block can not be configured to support both axial and arbitrary sides.`),!1)}var Qe=n("HgtZ");const Je=[...Re,"__experimentalBorder","color",We],et=e=>Je.some(t=>Object(o.hasBlockSupport)(e,t));function tt(e){if(Object(s.startsWith)(e,"var:")){return`var(--wp--${e.slice("var:".length).split("|").join("--")})`}return e}function nt(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=["spacing.blockGap"],n={};return Object.keys(o.__EXPERIMENTAL_STYLE_PROPERTY).forEach(r=>{const c=o.__EXPERIMENTAL_STYLE_PROPERTY[r].value,l=o.__EXPERIMENTAL_STYLE_PROPERTY[r].properties;if(Object(s.has)(e,c)&&"elements"!==Object(s.first)(c)){const o=Object(s.get)(e,c);l&&!Object(s.isString)(o)?Object.entries(l).forEach(e=>{const[t,r]=e,c=Object(s.get)(o,[r]);c&&(n[t]=tt(c))}):t.includes(c.join("."))||(n[r]=tt(Object(s.get)(e,c)))}}),n}const ot={"__experimentalBorder.__experimentalSkipSerialization":["border"],"color.__experimentalSkipSerialization":["color"],"typography.__experimentalSkipSerialization":["typography"],[We+".__experimentalSkipSerialization"]:["spacing"]},rt={...ot,[""+We]:["spacing.blockGap"]};function ct(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:rt;if(!et(t))return e;let{style:c}=n;return Object(s.forEach)(r,(e,n)=>{Object(o.getBlockSupport)(t,n)&&(c=Object(s.omit)(c,e))}),e.style={...nt(c),...e.style},e}const lt=Object(u.createHigherOrderComponent)(e=>t=>{const n=Object(Qe.a)();return Object(l.createElement)(l.Fragment,null,n&&Object(l.createElement)(l.Fragment,null,Object(l.createElement)(te,t),Object(l.createElement)(Ne,t),Object(l.createElement)(z,t),Object(l.createElement)(Ye,t)),Object(l.createElement)(e,t))},"withToolbarControls"),it=Object(u.createHigherOrderComponent)(e=>t=>{var n,r;const i=null===(n=t.attributes.style)||void 0===n?void 0:n.elements,d="wp-elements-"+Object(u.useInstanceId)(e),b=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(s.map)(t,(t,n)=>{const r=nt(t);return Object(s.isEmpty)(r)?"":[`.${e} ${o.__EXPERIMENTAL_ELEMENTS[n]}{`,...Object(s.map)(r,(e,t)=>`\t${Object(s.kebabCase)(t)}: ${e};`),"}"].join("\n")}).join("\n")}(d,null===(r=t.attributes.style)||void 0===r?void 0:r.elements),p=Object(l.useContext)(C.c.__unstableElementContext);return Object(l.createElement)(l.Fragment,null,i&&p&&Object(l.createPortal)(Object(l.createElement)("style",{dangerouslySetInnerHTML:{__html:b}}),p),Object(l.createElement)(e,Object(c.a)({},t,{className:i?a()(t.className,d):t.className})))});Object(r.addFilter)("blocks.registerBlockType","core/style/addAttribute",(function(e){return et(e)?(e.attributes.style||Object.assign(e.attributes,{style:{type:"object"}}),e):e})),Object(r.addFilter)("blocks.getSaveContent.extraProps","core/style/addSaveProps",ct),Object(r.addFilter)("blocks.registerBlockType","core/style/addEditProps",(function(e){if(!et(e))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),ct(o,e,n,ot)},e})),Object(r.addFilter)("editor.BlockEdit","core/style/with-block-controls",lt),Object(r.addFilter)("editor.BlockListBlock","core/editor/with-elements-styles",it);var at=n("fHnH"),st=n("abaT"),ut=n("1uGa");const dt=[];function bt(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t={r:[],g:[],b:[],a:[]};return e.forEach(e=>{const n=Object(at.a)(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 pt(e){let{selector:t,id:n,values:o}=e;const r=`\n${t} {\n\tfilter: url( #${n} );\n}\n`;return Object(l.createElement)(l.Fragment,null,Object(l.createElement)(v.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"}},Object(l.createElement)("defs",null,Object(l.createElement)("filter",{id:n},Object(l.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 "}),Object(l.createElement)("feComponentTransfer",{colorInterpolationFilters:"sRGB"},Object(l.createElement)("feFuncR",{type:"table",tableValues:o.r.join(" ")}),Object(l.createElement)("feFuncG",{type:"table",tableValues:o.g.join(" ")}),Object(l.createElement)("feFuncB",{type:"table",tableValues:o.b.join(" ")}),Object(l.createElement)("feFuncA",{type:"table",tableValues:o.a.join(" ")})),Object(l.createElement)("feComposite",{in2:"SourceGraphic",operator:"in"})))),Object(l.createElement)("style",{dangerouslySetInnerHTML:{__html:r}}))}function mt(e){var t;let{attributes:n,setAttributes:o}=e;const r=null==n?void 0:n.style,c=null==r||null===(t=r.color)||void 0===t?void 0:t.duotone,i=Object(S.a)("color.duotone")||dt,a=Object(S.a)("color.palette")||dt,s=!Object(S.a)("color.custom"),u=!Object(S.a)("color.customDuotone")||0===(null==a?void 0:a.length)&&s;return 0===(null==i?void 0:i.length)&&u?null:Object(l.createElement)(d.b,{group:"block",__experimentalShareWithChildBlocks:!0},Object(l.createElement)(ut.a,{duotonePalette:i,colorPalette:a,disableCustomDuotone:u,disableCustomColors:s,value:c,onChange:e=>{const t={...r,color:{...null==r?void 0:r.color,duotone:e}};o({style:t})}}))}Object(at.b)([st.a]);const ft=Object(u.createHigherOrderComponent)(e=>t=>{const n=Object(o.hasBlockSupport)(t.name,"color.__experimentalDuotone");return Object(l.createElement)(l.Fragment,null,Object(l.createElement)(e,t),n&&Object(l.createElement)(mt,t))},"withDuotoneControls");const ht=Object(u.createHigherOrderComponent)(e=>t=>{var n,r,i;const s=Object(o.getBlockSupport)(t.name,"color.__experimentalDuotone"),d=null==t||null===(n=t.attributes)||void 0===n||null===(r=n.style)||void 0===r||null===(i=r.color)||void 0===i?void 0:i.duotone;if(!s||!d)return Object(l.createElement)(e,t);const b="wp-duotone-"+Object(u.useInstanceId)(e),p=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 ."+b,s),m=a()(null==t?void 0:t.className,b),f=Object(l.useContext)(C.c.__unstableElementContext);return Object(l.createElement)(l.Fragment,null,f&&Object(l.createPortal)(Object(l.createElement)(pt,{selector:p,id:b,values:bt(d)}),f),Object(l.createElement)(e,Object(c.a)({},t,{className:m})))},"withDuotoneStyles");Object(r.addFilter)("blocks.registerBlockType","core/editor/duotone/add-attributes",(function(e){return Object(o.hasBlockSupport)(e,"color.__experimentalDuotone")?(e.attributes.style||Object.assign(e.attributes,{style:{type:"object"}}),e):e})),Object(r.addFilter)("editor.BlockEdit","core/editor/duotone/with-editor-controls",ft),Object(r.addFilter)("editor.BlockListBlock","core/editor/duotone/with-styles",ht);var gt=n("1ZqX"),Ot=n("BhPs"),vt=n("w8sn"),jt=n("PPMp");function kt(e){let{setAttributes:t,attributes:n,name:r}=e;const{layout:c}=n,i=Object(S.a)("layout"),a=Object(gt.useSelect)(e=>{const{getSettings:t}=e(Ot.a);return t().supportsLayout},[]),s=Object(o.getBlockSupport)(r,"__experimentalLayout",{}),{allowSwitching:u,allowEditing:d=!0,allowInheriting:b=!0,default:p}=s;if(!d)return null;const m=c||p||{},{inherit:f=!1,type:h="default"}=m;if("default"===h&&!a)return null;const g=Object(jt.a)(h),O=e=>t({layout:e});return Object(l.createElement)(l.Fragment,null,Object(l.createElement)(k.b,null,Object(l.createElement)(v.PanelBody,{title:Object(j.__)("Layout")},b&&!!i&&Object(l.createElement)(v.ToggleControl,{label:Object(j.__)("Inherit default layout"),checked:!!f,onChange:()=>t({layout:{inherit:!f}})}),!f&&u&&Object(l.createElement)(_t,{type:h,onChange:e=>t({layout:{type:e}})}),!f&&g&&Object(l.createElement)(g.inspectorControls,{layout:m,onChange:O,layoutBlockSupport:s}))),!f&&g&&Object(l.createElement)(g.toolBarControls,{layout:m,onChange:O,layoutBlockSupport:s}))}function _t(e){let{type:t,onChange:n}=e;return Object(l.createElement)(v.ButtonGroup,null,Object(jt.b)().map(e=>{let{name:o,label:r}=e;return Object(l.createElement)(v.Button,{key:o,isPressed:t===o,onClick:()=>n(o)},r)}))}const yt=Object(u.createHigherOrderComponent)(e=>t=>{const{name:n}=t;return[Object(o.hasBlockSupport)(n,"__experimentalLayout")&&Object(l.createElement)(kt,Object(c.a)({key:"layout"},t)),Object(l.createElement)(e,Object(c.a)({key:"edit"},t))]},"withInspectorControls"),Et=Object(u.createHigherOrderComponent)(e=>t=>{const{name:n,attributes:r}=t,i=Object(o.hasBlockSupport)(n,"__experimentalLayout"),s=Object(u.useInstanceId)(e),d=Object(S.a)("layout")||{},b=Object(l.useContext)(C.c.__unstableElementContext),{layout:p}=r,{default:m}=Object(o.getBlockSupport)(n,"__experimentalLayout")||{},f=null!=p&&p.inherit?d:p||m||{},h=a()(null==t?void 0:t.className,{["wp-container-"+s]:i});return Object(l.createElement)(l.Fragment,null,i&&b&&Object(l.createPortal)(Object(l.createElement)(vt.b,{selector:".wp-container-"+s,layout:f,style:null==r?void 0:r.style}),b),Object(l.createElement)(e,Object(c.a)({},t,{className:h})))});Object(r.addFilter)("blocks.registerBlockType","core/layout/addAttribute",(function(e){return Object(s.has)(e.attributes,["layout","type"])||Object(o.hasBlockSupport)(e,"__experimentalLayout")&&(e.attributes={...e.attributes,layout:{type:"object"}}),e})),Object(r.addFilter)("editor.BlockListBlock","core/editor/layout/with-layout-styles",Et),Object(r.addFilter)("editor.BlockEdit","core/editor/layout/with-inspector-controls",yt);const Ct=[];function St(e){var t;let{borderColor:n,style:o}=e;const r=(null==o?void 0:o.border)||{},c=Object(x.a)("border-color",n);return{className:a()({[c]:!!c,"has-border-color":n||(null==o||null===(t=o.border)||void 0===t?void 0:t.color)})||void 0,style:nt({border:r})}}function wt(e){const t=Object(S.a)("color.palette")||Ct,n=St(e);if(e.borderColor){const o=Object(x.b)(t,e.borderColor);n.style.borderColor=o.color}return n}function It(e){var t,n,o,r,c,l;const{backgroundColor:i,textColor:s,gradient:u,style:d}=e,b=Object(x.a)("background-color",i),p=Object(x.a)("color",s),m=Object(U.a)(u),f=m||(null==d||null===(t=d.color)||void 0===t?void 0:t.gradient);return{className:a()(p,m,{[b]:!f&&!!b,"has-text-color":s||(null==d||null===(n=d.color)||void 0===n?void 0:n.text),"has-background":i||(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===(c=d.elements)||void 0===c||null===(l=c.link)||void 0===l?void 0:l.color})||void 0,style:nt({color:(null==d?void 0:d.color)||{}})}}const xt={};function Bt(e){const{backgroundColor:t,textColor:n,gradient:o}=e,r=Object(S.a)("color.palette.custom")||[],c=Object(S.a)("color.palette.theme")||[],i=Object(S.a)("color.palette.default")||[],a=Object(S.a)("color.gradients")||xt,s=Object(l.useMemo)(()=>[...r||[],...c||[],...i||[]],[r,c,i]),u=Object(l.useMemo)(()=>[...(null==a?void 0:a.custom)||[],...(null==a?void 0:a.theme)||[],...(null==a?void 0:a.default)||[]],[a]),d=It(e);if(t){const e=Object(x.b)(s,t);d.style.backgroundColor=e.color}if(o&&(d.style.background=Object(U.e)(u,o)),n){const e=Object(x.b)(s,n);d.style.color=e.color}return d}function Tt(e){const{style:t}=e;return{style:nt({spacing:(null==t?void 0:t.spacing)||{}})}}function Pt(e){const[t,n]=Object(l.useState)(e);return Object(l.useEffect)(()=>{e&&n(e)},[e]),t}var Rt=n("14PQ"),Nt=n("BCrt"),Mt=n("lJLt")},uoCR:function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var o=n("GRId");const r=Object(o.createContext)({});function c(e){let{value:t,children:n}=e;const c=Object(o.useContext)(r),l=Object(o.useMemo)(()=>({...c,...t}),[c,t]);return Object(o.createElement)(r.Provider,{value:l,children:n})}t.b=r},ur0x:function(e,t,n){"use strict";n.d(t,"b",(function(){return r})),n.d(t,"a",(function(){return l})),n.d(t,"c",(function(){return i}));var o=n("GRId");const r={name:"",isSelected:!1},c=Object(o.createContext)(r),{Provider:l}=c;function i(){return Object(o.useContext)(c)}},v5LD:function(e,t,n){"use strict";n.d(t,"a",(function(){return d}));var o=n("YLtl"),r=n("1ZqX"),c=n("HSyU"),l=n("ur0x"),i=n("BhPs");const a=["color","border","typography","spacing"],s={"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},u={"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 d(e){const{name:t}=Object(l.c)();return Object(r.useSelect)(n=>{var r;if(a.includes(e))return void console.warn("Top level useSetting paths are disabled. Please use a subpath to query the information needed.");const l=n(i.a).getSettings(),d=(e=>u[e]||e)(e),b="__experimentalFeatures."+d,p=`__experimentalFeatures.blocks.${t}.${d}`,m=null!==(r=Object(o.get)(l,p))&&void 0!==r?r:Object(o.get)(l,b);var f,h;if(void 0!==m)return c.__EXPERIMENTAL_PATHS_WITH_MERGE[d]?null!==(f=null!==(h=m.custom)&&void 0!==h?h:m.theme)&&void 0!==f?f:m.default:m;const g=s[d]?s[d](l):void 0;return void 0!==g?g:"typography.dropCap"===d||void 0},[t,e])}},v8Ku:function(e,t){},vIlp:function(e,t,n){"use strict";function o(e,t,n){const o="top"===n||"bottom"===n,{x:r,y:c}=e,l=o?r:c,i=o?c:r,a=o?t.left:t.top,s=o?t.right:t.bottom,u=t[n];let d;return d=l>=a&&l<=s?l:l2&&void 0!==arguments[2]?arguments[2]:["top","bottom","left","right"];return c.forEach(c=>{const l=o(e,t,c);(void 0===n||lt=>{if("declaration"===t.type){const c=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]};v(e)&&o.push(e)}return o}(t.value).map((r=e,e=>({...e,newUrl:"url("+e.before+e.quote+j(e.value,r)+e.quote+e.after+")"})));return{...t,value:(n=t.value,o=c,o.forEach(e=>{n=n.replace(e.source,e.newUrl)}),n)}}var n,o,r;return t};const _=/^(body|html|:root).*$/;var y=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(_)?n.replace(/^(body|html|:root)/,e):e+" "+n;return"rule"===n.type?{...n,selectors:n.selectors.map(o)}:n}};t.a=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return Object(o.map)(e,e=>{let{css:n,baseURL:o}=e;const c=[];return t&&c.push(y(t)),o&&c.push(k(o)),c.length?O(n,Object(r.compose)(c)):n})}},vtO0:function(e,t,n){"use strict";n.d(t,"a",(function(){return j})),n.d(t,"b",(function(){return k}));var o=n("wx14"),r=n("GRId"),c=n("TSYQ"),l=n.n(c),i=n("l3Sj"),a=n("tI+e"),s=n("Tqx9");var u=Object(r.createElement)(s.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(r.createElement)(s.Path,{d:"M5 15h14V9H5v6zm0 4.8h14v-1.5H5v1.5zM5 4.2v1.5h14V4.2H5z"}));var d=Object(r.createElement)(s.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(r.createElement)(s.Path,{d:"M4 9v6h14V9H4zm8-4.8H4v1.5h8V4.2zM4 19.8h8v-1.5H4v1.5z"})),b=n("EpZT");var p=Object(r.createElement)(s.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(r.createElement)(s.Path,{d:"M6 15h14V9H6v6zm6-10.8v1.5h8V4.2h-8zm0 15.6h8v-1.5h-8v1.5z"})),m=n("beZb"),f=n("XNw2"),h=n("K/rC");const g={none:{icon:u,title:Object(i.__)("None")},left:{icon:d,title:Object(i.__)("Align left")},center:{icon:b.a,title:Object(i.__)("Align center")},right:{icon:p,title:Object(i.__)("Align right")},wide:{icon:m.a,title:Object(i.__)("Wide width")},full:{icon:f.a,title:Object(i.__)("Full width")}},O={isAlternate:!0};var v=function(e){let{value:t,onChange:n,controls:c,isToolbar:s,isCollapsed:u=!0}=e;const d=Object(h.a)(c);if(!!!d.length)return null;function b(e){n([t,"none"].includes(e)?void 0:e)}const p=g[t],m=g.none,f=s?a.ToolbarGroup:a.ToolbarDropdownMenu,v={popoverProps:O,icon:p?p.icon:m.icon,label:Object(i.__)("Align"),toggleProps:{describedBy:Object(i.__)("Change alignment")}},j=s||r.Platform.isNative?{isCollapsed:s?u:void 0,controls:d.map(e=>{let{name:n}=e;return{...g[n],isActive:t===n||!t&&"none"===n,role:u?"menuitemradio":void 0,onClick:()=>b(n)}})}:{children:e=>{let{onClose:n}=e;return Object(r.createElement)(r.Fragment,null,Object(r.createElement)(a.MenuGroup,{className:"block-editor-block-alignment-control__menu-group"},d.map(e=>{let{name:o,info:c}=e;const{icon:i,title:s}=g[o],u=o===t||!t&&"none"===o;return Object(r.createElement)(a.MenuItem,{key:o,icon:i,iconPosition:"left",className:l()("components-dropdown-menu__menu-item",{"is-active":u}),isSelected:u,onClick:()=>{b(o),n()},role:"menuitemradio",info:c},s)})))}};return Object(r.createElement)(f,Object(o.a)({},v,j))};function j(e){return Object(r.createElement)(v,Object(o.a)({},e,{isToolbar:!1}))}function k(e){return Object(r.createElement)(v,Object(o.a)({},e,{isToolbar:!0}))}},w8sn:function(e,t,n){"use strict";n.d(t,"c",(function(){return l})),n.d(t,"a",(function(){return a})),n.d(t,"d",(function(){return s})),n.d(t,"b",(function(){return u}));var o=n("wx14"),r=n("GRId"),c=n("PPMp");const l={type:"default"},i=Object(r.createContext)(l),a=i.Provider;function s(){return Object(r.useContext)(i)}function u(e){let{layout:t={},...n}=e;const l=Object(c.a)(t.type);return l?Object(r.createElement)(l.save,Object(o.a)({layout:t},n)):null}},w95h:function(e,t,n){"use strict";var o=n("GRId"),r=n("Tqx9");const c=Object(o.createElement)(r.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(o.createElement)(r.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"}));t.a=c},wC17:function(e,t,n){"use strict";n.d(t,"a",(function(){return l}));var o=n("1ZqX"),r=n("HSyU"),c=n("BhPs");function l(e){return Object(o.useSelect)(t=>{if(!e)return null;const{getBlockName:n,getBlockAttributes:o}=t(c.a),{getBlockType:l,getActiveBlockVariation:i}=t(r.store),a=n(e),s=l(a);if(!s)return null;const u=o(e),d=i(a,u),b={title:s.title,icon:s.icon,description:s.description,anchor:null==u?void 0:u.anchor};return d?{title:d.title||s.title,icon:d.icon||s.icon,description:d.description||s.description}:b},[e])}},wJiJ:function(e,t,n){e.exports=n("1K8p")},weEX:function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var o=n("GRId"),r=n("l3Sj"),c=n("tI+e"),l=n("RxS6");function i(e){let{value:t,onChange:n}=e;const i=function(e){return void 0!==e&&""!==e}(t),a=i?t:"";return Object(o.createElement)("div",{className:"block-editor-line-height-control"},Object(o.createElement)(c.TextControl,{autoComplete:"off",onKeyDown:e=>{const{keyCode:t}=e;t!==l.ZERO||i||(e.preventDefault(),n("0"))},onChange:e=>{if(i)return void n(e);let t=e;switch(e){case"0.1":t=1.6;break;case"0":t=1.4}n(t)},label:Object(r.__)("Line height"),placeholder:1.5,step:.1,type:"number",value:a,min:0}))}},"wiT/":function(e,t,n){"use strict";var o=n("GRId"),r=n("tI+e"),c=n("GOly");t.a=function(e){let{children:t}=e;const n=Object(r.__unstableUseCompositeState)({shift:!0,wrap:"horizontal"});return Object(o.createElement)(c.a.Provider,{value:n},t)}},wx14:function(e,t,n){"use strict";function o(){return(o=Object.assign||function(e){for(var t=1;t{var o;const{getBlock:r,getBlockIndex:c,hasBlockMovingClientId:l,getBlockListSettings:i}=e(j.a),a=c(t),{name:s,attributes:u}=r(t);return{index:a,name:s,attributes:u,blockMovingMode:l(),orientation:null===(o=i(n))||void 0===o?void 0:o.orientation}},[t,n]),{index:d,name:y,attributes:E,blockMovingMode:C,orientation:S}=u,{setNavigationMode:w,removeBlock:I}=Object(s.useDispatch)(j.a),x=Object(o.useRef)(),B=Object(i.getBlockType)(y),T=Object(i.__experimentalGetAccessibleBlockLabel)(B,E,d+1,S);Object(o.useEffect)(()=>{x.current.focus(),Object(h.speak)(T)},[T]);const{hasBlockMovingClientId:P,getBlockIndex:R,getBlockRootClientId:N,getClientIdsOfDescendants:M,getSelectedBlockClientId:L,getMultiSelectedBlocksEndClientId:A,getPreviousBlockClientId:D,getNextBlockClientId:F,isNavigationMode:z}=Object(s.useSelect)(j.a),{selectBlock:H,clearSelectedBlock:V,setBlockMovingClientId:G,moveBlockToPosition:U}=Object(s.useDispatch)(j.a),W=l()("block-editor-block-list__block-selection-button",{"is-block-moving-mode":!!C}),q=Object(g.__)("Drag");return Object(o.createElement)("div",{className:W},Object(o.createElement)(a.Flex,{justify:"center",className:"block-editor-block-list__block-selection-button__content"},Object(o.createElement)(a.FlexItem,null,Object(o.createElement)(v.a,{icon:null==c?void 0:c.icon,showColors:!0})),Object(o.createElement)(a.FlexItem,null,Object(o.createElement)(k.a,{clientIds:[t]},e=>Object(o.createElement)(a.Button,Object(p.a)({icon:m.a,className:"block-selection-button_drag-handle","aria-hidden":"true",label:q,tabIndex:"-1"},e)))),Object(o.createElement)(a.FlexItem,null,Object(o.createElement)(a.Button,{ref:x,onClick:()=>w(!1),onKeyDown:function(e){const{keyCode:n}=e,o=n===f.UP,c=n===f.DOWN,l=n===f.LEFT,i=n===f.RIGHT,a=n===f.TAB,s=n===f.ESCAPE,u=n===f.ENTER,d=n===f.SPACE,p=e.shiftKey;if(n===f.BACKSPACE||n===f.DELETE)return I(t),void e.preventDefault();const m=L(),h=A(),g=D(h||m),O=F(h||m),v=a&&p||o,j=a&&!p||c,k=l,_=i;let y;if(v)y=g;else if(j)y=O;else if(k){var E;y=null!==(E=N(m))&&void 0!==E?E:m}else if(_){var C;y=null!==(C=M([m])[0])&&void 0!==C?C:m}const S=P();if(s&&z()&&(V(),e.preventDefault()),s&&S&&!e.defaultPrevented&&(G(null),e.preventDefault()),(u||d)&&S){const e=N(S),t=N(m),n=R(S);let o=R(m);n{const{isBlockInsertionPointVisible:n,getBlockInsertionPoint:o,getBlockOrder:r}=e(j.a);if(!n())return!1;const c=o();return r(c.rootClientId)[c.index]===t},[t]),B=Object(d.useViewportMatch)("medium"),[T,P]=Object(o.useState)(!1),[R,N]=Object(o.useState)(!1),{stopTyping:M}=Object(s.useDispatch)(j.a),L=!g&&!f&&c&&r,A=f,D=!f&&!k&&B&&!L&&!h&&(!g||O),F=!(f||D||k||c);Object(u.useShortcut)("core/block-editor/focus-toolbar",()=>{P(!0),M(!0)},{isDisabled:!F}),Object(o.useEffect)(()=>{D||P(!1)},[D]);const z=Object(o.useRef)(),H=Object(S.a)(t),V=Object(S.a)(_),G=Object(S.a)(i),U=Object(w.a)(m);if(!(A||D||T||L))return null;let W=H;if(!W)return null;i&&(W=G);let q=W;if(v){if(!V)return null;q={top:W,bottom:V}}const K=L?"top left right":"top right left",{ownerDocument:Y}=W,$=L?void 0:Y.defaultView.frameElement||Object(b.getScrollContainer)(W)||Y.body;return Object(o.createElement)(a.Popover,{ref:U,noArrow:!0,animate:!1,position:K,focusOnMount:!1,anchorRef:q,className:l()("block-editor-block-list__block-popover",{"is-insertion-point-visible":x}),__unstableStickyBoundaryElement:$,__unstableSlotName:p||null,__unstableBoundaryParent:!0,__unstableObserveElement:W,shouldAnchorIncludePadding:!0,__unstableEditorCanvasWrapper:null==m?void 0:m.current},(D||T)&&Object(o.createElement)("div",{onFocus:function(){N(!0)},onBlur:function(){N(!1)},tabIndex:-1,className:l()("block-editor-block-list__block-popover-inserter",{"is-visible":R})},Object(o.createElement)(C.a,{clientId:t,rootClientId:n,__experimentalIsQuick:!0})),(D||T)&&Object(o.createElement)(E.a,{focusOnMount:T,__experimentalInitialIndex:z.current,__experimentalOnIndexChange:e=>{z.current=e},key:t}),A&&Object(o.createElement)(y,{clientId:t,rootClientId:n,blockElement:W}),L&&Object(o.createElement)("div",{className:"block-editor-block-list__empty-block-inserter"},Object(o.createElement)(C.a,{position:"bottom right",rootClientId:n,clientId:t,__experimentalIsQuick:!0})))}function B(e){const{getSelectedBlockClientId:t,getFirstMultiSelectedBlockClientId:n,getBlockRootClientId:o,getBlock:c,getBlockParents:l,__experimentalGetBlockListSettingsForBlocks:a}=e(j.a),s=t()||n();if(!s)return;const{name:u,attributes:d={},isValid:b}=c(s)||{},p=l(s),m=a(p),f=Object(r.find)(p,e=>{var t;return null===(t=m[e])||void 0===t?void 0:t.__experimentalCaptureToolbars});return{clientId:s,rootClientId:o(s),name:u,isValid:b,isEmptyDefaultBlock:u&&Object(i.isUnmodifiedDefaultBlock)({name:u,attributes:d}),capturingClientId:f}}function T(e){let{__unstablePopoverSlot:t,__unstableContentRef:n}=e;const r=Object(s.useSelect)(B,[]);if(!r)return null;const{clientId:c,rootClientId:l,name:i,isValid:a,isEmptyDefaultBlock:u,capturingClientId:d}=r;return i?Object(o.createElement)(x,{clientId:c,rootClientId:l,isValid:a,isEmptyDefaultBlock:u,capturingClientId:d,__unstablePopoverSlot:t,__unstableContentRef:n}):null}},"xN+R":function(e,t,n){"use strict";var o=n("GRId"),r=n("Tqx9");const c=Object(o.createElement)(r.SVG,{width:"18",height:"18",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 18 18"},Object(o.createElement)(r.Path,{d:"M5 4h2V2H5v2zm6-2v2h2V2h-2zm-6 8h2V8H5v2zm6 0h2V8h-2v2zm-6 6h2v-2H5v2zm6 0h2v-2h-2v2z"}));t.a=c},xTGt:function(e,t){e.exports=window.wp.blob},xZzQ:function(e,t,n){"use strict";var o=n("GRId"),r=n("tI+e"),c=n("l3Sj"),l=n("1ZqX");const i=[Object(o.createInterpolateElement)(Object(c.__)("While writing, you can press / to quickly insert new blocks."),{kbd:Object(o.createElement)("kbd",null)}),Object(o.createInterpolateElement)(Object(c.__)("Indent a list by pressing space at the beginning of a line."),{kbd:Object(o.createElement)("kbd",null)}),Object(o.createInterpolateElement)(Object(c.__)("Outdent a list by pressing backspace at the beginning of a line."),{kbd:Object(o.createElement)("kbd",null)}),Object(c.__)("Drag files into the editor to automatically insert media blocks."),Object(c.__)("Change a block's type by pressing the block icon on the toolbar.")];var a=function(){const[e]=Object(o.useState)(Math.floor(Math.random()*i.length));return Object(o.createElement)(r.Tip,null,i[e])},s=n("HSyU"),u=n("GvwK"),d=n("REKd");var b=function(e){var t,n;let{item:r}=e;const{name:l,title:i,icon:a,description:b,initialAttributes:p}=r,m=Object(s.getBlockType)(l),f=Object(s.isReusableBlock)(r);return Object(o.createElement)("div",{className:"block-editor-inserter__preview-container"},Object(o.createElement)("div",{className:"block-editor-inserter__preview"},f||null!=m&&m.example?Object(o.createElement)("div",{className:"block-editor-inserter__preview-content"},Object(o.createElement)(d.a,{__experimentalPadding:16,viewportWidth:null!==(t=null===(n=m.example)||void 0===n?void 0:n.viewportWidth)&&void 0!==t?t:500,blocks:m.example?Object(s.getBlockFromExample)(r.name,{attributes:{...m.example.attributes,...p},innerBlocks:m.example.innerBlocks}):Object(s.createBlock)(l,p)})):Object(o.createElement)("div",{className:"block-editor-inserter__preview-content-missing"},Object(c.__)("No Preview Available."))),!f&&Object(o.createElement)(u.a,{title:i,icon:a,description:b}))},p=n("YLtl"),m=n("K9lf"),f=n("6ZVF"),h=n("mdLt"),g=n("+G0a"),O=n("wiT/");const v=[];var j=function(e){let{rootClientId:t,onInsert:n,onHover:r,showMostUsedBlocks:l}=e;const[i,a,s,u]=Object(g.a)(t,n),d=Object(o.useMemo)(()=>Object(p.orderBy)(i,["frecency"],["desc"]).slice(0,6),[i]),b=Object(o.useMemo)(()=>i.filter(e=>!e.category),[i]),j=Object(o.useMemo)(()=>Object(p.flow)(e=>e.filter(e=>e.category&&"reusable"!==e.category),e=>Object(p.groupBy)(e,"category"))(i),[i]),k=Object(o.useMemo)(()=>{const e={...s};return Object.keys(s).forEach(t=>{e[t]=i.filter(e=>(e=>e.name.split("/")[0])(e)===t),0===e[t].length&&delete e[t]}),e},[i,s]);Object(o.useEffect)(()=>()=>r(null),[]);const _=Object(m.useAsyncList)(a),y=a.length===_.length,E=Object(o.useMemo)(()=>Object.entries(s),[s]),C=Object(m.useAsyncList)(y?E:v);return Object(o.createElement)(O.a,null,Object(o.createElement)("div",null,l&&!!d.length&&Object(o.createElement)(h.a,{title:Object(c._x)("Most used","blocks")},Object(o.createElement)(f.a,{items:d,onSelect:u,onHover:r,label:Object(c._x)("Most used","blocks")})),Object(p.map)(_,e=>{const t=j[e.slug];return t&&t.length?Object(o.createElement)(h.a,{key:e.slug,title:e.title,icon:e.icon},Object(o.createElement)(f.a,{items:t,onSelect:u,onHover:r,label:e.title})):null}),y&&b.length>0&&Object(o.createElement)(h.a,{className:"block-editor-inserter__uncategorized-blocks-panel",title:Object(c.__)("Uncategorized")},Object(o.createElement)(f.a,{items:b,onSelect:u,onHover:r,label:Object(c.__)("Uncategorized")})),Object(p.map)(C,e=>{let[t,n]=e;const c=k[t];return c&&c.length?Object(o.createElement)(h.a,{key:t,title:n.title,icon:n.icon},Object(o.createElement)(f.a,{items:c,onSelect:u,onHover:r,label:n.title})):null})))},k=n("TSYQ"),_=n.n(k);var y=function(e){let{selectedCategory:t,patternCategories:n,onClickCategory:l,openPatternExplorer:i}=e;const a=Object(m.useViewportMatch)("medium","<"),s=_()("block-editor-inserter__panel-header","block-editor-inserter__panel-header-patterns");return Object(o.createElement)(r.Flex,{justify:"space-between",align:"start",gap:"4",className:s},Object(o.createElement)(r.FlexItem,{isBlock:!0},Object(o.createElement)(r.SelectControl,{className:"block-editor-inserter__panel-dropdown",label:Object(c.__)("Filter patterns"),hideLabelFromVision:!0,value:t.name,onChange:e=>{l(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})()})),!a&&Object(o.createElement)(r.FlexItem,null,Object(o.createElement)(r.Button,{variant:"secondary",className:"block-editor-inserter__patterns-explorer-expand",label:Object(c.__)("Explore all patterns"),onClick:()=>i()},Object(c._x)("Explore","Label for showing all block patterns"))))},E=n("nQUx"),C=n("Fmc1");function S(e){let{selectedCategory:t,patternCategories:n,onClickCategory:c}=e;const l="block-editor-block-patterns-explorer__sidebar";return Object(o.createElement)("div",{className:l+"__categories-list"},n.map(e=>{let{name:n,label:i}=e;return Object(o.createElement)(r.Button,{key:n,label:i,className:l+"__categories-list__item",isPressed:t===n,onClick:()=>{c(n)}},i)}))}function w(e){let{filterValue:t,setFilterValue:n}=e;return Object(o.createElement)("div",{className:"block-editor-block-patterns-explorer__search"},Object(o.createElement)(r.SearchControl,{onChange:n,value:t,label:Object(c.__)("Search for patterns"),placeholder:Object(c.__)("Search")}))}var I=function(e){let{selectedCategory:t,patternCategories:n,onClickCategory:r,filterValue:c,setFilterValue:l}=e;return Object(o.createElement)("div",{className:"block-editor-block-patterns-explorer__sidebar"},Object(o.createElement)(w,{filterValue:c,setFilterValue:l}),!c&&Object(o.createElement)(S,{selectedCategory:t,patternCategories:n,onClickCategory:r}))},x=n("gdqT"),B=n("LolH"),T=n("AORF"),P=n("pOGT");function R(e){let{filterValue:t,filteredBlockPatternsLength:n}=e;return t?Object(o.createElement)(r.__experimentalHeading,{level:2,lineHeight:"48px",className:"block-editor-block-patterns-explorer__search-results-count"},Object(c.sprintf)(Object(c._n)('%1$d pattern found for "%2$s"','%1$d patterns found for "%2$s"',n),n,t)):null}var N=function(e){let{filterValue:t,selectedCategory:n,patternCategories:r}=e;const l=Object(m.useDebounce)(x.speak,500),[i,a]=Object(T.a)({shouldFocusBlock:!0}),[s,,u]=Object(E.a)(a,i),d=Object(o.useMemo)(()=>r.map(e=>e.name),[r]),b=Object(o.useMemo)(()=>t?Object(P.b)(s,t):s.filter(e=>{var t,o;return"uncategorized"===n?!(null!==(t=e.categories)&&void 0!==t&&t.length)||e.categories.every(e=>!d.includes(e)):null===(o=e.categories)||void 0===o?void 0:o.includes(n)}),[t,n,s]);Object(o.useEffect)(()=>{if(!t)return;const e=b.length,n=Object(c.sprintf)(Object(c._n)("%d result found.","%d results found.",e),e);l(n)},[t,l]);const p=Object(m.useAsyncList)(b,{step:2}),f=!(null==b||!b.length);return Object(o.createElement)("div",{className:"block-editor-block-patterns-explorer__list"},f&&Object(o.createElement)(R,{filterValue:t,filteredBlockPatternsLength:b.length}),Object(o.createElement)(O.a,null,!f&&Object(o.createElement)(B.a,null),f&&Object(o.createElement)(C.a,{shownPatterns:p,blockPatterns:b,onClickPattern:u,isDraggable:!1})))};function M(e){let{initialCategory:t,patternCategories:n}=e;const[r,c]=Object(o.useState)(""),[l,i]=Object(o.useState)(null==t?void 0:t.name);return Object(o.createElement)("div",{className:"block-editor-block-patterns-explorer"},Object(o.createElement)(I,{selectedCategory:l,patternCategories:n,onClickCategory:i,filterValue:r,setFilterValue:c}),Object(o.createElement)(N,{filterValue:r,selectedCategory:l,patternCategories:n}))}var L=function(e){let{onModalClose:t,...n}=e;return Object(o.createElement)(r.Modal,{title:Object(c.__)("Patterns"),closeLabel:Object(c.__)("Close"),onRequestClose:t,isFullScreen:!0},Object(o.createElement)(M,n))};function A(e){let{rootClientId:t,onInsert:n,selectedCategory:r,populatedCategories:c}=e;const[l,,i]=Object(E.a)(n,t),a=Object(o.useCallback)(e=>{var t;if(null===(t=e.categories)||void 0===t||!t.length)return 1/0;const n=c.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))},[c]),s=Object(o.useMemo)(()=>l.filter(e=>{var t;return"uncategorized"===r.name?a(e)===1/0:null===(t=e.categories)||void 0===t?void 0:t.includes(r.name)}),[l,r]),u=Object(o.useMemo)(()=>s.sort((e,t)=>a(e)-a(t)),[s,a]),d=Object(m.useAsyncList)(u);return s.length?Object(o.createElement)("div",{className:"block-editor-inserter__panel-content"},Object(o.createElement)(C.a,{shownPatterns:d,blockPatterns:s,onClickPattern:i,label:r.label,orientation:"vertical",isDraggable:!0})):null}var D=function(e){let{rootClientId:t,onInsert:n,onClickCategory:r,selectedCategory:l}=e;const[i,a]=Object(o.useState)(!1),[s,u]=Object(E.a)(),d=Object(o.useCallback)(e=>!(!e.categories||!e.categories.length)&&e.categories.some(e=>u.some(t=>t.name===e)),[u]),b=Object(o.useMemo)(()=>{const e=u.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=>!d(e))&&!e.find(e=>"uncategorized"===e.name)&&e.push({name:"uncategorized",label:Object(c._x)("Uncategorized")}),e},[s,u]),p=l||b[0];return Object(o.createElement)(o.Fragment,null,!i&&Object(o.createElement)(o.Fragment,null,Object(o.createElement)(y,{selectedCategory:p,patternCategories:b,onClickCategory:r,openPatternExplorer:()=>a(!0)}),Object(o.createElement)(A,{rootClientId:t,onInsert:n,selectedCategory:p,populatedCategories:b})),i&&Object(o.createElement)(L,{initialCategory:p,patternCategories:b,onModalClose:()=>a(!1)}))},F=n("Mmq9");function z(e){let{onHover:t,onInsert:n,rootClientId:r}=e;const[l,,,i]=Object(g.a)(r,n),a=Object(o.useMemo)(()=>l.filter(e=>{let{category:t}=e;return"reusable"===t}),[l]);return 0===a.length?Object(o.createElement)(B.a,null):Object(o.createElement)(h.a,{title:Object(c.__)("Reusable blocks")},Object(o.createElement)(f.a,{items:a,onSelect:i,onHover:t,label:Object(c.__)("Reusable blocks")}))}var H=function(e){let{rootClientId:t,onInsert:n,onHover:r}=e;return Object(o.createElement)(o.Fragment,null,Object(o.createElement)(z,{onHover:r,onInsert:n,rootClientId:t}),Object(o.createElement)("div",{className:"block-editor-inserter__manage-reusable-blocks-container"},Object(o.createElement)("a",{className:"block-editor-inserter__manage-reusable-blocks",href:Object(F.addQueryArgs)("edit.php",{post_type:"wp_block"})},Object(c.__)("Manage Reusable blocks"))))},V=n("Wg7J");const G={name:"blocks",title:Object(c.__)("Blocks")},U={name:"patterns",title:Object(c.__)("Patterns")},W={name:"reusable",title:Object(c.__)("Reusable")};var q=function(e){let{children:t,showPatterns:n=!1,showReusableBlocks:c=!1,onSelect:l}=e;const i=Object(o.useMemo)(()=>{const e=[G];return n&&e.push(U),c&&e.push(W),e},[G,n,U,c,W]);return Object(o.createElement)(r.TabPanel,{className:"block-editor-inserter__tabs",tabs:i,onSelect:l},t)},K=n("BhPs");t.a=function(e){let{rootClientId:t,clientId:n,isAppender:i,__experimentalInsertionIndex:s,onSelect:u,showInserterHelpPanel:d,showMostUsedBlocks:p,__experimentalFilterValue:m="",shouldFocusBlock:f=!0}=e;const[h,g]=Object(o.useState)(m),[O,v]=Object(o.useState)(null),[k,_]=Object(o.useState)(null),[y,E,C]=Object(T.a)({rootClientId:t,clientId:n,isAppender:i,insertionIndex:s,shouldFocusBlock:f}),{showPatterns:S,hasReusableBlocks:w}=Object(l.useSelect)(e=>{var t;const{__experimentalGetAllowedPatterns:n,getSettings:o}=e(K.a);return{showPatterns:!!n(y).length,hasReusableBlocks:!(null===(t=o().__experimentalReusableBlocks)||void 0===t||!t.length)}},[y]),I=Object(o.useCallback)((e,t,n)=>{E(e,t,n),u()},[E,u]),x=Object(o.useCallback)((e,t)=>{E(e,{patternName:t}),u()},[E,u]),B=Object(o.useCallback)(e=>{C(!!e),v(e)},[C,v]),P=Object(o.useCallback)(e=>{_(e)},[_]),R=Object(o.useMemo)(()=>Object(o.createElement)(o.Fragment,null,Object(o.createElement)("div",{className:"block-editor-inserter__block-list"},Object(o.createElement)(j,{rootClientId:y,onInsert:I,onHover:B,showMostUsedBlocks:p})),d&&Object(o.createElement)("div",{className:"block-editor-inserter__tips"},Object(o.createElement)(r.VisuallyHidden,{as:"h2"},Object(c.__)("A tip for using the block editor")),Object(o.createElement)(a,null))),[y,I,B,h,p,d]),N=Object(o.useMemo)(()=>Object(o.createElement)(D,{rootClientId:y,onInsert:x,onClickCategory:P,selectedCategory:k}),[y,x,P,k]),M=Object(o.useMemo)(()=>Object(o.createElement)(H,{rootClientId:y,onInsert:I,onHover:B}),[y,I,B]),L=Object(o.useCallback)(e=>"blocks"===e.name?R:"patterns"===e.name?N:M,[R,N,M]);return Object(o.createElement)("div",{className:"block-editor-inserter__menu"},Object(o.createElement)("div",{className:"block-editor-inserter__main-area"},Object(o.createElement)("div",{className:"block-editor-inserter__content"},Object(o.createElement)(r.SearchControl,{className:"block-editor-inserter__search",onChange:e=>{O&&v(null),g(e)},value:h,label:Object(c.__)("Search for blocks and patterns"),placeholder:Object(c.__)("Search")}),!!h&&Object(o.createElement)(V.a,{filterValue:h,onSelect:u,onHover:B,rootClientId:t,clientId:n,isAppender:i,__experimentalInsertionIndex:s,showBlockDirectory:!0,shouldFocusBlock:f}),!h&&(S||w)&&Object(o.createElement)(q,{showPatterns:S,showReusableBlocks:w},L),!h&&!S&&!w&&R)),d&&O&&Object(o.createElement)(b,{item:O}))}},xkPd:function(e,t,n){"use strict";var o=n("wx14"),r=n("GRId"),c=n("l3Sj"),l=n("gdqT");t.a=Object(r.forwardRef)((function(e,t){const[n,i]=Object(r.useState)(!1);return Object(r.useEffect)(()=>{n&&Object(l.speak)(Object(c.__)("Use left and right arrow keys to move through blocks"))},[n]),Object(r.createElement)("div",Object(o.a)({ref:t,role:"listbox","aria-orientation":"horizontal",onFocus:()=>{i(!0)},onBlur:e=>{!e.currentTarget.contains(e.relatedTarget)&&i(!1)}},e))}))},yU1v:function(e,t,n){"use strict";var o=n("wx14"),r=n("GRId"),c=n("TSYQ"),l=n.n(c),i=n("YLtl"),a=n("tI+e"),s=n("l3Sj"),u=n("dchM"),d=n("bVpQ"),b=n("Cn0l"),p=n("v5LD"),m=n("pY5h"),f=n("0LBR");const h=Object(s.__)("(%s: color %s)"),g=Object(s.__)("(%s: gradient %s)"),O=["colors","disableCustomColors","gradients","disableCustomGradients"],v=e=>{let{colors:t,gradients:n,settings:o}=e;return o.map((e,o)=>{let c,{colorValue:l,gradientValue:i,label:u,colors:p,gradients:m}=e;if(!l&&!i)return null;if(l){const e=Object(d.c)(p||t,l);c=Object(s.sprintf)(h,u.toLowerCase(),e&&e.name||l)}else{const e=Object(b.b)(m||n,l);c=Object(s.sprintf)(g,u.toLowerCase(),e&&e.name||i)}return Object(r.createElement)(a.ColorIndicator,{key:o,colorValue:l||i,"aria-label":c})})},j=e=>{let{className:t,colors:n,gradients:c,disableCustomColors:s,disableCustomGradients:d,children:b,settings:p,title:m,showTitle:f=!0,__experimentalHasMultipleOrigins:h,__experimentalIsRenderedInSidebar:g,enableAlpha:O,...j}=e;if(Object(i.isEmpty)(n)&&Object(i.isEmpty)(c)&&s&&d&&Object(i.every)(p,e=>Object(i.isEmpty)(e.colors)&&Object(i.isEmpty)(e.gradients)&&(void 0===e.disableCustomColors||e.disableCustomColors)&&(void 0===e.disableCustomGradients||e.disableCustomGradients)))return null;const k=Object(r.createElement)("span",{className:"block-editor-panel-color-gradient-settings__panel-title"},m,Object(r.createElement)(v,{colors:n,gradients:c,settings:p}));return Object(r.createElement)(a.PanelBody,Object(o.a)({className:l()("block-editor-panel-color-gradient-settings",t),title:f?k:void 0},j),Object(r.createElement)(u.a,{settings:p,colors:n,gradients:c,disableCustomColors:s,disableCustomGradients:d,__experimentalHasMultipleOrigins:h,__experimentalIsRenderedInSidebar:g,enableAlpha:O}),!!b&&Object(r.createElement)(r.Fragment,null,Object(r.createElement)(a.__experimentalSpacer,{marginY:4})," ",b))},k=e=>{const t=Object(m.a)();return t.colors=Object(p.a)("color.palette"),t.gradients=Object(p.a)("color.gradients"),Object(r.createElement)(j,Object(o.a)({},t,e))},_=e=>{const t=Object(f.a)();return Object(r.createElement)(j,Object(o.a)({},t,e))};t.a=e=>Object(i.every)(O,t=>e.hasOwnProperty(t))?Object(r.createElement)(j,e):e.__experimentalHasMultipleOrigins?Object(r.createElement)(_,e):Object(r.createElement)(k,e)},ywyh:function(e,t){e.exports=window.wp.apiFetch},"z+q2":function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var o=n("YLtl"),r=n("GRId"),c=n("1CF3"),l=n("1ZqX"),i=n("OL6h"),a=n("BhPs");function s(e){const t=Object(r.useRef)(),n=function(e){return Object(l.useSelect)(t=>{const{getSelectedBlocksInitialCaretPosition:n,isMultiSelecting:o,isNavigationMode:r,isBlockSelected:c}=t(a.a);if(c(e)&&!o()&&!r())return n()},[e])}(e);return Object(r.useEffect)(()=>{if(null==n)return;if(!t.current)return;const{ownerDocument:e}=t.current;if(t.current.contains(e.activeElement))return;const r=c.focus.tabbable.find(t.current).filter(e=>Object(c.isTextField)(e)),l=-1===n,a=(l?o.last:o.first)(r)||t.current;Object(i.c)(t.current,a)?Object(c.placeCaretAtHorizontalEdge)(a,l):t.current.focus()},[n]),t}},zQI6:function(e,t,n){"use strict";n.d(t,"b",(function(){return a})),n.d(t,"a",(function(){return s}));var o=n("wx14"),r=n("GRId"),c=n("1ZqX"),l=n("K9lf"),i=n("BhPs");function a(){const{hasSelectedBlock:e,hasMultiSelection:t}=Object(c.useSelect)(i.a),{clearSelectedBlock:n}=Object(c.useDispatch)(i.a);return Object(l.useRefEffect)(o=>{function r(r){(e()||t())&&r.target===o&&n()}return o.addEventListener("mousedown",r),()=>{o.removeEventListener("mousedown",r)}},[e,t,n])}function s(e){return Object(r.createElement)("div",Object(o.a)({ref:a()},e))}},ziDm:function(e,t,n){"use strict";var o=n("GRId"),r=n("Tqx9");const c=Object(o.createElement)(r.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(o.createElement)(r.Path,{d:"M11.1 19.8H20v-1.5h-8.9v1.5zm0-15.6v1.5H20V4.2h-8.9zM4 12.8h16v-1.5H4v1.5z"}));t.a=c},zmSX:function(e,t,n){"use strict";var o=n("Cn0l");n.d(t,"a",(function(){return o.a})),n.d(t,"b",(function(){return o.b})),n.d(t,"c",(function(){return o.c})),n.d(t,"d",(function(){return o.d})),n.d(t,"e",(function(){return o.e}))},zt9T:function(e,t,n){"use strict";var o=n("jB5C");e.exports=function(e,t,n){n=n||{},9===t.nodeType&&(t=o.getWindow(t));var r=n.allowHorizontalScroll,c=n.onlyScrollIfNeeded,l=n.alignWithTop,i=n.alignWithLeft,a=n.offsetTop||0,s=n.offsetLeft||0,u=n.offsetBottom||0,d=n.offsetRight||0;r=void 0===r||r;var b=o.isWindow(t),p=o.offset(e),m=o.outerHeight(e),f=o.outerWidth(e),h=void 0,g=void 0,O=void 0,v=void 0,j=void 0,k=void 0,_=void 0,y=void 0,E=void 0,C=void 0;b?(_=t,C=o.height(_),E=o.width(_),y={left:o.scrollLeft(_),top:o.scrollTop(_)},j={left:p.left-y.left-s,top:p.top-y.top-a},k={left:p.left+f-(y.left+E)+d,top:p.top+m-(y.top+C)+u},v=y):(h=o.offset(t),g=t.clientHeight,O=t.clientWidth,v={left:t.scrollLeft,top:t.scrollTop},j={left:p.left-(h.left+(parseFloat(o.css(t,"borderLeftWidth"))||0))-s,top:p.top-(h.top+(parseFloat(o.css(t,"borderTopWidth"))||0))-a},k={left:p.left+f-(h.left+O+(parseFloat(o.css(t,"borderRightWidth"))||0))+d,top:p.top+m-(h.top+g+(parseFloat(o.css(t,"borderBottomWidth"))||0))+u}),j.top<0||k.top>0?!0===l?o.scrollTop(t,v.top+j.top):!1===l?o.scrollTop(t,v.top+k.top):j.top<0?o.scrollTop(t,v.top+j.top):o.scrollTop(t,v.top+k.top):c||((l=void 0===l||!!l)?o.scrollTop(t,v.top+j.top):o.scrollTop(t,v.top+k.top)),r&&(j.left<0||k.left>0?!0===i?o.scrollLeft(t,v.left+j.left):!1===i?o.scrollLeft(t,v.left+k.left):j.left<0?o.scrollLeft(t,v.left+j.left):o.scrollLeft(t,v.left+k.left):c||((i=void 0===i||!!i)?o.scrollLeft(t,v.left+j.left):o.scrollLeft(t,v.left+k.left)))}}}); \ No newline at end of file diff --git a/packages/playground/remote/public/wp-6.0/wp-includes/empty.html b/packages/playground/remote/public/wp-6.0/wp-includes/empty.html index c50eddd41f..620d9da39e 100755 --- a/packages/playground/remote/public/wp-6.0/wp-includes/empty.html +++ b/packages/playground/remote/public/wp-6.0/wp-includes/empty.html @@ -1 +1 @@ - + diff --git a/packages/playground/remote/public/wp-6.0/wp-includes/js/dist/block-editor.js b/packages/playground/remote/public/wp-6.0/wp-includes/js/dist/block-editor.js index f05671ade9..c37ed82f2f 100755 --- a/packages/playground/remote/public/wp-6.0/wp-includes/js/dist/block-editor.js +++ b/packages/playground/remote/public/wp-6.0/wp-includes/js/dist/block-editor.js @@ -1,4 +1,47 @@ -/******/ (function() { // webpackBootstrap +/** + * A synchronous function to read a blob URL as text. + * + * @param {string} url + * @returns {string} + */ +const __playground_readBlobAsText = function (url) { + try { + let xhr = new XMLHttpRequest(); + xhr.open('GET', url, false); + xhr.overrideMimeType('text/plain;charset=utf-8'); + xhr.send(); + return xhr.responseText; + } catch(e) { + return ''; + } finally { + URL.revokeObjectURL(url); + } +} + +window.__playground_ControlledIframe = window.wp.element.forwardRef(function (props, ref) { + const source = window.wp.element.useMemo(function () { + if (props.srcDoc) { + // WordPress <= 6.2 uses a srcDoc that only contains a doctype. + return '/wp-includes/empty.html'; + } else if (props.src && props.src.startsWith('blob:')) { + // WordPress 6.3 uses a blob URL with doctype and a list of static assets. + // Let's pass the document content to empty.html and render it there. + return '/wp-includes/empty.html#' + encodeURIComponent(__playground_readBlobAsText(props.src)); + } else { + // WordPress >= 6.4 uses a plain HTTPS URL that needs no correction. + return props.src; + } + }, [props.src]); + return ( + window.wp.element.createElement('iframe', { + ...props, + ref: ref, + src: source, + // Make sure there's no srcDoc, as it would interfere with the src. + srcDoc: undefined + }) + ) +});/******/ (function() { // webpackBootstrap /******/ var __webpack_modules__ = ({ /***/ 6411: @@ -20940,11 +20983,11 @@ function Iframe(_ref3, ref) { key: id }); }), head); - return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, tabIndex >= 0 && before, (0,external_wp_element_namespaceObject.createElement)("iframe", _extends({}, props, { + return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, tabIndex >= 0 && before, (0,external_wp_element_namespaceObject.createElement)(__playground_ControlledIframe, _extends({}, props, { ref: (0,external_wp_compose_namespaceObject.useMergeRefs)([ref, setRef]), tabIndex: tabIndex // Correct doctype is required to enable rendering in standards mode , - src:"/wp-includes/empty.html", + srcDoc: "", title: (0,external_wp_i18n_namespaceObject.__)('Editor canvas') }), iframeDocument && (0,external_wp_element_namespaceObject.createPortal)((0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)("head", { ref: headRef diff --git a/packages/playground/remote/public/wp-6.0/wp-includes/js/dist/block-editor.min.js b/packages/playground/remote/public/wp-6.0/wp-includes/js/dist/block-editor.min.js index 357c659179..0bc29dba67 100755 --- a/packages/playground/remote/public/wp-6.0/wp-includes/js/dist/block-editor.min.js +++ b/packages/playground/remote/public/wp-6.0/wp-includes/js/dist/block-editor.min.js @@ -1,4 +1,47 @@ -/*! This file is auto-generated */ +/** + * A synchronous function to read a blob URL as text. + * + * @param {string} url + * @returns {string} + */ +const __playground_readBlobAsText = function (url) { + try { + let xhr = new XMLHttpRequest(); + xhr.open('GET', url, false); + xhr.overrideMimeType('text/plain;charset=utf-8'); + xhr.send(); + return xhr.responseText; + } catch(e) { + return ''; + } finally { + URL.revokeObjectURL(url); + } +} + +window.__playground_ControlledIframe = window.wp.element.forwardRef(function (props, ref) { + const source = window.wp.element.useMemo(function () { + if (props.srcDoc) { + // WordPress <= 6.2 uses a srcDoc that only contains a doctype. + return '/wp-includes/empty.html'; + } else if (props.src && props.src.startsWith('blob:')) { + // WordPress 6.3 uses a blob URL with doctype and a list of static assets. + // Let's pass the document content to empty.html and render it there. + return '/wp-includes/empty.html#' + encodeURIComponent(__playground_readBlobAsText(props.src)); + } else { + // WordPress >= 6.4 uses a plain HTTPS URL that needs no correction. + return props.src; + } + }, [props.src]); + return ( + window.wp.element.createElement('iframe', { + ...props, + ref: ref, + src: source, + // Make sure there's no srcDoc, as it would interfere with the src. + srcDoc: undefined + }) + ) +});/*! This file is auto-generated */ !function(){var e={6411:function(e,t){var n,o,r; /*! autosize 4.0.4 @@ -23,4 +66,4 @@ * @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;n3&&void 0!==arguments[3]?arguments[3]:1;const r=[...e];return r.splice(t,o),b(r,e.slice(t,t+o),n)}function _(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const n={[t]:[]};return e.forEach((e=>{const{clientId:o,innerBlocks:r}=e;n[t].push(o),Object.assign(n,_(r,o))})),n}function y(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return e.reduce(((e,n)=>Object.assign(e,{[n.clientId]:t},y(n.innerBlocks,n.clientId))),{})}function E(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:u.identity;const n={},o=[...e];for(;o.length;){const{innerBlocks:e,...r}=o.shift();o.push(...e),n[r.clientId]=t(r)}return n}function C(e){return E(e,(e=>(0,u.omit)(e,"attributes")))}function w(e){return E(e,(e=>e.attributes))}function S(e,t){return"UPDATE_BLOCK_ATTRIBUTES"===e.type&&void 0!==t&&"UPDATE_BLOCK_ATTRIBUTES"===t.type&&(0,u.isEqual)(e.clientIds,t.clientIds)&&function(e,t){return(0,u.isEqual)((0,u.keys)(e),(0,u.keys)(t))}(e.attributes,t.attributes)}function B(e,t){const n={},o=[...t],r=[...t];for(;o.length;){const e=o.shift();o.push(...e.innerBlocks),r.push(...e.innerBlocks)}for(const e of r)n[e.clientId]={};for(const t of r)n[t.clientId]=Object.assign(n[t.clientId],{...e.byClientId[t.clientId],attributes:e.attributes[t.clientId],innerBlocks:t.innerBlocks.map((e=>n[e.clientId]))});return n}function I(e,t,n){let o=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const r=new Set([]),l=new Set;for(const t of n){let n=o?t:e.parents[t];do{if(e.controlledInnerBlocks[n]){l.add(n);break}r.add(n),n=e.parents[n]}while(void 0!==n)}for(const e of r)t[e]={...t[e]};for(const n of r)t[n].innerBlocks=(e.order[n]||[]).map((e=>t[e]));for(const n of l)t["controlled||"+n]={innerBlocks:(e.order[n]||[]).map((e=>t[e]))};return t}const x=(0,u.flow)(m.combineReducers,(e=>(t,n)=>{if(t&&"SAVE_REUSABLE_BLOCK_SUCCESS"===n.type){const{id:e,updatedId:o}=n;if(e===o)return t;(t={...t}).attributes=(0,u.mapValues)(t.attributes,((n,r)=>{const{name:l}=t.byClientId[r];return"core/block"===l&&n.ref===e?{...n,ref:o}:n}))}return e(t,n)}),(e=>function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;const o=e(t,n);if(o===t)return t;switch(o.tree=t.tree?t.tree:{},n.type){case"RECEIVE_BLOCKS":case"INSERT_BLOCKS":{const e=B(o,n.blocks);o.tree=I(o,{...o.tree,...e},n.rootClientId?[n.rootClientId]:[""],!0);break}case"UPDATE_BLOCK":o.tree=I(o,{...o.tree,[n.clientId]:{...o.tree[n.clientId],...o.byClientId[n.clientId],attributes:o.attributes[n.clientId]}},[n.clientId],!1);break;case"UPDATE_BLOCK_ATTRIBUTES":{const e=n.clientIds.reduce(((e,t)=>(e[t]={...o.tree[t],attributes:o.attributes[t]},e)),{});o.tree=I(o,{...o.tree,...e},n.clientIds,!1);break}case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":{const e=B(o,n.blocks);o.tree=I(o,{...(0,u.omit)(o.tree,n.replacedClientIds.concat(n.replacedClientIds.filter((t=>!e[t])).map((e=>"controlled||"+e)))),...e},n.blocks.map((e=>e.clientId)),!1);const r=[];for(const e of n.clientIds)void 0===t.parents[e]||""!==t.parents[e]&&!o.byClientId[t.parents[e]]||r.push(t.parents[e]);o.tree=I(o,o.tree,r,!0);break}case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":const e=[];for(const r of n.clientIds)void 0===t.parents[r]||""!==t.parents[r]&&!o.byClientId[t.parents[r]]||e.push(t.parents[r]);o.tree=I(o,(0,u.omit)(o.tree,n.removedClientIds.concat(n.removedClientIds.map((e=>"controlled||"+e)))),e,!0);break;case"MOVE_BLOCKS_TO_POSITION":{const e=[];n.fromRootClientId&&e.push(n.fromRootClientId),n.toRootClientId&&e.push(n.toRootClientId),n.fromRootClientId&&n.fromRootClientId||e.push(""),o.tree=I(o,o.tree,e,!0);break}case"MOVE_BLOCKS_UP":case"MOVE_BLOCKS_DOWN":{const e=[n.rootClientId?n.rootClientId:""];o.tree=I(o,o.tree,e,!0);break}case"SAVE_REUSABLE_BLOCK_SUCCESS":{const e=(0,u.keys)((0,u.omitBy)(o.attributes,((e,t)=>"core/block"!==o.byClientId[t].name||e.ref!==n.updatedId)));o.tree=I(o,{...o.tree,...e.reduce(((e,t)=>(e[t]={...o.byClientId[t],attributes:o.attributes[t],innerBlocks:o.tree[t].innerBlocks},e)),{})},e,!1)}}return o}),(e=>(t,n)=>{const o=e=>{let o=e;for(let r=0;r(t,n)=>{if("REPLACE_INNER_BLOCKS"!==n.type)return e(t,n);const o={};if(Object.keys(t.controlledInnerBlocks).length){const e=[...n.blocks];for(;e.length;){const{innerBlocks:n,...r}=e.shift();e.push(...n),t.controlledInnerBlocks[r.clientId]&&(o[r.clientId]=!0)}}let r=t;t.order[n.rootClientId]&&(r=e(r,{type:"REMOVE_BLOCKS",keepControlledInnerBlocks:o,clientIds:t.order[n.rootClientId]}));let l=r;return n.blocks.length&&(l=e(l,{...n,type:"INSERT_BLOCKS",index:0}),l.order={...l.order,...(0,u.reduce)(o,((e,n,o)=>(t.order[o]&&(e[o]=t.order[o]),e)),{})}),l}),(e=>(t,n)=>{if("RESET_BLOCKS"===n.type){const e={...t,byClientId:C(n.blocks),attributes:w(n.blocks),order:_(n.blocks),parents:y(n.blocks),controlledInnerBlocks:{}},o=B(e,n.blocks);return e.tree={...o,"":{innerBlocks:n.blocks.map((e=>o[e.clientId]))}},e}return e(t,n)}),(function(e){let t,n=!1;return(o,r)=>{let l=e(o,r);const i="MARK_LAST_CHANGE_AS_PERSISTENT"===r.type||n;if(o===l&&!i){var 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:!S(r,t)},t=r,n="MARK_NEXT_CHANGE_AS_NOT_PERSISTENT"===r.type,l}}),(function(e){const t=new Set(["RECEIVE_BLOCKS"]);return(n,o)=>{const r=e(n,o);return r!==n&&(r.isIgnoredChange=t.has(o.type)),r}}),(e=>(t,n)=>{if("SET_HAS_CONTROLLED_INNER_BLOCKS"===n.type){const o=e(t,{type:"REPLACE_INNER_BLOCKS",rootClientId:n.clientId,blocks:[]});return e(o,n)}return e(t,n)}))({byClientId(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"RECEIVE_BLOCKS":case"INSERT_BLOCKS":return{...e,...C(t.blocks)};case"UPDATE_BLOCK":if(!e[t.clientId])return e;const n=(0,u.omit)(t.updates,"attributes");return(0,u.isEmpty)(n)?e:{...e,[t.clientId]:{...e[t.clientId],...n}};case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":return t.blocks?{...(0,u.omit)(e,t.replacedClientIds),...C(t.blocks)}:e;case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":return(0,u.omit)(e,t.removedClientIds)}return e},attributes(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"RECEIVE_BLOCKS":case"INSERT_BLOCKS":return{...e,...w(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),...w(t.blocks)}:e;case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":return(0,u.omit)(e,t.removedClientIds)}return e},order(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"RECEIVE_BLOCKS":{const n=_(t.blocks);return{...e,...(0,u.omit)(n,""),"":((null==e?void 0:e[""])||[]).concat(n[""])}}case"INSERT_BLOCKS":{const{rootClientId:n=""}=t,o=e[n]||[],r=_(t.blocks,n),{index:l=o.length}=t;return{...e,...r,[n]:b(o,r[n],l)}}case"MOVE_BLOCKS_TO_POSITION":{const{fromRootClientId:n="",toRootClientId:o="",clientIds:r}=t,{index:l=e[o].length}=t;if(n===o){const t=e[o].indexOf(r[0]);return{...e,[o]:k(e[o],t,l,r.length)}}return{...e,[n]:(0,u.without)(e[n],...r),[o]:b(e[o],r,l)}}case"MOVE_BLOCKS_UP":{const{clientIds:n,rootClientId:o=""}=t,r=(0,u.first)(n),l=e[o];if(!l.length||r===(0,u.first)(l))return e;const i=l.indexOf(r);return{...e,[o]:k(l,i,i-1,n.length)}}case"MOVE_BLOCKS_DOWN":{const{clientIds:n,rootClientId:o=""}=t,r=(0,u.first)(n),l=(0,u.last)(n),i=e[o];if(!i.length||l===(0,u.last)(i))return e;const a=i.indexOf(r);return{...e,[o]:k(i,a,a+1,n.length)}}case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":{const{clientIds:n}=t;if(!t.blocks)return e;const o=_(t.blocks);return(0,u.flow)([e=>(0,u.omit)(e,t.replacedClientIds),e=>({...e,...(0,u.omit)(o,"")}),e=>(0,u.mapValues)(e,(e=>(0,u.reduce)(e,((e,t)=>t===n[0]?[...e,...o[""]]:(-1===n.indexOf(t)&&e.push(t),e)),[])))])(e)}case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":return(0,u.flow)([e=>(0,u.omit)(e,t.removedClientIds),e=>(0,u.mapValues)(e,(e=>(0,u.without)(e,...t.removedClientIds)))])(e)}return e},parents(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"RECEIVE_BLOCKS":return{...e,...y(t.blocks)};case"INSERT_BLOCKS":return{...e,...y(t.blocks,t.rootClientId||"")};case"MOVE_BLOCKS_TO_POSITION":return{...e,...t.clientIds.reduce(((e,n)=>(e[n]=t.toRootClientId||"",e)),{})};case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":return{...(0,u.omit)(e,t.replacedClientIds),...y(t.blocks,e[t.clientIds[0]])};case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":return(0,u.omit)(e,t.removedClientIds)}return e},controlledInnerBlocks(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{type:t,clientId:n,hasControlledInnerBlocks:o}=arguments.length>1?arguments[1]:void 0;return"SET_HAS_CONTROLLED_INNER_BLOCKS"===t?{...e,[n]:o}:e}});function T(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"CLEAR_SELECTED_BLOCK":return e.clientId?{}:e;case"SELECT_BLOCK":return t.clientId===e.clientId?e:{clientId:t.clientId};case"REPLACE_INNER_BLOCKS":case"INSERT_BLOCKS":return t.updateSelection&&t.blocks.length?{clientId:t.blocks[0].clientId}:e;case"REMOVE_BLOCKS":return t.clientIds&&t.clientIds.length&&-1!==t.clientIds.indexOf(e.clientId)?{}:e;case"REPLACE_BLOCKS":{if(-1===t.clientIds.indexOf(e.clientId))return e;const n=t.blocks[t.indexToSelect]||t.blocks[t.blocks.length-1];return n?n.clientId===e.clientId?e:{clientId:n.clientId}:{}}}return e}var N,P,M=(0,m.combineReducers)({blocks:x,isTyping:function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"START_TYPING":return!0;case"STOP_TYPING":return!1}return e},draggedBlocks:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"START_DRAGGING_BLOCKS":return t.clientIds;case"STOP_DRAGGING_BLOCKS":return[]}return e},isCaretWithinFormattedText:function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"ENTER_FORMATTED_TEXT":return!0;case"EXIT_FORMATTED_TEXT":return!1}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:T(r.selectionStart,l),selectionEnd:T(r.selectionEnd,l)}},isMultiSelecting:function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"START_MULTI_SELECT":return!0;case"STOP_MULTI_SELECT":return!1}return e},isSelectionEnabled:function(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=arguments.length>1?arguments[1]:void 0;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,m.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},isNavigationMode:function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0;return"INSERT_BLOCKS"!==t.type&&("SET_NAVIGATION_MODE"===t.type?t.isNavigationMode:e)},hasBlockMovingClientId:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1?arguments[1]:void 0;return"SET_BLOCK_MOVING_MODE"===t.type?t.hasBlockMovingClientId:"SET_NAVIGATION_MODE"===t.type?null:e},automaticChangeStatus:function(e,t){switch(t.type){case"MARK_AUTOMATIC_CHANGE":return"pending";case"MARK_AUTOMATIC_CHANGE_FINAL":return"pending"===e?"final":void 0;case"SELECTION_CHANGE":return"final"!==e?e:void 0;case"START_TYPING":case"STOP_TYPING":return e}},highlightedBlock:function(e,t){switch(t.type){case"TOGGLE_BLOCK_HIGHLIGHT":const{clientId:n,isHighlighted:o}=t;return o?n:e===n?null:e;case"SELECT_BLOCK":if(t.clientId!==e)return null}return e},lastBlockInserted:function(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;switch(n.type){case"INSERT_BLOCKS":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}});function R(e){return[e]}function L(){var e={clear:function(){e.head=null}};return e}function A(e,t,n){var o;if(e.length!==t.length)return!1;for(o=n;o{const n=e.blocks.byClientId[t];return n?{...n,attributes:W(e,t)}:null}),((e,t)=>[e.blocks.byClientId[t],e.blocks.attributes[t]]));function K(e,t){var n;const o=t&&At(e,t)?"controlled||"+t:t||"";return(null===(n=e.blocks.tree[o])||void 0===n?void 0:n.innerBlocks)||H}const q=D(((e,t)=>({clientId:t,innerBlocks:Y(e,t)})),(e=>[e.blocks.order])),Y=D((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return(0,u.map)(Re(e,t),(t=>q(e,t)))}),(e=>[e.blocks.order])),Q=D(((e,t)=>{const n=[];for(const o of t)for(const t of Re(e,o))n.push(t,...Q(e,[t]));return n}),(e=>[e.blocks.order])),X=D((e=>{const t=[];for(const n of Re(e))t.push(n,...Q(e,[n]));return t}),(e=>[e.blocks.order])),Z=D(((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])),J=D(((e,t)=>{if(!t)return H;const n=X(e).filter((n=>e.blocks.byClientId[n].name===t));return n.length>0?n:H}),(e=>[e.blocks.order,e.blocks.byClientId])),ee=D(((e,t)=>(0,u.map)((0,u.castArray)(t),(t=>$(e,t)))),((e,t)=>(0,u.map)((0,u.castArray)(t),(t=>e.blocks.tree[t]))));function te(e,t){return Re(e,t).length}function ne(e){return e.selection.selectionStart}function oe(e){return e.selection.selectionEnd}function re(e){return e.selection.selectionStart.clientId}function le(e){return e.selection.selectionEnd.clientId}function ie(e){const t=_e(e).length;return t||(e.selection.selectionStart.clientId?1:0)}function ae(e){const{selectionStart:t,selectionEnd:n}=e.selection;return!!t.clientId&&t.clientId===n.clientId}function se(e){const{selectionStart:t,selectionEnd:n}=e.selection,{clientId:o}=t;return o&&o===n.clientId?o:null}function ce(e){const t=se(e);return t?$(e,t):null}function ue(e,t){return void 0!==e.blocks.parents[t]?e.blocks.parents[t]:null}const de=D((function(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const o=[];let r=t;for(;e.blocks.parents[r];)r=e.blocks.parents[r],o.push(r);return n?o:o.reverse()}),(e=>[e.blocks.parents])),pe=D((function(e,t,n){let o=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const r=de(e,t,o);return(0,u.map)((0,u.filter)((0,u.map)(r,(t=>({id:t,name:G(e,t)}))),(e=>{let{name:t}=e;return Array.isArray(n)?n.includes(t):t===n})),(e=>{let{id:t}=e;return t}))}),(e=>[e.blocks.parents]));function me(e,t){let n,o=t;do{n=o,o=e.blocks.parents[o]}while(o);return n}function fe(e,t){const n=se(e),o=[...de(e,t),t],r=[...de(e,n),n];let l;const i=Math.min(o.length,r.length);for(let e=0;e2&&void 0!==arguments[2]?arguments[2]:1;if(void 0===t&&(t=se(e)),void 0===t&&(t=n<0?Ee(e):Ce(e)),!t)return null;const o=ue(e,t);if(null===o)return null;const{order:r}=e.blocks,l=r[o],i=l.indexOf(t),a=i+1*n;return a<0||a===l.length?null:l[a]}function he(e,t){return ge(e,t,-1)}function ve(e,t){return ge(e,t,1)}function be(e){return e.initialPosition}const ke=D((e=>{const{selectionStart:t,selectionEnd:n}=e.selection;if(void 0===t.clientId||void 0===n.clientId)return H;if(t.clientId===n.clientId)return[t.clientId];const o=ue(e,t.clientId);if(null===o)return H;const r=Re(e,o),l=r.indexOf(t.clientId),i=r.indexOf(n.clientId);return l>i?r.slice(i,l+1):r.slice(l,i+1)}),(e=>[e.blocks.order,e.selection.selectionStart.clientId,e.selection.selectionEnd.clientId]));function _e(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId===n.clientId?H:ke(e)}const ye=D((e=>{const t=_e(e);return t.length?t.map((t=>$(e,t))):H}),(e=>[...ke.getDependants(e),e.blocks.byClientId,e.blocks.order,e.blocks.attributes]));function Ee(e){return(0,u.first)(_e(e))||null}function Ce(e){return(0,u.last)(_e(e))||null}function we(e,t){return Ee(e)===t}function Se(e,t){return-1!==_e(e).indexOf(t)}const Be=D(((e,t)=>{let n=t,o=!1;for(;n&&!o;)n=ue(e,n),o=Se(e,n);return o}),(e=>[e.blocks.order,e.selection.selectionStart.clientId,e.selection.selectionEnd.clientId]));function Ie(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId===n.clientId?null:t.clientId||null}function xe(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId===n.clientId?null:n.clientId||null}function Te(e){const t=ne(e),n=oe(e);return!t.attributeKey&&!n.attributeKey&&void 0===t.offset&&void 0===n.offset}function Ne(e){const t=ne(e),n=oe(e);return!!t&&!!n&&t.clientId===n.clientId&&t.attributeKey===n.attributeKey&&t.offset===n.offset}function Pe(e,t){const n=ne(e),o=oe(e);if(n.clientId===o.clientId)return!1;if(!n.attributeKey||!o.attributeKey||void 0===n.offset||void 0===o.offset)return!1;const l=ue(e,n.clientId);if(l!==ue(e,o.clientId))return!1;const i=Re(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=$(e,c);if(!(0,r.getBlockType)(d.name).merge)return!1;const p=$(e,u);if(p.name===d.name)return!0;const m=(0,r.switchToBlockType)(p,d.name);return m&&m.length}const Me=e=>{const t=ne(e),n=oe(e);if(t.clientId===n.clientId)return H;if(!t.attributeKey||!n.attributeKey||void 0===t.offset||void 0===n.offset)return H;const o=ue(e,t.clientId);if(o!==ue(e,n.clientId))return H;const l=Re(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,...V(h)}),k=(0,z.create)({html:g,...V(v)});return b=(0,z.remove)(b,0,s.offset),k=(0,z.remove)(k,c.offset,k.text.length),[{...u,attributes:{...u.attributes,[s.attributeKey]:(0,z.toHTMLString)({value:b,...V(h)})}},{...p,attributes:{...p.attributes,[c.attributeKey]:(0,z.toHTMLString)({value:k,...V(v)})}}]};function Re(e,t){return e.blocks.order[t||""]||H}function Le(e,t){return Re(e,ue(e,t)).indexOf(t)}function Ae(e,t){const{selectionStart:n,selectionEnd:o}=e.selection;return n.clientId===o.clientId&&n.clientId===t}function De(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return(0,u.some)(Re(e,t),(t=>Ae(e,t)||Se(e,t)||n&&De(e,t,n)))}function Oe(e,t){if(!t)return!1;const n=_e(e),o=n.indexOf(t);return o>-1&&o$e(e,t)))}function Ke(e){return e.isCaretWithinFormattedText}function qe(e){let t,n;const{insertionPoint:o,selection:{selectionEnd:r}}=e;if(null!==o)return o;const{clientId:l}=r;return l?(t=ue(e,l)||void 0,n=Le(e,r.clientId)+1):n=Re(e).length,{rootClientId:t,index:n}}function Ye(e){return null!==e.insertionPoint}function Qe(e){return e.template.isValid}function Xe(e){return e.settings.template}function Ze(e,t){if(!t)return e.settings.templateLock;const n=Ct(e,t);return n?n.templateLock:null}const Je=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return(0,u.isBoolean)(e)?e:(0,u.isArray)(e)?!(!e.includes("core/post-content")||null!==t)||e.includes(t):n},et=function(e,t){let n,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(t&&"object"==typeof t?(n=t,t=n.name):n=(0,r.getBlockType)(t),!n)return!1;const{allowedBlockTypes:i}=wt(e),a=Je(i,t,!0);if(!a)return!1;const s=!!Ze(e,o);if(s)return!1;const c=Ct(e,o);if(o&&void 0===c)return!1;const d=null==c?void 0:c.allowedBlocks,p=Je(d,t),m=n.parent,f=G(e,o),g=Je(m,f);let h=!0;const v=n.ancestor;if(v){const t=[o,...de(e,o)];h=(0,u.some)(t,(t=>Je(v,G(e,t))))}const b=h&&(null===p&&null===g||!0===p||!0===g);return b?(0,l.applyFilters)("blockEditor.__unstableCanInsertBlockType",b,n,o,{getBlock:$.bind(null,e),getBlockParentsByBlockName:pe.bind(null,e)}):b},tt=D(et,((e,t,n)=>[e.blockListSettings[n],e.blocks.byClientId[n],e.settings.allowedBlockTypes,e.settings.templateLock]));function nt(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return t.every((t=>tt(e,G(e,t),n)))}function ot(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const o=W(e,t);if(null===o)return!0;const{lock:r}=o,l=!!Ze(e,n);return void 0===r||void 0===(null==r?void 0:r.remove)?!l:!(null!=r&&r.remove)}function rt(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return t.every((t=>ot(e,t,n)))}function lt(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const o=W(e,t);if(null===o)return;const{lock:r}=o,l="all"===Ze(e,n);return void 0===r||void 0===(null==r?void 0:r.move)?!l:!(null!=r&&r.move)}function it(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return t.every((t=>lt(e,t,n)))}function at(e,t){var n;return!!(0,r.hasBlockSupport)(t,"lock",!0)&&!(null===(n=e.settings)||void 0===n||!n.canLockBlocks)}function st(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 ct=(e,t,n)=>!!(0,r.hasBlockSupport)(t,"inserter",!0)&&et(e,t.name,n),ut=(e,t)=>n=>{const o=`${t.id}/${n.name}`,{time:r,count:l=0}=st(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:dt(r,l)}},dt=(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}},pt=(e,t)=>{let{buildScope:n="inserter"}=t;return t=>{const o=t.name;let l=!1;(0,r.hasBlockSupport)(t.name,"multiple",!0)||(l=(0,u.some)(ee(e,X(e)),{name:t.name}));const{time:i,count:a=0}=st(e,o)||{},s={id:o,name:t.name,title:t.title,icon:t.icon,isDisabled:l,frecency:dt(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}}},mt=D((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const n=pt(e,{buildScope:"inserter"}),o=/^\s*)[^])*)\5|[^]*?)}\s+)?(\/)?-->/,l=t=>{let n=F;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}=st(e,l)||{},c=dt(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=>ct(e,n,t))).map(n),s=et(e,"core/block",t)?Nt(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=ut(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,Nt(e),(0,r.getBlockTypes)()])),ft=D((function(e,t){var n;let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const[l]=t,i=pt(e,{buildScope:"transform"}),a=(0,r.getBlockTypes)().filter((t=>ct(e,t,o))).map(i),s=(0,u.mapKeys)(a,(e=>{let{name:t}=e;return t}));s["*"]={frecency:1/0,id:"*",isDisabled:!1,name:"*",title:(0,g.__)("Unwrap"),icon:null===(n=s[l.name])||void 0===n?void 0:n.icon};const c=(0,r.getPossibleBlockTransformations)(t).reduce(((e,t)=>("*"===t?e.push(s["*"]):s[null==t?void 0:t.name]&&e.push(s[t.name]),e)),[]);return(0,u.orderBy)(c,(e=>s[e.name].frecency),"desc")}),((e,t)=>[e.blockListSettings[t],e.blocks.byClientId,e.preferences.insertUsage,e.settings.allowedBlockTypes,e.settings.templateLock,(0,r.getBlockTypes)()])),gt=D((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const n=(0,u.some)((0,r.getBlockTypes)(),(n=>ct(e,n,t)));if(n)return!0;const o=et(e,"core/block",t)&&Nt(e).length>0;return o}),((e,t)=>[e.blockListSettings[t],e.blocks.byClientId,e.settings.allowedBlockTypes,e.settings.templateLock,Nt(e),(0,r.getBlockTypes)()])),ht=D((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(t)return(0,u.filter)((0,r.getBlockTypes)(),(n=>ct(e,n,t)))}),((e,t)=>[e.blockListSettings[t],e.blocks.byClientId,e.settings.allowedBlockTypes,e.settings.templateLock,(0,r.getBlockTypes)()])),vt=D((function(e){var t,n;let o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(!o)return;const r=null===(t=e.blockListSettings[o])||void 0===t?void 0:t.__experimentalDefaultBlock,l=null===(n=e.blockListSettings[o])||void 0===n?void 0:n.__experimentalDirectInsert;return r&&l?"function"==typeof l?l($(e,o))?r:null:r:void 0}),((e,t)=>[e.blockListSettings[t],e.blocks.tree[t]])),bt=D(((e,t)=>{const n=e.settings.__experimentalBlockPatterns.find((e=>{let{name:n}=e;return n===t}));return n?{...n,blocks:(0,r.parse)(n.content,{__unstableSkipMigrationLogs:!0})}:null}),(e=>[e.settings.__experimentalBlockPatterns])),kt=D((e=>{const t=e.settings.__experimentalBlockPatterns,{allowedBlockTypes:n}=wt(e),o=t.filter((e=>{let{inserter:t=!0}=e;return!!t})).map((t=>{let{name:n}=t;return bt(e,n)})),r=o.filter((e=>{let{blocks:t}=e;return((e,t)=>{if((0,u.isBoolean)(t))return t;const n=[...e];for(;n.length>0;){var o;const e=n.shift();if(!Je(t,e.name||e.blockName,!0))return!1;null===(o=e.innerBlocks)||void 0===o||o.forEach((e=>{n.push(e)}))}return!0})(t,n)}));return r}),(e=>[e.settings.__experimentalBlockPatterns,e.settings.allowedBlockTypes])),_t=D((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const n=kt(e),o=(0,u.filter)(n,(n=>{let{blocks:o}=n;return o.every((n=>{let{name:o}=n;return tt(e,o,t)}))}));return o}),((e,t)=>[e.settings.__experimentalBlockPatterns,e.settings.allowedBlockTypes,e.settings.templateLock,e.blockListSettings[t],e.blocks.byClientId[t]])),yt=D((function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!t)return H;const o=_t(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)=>[..._t.getDependants(e,t)])),Et=D((function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!t)return H;if(t.some((t=>{let{clientId:n,innerBlocks:o}=t;return o.length||At(e,n)})))return H;const o=Array.from(new Set(t.map((e=>{let{name:t}=e;return t}))));return yt(e,o,n)}),((e,t)=>[...yt.getDependants(e,t)]));function Ct(e,t){return e.blockListSettings[t]}function wt(e){return e.settings}function St(e){return e.blocks.isPersistentChange}const Bt=D((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return t.reduce(((t,n)=>e.blockListSettings[n]?{...t,[n]:e.blockListSettings[n]}:t),{})}),(e=>[e.blockListSettings])),It=D(((e,t)=>{var n;const o=(0,u.find)(Nt(e),(e=>e.id===t));return o?null===(n=o.title)||void 0===n?void 0:n.raw:null}),(e=>[Nt(e)]));function xt(e){return e.blocks.isIgnoredChange}function Tt(e){return e.lastBlockAttributesChange}function Nt(e){var t,n;return null!==(t=null==e||null===(n=e.settings)||void 0===n?void 0:n.__experimentalReusableBlocks)&&void 0!==t?t:H}function Pt(e){return e.isNavigationMode}function Mt(e){return e.hasBlockMovingClientId}function Rt(e){return!!e.automaticChangeStatus}function Lt(e,t){return e.highlightedBlock===t}function At(e,t){return!!e.blocks.controlledInnerBlocks[t]}const Dt=D(((e,t)=>{if(!t.length)return null;const n=se(e);if(t.includes(G(e,n)))return n;const o=_e(e),r=pe(e,n||o[0],t);return r?(0,u.last)(r):null}),((e,t)=>[e.selection.selectionStart.clientId,e.selection.selectionEnd.clientId,t]));function Ot(e,t,n){const{lastBlockInserted:o}=e;return o.clientId===t&&o.source===n}var Ft=window.wp.a11y,zt=window.wp.deprecated,Vt=n.n(zt);const Ht=e=>t=>{let{dispatch:n}=t;n({type:"RESET_BLOCKS",blocks:e}),n(Gt(e))},Gt=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 Ut(e,t,n){return{type:"RESET_SELECTION",selectionStart:e,selectionEnd:t,initialPosition:n}}function Wt(e){return Vt()('wp.data.dispatch( "core/block-editor" ).receiveBlocks',{since:"5.9",alternative:"resetBlocks or insertBlocks"}),{type:"RECEIVE_BLOCKS",blocks:e}}function $t(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return{type:"UPDATE_BLOCK_ATTRIBUTES",clientIds:(0,u.castArray)(e),attributes:t,uniqueByBlock:n}}function jt(e,t){return{type:"UPDATE_BLOCK",clientId:e,updates:t}}function Kt(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return{type:"SELECT_BLOCK",initialPosition:t,clientId:e}}const qt=e=>t=>{let{select:n,dispatch:o}=t;const r=n.getPreviousBlockClientId(e);r&&o.selectBlock(r,-1)},Yt=e=>t=>{let{select:n,dispatch:o}=t;const r=n.getNextBlockClientId(e);r&&o.selectBlock(r)};function Qt(){return{type:"START_MULTI_SELECT"}}function Xt(){return{type:"STOP_MULTI_SELECT"}}const Zt=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,Ft.speak)((0,g.sprintf)((0,g._n)("%s block selected.","%s blocks selected.",i),i),"assertive")}};function Jt(){return{type:"CLEAR_SELECTED_BLOCK"}}function en(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return{type:"TOGGLE_SELECTION",isSelectionEnabled:e}}function tn(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 nn=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=(0,u.castArray)(e),t=tn((0,u.castArray)(t),i.getSettings());const s=i.getBlockRootClientId((0,u.first)(e));for(let e=0;e{let{select:t,dispatch:n}=e;if(t.getBlockCount()>0)return;const{__unstableHasCustomAppender:o}=t.getSettings();o||n.insertDefaultBlock()}))}};function on(e,t){return nn(e,t)}const rn=e=>(t,n)=>o=>{let{select:r,dispatch:l}=o;r.canMoveBlocks(t,n)&&l({type:e,clientIds:(0,u.castArray)(t),rootClientId:n})},ln=rn("MOVE_BLOCKS_DOWN"),an=rn("MOVE_BLOCKS_UP"),sn=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 cn(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 sn([e],t,n,o)}function un(e,t,n,o,r){return dn([e],t,n,o,0,r)}const dn=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;(0,u.isObject)(r)&&(l=r,r=0,Vt()("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=tn((0,u.castArray)(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 pn(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 mn(){return{type:"HIDE_INSERTION_POINT"}}function fn(e){return{type:"SET_TEMPLATE_VALIDITY",isValid:e}}const gn=()=>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)},hn=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 d,p;c.indexOf(i.clientId)>c.indexOf(a.clientId)?(d=a,p=i):(d=i,p=a);const m=e?p:d,f=o.getBlock(m.clientId),g=(0,r.getBlockType)(f.name);if(!g.merge)return;const h=d,v=p,b=o.getBlock(h.clientId),k=(0,r.getBlockType)(b.name),_=o.getBlock(v.clientId),y=(0,r.getBlockType)(_.name),E=b.attributes[h.attributeKey],C=_.attributes[v.attributeKey],w=k.attributes[h.attributeKey],S=y.attributes[v.attributeKey];let B=(0,z.create)({html:E,...V(w)}),I=(0,z.create)({html:C,...V(S)});B=(0,z.remove)(B,h.offset,B.text.length),I=(0,z.insert)(I,"†",0,v.offset);const x=(0,r.cloneBlock)(b,{[h.attributeKey]:(0,z.toHTMLString)({value:B,...V(w)})}),T=(0,r.cloneBlock)(_,{[v.attributeKey]:(0,z.toHTMLString)({value:I,...V(S)})}),N=e?x:T,P=b.name===_.name?[N]:(0,r.switchToBlockType)(N,g.name);if(!P||!P.length)return;let M;if(e){const e=P.pop();M=g.merge(e.attributes,T.attributes)}else{const e=P.shift();M=g.merge(x.attributes,e.attributes)}const R=(0,u.findKey)(M,(e=>"string"==typeof e&&-1!==e.indexOf("†"))),L=M[R],A=(0,z.create)({html:L,...V(g.attributes[R])}),D=A.text.indexOf("†"),O=(0,z.remove)(A,D,D+1),F=(0,z.toHTMLString)({value:O,...V(g.attributes[R])});M[R]=F;const H=o.getSelectedBlockClientIds(),G=[...e?P:[],{...f,attributes:{...f.attributes,...M}},...e?[]:P];n.batch((()=>{l.selectionChange(f.clientId,R,D,D),l.replaceBlocks(H,G,0,o.getSelectedBlocksInitialCaretPosition())}))},vn=()=>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],k=g.attributes[d.attributeKey];let _=(0,z.create)({html:h,...V(b)}),y=(0,z.create)({html:v,...V(k)});_=(0,z.remove)(_,u.offset,_.text.length),y=(0,z.remove)(y,0,d.offset),n.replaceBlocks(t.getSelectedBlockClientIds(),[{...p,attributes:{...p.attributes,[u.attributeKey]:(0,z.toHTMLString)({value:_,...V(b)})}},(0,r.createBlock)((0,r.getDefaultBlockName)()),{...f,attributes:{...f.attributes,[d.attributeKey]:(0,z.toHTMLString)({value:y,...V(k)})}}],1,t.getSelectedBlocksInitialCaretPosition())},bn=()=>e=>{let{select:t,dispatch:n}=e;const o=t.getSelectionStart(),r=t.getSelectionEnd();n.selectionChange({start:{clientId:o.clientId},end:{clientId:r.clientId}})},kn=(e,t)=>n=>{let{select:o,dispatch:l}=n;const i=[e,t];l({type:"MERGE_BLOCKS",blocks:i});const[a,s]=i,c=o.getBlock(a),d=(0,r.getBlockType)(c.name);if(d&&!d.merge)return void l.selectBlock(c.clientId);const p=o.getBlock(s),m=(0,r.getBlockType)(p.name),{clientId:f,attributeKey:g,offset:h}=o.getSelectionStart(),v=(f===a?d:m).attributes[g],b=(f===a||f===s)&&void 0!==g&&void 0!==h&&!!v;v||("number"==typeof g?window.console.error("RichText needs an identifier prop that is the block attribute key of the attribute it controls. Its type is expected to be a string, but was "+typeof g):window.console.error("The RichText identifier prop does not match any attributes defined by the block."));const k=(0,r.cloneBlock)(c),_=(0,r.cloneBlock)(p);if(b){const e=f===a?k:_,t=e.attributes[g],n=(0,z.insert)((0,z.create)({html:t,...V(v)}),"†",h,h);e.attributes[g]=(0,z.toHTMLString)({value:n,...V(v)})}const y=c.name===p.name?[_]:(0,r.switchToBlockType)(_,c.name);if(!y||!y.length)return;const E=d.merge(k.attributes,y[0].attributes);if(b){const e=(0,u.findKey)(E,(e=>"string"==typeof e&&-1!==e.indexOf("†"))),t=E[e],n=(0,z.create)({html:t,...V(d.attributes[e])}),o=n.text.indexOf("†"),r=(0,z.remove)(n,o,o+1),i=(0,z.toHTMLString)({value:r,...V(d.attributes[e])});E[e]=i,l.selectionChange(c.clientId,e,o,o)}l.replaceBlocks([c.clientId,p.clientId],[{...c,attributes:{...c.attributes,...E}},...y.slice(1)],0)},_n=function(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return n=>{let{select:o,dispatch:r}=n;if(!e||!e.length)return;e=(0,u.castArray)(e);const l=o.getBlockRootClientId(e[0]);o.canRemoveBlocks(e,l)&&(t&&r.selectPreviousBlock(e[0]),r({type:"REMOVE_BLOCKS",clientIds:e}),r((e=>{let{select:t,dispatch:n}=e;if(t.getBlockCount()>0)return;const{__unstableHasCustomAppender:o}=t.getSettings();o||n.insertDefaultBlock()})))}};function yn(e,t){return _n([e],t)}function En(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 Cn(e){return{type:"TOGGLE_BLOCK_MODE",clientId:e}}function wn(){return{type:"START_TYPING"}}function Sn(){return{type:"STOP_TYPING"}}function Bn(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return{type:"START_DRAGGING_BLOCKS",clientIds:e}}function In(){return{type:"STOP_DRAGGING_BLOCKS"}}function xn(){return{type:"ENTER_FORMATTED_TEXT"}}function Tn(){return{type:"EXIT_FORMATTED_TEXT"}}function Nn(e,t,n,o){return"string"==typeof e?{type:"SELECTION_CHANGE",clientId:e,attributeKey:t,startOffset:n,endOffset:o}:{type:"SELECTION_CHANGE",...e}}const Pn=(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 Mn(e,t){return{type:"UPDATE_BLOCK_LIST_SETTINGS",clientId:e,settings:t}}function Rn(e){return{type:"UPDATE_SETTINGS",settings:e}}function Ln(e,t){return{type:"SAVE_REUSABLE_BLOCK_SUCCESS",id:e,updatedId:t}}function An(){return{type:"MARK_LAST_CHANGE_AS_PERSISTENT"}}function Dn(){return{type:"MARK_NEXT_CHANGE_AS_NOT_PERSISTENT"}}const On=()=>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"})}))},Fn=function(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return t=>{let{dispatch:n}=t;n({type:"SET_NAVIGATION_MODE",isNavigationMode:e}),e?(0,Ft.speak)((0,g.__)("You are currently in navigation mode. Navigate blocks using the Tab key and Arrow keys. Use Left and Right Arrow keys to move between nesting levels. To exit navigation mode and edit the selected block, press Enter.")):(0,Ft.speak)((0,g.__)("You are currently in edit mode. To return to the navigation mode, press Escape."))}},zn=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,Ft.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."))}},Vn=function(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return n=>{let{select:o,dispatch:l}=n;if(!e||!e.length)return;const i=o.getBlocksByClientId(e);if((0,u.some)(i,(e=>!e)))return;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=o.getBlockIndex((0,u.last)((0,u.castArray)(e))),d=i.map((e=>(0,r.__experimentalCloneSanitizedBlock)(e)));return l.insertBlocks(d,c+1,s,t),d.length>1&&t&&l.multiSelect((0,u.first)(d).clientId,(0,u.last)(d).clientId),d.map((e=>e.clientId))}},Hn=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)},Gn=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 Un(e,t){return{type:"TOGGLE_BLOCK_HIGHLIGHT",clientId:e,isHighlighted:t}}const Wn=e=>async t=>{let{dispatch:n}=t;n(Un(e,!0)),await new Promise((e=>setTimeout(e,150))),n(Un(e,!1))};function $n(e,t){return{type:"SET_HAS_CONTROLLED_INNER_BLOCKS",hasControlledInnerBlocks:t,clientId:e}}const jn="core/block-editor",Kn={reducer:M,selectors:e,actions:t},qn=(0,m.createReduxStore)(jn,{...Kn,persist:["preferences"]});(0,m.registerStore)(jn,{...Kn,persist:["preferences"]});const Yn={name:"",isSelected:!1},Qn=(0,a.createContext)(Yn),{Provider:Xn}=Qn;function Zn(){return(0,a.useContext)(Qn)}function Jn(){const{isSelected:e,clientId:t,name:n}=Zn();return(0,m.useSelect)((o=>{if(e)return!0;const{getBlockName:r,isFirstMultiSelectedBlock:l,getMultiSelectedBlockClientIds:i}=o(qn);return!!l(t)&&i().every((e=>r(e)===n))}),[t,e,n])}function eo(e){let{group:t="default",controls:n,children:o,__experimentalShareWithChildBlocks:l=!1}=e;const i=function(e,t){const n=Jn(),{clientId:o}=Zn(),l=(0,m.useSelect)((e=>{const{getBlockName:n,hasSelectedInnerBlock:l}=e(qn),{hasBlockSupport:i}=e(r.store);return t&&i(n(o),"__experimentalExposeControlsToChildren",!1)&&l(o)}),[t,o]);var i;return n?null===(i=f[e])||void 0===i?void 0:i.Fill:l?f.parent.Fill:null}(t,l);return i?(0,a.createElement)(p.__experimentalStyleProvider,{document:document},(0,a.createElement)(i,null,(e=>{const r=(0,u.isEmpty)(e)?null:e;return(0,a.createElement)(p.__experimentalToolbarContext.Provider,{value:r},"default"===t&&(0,a.createElement)(p.ToolbarGroup,{controls:n}),o)}))):null}function to(e){let{group:t="default",...n}=e;const o=(0,a.useContext)(p.__experimentalToolbarContext),r=f[t].Slot,l=(0,p.__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)(p.ToolbarGroup,null,(0,a.createElement)(r,i({},n,{bubblesVirtually:!0,fillProps:o}))):null}const no=eo;no.Slot=to;const oo=e=>(0,a.createElement)(eo,i({group:"inline"},e));oo.Slot=e=>(0,a.createElement)(to,i({group:"inline"},e));var ro=no;var lo=(0,a.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(O.Path,{d:"M5 15h14V9H5v6zm0 4.8h14v-1.5H5v1.5zM5 4.2v1.5h14V4.2H5z"}));var io=(0,a.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(O.Path,{d:"M4 9v6h14V9H4zm8-4.8H4v1.5h8V4.2zM4 19.8h8v-1.5H4v1.5z"}));var ao=(0,a.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(O.Path,{d:"M7 9v6h10V9H7zM5 19.8h14v-1.5H5v1.5zM5 4.3v1.5h14V4.3H5z"}));var so=(0,a.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(O.Path,{d:"M6 15h14V9H6v6zm6-10.8v1.5h8V4.2h-8zm0 15.6h8v-1.5h-8v1.5z"}));var co=(0,a.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(O.Path,{d:"M5 9v6h14V9H5zm11-4.8H8v1.5h8V4.2zM8 19.8h8v-1.5H8v1.5z"}));var uo=(0,a.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(O.Path,{d:"M5 4v11h14V4H5zm3 15.8h8v-1.5H8v1.5z"}));var po=(0,a.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(O.Path,{d:"M9 9v6h11V9H9zM4 20h1.5V4H4v16z"}));var mo=(0,a.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(O.Path,{d:"M20 9h-7.2V4h-1.6v5H4v6h7.2v5h1.6v-5H20z"}));var fo=(0,a.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(O.Path,{d:"M4 15h11V9H4v6zM18.5 4v16H20V4h-1.5z"}));var go=(0,a.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(O.Path,{d:"M9 15h6V9H9v6zm-5 5h1.5V4H4v16zM18.5 4v16H20V4h-1.5z"}));var ho=(0,a.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(O.Path,{d:"M14.3 6.7l-1.1 1.1 4 4H4v1.5h13.3l-4.1 4.4 1.1 1.1 5.8-6.3z"}));var vo=(0,a.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(O.Path,{d:"M16.2 13.2l-4 4V4h-1.5v13.3l-4.5-4.1-1 1.1 6.2 5.8 5.8-5.8-1-1.1z"}));function bo(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return e.split(",").map((e=>`.editor-styles-wrapper ${e} ${t}`)).join(",")}const ko=(0,a.createContext)({refs:new Map,callbacks:new Map});function _o(e){let{children:t}=e;const n=(0,a.useMemo)((()=>({refs:new Map,callbacks:new Map})),[]);return(0,a.createElement)(ko.Provider,{value:n},t)}function yo(e){const{refs:t,callbacks:n}=(0,a.useContext)(ko),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 Eo(e){const{refs:t}=(0,a.useContext)(ko),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 Co(e){const{callbacks:t}=(0,a.useContext)(ko),n=Eo(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}const wo=["color","border","typography","spacing"],So={"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},Bo={"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 Io(e){const{name:t}=Zn(),n=(0,m.useSelect)((n=>{var o;if(wo.includes(e))return void console.warn("Top level useSetting paths are disabled. Please use a subpath to query the information needed.");const l=n(qn).getSettings(),i=(e=>Bo[e]||e)(e),a=`__experimentalFeatures.${i}`,s=`__experimentalFeatures.blocks.${t}.${i}`,c=null!==(o=(0,u.get)(l,s))&&void 0!==o?o:(0,u.get)(l,a);var d,p;if(void 0!==c)return r.__EXPERIMENTAL_PATHS_WITH_MERGE[i]?null!==(d=null!==(p=c.custom)&&void 0!==p?p:c.theme)&&void 0!==d?d:c.default:c;const m=So[i]?So[i](l):void 0;return void 0!==m?m:"typography.dropCap"===i||void 0}),[t,e]);return n}window.wp.warning;var xo={default:(0,p.createSlotFill)("InspectorControls"),advanced:(0,p.createSlotFill)("InspectorAdvancedControls"),border:(0,p.createSlotFill)("InspectorControlsBorder"),color:(0,p.createSlotFill)("InspectorControlsColor"),dimensions:(0,p.createSlotFill)("InspectorControlsDimensions"),typography:(0,p.createSlotFill)("InspectorControlsTypography")};function To(e){var t;let{__experimentalGroup:n="default",children:o}=e;const r=Jn(),l=null===(t=xo[n])||void 0===t?void 0:t.Fill;return l?r?(0,a.createElement)(p.__experimentalStyleProvider,{document:document},(0,a.createElement)(l,null,(e=>{const t=(0,u.isEmpty)(e)?null:e;return(0,a.createElement)(p.__experimentalToolsPanelContext.Provider,{value:t},o)}))):null:("undefined"!=typeof process&&process.env,null)}const No=e=>{if(!(0,u.isObject)(e)||Array.isArray(e))return e;const t=(0,u.pickBy)((0,u.mapValues)(e,No),u.identity);return(0,u.isEmpty)(t)?void 0:t};function Po(e,t,n){return(0,u.setWith)(e?(0,u.clone)(e):{},t,n,u.clone)}function Mo(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(0,u.forEach)(e,((e,n)=>{e&&t[n].forEach((e=>{const t=(0,u.get)(a,e);t&&(c={...c,attributes:Po(c.attributes,e,t)})}))})),c}function Ro(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 Lo(e){let{children:t,group:n,label:o}=e;const{updateBlockAttributes:r}=(0,m.useDispatch)(qn),{getBlockAttributes:l,getMultiSelectedBlockClientIds:i,getSelectedBlockClientId:s,hasMultiSelection:c}=(0,m.useSelect)(qn),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:No(r.style)},t[n]=r})),r(n,t,!0)}),[No,l,i,c,u,r]);return(0,a.createElement)(p.__experimentalToolsPanel,{className:`${n}-block-support-panel`,label:o,resetAll:d,key:u,panelId:u,hasInnerWrapper:!0,shouldRenderPlaceholderItems:!0,__experimentalFirstVisibleItemClass:"first",__experimentalLastVisibleItemClass:"last"},t)}function Ao(e){let{Slot:t,...n}=e;const o=(0,a.useContext)(p.__experimentalToolsPanelContext);return(0,a.createElement)(t,i({},n,{fillProps:o,bubblesVirtually:!0}))}function Do(e){var t;let{__experimentalGroup:n="default",label:o,...r}=e;const l=null===(t=xo[n])||void 0===t?void 0:t.Slot,s=(0,p.__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)(Lo,{group:n,label:o},(0,a.createElement)(Ao,i({},r,{Slot:l}))):(0,a.createElement)(l,i({},r,{bubblesVirtually:!0})):null}const Oo=To;Oo.Slot=Do;const Fo=e=>(0,a.createElement)(To,i({},e,{__experimentalGroup:"advanced"}));Fo.Slot=e=>(0,a.createElement)(Do,i({},e,{__experimentalGroup:"advanced"})),Fo.slotName="InspectorAdvancedControls";var zo=Oo;function Vo(e){const t=(0,r.getBlockSupport)(e,jo);return!!(!0===t||null!=t&&t.margin)}function Ho(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!Io("spacing.margin"),n=!Zo(e,"margin");return!Vo(e)||t||n}function Go(e){var t;const{name:n,attributes:{style:o},setAttributes:r}=e,l=(0,p.__experimentalUseCustomUnits)({availableUnits:Io("spacing.units")||["%","px","em","rem","vw"]}),i=Xo(n,"margin"),s=i&&i.some((e=>qo.includes(e)));if(Ho(e))return null;return a.Platform.select({web:(0,a.createElement)(a.Fragment,null,(0,a.createElement)(p.__experimentalBoxControl,{values:null==o||null===(t=o.spacing)||void 0===t?void 0:t.margin,onChange:e=>{const t={...o,spacing:{...null==o?void 0:o.spacing,margin:e}};r({style:No(t)})},onChangeShowVisualizer:e=>{const t={...o,visualizers:{margin:e}};r({style:No(t)})},label:(0,g.__)("Margin"),sides:i,units:l,allowReset:!1,splitOnAxis:s})),native:null})}function Uo(e){const t=(0,r.getBlockSupport)(e,jo);return!!(!0===t||null!=t&&t.padding)}function Wo(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!Io("spacing.padding"),n=!Zo(e,"padding");return!Uo(e)||t||n}function $o(e){var t;const{name:n,attributes:{style:o},setAttributes:r}=e,l=(0,p.__experimentalUseCustomUnits)({availableUnits:Io("spacing.units")||["%","px","em","rem","vw"]}),i=Xo(n,"padding"),s=i&&i.some((e=>qo.includes(e)));if(Wo(e))return null;return a.Platform.select({web:(0,a.createElement)(a.Fragment,null,(0,a.createElement)(p.__experimentalBoxControl,{values:null==o||null===(t=o.spacing)||void 0===t?void 0:t.padding,onChange:e=>{const t={...o,spacing:{...null==o?void 0:o.spacing,padding:e}};r({style:No(t)})},onChangeShowVisualizer:e=>{const t={...o,visualizers:{padding:e}};r({style:No(t)})},label:(0,g.__)("Padding"),sides:i,units:l,allowReset:!1,splitOnAxis:s})),native:null})}const jo="spacing",Ko=["top","right","bottom","left"],qo=["vertical","horizontal"];function Yo(e){const t=tr(e),n=Wo(e),o=Ho(e),l=Qo(e),i=function(e){if("web"!==a.Platform.OS)return!1;return Jo(e)||Uo(e)||Vo(e)}(e.name);if(l||!i)return null;const s=(0,r.getBlockSupport)(e.name,[jo,"__experimentalDefaultControls"]),c=e=>t=>{var n;return{...t,style:{...t.style,spacing:{...null===(n=t.style)||void 0===n?void 0:n.spacing,[e]:void 0}}}};return(0,a.createElement)(zo,{__experimentalGroup:"dimensions"},!n&&(0,a.createElement)(p.__experimentalToolsPanelItem,{hasValue:()=>function(e){var t,n;return void 0!==(null===(t=e.attributes.style)||void 0===t||null===(n=t.spacing)||void 0===n?void 0:n.padding)}(e),label:(0,g.__)("Padding"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:No({...o,spacing:{...null==o?void 0:o.spacing,padding:void 0}})})}(e),resetAllFilter:c("padding"),isShownByDefault:null==s?void 0:s.padding,panelId:e.clientId},(0,a.createElement)($o,e)),!o&&(0,a.createElement)(p.__experimentalToolsPanelItem,{hasValue:()=>function(e){var t,n;return void 0!==(null===(t=e.attributes.style)||void 0===t||null===(n=t.spacing)||void 0===n?void 0:n.margin)}(e),label:(0,g.__)("Margin"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:No({...o,spacing:{...null==o?void 0:o.spacing,margin:void 0}})})}(e),resetAllFilter:c("margin"),isShownByDefault:null==s?void 0:s.margin,panelId:e.clientId},(0,a.createElement)(Go,e)),!t&&(0,a.createElement)(p.__experimentalToolsPanelItem,{hasValue:()=>function(e){var t,n;return void 0!==(null===(t=e.attributes.style)||void 0===t||null===(n=t.spacing)||void 0===n?void 0:n.blockGap)}(e),label:(0,g.__)("Block spacing"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:{...o,spacing:{...null==o?void 0:o.spacing,blockGap:void 0}}})}(e),resetAllFilter:c("blockGap"),isShownByDefault:null==s?void 0:s.blockGap,panelId:e.clientId},(0,a.createElement)(nr,e)))}const Qo=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=tr(e),n=Wo(e),o=Ho(e);return t&&n&&o};function Xo(e,t){var n;const o=(0,r.getBlockSupport)(e,jo);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 Zo(e,t){const n=Xo(e,t);return!(n&&n.some((e=>Ko.includes(e)))&&n.some((e=>qo.includes(e))))||(console.warn(`The ${t} support for the "${e}" block can not be configured to support both axial and arbitrary sides.`),!1)}function Jo(e){const t=(0,r.getBlockSupport)(e,jo);return!!(!0===t||null!=t&&t.blockGap)}function er(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 tr(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!Io("spacing.blockGap");return!Jo(e)||t}function nr(e){var t;const{clientId:n,attributes:{style:o},name:r,setAttributes:l}=e,i=(0,p.__experimentalUseCustomUnits)({availableUnits:Io("spacing.units")||["%","px","em","rem","vw"]}),s=Xo(r,"blockGap"),c=Eo(n);if(tr(e))return null;const u=s&&s.some((e=>qo.includes(e))),d=e=>{var t;let n=e;e&&u&&(n={...er(e)});const r={...o,spacing:{...null==o?void 0:o.spacing,blockGap:n}};l({style:No(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;c.current&&i&&(null===(a=c.current.parentNode)||void 0===a||a.replaceChild(c.current,c.current))},m=er(null==o||null===(t=o.spacing)||void 0===t?void 0:t.blockGap),f=u?{...m,right:null==m?void 0:m.left,bottom:null==m?void 0:m.top}:null==m?void 0:m.top;return a.Platform.select({web:(0,a.createElement)(a.Fragment,null,u?(0,a.createElement)(p.__experimentalBoxControl,{label:(0,g.__)("Block spacing"),min:0,onChange:d,units:i,sides:s,values:f,allowReset:!1,splitOnAxis:u}):(0,a.createElement)(p.__experimentalUnitControl,{label:(0,g.__)("Block spacing"),__unstableInputWidth:"80px",min:0,onChange:d,units:i,value:f})),native:null})}const or=(0,a.createElement)(p.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(p.Path,{d:"M15 4H9v11h6V4zM4 18.5V20h16v-1.5H4z"})),rr=(0,a.createElement)(p.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(p.Path,{d:"M20 11h-5V4H9v7H4v1.5h5V20h6v-7.5h5z"})),lr={top:{icon:(0,a.createElement)(p.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(p.Path,{d:"M9 20h6V9H9v11zM4 4v1.5h16V4H4z"})),title:(0,g._x)("Align top","Block vertical alignment setting")},center:{icon:rr,title:(0,g._x)("Align middle","Block vertical alignment setting")},bottom:{icon:or,title:(0,g._x)("Align bottom","Block vertical alignment setting")}},ir=["top","center","bottom"],ar={isAlternate:!0};var sr=function(e){let{value:t,onChange:n,controls:o=ir,isCollapsed:r=!0,isToolbar:l}=e;const s=lr[t],c=lr.top,u=l?p.ToolbarGroup:p.ToolbarDropdownMenu,d=l?{isCollapsed:r}:{};return(0,a.createElement)(u,i({popoverProps:ar,icon:s?s.icon:c.icon,label:(0,g._x)("Change vertical alignment","Block vertical alignment setting label"),controls:o.map((e=>{return{...lr[e],isActive:t===e,role:r?"menuitemradio":void 0,onClick:(o=e,()=>n(t===o?void 0:o))};var o}))},d))};const cr=e=>(0,a.createElement)(sr,i({},e,{isToolbar:!1})),ur=e=>(0,a.createElement)(sr,i({},e,{isToolbar:!0})),dr={left:po,center:mo,right:fo,"space-between":go};var pr=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?dr[r]:dr.left,d=[{name:"left",icon:po,title:(0,g.__)("Justify items left"),isActive:"left"===r,onClick:()=>c("left")},{name:"center",icon:mo,title:(0,g.__)("Justify items center"),isActive:"center"===r,onClick:()=>c("center")},{name:"right",icon:fo,title:(0,g.__)("Justify items right"),isActive:"right"===r,onClick:()=>c("right")},{name:"space-between",icon:go,title:(0,g.__)("Space between items"),isActive:"space-between"===r,onClick:()=>c("space-between")}],m=s?p.ToolbarGroup:p.ToolbarDropdownMenu,f=s?{isCollapsed:n}:{};return(0,a.createElement)(m,i({icon:u,popoverProps:l,label:(0,g.__)("Change items justification"),controls:d.filter((e=>t.includes(e.name)))},f))};const mr=e=>(0,a.createElement)(pr,i({},e,{isToolbar:!1})),fr=e=>(0,a.createElement)(pr,i({},e,{isToolbar:!0})),gr={left:"flex-start",right:"flex-end",center:"center","space-between":"space-between"},hr={left:"flex-start",right:"flex-end",center:"center"},vr={top:"flex-start",center:"center",bottom:"flex-end"},br=["wrap","nowrap"];var kr={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)(p.Flex,null,(0,a.createElement)(p.FlexItem,null,(0,a.createElement)(yr,{layout:t,onChange:n})),(0,a.createElement)(p.FlexItem,null,r&&(0,a.createElement)(Cr,{layout:t,onChange:n}))),(0,a.createElement)(Er,{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)(ro,{group:"block",__experimentalShareWithChildBlocks:!0},(0,a.createElement)(yr,{layout:t,onChange:n,isToolbar:!0}),r&&"vertical"!==(null==t?void 0:t.orientation)&&(0,a.createElement)(_r,{layout:t,onChange:n,isToolbar:!0}))},save:function(e){var t,n;let{selector:o,layout:l,style:i,blockName:s}=e;const{orientation:c="horizontal"}=l,u=Io("spacing.blockGap"),d=(0,r.getBlockSupport)(s,["spacing","blockGap","__experimentalDefault"])||"0.5em",p=null!==u,m=null!=i&&null!==(t=i.spacing)&&void 0!==t&&t.blockGap&&!Ro(s,"spacing","blockGap")?function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"0";const n=er(e);if(!n)return null;const o=(null==n?void 0:n.top)||t,r=(null==n?void 0:n.left)||t;return o===r?o:`${o} ${r}`}(null==i||null===(n=i.spacing)||void 0===n?void 0:n.blockGap,d):`var( --wp--style--block-gap, ${d} )`,f=gr[l.justifyContent]||gr.left,g=br.includes(l.flexWrap)?l.flexWrap:"wrap",h=`\n\t\tflex-direction: row;\n\t\talign-items: ${vr[l.verticalAlignment]||vr.center};\n\t\tjustify-content: ${f};\n\t\t`,v=`\n\t\tflex-direction: column;\n\t\talign-items: ${hr[l.justifyContent]||hr.left};\n\t\t`;return(0,a.createElement)("style",null,`\n\t\t\t\t${bo(o)} {\n\t\t\t\t\tdisplay: flex;\n\t\t\t\t\tflex-wrap: ${g};\n\t\t\t\t\tgap: ${p?m:d};\n\t\t\t\t\t${"horizontal"===c?h:v}\n\t\t\t\t}\n\n\t\t\t\t${bo(o,"> *")} {\n\t\t\t\t\tmargin: 0;\n\t\t\t\t}\n\t\t\t`)},getOrientation(e){const{orientation:t="horizontal"}=e;return t},getAlignments:()=>[]};function _r(e){let{layout:t,onChange:n,isToolbar:o=!1}=e;const{verticalAlignment:r=vr.center}=t,l=e=>{n({...t,verticalAlignment:e})};if(o)return(0,a.createElement)(cr,{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)(p.Button,{key:e,label:n,icon:t,isPressed:r===e,onClick:()=>l(e)})))))}function yr(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)(mr,{allowedControls:s,value:r,onChange:i,popoverProps:{position:"bottom right",isAlternate:!0}});const c=[{value:"left",icon:po,label:(0,g.__)("Justify items left")},{value:"center",icon:mo,label:(0,g.__)("Justify items center")},{value:"right",icon:fo,label:(0,g.__)("Justify items right")}];return"horizontal"===l&&c.push({value:"space-between",icon:go,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)(p.Button,{key:t,label:o,icon:n,isPressed:r===t,onClick:()=>i(t)})}))))}function Er(e){let{layout:t,onChange:n}=e;const{flexWrap:o="wrap"}=t;return(0,a.createElement)(p.ToggleControl,{label:(0,g.__)("Allow to wrap to multiple lines"),onChange:e=>{n({...t,flexWrap:e?"wrap":"nowrap"})},checked:"wrap"===o})}function Cr(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)(p.Button,{label:"horizontal",icon:ho,isPressed:"horizontal"===o,onClick:()=>n({...t,orientation:"horizontal"})}),(0,a.createElement)(p.Button,{label:"vertical",icon:vo,isPressed:"vertical"===o,onClick:()=>n({...t,orientation:"vertical"})}))}var wr=function(e){let{icon:t,size:n=24,...o}=e;return(0,a.cloneElement)(t,{width:n,height:n,...o})},Sr={name:"default",label:(0,g.__)("Flow"),inspectorControls:function(e){let{layout:t,onChange:n}=e;const{wideSize:o,contentSize:r}=t,l=(0,p.__experimentalUseCustomUnits)({availableUnits:Io("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)(p.__experimentalUnitControl,{label:(0,g.__)("Content"),labelPosition:"top",__unstableInputWidth:"80px",value:r||o||"",onChange:e=>{e=0>parseFloat(e)?"0":e,n({...t,contentSize:e})},units:l}),(0,a.createElement)(wr,{icon:ao})),(0,a.createElement)("div",{className:"block-editor-hooks__layout-controls-unit"},(0,a.createElement)(p.__experimentalUnitControl,{label:(0,g.__)("Wide"),labelPosition:"top",__unstableInputWidth:"80px",value:o||r||"",onChange:e=>{e=0>parseFloat(e)?"0":e,n({...t,wideSize:e})},units:l}),(0,a.createElement)(wr,{icon:co}))),(0,a.createElement)("div",{className:"block-editor-hooks__layout-controls-reset"},(0,a.createElement)(p.Button,{variant:"secondary",isSmall:!0,disabled:!r&&!o,onClick:()=>n({contentSize:void 0,wideSize:void 0,inherit:!1})},(0,g.__)("Reset"))),(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.")))},toolBarControls:function(){return null},save:function(e){var t;let{selector:n,layout:o={},style:r,blockName:l}=e;const{contentSize:i,wideSize:s}=o,c=null!==Io("spacing.blockGap"),u=er(null==r||null===(t=r.spacing)||void 0===t?void 0:t.blockGap),d=null!=u&&u.top&&!Ro(l,"spacing","blockGap")?null==u?void 0:u.top:"var( --wp--style--block-gap )";let p=i||s?`\n\t\t\t\t\t${bo(n,"> :where(:not(.alignleft):not(.alignright))")} {\n\t\t\t\t\t\tmax-width: ${null!=i?i:s};\n\t\t\t\t\t\tmargin-left: auto !important;\n\t\t\t\t\t\tmargin-right: auto !important;\n\t\t\t\t\t}\n\t\t\t\t\t${bo(n,"> .alignwide")} {\n\t\t\t\t\t\tmax-width: ${null!=s?s:i};\n\t\t\t\t\t}\n\t\t\t\t\t${bo(n,"> .alignfull")} {\n\t\t\t\t\t\tmax-width: none;\n\t\t\t\t\t}\n\t\t\t\t`:"";return p+=`\n\t\t\t${bo(n,"> .alignleft")} {\n\t\t\t\tfloat: left;\n\t\t\t\tmargin-inline-start: 0;\n\t\t\t\tmargin-inline-end: 2em;\n\t\t\t}\n\t\t\t${bo(n,"> .alignright")} {\n\t\t\t\tfloat: right;\n\t\t\t\tmargin-inline-start: 2em;\n\t\t\t\tmargin-inline-end: 0;\n\t\t\t}\n\n\t\t\t${bo(n,"> .aligncenter")} {\n\t\t\t\tmargin-left: auto !important;\n\t\t\t\tmargin-right: auto !important;\n\t\t\t}\n\t\t`,c&&(p+=`\n\t\t\t\t${bo(n,"> *")} {\n\t\t\t\t\tmargin-block-start: 0;\n\t\t\t\t\tmargin-block-end: 0;\n\t\t\t\t}\n\t\t\t\t${bo(n,"> * + *")} {\n\t\t\t\t\tmargin-block-start: ${d};\n\t\t\t\t}\n\t\t\t`),(0,a.createElement)("style",null,p)},getOrientation:()=>"vertical",getAlignments(e){const t=function(e){const{contentSize:t,wideSize:n}=e,o={},r=/^(?!0)\d+(px|em|rem|vw|vh|%)?$/i;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));return o}(e);if(void 0!==e.alignments)return e.alignments.includes("none")||e.alignments.unshift("none"),e.alignments.map((e=>({name:e,info:t[e]})));const{contentSize:n,wideSize:o}=e,r=[{name:"left"},{name:"center"},{name:"right"}];return n&&r.unshift({name:"full"}),o&&r.unshift({name:"wide",info:t.wide}),r.unshift({name:"none",info:t.none}),r}};const Br=[Sr,kr];function Ir(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default";return Br.find((t=>t.name===e))}const xr={type:"default"},Tr=(0,a.createContext)(xr),Nr=Tr.Provider;function Pr(){return(0,a.useContext)(Tr)}function Mr(e){let{layout:t={},...n}=e;const o=Ir(t.type);return o?(0,a.createElement)(o.save,i({layout:t},n)):null}const Rr=["none","left","center","right","wide","full"],Lr=["wide","full"];function Ar(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Rr;e.includes("none")||(e=["none",...e]);const{wideControlsEnabled:t=!1,themeSupportsLayout:n}=(0,m.useSelect)((e=>{const{getSettings:t}=e(qn),n=t();return{wideControlsEnabled:n.alignWide,themeSupportsLayout:n.supportsLayout}}),[]),o=Pr(),r=Ir(null==o?void 0:o.type),l=r.getAlignments(o);if(n){const t=l.filter((t=>{let{name:n}=t;return e.includes(n)}));return 1===t.length&&"none"===t[0].name?[]:t}if("default"!==r.name)return[];const{alignments:i=Rr}=o,a=e.filter((e=>(o.alignments||t||!Lr.includes(e))&&i.includes(e))).map((e=>({name:e})));return 1===a.length&&"none"===a[0].name?[]:a}const Dr={none:{icon:lo,title:(0,g._x)("None","Alignment option")},left:{icon:io,title:(0,g.__)("Align left")},center:{icon:ao,title:(0,g.__)("Align center")},right:{icon:so,title:(0,g.__)("Align right")},wide:{icon:co,title:(0,g.__)("Wide width")},full:{icon:uo,title:(0,g.__)("Full width")}},Or={isAlternate:!0};var Fr=function(e){let{value:t,onChange:n,controls:o,isToolbar:r,isCollapsed:l=!0}=e;const s=Ar(o);if(!!!s.length)return null;function u(e){n([t,"none"].includes(e)?void 0:e)}const d=Dr[t],m=Dr.none,f=r?p.ToolbarGroup:p.ToolbarDropdownMenu,h={popoverProps:Or,icon:d?d.icon:m.icon,label:(0,g.__)("Align"),toggleProps:{describedBy:(0,g.__)("Change alignment")}},v=r||a.Platform.isNative?{isCollapsed:r?l:void 0,controls:s.map((e=>{let{name:n}=e;return{...Dr[n],isActive:t===n||!t&&"none"===n,role:l?"menuitemradio":void 0,onClick:()=>u(n)}}))}:{children:e=>{let{onClose:n}=e;return(0,a.createElement)(a.Fragment,null,(0,a.createElement)(p.MenuGroup,{className:"block-editor-block-alignment-control__menu-group"},s.map((e=>{let{name:o,info:r}=e;const{icon:l,title:i}=Dr[o],s=o===t||!t&&"none"===o;return(0,a.createElement)(p.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 zr=e=>(0,a.createElement)(Fr,i({},e,{isToolbar:!1})),Vr=e=>(0,a.createElement)(Fr,i({},e,{isToolbar:!0})),Hr=["left","center","right","wide","full"],Gr=["wide","full"];function Ur(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)?Hr.filter((t=>e.includes(t))):!0===e?[...Hr]:[],!o||!0===e&&!n?(0,u.without)(t,...Gr):t}const Wr=(0,d.createHigherOrderComponent)((e=>t=>{const{name:n}=t,o=Ar(Ur((0,r.getBlockSupport)(n,"align"),(0,r.hasBlockSupport)(n,"alignWide",!0))).map((e=>{let{name:t}=e;return t}));return(0,a.createElement)(a.Fragment,null,!!o.length&&(0,a.createElement)(ro,{group:"block",__experimentalShareWithChildBlocks:!0},(0,a.createElement)(zr,{value:t.attributes.align,onChange:e=>{if(!e){var n,o;const l=(0,r.getBlockType)(t.name);(null==l||null===(n=l.attributes)||void 0===n||null===(o=n.align)||void 0===o?void 0:o.default)&&(e="")}t.setAttributes({align:e})},controls:o})),(0,a.createElement)(e,t))}),"withToolbarControls"),$r=(0,d.createHigherOrderComponent)((e=>t=>{const{name:n,attributes:o}=t,{align:l}=o,s=Ar(Ur((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){return(0,u.has)(e.attributes,["align","type"])||(0,r.hasBlockSupport)(e,"align")&&(e.attributes={...e.attributes,align:{type:"string",enum:[...Hr,""]}}),e})),(0,l.addFilter)("editor.BlockListBlock","core/editor/align/with-data-align",$r),(0,l.addFilter)("editor.BlockEdit","core/editor/align/with-toolbar-controls",Wr),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/align/addAssignedAlign",(function(e,t,n){const{align:o}=n;return Ur((0,r.getBlockSupport)(t,"align"),(0,r.hasBlockSupport)(t,"alignWide",!0)).includes(o)&&(e.className=c()(`align${o}`,e.className)),e})),(0,l.addFilter)("blocks.registerBlockType","core/lock/addAttribute",(function(e){return(0,u.has)(e.attributes,["lock","type"])||(e.attributes={...e.attributes,lock:{type:"object"}}),e}));const jr=/[\s#]/g,Kr={type:"string",source:"attribute",attribute:"id",selector:"*"};const qr=(0,d.createHigherOrderComponent)((e=>t=>{if((0,r.hasBlockSupport)(t.name,"anchor")&&t.isSelected){const n="web"===a.Platform.OS,o=(0,a.createElement)(p.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, you’ll be able to link directly to this section of your page."),n&&(0,a.createElement)(p.ExternalLink,{href:(0,g.__)("https://wordpress.org/support/article/page-jumps/")},(0,g.__)("Learn more about anchors"))),value:t.attributes.anchor||"",placeholder:n?null:(0,g.__)("Add an anchor"),onChange:e=>{e=e.replace(jr,"-"),t.setAttributes({anchor:e})},autoCapitalize:"none",autoComplete:"off"});return(0,a.createElement)(a.Fragment,null,(0,a.createElement)(e,t),n&&(0,a.createElement)(zo,{__experimentalGroup:"advanced"},o),!n&&"core/heading"===t.name&&(0,a.createElement)(zo,null,(0,a.createElement)(p.PanelBody,{title:(0,g.__)("Heading settings")},o)))}return(0,a.createElement)(e,t)}),"withInspectorControl");(0,l.addFilter)("blocks.registerBlockType","core/anchor/attribute",(function(e){return(0,u.has)(e.attributes,["anchor","type"])||(0,r.hasBlockSupport)(e,"anchor")&&(e.attributes={...e.attributes,anchor:Kr}),e})),(0,l.addFilter)("editor.BlockEdit","core/editor/anchor/with-inspector-control",qr),(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 Yr=(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)(zo,{__experimentalGroup:"advanced"},(0,a.createElement)(p.TextControl,{autoComplete:"off",label:(0,g.__)("Additional CSS class(es)"),value:t.attributes.className||"",onChange:e=>{t.setAttributes({className:""!==e?e:void 0})},help:(0,g.__)("Separate multiple classes with spaces.")}))):(0,a.createElement)(e,t)),"withInspectorControl");function Qr(e,t,n,o){const r=(0,u.get)(e,n);if(!r)return[];const l=[];if("string"==typeof r)l.push({selector:t.selector,key:o,value:r});else{const e=["top","right","bottom","left"].reduce(((e,n)=>{const l=(0,u.get)(r,[n]);return l&&e.push({selector:t.selector,key:`${o}${(0,u.upperFirst)(n)}`,value:l}),e}),[]);l.push(...e)}return l}(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",Yr),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/custom-class-name/save-props",(function(e,t,n){return(0,r.hasBlockSupport)(t,"customClassName",!0)&&n.className&&(e.className=c()(e.className,n.className)),e})),(0,l.addFilter)("blocks.switchToBlockType.transformedBlock","core/color/addTransforms",(function(e,t,n,o){if(!(0,r.hasBlockSupport)(e.name,"customClassName",!0))return e;if(1===o.length&&e.innerBlocks.length===t.length)return e;if(1===o.length&&t.length>1||o.length>1&&1===t.length)return e;if(t[n]){var l;const o=null===(l=t[n])||void 0===l?void 0:l.attributes.className;if(o)return{...e,attributes:{...e.attributes,className:o}}}return e})),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/generated-class-name/save-props",(function(e,t){return(0,r.hasBlockSupport)(t,"className",!0)&&("string"==typeof e.className?e.className=(0,u.uniq)([(0,r.getBlockDefaultClassName)(t.name),...e.className.split(" ")]).join(" ").trim():e.className=(0,r.getBlockDefaultClassName)(t.name)),e}));const Xr=[{name:"margin",generate:(e,t)=>Qr(e,t,["spacing","margin"],"margin")},{name:"padding",generate:(e,t)=>Qr(e,t,["spacing","padding"],"padding")}];function Zr(e,t){const n=[];return Xr.forEach((o=>{n.push(...o.generate(e,t))})),n}var Jr=window.wp.dom;const el=(0,a.createContext)({});function tl(e){let{value:t,children:n}=e;const o=(0,a.useContext)(el),r=(0,a.useMemo)((()=>({...o,...t})),[o,t]);return(0,a.createElement)(el.Provider,{value:r,children:n})}var nl=el;const ol={};var rl=(0,p.withFilters)("editor.BlockEdit")((e=>{const{attributes:t={},name:n}=e,o=(0,r.getBlockType)(n),l=(0,a.useContext)(nl),s=(0,a.useMemo)((()=>o&&o.usesContext?(0,u.pick)(l,o.usesContext):ol),[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);return(0,a.createElement)(d,i({},e,{context:s,className:m}))}));function ll(e){const{name:t,isSelected:n,clientId:o}=e,r={name:t,isSelected:n,clientId:o};return(0,a.createElement)(Xn,{value:(0,a.useMemo)((()=>r),Object.values(r))},(0,a.createElement)(rl,e))}var il=(0,a.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(O.Path,{d:"M11 13h2v-2h-2v2zm-6 0h2v-2H5v2zm12-2v2h2v-2h-2z"}));var al=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)(p.DropdownMenu,{className:"block-editor-warning__secondary",icon:il,label:(0,g.__)("More options"),popoverProps:{position:"bottom left",className:"block-editor-warning__dropdown"},noIcons:!0},(()=>(0,a.createElement)(p.MenuGroup,null,r.map(((e,t)=>(0,a.createElement)(p.MenuItem,{onClick:e.onClick,key:t},e.title))))))))))},sl=n(1973);function cl(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,Jr.safeHTML)(o)))),(0,a.createElement)("div",{className:"block-editor-block-compare__action"},(0,a.createElement)(p.Button,{variant:"secondary",tabIndex:"0",onClick:r},l)))}var ul=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,sl.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)(cl,{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)(cl,{title:(0,g.__)("After Conversion"),className:"block-editor-block-compare__converted",action:o,actionText:i,rawContent:p,renderedContent:s}))};const dl=e=>(0,r.rawHandler)({HTML:e.originalContent});var pl=(0,d.compose)([(0,m.withSelect)(((e,t)=>{let{clientId:n}=t;return{block:e(qn).getBlock(n)}})),(0,m.withDispatch)(((e,t)=>{let{block:n}=t;const{replaceBlock:o}=e(qn);return{convertToClassic(){o(n.clientId,(e=>(0,r.createBlock)("core/freeform",{content:e.originalContent}))(n))},convertToHTML(){o(n.clientId,(e=>(0,r.createBlock)("core/html",{content:e.originalContent}))(n))},convertToBlocks(){o(n.clientId,dl(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)),[]),m=(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)(al,{actions:[(0,a.createElement)(p.Button,{key:"recover",onClick:l,variant:"primary"},(0,g.__)("Attempt Block Recovery"))],secondaryActions:f},(0,g.__)("This block contains unexpected or invalid content.")),c&&(0,a.createElement)(p.Modal,{title:(0,g.__)("Resolve Block"),onRequestClose:m,className:"block-editor-block-compare"},(0,a.createElement)(ul,{block:i,onKeep:t,onConvert:n,convertor:dl,convertButtonText:(0,g.__)("Convert to Blocks")})))}));const ml=(0,a.createElement)(al,{className:"block-editor-block-list__block-crash-warning"},(0,g.__)("This block has encountered an error and cannot be previewed."));var fl=()=>ml;class gl 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 hl=gl,vl=n(773);var bl=function(e){let{clientId:t}=e;const[n,o]=(0,a.useState)(""),l=(0,m.useSelect)((e=>e(qn).getBlock(t)),[t]),{updateBlock:i}=(0,m.useDispatch)(qn);return(0,a.useEffect)((()=>{o((0,r.getBlockContent)(l))}),[l]),(0,a.createElement)(vl.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 kl=Al();const _l=e=>Pl(e,kl);let yl=Al();_l.write=e=>Pl(e,yl);let El=Al();_l.onStart=e=>Pl(e,El);let Cl=Al();_l.onFrame=e=>Pl(e,Cl);let wl=Al();_l.onFinish=e=>Pl(e,wl);let Sl=[];_l.setTimeout=(e,t)=>{let n=_l.now()+t,o=()=>{let e=Sl.findIndex((e=>e.cancel==o));~e&&Sl.splice(e,1),Tl-=~e?1:0},r={time:n,handler:e,cancel:o};return Sl.splice(Bl(n),0,r),Tl+=1,Ml(),r};let Bl=e=>~(~Sl.findIndex((t=>t.time>e))||~Sl.length);_l.cancel=e=>{El.delete(e),Cl.delete(e),wl.delete(e),kl.delete(e),yl.delete(e)},_l.sync=e=>{Nl=!0,_l.batchedUpdates(e),Nl=!1},_l.throttle=e=>{let t;function n(){try{e(...t)}finally{t=null}}function o(...e){t=e,_l.onStart(n)}return o.handler=e,o.cancel=()=>{El.delete(n),t=null},o};let Il="undefined"!=typeof window?window.requestAnimationFrame:()=>{};_l.use=e=>Il=e,_l.now="undefined"!=typeof performance?()=>performance.now():Date.now,_l.batchedUpdates=e=>e(),_l.catch=console.error,_l.frameLoop="always",_l.advance=()=>{"demand"!==_l.frameLoop?console.warn("Cannot call the manual advancement of rafz whilst frameLoop is not set as demand"):Ll()};let xl=-1,Tl=0,Nl=!1;function Pl(e,t){Nl?(t.delete(e),e(0)):(t.add(e),Ml())}function Ml(){xl<0&&(xl=0,"demand"!==_l.frameLoop&&Il(Rl))}function Rl(){~xl&&(Il(Rl),_l.batchedUpdates(Ll))}function Ll(){let e=xl;xl=_l.now();let t=Bl(xl);t&&(Dl(Sl.splice(0,t),(e=>e.handler())),Tl-=t),Tl?(El.flush(),kl.flush(e?Math.min(64,xl-e):16.667),Cl.flush(),yl.flush(),wl.flush()):xl=-1}function Al(){let e=new Set,t=e;return{add(n){Tl+=t!=e||e.has(n)?0:1,e.add(n)},delete:n=>(Tl-=t==e&&e.has(n)?1:0,e.delete(n)),flush(n){t.size&&(e=new Set,Tl-=t.size,Dl(t,(t=>t(n)&&e.add(t))),Tl+=e.size,t=e)}}}function Dl(e,t){e.forEach((e=>{try{t(e)}catch(e){_l.catch(e)}}))}var Ol=n(9196),Fl=n.n(Ol);function zl(){}const Vl={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 Hl(e,t){if(Vl.arr(e)){if(!Vl.arr(t)||e.length!==t.length)return!1;for(let n=0;ne.forEach(t);function Ul(e,t,n){if(Vl.arr(e))for(let o=0;oVl.und(e)?[]:Vl.arr(e)?e:[e];function $l(e,t){if(e.size){const n=Array.from(e);e.clear(),Gl(n,t)}}const jl=(e,...t)=>$l(e,(e=>e(...t))),Kl=()=>"undefined"==typeof window||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent);let ql,Yl,Ql=null,Xl=!1,Zl=zl;const Jl=e=>{e.to&&(Yl=e.to),e.now&&(_l.now=e.now),void 0!==e.colors&&(Ql=e.colors),null!=e.skipAnimation&&(Xl=e.skipAnimation),e.createStringInterpolator&&(ql=e.createStringInterpolator),e.requestAnimationFrame&&_l.use(e.requestAnimationFrame),e.batchedUpdates&&(_l.batchedUpdates=e.batchedUpdates),e.willAdvance&&(Zl=e.willAdvance),e.frameLoop&&(_l.frameLoop=e.frameLoop)};var ei=Object.freeze({__proto__:null,get createStringInterpolator(){return ql},get to(){return Yl},get colors(){return Ql},get skipAnimation(){return Xl},get willAdvance(){return Zl},assign:Jl});const ti=new Set;let ni=[],oi=[],ri=0;const li={get idle(){return!ti.size&&!ni.length},start(e){ri>e.priority?(ti.add(e),_l.onStart(ii)):(ai(e),_l(ci))},advance:ci,sort(e){if(ri)_l.onFrame((()=>li.sort(e)));else{const t=ni.indexOf(e);~t&&(ni.splice(t,1),si(e))}},clear(){ni=[],ti.clear()}};function ii(){ti.forEach(ai),ti.clear(),_l(ci)}function ai(e){ni.includes(e)||si(e)}function si(e){ni.splice(function(e,t){const n=e.findIndex(t);return n<0?e.length:n}(ni,(t=>t.priority>e.priority)),0,e)}function ci(e){const t=oi;for(let n=0;n0}const ui="[-+]?\\d*\\.?\\d+",di=ui+"%";function pi(...e){return"\\(\\s*("+e.join(")\\s*,\\s*(")+")\\s*\\)"}const mi=new RegExp("rgb"+pi(ui,ui,ui)),fi=new RegExp("rgba"+pi(ui,ui,ui,ui)),gi=new RegExp("hsl"+pi(ui,di,di)),hi=new RegExp("hsla"+pi(ui,di,di,ui)),vi=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,bi=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,ki=/^#([0-9a-fA-F]{6})$/,_i=/^#([0-9a-fA-F]{8})$/;function yi(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 Ei(e,t,n){const o=n<.5?n*(1+t):n+t-n*t,r=2*n-o,l=yi(r,o,e+1/3),i=yi(r,o,e),a=yi(r,o,e-1/3);return Math.round(255*l)<<24|Math.round(255*i)<<16|Math.round(255*a)<<8}function Ci(e){const t=parseInt(e,10);return t<0?0:t>255?255:t}function wi(e){return(parseFloat(e)%360+360)%360/360}function Si(e){const t=parseFloat(e);return t<0?0:t>1?255:Math.round(255*t)}function Bi(e){const t=parseFloat(e);return t<0?0:t>100?1:t/100}function Ii(e){let t=function(e){let t;return"number"==typeof e?e>>>0===e&&e>=0&&e<=4294967295?e:null:(t=ki.exec(e))?parseInt(t[1]+"ff",16)>>>0:Ql&&void 0!==Ql[e]?Ql[e]:(t=mi.exec(e))?(Ci(t[1])<<24|Ci(t[2])<<16|Ci(t[3])<<8|255)>>>0:(t=fi.exec(e))?(Ci(t[1])<<24|Ci(t[2])<<16|Ci(t[3])<<8|Si(t[4]))>>>0:(t=vi.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+"ff",16)>>>0:(t=_i.exec(e))?parseInt(t[1],16)>>>0:(t=bi.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+t[4]+t[4],16)>>>0:(t=gi.exec(e))?(255|Ei(wi(t[1]),Bi(t[2]),Bi(t[3])))>>>0:(t=hi.exec(e))?(Ei(wi(t[1]),Bi(t[2]),Bi(t[3]))|Si(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 xi=(e,t,n)=>{if(Vl.fun(e))return e;if(Vl.arr(e))return xi({range:e,output:t,extrapolate:n});if(Vl.str(e.output[0]))return ql(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=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(cn){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 Ti(){return Ti=Object.assign||function(e){for(var t=1;tBoolean(e&&e[Ni]),Ri=e=>e&&e[Ni]?e[Ni]():e,Li=e=>e[Pi]||null;function Ai(e,t){let n=e[Pi];n&&n.forEach((e=>{!function(e,t){e.eventObserved?e.eventObserved(t):e(t)}(e,t)}))}class Di{constructor(e){if(this[Ni]=void 0,this[Pi]=void 0,!e&&!(e=this.get))throw Error("Unknown getter");Oi(this,e)}}const Oi=(e,t)=>Vi(e,Ni,t);function Fi(e,t){if(e[Ni]){let n=e[Pi];n||Vi(e,Pi,n=new Set),n.has(t)||(n.add(t),e.observerAdded&&e.observerAdded(n.size,t))}return t}function zi(e,t){let n=e[Pi];if(n&&n.has(t)){const o=n.size-1;o?n.delete(t):e[Pi]=null,e.observerRemoved&&e.observerRemoved(o,t)}}const Vi=(e,t,n)=>Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0}),Hi=/[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,Gi=/(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi,Ui=new RegExp(`(${Hi.source})(%|[a-z]+)`,"i"),Wi=/rgba\(([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+)\)/gi,$i=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/,ji=e=>{const[t,n]=Ki(e);if(!t||Kl())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&&$i.test(n)?ji(n):n||e},Ki=e=>{const t=$i.exec(e);if(!t)return[,];const[,n,o]=t;return[n,o]};let qi;const Yi=(e,t,n,o,r)=>`rgba(${Math.round(t)}, ${Math.round(n)}, ${Math.round(o)}, ${r})`,Qi=e=>{qi||(qi=Ql?new RegExp(`(${Object.keys(Ql).join("|")})(?!\\w)`,"g"):/^\b$/);const t=e.output.map((e=>Ri(e).replace($i,ji).replace(Gi,Ii).replace(qi,Ii))),n=t.map((e=>e.match(Hi).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=>xi(Ti({},e,{output:t}))));return e=>{var n;const o=!Ui.test(t[0])&&(null==(n=t.find((e=>Ui.test(e))))?void 0:n.replace(Hi,""));let l=0;return t[0].replace(Hi,(()=>`${r[l++](e)}${o||""}`)).replace(Wi,Yi)}},Xi="react-spring: ",Zi=e=>{const t=e;let n=!1;if("function"!=typeof t)throw new TypeError(`${Xi}once requires a function parameter`);return(...e)=>{n||(t(...e),n=!0)}},Ji=Zi(console.warn);const ea=Zi(console.warn);function ta(e){return Vl.str(e)&&("#"==e[0]||/\d/.test(e)||!Kl()&&$i.test(e)||e in(Ql||{}))}const na=Kl()?Ol.useEffect:Ol.useLayoutEffect;function oa(){const e=(0,Ol.useState)()[1],t=(()=>{const e=(0,Ol.useRef)(!1);return na((()=>(e.current=!0,()=>{e.current=!1})),[]),e})();return()=>{t.current&&e(Math.random())}}const ra=e=>(0,Ol.useEffect)(e,la),la=[];function ia(e){const t=(0,Ol.useRef)();return(0,Ol.useEffect)((()=>{t.current=e})),t.current}const aa=Symbol.for("Animated:node"),sa=e=>e&&e[aa],ca=(e,t)=>{return n=e,o=aa,r=t,Object.defineProperty(n,o,{value:r,writable:!0,configurable:!0});var n,o,r},ua=e=>e&&e[aa]&&e[aa].getPayload();class da{constructor(){this.payload=void 0,ca(this,this)}getPayload(){return this.payload||[]}}class pa extends da{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,Vl.num(this._value)&&(this.lastPosition=this._value)}static create(e){return new pa(e)}getPayload(){return[this]}getValue(){return this._value}setValue(e,t){return Vl.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,Vl.num(this._value)&&(this.elapsedTime=0,this.durationProgress=0,this.lastPosition=this._value,e&&(this.lastVelocity=null),this.v0=null)}}class ma extends pa{constructor(e){super(0),this._string=null,this._toString=void 0,this._toString=xi({output:[e,e]})}static create(e){return new ma(e)}getValue(){let e=this._string;return null==e?this._string=this._toString(this._value):e}setValue(e){if(Vl.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=xi({output:[this.getValue(),e]})),this._value=0,super.reset()}}const fa={dependencies:null};class ga extends da{constructor(e){super(),this.source=e,this.setValue(e)}getValue(e){const t={};return Ul(this.source,((n,o)=>{var r;(r=n)&&r[aa]===r?t[o]=n.getValue(e):Mi(n)?t[o]=Ri(n):e||(t[o]=n)})),t}setValue(e){this.source=e,this.payload=this._makePayload(e)}reset(){this.payload&&Gl(this.payload,(e=>e.reset()))}_makePayload(e){if(e){const t=new Set;return Ul(e,this._addToPayload,t),Array.from(t)}}_addToPayload(e){fa.dependencies&&Mi(e)&&fa.dependencies.add(e);const t=ua(e);t&&Gl(t,(e=>this.add(e)))}}class ha extends ga{constructor(e){super(e)}static create(e){return new ha(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(va)),!0)}}function va(e){return(ta(e)?ma:pa).create(e)}function ba(e){const t=sa(e);return t?t.constructor:Vl.arr(e)?ha:ta(e)?ma:pa}function ka(){return ka=Object.assign||function(e){for(var t=1;t{const n=!Vl.fun(e)||e.prototype&&e.prototype.isReactComponent;return(0,Ol.forwardRef)(((o,r)=>{const l=(0,Ol.useRef)(null),i=n&&(0,Ol.useCallback)((e=>{l.current=function(e,t){e&&(Vl.fun(e)?e(t):e.current=t);return t}(r,e)}),[r]),[a,s]=function(e,t){const n=new Set;fa.dependencies=n,e.style&&(e=ka({},e,{style:t.createAnimatedStyle(e.style)}));return e=new ga(e),fa.dependencies=null,[e,n]}(o,t),c=oa(),u=()=>{const e=l.current;if(n&&!e)return;!1===(!!e&&t.applyAnimatedValues(e,a.getValue(!0)))&&c()},d=new ya(u,s),p=(0,Ol.useRef)();na((()=>(p.current=d,Gl(s,(e=>Fi(e,d))),()=>{p.current&&(Gl(p.current.deps,(e=>zi(e,p.current))),_l.cancel(p.current.update))}))),(0,Ol.useEffect)(u,[]),ra((()=>()=>{const e=p.current;Gl(e.deps,(t=>zi(t,e)))}));const m=t.getComponentProps(a.getValue());return Ol.createElement(e,ka({},m,{ref:i}))}))};class ya{constructor(e,t){this.update=e,this.deps=t}eventObserved(e){"change"==e.type&&_l.write(this.update)}}const Ea=Symbol.for("AnimatedComponent"),Ca=e=>Vl.str(e)?e:e&&Vl.str(e.displayName)?e.displayName:Vl.fun(e)&&e.name||null;function wa(){return wa=Object.assign||function(e){for(var t=1;t!0===e||!!(t&&e&&(Vl.fun(e)?e(t):Wl(e).includes(t))),Ia=(e,t)=>Vl.obj(e)?t&&e[t]:e,xa=(e,t)=>!0===e.default?e[t]:e.default?e.default[t]:void 0,Ta=e=>e,Na=(e,t=Ta)=>{let n=Pa;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);Vl.und(n)||(o[r]=n)}return o},Pa=["config","onProps","onStart","onChange","onPause","onResume","onRest"],Ma={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 Ra(e){const t=function(e){const t={};let n=0;if(Ul(e,((e,o)=>{Ma[o]||(t[o]=e,n++)})),n)return t}(e);if(t){const n={to:t};return Ul(e,((e,o)=>o in t||(n[o]=e))),n}return wa({},e)}function La(e){return e=Ri(e),Vl.arr(e)?e.map(La):ta(e)?ei.createStringInterpolator({range:[0,1],output:[e,e]})(1):e}function Aa(e){for(const t in e)return!0;return!1}function Da(e){return Vl.fun(e)||Vl.arr(e)&&Vl.obj(e[0])}function Oa(e,t){var n;null==(n=e.ref)||n.delete(e),null==t||t.delete(e)}function Fa(e,t){var n;t&&e.ref!==t&&(null==(n=e.ref)||n.delete(e),t.add(e),e.ref=t)}const za=1.70158,Va=1.525*za,Ha=za+1,Ga=2*Math.PI/3,Ua=2*Math.PI/4.5,Wa=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},$a={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=>Ha*e*e*e-za*e*e,easeOutBack:e=>1+Ha*Math.pow(e-1,3)+za*Math.pow(e-1,2),easeInOutBack:e=>e<.5?Math.pow(2*e,2)*(7.189819*e-Va)/2:(Math.pow(2*e-2,2)*((Va+1)*(2*e-2)+Va)+2)/2,easeInElastic:e=>0===e?0:1===e?1:-Math.pow(2,10*e-10)*Math.sin((10*e-10.75)*Ga),easeOutElastic:e=>0===e?0:1===e?1:Math.pow(2,-10*e)*Math.sin((10*e-.75)*Ga)+1,easeInOutElastic:e=>0===e?0:1===e?1:e<.5?-Math.pow(2,20*e-10)*Math.sin((20*e-11.125)*Ua)/2:Math.pow(2,-20*e+10)*Math.sin((20*e-11.125)*Ua)/2+1,easeInBounce:e=>1-Wa(1-e),easeOutBounce:Wa,easeInOutBounce:e=>e<.5?(1-Wa(1-2*e))/2:(1+Wa(2*e-1))/2},ja=wa({},{tension:170,friction:26},{mass:1,damping:1,easing:$a.linear,clamp:!1});class Ka{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,ja)}}function qa(e,t){if(Vl.und(t.decay)){const n=!Vl.und(t.tension)||!Vl.und(t.friction);!n&&Vl.und(t.frequency)&&Vl.und(t.damping)&&Vl.und(t.mass)||(e.duration=void 0,e.decay=void 0),n&&(e.frequency=void 0)}else e.duration=void 0}const Ya=[];class Qa{constructor(){this.changed=!1,this.values=Ya,this.toValues=null,this.fromValues=Ya,this.to=void 0,this.from=void 0,this.config=new Ka,this.immediate=!1}}function Xa(e,{key:t,props:n,defaultProps:o,state:r,actions:l}){return new Promise(((i,a)=>{var s;let c,u,d=Ba(null!=(s=n.cancel)?s:null==o?void 0:o.cancel,t);if(d)f();else{Vl.und(n.pause)||(r.paused=Ba(n.pause,t));let e=null==o?void 0:o.pause;!0!==e&&(e=r.paused||Ba(e,t)),c=Sa(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-_l.now()}function m(){c>0&&!ei.skipAnimation?(r.delayed=!0,u=_l.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(wa({},n,{callId:e,cancel:d}),i)}catch(e){a(e)}}}))}const Za=(e,t)=>1==t.length?t[0]:t.some((e=>e.cancelled))?ts(e.get()):t.every((e=>e.noop))?Ja(e.get()):es(e.get(),t.every((e=>e.finished))),Ja=e=>({value:e,noop:!0,finished:!0,cancelled:!1}),es=(e,t,n=!1)=>({value:e,finished:t,cancelled:n}),ts=e=>({value:e,cancelled:!0,finished:!1});function ns(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=Na(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)&&ts(o)||r!==n.asyncId&&es(o,!1);if(t)throw e.result=t,d(e),e},f=(e,t)=>{const l=new rs,i=new ls;return(async()=>{if(ei.skipAnimation)throw os(n),i.result=es(o,!1),d(i),i;m(l);const a=Vl.obj(e)?wa({},e):wa({},t,{to:e});a.parentId=r,Ul(c,((e,t)=>{Vl.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(ei.skipAnimation)return os(n),es(o,!1);try{let t;t=Vl.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=es(o.get(),!0,!1)}catch(e){if(e instanceof rs)g=e.result;else{if(!(e instanceof ls))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 Vl.fun(i)&&_l.batchedUpdates((()=>{i(g,o,o.item)})),g})():s}function os(e,t){$l(e.timeouts,(e=>e.cancel())),e.pauseQueue.clear(),e.resumeQueue.clear(),e.asyncId=e.asyncTo=e.promise=void 0,t&&(e.cancelId=t)}class rs 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 ls extends Error{constructor(){super("SkipAnimationSignal"),this.result=void 0}}const is=e=>e instanceof ss;let as=1;class ss extends Di{constructor(...e){super(...e),this.id=as++,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=sa(this);return e&&e.getValue()}to(...e){return ei.to(this,e)}interpolate(...e){return Ji(`${Xi}The "interpolate" function is deprecated in v9 (use "to" instead)`),ei.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){Ai(this,{type:"change",parent:this,value:e,idle:t})}_onPriorityChange(e){this.idle||li.sort(this),Ai(this,{type:"priority",parent:this,priority:e})}}const cs=Symbol.for("SpringPhase"),us=e=>(1&e[cs])>0,ds=e=>(2&e[cs])>0,ps=e=>(4&e[cs])>0,ms=(e,t)=>t?e[cs]|=3:e[cs]&=-3,fs=(e,t)=>t?e[cs]|=4:e[cs]&=-5;class gs extends ss{constructor(e,t){if(super(),this.key=void 0,this.animation=new Qa,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,!Vl.und(e)||!Vl.und(t)){const n=Vl.obj(e)?wa({},e):wa({},t,{from:e});Vl.und(n.default)&&(n.default=!0),this.start(n)}}get idle(){return!(ds(this)||this._state.asyncTo)||ps(this)}get goal(){return Ri(this.animation.to)}get velocity(){const e=sa(this);return e instanceof pa?e.lastVelocity||0:e.getPayload().map((e=>e.lastVelocity||0))}get hasAnimated(){return us(this)}get isAnimating(){return ds(this)}get isPaused(){return ps(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=ua(o.to);!i&&Mi(o.to)&&(l=Wl(Ri(o.to))),o.values.forEach(((a,s)=>{if(a.done)return;const c=a.constructor==ma?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=Vl.arr(r.velocity)?r.velocity[s]:r.velocity;let i;if(Vl.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)<.1,i=l*o}else{i=null==a.lastVelocity?l:a.lastVelocity;const t=r.precision||(n==c?.005:Math.min(1,.001*Math.abs(c-n))),o=r.restVelocity||t/10,s=r.clamp?0:r.bounce,p=!Vl.und(s),m=n==c?a.v0>0:no,f||(u=Math.abs(c-d)<=t,!u));++e){p&&(g=d==c||d>c==m,g&&(i=-i*s,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=sa(this),s=a.getValue();if(t){const e=Ri(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 _l.batchedUpdates((()=>{this._stop(),this._focus(e),this._set(e)})),this}pause(){this._update({pause:!0})}resume(){this._update({pause:!1})}finish(){if(ds(this)){const{to:e,config:t}=this.animation;_l.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 Vl.und(e)?(n=this.queue||[],this.queue=[]):n=[Vl.obj(e)?e:wa({},t,{to:e})],Promise.all(n.map((e=>this._update(e)))).then((e=>Za(this,e)))}stop(e){const{to:t}=this.animation;return this._focus(this.get()),os(this._state,e&&this._lastCallId),_l.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=Vl.obj(n)?n[t]:n,(null==n||Da(n))&&(n=void 0),o=Vl.obj(o)?o[t]:o,null==o&&(o=void 0);const r={to:n,from:o};return us(this)||(e.reverse&&([n,o]=[o,n]),o=Ri(o),Vl.und(o)?sa(this)||this._set(n):this._set(o)),r}_update(e,t){let n=wa({},e);const{key:o,defaultProps:r}=this;n.default&&Object.assign(r,Na(n,((e,t)=>/^on/.test(t)?Ia(e,o):e))),Es(this,n,"onProps"),Cs(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 Xa(++this._lastCallId,{key:o,props:n,defaultProps:r,state:i,actions:{pause:()=>{ps(this)||(fs(this,!0),jl(i.pauseQueue),Cs(this,"onPause",es(this,hs(this,this.animation.to)),this))},resume:()=>{ps(this)&&(fs(this,!1),ds(this)&&this._resume(),jl(i.resumeQueue),Cs(this,"onResume",es(this,hs(this,this.animation.to)),this))},start:this._merge.bind(this,l)}}).then((e=>{if(n.loop&&e.finished&&(!t||!e.noop)){const e=vs(n);if(e)return this._update(e,!0)}return e}))}_merge(e,t,n){if(t.cancel)return this.stop(!0),n(ts(this));const o=!Vl.und(e.to),r=!Vl.und(e.from);if(o||r){if(!(t.callId>this._lastToId))return n(ts(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&&!Vl.und(u)||(u=d),t.reverse&&([u,d]=[d,u]);const p=!Hl(d,c);p&&(a.from=d),d=Ri(d);const m=!Hl(u,s);m&&this._focus(u);const f=Da(t.to),{config:g}=a,{decay:h,velocity:v}=g;(o||r)&&(g.velocity=0),t.config&&!f&&function(e,t,n){n&&(qa(n=wa({},n),t),t=wa({},n,t)),qa(e,t),Object.assign(e,t);for(const t in ja)null==e[t]&&(e[t]=ja[t]);let{mass:o,frequency:r,damping:l}=e;Vl.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,Sa(t.config,l),t.config!==i.config?Sa(i.config,l):void 0);let b=sa(this);if(!b||Vl.und(u))return n(es(this,!0));const k=Vl.und(t.reset)?r&&!t.default:!Vl.und(d)&&Ba(t.reset,l),_=k?d:this.get(),y=La(u),E=Vl.num(y)||Vl.arr(y)||ta(y),C=!f&&(!E||Ba(i.immediate||t.immediate,l));if(m){const e=ba(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=Mi(u),B=!1;if(!S){const e=k||!us(this)&&p;(m||e)&&(B=Hl(La(_),y),S=!B),(Hl(a.immediate,C)||C)&&Hl(g.decay,h)&&Hl(g.velocity,v)||(S=!0)}if(B&&ds(this)&&(a.changed&&!k?S=!0:S||this._stop(s)),!f&&((S||Mi(s))&&(a.values=b.getPayload(),a.toValues=Mi(u)?null:w==ma?[1]:Wl(y)),a.immediate!=C&&(a.immediate=C,C||k||this._set(s)),S)){const{onRest:e}=a;Gl(ys,(e=>Es(this,t,e)));const o=es(this,hs(this,s));jl(this._pendingCalls,o),this._pendingCalls.add(n),a.changed&&_l.batchedUpdates((()=>{a.changed=!k,null==e||e(o,this),k?Sa(i.onRest,o):null==a.onStart||a.onStart(o,this)}))}k&&this._set(_),f?n(ns(t.to,t,this._state,this)):S?this._start():ds(this)&&!m?this._pendingCalls.add(n):n(Ja(_))}_focus(e){const t=this.animation;e!==t.to&&(Li(this)&&this._detach(),t.to=e,Li(this)&&this._attach())}_attach(){let e=0;const{to:t}=this.animation;Mi(t)&&(Fi(t,this),is(t)&&(e=t.priority+1)),this.priority=e}_detach(){const{to:e}=this.animation;Mi(e)&&zi(e,this)}_set(e,t=!0){const n=Ri(e);if(!Vl.und(n)){const e=sa(this);if(!e||!Hl(n,e.getValue())){const o=ba(n);e&&e.constructor==o?e.setValue(n):ca(this,o.create(n)),e&&_l.batchedUpdates((()=>{this._onChange(n,t)}))}}return sa(this)}_onStart(){const e=this.animation;e.changed||(e.changed=!0,Cs(this,"onStart",es(this,hs(this,e.to)),this))}_onChange(e,t){t||(this._onStart(),Sa(this.animation.onChange,e,this)),Sa(this.defaultProps.onChange,e,this),super._onChange(e,t)}_start(){const e=this.animation;sa(this).reset(Ri(e.to)),e.immediate||(e.fromValues=e.values.map((e=>e.lastPosition))),ds(this)||(ms(this,!0),ps(this)||this._resume())}_resume(){ei.skipAnimation?this.finish():li.start(this)}_stop(e,t){if(ds(this)){ms(this,!1);const n=this.animation;Gl(n.values,(e=>{e.done=!0})),n.toValues&&(n.onChange=n.onPause=n.onResume=void 0),Ai(this,{type:"idle",parent:this});const o=t?ts(this.get()):es(this.get(),hs(this,null!=e?e:n.to));jl(this._pendingCalls,o),n.changed&&(n.changed=!1,Cs(this,"onRest",o,this))}}}function hs(e,t){const n=La(t);return Hl(La(e.get()),n)}function vs(e,t=e.loop,n=e.to){let o=Sa(t);if(o){const r=!0!==o&&Ra(o),l=(r||e).reverse,i=!r||r.reset;return bs(wa({},e,{loop:t,default:!1,pause:void 0,to:!l||Da(n)?n:void 0,from:i?e.from:void 0,reset:i},r))}}function bs(e){const{to:t,from:n}=e=Ra(e),o=new Set;return Vl.obj(t)&&_s(t,o),Vl.obj(n)&&_s(n,o),e.keys=o.size?Array.from(o):null,e}function ks(e){const t=bs(e);return Vl.und(t.default)&&(t.default=Na(t)),t}function _s(e,t){Ul(e,((e,n)=>null!=e&&t.add(n)))}const ys=["onStart","onRest","onChange","onPause","onResume"];function Es(e,t,n){e.animation[n]=t[n]!==xa(t,n)?Ia(t[n],e.key):void 0}function Cs(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 ws=["onStart","onChange","onRest"];let Ss=1;class Bs{constructor(e,t){this.id=Ss++,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(wa({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];Vl.und(n)||this.springs[t].set(n)}}update(e){return e&&this.queue.push(bs(e)),this}start(e){let{queue:t}=this;return e?t=Wl(e).map(bs):this.queue=[],this._flush?this._flush(this,t):(Rs(this,t),Is(this,t))}stop(e,t){if(e!==!!e&&(t=e),t){const n=this.springs;Gl(Wl(t),(t=>n[t].stop(!!e)))}else os(this._state,this._lastAsyncId),this.each((t=>t.stop(!!e)));return this}pause(e){if(Vl.und(e))this.start({pause:!0});else{const t=this.springs;Gl(Wl(e),(e=>t[e].pause()))}return this}resume(e){if(Vl.und(e))this.start({pause:!1});else{const t=this.springs;Gl(Wl(e),(e=>t[e].resume()))}return this}each(e){Ul(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,$l(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&&$l(t,(([e,t])=>{t.value=i,e(t,this,this._item)})),l&&(this._started=!1,$l(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)}_l.onFrame(this._onFrame)}}function Is(e,t){return Promise.all(t.map((t=>xs(e,t)))).then((t=>Za(e,t)))}async function xs(e,t,n){const{keys:o,to:r,from:l,loop:i,onRest:a,onResolve:s}=t,c=Vl.obj(t.default)&&t.default;i&&(t.loop=!1),!1===r&&(t.to=null),!1===l&&(t.from=null);const u=Vl.arr(r)||Vl.fun(r)?r:void 0;u?(t.to=void 0,t.onRest=void 0,c&&(c.onRest=void 0)):Gl(ws,(n=>{const o=t[n];if(Vl.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,jl(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===xa(t,"cancel");(u||m&&d.asyncId)&&p.push(Xa(++e._lastAsyncId,{props:t,state:d,actions:{pause:zl,resume:zl,start(t,n){m?(os(d,e._lastAsyncId),n(ts(e))):(t.onRest=a,n(ns(u,t,d,e)))}}})),d.paused&&await new Promise((e=>{d.resumeQueue.add(e)}));const f=Za(e,await Promise.all(p));if(i&&f.finished&&(!n||!f.noop)){const n=vs(t,i,r);if(n)return Rs(e,[n]),xs(e,n,!0)}return s&&_l.batchedUpdates((()=>s(f,e,e.item))),f}function Ts(e,t){const n=wa({},e.springs);return t&&Gl(Wl(t),(e=>{Vl.und(e.keys)&&(e=bs(e)),Vl.obj(e.to)||(e=wa({},e,{to:void 0})),Ms(n,e,(e=>Ps(e)))})),Ns(e,n),n}function Ns(e,t){Ul(t,((t,n)=>{e.springs[n]||(e.springs[n]=t,Fi(t,e))}))}function Ps(e,t){const n=new gs;return n.key=e,t&&Fi(n,t),n}function Ms(e,t,n){t.keys&&Gl(t.keys,(o=>{(e[o]||(e[o]=n(o)))._prepareNode(t)}))}function Rs(e,t){Gl(t,(t=>{Ms(e.springs,t,(t=>Ps(t,e)))}))}function Ls(e,t){if(null==e)return{};var n,o,r={},l=Object.keys(e);for(o=0;o=0||(r[n]=e[n]);return r}const As=["children"],Ds=e=>{let{children:t}=e,n=Ls(e,As);const o=(0,Ol.useContext)(Os),r=n.pause||!!o.pause,l=n.immediate||!!o.immediate;n=function(e,t){const[n]=(0,Ol.useState)((()=>({inputs:t,result:e()}))),o=(0,Ol.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{o.current=l,r==n&&(n.inputs=n.result=void 0)}),[l]),l.result}((()=>({pause:r,immediate:l})),[r,l]);const{Provider:i}=Os;return Ol.createElement(i,{value:n},t)},Os=(Fs=Ds,zs={},Object.assign(Fs,Ol.createContext(zs)),Fs.Provider._context=Fs,Fs.Consumer._context=Fs,Fs);var Fs,zs;Ds.Provider=Os.Provider,Ds.Consumer=Os.Consumer;const Vs=()=>{const e=[],t=function(t){ea(`${Xi}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 Gl(e,((e,r)=>{if(Vl.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 Gl(e,(e=>e.pause(...arguments))),this},t.resume=function(){return Gl(e,(e=>e.resume(...arguments))),this},t.set=function(t){Gl(e,(e=>e.set(t)))},t.start=function(t){const n=[];return Gl(e,((e,o)=>{if(Vl.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 Gl(e,(e=>e.stop(...arguments))),this},t.update=function(t){return Gl(e,((e,n)=>e.update(this._getProps(t,e,n)))),this};const n=function(e,t,n){return Vl.fun(e)?e(n,t):e};return t._getProps=n,t};function Hs(e,t,n){const o=Vl.fun(t)&&t;o&&!n&&(n=[]);const r=(0,Ol.useMemo)((()=>o||3==arguments.length?Vs():void 0),[]),l=(0,Ol.useRef)(0),i=oa(),a=(0,Ol.useMemo)((()=>({ctrls:[],queue:[],flush(e,t){const n=Ts(e,t);return l.current>0&&!a.queue.length&&!Object.keys(n).some((t=>!e.springs[t]))?Is(e,t):new Promise((o=>{Ns(e,n),a.queue.push((()=>{o(Is(e,t))})),i()}))}})),[]),s=(0,Ol.useRef)([...a.ctrls]),c=[],u=ia(e)||0;function d(e,n){for(let r=e;r{Gl(s.current.slice(e,u),(e=>{Oa(e,r),e.stop(!0)})),s.current.length=e,d(u,e)}),[e]),(0,Ol.useMemo)((()=>{d(0,Math.min(u,e))}),n);const p=s.current.map(((e,t)=>Ts(e,c[t]))),m=(0,Ol.useContext)(Ds),f=ia(m),g=m!==f&&Aa(m);na((()=>{l.current++,a.ctrls=s.current;const{queue:e}=a;e.length&&(a.queue=[],Gl(e,(e=>e()))),Gl(s.current,((e,t)=>{null==r||r.add(e),g&&e.start({default:m});const n=c[t];n&&(Fa(e,n.ref),e.ref?e.queue.push(n):e.start(n))}))})),ra((()=>()=>{Gl(a.ctrls,(e=>e.stop(!0)))}));const h=p.map((e=>wa({},e)));return r?[h,r]:h}function Gs(e,t){const n=Vl.fun(e),[[o],r]=Hs(1,n?e:[e],n?t||[]:t);return n||2==arguments.length?[o,r]:o}let Us;!function(e){e.MOUNT="mount",e.ENTER="enter",e.UPDATE="update",e.LEAVE="leave"}(Us||(Us={}));class Ws extends ss{constructor(e,t){super(),this.key=void 0,this.idle=!0,this.calc=void 0,this._active=new Set,this.source=e,this.calc=xi(...t);const n=this._get(),o=ba(n);ca(this,o.create(n))}advance(e){const t=this._get();Hl(t,this.get())||(sa(this).setValue(t),this._onChange(t,this.idle)),!this.idle&&js(this._active)&&Ks(this)}_get(){const e=Vl.arr(this.source)?this.source.map(Ri):Wl(Ri(this.source));return this.calc(...e)}_start(){this.idle&&!js(this._active)&&(this.idle=!1,Gl(ua(this),(e=>{e.done=!1})),ei.skipAnimation?(_l.batchedUpdates((()=>this.advance())),Ks(this)):li.start(this))}_attach(){let e=1;Gl(Wl(this.source),(t=>{Mi(t)&&Fi(t,this),is(t)&&(t.idle||this._active.add(t),e=Math.max(e,t.priority+1))})),this.priority=e,this._start()}_detach(){Gl(Wl(this.source),(e=>{Mi(e)&&zi(e,this)})),this._active.clear(),Ks(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=Wl(this.source).reduce(((e,t)=>Math.max(e,(is(t)?t.priority:0)+1)),0))}}function $s(e){return!1!==e.idle}function js(e){return!e.size||Array.from(e).every($s)}function Ks(e){e.idle||(e.idle=!0,Gl(ua(e),(e=>{e.done=!0})),Ai(e,{type:"idle",parent:e}))}ei.assign({createStringInterpolator:Qi,to:(e,t)=>new Ws(e,t)});li.advance;var qs=window.ReactDOM;function Ys(e,t){if(null==e)return{};var n,o,r={},l=Object.keys(e);for(o=0;o=0||(r[n]=e[n]);return r}const Qs=["style","children","scrollTop","scrollLeft"],Xs=/^--/;function Zs(e,t){return null==t||"boolean"==typeof t||""===t?"":"number"!=typeof t||0===t||Xs.test(e)||ec.hasOwnProperty(e)&&ec[e]?(""+t).trim():t+"px"}const Js={};let ec={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 tc=["Webkit","Ms","Moz","O"];ec=Object.keys(ec).reduce(((e,t)=>(tc.forEach((n=>e[((e,t)=>e+t.charAt(0).toUpperCase()+t.substring(1))(n,t)]=e[t])),e)),ec);const nc=["x","y","z"],oc=/^(matrix|translate|scale|rotate|skew)/,rc=/^(translate)/,lc=/^(rotate|skew)/,ic=(e,t)=>Vl.num(e)&&0!==e?e+t:e,ac=(e,t)=>Vl.arr(e)?e.every((e=>ac(e,t))):Vl.num(e)?e===t:parseFloat(e)===t;class sc extends ga{constructor(e){let{x:t,y:n,z:o}=e,r=Ys(e,nc);const l=[],i=[];(t||n||o)&&(l.push([t||0,n||0,o||0]),i.push((e=>[`translate3d(${e.map((e=>ic(e,"px"))).join(",")})`,ac(e,0)]))),Ul(r,((e,t)=>{if("transform"===t)l.push([e||""]),i.push((e=>[e,""===e]));else if(oc.test(t)){if(delete r[t],Vl.und(e))return;const n=rc.test(t)?"px":lc.test(t)?"deg":"";l.push(Wl(e)),i.push("rotate3d"===t?([e,t,o,r])=>[`rotate3d(${e},${t},${o},${ic(r,n)})`,ac(r,0)]:e=>[`${t}(${e.map((e=>ic(e,n))).join(",")})`,ac(e,t.startsWith("scale")?1:0)])}})),l.length&&(r.transform=new cc(l,i)),super(r)}}class cc extends Di{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 Gl(this.inputs,((n,o)=>{const r=Ri(n[0]),[l,i]=this.transforms[o](Vl.arr(r)?r:n.map(Ri));e+=" "+l,t=t&&i})),t?"none":e}observerAdded(e){1==e&&Gl(this.inputs,(e=>Gl(e,(e=>Mi(e)&&Fi(e,this)))))}observerRemoved(e){0==e&&Gl(this.inputs,(e=>Gl(e,(e=>Mi(e)&&zi(e,this)))))}eventObserved(e){"change"==e.type&&(this._value=null),Ai(this,e)}}const uc=["scrollTop","scrollLeft"];ei.assign({batchedUpdates:qs.unstable_batchedUpdates,createStringInterpolator:Qi,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 dc=((e,{applyAnimatedValues:t=(()=>!1),createAnimatedStyle:n=(e=>new ga(e)),getComponentProps:o=(e=>e)}={})=>{const r={applyAnimatedValues:t,createAnimatedStyle:n,getComponentProps:o},l=e=>{const t=Ca(e)||"Anonymous";return(e=Vl.str(e)?l[e]||(l[e]=_a(e,r)):e[Ea]||(e[Ea]=_a(e,r))).displayName=`Animated(${t})`,e};return Ul(e,((t,n)=>{Vl.arr(e)&&(n=Ca(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=Ys(o,Qs),c=Object.values(s),u=Object.keys(s).map((t=>n||e.hasAttribute(t)?t:Js[t]||(Js[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=Zs(t,r[t]);Xs.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 sc(e),getComponentProps:e=>Ys(e,uc)}),pc=dc.animated,mc=e=>e+1,fc=e=>({top:e.offsetTop,left:e.offsetLeft});var gc=function(e){let{isSelected:t,adjustScrolling:n,enableAnimation:o,triggerAnimationOnChange:r}=e;const l=(0,a.useRef)(),i=(0,d.useReducedMotion)()||!o,[s,c]=(0,a.useReducer)(mc,0),[u,p]=(0,a.useReducer)(mc,0),[m,f]=(0,a.useState)({x:0,y:0}),g=(0,a.useMemo)((()=>l.current?fc(l.current):null),[r]),h=(0,a.useMemo)((()=>{if(!n||!l.current)return()=>{};const e=(0,Jr.getScrollContainer)(l.current);if(!e)return()=>{};const t=l.current.getBoundingClientRect();return()=>{const n=l.current.getBoundingClientRect().top-t.top;n&&(e.scrollTop+=n)}}),[r,n]);function v(e){let{value:n}=e,{x:o,y:r}=n;o=Math.round(o),r=Math.round(r),o===v.x&&r===v.y||(!function(e){let{x:n,y:o}=e;if(!l.current)return;const r=0===n&&0===o;l.current.style.transformOrigin=r?"":"center",l.current.style.transform=r?"":`translate3d(${n}px,${o}px,0)`,l.current.style.zIndex=!t||r?"":"1",h()}({x:o,y:r}),v.x=o,v.y=r)}return(0,a.useLayoutEffect)((()=>{s&&p()}),[s]),(0,a.useLayoutEffect)((()=>{if(!g)return;if(i)return void h();l.current.style.transform="";const e=fc(l.current);c(),f({x:Math.round(g.left-e.left),y:Math.round(g.top-e.top)})}),[r]),v.x=0,v.y=0,Gs({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:v}),l};const hc=".block-editor-block-list__block",vc=".block-list-appender",bc=".block-editor-button-block-appender";function kc(e,t){return t.closest([hc,vc,bc].join(","))===e}function _c(e){for(;e&&e.nodeType!==e.ELEMENT_NODE;)e=e.parentNode;if(!e)return;const t=e.closest(hc);return t?t.id.slice("block-".length):void 0}function yc(e){const t=(0,a.useRef)(),n=function(e){return(0,m.useSelect)((t=>{const{getSelectedBlocksInitialCaretPosition:n,isNavigationMode:o,isBlockSelected:r}=t(qn);if(r(e)&&!o())return n()}),[e])}(e),{isBlockSelected:o,isMultiSelecting:r}=(0,m.useSelect)(qn);return(0,a.useEffect)((()=>{if(!o(e)||r())return;if(null==n)return;if(!t.current)return;const{ownerDocument:l}=t.current;if(t.current.contains(l.activeElement))return;const i=Jr.focus.tabbable.find(t.current).filter((e=>(0,Jr.isTextField)(e))),a=-1===n,s=(a?u.last:u.first)(i)||t.current;if(kc(t.current,s)){if(!t.current.getAttribute("contenteditable")){const e=Jr.focus.tabbable.findNext(t.current);if(e&&kc(t.current,e)&&(0,Jr.isFormElement)(e))return void e.focus()}(0,Jr.placeCaretAtHorizontalEdge)(s,a)}else t.current.focus()}),[n,e]),t}function Ec(e){if(e.defaultPrevented)return;const t="mouseover"===e.type?"add":"remove";e.preventDefault(),e.currentTarget.classList[t]("is-hovered")}function Cc(){const e=(0,m.useSelect)((e=>{const{isNavigationMode:t,getSettings:n}=e(qn);return t()||n().outlineMode}),[]);return(0,d.useRefEffect)((t=>{if(e)return t.addEventListener("mouseout",Ec),t.addEventListener("mouseover",Ec),()=>{t.removeEventListener("mouseout",Ec),t.removeEventListener("mouseover",Ec),t.classList.remove("is-hovered")}}),[e])}function wc(e){return(0,m.useSelect)((t=>{const{isBlockBeingDragged:n,isBlockHighlighted:o,isBlockSelected:l,isBlockMultiSelected:i,getBlockName:a,getSettings:s,hasSelectedInnerBlock:u,isTyping:d,__experimentalGetActiveBlockIdByBlockNames:p}=t(qn),{__experimentalSpotlightEntityBlocks:m,outlineMode:f}=s(),g=n(e),h=l(e),v=a(e),b=u(e,!0),k=p(m);return c()({"is-selected":h,"is-highlighted":o(e),"is-multi-selected":i(e),"is-reusable":(0,r.isReusableBlock)((0,r.getBlockType)(v)),"is-dragging":g,"has-child-selected":b,"has-active-entity":k,"is-active-entity":k===e,"remove-outline":h&&f&&d()})}),[e])}function Sc(e){return(0,m.useSelect)((t=>{const n=t(qn).getBlockName(e),o=(0,r.getBlockType)(n);if((null==o?void 0:o.apiVersion)>1)return(0,r.getBlockDefaultClassName)(n)}),[e])}function Bc(e){return(0,m.useSelect)((t=>{const{getBlockName:n,getBlockAttributes:o}=t(qn),l=o(e);if(null==l||!l.className)return;const i=(0,r.getBlockType)(n(e));return(null==i?void 0:i.apiVersion)>1?l.className:void 0}),[e])}function Ic(e){return(0,m.useSelect)((t=>{const{hasBlockMovingClientId:n,canInsertBlockType:o,getBlockName:r,getBlockRootClientId:l,isBlockSelected:i}=t(qn);if(!i(e))return;const a=n();return a?c()("is-block-moving-mode",{"can-insert-moving-block":o(r(a),l(e))}):void 0}),[e])}function xc(e){const{isBlockSelected:t}=(0,m.useSelect)(qn),{selectBlock:n,selectionChange:o}=(0,m.useDispatch)(qn);return(0,d.useRefEffect)((r=>{function l(l){r.parentElement.closest('[contenteditable="true"]')||(t(e)?l.target.isContentEditable||o(e):kc(r,l.target)&&n(e))}return r.addEventListener("focusin",l),()=>{r.removeEventListener("focusin",l)}}),[t,n])}var Tc=window.wp.keycodes;function Nc(e){const t=(0,m.useSelect)((t=>t(qn).isBlockSelected(e)),[e]),{getBlockRootClientId:n,getBlockIndex:o}=(0,m.useSelect)(qn),{insertDefaultBlock:r,removeBlock:l}=(0,m.useDispatch)(qn);return(0,d.useRefEffect)((i=>{if(t)return i.addEventListener("keydown",a),i.addEventListener("dragstart",s),()=>{i.removeEventListener("keydown",a),i.removeEventListener("dragstart",s)};function a(t){const{keyCode:a,target:s}=t;a!==Tc.ENTER&&a!==Tc.BACKSPACE&&a!==Tc.DELETE||s!==i||(0,Jr.isTextField)(s)||(t.preventDefault(),a===Tc.ENTER?r({},n(e),o(e)+1):l(e))}function s(e){e.preventDefault()}}),[e,t,n,o,r,l])}function Pc(e){const{isNavigationMode:t,isBlockSelected:n}=(0,m.useSelect)(qn),{setNavigationMode:o,selectBlock:r}=(0,m.useDispatch)(qn);return(0,d.useRefEffect)((l=>{function i(l){t()&&!l.defaultPrevented&&(l.preventDefault(),n(e)?o(!1):r(e))}return l.addEventListener("mousedown",i),()=>{l.addEventListener("mousedown",i)}}),[e,t,n,o])}function Mc(){const e=(0,a.useContext)(Gf);return(0,d.useRefEffect)((t=>{if(e)return e.observe(t),()=>{e.unobserve(t)}}),[e])}function Rc(){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)(Lc),{index:s,mode:u,name:p,blockApiVersion:f,blockTitle:h,isPartOfSelection:v,adjustScrolling:b,enableAnimation:k}=(0,m.useSelect)((e=>{const{getBlockIndex:t,getBlockMode:o,getBlockName:l,isTyping:i,getGlobalBlockCount:a,isBlockSelected:s,isBlockMultiSelected:c,isAncestorMultiSelected:u,isFirstMultiSelectedBlock:d}=e(qn),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]),_=(0,g.sprintf)((0,g.__)("Block: %s"),h),y="html"!==u||t?"":"-visual",E=(0,d.useMergeRefs)([e.ref,yc(n),yo(n),xc(n),Nc(n),Pc(n),Cc(),Mc(),gc({isSelected:v,adjustScrolling:b,enableAnimation:k,triggerAnimationOnChange:s})]),C=Zn();return f<2&&n===C.clientId&&"undefined"!=typeof process&&process.env,{...l,...e,ref:E,id:`block-${n}${y}`,tabIndex:0,role:"document","aria-label":_,"data-block":n,"data-type":p,"data-title":h,className:c()(c()("block-editor-block-list__block",{"wp-block":!i}),o,e.className,l.className,wc(n),Sc(n),Bc(n),Ic(n)),style:{...l.style,...e.style}}}Rc.save=r.__unstableGetBlockProps;const Lc=(0,a.createContext)();function Ac(e){let{children:t,isHtml:n,...o}=e;return(0,a.createElement)("div",Rc(o,{__unstableIsHtml:n}),t)}const Dc=(0,m.withSelect)(((e,t)=>{let{clientId:n,rootClientId:o}=t;const{isBlockSelected:r,getBlockMode:l,isSelectionEnabled:i,getTemplateLock:a,__unstableGetBlockWithoutInnerBlocks:s,canRemoveBlock:c,canMoveBlock:u}=e(qn),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}})),Oc=(0,m.withDispatch)(((e,t,n)=>{let{select:o}=n;const{updateBlockAttributes:l,insertBlocks:i,mergeBlocks:a,replaceBlocks:s,toggleSelection:c,__unstableMarkLastChangeAsPersistent:u}=e(qn);return{setAttributes(e){const{getMultiSelectedBlockClientIds:n}=o(qn),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(qn),a=l(n);i(e,a+1,r)},onMerge(e){const{clientId:n}=t,{getPreviousBlockClientId:r,getNextBlockClientId:l}=o(qn);if(e){const e=l(n);e&&a(n,e)}else{const e=r(n);e&&a(e,n)}},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 Fc=(0,d.compose)(d.pure,Dc,Oc,(0,d.ifCondition)((e=>{let{block:t}=e;return!!t})),(0,p.withFilters)("editor.BlockListBlock"))((function(e){var t;let{block:{__unstableBlockSource:n},mode:o,isLocked:l,canRemove:i,clientId:s,isSelected:d,isSelectionEnabled:p,className:f,name:g,isValid:h,attributes:v,wrapperProps:b,setAttributes:k,onReplace:_,onInsertBlocksAfter:y,onMerge:E,toggleSelection:C}=e;const w=(0,m.useSelect)((e=>{const{getSettings:t}=e(qn);return t().supportsLayout}),[]),{removeBlock:S}=(0,m.useDispatch)(qn),B=(0,a.useCallback)((()=>S(s)),[s]);let I=(0,a.createElement)(ll,{name:g,isSelected:d,attributes:v,setAttributes:k,insertBlocksAfter:l?void 0:y,onReplace:i?_:void 0,onRemove:i?B:void 0,mergeBlocks:i?E:void 0,clientId:s,isSelectionEnabled:p,toggleSelection:C});const x=(0,r.getBlockType)(g);null!=x&&x.getEditWrapperProps&&(b=function(e,t){const n={...e,...t};return e&&t&&e.className&&t.className&&(n.className=c()(e.className,t.className)),e&&t&&e.style&&t.style&&(n.style={...e.style,...t.style}),n}(b,x.getEditWrapperProps(v)));const T=b&&!!b["data-align"]&&!w;let N;if(T&&(I=(0,a.createElement)("div",{className:"wp-block","data-align":b["data-align"]},I)),h)N="html"===o?(0,a.createElement)(a.Fragment,null,(0,a.createElement)("div",{style:{display:"none"}},I),(0,a.createElement)(Ac,{isHtml:!0},(0,a.createElement)(bl,{clientId:s}))):(null==x?void 0:x.apiVersion)>1?I:(0,a.createElement)(Ac,b,I);else{const e=n?(0,r.serializeRawBlock)(n):(0,r.getSaveContent)(x,v);N=(0,a.createElement)(Ac,{className:"has-warning"},(0,a.createElement)(pl,{clientId:s}),(0,a.createElement)(a.RawHTML,null,(0,Jr.safeHTML)(e)))}const P={clientId:s,className:null!==(t=b)&&void 0!==t&&t["data-align"]&&w?c()(f,`align${b["data-align"]}`):f,wrapperProps:(0,u.omit)(b,["data-align"]),isAligned:T},M=(0,a.useMemo)((()=>P),Object.values(P));return(0,a.createElement)(Lc.Provider,{value:M},(0,a.createElement)(hl,{fallback:(0,a.createElement)(Ac,{className:"has-warning"},(0,a.createElement)(fl,null))},N))})),zc=window.wp.htmlEntities;var Vc=(0,a.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(O.Path,{d:"M18 11.2h-5.2V6h-1.6v5.2H6v1.6h5.2V18h1.6v-5.2H18z"}));const Hc=[(0,a.createInterpolateElement)((0,g.__)("While writing, you can press / to quickly insert new blocks."),{kbd:(0,a.createElement)("kbd",null)}),(0,a.createInterpolateElement)((0,g.__)("Indent a list by pressing space at the beginning of a line."),{kbd:(0,a.createElement)("kbd",null)}),(0,a.createInterpolateElement)((0,g.__)("Outdent a list by pressing backspace 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 Gc=function(){const[e]=(0,a.useState)(Math.floor(Math.random()*Hc.length));return(0,a.createElement)(p.Tip,null,Hc[e])};var Uc=(0,a.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(O.Path,{d:"M19 8h-1V6h-5v2h-2V6H6v2H5c-1.1 0-2 .9-2 2v8c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-8c0-1.1-.9-2-2-2zm.5 10c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5v-8c0-.3.2-.5.5-.5h14c.3 0 .5.2.5.5v8z"}));var Wc=(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:Uc});const l=(0,a.createElement)(p.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 $c=function(e){let{title:t,icon:n,description:o,blockType:r}=e;return r&&(Vt()("`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)(Wc,{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)))};function jc(e){let{clientId:t=null,value:n,selection:o,onChange:l=u.noop,onInput:i=u.noop}=e;const s=(0,m.useRegistry)(),{resetBlocks:c,resetSelection:d,replaceInnerBlocks:p,setHasControlledInnerBlocks:f,__unstableMarkNextChangeAsNotPersistent:g}=s.dispatch(qn),{getBlockName:h,getBlocks:v}=s.select(qn),b=(0,m.useSelect)((e=>!t||e(qn).areInnerBlocksControlled(t)),[t]),k=(0,a.useRef)({incoming:null,outgoing:[]}),_=(0,a.useRef)(!1),y=()=>{n&&(g(),t?s.batch((()=>{f(t,!0);const e=n.map((e=>(0,r.cloneBlock)(e)));_.current&&(k.current.incoming=e),g(),p(t,e)})):(_.current&&(k.current.incoming=n),c(n)))},E=(0,a.useRef)(i),C=(0,a.useRef)(l);(0,a.useEffect)((()=>{E.current=i,C.current=l}),[i,l]),(0,a.useEffect)((()=>{k.current.outgoing.includes(n)?(0,u.last)(k.current.outgoing)===n&&(k.current.outgoing=[]):v(t)!==n&&(k.current.outgoing=[],y(),o&&d(o.selectionStart,o.selectionEnd,o.initialPosition))}),[n,t]),(0,a.useEffect)((()=>{b||(k.current.outgoing=[],y())}),[b]),(0,a.useEffect)((()=>{const{getSelectionStart:e,getSelectionEnd:n,getSelectedBlocksInitialCaretPosition:o,isLastBlockChangePersistent:r,__unstableIsLastBlockChangeIgnored:l,areInnerBlocksControlled:i}=s.select(qn);let a=v(t),c=r(),u=!1;_.current=!0;const d=s.subscribe((()=>{if(null!==t&&null===h(t))return;if(!(!t||i(t)))return;const s=r(),d=v(t),p=d!==a;if(a=d,p&&(k.current.incoming||l()))return k.current.incoming=null,void(c=s);if(p||u&&!p&&s&&!c){c=s,k.current.outgoing.push(a);(c?C.current:E.current)(a,{selection:{selectionStart:e(),selectionEnd:n(),initialPosition:o()}})}u=p}));return()=>d()}),[s,t])}var Kc=(0,d.createHigherOrderComponent)((e=>(0,m.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,m.createRegistry)({},o);e.registerStore(jn,Kn),s(e)}),[o]),l?(0,a.createElement)(m.RegistryProvider,{value:l},(0,a.createElement)(e,i({registry:l},r))):null}))),"withRegistryProvider")((function(e){const{children:t,settings:n}=e,{updateSettings:o}=(0,m.useDispatch)(qn);return(0,a.useEffect)((()=>{o(n)}),[n]),jc(e),(0,a.createElement)(_o,null,t)}));function qc(e){let{onClick:t}=e;return(0,a.createElement)("div",{tabIndex:0,role:"button",onClick:t,onKeyPress:t},(0,a.createElement)(p.Disabled,null,(0,a.createElement)(Wf,null)))}function Yc(){const{hasSelectedBlock:e,hasMultiSelection:t}=(0,m.useSelect)(qn),{clearSelectedBlock:n}=(0,m.useDispatch)(qn);return(0,d.useRefEffect)((o=>{function r(r){(e()||t())&&r.target===o&&n()}return o.addEventListener("mousedown",r),()=>{o.removeEventListener("mousedown",r)}}),[e,t,n])}function Qc(e){return(0,a.createElement)("div",i({ref:Yc()},e))}function Xc(e){const{isMultiSelecting:t,getMultiSelectedBlockClientIds:n,hasMultiSelection:o,getSelectedBlockClientId:r,getSelectedBlocksInitialCaretPosition:l,__unstableIsFullySelected:i}=e(qn);return{isMultiSelecting:t(),multiSelectedBlockClientIds:n(),hasMultiSelection:o(),selectedBlockClientId:r(),initialPosition:l(),isFullSelection:i()}}function Zc(){const{initialPosition:e,isMultiSelecting:t,multiSelectedBlockClientIds:n,hasMultiSelection:o,selectedBlockClientId:r,isFullSelection:l}=(0,m.useSelect)(Xc,[]),i=Eo(r),a=Eo((0,u.first)(n)),s=Eo((0,u.last)(n));return(0,d.useRefEffect)((c=>{const{ownerDocument:u}=c,{defaultView:d}=u;if(null==e)return;if(!o||t){if(!r||t)return;const e=d.getSelection();if(e.rangeCount&&!e.isCollapsed){const t=i.current,{startContainer:n,endContainer:o}=e.getRangeAt(0);!t||t.contains(n)&&t.contains(o)||e.removeAllRanges()}return}const{length:p}=n;if(p<2)return;if(!l)return;if(c.contentEditable=!0,c.focus(),!a.current||!s.current)return;const m=d.getSelection(),f=u.createRange();f.setStartBefore(a.current),f.setEndAfter(s.current),m.removeAllRanges(),m.addRange(f)}),[o,t,n,r,e,l])}function Jc(e,t,n,o){let r,l=Jr.focus.focusable.find(n);return t&&(l=(0,u.reverse)(l)),l=l.slice(l.indexOf(e)+1),o&&(r=e.getBoundingClientRect()),(0,u.find)(l,(function(e){if(!Jr.focus.tabbable.isTabbableIndex(e))return!1;if(e.isContentEditable&&"true"!==e.contentEditable)return!1;if(o){const t=e.getBoundingClientRect();if(t.left>=r.right||t.right<=r.left)return!1}return!0}))}function eu(){const{getSelectedBlockClientId:e,getMultiSelectedBlocksEndClientId:t,getPreviousBlockClientId:n,getNextBlockClientId:o,getSettings:r,hasMultiSelection:l}=(0,m.useSelect)(qn);return(0,d.useRefEffect)((i=>{let a;function s(){a=null}function c(e,t){const n=Jc(e,t,i);return!n||!function(e,t){return e.closest(hc)===t.closest(hc)}(e,n)}function u(s){const{keyCode:u,target:d}=s,p=u===Tc.UP,m=u===Tc.DOWN,f=u===Tc.LEFT,g=u===Tc.RIGHT,h=p||f,v=f||g,b=p||m,k=v||b,_=s.shiftKey,y=_||s.ctrlKey||s.altKey||s.metaKey,E=b?Jr.isVerticalEdge:Jr.isHorizontalEdge,{ownerDocument:C}=i,{defaultView:w}=C;if(l())return;if(b?a||(a=(0,Jr.computeCaretRect)(w)):a=null,s.defaultPrevented)return;if(!k)return;if(!function(e,t,n){if((t===Tc.UP||t===Tc.DOWN)&&!n)return!0;const{tagName:o}=e;return"INPUT"!==o&&"TEXTAREA"!==o}(d,u,y))return;const S=(0,Jr.isRTL)(d)?!h:h,{keepCaretInsideBlock:B}=r(),I=e();if(_){const e=t(),r=n(e||I),l=o(e||I);(h&&r||!h&&l)&&c(d,h)&&E(d,h)&&(i.contentEditable=!0,i.focus())}else if(b&&(0,Jr.isVerticalEdge)(d,h)&&!B){const e=Jc(d,h,i,!0);e&&((0,Jr.placeCaretAtVerticalEdge)(e,h,a),s.preventDefault())}else if(v&&w.getSelection().isCollapsed&&(0,Jr.isHorizontalEdge)(d,S)&&!B){const e=Jc(d,S,i);(0,Jr.placeCaretAtHorizontalEdge)(e,h),s.preventDefault()}}return i.addEventListener("mousedown",s),i.addEventListener("keydown",u),()=>{i.removeEventListener("mousedown",s),i.removeEventListener("keydown",u)}}),[])}var tu=window.wp.keyboardShortcuts;function nu(){const{getBlockOrder:e,getSelectedBlockClientIds:t,getBlockRootClientId:n}=(0,m.useSelect)(qn),{multiSelect:o}=(0,m.useDispatch)(qn),r=(0,tu.__unstableUseShortcutEventMatch)();return(0,d.useRefEffect)((l=>{function i(l){if(!r("core/block-editor/select-all",l))return;const i=t();if(i.length<2&&!(0,Jr.isEntirelySelected)(l.target))return;const[a]=i,s=n(a);let c=e(s);i.length===c.length&&(c=e(n(s)));const d=(0,u.first)(c),p=(0,u.last)(c);d!==p&&(o(d,p),l.preventDefault())}return l.addEventListener("keydown",i),()=>{l.removeEventListener("keydown",i)}}),[])}function ou(e,t){e.contentEditable=t,t&&e.focus()}function ru(){const{startMultiSelect:e,stopMultiSelect:t}=(0,m.useDispatch)(qn),{isSelectionEnabled:n,hasMultiSelection:o}=(0,m.useSelect)(qn);return(0,d.useRefEffect)((r=>{const{ownerDocument:l}=r,{defaultView:i}=l;let a,s;function c(){t(),i.removeEventListener("mouseup",c),s=i.requestAnimationFrame((()=>{if(o())return;ou(r,!1);const e=i.getSelection();if(e.rangeCount){const{commonAncestorContainer:t}=e.getRangeAt(0);a.contains(t)&&a.focus()}}))}function u(t){let{buttons:o,target:s}=t;1===o&&s.getAttribute("contenteditable")&&n()&&(a=l.activeElement,e(),i.addEventListener("mouseup",c),ou(r,!0))}return r.addEventListener("mouseout",u),()=>{r.removeEventListener("mouseout",u),i.removeEventListener("mouseup",c),i.cancelAnimationFrame(s)}}),[e,t,n,o])}function lu(e,t){e.contentEditable=t,t&&e.focus()}function iu(){const{multiSelect:e,selectBlock:t,selectionChange:n}=(0,m.useDispatch)(qn),{getBlockParents:o,getBlockSelectionStart:r}=(0,m.useSelect)(qn);return(0,d.useRefEffect)((n=>{const{ownerDocument:l}=n,{defaultView:i}=l;function a(l){const a=i.getSelection();if(!a.rangeCount)return void lu(n,!1);const s=l.shiftKey&&"mouseup"===l.type;if(a.isCollapsed&&!s)return void lu(n,!1);let c=_c(function(e){const{anchorNode:t,anchorOffset:n}=e;return t.nodeType===t.TEXT_NODE?t:t.childNodes[n]}(a)),u=_c(function(e){const{focusNode:t,focusOffset:n}=e;return t.nodeType===t.TEXT_NODE?t:t.childNodes[n-1]}(a));if(s){const e=r(),t=_c(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 lu(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 au(){const{selectBlock:e}=(0,m.useDispatch)(qn),{isSelectionEnabled:t,getBlockSelectionStart:n,hasMultiSelection:o}=(0,m.useSelect)(qn);return(0,d.useRefEffect)((r=>{function l(l){if(!t()||0!==l.button)return;const i=n(),a=_c(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 su(){const{__unstableIsFullySelected:e,getSelectedBlockClientIds:t,__unstableIsSelectionMergeable:n,hasMultiSelection:o}=(0,m.useSelect)(qn),{replaceBlocks:l,__unstableSplitSelection:i,removeBlocks:a,__unstableDeleteSelection:s,__unstableExpandSelection:c}=(0,m.useDispatch)(qn);return(0,d.useRefEffect)((u=>{function d(d){d.defaultPrevented||o()&&(d.keyCode===Tc.ENTER?(u.contentEditable=!1,d.preventDefault(),e()?l(t(),(0,r.createBlock)((0,r.getDefaultBlockName)())):i()):d.keyCode===Tc.BACKSPACE||d.keyCode===Tc.DELETE?(u.contentEditable=!1,d.preventDefault(),e()?a(t()):n()?s(d.keyCode===Tc.DELETE):c()):1!==d.key.length||d.metaKey||d.ctrlKey||(u.contentEditable=!1,n()?s(d.keyCode===Tc.DELETE):(d.preventDefault(),u.ownerDocument.defaultView.getSelection().removeAllRanges())))}function p(e){o()&&(u.contentEditable=!1,n()?s():(e.preventDefault(),u.ownerDocument.defaultView.getSelection().removeAllRanges()))}return u.addEventListener("keydown",d),u.addEventListener("compositionstart",p),()=>{u.removeEventListener("keydown",d),u.removeEventListener("compositionstart",p)}}),[])}function cu(){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,m.useSelect)(qn),{setNavigationMode:s}=(0,m.useDispatch)(qn),c=(0,m.useSelect)((e=>e(qn).isNavigationMode()),[])?void 0:"0",u=(0,a.useRef)();function p(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";Jr.focus.tabbable[n](t.target).focus()}}const f=(0,a.createElement)("div",{ref:t,tabIndex:c,onFocus:p}),g=(0,a.createElement)("div",{ref:n,tabIndex:c,onFocus:p}),h=(0,d.useRefEffect)((a=>{function c(e){if(e.defaultPrevented)return;if(e.keyCode===Tc.ESCAPE&&!r())return e.preventDefault(),void s(!0);if(e.keyCode!==Tc.TAB)return;const o=e.shiftKey,i=o?"findPrevious":"findNext";if(!r()&&!l())return void(e.target===a&&s(!0));if(((0,Jr.isFormElement)(e.target)||e.target.getAttribute("data-block")===l())&&(0,Jr.isFormElement)(Jr.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!==Tc.TAB)return;if("region"===(null===(r=o.target)||void 0===r?void 0:r.getAttribute("role")))return;if(e.current===o.target)return;const l=o.shiftKey?"findPrevious":"findNext",i=Jr.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,m.useSelect)((e=>e(qn).hasMultiSelection()),[]);return[e,(0,d.useMergeRefs)([t,su(),ru(),iu(),au(),Zc(),nu(),eu(),(0,d.useRefEffect)((e=>{if(e.tabIndex=-1,e.contentEditable=o,o)return e.setAttribute("aria-label",(0,g.__)("Multiple selected blocks")),()=>{e.removeAttribute("aria-label")}}),[o])]),n]}var uu=(0,a.forwardRef)((function(e,t){let{children:n,...o}=e;const[r,l,s]=cu();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 du="editor-styles-wrapper";function pu(e){return(0,a.useMemo)((()=>{const t=document.implementation.createHTMLDocument("");return t.body.innerHTML=e,Array.from(t.body.children)}),[e])}var mu=(0,a.forwardRef)((function(e,t){let{contentRef:n,children:o,head:r,tabIndex:l=0,assets:s,...u}=e;const[,m]=(0,a.useReducer)((()=>({}))),[f,h]=(0,a.useState)(),[v,b]=(0,a.useState)([]),k=pu(null==s?void 0:s.styles),_=pu(null==s?void 0:s.scripts),y=Yc(),[E,C,w]=cu(),S=(0,d.useRefEffect)((e=>{function t(){const{contentDocument:t,ownerDocument:n}=e,{readyState:o,documentElement:r}=t;return("interactive"===o||"complete"===o)&&(function(e){const{defaultView:t}=e,{frameElement:n}=t;function o(e){const o=Object.getPrototypeOf(e).constructor.name,r=window[o],l={};for(const t in e)l[t]=e[t];if(e instanceof t.MouseEvent){const e=n.getBoundingClientRect();l.clientX+=e.left,l.clientY+=e.top}const i=new r(e.type,l);!n.dispatchEvent(i)&&e.preventDefault()}const r=["dragover"];for(const t of r)e.addEventListener(t,o)}(t),h(t),y(r),b(Array.from(n.body.classList).filter((e=>e.startsWith("admin-color-")||e.startsWith("post-type-")||"wp-embed-responsive"===e))),t.dir=n.dir,r.removeChild(t.head),r.removeChild(t.body),!0)}return e.addEventListener("load",t),()=>e.removeEventListener("load",t)}),[]),B=(0,d.useRefEffect)((e=>{_.reduce(((t,n)=>t.then((()=>async function(e,t){let{id:n,src:o}=t;return new Promise(((t,r)=>{const l=e.ownerDocument.createElement("script");l.id=n,o?(l.src=o,l.onload=()=>t(),l.onerror=()=>r()):t(),e.appendChild(l)}))}(e,n)))),Promise.resolve()).finally((()=>{m()}))}),[]),I=(0,d.useMergeRefs)([n,y,C]),x=(0,d.useRefEffect)((e=>{Array.from(document.styleSheets).forEach((t=>{try{t.cssRules}catch(e){return}const{ownerNode:n,cssRules:o}=t;if(o&&"LINK"===n.tagName&&"wp-reset-editor-styles-css"!==n.id&&Array.from(o).find((e=>{let{selectorText:t}=e;return t&&(t.includes(`.${du}`)||t.includes(".wp-block"))}))&&!e.ownerDocument.getElementById(n.id)){e.appendChild(n.cloneNode(!0));const t=n.id.replace("-css","-inline-css"),o=document.getElementById(t);o&&e.appendChild(o.cloneNode(!0))}}))}),[]);return r=(0,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&&E,(0,a.createElement)("iframe",i({},u,{ref:(0,d.useMergeRefs)([t,S]),tabIndex:l,src:"/wp-includes/empty.html",title:(0,g.__)("Editor canvas")}),f&&(0,a.createPortal)((0,a.createElement)(a.Fragment,null,(0,a.createElement)("head",{ref:B},r),(0,a.createElement)("body",{ref:I,className:c()(du,...v)},(0,a.createElement)("div",{style:{display:"none"},ref:x}),(0,a.createElement)(p.__experimentalStyleProvider,{document:f},o))),f.documentElement)),l>=0&&w)})),fu={grad:.9,turn:360,rad:360/(2*Math.PI)},gu=function(e){return"string"==typeof e?e.length>0:"number"==typeof e},hu=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=Math.pow(10,t)),Math.round(n*e)/n+0},vu=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=1),e>n?n:e>t?e:t},bu=function(e){return(e=isFinite(e)?e%360:0)>0?e:e+360},ku=function(e){return{r:vu(e.r,0,255),g:vu(e.g,0,255),b:vu(e.b,0,255),a:vu(e.a)}},_u=function(e){return{r:hu(e.r),g:hu(e.g),b:hu(e.b),a:hu(e.a,3)}},yu=/^#([0-9a-f]{3,8})$/i,Eu=function(e){var t=e.toString(16);return t.length<2?"0"+t:t},Cu=function(e){var t=e.r,n=e.g,o=e.b,r=e.a,l=Math.max(t,n,o),i=l-Math.min(t,n,o),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}},wu=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}},Su=function(e){return{h:bu(e.h),s:vu(e.s,0,100),l:vu(e.l,0,100),a:vu(e.a)}},Bu=function(e){return{h:hu(e.h),s:hu(e.s),l:hu(e.l),a:hu(e.a,3)}},Iu=function(e){return wu((n=(t=e).s,{h:t.h,s:(n*=((o=t.l)<50?o:100-o)/100)>0?2*n/(o+n)*100:0,v:o+n,a:t.a}));var t,n,o},xu=function(e){return{h:(t=Cu(e)).h,s:(r=(200-(n=t.s))*(o=t.v)/100)>0&&r<200?n*o/100/(r<=100?r:200-r)*100:0,l:r/2,a:t.a};var t,n,o,r},Tu=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Nu=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Pu=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Mu=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Ru={string:[[function(e){var t=yu.exec(e);return t?(e=t[1]).length<=4?{r:parseInt(e[0]+e[0],16),g:parseInt(e[1]+e[1],16),b:parseInt(e[2]+e[2],16),a:4===e.length?hu(parseInt(e[3]+e[3],16)/255,2):1}:6===e.length||8===e.length?{r:parseInt(e.substr(0,2),16),g:parseInt(e.substr(2,2),16),b:parseInt(e.substr(4,2),16),a:8===e.length?hu(parseInt(e.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(e){var t=Pu.exec(e)||Mu.exec(e);return t?t[2]!==t[4]||t[4]!==t[6]?null:ku({r:Number(t[1])/(t[2]?100/255:1),g:Number(t[3])/(t[4]?100/255:1),b:Number(t[5])/(t[6]?100/255:1),a:void 0===t[7]?1:Number(t[7])/(t[8]?100:1)}):null},"rgb"],[function(e){var t=Tu.exec(e)||Nu.exec(e);if(!t)return null;var n,o,r=Su({h:(n=t[1],o=t[2],void 0===o&&(o="deg"),Number(n)*(fu[o]||1)),s:Number(t[3]),l:Number(t[4]),a:void 0===t[5]?1:Number(t[5])/(t[6]?100:1)});return Iu(r)},"hsl"]],object:[[function(e){var t=e.r,n=e.g,o=e.b,r=e.a,l=void 0===r?1:r;return gu(t)&&gu(n)&&gu(o)?ku({r:Number(t),g:Number(n),b:Number(o),a:Number(l)}):null},"rgb"],[function(e){var t=e.h,n=e.s,o=e.l,r=e.a,l=void 0===r?1:r;if(!gu(t)||!gu(n)||!gu(o))return null;var i=Su({h:Number(t),s:Number(n),l:Number(o),a:Number(l)});return Iu(i)},"hsl"],[function(e){var t=e.h,n=e.s,o=e.v,r=e.a,l=void 0===r?1:r;if(!gu(t)||!gu(n)||!gu(o))return null;var i=function(e){return{h:bu(e.h),s:vu(e.s,0,100),v:vu(e.v,0,100),a:vu(e.a)}}({h:Number(t),s:Number(n),v:Number(o),a:Number(l)});return wu(i)},"hsv"]]},Lu=function(e,t){for(var n=0;n=.5},e.prototype.toHex=function(){return t=(e=_u(this.rgba)).r,n=e.g,o=e.b,l=(r=e.a)<1?Eu(hu(255*r)):"","#"+Eu(t)+Eu(n)+Eu(o)+l;var e,t,n,o,r,l},e.prototype.toRgb=function(){return _u(this.rgba)},e.prototype.toRgbString=function(){return t=(e=_u(this.rgba)).r,n=e.g,o=e.b,(r=e.a)<1?"rgba("+t+", "+n+", "+o+", "+r+")":"rgb("+t+", "+n+", "+o+")";var e,t,n,o,r},e.prototype.toHsl=function(){return Bu(xu(this.rgba))},e.prototype.toHslString=function(){return t=(e=Bu(xu(this.rgba))).h,n=e.s,o=e.l,(r=e.a)<1?"hsla("+t+", "+n+"%, "+o+"%, "+r+")":"hsl("+t+", "+n+"%, "+o+"%)";var e,t,n,o,r},e.prototype.toHsv=function(){return e=Cu(this.rgba),{h:hu(e.h),s:hu(e.s),v:hu(e.v),a:hu(e.a,3)};var e},e.prototype.invert=function(){return Vu({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),Vu(Du(this.rgba,e))},e.prototype.desaturate=function(e){return void 0===e&&(e=.1),Vu(Du(this.rgba,-e))},e.prototype.grayscale=function(){return Vu(Du(this.rgba,-1))},e.prototype.lighten=function(e){return void 0===e&&(e=.1),Vu(Fu(this.rgba,e))},e.prototype.darken=function(e){return void 0===e&&(e=.1),Vu(Fu(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?Vu({r:(t=this.rgba).r,g:t.g,b:t.b,a:e}):hu(this.rgba.a,3);var t},e.prototype.hue=function(e){var t=xu(this.rgba);return"number"==typeof e?Vu({h:e,s:t.s,l:t.l,a:t.a}):hu(t.h)},e.prototype.isEqual=function(e){return this.toHex()===Vu(e).toHex()},e}(),Vu=function(e){return e instanceof zu?e:new zu(e)},Hu=[],Gu=function(e){e.forEach((function(e){Hu.indexOf(e)<0&&(e(zu,Ru),Hu.push(e))}))};function Uu(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(s=$u(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 Ku=n(3124),qu=n.n(Ku);const Yu=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;function Qu(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 Xu(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=Xu(t[0]),!p(/^:\s*/))return s("property missing ':'");const n=p(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^\)]*?\)|[^};])+)/),o=e({type:"declaration",property:t.replace(Yu,""),value:n?Xu(n[0]).replace(Yu,""):""});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 k(){let e;const t=[],n=l();for(;e=p(/^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/);)t.push(e[1]),p(/^,\s*/);if(t.length)return n({type:"keyframe",values:t,declarations:b()})}const _=C("import"),y=C("charset"),E=C("namespace");function C(e){const t=new RegExp("^@"+e+"\\s*([^;]+);");return function(){const n=l(),o=p(t);if(!o)return;const r={type:e};return r[e]=o[1].trim(),n(r)}}function 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=k();)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=Xu(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:Xu(t[1]),media:Xu(t[2])})}()||function(){const e=l(),t=p(/^@supports *([^{]+)/);if(!t)return;const n=Xu(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 '}'")}()||_()||y()||E()||function(){const e=l(),t=p(/^@([-\w]+)?document *([^{]+)/);if(!t)return;const n=Xu(t[1]),o=Xu(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 Zu(function(){const e=d();return{type:"stylesheet",stylesheet:{source:t.source,rules:e,parsingErrors:a}}}())}function Xu(e){return e?e.replace(/^\s+|\s+$/g,""):""}function Zu(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){Zu(e,o)})):n&&"object"==typeof n&&Zu(n,o)}return n&&Object.defineProperty(e,"parent",{configurable:!0,writable:!0,enumerable:!1,value:t||null}),e}var Ju=n(8575),ed=n.n(Ju),td=nd;function nd(e){this.options=e||{}}nd.prototype.emit=function(e){return e},nd.prototype.visit=function(e){return this[e.type](e)},nd.prototype.mapVisit=function(e,t){let n="";t=t||"";for(let o=0,r=e.length;ot=>{if("declaration"===t.type){const l=function(e){const t=/url\((\s*)(['"]?)(.+?)\2(\s*)\)/g;let n;const o=[];for(;null!==(n=t.exec(e));){const e={source:n[0],before:n[1],quote:n[2],value:n[3],after:n[4]};sd(e)&&o.push(e)}return o}(t.value).map((r=e,e=>({...e,newUrl:"url("+e.before+e.quote+cd(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 dd=/^(body|html|:root).*$/;var pd=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(dd)?n.replace(/^(body|html|:root)/,e):e+" "+n;return"rule"===n.type?{...n,selectors:n.selectors.map(o)}:n}};var md=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(pd(t)),o&&r.push(ud(o)),r.length?ad(n,(0,d.compose)(r)):n}))};const fd=".editor-styles-wrapper";function gd(e){return(0,a.useCallback)((e=>{if(!e)return;const{ownerDocument:t}=e,{defaultView:n,body:o}=t,r=t.querySelector(fd);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=Vu(l);i.luminance()>.5||0===i.alpha()?o.classList.remove("is-dark-theme"):o.classList.add("is-dark-theme")}),[e])}function hd(e){let{styles:t}=e;const n=(0,a.useMemo)((()=>md(t,fd)),[t]);return(0,a.createElement)(a.Fragment,null,(0,a.createElement)("style",{ref:gd(t)}),n.map(((e,t)=>(0,a.createElement)("style",{key:t},e))))}let vd;Gu([Uu,ju]);const bd=2e3;var kd=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}=(0,m.useSelect)((e=>{const t=e(qn).getSettings();return{styles:t.styles,assets:t.__unstableResolvedAssets}}),[]),f=(0,a.useMemo)((()=>c?[...c,{css:"body{height:auto;overflow:hidden;}",__unstableType:"presets"}]:c),[c]);vd=vd||(0,d.pure)(Wf);const g=l/t;return(0,a.createElement)("div",{className:"block-editor-block-preview__container"},r,(0,a.createElement)(p.Disabled,{className:"block-editor-block-preview__content",style:{transform:`scale(${g})`,height:s*g,maxHeight:s>bd?bd*g:void 0,minHeight:o}},(0,a.createElement)(mu,{head:(0,a.createElement)(hd,{styles:f}),assets:u,contentRef:(0,d.useRefEffect)((e=>{const{ownerDocument:{documentElement:t}}=e;t.classList.add("block-editor-block-preview__content-iframe"),t.style.position="absolute",t.style.width="100%",e.style.padding=n+"px",e.style.position="relative"}),[]),"aria-hidden":!0,tabIndex:-1,style:{position:"absolute",width:t,height:s,pointerEvents:"none",maxHeight:bd,minHeight:g<1&&o?o/g:o}},i,(0,a.createElement)(vd,{renderAppender:!1}))))};var _d=(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,m.useSelect)((e=>e(qn).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)(Kc,{value:d,settings:c},r?(0,a.createElement)(qc,{onClick:l}):(0,a.createElement)(kd,{viewportWidth:o,__experimentalPadding:n,__experimentalMinHeight:i})):null}));function yd(e){let{blocks:t,props:n={},__experimentalLayout:o}=e;const r=(0,m.useSelect)((e=>e(qn).getSettings()),[]),l=(0,d.__experimentalUseDisabled)(),i=(0,d.useMergeRefs)([n.ref,l]),s=(0,a.useMemo)((()=>({...r,__experimentalBlockPatterns:[]})),[r]),p=(0,a.useMemo)((()=>(0,u.castArray)(t)),[t]),f=(0,a.createElement)(Kc,{value:p,settings:s},(0,a.createElement)(jf,{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 Ed=function(e){var t,n;let{item:o}=e;const{name:l,title:i,icon:s,description:c,initialAttributes:u}=o,d=(0,r.getBlockType)(l),p=(0,r.isReusableBlock)(o);return(0,a.createElement)("div",{className:"block-editor-inserter__preview-container"},(0,a.createElement)("div",{className:"block-editor-inserter__preview"},p||null!=d&&d.example?(0,a.createElement)("div",{className:"block-editor-inserter__preview-content"},(0,a.createElement)(_d,{__experimentalPadding:16,viewportWidth:null!==(t=null===(n=d.example)||void 0===n?void 0:n.viewportWidth)&&void 0!==t?t:500,blocks:d.example?(0,r.getBlockFromExample)(o.name,{attributes:{...d.example.attributes,...u},innerBlocks:d.example.innerBlocks}):(0,r.createBlock)(l,u)})):(0,a.createElement)("div",{className:"block-editor-inserter__preview-content-missing"},(0,g.__)("No Preview Available."))),!p&&(0,a.createElement)($c,{title:i,icon:s,description:c}))};var Cd=(0,a.createContext)();var wd=(0,a.forwardRef)((function(e,t){let{isFirst:n,as:o,children:r,...l}=e;const s=(0,a.useContext)(Cd);return(0,a.createElement)(p.__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)(p.Button,t,r)}))}));var Sd=(0,a.createElement)(O.SVG,{width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(O.Path,{d:"M8 7h2V5H8v2zm0 6h2v-2H8v2zm0 6h2v-2H8v2zm6-14v2h2V5h-2zm0 8h2v-2h-2v2zm0 6h2v-2h-2v2z"}));function Bd(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"},(0,a.createElement)(p.Flex,{justify:"center",className:"block-editor-block-draggable-chip__content"},(0,a.createElement)(p.FlexItem,null,n?(0,a.createElement)(Wc,{icon:n}):(0,g.sprintf)((0,g._n)("%d block","%d blocks",t),t)),(0,a.createElement)(p.FlexItem,null,(0,a.createElement)(Wc,{icon:Sd})))))}var Id=e=>{let{isEnabled:t,blocks:n,icon:o,children:r}=e;const l={type:"inserter",blocks:n};return(0,a.createElement)(p.Draggable,{__experimentalTransferDataType:"wp-blocks",transferData:l,__experimentalDragComponent:(0,a.createElement)(Bd,{count:n.length,icon:o})},(e=>{let{onDraggableStart:n,onDraggableEnd:o}=e;return r({draggable:t,onDragStart:t?n:void 0,onDragEnd:t?o:void 0})}))};function xd(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window;const{platform:t}=e.navigator;return-1!==t.indexOf("Mac")||["iPad","iPhone"].includes(t)}var Td=(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),m=o.icon?{backgroundColor:o.icon.background,color:o.icon.foreground}:{},f=(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)(Id,{isEnabled:u&&!o.disabled,blocks:f,icon:o.icon},(e=>{let{draggable:r,onDragStart:u,onDragEnd:f}=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,f&&f(e)}},(0,a.createElement)(wd,i({isFirst:n,className:c()("block-editor-block-types-list__item",t),disabled:o.isDisabled,onClick:e=>{e.preventDefault(),l(o,xd()?e.metaKey:e.ctrlKey),s(null)},onKeyDown:e=>{const{keyCode:t}=e;t===Tc.ENTER&&(e.preventDefault(),l(o,xd()?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:m},(0,a.createElement)(Wc,{icon:o.icon,showColors:!0})),(0,a.createElement)("span",{className:"block-editor-block-types-list__item-title"},o.title)))}))}));var Nd=(0,a.forwardRef)((function(e,t){const[n,o]=(0,a.useState)(!1);return(0,a.useEffect)((()=>{n&&(0,Ft.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 Pd=(0,a.forwardRef)((function(e,t){const n=(0,a.useContext)(Cd);return(0,a.createElement)(p.__unstableCompositeGroup,i({state:n,role:"presentation",ref:t},e))}));var Md=function(e){let{items:t=[],onSelect:n,onHover:o=(()=>{}),children:l,label:i,isDraggable:s=!0}=e;return(0,a.createElement)(Nd,{className:"block-editor-block-types-list","aria-label":i},function(e,t){const n=[];for(let o=0,r=e.length;o(0,a.createElement)(Pd,{key:t},e.map(((e,l)=>(0,a.createElement)(Td,{key:e.id,item:e,className:(0,r.getBlockMenuDefaultClassName)(e.id),onSelect:n,onHover:o,isDraggable:s,isFirst:0===t&&0===l})))))),l)};var Rd=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)(p.Icon,{icon:n})),(0,a.createElement)("div",{className:"block-editor-inserter__panel-content"},o))};var Ld=(e,t)=>{const{categories:n,collections:o,items:l}=(0,m.useSelect)((t=>{const{getInserterItems:n}=t(qn),{getCategories:o,getCollections:l}=t(r.store);return{categories:o(),collections:l(),items:n(e)}}),[e]);return[l,n,o,(0,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 Ad=function(e){let{children:t}=e;const n=(0,p.__unstableUseCompositeState)({shift:!0,wrap:"horizontal"});return(0,a.createElement)(Cd.Provider,{value:n},t)};const Dd=[];var Od=function(e){let{rootClientId:t,onInsert:n,onHover:o,showMostUsedBlocks:r}=e;const[l,i,s,c]=Ld(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,k=(0,a.useMemo)((()=>Object.entries(s)),[s]),_=(0,d.useAsyncList)(b?k:Dd);return(0,a.createElement)(Ad,null,(0,a.createElement)("div",null,r&&!!p.length&&(0,a.createElement)(Rd,{title:(0,g._x)("Most used","blocks")},(0,a.createElement)(Md,{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)(Rd,{key:e.slug,title:e.title,icon:e.icon},(0,a.createElement)(Md,{items:t,onSelect:c,onHover:o,label:e.title})):null})),b&&m.length>0&&(0,a.createElement)(Rd,{className:"block-editor-inserter__uncategorized-blocks-panel",title:(0,g.__)("Uncategorized")},(0,a.createElement)(Md,{items:m,onSelect:c,onHover:o,label:(0,g.__)("Uncategorized")})),(0,u.map)(_,(e=>{let[t,n]=e;const r=h[t];return r&&r.length?(0,a.createElement)(Rd,{key:t,title:n.title,icon:n.icon},(0,a.createElement)(Md,{items:r,onSelect:c,onHover:o,label:n.title})):null}))))};var Fd=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)(p.Flex,{justify:"space-between",align:"start",gap:"4",className:i},(0,a.createElement)(p.FlexItem,{isBlock:!0},(0,a.createElement)(p.SelectControl,{className:"block-editor-inserter__panel-dropdown",label:(0,g.__)("Filter patterns"),hideLabelFromVision:!0,value:t.name,onChange:e=>{o(n.find((t=>e===t.name)))},onBlur:e=>{null!=e&&e.relatedTarget||e.stopPropagation()},options:(()=>{const e=[];return n.map((t=>e.push({value:t.name,label:t.label}))),e})()})),!l&&(0,a.createElement)(p.FlexItem,null,(0,a.createElement)(p.Button,{variant:"secondary",className:"block-editor-inserter__patterns-explorer-expand",label:(0,g.__)("Explore all patterns"),onClick:()=>r()},(0,g._x)("Explore","Label for showing all block patterns"))))},zd=window.wp.notices;var Vd=(e,t)=>{const{patternCategories:n,patterns:o}=(0,m.useSelect)((e=>{const{__experimentalGetAllowedPatterns:n,getSettings:o}=e(qn);return{patterns:n(t),patternCategories:o().__experimentalBlockPatternCategories}}),[t]),{createSuccessNotice:l}=(0,m.useDispatch)(zd.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 Hd(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)(Hd)}`;return(0,a.createElement)(Id,{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)(p.__unstableCompositeItem,i({role:"option",as:"div"},r,{className:"block-editor-block-patterns-list__item",onClick:()=>o(n,l)}),(0,a.createElement)(_d,{blocks:l,viewportWidth:s}),(0,a.createElement)("div",{className:"block-editor-block-patterns-list__item-title"},n.title),!!n.description&&(0,a.createElement)(p.VisuallyHidden,{id:c},n.description)))}))}function Gd(){return(0,a.createElement)("div",{className:"block-editor-block-patterns-list__item is-placeholder"})}var Ud=function(e){let{isDraggable:t,blockPatterns:n,shownPatterns:o,onClickPattern:r,orientation:l,label:s=(0,g.__)("Block Patterns")}=e;const c=(0,p.__unstableUseCompositeState)({orientation:l});return(0,a.createElement)(p.__unstableComposite,i({},c,{role:"listbox",className:"block-editor-block-patterns-list","aria-label":s}),n.map((e=>o.includes(e)?(0,a.createElement)(Hd,{key:e.name,pattern:e,onClick:r,isDraggable:t,composite:c}):(0,a.createElement)(Gd,{key:e.name}))))};function Wd(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)(p.Button,{key:n,label:l,className:`${r}__categories-list__item`,isPressed:t===n,onClick:()=>{o(n)}},l)})))}function $d(e){let{filterValue:t,setFilterValue:n}=e;return(0,a.createElement)("div",{className:"block-editor-block-patterns-explorer__search"},(0,a.createElement)(p.SearchControl,{onChange:n,value:t,label:(0,g.__)("Search for patterns"),placeholder:(0,g.__)("Search")}))}var jd=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)($d,{filterValue:r,setFilterValue:l}),!r&&(0,a.createElement)(Wd,{selectedCategory:t,patternCategories:n,onClickCategory:o}))};var Kd=function(){return(0,a.createElement)("div",{className:"block-editor-inserter__no-results"},(0,a.createElement)(wr,{className:"block-editor-inserter__no-results-icon",icon:Uc}),(0,a.createElement)("p",null,(0,g.__)("No results found.")))};var qd=function(e){let{rootClientId:t="",insertionIndex:n,clientId:o,isAppender:l,onSelect:i,shouldFocusBlock:s=!0}=e;const{getSelectedBlock:c}=(0,m.useSelect)(qn),{destinationRootClientId:d,destinationIndex:p}=(0,m.useSelect)((e=>{const{getSelectedBlockClientId:r,getBlockRootClientId:i,getBlockIndex:a,getBlockOrder:s}=e(qn),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,m.useDispatch)(qn),k=(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,p,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,Ft.speak)(a),i&&i()}),[l,c,f,h,d,p,i,s]),_=(0,a.useCallback)((e=>{e?v(d,p):b()}),[v,b,d,p]);return[d,k,_]};const Yd=e=>e.name||"",Qd=e=>e.title,Xd=e=>e.description||"",Zd=e=>e.keywords||[],Jd=e=>e.category,ep=()=>null;function tp(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return e=(0,u.deburr)(e),e=e.replace(/^\//,""),e=e.toLowerCase(),e}const np=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return(0,u.words)(tp(e))},op=(e,t)=>(0,u.differenceWith)(e,np(t),((e,t)=>t.includes(e))),rp=(e,t,n,o)=>{if(0===np(o).length)return e;return lp(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}})},lp=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=np(t);if(0===o.length)return e;const r=e.map((e=>[e,ip(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 ip(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{getName:o=Yd,getTitle:r=Qd,getDescription:l=Xd,getKeywords:i=Zd,getCategory:a=Jd,getCollection:s=ep}=n,c=o(e),d=r(e),p=l(e),m=i(e),f=a(e),g=s(e),h=tp(t),v=tp(d);let b=0;if(h===v)b+=30;else if(v.startsWith(h))b+=20;else{const e=[c,d,p,...m,f,g].join(" "),t=(0,u.words)(h);0===op(t,e).length&&(b+=10)}if(0!==b&&c.startsWith("core/")){b+=c!==e.id?1:2}return b}function ap(e){let{filterValue:t,filteredBlockPatternsLength:n}=e;return t?(0,a.createElement)(p.__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 sp=function(e){let{filterValue:t,selectedCategory:n,patternCategories:o}=e;const r=(0,d.useDebounce)(Ft.speak,500),[l,i]=qd({shouldFocusBlock:!0}),[s,,c]=Vd(i,l),u=(0,a.useMemo)((()=>o.map((e=>e.name))),[o]),p=(0,a.useMemo)((()=>t?lp(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)(ap,{filterValue:t,filteredBlockPatternsLength:p.length}),(0,a.createElement)(Ad,null,!f&&(0,a.createElement)(Kd,null),f&&(0,a.createElement)(Ud,{shownPatterns:m,blockPatterns:p,onClickPattern:c,isDraggable:!1})))};function cp(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)(jd,{selectedCategory:l,patternCategories:n,onClickCategory:i,filterValue:o,setFilterValue:r}),(0,a.createElement)(sp,{filterValue:o,selectedCategory:l,patternCategories:n}))}var up=function(e){let{onModalClose:t,...n}=e;return(0,a.createElement)(p.Modal,{title:(0,g.__)("Patterns"),closeLabel:(0,g.__)("Close"),onRequestClose:t,isFullScreen:!0},(0,a.createElement)(cp,n))};function dp(e){let{rootClientId:t,onInsert:n,selectedCategory:o,populatedCategories:r}=e;const[l,,i]=Vd(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)(Ud,{shownPatterns:p,blockPatterns:c,onClickPattern:i,label:o.label,orientation:"vertical",isDraggable:!0})):null}var pp=function(e){let{rootClientId:t,onInsert:n,onClickCategory:o,selectedCategory:r}=e;const[l,i]=(0,a.useState)(!1),[s,c]=Vd(),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)(Fd,{selectedCategory:p,patternCategories:d,onClickCategory:o,openPatternExplorer:()=>i(!0)}),!l&&(0,a.createElement)(dp,{rootClientId:t,onInsert:n,selectedCategory:p,populatedCategories:d}),l&&(0,a.createElement)(up,{initialCategory:p,patternCategories:d,onModalClose:()=>i(!1)}))},mp=window.wp.url;function fp(e){let{onHover:t,onInsert:n,rootClientId:o}=e;const[r,,,l]=Ld(o,n),i=(0,a.useMemo)((()=>r.filter((e=>{let{category:t}=e;return"reusable"===t}))),[r]);return 0===i.length?(0,a.createElement)(Kd,null):(0,a.createElement)(Rd,{title:(0,g.__)("Reusable blocks")},(0,a.createElement)(Md,{items:i,onSelect:l,onHover:t,label:(0,g.__)("Reusable blocks")}))}var gp=function(e){let{rootClientId:t,onInsert:n,onHover:o}=e;return(0,a.createElement)(a.Fragment,null,(0,a.createElement)(fp,{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,mp.addQueryArgs)("edit.php",{post_type:"wp_block"})},(0,g.__)("Manage Reusable blocks"))))};const{Fill:hp,Slot:vp}=(0,p.createSlotFill)("__unstableInserterMenuExtension");hp.Slot=vp;var bp=hp;const kp=[];var _p=function(e){let{filterValue:t,onSelect:n,onHover:o,rootClientId:r,clientId:l,isAppender:i,__experimentalInsertionIndex:s,maxBlockPatterns:c,maxBlockTypes:m,showBlockDirectory:f=!1,isDraggable:h=!0,shouldFocusBlock:v=!0,prioritizePatterns:b}=e;const k=(0,d.useDebounce)(Ft.speak,500),[_,y]=qd({onSelect:n,rootClientId:r,clientId:l,isAppender:i,insertionIndex:s,shouldFocusBlock:v}),[E,C,w,S]=Ld(_,y),[B,,I]=Vd(y,_),x=(0,a.useMemo)((()=>{if(0===c)return[];const e=lp(B,t);return void 0!==c?e.slice(0,c):e}),[t,B,c]);let T=m;b&&x.length>2&&(T=0);const N=(0,a.useMemo)((()=>{if(0===T)return[];const e=rp((0,u.orderBy)(E,["frecency"],["desc"]),C,w,t);return void 0!==T?e.slice(0,T):e}),[t,E,C,w,m]);(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);k(n)}),[t,k]);const P=(0,d.useAsyncList)(N,{step:9}),M=(0,d.useAsyncList)(P.length===N.length?x:kp),R=!(0,u.isEmpty)(N)||!(0,u.isEmpty)(x),L=!!N.length&&(0,a.createElement)(Rd,{title:(0,a.createElement)(p.VisuallyHidden,null,(0,g.__)("Blocks"))},(0,a.createElement)(Md,{items:P,onSelect:S,onHover:o,label:(0,g.__)("Blocks"),isDraggable:h})),A=!!x.length&&(0,a.createElement)(Rd,{title:(0,a.createElement)(p.VisuallyHidden,null,(0,g.__)("Block Patterns"))},(0,a.createElement)("div",{className:"block-editor-inserter__quick-inserter-patterns"},(0,a.createElement)(Ud,{shownPatterns:M,blockPatterns:x,onClickPattern:I,isDraggable:h})));return(0,a.createElement)(Ad,null,!f&&!R&&(0,a.createElement)(Kd,null),b?A:L,!!N.length&&!!x.length&&(0,a.createElement)("div",{className:"block-editor-inserter__quick-inserter-separator"}),b?L:A,f&&(0,a.createElement)(bp.Slot,{fillProps:{onSelect:S,onHover:o,filterValue:t,hasItems:R,rootClientId:_}},(e=>e.length?e:R?null:(0,a.createElement)(Kd,null))))};const yp={name:"blocks",title:(0,g.__)("Blocks")},Ep={name:"patterns",title:(0,g.__)("Patterns")},Cp={name:"reusable",title:(0,g.__)("Reusable")};var wp=function(e){let{children:t,showPatterns:n=!1,showReusableBlocks:o=!1,onSelect:r}=e;const l=(0,a.useMemo)((()=>{const e=[yp];return n&&e.push(Ep),o&&e.push(Cp),e}),[yp,n,Ep,o,Cp]);return(0,a.createElement)(p.TabPanel,{className:"block-editor-inserter__tabs",tabs:l,onSelect:r},t)};var Sp=(0,a.forwardRef)((function(e,t){let{rootClientId:n,clientId:o,isAppender:r,__experimentalInsertionIndex:l,onSelect:i,showInserterHelpPanel:s,showMostUsedBlocks:c,__experimentalFilterValue:u="",shouldFocusBlock:d=!0}=e;const[f,h]=(0,a.useState)(u),[v,b]=(0,a.useState)(null),[k,_]=(0,a.useState)(null),[y,E,C]=qd({rootClientId:n,clientId:o,isAppender:r,insertionIndex:l,shouldFocusBlock:d}),{showPatterns:w,hasReusableBlocks:S}=(0,m.useSelect)((e=>{var t;const{__experimentalGetAllowedPatterns:n,getSettings:o}=e(qn);return{showPatterns:!!n(y).length,hasReusableBlocks:!(null===(t=o().__experimentalReusableBlocks)||void 0===t||!t.length)}}),[y]),B=(0,a.useCallback)(((e,t,n)=>{E(e,t,n),i()}),[E,i]),I=(0,a.useCallback)(((e,t)=>{E(e,{patternName:t}),i()}),[E,i]),x=(0,a.useCallback)((e=>{C(!!e),b(e)}),[C,b]),T=(0,a.useCallback)((e=>{_(e)}),[_]),N=(0,a.useMemo)((()=>(0,a.createElement)(a.Fragment,null,(0,a.createElement)("div",{className:"block-editor-inserter__block-list"},(0,a.createElement)(Od,{rootClientId:y,onInsert:B,onHover:x,showMostUsedBlocks:c})),s&&(0,a.createElement)("div",{className:"block-editor-inserter__tips"},(0,a.createElement)(p.VisuallyHidden,{as:"h2"},(0,g.__)("A tip for using the block editor")),(0,a.createElement)(Gc,null)))),[y,B,x,f,c,s]),P=(0,a.useMemo)((()=>(0,a.createElement)(pp,{rootClientId:y,onInsert:I,onClickCategory:T,selectedCategory:k})),[y,I,T,k]),M=(0,a.useMemo)((()=>(0,a.createElement)(gp,{rootClientId:y,onInsert:B,onHover:x})),[y,B,x]),R=(0,a.useCallback)((e=>"blocks"===e.name?N:"patterns"===e.name?P:M),[N,P,M]),L=(0,a.useRef)();return(0,a.useImperativeHandle)(t,(()=>({focusSearch:()=>{L.current.focus()}}))),(0,a.createElement)("div",{className:"block-editor-inserter__menu"},(0,a.createElement)("div",{className:"block-editor-inserter__main-area"},(0,a.createElement)("div",{className:"block-editor-inserter__content"},(0,a.createElement)(p.SearchControl,{className:"block-editor-inserter__search",onChange:e=>{v&&b(null),h(e)},value:f,label:(0,g.__)("Search for blocks and patterns"),placeholder:(0,g.__)("Search"),ref:L}),!!f&&(0,a.createElement)(_p,{filterValue:f,onSelect:i,onHover:x,rootClientId:n,clientId:o,isAppender:r,__experimentalInsertionIndex:l,showBlockDirectory:!0,shouldFocusBlock:d}),!f&&(w||S)&&(0,a.createElement)(wp,{showPatterns:w,showReusableBlocks:S},R),!f&&!w&&!S&&N)),s&&v&&(0,a.createElement)(Ed,{item:v}))}));function Bp(e){let{onSelect:t,rootClientId:n,clientId:o,isAppender:r,prioritizePatterns:l}=e;const[i,s]=(0,a.useState)(""),[u,d]=qd({onSelect:t,rootClientId:n,clientId:o,isAppender:r}),[f]=Ld(u,d),[h]=Vd(d,u),{setInserterIsOpened:v,insertionIndex:b}=(0,m.useSelect)((e=>{const{getSettings:t,getBlockIndex:n,getBlockCount:r}=e(qn),l=t(),i=n(o),a=r();return{setInserterIsOpened:l.__experimentalSetIsInserterOpened,insertionIndex:-1===i?a:i}}),[o]),k=h.length&&(!!i||l),_=k&&h.length>6||f.length>6;(0,a.useEffect)((()=>{v&&v(!1)}),[v]);let y=0;return k&&(y=l?4:2),(0,a.createElement)("div",{className:c()("block-editor-inserter__quick-inserter",{"has-search":_,"has-expand":v})},_&&(0,a.createElement)(p.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)(_p,{filterValue:i,onSelect:t,rootClientId:n,clientId:o,isAppender:r,maxBlockPatterns:y,maxBlockTypes:6,isDraggable:!1,prioritizePatterns:l})),v&&(0,a.createElement)(p.Button,{className:"block-editor-inserter__quick-inserter-expand",onClick:()=>{v({rootClientId:n,insertionIndex:b,filterValue:i})},"aria-label":(0,g.__)("Browse all. This will open the main inserter panel in the editor toolbar.")},(0,g.__)("Browse all")))}const Ip=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,...m}=c;return(0,a.createElement)(p.Button,i({icon:Vc,label:t,tooltipPosition:"bottom",onClick:function(e){n&&n(e),d&&d(e)},className:"block-editor-inserter__toggle","aria-haspopup":!s&&"true","aria-expanded":!s&&r,disabled:o},m))};class xp 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=Ip,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)(Bp,{onSelect:()=>{t()},rootClientId:n,clientId:o,isAppender:r,prioritizePatterns:s}):(0,a.createElement)(Sp,{onSelect:()=>{t()},rootClientId:n,clientId:o,isAppender:r,showInserterHelpPanel:l})}render(){const{position:e,hasSingleBlockType:t,directInsertBlock:n,insertOnlyAllowedBlock:o,__experimentalIsQuick:r,onSelectOrClose:l}=this.props;return t||n?this.renderToggle({onToggle:o}):(0,a.createElement)(p.Dropdown,{className:"block-editor-inserter",contentClassName:c()("block-editor-inserter__popover",{"is-quick":r}),position:e,onToggle:this.onToggle,expandOnMobile:!0,headerTitle:(0,g.__)("Add a block"),renderToggle:this.renderToggle,renderContent:this.renderContent,onClose:l})}}var Tp=(0,d.compose)([(0,m.withSelect)(((e,t)=>{let{clientId:n,rootClientId:o}=t;const{getBlockRootClientId:l,hasInserterItems:i,__experimentalGetAllowedBlocks:a,__experimentalGetDirectInsertBlock:s,getBlockIndex:c,getBlockCount:d,getSettings:p}=e(qn),{getBlockVariations:m}=e(r.store);o=o||l(n)||void 0;const f=a(o),g=s(o),h=c(n),v=d(),b=p(),k=1===(0,u.size)(f)&&0===(0,u.size)(m(f[0].name,"inserter"));let _=!1;return k&&(_=f[0]),{hasItems:i(o),hasSingleBlockType:k,blockTitle:_?_.title:"",allowedBlockType:_,directInsertBlock:g,rootClientId:o,prioritizePatterns:b.__experimentalPreferPatternsOnRoot&&!o&&h>0&&(h{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(qn);let p;if(c){const e=function(e){const{getBlock:t,getPreviousBlockClientId:r}=o(qn);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(qn);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,Ft.speak)(m)}}})),(0,d.ifCondition)((e=>{let{hasItems:t,isAppender:n,rootClientId:o,clientId:r}=e;return t||!n&&!o&&!r}))])(xp);var Np=(0,d.compose)((0,m.withSelect)(((e,t)=>{const{getBlockCount:n,getSettings:o,getTemplateLock:r}=e(qn),l=!n(t.rootClientId),{bodyPlaceholder:i}=o();return{showPrompt:l,isLocked:!!r(t.rootClientId),placeholder:i}})),(0,m.withDispatch)(((e,t)=>{const{insertDefaultBlock:n,startTyping:o}=e(qn);return{onAppend(){const{rootClientId:e}=t;n(void 0,e),o()}}})))((function(e){let{isLocked:t,onAppend:n,showPrompt:o,placeholder:r,rootClientId:l}=e;if(t)return null;const i=(0,zc.decodeEntities)(r)||(0,g.__)("Type / to choose a block");return(0,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=>{Tc.ENTER!==e.keyCode&&Tc.SPACE!==e.keyCode||n()},onClick:()=>n(),onFocus:()=>{o&&n()}},o?i:"\ufeff"),(0,a.createElement)(Tp,{rootClientId:l,position:"bottom right",isAppender:!0,__experimentalIsQuick:!0}))}));function Pp(e,t){let{rootClientId:n,className:o,onFocus:r,tabIndex:l}=e;return(0,a.createElement)(Tp,{position:"bottom center",rootClientId:n,__experimentalIsQuick:!0,renderToggle:e=>{let n,{onToggle:i,disabled:s,isOpen:u,blockTitle:d,hasSingleBlockType:m}=e;n=m?(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=!m;let h=(0,a.createElement)(p.Button,{ref:t,onFocus:r,tabIndex:l,className:c()(o,"block-editor-button-block-appender"),onClick:i,"aria-haspopup":f?"true":void 0,"aria-expanded":f?u:void 0,disabled:s,label:n},!m&&(0,a.createElement)(p.VisuallyHidden,{as:"span"},n),(0,a.createElement)(wr,{icon:Vc}));return(f||m)&&(h=(0,a.createElement)(p.Tooltip,{text:n},h)),h},isAppender:!0})}const Mp=(0,a.forwardRef)(((e,t)=>(Vt()("wp.blockEditor.ButtonBlockerAppender",{alternative:"wp.blockEditor.ButtonBlockAppender",since:"5.9"}),Pp(e,t))));var Rp=(0,a.forwardRef)(Pp);var Lp=(0,m.withSelect)(((e,t)=>{let{rootClientId:n}=t;const{canInsertBlockType:o,getTemplateLock:l,getSelectedBlockClientId:i}=e(qn);return{isLocked:!!l(n),canInsertDefaultBlock:o((0,r.getDefaultBlockName)(),n),selectedBlockClientId:i()}}))((function(e){let t,{rootClientId:n,canInsertDefaultBlock:o,isLocked:r,renderAppender:l,className:i,selectedBlockClientId:s,tagName:u="div"}=e;if(r||!1===l)return null;if(l)t=(0,a.createElement)(l,null);else{if(!(s===n||!n&&!s))return null;t=o?(0,a.createElement)(Np,{rootClientId:n}):(0,a.createElement)(Rp,{rootClientId:n,className:"block-list-appender__toggle"})}return(0,a.createElement)(u,{tabIndex:-1,className:c()("block-list-appender wp-block",i),contentEditable:!1,"data-block":!0},t)}));function Ap(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 Dp=(0,a.createContext)();function Op(e){let{__unstablePopoverSlot:t,__unstableContentRef:n}=e;const{selectBlock:o,hideInsertionPoint:r}=(0,m.useDispatch)(qn),l=(0,a.useContext)(Dp),i=(0,a.useRef)(),{orientation:s,previousClientId:u,nextClientId:f,rootClientId:h,isInserterShown:v}=(0,m.useSelect)((e=>{var t;const{getBlockOrder:n,getBlockListSettings:o,getBlockInsertionPoint:r,isBlockBeingDragged:l,getPreviousBlockClientId:i,getNextBlockClientId:a}=e(qn),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}}),[]),b=Co(u),k=Co(f),_="vertical"===s,y=(0,a.useMemo)((()=>{if(!b&&!k)return{};const e=b?b.getBoundingClientRect():null,t=k?k.getBoundingClientRect():null;if(_)return{width:b?b.offsetWidth:k.offsetWidth,height:t&&e?t.top-e.bottom:0};let n=0;return e&&t&&(n=(0,g.isRTL)()?e.left-t.right:t.left-e.right),{width:n,height:b?b.offsetHeight:k.offsetHeight}}),[b,k]),E=(0,a.useCallback)((()=>{if(!b&&!k)return{};const{ownerDocument:e}=b||k,t=b?b.getBoundingClientRect():null,n=k?k.getBoundingClientRect():null;return _?(0,g.isRTL)()?{top:t?t.bottom:n.top,left:t?t.right:n.right,right:t?t.left:n.left,bottom:n?n.top:t.bottom,ownerDocument:e}:{top:t?t.bottom:n.top,left:t?t.left:n.left,right:t?t.right:n.right,bottom:n?n.top:t.bottom,ownerDocument:e}:(0,g.isRTL)()?{top:t?t.top:n.top,left:t?t.left:n.right,right:n?n.right:t.left,bottom:t?t.bottom:n.bottom,ownerDocument:e}:{top:t?t.top:n.top,left:t?t.right:n.left,right:n?n.left:t.right,bottom:t?t.bottom:n.bottom,ownerDocument:e}}),[b,k]),C=Ap(n),w=(0,d.useReducedMotion)(),S=c()("block-editor-block-list__insertion-point","is-"+s);const B=b&&k&&v,I={start:{..._?{height:0,left:"50%",right:"50%",y:0}:{width:0,top:"50%",bottom:"50%",x:0},opacity:0},rest:{..._?{height:4,left:0,right:0,y:-2}:{width:4,top:0,bottom:0,x:-2},opacity:1,borderRadius:"2px",transition:{delay:B?.4:0}},hover:{..._?{height:4,left:0,right:0,y:-2}:{width:4,top:0,bottom:0,x:-2},opacity:1,borderRadius:"2px",transition:{delay:.4}}},x={start:{scale:w?1:0},rest:{scale:1,transition:{delay:.2}}};return(0,a.createElement)(p.Popover,{ref:C,noArrow:!0,animate:!1,getAnchorRect:E,focusOnMount:!1,className:"block-editor-block-list__insertion-point-popover",__unstableSlotName:t||null,key:f+"--"+h},(0,a.createElement)(p.__unstableMotion.div,{layout:!w,initial:w?"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()(S,{"is-with-inserter":B}),onHoverEnd:function(e){e.target!==i.current||l.current||r()},style:y},(0,a.createElement)(p.__unstableMotion.div,{variants:I,className:"block-editor-block-list__insertion-point-indicator"}),B&&(0,a.createElement)(p.__unstableMotion.div,{variants:x,className:c()("block-editor-block-list__insertion-point-inserter")},(0,a.createElement)(Tp,{position:"bottom center",clientId:f,rootClientId:h,__experimentalIsQuick:!0,onToggle:e=>{l.current=e},onSelectOrClose:()=>{l.current=!1}}))))}function Fp(e){let{children:t,__unstablePopoverSlot:n,__unstableContentRef:o}=e;const r=(0,m.useSelect)((e=>e(qn).isBlockInsertionPointVisible()),[]);return(0,a.createElement)(Dp.Provider,{value:(0,a.useRef)(!1)},r&&(0,a.createElement)(Op,{__unstablePopoverSlot:n,__unstableContentRef:o}),t)}function zp(){const e=(0,a.useContext)(Dp),t=(0,m.useSelect)((e=>e(qn).getSettings().hasReducedUI),[]),{getBlockListSettings:n,getBlockRootClientId:o,getBlockIndex:r,isBlockInsertionPointVisible:l,isMultiSelecting:i,getSelectedBlockClientIds:s,getTemplateLock:c}=(0,m.useSelect)(qn),{showInsertionPoint:u,hideInsertionPoint:p}=(0,m.useDispatch)(qn);return(0,d.useRefEffect)((o=>{if(!t)return o.addEventListener("mousemove",a),()=>{o.removeEventListener("mousemove",a)};function a(t){var o,a;if(e.current)return;if(i())return;if(!t.target.classList.contains("block-editor-block-list__layout"))return void(l()&&p());let d;if(!t.target.classList.contains("is-root-container")){d=(t.target.getAttribute("data-block")?t.target:t.target.closest("[data-block]")).getAttribute("data-block")}if(c(d))return;const m=(null===(o=n(d))||void 0===o?void 0:o.orientation)||"vertical",f=t.target.getBoundingClientRect(),g=t.clientY-f.top,h=t.clientX-f.left;let v=Array.from(t.target.children).find((e=>e.classList.contains("wp-block")&&"vertical"===m&&e.offsetTop>g||e.classList.contains("wp-block")&&"horizontal"===m&&e.offsetLeft>h));if(!v)return;if(!v.id&&(v=v.firstElementChild,!v))return;if(null===(a=v.parentElement)||void 0===a?void 0:a.closest(".block-editor-block-content-overlay.overlay-active"))return;const b=v.id.slice("block-".length);if(!b)return;if(s().includes(b))return;const k=v.getBoundingClientRect();if("horizontal"===m&&(t.clientY>k.bottom||t.clientYk.right||t.clientX{setTimeout((()=>e(Date.now())),0)}:window.requestIdleCallback||window.requestAnimationFrame,Hp="undefined"==typeof window?clearTimeout:window.cancelIdleCallback||window.cancelAnimationFrame;function Gp(e){return(0,m.useSelect)((t=>{if(!e)return null;const{getBlockName:n,getBlockAttributes:o}=t(qn),{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}:d}),[e])}function Up(e,t){const{attributes:n,name:o,reusableBlockTitle:l}=(0,m.useSelect)((t=>{if(!e)return{};const{getBlockName:n,getBlockAttributes:o,__experimentalGetReusableBlockTitle:l}=t(qn),i=n(e);if(!i)return{};const a=(0,r.isReusableBlock)((0,r.getBlockType)(i));return{attributes:o(e),name:i,reusableBlockTitle:a&&l(o(e).ref)}}),[e]),i=Gp(e);if(!o||!i)return null;const a=(0,r.getBlockType)(o),s=a?(0,r.__experimentalGetBlockLabel)(a,n):null,c=l||s,d=c&&c!==a.title?c:i.title;return t&&t>0?(0,u.truncate)(d,{length:t}):d}function Wp(e){let{clientId:t,maximumLength:n}=e;return Up(t,n)}var $p=e=>{let{children:t,clientIds:n,cloneClassname:o,onDragStart:l,onDragEnd:i}=e;const{srcRootClientId:s,isDraggable:c,icon:u}=(0,m.useSelect)((e=>{var t;const{canMoveBlocks:o,getBlockRootClientId:l,getBlockName:i}=e(qn),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,Jr.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{e.current=null,n.current=null,o.current&&(clearInterval(o.current),o.current=null)}]}(),{startDraggingBlocks:v,stopDraggingBlocks:b}=(0,m.useDispatch)(qn);if((0,a.useEffect)((()=>()=>{d.current&&b()}),[]),!c)return t({isDraggable:!1});const k={type:"block",srcClientIds:n,srcRootClientId:s};return(0,a.createElement)(p.Draggable,{cloneClassname:o,__experimentalTransferDataType:"wp-blocks",transferData:k,onDragStart:e=>{v(n),d.current=!0,f(e),l&&l()},onDragOver:g,onDragEnd:()=>{b(),d.current=!1,h(),i&&i()},__experimentalDragComponent:(0,a.createElement)(Bd,{count:n.length,icon:u})},(e=>{let{onDraggableStart:n,onDraggableEnd:o}=e;return t({draggable:!0,onDragStart:n,onDragEnd:o})}))};var jp=function(e){let{clientId:t,rootClientId:n,blockElement:o}=e;const l=Gp(t),s=(0,m.useSelect)((e=>{var o;const{getBlock:r,getBlockIndex:l,hasBlockMovingClientId:i,getBlockListSettings:a}=e(qn),s=l(t),{name:c,attributes:u}=r(t);return{index:s,name:c,attributes:u,blockMovingMode:i(),orientation:null===(o=a(n))||void 0===o?void 0:o.orientation}}),[t,n]),{index:u,name:d,attributes:f,blockMovingMode:h,orientation:v}=s,{setNavigationMode:b,removeBlock:k}=(0,m.useDispatch)(qn),_=(0,a.useRef)(),y=(0,r.getBlockType)(d),E=(0,r.__experimentalGetAccessibleBlockLabel)(y,f,u+1,v);(0,a.useEffect)((()=>{_.current.focus(),(0,Ft.speak)(E)}),[E]);const{hasBlockMovingClientId:C,getBlockIndex:w,getBlockRootClientId:S,getClientIdsOfDescendants:B,getSelectedBlockClientId:I,getMultiSelectedBlocksEndClientId:x,getPreviousBlockClientId:T,getNextBlockClientId:N,isNavigationMode:P}=(0,m.useSelect)(qn),{selectBlock:M,clearSelectedBlock:R,setBlockMovingClientId:L,moveBlockToPosition:A}=(0,m.useDispatch)(qn),D=c()("block-editor-block-list__block-selection-button",{"is-block-moving-mode":!!h}),O=(0,g.__)("Drag");return(0,a.createElement)("div",{className:D},(0,a.createElement)(p.Flex,{justify:"center",className:"block-editor-block-list__block-selection-button__content"},(0,a.createElement)(p.FlexItem,null,(0,a.createElement)(Wc,{icon:null==l?void 0:l.icon,showColors:!0})),(0,a.createElement)(p.FlexItem,null,(0,a.createElement)($p,{clientIds:[t]},(e=>(0,a.createElement)(p.Button,i({icon:Sd,className:"block-selection-button_drag-handle","aria-hidden":"true",label:O,tabIndex:"-1"},e))))),(0,a.createElement)(p.FlexItem,null,(0,a.createElement)(p.Button,{ref:_,onClick:()=>b(!1),onKeyDown:function(e){const{keyCode:n}=e,r=n===Tc.UP,l=n===Tc.DOWN,i=n===Tc.LEFT,a=n===Tc.RIGHT,s=n===Tc.TAB,c=n===Tc.ESCAPE,u=n===Tc.ENTER,d=n===Tc.SPACE,p=e.shiftKey;if(n===Tc.BACKSPACE||n===Tc.DELETE)return k(t),void e.preventDefault();const m=I(),f=x(),g=T(f||m),h=N(f||m),v=s&&p||r,b=s&&!p||l,_=i,y=a;let E;if(v)E=g;else if(b)E=h;else if(_){var D;E=null!==(D=S(m))&&void 0!==D?D:m}else if(y){var O;E=null!==(O=B([m])[0])&&void 0!==O?O:m}const F=C();if(c&&P()&&(R(),e.preventDefault()),c&&F&&!e.defaultPrevented&&(L(null),e.preventDefault()),(u||d)&&F){const e=S(F),t=S(m),n=w(F);let o=w(m);n{!function(e){const[t]=Jr.focus.tabbable.find(e);t&&t.focus()}(e.current)}),[]);(0,tu.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=Kp(e.current),n=i||0;var o;t[n]&&(o=e.current).contains(o.ownerDocument.activeElement)&&t[n].focus()}))),()=>{if(window.cancelAnimationFrame(t),!r||!e.current)return;const n=Kp(e.current).findIndex((e=>0===e.tabIndex));r(n)}}),[i,l])}var Yp=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=!Jr.focus.tabbable.find(e.current).some((e=>!("toolbarItem"in e.dataset)));t||Vt()("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 qp(s,n,c,o,r),c?(0,a.createElement)(p.Toolbar,i({label:l["aria-label"],ref:s},l),t):(0,a.createElement)(p.NavigableMenu,i({orientation:"horizontal",role:"toolbar",ref:s},l),t)};var Qp=(0,a.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(O.Path,{d:"M10.6 6L9.4 7l4.6 5-4.6 5 1.2 1 5.4-6z"}));var Xp=(0,a.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(O.Path,{d:"M14.6 7l-1.2-1L8 12l5.4 6 1.2-1-4.6-5z"}));var Zp=(0,a.createElement)(O.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,a.createElement)(O.Path,{d:"M6.5 12.4L12 8l5.5 4.4-.9 1.2L12 10l-4.5 3.6-1-1.2z"}));var Jp=(0,a.createElement)(O.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,a.createElement)(O.Path,{d:"M17.5 11.6L12 16l-5.5-4.4.9-1.2L12 14l4.5-3.6 1 1.2z"}));function em(e,t,n,o,r,l,i){const a=n+1,s=e=>"up"===e?"horizontal"===i?(0,g.isRTL)()?"right":"left":"up":"down"===e?"horizontal"===i?(0,g.isRTL)()?"left":"right":"down":null;if(e>1)return function(e,t,n,o,r){const l=t+1;if(r<0&&n)return(0,g.__)("Blocks cannot be moved up as they are already at the top");if(r>0&&o)return(0,g.__)("Blocks cannot be moved down as they are already at the bottom");if(r<0&&!n)return(0,g.sprintf)((0,g._n)("Move %1$d block from position %2$d up by one place","Move %1$d blocks from position %2$d up by one place",e),e,l);if(r>0&&!o)return(0,g.sprintf)((0,g._n)("Move %1$d block from position %2$d down by one place","Move %1$d blocks from position %2$d down by one place",e),e,l)}(e,n,o,r,l);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=s("down");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=s("down");if("down"===e)return(0,g.sprintf)((0,g.__)("Block %1$s is at the end of the content and can’t be moved down"),t);if("left"===e)return(0,g.sprintf)((0,g.__)("Block %1$s is at the end of the content and can’t be moved left"),t);if("right"===e)return(0,g.sprintf)((0,g.__)("Block %1$s is at the end of the content and can’t be moved right"),t)}if(l<0&&!o){const e=s("up");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=s("up");if("up"===e)return(0,g.sprintf)((0,g.__)("Block %1$s is at the beginning of the content and can’t be moved up"),t);if("left"===e)return(0,g.sprintf)((0,g.__)("Block %1$s is at the beginning of the content and can’t be moved left"),t);if("right"===e)return(0,g.sprintf)((0,g.__)("Block %1$s is at the beginning of the content and can’t be moved right"),t)}}const tm=(e,t)=>"up"===e?"horizontal"===t?(0,g.isRTL)()?Qp:Xp:Zp:"down"===e?"horizontal"===t?(0,g.isRTL)()?Xp:Qp:Jp:null,nm=(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,om=(0,a.forwardRef)(((e,t)=>{let{clientIds:n,direction:o,orientation:l,...s}=e;const f=(0,d.useInstanceId)(om),g=(0,u.castArray)(n).length,{blockType:h,isDisabled:v,rootClientId:b,isFirst:k,isLast:_,firstIndex:y,orientation:E="vertical"}=(0,m.useSelect)((e=>{const{getBlockIndex:t,getBlockRootClientId:i,getBlockOrder:a,getBlock:s,getBlockListSettings:c}=e(qn),d=(0,u.castArray)(n),p=(0,u.first)(d),m=i(p),f=t(p),g=t((0,u.last)(d)),h=a(m),v=s(p),b=0===f,k=g===h.length-1,{orientation:_}=c(m)||{};return{blockType:v?(0,r.getBlockType)(v.name):null,isDisabled:"up"===o?b:k,rootClientId:m,firstIndex:f,isFirst:b,isLast:k,orientation:l||_}}),[n,o]),{moveBlocksDown:C,moveBlocksUp:w}=(0,m.useDispatch)(qn),S="up"===o?w:C,B=`block-editor-block-mover-button__description-${f}`;return(0,a.createElement)(a.Fragment,null,(0,a.createElement)(p.Button,i({ref:t,className:c()("block-editor-block-mover-button",`is-${o}-button`),icon:tm(o,E),label:nm(o,E),"aria-describedby":B},s,{onClick:v?null:e=>{S(n,b),s.onClick&&s.onClick(e)},"aria-disabled":v})),(0,a.createElement)("span",{id:B,className:"block-editor-block-mover-button__description"},em(g,h&&h.title,y,k,_,"up"===o?-1:1,E)))})),rm=(0,a.forwardRef)(((e,t)=>(0,a.createElement)(om,i({direction:"up",ref:t},e)))),lm=(0,a.forwardRef)(((e,t)=>(0,a.createElement)(om,i({direction:"down",ref:t},e))));var im=(0,m.withSelect)(((e,t)=>{var n;let{clientIds:o}=t;const{getBlock:l,getBlockIndex:i,getBlockListSettings:a,canMoveBlocks:s,getBlockOrder:c,getBlockRootClientId:d}=e(qn),p=(0,u.castArray)(o),m=(0,u.first)(p),f=l(m),g=d((0,u.first)(p)),h=i(m),v=0===h,b=i((0,u.last)(p))===c(g).length-1;return{blockType:f?(0,r.getBlockType)(f.name):null,canMove:s(o,g),rootClientId:g,firstIndex:h,isFirst:v,isLast:b,orientation:null===(n=a(g))||void 0===n?void 0:n.orientation}}))((function(e){let{isFirst:t,isLast:n,clientIds:o,canMove:r,isHidden:l,rootClientId:s,orientation:u,hideDragHandle:d}=e;const[m,f]=(0,a.useState)(!1),h=()=>f(!0),v=()=>f(!1);if(!r||t&&n&&!s)return null;const b=(0,g.__)("Drag");return(0,a.createElement)("div",{className:c()("block-editor-block-mover",{"is-visible":m||!l,"is-horizontal":"horizontal"===u})},!d&&(0,a.createElement)($p,{clientIds:o,cloneClassname:"block-editor-block-mover__drag-clone"},(e=>(0,a.createElement)(p.Button,i({icon:Sd,className:"block-editor-block-mover__drag-handle","aria-hidden":"true",label:b,tabIndex:"-1"},e)))),(0,a.createElement)(p.ToolbarGroup,{className:"block-editor-block-mover__move-button-container"},(0,a.createElement)(p.ToolbarItem,{onFocus:h,onBlur:v},(e=>(0,a.createElement)(rm,i({clientIds:o},e)))),(0,a.createElement)(p.ToolbarItem,{onFocus:h,onBlur:v},(e=>(0,a.createElement)(lm,i({clientIds:o},e))))))}));const{clearTimeout:am,setTimeout:sm}=window,cm=200;function um(e){let{ref:t,isFocused:n,debounceTimeout:o=cm,onChange:r=u.noop}=e;const[l,i]=(0,a.useState)(!1),s=(0,a.useRef)(),c=e=>{null!=t&&t.current&&i(e),r(e)},d=()=>{const e=(null==t?void 0:t.current)&&t.current.matches(":hover");return!n&&!e},p=()=>{const e=s.current;e&&am&&am(e)};return(0,a.useEffect)((()=>()=>{c(!1),p()}),[]),{showMovers:l,debouncedShowMovers:e=>{e&&e.stopPropagation(),p(),l||c(!0)},debouncedHideMovers:e=>{e&&e.stopPropagation(),p(),s.current=sm((()=>{d()&&c(!1)}),o)}}}function dm(e){let{ref:t,debounceTimeout:n=cm,onChange:o=u.noop}=e;const[r,l]=(0,a.useState)(!1),{showMovers:i,debouncedShowMovers:s,debouncedHideMovers:c}=um({ref:t,debounceTimeout:n,isFocused:r,onChange:o}),d=(0,a.useRef)(!1),p=()=>(null==t?void 0:t.current)&&t.current.contains(t.current.ownerDocument.activeElement);return(0,a.useEffect)((()=>{const e=t.current,n=()=>{p()&&(l(!0),s())},o=()=>{p()||(l(!1),c())};return e&&!d.current&&(e.addEventListener("focus",n,!0),e.addEventListener("blur",o,!0),d.current=!0),()=>{e&&(e.removeEventListener("focus",n),e.removeEventListener("blur",o))}}),[t,d,l,s,c]),{showMovers:i,gestures:{onMouseMove:s,onMouseLeave:c}}}function pm(){const{selectBlock:e,toggleBlockHighlight:t}=(0,m.useDispatch)(qn),{firstParentClientId:n,shouldHide:o,hasReducedUI:l}=(0,m.useSelect)((e=>{const{getBlockName:t,getBlockParents:n,getSelectedBlockClientId:o,getSettings:l}=e(qn),{hasBlockSupport:i}=e(r.store),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=Gp(n),c=(0,a.useRef)(),{gestures:u}=dm({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)(p.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)(Wc,{icon:s.icon})}))}var mm=(0,a.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(O.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 fm(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)(p.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)(_d,{viewportWidth:500,blocks:t})))))}var gm=e=>{let{className:t,possibleBlockTransformations:n,onSelect:o,blocks:l}=e;const[i,s]=(0,a.useState)();return(0,a.createElement)(p.MenuGroup,{label:(0,g.__)("Transform to"),className:t},i&&(0,a.createElement)(fm,{blocks:(0,r.switchToBlockType)(l,i)}),n.map((e=>{const{name:t,icon:n,title:l,isDisabled:i}=e;return(0,a.createElement)(p.MenuItem,{key:t,className:(0,r.getBlockMenuDefaultClassName)(t),onClick:e=>{e.preventDefault(),o(t)},disabled:i,onMouseLeave:()=>s(null),onMouseEnter:()=>s(t)},(0,a.createElement)(Wc,{icon:n,showColors:!0}),l)})))};var hm=(0,a.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(O.Path,{d:"M16.7 7.1l-6.3 8.5-3.3-2.5-.9 1.2 4.5 3.4L17.9 8z"})),vm=window.wp.tokenList,bm=n.n(vm);function km(e,t,n){const o=new(bm())(e);return t&&o.remove("is-style-"+t.name),o.add("is-style-"+n.name),o.value}function _m(e){return(0,u.find)(e,"isDefault")}function ym(e){let{clientId:t,onSwitch:n}=e;const{styles:o,block:l,blockType:i,className:s}=(0,m.useSelect)((e=>{const{getBlock:n}=e(qn),o=n(t);if(!o)return{};const l=(0,r.getBlockType)(o.name),{getBlockStyles:i}=e(r.store);return{block:o,blockType:l,styles:i(o.name),className:o.attributes.className||""}}),[t]),{updateBlockAttributes:c}=(0,m.useDispatch)(qn),d=function(e){return e&&0!==e.length?_m(e)?e:[{name:"default",label:(0,g._x)("Default","block style"),isDefault:!0},...e]:[]}(o),p=function(e,t){for(const n of new(bm())(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=km(s,p,e);c(t,{className:o}),n()},stylesToRender:d,activeStyle:p,genericPreviewBlock:f,className:s}}function Em(e){let{clientId:t,onSwitch:n=u.noop}=e;const{onSelect:o,stylesToRender:r,activeStyle:l}=ym({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)(p.MenuItem,{key:e.name,icon:l.name===e.name?hm:null,onClick:()=>o(e)},(0,a.createElement)(p.__experimentalText,{as:"span",limit:18,ellipsizeMode:"tail",truncate:!0},t))}))):null}function Cm(e){let{hoveredBlock:t,onSwitch:n}=e;const{clientId:o}=t;return(0,a.createElement)(p.MenuGroup,{label:(0,g.__)("Styles"),className:"block-editor-block-switcher__styles__menugroup"},(0,a.createElement)(Em,{clientId:o,onSwitch:n}))}const wm=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=wm(e,t,n);if(o)return o}}},Sm=(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 Bm=(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=wm(r,t.name,o);if(n){e=!0,o.add(n.clientId),Sm(n,t);break}}if(!e)return}return n})(t,n.blocks);return o&&e.push({...n,transformedBlocks:o}),e}),[])),[e,t]);function Im(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)(p.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)(xm,{patterns:t,onSelect:n})))))}function xm(e){let{patterns:t,onSelect:n}=e;const o=(0,p.__unstableUseCompositeState)();return(0,a.createElement)(p.__unstableComposite,i({},o,{role:"listbox",className:"block-editor-block-switcher__preview-patterns-container","aria-label":(0,g.__)("Patterns list")}),t.map((e=>(0,a.createElement)(Tm,{key:e.name,pattern:e,onSelect:n,composite:o}))))}function Tm(e){let{pattern:t,onSelect:n,composite:o}=e;const r="block-editor-block-switcher__preview-patterns-container",l=(0,d.useInstanceId)(Tm,`${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)(p.__unstableCompositeItem,i({role:"option",as:"div"},o,{className:`${r}-list__item`,onClick:()=>n(t.transformedBlocks)}),(0,a.createElement)(_d,{blocks:t.transformedBlocks,viewportWidth:t.viewportWidth||500}),(0,a.createElement)("div",{className:`${r}-list__item-title`},t.title)),!!t.description&&(0,a.createElement)(p.VisuallyHidden,{id:l},t.description))}var Nm=function(e){let{blocks:t,patterns:n,onSelect:o}=e;const[r,l]=(0,a.useState)(!1),i=Bm(n,t);return i.length?(0,a.createElement)(p.MenuGroup,{className:"block-editor-block-switcher__pattern__transforms__menugroup"},r&&(0,a.createElement)(Im,{patterns:i,onSelect:o}),(0,a.createElement)(p.MenuItem,{onClick:e=>{e.preventDefault(),l(!r)},icon:Qp},(0,g.__)("Patterns"))):null};const Pm=e=>{let{clientIds:t,blocks:n}=e;const{replaceBlocks:o}=(0,m.useDispatch)(qn),l=Gp(n[0].clientId),{possibleBlockTransformations:i,canRemove:s,hasBlockStyles:c,icon:d,blockTitle:f,patterns:h}=(0,m.useSelect)((e=>{var o;const{getBlockRootClientId:i,getBlockTransformItems:a,__experimentalGetPatternTransformItems:s}=e(qn),{getBlockStyles:c,getBlockType:d}=e(r.store),{canRemoveBlocks:p}=e(qn),m=i((0,u.castArray)(t)[0]),[{name:f}]=n,g=1===n.length,h=g&&c(f);let v;if(g)v=null==l?void 0:l.icon;else{var b;v=1===(0,u.uniq)(n.map((e=>{let{name:t}=e;return t}))).length?null===(b=d(f))||void 0===b?void 0:b.icon:mm}return{possibleBlockTransformations:a(n,m),canRemove:p(t,m),hasBlockStyles:!(null==h||!h.length),icon:v,blockTitle:null===(o=d(f))||void 0===o?void 0:o.title,patterns:s(n,m)}}),[t,n,null==l?void 0:l.icon]),v=1===n.length&&(0,r.isReusableBlock)(n[0]),b=1===n.length&&(0,r.isTemplatePart)(n[0]),k=!!i.length&&s,_=!(null==h||!h.length)&&s;if(!c&&!k)return(0,a.createElement)(p.ToolbarGroup,null,(0,a.createElement)(p.ToolbarButton,{disabled:!0,className:"block-editor-block-switcher__no-switcher-icon",title:f,icon:(0,a.createElement)(a.Fragment,null,(0,a.createElement)(Wc,{icon:d,showColors:!0}),(v||b)&&(0,a.createElement)("span",{className:"block-editor-block-switcher__toggle-text"},(0,a.createElement)(Wp,{clientId:t,maximumLength:35})))}));const y=f,E=1===n.length?(0,g.sprintf)((0,g.__)("%s: Change block type or style"),f):(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)(p.ToolbarGroup,null,(0,a.createElement)(p.ToolbarItem,null,(e=>(0,a.createElement)(p.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)(Wc,{icon:d,className:"block-editor-block-switcher__toggle",showColors:!0}),(v||b)&&(0,a.createElement)("span",{className:"block-editor-block-switcher__toggle-text"},(0,a.createElement)(Wp,{clientId:t,maximumLength:35}))),toggleProps:{describedBy:E,...e},menuProps:{orientation:"both"}},(e=>{let{onClose:l}=e;return C&&(0,a.createElement)("div",{className:"block-editor-block-switcher__container"},_&&(0,a.createElement)(Nm,{blocks:n,patterns:h,onSelect:e=>{(e=>{o(t,e)})(e),l()}}),k&&(0,a.createElement)(gm,{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)(Cm,{hoveredBlock:n[0],onSwitch:l}))})))))};var Mm=e=>{let{clientIds:t}=e;const n=(0,m.useSelect)((e=>e(qn).getBlocksByClientId(t)),[t]);return!n.length||n.some((e=>!e))?null:(0,a.createElement)(Pm,{clientIds:t,blocks:n})};const{Fill:Rm,Slot:Lm}=(0,p.createSlotFill)("__unstableBlockToolbarLastItem");Rm.Slot=Lm;var Am=Rm;var Dm=(0,a.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(O.Path,{d:"M13 19h-2v-2h2v2zm0-6h-2v-2h2v2zm0-6h-2V5h2v2z"})),Om=window.wp.blob;function Fm(e,t){if(t&&1===(null==e?void 0:e.length)&&0===e[0].type.indexOf("image/")){var n;const e=/<\s*img\b/gi;return 1!==(null===(n=t.match(e))||void 0===n?void 0:n.length)}return!1}function zm(){const{getBlockName:e}=(0,m.useSelect)(qn),{getBlockType:t}=(0,m.useSelect)(r.store),{createSuccessNotice:n}=(0,m.useDispatch)(zd.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 Vm(){const{getBlocksByClientId:e,getSelectedBlockClientIds:t,hasMultiSelection:n,getSettings:o,__unstableIsFullySelected:l,__unstableIsSelectionCollapsed:i,__unstableIsSelectionMergeable:a,__unstableGetSelectedBlocksWithPartialSelection:s}=(0,m.useSelect)(qn),{flashBlock:c,removeBlocks:u,replaceBlocks:p,__unstableDeleteSelection:f,__unstableExpandSelection:g}=(0,m.useDispatch)(qn),h=zm();return(0,d.useRefEffect)((d=>{function m(m){const v=t();if(0===v.length)return;if(!n()){const{target:e}=m,{ownerDocument:t}=e;if("copy"===m.type||"cut"===m.type?(0,Jr.documentHasUncollapsedSelection)(t):(0,Jr.documentHasSelection)(t))return}if(!d.contains(m.target.ownerDocument.activeElement))return;const b=m.defaultPrevented;m.preventDefault();const k=a(),_=i()||l(),y=!_&&!k;if("copy"===m.type||"cut"===m.type)if(1===v.length&&c(v[0]),y)g();else{let t;if(h(m.type,v),_)t=e(v);else{const[n,o]=s();t=[n,...e(v.slice(1,v.length-1)),o]}const n=(0,r.serialize)(t);m.clipboardData.setData("text/plain",n),m.clipboardData.setData("text/html",n)}if("cut"===m.type)_&&!y?u(v):f();else if("paste"===m.type){if(b)return;const{__experimentalCanUserUseUnfilteredHTML:e}=o(),{plainText:t,html:n}=function(e){let{clipboardData:t}=e,n="",o="";try{n=t.getData("text/plain"),o=t.getData("text/html")}catch(e){try{o=t.getData("Text")}catch(e){return}}const r=(0,Jr.getFilesFromDataTransfer)(t).filter((e=>{let{type:t}=e;return/^image\/(?:jpe?g|png|gif|webp)$/.test(t)}));return r.length&&!Fm(r,o)&&(o=r.map((e=>``)).join(""),n=""),{html:o,plainText:n}}(m),l=(0,r.pasteHandler)({HTML:n,plainText:t,mode:"BLOCKS",canUserUseUnfilteredHTML:e});p(v,l,l.length-1,-1)}}return d.ownerDocument.addEventListener("copy",m),d.ownerDocument.addEventListener("cut",m),d.ownerDocument.addEventListener("paste",m),()=>{d.ownerDocument.removeEventListener("copy",m),d.ownerDocument.removeEventListener("cut",m),d.ownerDocument.removeEventListener("paste",m)}}),[])}var Hm=function(e){let{children:t}=e;return(0,a.createElement)("div",{ref:Vm()},t)};function Gm(e){let{clientIds:t,children:n,__experimentalUpdateSelection:o}=e;const{canInsertBlockType:l,getBlockRootClientId:i,getBlocksByClientId:a,canMoveBlocks:s,canRemoveBlocks:c}=(0,m.useSelect)(qn),{getDefaultBlockName:d,getGroupingBlockName:p}=(0,m.useSelect)(r.store),f=a(t),g=i(t[0]),h=(0,u.every)(f,(e=>!!e&&(0,r.hasBlockSupport)(e.name,"multiple",!0)&&l(e.name,g))),v=l(d(),g),b=s(t,g),k=c(t,g),{removeBlocks:_,replaceBlocks:y,duplicateBlocks:E,insertAfterBlock:C,insertBeforeBlock:w,flashBlock:S,setBlockMovingClientId:B,setNavigationMode:I,selectBlock:x}=(0,m.useDispatch)(qn),T=zm();return n({canDuplicate:h,canInsertDefaultBlock:v,canMove:b,canRemove:k,rootClientId:g,blocks:f,onDuplicate:()=>E(t,o),onRemove:()=>_(t,o),onInsertBefore(){w((0,u.first)((0,u.castArray)(t)))},onInsertAfter(){C((0,u.last)((0,u.castArray)(t)))},onMoveTo(){I(!0),x(t[0]),B(t[0])},onGroup(){if(!f.length)return;const e=p(),n=(0,r.switchToBlockType)(f,e);n&&y(t,n)},onUngroup(){if(!f.length)return;const e=f[0].innerBlocks;e.length&&y(t,e)},onCopy(){const e=f.map((e=>{let{clientId:t}=e;return t}));1===f.length&&S(e[0]),T("copy",e)}})}var Um=(0,d.compose)([(0,m.withSelect)(((e,t)=>{let{clientId:n}=t;const{getBlock:o,getBlockMode:l,getSettings:i}=e(qn),a=o(n),s=i().codeEditingEnabled;return{mode:l(n),blockType:a?(0,r.getBlockType)(a.name):null,isCodeEditingEnabled:s}})),(0,m.withDispatch)(((e,t)=>{let{onToggle:n=u.noop,clientId:o}=t;return{onToggleMode(){e(qn).toggleBlockMode(o),n()}}}))])((function(e){let{blockType:t,mode:n,onToggleMode:o,small:l=!1,isCodeEditingEnabled:i=!0}=e;if(!(0,r.hasBlockSupport)(t,"html",!0)||!i)return null;const s="visual"===n?(0,g.__)("Edit as HTML"):(0,g.__)("Edit visually");return(0,a.createElement)(p.MenuItem,{onClick:o},!l&&s)}));var Wm=(0,d.compose)((0,m.withSelect)(((e,t)=>{let{clientId:n}=t;const o=e(qn).getBlock(n);return{block:o,shouldRender:o&&"core/html"===o.name}})),(0,m.withDispatch)(((e,t)=>{let{block:n}=t;return{onClick:()=>e(qn).replaceBlocks(n.clientId,(0,r.rawHandler)({HTML:(0,r.getBlockContent)(n)}))}})))((function(e){let{shouldRender:t,onClick:n,small:o}=e;if(!t)return null;const r=(0,g.__)("Convert to Blocks");return(0,a.createElement)(p.MenuItem,{onClick:n},!o&&r)}));const{Fill:$m,Slot:jm}=(0,p.createSlotFill)("__unstableBlockSettingsMenuFirstItem");$m.Slot=jm;var Km=$m;function qm(e){let{clientIds:t,isGroupable:n,isUngroupable:o,blocksSelection:l,groupingBlockName:i,onClose:s=(()=>{})}=e;const{replaceBlocks:c}=(0,m.useDispatch)(qn);return n||o?(0,a.createElement)(a.Fragment,null,n&&(0,a.createElement)(p.MenuItem,{onClick:()=>{(()=>{const e=(0,r.switchToBlockType)(l,i);e&&c(t,e)})(),s()}},(0,g._x)("Group","verb")),o&&(0,a.createElement)(p.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 Ym(){const{clientIds:e,isGroupable:t,isUngroupable:n,blocksSelection:o,groupingBlockName:l}=(0,m.useSelect)((e=>{var t;const{getBlockRootClientId:n,getBlocksByClientId:o,canInsertBlockType:l,getSelectedBlockClientIds:i}=e(qn),{getGroupingBlockName: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}}var Qm=(0,a.createElement)(O.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,a.createElement)(O.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 Xm=(0,a.createElement)(O.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,a.createElement)(O.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 Zm(e){return(0,m.useSelect)((t=>{const{canMoveBlock:n,canRemoveBlock:o,canLockBlockType:r,getBlockName:l,getBlockRootClientId:i}=t(qn),a=i(e),s=n(e,a),c=o(e,a);return{canMove:s,canRemove:c,canLock:r(l(e)),isLocked:!s||!c}}),[e])}function Jm(e){let{clientId:t,onClose:n}=e;const[o,r]=(0,a.useState)({move:!1,remove:!1}),{canMove:l,canRemove:i}=Zm(t),{updateBlockAttributes:s}=(0,m.useDispatch)(qn),c=Gp(t),u=(0,d.useInstanceId)(Jm,"block-editor-block-lock-modal__options-title");(0,a.useEffect)((()=>{r({move:!l,remove:!i})}),[l,i]);const f=Object.values(o).every(Boolean),h=Object.values(o).some(Boolean)&&!f;return(0,a.createElement)(p.Modal,{title:(0,g.sprintf)((0,g.__)("Lock %s"),c.title),overlayClassName:"block-editor-block-lock-modal",closeLabel:(0,g.__)("Close"),onRequestClose:n},(0,a.createElement)("form",{onSubmit:e=>{e.preventDefault(),s([t],{lock:o}),n()}},(0,a.createElement)("p",null,(0,g.__)("Choose specific attributes to restrict or lock all available options.")),(0,a.createElement)("div",{role:"group","aria-labelledby":u,className:"block-editor-block-lock-modal__options"},(0,a.createElement)(p.CheckboxControl,{className:"block-editor-block-lock-modal__options-title",label:(0,a.createElement)("span",{id:u},(0,g.__)("Lock all")),checked:f,indeterminate:h,onChange:e=>r({move:e,remove:e})}),(0,a.createElement)("ul",{className:"block-editor-block-lock-modal__checklist"},(0,a.createElement)("li",{className:"block-editor-block-lock-modal__checklist-item"},(0,a.createElement)(p.CheckboxControl,{label:(0,a.createElement)(a.Fragment,null,(0,g.__)("Disable movement"),(0,a.createElement)(p.Icon,{icon:o.move?Xm:Qm})),checked:o.move,onChange:e=>r((t=>({...t,move:e})))})),(0,a.createElement)("li",{className:"block-editor-block-lock-modal__checklist-item"},(0,a.createElement)(p.CheckboxControl,{label:(0,a.createElement)(a.Fragment,null,(0,g.__)("Prevent removal"),(0,a.createElement)(p.Icon,{icon:o.remove?Xm:Qm})),checked:o.remove,onChange:e=>r((t=>({...t,remove:e})))})))),(0,a.createElement)(p.Flex,{className:"block-editor-block-lock-modal__actions",justify:"flex-end",expanded:!1},(0,a.createElement)(p.FlexItem,null,(0,a.createElement)(p.Button,{variant:"tertiary",onClick:n},(0,g.__)("Cancel"))),(0,a.createElement)(p.FlexItem,null,(0,a.createElement)(p.Button,{variant:"primary",type:"submit"},(0,g.__)("Apply"))))))}function ef(e){let{clientId:t}=e;const{canLock:n,isLocked:o}=Zm(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)(p.MenuItem,{icon:o?Qm:Xm,onClick:l},i),r&&(0,a.createElement)(Jm,{clientId:t,onClose:l}))}const{Fill:tf,Slot:nf}=(0,p.createSlotFill)("BlockSettingsMenuControls");function of(e){let{...t}=e;return(0,a.createElement)(p.__experimentalStyleProvider,{document:document},(0,a.createElement)(tf,t))}of.Slot=e=>{let{fillProps:t,clientIds:n=null}=e;const{selectedBlocks:o,selectedClientIds:r,canRemove:l}=(0,m.useSelect)((e=>{const{getBlocksByClientId:t,getSelectedBlockClientIds:o,canRemoveBlocks:r}=e(qn),l=null!==n?n:o();return{selectedBlocks:(0,u.map)((0,u.compact)(t(l)),(e=>e.name)),selectedClientIds:l,canRemove:r(l)}}),[n]),s=1===r.length,c=Ym(),{isGroupable:d,isUngroupable:f}=c,g=(d||f)&&l;return(0,a.createElement)(nf,{fillProps:{...t,selectedBlocks:o,selectedClientIds:r}},(e=>!(null!=e&&e.length)>0&&!g&&!s?null:(0,a.createElement)(p.MenuGroup,null,s&&(0,a.createElement)(ef,{clientId:r[0]}),e,g&&(0,a.createElement)(qm,i({},c,{onClose:null==t?void 0:t.onClose})))))};var rf=of;const lf={className:"block-editor-block-settings-menu__popover",position:"bottom right",isAlternate:!0};function af(e){let{blocks:t,onCopy:n}=e;const o=(0,d.useCopyToClipboard)((()=>(0,r.serialize)(t)),n);return(0,a.createElement)(p.MenuItem,{ref:o},(0,g.__)("Copy"))}var sf=function(e){let{clientIds:t,__experimentalSelectBlock:n,children:o,...l}=e;const s=(0,u.castArray)(t),c=s.length,d=s[0],{firstParentClientId:f,hasReducedUI:h,onlyBlock:v,parentBlockType:b,previousBlockClientId:k,nextBlockClientId:_,selectedBlockClientIds:y}=(0,m.useSelect)((e=>{const{getBlockCount:t,getBlockName:n,getBlockParents:o,getPreviousBlockClientId:l,getNextBlockClientId:i,getSelectedBlockClientIds:a,getSettings:s}=e(qn),c=o(d),u=c[c.length-1],p=n(u);return{firstParentClientId:u,hasReducedUI:s().hasReducedUI,onlyBlock:1===t(),parentBlockType:(0,r.getBlockType)(p),previousBlockClientId:l(d),nextBlockClientId:i(d),selectedBlockClientIds:a()}}),[d]),E=(0,m.useSelect)((e=>{const{getShortcutRepresentation:t}=e(tu.store);return{duplicate:t("core/block-editor/duplicate"),remove:t("core/block-editor/remove"),insertAfter:t("core/block-editor/insert-after"),insertBefore:t("core/block-editor/insert-before")}}),[]),{selectBlock:C,toggleBlockHighlight:w}=(0,m.useDispatch)(qn),S=(0,a.useCallback)(n?async e=>{const t=await e;t&&t[0]&&n(t[0])}:u.noop,[n]),B=Up(d,25),I=(0,a.useCallback)(n?()=>{const e=k||_;e&&y.includes(d)&&!y.includes(e)&&n(e)}:u.noop,[n,k,_,y]),x=(0,g.sprintf)((0,g.__)("Remove %s"),B),T=1===c?x:(0,g.__)("Remove blocks"),N=(0,a.useRef)(),{gestures:P}=dm({ref:N,onChange(e){e&&h||w(f,e)}});return(0,a.createElement)(Gm,{clientIds:t,__experimentalUpdateSelection:!n},(e=>{let{canDuplicate:n,canInsertDefaultBlock:r,canMove:s,canRemove:m,onDuplicate:h,onInsertAfter:k,onInsertBefore:_,onRemove:y,onCopy:w,onMoveTo:B,blocks:x}=e;return(0,a.createElement)(p.DropdownMenu,i({icon:Dm,label:(0,g.__)("Options"),className:"block-editor-block-settings-menu",popoverProps:lf,noIcons:!0},l),(e=>{let{onClose:l}=e;return(0,a.createElement)(a.Fragment,null,(0,a.createElement)(p.MenuGroup,null,(0,a.createElement)(Km.Slot,{fillProps:{onClose:l}}),void 0!==f&&(0,a.createElement)(p.MenuItem,i({},P,{ref:N,icon:(0,a.createElement)(Wc,{icon:b.icon}),onClick:()=>C(f)}),(0,g.sprintf)((0,g.__)("Select parent block (%s)"),b.title)),1===c&&(0,a.createElement)(Wm,{clientId:d}),(0,a.createElement)(af,{blocks:x,onCopy:w}),n&&(0,a.createElement)(p.MenuItem,{onClick:(0,u.flow)(l,h,S),shortcut:E.duplicate},(0,g.__)("Duplicate")),r&&(0,a.createElement)(a.Fragment,null,(0,a.createElement)(p.MenuItem,{onClick:(0,u.flow)(l,_),shortcut:E.insertBefore},(0,g.__)("Insert before")),(0,a.createElement)(p.MenuItem,{onClick:(0,u.flow)(l,k),shortcut:E.insertAfter},(0,g.__)("Insert after"))),s&&!v&&(0,a.createElement)(p.MenuItem,{onClick:(0,u.flow)(l,B)},(0,g.__)("Move to")),1===c&&(0,a.createElement)(Um,{clientId:d,onToggle:l})),(0,a.createElement)(rf.Slot,{fillProps:{onClose:l},clientIds:t}),"function"==typeof o?o({onClose:l}):a.Children.map((e=>(0,a.cloneElement)(e,{onClose:l}))),m&&(0,a.createElement)(p.MenuGroup,null,(0,a.createElement)(p.MenuItem,{onClick:(0,u.flow)(l,y,I),shortcut:E.remove},T)))}))}))};var cf=function(e){let{clientIds:t,...n}=e;return(0,a.createElement)(p.ToolbarGroup,null,(0,a.createElement)(p.ToolbarItem,null,(e=>(0,a.createElement)(sf,i({clientIds:t,toggleProps:e},n)))))};function uf(e){let{clientId:t}=e;const n=Gp(t),{canMove:o,canRemove:r,canLock:l}=Zm(t),[i,s]=(0,a.useReducer)((e=>!e),!1);return l?o&&r?null:(0,a.createElement)(a.Fragment,null,(0,a.createElement)(p.ToolbarGroup,{className:"block-editor-block-lock-toolbar"},(0,a.createElement)(p.ToolbarButton,{icon:Xm,label:(0,g.sprintf)((0,g.__)("Unlock %s"),n.title),onClick:s})),i&&(0,a.createElement)(Jm,{clientId:t,onClose:s})):null}var df=(0,a.createElement)(O.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,a.createElement)(O.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 pf=(0,a.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(O.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 mf=(0,a.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(O.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 ff={group:void 0,row:{type:"flex",flexWrap:"nowrap"},stack:{type:"flex",orientation:"vertical"}};var gf=function(){const{blocksSelection:e,clientIds:t,groupingBlockName:n,isGroupable:o}=Ym(),{replaceBlocks:l}=(0,m.useDispatch)(qn),{canRemove:i}=(0,m.useSelect)((e=>{const{canRemoveBlocks:n}=e(qn);return{canRemove:n(t)}}),[t]),s=function(){let o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"group";const i=(0,r.switchToBlockType)(e,n);i&&i.length>0&&(i[0].attributes.layout=ff[o],l(t,i))};return o&&i?(0,a.createElement)(p.ToolbarGroup,null,(0,a.createElement)(p.ToolbarButton,{icon:df,label:(0,g._x)("Group","verb"),onClick:s}),(0,a.createElement)(p.ToolbarButton,{icon:pf,label:(0,g._x)("Row","single horizontal line"),onClick:()=>s("row")}),(0,a.createElement)(p.ToolbarButton,{icon:mf,label:(0,g._x)("Stack","verb"),onClick:()=>s("stack")})):null};var hf=(0,a.createContext)("");var vf=e=>{let{hideDragHandle:t}=e;const{blockClientIds:n,blockClientId:o,blockType:l,hasFixedToolbar:s,hasReducedUI:u,isValid:f,isVisual:g}=(0,m.useSelect)((e=>{const{getBlockName:t,getBlockMode:n,getSelectedBlockClientIds:o,isBlockValid:l,getBlockRootClientId:i,getSettings:a}=e(qn),s=o(),c=s[0],u=i(c),d=a();return{blockClientIds:s,blockClientId:c,blockType:c&&(0,r.getBlockType)(t(c)),hasFixedToolbar:d.hasFixedToolbar,hasReducedUI:d.hasReducedUI,rootClientId:u,isValid:s.every((e=>l(e))),isVisual:s.every((e=>"visual"===n(e)))}}),[]),{toggleBlockHighlight:h}=(0,m.useDispatch)(qn),v=(0,a.useRef)(),{showMovers:b,gestures:k}=dm({ref:v,onChange(e){e&&u||h(o,e)}}),_=(0,d.useViewportMatch)("medium","<")||s;if(l&&!(0,r.hasBlockSupport)(l,"__experimentalToolbar",!0))return null;const y=_||b;if(0===n.length)return null;const E=f&&g,C=n.length>1,w=c()("block-editor-block-toolbar",y&&"is-showing-movers");return(0,a.createElement)("div",{className:w},!C&&!_&&(0,a.createElement)(pm,{clientIds:n}),(0,a.createElement)("div",i({ref:v},k),(E||C)&&(0,a.createElement)(p.ToolbarGroup,{className:"block-editor-block-toolbar__block-controls"},(0,a.createElement)(Mm,{clientIds:n}),!C&&(0,a.createElement)(uf,{clientId:n[0]}),(0,a.createElement)(im,{clientIds:n,hideDragHandle:t||u}))),E&&C&&(0,a.createElement)(gf,null),E&&(0,a.createElement)(a.Fragment,null,(0,a.createElement)(ro.Slot,{group:"parent",className:"block-editor-block-toolbar__slot"}),(0,a.createElement)(ro.Slot,{group:"block",className:"block-editor-block-toolbar__slot"}),(0,a.createElement)(ro.Slot,{className:"block-editor-block-toolbar__slot"}),(0,a.createElement)(ro.Slot,{group:"inline",className:"block-editor-block-toolbar__slot"}),(0,a.createElement)(ro.Slot,{group:"other",className:"block-editor-block-toolbar__slot"}),(0,a.createElement)(hf.Provider,{value:null==l?void 0:l.name},(0,a.createElement)(Am.Slot,null))),(0,a.createElement)(cf,{clientIds:n}))};var bf=function(e){let{focusOnMount:t,isFixed:n,...o}=e;const{blockType:l,hasParents:s,showParentSelector:u}=(0,m.useSelect)((e=>{const{getBlockName:t,getBlockParents:n,getSelectedBlockClientIds:o}=e(qn),{getBlockType:l}=e(r.store),i=o(),a=i[0],s=n(a),c=l(t(s[s.length-1]));return{blockType:a&&l(t(a)),hasParents:s.length,showParentSelector:(0,r.hasBlockSupport)(c,"__experimentalParentSelector",!0)&&i.length<=1}}),[]);if(l&&!(0,r.hasBlockSupport)(l,"__experimentalToolbar",!0))return null;const d=c()("block-editor-block-contextual-toolbar",{"has-parent":s&&u,"is-fixed":n});return(0,a.createElement)(Yp,i({focusOnMount:t,className:d,"aria-label":(0,g.__)("Block tools")},o),(0,a.createElement)(vf,{hideDragHandle:n}))};function kf(e){const{isNavigationMode:t,isMultiSelecting:n,hasMultiSelection:o,isTyping:r,isCaretWithinFormattedText:l,getSettings:i,getLastMultiSelectedBlockClientId:a}=e(qn);return{isNavigationMode:t(),isMultiSelecting:n(),isTyping:r(),isCaretWithinFormattedText:l(),hasMultiSelection:o(),hasFixedToolbar:i().hasFixedToolbar,lastClientId:a()}}function _f(e){let{clientId:t,rootClientId:n,isValid:o,isEmptyDefaultBlock:r,capturingClientId:l,__unstablePopoverSlot:i,__unstableContentRef:s}=e;const{isNavigationMode:u,isMultiSelecting:f,isTyping:g,isCaretWithinFormattedText:h,hasMultiSelection:v,hasFixedToolbar:b,lastClientId:k}=(0,m.useSelect)(kf,[]),_=(0,m.useSelect)((e=>{const{isBlockInsertionPointVisible:n,getBlockInsertionPoint:o,getBlockOrder:r}=e(qn);if(!n())return!1;const l=o();return r(l.rootClientId)[l.index]===t}),[t]),y=(0,d.useViewportMatch)("medium"),[E,C]=(0,a.useState)(!1),[w,S]=(0,a.useState)(!1),{stopTyping:B}=(0,m.useDispatch)(qn),I=!g&&!u&&r&&o,x=u,T=!u&&!b&&y&&!I&&!f&&(!g||h),N=!(u||T||b||r);(0,tu.useShortcut)("core/block-editor/focus-toolbar",(()=>{C(!0),B(!0)}),{isDisabled:!N}),(0,a.useEffect)((()=>{T||C(!1)}),[T]);const P=(0,a.useRef)(),M=Co(t),R=Co(k),L=Co(l),A=Ap(s);if(!(x||T||E||I))return null;let D=M;if(!D)return null;l&&(D=L);let O=D;if(v){if(!R)return null;O={top:D,bottom:R}}const F=I?"top left right":"top right left",{ownerDocument:z}=D,V=I?void 0:z.defaultView.frameElement||(0,Jr.getScrollContainer)(D)||z.body;return(0,a.createElement)(p.Popover,{ref:A,noArrow:!0,animate:!1,position:F,focusOnMount:!1,anchorRef:O,className:c()("block-editor-block-list__block-popover",{"is-insertion-point-visible":_}),__unstableStickyBoundaryElement:V,__unstableSlotName:i||null,__unstableBoundaryParent:!0,__unstableObserveElement:D,shouldAnchorIncludePadding:!0,__unstableEditorCanvasWrapper:null==s?void 0:s.current},(T||E)&&(0,a.createElement)("div",{onFocus:function(){S(!0)},onBlur:function(){S(!1)},tabIndex:-1,className:c()("block-editor-block-list__block-popover-inserter",{"is-visible":w})},(0,a.createElement)(Tp,{clientId:t,rootClientId:n,__experimentalIsQuick:!0})),(T||E)&&(0,a.createElement)(bf,{focusOnMount:E,__experimentalInitialIndex:P.current,__experimentalOnIndexChange:e=>{P.current=e},key:t}),x&&(0,a.createElement)(jp,{clientId:t,rootClientId:n,blockElement:D}),I&&(0,a.createElement)("div",{className:"block-editor-block-list__empty-block-inserter"},(0,a.createElement)(Tp,{position:"bottom right",rootClientId:n,clientId:t,__experimentalIsQuick:!0})))}function yf(e){const{getSelectedBlockClientId:t,getFirstMultiSelectedBlockClientId:n,getBlockRootClientId:o,getBlock:l,getBlockParents:i,__experimentalGetBlockListSettingsForBlocks:a}=e(qn),s=t()||n();if(!s)return;const{name:c,attributes:d={},isValid:p}=l(s)||{},m=i(s),f=a(m),g=(0,u.find)(m,(e=>{var t;return null===(t=f[e])||void 0===t?void 0:t.__experimentalCaptureToolbars}));return{clientId:s,rootClientId:o(s),name:c,isValid:p,isEmptyDefaultBlock:c&&(0,r.isUnmodifiedDefaultBlock)({name:c,attributes:d}),capturingClientId:g}}function Ef(e){let{__unstablePopoverSlot:t,__unstableContentRef:n}=e;const o=(0,m.useSelect)(yf,[]);if(!o)return null;const{clientId:r,rootClientId:l,name:i,isValid:s,isEmptyDefaultBlock:c,capturingClientId:u}=o;return i?(0,a.createElement)(_f,{clientId:r,rootClientId:l,isValid:s,isEmptyDefaultBlock:c,capturingClientId:u,__unstablePopoverSlot:t,__unstableContentRef:n}):null}function Cf(e){let{children:t}=e;const n=(0,a.useContext)(Dp),o=(0,a.useContext)(p.Disabled.Context);return n||o?t:(Vt()('wp.components.Popover.Slot name="block-toolbar"',{alternative:"wp.blockEditor.BlockTools",since:"5.8"}),(0,a.createElement)(Fp,{__unstablePopoverSlot:"block-toolbar"},(0,a.createElement)(Ef,{__unstablePopoverSlot:"block-toolbar"}),t))}var wf=(0,d.createHigherOrderComponent)((e=>t=>{const{clientId:n}=Zn();return(0,a.createElement)(e,i({},t,{clientId:n}))}),"withClientId");var Sf=wf((e=>{let{clientId:t,showSeparator:n,isFloating:o,onAddBlock:r,isToggle:l}=e;return(0,a.createElement)(Rp,{className:c()({"block-list-appender__toggle":l}),rootClientId:t,showSeparator:n,isFloating:o,onAddBlock:r})}));var Bf=(0,d.compose)([wf,(0,m.withSelect)(((e,t)=>{let{clientId:n}=t;const{getBlockOrder:o}=e(qn),r=o(n);return{lastBlockClientId:(0,u.last)(r)}}))])((e=>{let{clientId:t}=e;return(0,a.createElement)(Np,{rootClientId:t})})),If=window.wp.isShallowEqual,xf=n.n(If);const Tf=new WeakMap;function Nf(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&&re(qn).getSettings().mediaUpload),[]),{canInsertBlockType:o,getBlockIndex:l,getClientIdsOfDescendants:i}=(0,m.useSelect)(qn),{insertBlocks:a,moveBlocksToPosition:s,updateBlockAttributes:c,clearSelectedBlock:u}=(0,m.useDispatch)(qn),d=Nf(e,t,l,i,s,a,u),p=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,Jr.getFilesFromDataTransfer)(e.dataTransfer),n=e.dataTransfer.getData("text/html");n?f(n):t.length?p(t):d(e)}}function Mf(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:i2&&void 0!==arguments[2]?arguments[2]:["top","bottom","left","right"];return r.forEach((r=>{const l=Mf(e,t,r);(void 0===n||l{const a=e.getBoundingClientRect(),[s,c]=Rf(t,a,o);if(void 0===i||s0&&void 0!==arguments[0]?arguments[0]:{};const[t,n]=(0,a.useState)(null),o=(0,m.useSelect)((t=>{const{getTemplateLock:n}=t(qn);return"all"===n(e)}),[e]),{getBlockListSettings:r}=(0,m.useSelect)(qn),{showInsertionPoint:l,hideInsertionPoint:i}=(0,m.useDispatch)(qn),s=Pf(e,t),c=(0,d.useThrottle)((0,a.useCallback)(((t,o)=>{var i;const a=Lf(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 Df(e){const{clientId:t,allowedBlocks:n,__experimentalDefaultBlock:o,__experimentalDirectInsert:l,template:i,templateLock:s,wrapperRef:c,templateInsertUpdatesSelection:d,__experimentalCaptureToolbars:p,__experimentalAppenderTagName:f,renderAppender:g,orientation:h,placeholder:v,__experimentalLayout:b}=e;!function(e,t,n,o,r,l,i,s){const{updateBlockListSettings:c}=(0,m.useDispatch)(qn),{blockListSettings:u,parentLock:d}=(0,m.useSelect)((t=>{const n=t(qn).getBlockRootClientId(e);return{blockListSettings:t(qn).getBlockListSettings(e),parentLock:t(qn).getTemplateLock(n)}}),[e]),p=(0,a.useMemo)((()=>t),t);(0,a.useLayoutEffect)((()=>{const t={allowedBlocks:p,templateLock:void 0===r?d:r};if(void 0!==l&&(t.__experimentalCaptureToolbars=l),void 0!==i)t.orientation=i;else{const e=Ir(null==s?void 0:s.type);t.orientation=e.getOrientation(s)}void 0!==n&&(t.__experimentalDefaultBlock=n),void 0!==o&&(t.__experimentalDirectInsert=o),xf()(u,t)||c(e,t)}),[e,u,p,n,o,r,d,l,i,c,s])}(t,n,o,l,s,p,h,b),function(e,t,n,o){const{getSelectedBlocksInitialCaretPosition:l}=(0,m.useSelect)(qn),{replaceInnerBlocks:i}=(0,m.useDispatch)(qn),s=(0,m.useSelect)((t=>t(qn).getBlocks(e)),[e]),c=(0,a.useRef)(null);(0,a.useLayoutEffect)((()=>{if((0===s.length||"all"===n)&&!(0,u.isEqual)(t,c.current)){c.current=t;const n=(0,r.synchronizeBlocksWithTemplate)(s,t);(0,u.isEqual)(n,s)||i(e,n,0===s.length&&o&&0!==n.length,l())}}),[s,t,n,e])}(t,i,s,d);const k=(0,m.useSelect)((e=>{const n=e(qn).getBlock(t),o=(0,r.getBlockType)(n.name);if(o&&o.providesContext)return function(e,t){Tf.has(t)||Tf.set(t,new WeakMap);const n=Tf.get(t);if(!n.has(e)){const o=(0,u.mapValues)(t.providesContext,(t=>e[t]));n.set(e,o)}return n.get(e)}(n.attributes,o)}),[t]);return(0,a.createElement)(tl,{value:k},(0,a.createElement)(jf,{rootClientId:t,renderAppender:g,__experimentalAppenderTagName:f,__experimentalLayout:b,wrapperRef:c,placeholder:v}))}function Of(e){return jc(e),(0,a.createElement)(Df,e)}const Ff=(0,a.forwardRef)(((e,t)=>{const n=zf({ref:t},e);return(0,a.createElement)("div",{className:"block-editor-inner-blocks"},(0,a.createElement)("div",n))}));function zf(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{clientId:n}=Zn(),o=(0,d.useViewportMatch)("medium","<"),{__experimentalCaptureToolbars:l,hasOverlay:s}=(0,m.useSelect)((e=>{if(!n)return{};const{getBlockName:t,isBlockSelected:l,hasSelectedInnerBlock:i,isNavigationMode:a}=e(qn),s=t(n),c=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,Af({rootClientId:n})]),p={__experimentalCaptureToolbars:l,...t},f=p.value&&p.onChange?Of:Df;return{...e,ref:u,className:c()(e.className,"block-editor-block-list__layout",{"has-overlay":s}),children:n?(0,a.createElement)(f,i({},p,{clientId:n})):(0,a.createElement)(jf,t)}}zf.save=r.__unstableGetInnerBlocksProps,Ff.DefaultBlockAppender=Bf,Ff.ButtonBlockAppender=Sf,Ff.Content=()=>zf.save().children;var Vf=Ff;const Hf=(0,a.createContext)(),Gf=(0,a.createContext)();function Uf(e){let{className:t,...n}=e;const[o,r]=(0,a.useState)(),l=(0,d.useViewportMatch)("medium"),{isOutlineMode:i,isFocusMode:s,isNavigationMode:u}=(0,m.useSelect)((e=>{const{getSettings:t,isNavigationMode:n}=e(qn),{outlineMode:o,focusMode:r}=t();return{isOutlineMode:o,isFocusMode:r,isNavigationMode:n()}}),[]),p=zf({ref:(0,d.useMergeRefs)([Yc(),zp(),r]),className:c()("is-root-container",t,{"is-outline-mode":i,"is-focus-mode":s&&l,"is-navigate-mode":u})},n);return(0,a.createElement)(Hf.Provider,{value:o},(0,a.createElement)("div",p))}function Wf(e){return function(){const e=(0,m.useSelect)((e=>e(qn).getSettings().__experimentalBlockPatterns),[]);(0,a.useEffect)((()=>{if(null==e||!e.length)return;let t,n=-1;const o=()=>{n++,n>=e.length||((0,m.select)(qn).__experimentalGetParsedPattern(e[n].name),t=Vp(o))};return t=Vp(o),()=>Hp(t)}),[e])}(),(0,a.createElement)(Cf,null,(0,a.createElement)(Xn,{value:Yn},(0,a.createElement)(Uf,e)))}function $f(e){let{placeholder:t,rootClientId:n,renderAppender:o,__experimentalAppenderTagName:r,__experimentalLayout:l=xr}=e;const[i,s]=(0,a.useState)(new Set),c=(0,a.useMemo)((()=>{const{IntersectionObserver:e}=window;if(e)return new e((e=>{s((t=>{const n=new Set(t);for(const t of e){const e=t.target.getAttribute("data-block");n[t.isIntersecting?"add":"delete"](e)}return n}))}))}),[s]),{order:u,selectedBlocks:d}=(0,m.useSelect)((e=>{const{getBlockOrder:t,getSelectedBlockClientIds:o}=e(qn);return{order:t(n),selectedBlocks:o()}}),[n]);return(0,a.createElement)(Nr,{value:l},(0,a.createElement)(Gf.Provider,{value:c},u.map((e=>(0,a.createElement)(m.AsyncModeProvider,{key:e,value:!i.has(e)&&!d.includes(e)},(0,a.createElement)(Fc,{rootClientId:n,clientId:e}))))),u.length<1&&t,(0,a.createElement)(Lp,{tagName:r,rootClientId:n,renderAppender:o}))}function jf(e){return(0,a.createElement)(m.AsyncModeProvider,{value:!1},(0,a.createElement)($f,e))}Wf.__unstableElementContext=Hf;const Kf=["colors","disableCustomColors","gradients","disableCustomGradients"];function qf(e){let{colors:t,gradients:n,disableCustomColors:o,disableCustomGradients:r,__experimentalHasMultipleOrigins:l,__experimentalIsRenderedInSidebar:i,className:s,label:d,onColorChange:m,onGradientChange:f,colorValue:h,gradientValue:v,clearable:b,showTitle:k=!0,enableAlpha:_}=e;const y=m&&(!(0,u.isEmpty)(t)||!o),E=f&&(!(0,u.isEmpty)(n)||!r),[C,w]=(0,a.useState)(v?"gradient":!!y&&"color");return y||E?(0,a.createElement)(p.BaseControl,{className:c()("block-editor-color-gradient-control",s)},(0,a.createElement)("fieldset",{className:"block-editor-color-gradient-control__fieldset"},(0,a.createElement)(p.__experimentalVStack,{spacing:1},k&&(0,a.createElement)("legend",null,(0,a.createElement)("div",{className:"block-editor-color-gradient-control__color-indicator"},(0,a.createElement)(p.BaseControl.VisualLabel,null,d))),y&&E&&(0,a.createElement)(p.__experimentalToggleGroupControl,{value:C,onChange:w,label:(0,g.__)("Select color type"),hideLabelFromVision:!0,isBlock:!0},(0,a.createElement)(p.__experimentalToggleGroupControlOption,{value:"color",label:(0,g.__)("Solid")}),(0,a.createElement)(p.__experimentalToggleGroupControlOption,{value:"gradient",label:(0,g.__)("Gradient")})),("color"===C||!E)&&(0,a.createElement)(p.ColorPalette,{value:h,onChange:E?e=>{m(e),f()}:m,colors:t,disableCustomColors:o,__experimentalHasMultipleOrigins:l,__experimentalIsRenderedInSidebar:i,clearable:b,enableAlpha:_}),("gradient"===C||!y)&&(0,a.createElement)(p.GradientPicker,{value:v,onChange:y?e=>{f(e),m()}:f,gradients:n,disableCustomGradients:r,__experimentalHasMultipleOrigins:l,__experimentalIsRenderedInSidebar:i,clearable:b})))):null}function Yf(e){const t={};return t.colors=Io("color.palette"),t.gradients=Io("color.gradients"),t.disableCustomColors=!Io("color.custom"),t.disableCustomGradients=!Io("color.customGradient"),(0,a.createElement)(qf,i({},t,e))}var Qf=function(e){return(0,u.every)(Kf,(t=>e.hasOwnProperty(t)))?(0,a.createElement)(qf,e):(0,a.createElement)(Yf,e)};function Xf(e){let t,{colors:n,gradients:o,disableCustomColors:r,disableCustomGradients:l,__experimentalHasMultipleOrigins:s,__experimentalIsRenderedInSidebar:u,enableAlpha:d,settings:m}=e;return u&&(t="bottom left"),(0,a.createElement)(p.__experimentalItemGroup,{isBordered:!0,isSeparated:!0,className:"block-editor-panel-color-gradient-settings__item-group"},m.map(((e,m)=>e&&(0,a.createElement)(p.Dropdown,{key:m,position:t,className:"block-editor-panel-color-gradient-settings__dropdown",contentClassName:"block-editor-panel-color-gradient-settings__dropdown-content",renderToggle:t=>{var n;let{isOpen:o,onToggle:r}=t;return(0,a.createElement)(p.__experimentalItem,{onClick:r,className:c()("block-editor-panel-color-gradient-settings__item",{"is-open":o})},(0,a.createElement)(p.__experimentalHStack,{justify:"flex-start"},(0,a.createElement)(p.ColorIndicator,{className:"block-editor-panel-color-gradient-settings__color-indicator",colorValue:null!==(n=e.gradientValue)&&void 0!==n?n:e.colorValue}),(0,a.createElement)(p.FlexItem,null,e.label)))},renderContent:()=>(0,a.createElement)(Qf,i({showTitle:!1,colors:n,gradients:o,disableCustomColors:r,disableCustomGradients:l,__experimentalHasMultipleOrigins:s,__experimentalIsRenderedInSidebar:u,enableAlpha:d},e))}))))}function Zf(){return{disableCustomColors:!Io("color.custom"),disableCustomGradients:!Io("color.customGradient")}}function Jf(){const e=Zf(),t=Io("color.palette.custom"),n=Io("color.palette.theme"),o=Io("color.palette.default"),r=Io("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=Io("color.gradients.custom"),i=Io("color.gradients.theme"),s=Io("color.gradients.default"),c=Io("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}Gu([Uu,ju]);const eg=(e,t,n)=>{if(t){const n=(0,u.find)(e,{slug:t});if(n)return n}return{color:n}},tg=(e,t)=>(0,u.find)(e,{color:t});function ng(e,t){if(e&&t)return`has-${(0,u.kebabCase)(t)}-${e}`}const og=[];function rg(e){const{attributes:{borderColor:t,style:n},setAttributes:o}=e,r=Jf(),l=r.colors.reduce(((e,t)=>e.concat(t.colors)),[]),{color:s}=(null==n?void 0:n.border)||{},[c,u]=(0,a.useState)((()=>{var e;return null===(e=eg(l,t,s))||void 0===e?void 0:e.color}));(0,a.useEffect)((()=>{var e;u(null===(e=eg(l,t,s))||void 0===e?void 0:e.color)}),[t,s,l]);const d=[{label:(0,g.__)("Color"),onColorChange:e=>{u(e);const t=tg(l,e),r={...n,border:{...null==n?void 0:n.border,color:null!=t&&t.slug?void 0:e}},i=null!=t&&t.slug?t.slug:void 0;o({style:No(r),borderColor:i})},colorValue:c,clearable:!1}];return(0,a.createElement)(Xf,i({settings:d,disableCustomColors:!0,disableCustomGradients:!0,__experimentalHasMultipleOrigins:!0,__experimentalIsRenderedInSidebar:!0,enableAlpha:!0},r))}function lg(e,t,n){var o;if(!Ng(t,"color")||Ro(t,xg,"color"))return e;const{borderColor:r,style:l}=n,i=ng("border-color",r),a=c()(e.className,{"has-border-color":r||(null==l||null===(o=l.border)||void 0===o?void 0:o.color),[i]:!!i});return e.className=a||void 0,e}const ig=(0,d.createHigherOrderComponent)((e=>t=>{var n,o;const{name:r,attributes:l}=t,{borderColor:s}=l,c=Io("color.palette")||og;if(!Ng(r,"color")||Ro(r,xg,"color"))return(0,a.createElement)(e,t);const u={borderColor:s?null===(n=eg(c,s))||void 0===n?void 0:n.color:void 0};let d=t.wrapperProps;return d={...t.wrapperProps,style:{...u,...null===(o=t.wrapperProps)||void 0===o?void 0:o.style}},(0,a.createElement)(e,i({},t,{wrapperProps:d}))}));function ag(e){return[...e].sort(((t,n)=>e.filter((e=>e===n)).length-e.filter((e=>e===t)).length)).shift()}function sg(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if("string"==typeof e)return e;const t=Object.values(e).map((e=>(0,p.__experimentalParseQuantityAndUnitFromRawValue)(e))),n=t.map((e=>{var t;return null!==(t=e[0])&&void 0!==t?t:""})),o=t.map((e=>e[1])),r=n.every((e=>e===n[0]))?n[0]:"",l=ag(o),i=0===r||r?`${r}${l}`:void 0;return i}function cg(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=sg(e),n="string"!=typeof e&&isNaN(parseFloat(t));return n}function ug(e){if(!e)return!1;if("string"==typeof e)return!0;return!!Object.values(e).filter((e=>!!e||0===e)).length}function dg(e){let{onChange:t,values:n,...o}=e;const r=sg(n),l=ug(n)&&cg(n),s=l?(0,g.__)("Mixed"):null;return(0,a.createElement)(p.__experimentalUnitControl,i({},o,{"aria-label":(0,g.__)("Border radius"),disableUnits:l,isOnly:!0,value:r,onChange:t,placeholder:s}))}(0,l.addFilter)("blocks.registerBlockType","core/border/addAttributes",(function(e){return Ng(e,"color")?e.attributes.borderColor?e:{...e,attributes:{...e.attributes,borderColor:{type:"string"}}}:e})),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/border/addSaveProps",lg),(0,l.addFilter)("blocks.registerBlockType","core/border/addEditProps",(function(e){if(!Ng(e,"color")||Ro(e,xg,"color"))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),lg(o,e,n)},e})),(0,l.addFilter)("editor.BlockListBlock","core/border/with-border-color-palette-styles",ig);const pg={topLeft:(0,g.__)("Top left"),topRight:(0,g.__)("Top right"),bottomLeft:(0,g.__)("Bottom left"),bottomRight:(0,g.__)("Bottom right")};function mg(e){let{onChange:t,values:n,...o}=e;const r="string"!=typeof n?n:{topLeft:n,topRight:n,bottomLeft:n,bottomRight:n};return(0,a.createElement)("div",{className:"components-border-radius-control__input-controls-wrapper"},Object.entries(pg).map((e=>{let[n,l]=e;return(0,a.createElement)(p.__experimentalUnitControl,i({},o,{key:n,"aria-label":l,value:r[n],onChange:(s=n,e=>{t&&t({...r,[s]:e||void 0})})}));var s})))}var fg=(0,a.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(O.Path,{d:"M15.6 7.2H14v1.5h1.6c2 0 3.7 1.7 3.7 3.7s-1.7 3.7-3.7 3.7H14v1.5h1.6c2.8 0 5.2-2.3 5.2-5.2 0-2.9-2.3-5.2-5.2-5.2zM4.7 12.4c0-2 1.7-3.7 3.7-3.7H10V7.2H8.4c-2.9 0-5.2 2.3-5.2 5.2 0 2.9 2.3 5.2 5.2 5.2H10v-1.5H8.4c-2 0-3.7-1.7-3.7-3.7zm4.6.9h5.3v-1.5H9.3v1.5z"}));var gg=(0,a.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(O.Path,{d:"M15.6 7.3h-.7l1.6-3.5-.9-.4-3.9 8.5H9v1.5h2l-1.3 2.8H8.4c-2 0-3.7-1.7-3.7-3.7s1.7-3.7 3.7-3.7H10V7.3H8.4c-2.9 0-5.2 2.3-5.2 5.2 0 2.9 2.3 5.2 5.2 5.2H9l-1.4 3.2.9.4 5.7-12.5h1.4c2 0 3.7 1.7 3.7 3.7s-1.7 3.7-3.7 3.7H14v1.5h1.6c2.9 0 5.2-2.3 5.2-5.2 0-2.9-2.4-5.2-5.2-5.2z"}));function hg(e){let{isLinked:t,...n}=e;const o=t?(0,g.__)("Unlink Radii"):(0,g.__)("Link Radii");return(0,a.createElement)(p.Tooltip,{text:o},(0,a.createElement)(p.Button,i({},n,{className:"component-border-radius-control__linked-button",isPrimary:t,isSecondary:!t,isSmall:!0,icon:t?fg:gg,iconSize:16,"aria-label":o})))}const vg={topLeft:null,topRight:null,bottomLeft:null,bottomRight:null},bg={px:100,em:20,rem:20};function kg(e){let{onChange:t,values:n}=e;const[o,r]=(0,a.useState)(!ug(n)||!cg(n)),l=(0,p.__experimentalUseCustomUnits)({availableUnits:Io("spacing.units")||["px","em","rem"]}),i=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if("string"==typeof e){const[,t]=(0,p.__experimentalParseQuantityAndUnitFromRawValue)(e);return t||"px"}const t=Object.values(e).map((e=>{const[,t]=(0,p.__experimentalParseQuantityAndUnitFromRawValue)(e);return t}));return ag(t)||"px"}(n),s=l&&l.find((e=>e.value===i)),c=(null==s?void 0:s.step)||1,[u]=(0,p.__experimentalParseQuantityAndUnitFromRawValue)(sg(n));return(0,a.createElement)("fieldset",{className:"components-border-radius-control"},(0,a.createElement)("legend",null,(0,g.__)("Radius")),(0,a.createElement)("div",{className:"components-border-radius-control__wrapper"},o?(0,a.createElement)(a.Fragment,null,(0,a.createElement)(dg,{className:"components-border-radius-control__unit-control",values:n,min:0,onChange:t,units:l}),(0,a.createElement)(p.RangeControl,{className:"components-border-radius-control__range-control",value:null!=u?u:"",min:0,max:bg[i],initialPosition:0,withInputField:!1,onChange:e=>{t(void 0!==e?`${e}${i}`:void 0)},step:c})):(0,a.createElement)(mg,{min:0,onChange:t,values:n||vg,units:l}),(0,a.createElement)(hg,{onClick:()=>r(!o),isLinked:o})))}function _g(e){var t;const{attributes:{style:n},setAttributes:o}=e;return(0,a.createElement)(kg,{values:null==n||null===(t=n.border)||void 0===t?void 0:t.radius,onChange:e=>{let t={...n,border:{...null==n?void 0:n.border,radius:e}};void 0!==e&&""!==e||(t=No(t)),o({style:t})}})}var yg=(0,a.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none"},(0,a.createElement)(O.Path,{d:"M5 11.25h14v1.5H5z"}));var Eg=(0,a.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none"},(0,a.createElement)(O.Path,{fillRule:"evenodd",d:"M5 11.25h3v1.5H5v-1.5zm5.5 0h3v1.5h-3v-1.5zm8.5 0h-3v1.5h3v-1.5z",clipRule:"evenodd"}));var Cg=(0,a.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none"},(0,a.createElement)(O.Path,{fillRule:"evenodd",d:"M5.25 11.25h1.5v1.5h-1.5v-1.5zm3 0h1.5v1.5h-1.5v-1.5zm4.5 0h-1.5v1.5h1.5v-1.5zm1.5 0h1.5v1.5h-1.5v-1.5zm4.5 0h-1.5v1.5h1.5v-1.5z",clipRule:"evenodd"}));const wg=[{label:(0,g.__)("Solid"),icon:yg,value:"solid"},{label:(0,g.__)("Dashed"),icon:Eg,value:"dashed"},{label:(0,g.__)("Dotted"),icon:Cg,value:"dotted"}];function Sg(e){let{onChange:t,value:n}=e;return(0,a.createElement)("fieldset",{className:"components-border-style-control"},(0,a.createElement)("legend",null,(0,g.__)("Style")),(0,a.createElement)("div",{className:"components-border-style-control__buttons"},wg.map((e=>(0,a.createElement)(p.Button,{key:e.value,icon:e.icon,isSmall:!0,isPressed:e.value===n,onClick:()=>t(e.value===n?void 0:e.value),"aria-label":e.label})))))}const Bg=e=>{var t;const{attributes:{style:n},setAttributes:o}=e;return(0,a.createElement)(Sg,{value:null==n||null===(t=n.border)||void 0===t?void 0:t.style,onChange:e=>{const t={...n,border:{...null==n?void 0:n.border,style:e}};o({style:No(t)})}})};const Ig=e=>{const{attributes:{borderColor:t,style:n},setAttributes:o}=e,{width:r,color:l,style:i}=(null==n?void 0:n.border)||{},[s,c]=(0,a.useState)(),[u,d]=(0,a.useState)(),[m,f]=(0,a.useState)(),h=(0,p.__experimentalUseCustomUnits)({availableUnits:Io("spacing.units")||["px","em","rem"]});return(0,a.createElement)(p.__experimentalUnitControl,{value:r,label:(0,g.__)("Width"),min:0,onChange:e=>{let a={...n,border:{...null==n?void 0:n.border,width:e}},p=t;const g=0===parseFloat(e),h=0===parseFloat(r);g&&!h&&(d(t),f(l),c(i),p=void 0,a.border.color=void 0,a.border.style="none"),!g&&h&&("none"===i&&(a.border.style=s),void 0===t&&(p=u,a.border.color=m)),void 0!==e&&""!==e||(a=No(a)),o({borderColor:p,style:a})},units:h})};const xg="__experimentalBorder";function Tg(e){const{clientId:t}=e,n=Io("border.color")&&Ng(e.name,"color"),o=Io("border.radius")&&Ng(e.name,"radius"),l=Io("border.style")&&Ng(e.name,"style"),i=Io("border.width")&&Ng(e.name,"width");if([!n,!o,!l,!i].every(Boolean))return null;const s=(0,r.getBlockSupport)(e.name,[xg,"__experimentalDefaultControls"]),c=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return n=>{var o;return{...n,...t,style:{...n.style,border:{...null===(o=n.style)||void 0===o?void 0:o.border,[e]:void 0}}}}};return(0,a.createElement)(zo,{__experimentalGroup:"border"},i&&(0,a.createElement)(p.__experimentalToolsPanelItem,{className:"single-column",hasValue:()=>function(e){var t,n;return!(null===(t=e.attributes.style)||void 0===t||null===(n=t.border)||void 0===n||!n.width)}(e),label:(0,g.__)("Width"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:Pg(o,"width")})}(e),isShownByDefault:null==s?void 0:s.width,resetAllFilter:c("width"),panelId:t},(0,a.createElement)(Ig,e)),l&&(0,a.createElement)(p.__experimentalToolsPanelItem,{className:"single-column",hasValue:()=>function(e){var t,n;return!(null===(t=e.attributes.style)||void 0===t||null===(n=t.border)||void 0===n||!n.style)}(e),label:(0,g.__)("Style"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:Pg(o,"style")})}(e),isShownByDefault:null==s?void 0:s.style,resetAllFilter:c("style"),panelId:t},(0,a.createElement)(Bg,e)),n&&(0,a.createElement)(p.__experimentalToolsPanelItem,{hasValue:()=>function(e){var t;const{attributes:{borderColor:n,style:o}}=e;return!!n||!(null==o||null===(t=o.border)||void 0===t||!t.color)}(e),label:(0,g.__)("Color"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({borderColor:void 0,style:Pg(o,"color")})}(e),isShownByDefault:null==s?void 0:s.color,resetAllFilter:c("color",{borderColor:void 0}),panelId:t},(0,a.createElement)(rg,e)),o&&(0,a.createElement)(p.__experimentalToolsPanelItem,{hasValue:()=>function(e){var t,n;const o=null===(t=e.attributes.style)||void 0===t||null===(n=t.border)||void 0===n?void 0:n.radius;return"object"==typeof o?Object.entries(o).some(Boolean):!!o}(e),label:(0,g.__)("Radius"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:Pg(o,"radius")})}(e),isShownByDefault:null==s?void 0:s.radius,resetAllFilter:c("radius"),panelId:t},(0,a.createElement)(_g,e)))}function Ng(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,xg);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 Pg(e,t){return No({...e,border:{...null==e?void 0:e.border,[t]:void 0}})}function Mg(e){if(e)return`has-${e}-gradient-background`}function Rg(e,t){const n=(0,u.find)(e,["slug",t]);return n&&n.gradient}function Lg(e,t){return(0,u.find)(e,["gradient",t])}function Ag(e,t){const n=Lg(e,t);return n&&n.slug}function Dg(){let{gradientAttribute:e="gradient",customGradientAttribute:t="customGradient"}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{clientId:n}=Zn(),o=Io("color.gradients.custom"),r=Io("color.gradients.theme"),l=Io("color.gradients.default"),i=(0,a.useMemo)((()=>[...o||[],...r||[],...l||[]]),[o,r,l]),{gradient:s,customGradient:c}=(0,m.useSelect)((o=>{const{getBlockAttributes:r}=o(qn),l=r(n)||{};return{customGradient:l[t],gradient:l[e]}}),[n,e,t]),{updateBlockAttributes:u}=(0,m.useDispatch)(qn),d=(0,a.useCallback)((o=>{const r=Ag(i,o);u(n,r?{[e]:r,[t]:void 0}:{[e]:void 0,[t]:o})}),[i,n,u]),p=Mg(s);let f;return f=s?Rg(i,s):c,{gradientClass:p,gradientValue:f,setGradient:d}}Gu([Uu,ju]);var Og=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 m=s||o,f=c||r;if(!m&&!f)return null;const h=[{color:m,description:(0,g.__)("text color")},{color:f,description:(0,g.__)("link color")}],v=Vu(d),b=v.alpha()<1,k=v.brightness(),_={level:"AA",size:i||!1!==i&&l>=24?"large":"small"};let y="",E="";for(const e of h){if(!e.color)continue;const t=Vu(e.color),n=t.isReadable(v,_),o=t.alpha()<1;if(!n){if(b||o)continue;y=k{let{isOpen:t,onToggle:o}=e;return(0,a.createElement)(p.Button,{onClick:o,"aria-expanded":t,className:c()("block-editor-panel-color-gradient-settings__dropdown",{"is-open":t})},(0,a.createElement)(p.__experimentalHStack,{justify:"flex-start"},(0,a.createElement)(p.ColorIndicator,{className:"block-editor-panel-color-gradient-settings__color-indicator",colorValue:s}),(0,a.createElement)(p.FlexItem,null,n.label)))},renderContent:()=>(0,a.createElement)(Qf,i({showTitle:!1,__experimentalHasMultipleOrigins:!0,__experimentalIsRenderedInSidebar:!0,enableAlpha:!0},l))}))}function zg(e){return e.ownerDocument.defaultView.getComputedStyle(e)}function Vg(e){let{enableAlpha:t=!1,settings:n,clientId:o,enableContrastChecking:r=!0}=e;const[l,i]=(0,a.useState)(),[s,c]=(0,a.useState)(),[u,d]=(0,a.useState)(),p=Eo(o);return(0,a.useEffect)((()=>{var e;if(!r)return;if(!p.current)return;c(zg(p.current).color);const t=null===(e=p.current)||void 0===e?void 0:e.querySelector("a");t&&t.innerText&&d(zg(t).color);let n=p.current,o=zg(n).backgroundColor;for(;"rgba(0, 0, 0, 0)"===o&&n.parentNode&&n.parentNode.nodeType===n.parentNode.ELEMENT_NODE;)n=n.parentNode,o=zg(n).backgroundColor;i(o)})),(0,a.createElement)(zo,{__experimentalGroup:"color"},n.map(((e,n)=>(0,a.createElement)(Fg,{key:n,settings:e,panelId:o,enableAlpha:t}))),r&&(0,a.createElement)(Og,{backgroundColor:l,textColor:s,enableAlphaChecker:t,linkColor:u}))}const Hg="color",Gg=e=>{const t=(0,r.getBlockSupport)(e,Hg);return t&&(!0===t.link||!0===t.gradient||!1!==t.background||!1!==t.text)},Ug=e=>{if("web"!==a.Platform.OS)return!1;const t=(0,r.getBlockSupport)(e,Hg);return(0,u.isObject)(t)&&!!t.link},Wg=e=>{const t=(0,r.getBlockSupport)(e,Hg);return(0,u.isObject)(t)&&!!t.gradients},$g=e=>{const t=(0,r.getBlockSupport)(e,Hg);return t&&!1!==t.background},jg=e=>{const t=(0,r.getBlockSupport)(e,Hg);return t&&!1!==t.text},Kg=e=>t=>{var n,o,r,l,i,a,s,c,u,d;return"background"===e?!!(t.attributes.backgroundColor||null!==(r=t.attributes.style)&&void 0!==r&&null!==(l=r.color)&&void 0!==l&&l.background||t.attributes.gradient||null!==(i=t.attributes.style)&&void 0!==i&&null!==(a=i.color)&&void 0!==a&&a.gradient):"link"===e?!(null===(s=t.attributes.style)||void 0===s||null===(c=s.elements)||void 0===c||null===(u=c.link)||void 0===u||null===(d=u.color)||void 0===d||!d.text):!!t.attributes[`${e}Color`]||!(null===(n=t.attributes.style)||void 0===n||null===(o=n.color)||void 0===o||!o[e])},qg=(e,t)=>No(Po(t,e,void 0)),Yg=e=>({textColor:void 0,style:qg(["color","text"],e.style)}),Qg=e=>({style:qg(["elements","link","color","text"],e.style)}),Xg=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 Zg(e,t,n){var o,r,l,i,a,s;if(!Gg(t)||Ro(t,Hg))return e;const u=Wg(t),{backgroundColor:d,textColor:p,gradient:m,style:f}=n,g=e=>!Ro(t,Hg,e),h=g("text")?ng("color",p):void 0,v=g("gradients")?Mg(m):void 0,b=g("background")?ng("background-color",d):void 0,k=g("background")||g("gradients"),_=d||(null==f||null===(o=f.color)||void 0===o?void 0:o.background)||u&&(m||(null==f||null===(r=f.color)||void 0===r?void 0:r.gradient)),y=c()(e.className,h,v,{[b]:!(u&&null!=f&&null!==(l=f.color)&&void 0!==l&&l.gradient||!b),"has-text-color":g("text")&&(p||(null==f||null===(i=f.color)||void 0===i?void 0:i.text)),"has-background":k&&_,"has-link-color":g("link")&&(null==f||null===(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 Jg=(e,t)=>{const n=/var:preset\|color\|(.+)/.exec(t);return n&&n[1]?eg(e,n[1]).color:t};function eh(e){var t,n,o,l,i,s,c,u,d;const{name:p,attributes:m}=e,f=Io("color.palette.custom"),h=Io("color.palette.theme"),v=Io("color.palette.default"),b=(0,a.useMemo)((()=>[...f||[],...h||[],...v||[]]),[f,h,v]),k=Io("color.gradients.custom"),_=Io("color.gradients.theme"),y=Io("color.gradients.default"),E=(0,a.useMemo)((()=>[...k||[],..._||[],...y||[]]),[k,_,y]),C=Io("color.custom"),w=Io("color.customGradient"),S=Io("color.background"),B=Io("color.link"),I=Io("color.text"),x=C||!h||(null==h?void 0:h.length)>0,T=w||!_||(null==_?void 0:_.length)>0,N=(0,a.useRef)(m);if((0,a.useEffect)((()=>{N.current=m}),[m]),!Gg(p))return null;const P=Ug(p)&&B&&x,M=jg(p)&&I&&x,R=$g(p)&&S&&x,L=Wg(p)&&T;if(!(P||M||R||L))return null;const{style:A,textColor:D,backgroundColor:O,gradient:F}=m;let z;if(L&&F)z=Rg(E,F);else if(L){var V;z=null==A||null===(V=A.color)||void 0===V?void 0:V.gradient}const H=t=>n=>{var o,r;const l=tg(b,n),i=t+"Color",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:No(a),[i]:s};e.setAttributes(c),N.current={...N.current,...c}},G=!("web"!==a.Platform.OS||F||null!=A&&null!==(t=A.color)&&void 0!==t&&t.gradient),U=(0,r.getBlockSupport)(e.name,[Hg,"__experimentalDefaultControls"]);return(0,a.createElement)(Vg,{enableContrastChecking:G,clientId:e.clientId,enableAlpha:!0,settings:[...M?[{label:(0,g.__)("Text"),onColorChange:H("text"),colorValue:eg(b,D,null==A||null===(n=A.color)||void 0===n?void 0:n.text).color,isShownByDefault:null==U?void 0:U.text,hasValue:()=>Kg("text")(e),onDeselect:()=>(e=>{let{attributes:t,setAttributes:n}=e;n({textColor:void 0,style:qg(["color","text"],t.style)})})(e),resetAllFilter:Yg}]:[],...R||L?[{label:(0,g.__)("Background"),onColorChange:R?H("background"):void 0,colorValue:eg(b,O,null==A||null===(o=A.color)||void 0===o?void 0:o.background).color,gradientValue:z,onGradientChange:L?t=>{const n=Ag(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:No(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:No(e),gradient:void 0}}e.setAttributes(o),N.current={...N.current,...o}}:void 0,isShownByDefault:null==U?void 0:U.background,hasValue:()=>Kg("background")(e),onDeselect:()=>(e=>{let{attributes:t,setAttributes:n}=e;n(Xg(t))})(e),resetAllFilter:Xg}]:[],...P?[{label:(0,g.__)("Link"),onColorChange:t=>{const n=tg(b,t),o=null!=n&&n.slug?`var:preset|color|${n.slug}`:t,r=No(Po(A,["elements","link","color","text"],o));e.setAttributes({style:r})},colorValue:Jg(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==U?void 0:U.link,hasValue:()=>Kg("link")(e),onDeselect:()=>(e=>{let{attributes:t,setAttributes:n}=e;n({style:qg(["elements","link","color","text"],t.style)})})(e),resetAllFilter:Qg}]:[]]})}const th=(0,d.createHigherOrderComponent)((e=>t=>{var n;const{name:o,attributes:r}=t,{backgroundColor:l,textColor:s}=r,c=Io("color.palette.custom")||[],u=Io("color.palette.theme")||[],d=Io("color.palette.default")||[],p=(0,a.useMemo)((()=>[...c||[],...u||[],...d||[]]),[c,u,d]);if(!Gg(o)||Ro(o,Hg))return(0,a.createElement)(e,t);const m={};var f,g;s&&!Ro(o,Hg,"text")&&(m.color=null===(f=eg(p,s))||void 0===f?void 0:f.color);l&&!Ro(o,Hg,"background")&&(m.backgroundColor=null===(g=eg(p,l))||void 0===g?void 0:g.color);let h=t.wrapperProps;return h={...t.wrapperProps,style:{...m,...null===(n=t.wrapperProps)||void 0===n?void 0:n.style}},(0,a.createElement)(e,i({},t,{wrapperProps:h}))})),nh={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 Gg(e)?(e.attributes.backgroundColor||Object.assign(e.attributes,{backgroundColor:{type:"string"}}),e.attributes.textColor||Object.assign(e.attributes,{textColor:{type:"string"}}),Wg(e)&&!e.attributes.gradient&&Object.assign(e.attributes,{gradient:{type:"string"}}),e):e})),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/color/addSaveProps",Zg),(0,l.addFilter)("blocks.registerBlockType","core/color/addEditProps",(function(e){if(!Gg(e)||Ro(e,Hg))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),Zg(o,e,n)},e})),(0,l.addFilter)("editor.BlockListBlock","core/color/with-color-palette-styles",th),(0,l.addFilter)("blocks.switchToBlockType.transformedBlock","core/color/addTransforms",(function(e,t,n,o){const r=e.name;return Mo({linkColor:Ug(r),textColor:jg(r),backgroundColor:$g(r),gradient:Wg(r)},nh,e,t,n,o)}));const oh=[{name:(0,g._x)("Regular","font style"),value:"normal"},{name:(0,g._x)("Italic","font style"),value:"italic"}],rh=[{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"}],lh=(e,t)=>e?t?(0,g.__)("Appearance"):(0,g.__)("Font style"):(0,g.__)("Font weight");function ih(e){const{onChange:t,hasFontStyles:n=!0,hasFontWeights:o=!0,value:{fontStyle:r,fontWeight:l}}=e,i=n||o,s=lh(n,o),c={key:"default",name:(0,g.__)("Default"),style:{fontStyle:void 0,fontWeight:void 0}},u=(0,a.useMemo)((()=>n&&o?(()=>{const e=[c];return oh.forEach((t=>{let{name:n,value:o}=t;rh.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=[c];return oh.forEach((t=>{let{name:n,value:o}=t;e.push({key:o,name:n,style:{fontStyle:o,fontWeight:void 0}})})),e})():(()=>{const e=[c];return rh.forEach((t=>{let{name:n,value:o}=t;e.push({key:o,name:n,style:{fontStyle:void 0,fontWeight:o}})})),e})()),[e.options]),d=u.find((e=>e.style.fontStyle===r&&e.style.fontWeight===l))||u[0];return i&&(0,a.createElement)(p.CustomSelectControl,{className:"components-font-appearance-control",label:s,describedBy:d?n?o?(0,g.sprintf)((0,g.__)("Currently selected font appearance: %s"),d.name):(0,g.sprintf)((0,g.__)("Currently selected font style: %s"),d.name):(0,g.sprintf)((0,g.__)("Currently selected font weight: %s"),d.name):(0,g.__)("No selected font appearance"),options:u,value:d,onChange:e=>{let{selectedItem:n}=e;return t(n.style)}})}const ah=1.5,sh=.1;var ch=e=>{let{value:t,onChange:n,__nextHasNoMarginBottom:o=!1,__unstableInputWidth:r="60px"}=e;const l=function(e){return void 0!==e&&""!==e}(t),i=l?t:"";o||Vt()("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 s=o?void 0:{marginBottom:24};return(0,a.createElement)("div",{className:"block-editor-line-height-control",style:s},(0,a.createElement)(p.__experimentalNumberControl,{__unstableInputWidth:r,__unstableStateReducer:(e,t)=>{var n;const o=["insertText","insertFromPaste"].includes(null===(n=t.payload.event.nativeEvent)||void 0===n?void 0:n.inputType),r=((e,t)=>{if(l)return e;switch(`${e}`){case"0.1":return 1.6;case"0":return t?e:1.4;case"":return ah;default:return e}})(e.value,o);return{...e,value:r}},onChange:n,label:(0,g.__)("Line height"),placeholder:ah,step:sh,value:i,min:0}))};const uh="typography.lineHeight";function dh(e){var t;const{attributes:{style:n},setAttributes:o}=e;return(0,a.createElement)(ch,{__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:No(t)})}})}function ph(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!Io("typography.lineHeight");return!(0,r.hasBlockSupport)(e,uh)||t}const mh="typography.__experimentalFontStyle",fh="typography.__experimentalFontWeight";function gh(e){var t,n;const{attributes:{style:o},setAttributes:r}=e,l=!hh(e),i=!vh(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)(ih,{onChange:e=>{r({style:No({...o,typography:{...null==o?void 0:o.typography,fontStyle:e.fontStyle,fontWeight:e.fontWeight}})})},hasFontStyles:l,hasFontWeights:i,value:{fontStyle:s,fontWeight:c}})}function hh(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=(0,r.hasBlockSupport)(e,mh),n=Io("typography.fontStyle");return!t||!n}function vh(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=(0,r.hasBlockSupport)(e,fh),n=Io("typography.fontWeight");return!t||!n}function bh(e){const t=hh(e),n=vh(e);return t&&n}function kh(e){let{value:t="",onChange:n,fontFamilies:o,...r}=e;const l=Io("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)(p.SelectControl,i({label:(0,g.__)("Font family"),options:s,value:t,onChange:n,labelPosition:"top"},r))}const _h="typography.__experimentalFontFamily";function yh(e,t,n){if(!(0,r.hasBlockSupport)(t,_h))return e;if(Ro(t,Jh,"fontFamily"))return e;if(null==n||!n.fontFamily)return e;const o=new(bm())(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 Eh(e){var t;let{setAttributes:n,attributes:{fontFamily:o}}=e;const r=Io("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)(kh,{className:"block-editor-hooks-font-family-control",fontFamilies:r,value:l,onChange:function(e){const t=(0,u.find)(r,(t=>{let{fontFamily:n}=t;return n===e}));n({fontFamily:null==t?void 0:t.slug})}})}function Ch(e){let{name:t}=e;const n=Io("typography.fontFamilies");return!n||0===n.length||!(0,r.hasBlockSupport)(t,_h)}(0,l.addFilter)("blocks.registerBlockType","core/fontFamily/addAttribute",(function(e){return(0,r.hasBlockSupport)(e,_h)?(e.attributes.fontFamily||Object.assign(e.attributes,{fontFamily:{type:"string"}}),e):e})),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/fontFamily/addSaveProps",yh),(0,l.addFilter)("blocks.registerBlockType","core/fontFamily/addEditProps",(function(e){if(!(0,r.hasBlockSupport)(e,_h))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),yh(o,e,n)},e}));const wh=(e,t,n)=>{if(t){const n=(0,u.find)(e,{slug:t});if(n)return n}return{size:n}};function Sh(e,t){const n=(0,u.find)(e,{size:t});return n||{size:t}}function Bh(e){if(e)return`has-${(0,u.kebabCase)(e)}-font-size`}var Ih=function(e){const t=Io("typography.fontSizes"),n=!Io("typography.customFontSize");return(0,a.createElement)(p.FontSizePicker,i({},e,{fontSizes:t,disableCustomFontSizes:n}))};const xh="typography.fontSize";function Th(e,t,n){if(!(0,r.hasBlockSupport)(t,xh))return e;if(Ro(t,Jh,"fontSize"))return e;const o=new(bm())(e.className);o.add(Bh(n.fontSize));const l=o.value;return e.className=l||void 0,e}function Nh(e){var t,n;const{attributes:{fontSize:o,style:r},setAttributes:l}=e,i=Io("typography.fontSizes"),s=wh(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)(Ih,{onChange:e=>{const t=Sh(i,e).slug;l({style:No({...r,typography:{...null==r?void 0:r.typography,fontSize:t?void 0:e}}),fontSize:t})},value:c,withReset:!1})}function Ph(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=Io("typography.fontSizes"),n=!(null==t||!t.length);return!(0,r.hasBlockSupport)(e,xh)||!n}const Mh=(0,d.createHigherOrderComponent)((e=>t=>{var n,o;const l=Io("typography.fontSizes"),{name:i,attributes:{fontSize:s,style:c},wrapperProps:u}=t;if(!(0,r.hasBlockSupport)(i,xh)||Ro(i,Jh,"fontSize")||!s||null!=c&&null!==(n=c.typography)&&void 0!==n&&n.fontSize)return(0,a.createElement)(e,t);const d=wh(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"),Rh={fontSize:[["fontSize"],["style","typography","fontSize"]]};(0,l.addFilter)("blocks.registerBlockType","core/font/addAttribute",(function(e){return(0,r.hasBlockSupport)(e,xh)?(e.attributes.fontSize||Object.assign(e.attributes,{fontSize:{type:"string"}}),e):e})),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/font/addSaveProps",Th),(0,l.addFilter)("blocks.registerBlockType","core/font/addEditProps",(function(e){if(!(0,r.hasBlockSupport)(e,xh))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),Th(o,e,n)},e})),(0,l.addFilter)("editor.BlockListBlock","core/font-size/with-font-size-inline-styles",Mh),(0,l.addFilter)("blocks.switchToBlockType.transformedBlock","core/font-size/addTransforms",(function(e,t,n,o){const l=e.name;return Mo({fontSize:(0,r.hasBlockSupport)(l,xh)},Rh,e,t,n,o)}));var Lh=(0,a.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(O.Path,{d:"M7 18v1h10v-1H7zm5-2c1.5 0 2.6-.4 3.4-1.2.8-.8 1.1-2 1.1-3.5V5H15v5.8c0 1.2-.2 2.1-.6 2.8-.4.7-1.2 1-2.4 1s-2-.3-2.4-1c-.4-.7-.6-1.6-.6-2.8V5H7.5v6.2c0 1.5.4 2.7 1.1 3.5.8.9 1.9 1.3 3.4 1.3z"}));var Ah=(0,a.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(O.Path,{d:"M9.1 9v-.5c0-.6.2-1.1.7-1.4.5-.3 1.2-.5 2-.5.7 0 1.4.1 2.1.3.7.2 1.4.5 2.1.9l.2-1.9c-.6-.3-1.2-.5-1.9-.7-.8-.1-1.6-.2-2.4-.2-1.5 0-2.7.3-3.6 1-.8.7-1.2 1.5-1.2 2.6V9h2zM20 12H4v1h8.3c.3.1.6.2.8.3.5.2.9.5 1.1.8.3.3.4.7.4 1.2 0 .7-.2 1.1-.8 1.5-.5.3-1.2.5-2.1.5-.8 0-1.6-.1-2.4-.3-.8-.2-1.5-.5-2.2-.8L7 18.1c.5.2 1.2.4 2 .6.8.2 1.6.3 2.4.3 1.7 0 3-.3 3.9-1 .9-.7 1.3-1.6 1.3-2.8 0-.9-.2-1.7-.7-2.2H20v-1z"}));const Dh=[{name:(0,g.__)("Underline"),value:"underline",icon:Lh},{name:(0,g.__)("Strikethrough"),value:"line-through",icon:Ah}];function Oh(e){let{value:t,onChange:n}=e;return(0,a.createElement)("fieldset",{className:"block-editor-text-decoration-control"},(0,a.createElement)("legend",null,(0,g.__)("Decoration")),(0,a.createElement)("div",{className:"block-editor-text-decoration-control__buttons"},Dh.map((e=>(0,a.createElement)(p.Button,{key:e.value,icon:e.icon,isSmall:!0,isPressed:e.value===t,onClick:()=>n(e.value===t?void 0:e.value),"aria-label":e.name})))))}const Fh="typography.__experimentalTextDecoration";function zh(e){var t;const{attributes:{style:n},setAttributes:o}=e;return(0,a.createElement)(Oh,{value:null==n||null===(t=n.typography)||void 0===t?void 0:t.textDecoration,onChange:function(e){o({style:No({...n,typography:{...null==n?void 0:n.typography,textDecoration:e}})})}})}function Vh(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!(0,r.hasBlockSupport)(e,Fh),n=Io("typography.textDecoration");return t||!n}var Hh=(0,a.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(O.Path,{d:"M6.1 6.8L2.1 18h1.6l1.1-3h4.3l1.1 3h1.6l-4-11.2H6.1zm-.8 6.8L7 8.9l1.7 4.7H5.3zm15.1-.7c-.4-.5-.9-.8-1.6-1 .4-.2.7-.5.8-.9.2-.4.3-.9.3-1.4 0-.9-.3-1.6-.8-2-.6-.5-1.3-.7-2.4-.7h-3.5V18h4.2c1.1 0 2-.3 2.6-.8.6-.6 1-1.4 1-2.4-.1-.8-.3-1.4-.6-1.9zm-5.7-4.7h1.8c.6 0 1.1.1 1.4.4.3.2.5.7.5 1.3 0 .6-.2 1.1-.5 1.3-.3.2-.8.4-1.4.4h-1.8V8.2zm4 8c-.4.3-.9.5-1.5.5h-2.6v-3.8h2.6c1.4 0 2 .6 2 1.9.1.6-.1 1-.5 1.4z"}));var Gh=(0,a.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(O.Path,{d:"M11 16.8c-.1-.1-.2-.3-.3-.5v-2.6c0-.9-.1-1.7-.3-2.2-.2-.5-.5-.9-.9-1.2-.4-.2-.9-.3-1.6-.3-.5 0-1 .1-1.5.2s-.9.3-1.2.6l.2 1.2c.4-.3.7-.4 1.1-.5.3-.1.7-.2 1-.2.6 0 1 .1 1.3.4.3.2.4.7.4 1.4-1.2 0-2.3.2-3.3.7s-1.4 1.1-1.4 2.1c0 .7.2 1.2.7 1.6.4.4 1 .6 1.8.6.9 0 1.7-.4 2.4-1.2.1.3.2.5.4.7.1.2.3.3.6.4.3.1.6.1 1.1.1h.1l.2-1.2h-.1c-.4.1-.6 0-.7-.1zM9.2 16c-.2.3-.5.6-.9.8-.3.1-.7.2-1.1.2-.4 0-.7-.1-.9-.3-.2-.2-.3-.5-.3-.9 0-.6.2-1 .7-1.3.5-.3 1.3-.4 2.5-.5v2zm10.6-3.9c-.3-.6-.7-1.1-1.2-1.5-.6-.4-1.2-.6-1.9-.6-.5 0-.9.1-1.4.3-.4.2-.8.5-1.1.8V6h-1.4v12h1.3l.2-1c.2.4.6.6 1 .8.4.2.9.3 1.4.3.7 0 1.2-.2 1.8-.5.5-.4 1-.9 1.3-1.5.3-.6.5-1.3.5-2.1-.1-.6-.2-1.3-.5-1.9zm-1.7 4c-.4.5-.9.8-1.6.8s-1.2-.2-1.7-.7c-.4-.5-.7-1.2-.7-2.1 0-.9.2-1.6.7-2.1.4-.5 1-.7 1.7-.7s1.2.3 1.6.8c.4.5.6 1.2.6 2s-.2 1.4-.6 2z"}));var Uh=(0,a.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(O.Path,{d:"M7.1 6.8L3.1 18h1.6l1.1-3h4.3l1.1 3h1.6l-4-11.2H7.1zm-.8 6.8L8 8.9l1.7 4.7H6.3zm14.5-1.5c-.3-.6-.7-1.1-1.2-1.5-.6-.4-1.2-.6-1.9-.6-.5 0-.9.1-1.4.3-.4.2-.8.5-1.1.8V6h-1.4v12h1.3l.2-1c.2.4.6.6 1 .8.4.2.9.3 1.4.3.7 0 1.2-.2 1.8-.5.5-.4 1-.9 1.3-1.5.3-.6.5-1.3.5-2.1-.1-.6-.2-1.3-.5-1.9zm-1.7 4c-.4.5-.9.8-1.6.8s-1.2-.2-1.7-.7c-.4-.5-.7-1.2-.7-2.1 0-.9.2-1.6.7-2.1.4-.5 1-.7 1.7-.7s1.2.3 1.6.8c.4.5.6 1.2.6 2 .1.8-.2 1.4-.6 2z"}));const Wh=[{name:(0,g.__)("Uppercase"),value:"uppercase",icon:Hh},{name:(0,g.__)("Lowercase"),value:"lowercase",icon:Gh},{name:(0,g.__)("Capitalize"),value:"capitalize",icon:Uh}];function $h(e){let{value:t,onChange:n}=e;return(0,a.createElement)("fieldset",{className:"block-editor-text-transform-control"},(0,a.createElement)("legend",null,(0,g.__)("Letter case")),(0,a.createElement)("div",{className:"block-editor-text-transform-control__buttons"},Wh.map((e=>(0,a.createElement)(p.Button,{key:e.value,icon:e.icon,isSmall:!0,isPressed:t===e.value,"aria-label":e.name,onClick:()=>n(t===e.value?void 0:e.value)})))))}const jh="typography.__experimentalTextTransform";function Kh(e){var t;const{attributes:{style:n},setAttributes:o}=e;return(0,a.createElement)($h,{value:null==n||null===(t=n.typography)||void 0===t?void 0:t.textTransform,onChange:function(e){o({style:No({...n,typography:{...null==n?void 0:n.typography,textTransform:e}})})}})}function qh(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!(0,r.hasBlockSupport)(e,jh),n=Io("typography.textTransform");return t||!n}function Yh(e){let{value:t,onChange:n,__unstableInputWidth:o="60px"}=e;const r=(0,p.__experimentalUseCustomUnits)({availableUnits:Io("spacing.units")||["px","em","rem"],defaultValues:{px:2,em:.2,rem:.2}});return(0,a.createElement)(p.__experimentalUnitControl,{label:(0,g.__)("Letter spacing"),value:t,__unstableInputWidth:o,units:r,onChange:n})}const Qh="typography.__experimentalLetterSpacing";function Xh(e){var t;const{attributes:{style:n},setAttributes:o}=e;return(0,a.createElement)(Yh,{value:null==n||null===(t=n.typography)||void 0===t?void 0:t.letterSpacing,onChange:function(e){o({style:No({...n,typography:{...null==n?void 0:n.typography,letterSpacing:e}})})},__unstableInputWidth:"100%"})}function Zh(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!(0,r.hasBlockSupport)(e,Qh),n=Io("typography.letterSpacing");return t||!n}const Jh="typography",ev=[uh,xh,mh,fh,_h,Fh,jh,Qh];function tv(e){const{clientId:t}=e,n=Ch(e),o=Ph(e),l=bh(e),i=ph(e),s=Vh(e),c=qh(e),u=Zh(e),d=!hh(e),m=!vh(e),f=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=[bh(e),Ph(e),ph(e),Ch(e),Vh(e),qh(e),Zh(e)];return t.filter(Boolean).length===t.length}(e),h=nv(e.name);if(f||!h)return null;const v=(0,r.getBlockSupport)(e.name,[Jh,"__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)(zo,{__experimentalGroup:"typography"},!n&&(0,a.createElement)(p.__experimentalToolsPanelItem,{hasValue:()=>function(e){return!!e.attributes.fontFamily}(e),label:(0,g.__)("Font family"),onDeselect:()=>function(e){let{setAttributes:t}=e;t({fontFamily:void 0})}(e),isShownByDefault:null==v?void 0:v.fontFamily,resetAllFilter:e=>({...e,fontFamily:void 0}),panelId:t},(0,a.createElement)(Eh,e)),!o&&(0,a.createElement)(p.__experimentalToolsPanelItem,{hasValue:()=>function(e){var t;const{fontSize:n,style:o}=e.attributes;return!!n||!(null==o||null===(t=o.typography)||void 0===t||!t.fontSize)}(e),label:(0,g.__)("Font size"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({fontSize:void 0,style:No({...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)(Nh,e)),!l&&(0,a.createElement)(p.__experimentalToolsPanelItem,{className:"single-column",hasValue:()=>function(e){var t;const{fontStyle:n,fontWeight:o}=(null===(t=e.attributes.style)||void 0===t?void 0:t.typography)||{};return!!n||!!o}(e),label:lh(d,m),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:No({...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)(gh,e)),!i&&(0,a.createElement)(p.__experimentalToolsPanelItem,{className:"single-column",hasValue:()=>function(e){var t,n;return!(null===(t=e.attributes.style)||void 0===t||null===(n=t.typography)||void 0===n||!n.lineHeight)}(e),label:(0,g.__)("Line height"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:No({...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)(dh,e)),!s&&(0,a.createElement)(p.__experimentalToolsPanelItem,{className:"single-column",hasValue:()=>function(e){var t,n;return!(null===(t=e.attributes.style)||void 0===t||null===(n=t.typography)||void 0===n||!n.textDecoration)}(e),label:(0,g.__)("Decoration"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:No({...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)(zh,e)),!c&&(0,a.createElement)(p.__experimentalToolsPanelItem,{className:"single-column",hasValue:()=>function(e){var t,n;return!(null===(t=e.attributes.style)||void 0===t||null===(n=t.typography)||void 0===n||!n.textTransform)}(e),label:(0,g.__)("Letter case"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:No({...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)(Kh,e)),!u&&(0,a.createElement)(p.__experimentalToolsPanelItem,{className:"single-column",hasValue:()=>function(e){var t,n;return!(null===(t=e.attributes.style)||void 0===t||null===(n=t.typography)||void 0===n||!n.letterSpacing)}(e),label:(0,g.__)("Letter spacing"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:No({...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)(Xh,e)))}const nv=e=>ev.some((t=>(0,r.hasBlockSupport)(e,t)));const ov=[...ev,xg,Hg,jo],rv=e=>ov.some((t=>(0,r.hasBlockSupport)(e,t))),lv="var:";function iv(e){if((0,u.startsWith)(e,lv)){return`var(--wp--${e.slice(lv.length).split("|").join("--")})`}return e}function av(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=["spacing.blockGap"],n={};Object.keys(r.__EXPERIMENTAL_STYLE_PROPERTY).forEach((o=>{const l=r.__EXPERIMENTAL_STYLE_PROPERTY[o].value,i=r.__EXPERIMENTAL_STYLE_PROPERTY[o].properties;if((0,u.has)(e,l)&&"elements"!==(0,u.first)(l)){const a=(0,u.get)(e,l);r.__EXPERIMENTAL_STYLE_PROPERTY[o].useEngine||(i&&!(0,u.isString)(a)?Object.entries(i).forEach((e=>{const[t,o]=e,r=(0,u.get)(a,[o]);r&&(n[t]=iv(r))})):t.includes(l.join("."))||(n[o]=iv((0,u.get)(e,l))))}}));const o=Zr(e,{selector:"self"});return o.forEach((e=>{if("self"!==e.selector)throw"This style can't be added as inline style";n[e.key]=e.value})),n}const sv={[`${xg}.__experimentalSkipSerialization`]:["border"],"color.__experimentalSkipSerialization":[Hg],[`${Jh}.__experimentalSkipSerialization`]:[Jh],[`${jo}.__experimentalSkipSerialization`]:["spacing"]},cv={...sv,[`${jo}`]:["spacing.blockGap"]},uv={gradients:"gradient"};function dv(e,t,n){let o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:cv;if(!rv(t))return e;let{style:l}=n;return(0,u.forEach)(o,((e,n)=>{const o=(0,r.getBlockSupport)(t,n);!0===o&&(l=(0,u.omit)(l,e)),Array.isArray(o)&&o.forEach((t=>{const n=uv[t]||t;l=(0,u.omit)(l,[[...e,n]])}))})),e.style={...av(l),...e.style},e}const pv=(0,d.createHigherOrderComponent)((e=>t=>{const n=Jn();return(0,a.createElement)(a.Fragment,null,n&&(0,a.createElement)(a.Fragment,null,(0,a.createElement)(eh,t),(0,a.createElement)(tv,t),(0,a.createElement)(Tg,t),(0,a.createElement)(Yo,t)),(0,a.createElement)(e,t))}),"withToolbarControls"),mv=(0,d.createHigherOrderComponent)((e=>t=>{var n,o;const l=`wp-elements-${(0,d.useInstanceId)(e)}`,s=Ro(t.name,Hg,"link")?(0,u.omit)(null===(n=t.attributes.style)||void 0===n?void 0:n.elements,["link"]):null===(o=t.attributes.style)||void 0===o?void 0:o.elements,p=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(0,u.map)(t,((t,n)=>{const o=av(t);return(0,u.isEmpty)(o)?"":[`.editor-styles-wrapper .${e} ${r.__EXPERIMENTAL_ELEMENTS[n]}{`,...(0,u.map)(o,((e,t)=>`\t${(0,u.kebabCase)(t)}: ${e};`)),"}"].join("\n")})).join("\n")}(l,s),m=(0,a.useContext)(Wf.__unstableElementContext);return(0,a.createElement)(a.Fragment,null,s&&m&&(0,a.createPortal)((0,a.createElement)("style",{dangerouslySetInnerHTML:{__html:p}}),m),(0,a.createElement)(e,i({},t,{className:s?c()(t.className,l):t.className})))}));(0,l.addFilter)("blocks.registerBlockType","core/style/addAttribute",(function(e){return rv(e)?(e.attributes.style||Object.assign(e.attributes,{style:{type:"object"}}),e):e})),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/style/addSaveProps",dv),(0,l.addFilter)("blocks.registerBlockType","core/style/addEditProps",(function(e){if(!rv(e))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),dv(o,e,n,sv)},e})),(0,l.addFilter)("editor.BlockEdit","core/style/with-block-controls",pv),(0,l.addFilter)("editor.BlockListBlock","core/editor/with-elements-styles",mv);var fv=function(e){let{colorPalette:t,duotonePalette:n,disableCustomColors:o,disableCustomDuotone:r,value:l,onChange:i}=e;return(0,a.createElement)(p.Dropdown,{popoverProps:{className:"block-editor-duotone-control__popover",headerTitle:(0,g.__)("Duotone"),isAlternate:!0},renderToggle:e=>{let{isOpen:t,onToggle:n}=e;return(0,a.createElement)(p.ToolbarButton,{showTooltip:!0,onClick:n,"aria-haspopup":"true","aria-expanded":t,onKeyDown:e=>{t||e.keyCode!==Tc.DOWN||(e.preventDefault(),n())},label:(0,g.__)("Apply duotone filter"),icon:(0,a.createElement)(p.DuotoneSwatch,{values:l})})},renderContent:()=>(0,a.createElement)(p.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)(p.DuotonePicker,{colorPalette:t,duotonePalette:n,disableCustomColors:o,disableCustomDuotone:r,value:l,onChange:i}))})};const gv=[];function hv(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t={r:[],g:[],b:[],a:[]};return e.forEach((e=>{const n=Vu(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 vv(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 bv(e){let{id:t,values:n}=e;return(0,a.createElement)(p.SVG,{xmlnsXlink:"http://www.w3.org/1999/xlink",viewBox:"0 0 0 0",width:"0",height:"0",focusable:"false",role:"none",style:{visibility:"hidden",position:"absolute",left:"-9999px",overflow:"hidden"}},(0,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:n.r.join(" ")}),(0,a.createElement)("feFuncG",{type:"table",tableValues:n.g.join(" ")}),(0,a.createElement)("feFuncB",{type:"table",tableValues:n.b.join(" ")}),(0,a.createElement)("feFuncA",{type:"table",tableValues:n.a.join(" ")})),(0,a.createElement)("feComposite",{in2:"SourceGraphic",operator:"in"}))))}function kv(e){let{selector:t,id:n,values:o}=e;return(0,a.createElement)(a.Fragment,null,(0,a.createElement)(bv,{id:n,values:o}),(0,a.createElement)(vv,{id:n,selector:t}))}function _v(e){let{presetSetting:t,defaultSetting:n}=e;const o=!Io(n),r=Io(`${t}.custom`)||gv,l=Io(`${t}.theme`)||gv,i=Io(`${t}.default`)||gv;return(0,a.useMemo)((()=>[...r,...l,...o?gv:i]),[o,r,l,i])}function yv(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=_v({presetSetting:"color.duotone",defaultSetting:"color.defaultDuotone"}),s=_v({presetSetting:"color.palette",defaultSetting:"color.defaultPalette"}),c=!Io("color.custom"),u=!Io("color.customDuotone")||0===(null==s?void 0:s.length)&&c;return 0===(null==i?void 0:i.length)&&u?null:(0,a.createElement)(ro,{group:"block",__experimentalShareWithChildBlocks:!0},(0,a.createElement)(fv,{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})}}))}Gu([Uu]);const Ev=(0,d.createHigherOrderComponent)((e=>t=>{const n=(0,r.hasBlockSupport)(t.name,"color.__experimentalDuotone");return(0,a.createElement)(a.Fragment,null,(0,a.createElement)(e,t),n&&(0,a.createElement)(yv,t))}),"withDuotoneControls");const Cv=(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)(Wf.__unstableElementContext);return(0,a.createElement)(a.Fragment,null,g&&(0,a.createPortal)((0,a.createElement)(kv,{selector:m,id:p,values:hv(u)}),g),(0,a.createElement)(e,i({},t,{className:f})))}),"withDuotoneStyles");function wv(e){let{preset:t}=e;return(0,a.createElement)(bv,{id:`wp-duotone-${t.slug}`,values:hv(t.colors)})}(0,l.addFilter)("blocks.registerBlockType","core/editor/duotone/add-attributes",(function(e){return(0,r.hasBlockSupport)(e,"color.__experimentalDuotone")?(e.attributes.style||Object.assign(e.attributes,{style:{type:"object"}}),e):e})),(0,l.addFilter)("editor.BlockEdit","core/editor/duotone/with-editor-controls",Ev),(0,l.addFilter)("editor.BlockListBlock","core/editor/duotone/with-styles",Cv);const Sv="__experimentalLayout";function Bv(e){let{setAttributes:t,attributes:n,name:o}=e;const{layout:l}=n,i=Io("layout"),s=(0,m.useSelect)((e=>{const{getSettings:t}=e(qn);return t().supportsLayout}),[]),c=(0,r.getBlockSupport)(o,Sv,{}),{allowSwitching:u,allowEditing:d=!0,allowInheriting:f=!0,default:h}=c;if(!d)return null;const v=!(!f||!i||null!=l&&l.type&&"default"!==(null==l?void 0:l.type)&&(null==l||!l.inherit)),b=l||h||{},{inherit:k=!1,type:_="default"}=b;if("default"===_&&!s)return null;const y=Ir(_),E=e=>t({layout:e});return(0,a.createElement)(a.Fragment,null,(0,a.createElement)(zo,null,(0,a.createElement)(p.PanelBody,{title:(0,g.__)("Layout")},v&&(0,a.createElement)(p.ToggleControl,{label:(0,g.__)("Inherit default layout"),checked:!!k,onChange:()=>t({layout:{inherit:!k}})}),!k&&u&&(0,a.createElement)(Iv,{type:_,onChange:e=>t({layout:{type:e}})}),!k&&y&&(0,a.createElement)(y.inspectorControls,{layout:b,onChange:E,layoutBlockSupport:c}))),!k&&y&&(0,a.createElement)(y.toolBarControls,{layout:b,onChange:E,layoutBlockSupport:c}))}function Iv(e){let{type:t,onChange:n}=e;return(0,a.createElement)(p.ButtonGroup,null,Br.map((e=>{let{name:o,label:r}=e;return(0,a.createElement)(p.Button,{key:o,isPressed:t===o,onClick:()=>n(o)},r)})))}const xv=(0,d.createHigherOrderComponent)((e=>t=>{const{name:n}=t;return[(0,r.hasBlockSupport)(n,Sv)&&(0,a.createElement)(Bv,i({key:"layout"},t)),(0,a.createElement)(e,i({key:"edit"},t))]}),"withInspectorControls"),Tv=(0,d.createHigherOrderComponent)((e=>t=>{const{name:n,attributes:o}=t,l=(0,r.hasBlockSupport)(n,Sv),s=(0,d.useInstanceId)(e),p=Io("layout")||{},m=(0,a.useContext)(Wf.__unstableElementContext),{layout:f}=o,{default:g}=(0,r.getBlockSupport)(n,Sv)||{},h=null!=f&&f.inherit?p:f||g||{},v=l?function(e){var t,n,o;const r=[];return e.layout?(null!=e&&null!==(t=e.layout)&&void 0!==t&&t.orientation&&r.push(`is-${(0,u.kebabCase)(e.layout.orientation)}`),null!=e&&null!==(n=e.layout)&&void 0!==n&&n.justifyContent&&r.push(`is-content-justification-${(0,u.kebabCase)(e.layout.justifyContent)}`),null!=e&&null!==(o=e.layout)&&void 0!==o&&o.flexWrap&&"nowrap"===e.layout.flexWrap&&r.push("is-nowrap"),r):r}(o):null,b=c()(null==t?void 0:t.className,{[`wp-container-${s}`]:l},v);return(0,a.createElement)(a.Fragment,null,l&&m&&(0,a.createPortal)((0,a.createElement)(Mr,{blockName:n,selector:`.wp-container-${s}`,layout:h,style:null==o?void 0:o.style}),m),(0,a.createElement)(e,i({},t,{className:b})))}));(0,l.addFilter)("blocks.registerBlockType","core/layout/addAttribute",(function(e){return(0,u.has)(e.attributes,["layout","type"])||(0,r.hasBlockSupport)(e,Sv)&&(e.attributes={...e.attributes,layout:{type:"object"}}),e})),(0,l.addFilter)("editor.BlockListBlock","core/editor/layout/with-layout-styles",Tv),(0,l.addFilter)("editor.BlockEdit","core/editor/layout/with-inspector-controls",xv);const Nv=[];function Pv(e){var t;let{borderColor:n,style:o}=e;const r=(null==o?void 0:o.border)||{},l=ng("border-color",n);return{className:c()({[l]:!!l,"has-border-color":n||(null==o||null===(t=o.border)||void 0===t?void 0:t.color)})||void 0,style:av({border:r})}}function Mv(e){const t=Io("color.palette")||Nv,n=Pv(e);if(e.borderColor){const o=eg(t,e.borderColor);n.style.borderColor=o.color}return n}function Rv(e){var t,n,o,r,l,i;const{backgroundColor:a,textColor:s,gradient:u,style:d}=e,p=ng("background-color",a),m=ng("color",s),f=Mg(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:av({color:(null==d?void 0:d.color)||{}})}}const Lv={};function Av(e){const{backgroundColor:t,textColor:n,gradient:o}=e,r=Io("color.palette.custom")||[],l=Io("color.palette.theme")||[],i=Io("color.palette.default")||[],s=Io("color.gradients")||Lv,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=Rv(e);if(t){const e=eg(c,t);d.style.backgroundColor=e.color}if(o&&(d.style.background=Rg(u,o)),n){const e=eg(c,n);d.style.color=e.color}return d}function Dv(e){const{style:t}=e;return{style:av({spacing:(null==t?void 0:t.spacing)||{}})}}function Ov(e){const[t,n]=(0,a.useState)(e);return(0,a.useEffect)((()=>{e&&n(e)}),[e]),t}const Fv=e=>(0,d.createHigherOrderComponent)((t=>n=>(0,a.createElement)(t,i({},n,{colors:e}))),"withCustomColorPalette"),zv=()=>(0,d.createHigherOrderComponent)((e=>t=>{const n=Io("color.palette.custom"),o=Io("color.palette.theme"),r=Io("color.palette.default"),l=(0,a.useMemo)((()=>[...n||[],...o||[],...r||[]]),[n,o,r]);return(0,a.createElement)(e,i({},t,{colors:l}))}),"withEditorColorPalette");function Vv(e,t){const n=(0,u.reduce)(e,((e,t)=>({...e,...(0,u.isString)(t)?{[t]:(0,u.kebabCase)(t)}:t})),{});return(0,d.compose)([t,e=>class extends 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=Vu(t);return(0,u.maxBy)(e,(e=>{let{color:t}=e;return n.contrast(t)})).color}(t,e)}createSetters(){return(0,u.reduce)(n,((e,t,n)=>{const o=(0,u.upperFirst)(n),r=`custom${o}`;return e[`set${o}`]=this.createSetColor(n,r),e}),{})}createSetColor(e,t){return n=>{const o=tg(this.props.colors,n);this.props.setAttributes({[e]:o&&o.slug?o.slug:void 0,[t]:o&&o.slug?void 0:n})}}static getDerivedStateFromProps(e,t){let{attributes:o,colors:r}=e;return(0,u.reduce)(n,((e,n,l)=>{const i=eg(r,o[l],o[`custom${(0,u.upperFirst)(l)}`]),a=t[l];return(null==a?void 0:a.color)===i.color&&a?e[l]=a:e[l]={...i,class:ng(n,i.slug)},e}),{})}render(){return(0,a.createElement)(e,i({},this.props,{colors:void 0},this.state,this.setters,{colorUtils:this.colorUtils}))}}])}function Hv(e){return function(){const t=Fv(e);for(var n=arguments.length,o=new Array(n),r=0;r(e[t]=`custom${(0,u.upperFirst)(t)}`,e)),{});return(0,d.createHigherOrderComponent)((0,d.compose)([(0,d.createHigherOrderComponent)((e=>t=>{const n=Io("typography.fontSizes")||Uv;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${(0,u.upperFirst)(n)}`]=this.createSetFontSize(n,t),e)),{})}createSetFontSize(e,t){return n=>{const o=(0,u.find)(this.props.fontSizes,{size:Number(n)});this.props.setAttributes({[e]:o&&o.slug?o.slug:void 0,[t]:o&&o.slug?void 0:n})}}static getDerivedStateFromProps(e,t){let{attributes:n,fontSizes:r}=e;const l=(e,o)=>!t[o]||(n[o]?n[o]!==t[o].slug:t[o].size!==n[e]);if(!(0,u.some)(o,l))return null;const i=(0,u.reduce)((0,u.pickBy)(o,l),((e,t,o)=>{const l=n[o],i=wh(r,l,n[t]);return e[o]={...i,class:Bh(l)},e}),{});return{...t,...i}}render(){return(0,a.createElement)(e,i({},this.props,{fontSizes:void 0},this.state,this.setters))}}]),"withFontSizes")};var $v=(0,a.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(O.Path,{d:"M4 19.8h8.9v-1.5H4v1.5zm8.9-15.6H4v1.5h8.9V4.2zm-8.9 7v1.5h16v-1.5H4z"}));var jv=(0,a.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(O.Path,{d:"M16.4 4.2H7.6v1.5h8.9V4.2zM4 11.2v1.5h16v-1.5H4zm3.6 8.6h8.9v-1.5H7.6v1.5z"}));var Kv=(0,a.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(O.Path,{d:"M11.1 19.8H20v-1.5h-8.9v1.5zm0-15.6v1.5H20V4.2h-8.9zM4 12.8h16v-1.5H4v1.5z"}));const qv=[{icon:$v,title:(0,g.__)("Align text left"),align:"left"},{icon:jv,title:(0,g.__)("Align text center"),align:"center"},{icon:Kv,title:(0,g.__)("Align text right"),align:"right"}],Yv={position:"bottom right",isAlternate:!0};var Qv=function(e){let{value:t,onChange:n,alignmentControls:o=qv,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 m=(0,u.find)(o,(e=>e.align===t)),f=c?p.ToolbarGroup:p.ToolbarDropdownMenu,h=c?{isCollapsed:s}:{};return(0,a.createElement)(f,i({icon:m?m.icon:(0,g.isRTL)()?Kv:$v,label:r,toggleProps:{describedBy:l},popoverProps:Yv,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 Xv=e=>(0,a.createElement)(Qv,i({},e,{isToolbar:!1})),Zv=e=>(0,a.createElement)(Qv,i({},e,{isToolbar:!0}));var Jv={name:"blocks",className:"block-editor-autocompleters__block",triggerPrefix:"/",useItems(e){const{rootClientId:t,selectedBlockName:n}=(0,m.useSelect)((e=>{const{getSelectedBlockClientId:t,getBlockName:n,getBlockInsertionPoint:o}=e(qn),r=t();return{selectedBlockName:r?n(r):null,rootClientId:o().rootClientId}}),[]),[o,r,l]=Ld(t,u.noop),i=(0,a.useMemo)((()=>(e.trim()?rp(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)(Wc,{key:"icon",icon:n,showColors:!0}),t),isDisabled:o}}))),[i]);return[s]},allowContext:(e,t)=>!(/\S/.test(e)||/\S/.test(t)),getOptionCompletion(e){const{name:t,initialAttributes:n,innerBlocks:o}=e;return{action:"replace",value:(0,r.createBlock)(t,n,(0,r.createBlocksFromInnerBlocksTemplate)(o))}}},eb=window.wp.apiFetch,tb=n.n(eb);var nb=(0,a.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(O.Path,{d:"M7 5.5h10a.5.5 0 01.5.5v12a.5.5 0 01-.5.5H7a.5.5 0 01-.5-.5V6a.5.5 0 01.5-.5zM17 4H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V6a2 2 0 00-2-2zm-1 3.75H8v1.5h8v-1.5zM8 11h8v1.5H8V11zm6 3.25H8v1.5h6v-1.5z"}));var ob=(0,a.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(O.Path,{d:"m7.3 9.7 1.4 1.4c.2-.2.3-.3.4-.5 0 0 0-.1.1-.1.3-.5.4-1.1.3-1.6L12 7 9 4 7.2 6.5c-.6-.1-1.1 0-1.6.3 0 0-.1 0-.1.1-.3.1-.4.2-.6.4l1.4 1.4L4 11v1h1l2.3-2.3zM4 20h9v-1.5H4V20zm0-5.5V16h16v-1.5H4z"}));var rb={name:"links",className:"block-editor-autocompleters__link",triggerPrefix:"[[",options:async e=>{let t=await tb()({path:(0,mp.addQueryArgs)("/wp/v2/search",{per_page:10,search:e,type:"post",order_by:"menu_order"})});return t=t.filter((e=>""!==e.title)),t},getOptionKeywords:e=>[...e.title.split(/\s+/)],getOptionLabel:e=>(0,a.createElement)(a.Fragment,null,(0,a.createElement)(wr,{key:"icon",icon:"page"===e.subtype?nb:ob}),e.title),getOptionCompletion:e=>(0,a.createElement)("a",{href:e.url},e.title)};const lb=[];function ib(e){let{completers:t=lb}=e;const{name:n}=Zn();return(0,a.useMemo)((()=>{let e=t;return(n===(0,r.getDefaultBlockName)()||(0,r.getBlockSupport)(n,"__experimentalSlashInserter",!1))&&(e=e.concat([Jv,rb])),(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 ab=function(e){return(0,a.createElement)(p.Autocomplete,i({},e,{completers:ib(e)}))};var sb=(0,a.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(O.Path,{d:"M4.2 9h1.5V5.8H9V4.2H4.2V9zm14 9.2H15v1.5h4.8V15h-1.5v3.2zM15 4.2v1.5h3.2V9h1.5V4.2H15zM5.8 15H4.2v4.8H9v-1.5H5.8V15z"}));var cb=function(e){let{isActive:t,label:n=(0,g.__)("Toggle full height"),onToggle:o,isDisabled:r}=e;return(0,a.createElement)(p.ToolbarButton,{isActive:t,icon:sb,label:n,onClick:()=>o(!t),disabled:r})};var ub=function(e){const{label:t=(0,g.__)("Change matrix alignment"),onChange:n=u.noop,value:o="center",isDisabled:r}=e,l=(0,a.createElement)(p.__experimentalAlignmentMatrixControl.Icon,{value:o}),i="block-editor-block-alignment-matrix-control",s=`${i}__popover`;return(0,a.createElement)(p.Dropdown,{position:"bottom right",className:i,popoverProps:{className:s,isAlternate:!0},renderToggle:e=>{let{onToggle:n,isOpen:o}=e;return(0,a.createElement)(p.ToolbarButton,{onClick:n,"aria-haspopup":"true","aria-expanded":o,onKeyDown:e=>{o||e.keyCode!==Tc.DOWN||(e.preventDefault(),n())},label:t,icon:l,showTooltip:!0,disabled:r})},renderContent:()=>(0,a.createElement)(p.__experimentalAlignmentMatrixControl,{hasFocusBorder:!1,onChange:n,value:o})})};var db=(0,a.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(O.Path,{d:"M10.8622 8.04053L14.2805 12.0286L10.8622 16.0167L9.72327 15.0405L12.3049 12.0286L9.72327 9.01672L10.8622 8.04053Z"}));var pb=function(e){let{rootLabelText:t}=e;const{selectBlock:n,clearSelectedBlock:o}=(0,m.useDispatch)(qn),{clientId:r,parents:l,hasSelection:i}=(0,m.useSelect)((e=>{const{getSelectionStart:t,getSelectedBlockClientId:n,getBlockParents:o}=e(qn),r=n();return{parents:o(r),clientId:r,hasSelection:!!t().clientId}}),[]),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)(p.Button,{className:"block-editor-block-breadcrumb__button",variant:"tertiary",onClick:o},s),!i&&s,!!r&&(0,a.createElement)(wr,{icon:db,className:"block-editor-block-breadcrumb__separator"})),l.map((e=>(0,a.createElement)("li",{key:e},(0,a.createElement)(p.Button,{className:"block-editor-block-breadcrumb__button",variant:"tertiary",onClick:()=>n(e)},(0,a.createElement)(Wp,{clientId:e,maximumLength:35})),(0,a.createElement)(wr,{icon:db,className:"block-editor-block-breadcrumb__separator"})))),!!r&&(0,a.createElement)("li",{className:"block-editor-block-breadcrumb__current","aria-current":"true"},(0,a.createElement)(Wp,{clientId:r,maximumLength:35})))};function mb(e){let{clientId:t,tagName:n="div",wrapperProps:o,className:r}=e;const[l,s]=(0,a.useState)(!0),[u,d]=(0,a.useState)(!1),{isParentSelected:p,hasChildSelected:f,isDraggingBlocks:g,isParentHighlighted:h}=(0,m.useSelect)((e=>{const{isBlockSelected:n,hasSelectedInnerBlock:o,isDraggingBlocks:r,isBlockHighlighted:l}=e(qn);return{isParentSelected:n(t),hasChildSelected:o(t,!0),isDraggingBlocks:r(),isParentHighlighted:l(t)}}),[t]),v=c()("block-editor-block-content-overlay",null==o?void 0:o.className,r,{"overlay-active":l,"parent-highlighted":h,"is-dragging-blocks":g});return(0,a.useEffect)((()=>{p||f||l||s(!0),p&&!u&&l&&s(!1),f&&l&&s(!1)}),[p,f,l,u]),(0,a.createElement)(n,i({},o,{className:v,onMouseEnter:()=>d(!0),onMouseLeave:()=>d(!1),onMouseUp:l?()=>s(!1):void 0}),null==o?void 0:o.children)}const fb=()=>(0,a.createElement)(p.SVG,{xmlns:"https://www.w3.org/2000/svg",viewBox:"0 0 20 20"},(0,a.createElement)(p.Path,{d:"M7.434 5l3.18 9.16H8.538l-.692-2.184H4.628l-.705 2.184H2L5.18 5h2.254zm-1.13 1.904h-.115l-1.148 3.593H7.44L6.304 6.904zM14.348 7.006c1.853 0 2.9.876 2.9 2.374v4.78h-1.79v-.914h-.114c-.362.64-1.123 1.022-2.031 1.022-1.346 0-2.292-.826-2.292-2.108 0-1.27.972-2.006 2.71-2.107l1.696-.102V9.38c0-.584-.42-.914-1.18-.914-.667 0-1.112.228-1.264.647h-1.701c.12-1.295 1.307-2.107 3.066-2.107zm1.079 4.1l-1.416.09c-.793.056-1.18.342-1.18.844 0 .52.45.837 1.091.837.857 0 1.505-.545 1.505-1.256v-.515z"})),gb=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)(fb,null)))},hb=e=>{let{TextColor:t,BackgroundColor:n}=e;return e=>{let{onToggle:o,isOpen:r}=e;return(0,a.createElement)(p.ToolbarGroup,null,(0,a.createElement)(p.ToolbarButton,{className:"components-toolbar__control block-library-colors-selector__toggle",label:(0,g.__)("Open Colors Selector"),onClick:o,onKeyDown:e=>{r||e.keyCode!==Tc.DOWN||(e.preventDefault(),o())},icon:(0,a.createElement)(n,null,(0,a.createElement)(t,null,(0,a.createElement)(gb,null)))}))}};var vb=e=>{let{children:t,...n}=e;return(0,a.createElement)(p.Dropdown,{position:"bottom right",className:"block-library-colors-selector",contentClassName:"block-library-colors-selector__popover",renderToggle:hb(n),renderContent:()=>t})};var bb=(0,a.createElement)(O.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,a.createElement)(O.Path,{d:"M13.8 5.2H3v1.5h10.8V5.2zm-3.6 12v1.5H21v-1.5H10.2zm7.2-6H6.6v1.5h10.8v-1.5z"}));const kb=pc(p.__experimentalTreeGridRow);function _b(e){let{isSelected:t,position:n,level:o,rowCount:r,children:l,className:s,path:u,...d}=e;const p=gc({isSelected:t,adjustScrolling:!1,enableAnimation:!0,triggerAnimationOnChange:u});return(0,a.createElement)(kb,i({ref:p,className:c()("block-editor-list-view-leaf",s),level:o,positionInSet:n,setSize:r},d),l)}function yb(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)(wr,{icon:db}))}var Eb=(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:m}=e;const f=Gp(o),{isLocked:g}=Zm(o);return(0,a.createElement)(a.Fragment,null,(0,a.createElement)(p.Button,{className:c()("block-editor-list-view-block-select-button",n),onClick:r,onKeyDown:function(e){e.keyCode!==Tc.ENTER&&e.keyCode!==Tc.SPACE||r(e)},ref:t,tabIndex:i,onFocus:s,onDragStart:e=>{e.dataTransfer.clearData(),null==u||u(e)},onDragEnd:d,draggable:m,href:`#block-${o}`,"aria-hidden":!0},(0,a.createElement)(yb,{onClick:l}),(0,a.createElement)(Wc,{icon:null==f?void 0:f.icon,showColors:!0}),(0,a.createElement)("span",{className:"block-editor-list-view-block-select-button__title"},(0,a.createElement)(Wp,{clientId:o,maximumLength:35})),(null==f?void 0:f.anchor)&&(0,a.createElement)("span",{className:"block-editor-list-view-block-select-button__anchor"},f.anchor),g&&(0,a.createElement)("span",{className:"block-editor-list-view-block-select-button__lock"},(0,a.createElement)(wr,{icon:Xm}))))}));const Cb=(0,a.forwardRef)(((e,t)=>{let{onClick:n,onToggleExpanded:o,block:r,isSelected:l,position:s,siblingBlockCount:u,level:d,isExpanded:p,selectedClientIds:f,...g}=e;const{clientId:h}=r,{blockMovingClientId:v,selectedBlockInBlockEditor:b}=(0,m.useSelect)((e=>{const{hasBlockMovingClientId:t,getSelectedBlockClientId:n}=e(qn);return{blockMovingClientId:t(),selectedBlockInBlockEditor:n()}}),[h]),k=v&&b===h,_=c()("block-editor-list-view-block-contents",{"is-dropping-before":k}),y=f.includes(h)?f:[h];return(0,a.createElement)($p,{clientIds:y},(e=>{let{draggable:c,onDragStart:m,onDragEnd:f}=e;return(0,a.createElement)(Eb,i({ref:t,className:_,block:r,onClick:n,onToggleExpanded:o,isSelected:l,position:s,siblingBlockCount:u,level:d,draggable:c,onDragStart:m,onDragEnd:f,isExpanded:p},g))}))}));var wb=Cb;const Sb=(0,a.createContext)({__experimentalFeatures:!1,__experimentalPersistentListViewFeatures:!1}),Bb=()=>(0,a.useContext)(Sb);var Ib=(0,a.memo)((function e(t){let{block:n,isDragged:o,isSelected:r,isBranchSelected:l,selectBlock:i,position:s,level:u,rowCount:f,siblingBlockCount:h,showBlockMovers:v,path:b,isExpanded:k,selectedClientIds:_,preventAnnouncement:y}=t;const E=(0,a.useRef)(null),[C,w]=(0,a.useState)(!1),{clientId:S}=n,B=r&&_[0]===S,I=r&&_[_.length-1]===S,{toggleBlockHighlight:x}=(0,m.useDispatch)(qn),T=Gp(S),{isLocked:N}=Zm(S),P=`list-view-block-select-button__${(0,d.useInstanceId)(e)}`,M=((e,t,n)=>(0,g.sprintf)((0,g.__)("Block %1$d of %2$d, Level %3$d"),e,t,n))(s,h,u);let R=(0,g.__)("Link");T&&(R=N?(0,g.sprintf)((0,g.__)("%s link (locked)"),T.title):(0,g.sprintf)((0,g.__)("%s link"),T.title));const L=T?(0,g.sprintf)((0,g.__)("Options for %s block"),T.title):(0,g.__)("Options"),{__experimentalFeatures:A,__experimentalPersistentListViewFeatures:D,__experimentalHideContainerBlockActions:O,isTreeGridMounted:F,expand:z,collapse:V}=Bb(),H=v&&h>0,G=c()("block-editor-list-view-block__mover-cell",{"is-visible":C||r}),U=c()("block-editor-list-view-block__menu-cell",{"is-visible":C||B});(0,a.useEffect)((()=>{D&&!F&&r&&E.current.focus()}),[]);const W=D?x:()=>{},$=(0,a.useCallback)((()=>{w(!0),W(S,!0)}),[S,w,W]),j=(0,a.useCallback)((()=>{w(!1),W(S,!1)}),[S,w,W]),K=(0,a.useCallback)((e=>{i(e,S),e.preventDefault()}),[S,i]),q=(0,a.useCallback)((e=>{i(void 0,e)}),[i]),Y=(0,a.useCallback)((e=>{e.preventDefault(),e.stopPropagation(),!0===k?V(S):!1===k&&z(S)}),[S,z,V,k]),Q=A&&(!O||O&&u>1),X=A&&!Q;let Z;H?Z=2:X&&(Z=3);const J=c()({"is-selected":r,"is-first-selected":B,"is-last-selected":I,"is-branch-selected":D&&l,"is-dragging":o,"has-single-cell":X}),ee=_.includes(S)?_:[S];return(0,a.createElement)(_b,{className:J,onMouseEnter:$,onMouseLeave:j,onFocus:$,onBlur:j,level:u,position:s,rowCount:f,path:b,id:`list-view-block-${S}`,"data-block":S,isExpanded:k,"aria-selected":!!r},(0,a.createElement)(p.__experimentalTreeGridCell,{className:"block-editor-list-view-block__contents-cell",colSpan:Z,ref:E,"aria-label":R,"aria-selected":!!r,"aria-expanded":k,"aria-describedby":P},(e=>{let{ref:t,tabIndex:o,onFocus:l}=e;return(0,a.createElement)("div",{className:"block-editor-list-view-block__contents-container"},(0,a.createElement)(wb,{block:n,onClick:K,onToggleExpanded:Y,isSelected:r,position:s,siblingBlockCount:h,level:u,ref:t,tabIndex:o,onFocus:l,isExpanded:k,selectedClientIds:_,preventAnnouncement:y}),(0,a.createElement)("div",{className:"block-editor-list-view-block-select-button__description",id:P},M))})),H&&(0,a.createElement)(a.Fragment,null,(0,a.createElement)(p.__experimentalTreeGridCell,{className:G,withoutGridItem:!0},(0,a.createElement)(p.__experimentalTreeGridItem,null,(e=>{let{ref:t,tabIndex:n,onFocus:o}=e;return(0,a.createElement)(rm,{orientation:"vertical",clientIds:[S],ref:t,tabIndex:n,onFocus:o})})),(0,a.createElement)(p.__experimentalTreeGridItem,null,(e=>{let{ref:t,tabIndex:n,onFocus:o}=e;return(0,a.createElement)(lm,{orientation:"vertical",clientIds:[S],ref:t,tabIndex:n,onFocus:o})})))),Q&&(0,a.createElement)(p.__experimentalTreeGridCell,{className:U,"aria-selected":!!r},(e=>{let{ref:t,tabIndex:n,onFocus:o}=e;return(0,a.createElement)(sf,{clientIds:ee,icon:Dm,label:L,toggleProps:{ref:t,className:"block-editor-list-view-block__menu",tabIndex:n,onFocus:o},disableOpenOnArrowDown:!0,__experimentalSelectBlock:q})})))}));function xb(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(Tb(t,n,o),0):1}const Tb=(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+xb(r,e,t,n):o+1};function Nb(e){const{blocks:t,selectBlock:n,showBlockMovers:o,showNestedBlocks:r,selectedClientIds:l,level:i=1,path:s="",isBranchSelected:c=!1,listPosition:d=0,fixedListWindow:p,expandNested:f}=e,{expandedState:g,draggedClientIds:h,__experimentalPersistentListViewFeatures:v}=Bb(),b=(0,u.compact)(t),k=b.length;let _=d;return(0,a.createElement)(a.Fragment,null,b.map(((e,t)=>{var d;const{clientId:y,innerBlocks:E}=e;t>0&&(_+=xb(b[t-1],g,h,f));const C=v,{itemInView:w}=p,S=!C||w(_),B=t+1,I=s.length>0?`${s}_${B}`:`${B}`,x=r&&!!E&&!!E.length,T=x?null!==(d=g[y])&&void 0!==d?d:f:void 0,N=!(null==h||!h.includes(y)),P=N||S,M=((e,t)=>(0,u.isArray)(t)&&t.length?-1!==t.indexOf(e):t===e)(y,l),R=c||M&&x;return(0,a.createElement)(m.AsyncModeProvider,{key:y,value:!M},P&&(0,a.createElement)(Ib,{block:e,selectBlock:n,isSelected:M,isBranchSelected:R,isDragged:N,level:i,position:B,rowCount:k,siblingBlockCount:k,showBlockMovers:o,path:I,isExpanded:T,listPosition:_,selectedClientIds:l}),!P&&(0,a.createElement)("tr",null,(0,a.createElement)("td",{className:"block-editor-list-view-placeholder"})),x&&T&&!N&&(0,a.createElement)(Nb,{blocks:E,selectBlock:n,showBlockMovers:o,showNestedBlocks:r,level:i+1,path:I,listPosition:_+1,fixedListWindow:p,isBranchSelected:R,selectedClientIds:l,expandNested:f}))})))}Nb.defaultProps={selectBlock:()=>{}};var Pb=(0,a.memo)(Nb);function Mb(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]),m=(0,a.useCallback)((()=>{if(!c)return{};const e=c.ownerDocument,t=c.getBoundingClientRect(),n=u(),o={left:t.left+n,right:t.right,width:0,height:t.height,ownerDocument:e};return"top"===l?{...o,top:t.top,bottom:t.top}:"bottom"===l||"inside"===l?{...o,top:t.bottom,bottom:t.bottom}:{}}),[c,l,u]);return c?(0,a.createElement)(p.Popover,{noArrow:!0,animate:!1,getAnchorRect:m,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 Rb(){const{clearSelectedBlock:e,multiSelect:t,selectBlock:n}=(0,m.useDispatch)(qn),{getBlockName:o,getBlockParents:l,getBlockSelectionStart:i,getBlockSelectionEnd:s,getSelectedBlockClientIds:c,hasMultiSelection:d,hasSelectedBlock:p}=(0,m.useSelect)(qn),{getBlockType:f}=(0,m.useSelect)(r.store),h=(0,a.useCallback)((async(r,a,s)=>{if(null==r||!r.shiftKey)return await e(),void n(a);r.preventDefault();const m="keydown"===r.type&&(r.keyCode===Tc.UP||r.keyCode===Tc.DOWN||r.keyCode===Tc.HOME||r.keyCode===Tc.END);if(!m&&!p()&&!d())return void n(a,null);const h=c(),v=[...l(a),a];m&&!h.some((e=>v.includes(e)))&&await e();let b=i(),k=a;m&&(p()||d()||(b=a),s&&(k=s));const _=l(b),y=l(k),{start:E,end:C}=function(e,t,n,o){const r=[...n,e],l=[...o,t],i=Math.min(r.length,l.length)-1;return{start:r[i],end:l[i]}}(b,k,_,y);await t(E,C,null);const w=c();if((r.keyCode===Tc.HOME||r.keyCode===Tc.END)&&w.length>1)return;const S=(0,u.difference)(h,w);let B;if(1===S.length){var I;const e=null===(I=f(o(S[0])))||void 0===I?void 0:I.title;e&&(B=(0,g.sprintf)((0,g.__)("%s deselected."),e))}else S.length>1&&(B=(0,g.sprintf)((0,g.__)("%s blocks deselected."),S.length));B&&(0,Ft.speak)(B)}),[e,o,f,l,i,s,c,d,p,t,n]);return{updateBlockSelection:h}}function Lb(e,t){return t.left<=e.x&&t.right>=e.x&&t.top<=e.y&&t.bottom>=e.y}const Ab=["top","bottom"];function Db(){const{getBlockRootClientId:e,getBlockIndex:t,getBlockCount:n,getDraggedBlockClientIds:o,canInsertBlocks:r}=(0,m.useSelect)(qn),[l,i]=(0,a.useState)(),{rootClientId:s,blockIndex:c}=l||{},u=Pf(s,c),p=o(),f=(0,d.useThrottle)((0,a.useCallback)(((o,l)=>{const a={x:o.clientX,y:o.clientY},s=!(null==p||!p.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]=Rf(t,a,Ab),u=Lb(t,a);if(void 0===r||s0||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&&p.includes(l),innerBlockCount:n(l),canInsertDraggedBlocksAsSibling:!s||r(p,i),canInsertDraggedBlocksAsChild:!s||r(p,l)}})),a);c&&i(c)}),[p]),200);return{ref:(0,d.__experimentalUseDropZone)({onDrop:u,onDragOver(e){f(e,e.currentTarget)},onDragEnd(){f.cancel(),i(null)}}),target:l}}const Ob=(e,t)=>Array.isArray(t.clientIds)?{...e,...t.clientIds.reduce(((e,n)=>({...e,[n]:"expand"===t.type})),{})}:e;var Fb=(0,a.forwardRef)((function(e,t){let{blocks:n,__experimentalFeatures:o,__experimentalPersistentListViewFeatures:r,__experimentalHideContainerBlockActions:l,showNestedBlocks:s,showBlockMovers:c,id:u,expandNested:f=!1,...h}=e;const{clientIdsTree:v,draggedClientIds:b,selectedClientIds:k}=function(e){return(0,m.useSelect)((t=>{const{getDraggedBlockClientIds:n,getSelectedBlockClientIds:o,__unstableGetClientIdsTree:r}=t(qn);return{selectedClientIds:o(),draggedClientIds:n(),clientIdsTree:e||r()}}),[e])}(n),{visibleBlockCount:_}=(0,m.useSelect)((e=>{const{getGlobalBlockCount:t,getClientIdsOfDescendants:n}=e(qn),o=(null==b?void 0:b.length)>0?n(b).length+1:0;return{visibleBlockCount:t()-o}}),[b]),{updateBlockSelection:y}=Rb(),[E,C]=(0,a.useReducer)(Ob,{}),{ref:w,target:S}=Db(),B=(0,a.useRef)(),I=(0,d.useMergeRefs)([B,w,t]),x=(0,a.useRef)(!1),{setSelectedTreeId:T}=function(e){let{firstSelectedBlockClientId:t,setExpandedState:n}=e;const[o,r]=(0,a.useState)(null),{selectedBlockParentClientIds:l}=(0,m.useSelect)((e=>{const{getBlockParents:n}=e(qn);return{selectedBlockParentClientIds:n(t,!1)}}),[t]),i=Array.isArray(l)&&l.length?l:null;return(0,a.useEffect)((()=>{o!==t&&i&&n({type:"expand",clientIds:l})}),[t]),{setSelectedTreeId:r}}({firstSelectedBlockClientId:k[0],setExpandedState:C}),N=(0,a.useCallback)(((e,t)=>{y(e,t),T(t)}),[T,y]);(0,a.useEffect)((()=>{x.current=!0}),[]);const[P]=(0,d.__experimentalUseFixedWindowList)(B,36,_,{useWindowing:r,windowOverscan:40}),M=(0,a.useCallback)((e=>{e&&C({type:"expand",clientIds:[e]})}),[C]),R=(0,a.useCallback)((e=>{e&&C({type:"collapse",clientIds:[e]})}),[C]),L=(0,a.useCallback)((e=>{var t;M(null==e||null===(t=e.dataset)||void 0===t?void 0:t.block)}),[M]),A=(0,a.useCallback)((e=>{var t;R(null==e||null===(t=e.dataset)||void 0===t?void 0:t.block)}),[R]),D=(0,a.useCallback)(((e,t,n)=>{var o,r;e.shiftKey&&y(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)}),[y]),O=(0,a.useMemo)((()=>({__experimentalFeatures:o,__experimentalPersistentListViewFeatures:r,__experimentalHideContainerBlockActions:l,isTreeGridMounted:x.current,draggedClientIds:b,expandedState:E,expand:M,collapse:R})),[o,r,l,x.current,b,E,M,R]);return(0,a.createElement)(m.AsyncModeProvider,{value:!0},(0,a.createElement)(Mb,{listViewRef:B,blockDropTarget:S}),(0,a.createElement)(p.__experimentalTreeGrid,{id:u,className:"block-editor-list-view-tree","aria-label":(0,g.__)("Block navigation structure"),ref:I,onCollapseRow:A,onExpandRow:L,onFocusRow:D},(0,a.createElement)(Sb.Provider,{value:O},(0,a.createElement)(Pb,i({blocks:v,selectBlock:N,showNestedBlocks:s,showBlockMovers:c,fixedListWindow:P,selectedClientIds:k,expandNested:f},h)))))}));function zb(e){let{isEnabled:t,onToggle:n,isOpen:o,innerRef:r,...l}=e;return(0,a.createElement)(p.Button,i({},l,{ref:r,icon:bb,"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 Vb=(0,a.forwardRef)((function(e,t){let{isDisabled:n,__experimentalFeatures:o,...r}=e;const l=(0,m.useSelect)((e=>!!e(qn).getBlockCount()),[])&&!n;return(0,a.createElement)(p.Dropdown,{contentClassName:"block-editor-block-navigation__popover",position:"bottom right",renderToggle:e=>{let{isOpen:n,onToggle:o}=e;return(0,a.createElement)(zb,i({},r,{innerRef:t,isOpen:n,onToggle:o,isEnabled:l}))},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)(Fb,{showNestedBlocks:!0,__experimentalFeatures:o}))})}));function Hb(e){let{genericPreviewBlock:t,style:n,className:o,activeStyle:r}=e;const l=km(o,r,n),i=(0,a.useMemo)((()=>({...t,title:n.label||n.name,description:n.description,initialAttributes:{...t.attributes,className:l+" block-editor-block-styles__block-preview-container"}})),[t,l]);return(0,a.createElement)(Ed,{item:i,isStylePreview:!0})}function Gb(e){let{children:t,scope:n,...o}=e;return(0,a.createElement)(p.Fill,{name:`BlockStylesPreviewPanel/${n}`},(0,a.createElement)("div",o,t))}function Ub(e){let{clientId:t,onSwitch:n=u.noop,onHoverClassName:o=u.noop,scope:r}=e;const{onSelect:l,stylesToRender:i,activeStyle:s,genericPreviewBlock:m,className:f}=ym({clientId:t,onSwitch:n}),[g,h]=(0,a.useState)(null),[v,b]=(0,a.useState)(0),k=(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 _=(0,u.debounce)(h,250),y=e=>{l(e),o(null),h(null),_.cancel()},E=e=>{var t;g!==e?(_(e),o(null!==(t=null==e?void 0:e.name)&&void 0!==t?t:null)):_.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)(p.Button,{className:c()("block-editor-block-styles__item",{"is-active":s.name===e.name}),key:e.name,variant:"secondary",label:t,onMouseEnter:()=>E(e),onFocus:()=>E(e),onMouseLeave:()=>E(null),onBlur:()=>E(null),onKeyDown:t=>{Tc.ENTER!==t.keyCode&&Tc.SPACE!==t.keyCode||(t.preventDefault(),y(e))},onClick:()=>y(e),role:"button",tabIndex:"0"},(0,a.createElement)(p.__experimentalTruncate,{numberOfLines:1,className:"block-editor-block-styles__item-text"},t))}))),g&&!k&&(0,a.createElement)(Gb,{scope:r,className:"block-editor-block-styles__preview-panel",style:{top:v},onMouseLeave:()=>E(null)},(0,a.createElement)(Hb,{activeStyle:s,className:f,genericPreviewBlock:m,style:g})))}Ub.Slot=function(e){let{scope:t}=e;return(0,a.createElement)(p.Slot,{name:`BlockStylesPreviewPanel/${t}`})};var Wb=Ub;var $b=(0,a.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(O.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 jb=function(e){let{icon:t=$b,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)(p.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)(p.Button,{variant:"secondary",icon:e.icon,iconSize:48,onClick:()=>l(e),className:"block-editor-block-variation-picker__variation",label:e.description||e.title}),(0,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)(p.Button,{variant:"link",onClick:()=>l()},(0,g.__)("Skip"))))};var Kb=(0,a.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(O.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 qb="carousel",Yb="grid",Qb=e=>{let{onStartBlank:t,onBlockPatternSelect:n}=e;return(0,a.createElement)("div",{className:"block-editor-block-pattern-setup__actions"},t&&(0,a.createElement)(p.Button,{onClick:t},(0,g.__)("Start blank")),(0,a.createElement)(p.Button,{variant:"primary",onClick:n},(0,g.__)("Choose")))},Xb=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)(p.Button,{icon:Xp,label:(0,g.__)("Previous pattern"),onClick:t,disabled:0===o}),(0,a.createElement)(p.Button,{icon:Qp,label:(0,g.__)("Next pattern"),onClick:n,disabled:o===r-1}))};var Zb=e=>{let{viewMode:t,setViewMode:n,handlePrevious:o,handleNext:r,activeSlide:l,totalSlides:i,onBlockPatternSelect:s,onStartBlank:c}=e;const u=t===qb,d=(0,a.createElement)("div",{className:"block-editor-block-pattern-setup__display-controls"},(0,a.createElement)(p.Button,{icon:uo,label:(0,g.__)("Carousel view"),onClick:()=>n(qb),isPressed:u}),(0,a.createElement)(p.Button,{icon:Kb,label:(0,g.__)("Grid view"),onClick:()=>n(Yb),isPressed:t===Yb}));return(0,a.createElement)("div",{className:"block-editor-block-pattern-setup__toolbar"},u&&(0,a.createElement)(Xb,{handlePrevious:o,handleNext:r,activeSlide:l,totalSlides:i}),d,u&&(0,a.createElement)(Qb,{onBlockPatternSelect:s,onStartBlank:c}))};var Jb=function(e,t,n){return(0,m.useSelect)((o=>{const{getBlockRootClientId:r,__experimentalGetPatternsByBlockTypes:l,__experimentalGetAllowedPatterns:i}=o(qn),a=r(e);return n?i(a).filter(n):l(t,a)}),[e,t,n])};const ek=e=>{let{viewMode:t,activeSlide:n,patterns:o,onBlockPatternSelect:r,height:l}=e;const s=(0,p.__unstableUseCompositeState)(),c="block-editor-block-pattern-setup__container";if(t===qb){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",style:{height:l}},(0,a.createElement)("div",{className:c},(0,a.createElement)("ul",{className:"carousel-container"},o.map(((t,n)=>(0,a.createElement)(nk,{className:e.get(n)||"",key:t.name,pattern:t,minHeight:l}))))))}return(0,a.createElement)("div",{style:{height:l},className:"block-editor-block-pattern-setup__grid"},(0,a.createElement)(p.__unstableComposite,i({},s,{role:"listbox",className:c,"aria-label":(0,g.__)("Patterns list")}),o.map((e=>(0,a.createElement)(tk,{key:e.name,pattern:e,onSelect:r,composite:s})))))};function tk(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)(tk,`${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)(p.__unstableCompositeItem,i({role:"option",as:"div"},o,{className:`${r}__item`,onClick:()=>n(l)}),(0,a.createElement)(_d,{blocks:l,viewportWidth:c})),!!s&&(0,a.createElement)(p.VisuallyHidden,{id:u},s))}function nk(e){let{className:t,pattern:n,minHeight:o}=e;const{blocks:r,title:l,description:i}=n,s=(0,d.useInstanceId)(nk,"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)(_d,{blocks:r,__experimentalMinHeight:o}),!!i&&(0,a.createElement)(p.VisuallyHidden,{id:s},i))}var ok=e=>{let{clientId:t,blockName:n,filterPatternsFn:o,startBlankComponent:l,onBlockPatternSelect:i}=e;const[s,c]=(0,a.useState)(qb),[u,p]=(0,a.useState)(0),[f,g]=(0,a.useState)(!1),{replaceBlock:h}=(0,m.useDispatch)(qn),v=Jb(t,n,o),[b,{height:k}]=(0,d.useResizeObserver)();if(null==v||!v.length||f)return l;const _=i||(e=>{const n=e.map((e=>(0,r.cloneBlock)(e)));h(t,n)}),y=l?()=>{g(!0)}:void 0;return(0,a.createElement)(a.Fragment,null,b,(0,a.createElement)("div",{className:`block-editor-block-pattern-setup view-mode-${s}`},(0,a.createElement)(ek,{viewMode:s,activeSlide:u,patterns:v,onBlockPatternSelect:_,height:k-120}),(0,a.createElement)(Zb,{viewMode:s,setViewMode:c,activeSlide:u,totalSlides:v.length,handleNext:()=>{p((e=>e+1))},handlePrevious:()=>{p((e=>e-1))},onBlockPatternSelect:()=>{_(v[u].blocks)},onStartBlank:y})))};function rk(e){let{className:t,onSelectVariation:n,selectedValue:o,variations:r}=e;return(0,a.createElement)("fieldset",{className:t},(0,a.createElement)(p.VisuallyHidden,{as:"legend"},(0,g.__)("Transform to variation")),r.map((e=>(0,a.createElement)(p.Button,{key:e.name,icon:e.icon,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 lk(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)(p.DropdownMenu,{className:t,label:(0,g.__)("Transform to variation"),text:(0,g.__)("Transform to variation"),popoverProps:{position:"bottom center",className:`${t}__popover`},icon:Jp,toggleProps:{iconPosition:"right"}},(()=>(0,a.createElement)("div",{className:`${t}__container`},(0,a.createElement)(p.MenuGroup,null,(0,a.createElement)(p.MenuItemsChoice,{choices:l,value:o,onSelect:n})))))}var ik=function(e){let{blockClientId:t}=e;const{updateBlockAttributes:n}=(0,m.useDispatch)(qn),{activeBlockVariation:o,variations:l}=(0,m.useSelect)((e=>{const{getActiveBlockVariation:n,getBlockVariations:o}=e(r.store),{getBlockName:l,getBlockAttributes:i}=e(qn),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=>{t.icon&&e.add(t.icon)})),e.size===l.length)}),[l]);if(null==l||!l.length)return null;const c=s?rk:lk;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})},ak=(0,d.createHigherOrderComponent)((e=>t=>{const n=Io("color.palette"),o=!Io("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"),sk=ak(p.ColorPalette);function ck(e){let{onChange:t,value:n,...o}=e;return(0,a.createElement)(Qf,i({},o,{onColorChange:t,colorValue:n,gradients:[],disableCustomGradients:!0}))}var uk=window.wp.date;const dk=new Date(2022,0,25);function pk(e){let{format:t,defaultFormat:n,onChange:o}=e;return(0,a.createElement)("fieldset",{className:"block-editor-date-format-picker"},(0,a.createElement)(p.VisuallyHidden,{as:"legend"},(0,g.__)("Date format")),(0,a.createElement)(p.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,uk.dateI18n)(n,dk))),checked:!t,onChange:e=>o(e?null:n)}),t&&(0,a.createElement)(mk,{format:t,onChange:o}))}function mk(e){var t;let{format:n,onChange:o}=e;const r=(0,u.uniq)(["Y-m-d",(0,g._x)("n/j/Y","short date format"),(0,g._x)("n/j/Y g:i A","short date format with time"),(0,g._x)("M j, Y","medium date format"),(0,g._x)("M j, Y g:i A","medium date format with time"),(0,g._x)("F j, Y","long date format")]),l=r.map(((e,t)=>({key:`suggested-${t}`,name:(0,uk.dateI18n)(e,dk),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)(p.BaseControl,{className:"block-editor-date-format-picker__custom-format-select-control"},(0,a.createElement)(p.CustomSelectControl,{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)(p.TextControl,{label:(0,g.__)("Custom format"),hideLabelFromVision:!0,help:(0,a.createInterpolateElement)((0,g.__)("Enter a date or time format string."),{Link:(0,a.createElement)(p.ExternalLink,{href:(0,g.__)("https://wordpress.org/support/article/formatting-date-and-time/")})}),value:n,onChange:e=>o(e)}))}const fk=(0,g.__)("(%s: color %s)"),gk=(0,g.__)("(%s: gradient %s)"),hk=["colors","disableCustomColors","gradients","disableCustomGradients"],vk=e=>{let{colors:t,gradients:n,settings:o}=e;return o.map(((e,o)=>{let r,{colorValue:l,gradientValue:i,label:s,colors:c,gradients:u}=e;if(!l&&!i)return null;if(l){const e=tg(c||t,l);r=(0,g.sprintf)(fk,s.toLowerCase(),e&&e.name||l)}else{const e=Lg(u||n,l);r=(0,g.sprintf)(gk,s.toLowerCase(),e&&e.name||i)}return(0,a.createElement)(p.ColorIndicator,{key:o,colorValue:l||i,"aria-label":r})}))},bk=e=>{let{className:t,colors:n,gradients:o,disableCustomColors:r,disableCustomGradients:l,children:s,settings:d,title:m,showTitle:f=!0,__experimentalHasMultipleOrigins:g,__experimentalIsRenderedInSidebar:h,enableAlpha:v,...b}=e;if((0,u.isEmpty)(n)&&(0,u.isEmpty)(o)&&r&&l&&(0,u.every)(d,(e=>(0,u.isEmpty)(e.colors)&&(0,u.isEmpty)(e.gradients)&&(void 0===e.disableCustomColors||e.disableCustomColors)&&(void 0===e.disableCustomGradients||e.disableCustomGradients))))return null;const k=(0,a.createElement)("span",{className:"block-editor-panel-color-gradient-settings__panel-title"},m,(0,a.createElement)(vk,{colors:n,gradients:o,settings:d}));return(0,a.createElement)(p.PanelBody,i({className:c()("block-editor-panel-color-gradient-settings",t),title:f?k:void 0},b),(0,a.createElement)(Xf,{settings:d,colors:n,gradients:o,disableCustomColors:r,disableCustomGradients:l,__experimentalHasMultipleOrigins:g,__experimentalIsRenderedInSidebar:h,enableAlpha:v}),!!s&&(0,a.createElement)(a.Fragment,null,(0,a.createElement)(p.__experimentalSpacer,{marginY:4})," ",s))},kk=e=>{const t=Zf();return t.colors=Io("color.palette"),t.gradients=Io("color.gradients"),(0,a.createElement)(bk,i({},t,e))},_k=e=>{const t=Jf();return(0,a.createElement)(bk,i({},t,e))};var yk=e=>(0,u.every)(hk,(t=>e.hasOwnProperty(t)))?(0,a.createElement)(bk,e):e.__experimentalHasMultipleOrigins?(0,a.createElement)(_k,e):(0,a.createElement)(kk,e),Ek=function(e,t){return Ek=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])},Ek(e,t)};var Ck=function(){return Ck=Object.assign||function(e){for(var t,n=1,o=arguments.length;nu*r?{width:u*r,height:u}:{width:c,height:c/r}}function Ik(e,t,n,o,r){void 0===r&&(r=0);var l=Ok(t.width,t.height,r),i=l.width,a=l.height;return{x:xk(e.x,i,n.width,o),y:xk(e.y,a,n.height,o)}}function xk(e,t,n,o){var r=t*o/2-n/2;return Math.min(r,Math.max(e,-r))}function Tk(e,t){return Math.sqrt(Math.pow(e.y-t.y,2)+Math.pow(e.x-t.x,2))}function Nk(e,t){return 180*Math.atan2(t.y-e.y,t.x-e.x)/Math.PI}function Pk(e,t,n,o,r,l,i){void 0===l&&(l=0),void 0===i&&(i=!0);var a=i&&0===l?Mk:Rk,s={x:a(100,((t.width-n.width/r)/2-e.x/r)/t.width*100),y:a(100,((t.height-n.height/r)/2-e.y/r)/t.height*100),width:a(100,n.width/t.width*100/r),height:a(100,n.height/t.height*100/r)},c=Math.round(a(t.naturalWidth,s.width*t.naturalWidth/100)),u=Math.round(a(t.naturalHeight,s.height*t.naturalHeight/100)),d=t.naturalWidth>=t.naturalHeight*o?{width:Math.round(u*o),height:u}:{width:c,height:Math.round(c/o)};return{croppedAreaPercentages:s,croppedAreaPixels:Ck(Ck({},d),{x:Math.round(a(t.naturalWidth-d.width,s.x*t.naturalWidth/100)),y:Math.round(a(t.naturalHeight-d.height,s.y*t.naturalHeight/100))})}}function Mk(e,t){return Math.min(e,Math.max(0,t))}function Rk(e,t){return t}function Lk(e,t,n){var o=t.width/t.naturalWidth,r=function(e,t,n){var o=t.width/t.naturalWidth;if(n)return n.height>n.width?n.height/o/e.height:n.width/o/e.width;var r=e.width/e.height;return t.naturalWidth>=t.naturalHeight*r?t.naturalHeight/e.height:t.naturalWidth/e.width}(e,t,n),l=o*r;return{crop:{x:((t.naturalWidth-e.width)/2-e.x)*l,y:((t.naturalHeight-e.height)/2-e.y)*l},zoom:r}}function Ak(e,t){return{x:(t.x+e.x)/2,y:(t.y+e.y)/2}}function Dk(e,t,n,o,r){var l=Math.cos,i=Math.sin,a=r*Math.PI/180;return[(e-n)*l(a)-(t-o)*i(a)+n,(e-n)*i(a)+(t-o)*l(a)+o]}function Ok(e,t,n){var o=e/2,r=t/2,l=[Dk(0,0,o,r,n),Dk(e,0,o,r,n),Dk(e,t,o,r,n),Dk(0,t,o,r,n)],i=Math.min.apply(Math,l.map((function(e){return e[0]}))),a=Math.max.apply(Math,l.map((function(e){return e[0]}))),s=Math.min.apply(Math,l.map((function(e){return e[1]}))),c=Math.max.apply(Math,l.map((function(e){return e[1]})));return{width:a-i,height:c-s}}function Fk(){for(var e=[],t=0;t0})).join(" ").trim()}var zk=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.imageRef=null,n.videoRef=null,n.containerRef=null,n.styleRef=null,n.containerRect=null,n.mediaSize={width:0,height:0,naturalWidth:0,naturalHeight:0},n.dragStartPosition={x:0,y:0},n.dragStartCrop={x:0,y:0},n.lastPinchDistance=0,n.lastPinchRotation=0,n.rafDragTimeout=null,n.rafPinchTimeout=null,n.wheelTimer=null,n.state={cropSize:null,hasWheelJustStarted:!1},n.preventZoomSafari=function(e){return e.preventDefault()},n.cleanEvents=function(){document.removeEventListener("mousemove",n.onMouseMove),document.removeEventListener("mouseup",n.onDragStopped),document.removeEventListener("touchmove",n.onTouchMove),document.removeEventListener("touchend",n.onDragStopped)},n.clearScrollEvent=function(){n.containerRef&&n.containerRef.removeEventListener("wheel",n.onWheel),n.wheelTimer&&clearTimeout(n.wheelTimer)},n.onMediaLoad=function(){n.computeSizes(),n.emitCropData(),n.setInitialCrop(),n.props.onMediaLoaded&&n.props.onMediaLoaded(n.mediaSize)},n.setInitialCrop=function(){var e=n.props,t=e.initialCroppedAreaPixels,o=e.cropSize;if(t){var r=Lk(t,n.mediaSize,o),l=r.crop,i=r.zoom;n.props.onCropChange(l),n.props.onZoomChange&&n.props.onZoomChange(i)}},n.computeSizes=function(){var e,t,o,r,l,i,a=n.imageRef||n.videoRef;if(a&&n.containerRef){n.containerRect=n.containerRef.getBoundingClientRect(),n.mediaSize={width:a.offsetWidth,height:a.offsetHeight,naturalWidth:(null===(e=n.imageRef)||void 0===e?void 0:e.naturalWidth)||(null===(t=n.videoRef)||void 0===t?void 0:t.videoWidth)||0,naturalHeight:(null===(o=n.imageRef)||void 0===o?void 0:o.naturalHeight)||(null===(r=n.videoRef)||void 0===r?void 0:r.videoHeight)||0};var s=n.props.cropSize?n.props.cropSize:Bk(a.offsetWidth,a.offsetHeight,n.containerRect.width,n.containerRect.height,n.props.aspect,n.props.rotation);(null===(l=n.state.cropSize)||void 0===l?void 0:l.height)===s.height&&(null===(i=n.state.cropSize)||void 0===i?void 0:i.width)===s.width||n.props.onCropSizeChange&&n.props.onCropSizeChange(s),n.setState({cropSize:s},n.recomputeCropPosition)}},n.onMouseDown=function(e){e.preventDefault(),document.addEventListener("mousemove",n.onMouseMove),document.addEventListener("mouseup",n.onDragStopped),n.onDragStart(t.getMousePoint(e))},n.onMouseMove=function(e){return n.onDrag(t.getMousePoint(e))},n.onTouchStart=function(e){document.addEventListener("touchmove",n.onTouchMove,{passive:!1}),document.addEventListener("touchend",n.onDragStopped),2===e.touches.length?n.onPinchStart(e):1===e.touches.length&&n.onDragStart(t.getTouchPoint(e.touches[0]))},n.onTouchMove=function(e){e.preventDefault(),2===e.touches.length?n.onPinchMove(e):1===e.touches.length&&n.onDrag(t.getTouchPoint(e.touches[0]))},n.onDragStart=function(e){var t,o,r=e.x,l=e.y;n.dragStartPosition={x:r,y:l},n.dragStartCrop=Ck({},n.props.crop),null===(o=(t=n.props).onInteractionStart)||void 0===o||o.call(t)},n.onDrag=function(e){var t=e.x,o=e.y;n.rafDragTimeout&&window.cancelAnimationFrame(n.rafDragTimeout),n.rafDragTimeout=window.requestAnimationFrame((function(){if(n.state.cropSize&&void 0!==t&&void 0!==o){var e=t-n.dragStartPosition.x,r=o-n.dragStartPosition.y,l={x:n.dragStartCrop.x+e,y:n.dragStartCrop.y+r},i=n.props.restrictPosition?Ik(l,n.mediaSize,n.state.cropSize,n.props.zoom,n.props.rotation):l;n.props.onCropChange(i)}}))},n.onDragStopped=function(){var e,t;n.cleanEvents(),n.emitCropData(),null===(t=(e=n.props).onInteractionEnd)||void 0===t||t.call(e)},n.onWheel=function(e){e.preventDefault();var o=t.getMousePoint(e),r=Sk()(e).pixelY,l=n.props.zoom-r*n.props.zoomSpeed/200;n.setNewZoom(l,o),n.state.hasWheelJustStarted||n.setState({hasWheelJustStarted:!0},(function(){var e,t;return null===(t=(e=n.props).onInteractionStart)||void 0===t?void 0:t.call(e)})),n.wheelTimer&&clearTimeout(n.wheelTimer),n.wheelTimer=window.setTimeout((function(){return n.setState({hasWheelJustStarted:!1},(function(){var e,t;return null===(t=(e=n.props).onInteractionEnd)||void 0===t?void 0:t.call(e)}))}),250)},n.getPointOnContainer=function(e){var t=e.x,o=e.y;if(!n.containerRect)throw new Error("The Cropper is not mounted");return{x:n.containerRect.width/2-(t-n.containerRect.left),y:n.containerRect.height/2-(o-n.containerRect.top)}},n.getPointOnMedia=function(e){var t=e.x,o=e.y,r=n.props,l=r.crop,i=r.zoom;return{x:(t+l.x)/i,y:(o+l.y)/i}},n.setNewZoom=function(e,t){if(n.state.cropSize&&n.props.onZoomChange){var o=n.getPointOnContainer(t),r=n.getPointOnMedia(o),l=Math.min(n.props.maxZoom,Math.max(e,n.props.minZoom)),i={x:r.x*l-o.x,y:r.y*l-o.y},a=n.props.restrictPosition?Ik(i,n.mediaSize,n.state.cropSize,l,n.props.rotation):i;n.props.onCropChange(a),n.props.onZoomChange(l)}},n.getCropData=function(){return n.state.cropSize?Pk(n.props.restrictPosition?Ik(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?Ik(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}Ek(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}(t,e),t.prototype.componentDidMount=function(){window.addEventListener("resize",this.computeSizes),this.containerRef&&(this.props.zoomWithScroll&&this.containerRef.addEventListener("wheel",this.onWheel,{passive:!1}),this.containerRef.addEventListener("gesturestart",this.preventZoomSafari),this.containerRef.addEventListener("gesturechange",this.preventZoomSafari)),this.props.disableAutomaticStylesInjection||(this.styleRef=document.createElement("style"),this.styleRef.setAttribute("type","text/css"),this.styleRef.innerHTML=".reactEasyCrop_Container {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n overflow: hidden;\n user-select: none;\n touch-action: none;\n cursor: move;\n 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",document.head.appendChild(this.styleRef)),this.imageRef&&this.imageRef.complete&&this.onMediaLoad()},t.prototype.componentWillUnmount=function(){var e;window.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)||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=Tk(n,o),this.lastPinchRotation=Nk(n,o),this.onDragStart(Ak(n,o))},t.prototype.onPinchMove=function(e){var n=this,o=t.getTouchPoint(e.touches[0]),r=t.getTouchPoint(e.touches[1]),l=Ak(o,r);this.onDrag(l),this.rafPinchTimeout&&window.cancelAnimationFrame(this.rafPinchTimeout),this.rafPinchTimeout=window.requestAnimationFrame((function(){var e=Tk(o,r),t=n.props.zoom*(e/n.lastPinchDistance);n.setNewZoom(t,l),n.lastPinchDistance=e;var i=Nk(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,k=v.cropAreaClassName,_=v.mediaClassName,y=t.objectFit;return Fl().createElement("div",{onMouseDown:this.onMouseDown,onTouchStart:this.onTouchStart,ref:function(t){return e.containerRef=t},"data-testid":"container",style:f,className:Fk("reactEasyCrop_Container",b)},n?Fl().createElement("img",Ck({alt:"",className:Fk("reactEasyCrop_Image","contain"===y&&"reactEasyCrop_Contain","horizontal-cover"===y&&"reactEasyCrop_Cover_Horizontal","vertical-cover"===y&&"reactEasyCrop_Cover_Vertical",_)},r,{src:n,ref:function(t){return e.imageRef=t},style:Ck(Ck({},h),{transform:l||"translate("+a+"px, "+s+"px) rotate("+c+"deg) scale("+u+")"}),onLoad:this.onMediaLoad})):o&&Fl().createElement("video",Ck({autoPlay:!0,loop:!0,muted:!0,className:Fk("reactEasyCrop_Video","contain"===y&&"reactEasyCrop_Contain","horizontal-cover"===y&&"reactEasyCrop_Cover_Horizontal","vertical-cover"===y&&"reactEasyCrop_Cover_Vertical",_)},r,{ref:function(t){return e.videoRef=t},onLoadedMetadata:this.onMediaLoad,style:Ck(Ck({},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 Fl().createElement("source",Ck({key:e.src},e))}))),this.state.cropSize&&Fl().createElement("div",{style:Ck(Ck({},g),{width:this.state.cropSize.width,height:this.state.cropSize.height}),"data-testid":"cropper",className:Fk("reactEasyCrop_CropArea","round"===d&&"reactEasyCrop_CropAreaRound",p&&"reactEasyCrop_CropAreaGrid",k)}))},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}(Fl().Component),Vk=zk;const Hk={position:"bottom right",isAlternate:!0};function Gk(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,k]=(0,a.useState)(),_=(0,a.useCallback)((()=>{d({x:0,y:0}),m(100),g(0),v(n/o),k(n/o)}),[n,o,d,m,g,v,k]),y=(0,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:_})),[r,i,s,c,u,d,p,m,f,g,y,h,v,b,_])}(e),{initializeTransformValues:o}=n;return(0,a.useEffect)((()=>{t&&o()}),[t,o]),n}const Uk=(0,a.createContext)({}),Wk=()=>(0,a.useContext)(Uk);function $k(e){let{id:t,url:n,naturalWidth:o,naturalHeight:r,isEditing:l,onFinishEditing:i,onSaveImage:s,children:c}=e;const u=Gk({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,m.useDispatch)(zd.store),[p,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,tb()({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"),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:p,apply:v,cancel:h})),[p,v,h])}({id:t,url:n,onSaveImage:s,onFinishEditing:i,...u}),p=(0,a.useMemo)((()=>({...u,...d})),[u,d]);return(0,a.createElement)(Uk.Provider,{value:p},c)}function jk(e){let{url:t,width:n,height:o,clientWidth:r,naturalHeight:l,naturalWidth:i}=e;const{isInProgress:s,editedUrl:u,position:d,zoom:m,aspect:f,setPosition:g,setCrop:h,setZoom:v,rotation:b}=Wk();let k=o||r*l/i;return b%180==90&&(k=r*i/l),(0,a.createElement)("div",{className:c()("wp-block-image__crop-area",{"is-applying":s}),style:{width:n||r,height:k}},(0,a.createElement)(Vk,{image:u||t,disabled:s,minZoom:1,maxZoom:3,crop:d,zoom:m/100,aspect:f,onCropChange:g,onCropComplete:e=>{h(e)},onZoomChange:e=>{v(100*e)}}),s&&(0,a.createElement)(p.Spinner,null))}var Kk=(0,a.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(O.Path,{d:"M13.5 6C10.5 6 8 8.5 8 11.5c0 1.1.3 2.1.9 3l-3.4 3 1 1.1 3.4-2.9c1 .9 2.2 1.4 3.6 1.4 3 0 5.5-2.5 5.5-5.5C19 8.5 16.5 6 13.5 6zm0 9.5c-2.2 0-4-1.8-4-4s1.8-4 4-4 4 1.8 4 4-1.8 4-4 4z"}));function qk(){const{isInProgress:e,zoom:t,setZoom:n}=Wk();return(0,a.createElement)(p.Dropdown,{contentClassName:"wp-block-image__zoom",popoverProps:Hk,renderToggle:t=>{let{isOpen:n,onToggle:o}=t;return(0,a.createElement)(p.ToolbarButton,{icon:Kk,label:(0,g.__)("Zoom"),onClick:o,"aria-expanded":n,disabled:e})},renderContent:()=>(0,a.createElement)(p.RangeControl,{label:(0,g.__)("Zoom"),min:100,max:300,value:Math.round(t),onChange:n})})}var Yk=(0,a.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(O.Path,{d:"M18.5 5.5h-13c-1.1 0-2 .9-2 2v9c0 1.1.9 2 2 2h13c1.1 0 2-.9 2-2v-9c0-1.1-.9-2-2-2zm.5 11c0 .3-.2.5-.5.5h-13c-.3 0-.5-.2-.5-.5v-9c0-.3.2-.5.5-.5h13c.3 0 .5.2.5.5v9zM6.5 12H8v-2h2V8.5H6.5V12zm9.5 2h-2v1.5h3.5V12H16v2z"}));function Qk(e){let{aspectRatios:t,isDisabled:n,label:o,onClick:r,value:l}=e;return(0,a.createElement)(p.MenuGroup,{label:o},t.map((e=>{let{title:t,aspect:o}=e;return(0,a.createElement)(p.MenuItem,{key:o,disabled:n,onClick:()=>{r(o)},role:"menuitemradio",isSelected:o===l,icon:o===l?hm:void 0},t)})))}function Xk(e){let{toggleProps:t}=e;const{isInProgress:n,aspect:o,setAspect:r,defaultAspect:l}=Wk();return(0,a.createElement)(p.DropdownMenu,{icon:Yk,label:(0,g.__)("Aspect Ratio"),popoverProps:Hk,toggleProps:t,className:"wp-block-image__aspect-ratio"},(e=>{let{onClose:t}=e;return(0,a.createElement)(a.Fragment,null,(0,a.createElement)(Qk,{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)(Qk,{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)(Qk,{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 Zk=(0,a.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(O.Path,{d:"M15.1 4.8l-3-2.5V4c-4.4 0-8 3.6-8 8 0 3.7 2.5 6.9 6 7.7.3.1.6.1 1 .2l.2-1.5c-.4 0-.7-.1-1.1-.2l-.1.2v-.2c-2.6-.8-4.5-3.3-4.5-6.2 0-3.6 2.9-6.5 6.5-6.5v1.8l3-2.5zM20 11c-.2-1.4-.7-2.7-1.6-3.8l-1.2.8c.7.9 1.1 2 1.3 3.1L20 11zm-1.5 1.8c-.1.5-.2 1.1-.4 1.6s-.5 1-.8 1.5l1.2.9c.4-.5.8-1.1 1-1.8s.5-1.3.5-2l-1.5-.2zm-5.6 5.6l.2 1.5c1.4-.2 2.7-.7 3.8-1.6l-.9-1.1c-.9.7-2 1.1-3.1 1.2z"}));function Jk(){const{isInProgress:e,rotateClockwise:t}=Wk();return(0,a.createElement)(p.ToolbarButton,{icon:Zk,label:(0,g.__)("Rotate"),onClick:t,disabled:e})}function e_(){const{isInProgress:e,apply:t,cancel:n}=Wk();return(0,a.createElement)(a.Fragment,null,(0,a.createElement)(p.ToolbarButton,{onClick:t,disabled:e},(0,g.__)("Apply")),(0,a.createElement)(p.ToolbarButton,{onClick:n},(0,g.__)("Cancel")))}function t_(e){let{url:t,width:n,height:o,clientWidth:r,naturalHeight:l,naturalWidth:i}=e;return(0,a.createElement)(a.Fragment,null,(0,a.createElement)(jk,{url:t,width:n,height:o,clientWidth:r,naturalHeight:l,naturalWidth:i}),(0,a.createElement)(ro,null,(0,a.createElement)(p.ToolbarGroup,null,(0,a.createElement)(qk,null),(0,a.createElement)(p.ToolbarItem,null,(e=>(0,a.createElement)(Xk,{toggleProps:e}))),(0,a.createElement)(Jk,null)),(0,a.createElement)(p.ToolbarGroup,null,(0,a.createElement)(e_,null))))}const n_=[25,50,75,100];function o_(e){let{imageWidth:t,imageHeight:n,imageSizeOptions:o=[],isResizable:r=!0,slug:l,width:i,height:s,onChange:c,onChangeImage:d=u.noop}=e;const{currentHeight:m,currentWidth:f,updateDimension:h,updateDimensions:v}=function(e,t,n,o,r){var l,i;const[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})}}}(s,i,n,t,c);return(0,a.createElement)(a.Fragment,null,!(0,u.isEmpty)(o)&&(0,a.createElement)(p.SelectControl,{label:(0,g.__)("Image size"),value:l,options:o,onChange:d}),r&&(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)(p.TextControl,{type:"number",className:"block-editor-image-size-control__width",label:(0,g.__)("Width"),value:f,min:1,onChange:e=>h("width",e)}),(0,a.createElement)(p.TextControl,{type:"number",className:"block-editor-image-size-control__height",label:(0,g.__)("Height"),value:m,min:1,onChange:e=>h("height",e)})),(0,a.createElement)("div",{className:"block-editor-image-size-control__row"},(0,a.createElement)(p.ButtonGroup,{"aria-label":(0,g.__)("Image size presets")},n_.map((e=>{const o=Math.round(t*(e/100)),r=Math.round(n*(e/100)),l=f===o&&m===r;return(0,a.createElement)(p.Button,{key:e,isSmall:!0,variant:l?"primary":void 0,isPressed:l,onClick:()=>v(r,o)},e,"%")}))),(0,a.createElement)(p.Button,{isSmall:!0,onClick:()=>v()},(0,g.__)("Reset")))))}var r_=(0,a.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -2 24 24"},(0,a.createElement)(O.Path,{d:"M6.734 16.106l2.176-2.38-1.093-1.028-3.846 4.158 3.846 4.157 1.093-1.027-2.176-2.38h2.811c1.125 0 2.25.03 3.374 0 1.428-.001 3.362-.25 4.963-1.277 1.66-1.065 2.868-2.906 2.868-5.859 0-2.479-1.327-4.896-3.65-5.93-1.82-.813-3.044-.8-4.806-.788l-.567.002v1.5c.184 0 .368 0 .553-.002 1.82-.007 2.704-.014 4.21.657 1.854.827 2.76 2.657 2.76 4.561 0 2.472-.973 3.824-2.178 4.596-1.258.807-2.864 1.04-4.163 1.04h-.02c-1.115.03-2.229 0-3.344 0H6.734z"}));var l_=e=>{let{value:t,onChange:n=u.noop,settings:o}=e;if(!o||!o.length)return null;const r=e=>o=>{n({...t,[e.id]:o})},l=o.map((e=>(0,a.createElement)(p.ToggleControl,{className:"block-editor-link-control__setting",key:e.id,label:e.title,onChange:r(e),checked:!!t&&!!t[e.id]})));return(0,a.createElement)("fieldset",{className:"block-editor-link-control__settings"},(0,a.createElement)(p.VisuallyHidden,{as:"legend"},(0,g.__)("Currently selected link settings")),l)},i_=n(5425),a_=n.n(i_);class s_ 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,a_()(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,mp.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 Tc.UP:0!==e.target.selectionStart&&(e.preventDefault(),e.target.setSelectionRange(0,0));break;case Tc.DOWN:this.props.value.length!==e.target.selectionStart&&(e.preventDefault(),e.target.setSelectionRange(this.props.value.length,this.props.value.length));break;case Tc.ENTER:this.props.onSubmit&&this.props.onSubmit(null,e)}return}const l=this.state.suggestions[this.state.selectedSuggestion];switch(e.keyCode){case Tc.UP:{e.preventDefault();const t=n?n-1:o.length-1;this.setState({selectedSuggestion:t});break}case Tc.DOWN:{e.preventDefault();const t=null===n||n===o.length-1?0:n+1;this.setState({selectedSuggestion:t});break}case Tc.TAB:null!==this.state.selectedSuggestion&&(this.selectLink(l),this.props.speak((0,g.__)("Link selected.")));break;case Tc.ENTER: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,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:m,suggestionOptionIdPrefix:f}=this.state,h={id:`url-input-control-${o}`,label:e,className:c()("block-editor-url-input",t,{"is-full-width":n})},v={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":(0,g.__)("URL"),"aria-expanded":u,"aria-autocomplete":"list","aria-owns":m,"aria-activedescendant":null!==d?`${f}-${d}`:void 0,ref:this.inputRef};return l?l(h,v,s):(0,a.createElement)(p.BaseControl,h,(0,a.createElement)("input",v),s&&(0,a.createElement)(p.Spinner,null))}renderSuggestions(){const{className:e,__experimentalRenderSuggestions:t,value:n="",__experimentalShowInitialSuggestions:o=!1}=this.props,{showSuggestions:r,suggestions:l,selectedSuggestion:s,suggestionsListboxId:d,suggestionOptionIdPrefix:m,loading:f}=this.state,g={id:d,ref:this.autocompleteRef,role:"listbox"},h=(e,t)=>({role:"option",tabIndex:"-1",id:`${m}-${t}`,ref:this.bindSuggestionNode(t),"aria-selected":t===s});return(0,u.isFunction)(t)&&r&&l.length?t({suggestions:l,selectedSuggestion:s,suggestionsListProps:g,buildSuggestionItemProps:h,isLoading:f,handleSuggestionClick:this.handleOnClick,isInitialSuggestions:o&&!(n&&n.length)}):!(0,u.isFunction)(t)&&r&&l.length?(0,a.createElement)(p.Popover,{position:"bottom",noArrow:!0,focusOnMount:!1},(0,a.createElement)("div",i({},g,{className:c()("block-editor-url-input__suggestions",`${e}__suggestions`)}),l.map(((e,t)=>(0,a.createElement)(p.Button,i({},h(0,t),{key:e.id,className:c()("block-editor-url-input__suggestion",{"is-selected":t===s}),onClick:()=>this.handleOnClick(e)}),e.title))))):null}}var c_=(0,d.compose)(d.withSafeTimeout,p.withSpokenMessages,d.withInstanceId,(0,m.withSelect)(((e,t)=>{if((0,u.isFunction)(t.__experimentalFetchLinkSuggestions))return;const{getSettings:n}=e(qn);return{__experimentalFetchLinkSuggestions:n().__experimentalFetchLinkSuggestions}})))(s_);var u_=e=>{let t,{searchTerm:n,onClick:o,itemProps:r,isSelected:l,buttonText:s}=e;return n?(t=s?(0,u.isFunction)(s)?s(n):s:(0,a.createInterpolateElement)((0,g.sprintf)((0,g.__)("Create: %s"),n),{mark:(0,a.createElement)("mark",null)}),(0,a.createElement)(p.Button,i({},r,{className:c()("block-editor-link-control__search-create block-editor-link-control__search-item",{"is-selected":l}),onClick:o}),(0,a.createElement)(wr,{className:"block-editor-link-control__search-item-icon",icon:Vc}),(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 d_=(0,a.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(O.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"}));var p_=e=>{let{itemProps:t,suggestion:n,isSelected:o=!1,onClick:r,isURL:l=!1,searchTerm:s="",shouldShowType:u=!1}=e;return(0,a.createElement)(p.Button,i({},t,{onClick:r,className:c()("block-editor-link-control__search-item",{"is-selected":o,"is-url":l,"is-entity":!l})}),l&&(0,a.createElement)(wr,{className:"block-editor-link-control__search-item-icon",icon:d_}),(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)(p.TextHighlight,{text:n.title,highlight:s})),(0,a.createElement)("span",{"aria-hidden":!l,className:"block-editor-link-control__search-item-info"},!l&&((0,mp.filterURLForDisplay)((0,mp.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 m_="__CREATE__",f_=[{id:"opensInNewTab",title:(0,g.__)("Open in new tab")}];function g_(e){let{instanceId:t,withCreateSuggestion:n,currentInputValue:o,handleSuggestionClick:r,suggestionsListProps:l,buildSuggestionItemProps:s,suggestions:u,selectedSuggestion:d,isLoading:m,isInitialSuggestions:f,createSuggestionButtonText:h,suggestionsQuery:v}=e;const b=c()("block-editor-link-control__search-results",{"is-loading":m}),k=["url","mailto","tel","internal"],_=1===u.length&&k.includes(u[0].type.toLowerCase()),y=n&&!_&&!f,E=!(null!=v&&v.type),C=`block-editor-link-control-search-results-label-${t}`,w=f?(0,g.__)("Recently updated"):(0,g.sprintf)((0,g.__)('Search results for "%s"'),o),S=(0,a.createElement)(f?a.Fragment:p.VisuallyHidden,{},(0,a.createElement)("span",{className:"block-editor-link-control__search-results-label",id:C},w));return(0,a.createElement)("div",{className:"block-editor-link-control__search-results-wrapper"},S,(0,a.createElement)("div",i({},l,{className:b,"aria-labelledby":C}),u.map(((e,t)=>y&&m_===e.type?(0,a.createElement)(u_,{searchTerm:o,buttonText:h,onClick:()=>r(e),key:e.type,itemProps:s(e,t),isSelected:t===d}):m_===e.type?null:(0,a.createElement)(p_,{key:`${e.id}-${e.type}`,itemProps:s(e,t),suggestion:e,index:t,onClick:()=>{r(e)},isSelected:t===d,isURL:k.includes(e.type.toLowerCase()),searchTerm:o,shouldShowType:E,isFrontPage:null==e?void 0:e.isFrontPage})))))}function h_(e){const t=(0,u.startsWith)(e,"#");return(0,mp.isURL)(e)||e&&e.includes("www.")||t}const v_=()=>Promise.resolve([]),b_=e=>{let t="URL";const n=(0,mp.getProtocol)(e)||"";return n.includes("mailto")&&(t="mailto"),n.includes("tel")&&(t="tel"),(0,u.startsWith)(e,"#")&&(t="internal"),Promise.resolve([{id:e,title:e,url:"URL"===t?(0,mp.prependHTTP)(e):e,type:t}])};function k_(e,t,n,o){const{fetchSearchSuggestions:r,pageOnFront:l}=(0,m.useSelect)((e=>{const{getSettings:t}=e(qn);return{pageOnFront:t().pageOnFront,fetchSearchSuggestions:t().__experimentalFetchLinkSuggestions}}),[]),i=t?b_:v_;return(0,a.useCallback)(((t,a)=>{let{isInitialSuggestions:s}=a;return h_(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||h_(e)||!r?c:c.concat({title:e,url:e,type:m_})})(t,{...e,isInitialSuggestions:s},r,i,n,o,l)}),[i,r,n])}const __=()=>Promise.resolve([]),y_=(0,a.forwardRef)(((e,t)=>{let{value:n,children:o,currentLink:r={},className:l=null,placeholder:i=null,withCreateSuggestion:s=!1,onCreateSuggestion:p=u.noop,onChange:m=u.noop,onSelect:f=u.noop,showSuggestions:h=!0,renderSuggestions:v=(e=>(0,a.createElement)(g_,e)),fetchSuggestions:b=null,allowDirectEntry:k=!0,showInitialSuggestions:_=!1,suggestionsQuery:y={},withURLSuggestion:E=!0,createSuggestionButtonText:C,useLabel:w=!1}=e;const S=k_(y,k,s,E),B=h?b||S:__,I=(0,d.useInstanceId)(y_),[x,T]=(0,a.useState)(),N=async e=>{let t=e;if(m_!==e.type)(k||t&&Object.keys(t).length>=1)&&f({...(0,u.omit)(r,"id","url"),...t},t);else try{var n;t=await p(e.title),null!==(n=t)&&void 0!==n&&n.url&&f(t)}catch(e){}},P=c()(l,{"has-no-label":!w});return(0,a.createElement)("div",{className:"block-editor-link-control__search-input-container"},(0,a.createElement)(c_,{label:w?"URL":void 0,className:P,value:n,onChange:(e,t)=>{m(e),T(t)},placeholder:null!=i?i:(0,g.__)("Search or type url"),__experimentalRenderSuggestions:h?e=>v({...e,instanceId:I,withCreateSuggestion:s,currentInputValue:n,createSuggestionButtonText:C,suggestionsQuery:y,handleSuggestionClick:t=>{e.handleSuggestionClick&&e.handleSuggestionClick(t),N(t)}}):null,__experimentalFetchLinkSuggestions:B,__experimentalHandleURLSuggestions:!0,__experimentalShowInitialSuggestions:_,onSubmit:(e,t)=>{var o;const r=e||x;r||null!=n&&null!==(o=n.trim())&&void 0!==o&&o.length?N(r||{url:n}):t.preventDefault()},ref:t}),o)}));var E_=y_;var C_=(0,a.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(O.Path,{d:"M12 3.2c-4.8 0-8.8 3.9-8.8 8.8 0 4.8 3.9 8.8 8.8 8.8 4.8 0 8.8-3.9 8.8-8.8 0-4.8-4-8.8-8.8-8.8zm0 16c-4 0-7.2-3.3-7.2-7.2C4.8 8 8 4.8 12 4.8s7.2 3.3 7.2 7.2c0 4-3.2 7.2-7.2 7.2zM11 17h2v-6h-2v6zm0-8h2V7h-2v2z"}));var w_=(0,a.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(O.Path,{d:"M20.1 5.1L16.9 2 6.2 12.7l-1.3 4.4 4.5-1.3L20.1 5.1zM4 20.8h8v-1.5H4v1.5z"}));const{Slot:S_,Fill:B_}=(0,p.createSlotFill)("BlockEditorLinkControlViewer");function I_(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 x_=function(e){const[t,n]=(0,a.useReducer)(I_,{richData:null,isFetching:!1}),{fetchRichUrlData:o}=(0,m.useSelect)((e=>{const{getSettings:t}=e(qn);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 T_(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}=x_(s),m=u&&Object.keys(u).length,f=n&&(0,mp.filterURLForDisplay)((0,mp.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)(wr,{icon:C_,size:32}):(0,a.createElement)(wr,{icon:d_}),(0,a.createElement)("div",{"aria-label":(0,g.__)("Currently selected"),"aria-selected":"true",className:c()("block-editor-link-control__search-item",{"is-current":!0,"is-rich":m,"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)(p.ExternalLink,{className:"block-editor-link-control__search-item-title",href:n.url},(0,Jr.__unstableStripHTML)(h)),(null==n?void 0:n.url)&&(0,a.createElement)("span",{className:"block-editor-link-control__search-item-info"},f)))),(0,a.createElement)(p.Button,{icon:w_,label:(0,g.__)("Edit"),className:"block-editor-link-control__search-item-action",onClick:o,iconSize:24}),l&&(0,a.createElement)(p.Button,{icon:gg,label:(0,g.__)("Unlink"),className:"block-editor-link-control__search-item-action block-editor-link-control__unlink",onClick:i,iconSize:24}),(0,a.createElement)(S_,{fillProps:n})),(m&&((null==u?void 0:u.image)||(null==u?void 0: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)(p.__experimentalText,{truncate:!0,numberOfLines:"2"},u.description))))}const N_=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}}};function P_(e){var t,n,o;let{searchInputPlaceholder:r,value:l,settings:i=f_,onChange:s=u.noop,onRemove:d,noDirectEntry:m=!1,showSuggestions:f=!0,showInitialSuggestions:h,forceIsEditingLink:v,createSuggestion:b,withCreateSuggestion:k,inputValue:_="",suggestionsQuery:y={},noURLSuggestion:E=!1,createSuggestionButtonText:C,hasRichPreviews:w=!1,hasTextControl:S=!1,renderControlBottom:B=null}=e;void 0===k&&b&&(k=!0);const I=(0,a.useRef)(!0),x=(0,a.useRef)(),T=(0,a.useRef)(),[N,P]=(0,a.useState)((null==l?void 0:l.url)||""),[M,R]=(0,a.useState)((null==l?void 0:l.title)||""),L=_||N,[A,D]=(0,a.useState)(void 0!==v?v:!l||!l.url),O=(0,a.useRef)(!1),F=!(null!=L&&null!==(t=L.trim())&&void 0!==t&&t.length),{createPage:z,isCreatingPage:V,errorMessage:H}=function(e){const t=(0,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=N_(Promise.resolve(e(n))),await t.current.promise}catch(e){if(e&&e.isCanceled)return;throw l(e.message||(0,g.__)("An unknown error occurred during creation. Please try again.")),e}finally{o(!1)}},isCreatingPage:n,errorMessage:r}}(b);function G(){var e;O.current=!(null===(e=x.current)||void 0===e||!e.contains(x.current.ownerDocument.activeElement)),D(!1)}(0,a.useEffect)((()=>{void 0!==v&&v!==A&&D(v)}),[v]),(0,a.useEffect)((()=>{if(I.current)return void(I.current=!1);const e=null!=T&&T.current?1:0;(Jr.focus.focusable.find(x.current)[e]||x.current).focus(),O.current=!1}),[A,V]),(0,a.useEffect)((()=>{null!=l&&l.title&&l.title!==M&&R(l.title),null!=l&&l.url&&P(l.url)}),[l]);const U=()=>{L===(null==l?void 0:l.url)&&M===(null==l?void 0:l.title)||s({url:L,title:M}),G()},W=d&&l&&!A&&!V,$=!(null==i||!i.length),j=(null==l||null===(n=l.url)||void 0===n||null===(o=n.trim())||void 0===o?void 0:o.length)>0&&S;return(0,a.createElement)("div",{tabIndex:-1,ref:x,className:"block-editor-link-control"},V&&(0,a.createElement)("div",{className:"block-editor-link-control__loading"},(0,a.createElement)(p.Spinner,null)," ",(0,g.__)("Creating"),"…"),(A||!l)&&!V&&(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)(p.TextControl,{ref:T,className:"block-editor-link-control__field block-editor-link-control__text-content",label:"Text",value:M,onChange:R,onKeyDown:e=>{const{keyCode:t}=e;t!==Tc.ENTER||F||(e.preventDefault(),U())}}),(0,a.createElement)(E_,{currentLink:l,className:"block-editor-link-control__field block-editor-link-control__search-input",placeholder:r,value:L,withCreateSuggestion:k,onCreateSuggestion:z,onChange:P,onSelect:e=>{s({...e,title:M||(null==e?void 0:e.title)}),G()},showInitialSuggestions:h,allowDirectEntry:!m,showSuggestions:f,suggestionsQuery:y,withURLSuggestion:!E,createSuggestionButtonText:C,useLabel:j},(0,a.createElement)("div",{className:"block-editor-link-control__search-actions"},(0,a.createElement)(p.Button,{onClick:U,label:(0,g.__)("Submit"),icon:r_,className:"block-editor-link-control__search-submit",disabled:F})))),H&&(0,a.createElement)(p.Notice,{className:"block-editor-link-control__search-error",status:"error",isDismissible:!1},H)),l&&!A&&!V&&(0,a.createElement)(T_,{key:null==l?void 0:l.url,value:l,onEditClick:()=>D(!0),hasRichPreviews:w,hasUnlinkControl:W,onRemove:d}),$&&(0,a.createElement)("div",{className:"block-editor-link-control__tools"},(0,a.createElement)(l_,{value:l,settings:i,onChange:s})),B&&B())}P_.ViewerFill=B_;var M_=P_;var R_=(0,a.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(O.Path,{d:"M18.7 3H5.3C4 3 3 4 3 5.3v13.4C3 20 4 21 5.3 21h13.4c1.3 0 2.3-1 2.3-2.3V5.3C21 4 20 3 18.7 3zm.8 15.7c0 .4-.4.8-.8.8H5.3c-.4 0-.8-.4-.8-.8V5.3c0-.4.4-.8.8-.8h13.4c.4 0 .8.4.8.8v13.4zM10 15l5-3-5-3v6z"}));var L_=(0,a.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(O.Path,{d:"M18.5 15v3.5H13V6.7l4.5 4.1 1-1.1-6.2-5.8-5.8 5.8 1 1.1 4-4v11.7h-6V15H4v5h16v-5z"}));var A_=(0,p.withFilters)("editor.MediaUpload")((()=>null));var D_=function(e){let{fallback:t=null,children:n}=e;const o=(0,m.useSelect)((e=>{const{getSettings:t}=e(qn);return!!t().mediaUpload}),[]);return o?n:t};var O_=(0,d.compose)([(0,m.withDispatch)((e=>{const{createNotice:t,removeNotice:n}=e(zd.store);return{createNotice:t,removeNotice:n}})),(0,p.withFilters)("editor.MediaReplaceFlow")])((e=>{let{mediaURL:t,mediaId:n,mediaIds:o,allowedTypes:r,accept:l,onError:i,onSelect:s,onSelectURL:c,onFilesUpload:d=u.noop,name:f=(0,g.__)("Replace"),createNotice:h,removeNotice:v,children:b,multiple:k=!1,addToGallery:_,handleUpload:y=!0}=e;const[E,C]=(0,a.useState)(t),w=(0,m.useSelect)((e=>e(qn).getSettings().mediaUpload),[]),S=(0,a.useRef)(),B=(0,u.uniqueId)("block-editor/media-replace-flow/error-notice/"),I=e=>{const t=(0,Jr.__unstableStripHTML)(e);i?i(t):setTimeout((()=>{h("error",t,{speak:!0,id:B,isDismissible:!0})}),1e3)},x=(e,t)=>{t(),C(null==e?void 0:e.url),s(e),(0,Ft.speak)((0,g.__)("The media file has been replaced")),v(B)},T=e=>{e.keyCode===Tc.DOWN&&(e.preventDefault(),e.target.click())},N=k&&!(!r||0===r.length)&&r.every((e=>"image"===e||e.startsWith("image/")));return(0,a.createElement)(p.Dropdown,{popoverProps:{isAlternate:!0},contentClassName:"block-editor-media-replace-flow__options",renderToggle:e=>{let{isOpen:t,onToggle:n}=e;return(0,a.createElement)(p.ToolbarButton,{ref:S,"aria-expanded":t,"aria-haspopup":"true",onClick:n,onKeyDown:T},f)},renderContent:e=>{let{onClose:t}=e;return(0,a.createElement)(a.Fragment,null,(0,a.createElement)(p.NavigableMenu,{className:"block-editor-media-replace-flow__media-upload-menu"},(0,a.createElement)(A_,{gallery:N,addToGallery:_,multiple:k,value:k?o:n,onSelect:e=>x(e,t),allowedTypes:r,render:e=>{let{open:t}=e;return(0,a.createElement)(p.MenuItem,{icon:R_,onClick:t},(0,g.__)("Open Media Library"))}}),(0,a.createElement)(D_,null,(0,a.createElement)(p.FormFileUpload,{onChange:e=>{((e,t)=>{const n=e.target.files;if(!y)return t(),s(n);d(n),w({allowedTypes:r,filesList:n,onFileChange:e=>{let[n]=e;x(n,t)},onError:I})})(e,t)},accept:l,multiple:k,render:e=>{let{openFileDialog:t}=e;return(0,a.createElement)(p.MenuItem,{icon:L_,onClick:()=>{t()}},(0,g.__)("Upload"))}})),b),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_,{value:{url:E},settings:[],showSuggestions:!1,onChange:e=>{let{url:t}=e;C(t),c(t),S.current.focus()}})))}})}));function F_(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)(p.ExternalLink,{className:r,href:t},n||(0,mp.filterURLForDisplay)((0,mp.safeDecodeURI)(t))):(0,a.createElement)("span",{className:r})}function z_(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)(p.Popover,i({className:"block-editor-url-popover",focusOnMount:l,position:r},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)(p.Button,{className:"block-editor-url-popover__settings-toggle",icon:Jp,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))}z_.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)(c_,{value:r,onChange:o,autocompleteRef:t}),(0,a.createElement)(p.Button,{icon:r_,label:(0,g.__)("Apply"),type:"submit"}))},z_.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)(F_,{url:r,urlLabel:l,className:n}),o&&(0,a.createElement)(p.Button,{icon:w_,label:(0,g.__)("Edit"),onClick:o}))};var V_=z_;const H_=e=>{let{src:t,onChange:n,onSubmit:o,onClose:r}=e;return(0,a.createElement)(V_,{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)(p.Button,{className:"block-editor-media-placeholder__url-input-submit-button",icon:r_,label:(0,g.__)("Apply"),type:"submit"})))};var G_=(0,p.withFilters)("editor.MediaPlaceholder")((function(e){let{value:t={},allowedTypes:n,className:o,icon:r,labels:l={},mediaPreview:i,notices:s,isAppender:d,accept:f,addToGallery:h,multiple:v=!1,handleUpload:b=!0,disableDropZone:k,disableMediaButtons:_,onError:y,onSelect:E,onCancel:C,onSelectURL:w,onDoubleClick:S,onFilesPreUpload:B=u.noop,onHTMLDrop:I=u.noop,children:x,mediaLibraryButton:T,placeholder:N,style:P}=e;const M=(0,m.useSelect)((e=>{const{getSettings:t}=e(qn);return t().mediaUpload}),[]),[R,L]=(0,a.useState)(""),[A,D]=(0,a.useState)(!1);(0,a.useEffect)((()=>{var e;L(null!==(e=null==t?void 0:t.src)&&void 0!==e?e:"")}),[null==t?void 0:t.src]);const O=e=>{L(e.target.value)},F=()=>{D(!0)},z=()=>{D(!1)},V=e=>{e.preventDefault(),R&&w&&(w(R),z())},H=e=>{if(!b)return E(e);let o;if(B(e),v)if(h){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)}))));E(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=E;else o=e=>{let[t]=e;return E(t)};M({allowedTypes:n,filesList:e,onFileChange:o,onError:y})},G=e=>{H(e.target.files)},U=null!=N?N:e=>{let{instructions:t,title:u}=l;if(M||w||(t=(0,g.__)("To edit this block, you need permission to upload media.")),void 0===t||void 0===u){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===u&&(u=(0,g.__)("Media"),l?u=(0,g.__)("Audio"):i?u=(0,g.__)("Image"):a&&(u=(0,g.__)("Video")))}const m=c()("block-editor-media-placeholder",o,{"is-appender":d});return(0,a.createElement)(p.Placeholder,{icon:r,label:u,instructions:t,className:m,notices:s,onDoubleClick:S,preview:i,style:P},e,x)},W=()=>k?null:(0,a.createElement)(p.DropZone,{onFilesDrop:H,onHTMLDrop:I}),$=()=>C&&(0,a.createElement)(p.Button,{className:"block-editor-media-placeholder__cancel-button",title:(0,g.__)("Cancel"),variant:"link",onClick:C},(0,g.__)("Cancel")),j=()=>w&&(0,a.createElement)("div",{className:"block-editor-media-placeholder__url-input-container"},(0,a.createElement)(p.Button,{className:"block-editor-media-placeholder__button",onClick:F,isPressed:A,variant:"tertiary"},(0,g.__)("Insert from URL")),A&&(0,a.createElement)(H_,{src:R,onChange:O,onSubmit:V,onClose:z}));return _?(0,a.createElement)(D_,null,W()):(0,a.createElement)(D_,{fallback:U(j())},(()=>{const e=null!=T?T:e=>{let{open:t}=e;return(0,a.createElement)(p.Button,{variant:"tertiary",onClick:()=>{t()}},(0,g.__)("Media Library"))},o=(0,a.createElement)(A_,{addToGallery:h,gallery:v&&!(!n||0===n.length)&&n.every((e=>"image"===e||e.startsWith("image/"))),multiple:v,onSelect:E,allowedTypes:n,value:Array.isArray(t)?t.map((e=>{let{id:t}=e;return t})):t.id,render:e});if(M&&d)return(0,a.createElement)(a.Fragment,null,W(),(0,a.createElement)(p.FormFileUpload,{onChange:G,accept:f,multiple:v,render:e=>{let{openFileDialog:t}=e;const n=(0,a.createElement)(a.Fragment,null,(0,a.createElement)(p.Button,{variant:"primary",className:c()("block-editor-media-placeholder__button","block-editor-media-placeholder__upload-button"),onClick:t},(0,g.__)("Upload")),o,j(),$());return U(n)}}));if(M){const e=(0,a.createElement)(a.Fragment,null,W(),(0,a.createElement)(p.FormFileUpload,{variant:"primary",className:c()("block-editor-media-placeholder__button","block-editor-media-placeholder__upload-button"),onChange:G,accept:f,multiple:v},(0,g.__)("Upload")),o,j(),$());return U(e)}return U(o)})())}));var U_=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)(yk,i({settings:o,gradients:[],disableCustomGradients:!0},n))};const W_={position:"bottom right",isAlternate:!0};var $_=()=>(0,a.createElement)(a.Fragment,null,["bold","italic","link"].map((e=>(0,a.createElement)(p.Slot,{name:`RichText.ToolbarControls.${e}`,key:e}))),(0,a.createElement)(p.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)(p.ToolbarItem,null,(n=>(0,a.createElement)(p.DropdownMenu,{icon:Jp,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:W_})))})));var j_=e=>{let{inline:t,anchorRef:n}=e;return t?(0,a.createElement)(p.Popover,{noArrow:!0,position:"top center",focusOnMount:!1,anchorRef:n,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)(p.ToolbarGroup,null,(0,a.createElement)($_,null)))):(0,a.createElement)(ro,{group:"inline"},(0,a.createElement)($_,null))};function K_(){const{didAutomaticChange:e,getSettings:t}=(0,m.useSelect)(qn);return(0,d.useRefEffect)((n=>{function o(n){const{keyCode:o}=n;n.defaultPrevented||o!==Tc.DELETE&&o!==Tc.BACKSPACE&&o!==Tc.ESCAPE||e()&&(n.preventDefault(),t().__experimentalUndo())}return n.addEventListener("keydown",o),()=>{n.removeEventListener("keydown",o)}}),[])}function q_(e){return e.filter((e=>{let{type:t}=e;return/^image\/(?:jpe?g|png|gif|webp)$/.test(t)})).map((e=>``)).join("")}var Y_=window.wp.shortcode;function Q_(e,t){if(null!=t&&t.length){let n=e.formats.length;for(;n--;)e.formats[n]=[...t,...e.formats[n]||[]]}}function X_(e){if(!0===e||"p"===e||"li"===e)return!0===e?"p":e}function Z_(e){let{allowedFormats:t,formattingControls:n,disableFormats:o}=e;return o?Z_.EMPTY_ARRAY:t||n?t||(Vt()("wp.blockEditor.RichText formattingControls prop",{since:"5.4",alternative:"allowedFormats",version:"6.2"}),n.map((e=>`core/${e}`))):void 0}Z_.EMPTY_ARRAY=[];function J_(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 ey(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 ty(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="";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 k=a.reduce(((e,t)=>{let{__unstablePasteRule:n}=t;return n&&e===i&&(e=n(i,{html:b,plainText:v})),e}),i);if(k!==i)return void l(k);const _=[...(0,Jr.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=ey(t,!!m),Q_(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!=_&&_.length&&!Fm(_,b)){const e=(0,r.pasteHandler)({HTML:q_(_),mode:"BLOCKS",tagName:s,preserveWhiteSpace:f});return window.console.log("Received items:\n\n",_),void(c&&(0,z.isEmpty)(i)?c(e):J_({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,Y_.regexp)(".*").test(E))&&(y="BLOCKS"),p&&(0,z.isEmpty)(i)&&(0,mp.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=ey(e,!!m),Q_(e,i.activeFormats),l((0,z.insert)(i,e))}else C.length>0&&(c&&(0,z.isEmpty)(i)?c(C,C.length-1,-1):J_({value:i,pastedBlocks:C,onReplace:c,onSplit:u,onSplitMiddle:d,multilineTag:m}))}return e.addEventListener("paste",n),()=>{e.removeEventListener("paste",n)}}),[])}function ny(e){let t=e.length;for(;t--;){const n=(0,u.findKey)(e[t].attributes,(e=>"string"==typeof e&&-1!==e.indexOf("†")));if(n)return e[t].attributes[n]=e[t].attributes[n].replace("†",""),e[t].clientId;const o=ny(e[t].innerBlocks);if(o)return o}}function oy(e){const{__unstableMarkLastChangeAsPersistent:t,__unstableMarkAutomaticChange:n}=(0,m.useDispatch)(qn),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,"†",0,i)}),p=u.transform(d);l(ny([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{e.removeEventListener("input",i),e.removeEventListener("compositionend",i)}}),[])}function ry(e){const{__unstableMarkAutomaticChange:t}=(0,m.useDispatch)(qn),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!==Tc.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)?J_({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&&J_({value:m,onReplace:i,onSplit:a,onSplitMiddle:s,multilineTag:c})}}return e.addEventListener("keydown",o),()=>{e.removeEventListener("keydown",o)}}),[])}function ly(e){return e(z.store).getFormatTypes()}const iy=new Set(["a","audio","button","details","embed","iframe","input","label","select","textarea","video"]);function ay(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 sy(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 cy(){const{isMultiSelecting:e}=(0,m.useSelect)(qn);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 uy(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 dy=(0,a.createContext)(),py=(0,a.createContext)();const my=(0,a.forwardRef)((function e(t,n){let{children:o,tagName:l="div",value:s="",onChange:f,isSelected:g,multiline:h,inlineToolbar:v,wrapperClassName:b,autocompleters:k,onReplace:_,placeholder:y,allowedFormats:E,formattingControls:C,withoutInteractiveFormatting:w,onRemove:S,onMerge:B,onSplit:I,__unstableOnSplitAtEnd:x,__unstableOnSplitMiddle:T,identifier:N,preserveWhiteSpace:P,__unstablePastePlainText:M,__unstableEmbedURLOnPaste:R,__unstableDisableFormats:L,disableLineBreaks:A,unstableOnFocus:D,__unstableAllowPrefixTransformations:O,...F}=t;const V=(0,d.useInstanceId)(e);N=N||V,F=function(e){return(0,u.omit)(e,["__unstableMobileNoFocusOnMount","deleteEnter","placeholderTextColor","textAlign","selectionColor","tagsToEliminate","rootTagsToEliminate","disableEditingMenu","fontSize","fontFamily","fontWeight","fontStyle","minWidth","maxWidth","setRef"])}(F);const H=(0,a.useRef)(),{clientId:G}=Zn(),{selectionStart:U,selectionEnd:W,isSelected:$}=(0,m.useSelect)((e=>{const{getSelectionStart:t,getSelectionEnd:n}=e(qn),o=t(),r=n();let l;return void 0===g?l=o.clientId===G&&r.clientId===G&&o.attributeKey===N:g&&(l=o.clientId===G),{selectionStart:l?o.offset:void 0,selectionEnd:l?r.offset:void 0,isSelected:l}})),{selectionChange:j}=(0,m.useDispatch)(qn),K=X_(h),q=Z_({allowedFormats:E,formattingControls:C,disableFormats:L}),Y=!q||q.length>0;let Q=s,X=f;Array.isArray(s)&&(Q=r.children.toHTML(s),X=e=>f(r.children.fromDOM((0,z.__unstableCreateElement)(document,e).childNodes)));const Z=(0,a.useCallback)(((e,t)=>{const n={},o=void 0===e&&void 0===t;("number"==typeof e||o)&&(n.start={clientId:G,attributeKey:N,offset:e}),("number"==typeof t||o)&&(n.end={clientId:G,attributeKey:N,offset:t}),j(n)}),[G,N]),{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,m.useSelect)(ly,[]),i=(0,a.useMemo)((()=>l.filter((e=>{let{name:t,tagName:n}=e;return!(r&&!r.includes(t)||o&&iy.has(n))}))),[l,r,iy]),s=(0,m.useSelect)((e=>i.reduce(((o,r)=>(r.__experimentalGetPropsForEditableTreePreparation&&(o[r.name]=r.__experimentalGetPropsForEditableTreePreparation(e,{richTextIdentifier:n,blockClientId:t})),o)),{})),[i,t,n]),c=(0,m.useDispatch)(),u=[],d=[],p=[],f=[];return i.forEach((e=>{if(e.__experimentalCreatePrepareEditableTree){const o=s[e.name],r=e.__experimentalCreatePrepareEditableTree(o,{richTextIdentifier:n,blockClientId:t});e.__experimentalCreateOnChangeEditableValue?d.push(r):u.push(r);for(const e in o)f.push(o[e])}if(e.__experimentalCreateOnChangeEditableValue){let o={};e.__experimentalGetPropsForEditableTreeChangeHandler&&(o=e.__experimentalGetPropsForEditableTreeChangeHandler(c,{richTextIdentifier:n,blockClientId:t})),p.push(e.__experimentalCreateOnChangeEditableValue({...s[e.name]||{},...o},{richTextIdentifier:n,blockClientId:t}))}})),{formatTypes:i,prepareHandlers:u,valueHandlers:d,changeHandlers:p,dependencies:f}}({clientId:G,identifier:N,withoutInteractiveFormatting:w,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:Q,onChange(e,t){let{__unstableFormats:n,__unstableText:o}=t;X(e),Object.values(ne).forEach((e=>{e(n,o)}))},selectionStart:U,selectionEnd:W,onSelectionChange:Z,placeholder:y,__unstableIsSelected:$,__unstableMultilineTag:K,__unstableDisableFormats:L,preserveWhiteSpace:P,__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,p.__unstableUseAutocompleteProps)({...e,completers:ib(e)})}({onReplace:_,completers:k,record:le,onChange:ie});!function(e){let{value:t}=e;const n=t.activeFormats&&!!t.activeFormats.length,{isCaretWithinFormattedText:o}=(0,m.useSelect)(qn),{enterFormattedText:r,exitFormattedText:l}=(0,m.useDispatch)(qn);(0,a.useEffect)((()=>{n?o()||r():o()&&l()}),[n])}({value:le}),function(e){let{html:t,value:n}=e;const o=(0,a.useRef)(),r=n.activeFormats&&!!n.activeFormats.length,{__unstableMarkLastChangeAsPersistent:l}=(0,m.useDispatch)(qn);(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:Q,value:le});const ce=(0,a.useRef)(new Set),ue=(0,a.useRef)(new Set);function de(){H.current.focus()}const pe=l,me=(0,a.createElement)(a.Fragment,null,$&&(0,a.createElement)(dy.Provider,{value:ce},(0,a.createElement)(py.Provider,{value:ue},(0,a.createElement)(p.Popover.__unstableSlotNameProvider,{value:"__unstable-block-tools-after"},o&&o({value:le,onChange:ie,onFocus:de}),(0,a.createElement)(uy,{value:le,onChange:ie,onFocus:de,formatTypes:J,forwardedRef:H})))),$&&Y&&(0,a.createElement)(j_,{inline:v,anchorRef:H.current}),(0,a.createElement)(pe,i({role:"textbox","aria-multiline":!A,"aria-label":y},F,se,{ref:(0,d.useMergeRefs)([n,se.ref,F.ref,ae,oy({value:le,onChange:ie,__unstableAllowPrefixTransformations:O,formatTypes:J,onReplace:_,selectionChange:j}),(0,d.useRefEffect)((e=>{function t(e){(Tc.isKeyboardEvent.primary(e,"z")||Tc.isKeyboardEvent.primary(e,"y")||Tc.isKeyboardEvent.primaryShift(e,"z"))&&e.preventDefault()}return e.addEventListener("keydown",t),()=>{e.addEventListener("keydown",t)}}),[]),ay(ce),sy(ue),K_(),ty({isSelected:$,disableFormats:L,onChange:ie,value:le,formatTypes:J,tagName:l,onReplace:_,onSplit:I,onSplitMiddle:T,__unstableEmbedURLOnPaste:R,multilineTag:K,preserveWhiteSpace:P,pastePlainText:M}),ry({removeEditorOnlyFormats:re,value:le,onReplace:_,onSplit:I,onSplitMiddle:T,multilineTag:K,onChange:ie,disableLineBreaks:A,onSplitAtEnd:x}),cy(),H]),contentEditable:!0,suppressContentEditableWarning:!0,className:c()("block-editor-rich-text__editable",F.className,"rich-text"),onFocus:D,onKeyDown:function(e){const{keyCode:t}=e;if(!e.defaultPrevented&&(t===Tc.DELETE||t===Tc.BACKSPACE)){const{start:n,end:o,text:r}=le,l=t===Tc.BACKSPACE,i=le.activeFormats&&!!le.activeFormats.length;if(!(0,z.isCollapsed)(le)||i||l&&0!==n||!l&&o!==r.length)return;B&&B(!l),S&&(0,z.isEmpty)(le)&&l&&S(!l),e.preventDefault()}}})));if(!b)return me;Vt()("wp.blockEditor.RichText wrapperClassName prop",{since:"5.4",alternative:"className prop or create your own wrapper div",version:"6.2"});const fe=c()("block-editor-rich-text",b);return(0,a.createElement)("div",{className:fe},me)}));my.Content=e=>{let{value:t,tagName:n,multiline:o,...l}=e;Array.isArray(t)&&(t=r.children.toHTML(t));const i=X_(o);!t&&i&&(t=`<${i}>`);const s=(0,a.createElement)(a.RawHTML,null,t);return n?(0,a.createElement)(n,(0,u.omit)(l,["format"]),s):s},my.isEmpty=e=>!e||0===e.length;var fy=my;const gy=(0,a.forwardRef)(((e,t)=>(0,a.createElement)(fy,i({ref:t},e,{__unstableDisableFormats:!0,preserveWhiteSpace:!0}))));gy.Content=e=>{let{value:t="",tagName:n="div",...o}=e;return(0,a.createElement)(n,o,t)};var hy=gy;var vy=(0,a.forwardRef)(((e,t)=>{let{__experimentalVersion:n,...o}=e;if(2===n)return(0,a.createElement)(hy,i({ref:t},o));const{className:r,onChange:l,...s}=o;return(0,a.createElement)(vl.Z,i({ref:t,className:c()("block-editor-plain-text",r),onChange:e=>l(e.target.value)},s))}));function by(e){let{property:t,viewport:n,desc:o}=e;const r=(0,d.useInstanceId)(by),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)(p.VisuallyHidden,{as:"span",id:`rbc-desc-${r}`},l))}var ky=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 m=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)(by,{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)(p.ToggleControl,{className:"block-editor-responsive-block-control__toggle",label:m,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)(by,{property:n,viewport:e}),e))))))))};function _y(e){let{character:t,type:n,onUse:o}=e;const r=(0,a.useContext)(dy),l=(0,a.useRef)();return l.current=o,(0,a.useEffect)((()=>{function e(e){Tc.isKeyboardEvent[n](e,t)&&(l.current(),e.preventDefault())}return r.current.add(e),()=>{r.current.delete(e)}}),[t,n]),null}function yy(e){let t,{name:n,shortcutType:o,shortcutCharacter:r,...l}=e,s="RichText.ToolbarControls";return n&&(s+=`.${n}`),o&&r&&(t=Tc.displayShortcut[o](r)),(0,a.createElement)(p.Fill,{name:s},(0,a.createElement)(p.ToolbarButton,i({},l,{shortcut:t})))}function Ey(e){let{inputType:t,onInput:n}=e;const o=(0,a.useContext)(py),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 Cy=(0,a.createElement)(p.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},(0,a.createElement)(p.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 wy=(0,a.forwardRef)((function(e,t){const n=(0,m.useSelect)((e=>e(qn).isNavigationMode()),[]),{setNavigationMode:o}=(0,m.useDispatch)(qn),r=e=>{o("edit"!==e)};return(0,a.createElement)(p.Dropdown,{renderToggle:o=>{let{isOpen:r,onToggle:l}=o;return(0,a.createElement)(p.Button,i({},e,{ref:t,icon:n?Cy:w_,"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)(p.NavigableMenu,{role:"menu","aria-label":(0,g.__)("Tools")},(0,a.createElement)(p.MenuItemsChoice,{value:n?"select":"edit",onSelect:r,choices:[{value:"edit",label:(0,a.createElement)(a.Fragment,null,(0,a.createElement)(wr,{icon:w_}),(0,g.__)("Edit"))},{value:"select",label:(0,a.createElement)(a.Fragment,null,Cy,(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 Sy(e){let{units:t,...n}=e;const o=(0,p.__experimentalUseCustomUnits)({availableUnits:Io("spacing.units")||["%","px","em","rem","vw"],units:t});return(0,a.createElement)(p.__experimentalUnitControl,i({units:o},n))}var By=(0,a.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(O.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 Iy 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)(p.Button,{icon:fg,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)(p.Button,{className:"block-editor-url-input__back",icon:By,label:(0,g.__)("Close"),onClick:this.toggle}),(0,a.createElement)(c_,{value:e||"",onChange:t}),(0,a.createElement)(p.Button,{icon:r_,label:(0,g.__)("Submit"),type:"submit"}))))}}var xy=Iy;var Ty=(0,a.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(O.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 Ny="none",Py="custom",My="media",Ry="attachment",Ly=["noreferrer","noopener"],Ay=(0,a.createElement)(p.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,a.createElement)(p.Path,{d:"M0,0h24v24H0V0z",fill:"none"}),(0,a.createElement)(p.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)(p.Path,{d:"m14.14 11.86l-3 3.87-2.14-2.59-3 3.86h12l-3.86-5.14z"})),Dy=e=>{let{linkDestination:t,onChangeUrl:n,url:o,mediaType:r="image",mediaUrl:l,mediaLink:i,linkTarget:s,linkClass:c,rel:d}=e;const[m,f]=(0,a.useState)(!1),h=(0,a.useCallback)((()=>{f(!0)})),[v,b]=(0,a.useState)(!1),[k,_]=(0,a.useState)(null),y=(0,a.useRef)(null),E=(0,a.useCallback)((()=>{t!==My&&t!==Ry||_(""),b(!0)})),C=(0,a.useCallback)((()=>{b(!1)})),w=(0,a.useCallback)((()=>{_(null),C(),f(!1)})),S=(0,a.useCallback)((()=>e=>{const t=y.current;t&&t.contains(e.target)||(f(!1),_(null),C())})),B=(0,a.useCallback)((()=>e=>{if(k){var t;const e=(null===(t=x().find((e=>e.url===k)))||void 0===t?void 0:t.linkDestination)||Py;n({href:k,linkDestination:e})}C(),_(null),e.preventDefault()})),I=(0,a.useCallback)((()=>{n({linkDestination:Ny,href:""})})),x=()=>{const e=[{linkDestination:My,title:(0,g.__)("Media File"),url:"image"===r?l:void 0,icon:Ay}];return"image"===r&&i&&e.push({linkDestination:Ry,title:(0,g.__)("Attachment Page"),url:"image"===r?i:void 0,icon:(0,a.createElement)(p.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,a.createElement)(p.Path,{d:"M0 0h24v24H0V0z",fill:"none"}),(0,a.createElement)(p.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},T=(0,a.createElement)(a.Fragment,null,(0,a.createElement)(p.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(" ");Ly.forEach((t=>{e.includes(t)||e.push(t)})),n=e.join(" ")}else{const e=(null!=d?d:"").split(" ").filter((e=>!1===Ly.includes(e)));n=e.length?e.join(" "):void 0}return{linkTarget:t,rel:n}})(e);n(t)},checked:"_blank"===s}),(0,a.createElement)(p.TextControl,{label:(0,g.__)("Link Rel"),value:null!=d?d:"",onChange:e=>{n({rel:e})}}),(0,a.createElement)(p.TextControl,{label:(0,g.__)("Link CSS Class"),value:c||"",onChange:e=>{n({linkClass:e})}})),N=null!==k?k:o,P=((0,u.find)(x(),["linkDestination",t])||{}).title;return(0,a.createElement)(a.Fragment,null,(0,a.createElement)(p.ToolbarButton,{icon:fg,className:"components-toolbar__control",label:o?(0,g.__)("Edit link"):(0,g.__)("Insert link"),"aria-expanded":m,onClick:h}),m&&(0,a.createElement)(V_,{onFocusOutside:S(),onClose:w,renderSettings:()=>T,additionalControls:!N&&(0,a.createElement)(p.NavigableMenu,null,(0,u.map)(x(),(e=>(0,a.createElement)(p.MenuItem,{key:e.linkDestination,icon:e.icon,onClick:()=>{_(null),(e=>{const t=x();let o;o=e?((0,u.find)(t,(t=>t.url===e))||{linkDestination:Py}).linkDestination:Ny,n({linkDestination:o,href:e})})(e.url),C()}},e.title))))},(!o||v)&&(0,a.createElement)(V_.LinkEditor,{className:"block-editor-format-toolbar__link-container-content",value:N,onChangeInputValue:_,onSubmit:B(),autocompleteRef:y}),o&&!v&&(0,a.createElement)(a.Fragment,null,(0,a.createElement)(V_.LinkViewer,{className:"block-editor-format-toolbar__link-container-content",url:o,onEditLinkClick:E,urlLabel:P}),(0,a.createElement)(p.Button,{icon:Ty,label:(0,g.__)("Remove link"),onClick:I}))))};function Oy(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.__)("Preview")};return(0,a.createElement)(p.DropdownMenu,{className:"block-editor-post-preview__dropdown",popoverProps:i,toggleProps:s,icon:null},(()=>(0,a.createElement)(a.Fragment,null,(0,a.createElement)(p.MenuGroup,null,(0,a.createElement)(p.MenuItem,{className:"block-editor-post-preview__button-resize",onClick:()=>l("Desktop"),icon:"Desktop"===r&&hm},(0,g.__)("Desktop")),(0,a.createElement)(p.MenuItem,{className:"block-editor-post-preview__button-resize",onClick:()=>l("Tablet"),icon:"Tablet"===r&&hm},(0,g.__)("Tablet")),(0,a.createElement)(p.MenuItem,{className:"block-editor-post-preview__button-resize",onClick:()=>l("Mobile"),icon:"Mobile"===r&&hm},(0,g.__)("Mobile"))),t)))}function Fy(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{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 zy=(0,m.withSelect)((e=>({selectedBlockClientId:e(qn).getBlockSelectionStart()})))((e=>{let{selectedBlockClientId:t}=e;const n=Eo(t);return t?(0,a.createElement)(p.Button,{variant:"secondary",className:"block-editor-skip-to-selected-block",onClick:()=>{n.current.focus()}},(0,g.__)("Skip to the selected block")):null})),Vy=window.wp.wordcount;var Hy=(0,m.withSelect)((e=>{const{getMultiSelectedBlocks:t}=e(qn);return{blocks:t()}}))((function(e){let{blocks:t}=e;const n=(0,Vy.count)((0,r.serialize)(t),"words");return(0,a.createElement)("div",{className:"block-editor-multi-selection-inspector__card"},(0,a.createElement)(Wc,{icon:mm,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 Gy(e){let{blockName:t}=e;const{preferredStyle:n,onUpdatePreferredStyleVariations:o,styles:l}=(0,m.useSelect)((e=>{var n,o;const l=e(qn).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=_m(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)(p.SelectControl,{options:i,value:n||"",label:(0,g.__)("Default Style"),onChange:c})):null}const Uy=e=>{let{clientId:t,blockName:n,hasBlockStyles:o}=e;const l=Gp(t);return(0,a.createElement)("div",{className:"block-editor-block-inspector"},(0,a.createElement)($c,l),(0,a.createElement)(ik,{blockClientId:t}),o&&(0,a.createElement)("div",null,(0,a.createElement)(p.PanelBody,{title:(0,g.__)("Styles")},(0,a.createElement)(Wb,{scope:"core/block-inspector",clientId:t}),(0,r.hasBlockSupport)(n,"defaultStylePicker",!0)&&(0,a.createElement)(Gy,{blockName:n}))),(0,a.createElement)(zo.Slot,null),(0,a.createElement)(zo.Slot,{__experimentalGroup:"color",label:(0,g.__)("Color"),className:"color-block-support-panel__inner-wrapper"}),(0,a.createElement)(zo.Slot,{__experimentalGroup:"typography",label:(0,g.__)("Typography")}),(0,a.createElement)(zo.Slot,{__experimentalGroup:"dimensions",label:(0,g.__)("Dimensions")}),(0,a.createElement)(zo.Slot,{__experimentalGroup:"border",label:(0,g.__)("Border")}),(0,a.createElement)("div",null,(0,a.createElement)(Wy,null)),(0,a.createElement)(zy,{key:"back"}))},Wy=()=>{const e=(0,p.__experimentalUseSlot)(Fo.slotName);return Boolean(e.fills&&e.fills.length)?(0,a.createElement)(p.PanelBody,{className:"block-editor-block-inspector__advanced",title:(0,g.__)("Advanced"),initialOpen:!1},(0,a.createElement)(zo.Slot,{__experimentalGroup:"advanced"})):null};var $y=e=>{let{showNoBlockSelectedMessage:t=!0}=e;const{count:n,hasBlockStyles:o,selectedBlockName:l,selectedBlockClientId:i,blockType:s}=(0,m.useSelect)((e=>{const{getSelectedBlockClientId:t,getSelectedBlockCount:n,getBlockName:o}=e(qn),{getBlockStyles:l}=e(r.store),i=t(),a=i&&o(i),s=a&&(0,r.getBlockType)(a),c=a&&l(a);return{count:n(),selectedBlockClientId:i,selectedBlockName:a,blockType:s,hasBlockStyles:c&&c.length>0}}),[]);if(n>1)return(0,a.createElement)("div",{className:"block-editor-block-inspector"},(0,a.createElement)(Hy,null),(0,a.createElement)(zo.Slot,null),(0,a.createElement)(zo.Slot,{__experimentalGroup:"color",label:(0,g.__)("Color"),className:"color-block-support-panel__inner-wrapper"}),(0,a.createElement)(zo.Slot,{__experimentalGroup:"typography",label:(0,g.__)("Typography")}),(0,a.createElement)(zo.Slot,{__experimentalGroup:"dimensions",label:(0,g.__)("Dimensions")}),(0,a.createElement)(zo.Slot,{__experimentalGroup:"border",label:(0,g.__)("Border")}));const c=l===(0,r.getUnregisteredTypeHandlerName)();return s&&i&&!c?(0,a.createElement)(Uy,{clientId:i,blockName:s.name,hasBlockStyles:o}):t?(0,a.createElement)("span",{className:"block-editor-block-inspector__no-blocks"},(0,g.__)("No block selected.")):null};function jy(e){let{children:t,__unstableContentRef:n,...o}=e;const r=(0,d.useViewportMatch)("medium"),l=(0,m.useSelect)((e=>e(qn).getSettings().hasFixedToolbar),[]),s=(0,tu.__unstableUseShortcutEventMatch)(),{getSelectedBlockClientIds:c,getBlockRootClientId:f}=(0,m.useSelect)(qn),{duplicateBlocks:g,removeBlocks:h,insertAfterBlock:v,insertBeforeBlock:b,clearSelectedBlock:k,moveBlocksUp:_,moveBlocksDown:y}=(0,m.useDispatch)(qn);return(0,a.createElement)("div",i({},o,{onKeyDown:function(e){if(s("core/block-editor/move-up",e)){const t=c();if(t.length){e.preventDefault();const n=f((0,u.first)(t));_(t,n)}}else if(s("core/block-editor/move-down",e)){const t=c();if(t.length){e.preventDefault();const n=f((0,u.first)(t));y(t,n)}}else if(s("core/block-editor/duplicate",e)){const t=c();t.length&&(e.preventDefault(),g(t))}else if(s("core/block-editor/remove",e)){const t=c();t.length&&(e.preventDefault(),h(t))}else if(s("core/block-editor/insert-after",e)){const t=c();t.length&&(e.preventDefault(),v((0,u.last)(t)))}else if(s("core/block-editor/insert-before",e)){const t=c();t.length&&(e.preventDefault(),b((0,u.first)(t)))}else if(s("core/block-editor/unselect",e)){c().length>1&&(e.preventDefault(),k(),e.target.ownerDocument.defaultView.getSelection().removeAllRanges())}}}),(0,a.createElement)(Fp,{__unstableContentRef:n},(l||!r)&&(0,a.createElement)(bf,{isFixed:!0}),(0,a.createElement)(Ef,{__unstableContentRef:n}),(0,a.createElement)(p.Popover.Slot,{name:"block-toolbar",ref:Ap(n)}),t,(0,a.createElement)(p.Popover.Slot,{name:"__unstable-block-tools-after",ref:Ap(n)})))}var Ky=(0,a.forwardRef)((function(e,t){let{rootClientId:n,clientId:o,isAppender:r,showInserterHelpPanel:l,showMostUsedBlocks:i=!1,__experimentalInsertionIndex:s,__experimentalFilterValue:c,onSelect:d=u.noop,shouldFocusBlock:p=!1}=e;const f=(0,m.useSelect)((e=>{const{getBlockRootClientId:t}=e(qn);return n||t(o)||void 0}),[o,n]);return(0,a.createElement)(Sp,{onSelect:d,rootClientId:f,clientId:o,isAppender:r,showInserterHelpPanel:l,showMostUsedBlocks:i,__experimentalInsertionIndex:s,__experimentalFilterValue:c,shouldFocusBlock:p,ref:t})}));function qy(){return null}qy.Register=function(){const{registerShortcut:e}=(0,m.useDispatch)(tu.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 Yy=qy;function Qy(){return Vt()("wp.blockEditor.MultiSelectScrollIntoView",{hint:"This behaviour is now built-in.",since:"5.8"}),null}const Xy=new Set([Tc.UP,Tc.RIGHT,Tc.DOWN,Tc.LEFT,Tc.ENTER,Tc.BACKSPACE]);function Zy(){const e=(0,m.useSelect)((e=>e(qn).isTyping()),[]),{stopTyping:t}=(0,m.useDispatch)(qn);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 Jy(){const e=(0,m.useSelect)((e=>e(qn).isTyping())),{startTyping:t,stopTyping:n}=(0,m.useDispatch)(qn),o=Zy(),r=(0,d.useRefEffect)((o=>{const{ownerDocument:r}=o,{defaultView:l}=r;if(e){let a;function s(e){const{target:t}=e;a=l.setTimeout((()=>{(0,Jr.isTextField)(t)||n()}))}function c(e){const{keyCode:t}=e;t!==Tc.ESCAPE&&t!==Tc.TAB||n()}function u(){const e=l.getSelection();e.rangeCount>0&&e.getRangeAt(0).collapsed||n()}return o.addEventListener("focus",s),o.addEventListener("keydown",c),r.addEventListener("selectionchange",u),()=>{l.clearTimeout(a),o.removeEventListener("focus",s),o.removeEventListener("keydown",c),r.removeEventListener("selectionchange",u)}}function i(e){const{type:n,target:r}=e;(0,Jr.isTextField)(r)&&o.contains(r)&&("keydown"!==n||function(e){const{keyCode:t,shiftKey:n}=e;return!n&&Xy.has(t)}(e))&&t()}return o.addEventListener("keypress",i),o.addEventListener("keydown",i),()=>{o.removeEventListener("keypress",i),o.removeEventListener("keydown",i)}}),[e,t,n]);return(0,d.useMergeRefs)([o,r])}var eE=function(e){let{children:t}=e;return(0,a.createElement)("div",{ref:Jy()},t)};const tE=-1!==window.navigator.userAgent.indexOf("Trident"),nE=new Set([Tc.UP,Tc.DOWN,Tc.LEFT,Tc.RIGHT]);function oE(){const e=(0,m.useSelect)((e=>e(qn).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,Jr.computeCaretRect)(o);if(!l)return;if(!i)return void(i=l);if(nE.has(r))return void(i=l);const a=l.top-i.top;if(0===a)return;const s=(0,Jr.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{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 rE=tE?e=>e.children:function(e){let{children:t}=e;return(0,a.createElement)("div",{ref:oE(),className:"block-editor__typewriter"},t)};const lE=(0,a.createContext)({});function iE(e,t,n){const o={...e,[t]:e[t]?new Set(e[t]):new Set};return o[t].add(n),o}function aE(e){var t;let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const o=(0,a.useContext)(lE),{name:r}=Zn();n=n||r;const l=Boolean(null===(t=o[n])||void 0===t?void 0:t.has(e)),i=(0,a.useMemo)((()=>iE(o,n,e)),[o,n,e]),s=(0,a.useCallback)((e=>{let{children:t}=e;return(0,a.createElement)(lE.Provider,{value:i},t)}),[i]);return[l,s]}const sE=(e,t)=>{if(!t||!e)return;const n=t.filter((t=>{let{attributes:n}=t;return!(!n||!Object.keys(n).length)&&(0,u.isMatch)(e,n)}));return 1===n.length?n[0]:void 0};function cE(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 uE(e,t){const n=e.split(/[(),]/g).filter(Boolean),o=n.slice(1).map((e=>cE(gE(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[2]?o[2]+"px":o[1]+"px";case"calc":return o[0]+"px"}}function dE(e){for(;;){const t=e,n=/(max|min|calc|clamp)\(([^()]*)\)/g.exec(e)||[];if(n[0]){const t=uE(n[0]);e=e.replace(n[0],t)}if(e===t||parseFloat(e))break}return cE(e)}function pE(e){for(let t=0;tr.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 gE(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=cE(e);return n.unit||(n=dE(e)),pE(e)&&!n.unit?mE(e):fE(n,t)}const hE={};function vE(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 bE=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=e+vE(t);return hE[n]||(hE[n]=gE(e,t)),hE[n]}}(),(window.wp=window.wp||{}).blockEditor=o}(); \ No newline at end of file + */,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;n3&&void 0!==arguments[3]?arguments[3]:1;const r=[...e];return r.splice(t,o),b(r,e.slice(t,t+o),n)}function _(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const n={[t]:[]};return e.forEach((e=>{const{clientId:o,innerBlocks:r}=e;n[t].push(o),Object.assign(n,_(r,o))})),n}function y(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return e.reduce(((e,n)=>Object.assign(e,{[n.clientId]:t},y(n.innerBlocks,n.clientId))),{})}function E(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:u.identity;const n={},o=[...e];for(;o.length;){const{innerBlocks:e,...r}=o.shift();o.push(...e),n[r.clientId]=t(r)}return n}function C(e){return E(e,(e=>(0,u.omit)(e,"attributes")))}function w(e){return E(e,(e=>e.attributes))}function S(e,t){return"UPDATE_BLOCK_ATTRIBUTES"===e.type&&void 0!==t&&"UPDATE_BLOCK_ATTRIBUTES"===t.type&&(0,u.isEqual)(e.clientIds,t.clientIds)&&function(e,t){return(0,u.isEqual)((0,u.keys)(e),(0,u.keys)(t))}(e.attributes,t.attributes)}function B(e,t){const n={},o=[...t],r=[...t];for(;o.length;){const e=o.shift();o.push(...e.innerBlocks),r.push(...e.innerBlocks)}for(const e of r)n[e.clientId]={};for(const t of r)n[t.clientId]=Object.assign(n[t.clientId],{...e.byClientId[t.clientId],attributes:e.attributes[t.clientId],innerBlocks:t.innerBlocks.map((e=>n[e.clientId]))});return n}function I(e,t,n){let o=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const r=new Set([]),l=new Set;for(const t of n){let n=o?t:e.parents[t];do{if(e.controlledInnerBlocks[n]){l.add(n);break}r.add(n),n=e.parents[n]}while(void 0!==n)}for(const e of r)t[e]={...t[e]};for(const n of r)t[n].innerBlocks=(e.order[n]||[]).map((e=>t[e]));for(const n of l)t["controlled||"+n]={innerBlocks:(e.order[n]||[]).map((e=>t[e]))};return t}const x=(0,u.flow)(m.combineReducers,(e=>(t,n)=>{if(t&&"SAVE_REUSABLE_BLOCK_SUCCESS"===n.type){const{id:e,updatedId:o}=n;if(e===o)return t;(t={...t}).attributes=(0,u.mapValues)(t.attributes,((n,r)=>{const{name:l}=t.byClientId[r];return"core/block"===l&&n.ref===e?{...n,ref:o}:n}))}return e(t,n)}),(e=>function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;const o=e(t,n);if(o===t)return t;switch(o.tree=t.tree?t.tree:{},n.type){case"RECEIVE_BLOCKS":case"INSERT_BLOCKS":{const e=B(o,n.blocks);o.tree=I(o,{...o.tree,...e},n.rootClientId?[n.rootClientId]:[""],!0);break}case"UPDATE_BLOCK":o.tree=I(o,{...o.tree,[n.clientId]:{...o.tree[n.clientId],...o.byClientId[n.clientId],attributes:o.attributes[n.clientId]}},[n.clientId],!1);break;case"UPDATE_BLOCK_ATTRIBUTES":{const e=n.clientIds.reduce(((e,t)=>(e[t]={...o.tree[t],attributes:o.attributes[t]},e)),{});o.tree=I(o,{...o.tree,...e},n.clientIds,!1);break}case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":{const e=B(o,n.blocks);o.tree=I(o,{...(0,u.omit)(o.tree,n.replacedClientIds.concat(n.replacedClientIds.filter((t=>!e[t])).map((e=>"controlled||"+e)))),...e},n.blocks.map((e=>e.clientId)),!1);const r=[];for(const e of n.clientIds)void 0===t.parents[e]||""!==t.parents[e]&&!o.byClientId[t.parents[e]]||r.push(t.parents[e]);o.tree=I(o,o.tree,r,!0);break}case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":const e=[];for(const r of n.clientIds)void 0===t.parents[r]||""!==t.parents[r]&&!o.byClientId[t.parents[r]]||e.push(t.parents[r]);o.tree=I(o,(0,u.omit)(o.tree,n.removedClientIds.concat(n.removedClientIds.map((e=>"controlled||"+e)))),e,!0);break;case"MOVE_BLOCKS_TO_POSITION":{const e=[];n.fromRootClientId&&e.push(n.fromRootClientId),n.toRootClientId&&e.push(n.toRootClientId),n.fromRootClientId&&n.fromRootClientId||e.push(""),o.tree=I(o,o.tree,e,!0);break}case"MOVE_BLOCKS_UP":case"MOVE_BLOCKS_DOWN":{const e=[n.rootClientId?n.rootClientId:""];o.tree=I(o,o.tree,e,!0);break}case"SAVE_REUSABLE_BLOCK_SUCCESS":{const e=(0,u.keys)((0,u.omitBy)(o.attributes,((e,t)=>"core/block"!==o.byClientId[t].name||e.ref!==n.updatedId)));o.tree=I(o,{...o.tree,...e.reduce(((e,t)=>(e[t]={...o.byClientId[t],attributes:o.attributes[t],innerBlocks:o.tree[t].innerBlocks},e)),{})},e,!1)}}return o}),(e=>(t,n)=>{const o=e=>{let o=e;for(let r=0;r(t,n)=>{if("REPLACE_INNER_BLOCKS"!==n.type)return e(t,n);const o={};if(Object.keys(t.controlledInnerBlocks).length){const e=[...n.blocks];for(;e.length;){const{innerBlocks:n,...r}=e.shift();e.push(...n),t.controlledInnerBlocks[r.clientId]&&(o[r.clientId]=!0)}}let r=t;t.order[n.rootClientId]&&(r=e(r,{type:"REMOVE_BLOCKS",keepControlledInnerBlocks:o,clientIds:t.order[n.rootClientId]}));let l=r;return n.blocks.length&&(l=e(l,{...n,type:"INSERT_BLOCKS",index:0}),l.order={...l.order,...(0,u.reduce)(o,((e,n,o)=>(t.order[o]&&(e[o]=t.order[o]),e)),{})}),l}),(e=>(t,n)=>{if("RESET_BLOCKS"===n.type){const e={...t,byClientId:C(n.blocks),attributes:w(n.blocks),order:_(n.blocks),parents:y(n.blocks),controlledInnerBlocks:{}},o=B(e,n.blocks);return e.tree={...o,"":{innerBlocks:n.blocks.map((e=>o[e.clientId]))}},e}return e(t,n)}),(function(e){let t,n=!1;return(o,r)=>{let l=e(o,r);const i="MARK_LAST_CHANGE_AS_PERSISTENT"===r.type||n;if(o===l&&!i){var 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:!S(r,t)},t=r,n="MARK_NEXT_CHANGE_AS_NOT_PERSISTENT"===r.type,l}}),(function(e){const t=new Set(["RECEIVE_BLOCKS"]);return(n,o)=>{const r=e(n,o);return r!==n&&(r.isIgnoredChange=t.has(o.type)),r}}),(e=>(t,n)=>{if("SET_HAS_CONTROLLED_INNER_BLOCKS"===n.type){const o=e(t,{type:"REPLACE_INNER_BLOCKS",rootClientId:n.clientId,blocks:[]});return e(o,n)}return e(t,n)}))({byClientId(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"RECEIVE_BLOCKS":case"INSERT_BLOCKS":return{...e,...C(t.blocks)};case"UPDATE_BLOCK":if(!e[t.clientId])return e;const n=(0,u.omit)(t.updates,"attributes");return(0,u.isEmpty)(n)?e:{...e,[t.clientId]:{...e[t.clientId],...n}};case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":return t.blocks?{...(0,u.omit)(e,t.replacedClientIds),...C(t.blocks)}:e;case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":return(0,u.omit)(e,t.removedClientIds)}return e},attributes(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"RECEIVE_BLOCKS":case"INSERT_BLOCKS":return{...e,...w(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),...w(t.blocks)}:e;case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":return(0,u.omit)(e,t.removedClientIds)}return e},order(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"RECEIVE_BLOCKS":{const n=_(t.blocks);return{...e,...(0,u.omit)(n,""),"":((null==e?void 0:e[""])||[]).concat(n[""])}}case"INSERT_BLOCKS":{const{rootClientId:n=""}=t,o=e[n]||[],r=_(t.blocks,n),{index:l=o.length}=t;return{...e,...r,[n]:b(o,r[n],l)}}case"MOVE_BLOCKS_TO_POSITION":{const{fromRootClientId:n="",toRootClientId:o="",clientIds:r}=t,{index:l=e[o].length}=t;if(n===o){const t=e[o].indexOf(r[0]);return{...e,[o]:k(e[o],t,l,r.length)}}return{...e,[n]:(0,u.without)(e[n],...r),[o]:b(e[o],r,l)}}case"MOVE_BLOCKS_UP":{const{clientIds:n,rootClientId:o=""}=t,r=(0,u.first)(n),l=e[o];if(!l.length||r===(0,u.first)(l))return e;const i=l.indexOf(r);return{...e,[o]:k(l,i,i-1,n.length)}}case"MOVE_BLOCKS_DOWN":{const{clientIds:n,rootClientId:o=""}=t,r=(0,u.first)(n),l=(0,u.last)(n),i=e[o];if(!i.length||l===(0,u.last)(i))return e;const a=i.indexOf(r);return{...e,[o]:k(i,a,a+1,n.length)}}case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":{const{clientIds:n}=t;if(!t.blocks)return e;const o=_(t.blocks);return(0,u.flow)([e=>(0,u.omit)(e,t.replacedClientIds),e=>({...e,...(0,u.omit)(o,"")}),e=>(0,u.mapValues)(e,(e=>(0,u.reduce)(e,((e,t)=>t===n[0]?[...e,...o[""]]:(-1===n.indexOf(t)&&e.push(t),e)),[])))])(e)}case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":return(0,u.flow)([e=>(0,u.omit)(e,t.removedClientIds),e=>(0,u.mapValues)(e,(e=>(0,u.without)(e,...t.removedClientIds)))])(e)}return e},parents(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"RECEIVE_BLOCKS":return{...e,...y(t.blocks)};case"INSERT_BLOCKS":return{...e,...y(t.blocks,t.rootClientId||"")};case"MOVE_BLOCKS_TO_POSITION":return{...e,...t.clientIds.reduce(((e,n)=>(e[n]=t.toRootClientId||"",e)),{})};case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":return{...(0,u.omit)(e,t.replacedClientIds),...y(t.blocks,e[t.clientIds[0]])};case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":return(0,u.omit)(e,t.removedClientIds)}return e},controlledInnerBlocks(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{type:t,clientId:n,hasControlledInnerBlocks:o}=arguments.length>1?arguments[1]:void 0;return"SET_HAS_CONTROLLED_INNER_BLOCKS"===t?{...e,[n]:o}:e}});function T(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"CLEAR_SELECTED_BLOCK":return e.clientId?{}:e;case"SELECT_BLOCK":return t.clientId===e.clientId?e:{clientId:t.clientId};case"REPLACE_INNER_BLOCKS":case"INSERT_BLOCKS":return t.updateSelection&&t.blocks.length?{clientId:t.blocks[0].clientId}:e;case"REMOVE_BLOCKS":return t.clientIds&&t.clientIds.length&&-1!==t.clientIds.indexOf(e.clientId)?{}:e;case"REPLACE_BLOCKS":{if(-1===t.clientIds.indexOf(e.clientId))return e;const n=t.blocks[t.indexToSelect]||t.blocks[t.blocks.length-1];return n?n.clientId===e.clientId?e:{clientId:n.clientId}:{}}}return e}var N,P,M=(0,m.combineReducers)({blocks:x,isTyping:function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"START_TYPING":return!0;case"STOP_TYPING":return!1}return e},draggedBlocks:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"START_DRAGGING_BLOCKS":return t.clientIds;case"STOP_DRAGGING_BLOCKS":return[]}return e},isCaretWithinFormattedText:function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"ENTER_FORMATTED_TEXT":return!0;case"EXIT_FORMATTED_TEXT":return!1}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:T(r.selectionStart,l),selectionEnd:T(r.selectionEnd,l)}},isMultiSelecting:function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"START_MULTI_SELECT":return!0;case"STOP_MULTI_SELECT":return!1}return e},isSelectionEnabled:function(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=arguments.length>1?arguments[1]:void 0;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,m.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},isNavigationMode:function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0;return"INSERT_BLOCKS"!==t.type&&("SET_NAVIGATION_MODE"===t.type?t.isNavigationMode:e)},hasBlockMovingClientId:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1?arguments[1]:void 0;return"SET_BLOCK_MOVING_MODE"===t.type?t.hasBlockMovingClientId:"SET_NAVIGATION_MODE"===t.type?null:e},automaticChangeStatus:function(e,t){switch(t.type){case"MARK_AUTOMATIC_CHANGE":return"pending";case"MARK_AUTOMATIC_CHANGE_FINAL":return"pending"===e?"final":void 0;case"SELECTION_CHANGE":return"final"!==e?e:void 0;case"START_TYPING":case"STOP_TYPING":return e}},highlightedBlock:function(e,t){switch(t.type){case"TOGGLE_BLOCK_HIGHLIGHT":const{clientId:n,isHighlighted:o}=t;return o?n:e===n?null:e;case"SELECT_BLOCK":if(t.clientId!==e)return null}return e},lastBlockInserted:function(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;switch(n.type){case"INSERT_BLOCKS":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}});function R(e){return[e]}function L(){var e={clear:function(){e.head=null}};return e}function A(e,t,n){var o;if(e.length!==t.length)return!1;for(o=n;o{const n=e.blocks.byClientId[t];return n?{...n,attributes:W(e,t)}:null}),((e,t)=>[e.blocks.byClientId[t],e.blocks.attributes[t]]));function K(e,t){var n;const o=t&&At(e,t)?"controlled||"+t:t||"";return(null===(n=e.blocks.tree[o])||void 0===n?void 0:n.innerBlocks)||H}const q=D(((e,t)=>({clientId:t,innerBlocks:Y(e,t)})),(e=>[e.blocks.order])),Y=D((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return(0,u.map)(Re(e,t),(t=>q(e,t)))}),(e=>[e.blocks.order])),Q=D(((e,t)=>{const n=[];for(const o of t)for(const t of Re(e,o))n.push(t,...Q(e,[t]));return n}),(e=>[e.blocks.order])),X=D((e=>{const t=[];for(const n of Re(e))t.push(n,...Q(e,[n]));return t}),(e=>[e.blocks.order])),Z=D(((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])),J=D(((e,t)=>{if(!t)return H;const n=X(e).filter((n=>e.blocks.byClientId[n].name===t));return n.length>0?n:H}),(e=>[e.blocks.order,e.blocks.byClientId])),ee=D(((e,t)=>(0,u.map)((0,u.castArray)(t),(t=>$(e,t)))),((e,t)=>(0,u.map)((0,u.castArray)(t),(t=>e.blocks.tree[t]))));function te(e,t){return Re(e,t).length}function ne(e){return e.selection.selectionStart}function oe(e){return e.selection.selectionEnd}function re(e){return e.selection.selectionStart.clientId}function le(e){return e.selection.selectionEnd.clientId}function ie(e){const t=_e(e).length;return t||(e.selection.selectionStart.clientId?1:0)}function ae(e){const{selectionStart:t,selectionEnd:n}=e.selection;return!!t.clientId&&t.clientId===n.clientId}function se(e){const{selectionStart:t,selectionEnd:n}=e.selection,{clientId:o}=t;return o&&o===n.clientId?o:null}function ce(e){const t=se(e);return t?$(e,t):null}function ue(e,t){return void 0!==e.blocks.parents[t]?e.blocks.parents[t]:null}const de=D((function(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const o=[];let r=t;for(;e.blocks.parents[r];)r=e.blocks.parents[r],o.push(r);return n?o:o.reverse()}),(e=>[e.blocks.parents])),pe=D((function(e,t,n){let o=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const r=de(e,t,o);return(0,u.map)((0,u.filter)((0,u.map)(r,(t=>({id:t,name:G(e,t)}))),(e=>{let{name:t}=e;return Array.isArray(n)?n.includes(t):t===n})),(e=>{let{id:t}=e;return t}))}),(e=>[e.blocks.parents]));function me(e,t){let n,o=t;do{n=o,o=e.blocks.parents[o]}while(o);return n}function fe(e,t){const n=se(e),o=[...de(e,t),t],r=[...de(e,n),n];let l;const i=Math.min(o.length,r.length);for(let e=0;e2&&void 0!==arguments[2]?arguments[2]:1;if(void 0===t&&(t=se(e)),void 0===t&&(t=n<0?Ee(e):Ce(e)),!t)return null;const o=ue(e,t);if(null===o)return null;const{order:r}=e.blocks,l=r[o],i=l.indexOf(t),a=i+1*n;return a<0||a===l.length?null:l[a]}function he(e,t){return ge(e,t,-1)}function ve(e,t){return ge(e,t,1)}function be(e){return e.initialPosition}const ke=D((e=>{const{selectionStart:t,selectionEnd:n}=e.selection;if(void 0===t.clientId||void 0===n.clientId)return H;if(t.clientId===n.clientId)return[t.clientId];const o=ue(e,t.clientId);if(null===o)return H;const r=Re(e,o),l=r.indexOf(t.clientId),i=r.indexOf(n.clientId);return l>i?r.slice(i,l+1):r.slice(l,i+1)}),(e=>[e.blocks.order,e.selection.selectionStart.clientId,e.selection.selectionEnd.clientId]));function _e(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId===n.clientId?H:ke(e)}const ye=D((e=>{const t=_e(e);return t.length?t.map((t=>$(e,t))):H}),(e=>[...ke.getDependants(e),e.blocks.byClientId,e.blocks.order,e.blocks.attributes]));function Ee(e){return(0,u.first)(_e(e))||null}function Ce(e){return(0,u.last)(_e(e))||null}function we(e,t){return Ee(e)===t}function Se(e,t){return-1!==_e(e).indexOf(t)}const Be=D(((e,t)=>{let n=t,o=!1;for(;n&&!o;)n=ue(e,n),o=Se(e,n);return o}),(e=>[e.blocks.order,e.selection.selectionStart.clientId,e.selection.selectionEnd.clientId]));function Ie(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId===n.clientId?null:t.clientId||null}function xe(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId===n.clientId?null:n.clientId||null}function Te(e){const t=ne(e),n=oe(e);return!t.attributeKey&&!n.attributeKey&&void 0===t.offset&&void 0===n.offset}function Ne(e){const t=ne(e),n=oe(e);return!!t&&!!n&&t.clientId===n.clientId&&t.attributeKey===n.attributeKey&&t.offset===n.offset}function Pe(e,t){const n=ne(e),o=oe(e);if(n.clientId===o.clientId)return!1;if(!n.attributeKey||!o.attributeKey||void 0===n.offset||void 0===o.offset)return!1;const l=ue(e,n.clientId);if(l!==ue(e,o.clientId))return!1;const i=Re(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=$(e,c);if(!(0,r.getBlockType)(d.name).merge)return!1;const p=$(e,u);if(p.name===d.name)return!0;const m=(0,r.switchToBlockType)(p,d.name);return m&&m.length}const Me=e=>{const t=ne(e),n=oe(e);if(t.clientId===n.clientId)return H;if(!t.attributeKey||!n.attributeKey||void 0===t.offset||void 0===n.offset)return H;const o=ue(e,t.clientId);if(o!==ue(e,n.clientId))return H;const l=Re(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,...V(h)}),k=(0,z.create)({html:g,...V(v)});return b=(0,z.remove)(b,0,s.offset),k=(0,z.remove)(k,c.offset,k.text.length),[{...u,attributes:{...u.attributes,[s.attributeKey]:(0,z.toHTMLString)({value:b,...V(h)})}},{...p,attributes:{...p.attributes,[c.attributeKey]:(0,z.toHTMLString)({value:k,...V(v)})}}]};function Re(e,t){return e.blocks.order[t||""]||H}function Le(e,t){return Re(e,ue(e,t)).indexOf(t)}function Ae(e,t){const{selectionStart:n,selectionEnd:o}=e.selection;return n.clientId===o.clientId&&n.clientId===t}function De(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return(0,u.some)(Re(e,t),(t=>Ae(e,t)||Se(e,t)||n&&De(e,t,n)))}function Oe(e,t){if(!t)return!1;const n=_e(e),o=n.indexOf(t);return o>-1&&o$e(e,t)))}function Ke(e){return e.isCaretWithinFormattedText}function qe(e){let t,n;const{insertionPoint:o,selection:{selectionEnd:r}}=e;if(null!==o)return o;const{clientId:l}=r;return l?(t=ue(e,l)||void 0,n=Le(e,r.clientId)+1):n=Re(e).length,{rootClientId:t,index:n}}function Ye(e){return null!==e.insertionPoint}function Qe(e){return e.template.isValid}function Xe(e){return e.settings.template}function Ze(e,t){if(!t)return e.settings.templateLock;const n=Ct(e,t);return n?n.templateLock:null}const Je=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return(0,u.isBoolean)(e)?e:(0,u.isArray)(e)?!(!e.includes("core/post-content")||null!==t)||e.includes(t):n},et=function(e,t){let n,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(t&&"object"==typeof t?(n=t,t=n.name):n=(0,r.getBlockType)(t),!n)return!1;const{allowedBlockTypes:i}=wt(e),a=Je(i,t,!0);if(!a)return!1;const s=!!Ze(e,o);if(s)return!1;const c=Ct(e,o);if(o&&void 0===c)return!1;const d=null==c?void 0:c.allowedBlocks,p=Je(d,t),m=n.parent,f=G(e,o),g=Je(m,f);let h=!0;const v=n.ancestor;if(v){const t=[o,...de(e,o)];h=(0,u.some)(t,(t=>Je(v,G(e,t))))}const b=h&&(null===p&&null===g||!0===p||!0===g);return b?(0,l.applyFilters)("blockEditor.__unstableCanInsertBlockType",b,n,o,{getBlock:$.bind(null,e),getBlockParentsByBlockName:pe.bind(null,e)}):b},tt=D(et,((e,t,n)=>[e.blockListSettings[n],e.blocks.byClientId[n],e.settings.allowedBlockTypes,e.settings.templateLock]));function nt(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return t.every((t=>tt(e,G(e,t),n)))}function ot(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const o=W(e,t);if(null===o)return!0;const{lock:r}=o,l=!!Ze(e,n);return void 0===r||void 0===(null==r?void 0:r.remove)?!l:!(null!=r&&r.remove)}function rt(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return t.every((t=>ot(e,t,n)))}function lt(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const o=W(e,t);if(null===o)return;const{lock:r}=o,l="all"===Ze(e,n);return void 0===r||void 0===(null==r?void 0:r.move)?!l:!(null!=r&&r.move)}function it(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return t.every((t=>lt(e,t,n)))}function at(e,t){var n;return!!(0,r.hasBlockSupport)(t,"lock",!0)&&!(null===(n=e.settings)||void 0===n||!n.canLockBlocks)}function st(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 ct=(e,t,n)=>!!(0,r.hasBlockSupport)(t,"inserter",!0)&&et(e,t.name,n),ut=(e,t)=>n=>{const o=`${t.id}/${n.name}`,{time:r,count:l=0}=st(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:dt(r,l)}},dt=(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}},pt=(e,t)=>{let{buildScope:n="inserter"}=t;return t=>{const o=t.name;let l=!1;(0,r.hasBlockSupport)(t.name,"multiple",!0)||(l=(0,u.some)(ee(e,X(e)),{name:t.name}));const{time:i,count:a=0}=st(e,o)||{},s={id:o,name:t.name,title:t.title,icon:t.icon,isDisabled:l,frecency:dt(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}}},mt=D((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const n=pt(e,{buildScope:"inserter"}),o=/^\s*)[^])*)\5|[^]*?)}\s+)?(\/)?-->/,l=t=>{let n=F;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}=st(e,l)||{},c=dt(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=>ct(e,n,t))).map(n),s=et(e,"core/block",t)?Nt(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=ut(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,Nt(e),(0,r.getBlockTypes)()])),ft=D((function(e,t){var n;let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const[l]=t,i=pt(e,{buildScope:"transform"}),a=(0,r.getBlockTypes)().filter((t=>ct(e,t,o))).map(i),s=(0,u.mapKeys)(a,(e=>{let{name:t}=e;return t}));s["*"]={frecency:1/0,id:"*",isDisabled:!1,name:"*",title:(0,g.__)("Unwrap"),icon:null===(n=s[l.name])||void 0===n?void 0:n.icon};const c=(0,r.getPossibleBlockTransformations)(t).reduce(((e,t)=>("*"===t?e.push(s["*"]):s[null==t?void 0:t.name]&&e.push(s[t.name]),e)),[]);return(0,u.orderBy)(c,(e=>s[e.name].frecency),"desc")}),((e,t)=>[e.blockListSettings[t],e.blocks.byClientId,e.preferences.insertUsage,e.settings.allowedBlockTypes,e.settings.templateLock,(0,r.getBlockTypes)()])),gt=D((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const n=(0,u.some)((0,r.getBlockTypes)(),(n=>ct(e,n,t)));if(n)return!0;const o=et(e,"core/block",t)&&Nt(e).length>0;return o}),((e,t)=>[e.blockListSettings[t],e.blocks.byClientId,e.settings.allowedBlockTypes,e.settings.templateLock,Nt(e),(0,r.getBlockTypes)()])),ht=D((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(t)return(0,u.filter)((0,r.getBlockTypes)(),(n=>ct(e,n,t)))}),((e,t)=>[e.blockListSettings[t],e.blocks.byClientId,e.settings.allowedBlockTypes,e.settings.templateLock,(0,r.getBlockTypes)()])),vt=D((function(e){var t,n;let o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(!o)return;const r=null===(t=e.blockListSettings[o])||void 0===t?void 0:t.__experimentalDefaultBlock,l=null===(n=e.blockListSettings[o])||void 0===n?void 0:n.__experimentalDirectInsert;return r&&l?"function"==typeof l?l($(e,o))?r:null:r:void 0}),((e,t)=>[e.blockListSettings[t],e.blocks.tree[t]])),bt=D(((e,t)=>{const n=e.settings.__experimentalBlockPatterns.find((e=>{let{name:n}=e;return n===t}));return n?{...n,blocks:(0,r.parse)(n.content,{__unstableSkipMigrationLogs:!0})}:null}),(e=>[e.settings.__experimentalBlockPatterns])),kt=D((e=>{const t=e.settings.__experimentalBlockPatterns,{allowedBlockTypes:n}=wt(e),o=t.filter((e=>{let{inserter:t=!0}=e;return!!t})).map((t=>{let{name:n}=t;return bt(e,n)})),r=o.filter((e=>{let{blocks:t}=e;return((e,t)=>{if((0,u.isBoolean)(t))return t;const n=[...e];for(;n.length>0;){var o;const e=n.shift();if(!Je(t,e.name||e.blockName,!0))return!1;null===(o=e.innerBlocks)||void 0===o||o.forEach((e=>{n.push(e)}))}return!0})(t,n)}));return r}),(e=>[e.settings.__experimentalBlockPatterns,e.settings.allowedBlockTypes])),_t=D((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const n=kt(e),o=(0,u.filter)(n,(n=>{let{blocks:o}=n;return o.every((n=>{let{name:o}=n;return tt(e,o,t)}))}));return o}),((e,t)=>[e.settings.__experimentalBlockPatterns,e.settings.allowedBlockTypes,e.settings.templateLock,e.blockListSettings[t],e.blocks.byClientId[t]])),yt=D((function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!t)return H;const o=_t(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)=>[..._t.getDependants(e,t)])),Et=D((function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!t)return H;if(t.some((t=>{let{clientId:n,innerBlocks:o}=t;return o.length||At(e,n)})))return H;const o=Array.from(new Set(t.map((e=>{let{name:t}=e;return t}))));return yt(e,o,n)}),((e,t)=>[...yt.getDependants(e,t)]));function Ct(e,t){return e.blockListSettings[t]}function wt(e){return e.settings}function St(e){return e.blocks.isPersistentChange}const Bt=D((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return t.reduce(((t,n)=>e.blockListSettings[n]?{...t,[n]:e.blockListSettings[n]}:t),{})}),(e=>[e.blockListSettings])),It=D(((e,t)=>{var n;const o=(0,u.find)(Nt(e),(e=>e.id===t));return o?null===(n=o.title)||void 0===n?void 0:n.raw:null}),(e=>[Nt(e)]));function xt(e){return e.blocks.isIgnoredChange}function Tt(e){return e.lastBlockAttributesChange}function Nt(e){var t,n;return null!==(t=null==e||null===(n=e.settings)||void 0===n?void 0:n.__experimentalReusableBlocks)&&void 0!==t?t:H}function Pt(e){return e.isNavigationMode}function Mt(e){return e.hasBlockMovingClientId}function Rt(e){return!!e.automaticChangeStatus}function Lt(e,t){return e.highlightedBlock===t}function At(e,t){return!!e.blocks.controlledInnerBlocks[t]}const Dt=D(((e,t)=>{if(!t.length)return null;const n=se(e);if(t.includes(G(e,n)))return n;const o=_e(e),r=pe(e,n||o[0],t);return r?(0,u.last)(r):null}),((e,t)=>[e.selection.selectionStart.clientId,e.selection.selectionEnd.clientId,t]));function Ot(e,t,n){const{lastBlockInserted:o}=e;return o.clientId===t&&o.source===n}var Ft=window.wp.a11y,zt=window.wp.deprecated,Vt=n.n(zt);const Ht=e=>t=>{let{dispatch:n}=t;n({type:"RESET_BLOCKS",blocks:e}),n(Gt(e))},Gt=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 Ut(e,t,n){return{type:"RESET_SELECTION",selectionStart:e,selectionEnd:t,initialPosition:n}}function Wt(e){return Vt()('wp.data.dispatch( "core/block-editor" ).receiveBlocks',{since:"5.9",alternative:"resetBlocks or insertBlocks"}),{type:"RECEIVE_BLOCKS",blocks:e}}function $t(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return{type:"UPDATE_BLOCK_ATTRIBUTES",clientIds:(0,u.castArray)(e),attributes:t,uniqueByBlock:n}}function jt(e,t){return{type:"UPDATE_BLOCK",clientId:e,updates:t}}function Kt(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return{type:"SELECT_BLOCK",initialPosition:t,clientId:e}}const qt=e=>t=>{let{select:n,dispatch:o}=t;const r=n.getPreviousBlockClientId(e);r&&o.selectBlock(r,-1)},Yt=e=>t=>{let{select:n,dispatch:o}=t;const r=n.getNextBlockClientId(e);r&&o.selectBlock(r)};function Qt(){return{type:"START_MULTI_SELECT"}}function Xt(){return{type:"STOP_MULTI_SELECT"}}const Zt=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,Ft.speak)((0,g.sprintf)((0,g._n)("%s block selected.","%s blocks selected.",i),i),"assertive")}};function Jt(){return{type:"CLEAR_SELECTED_BLOCK"}}function en(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return{type:"TOGGLE_SELECTION",isSelectionEnabled:e}}function tn(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 nn=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=(0,u.castArray)(e),t=tn((0,u.castArray)(t),i.getSettings());const s=i.getBlockRootClientId((0,u.first)(e));for(let e=0;e{let{select:t,dispatch:n}=e;if(t.getBlockCount()>0)return;const{__unstableHasCustomAppender:o}=t.getSettings();o||n.insertDefaultBlock()}))}};function on(e,t){return nn(e,t)}const rn=e=>(t,n)=>o=>{let{select:r,dispatch:l}=o;r.canMoveBlocks(t,n)&&l({type:e,clientIds:(0,u.castArray)(t),rootClientId:n})},ln=rn("MOVE_BLOCKS_DOWN"),an=rn("MOVE_BLOCKS_UP"),sn=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 cn(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 sn([e],t,n,o)}function un(e,t,n,o,r){return dn([e],t,n,o,0,r)}const dn=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;(0,u.isObject)(r)&&(l=r,r=0,Vt()("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=tn((0,u.castArray)(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 pn(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 mn(){return{type:"HIDE_INSERTION_POINT"}}function fn(e){return{type:"SET_TEMPLATE_VALIDITY",isValid:e}}const gn=()=>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)},hn=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 d,p;c.indexOf(i.clientId)>c.indexOf(a.clientId)?(d=a,p=i):(d=i,p=a);const m=e?p:d,f=o.getBlock(m.clientId),g=(0,r.getBlockType)(f.name);if(!g.merge)return;const h=d,v=p,b=o.getBlock(h.clientId),k=(0,r.getBlockType)(b.name),_=o.getBlock(v.clientId),y=(0,r.getBlockType)(_.name),E=b.attributes[h.attributeKey],C=_.attributes[v.attributeKey],w=k.attributes[h.attributeKey],S=y.attributes[v.attributeKey];let B=(0,z.create)({html:E,...V(w)}),I=(0,z.create)({html:C,...V(S)});B=(0,z.remove)(B,h.offset,B.text.length),I=(0,z.insert)(I,"†",0,v.offset);const x=(0,r.cloneBlock)(b,{[h.attributeKey]:(0,z.toHTMLString)({value:B,...V(w)})}),T=(0,r.cloneBlock)(_,{[v.attributeKey]:(0,z.toHTMLString)({value:I,...V(S)})}),N=e?x:T,P=b.name===_.name?[N]:(0,r.switchToBlockType)(N,g.name);if(!P||!P.length)return;let M;if(e){const e=P.pop();M=g.merge(e.attributes,T.attributes)}else{const e=P.shift();M=g.merge(x.attributes,e.attributes)}const R=(0,u.findKey)(M,(e=>"string"==typeof e&&-1!==e.indexOf("†"))),L=M[R],A=(0,z.create)({html:L,...V(g.attributes[R])}),D=A.text.indexOf("†"),O=(0,z.remove)(A,D,D+1),F=(0,z.toHTMLString)({value:O,...V(g.attributes[R])});M[R]=F;const H=o.getSelectedBlockClientIds(),G=[...e?P:[],{...f,attributes:{...f.attributes,...M}},...e?[]:P];n.batch((()=>{l.selectionChange(f.clientId,R,D,D),l.replaceBlocks(H,G,0,o.getSelectedBlocksInitialCaretPosition())}))},vn=()=>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],k=g.attributes[d.attributeKey];let _=(0,z.create)({html:h,...V(b)}),y=(0,z.create)({html:v,...V(k)});_=(0,z.remove)(_,u.offset,_.text.length),y=(0,z.remove)(y,0,d.offset),n.replaceBlocks(t.getSelectedBlockClientIds(),[{...p,attributes:{...p.attributes,[u.attributeKey]:(0,z.toHTMLString)({value:_,...V(b)})}},(0,r.createBlock)((0,r.getDefaultBlockName)()),{...f,attributes:{...f.attributes,[d.attributeKey]:(0,z.toHTMLString)({value:y,...V(k)})}}],1,t.getSelectedBlocksInitialCaretPosition())},bn=()=>e=>{let{select:t,dispatch:n}=e;const o=t.getSelectionStart(),r=t.getSelectionEnd();n.selectionChange({start:{clientId:o.clientId},end:{clientId:r.clientId}})},kn=(e,t)=>n=>{let{select:o,dispatch:l}=n;const i=[e,t];l({type:"MERGE_BLOCKS",blocks:i});const[a,s]=i,c=o.getBlock(a),d=(0,r.getBlockType)(c.name);if(d&&!d.merge)return void l.selectBlock(c.clientId);const p=o.getBlock(s),m=(0,r.getBlockType)(p.name),{clientId:f,attributeKey:g,offset:h}=o.getSelectionStart(),v=(f===a?d:m).attributes[g],b=(f===a||f===s)&&void 0!==g&&void 0!==h&&!!v;v||("number"==typeof g?window.console.error("RichText needs an identifier prop that is the block attribute key of the attribute it controls. Its type is expected to be a string, but was "+typeof g):window.console.error("The RichText identifier prop does not match any attributes defined by the block."));const k=(0,r.cloneBlock)(c),_=(0,r.cloneBlock)(p);if(b){const e=f===a?k:_,t=e.attributes[g],n=(0,z.insert)((0,z.create)({html:t,...V(v)}),"†",h,h);e.attributes[g]=(0,z.toHTMLString)({value:n,...V(v)})}const y=c.name===p.name?[_]:(0,r.switchToBlockType)(_,c.name);if(!y||!y.length)return;const E=d.merge(k.attributes,y[0].attributes);if(b){const e=(0,u.findKey)(E,(e=>"string"==typeof e&&-1!==e.indexOf("†"))),t=E[e],n=(0,z.create)({html:t,...V(d.attributes[e])}),o=n.text.indexOf("†"),r=(0,z.remove)(n,o,o+1),i=(0,z.toHTMLString)({value:r,...V(d.attributes[e])});E[e]=i,l.selectionChange(c.clientId,e,o,o)}l.replaceBlocks([c.clientId,p.clientId],[{...c,attributes:{...c.attributes,...E}},...y.slice(1)],0)},_n=function(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return n=>{let{select:o,dispatch:r}=n;if(!e||!e.length)return;e=(0,u.castArray)(e);const l=o.getBlockRootClientId(e[0]);o.canRemoveBlocks(e,l)&&(t&&r.selectPreviousBlock(e[0]),r({type:"REMOVE_BLOCKS",clientIds:e}),r((e=>{let{select:t,dispatch:n}=e;if(t.getBlockCount()>0)return;const{__unstableHasCustomAppender:o}=t.getSettings();o||n.insertDefaultBlock()})))}};function yn(e,t){return _n([e],t)}function En(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 Cn(e){return{type:"TOGGLE_BLOCK_MODE",clientId:e}}function wn(){return{type:"START_TYPING"}}function Sn(){return{type:"STOP_TYPING"}}function Bn(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return{type:"START_DRAGGING_BLOCKS",clientIds:e}}function In(){return{type:"STOP_DRAGGING_BLOCKS"}}function xn(){return{type:"ENTER_FORMATTED_TEXT"}}function Tn(){return{type:"EXIT_FORMATTED_TEXT"}}function Nn(e,t,n,o){return"string"==typeof e?{type:"SELECTION_CHANGE",clientId:e,attributeKey:t,startOffset:n,endOffset:o}:{type:"SELECTION_CHANGE",...e}}const Pn=(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 Mn(e,t){return{type:"UPDATE_BLOCK_LIST_SETTINGS",clientId:e,settings:t}}function Rn(e){return{type:"UPDATE_SETTINGS",settings:e}}function Ln(e,t){return{type:"SAVE_REUSABLE_BLOCK_SUCCESS",id:e,updatedId:t}}function An(){return{type:"MARK_LAST_CHANGE_AS_PERSISTENT"}}function Dn(){return{type:"MARK_NEXT_CHANGE_AS_NOT_PERSISTENT"}}const On=()=>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"})}))},Fn=function(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return t=>{let{dispatch:n}=t;n({type:"SET_NAVIGATION_MODE",isNavigationMode:e}),e?(0,Ft.speak)((0,g.__)("You are currently in navigation mode. Navigate blocks using the Tab key and Arrow keys. Use Left and Right Arrow keys to move between nesting levels. To exit navigation mode and edit the selected block, press Enter.")):(0,Ft.speak)((0,g.__)("You are currently in edit mode. To return to the navigation mode, press Escape."))}},zn=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,Ft.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."))}},Vn=function(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return n=>{let{select:o,dispatch:l}=n;if(!e||!e.length)return;const i=o.getBlocksByClientId(e);if((0,u.some)(i,(e=>!e)))return;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=o.getBlockIndex((0,u.last)((0,u.castArray)(e))),d=i.map((e=>(0,r.__experimentalCloneSanitizedBlock)(e)));return l.insertBlocks(d,c+1,s,t),d.length>1&&t&&l.multiSelect((0,u.first)(d).clientId,(0,u.last)(d).clientId),d.map((e=>e.clientId))}},Hn=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)},Gn=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 Un(e,t){return{type:"TOGGLE_BLOCK_HIGHLIGHT",clientId:e,isHighlighted:t}}const Wn=e=>async t=>{let{dispatch:n}=t;n(Un(e,!0)),await new Promise((e=>setTimeout(e,150))),n(Un(e,!1))};function $n(e,t){return{type:"SET_HAS_CONTROLLED_INNER_BLOCKS",hasControlledInnerBlocks:t,clientId:e}}const jn="core/block-editor",Kn={reducer:M,selectors:e,actions:t},qn=(0,m.createReduxStore)(jn,{...Kn,persist:["preferences"]});(0,m.registerStore)(jn,{...Kn,persist:["preferences"]});const Yn={name:"",isSelected:!1},Qn=(0,a.createContext)(Yn),{Provider:Xn}=Qn;function Zn(){return(0,a.useContext)(Qn)}function Jn(){const{isSelected:e,clientId:t,name:n}=Zn();return(0,m.useSelect)((o=>{if(e)return!0;const{getBlockName:r,isFirstMultiSelectedBlock:l,getMultiSelectedBlockClientIds:i}=o(qn);return!!l(t)&&i().every((e=>r(e)===n))}),[t,e,n])}function eo(e){let{group:t="default",controls:n,children:o,__experimentalShareWithChildBlocks:l=!1}=e;const i=function(e,t){const n=Jn(),{clientId:o}=Zn(),l=(0,m.useSelect)((e=>{const{getBlockName:n,hasSelectedInnerBlock:l}=e(qn),{hasBlockSupport:i}=e(r.store);return t&&i(n(o),"__experimentalExposeControlsToChildren",!1)&&l(o)}),[t,o]);var i;return n?null===(i=f[e])||void 0===i?void 0:i.Fill:l?f.parent.Fill:null}(t,l);return i?(0,a.createElement)(p.__experimentalStyleProvider,{document:document},(0,a.createElement)(i,null,(e=>{const r=(0,u.isEmpty)(e)?null:e;return(0,a.createElement)(p.__experimentalToolbarContext.Provider,{value:r},"default"===t&&(0,a.createElement)(p.ToolbarGroup,{controls:n}),o)}))):null}function to(e){let{group:t="default",...n}=e;const o=(0,a.useContext)(p.__experimentalToolbarContext),r=f[t].Slot,l=(0,p.__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)(p.ToolbarGroup,null,(0,a.createElement)(r,i({},n,{bubblesVirtually:!0,fillProps:o}))):null}const no=eo;no.Slot=to;const oo=e=>(0,a.createElement)(eo,i({group:"inline"},e));oo.Slot=e=>(0,a.createElement)(to,i({group:"inline"},e));var ro=no;var lo=(0,a.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(O.Path,{d:"M5 15h14V9H5v6zm0 4.8h14v-1.5H5v1.5zM5 4.2v1.5h14V4.2H5z"}));var io=(0,a.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(O.Path,{d:"M4 9v6h14V9H4zm8-4.8H4v1.5h8V4.2zM4 19.8h8v-1.5H4v1.5z"}));var ao=(0,a.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(O.Path,{d:"M7 9v6h10V9H7zM5 19.8h14v-1.5H5v1.5zM5 4.3v1.5h14V4.3H5z"}));var so=(0,a.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(O.Path,{d:"M6 15h14V9H6v6zm6-10.8v1.5h8V4.2h-8zm0 15.6h8v-1.5h-8v1.5z"}));var co=(0,a.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(O.Path,{d:"M5 9v6h14V9H5zm11-4.8H8v1.5h8V4.2zM8 19.8h8v-1.5H8v1.5z"}));var uo=(0,a.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(O.Path,{d:"M5 4v11h14V4H5zm3 15.8h8v-1.5H8v1.5z"}));var po=(0,a.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(O.Path,{d:"M9 9v6h11V9H9zM4 20h1.5V4H4v16z"}));var mo=(0,a.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(O.Path,{d:"M20 9h-7.2V4h-1.6v5H4v6h7.2v5h1.6v-5H20z"}));var fo=(0,a.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(O.Path,{d:"M4 15h11V9H4v6zM18.5 4v16H20V4h-1.5z"}));var go=(0,a.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(O.Path,{d:"M9 15h6V9H9v6zm-5 5h1.5V4H4v16zM18.5 4v16H20V4h-1.5z"}));var ho=(0,a.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(O.Path,{d:"M14.3 6.7l-1.1 1.1 4 4H4v1.5h13.3l-4.1 4.4 1.1 1.1 5.8-6.3z"}));var vo=(0,a.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(O.Path,{d:"M16.2 13.2l-4 4V4h-1.5v13.3l-4.5-4.1-1 1.1 6.2 5.8 5.8-5.8-1-1.1z"}));function bo(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return e.split(",").map((e=>`.editor-styles-wrapper ${e} ${t}`)).join(",")}const ko=(0,a.createContext)({refs:new Map,callbacks:new Map});function _o(e){let{children:t}=e;const n=(0,a.useMemo)((()=>({refs:new Map,callbacks:new Map})),[]);return(0,a.createElement)(ko.Provider,{value:n},t)}function yo(e){const{refs:t,callbacks:n}=(0,a.useContext)(ko),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 Eo(e){const{refs:t}=(0,a.useContext)(ko),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 Co(e){const{callbacks:t}=(0,a.useContext)(ko),n=Eo(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}const wo=["color","border","typography","spacing"],So={"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},Bo={"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 Io(e){const{name:t}=Zn(),n=(0,m.useSelect)((n=>{var o;if(wo.includes(e))return void console.warn("Top level useSetting paths are disabled. Please use a subpath to query the information needed.");const l=n(qn).getSettings(),i=(e=>Bo[e]||e)(e),a=`__experimentalFeatures.${i}`,s=`__experimentalFeatures.blocks.${t}.${i}`,c=null!==(o=(0,u.get)(l,s))&&void 0!==o?o:(0,u.get)(l,a);var d,p;if(void 0!==c)return r.__EXPERIMENTAL_PATHS_WITH_MERGE[i]?null!==(d=null!==(p=c.custom)&&void 0!==p?p:c.theme)&&void 0!==d?d:c.default:c;const m=So[i]?So[i](l):void 0;return void 0!==m?m:"typography.dropCap"===i||void 0}),[t,e]);return n}window.wp.warning;var xo={default:(0,p.createSlotFill)("InspectorControls"),advanced:(0,p.createSlotFill)("InspectorAdvancedControls"),border:(0,p.createSlotFill)("InspectorControlsBorder"),color:(0,p.createSlotFill)("InspectorControlsColor"),dimensions:(0,p.createSlotFill)("InspectorControlsDimensions"),typography:(0,p.createSlotFill)("InspectorControlsTypography")};function To(e){var t;let{__experimentalGroup:n="default",children:o}=e;const r=Jn(),l=null===(t=xo[n])||void 0===t?void 0:t.Fill;return l?r?(0,a.createElement)(p.__experimentalStyleProvider,{document:document},(0,a.createElement)(l,null,(e=>{const t=(0,u.isEmpty)(e)?null:e;return(0,a.createElement)(p.__experimentalToolsPanelContext.Provider,{value:t},o)}))):null:("undefined"!=typeof process&&process.env,null)}const No=e=>{if(!(0,u.isObject)(e)||Array.isArray(e))return e;const t=(0,u.pickBy)((0,u.mapValues)(e,No),u.identity);return(0,u.isEmpty)(t)?void 0:t};function Po(e,t,n){return(0,u.setWith)(e?(0,u.clone)(e):{},t,n,u.clone)}function Mo(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(0,u.forEach)(e,((e,n)=>{e&&t[n].forEach((e=>{const t=(0,u.get)(a,e);t&&(c={...c,attributes:Po(c.attributes,e,t)})}))})),c}function Ro(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 Lo(e){let{children:t,group:n,label:o}=e;const{updateBlockAttributes:r}=(0,m.useDispatch)(qn),{getBlockAttributes:l,getMultiSelectedBlockClientIds:i,getSelectedBlockClientId:s,hasMultiSelection:c}=(0,m.useSelect)(qn),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:No(r.style)},t[n]=r})),r(n,t,!0)}),[No,l,i,c,u,r]);return(0,a.createElement)(p.__experimentalToolsPanel,{className:`${n}-block-support-panel`,label:o,resetAll:d,key:u,panelId:u,hasInnerWrapper:!0,shouldRenderPlaceholderItems:!0,__experimentalFirstVisibleItemClass:"first",__experimentalLastVisibleItemClass:"last"},t)}function Ao(e){let{Slot:t,...n}=e;const o=(0,a.useContext)(p.__experimentalToolsPanelContext);return(0,a.createElement)(t,i({},n,{fillProps:o,bubblesVirtually:!0}))}function Do(e){var t;let{__experimentalGroup:n="default",label:o,...r}=e;const l=null===(t=xo[n])||void 0===t?void 0:t.Slot,s=(0,p.__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)(Lo,{group:n,label:o},(0,a.createElement)(Ao,i({},r,{Slot:l}))):(0,a.createElement)(l,i({},r,{bubblesVirtually:!0})):null}const Oo=To;Oo.Slot=Do;const Fo=e=>(0,a.createElement)(To,i({},e,{__experimentalGroup:"advanced"}));Fo.Slot=e=>(0,a.createElement)(Do,i({},e,{__experimentalGroup:"advanced"})),Fo.slotName="InspectorAdvancedControls";var zo=Oo;function Vo(e){const t=(0,r.getBlockSupport)(e,jo);return!!(!0===t||null!=t&&t.margin)}function Ho(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!Io("spacing.margin"),n=!Zo(e,"margin");return!Vo(e)||t||n}function Go(e){var t;const{name:n,attributes:{style:o},setAttributes:r}=e,l=(0,p.__experimentalUseCustomUnits)({availableUnits:Io("spacing.units")||["%","px","em","rem","vw"]}),i=Xo(n,"margin"),s=i&&i.some((e=>qo.includes(e)));if(Ho(e))return null;return a.Platform.select({web:(0,a.createElement)(a.Fragment,null,(0,a.createElement)(p.__experimentalBoxControl,{values:null==o||null===(t=o.spacing)||void 0===t?void 0:t.margin,onChange:e=>{const t={...o,spacing:{...null==o?void 0:o.spacing,margin:e}};r({style:No(t)})},onChangeShowVisualizer:e=>{const t={...o,visualizers:{margin:e}};r({style:No(t)})},label:(0,g.__)("Margin"),sides:i,units:l,allowReset:!1,splitOnAxis:s})),native:null})}function Uo(e){const t=(0,r.getBlockSupport)(e,jo);return!!(!0===t||null!=t&&t.padding)}function Wo(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!Io("spacing.padding"),n=!Zo(e,"padding");return!Uo(e)||t||n}function $o(e){var t;const{name:n,attributes:{style:o},setAttributes:r}=e,l=(0,p.__experimentalUseCustomUnits)({availableUnits:Io("spacing.units")||["%","px","em","rem","vw"]}),i=Xo(n,"padding"),s=i&&i.some((e=>qo.includes(e)));if(Wo(e))return null;return a.Platform.select({web:(0,a.createElement)(a.Fragment,null,(0,a.createElement)(p.__experimentalBoxControl,{values:null==o||null===(t=o.spacing)||void 0===t?void 0:t.padding,onChange:e=>{const t={...o,spacing:{...null==o?void 0:o.spacing,padding:e}};r({style:No(t)})},onChangeShowVisualizer:e=>{const t={...o,visualizers:{padding:e}};r({style:No(t)})},label:(0,g.__)("Padding"),sides:i,units:l,allowReset:!1,splitOnAxis:s})),native:null})}const jo="spacing",Ko=["top","right","bottom","left"],qo=["vertical","horizontal"];function Yo(e){const t=tr(e),n=Wo(e),o=Ho(e),l=Qo(e),i=function(e){if("web"!==a.Platform.OS)return!1;return Jo(e)||Uo(e)||Vo(e)}(e.name);if(l||!i)return null;const s=(0,r.getBlockSupport)(e.name,[jo,"__experimentalDefaultControls"]),c=e=>t=>{var n;return{...t,style:{...t.style,spacing:{...null===(n=t.style)||void 0===n?void 0:n.spacing,[e]:void 0}}}};return(0,a.createElement)(zo,{__experimentalGroup:"dimensions"},!n&&(0,a.createElement)(p.__experimentalToolsPanelItem,{hasValue:()=>function(e){var t,n;return void 0!==(null===(t=e.attributes.style)||void 0===t||null===(n=t.spacing)||void 0===n?void 0:n.padding)}(e),label:(0,g.__)("Padding"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:No({...o,spacing:{...null==o?void 0:o.spacing,padding:void 0}})})}(e),resetAllFilter:c("padding"),isShownByDefault:null==s?void 0:s.padding,panelId:e.clientId},(0,a.createElement)($o,e)),!o&&(0,a.createElement)(p.__experimentalToolsPanelItem,{hasValue:()=>function(e){var t,n;return void 0!==(null===(t=e.attributes.style)||void 0===t||null===(n=t.spacing)||void 0===n?void 0:n.margin)}(e),label:(0,g.__)("Margin"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:No({...o,spacing:{...null==o?void 0:o.spacing,margin:void 0}})})}(e),resetAllFilter:c("margin"),isShownByDefault:null==s?void 0:s.margin,panelId:e.clientId},(0,a.createElement)(Go,e)),!t&&(0,a.createElement)(p.__experimentalToolsPanelItem,{hasValue:()=>function(e){var t,n;return void 0!==(null===(t=e.attributes.style)||void 0===t||null===(n=t.spacing)||void 0===n?void 0:n.blockGap)}(e),label:(0,g.__)("Block spacing"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:{...o,spacing:{...null==o?void 0:o.spacing,blockGap:void 0}}})}(e),resetAllFilter:c("blockGap"),isShownByDefault:null==s?void 0:s.blockGap,panelId:e.clientId},(0,a.createElement)(nr,e)))}const Qo=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=tr(e),n=Wo(e),o=Ho(e);return t&&n&&o};function Xo(e,t){var n;const o=(0,r.getBlockSupport)(e,jo);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 Zo(e,t){const n=Xo(e,t);return!(n&&n.some((e=>Ko.includes(e)))&&n.some((e=>qo.includes(e))))||(console.warn(`The ${t} support for the "${e}" block can not be configured to support both axial and arbitrary sides.`),!1)}function Jo(e){const t=(0,r.getBlockSupport)(e,jo);return!!(!0===t||null!=t&&t.blockGap)}function er(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 tr(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!Io("spacing.blockGap");return!Jo(e)||t}function nr(e){var t;const{clientId:n,attributes:{style:o},name:r,setAttributes:l}=e,i=(0,p.__experimentalUseCustomUnits)({availableUnits:Io("spacing.units")||["%","px","em","rem","vw"]}),s=Xo(r,"blockGap"),c=Eo(n);if(tr(e))return null;const u=s&&s.some((e=>qo.includes(e))),d=e=>{var t;let n=e;e&&u&&(n={...er(e)});const r={...o,spacing:{...null==o?void 0:o.spacing,blockGap:n}};l({style:No(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;c.current&&i&&(null===(a=c.current.parentNode)||void 0===a||a.replaceChild(c.current,c.current))},m=er(null==o||null===(t=o.spacing)||void 0===t?void 0:t.blockGap),f=u?{...m,right:null==m?void 0:m.left,bottom:null==m?void 0:m.top}:null==m?void 0:m.top;return a.Platform.select({web:(0,a.createElement)(a.Fragment,null,u?(0,a.createElement)(p.__experimentalBoxControl,{label:(0,g.__)("Block spacing"),min:0,onChange:d,units:i,sides:s,values:f,allowReset:!1,splitOnAxis:u}):(0,a.createElement)(p.__experimentalUnitControl,{label:(0,g.__)("Block spacing"),__unstableInputWidth:"80px",min:0,onChange:d,units:i,value:f})),native:null})}const or=(0,a.createElement)(p.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(p.Path,{d:"M15 4H9v11h6V4zM4 18.5V20h16v-1.5H4z"})),rr=(0,a.createElement)(p.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(p.Path,{d:"M20 11h-5V4H9v7H4v1.5h5V20h6v-7.5h5z"})),lr={top:{icon:(0,a.createElement)(p.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(p.Path,{d:"M9 20h6V9H9v11zM4 4v1.5h16V4H4z"})),title:(0,g._x)("Align top","Block vertical alignment setting")},center:{icon:rr,title:(0,g._x)("Align middle","Block vertical alignment setting")},bottom:{icon:or,title:(0,g._x)("Align bottom","Block vertical alignment setting")}},ir=["top","center","bottom"],ar={isAlternate:!0};var sr=function(e){let{value:t,onChange:n,controls:o=ir,isCollapsed:r=!0,isToolbar:l}=e;const s=lr[t],c=lr.top,u=l?p.ToolbarGroup:p.ToolbarDropdownMenu,d=l?{isCollapsed:r}:{};return(0,a.createElement)(u,i({popoverProps:ar,icon:s?s.icon:c.icon,label:(0,g._x)("Change vertical alignment","Block vertical alignment setting label"),controls:o.map((e=>{return{...lr[e],isActive:t===e,role:r?"menuitemradio":void 0,onClick:(o=e,()=>n(t===o?void 0:o))};var o}))},d))};const cr=e=>(0,a.createElement)(sr,i({},e,{isToolbar:!1})),ur=e=>(0,a.createElement)(sr,i({},e,{isToolbar:!0})),dr={left:po,center:mo,right:fo,"space-between":go};var pr=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?dr[r]:dr.left,d=[{name:"left",icon:po,title:(0,g.__)("Justify items left"),isActive:"left"===r,onClick:()=>c("left")},{name:"center",icon:mo,title:(0,g.__)("Justify items center"),isActive:"center"===r,onClick:()=>c("center")},{name:"right",icon:fo,title:(0,g.__)("Justify items right"),isActive:"right"===r,onClick:()=>c("right")},{name:"space-between",icon:go,title:(0,g.__)("Space between items"),isActive:"space-between"===r,onClick:()=>c("space-between")}],m=s?p.ToolbarGroup:p.ToolbarDropdownMenu,f=s?{isCollapsed:n}:{};return(0,a.createElement)(m,i({icon:u,popoverProps:l,label:(0,g.__)("Change items justification"),controls:d.filter((e=>t.includes(e.name)))},f))};const mr=e=>(0,a.createElement)(pr,i({},e,{isToolbar:!1})),fr=e=>(0,a.createElement)(pr,i({},e,{isToolbar:!0})),gr={left:"flex-start",right:"flex-end",center:"center","space-between":"space-between"},hr={left:"flex-start",right:"flex-end",center:"center"},vr={top:"flex-start",center:"center",bottom:"flex-end"},br=["wrap","nowrap"];var kr={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)(p.Flex,null,(0,a.createElement)(p.FlexItem,null,(0,a.createElement)(yr,{layout:t,onChange:n})),(0,a.createElement)(p.FlexItem,null,r&&(0,a.createElement)(Cr,{layout:t,onChange:n}))),(0,a.createElement)(Er,{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)(ro,{group:"block",__experimentalShareWithChildBlocks:!0},(0,a.createElement)(yr,{layout:t,onChange:n,isToolbar:!0}),r&&"vertical"!==(null==t?void 0:t.orientation)&&(0,a.createElement)(_r,{layout:t,onChange:n,isToolbar:!0}))},save:function(e){var t,n;let{selector:o,layout:l,style:i,blockName:s}=e;const{orientation:c="horizontal"}=l,u=Io("spacing.blockGap"),d=(0,r.getBlockSupport)(s,["spacing","blockGap","__experimentalDefault"])||"0.5em",p=null!==u,m=null!=i&&null!==(t=i.spacing)&&void 0!==t&&t.blockGap&&!Ro(s,"spacing","blockGap")?function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"0";const n=er(e);if(!n)return null;const o=(null==n?void 0:n.top)||t,r=(null==n?void 0:n.left)||t;return o===r?o:`${o} ${r}`}(null==i||null===(n=i.spacing)||void 0===n?void 0:n.blockGap,d):`var( --wp--style--block-gap, ${d} )`,f=gr[l.justifyContent]||gr.left,g=br.includes(l.flexWrap)?l.flexWrap:"wrap",h=`\n\t\tflex-direction: row;\n\t\talign-items: ${vr[l.verticalAlignment]||vr.center};\n\t\tjustify-content: ${f};\n\t\t`,v=`\n\t\tflex-direction: column;\n\t\talign-items: ${hr[l.justifyContent]||hr.left};\n\t\t`;return(0,a.createElement)("style",null,`\n\t\t\t\t${bo(o)} {\n\t\t\t\t\tdisplay: flex;\n\t\t\t\t\tflex-wrap: ${g};\n\t\t\t\t\tgap: ${p?m:d};\n\t\t\t\t\t${"horizontal"===c?h:v}\n\t\t\t\t}\n\n\t\t\t\t${bo(o,"> *")} {\n\t\t\t\t\tmargin: 0;\n\t\t\t\t}\n\t\t\t`)},getOrientation(e){const{orientation:t="horizontal"}=e;return t},getAlignments:()=>[]};function _r(e){let{layout:t,onChange:n,isToolbar:o=!1}=e;const{verticalAlignment:r=vr.center}=t,l=e=>{n({...t,verticalAlignment:e})};if(o)return(0,a.createElement)(cr,{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)(p.Button,{key:e,label:n,icon:t,isPressed:r===e,onClick:()=>l(e)})))))}function yr(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)(mr,{allowedControls:s,value:r,onChange:i,popoverProps:{position:"bottom right",isAlternate:!0}});const c=[{value:"left",icon:po,label:(0,g.__)("Justify items left")},{value:"center",icon:mo,label:(0,g.__)("Justify items center")},{value:"right",icon:fo,label:(0,g.__)("Justify items right")}];return"horizontal"===l&&c.push({value:"space-between",icon:go,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)(p.Button,{key:t,label:o,icon:n,isPressed:r===t,onClick:()=>i(t)})}))))}function Er(e){let{layout:t,onChange:n}=e;const{flexWrap:o="wrap"}=t;return(0,a.createElement)(p.ToggleControl,{label:(0,g.__)("Allow to wrap to multiple lines"),onChange:e=>{n({...t,flexWrap:e?"wrap":"nowrap"})},checked:"wrap"===o})}function Cr(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)(p.Button,{label:"horizontal",icon:ho,isPressed:"horizontal"===o,onClick:()=>n({...t,orientation:"horizontal"})}),(0,a.createElement)(p.Button,{label:"vertical",icon:vo,isPressed:"vertical"===o,onClick:()=>n({...t,orientation:"vertical"})}))}var wr=function(e){let{icon:t,size:n=24,...o}=e;return(0,a.cloneElement)(t,{width:n,height:n,...o})},Sr={name:"default",label:(0,g.__)("Flow"),inspectorControls:function(e){let{layout:t,onChange:n}=e;const{wideSize:o,contentSize:r}=t,l=(0,p.__experimentalUseCustomUnits)({availableUnits:Io("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)(p.__experimentalUnitControl,{label:(0,g.__)("Content"),labelPosition:"top",__unstableInputWidth:"80px",value:r||o||"",onChange:e=>{e=0>parseFloat(e)?"0":e,n({...t,contentSize:e})},units:l}),(0,a.createElement)(wr,{icon:ao})),(0,a.createElement)("div",{className:"block-editor-hooks__layout-controls-unit"},(0,a.createElement)(p.__experimentalUnitControl,{label:(0,g.__)("Wide"),labelPosition:"top",__unstableInputWidth:"80px",value:o||r||"",onChange:e=>{e=0>parseFloat(e)?"0":e,n({...t,wideSize:e})},units:l}),(0,a.createElement)(wr,{icon:co}))),(0,a.createElement)("div",{className:"block-editor-hooks__layout-controls-reset"},(0,a.createElement)(p.Button,{variant:"secondary",isSmall:!0,disabled:!r&&!o,onClick:()=>n({contentSize:void 0,wideSize:void 0,inherit:!1})},(0,g.__)("Reset"))),(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.")))},toolBarControls:function(){return null},save:function(e){var t;let{selector:n,layout:o={},style:r,blockName:l}=e;const{contentSize:i,wideSize:s}=o,c=null!==Io("spacing.blockGap"),u=er(null==r||null===(t=r.spacing)||void 0===t?void 0:t.blockGap),d=null!=u&&u.top&&!Ro(l,"spacing","blockGap")?null==u?void 0:u.top:"var( --wp--style--block-gap )";let p=i||s?`\n\t\t\t\t\t${bo(n,"> :where(:not(.alignleft):not(.alignright))")} {\n\t\t\t\t\t\tmax-width: ${null!=i?i:s};\n\t\t\t\t\t\tmargin-left: auto !important;\n\t\t\t\t\t\tmargin-right: auto !important;\n\t\t\t\t\t}\n\t\t\t\t\t${bo(n,"> .alignwide")} {\n\t\t\t\t\t\tmax-width: ${null!=s?s:i};\n\t\t\t\t\t}\n\t\t\t\t\t${bo(n,"> .alignfull")} {\n\t\t\t\t\t\tmax-width: none;\n\t\t\t\t\t}\n\t\t\t\t`:"";return p+=`\n\t\t\t${bo(n,"> .alignleft")} {\n\t\t\t\tfloat: left;\n\t\t\t\tmargin-inline-start: 0;\n\t\t\t\tmargin-inline-end: 2em;\n\t\t\t}\n\t\t\t${bo(n,"> .alignright")} {\n\t\t\t\tfloat: right;\n\t\t\t\tmargin-inline-start: 2em;\n\t\t\t\tmargin-inline-end: 0;\n\t\t\t}\n\n\t\t\t${bo(n,"> .aligncenter")} {\n\t\t\t\tmargin-left: auto !important;\n\t\t\t\tmargin-right: auto !important;\n\t\t\t}\n\t\t`,c&&(p+=`\n\t\t\t\t${bo(n,"> *")} {\n\t\t\t\t\tmargin-block-start: 0;\n\t\t\t\t\tmargin-block-end: 0;\n\t\t\t\t}\n\t\t\t\t${bo(n,"> * + *")} {\n\t\t\t\t\tmargin-block-start: ${d};\n\t\t\t\t}\n\t\t\t`),(0,a.createElement)("style",null,p)},getOrientation:()=>"vertical",getAlignments(e){const t=function(e){const{contentSize:t,wideSize:n}=e,o={},r=/^(?!0)\d+(px|em|rem|vw|vh|%)?$/i;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));return o}(e);if(void 0!==e.alignments)return e.alignments.includes("none")||e.alignments.unshift("none"),e.alignments.map((e=>({name:e,info:t[e]})));const{contentSize:n,wideSize:o}=e,r=[{name:"left"},{name:"center"},{name:"right"}];return n&&r.unshift({name:"full"}),o&&r.unshift({name:"wide",info:t.wide}),r.unshift({name:"none",info:t.none}),r}};const Br=[Sr,kr];function Ir(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default";return Br.find((t=>t.name===e))}const xr={type:"default"},Tr=(0,a.createContext)(xr),Nr=Tr.Provider;function Pr(){return(0,a.useContext)(Tr)}function Mr(e){let{layout:t={},...n}=e;const o=Ir(t.type);return o?(0,a.createElement)(o.save,i({layout:t},n)):null}const Rr=["none","left","center","right","wide","full"],Lr=["wide","full"];function Ar(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Rr;e.includes("none")||(e=["none",...e]);const{wideControlsEnabled:t=!1,themeSupportsLayout:n}=(0,m.useSelect)((e=>{const{getSettings:t}=e(qn),n=t();return{wideControlsEnabled:n.alignWide,themeSupportsLayout:n.supportsLayout}}),[]),o=Pr(),r=Ir(null==o?void 0:o.type),l=r.getAlignments(o);if(n){const t=l.filter((t=>{let{name:n}=t;return e.includes(n)}));return 1===t.length&&"none"===t[0].name?[]:t}if("default"!==r.name)return[];const{alignments:i=Rr}=o,a=e.filter((e=>(o.alignments||t||!Lr.includes(e))&&i.includes(e))).map((e=>({name:e})));return 1===a.length&&"none"===a[0].name?[]:a}const Dr={none:{icon:lo,title:(0,g._x)("None","Alignment option")},left:{icon:io,title:(0,g.__)("Align left")},center:{icon:ao,title:(0,g.__)("Align center")},right:{icon:so,title:(0,g.__)("Align right")},wide:{icon:co,title:(0,g.__)("Wide width")},full:{icon:uo,title:(0,g.__)("Full width")}},Or={isAlternate:!0};var Fr=function(e){let{value:t,onChange:n,controls:o,isToolbar:r,isCollapsed:l=!0}=e;const s=Ar(o);if(!!!s.length)return null;function u(e){n([t,"none"].includes(e)?void 0:e)}const d=Dr[t],m=Dr.none,f=r?p.ToolbarGroup:p.ToolbarDropdownMenu,h={popoverProps:Or,icon:d?d.icon:m.icon,label:(0,g.__)("Align"),toggleProps:{describedBy:(0,g.__)("Change alignment")}},v=r||a.Platform.isNative?{isCollapsed:r?l:void 0,controls:s.map((e=>{let{name:n}=e;return{...Dr[n],isActive:t===n||!t&&"none"===n,role:l?"menuitemradio":void 0,onClick:()=>u(n)}}))}:{children:e=>{let{onClose:n}=e;return(0,a.createElement)(a.Fragment,null,(0,a.createElement)(p.MenuGroup,{className:"block-editor-block-alignment-control__menu-group"},s.map((e=>{let{name:o,info:r}=e;const{icon:l,title:i}=Dr[o],s=o===t||!t&&"none"===o;return(0,a.createElement)(p.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 zr=e=>(0,a.createElement)(Fr,i({},e,{isToolbar:!1})),Vr=e=>(0,a.createElement)(Fr,i({},e,{isToolbar:!0})),Hr=["left","center","right","wide","full"],Gr=["wide","full"];function Ur(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)?Hr.filter((t=>e.includes(t))):!0===e?[...Hr]:[],!o||!0===e&&!n?(0,u.without)(t,...Gr):t}const Wr=(0,d.createHigherOrderComponent)((e=>t=>{const{name:n}=t,o=Ar(Ur((0,r.getBlockSupport)(n,"align"),(0,r.hasBlockSupport)(n,"alignWide",!0))).map((e=>{let{name:t}=e;return t}));return(0,a.createElement)(a.Fragment,null,!!o.length&&(0,a.createElement)(ro,{group:"block",__experimentalShareWithChildBlocks:!0},(0,a.createElement)(zr,{value:t.attributes.align,onChange:e=>{if(!e){var n,o;const l=(0,r.getBlockType)(t.name);(null==l||null===(n=l.attributes)||void 0===n||null===(o=n.align)||void 0===o?void 0:o.default)&&(e="")}t.setAttributes({align:e})},controls:o})),(0,a.createElement)(e,t))}),"withToolbarControls"),$r=(0,d.createHigherOrderComponent)((e=>t=>{const{name:n,attributes:o}=t,{align:l}=o,s=Ar(Ur((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){return(0,u.has)(e.attributes,["align","type"])||(0,r.hasBlockSupport)(e,"align")&&(e.attributes={...e.attributes,align:{type:"string",enum:[...Hr,""]}}),e})),(0,l.addFilter)("editor.BlockListBlock","core/editor/align/with-data-align",$r),(0,l.addFilter)("editor.BlockEdit","core/editor/align/with-toolbar-controls",Wr),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/align/addAssignedAlign",(function(e,t,n){const{align:o}=n;return Ur((0,r.getBlockSupport)(t,"align"),(0,r.hasBlockSupport)(t,"alignWide",!0)).includes(o)&&(e.className=c()(`align${o}`,e.className)),e})),(0,l.addFilter)("blocks.registerBlockType","core/lock/addAttribute",(function(e){return(0,u.has)(e.attributes,["lock","type"])||(e.attributes={...e.attributes,lock:{type:"object"}}),e}));const jr=/[\s#]/g,Kr={type:"string",source:"attribute",attribute:"id",selector:"*"};const qr=(0,d.createHigherOrderComponent)((e=>t=>{if((0,r.hasBlockSupport)(t.name,"anchor")&&t.isSelected){const n="web"===a.Platform.OS,o=(0,a.createElement)(p.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, you’ll be able to link directly to this section of your page."),n&&(0,a.createElement)(p.ExternalLink,{href:(0,g.__)("https://wordpress.org/support/article/page-jumps/")},(0,g.__)("Learn more about anchors"))),value:t.attributes.anchor||"",placeholder:n?null:(0,g.__)("Add an anchor"),onChange:e=>{e=e.replace(jr,"-"),t.setAttributes({anchor:e})},autoCapitalize:"none",autoComplete:"off"});return(0,a.createElement)(a.Fragment,null,(0,a.createElement)(e,t),n&&(0,a.createElement)(zo,{__experimentalGroup:"advanced"},o),!n&&"core/heading"===t.name&&(0,a.createElement)(zo,null,(0,a.createElement)(p.PanelBody,{title:(0,g.__)("Heading settings")},o)))}return(0,a.createElement)(e,t)}),"withInspectorControl");(0,l.addFilter)("blocks.registerBlockType","core/anchor/attribute",(function(e){return(0,u.has)(e.attributes,["anchor","type"])||(0,r.hasBlockSupport)(e,"anchor")&&(e.attributes={...e.attributes,anchor:Kr}),e})),(0,l.addFilter)("editor.BlockEdit","core/editor/anchor/with-inspector-control",qr),(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 Yr=(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)(zo,{__experimentalGroup:"advanced"},(0,a.createElement)(p.TextControl,{autoComplete:"off",label:(0,g.__)("Additional CSS class(es)"),value:t.attributes.className||"",onChange:e=>{t.setAttributes({className:""!==e?e:void 0})},help:(0,g.__)("Separate multiple classes with spaces.")}))):(0,a.createElement)(e,t)),"withInspectorControl");function Qr(e,t,n,o){const r=(0,u.get)(e,n);if(!r)return[];const l=[];if("string"==typeof r)l.push({selector:t.selector,key:o,value:r});else{const e=["top","right","bottom","left"].reduce(((e,n)=>{const l=(0,u.get)(r,[n]);return l&&e.push({selector:t.selector,key:`${o}${(0,u.upperFirst)(n)}`,value:l}),e}),[]);l.push(...e)}return l}(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",Yr),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/custom-class-name/save-props",(function(e,t,n){return(0,r.hasBlockSupport)(t,"customClassName",!0)&&n.className&&(e.className=c()(e.className,n.className)),e})),(0,l.addFilter)("blocks.switchToBlockType.transformedBlock","core/color/addTransforms",(function(e,t,n,o){if(!(0,r.hasBlockSupport)(e.name,"customClassName",!0))return e;if(1===o.length&&e.innerBlocks.length===t.length)return e;if(1===o.length&&t.length>1||o.length>1&&1===t.length)return e;if(t[n]){var l;const o=null===(l=t[n])||void 0===l?void 0:l.attributes.className;if(o)return{...e,attributes:{...e.attributes,className:o}}}return e})),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/generated-class-name/save-props",(function(e,t){return(0,r.hasBlockSupport)(t,"className",!0)&&("string"==typeof e.className?e.className=(0,u.uniq)([(0,r.getBlockDefaultClassName)(t.name),...e.className.split(" ")]).join(" ").trim():e.className=(0,r.getBlockDefaultClassName)(t.name)),e}));const Xr=[{name:"margin",generate:(e,t)=>Qr(e,t,["spacing","margin"],"margin")},{name:"padding",generate:(e,t)=>Qr(e,t,["spacing","padding"],"padding")}];function Zr(e,t){const n=[];return Xr.forEach((o=>{n.push(...o.generate(e,t))})),n}var Jr=window.wp.dom;const el=(0,a.createContext)({});function tl(e){let{value:t,children:n}=e;const o=(0,a.useContext)(el),r=(0,a.useMemo)((()=>({...o,...t})),[o,t]);return(0,a.createElement)(el.Provider,{value:r,children:n})}var nl=el;const ol={};var rl=(0,p.withFilters)("editor.BlockEdit")((e=>{const{attributes:t={},name:n}=e,o=(0,r.getBlockType)(n),l=(0,a.useContext)(nl),s=(0,a.useMemo)((()=>o&&o.usesContext?(0,u.pick)(l,o.usesContext):ol),[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);return(0,a.createElement)(d,i({},e,{context:s,className:m}))}));function ll(e){const{name:t,isSelected:n,clientId:o}=e,r={name:t,isSelected:n,clientId:o};return(0,a.createElement)(Xn,{value:(0,a.useMemo)((()=>r),Object.values(r))},(0,a.createElement)(rl,e))}var il=(0,a.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(O.Path,{d:"M11 13h2v-2h-2v2zm-6 0h2v-2H5v2zm12-2v2h2v-2h-2z"}));var al=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)(p.DropdownMenu,{className:"block-editor-warning__secondary",icon:il,label:(0,g.__)("More options"),popoverProps:{position:"bottom left",className:"block-editor-warning__dropdown"},noIcons:!0},(()=>(0,a.createElement)(p.MenuGroup,null,r.map(((e,t)=>(0,a.createElement)(p.MenuItem,{onClick:e.onClick,key:t},e.title))))))))))},sl=n(1973);function cl(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,Jr.safeHTML)(o)))),(0,a.createElement)("div",{className:"block-editor-block-compare__action"},(0,a.createElement)(p.Button,{variant:"secondary",tabIndex:"0",onClick:r},l)))}var ul=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,sl.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)(cl,{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)(cl,{title:(0,g.__)("After Conversion"),className:"block-editor-block-compare__converted",action:o,actionText:i,rawContent:p,renderedContent:s}))};const dl=e=>(0,r.rawHandler)({HTML:e.originalContent});var pl=(0,d.compose)([(0,m.withSelect)(((e,t)=>{let{clientId:n}=t;return{block:e(qn).getBlock(n)}})),(0,m.withDispatch)(((e,t)=>{let{block:n}=t;const{replaceBlock:o}=e(qn);return{convertToClassic(){o(n.clientId,(e=>(0,r.createBlock)("core/freeform",{content:e.originalContent}))(n))},convertToHTML(){o(n.clientId,(e=>(0,r.createBlock)("core/html",{content:e.originalContent}))(n))},convertToBlocks(){o(n.clientId,dl(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)),[]),m=(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)(al,{actions:[(0,a.createElement)(p.Button,{key:"recover",onClick:l,variant:"primary"},(0,g.__)("Attempt Block Recovery"))],secondaryActions:f},(0,g.__)("This block contains unexpected or invalid content.")),c&&(0,a.createElement)(p.Modal,{title:(0,g.__)("Resolve Block"),onRequestClose:m,className:"block-editor-block-compare"},(0,a.createElement)(ul,{block:i,onKeep:t,onConvert:n,convertor:dl,convertButtonText:(0,g.__)("Convert to Blocks")})))}));const ml=(0,a.createElement)(al,{className:"block-editor-block-list__block-crash-warning"},(0,g.__)("This block has encountered an error and cannot be previewed."));var fl=()=>ml;class gl 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 hl=gl,vl=n(773);var bl=function(e){let{clientId:t}=e;const[n,o]=(0,a.useState)(""),l=(0,m.useSelect)((e=>e(qn).getBlock(t)),[t]),{updateBlock:i}=(0,m.useDispatch)(qn);return(0,a.useEffect)((()=>{o((0,r.getBlockContent)(l))}),[l]),(0,a.createElement)(vl.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 kl=Al();const _l=e=>Pl(e,kl);let yl=Al();_l.write=e=>Pl(e,yl);let El=Al();_l.onStart=e=>Pl(e,El);let Cl=Al();_l.onFrame=e=>Pl(e,Cl);let wl=Al();_l.onFinish=e=>Pl(e,wl);let Sl=[];_l.setTimeout=(e,t)=>{let n=_l.now()+t,o=()=>{let e=Sl.findIndex((e=>e.cancel==o));~e&&Sl.splice(e,1),Tl-=~e?1:0},r={time:n,handler:e,cancel:o};return Sl.splice(Bl(n),0,r),Tl+=1,Ml(),r};let Bl=e=>~(~Sl.findIndex((t=>t.time>e))||~Sl.length);_l.cancel=e=>{El.delete(e),Cl.delete(e),wl.delete(e),kl.delete(e),yl.delete(e)},_l.sync=e=>{Nl=!0,_l.batchedUpdates(e),Nl=!1},_l.throttle=e=>{let t;function n(){try{e(...t)}finally{t=null}}function o(...e){t=e,_l.onStart(n)}return o.handler=e,o.cancel=()=>{El.delete(n),t=null},o};let Il="undefined"!=typeof window?window.requestAnimationFrame:()=>{};_l.use=e=>Il=e,_l.now="undefined"!=typeof performance?()=>performance.now():Date.now,_l.batchedUpdates=e=>e(),_l.catch=console.error,_l.frameLoop="always",_l.advance=()=>{"demand"!==_l.frameLoop?console.warn("Cannot call the manual advancement of rafz whilst frameLoop is not set as demand"):Ll()};let xl=-1,Tl=0,Nl=!1;function Pl(e,t){Nl?(t.delete(e),e(0)):(t.add(e),Ml())}function Ml(){xl<0&&(xl=0,"demand"!==_l.frameLoop&&Il(Rl))}function Rl(){~xl&&(Il(Rl),_l.batchedUpdates(Ll))}function Ll(){let e=xl;xl=_l.now();let t=Bl(xl);t&&(Dl(Sl.splice(0,t),(e=>e.handler())),Tl-=t),Tl?(El.flush(),kl.flush(e?Math.min(64,xl-e):16.667),Cl.flush(),yl.flush(),wl.flush()):xl=-1}function Al(){let e=new Set,t=e;return{add(n){Tl+=t!=e||e.has(n)?0:1,e.add(n)},delete:n=>(Tl-=t==e&&e.has(n)?1:0,e.delete(n)),flush(n){t.size&&(e=new Set,Tl-=t.size,Dl(t,(t=>t(n)&&e.add(t))),Tl+=e.size,t=e)}}}function Dl(e,t){e.forEach((e=>{try{t(e)}catch(e){_l.catch(e)}}))}var Ol=n(9196),Fl=n.n(Ol);function zl(){}const Vl={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 Hl(e,t){if(Vl.arr(e)){if(!Vl.arr(t)||e.length!==t.length)return!1;for(let n=0;ne.forEach(t);function Ul(e,t,n){if(Vl.arr(e))for(let o=0;oVl.und(e)?[]:Vl.arr(e)?e:[e];function $l(e,t){if(e.size){const n=Array.from(e);e.clear(),Gl(n,t)}}const jl=(e,...t)=>$l(e,(e=>e(...t))),Kl=()=>"undefined"==typeof window||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent);let ql,Yl,Ql=null,Xl=!1,Zl=zl;const Jl=e=>{e.to&&(Yl=e.to),e.now&&(_l.now=e.now),void 0!==e.colors&&(Ql=e.colors),null!=e.skipAnimation&&(Xl=e.skipAnimation),e.createStringInterpolator&&(ql=e.createStringInterpolator),e.requestAnimationFrame&&_l.use(e.requestAnimationFrame),e.batchedUpdates&&(_l.batchedUpdates=e.batchedUpdates),e.willAdvance&&(Zl=e.willAdvance),e.frameLoop&&(_l.frameLoop=e.frameLoop)};var ei=Object.freeze({__proto__:null,get createStringInterpolator(){return ql},get to(){return Yl},get colors(){return Ql},get skipAnimation(){return Xl},get willAdvance(){return Zl},assign:Jl});const ti=new Set;let ni=[],oi=[],ri=0;const li={get idle(){return!ti.size&&!ni.length},start(e){ri>e.priority?(ti.add(e),_l.onStart(ii)):(ai(e),_l(ci))},advance:ci,sort(e){if(ri)_l.onFrame((()=>li.sort(e)));else{const t=ni.indexOf(e);~t&&(ni.splice(t,1),si(e))}},clear(){ni=[],ti.clear()}};function ii(){ti.forEach(ai),ti.clear(),_l(ci)}function ai(e){ni.includes(e)||si(e)}function si(e){ni.splice(function(e,t){const n=e.findIndex(t);return n<0?e.length:n}(ni,(t=>t.priority>e.priority)),0,e)}function ci(e){const t=oi;for(let n=0;n0}const ui="[-+]?\\d*\\.?\\d+",di=ui+"%";function pi(...e){return"\\(\\s*("+e.join(")\\s*,\\s*(")+")\\s*\\)"}const mi=new RegExp("rgb"+pi(ui,ui,ui)),fi=new RegExp("rgba"+pi(ui,ui,ui,ui)),gi=new RegExp("hsl"+pi(ui,di,di)),hi=new RegExp("hsla"+pi(ui,di,di,ui)),vi=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,bi=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,ki=/^#([0-9a-fA-F]{6})$/,_i=/^#([0-9a-fA-F]{8})$/;function yi(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 Ei(e,t,n){const o=n<.5?n*(1+t):n+t-n*t,r=2*n-o,l=yi(r,o,e+1/3),i=yi(r,o,e),a=yi(r,o,e-1/3);return Math.round(255*l)<<24|Math.round(255*i)<<16|Math.round(255*a)<<8}function Ci(e){const t=parseInt(e,10);return t<0?0:t>255?255:t}function wi(e){return(parseFloat(e)%360+360)%360/360}function Si(e){const t=parseFloat(e);return t<0?0:t>1?255:Math.round(255*t)}function Bi(e){const t=parseFloat(e);return t<0?0:t>100?1:t/100}function Ii(e){let t=function(e){let t;return"number"==typeof e?e>>>0===e&&e>=0&&e<=4294967295?e:null:(t=ki.exec(e))?parseInt(t[1]+"ff",16)>>>0:Ql&&void 0!==Ql[e]?Ql[e]:(t=mi.exec(e))?(Ci(t[1])<<24|Ci(t[2])<<16|Ci(t[3])<<8|255)>>>0:(t=fi.exec(e))?(Ci(t[1])<<24|Ci(t[2])<<16|Ci(t[3])<<8|Si(t[4]))>>>0:(t=vi.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+"ff",16)>>>0:(t=_i.exec(e))?parseInt(t[1],16)>>>0:(t=bi.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+t[4]+t[4],16)>>>0:(t=gi.exec(e))?(255|Ei(wi(t[1]),Bi(t[2]),Bi(t[3])))>>>0:(t=hi.exec(e))?(Ei(wi(t[1]),Bi(t[2]),Bi(t[3]))|Si(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 xi=(e,t,n)=>{if(Vl.fun(e))return e;if(Vl.arr(e))return xi({range:e,output:t,extrapolate:n});if(Vl.str(e.output[0]))return ql(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=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(cn){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 Ti(){return Ti=Object.assign||function(e){for(var t=1;tBoolean(e&&e[Ni]),Ri=e=>e&&e[Ni]?e[Ni]():e,Li=e=>e[Pi]||null;function Ai(e,t){let n=e[Pi];n&&n.forEach((e=>{!function(e,t){e.eventObserved?e.eventObserved(t):e(t)}(e,t)}))}class Di{constructor(e){if(this[Ni]=void 0,this[Pi]=void 0,!e&&!(e=this.get))throw Error("Unknown getter");Oi(this,e)}}const Oi=(e,t)=>Vi(e,Ni,t);function Fi(e,t){if(e[Ni]){let n=e[Pi];n||Vi(e,Pi,n=new Set),n.has(t)||(n.add(t),e.observerAdded&&e.observerAdded(n.size,t))}return t}function zi(e,t){let n=e[Pi];if(n&&n.has(t)){const o=n.size-1;o?n.delete(t):e[Pi]=null,e.observerRemoved&&e.observerRemoved(o,t)}}const Vi=(e,t,n)=>Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0}),Hi=/[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,Gi=/(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi,Ui=new RegExp(`(${Hi.source})(%|[a-z]+)`,"i"),Wi=/rgba\(([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+)\)/gi,$i=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/,ji=e=>{const[t,n]=Ki(e);if(!t||Kl())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&&$i.test(n)?ji(n):n||e},Ki=e=>{const t=$i.exec(e);if(!t)return[,];const[,n,o]=t;return[n,o]};let qi;const Yi=(e,t,n,o,r)=>`rgba(${Math.round(t)}, ${Math.round(n)}, ${Math.round(o)}, ${r})`,Qi=e=>{qi||(qi=Ql?new RegExp(`(${Object.keys(Ql).join("|")})(?!\\w)`,"g"):/^\b$/);const t=e.output.map((e=>Ri(e).replace($i,ji).replace(Gi,Ii).replace(qi,Ii))),n=t.map((e=>e.match(Hi).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=>xi(Ti({},e,{output:t}))));return e=>{var n;const o=!Ui.test(t[0])&&(null==(n=t.find((e=>Ui.test(e))))?void 0:n.replace(Hi,""));let l=0;return t[0].replace(Hi,(()=>`${r[l++](e)}${o||""}`)).replace(Wi,Yi)}},Xi="react-spring: ",Zi=e=>{const t=e;let n=!1;if("function"!=typeof t)throw new TypeError(`${Xi}once requires a function parameter`);return(...e)=>{n||(t(...e),n=!0)}},Ji=Zi(console.warn);const ea=Zi(console.warn);function ta(e){return Vl.str(e)&&("#"==e[0]||/\d/.test(e)||!Kl()&&$i.test(e)||e in(Ql||{}))}const na=Kl()?Ol.useEffect:Ol.useLayoutEffect;function oa(){const e=(0,Ol.useState)()[1],t=(()=>{const e=(0,Ol.useRef)(!1);return na((()=>(e.current=!0,()=>{e.current=!1})),[]),e})();return()=>{t.current&&e(Math.random())}}const ra=e=>(0,Ol.useEffect)(e,la),la=[];function ia(e){const t=(0,Ol.useRef)();return(0,Ol.useEffect)((()=>{t.current=e})),t.current}const aa=Symbol.for("Animated:node"),sa=e=>e&&e[aa],ca=(e,t)=>{return n=e,o=aa,r=t,Object.defineProperty(n,o,{value:r,writable:!0,configurable:!0});var n,o,r},ua=e=>e&&e[aa]&&e[aa].getPayload();class da{constructor(){this.payload=void 0,ca(this,this)}getPayload(){return this.payload||[]}}class pa extends da{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,Vl.num(this._value)&&(this.lastPosition=this._value)}static create(e){return new pa(e)}getPayload(){return[this]}getValue(){return this._value}setValue(e,t){return Vl.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,Vl.num(this._value)&&(this.elapsedTime=0,this.durationProgress=0,this.lastPosition=this._value,e&&(this.lastVelocity=null),this.v0=null)}}class ma extends pa{constructor(e){super(0),this._string=null,this._toString=void 0,this._toString=xi({output:[e,e]})}static create(e){return new ma(e)}getValue(){let e=this._string;return null==e?this._string=this._toString(this._value):e}setValue(e){if(Vl.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=xi({output:[this.getValue(),e]})),this._value=0,super.reset()}}const fa={dependencies:null};class ga extends da{constructor(e){super(),this.source=e,this.setValue(e)}getValue(e){const t={};return Ul(this.source,((n,o)=>{var r;(r=n)&&r[aa]===r?t[o]=n.getValue(e):Mi(n)?t[o]=Ri(n):e||(t[o]=n)})),t}setValue(e){this.source=e,this.payload=this._makePayload(e)}reset(){this.payload&&Gl(this.payload,(e=>e.reset()))}_makePayload(e){if(e){const t=new Set;return Ul(e,this._addToPayload,t),Array.from(t)}}_addToPayload(e){fa.dependencies&&Mi(e)&&fa.dependencies.add(e);const t=ua(e);t&&Gl(t,(e=>this.add(e)))}}class ha extends ga{constructor(e){super(e)}static create(e){return new ha(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(va)),!0)}}function va(e){return(ta(e)?ma:pa).create(e)}function ba(e){const t=sa(e);return t?t.constructor:Vl.arr(e)?ha:ta(e)?ma:pa}function ka(){return ka=Object.assign||function(e){for(var t=1;t{const n=!Vl.fun(e)||e.prototype&&e.prototype.isReactComponent;return(0,Ol.forwardRef)(((o,r)=>{const l=(0,Ol.useRef)(null),i=n&&(0,Ol.useCallback)((e=>{l.current=function(e,t){e&&(Vl.fun(e)?e(t):e.current=t);return t}(r,e)}),[r]),[a,s]=function(e,t){const n=new Set;fa.dependencies=n,e.style&&(e=ka({},e,{style:t.createAnimatedStyle(e.style)}));return e=new ga(e),fa.dependencies=null,[e,n]}(o,t),c=oa(),u=()=>{const e=l.current;if(n&&!e)return;!1===(!!e&&t.applyAnimatedValues(e,a.getValue(!0)))&&c()},d=new ya(u,s),p=(0,Ol.useRef)();na((()=>(p.current=d,Gl(s,(e=>Fi(e,d))),()=>{p.current&&(Gl(p.current.deps,(e=>zi(e,p.current))),_l.cancel(p.current.update))}))),(0,Ol.useEffect)(u,[]),ra((()=>()=>{const e=p.current;Gl(e.deps,(t=>zi(t,e)))}));const m=t.getComponentProps(a.getValue());return Ol.createElement(e,ka({},m,{ref:i}))}))};class ya{constructor(e,t){this.update=e,this.deps=t}eventObserved(e){"change"==e.type&&_l.write(this.update)}}const Ea=Symbol.for("AnimatedComponent"),Ca=e=>Vl.str(e)?e:e&&Vl.str(e.displayName)?e.displayName:Vl.fun(e)&&e.name||null;function wa(){return wa=Object.assign||function(e){for(var t=1;t!0===e||!!(t&&e&&(Vl.fun(e)?e(t):Wl(e).includes(t))),Ia=(e,t)=>Vl.obj(e)?t&&e[t]:e,xa=(e,t)=>!0===e.default?e[t]:e.default?e.default[t]:void 0,Ta=e=>e,Na=(e,t=Ta)=>{let n=Pa;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);Vl.und(n)||(o[r]=n)}return o},Pa=["config","onProps","onStart","onChange","onPause","onResume","onRest"],Ma={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 Ra(e){const t=function(e){const t={};let n=0;if(Ul(e,((e,o)=>{Ma[o]||(t[o]=e,n++)})),n)return t}(e);if(t){const n={to:t};return Ul(e,((e,o)=>o in t||(n[o]=e))),n}return wa({},e)}function La(e){return e=Ri(e),Vl.arr(e)?e.map(La):ta(e)?ei.createStringInterpolator({range:[0,1],output:[e,e]})(1):e}function Aa(e){for(const t in e)return!0;return!1}function Da(e){return Vl.fun(e)||Vl.arr(e)&&Vl.obj(e[0])}function Oa(e,t){var n;null==(n=e.ref)||n.delete(e),null==t||t.delete(e)}function Fa(e,t){var n;t&&e.ref!==t&&(null==(n=e.ref)||n.delete(e),t.add(e),e.ref=t)}const za=1.70158,Va=1.525*za,Ha=za+1,Ga=2*Math.PI/3,Ua=2*Math.PI/4.5,Wa=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},$a={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=>Ha*e*e*e-za*e*e,easeOutBack:e=>1+Ha*Math.pow(e-1,3)+za*Math.pow(e-1,2),easeInOutBack:e=>e<.5?Math.pow(2*e,2)*(7.189819*e-Va)/2:(Math.pow(2*e-2,2)*((Va+1)*(2*e-2)+Va)+2)/2,easeInElastic:e=>0===e?0:1===e?1:-Math.pow(2,10*e-10)*Math.sin((10*e-10.75)*Ga),easeOutElastic:e=>0===e?0:1===e?1:Math.pow(2,-10*e)*Math.sin((10*e-.75)*Ga)+1,easeInOutElastic:e=>0===e?0:1===e?1:e<.5?-Math.pow(2,20*e-10)*Math.sin((20*e-11.125)*Ua)/2:Math.pow(2,-20*e+10)*Math.sin((20*e-11.125)*Ua)/2+1,easeInBounce:e=>1-Wa(1-e),easeOutBounce:Wa,easeInOutBounce:e=>e<.5?(1-Wa(1-2*e))/2:(1+Wa(2*e-1))/2},ja=wa({},{tension:170,friction:26},{mass:1,damping:1,easing:$a.linear,clamp:!1});class Ka{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,ja)}}function qa(e,t){if(Vl.und(t.decay)){const n=!Vl.und(t.tension)||!Vl.und(t.friction);!n&&Vl.und(t.frequency)&&Vl.und(t.damping)&&Vl.und(t.mass)||(e.duration=void 0,e.decay=void 0),n&&(e.frequency=void 0)}else e.duration=void 0}const Ya=[];class Qa{constructor(){this.changed=!1,this.values=Ya,this.toValues=null,this.fromValues=Ya,this.to=void 0,this.from=void 0,this.config=new Ka,this.immediate=!1}}function Xa(e,{key:t,props:n,defaultProps:o,state:r,actions:l}){return new Promise(((i,a)=>{var s;let c,u,d=Ba(null!=(s=n.cancel)?s:null==o?void 0:o.cancel,t);if(d)f();else{Vl.und(n.pause)||(r.paused=Ba(n.pause,t));let e=null==o?void 0:o.pause;!0!==e&&(e=r.paused||Ba(e,t)),c=Sa(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-_l.now()}function m(){c>0&&!ei.skipAnimation?(r.delayed=!0,u=_l.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(wa({},n,{callId:e,cancel:d}),i)}catch(e){a(e)}}}))}const Za=(e,t)=>1==t.length?t[0]:t.some((e=>e.cancelled))?ts(e.get()):t.every((e=>e.noop))?Ja(e.get()):es(e.get(),t.every((e=>e.finished))),Ja=e=>({value:e,noop:!0,finished:!0,cancelled:!1}),es=(e,t,n=!1)=>({value:e,finished:t,cancelled:n}),ts=e=>({value:e,cancelled:!0,finished:!1});function ns(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=Na(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)&&ts(o)||r!==n.asyncId&&es(o,!1);if(t)throw e.result=t,d(e),e},f=(e,t)=>{const l=new rs,i=new ls;return(async()=>{if(ei.skipAnimation)throw os(n),i.result=es(o,!1),d(i),i;m(l);const a=Vl.obj(e)?wa({},e):wa({},t,{to:e});a.parentId=r,Ul(c,((e,t)=>{Vl.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(ei.skipAnimation)return os(n),es(o,!1);try{let t;t=Vl.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=es(o.get(),!0,!1)}catch(e){if(e instanceof rs)g=e.result;else{if(!(e instanceof ls))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 Vl.fun(i)&&_l.batchedUpdates((()=>{i(g,o,o.item)})),g})():s}function os(e,t){$l(e.timeouts,(e=>e.cancel())),e.pauseQueue.clear(),e.resumeQueue.clear(),e.asyncId=e.asyncTo=e.promise=void 0,t&&(e.cancelId=t)}class rs 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 ls extends Error{constructor(){super("SkipAnimationSignal"),this.result=void 0}}const is=e=>e instanceof ss;let as=1;class ss extends Di{constructor(...e){super(...e),this.id=as++,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=sa(this);return e&&e.getValue()}to(...e){return ei.to(this,e)}interpolate(...e){return Ji(`${Xi}The "interpolate" function is deprecated in v9 (use "to" instead)`),ei.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){Ai(this,{type:"change",parent:this,value:e,idle:t})}_onPriorityChange(e){this.idle||li.sort(this),Ai(this,{type:"priority",parent:this,priority:e})}}const cs=Symbol.for("SpringPhase"),us=e=>(1&e[cs])>0,ds=e=>(2&e[cs])>0,ps=e=>(4&e[cs])>0,ms=(e,t)=>t?e[cs]|=3:e[cs]&=-3,fs=(e,t)=>t?e[cs]|=4:e[cs]&=-5;class gs extends ss{constructor(e,t){if(super(),this.key=void 0,this.animation=new Qa,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,!Vl.und(e)||!Vl.und(t)){const n=Vl.obj(e)?wa({},e):wa({},t,{from:e});Vl.und(n.default)&&(n.default=!0),this.start(n)}}get idle(){return!(ds(this)||this._state.asyncTo)||ps(this)}get goal(){return Ri(this.animation.to)}get velocity(){const e=sa(this);return e instanceof pa?e.lastVelocity||0:e.getPayload().map((e=>e.lastVelocity||0))}get hasAnimated(){return us(this)}get isAnimating(){return ds(this)}get isPaused(){return ps(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=ua(o.to);!i&&Mi(o.to)&&(l=Wl(Ri(o.to))),o.values.forEach(((a,s)=>{if(a.done)return;const c=a.constructor==ma?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=Vl.arr(r.velocity)?r.velocity[s]:r.velocity;let i;if(Vl.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)<.1,i=l*o}else{i=null==a.lastVelocity?l:a.lastVelocity;const t=r.precision||(n==c?.005:Math.min(1,.001*Math.abs(c-n))),o=r.restVelocity||t/10,s=r.clamp?0:r.bounce,p=!Vl.und(s),m=n==c?a.v0>0:no,f||(u=Math.abs(c-d)<=t,!u));++e){p&&(g=d==c||d>c==m,g&&(i=-i*s,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=sa(this),s=a.getValue();if(t){const e=Ri(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 _l.batchedUpdates((()=>{this._stop(),this._focus(e),this._set(e)})),this}pause(){this._update({pause:!0})}resume(){this._update({pause:!1})}finish(){if(ds(this)){const{to:e,config:t}=this.animation;_l.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 Vl.und(e)?(n=this.queue||[],this.queue=[]):n=[Vl.obj(e)?e:wa({},t,{to:e})],Promise.all(n.map((e=>this._update(e)))).then((e=>Za(this,e)))}stop(e){const{to:t}=this.animation;return this._focus(this.get()),os(this._state,e&&this._lastCallId),_l.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=Vl.obj(n)?n[t]:n,(null==n||Da(n))&&(n=void 0),o=Vl.obj(o)?o[t]:o,null==o&&(o=void 0);const r={to:n,from:o};return us(this)||(e.reverse&&([n,o]=[o,n]),o=Ri(o),Vl.und(o)?sa(this)||this._set(n):this._set(o)),r}_update(e,t){let n=wa({},e);const{key:o,defaultProps:r}=this;n.default&&Object.assign(r,Na(n,((e,t)=>/^on/.test(t)?Ia(e,o):e))),Es(this,n,"onProps"),Cs(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 Xa(++this._lastCallId,{key:o,props:n,defaultProps:r,state:i,actions:{pause:()=>{ps(this)||(fs(this,!0),jl(i.pauseQueue),Cs(this,"onPause",es(this,hs(this,this.animation.to)),this))},resume:()=>{ps(this)&&(fs(this,!1),ds(this)&&this._resume(),jl(i.resumeQueue),Cs(this,"onResume",es(this,hs(this,this.animation.to)),this))},start:this._merge.bind(this,l)}}).then((e=>{if(n.loop&&e.finished&&(!t||!e.noop)){const e=vs(n);if(e)return this._update(e,!0)}return e}))}_merge(e,t,n){if(t.cancel)return this.stop(!0),n(ts(this));const o=!Vl.und(e.to),r=!Vl.und(e.from);if(o||r){if(!(t.callId>this._lastToId))return n(ts(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&&!Vl.und(u)||(u=d),t.reverse&&([u,d]=[d,u]);const p=!Hl(d,c);p&&(a.from=d),d=Ri(d);const m=!Hl(u,s);m&&this._focus(u);const f=Da(t.to),{config:g}=a,{decay:h,velocity:v}=g;(o||r)&&(g.velocity=0),t.config&&!f&&function(e,t,n){n&&(qa(n=wa({},n),t),t=wa({},n,t)),qa(e,t),Object.assign(e,t);for(const t in ja)null==e[t]&&(e[t]=ja[t]);let{mass:o,frequency:r,damping:l}=e;Vl.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,Sa(t.config,l),t.config!==i.config?Sa(i.config,l):void 0);let b=sa(this);if(!b||Vl.und(u))return n(es(this,!0));const k=Vl.und(t.reset)?r&&!t.default:!Vl.und(d)&&Ba(t.reset,l),_=k?d:this.get(),y=La(u),E=Vl.num(y)||Vl.arr(y)||ta(y),C=!f&&(!E||Ba(i.immediate||t.immediate,l));if(m){const e=ba(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=Mi(u),B=!1;if(!S){const e=k||!us(this)&&p;(m||e)&&(B=Hl(La(_),y),S=!B),(Hl(a.immediate,C)||C)&&Hl(g.decay,h)&&Hl(g.velocity,v)||(S=!0)}if(B&&ds(this)&&(a.changed&&!k?S=!0:S||this._stop(s)),!f&&((S||Mi(s))&&(a.values=b.getPayload(),a.toValues=Mi(u)?null:w==ma?[1]:Wl(y)),a.immediate!=C&&(a.immediate=C,C||k||this._set(s)),S)){const{onRest:e}=a;Gl(ys,(e=>Es(this,t,e)));const o=es(this,hs(this,s));jl(this._pendingCalls,o),this._pendingCalls.add(n),a.changed&&_l.batchedUpdates((()=>{a.changed=!k,null==e||e(o,this),k?Sa(i.onRest,o):null==a.onStart||a.onStart(o,this)}))}k&&this._set(_),f?n(ns(t.to,t,this._state,this)):S?this._start():ds(this)&&!m?this._pendingCalls.add(n):n(Ja(_))}_focus(e){const t=this.animation;e!==t.to&&(Li(this)&&this._detach(),t.to=e,Li(this)&&this._attach())}_attach(){let e=0;const{to:t}=this.animation;Mi(t)&&(Fi(t,this),is(t)&&(e=t.priority+1)),this.priority=e}_detach(){const{to:e}=this.animation;Mi(e)&&zi(e,this)}_set(e,t=!0){const n=Ri(e);if(!Vl.und(n)){const e=sa(this);if(!e||!Hl(n,e.getValue())){const o=ba(n);e&&e.constructor==o?e.setValue(n):ca(this,o.create(n)),e&&_l.batchedUpdates((()=>{this._onChange(n,t)}))}}return sa(this)}_onStart(){const e=this.animation;e.changed||(e.changed=!0,Cs(this,"onStart",es(this,hs(this,e.to)),this))}_onChange(e,t){t||(this._onStart(),Sa(this.animation.onChange,e,this)),Sa(this.defaultProps.onChange,e,this),super._onChange(e,t)}_start(){const e=this.animation;sa(this).reset(Ri(e.to)),e.immediate||(e.fromValues=e.values.map((e=>e.lastPosition))),ds(this)||(ms(this,!0),ps(this)||this._resume())}_resume(){ei.skipAnimation?this.finish():li.start(this)}_stop(e,t){if(ds(this)){ms(this,!1);const n=this.animation;Gl(n.values,(e=>{e.done=!0})),n.toValues&&(n.onChange=n.onPause=n.onResume=void 0),Ai(this,{type:"idle",parent:this});const o=t?ts(this.get()):es(this.get(),hs(this,null!=e?e:n.to));jl(this._pendingCalls,o),n.changed&&(n.changed=!1,Cs(this,"onRest",o,this))}}}function hs(e,t){const n=La(t);return Hl(La(e.get()),n)}function vs(e,t=e.loop,n=e.to){let o=Sa(t);if(o){const r=!0!==o&&Ra(o),l=(r||e).reverse,i=!r||r.reset;return bs(wa({},e,{loop:t,default:!1,pause:void 0,to:!l||Da(n)?n:void 0,from:i?e.from:void 0,reset:i},r))}}function bs(e){const{to:t,from:n}=e=Ra(e),o=new Set;return Vl.obj(t)&&_s(t,o),Vl.obj(n)&&_s(n,o),e.keys=o.size?Array.from(o):null,e}function ks(e){const t=bs(e);return Vl.und(t.default)&&(t.default=Na(t)),t}function _s(e,t){Ul(e,((e,n)=>null!=e&&t.add(n)))}const ys=["onStart","onRest","onChange","onPause","onResume"];function Es(e,t,n){e.animation[n]=t[n]!==xa(t,n)?Ia(t[n],e.key):void 0}function Cs(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 ws=["onStart","onChange","onRest"];let Ss=1;class Bs{constructor(e,t){this.id=Ss++,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(wa({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];Vl.und(n)||this.springs[t].set(n)}}update(e){return e&&this.queue.push(bs(e)),this}start(e){let{queue:t}=this;return e?t=Wl(e).map(bs):this.queue=[],this._flush?this._flush(this,t):(Rs(this,t),Is(this,t))}stop(e,t){if(e!==!!e&&(t=e),t){const n=this.springs;Gl(Wl(t),(t=>n[t].stop(!!e)))}else os(this._state,this._lastAsyncId),this.each((t=>t.stop(!!e)));return this}pause(e){if(Vl.und(e))this.start({pause:!0});else{const t=this.springs;Gl(Wl(e),(e=>t[e].pause()))}return this}resume(e){if(Vl.und(e))this.start({pause:!1});else{const t=this.springs;Gl(Wl(e),(e=>t[e].resume()))}return this}each(e){Ul(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,$l(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&&$l(t,(([e,t])=>{t.value=i,e(t,this,this._item)})),l&&(this._started=!1,$l(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)}_l.onFrame(this._onFrame)}}function Is(e,t){return Promise.all(t.map((t=>xs(e,t)))).then((t=>Za(e,t)))}async function xs(e,t,n){const{keys:o,to:r,from:l,loop:i,onRest:a,onResolve:s}=t,c=Vl.obj(t.default)&&t.default;i&&(t.loop=!1),!1===r&&(t.to=null),!1===l&&(t.from=null);const u=Vl.arr(r)||Vl.fun(r)?r:void 0;u?(t.to=void 0,t.onRest=void 0,c&&(c.onRest=void 0)):Gl(ws,(n=>{const o=t[n];if(Vl.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,jl(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===xa(t,"cancel");(u||m&&d.asyncId)&&p.push(Xa(++e._lastAsyncId,{props:t,state:d,actions:{pause:zl,resume:zl,start(t,n){m?(os(d,e._lastAsyncId),n(ts(e))):(t.onRest=a,n(ns(u,t,d,e)))}}})),d.paused&&await new Promise((e=>{d.resumeQueue.add(e)}));const f=Za(e,await Promise.all(p));if(i&&f.finished&&(!n||!f.noop)){const n=vs(t,i,r);if(n)return Rs(e,[n]),xs(e,n,!0)}return s&&_l.batchedUpdates((()=>s(f,e,e.item))),f}function Ts(e,t){const n=wa({},e.springs);return t&&Gl(Wl(t),(e=>{Vl.und(e.keys)&&(e=bs(e)),Vl.obj(e.to)||(e=wa({},e,{to:void 0})),Ms(n,e,(e=>Ps(e)))})),Ns(e,n),n}function Ns(e,t){Ul(t,((t,n)=>{e.springs[n]||(e.springs[n]=t,Fi(t,e))}))}function Ps(e,t){const n=new gs;return n.key=e,t&&Fi(n,t),n}function Ms(e,t,n){t.keys&&Gl(t.keys,(o=>{(e[o]||(e[o]=n(o)))._prepareNode(t)}))}function Rs(e,t){Gl(t,(t=>{Ms(e.springs,t,(t=>Ps(t,e)))}))}function Ls(e,t){if(null==e)return{};var n,o,r={},l=Object.keys(e);for(o=0;o=0||(r[n]=e[n]);return r}const As=["children"],Ds=e=>{let{children:t}=e,n=Ls(e,As);const o=(0,Ol.useContext)(Os),r=n.pause||!!o.pause,l=n.immediate||!!o.immediate;n=function(e,t){const[n]=(0,Ol.useState)((()=>({inputs:t,result:e()}))),o=(0,Ol.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{o.current=l,r==n&&(n.inputs=n.result=void 0)}),[l]),l.result}((()=>({pause:r,immediate:l})),[r,l]);const{Provider:i}=Os;return Ol.createElement(i,{value:n},t)},Os=(Fs=Ds,zs={},Object.assign(Fs,Ol.createContext(zs)),Fs.Provider._context=Fs,Fs.Consumer._context=Fs,Fs);var Fs,zs;Ds.Provider=Os.Provider,Ds.Consumer=Os.Consumer;const Vs=()=>{const e=[],t=function(t){ea(`${Xi}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 Gl(e,((e,r)=>{if(Vl.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 Gl(e,(e=>e.pause(...arguments))),this},t.resume=function(){return Gl(e,(e=>e.resume(...arguments))),this},t.set=function(t){Gl(e,(e=>e.set(t)))},t.start=function(t){const n=[];return Gl(e,((e,o)=>{if(Vl.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 Gl(e,(e=>e.stop(...arguments))),this},t.update=function(t){return Gl(e,((e,n)=>e.update(this._getProps(t,e,n)))),this};const n=function(e,t,n){return Vl.fun(e)?e(n,t):e};return t._getProps=n,t};function Hs(e,t,n){const o=Vl.fun(t)&&t;o&&!n&&(n=[]);const r=(0,Ol.useMemo)((()=>o||3==arguments.length?Vs():void 0),[]),l=(0,Ol.useRef)(0),i=oa(),a=(0,Ol.useMemo)((()=>({ctrls:[],queue:[],flush(e,t){const n=Ts(e,t);return l.current>0&&!a.queue.length&&!Object.keys(n).some((t=>!e.springs[t]))?Is(e,t):new Promise((o=>{Ns(e,n),a.queue.push((()=>{o(Is(e,t))})),i()}))}})),[]),s=(0,Ol.useRef)([...a.ctrls]),c=[],u=ia(e)||0;function d(e,n){for(let r=e;r{Gl(s.current.slice(e,u),(e=>{Oa(e,r),e.stop(!0)})),s.current.length=e,d(u,e)}),[e]),(0,Ol.useMemo)((()=>{d(0,Math.min(u,e))}),n);const p=s.current.map(((e,t)=>Ts(e,c[t]))),m=(0,Ol.useContext)(Ds),f=ia(m),g=m!==f&&Aa(m);na((()=>{l.current++,a.ctrls=s.current;const{queue:e}=a;e.length&&(a.queue=[],Gl(e,(e=>e()))),Gl(s.current,((e,t)=>{null==r||r.add(e),g&&e.start({default:m});const n=c[t];n&&(Fa(e,n.ref),e.ref?e.queue.push(n):e.start(n))}))})),ra((()=>()=>{Gl(a.ctrls,(e=>e.stop(!0)))}));const h=p.map((e=>wa({},e)));return r?[h,r]:h}function Gs(e,t){const n=Vl.fun(e),[[o],r]=Hs(1,n?e:[e],n?t||[]:t);return n||2==arguments.length?[o,r]:o}let Us;!function(e){e.MOUNT="mount",e.ENTER="enter",e.UPDATE="update",e.LEAVE="leave"}(Us||(Us={}));class Ws extends ss{constructor(e,t){super(),this.key=void 0,this.idle=!0,this.calc=void 0,this._active=new Set,this.source=e,this.calc=xi(...t);const n=this._get(),o=ba(n);ca(this,o.create(n))}advance(e){const t=this._get();Hl(t,this.get())||(sa(this).setValue(t),this._onChange(t,this.idle)),!this.idle&&js(this._active)&&Ks(this)}_get(){const e=Vl.arr(this.source)?this.source.map(Ri):Wl(Ri(this.source));return this.calc(...e)}_start(){this.idle&&!js(this._active)&&(this.idle=!1,Gl(ua(this),(e=>{e.done=!1})),ei.skipAnimation?(_l.batchedUpdates((()=>this.advance())),Ks(this)):li.start(this))}_attach(){let e=1;Gl(Wl(this.source),(t=>{Mi(t)&&Fi(t,this),is(t)&&(t.idle||this._active.add(t),e=Math.max(e,t.priority+1))})),this.priority=e,this._start()}_detach(){Gl(Wl(this.source),(e=>{Mi(e)&&zi(e,this)})),this._active.clear(),Ks(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=Wl(this.source).reduce(((e,t)=>Math.max(e,(is(t)?t.priority:0)+1)),0))}}function $s(e){return!1!==e.idle}function js(e){return!e.size||Array.from(e).every($s)}function Ks(e){e.idle||(e.idle=!0,Gl(ua(e),(e=>{e.done=!0})),Ai(e,{type:"idle",parent:e}))}ei.assign({createStringInterpolator:Qi,to:(e,t)=>new Ws(e,t)});li.advance;var qs=window.ReactDOM;function Ys(e,t){if(null==e)return{};var n,o,r={},l=Object.keys(e);for(o=0;o=0||(r[n]=e[n]);return r}const Qs=["style","children","scrollTop","scrollLeft"],Xs=/^--/;function Zs(e,t){return null==t||"boolean"==typeof t||""===t?"":"number"!=typeof t||0===t||Xs.test(e)||ec.hasOwnProperty(e)&&ec[e]?(""+t).trim():t+"px"}const Js={};let ec={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 tc=["Webkit","Ms","Moz","O"];ec=Object.keys(ec).reduce(((e,t)=>(tc.forEach((n=>e[((e,t)=>e+t.charAt(0).toUpperCase()+t.substring(1))(n,t)]=e[t])),e)),ec);const nc=["x","y","z"],oc=/^(matrix|translate|scale|rotate|skew)/,rc=/^(translate)/,lc=/^(rotate|skew)/,ic=(e,t)=>Vl.num(e)&&0!==e?e+t:e,ac=(e,t)=>Vl.arr(e)?e.every((e=>ac(e,t))):Vl.num(e)?e===t:parseFloat(e)===t;class sc extends ga{constructor(e){let{x:t,y:n,z:o}=e,r=Ys(e,nc);const l=[],i=[];(t||n||o)&&(l.push([t||0,n||0,o||0]),i.push((e=>[`translate3d(${e.map((e=>ic(e,"px"))).join(",")})`,ac(e,0)]))),Ul(r,((e,t)=>{if("transform"===t)l.push([e||""]),i.push((e=>[e,""===e]));else if(oc.test(t)){if(delete r[t],Vl.und(e))return;const n=rc.test(t)?"px":lc.test(t)?"deg":"";l.push(Wl(e)),i.push("rotate3d"===t?([e,t,o,r])=>[`rotate3d(${e},${t},${o},${ic(r,n)})`,ac(r,0)]:e=>[`${t}(${e.map((e=>ic(e,n))).join(",")})`,ac(e,t.startsWith("scale")?1:0)])}})),l.length&&(r.transform=new cc(l,i)),super(r)}}class cc extends Di{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 Gl(this.inputs,((n,o)=>{const r=Ri(n[0]),[l,i]=this.transforms[o](Vl.arr(r)?r:n.map(Ri));e+=" "+l,t=t&&i})),t?"none":e}observerAdded(e){1==e&&Gl(this.inputs,(e=>Gl(e,(e=>Mi(e)&&Fi(e,this)))))}observerRemoved(e){0==e&&Gl(this.inputs,(e=>Gl(e,(e=>Mi(e)&&zi(e,this)))))}eventObserved(e){"change"==e.type&&(this._value=null),Ai(this,e)}}const uc=["scrollTop","scrollLeft"];ei.assign({batchedUpdates:qs.unstable_batchedUpdates,createStringInterpolator:Qi,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 dc=((e,{applyAnimatedValues:t=(()=>!1),createAnimatedStyle:n=(e=>new ga(e)),getComponentProps:o=(e=>e)}={})=>{const r={applyAnimatedValues:t,createAnimatedStyle:n,getComponentProps:o},l=e=>{const t=Ca(e)||"Anonymous";return(e=Vl.str(e)?l[e]||(l[e]=_a(e,r)):e[Ea]||(e[Ea]=_a(e,r))).displayName=`Animated(${t})`,e};return Ul(e,((t,n)=>{Vl.arr(e)&&(n=Ca(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=Ys(o,Qs),c=Object.values(s),u=Object.keys(s).map((t=>n||e.hasAttribute(t)?t:Js[t]||(Js[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=Zs(t,r[t]);Xs.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 sc(e),getComponentProps:e=>Ys(e,uc)}),pc=dc.animated,mc=e=>e+1,fc=e=>({top:e.offsetTop,left:e.offsetLeft});var gc=function(e){let{isSelected:t,adjustScrolling:n,enableAnimation:o,triggerAnimationOnChange:r}=e;const l=(0,a.useRef)(),i=(0,d.useReducedMotion)()||!o,[s,c]=(0,a.useReducer)(mc,0),[u,p]=(0,a.useReducer)(mc,0),[m,f]=(0,a.useState)({x:0,y:0}),g=(0,a.useMemo)((()=>l.current?fc(l.current):null),[r]),h=(0,a.useMemo)((()=>{if(!n||!l.current)return()=>{};const e=(0,Jr.getScrollContainer)(l.current);if(!e)return()=>{};const t=l.current.getBoundingClientRect();return()=>{const n=l.current.getBoundingClientRect().top-t.top;n&&(e.scrollTop+=n)}}),[r,n]);function v(e){let{value:n}=e,{x:o,y:r}=n;o=Math.round(o),r=Math.round(r),o===v.x&&r===v.y||(!function(e){let{x:n,y:o}=e;if(!l.current)return;const r=0===n&&0===o;l.current.style.transformOrigin=r?"":"center",l.current.style.transform=r?"":`translate3d(${n}px,${o}px,0)`,l.current.style.zIndex=!t||r?"":"1",h()}({x:o,y:r}),v.x=o,v.y=r)}return(0,a.useLayoutEffect)((()=>{s&&p()}),[s]),(0,a.useLayoutEffect)((()=>{if(!g)return;if(i)return void h();l.current.style.transform="";const e=fc(l.current);c(),f({x:Math.round(g.left-e.left),y:Math.round(g.top-e.top)})}),[r]),v.x=0,v.y=0,Gs({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:v}),l};const hc=".block-editor-block-list__block",vc=".block-list-appender",bc=".block-editor-button-block-appender";function kc(e,t){return t.closest([hc,vc,bc].join(","))===e}function _c(e){for(;e&&e.nodeType!==e.ELEMENT_NODE;)e=e.parentNode;if(!e)return;const t=e.closest(hc);return t?t.id.slice("block-".length):void 0}function yc(e){const t=(0,a.useRef)(),n=function(e){return(0,m.useSelect)((t=>{const{getSelectedBlocksInitialCaretPosition:n,isNavigationMode:o,isBlockSelected:r}=t(qn);if(r(e)&&!o())return n()}),[e])}(e),{isBlockSelected:o,isMultiSelecting:r}=(0,m.useSelect)(qn);return(0,a.useEffect)((()=>{if(!o(e)||r())return;if(null==n)return;if(!t.current)return;const{ownerDocument:l}=t.current;if(t.current.contains(l.activeElement))return;const i=Jr.focus.tabbable.find(t.current).filter((e=>(0,Jr.isTextField)(e))),a=-1===n,s=(a?u.last:u.first)(i)||t.current;if(kc(t.current,s)){if(!t.current.getAttribute("contenteditable")){const e=Jr.focus.tabbable.findNext(t.current);if(e&&kc(t.current,e)&&(0,Jr.isFormElement)(e))return void e.focus()}(0,Jr.placeCaretAtHorizontalEdge)(s,a)}else t.current.focus()}),[n,e]),t}function Ec(e){if(e.defaultPrevented)return;const t="mouseover"===e.type?"add":"remove";e.preventDefault(),e.currentTarget.classList[t]("is-hovered")}function Cc(){const e=(0,m.useSelect)((e=>{const{isNavigationMode:t,getSettings:n}=e(qn);return t()||n().outlineMode}),[]);return(0,d.useRefEffect)((t=>{if(e)return t.addEventListener("mouseout",Ec),t.addEventListener("mouseover",Ec),()=>{t.removeEventListener("mouseout",Ec),t.removeEventListener("mouseover",Ec),t.classList.remove("is-hovered")}}),[e])}function wc(e){return(0,m.useSelect)((t=>{const{isBlockBeingDragged:n,isBlockHighlighted:o,isBlockSelected:l,isBlockMultiSelected:i,getBlockName:a,getSettings:s,hasSelectedInnerBlock:u,isTyping:d,__experimentalGetActiveBlockIdByBlockNames:p}=t(qn),{__experimentalSpotlightEntityBlocks:m,outlineMode:f}=s(),g=n(e),h=l(e),v=a(e),b=u(e,!0),k=p(m);return c()({"is-selected":h,"is-highlighted":o(e),"is-multi-selected":i(e),"is-reusable":(0,r.isReusableBlock)((0,r.getBlockType)(v)),"is-dragging":g,"has-child-selected":b,"has-active-entity":k,"is-active-entity":k===e,"remove-outline":h&&f&&d()})}),[e])}function Sc(e){return(0,m.useSelect)((t=>{const n=t(qn).getBlockName(e),o=(0,r.getBlockType)(n);if((null==o?void 0:o.apiVersion)>1)return(0,r.getBlockDefaultClassName)(n)}),[e])}function Bc(e){return(0,m.useSelect)((t=>{const{getBlockName:n,getBlockAttributes:o}=t(qn),l=o(e);if(null==l||!l.className)return;const i=(0,r.getBlockType)(n(e));return(null==i?void 0:i.apiVersion)>1?l.className:void 0}),[e])}function Ic(e){return(0,m.useSelect)((t=>{const{hasBlockMovingClientId:n,canInsertBlockType:o,getBlockName:r,getBlockRootClientId:l,isBlockSelected:i}=t(qn);if(!i(e))return;const a=n();return a?c()("is-block-moving-mode",{"can-insert-moving-block":o(r(a),l(e))}):void 0}),[e])}function xc(e){const{isBlockSelected:t}=(0,m.useSelect)(qn),{selectBlock:n,selectionChange:o}=(0,m.useDispatch)(qn);return(0,d.useRefEffect)((r=>{function l(l){r.parentElement.closest('[contenteditable="true"]')||(t(e)?l.target.isContentEditable||o(e):kc(r,l.target)&&n(e))}return r.addEventListener("focusin",l),()=>{r.removeEventListener("focusin",l)}}),[t,n])}var Tc=window.wp.keycodes;function Nc(e){const t=(0,m.useSelect)((t=>t(qn).isBlockSelected(e)),[e]),{getBlockRootClientId:n,getBlockIndex:o}=(0,m.useSelect)(qn),{insertDefaultBlock:r,removeBlock:l}=(0,m.useDispatch)(qn);return(0,d.useRefEffect)((i=>{if(t)return i.addEventListener("keydown",a),i.addEventListener("dragstart",s),()=>{i.removeEventListener("keydown",a),i.removeEventListener("dragstart",s)};function a(t){const{keyCode:a,target:s}=t;a!==Tc.ENTER&&a!==Tc.BACKSPACE&&a!==Tc.DELETE||s!==i||(0,Jr.isTextField)(s)||(t.preventDefault(),a===Tc.ENTER?r({},n(e),o(e)+1):l(e))}function s(e){e.preventDefault()}}),[e,t,n,o,r,l])}function Pc(e){const{isNavigationMode:t,isBlockSelected:n}=(0,m.useSelect)(qn),{setNavigationMode:o,selectBlock:r}=(0,m.useDispatch)(qn);return(0,d.useRefEffect)((l=>{function i(l){t()&&!l.defaultPrevented&&(l.preventDefault(),n(e)?o(!1):r(e))}return l.addEventListener("mousedown",i),()=>{l.addEventListener("mousedown",i)}}),[e,t,n,o])}function Mc(){const e=(0,a.useContext)(Gf);return(0,d.useRefEffect)((t=>{if(e)return e.observe(t),()=>{e.unobserve(t)}}),[e])}function Rc(){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)(Lc),{index:s,mode:u,name:p,blockApiVersion:f,blockTitle:h,isPartOfSelection:v,adjustScrolling:b,enableAnimation:k}=(0,m.useSelect)((e=>{const{getBlockIndex:t,getBlockMode:o,getBlockName:l,isTyping:i,getGlobalBlockCount:a,isBlockSelected:s,isBlockMultiSelected:c,isAncestorMultiSelected:u,isFirstMultiSelectedBlock:d}=e(qn),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]),_=(0,g.sprintf)((0,g.__)("Block: %s"),h),y="html"!==u||t?"":"-visual",E=(0,d.useMergeRefs)([e.ref,yc(n),yo(n),xc(n),Nc(n),Pc(n),Cc(),Mc(),gc({isSelected:v,adjustScrolling:b,enableAnimation:k,triggerAnimationOnChange:s})]),C=Zn();return f<2&&n===C.clientId&&"undefined"!=typeof process&&process.env,{...l,...e,ref:E,id:`block-${n}${y}`,tabIndex:0,role:"document","aria-label":_,"data-block":n,"data-type":p,"data-title":h,className:c()(c()("block-editor-block-list__block",{"wp-block":!i}),o,e.className,l.className,wc(n),Sc(n),Bc(n),Ic(n)),style:{...l.style,...e.style}}}Rc.save=r.__unstableGetBlockProps;const Lc=(0,a.createContext)();function Ac(e){let{children:t,isHtml:n,...o}=e;return(0,a.createElement)("div",Rc(o,{__unstableIsHtml:n}),t)}const Dc=(0,m.withSelect)(((e,t)=>{let{clientId:n,rootClientId:o}=t;const{isBlockSelected:r,getBlockMode:l,isSelectionEnabled:i,getTemplateLock:a,__unstableGetBlockWithoutInnerBlocks:s,canRemoveBlock:c,canMoveBlock:u}=e(qn),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}})),Oc=(0,m.withDispatch)(((e,t,n)=>{let{select:o}=n;const{updateBlockAttributes:l,insertBlocks:i,mergeBlocks:a,replaceBlocks:s,toggleSelection:c,__unstableMarkLastChangeAsPersistent:u}=e(qn);return{setAttributes(e){const{getMultiSelectedBlockClientIds:n}=o(qn),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(qn),a=l(n);i(e,a+1,r)},onMerge(e){const{clientId:n}=t,{getPreviousBlockClientId:r,getNextBlockClientId:l}=o(qn);if(e){const e=l(n);e&&a(n,e)}else{const e=r(n);e&&a(e,n)}},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 Fc=(0,d.compose)(d.pure,Dc,Oc,(0,d.ifCondition)((e=>{let{block:t}=e;return!!t})),(0,p.withFilters)("editor.BlockListBlock"))((function(e){var t;let{block:{__unstableBlockSource:n},mode:o,isLocked:l,canRemove:i,clientId:s,isSelected:d,isSelectionEnabled:p,className:f,name:g,isValid:h,attributes:v,wrapperProps:b,setAttributes:k,onReplace:_,onInsertBlocksAfter:y,onMerge:E,toggleSelection:C}=e;const w=(0,m.useSelect)((e=>{const{getSettings:t}=e(qn);return t().supportsLayout}),[]),{removeBlock:S}=(0,m.useDispatch)(qn),B=(0,a.useCallback)((()=>S(s)),[s]);let I=(0,a.createElement)(ll,{name:g,isSelected:d,attributes:v,setAttributes:k,insertBlocksAfter:l?void 0:y,onReplace:i?_:void 0,onRemove:i?B:void 0,mergeBlocks:i?E:void 0,clientId:s,isSelectionEnabled:p,toggleSelection:C});const x=(0,r.getBlockType)(g);null!=x&&x.getEditWrapperProps&&(b=function(e,t){const n={...e,...t};return e&&t&&e.className&&t.className&&(n.className=c()(e.className,t.className)),e&&t&&e.style&&t.style&&(n.style={...e.style,...t.style}),n}(b,x.getEditWrapperProps(v)));const T=b&&!!b["data-align"]&&!w;let N;if(T&&(I=(0,a.createElement)("div",{className:"wp-block","data-align":b["data-align"]},I)),h)N="html"===o?(0,a.createElement)(a.Fragment,null,(0,a.createElement)("div",{style:{display:"none"}},I),(0,a.createElement)(Ac,{isHtml:!0},(0,a.createElement)(bl,{clientId:s}))):(null==x?void 0:x.apiVersion)>1?I:(0,a.createElement)(Ac,b,I);else{const e=n?(0,r.serializeRawBlock)(n):(0,r.getSaveContent)(x,v);N=(0,a.createElement)(Ac,{className:"has-warning"},(0,a.createElement)(pl,{clientId:s}),(0,a.createElement)(a.RawHTML,null,(0,Jr.safeHTML)(e)))}const P={clientId:s,className:null!==(t=b)&&void 0!==t&&t["data-align"]&&w?c()(f,`align${b["data-align"]}`):f,wrapperProps:(0,u.omit)(b,["data-align"]),isAligned:T},M=(0,a.useMemo)((()=>P),Object.values(P));return(0,a.createElement)(Lc.Provider,{value:M},(0,a.createElement)(hl,{fallback:(0,a.createElement)(Ac,{className:"has-warning"},(0,a.createElement)(fl,null))},N))})),zc=window.wp.htmlEntities;var Vc=(0,a.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(O.Path,{d:"M18 11.2h-5.2V6h-1.6v5.2H6v1.6h5.2V18h1.6v-5.2H18z"}));const Hc=[(0,a.createInterpolateElement)((0,g.__)("While writing, you can press / to quickly insert new blocks."),{kbd:(0,a.createElement)("kbd",null)}),(0,a.createInterpolateElement)((0,g.__)("Indent a list by pressing space at the beginning of a line."),{kbd:(0,a.createElement)("kbd",null)}),(0,a.createInterpolateElement)((0,g.__)("Outdent a list by pressing backspace 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 Gc=function(){const[e]=(0,a.useState)(Math.floor(Math.random()*Hc.length));return(0,a.createElement)(p.Tip,null,Hc[e])};var Uc=(0,a.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(O.Path,{d:"M19 8h-1V6h-5v2h-2V6H6v2H5c-1.1 0-2 .9-2 2v8c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-8c0-1.1-.9-2-2-2zm.5 10c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5v-8c0-.3.2-.5.5-.5h14c.3 0 .5.2.5.5v8z"}));var Wc=(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:Uc});const l=(0,a.createElement)(p.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 $c=function(e){let{title:t,icon:n,description:o,blockType:r}=e;return r&&(Vt()("`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)(Wc,{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)))};function jc(e){let{clientId:t=null,value:n,selection:o,onChange:l=u.noop,onInput:i=u.noop}=e;const s=(0,m.useRegistry)(),{resetBlocks:c,resetSelection:d,replaceInnerBlocks:p,setHasControlledInnerBlocks:f,__unstableMarkNextChangeAsNotPersistent:g}=s.dispatch(qn),{getBlockName:h,getBlocks:v}=s.select(qn),b=(0,m.useSelect)((e=>!t||e(qn).areInnerBlocksControlled(t)),[t]),k=(0,a.useRef)({incoming:null,outgoing:[]}),_=(0,a.useRef)(!1),y=()=>{n&&(g(),t?s.batch((()=>{f(t,!0);const e=n.map((e=>(0,r.cloneBlock)(e)));_.current&&(k.current.incoming=e),g(),p(t,e)})):(_.current&&(k.current.incoming=n),c(n)))},E=(0,a.useRef)(i),C=(0,a.useRef)(l);(0,a.useEffect)((()=>{E.current=i,C.current=l}),[i,l]),(0,a.useEffect)((()=>{k.current.outgoing.includes(n)?(0,u.last)(k.current.outgoing)===n&&(k.current.outgoing=[]):v(t)!==n&&(k.current.outgoing=[],y(),o&&d(o.selectionStart,o.selectionEnd,o.initialPosition))}),[n,t]),(0,a.useEffect)((()=>{b||(k.current.outgoing=[],y())}),[b]),(0,a.useEffect)((()=>{const{getSelectionStart:e,getSelectionEnd:n,getSelectedBlocksInitialCaretPosition:o,isLastBlockChangePersistent:r,__unstableIsLastBlockChangeIgnored:l,areInnerBlocksControlled:i}=s.select(qn);let a=v(t),c=r(),u=!1;_.current=!0;const d=s.subscribe((()=>{if(null!==t&&null===h(t))return;if(!(!t||i(t)))return;const s=r(),d=v(t),p=d!==a;if(a=d,p&&(k.current.incoming||l()))return k.current.incoming=null,void(c=s);if(p||u&&!p&&s&&!c){c=s,k.current.outgoing.push(a);(c?C.current:E.current)(a,{selection:{selectionStart:e(),selectionEnd:n(),initialPosition:o()}})}u=p}));return()=>d()}),[s,t])}var Kc=(0,d.createHigherOrderComponent)((e=>(0,m.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,m.createRegistry)({},o);e.registerStore(jn,Kn),s(e)}),[o]),l?(0,a.createElement)(m.RegistryProvider,{value:l},(0,a.createElement)(e,i({registry:l},r))):null}))),"withRegistryProvider")((function(e){const{children:t,settings:n}=e,{updateSettings:o}=(0,m.useDispatch)(qn);return(0,a.useEffect)((()=>{o(n)}),[n]),jc(e),(0,a.createElement)(_o,null,t)}));function qc(e){let{onClick:t}=e;return(0,a.createElement)("div",{tabIndex:0,role:"button",onClick:t,onKeyPress:t},(0,a.createElement)(p.Disabled,null,(0,a.createElement)(Wf,null)))}function Yc(){const{hasSelectedBlock:e,hasMultiSelection:t}=(0,m.useSelect)(qn),{clearSelectedBlock:n}=(0,m.useDispatch)(qn);return(0,d.useRefEffect)((o=>{function r(r){(e()||t())&&r.target===o&&n()}return o.addEventListener("mousedown",r),()=>{o.removeEventListener("mousedown",r)}}),[e,t,n])}function Qc(e){return(0,a.createElement)("div",i({ref:Yc()},e))}function Xc(e){const{isMultiSelecting:t,getMultiSelectedBlockClientIds:n,hasMultiSelection:o,getSelectedBlockClientId:r,getSelectedBlocksInitialCaretPosition:l,__unstableIsFullySelected:i}=e(qn);return{isMultiSelecting:t(),multiSelectedBlockClientIds:n(),hasMultiSelection:o(),selectedBlockClientId:r(),initialPosition:l(),isFullSelection:i()}}function Zc(){const{initialPosition:e,isMultiSelecting:t,multiSelectedBlockClientIds:n,hasMultiSelection:o,selectedBlockClientId:r,isFullSelection:l}=(0,m.useSelect)(Xc,[]),i=Eo(r),a=Eo((0,u.first)(n)),s=Eo((0,u.last)(n));return(0,d.useRefEffect)((c=>{const{ownerDocument:u}=c,{defaultView:d}=u;if(null==e)return;if(!o||t){if(!r||t)return;const e=d.getSelection();if(e.rangeCount&&!e.isCollapsed){const t=i.current,{startContainer:n,endContainer:o}=e.getRangeAt(0);!t||t.contains(n)&&t.contains(o)||e.removeAllRanges()}return}const{length:p}=n;if(p<2)return;if(!l)return;if(c.contentEditable=!0,c.focus(),!a.current||!s.current)return;const m=d.getSelection(),f=u.createRange();f.setStartBefore(a.current),f.setEndAfter(s.current),m.removeAllRanges(),m.addRange(f)}),[o,t,n,r,e,l])}function Jc(e,t,n,o){let r,l=Jr.focus.focusable.find(n);return t&&(l=(0,u.reverse)(l)),l=l.slice(l.indexOf(e)+1),o&&(r=e.getBoundingClientRect()),(0,u.find)(l,(function(e){if(!Jr.focus.tabbable.isTabbableIndex(e))return!1;if(e.isContentEditable&&"true"!==e.contentEditable)return!1;if(o){const t=e.getBoundingClientRect();if(t.left>=r.right||t.right<=r.left)return!1}return!0}))}function eu(){const{getSelectedBlockClientId:e,getMultiSelectedBlocksEndClientId:t,getPreviousBlockClientId:n,getNextBlockClientId:o,getSettings:r,hasMultiSelection:l}=(0,m.useSelect)(qn);return(0,d.useRefEffect)((i=>{let a;function s(){a=null}function c(e,t){const n=Jc(e,t,i);return!n||!function(e,t){return e.closest(hc)===t.closest(hc)}(e,n)}function u(s){const{keyCode:u,target:d}=s,p=u===Tc.UP,m=u===Tc.DOWN,f=u===Tc.LEFT,g=u===Tc.RIGHT,h=p||f,v=f||g,b=p||m,k=v||b,_=s.shiftKey,y=_||s.ctrlKey||s.altKey||s.metaKey,E=b?Jr.isVerticalEdge:Jr.isHorizontalEdge,{ownerDocument:C}=i,{defaultView:w}=C;if(l())return;if(b?a||(a=(0,Jr.computeCaretRect)(w)):a=null,s.defaultPrevented)return;if(!k)return;if(!function(e,t,n){if((t===Tc.UP||t===Tc.DOWN)&&!n)return!0;const{tagName:o}=e;return"INPUT"!==o&&"TEXTAREA"!==o}(d,u,y))return;const S=(0,Jr.isRTL)(d)?!h:h,{keepCaretInsideBlock:B}=r(),I=e();if(_){const e=t(),r=n(e||I),l=o(e||I);(h&&r||!h&&l)&&c(d,h)&&E(d,h)&&(i.contentEditable=!0,i.focus())}else if(b&&(0,Jr.isVerticalEdge)(d,h)&&!B){const e=Jc(d,h,i,!0);e&&((0,Jr.placeCaretAtVerticalEdge)(e,h,a),s.preventDefault())}else if(v&&w.getSelection().isCollapsed&&(0,Jr.isHorizontalEdge)(d,S)&&!B){const e=Jc(d,S,i);(0,Jr.placeCaretAtHorizontalEdge)(e,h),s.preventDefault()}}return i.addEventListener("mousedown",s),i.addEventListener("keydown",u),()=>{i.removeEventListener("mousedown",s),i.removeEventListener("keydown",u)}}),[])}var tu=window.wp.keyboardShortcuts;function nu(){const{getBlockOrder:e,getSelectedBlockClientIds:t,getBlockRootClientId:n}=(0,m.useSelect)(qn),{multiSelect:o}=(0,m.useDispatch)(qn),r=(0,tu.__unstableUseShortcutEventMatch)();return(0,d.useRefEffect)((l=>{function i(l){if(!r("core/block-editor/select-all",l))return;const i=t();if(i.length<2&&!(0,Jr.isEntirelySelected)(l.target))return;const[a]=i,s=n(a);let c=e(s);i.length===c.length&&(c=e(n(s)));const d=(0,u.first)(c),p=(0,u.last)(c);d!==p&&(o(d,p),l.preventDefault())}return l.addEventListener("keydown",i),()=>{l.removeEventListener("keydown",i)}}),[])}function ou(e,t){e.contentEditable=t,t&&e.focus()}function ru(){const{startMultiSelect:e,stopMultiSelect:t}=(0,m.useDispatch)(qn),{isSelectionEnabled:n,hasMultiSelection:o}=(0,m.useSelect)(qn);return(0,d.useRefEffect)((r=>{const{ownerDocument:l}=r,{defaultView:i}=l;let a,s;function c(){t(),i.removeEventListener("mouseup",c),s=i.requestAnimationFrame((()=>{if(o())return;ou(r,!1);const e=i.getSelection();if(e.rangeCount){const{commonAncestorContainer:t}=e.getRangeAt(0);a.contains(t)&&a.focus()}}))}function u(t){let{buttons:o,target:s}=t;1===o&&s.getAttribute("contenteditable")&&n()&&(a=l.activeElement,e(),i.addEventListener("mouseup",c),ou(r,!0))}return r.addEventListener("mouseout",u),()=>{r.removeEventListener("mouseout",u),i.removeEventListener("mouseup",c),i.cancelAnimationFrame(s)}}),[e,t,n,o])}function lu(e,t){e.contentEditable=t,t&&e.focus()}function iu(){const{multiSelect:e,selectBlock:t,selectionChange:n}=(0,m.useDispatch)(qn),{getBlockParents:o,getBlockSelectionStart:r}=(0,m.useSelect)(qn);return(0,d.useRefEffect)((n=>{const{ownerDocument:l}=n,{defaultView:i}=l;function a(l){const a=i.getSelection();if(!a.rangeCount)return void lu(n,!1);const s=l.shiftKey&&"mouseup"===l.type;if(a.isCollapsed&&!s)return void lu(n,!1);let c=_c(function(e){const{anchorNode:t,anchorOffset:n}=e;return t.nodeType===t.TEXT_NODE?t:t.childNodes[n]}(a)),u=_c(function(e){const{focusNode:t,focusOffset:n}=e;return t.nodeType===t.TEXT_NODE?t:t.childNodes[n-1]}(a));if(s){const e=r(),t=_c(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 lu(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 au(){const{selectBlock:e}=(0,m.useDispatch)(qn),{isSelectionEnabled:t,getBlockSelectionStart:n,hasMultiSelection:o}=(0,m.useSelect)(qn);return(0,d.useRefEffect)((r=>{function l(l){if(!t()||0!==l.button)return;const i=n(),a=_c(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 su(){const{__unstableIsFullySelected:e,getSelectedBlockClientIds:t,__unstableIsSelectionMergeable:n,hasMultiSelection:o}=(0,m.useSelect)(qn),{replaceBlocks:l,__unstableSplitSelection:i,removeBlocks:a,__unstableDeleteSelection:s,__unstableExpandSelection:c}=(0,m.useDispatch)(qn);return(0,d.useRefEffect)((u=>{function d(d){d.defaultPrevented||o()&&(d.keyCode===Tc.ENTER?(u.contentEditable=!1,d.preventDefault(),e()?l(t(),(0,r.createBlock)((0,r.getDefaultBlockName)())):i()):d.keyCode===Tc.BACKSPACE||d.keyCode===Tc.DELETE?(u.contentEditable=!1,d.preventDefault(),e()?a(t()):n()?s(d.keyCode===Tc.DELETE):c()):1!==d.key.length||d.metaKey||d.ctrlKey||(u.contentEditable=!1,n()?s(d.keyCode===Tc.DELETE):(d.preventDefault(),u.ownerDocument.defaultView.getSelection().removeAllRanges())))}function p(e){o()&&(u.contentEditable=!1,n()?s():(e.preventDefault(),u.ownerDocument.defaultView.getSelection().removeAllRanges()))}return u.addEventListener("keydown",d),u.addEventListener("compositionstart",p),()=>{u.removeEventListener("keydown",d),u.removeEventListener("compositionstart",p)}}),[])}function cu(){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,m.useSelect)(qn),{setNavigationMode:s}=(0,m.useDispatch)(qn),c=(0,m.useSelect)((e=>e(qn).isNavigationMode()),[])?void 0:"0",u=(0,a.useRef)();function p(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";Jr.focus.tabbable[n](t.target).focus()}}const f=(0,a.createElement)("div",{ref:t,tabIndex:c,onFocus:p}),g=(0,a.createElement)("div",{ref:n,tabIndex:c,onFocus:p}),h=(0,d.useRefEffect)((a=>{function c(e){if(e.defaultPrevented)return;if(e.keyCode===Tc.ESCAPE&&!r())return e.preventDefault(),void s(!0);if(e.keyCode!==Tc.TAB)return;const o=e.shiftKey,i=o?"findPrevious":"findNext";if(!r()&&!l())return void(e.target===a&&s(!0));if(((0,Jr.isFormElement)(e.target)||e.target.getAttribute("data-block")===l())&&(0,Jr.isFormElement)(Jr.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!==Tc.TAB)return;if("region"===(null===(r=o.target)||void 0===r?void 0:r.getAttribute("role")))return;if(e.current===o.target)return;const l=o.shiftKey?"findPrevious":"findNext",i=Jr.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,m.useSelect)((e=>e(qn).hasMultiSelection()),[]);return[e,(0,d.useMergeRefs)([t,su(),ru(),iu(),au(),Zc(),nu(),eu(),(0,d.useRefEffect)((e=>{if(e.tabIndex=-1,e.contentEditable=o,o)return e.setAttribute("aria-label",(0,g.__)("Multiple selected blocks")),()=>{e.removeAttribute("aria-label")}}),[o])]),n]}var uu=(0,a.forwardRef)((function(e,t){let{children:n,...o}=e;const[r,l,s]=cu();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 du="editor-styles-wrapper";function pu(e){return(0,a.useMemo)((()=>{const t=document.implementation.createHTMLDocument("");return t.body.innerHTML=e,Array.from(t.body.children)}),[e])}var mu=(0,a.forwardRef)((function(e,t){let{contentRef:n,children:o,head:r,tabIndex:l=0,assets:s,...u}=e;const[,m]=(0,a.useReducer)((()=>({}))),[f,h]=(0,a.useState)(),[v,b]=(0,a.useState)([]),k=pu(null==s?void 0:s.styles),_=pu(null==s?void 0:s.scripts),y=Yc(),[E,C,w]=cu(),S=(0,d.useRefEffect)((e=>{function t(){const{contentDocument:t,ownerDocument:n}=e,{readyState:o,documentElement:r}=t;return("interactive"===o||"complete"===o)&&(function(e){const{defaultView:t}=e,{frameElement:n}=t;function o(e){const o=Object.getPrototypeOf(e).constructor.name,r=window[o],l={};for(const t in e)l[t]=e[t];if(e instanceof t.MouseEvent){const e=n.getBoundingClientRect();l.clientX+=e.left,l.clientY+=e.top}const i=new r(e.type,l);!n.dispatchEvent(i)&&e.preventDefault()}const r=["dragover"];for(const t of r)e.addEventListener(t,o)}(t),h(t),y(r),b(Array.from(n.body.classList).filter((e=>e.startsWith("admin-color-")||e.startsWith("post-type-")||"wp-embed-responsive"===e))),t.dir=n.dir,r.removeChild(t.head),r.removeChild(t.body),!0)}return e.addEventListener("load",t),()=>e.removeEventListener("load",t)}),[]),B=(0,d.useRefEffect)((e=>{_.reduce(((t,n)=>t.then((()=>async function(e,t){let{id:n,src:o}=t;return new Promise(((t,r)=>{const l=e.ownerDocument.createElement("script");l.id=n,o?(l.src=o,l.onload=()=>t(),l.onerror=()=>r()):t(),e.appendChild(l)}))}(e,n)))),Promise.resolve()).finally((()=>{m()}))}),[]),I=(0,d.useMergeRefs)([n,y,C]),x=(0,d.useRefEffect)((e=>{Array.from(document.styleSheets).forEach((t=>{try{t.cssRules}catch(e){return}const{ownerNode:n,cssRules:o}=t;if(o&&"LINK"===n.tagName&&"wp-reset-editor-styles-css"!==n.id&&Array.from(o).find((e=>{let{selectorText:t}=e;return t&&(t.includes(`.${du}`)||t.includes(".wp-block"))}))&&!e.ownerDocument.getElementById(n.id)){e.appendChild(n.cloneNode(!0));const t=n.id.replace("-css","-inline-css"),o=document.getElementById(t);o&&e.appendChild(o.cloneNode(!0))}}))}),[]);return r=(0,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&&E,(0,a.createElement)(__playground_ControlledIframe,i({},u,{ref:(0,d.useMergeRefs)([t,S]),tabIndex:l,srcDoc:"",title:(0,g.__)("Editor canvas")}),f&&(0,a.createPortal)((0,a.createElement)(a.Fragment,null,(0,a.createElement)("head",{ref:B},r),(0,a.createElement)("body",{ref:I,className:c()(du,...v)},(0,a.createElement)("div",{style:{display:"none"},ref:x}),(0,a.createElement)(p.__experimentalStyleProvider,{document:f},o))),f.documentElement)),l>=0&&w)})),fu={grad:.9,turn:360,rad:360/(2*Math.PI)},gu=function(e){return"string"==typeof e?e.length>0:"number"==typeof e},hu=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=Math.pow(10,t)),Math.round(n*e)/n+0},vu=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=1),e>n?n:e>t?e:t},bu=function(e){return(e=isFinite(e)?e%360:0)>0?e:e+360},ku=function(e){return{r:vu(e.r,0,255),g:vu(e.g,0,255),b:vu(e.b,0,255),a:vu(e.a)}},_u=function(e){return{r:hu(e.r),g:hu(e.g),b:hu(e.b),a:hu(e.a,3)}},yu=/^#([0-9a-f]{3,8})$/i,Eu=function(e){var t=e.toString(16);return t.length<2?"0"+t:t},Cu=function(e){var t=e.r,n=e.g,o=e.b,r=e.a,l=Math.max(t,n,o),i=l-Math.min(t,n,o),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}},wu=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}},Su=function(e){return{h:bu(e.h),s:vu(e.s,0,100),l:vu(e.l,0,100),a:vu(e.a)}},Bu=function(e){return{h:hu(e.h),s:hu(e.s),l:hu(e.l),a:hu(e.a,3)}},Iu=function(e){return wu((n=(t=e).s,{h:t.h,s:(n*=((o=t.l)<50?o:100-o)/100)>0?2*n/(o+n)*100:0,v:o+n,a:t.a}));var t,n,o},xu=function(e){return{h:(t=Cu(e)).h,s:(r=(200-(n=t.s))*(o=t.v)/100)>0&&r<200?n*o/100/(r<=100?r:200-r)*100:0,l:r/2,a:t.a};var t,n,o,r},Tu=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Nu=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Pu=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Mu=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Ru={string:[[function(e){var t=yu.exec(e);return t?(e=t[1]).length<=4?{r:parseInt(e[0]+e[0],16),g:parseInt(e[1]+e[1],16),b:parseInt(e[2]+e[2],16),a:4===e.length?hu(parseInt(e[3]+e[3],16)/255,2):1}:6===e.length||8===e.length?{r:parseInt(e.substr(0,2),16),g:parseInt(e.substr(2,2),16),b:parseInt(e.substr(4,2),16),a:8===e.length?hu(parseInt(e.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(e){var t=Pu.exec(e)||Mu.exec(e);return t?t[2]!==t[4]||t[4]!==t[6]?null:ku({r:Number(t[1])/(t[2]?100/255:1),g:Number(t[3])/(t[4]?100/255:1),b:Number(t[5])/(t[6]?100/255:1),a:void 0===t[7]?1:Number(t[7])/(t[8]?100:1)}):null},"rgb"],[function(e){var t=Tu.exec(e)||Nu.exec(e);if(!t)return null;var n,o,r=Su({h:(n=t[1],o=t[2],void 0===o&&(o="deg"),Number(n)*(fu[o]||1)),s:Number(t[3]),l:Number(t[4]),a:void 0===t[5]?1:Number(t[5])/(t[6]?100:1)});return Iu(r)},"hsl"]],object:[[function(e){var t=e.r,n=e.g,o=e.b,r=e.a,l=void 0===r?1:r;return gu(t)&&gu(n)&&gu(o)?ku({r:Number(t),g:Number(n),b:Number(o),a:Number(l)}):null},"rgb"],[function(e){var t=e.h,n=e.s,o=e.l,r=e.a,l=void 0===r?1:r;if(!gu(t)||!gu(n)||!gu(o))return null;var i=Su({h:Number(t),s:Number(n),l:Number(o),a:Number(l)});return Iu(i)},"hsl"],[function(e){var t=e.h,n=e.s,o=e.v,r=e.a,l=void 0===r?1:r;if(!gu(t)||!gu(n)||!gu(o))return null;var i=function(e){return{h:bu(e.h),s:vu(e.s,0,100),v:vu(e.v,0,100),a:vu(e.a)}}({h:Number(t),s:Number(n),v:Number(o),a:Number(l)});return wu(i)},"hsv"]]},Lu=function(e,t){for(var n=0;n=.5},e.prototype.toHex=function(){return t=(e=_u(this.rgba)).r,n=e.g,o=e.b,l=(r=e.a)<1?Eu(hu(255*r)):"","#"+Eu(t)+Eu(n)+Eu(o)+l;var e,t,n,o,r,l},e.prototype.toRgb=function(){return _u(this.rgba)},e.prototype.toRgbString=function(){return t=(e=_u(this.rgba)).r,n=e.g,o=e.b,(r=e.a)<1?"rgba("+t+", "+n+", "+o+", "+r+")":"rgb("+t+", "+n+", "+o+")";var e,t,n,o,r},e.prototype.toHsl=function(){return Bu(xu(this.rgba))},e.prototype.toHslString=function(){return t=(e=Bu(xu(this.rgba))).h,n=e.s,o=e.l,(r=e.a)<1?"hsla("+t+", "+n+"%, "+o+"%, "+r+")":"hsl("+t+", "+n+"%, "+o+"%)";var e,t,n,o,r},e.prototype.toHsv=function(){return e=Cu(this.rgba),{h:hu(e.h),s:hu(e.s),v:hu(e.v),a:hu(e.a,3)};var e},e.prototype.invert=function(){return Vu({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),Vu(Du(this.rgba,e))},e.prototype.desaturate=function(e){return void 0===e&&(e=.1),Vu(Du(this.rgba,-e))},e.prototype.grayscale=function(){return Vu(Du(this.rgba,-1))},e.prototype.lighten=function(e){return void 0===e&&(e=.1),Vu(Fu(this.rgba,e))},e.prototype.darken=function(e){return void 0===e&&(e=.1),Vu(Fu(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?Vu({r:(t=this.rgba).r,g:t.g,b:t.b,a:e}):hu(this.rgba.a,3);var t},e.prototype.hue=function(e){var t=xu(this.rgba);return"number"==typeof e?Vu({h:e,s:t.s,l:t.l,a:t.a}):hu(t.h)},e.prototype.isEqual=function(e){return this.toHex()===Vu(e).toHex()},e}(),Vu=function(e){return e instanceof zu?e:new zu(e)},Hu=[],Gu=function(e){e.forEach((function(e){Hu.indexOf(e)<0&&(e(zu,Ru),Hu.push(e))}))};function Uu(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(s=$u(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 Ku=n(3124),qu=n.n(Ku);const Yu=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;function Qu(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 Xu(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=Xu(t[0]),!p(/^:\s*/))return s("property missing ':'");const n=p(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^\)]*?\)|[^};])+)/),o=e({type:"declaration",property:t.replace(Yu,""),value:n?Xu(n[0]).replace(Yu,""):""});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 k(){let e;const t=[],n=l();for(;e=p(/^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/);)t.push(e[1]),p(/^,\s*/);if(t.length)return n({type:"keyframe",values:t,declarations:b()})}const _=C("import"),y=C("charset"),E=C("namespace");function C(e){const t=new RegExp("^@"+e+"\\s*([^;]+);");return function(){const n=l(),o=p(t);if(!o)return;const r={type:e};return r[e]=o[1].trim(),n(r)}}function 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=k();)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=Xu(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:Xu(t[1]),media:Xu(t[2])})}()||function(){const e=l(),t=p(/^@supports *([^{]+)/);if(!t)return;const n=Xu(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 '}'")}()||_()||y()||E()||function(){const e=l(),t=p(/^@([-\w]+)?document *([^{]+)/);if(!t)return;const n=Xu(t[1]),o=Xu(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 Zu(function(){const e=d();return{type:"stylesheet",stylesheet:{source:t.source,rules:e,parsingErrors:a}}}())}function Xu(e){return e?e.replace(/^\s+|\s+$/g,""):""}function Zu(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){Zu(e,o)})):n&&"object"==typeof n&&Zu(n,o)}return n&&Object.defineProperty(e,"parent",{configurable:!0,writable:!0,enumerable:!1,value:t||null}),e}var Ju=n(8575),ed=n.n(Ju),td=nd;function nd(e){this.options=e||{}}nd.prototype.emit=function(e){return e},nd.prototype.visit=function(e){return this[e.type](e)},nd.prototype.mapVisit=function(e,t){let n="";t=t||"";for(let o=0,r=e.length;ot=>{if("declaration"===t.type){const l=function(e){const t=/url\((\s*)(['"]?)(.+?)\2(\s*)\)/g;let n;const o=[];for(;null!==(n=t.exec(e));){const e={source:n[0],before:n[1],quote:n[2],value:n[3],after:n[4]};sd(e)&&o.push(e)}return o}(t.value).map((r=e,e=>({...e,newUrl:"url("+e.before+e.quote+cd(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 dd=/^(body|html|:root).*$/;var pd=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(dd)?n.replace(/^(body|html|:root)/,e):e+" "+n;return"rule"===n.type?{...n,selectors:n.selectors.map(o)}:n}};var md=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(pd(t)),o&&r.push(ud(o)),r.length?ad(n,(0,d.compose)(r)):n}))};const fd=".editor-styles-wrapper";function gd(e){return(0,a.useCallback)((e=>{if(!e)return;const{ownerDocument:t}=e,{defaultView:n,body:o}=t,r=t.querySelector(fd);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=Vu(l);i.luminance()>.5||0===i.alpha()?o.classList.remove("is-dark-theme"):o.classList.add("is-dark-theme")}),[e])}function hd(e){let{styles:t}=e;const n=(0,a.useMemo)((()=>md(t,fd)),[t]);return(0,a.createElement)(a.Fragment,null,(0,a.createElement)("style",{ref:gd(t)}),n.map(((e,t)=>(0,a.createElement)("style",{key:t},e))))}let vd;Gu([Uu,ju]);const bd=2e3;var kd=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}=(0,m.useSelect)((e=>{const t=e(qn).getSettings();return{styles:t.styles,assets:t.__unstableResolvedAssets}}),[]),f=(0,a.useMemo)((()=>c?[...c,{css:"body{height:auto;overflow:hidden;}",__unstableType:"presets"}]:c),[c]);vd=vd||(0,d.pure)(Wf);const g=l/t;return(0,a.createElement)("div",{className:"block-editor-block-preview__container"},r,(0,a.createElement)(p.Disabled,{className:"block-editor-block-preview__content",style:{transform:`scale(${g})`,height:s*g,maxHeight:s>bd?bd*g:void 0,minHeight:o}},(0,a.createElement)(mu,{head:(0,a.createElement)(hd,{styles:f}),assets:u,contentRef:(0,d.useRefEffect)((e=>{const{ownerDocument:{documentElement:t}}=e;t.classList.add("block-editor-block-preview__content-iframe"),t.style.position="absolute",t.style.width="100%",e.style.padding=n+"px",e.style.position="relative"}),[]),"aria-hidden":!0,tabIndex:-1,style:{position:"absolute",width:t,height:s,pointerEvents:"none",maxHeight:bd,minHeight:g<1&&o?o/g:o}},i,(0,a.createElement)(vd,{renderAppender:!1}))))};var _d=(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,m.useSelect)((e=>e(qn).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)(Kc,{value:d,settings:c},r?(0,a.createElement)(qc,{onClick:l}):(0,a.createElement)(kd,{viewportWidth:o,__experimentalPadding:n,__experimentalMinHeight:i})):null}));function yd(e){let{blocks:t,props:n={},__experimentalLayout:o}=e;const r=(0,m.useSelect)((e=>e(qn).getSettings()),[]),l=(0,d.__experimentalUseDisabled)(),i=(0,d.useMergeRefs)([n.ref,l]),s=(0,a.useMemo)((()=>({...r,__experimentalBlockPatterns:[]})),[r]),p=(0,a.useMemo)((()=>(0,u.castArray)(t)),[t]),f=(0,a.createElement)(Kc,{value:p,settings:s},(0,a.createElement)(jf,{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 Ed=function(e){var t,n;let{item:o}=e;const{name:l,title:i,icon:s,description:c,initialAttributes:u}=o,d=(0,r.getBlockType)(l),p=(0,r.isReusableBlock)(o);return(0,a.createElement)("div",{className:"block-editor-inserter__preview-container"},(0,a.createElement)("div",{className:"block-editor-inserter__preview"},p||null!=d&&d.example?(0,a.createElement)("div",{className:"block-editor-inserter__preview-content"},(0,a.createElement)(_d,{__experimentalPadding:16,viewportWidth:null!==(t=null===(n=d.example)||void 0===n?void 0:n.viewportWidth)&&void 0!==t?t:500,blocks:d.example?(0,r.getBlockFromExample)(o.name,{attributes:{...d.example.attributes,...u},innerBlocks:d.example.innerBlocks}):(0,r.createBlock)(l,u)})):(0,a.createElement)("div",{className:"block-editor-inserter__preview-content-missing"},(0,g.__)("No Preview Available."))),!p&&(0,a.createElement)($c,{title:i,icon:s,description:c}))};var Cd=(0,a.createContext)();var wd=(0,a.forwardRef)((function(e,t){let{isFirst:n,as:o,children:r,...l}=e;const s=(0,a.useContext)(Cd);return(0,a.createElement)(p.__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)(p.Button,t,r)}))}));var Sd=(0,a.createElement)(O.SVG,{width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(O.Path,{d:"M8 7h2V5H8v2zm0 6h2v-2H8v2zm0 6h2v-2H8v2zm6-14v2h2V5h-2zm0 8h2v-2h-2v2zm0 6h2v-2h-2v2z"}));function Bd(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"},(0,a.createElement)(p.Flex,{justify:"center",className:"block-editor-block-draggable-chip__content"},(0,a.createElement)(p.FlexItem,null,n?(0,a.createElement)(Wc,{icon:n}):(0,g.sprintf)((0,g._n)("%d block","%d blocks",t),t)),(0,a.createElement)(p.FlexItem,null,(0,a.createElement)(Wc,{icon:Sd})))))}var Id=e=>{let{isEnabled:t,blocks:n,icon:o,children:r}=e;const l={type:"inserter",blocks:n};return(0,a.createElement)(p.Draggable,{__experimentalTransferDataType:"wp-blocks",transferData:l,__experimentalDragComponent:(0,a.createElement)(Bd,{count:n.length,icon:o})},(e=>{let{onDraggableStart:n,onDraggableEnd:o}=e;return r({draggable:t,onDragStart:t?n:void 0,onDragEnd:t?o:void 0})}))};function xd(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window;const{platform:t}=e.navigator;return-1!==t.indexOf("Mac")||["iPad","iPhone"].includes(t)}var Td=(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),m=o.icon?{backgroundColor:o.icon.background,color:o.icon.foreground}:{},f=(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)(Id,{isEnabled:u&&!o.disabled,blocks:f,icon:o.icon},(e=>{let{draggable:r,onDragStart:u,onDragEnd:f}=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,f&&f(e)}},(0,a.createElement)(wd,i({isFirst:n,className:c()("block-editor-block-types-list__item",t),disabled:o.isDisabled,onClick:e=>{e.preventDefault(),l(o,xd()?e.metaKey:e.ctrlKey),s(null)},onKeyDown:e=>{const{keyCode:t}=e;t===Tc.ENTER&&(e.preventDefault(),l(o,xd()?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:m},(0,a.createElement)(Wc,{icon:o.icon,showColors:!0})),(0,a.createElement)("span",{className:"block-editor-block-types-list__item-title"},o.title)))}))}));var Nd=(0,a.forwardRef)((function(e,t){const[n,o]=(0,a.useState)(!1);return(0,a.useEffect)((()=>{n&&(0,Ft.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 Pd=(0,a.forwardRef)((function(e,t){const n=(0,a.useContext)(Cd);return(0,a.createElement)(p.__unstableCompositeGroup,i({state:n,role:"presentation",ref:t},e))}));var Md=function(e){let{items:t=[],onSelect:n,onHover:o=(()=>{}),children:l,label:i,isDraggable:s=!0}=e;return(0,a.createElement)(Nd,{className:"block-editor-block-types-list","aria-label":i},function(e,t){const n=[];for(let o=0,r=e.length;o(0,a.createElement)(Pd,{key:t},e.map(((e,l)=>(0,a.createElement)(Td,{key:e.id,item:e,className:(0,r.getBlockMenuDefaultClassName)(e.id),onSelect:n,onHover:o,isDraggable:s,isFirst:0===t&&0===l})))))),l)};var Rd=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)(p.Icon,{icon:n})),(0,a.createElement)("div",{className:"block-editor-inserter__panel-content"},o))};var Ld=(e,t)=>{const{categories:n,collections:o,items:l}=(0,m.useSelect)((t=>{const{getInserterItems:n}=t(qn),{getCategories:o,getCollections:l}=t(r.store);return{categories:o(),collections:l(),items:n(e)}}),[e]);return[l,n,o,(0,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 Ad=function(e){let{children:t}=e;const n=(0,p.__unstableUseCompositeState)({shift:!0,wrap:"horizontal"});return(0,a.createElement)(Cd.Provider,{value:n},t)};const Dd=[];var Od=function(e){let{rootClientId:t,onInsert:n,onHover:o,showMostUsedBlocks:r}=e;const[l,i,s,c]=Ld(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,k=(0,a.useMemo)((()=>Object.entries(s)),[s]),_=(0,d.useAsyncList)(b?k:Dd);return(0,a.createElement)(Ad,null,(0,a.createElement)("div",null,r&&!!p.length&&(0,a.createElement)(Rd,{title:(0,g._x)("Most used","blocks")},(0,a.createElement)(Md,{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)(Rd,{key:e.slug,title:e.title,icon:e.icon},(0,a.createElement)(Md,{items:t,onSelect:c,onHover:o,label:e.title})):null})),b&&m.length>0&&(0,a.createElement)(Rd,{className:"block-editor-inserter__uncategorized-blocks-panel",title:(0,g.__)("Uncategorized")},(0,a.createElement)(Md,{items:m,onSelect:c,onHover:o,label:(0,g.__)("Uncategorized")})),(0,u.map)(_,(e=>{let[t,n]=e;const r=h[t];return r&&r.length?(0,a.createElement)(Rd,{key:t,title:n.title,icon:n.icon},(0,a.createElement)(Md,{items:r,onSelect:c,onHover:o,label:n.title})):null}))))};var Fd=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)(p.Flex,{justify:"space-between",align:"start",gap:"4",className:i},(0,a.createElement)(p.FlexItem,{isBlock:!0},(0,a.createElement)(p.SelectControl,{className:"block-editor-inserter__panel-dropdown",label:(0,g.__)("Filter patterns"),hideLabelFromVision:!0,value:t.name,onChange:e=>{o(n.find((t=>e===t.name)))},onBlur:e=>{null!=e&&e.relatedTarget||e.stopPropagation()},options:(()=>{const e=[];return n.map((t=>e.push({value:t.name,label:t.label}))),e})()})),!l&&(0,a.createElement)(p.FlexItem,null,(0,a.createElement)(p.Button,{variant:"secondary",className:"block-editor-inserter__patterns-explorer-expand",label:(0,g.__)("Explore all patterns"),onClick:()=>r()},(0,g._x)("Explore","Label for showing all block patterns"))))},zd=window.wp.notices;var Vd=(e,t)=>{const{patternCategories:n,patterns:o}=(0,m.useSelect)((e=>{const{__experimentalGetAllowedPatterns:n,getSettings:o}=e(qn);return{patterns:n(t),patternCategories:o().__experimentalBlockPatternCategories}}),[t]),{createSuccessNotice:l}=(0,m.useDispatch)(zd.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 Hd(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)(Hd)}`;return(0,a.createElement)(Id,{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)(p.__unstableCompositeItem,i({role:"option",as:"div"},r,{className:"block-editor-block-patterns-list__item",onClick:()=>o(n,l)}),(0,a.createElement)(_d,{blocks:l,viewportWidth:s}),(0,a.createElement)("div",{className:"block-editor-block-patterns-list__item-title"},n.title),!!n.description&&(0,a.createElement)(p.VisuallyHidden,{id:c},n.description)))}))}function Gd(){return(0,a.createElement)("div",{className:"block-editor-block-patterns-list__item is-placeholder"})}var Ud=function(e){let{isDraggable:t,blockPatterns:n,shownPatterns:o,onClickPattern:r,orientation:l,label:s=(0,g.__)("Block Patterns")}=e;const c=(0,p.__unstableUseCompositeState)({orientation:l});return(0,a.createElement)(p.__unstableComposite,i({},c,{role:"listbox",className:"block-editor-block-patterns-list","aria-label":s}),n.map((e=>o.includes(e)?(0,a.createElement)(Hd,{key:e.name,pattern:e,onClick:r,isDraggable:t,composite:c}):(0,a.createElement)(Gd,{key:e.name}))))};function Wd(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)(p.Button,{key:n,label:l,className:`${r}__categories-list__item`,isPressed:t===n,onClick:()=>{o(n)}},l)})))}function $d(e){let{filterValue:t,setFilterValue:n}=e;return(0,a.createElement)("div",{className:"block-editor-block-patterns-explorer__search"},(0,a.createElement)(p.SearchControl,{onChange:n,value:t,label:(0,g.__)("Search for patterns"),placeholder:(0,g.__)("Search")}))}var jd=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)($d,{filterValue:r,setFilterValue:l}),!r&&(0,a.createElement)(Wd,{selectedCategory:t,patternCategories:n,onClickCategory:o}))};var Kd=function(){return(0,a.createElement)("div",{className:"block-editor-inserter__no-results"},(0,a.createElement)(wr,{className:"block-editor-inserter__no-results-icon",icon:Uc}),(0,a.createElement)("p",null,(0,g.__)("No results found.")))};var qd=function(e){let{rootClientId:t="",insertionIndex:n,clientId:o,isAppender:l,onSelect:i,shouldFocusBlock:s=!0}=e;const{getSelectedBlock:c}=(0,m.useSelect)(qn),{destinationRootClientId:d,destinationIndex:p}=(0,m.useSelect)((e=>{const{getSelectedBlockClientId:r,getBlockRootClientId:i,getBlockIndex:a,getBlockOrder:s}=e(qn),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,m.useDispatch)(qn),k=(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,p,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,Ft.speak)(a),i&&i()}),[l,c,f,h,d,p,i,s]),_=(0,a.useCallback)((e=>{e?v(d,p):b()}),[v,b,d,p]);return[d,k,_]};const Yd=e=>e.name||"",Qd=e=>e.title,Xd=e=>e.description||"",Zd=e=>e.keywords||[],Jd=e=>e.category,ep=()=>null;function tp(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return e=(0,u.deburr)(e),e=e.replace(/^\//,""),e=e.toLowerCase(),e}const np=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return(0,u.words)(tp(e))},op=(e,t)=>(0,u.differenceWith)(e,np(t),((e,t)=>t.includes(e))),rp=(e,t,n,o)=>{if(0===np(o).length)return e;return lp(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}})},lp=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=np(t);if(0===o.length)return e;const r=e.map((e=>[e,ip(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 ip(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{getName:o=Yd,getTitle:r=Qd,getDescription:l=Xd,getKeywords:i=Zd,getCategory:a=Jd,getCollection:s=ep}=n,c=o(e),d=r(e),p=l(e),m=i(e),f=a(e),g=s(e),h=tp(t),v=tp(d);let b=0;if(h===v)b+=30;else if(v.startsWith(h))b+=20;else{const e=[c,d,p,...m,f,g].join(" "),t=(0,u.words)(h);0===op(t,e).length&&(b+=10)}if(0!==b&&c.startsWith("core/")){b+=c!==e.id?1:2}return b}function ap(e){let{filterValue:t,filteredBlockPatternsLength:n}=e;return t?(0,a.createElement)(p.__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 sp=function(e){let{filterValue:t,selectedCategory:n,patternCategories:o}=e;const r=(0,d.useDebounce)(Ft.speak,500),[l,i]=qd({shouldFocusBlock:!0}),[s,,c]=Vd(i,l),u=(0,a.useMemo)((()=>o.map((e=>e.name))),[o]),p=(0,a.useMemo)((()=>t?lp(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)(ap,{filterValue:t,filteredBlockPatternsLength:p.length}),(0,a.createElement)(Ad,null,!f&&(0,a.createElement)(Kd,null),f&&(0,a.createElement)(Ud,{shownPatterns:m,blockPatterns:p,onClickPattern:c,isDraggable:!1})))};function cp(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)(jd,{selectedCategory:l,patternCategories:n,onClickCategory:i,filterValue:o,setFilterValue:r}),(0,a.createElement)(sp,{filterValue:o,selectedCategory:l,patternCategories:n}))}var up=function(e){let{onModalClose:t,...n}=e;return(0,a.createElement)(p.Modal,{title:(0,g.__)("Patterns"),closeLabel:(0,g.__)("Close"),onRequestClose:t,isFullScreen:!0},(0,a.createElement)(cp,n))};function dp(e){let{rootClientId:t,onInsert:n,selectedCategory:o,populatedCategories:r}=e;const[l,,i]=Vd(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)(Ud,{shownPatterns:p,blockPatterns:c,onClickPattern:i,label:o.label,orientation:"vertical",isDraggable:!0})):null}var pp=function(e){let{rootClientId:t,onInsert:n,onClickCategory:o,selectedCategory:r}=e;const[l,i]=(0,a.useState)(!1),[s,c]=Vd(),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)(Fd,{selectedCategory:p,patternCategories:d,onClickCategory:o,openPatternExplorer:()=>i(!0)}),!l&&(0,a.createElement)(dp,{rootClientId:t,onInsert:n,selectedCategory:p,populatedCategories:d}),l&&(0,a.createElement)(up,{initialCategory:p,patternCategories:d,onModalClose:()=>i(!1)}))},mp=window.wp.url;function fp(e){let{onHover:t,onInsert:n,rootClientId:o}=e;const[r,,,l]=Ld(o,n),i=(0,a.useMemo)((()=>r.filter((e=>{let{category:t}=e;return"reusable"===t}))),[r]);return 0===i.length?(0,a.createElement)(Kd,null):(0,a.createElement)(Rd,{title:(0,g.__)("Reusable blocks")},(0,a.createElement)(Md,{items:i,onSelect:l,onHover:t,label:(0,g.__)("Reusable blocks")}))}var gp=function(e){let{rootClientId:t,onInsert:n,onHover:o}=e;return(0,a.createElement)(a.Fragment,null,(0,a.createElement)(fp,{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,mp.addQueryArgs)("edit.php",{post_type:"wp_block"})},(0,g.__)("Manage Reusable blocks"))))};const{Fill:hp,Slot:vp}=(0,p.createSlotFill)("__unstableInserterMenuExtension");hp.Slot=vp;var bp=hp;const kp=[];var _p=function(e){let{filterValue:t,onSelect:n,onHover:o,rootClientId:r,clientId:l,isAppender:i,__experimentalInsertionIndex:s,maxBlockPatterns:c,maxBlockTypes:m,showBlockDirectory:f=!1,isDraggable:h=!0,shouldFocusBlock:v=!0,prioritizePatterns:b}=e;const k=(0,d.useDebounce)(Ft.speak,500),[_,y]=qd({onSelect:n,rootClientId:r,clientId:l,isAppender:i,insertionIndex:s,shouldFocusBlock:v}),[E,C,w,S]=Ld(_,y),[B,,I]=Vd(y,_),x=(0,a.useMemo)((()=>{if(0===c)return[];const e=lp(B,t);return void 0!==c?e.slice(0,c):e}),[t,B,c]);let T=m;b&&x.length>2&&(T=0);const N=(0,a.useMemo)((()=>{if(0===T)return[];const e=rp((0,u.orderBy)(E,["frecency"],["desc"]),C,w,t);return void 0!==T?e.slice(0,T):e}),[t,E,C,w,m]);(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);k(n)}),[t,k]);const P=(0,d.useAsyncList)(N,{step:9}),M=(0,d.useAsyncList)(P.length===N.length?x:kp),R=!(0,u.isEmpty)(N)||!(0,u.isEmpty)(x),L=!!N.length&&(0,a.createElement)(Rd,{title:(0,a.createElement)(p.VisuallyHidden,null,(0,g.__)("Blocks"))},(0,a.createElement)(Md,{items:P,onSelect:S,onHover:o,label:(0,g.__)("Blocks"),isDraggable:h})),A=!!x.length&&(0,a.createElement)(Rd,{title:(0,a.createElement)(p.VisuallyHidden,null,(0,g.__)("Block Patterns"))},(0,a.createElement)("div",{className:"block-editor-inserter__quick-inserter-patterns"},(0,a.createElement)(Ud,{shownPatterns:M,blockPatterns:x,onClickPattern:I,isDraggable:h})));return(0,a.createElement)(Ad,null,!f&&!R&&(0,a.createElement)(Kd,null),b?A:L,!!N.length&&!!x.length&&(0,a.createElement)("div",{className:"block-editor-inserter__quick-inserter-separator"}),b?L:A,f&&(0,a.createElement)(bp.Slot,{fillProps:{onSelect:S,onHover:o,filterValue:t,hasItems:R,rootClientId:_}},(e=>e.length?e:R?null:(0,a.createElement)(Kd,null))))};const yp={name:"blocks",title:(0,g.__)("Blocks")},Ep={name:"patterns",title:(0,g.__)("Patterns")},Cp={name:"reusable",title:(0,g.__)("Reusable")};var wp=function(e){let{children:t,showPatterns:n=!1,showReusableBlocks:o=!1,onSelect:r}=e;const l=(0,a.useMemo)((()=>{const e=[yp];return n&&e.push(Ep),o&&e.push(Cp),e}),[yp,n,Ep,o,Cp]);return(0,a.createElement)(p.TabPanel,{className:"block-editor-inserter__tabs",tabs:l,onSelect:r},t)};var Sp=(0,a.forwardRef)((function(e,t){let{rootClientId:n,clientId:o,isAppender:r,__experimentalInsertionIndex:l,onSelect:i,showInserterHelpPanel:s,showMostUsedBlocks:c,__experimentalFilterValue:u="",shouldFocusBlock:d=!0}=e;const[f,h]=(0,a.useState)(u),[v,b]=(0,a.useState)(null),[k,_]=(0,a.useState)(null),[y,E,C]=qd({rootClientId:n,clientId:o,isAppender:r,insertionIndex:l,shouldFocusBlock:d}),{showPatterns:w,hasReusableBlocks:S}=(0,m.useSelect)((e=>{var t;const{__experimentalGetAllowedPatterns:n,getSettings:o}=e(qn);return{showPatterns:!!n(y).length,hasReusableBlocks:!(null===(t=o().__experimentalReusableBlocks)||void 0===t||!t.length)}}),[y]),B=(0,a.useCallback)(((e,t,n)=>{E(e,t,n),i()}),[E,i]),I=(0,a.useCallback)(((e,t)=>{E(e,{patternName:t}),i()}),[E,i]),x=(0,a.useCallback)((e=>{C(!!e),b(e)}),[C,b]),T=(0,a.useCallback)((e=>{_(e)}),[_]),N=(0,a.useMemo)((()=>(0,a.createElement)(a.Fragment,null,(0,a.createElement)("div",{className:"block-editor-inserter__block-list"},(0,a.createElement)(Od,{rootClientId:y,onInsert:B,onHover:x,showMostUsedBlocks:c})),s&&(0,a.createElement)("div",{className:"block-editor-inserter__tips"},(0,a.createElement)(p.VisuallyHidden,{as:"h2"},(0,g.__)("A tip for using the block editor")),(0,a.createElement)(Gc,null)))),[y,B,x,f,c,s]),P=(0,a.useMemo)((()=>(0,a.createElement)(pp,{rootClientId:y,onInsert:I,onClickCategory:T,selectedCategory:k})),[y,I,T,k]),M=(0,a.useMemo)((()=>(0,a.createElement)(gp,{rootClientId:y,onInsert:B,onHover:x})),[y,B,x]),R=(0,a.useCallback)((e=>"blocks"===e.name?N:"patterns"===e.name?P:M),[N,P,M]),L=(0,a.useRef)();return(0,a.useImperativeHandle)(t,(()=>({focusSearch:()=>{L.current.focus()}}))),(0,a.createElement)("div",{className:"block-editor-inserter__menu"},(0,a.createElement)("div",{className:"block-editor-inserter__main-area"},(0,a.createElement)("div",{className:"block-editor-inserter__content"},(0,a.createElement)(p.SearchControl,{className:"block-editor-inserter__search",onChange:e=>{v&&b(null),h(e)},value:f,label:(0,g.__)("Search for blocks and patterns"),placeholder:(0,g.__)("Search"),ref:L}),!!f&&(0,a.createElement)(_p,{filterValue:f,onSelect:i,onHover:x,rootClientId:n,clientId:o,isAppender:r,__experimentalInsertionIndex:l,showBlockDirectory:!0,shouldFocusBlock:d}),!f&&(w||S)&&(0,a.createElement)(wp,{showPatterns:w,showReusableBlocks:S},R),!f&&!w&&!S&&N)),s&&v&&(0,a.createElement)(Ed,{item:v}))}));function Bp(e){let{onSelect:t,rootClientId:n,clientId:o,isAppender:r,prioritizePatterns:l}=e;const[i,s]=(0,a.useState)(""),[u,d]=qd({onSelect:t,rootClientId:n,clientId:o,isAppender:r}),[f]=Ld(u,d),[h]=Vd(d,u),{setInserterIsOpened:v,insertionIndex:b}=(0,m.useSelect)((e=>{const{getSettings:t,getBlockIndex:n,getBlockCount:r}=e(qn),l=t(),i=n(o),a=r();return{setInserterIsOpened:l.__experimentalSetIsInserterOpened,insertionIndex:-1===i?a:i}}),[o]),k=h.length&&(!!i||l),_=k&&h.length>6||f.length>6;(0,a.useEffect)((()=>{v&&v(!1)}),[v]);let y=0;return k&&(y=l?4:2),(0,a.createElement)("div",{className:c()("block-editor-inserter__quick-inserter",{"has-search":_,"has-expand":v})},_&&(0,a.createElement)(p.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)(_p,{filterValue:i,onSelect:t,rootClientId:n,clientId:o,isAppender:r,maxBlockPatterns:y,maxBlockTypes:6,isDraggable:!1,prioritizePatterns:l})),v&&(0,a.createElement)(p.Button,{className:"block-editor-inserter__quick-inserter-expand",onClick:()=>{v({rootClientId:n,insertionIndex:b,filterValue:i})},"aria-label":(0,g.__)("Browse all. This will open the main inserter panel in the editor toolbar.")},(0,g.__)("Browse all")))}const Ip=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,...m}=c;return(0,a.createElement)(p.Button,i({icon:Vc,label:t,tooltipPosition:"bottom",onClick:function(e){n&&n(e),d&&d(e)},className:"block-editor-inserter__toggle","aria-haspopup":!s&&"true","aria-expanded":!s&&r,disabled:o},m))};class xp 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=Ip,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)(Bp,{onSelect:()=>{t()},rootClientId:n,clientId:o,isAppender:r,prioritizePatterns:s}):(0,a.createElement)(Sp,{onSelect:()=>{t()},rootClientId:n,clientId:o,isAppender:r,showInserterHelpPanel:l})}render(){const{position:e,hasSingleBlockType:t,directInsertBlock:n,insertOnlyAllowedBlock:o,__experimentalIsQuick:r,onSelectOrClose:l}=this.props;return t||n?this.renderToggle({onToggle:o}):(0,a.createElement)(p.Dropdown,{className:"block-editor-inserter",contentClassName:c()("block-editor-inserter__popover",{"is-quick":r}),position:e,onToggle:this.onToggle,expandOnMobile:!0,headerTitle:(0,g.__)("Add a block"),renderToggle:this.renderToggle,renderContent:this.renderContent,onClose:l})}}var Tp=(0,d.compose)([(0,m.withSelect)(((e,t)=>{let{clientId:n,rootClientId:o}=t;const{getBlockRootClientId:l,hasInserterItems:i,__experimentalGetAllowedBlocks:a,__experimentalGetDirectInsertBlock:s,getBlockIndex:c,getBlockCount:d,getSettings:p}=e(qn),{getBlockVariations:m}=e(r.store);o=o||l(n)||void 0;const f=a(o),g=s(o),h=c(n),v=d(),b=p(),k=1===(0,u.size)(f)&&0===(0,u.size)(m(f[0].name,"inserter"));let _=!1;return k&&(_=f[0]),{hasItems:i(o),hasSingleBlockType:k,blockTitle:_?_.title:"",allowedBlockType:_,directInsertBlock:g,rootClientId:o,prioritizePatterns:b.__experimentalPreferPatternsOnRoot&&!o&&h>0&&(h{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(qn);let p;if(c){const e=function(e){const{getBlock:t,getPreviousBlockClientId:r}=o(qn);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(qn);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,Ft.speak)(m)}}})),(0,d.ifCondition)((e=>{let{hasItems:t,isAppender:n,rootClientId:o,clientId:r}=e;return t||!n&&!o&&!r}))])(xp);var Np=(0,d.compose)((0,m.withSelect)(((e,t)=>{const{getBlockCount:n,getSettings:o,getTemplateLock:r}=e(qn),l=!n(t.rootClientId),{bodyPlaceholder:i}=o();return{showPrompt:l,isLocked:!!r(t.rootClientId),placeholder:i}})),(0,m.withDispatch)(((e,t)=>{const{insertDefaultBlock:n,startTyping:o}=e(qn);return{onAppend(){const{rootClientId:e}=t;n(void 0,e),o()}}})))((function(e){let{isLocked:t,onAppend:n,showPrompt:o,placeholder:r,rootClientId:l}=e;if(t)return null;const i=(0,zc.decodeEntities)(r)||(0,g.__)("Type / to choose a block");return(0,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=>{Tc.ENTER!==e.keyCode&&Tc.SPACE!==e.keyCode||n()},onClick:()=>n(),onFocus:()=>{o&&n()}},o?i:"\ufeff"),(0,a.createElement)(Tp,{rootClientId:l,position:"bottom right",isAppender:!0,__experimentalIsQuick:!0}))}));function Pp(e,t){let{rootClientId:n,className:o,onFocus:r,tabIndex:l}=e;return(0,a.createElement)(Tp,{position:"bottom center",rootClientId:n,__experimentalIsQuick:!0,renderToggle:e=>{let n,{onToggle:i,disabled:s,isOpen:u,blockTitle:d,hasSingleBlockType:m}=e;n=m?(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=!m;let h=(0,a.createElement)(p.Button,{ref:t,onFocus:r,tabIndex:l,className:c()(o,"block-editor-button-block-appender"),onClick:i,"aria-haspopup":f?"true":void 0,"aria-expanded":f?u:void 0,disabled:s,label:n},!m&&(0,a.createElement)(p.VisuallyHidden,{as:"span"},n),(0,a.createElement)(wr,{icon:Vc}));return(f||m)&&(h=(0,a.createElement)(p.Tooltip,{text:n},h)),h},isAppender:!0})}const Mp=(0,a.forwardRef)(((e,t)=>(Vt()("wp.blockEditor.ButtonBlockerAppender",{alternative:"wp.blockEditor.ButtonBlockAppender",since:"5.9"}),Pp(e,t))));var Rp=(0,a.forwardRef)(Pp);var Lp=(0,m.withSelect)(((e,t)=>{let{rootClientId:n}=t;const{canInsertBlockType:o,getTemplateLock:l,getSelectedBlockClientId:i}=e(qn);return{isLocked:!!l(n),canInsertDefaultBlock:o((0,r.getDefaultBlockName)(),n),selectedBlockClientId:i()}}))((function(e){let t,{rootClientId:n,canInsertDefaultBlock:o,isLocked:r,renderAppender:l,className:i,selectedBlockClientId:s,tagName:u="div"}=e;if(r||!1===l)return null;if(l)t=(0,a.createElement)(l,null);else{if(!(s===n||!n&&!s))return null;t=o?(0,a.createElement)(Np,{rootClientId:n}):(0,a.createElement)(Rp,{rootClientId:n,className:"block-list-appender__toggle"})}return(0,a.createElement)(u,{tabIndex:-1,className:c()("block-list-appender wp-block",i),contentEditable:!1,"data-block":!0},t)}));function Ap(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 Dp=(0,a.createContext)();function Op(e){let{__unstablePopoverSlot:t,__unstableContentRef:n}=e;const{selectBlock:o,hideInsertionPoint:r}=(0,m.useDispatch)(qn),l=(0,a.useContext)(Dp),i=(0,a.useRef)(),{orientation:s,previousClientId:u,nextClientId:f,rootClientId:h,isInserterShown:v}=(0,m.useSelect)((e=>{var t;const{getBlockOrder:n,getBlockListSettings:o,getBlockInsertionPoint:r,isBlockBeingDragged:l,getPreviousBlockClientId:i,getNextBlockClientId:a}=e(qn),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}}),[]),b=Co(u),k=Co(f),_="vertical"===s,y=(0,a.useMemo)((()=>{if(!b&&!k)return{};const e=b?b.getBoundingClientRect():null,t=k?k.getBoundingClientRect():null;if(_)return{width:b?b.offsetWidth:k.offsetWidth,height:t&&e?t.top-e.bottom:0};let n=0;return e&&t&&(n=(0,g.isRTL)()?e.left-t.right:t.left-e.right),{width:n,height:b?b.offsetHeight:k.offsetHeight}}),[b,k]),E=(0,a.useCallback)((()=>{if(!b&&!k)return{};const{ownerDocument:e}=b||k,t=b?b.getBoundingClientRect():null,n=k?k.getBoundingClientRect():null;return _?(0,g.isRTL)()?{top:t?t.bottom:n.top,left:t?t.right:n.right,right:t?t.left:n.left,bottom:n?n.top:t.bottom,ownerDocument:e}:{top:t?t.bottom:n.top,left:t?t.left:n.left,right:t?t.right:n.right,bottom:n?n.top:t.bottom,ownerDocument:e}:(0,g.isRTL)()?{top:t?t.top:n.top,left:t?t.left:n.right,right:n?n.right:t.left,bottom:t?t.bottom:n.bottom,ownerDocument:e}:{top:t?t.top:n.top,left:t?t.right:n.left,right:n?n.left:t.right,bottom:t?t.bottom:n.bottom,ownerDocument:e}}),[b,k]),C=Ap(n),w=(0,d.useReducedMotion)(),S=c()("block-editor-block-list__insertion-point","is-"+s);const B=b&&k&&v,I={start:{..._?{height:0,left:"50%",right:"50%",y:0}:{width:0,top:"50%",bottom:"50%",x:0},opacity:0},rest:{..._?{height:4,left:0,right:0,y:-2}:{width:4,top:0,bottom:0,x:-2},opacity:1,borderRadius:"2px",transition:{delay:B?.4:0}},hover:{..._?{height:4,left:0,right:0,y:-2}:{width:4,top:0,bottom:0,x:-2},opacity:1,borderRadius:"2px",transition:{delay:.4}}},x={start:{scale:w?1:0},rest:{scale:1,transition:{delay:.2}}};return(0,a.createElement)(p.Popover,{ref:C,noArrow:!0,animate:!1,getAnchorRect:E,focusOnMount:!1,className:"block-editor-block-list__insertion-point-popover",__unstableSlotName:t||null,key:f+"--"+h},(0,a.createElement)(p.__unstableMotion.div,{layout:!w,initial:w?"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()(S,{"is-with-inserter":B}),onHoverEnd:function(e){e.target!==i.current||l.current||r()},style:y},(0,a.createElement)(p.__unstableMotion.div,{variants:I,className:"block-editor-block-list__insertion-point-indicator"}),B&&(0,a.createElement)(p.__unstableMotion.div,{variants:x,className:c()("block-editor-block-list__insertion-point-inserter")},(0,a.createElement)(Tp,{position:"bottom center",clientId:f,rootClientId:h,__experimentalIsQuick:!0,onToggle:e=>{l.current=e},onSelectOrClose:()=>{l.current=!1}}))))}function Fp(e){let{children:t,__unstablePopoverSlot:n,__unstableContentRef:o}=e;const r=(0,m.useSelect)((e=>e(qn).isBlockInsertionPointVisible()),[]);return(0,a.createElement)(Dp.Provider,{value:(0,a.useRef)(!1)},r&&(0,a.createElement)(Op,{__unstablePopoverSlot:n,__unstableContentRef:o}),t)}function zp(){const e=(0,a.useContext)(Dp),t=(0,m.useSelect)((e=>e(qn).getSettings().hasReducedUI),[]),{getBlockListSettings:n,getBlockRootClientId:o,getBlockIndex:r,isBlockInsertionPointVisible:l,isMultiSelecting:i,getSelectedBlockClientIds:s,getTemplateLock:c}=(0,m.useSelect)(qn),{showInsertionPoint:u,hideInsertionPoint:p}=(0,m.useDispatch)(qn);return(0,d.useRefEffect)((o=>{if(!t)return o.addEventListener("mousemove",a),()=>{o.removeEventListener("mousemove",a)};function a(t){var o,a;if(e.current)return;if(i())return;if(!t.target.classList.contains("block-editor-block-list__layout"))return void(l()&&p());let d;if(!t.target.classList.contains("is-root-container")){d=(t.target.getAttribute("data-block")?t.target:t.target.closest("[data-block]")).getAttribute("data-block")}if(c(d))return;const m=(null===(o=n(d))||void 0===o?void 0:o.orientation)||"vertical",f=t.target.getBoundingClientRect(),g=t.clientY-f.top,h=t.clientX-f.left;let v=Array.from(t.target.children).find((e=>e.classList.contains("wp-block")&&"vertical"===m&&e.offsetTop>g||e.classList.contains("wp-block")&&"horizontal"===m&&e.offsetLeft>h));if(!v)return;if(!v.id&&(v=v.firstElementChild,!v))return;if(null===(a=v.parentElement)||void 0===a?void 0:a.closest(".block-editor-block-content-overlay.overlay-active"))return;const b=v.id.slice("block-".length);if(!b)return;if(s().includes(b))return;const k=v.getBoundingClientRect();if("horizontal"===m&&(t.clientY>k.bottom||t.clientYk.right||t.clientX{setTimeout((()=>e(Date.now())),0)}:window.requestIdleCallback||window.requestAnimationFrame,Hp="undefined"==typeof window?clearTimeout:window.cancelIdleCallback||window.cancelAnimationFrame;function Gp(e){return(0,m.useSelect)((t=>{if(!e)return null;const{getBlockName:n,getBlockAttributes:o}=t(qn),{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}:d}),[e])}function Up(e,t){const{attributes:n,name:o,reusableBlockTitle:l}=(0,m.useSelect)((t=>{if(!e)return{};const{getBlockName:n,getBlockAttributes:o,__experimentalGetReusableBlockTitle:l}=t(qn),i=n(e);if(!i)return{};const a=(0,r.isReusableBlock)((0,r.getBlockType)(i));return{attributes:o(e),name:i,reusableBlockTitle:a&&l(o(e).ref)}}),[e]),i=Gp(e);if(!o||!i)return null;const a=(0,r.getBlockType)(o),s=a?(0,r.__experimentalGetBlockLabel)(a,n):null,c=l||s,d=c&&c!==a.title?c:i.title;return t&&t>0?(0,u.truncate)(d,{length:t}):d}function Wp(e){let{clientId:t,maximumLength:n}=e;return Up(t,n)}var $p=e=>{let{children:t,clientIds:n,cloneClassname:o,onDragStart:l,onDragEnd:i}=e;const{srcRootClientId:s,isDraggable:c,icon:u}=(0,m.useSelect)((e=>{var t;const{canMoveBlocks:o,getBlockRootClientId:l,getBlockName:i}=e(qn),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,Jr.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{e.current=null,n.current=null,o.current&&(clearInterval(o.current),o.current=null)}]}(),{startDraggingBlocks:v,stopDraggingBlocks:b}=(0,m.useDispatch)(qn);if((0,a.useEffect)((()=>()=>{d.current&&b()}),[]),!c)return t({isDraggable:!1});const k={type:"block",srcClientIds:n,srcRootClientId:s};return(0,a.createElement)(p.Draggable,{cloneClassname:o,__experimentalTransferDataType:"wp-blocks",transferData:k,onDragStart:e=>{v(n),d.current=!0,f(e),l&&l()},onDragOver:g,onDragEnd:()=>{b(),d.current=!1,h(),i&&i()},__experimentalDragComponent:(0,a.createElement)(Bd,{count:n.length,icon:u})},(e=>{let{onDraggableStart:n,onDraggableEnd:o}=e;return t({draggable:!0,onDragStart:n,onDragEnd:o})}))};var jp=function(e){let{clientId:t,rootClientId:n,blockElement:o}=e;const l=Gp(t),s=(0,m.useSelect)((e=>{var o;const{getBlock:r,getBlockIndex:l,hasBlockMovingClientId:i,getBlockListSettings:a}=e(qn),s=l(t),{name:c,attributes:u}=r(t);return{index:s,name:c,attributes:u,blockMovingMode:i(),orientation:null===(o=a(n))||void 0===o?void 0:o.orientation}}),[t,n]),{index:u,name:d,attributes:f,blockMovingMode:h,orientation:v}=s,{setNavigationMode:b,removeBlock:k}=(0,m.useDispatch)(qn),_=(0,a.useRef)(),y=(0,r.getBlockType)(d),E=(0,r.__experimentalGetAccessibleBlockLabel)(y,f,u+1,v);(0,a.useEffect)((()=>{_.current.focus(),(0,Ft.speak)(E)}),[E]);const{hasBlockMovingClientId:C,getBlockIndex:w,getBlockRootClientId:S,getClientIdsOfDescendants:B,getSelectedBlockClientId:I,getMultiSelectedBlocksEndClientId:x,getPreviousBlockClientId:T,getNextBlockClientId:N,isNavigationMode:P}=(0,m.useSelect)(qn),{selectBlock:M,clearSelectedBlock:R,setBlockMovingClientId:L,moveBlockToPosition:A}=(0,m.useDispatch)(qn),D=c()("block-editor-block-list__block-selection-button",{"is-block-moving-mode":!!h}),O=(0,g.__)("Drag");return(0,a.createElement)("div",{className:D},(0,a.createElement)(p.Flex,{justify:"center",className:"block-editor-block-list__block-selection-button__content"},(0,a.createElement)(p.FlexItem,null,(0,a.createElement)(Wc,{icon:null==l?void 0:l.icon,showColors:!0})),(0,a.createElement)(p.FlexItem,null,(0,a.createElement)($p,{clientIds:[t]},(e=>(0,a.createElement)(p.Button,i({icon:Sd,className:"block-selection-button_drag-handle","aria-hidden":"true",label:O,tabIndex:"-1"},e))))),(0,a.createElement)(p.FlexItem,null,(0,a.createElement)(p.Button,{ref:_,onClick:()=>b(!1),onKeyDown:function(e){const{keyCode:n}=e,r=n===Tc.UP,l=n===Tc.DOWN,i=n===Tc.LEFT,a=n===Tc.RIGHT,s=n===Tc.TAB,c=n===Tc.ESCAPE,u=n===Tc.ENTER,d=n===Tc.SPACE,p=e.shiftKey;if(n===Tc.BACKSPACE||n===Tc.DELETE)return k(t),void e.preventDefault();const m=I(),f=x(),g=T(f||m),h=N(f||m),v=s&&p||r,b=s&&!p||l,_=i,y=a;let E;if(v)E=g;else if(b)E=h;else if(_){var D;E=null!==(D=S(m))&&void 0!==D?D:m}else if(y){var O;E=null!==(O=B([m])[0])&&void 0!==O?O:m}const F=C();if(c&&P()&&(R(),e.preventDefault()),c&&F&&!e.defaultPrevented&&(L(null),e.preventDefault()),(u||d)&&F){const e=S(F),t=S(m),n=w(F);let o=w(m);n{!function(e){const[t]=Jr.focus.tabbable.find(e);t&&t.focus()}(e.current)}),[]);(0,tu.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=Kp(e.current),n=i||0;var o;t[n]&&(o=e.current).contains(o.ownerDocument.activeElement)&&t[n].focus()}))),()=>{if(window.cancelAnimationFrame(t),!r||!e.current)return;const n=Kp(e.current).findIndex((e=>0===e.tabIndex));r(n)}}),[i,l])}var Yp=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=!Jr.focus.tabbable.find(e.current).some((e=>!("toolbarItem"in e.dataset)));t||Vt()("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 qp(s,n,c,o,r),c?(0,a.createElement)(p.Toolbar,i({label:l["aria-label"],ref:s},l),t):(0,a.createElement)(p.NavigableMenu,i({orientation:"horizontal",role:"toolbar",ref:s},l),t)};var Qp=(0,a.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(O.Path,{d:"M10.6 6L9.4 7l4.6 5-4.6 5 1.2 1 5.4-6z"}));var Xp=(0,a.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(O.Path,{d:"M14.6 7l-1.2-1L8 12l5.4 6 1.2-1-4.6-5z"}));var Zp=(0,a.createElement)(O.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,a.createElement)(O.Path,{d:"M6.5 12.4L12 8l5.5 4.4-.9 1.2L12 10l-4.5 3.6-1-1.2z"}));var Jp=(0,a.createElement)(O.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,a.createElement)(O.Path,{d:"M17.5 11.6L12 16l-5.5-4.4.9-1.2L12 14l4.5-3.6 1 1.2z"}));function em(e,t,n,o,r,l,i){const a=n+1,s=e=>"up"===e?"horizontal"===i?(0,g.isRTL)()?"right":"left":"up":"down"===e?"horizontal"===i?(0,g.isRTL)()?"left":"right":"down":null;if(e>1)return function(e,t,n,o,r){const l=t+1;if(r<0&&n)return(0,g.__)("Blocks cannot be moved up as they are already at the top");if(r>0&&o)return(0,g.__)("Blocks cannot be moved down as they are already at the bottom");if(r<0&&!n)return(0,g.sprintf)((0,g._n)("Move %1$d block from position %2$d up by one place","Move %1$d blocks from position %2$d up by one place",e),e,l);if(r>0&&!o)return(0,g.sprintf)((0,g._n)("Move %1$d block from position %2$d down by one place","Move %1$d blocks from position %2$d down by one place",e),e,l)}(e,n,o,r,l);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=s("down");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=s("down");if("down"===e)return(0,g.sprintf)((0,g.__)("Block %1$s is at the end of the content and can’t be moved down"),t);if("left"===e)return(0,g.sprintf)((0,g.__)("Block %1$s is at the end of the content and can’t be moved left"),t);if("right"===e)return(0,g.sprintf)((0,g.__)("Block %1$s is at the end of the content and can’t be moved right"),t)}if(l<0&&!o){const e=s("up");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=s("up");if("up"===e)return(0,g.sprintf)((0,g.__)("Block %1$s is at the beginning of the content and can’t be moved up"),t);if("left"===e)return(0,g.sprintf)((0,g.__)("Block %1$s is at the beginning of the content and can’t be moved left"),t);if("right"===e)return(0,g.sprintf)((0,g.__)("Block %1$s is at the beginning of the content and can’t be moved right"),t)}}const tm=(e,t)=>"up"===e?"horizontal"===t?(0,g.isRTL)()?Qp:Xp:Zp:"down"===e?"horizontal"===t?(0,g.isRTL)()?Xp:Qp:Jp:null,nm=(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,om=(0,a.forwardRef)(((e,t)=>{let{clientIds:n,direction:o,orientation:l,...s}=e;const f=(0,d.useInstanceId)(om),g=(0,u.castArray)(n).length,{blockType:h,isDisabled:v,rootClientId:b,isFirst:k,isLast:_,firstIndex:y,orientation:E="vertical"}=(0,m.useSelect)((e=>{const{getBlockIndex:t,getBlockRootClientId:i,getBlockOrder:a,getBlock:s,getBlockListSettings:c}=e(qn),d=(0,u.castArray)(n),p=(0,u.first)(d),m=i(p),f=t(p),g=t((0,u.last)(d)),h=a(m),v=s(p),b=0===f,k=g===h.length-1,{orientation:_}=c(m)||{};return{blockType:v?(0,r.getBlockType)(v.name):null,isDisabled:"up"===o?b:k,rootClientId:m,firstIndex:f,isFirst:b,isLast:k,orientation:l||_}}),[n,o]),{moveBlocksDown:C,moveBlocksUp:w}=(0,m.useDispatch)(qn),S="up"===o?w:C,B=`block-editor-block-mover-button__description-${f}`;return(0,a.createElement)(a.Fragment,null,(0,a.createElement)(p.Button,i({ref:t,className:c()("block-editor-block-mover-button",`is-${o}-button`),icon:tm(o,E),label:nm(o,E),"aria-describedby":B},s,{onClick:v?null:e=>{S(n,b),s.onClick&&s.onClick(e)},"aria-disabled":v})),(0,a.createElement)("span",{id:B,className:"block-editor-block-mover-button__description"},em(g,h&&h.title,y,k,_,"up"===o?-1:1,E)))})),rm=(0,a.forwardRef)(((e,t)=>(0,a.createElement)(om,i({direction:"up",ref:t},e)))),lm=(0,a.forwardRef)(((e,t)=>(0,a.createElement)(om,i({direction:"down",ref:t},e))));var im=(0,m.withSelect)(((e,t)=>{var n;let{clientIds:o}=t;const{getBlock:l,getBlockIndex:i,getBlockListSettings:a,canMoveBlocks:s,getBlockOrder:c,getBlockRootClientId:d}=e(qn),p=(0,u.castArray)(o),m=(0,u.first)(p),f=l(m),g=d((0,u.first)(p)),h=i(m),v=0===h,b=i((0,u.last)(p))===c(g).length-1;return{blockType:f?(0,r.getBlockType)(f.name):null,canMove:s(o,g),rootClientId:g,firstIndex:h,isFirst:v,isLast:b,orientation:null===(n=a(g))||void 0===n?void 0:n.orientation}}))((function(e){let{isFirst:t,isLast:n,clientIds:o,canMove:r,isHidden:l,rootClientId:s,orientation:u,hideDragHandle:d}=e;const[m,f]=(0,a.useState)(!1),h=()=>f(!0),v=()=>f(!1);if(!r||t&&n&&!s)return null;const b=(0,g.__)("Drag");return(0,a.createElement)("div",{className:c()("block-editor-block-mover",{"is-visible":m||!l,"is-horizontal":"horizontal"===u})},!d&&(0,a.createElement)($p,{clientIds:o,cloneClassname:"block-editor-block-mover__drag-clone"},(e=>(0,a.createElement)(p.Button,i({icon:Sd,className:"block-editor-block-mover__drag-handle","aria-hidden":"true",label:b,tabIndex:"-1"},e)))),(0,a.createElement)(p.ToolbarGroup,{className:"block-editor-block-mover__move-button-container"},(0,a.createElement)(p.ToolbarItem,{onFocus:h,onBlur:v},(e=>(0,a.createElement)(rm,i({clientIds:o},e)))),(0,a.createElement)(p.ToolbarItem,{onFocus:h,onBlur:v},(e=>(0,a.createElement)(lm,i({clientIds:o},e))))))}));const{clearTimeout:am,setTimeout:sm}=window,cm=200;function um(e){let{ref:t,isFocused:n,debounceTimeout:o=cm,onChange:r=u.noop}=e;const[l,i]=(0,a.useState)(!1),s=(0,a.useRef)(),c=e=>{null!=t&&t.current&&i(e),r(e)},d=()=>{const e=(null==t?void 0:t.current)&&t.current.matches(":hover");return!n&&!e},p=()=>{const e=s.current;e&&am&&am(e)};return(0,a.useEffect)((()=>()=>{c(!1),p()}),[]),{showMovers:l,debouncedShowMovers:e=>{e&&e.stopPropagation(),p(),l||c(!0)},debouncedHideMovers:e=>{e&&e.stopPropagation(),p(),s.current=sm((()=>{d()&&c(!1)}),o)}}}function dm(e){let{ref:t,debounceTimeout:n=cm,onChange:o=u.noop}=e;const[r,l]=(0,a.useState)(!1),{showMovers:i,debouncedShowMovers:s,debouncedHideMovers:c}=um({ref:t,debounceTimeout:n,isFocused:r,onChange:o}),d=(0,a.useRef)(!1),p=()=>(null==t?void 0:t.current)&&t.current.contains(t.current.ownerDocument.activeElement);return(0,a.useEffect)((()=>{const e=t.current,n=()=>{p()&&(l(!0),s())},o=()=>{p()||(l(!1),c())};return e&&!d.current&&(e.addEventListener("focus",n,!0),e.addEventListener("blur",o,!0),d.current=!0),()=>{e&&(e.removeEventListener("focus",n),e.removeEventListener("blur",o))}}),[t,d,l,s,c]),{showMovers:i,gestures:{onMouseMove:s,onMouseLeave:c}}}function pm(){const{selectBlock:e,toggleBlockHighlight:t}=(0,m.useDispatch)(qn),{firstParentClientId:n,shouldHide:o,hasReducedUI:l}=(0,m.useSelect)((e=>{const{getBlockName:t,getBlockParents:n,getSelectedBlockClientId:o,getSettings:l}=e(qn),{hasBlockSupport:i}=e(r.store),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=Gp(n),c=(0,a.useRef)(),{gestures:u}=dm({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)(p.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)(Wc,{icon:s.icon})}))}var mm=(0,a.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(O.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 fm(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)(p.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)(_d,{viewportWidth:500,blocks:t})))))}var gm=e=>{let{className:t,possibleBlockTransformations:n,onSelect:o,blocks:l}=e;const[i,s]=(0,a.useState)();return(0,a.createElement)(p.MenuGroup,{label:(0,g.__)("Transform to"),className:t},i&&(0,a.createElement)(fm,{blocks:(0,r.switchToBlockType)(l,i)}),n.map((e=>{const{name:t,icon:n,title:l,isDisabled:i}=e;return(0,a.createElement)(p.MenuItem,{key:t,className:(0,r.getBlockMenuDefaultClassName)(t),onClick:e=>{e.preventDefault(),o(t)},disabled:i,onMouseLeave:()=>s(null),onMouseEnter:()=>s(t)},(0,a.createElement)(Wc,{icon:n,showColors:!0}),l)})))};var hm=(0,a.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(O.Path,{d:"M16.7 7.1l-6.3 8.5-3.3-2.5-.9 1.2 4.5 3.4L17.9 8z"})),vm=window.wp.tokenList,bm=n.n(vm);function km(e,t,n){const o=new(bm())(e);return t&&o.remove("is-style-"+t.name),o.add("is-style-"+n.name),o.value}function _m(e){return(0,u.find)(e,"isDefault")}function ym(e){let{clientId:t,onSwitch:n}=e;const{styles:o,block:l,blockType:i,className:s}=(0,m.useSelect)((e=>{const{getBlock:n}=e(qn),o=n(t);if(!o)return{};const l=(0,r.getBlockType)(o.name),{getBlockStyles:i}=e(r.store);return{block:o,blockType:l,styles:i(o.name),className:o.attributes.className||""}}),[t]),{updateBlockAttributes:c}=(0,m.useDispatch)(qn),d=function(e){return e&&0!==e.length?_m(e)?e:[{name:"default",label:(0,g._x)("Default","block style"),isDefault:!0},...e]:[]}(o),p=function(e,t){for(const n of new(bm())(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=km(s,p,e);c(t,{className:o}),n()},stylesToRender:d,activeStyle:p,genericPreviewBlock:f,className:s}}function Em(e){let{clientId:t,onSwitch:n=u.noop}=e;const{onSelect:o,stylesToRender:r,activeStyle:l}=ym({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)(p.MenuItem,{key:e.name,icon:l.name===e.name?hm:null,onClick:()=>o(e)},(0,a.createElement)(p.__experimentalText,{as:"span",limit:18,ellipsizeMode:"tail",truncate:!0},t))}))):null}function Cm(e){let{hoveredBlock:t,onSwitch:n}=e;const{clientId:o}=t;return(0,a.createElement)(p.MenuGroup,{label:(0,g.__)("Styles"),className:"block-editor-block-switcher__styles__menugroup"},(0,a.createElement)(Em,{clientId:o,onSwitch:n}))}const wm=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=wm(e,t,n);if(o)return o}}},Sm=(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 Bm=(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=wm(r,t.name,o);if(n){e=!0,o.add(n.clientId),Sm(n,t);break}}if(!e)return}return n})(t,n.blocks);return o&&e.push({...n,transformedBlocks:o}),e}),[])),[e,t]);function Im(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)(p.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)(xm,{patterns:t,onSelect:n})))))}function xm(e){let{patterns:t,onSelect:n}=e;const o=(0,p.__unstableUseCompositeState)();return(0,a.createElement)(p.__unstableComposite,i({},o,{role:"listbox",className:"block-editor-block-switcher__preview-patterns-container","aria-label":(0,g.__)("Patterns list")}),t.map((e=>(0,a.createElement)(Tm,{key:e.name,pattern:e,onSelect:n,composite:o}))))}function Tm(e){let{pattern:t,onSelect:n,composite:o}=e;const r="block-editor-block-switcher__preview-patterns-container",l=(0,d.useInstanceId)(Tm,`${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)(p.__unstableCompositeItem,i({role:"option",as:"div"},o,{className:`${r}-list__item`,onClick:()=>n(t.transformedBlocks)}),(0,a.createElement)(_d,{blocks:t.transformedBlocks,viewportWidth:t.viewportWidth||500}),(0,a.createElement)("div",{className:`${r}-list__item-title`},t.title)),!!t.description&&(0,a.createElement)(p.VisuallyHidden,{id:l},t.description))}var Nm=function(e){let{blocks:t,patterns:n,onSelect:o}=e;const[r,l]=(0,a.useState)(!1),i=Bm(n,t);return i.length?(0,a.createElement)(p.MenuGroup,{className:"block-editor-block-switcher__pattern__transforms__menugroup"},r&&(0,a.createElement)(Im,{patterns:i,onSelect:o}),(0,a.createElement)(p.MenuItem,{onClick:e=>{e.preventDefault(),l(!r)},icon:Qp},(0,g.__)("Patterns"))):null};const Pm=e=>{let{clientIds:t,blocks:n}=e;const{replaceBlocks:o}=(0,m.useDispatch)(qn),l=Gp(n[0].clientId),{possibleBlockTransformations:i,canRemove:s,hasBlockStyles:c,icon:d,blockTitle:f,patterns:h}=(0,m.useSelect)((e=>{var o;const{getBlockRootClientId:i,getBlockTransformItems:a,__experimentalGetPatternTransformItems:s}=e(qn),{getBlockStyles:c,getBlockType:d}=e(r.store),{canRemoveBlocks:p}=e(qn),m=i((0,u.castArray)(t)[0]),[{name:f}]=n,g=1===n.length,h=g&&c(f);let v;if(g)v=null==l?void 0:l.icon;else{var b;v=1===(0,u.uniq)(n.map((e=>{let{name:t}=e;return t}))).length?null===(b=d(f))||void 0===b?void 0:b.icon:mm}return{possibleBlockTransformations:a(n,m),canRemove:p(t,m),hasBlockStyles:!(null==h||!h.length),icon:v,blockTitle:null===(o=d(f))||void 0===o?void 0:o.title,patterns:s(n,m)}}),[t,n,null==l?void 0:l.icon]),v=1===n.length&&(0,r.isReusableBlock)(n[0]),b=1===n.length&&(0,r.isTemplatePart)(n[0]),k=!!i.length&&s,_=!(null==h||!h.length)&&s;if(!c&&!k)return(0,a.createElement)(p.ToolbarGroup,null,(0,a.createElement)(p.ToolbarButton,{disabled:!0,className:"block-editor-block-switcher__no-switcher-icon",title:f,icon:(0,a.createElement)(a.Fragment,null,(0,a.createElement)(Wc,{icon:d,showColors:!0}),(v||b)&&(0,a.createElement)("span",{className:"block-editor-block-switcher__toggle-text"},(0,a.createElement)(Wp,{clientId:t,maximumLength:35})))}));const y=f,E=1===n.length?(0,g.sprintf)((0,g.__)("%s: Change block type or style"),f):(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)(p.ToolbarGroup,null,(0,a.createElement)(p.ToolbarItem,null,(e=>(0,a.createElement)(p.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)(Wc,{icon:d,className:"block-editor-block-switcher__toggle",showColors:!0}),(v||b)&&(0,a.createElement)("span",{className:"block-editor-block-switcher__toggle-text"},(0,a.createElement)(Wp,{clientId:t,maximumLength:35}))),toggleProps:{describedBy:E,...e},menuProps:{orientation:"both"}},(e=>{let{onClose:l}=e;return C&&(0,a.createElement)("div",{className:"block-editor-block-switcher__container"},_&&(0,a.createElement)(Nm,{blocks:n,patterns:h,onSelect:e=>{(e=>{o(t,e)})(e),l()}}),k&&(0,a.createElement)(gm,{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)(Cm,{hoveredBlock:n[0],onSwitch:l}))})))))};var Mm=e=>{let{clientIds:t}=e;const n=(0,m.useSelect)((e=>e(qn).getBlocksByClientId(t)),[t]);return!n.length||n.some((e=>!e))?null:(0,a.createElement)(Pm,{clientIds:t,blocks:n})};const{Fill:Rm,Slot:Lm}=(0,p.createSlotFill)("__unstableBlockToolbarLastItem");Rm.Slot=Lm;var Am=Rm;var Dm=(0,a.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(O.Path,{d:"M13 19h-2v-2h2v2zm0-6h-2v-2h2v2zm0-6h-2V5h2v2z"})),Om=window.wp.blob;function Fm(e,t){if(t&&1===(null==e?void 0:e.length)&&0===e[0].type.indexOf("image/")){var n;const e=/<\s*img\b/gi;return 1!==(null===(n=t.match(e))||void 0===n?void 0:n.length)}return!1}function zm(){const{getBlockName:e}=(0,m.useSelect)(qn),{getBlockType:t}=(0,m.useSelect)(r.store),{createSuccessNotice:n}=(0,m.useDispatch)(zd.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 Vm(){const{getBlocksByClientId:e,getSelectedBlockClientIds:t,hasMultiSelection:n,getSettings:o,__unstableIsFullySelected:l,__unstableIsSelectionCollapsed:i,__unstableIsSelectionMergeable:a,__unstableGetSelectedBlocksWithPartialSelection:s}=(0,m.useSelect)(qn),{flashBlock:c,removeBlocks:u,replaceBlocks:p,__unstableDeleteSelection:f,__unstableExpandSelection:g}=(0,m.useDispatch)(qn),h=zm();return(0,d.useRefEffect)((d=>{function m(m){const v=t();if(0===v.length)return;if(!n()){const{target:e}=m,{ownerDocument:t}=e;if("copy"===m.type||"cut"===m.type?(0,Jr.documentHasUncollapsedSelection)(t):(0,Jr.documentHasSelection)(t))return}if(!d.contains(m.target.ownerDocument.activeElement))return;const b=m.defaultPrevented;m.preventDefault();const k=a(),_=i()||l(),y=!_&&!k;if("copy"===m.type||"cut"===m.type)if(1===v.length&&c(v[0]),y)g();else{let t;if(h(m.type,v),_)t=e(v);else{const[n,o]=s();t=[n,...e(v.slice(1,v.length-1)),o]}const n=(0,r.serialize)(t);m.clipboardData.setData("text/plain",n),m.clipboardData.setData("text/html",n)}if("cut"===m.type)_&&!y?u(v):f();else if("paste"===m.type){if(b)return;const{__experimentalCanUserUseUnfilteredHTML:e}=o(),{plainText:t,html:n}=function(e){let{clipboardData:t}=e,n="",o="";try{n=t.getData("text/plain"),o=t.getData("text/html")}catch(e){try{o=t.getData("Text")}catch(e){return}}const r=(0,Jr.getFilesFromDataTransfer)(t).filter((e=>{let{type:t}=e;return/^image\/(?:jpe?g|png|gif|webp)$/.test(t)}));return r.length&&!Fm(r,o)&&(o=r.map((e=>``)).join(""),n=""),{html:o,plainText:n}}(m),l=(0,r.pasteHandler)({HTML:n,plainText:t,mode:"BLOCKS",canUserUseUnfilteredHTML:e});p(v,l,l.length-1,-1)}}return d.ownerDocument.addEventListener("copy",m),d.ownerDocument.addEventListener("cut",m),d.ownerDocument.addEventListener("paste",m),()=>{d.ownerDocument.removeEventListener("copy",m),d.ownerDocument.removeEventListener("cut",m),d.ownerDocument.removeEventListener("paste",m)}}),[])}var Hm=function(e){let{children:t}=e;return(0,a.createElement)("div",{ref:Vm()},t)};function Gm(e){let{clientIds:t,children:n,__experimentalUpdateSelection:o}=e;const{canInsertBlockType:l,getBlockRootClientId:i,getBlocksByClientId:a,canMoveBlocks:s,canRemoveBlocks:c}=(0,m.useSelect)(qn),{getDefaultBlockName:d,getGroupingBlockName:p}=(0,m.useSelect)(r.store),f=a(t),g=i(t[0]),h=(0,u.every)(f,(e=>!!e&&(0,r.hasBlockSupport)(e.name,"multiple",!0)&&l(e.name,g))),v=l(d(),g),b=s(t,g),k=c(t,g),{removeBlocks:_,replaceBlocks:y,duplicateBlocks:E,insertAfterBlock:C,insertBeforeBlock:w,flashBlock:S,setBlockMovingClientId:B,setNavigationMode:I,selectBlock:x}=(0,m.useDispatch)(qn),T=zm();return n({canDuplicate:h,canInsertDefaultBlock:v,canMove:b,canRemove:k,rootClientId:g,blocks:f,onDuplicate:()=>E(t,o),onRemove:()=>_(t,o),onInsertBefore(){w((0,u.first)((0,u.castArray)(t)))},onInsertAfter(){C((0,u.last)((0,u.castArray)(t)))},onMoveTo(){I(!0),x(t[0]),B(t[0])},onGroup(){if(!f.length)return;const e=p(),n=(0,r.switchToBlockType)(f,e);n&&y(t,n)},onUngroup(){if(!f.length)return;const e=f[0].innerBlocks;e.length&&y(t,e)},onCopy(){const e=f.map((e=>{let{clientId:t}=e;return t}));1===f.length&&S(e[0]),T("copy",e)}})}var Um=(0,d.compose)([(0,m.withSelect)(((e,t)=>{let{clientId:n}=t;const{getBlock:o,getBlockMode:l,getSettings:i}=e(qn),a=o(n),s=i().codeEditingEnabled;return{mode:l(n),blockType:a?(0,r.getBlockType)(a.name):null,isCodeEditingEnabled:s}})),(0,m.withDispatch)(((e,t)=>{let{onToggle:n=u.noop,clientId:o}=t;return{onToggleMode(){e(qn).toggleBlockMode(o),n()}}}))])((function(e){let{blockType:t,mode:n,onToggleMode:o,small:l=!1,isCodeEditingEnabled:i=!0}=e;if(!(0,r.hasBlockSupport)(t,"html",!0)||!i)return null;const s="visual"===n?(0,g.__)("Edit as HTML"):(0,g.__)("Edit visually");return(0,a.createElement)(p.MenuItem,{onClick:o},!l&&s)}));var Wm=(0,d.compose)((0,m.withSelect)(((e,t)=>{let{clientId:n}=t;const o=e(qn).getBlock(n);return{block:o,shouldRender:o&&"core/html"===o.name}})),(0,m.withDispatch)(((e,t)=>{let{block:n}=t;return{onClick:()=>e(qn).replaceBlocks(n.clientId,(0,r.rawHandler)({HTML:(0,r.getBlockContent)(n)}))}})))((function(e){let{shouldRender:t,onClick:n,small:o}=e;if(!t)return null;const r=(0,g.__)("Convert to Blocks");return(0,a.createElement)(p.MenuItem,{onClick:n},!o&&r)}));const{Fill:$m,Slot:jm}=(0,p.createSlotFill)("__unstableBlockSettingsMenuFirstItem");$m.Slot=jm;var Km=$m;function qm(e){let{clientIds:t,isGroupable:n,isUngroupable:o,blocksSelection:l,groupingBlockName:i,onClose:s=(()=>{})}=e;const{replaceBlocks:c}=(0,m.useDispatch)(qn);return n||o?(0,a.createElement)(a.Fragment,null,n&&(0,a.createElement)(p.MenuItem,{onClick:()=>{(()=>{const e=(0,r.switchToBlockType)(l,i);e&&c(t,e)})(),s()}},(0,g._x)("Group","verb")),o&&(0,a.createElement)(p.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 Ym(){const{clientIds:e,isGroupable:t,isUngroupable:n,blocksSelection:o,groupingBlockName:l}=(0,m.useSelect)((e=>{var t;const{getBlockRootClientId:n,getBlocksByClientId:o,canInsertBlockType:l,getSelectedBlockClientIds:i}=e(qn),{getGroupingBlockName: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}}var Qm=(0,a.createElement)(O.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,a.createElement)(O.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 Xm=(0,a.createElement)(O.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,a.createElement)(O.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 Zm(e){return(0,m.useSelect)((t=>{const{canMoveBlock:n,canRemoveBlock:o,canLockBlockType:r,getBlockName:l,getBlockRootClientId:i}=t(qn),a=i(e),s=n(e,a),c=o(e,a);return{canMove:s,canRemove:c,canLock:r(l(e)),isLocked:!s||!c}}),[e])}function Jm(e){let{clientId:t,onClose:n}=e;const[o,r]=(0,a.useState)({move:!1,remove:!1}),{canMove:l,canRemove:i}=Zm(t),{updateBlockAttributes:s}=(0,m.useDispatch)(qn),c=Gp(t),u=(0,d.useInstanceId)(Jm,"block-editor-block-lock-modal__options-title");(0,a.useEffect)((()=>{r({move:!l,remove:!i})}),[l,i]);const f=Object.values(o).every(Boolean),h=Object.values(o).some(Boolean)&&!f;return(0,a.createElement)(p.Modal,{title:(0,g.sprintf)((0,g.__)("Lock %s"),c.title),overlayClassName:"block-editor-block-lock-modal",closeLabel:(0,g.__)("Close"),onRequestClose:n},(0,a.createElement)("form",{onSubmit:e=>{e.preventDefault(),s([t],{lock:o}),n()}},(0,a.createElement)("p",null,(0,g.__)("Choose specific attributes to restrict or lock all available options.")),(0,a.createElement)("div",{role:"group","aria-labelledby":u,className:"block-editor-block-lock-modal__options"},(0,a.createElement)(p.CheckboxControl,{className:"block-editor-block-lock-modal__options-title",label:(0,a.createElement)("span",{id:u},(0,g.__)("Lock all")),checked:f,indeterminate:h,onChange:e=>r({move:e,remove:e})}),(0,a.createElement)("ul",{className:"block-editor-block-lock-modal__checklist"},(0,a.createElement)("li",{className:"block-editor-block-lock-modal__checklist-item"},(0,a.createElement)(p.CheckboxControl,{label:(0,a.createElement)(a.Fragment,null,(0,g.__)("Disable movement"),(0,a.createElement)(p.Icon,{icon:o.move?Xm:Qm})),checked:o.move,onChange:e=>r((t=>({...t,move:e})))})),(0,a.createElement)("li",{className:"block-editor-block-lock-modal__checklist-item"},(0,a.createElement)(p.CheckboxControl,{label:(0,a.createElement)(a.Fragment,null,(0,g.__)("Prevent removal"),(0,a.createElement)(p.Icon,{icon:o.remove?Xm:Qm})),checked:o.remove,onChange:e=>r((t=>({...t,remove:e})))})))),(0,a.createElement)(p.Flex,{className:"block-editor-block-lock-modal__actions",justify:"flex-end",expanded:!1},(0,a.createElement)(p.FlexItem,null,(0,a.createElement)(p.Button,{variant:"tertiary",onClick:n},(0,g.__)("Cancel"))),(0,a.createElement)(p.FlexItem,null,(0,a.createElement)(p.Button,{variant:"primary",type:"submit"},(0,g.__)("Apply"))))))}function ef(e){let{clientId:t}=e;const{canLock:n,isLocked:o}=Zm(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)(p.MenuItem,{icon:o?Qm:Xm,onClick:l},i),r&&(0,a.createElement)(Jm,{clientId:t,onClose:l}))}const{Fill:tf,Slot:nf}=(0,p.createSlotFill)("BlockSettingsMenuControls");function of(e){let{...t}=e;return(0,a.createElement)(p.__experimentalStyleProvider,{document:document},(0,a.createElement)(tf,t))}of.Slot=e=>{let{fillProps:t,clientIds:n=null}=e;const{selectedBlocks:o,selectedClientIds:r,canRemove:l}=(0,m.useSelect)((e=>{const{getBlocksByClientId:t,getSelectedBlockClientIds:o,canRemoveBlocks:r}=e(qn),l=null!==n?n:o();return{selectedBlocks:(0,u.map)((0,u.compact)(t(l)),(e=>e.name)),selectedClientIds:l,canRemove:r(l)}}),[n]),s=1===r.length,c=Ym(),{isGroupable:d,isUngroupable:f}=c,g=(d||f)&&l;return(0,a.createElement)(nf,{fillProps:{...t,selectedBlocks:o,selectedClientIds:r}},(e=>!(null!=e&&e.length)>0&&!g&&!s?null:(0,a.createElement)(p.MenuGroup,null,s&&(0,a.createElement)(ef,{clientId:r[0]}),e,g&&(0,a.createElement)(qm,i({},c,{onClose:null==t?void 0:t.onClose})))))};var rf=of;const lf={className:"block-editor-block-settings-menu__popover",position:"bottom right",isAlternate:!0};function af(e){let{blocks:t,onCopy:n}=e;const o=(0,d.useCopyToClipboard)((()=>(0,r.serialize)(t)),n);return(0,a.createElement)(p.MenuItem,{ref:o},(0,g.__)("Copy"))}var sf=function(e){let{clientIds:t,__experimentalSelectBlock:n,children:o,...l}=e;const s=(0,u.castArray)(t),c=s.length,d=s[0],{firstParentClientId:f,hasReducedUI:h,onlyBlock:v,parentBlockType:b,previousBlockClientId:k,nextBlockClientId:_,selectedBlockClientIds:y}=(0,m.useSelect)((e=>{const{getBlockCount:t,getBlockName:n,getBlockParents:o,getPreviousBlockClientId:l,getNextBlockClientId:i,getSelectedBlockClientIds:a,getSettings:s}=e(qn),c=o(d),u=c[c.length-1],p=n(u);return{firstParentClientId:u,hasReducedUI:s().hasReducedUI,onlyBlock:1===t(),parentBlockType:(0,r.getBlockType)(p),previousBlockClientId:l(d),nextBlockClientId:i(d),selectedBlockClientIds:a()}}),[d]),E=(0,m.useSelect)((e=>{const{getShortcutRepresentation:t}=e(tu.store);return{duplicate:t("core/block-editor/duplicate"),remove:t("core/block-editor/remove"),insertAfter:t("core/block-editor/insert-after"),insertBefore:t("core/block-editor/insert-before")}}),[]),{selectBlock:C,toggleBlockHighlight:w}=(0,m.useDispatch)(qn),S=(0,a.useCallback)(n?async e=>{const t=await e;t&&t[0]&&n(t[0])}:u.noop,[n]),B=Up(d,25),I=(0,a.useCallback)(n?()=>{const e=k||_;e&&y.includes(d)&&!y.includes(e)&&n(e)}:u.noop,[n,k,_,y]),x=(0,g.sprintf)((0,g.__)("Remove %s"),B),T=1===c?x:(0,g.__)("Remove blocks"),N=(0,a.useRef)(),{gestures:P}=dm({ref:N,onChange(e){e&&h||w(f,e)}});return(0,a.createElement)(Gm,{clientIds:t,__experimentalUpdateSelection:!n},(e=>{let{canDuplicate:n,canInsertDefaultBlock:r,canMove:s,canRemove:m,onDuplicate:h,onInsertAfter:k,onInsertBefore:_,onRemove:y,onCopy:w,onMoveTo:B,blocks:x}=e;return(0,a.createElement)(p.DropdownMenu,i({icon:Dm,label:(0,g.__)("Options"),className:"block-editor-block-settings-menu",popoverProps:lf,noIcons:!0},l),(e=>{let{onClose:l}=e;return(0,a.createElement)(a.Fragment,null,(0,a.createElement)(p.MenuGroup,null,(0,a.createElement)(Km.Slot,{fillProps:{onClose:l}}),void 0!==f&&(0,a.createElement)(p.MenuItem,i({},P,{ref:N,icon:(0,a.createElement)(Wc,{icon:b.icon}),onClick:()=>C(f)}),(0,g.sprintf)((0,g.__)("Select parent block (%s)"),b.title)),1===c&&(0,a.createElement)(Wm,{clientId:d}),(0,a.createElement)(af,{blocks:x,onCopy:w}),n&&(0,a.createElement)(p.MenuItem,{onClick:(0,u.flow)(l,h,S),shortcut:E.duplicate},(0,g.__)("Duplicate")),r&&(0,a.createElement)(a.Fragment,null,(0,a.createElement)(p.MenuItem,{onClick:(0,u.flow)(l,_),shortcut:E.insertBefore},(0,g.__)("Insert before")),(0,a.createElement)(p.MenuItem,{onClick:(0,u.flow)(l,k),shortcut:E.insertAfter},(0,g.__)("Insert after"))),s&&!v&&(0,a.createElement)(p.MenuItem,{onClick:(0,u.flow)(l,B)},(0,g.__)("Move to")),1===c&&(0,a.createElement)(Um,{clientId:d,onToggle:l})),(0,a.createElement)(rf.Slot,{fillProps:{onClose:l},clientIds:t}),"function"==typeof o?o({onClose:l}):a.Children.map((e=>(0,a.cloneElement)(e,{onClose:l}))),m&&(0,a.createElement)(p.MenuGroup,null,(0,a.createElement)(p.MenuItem,{onClick:(0,u.flow)(l,y,I),shortcut:E.remove},T)))}))}))};var cf=function(e){let{clientIds:t,...n}=e;return(0,a.createElement)(p.ToolbarGroup,null,(0,a.createElement)(p.ToolbarItem,null,(e=>(0,a.createElement)(sf,i({clientIds:t,toggleProps:e},n)))))};function uf(e){let{clientId:t}=e;const n=Gp(t),{canMove:o,canRemove:r,canLock:l}=Zm(t),[i,s]=(0,a.useReducer)((e=>!e),!1);return l?o&&r?null:(0,a.createElement)(a.Fragment,null,(0,a.createElement)(p.ToolbarGroup,{className:"block-editor-block-lock-toolbar"},(0,a.createElement)(p.ToolbarButton,{icon:Xm,label:(0,g.sprintf)((0,g.__)("Unlock %s"),n.title),onClick:s})),i&&(0,a.createElement)(Jm,{clientId:t,onClose:s})):null}var df=(0,a.createElement)(O.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,a.createElement)(O.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 pf=(0,a.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(O.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 mf=(0,a.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(O.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 ff={group:void 0,row:{type:"flex",flexWrap:"nowrap"},stack:{type:"flex",orientation:"vertical"}};var gf=function(){const{blocksSelection:e,clientIds:t,groupingBlockName:n,isGroupable:o}=Ym(),{replaceBlocks:l}=(0,m.useDispatch)(qn),{canRemove:i}=(0,m.useSelect)((e=>{const{canRemoveBlocks:n}=e(qn);return{canRemove:n(t)}}),[t]),s=function(){let o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"group";const i=(0,r.switchToBlockType)(e,n);i&&i.length>0&&(i[0].attributes.layout=ff[o],l(t,i))};return o&&i?(0,a.createElement)(p.ToolbarGroup,null,(0,a.createElement)(p.ToolbarButton,{icon:df,label:(0,g._x)("Group","verb"),onClick:s}),(0,a.createElement)(p.ToolbarButton,{icon:pf,label:(0,g._x)("Row","single horizontal line"),onClick:()=>s("row")}),(0,a.createElement)(p.ToolbarButton,{icon:mf,label:(0,g._x)("Stack","verb"),onClick:()=>s("stack")})):null};var hf=(0,a.createContext)("");var vf=e=>{let{hideDragHandle:t}=e;const{blockClientIds:n,blockClientId:o,blockType:l,hasFixedToolbar:s,hasReducedUI:u,isValid:f,isVisual:g}=(0,m.useSelect)((e=>{const{getBlockName:t,getBlockMode:n,getSelectedBlockClientIds:o,isBlockValid:l,getBlockRootClientId:i,getSettings:a}=e(qn),s=o(),c=s[0],u=i(c),d=a();return{blockClientIds:s,blockClientId:c,blockType:c&&(0,r.getBlockType)(t(c)),hasFixedToolbar:d.hasFixedToolbar,hasReducedUI:d.hasReducedUI,rootClientId:u,isValid:s.every((e=>l(e))),isVisual:s.every((e=>"visual"===n(e)))}}),[]),{toggleBlockHighlight:h}=(0,m.useDispatch)(qn),v=(0,a.useRef)(),{showMovers:b,gestures:k}=dm({ref:v,onChange(e){e&&u||h(o,e)}}),_=(0,d.useViewportMatch)("medium","<")||s;if(l&&!(0,r.hasBlockSupport)(l,"__experimentalToolbar",!0))return null;const y=_||b;if(0===n.length)return null;const E=f&&g,C=n.length>1,w=c()("block-editor-block-toolbar",y&&"is-showing-movers");return(0,a.createElement)("div",{className:w},!C&&!_&&(0,a.createElement)(pm,{clientIds:n}),(0,a.createElement)("div",i({ref:v},k),(E||C)&&(0,a.createElement)(p.ToolbarGroup,{className:"block-editor-block-toolbar__block-controls"},(0,a.createElement)(Mm,{clientIds:n}),!C&&(0,a.createElement)(uf,{clientId:n[0]}),(0,a.createElement)(im,{clientIds:n,hideDragHandle:t||u}))),E&&C&&(0,a.createElement)(gf,null),E&&(0,a.createElement)(a.Fragment,null,(0,a.createElement)(ro.Slot,{group:"parent",className:"block-editor-block-toolbar__slot"}),(0,a.createElement)(ro.Slot,{group:"block",className:"block-editor-block-toolbar__slot"}),(0,a.createElement)(ro.Slot,{className:"block-editor-block-toolbar__slot"}),(0,a.createElement)(ro.Slot,{group:"inline",className:"block-editor-block-toolbar__slot"}),(0,a.createElement)(ro.Slot,{group:"other",className:"block-editor-block-toolbar__slot"}),(0,a.createElement)(hf.Provider,{value:null==l?void 0:l.name},(0,a.createElement)(Am.Slot,null))),(0,a.createElement)(cf,{clientIds:n}))};var bf=function(e){let{focusOnMount:t,isFixed:n,...o}=e;const{blockType:l,hasParents:s,showParentSelector:u}=(0,m.useSelect)((e=>{const{getBlockName:t,getBlockParents:n,getSelectedBlockClientIds:o}=e(qn),{getBlockType:l}=e(r.store),i=o(),a=i[0],s=n(a),c=l(t(s[s.length-1]));return{blockType:a&&l(t(a)),hasParents:s.length,showParentSelector:(0,r.hasBlockSupport)(c,"__experimentalParentSelector",!0)&&i.length<=1}}),[]);if(l&&!(0,r.hasBlockSupport)(l,"__experimentalToolbar",!0))return null;const d=c()("block-editor-block-contextual-toolbar",{"has-parent":s&&u,"is-fixed":n});return(0,a.createElement)(Yp,i({focusOnMount:t,className:d,"aria-label":(0,g.__)("Block tools")},o),(0,a.createElement)(vf,{hideDragHandle:n}))};function kf(e){const{isNavigationMode:t,isMultiSelecting:n,hasMultiSelection:o,isTyping:r,isCaretWithinFormattedText:l,getSettings:i,getLastMultiSelectedBlockClientId:a}=e(qn);return{isNavigationMode:t(),isMultiSelecting:n(),isTyping:r(),isCaretWithinFormattedText:l(),hasMultiSelection:o(),hasFixedToolbar:i().hasFixedToolbar,lastClientId:a()}}function _f(e){let{clientId:t,rootClientId:n,isValid:o,isEmptyDefaultBlock:r,capturingClientId:l,__unstablePopoverSlot:i,__unstableContentRef:s}=e;const{isNavigationMode:u,isMultiSelecting:f,isTyping:g,isCaretWithinFormattedText:h,hasMultiSelection:v,hasFixedToolbar:b,lastClientId:k}=(0,m.useSelect)(kf,[]),_=(0,m.useSelect)((e=>{const{isBlockInsertionPointVisible:n,getBlockInsertionPoint:o,getBlockOrder:r}=e(qn);if(!n())return!1;const l=o();return r(l.rootClientId)[l.index]===t}),[t]),y=(0,d.useViewportMatch)("medium"),[E,C]=(0,a.useState)(!1),[w,S]=(0,a.useState)(!1),{stopTyping:B}=(0,m.useDispatch)(qn),I=!g&&!u&&r&&o,x=u,T=!u&&!b&&y&&!I&&!f&&(!g||h),N=!(u||T||b||r);(0,tu.useShortcut)("core/block-editor/focus-toolbar",(()=>{C(!0),B(!0)}),{isDisabled:!N}),(0,a.useEffect)((()=>{T||C(!1)}),[T]);const P=(0,a.useRef)(),M=Co(t),R=Co(k),L=Co(l),A=Ap(s);if(!(x||T||E||I))return null;let D=M;if(!D)return null;l&&(D=L);let O=D;if(v){if(!R)return null;O={top:D,bottom:R}}const F=I?"top left right":"top right left",{ownerDocument:z}=D,V=I?void 0:z.defaultView.frameElement||(0,Jr.getScrollContainer)(D)||z.body;return(0,a.createElement)(p.Popover,{ref:A,noArrow:!0,animate:!1,position:F,focusOnMount:!1,anchorRef:O,className:c()("block-editor-block-list__block-popover",{"is-insertion-point-visible":_}),__unstableStickyBoundaryElement:V,__unstableSlotName:i||null,__unstableBoundaryParent:!0,__unstableObserveElement:D,shouldAnchorIncludePadding:!0,__unstableEditorCanvasWrapper:null==s?void 0:s.current},(T||E)&&(0,a.createElement)("div",{onFocus:function(){S(!0)},onBlur:function(){S(!1)},tabIndex:-1,className:c()("block-editor-block-list__block-popover-inserter",{"is-visible":w})},(0,a.createElement)(Tp,{clientId:t,rootClientId:n,__experimentalIsQuick:!0})),(T||E)&&(0,a.createElement)(bf,{focusOnMount:E,__experimentalInitialIndex:P.current,__experimentalOnIndexChange:e=>{P.current=e},key:t}),x&&(0,a.createElement)(jp,{clientId:t,rootClientId:n,blockElement:D}),I&&(0,a.createElement)("div",{className:"block-editor-block-list__empty-block-inserter"},(0,a.createElement)(Tp,{position:"bottom right",rootClientId:n,clientId:t,__experimentalIsQuick:!0})))}function yf(e){const{getSelectedBlockClientId:t,getFirstMultiSelectedBlockClientId:n,getBlockRootClientId:o,getBlock:l,getBlockParents:i,__experimentalGetBlockListSettingsForBlocks:a}=e(qn),s=t()||n();if(!s)return;const{name:c,attributes:d={},isValid:p}=l(s)||{},m=i(s),f=a(m),g=(0,u.find)(m,(e=>{var t;return null===(t=f[e])||void 0===t?void 0:t.__experimentalCaptureToolbars}));return{clientId:s,rootClientId:o(s),name:c,isValid:p,isEmptyDefaultBlock:c&&(0,r.isUnmodifiedDefaultBlock)({name:c,attributes:d}),capturingClientId:g}}function Ef(e){let{__unstablePopoverSlot:t,__unstableContentRef:n}=e;const o=(0,m.useSelect)(yf,[]);if(!o)return null;const{clientId:r,rootClientId:l,name:i,isValid:s,isEmptyDefaultBlock:c,capturingClientId:u}=o;return i?(0,a.createElement)(_f,{clientId:r,rootClientId:l,isValid:s,isEmptyDefaultBlock:c,capturingClientId:u,__unstablePopoverSlot:t,__unstableContentRef:n}):null}function Cf(e){let{children:t}=e;const n=(0,a.useContext)(Dp),o=(0,a.useContext)(p.Disabled.Context);return n||o?t:(Vt()('wp.components.Popover.Slot name="block-toolbar"',{alternative:"wp.blockEditor.BlockTools",since:"5.8"}),(0,a.createElement)(Fp,{__unstablePopoverSlot:"block-toolbar"},(0,a.createElement)(Ef,{__unstablePopoverSlot:"block-toolbar"}),t))}var wf=(0,d.createHigherOrderComponent)((e=>t=>{const{clientId:n}=Zn();return(0,a.createElement)(e,i({},t,{clientId:n}))}),"withClientId");var Sf=wf((e=>{let{clientId:t,showSeparator:n,isFloating:o,onAddBlock:r,isToggle:l}=e;return(0,a.createElement)(Rp,{className:c()({"block-list-appender__toggle":l}),rootClientId:t,showSeparator:n,isFloating:o,onAddBlock:r})}));var Bf=(0,d.compose)([wf,(0,m.withSelect)(((e,t)=>{let{clientId:n}=t;const{getBlockOrder:o}=e(qn),r=o(n);return{lastBlockClientId:(0,u.last)(r)}}))])((e=>{let{clientId:t}=e;return(0,a.createElement)(Np,{rootClientId:t})})),If=window.wp.isShallowEqual,xf=n.n(If);const Tf=new WeakMap;function Nf(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&&re(qn).getSettings().mediaUpload),[]),{canInsertBlockType:o,getBlockIndex:l,getClientIdsOfDescendants:i}=(0,m.useSelect)(qn),{insertBlocks:a,moveBlocksToPosition:s,updateBlockAttributes:c,clearSelectedBlock:u}=(0,m.useDispatch)(qn),d=Nf(e,t,l,i,s,a,u),p=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,Jr.getFilesFromDataTransfer)(e.dataTransfer),n=e.dataTransfer.getData("text/html");n?f(n):t.length?p(t):d(e)}}function Mf(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:i2&&void 0!==arguments[2]?arguments[2]:["top","bottom","left","right"];return r.forEach((r=>{const l=Mf(e,t,r);(void 0===n||l{const a=e.getBoundingClientRect(),[s,c]=Rf(t,a,o);if(void 0===i||s0&&void 0!==arguments[0]?arguments[0]:{};const[t,n]=(0,a.useState)(null),o=(0,m.useSelect)((t=>{const{getTemplateLock:n}=t(qn);return"all"===n(e)}),[e]),{getBlockListSettings:r}=(0,m.useSelect)(qn),{showInsertionPoint:l,hideInsertionPoint:i}=(0,m.useDispatch)(qn),s=Pf(e,t),c=(0,d.useThrottle)((0,a.useCallback)(((t,o)=>{var i;const a=Lf(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 Df(e){const{clientId:t,allowedBlocks:n,__experimentalDefaultBlock:o,__experimentalDirectInsert:l,template:i,templateLock:s,wrapperRef:c,templateInsertUpdatesSelection:d,__experimentalCaptureToolbars:p,__experimentalAppenderTagName:f,renderAppender:g,orientation:h,placeholder:v,__experimentalLayout:b}=e;!function(e,t,n,o,r,l,i,s){const{updateBlockListSettings:c}=(0,m.useDispatch)(qn),{blockListSettings:u,parentLock:d}=(0,m.useSelect)((t=>{const n=t(qn).getBlockRootClientId(e);return{blockListSettings:t(qn).getBlockListSettings(e),parentLock:t(qn).getTemplateLock(n)}}),[e]),p=(0,a.useMemo)((()=>t),t);(0,a.useLayoutEffect)((()=>{const t={allowedBlocks:p,templateLock:void 0===r?d:r};if(void 0!==l&&(t.__experimentalCaptureToolbars=l),void 0!==i)t.orientation=i;else{const e=Ir(null==s?void 0:s.type);t.orientation=e.getOrientation(s)}void 0!==n&&(t.__experimentalDefaultBlock=n),void 0!==o&&(t.__experimentalDirectInsert=o),xf()(u,t)||c(e,t)}),[e,u,p,n,o,r,d,l,i,c,s])}(t,n,o,l,s,p,h,b),function(e,t,n,o){const{getSelectedBlocksInitialCaretPosition:l}=(0,m.useSelect)(qn),{replaceInnerBlocks:i}=(0,m.useDispatch)(qn),s=(0,m.useSelect)((t=>t(qn).getBlocks(e)),[e]),c=(0,a.useRef)(null);(0,a.useLayoutEffect)((()=>{if((0===s.length||"all"===n)&&!(0,u.isEqual)(t,c.current)){c.current=t;const n=(0,r.synchronizeBlocksWithTemplate)(s,t);(0,u.isEqual)(n,s)||i(e,n,0===s.length&&o&&0!==n.length,l())}}),[s,t,n,e])}(t,i,s,d);const k=(0,m.useSelect)((e=>{const n=e(qn).getBlock(t),o=(0,r.getBlockType)(n.name);if(o&&o.providesContext)return function(e,t){Tf.has(t)||Tf.set(t,new WeakMap);const n=Tf.get(t);if(!n.has(e)){const o=(0,u.mapValues)(t.providesContext,(t=>e[t]));n.set(e,o)}return n.get(e)}(n.attributes,o)}),[t]);return(0,a.createElement)(tl,{value:k},(0,a.createElement)(jf,{rootClientId:t,renderAppender:g,__experimentalAppenderTagName:f,__experimentalLayout:b,wrapperRef:c,placeholder:v}))}function Of(e){return jc(e),(0,a.createElement)(Df,e)}const Ff=(0,a.forwardRef)(((e,t)=>{const n=zf({ref:t},e);return(0,a.createElement)("div",{className:"block-editor-inner-blocks"},(0,a.createElement)("div",n))}));function zf(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{clientId:n}=Zn(),o=(0,d.useViewportMatch)("medium","<"),{__experimentalCaptureToolbars:l,hasOverlay:s}=(0,m.useSelect)((e=>{if(!n)return{};const{getBlockName:t,isBlockSelected:l,hasSelectedInnerBlock:i,isNavigationMode:a}=e(qn),s=t(n),c=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,Af({rootClientId:n})]),p={__experimentalCaptureToolbars:l,...t},f=p.value&&p.onChange?Of:Df;return{...e,ref:u,className:c()(e.className,"block-editor-block-list__layout",{"has-overlay":s}),children:n?(0,a.createElement)(f,i({},p,{clientId:n})):(0,a.createElement)(jf,t)}}zf.save=r.__unstableGetInnerBlocksProps,Ff.DefaultBlockAppender=Bf,Ff.ButtonBlockAppender=Sf,Ff.Content=()=>zf.save().children;var Vf=Ff;const Hf=(0,a.createContext)(),Gf=(0,a.createContext)();function Uf(e){let{className:t,...n}=e;const[o,r]=(0,a.useState)(),l=(0,d.useViewportMatch)("medium"),{isOutlineMode:i,isFocusMode:s,isNavigationMode:u}=(0,m.useSelect)((e=>{const{getSettings:t,isNavigationMode:n}=e(qn),{outlineMode:o,focusMode:r}=t();return{isOutlineMode:o,isFocusMode:r,isNavigationMode:n()}}),[]),p=zf({ref:(0,d.useMergeRefs)([Yc(),zp(),r]),className:c()("is-root-container",t,{"is-outline-mode":i,"is-focus-mode":s&&l,"is-navigate-mode":u})},n);return(0,a.createElement)(Hf.Provider,{value:o},(0,a.createElement)("div",p))}function Wf(e){return function(){const e=(0,m.useSelect)((e=>e(qn).getSettings().__experimentalBlockPatterns),[]);(0,a.useEffect)((()=>{if(null==e||!e.length)return;let t,n=-1;const o=()=>{n++,n>=e.length||((0,m.select)(qn).__experimentalGetParsedPattern(e[n].name),t=Vp(o))};return t=Vp(o),()=>Hp(t)}),[e])}(),(0,a.createElement)(Cf,null,(0,a.createElement)(Xn,{value:Yn},(0,a.createElement)(Uf,e)))}function $f(e){let{placeholder:t,rootClientId:n,renderAppender:o,__experimentalAppenderTagName:r,__experimentalLayout:l=xr}=e;const[i,s]=(0,a.useState)(new Set),c=(0,a.useMemo)((()=>{const{IntersectionObserver:e}=window;if(e)return new e((e=>{s((t=>{const n=new Set(t);for(const t of e){const e=t.target.getAttribute("data-block");n[t.isIntersecting?"add":"delete"](e)}return n}))}))}),[s]),{order:u,selectedBlocks:d}=(0,m.useSelect)((e=>{const{getBlockOrder:t,getSelectedBlockClientIds:o}=e(qn);return{order:t(n),selectedBlocks:o()}}),[n]);return(0,a.createElement)(Nr,{value:l},(0,a.createElement)(Gf.Provider,{value:c},u.map((e=>(0,a.createElement)(m.AsyncModeProvider,{key:e,value:!i.has(e)&&!d.includes(e)},(0,a.createElement)(Fc,{rootClientId:n,clientId:e}))))),u.length<1&&t,(0,a.createElement)(Lp,{tagName:r,rootClientId:n,renderAppender:o}))}function jf(e){return(0,a.createElement)(m.AsyncModeProvider,{value:!1},(0,a.createElement)($f,e))}Wf.__unstableElementContext=Hf;const Kf=["colors","disableCustomColors","gradients","disableCustomGradients"];function qf(e){let{colors:t,gradients:n,disableCustomColors:o,disableCustomGradients:r,__experimentalHasMultipleOrigins:l,__experimentalIsRenderedInSidebar:i,className:s,label:d,onColorChange:m,onGradientChange:f,colorValue:h,gradientValue:v,clearable:b,showTitle:k=!0,enableAlpha:_}=e;const y=m&&(!(0,u.isEmpty)(t)||!o),E=f&&(!(0,u.isEmpty)(n)||!r),[C,w]=(0,a.useState)(v?"gradient":!!y&&"color");return y||E?(0,a.createElement)(p.BaseControl,{className:c()("block-editor-color-gradient-control",s)},(0,a.createElement)("fieldset",{className:"block-editor-color-gradient-control__fieldset"},(0,a.createElement)(p.__experimentalVStack,{spacing:1},k&&(0,a.createElement)("legend",null,(0,a.createElement)("div",{className:"block-editor-color-gradient-control__color-indicator"},(0,a.createElement)(p.BaseControl.VisualLabel,null,d))),y&&E&&(0,a.createElement)(p.__experimentalToggleGroupControl,{value:C,onChange:w,label:(0,g.__)("Select color type"),hideLabelFromVision:!0,isBlock:!0},(0,a.createElement)(p.__experimentalToggleGroupControlOption,{value:"color",label:(0,g.__)("Solid")}),(0,a.createElement)(p.__experimentalToggleGroupControlOption,{value:"gradient",label:(0,g.__)("Gradient")})),("color"===C||!E)&&(0,a.createElement)(p.ColorPalette,{value:h,onChange:E?e=>{m(e),f()}:m,colors:t,disableCustomColors:o,__experimentalHasMultipleOrigins:l,__experimentalIsRenderedInSidebar:i,clearable:b,enableAlpha:_}),("gradient"===C||!y)&&(0,a.createElement)(p.GradientPicker,{value:v,onChange:y?e=>{f(e),m()}:f,gradients:n,disableCustomGradients:r,__experimentalHasMultipleOrigins:l,__experimentalIsRenderedInSidebar:i,clearable:b})))):null}function Yf(e){const t={};return t.colors=Io("color.palette"),t.gradients=Io("color.gradients"),t.disableCustomColors=!Io("color.custom"),t.disableCustomGradients=!Io("color.customGradient"),(0,a.createElement)(qf,i({},t,e))}var Qf=function(e){return(0,u.every)(Kf,(t=>e.hasOwnProperty(t)))?(0,a.createElement)(qf,e):(0,a.createElement)(Yf,e)};function Xf(e){let t,{colors:n,gradients:o,disableCustomColors:r,disableCustomGradients:l,__experimentalHasMultipleOrigins:s,__experimentalIsRenderedInSidebar:u,enableAlpha:d,settings:m}=e;return u&&(t="bottom left"),(0,a.createElement)(p.__experimentalItemGroup,{isBordered:!0,isSeparated:!0,className:"block-editor-panel-color-gradient-settings__item-group"},m.map(((e,m)=>e&&(0,a.createElement)(p.Dropdown,{key:m,position:t,className:"block-editor-panel-color-gradient-settings__dropdown",contentClassName:"block-editor-panel-color-gradient-settings__dropdown-content",renderToggle:t=>{var n;let{isOpen:o,onToggle:r}=t;return(0,a.createElement)(p.__experimentalItem,{onClick:r,className:c()("block-editor-panel-color-gradient-settings__item",{"is-open":o})},(0,a.createElement)(p.__experimentalHStack,{justify:"flex-start"},(0,a.createElement)(p.ColorIndicator,{className:"block-editor-panel-color-gradient-settings__color-indicator",colorValue:null!==(n=e.gradientValue)&&void 0!==n?n:e.colorValue}),(0,a.createElement)(p.FlexItem,null,e.label)))},renderContent:()=>(0,a.createElement)(Qf,i({showTitle:!1,colors:n,gradients:o,disableCustomColors:r,disableCustomGradients:l,__experimentalHasMultipleOrigins:s,__experimentalIsRenderedInSidebar:u,enableAlpha:d},e))}))))}function Zf(){return{disableCustomColors:!Io("color.custom"),disableCustomGradients:!Io("color.customGradient")}}function Jf(){const e=Zf(),t=Io("color.palette.custom"),n=Io("color.palette.theme"),o=Io("color.palette.default"),r=Io("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=Io("color.gradients.custom"),i=Io("color.gradients.theme"),s=Io("color.gradients.default"),c=Io("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}Gu([Uu,ju]);const eg=(e,t,n)=>{if(t){const n=(0,u.find)(e,{slug:t});if(n)return n}return{color:n}},tg=(e,t)=>(0,u.find)(e,{color:t});function ng(e,t){if(e&&t)return`has-${(0,u.kebabCase)(t)}-${e}`}const og=[];function rg(e){const{attributes:{borderColor:t,style:n},setAttributes:o}=e,r=Jf(),l=r.colors.reduce(((e,t)=>e.concat(t.colors)),[]),{color:s}=(null==n?void 0:n.border)||{},[c,u]=(0,a.useState)((()=>{var e;return null===(e=eg(l,t,s))||void 0===e?void 0:e.color}));(0,a.useEffect)((()=>{var e;u(null===(e=eg(l,t,s))||void 0===e?void 0:e.color)}),[t,s,l]);const d=[{label:(0,g.__)("Color"),onColorChange:e=>{u(e);const t=tg(l,e),r={...n,border:{...null==n?void 0:n.border,color:null!=t&&t.slug?void 0:e}},i=null!=t&&t.slug?t.slug:void 0;o({style:No(r),borderColor:i})},colorValue:c,clearable:!1}];return(0,a.createElement)(Xf,i({settings:d,disableCustomColors:!0,disableCustomGradients:!0,__experimentalHasMultipleOrigins:!0,__experimentalIsRenderedInSidebar:!0,enableAlpha:!0},r))}function lg(e,t,n){var o;if(!Ng(t,"color")||Ro(t,xg,"color"))return e;const{borderColor:r,style:l}=n,i=ng("border-color",r),a=c()(e.className,{"has-border-color":r||(null==l||null===(o=l.border)||void 0===o?void 0:o.color),[i]:!!i});return e.className=a||void 0,e}const ig=(0,d.createHigherOrderComponent)((e=>t=>{var n,o;const{name:r,attributes:l}=t,{borderColor:s}=l,c=Io("color.palette")||og;if(!Ng(r,"color")||Ro(r,xg,"color"))return(0,a.createElement)(e,t);const u={borderColor:s?null===(n=eg(c,s))||void 0===n?void 0:n.color:void 0};let d=t.wrapperProps;return d={...t.wrapperProps,style:{...u,...null===(o=t.wrapperProps)||void 0===o?void 0:o.style}},(0,a.createElement)(e,i({},t,{wrapperProps:d}))}));function ag(e){return[...e].sort(((t,n)=>e.filter((e=>e===n)).length-e.filter((e=>e===t)).length)).shift()}function sg(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if("string"==typeof e)return e;const t=Object.values(e).map((e=>(0,p.__experimentalParseQuantityAndUnitFromRawValue)(e))),n=t.map((e=>{var t;return null!==(t=e[0])&&void 0!==t?t:""})),o=t.map((e=>e[1])),r=n.every((e=>e===n[0]))?n[0]:"",l=ag(o),i=0===r||r?`${r}${l}`:void 0;return i}function cg(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=sg(e),n="string"!=typeof e&&isNaN(parseFloat(t));return n}function ug(e){if(!e)return!1;if("string"==typeof e)return!0;return!!Object.values(e).filter((e=>!!e||0===e)).length}function dg(e){let{onChange:t,values:n,...o}=e;const r=sg(n),l=ug(n)&&cg(n),s=l?(0,g.__)("Mixed"):null;return(0,a.createElement)(p.__experimentalUnitControl,i({},o,{"aria-label":(0,g.__)("Border radius"),disableUnits:l,isOnly:!0,value:r,onChange:t,placeholder:s}))}(0,l.addFilter)("blocks.registerBlockType","core/border/addAttributes",(function(e){return Ng(e,"color")?e.attributes.borderColor?e:{...e,attributes:{...e.attributes,borderColor:{type:"string"}}}:e})),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/border/addSaveProps",lg),(0,l.addFilter)("blocks.registerBlockType","core/border/addEditProps",(function(e){if(!Ng(e,"color")||Ro(e,xg,"color"))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),lg(o,e,n)},e})),(0,l.addFilter)("editor.BlockListBlock","core/border/with-border-color-palette-styles",ig);const pg={topLeft:(0,g.__)("Top left"),topRight:(0,g.__)("Top right"),bottomLeft:(0,g.__)("Bottom left"),bottomRight:(0,g.__)("Bottom right")};function mg(e){let{onChange:t,values:n,...o}=e;const r="string"!=typeof n?n:{topLeft:n,topRight:n,bottomLeft:n,bottomRight:n};return(0,a.createElement)("div",{className:"components-border-radius-control__input-controls-wrapper"},Object.entries(pg).map((e=>{let[n,l]=e;return(0,a.createElement)(p.__experimentalUnitControl,i({},o,{key:n,"aria-label":l,value:r[n],onChange:(s=n,e=>{t&&t({...r,[s]:e||void 0})})}));var s})))}var fg=(0,a.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(O.Path,{d:"M15.6 7.2H14v1.5h1.6c2 0 3.7 1.7 3.7 3.7s-1.7 3.7-3.7 3.7H14v1.5h1.6c2.8 0 5.2-2.3 5.2-5.2 0-2.9-2.3-5.2-5.2-5.2zM4.7 12.4c0-2 1.7-3.7 3.7-3.7H10V7.2H8.4c-2.9 0-5.2 2.3-5.2 5.2 0 2.9 2.3 5.2 5.2 5.2H10v-1.5H8.4c-2 0-3.7-1.7-3.7-3.7zm4.6.9h5.3v-1.5H9.3v1.5z"}));var gg=(0,a.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(O.Path,{d:"M15.6 7.3h-.7l1.6-3.5-.9-.4-3.9 8.5H9v1.5h2l-1.3 2.8H8.4c-2 0-3.7-1.7-3.7-3.7s1.7-3.7 3.7-3.7H10V7.3H8.4c-2.9 0-5.2 2.3-5.2 5.2 0 2.9 2.3 5.2 5.2 5.2H9l-1.4 3.2.9.4 5.7-12.5h1.4c2 0 3.7 1.7 3.7 3.7s-1.7 3.7-3.7 3.7H14v1.5h1.6c2.9 0 5.2-2.3 5.2-5.2 0-2.9-2.4-5.2-5.2-5.2z"}));function hg(e){let{isLinked:t,...n}=e;const o=t?(0,g.__)("Unlink Radii"):(0,g.__)("Link Radii");return(0,a.createElement)(p.Tooltip,{text:o},(0,a.createElement)(p.Button,i({},n,{className:"component-border-radius-control__linked-button",isPrimary:t,isSecondary:!t,isSmall:!0,icon:t?fg:gg,iconSize:16,"aria-label":o})))}const vg={topLeft:null,topRight:null,bottomLeft:null,bottomRight:null},bg={px:100,em:20,rem:20};function kg(e){let{onChange:t,values:n}=e;const[o,r]=(0,a.useState)(!ug(n)||!cg(n)),l=(0,p.__experimentalUseCustomUnits)({availableUnits:Io("spacing.units")||["px","em","rem"]}),i=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if("string"==typeof e){const[,t]=(0,p.__experimentalParseQuantityAndUnitFromRawValue)(e);return t||"px"}const t=Object.values(e).map((e=>{const[,t]=(0,p.__experimentalParseQuantityAndUnitFromRawValue)(e);return t}));return ag(t)||"px"}(n),s=l&&l.find((e=>e.value===i)),c=(null==s?void 0:s.step)||1,[u]=(0,p.__experimentalParseQuantityAndUnitFromRawValue)(sg(n));return(0,a.createElement)("fieldset",{className:"components-border-radius-control"},(0,a.createElement)("legend",null,(0,g.__)("Radius")),(0,a.createElement)("div",{className:"components-border-radius-control__wrapper"},o?(0,a.createElement)(a.Fragment,null,(0,a.createElement)(dg,{className:"components-border-radius-control__unit-control",values:n,min:0,onChange:t,units:l}),(0,a.createElement)(p.RangeControl,{className:"components-border-radius-control__range-control",value:null!=u?u:"",min:0,max:bg[i],initialPosition:0,withInputField:!1,onChange:e=>{t(void 0!==e?`${e}${i}`:void 0)},step:c})):(0,a.createElement)(mg,{min:0,onChange:t,values:n||vg,units:l}),(0,a.createElement)(hg,{onClick:()=>r(!o),isLinked:o})))}function _g(e){var t;const{attributes:{style:n},setAttributes:o}=e;return(0,a.createElement)(kg,{values:null==n||null===(t=n.border)||void 0===t?void 0:t.radius,onChange:e=>{let t={...n,border:{...null==n?void 0:n.border,radius:e}};void 0!==e&&""!==e||(t=No(t)),o({style:t})}})}var yg=(0,a.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none"},(0,a.createElement)(O.Path,{d:"M5 11.25h14v1.5H5z"}));var Eg=(0,a.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none"},(0,a.createElement)(O.Path,{fillRule:"evenodd",d:"M5 11.25h3v1.5H5v-1.5zm5.5 0h3v1.5h-3v-1.5zm8.5 0h-3v1.5h3v-1.5z",clipRule:"evenodd"}));var Cg=(0,a.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none"},(0,a.createElement)(O.Path,{fillRule:"evenodd",d:"M5.25 11.25h1.5v1.5h-1.5v-1.5zm3 0h1.5v1.5h-1.5v-1.5zm4.5 0h-1.5v1.5h1.5v-1.5zm1.5 0h1.5v1.5h-1.5v-1.5zm4.5 0h-1.5v1.5h1.5v-1.5z",clipRule:"evenodd"}));const wg=[{label:(0,g.__)("Solid"),icon:yg,value:"solid"},{label:(0,g.__)("Dashed"),icon:Eg,value:"dashed"},{label:(0,g.__)("Dotted"),icon:Cg,value:"dotted"}];function Sg(e){let{onChange:t,value:n}=e;return(0,a.createElement)("fieldset",{className:"components-border-style-control"},(0,a.createElement)("legend",null,(0,g.__)("Style")),(0,a.createElement)("div",{className:"components-border-style-control__buttons"},wg.map((e=>(0,a.createElement)(p.Button,{key:e.value,icon:e.icon,isSmall:!0,isPressed:e.value===n,onClick:()=>t(e.value===n?void 0:e.value),"aria-label":e.label})))))}const Bg=e=>{var t;const{attributes:{style:n},setAttributes:o}=e;return(0,a.createElement)(Sg,{value:null==n||null===(t=n.border)||void 0===t?void 0:t.style,onChange:e=>{const t={...n,border:{...null==n?void 0:n.border,style:e}};o({style:No(t)})}})};const Ig=e=>{const{attributes:{borderColor:t,style:n},setAttributes:o}=e,{width:r,color:l,style:i}=(null==n?void 0:n.border)||{},[s,c]=(0,a.useState)(),[u,d]=(0,a.useState)(),[m,f]=(0,a.useState)(),h=(0,p.__experimentalUseCustomUnits)({availableUnits:Io("spacing.units")||["px","em","rem"]});return(0,a.createElement)(p.__experimentalUnitControl,{value:r,label:(0,g.__)("Width"),min:0,onChange:e=>{let a={...n,border:{...null==n?void 0:n.border,width:e}},p=t;const g=0===parseFloat(e),h=0===parseFloat(r);g&&!h&&(d(t),f(l),c(i),p=void 0,a.border.color=void 0,a.border.style="none"),!g&&h&&("none"===i&&(a.border.style=s),void 0===t&&(p=u,a.border.color=m)),void 0!==e&&""!==e||(a=No(a)),o({borderColor:p,style:a})},units:h})};const xg="__experimentalBorder";function Tg(e){const{clientId:t}=e,n=Io("border.color")&&Ng(e.name,"color"),o=Io("border.radius")&&Ng(e.name,"radius"),l=Io("border.style")&&Ng(e.name,"style"),i=Io("border.width")&&Ng(e.name,"width");if([!n,!o,!l,!i].every(Boolean))return null;const s=(0,r.getBlockSupport)(e.name,[xg,"__experimentalDefaultControls"]),c=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return n=>{var o;return{...n,...t,style:{...n.style,border:{...null===(o=n.style)||void 0===o?void 0:o.border,[e]:void 0}}}}};return(0,a.createElement)(zo,{__experimentalGroup:"border"},i&&(0,a.createElement)(p.__experimentalToolsPanelItem,{className:"single-column",hasValue:()=>function(e){var t,n;return!(null===(t=e.attributes.style)||void 0===t||null===(n=t.border)||void 0===n||!n.width)}(e),label:(0,g.__)("Width"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:Pg(o,"width")})}(e),isShownByDefault:null==s?void 0:s.width,resetAllFilter:c("width"),panelId:t},(0,a.createElement)(Ig,e)),l&&(0,a.createElement)(p.__experimentalToolsPanelItem,{className:"single-column",hasValue:()=>function(e){var t,n;return!(null===(t=e.attributes.style)||void 0===t||null===(n=t.border)||void 0===n||!n.style)}(e),label:(0,g.__)("Style"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:Pg(o,"style")})}(e),isShownByDefault:null==s?void 0:s.style,resetAllFilter:c("style"),panelId:t},(0,a.createElement)(Bg,e)),n&&(0,a.createElement)(p.__experimentalToolsPanelItem,{hasValue:()=>function(e){var t;const{attributes:{borderColor:n,style:o}}=e;return!!n||!(null==o||null===(t=o.border)||void 0===t||!t.color)}(e),label:(0,g.__)("Color"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({borderColor:void 0,style:Pg(o,"color")})}(e),isShownByDefault:null==s?void 0:s.color,resetAllFilter:c("color",{borderColor:void 0}),panelId:t},(0,a.createElement)(rg,e)),o&&(0,a.createElement)(p.__experimentalToolsPanelItem,{hasValue:()=>function(e){var t,n;const o=null===(t=e.attributes.style)||void 0===t||null===(n=t.border)||void 0===n?void 0:n.radius;return"object"==typeof o?Object.entries(o).some(Boolean):!!o}(e),label:(0,g.__)("Radius"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:Pg(o,"radius")})}(e),isShownByDefault:null==s?void 0:s.radius,resetAllFilter:c("radius"),panelId:t},(0,a.createElement)(_g,e)))}function Ng(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,xg);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 Pg(e,t){return No({...e,border:{...null==e?void 0:e.border,[t]:void 0}})}function Mg(e){if(e)return`has-${e}-gradient-background`}function Rg(e,t){const n=(0,u.find)(e,["slug",t]);return n&&n.gradient}function Lg(e,t){return(0,u.find)(e,["gradient",t])}function Ag(e,t){const n=Lg(e,t);return n&&n.slug}function Dg(){let{gradientAttribute:e="gradient",customGradientAttribute:t="customGradient"}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{clientId:n}=Zn(),o=Io("color.gradients.custom"),r=Io("color.gradients.theme"),l=Io("color.gradients.default"),i=(0,a.useMemo)((()=>[...o||[],...r||[],...l||[]]),[o,r,l]),{gradient:s,customGradient:c}=(0,m.useSelect)((o=>{const{getBlockAttributes:r}=o(qn),l=r(n)||{};return{customGradient:l[t],gradient:l[e]}}),[n,e,t]),{updateBlockAttributes:u}=(0,m.useDispatch)(qn),d=(0,a.useCallback)((o=>{const r=Ag(i,o);u(n,r?{[e]:r,[t]:void 0}:{[e]:void 0,[t]:o})}),[i,n,u]),p=Mg(s);let f;return f=s?Rg(i,s):c,{gradientClass:p,gradientValue:f,setGradient:d}}Gu([Uu,ju]);var Og=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 m=s||o,f=c||r;if(!m&&!f)return null;const h=[{color:m,description:(0,g.__)("text color")},{color:f,description:(0,g.__)("link color")}],v=Vu(d),b=v.alpha()<1,k=v.brightness(),_={level:"AA",size:i||!1!==i&&l>=24?"large":"small"};let y="",E="";for(const e of h){if(!e.color)continue;const t=Vu(e.color),n=t.isReadable(v,_),o=t.alpha()<1;if(!n){if(b||o)continue;y=k{let{isOpen:t,onToggle:o}=e;return(0,a.createElement)(p.Button,{onClick:o,"aria-expanded":t,className:c()("block-editor-panel-color-gradient-settings__dropdown",{"is-open":t})},(0,a.createElement)(p.__experimentalHStack,{justify:"flex-start"},(0,a.createElement)(p.ColorIndicator,{className:"block-editor-panel-color-gradient-settings__color-indicator",colorValue:s}),(0,a.createElement)(p.FlexItem,null,n.label)))},renderContent:()=>(0,a.createElement)(Qf,i({showTitle:!1,__experimentalHasMultipleOrigins:!0,__experimentalIsRenderedInSidebar:!0,enableAlpha:!0},l))}))}function zg(e){return e.ownerDocument.defaultView.getComputedStyle(e)}function Vg(e){let{enableAlpha:t=!1,settings:n,clientId:o,enableContrastChecking:r=!0}=e;const[l,i]=(0,a.useState)(),[s,c]=(0,a.useState)(),[u,d]=(0,a.useState)(),p=Eo(o);return(0,a.useEffect)((()=>{var e;if(!r)return;if(!p.current)return;c(zg(p.current).color);const t=null===(e=p.current)||void 0===e?void 0:e.querySelector("a");t&&t.innerText&&d(zg(t).color);let n=p.current,o=zg(n).backgroundColor;for(;"rgba(0, 0, 0, 0)"===o&&n.parentNode&&n.parentNode.nodeType===n.parentNode.ELEMENT_NODE;)n=n.parentNode,o=zg(n).backgroundColor;i(o)})),(0,a.createElement)(zo,{__experimentalGroup:"color"},n.map(((e,n)=>(0,a.createElement)(Fg,{key:n,settings:e,panelId:o,enableAlpha:t}))),r&&(0,a.createElement)(Og,{backgroundColor:l,textColor:s,enableAlphaChecker:t,linkColor:u}))}const Hg="color",Gg=e=>{const t=(0,r.getBlockSupport)(e,Hg);return t&&(!0===t.link||!0===t.gradient||!1!==t.background||!1!==t.text)},Ug=e=>{if("web"!==a.Platform.OS)return!1;const t=(0,r.getBlockSupport)(e,Hg);return(0,u.isObject)(t)&&!!t.link},Wg=e=>{const t=(0,r.getBlockSupport)(e,Hg);return(0,u.isObject)(t)&&!!t.gradients},$g=e=>{const t=(0,r.getBlockSupport)(e,Hg);return t&&!1!==t.background},jg=e=>{const t=(0,r.getBlockSupport)(e,Hg);return t&&!1!==t.text},Kg=e=>t=>{var n,o,r,l,i,a,s,c,u,d;return"background"===e?!!(t.attributes.backgroundColor||null!==(r=t.attributes.style)&&void 0!==r&&null!==(l=r.color)&&void 0!==l&&l.background||t.attributes.gradient||null!==(i=t.attributes.style)&&void 0!==i&&null!==(a=i.color)&&void 0!==a&&a.gradient):"link"===e?!(null===(s=t.attributes.style)||void 0===s||null===(c=s.elements)||void 0===c||null===(u=c.link)||void 0===u||null===(d=u.color)||void 0===d||!d.text):!!t.attributes[`${e}Color`]||!(null===(n=t.attributes.style)||void 0===n||null===(o=n.color)||void 0===o||!o[e])},qg=(e,t)=>No(Po(t,e,void 0)),Yg=e=>({textColor:void 0,style:qg(["color","text"],e.style)}),Qg=e=>({style:qg(["elements","link","color","text"],e.style)}),Xg=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 Zg(e,t,n){var o,r,l,i,a,s;if(!Gg(t)||Ro(t,Hg))return e;const u=Wg(t),{backgroundColor:d,textColor:p,gradient:m,style:f}=n,g=e=>!Ro(t,Hg,e),h=g("text")?ng("color",p):void 0,v=g("gradients")?Mg(m):void 0,b=g("background")?ng("background-color",d):void 0,k=g("background")||g("gradients"),_=d||(null==f||null===(o=f.color)||void 0===o?void 0:o.background)||u&&(m||(null==f||null===(r=f.color)||void 0===r?void 0:r.gradient)),y=c()(e.className,h,v,{[b]:!(u&&null!=f&&null!==(l=f.color)&&void 0!==l&&l.gradient||!b),"has-text-color":g("text")&&(p||(null==f||null===(i=f.color)||void 0===i?void 0:i.text)),"has-background":k&&_,"has-link-color":g("link")&&(null==f||null===(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 Jg=(e,t)=>{const n=/var:preset\|color\|(.+)/.exec(t);return n&&n[1]?eg(e,n[1]).color:t};function eh(e){var t,n,o,l,i,s,c,u,d;const{name:p,attributes:m}=e,f=Io("color.palette.custom"),h=Io("color.palette.theme"),v=Io("color.palette.default"),b=(0,a.useMemo)((()=>[...f||[],...h||[],...v||[]]),[f,h,v]),k=Io("color.gradients.custom"),_=Io("color.gradients.theme"),y=Io("color.gradients.default"),E=(0,a.useMemo)((()=>[...k||[],..._||[],...y||[]]),[k,_,y]),C=Io("color.custom"),w=Io("color.customGradient"),S=Io("color.background"),B=Io("color.link"),I=Io("color.text"),x=C||!h||(null==h?void 0:h.length)>0,T=w||!_||(null==_?void 0:_.length)>0,N=(0,a.useRef)(m);if((0,a.useEffect)((()=>{N.current=m}),[m]),!Gg(p))return null;const P=Ug(p)&&B&&x,M=jg(p)&&I&&x,R=$g(p)&&S&&x,L=Wg(p)&&T;if(!(P||M||R||L))return null;const{style:A,textColor:D,backgroundColor:O,gradient:F}=m;let z;if(L&&F)z=Rg(E,F);else if(L){var V;z=null==A||null===(V=A.color)||void 0===V?void 0:V.gradient}const H=t=>n=>{var o,r;const l=tg(b,n),i=t+"Color",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:No(a),[i]:s};e.setAttributes(c),N.current={...N.current,...c}},G=!("web"!==a.Platform.OS||F||null!=A&&null!==(t=A.color)&&void 0!==t&&t.gradient),U=(0,r.getBlockSupport)(e.name,[Hg,"__experimentalDefaultControls"]);return(0,a.createElement)(Vg,{enableContrastChecking:G,clientId:e.clientId,enableAlpha:!0,settings:[...M?[{label:(0,g.__)("Text"),onColorChange:H("text"),colorValue:eg(b,D,null==A||null===(n=A.color)||void 0===n?void 0:n.text).color,isShownByDefault:null==U?void 0:U.text,hasValue:()=>Kg("text")(e),onDeselect:()=>(e=>{let{attributes:t,setAttributes:n}=e;n({textColor:void 0,style:qg(["color","text"],t.style)})})(e),resetAllFilter:Yg}]:[],...R||L?[{label:(0,g.__)("Background"),onColorChange:R?H("background"):void 0,colorValue:eg(b,O,null==A||null===(o=A.color)||void 0===o?void 0:o.background).color,gradientValue:z,onGradientChange:L?t=>{const n=Ag(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:No(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:No(e),gradient:void 0}}e.setAttributes(o),N.current={...N.current,...o}}:void 0,isShownByDefault:null==U?void 0:U.background,hasValue:()=>Kg("background")(e),onDeselect:()=>(e=>{let{attributes:t,setAttributes:n}=e;n(Xg(t))})(e),resetAllFilter:Xg}]:[],...P?[{label:(0,g.__)("Link"),onColorChange:t=>{const n=tg(b,t),o=null!=n&&n.slug?`var:preset|color|${n.slug}`:t,r=No(Po(A,["elements","link","color","text"],o));e.setAttributes({style:r})},colorValue:Jg(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==U?void 0:U.link,hasValue:()=>Kg("link")(e),onDeselect:()=>(e=>{let{attributes:t,setAttributes:n}=e;n({style:qg(["elements","link","color","text"],t.style)})})(e),resetAllFilter:Qg}]:[]]})}const th=(0,d.createHigherOrderComponent)((e=>t=>{var n;const{name:o,attributes:r}=t,{backgroundColor:l,textColor:s}=r,c=Io("color.palette.custom")||[],u=Io("color.palette.theme")||[],d=Io("color.palette.default")||[],p=(0,a.useMemo)((()=>[...c||[],...u||[],...d||[]]),[c,u,d]);if(!Gg(o)||Ro(o,Hg))return(0,a.createElement)(e,t);const m={};var f,g;s&&!Ro(o,Hg,"text")&&(m.color=null===(f=eg(p,s))||void 0===f?void 0:f.color);l&&!Ro(o,Hg,"background")&&(m.backgroundColor=null===(g=eg(p,l))||void 0===g?void 0:g.color);let h=t.wrapperProps;return h={...t.wrapperProps,style:{...m,...null===(n=t.wrapperProps)||void 0===n?void 0:n.style}},(0,a.createElement)(e,i({},t,{wrapperProps:h}))})),nh={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 Gg(e)?(e.attributes.backgroundColor||Object.assign(e.attributes,{backgroundColor:{type:"string"}}),e.attributes.textColor||Object.assign(e.attributes,{textColor:{type:"string"}}),Wg(e)&&!e.attributes.gradient&&Object.assign(e.attributes,{gradient:{type:"string"}}),e):e})),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/color/addSaveProps",Zg),(0,l.addFilter)("blocks.registerBlockType","core/color/addEditProps",(function(e){if(!Gg(e)||Ro(e,Hg))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),Zg(o,e,n)},e})),(0,l.addFilter)("editor.BlockListBlock","core/color/with-color-palette-styles",th),(0,l.addFilter)("blocks.switchToBlockType.transformedBlock","core/color/addTransforms",(function(e,t,n,o){const r=e.name;return Mo({linkColor:Ug(r),textColor:jg(r),backgroundColor:$g(r),gradient:Wg(r)},nh,e,t,n,o)}));const oh=[{name:(0,g._x)("Regular","font style"),value:"normal"},{name:(0,g._x)("Italic","font style"),value:"italic"}],rh=[{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"}],lh=(e,t)=>e?t?(0,g.__)("Appearance"):(0,g.__)("Font style"):(0,g.__)("Font weight");function ih(e){const{onChange:t,hasFontStyles:n=!0,hasFontWeights:o=!0,value:{fontStyle:r,fontWeight:l}}=e,i=n||o,s=lh(n,o),c={key:"default",name:(0,g.__)("Default"),style:{fontStyle:void 0,fontWeight:void 0}},u=(0,a.useMemo)((()=>n&&o?(()=>{const e=[c];return oh.forEach((t=>{let{name:n,value:o}=t;rh.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=[c];return oh.forEach((t=>{let{name:n,value:o}=t;e.push({key:o,name:n,style:{fontStyle:o,fontWeight:void 0}})})),e})():(()=>{const e=[c];return rh.forEach((t=>{let{name:n,value:o}=t;e.push({key:o,name:n,style:{fontStyle:void 0,fontWeight:o}})})),e})()),[e.options]),d=u.find((e=>e.style.fontStyle===r&&e.style.fontWeight===l))||u[0];return i&&(0,a.createElement)(p.CustomSelectControl,{className:"components-font-appearance-control",label:s,describedBy:d?n?o?(0,g.sprintf)((0,g.__)("Currently selected font appearance: %s"),d.name):(0,g.sprintf)((0,g.__)("Currently selected font style: %s"),d.name):(0,g.sprintf)((0,g.__)("Currently selected font weight: %s"),d.name):(0,g.__)("No selected font appearance"),options:u,value:d,onChange:e=>{let{selectedItem:n}=e;return t(n.style)}})}const ah=1.5,sh=.1;var ch=e=>{let{value:t,onChange:n,__nextHasNoMarginBottom:o=!1,__unstableInputWidth:r="60px"}=e;const l=function(e){return void 0!==e&&""!==e}(t),i=l?t:"";o||Vt()("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 s=o?void 0:{marginBottom:24};return(0,a.createElement)("div",{className:"block-editor-line-height-control",style:s},(0,a.createElement)(p.__experimentalNumberControl,{__unstableInputWidth:r,__unstableStateReducer:(e,t)=>{var n;const o=["insertText","insertFromPaste"].includes(null===(n=t.payload.event.nativeEvent)||void 0===n?void 0:n.inputType),r=((e,t)=>{if(l)return e;switch(`${e}`){case"0.1":return 1.6;case"0":return t?e:1.4;case"":return ah;default:return e}})(e.value,o);return{...e,value:r}},onChange:n,label:(0,g.__)("Line height"),placeholder:ah,step:sh,value:i,min:0}))};const uh="typography.lineHeight";function dh(e){var t;const{attributes:{style:n},setAttributes:o}=e;return(0,a.createElement)(ch,{__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:No(t)})}})}function ph(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!Io("typography.lineHeight");return!(0,r.hasBlockSupport)(e,uh)||t}const mh="typography.__experimentalFontStyle",fh="typography.__experimentalFontWeight";function gh(e){var t,n;const{attributes:{style:o},setAttributes:r}=e,l=!hh(e),i=!vh(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)(ih,{onChange:e=>{r({style:No({...o,typography:{...null==o?void 0:o.typography,fontStyle:e.fontStyle,fontWeight:e.fontWeight}})})},hasFontStyles:l,hasFontWeights:i,value:{fontStyle:s,fontWeight:c}})}function hh(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=(0,r.hasBlockSupport)(e,mh),n=Io("typography.fontStyle");return!t||!n}function vh(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=(0,r.hasBlockSupport)(e,fh),n=Io("typography.fontWeight");return!t||!n}function bh(e){const t=hh(e),n=vh(e);return t&&n}function kh(e){let{value:t="",onChange:n,fontFamilies:o,...r}=e;const l=Io("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)(p.SelectControl,i({label:(0,g.__)("Font family"),options:s,value:t,onChange:n,labelPosition:"top"},r))}const _h="typography.__experimentalFontFamily";function yh(e,t,n){if(!(0,r.hasBlockSupport)(t,_h))return e;if(Ro(t,Jh,"fontFamily"))return e;if(null==n||!n.fontFamily)return e;const o=new(bm())(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 Eh(e){var t;let{setAttributes:n,attributes:{fontFamily:o}}=e;const r=Io("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)(kh,{className:"block-editor-hooks-font-family-control",fontFamilies:r,value:l,onChange:function(e){const t=(0,u.find)(r,(t=>{let{fontFamily:n}=t;return n===e}));n({fontFamily:null==t?void 0:t.slug})}})}function Ch(e){let{name:t}=e;const n=Io("typography.fontFamilies");return!n||0===n.length||!(0,r.hasBlockSupport)(t,_h)}(0,l.addFilter)("blocks.registerBlockType","core/fontFamily/addAttribute",(function(e){return(0,r.hasBlockSupport)(e,_h)?(e.attributes.fontFamily||Object.assign(e.attributes,{fontFamily:{type:"string"}}),e):e})),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/fontFamily/addSaveProps",yh),(0,l.addFilter)("blocks.registerBlockType","core/fontFamily/addEditProps",(function(e){if(!(0,r.hasBlockSupport)(e,_h))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),yh(o,e,n)},e}));const wh=(e,t,n)=>{if(t){const n=(0,u.find)(e,{slug:t});if(n)return n}return{size:n}};function Sh(e,t){const n=(0,u.find)(e,{size:t});return n||{size:t}}function Bh(e){if(e)return`has-${(0,u.kebabCase)(e)}-font-size`}var Ih=function(e){const t=Io("typography.fontSizes"),n=!Io("typography.customFontSize");return(0,a.createElement)(p.FontSizePicker,i({},e,{fontSizes:t,disableCustomFontSizes:n}))};const xh="typography.fontSize";function Th(e,t,n){if(!(0,r.hasBlockSupport)(t,xh))return e;if(Ro(t,Jh,"fontSize"))return e;const o=new(bm())(e.className);o.add(Bh(n.fontSize));const l=o.value;return e.className=l||void 0,e}function Nh(e){var t,n;const{attributes:{fontSize:o,style:r},setAttributes:l}=e,i=Io("typography.fontSizes"),s=wh(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)(Ih,{onChange:e=>{const t=Sh(i,e).slug;l({style:No({...r,typography:{...null==r?void 0:r.typography,fontSize:t?void 0:e}}),fontSize:t})},value:c,withReset:!1})}function Ph(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=Io("typography.fontSizes"),n=!(null==t||!t.length);return!(0,r.hasBlockSupport)(e,xh)||!n}const Mh=(0,d.createHigherOrderComponent)((e=>t=>{var n,o;const l=Io("typography.fontSizes"),{name:i,attributes:{fontSize:s,style:c},wrapperProps:u}=t;if(!(0,r.hasBlockSupport)(i,xh)||Ro(i,Jh,"fontSize")||!s||null!=c&&null!==(n=c.typography)&&void 0!==n&&n.fontSize)return(0,a.createElement)(e,t);const d=wh(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"),Rh={fontSize:[["fontSize"],["style","typography","fontSize"]]};(0,l.addFilter)("blocks.registerBlockType","core/font/addAttribute",(function(e){return(0,r.hasBlockSupport)(e,xh)?(e.attributes.fontSize||Object.assign(e.attributes,{fontSize:{type:"string"}}),e):e})),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/font/addSaveProps",Th),(0,l.addFilter)("blocks.registerBlockType","core/font/addEditProps",(function(e){if(!(0,r.hasBlockSupport)(e,xh))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),Th(o,e,n)},e})),(0,l.addFilter)("editor.BlockListBlock","core/font-size/with-font-size-inline-styles",Mh),(0,l.addFilter)("blocks.switchToBlockType.transformedBlock","core/font-size/addTransforms",(function(e,t,n,o){const l=e.name;return Mo({fontSize:(0,r.hasBlockSupport)(l,xh)},Rh,e,t,n,o)}));var Lh=(0,a.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(O.Path,{d:"M7 18v1h10v-1H7zm5-2c1.5 0 2.6-.4 3.4-1.2.8-.8 1.1-2 1.1-3.5V5H15v5.8c0 1.2-.2 2.1-.6 2.8-.4.7-1.2 1-2.4 1s-2-.3-2.4-1c-.4-.7-.6-1.6-.6-2.8V5H7.5v6.2c0 1.5.4 2.7 1.1 3.5.8.9 1.9 1.3 3.4 1.3z"}));var Ah=(0,a.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(O.Path,{d:"M9.1 9v-.5c0-.6.2-1.1.7-1.4.5-.3 1.2-.5 2-.5.7 0 1.4.1 2.1.3.7.2 1.4.5 2.1.9l.2-1.9c-.6-.3-1.2-.5-1.9-.7-.8-.1-1.6-.2-2.4-.2-1.5 0-2.7.3-3.6 1-.8.7-1.2 1.5-1.2 2.6V9h2zM20 12H4v1h8.3c.3.1.6.2.8.3.5.2.9.5 1.1.8.3.3.4.7.4 1.2 0 .7-.2 1.1-.8 1.5-.5.3-1.2.5-2.1.5-.8 0-1.6-.1-2.4-.3-.8-.2-1.5-.5-2.2-.8L7 18.1c.5.2 1.2.4 2 .6.8.2 1.6.3 2.4.3 1.7 0 3-.3 3.9-1 .9-.7 1.3-1.6 1.3-2.8 0-.9-.2-1.7-.7-2.2H20v-1z"}));const Dh=[{name:(0,g.__)("Underline"),value:"underline",icon:Lh},{name:(0,g.__)("Strikethrough"),value:"line-through",icon:Ah}];function Oh(e){let{value:t,onChange:n}=e;return(0,a.createElement)("fieldset",{className:"block-editor-text-decoration-control"},(0,a.createElement)("legend",null,(0,g.__)("Decoration")),(0,a.createElement)("div",{className:"block-editor-text-decoration-control__buttons"},Dh.map((e=>(0,a.createElement)(p.Button,{key:e.value,icon:e.icon,isSmall:!0,isPressed:e.value===t,onClick:()=>n(e.value===t?void 0:e.value),"aria-label":e.name})))))}const Fh="typography.__experimentalTextDecoration";function zh(e){var t;const{attributes:{style:n},setAttributes:o}=e;return(0,a.createElement)(Oh,{value:null==n||null===(t=n.typography)||void 0===t?void 0:t.textDecoration,onChange:function(e){o({style:No({...n,typography:{...null==n?void 0:n.typography,textDecoration:e}})})}})}function Vh(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!(0,r.hasBlockSupport)(e,Fh),n=Io("typography.textDecoration");return t||!n}var Hh=(0,a.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(O.Path,{d:"M6.1 6.8L2.1 18h1.6l1.1-3h4.3l1.1 3h1.6l-4-11.2H6.1zm-.8 6.8L7 8.9l1.7 4.7H5.3zm15.1-.7c-.4-.5-.9-.8-1.6-1 .4-.2.7-.5.8-.9.2-.4.3-.9.3-1.4 0-.9-.3-1.6-.8-2-.6-.5-1.3-.7-2.4-.7h-3.5V18h4.2c1.1 0 2-.3 2.6-.8.6-.6 1-1.4 1-2.4-.1-.8-.3-1.4-.6-1.9zm-5.7-4.7h1.8c.6 0 1.1.1 1.4.4.3.2.5.7.5 1.3 0 .6-.2 1.1-.5 1.3-.3.2-.8.4-1.4.4h-1.8V8.2zm4 8c-.4.3-.9.5-1.5.5h-2.6v-3.8h2.6c1.4 0 2 .6 2 1.9.1.6-.1 1-.5 1.4z"}));var Gh=(0,a.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(O.Path,{d:"M11 16.8c-.1-.1-.2-.3-.3-.5v-2.6c0-.9-.1-1.7-.3-2.2-.2-.5-.5-.9-.9-1.2-.4-.2-.9-.3-1.6-.3-.5 0-1 .1-1.5.2s-.9.3-1.2.6l.2 1.2c.4-.3.7-.4 1.1-.5.3-.1.7-.2 1-.2.6 0 1 .1 1.3.4.3.2.4.7.4 1.4-1.2 0-2.3.2-3.3.7s-1.4 1.1-1.4 2.1c0 .7.2 1.2.7 1.6.4.4 1 .6 1.8.6.9 0 1.7-.4 2.4-1.2.1.3.2.5.4.7.1.2.3.3.6.4.3.1.6.1 1.1.1h.1l.2-1.2h-.1c-.4.1-.6 0-.7-.1zM9.2 16c-.2.3-.5.6-.9.8-.3.1-.7.2-1.1.2-.4 0-.7-.1-.9-.3-.2-.2-.3-.5-.3-.9 0-.6.2-1 .7-1.3.5-.3 1.3-.4 2.5-.5v2zm10.6-3.9c-.3-.6-.7-1.1-1.2-1.5-.6-.4-1.2-.6-1.9-.6-.5 0-.9.1-1.4.3-.4.2-.8.5-1.1.8V6h-1.4v12h1.3l.2-1c.2.4.6.6 1 .8.4.2.9.3 1.4.3.7 0 1.2-.2 1.8-.5.5-.4 1-.9 1.3-1.5.3-.6.5-1.3.5-2.1-.1-.6-.2-1.3-.5-1.9zm-1.7 4c-.4.5-.9.8-1.6.8s-1.2-.2-1.7-.7c-.4-.5-.7-1.2-.7-2.1 0-.9.2-1.6.7-2.1.4-.5 1-.7 1.7-.7s1.2.3 1.6.8c.4.5.6 1.2.6 2s-.2 1.4-.6 2z"}));var Uh=(0,a.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(O.Path,{d:"M7.1 6.8L3.1 18h1.6l1.1-3h4.3l1.1 3h1.6l-4-11.2H7.1zm-.8 6.8L8 8.9l1.7 4.7H6.3zm14.5-1.5c-.3-.6-.7-1.1-1.2-1.5-.6-.4-1.2-.6-1.9-.6-.5 0-.9.1-1.4.3-.4.2-.8.5-1.1.8V6h-1.4v12h1.3l.2-1c.2.4.6.6 1 .8.4.2.9.3 1.4.3.7 0 1.2-.2 1.8-.5.5-.4 1-.9 1.3-1.5.3-.6.5-1.3.5-2.1-.1-.6-.2-1.3-.5-1.9zm-1.7 4c-.4.5-.9.8-1.6.8s-1.2-.2-1.7-.7c-.4-.5-.7-1.2-.7-2.1 0-.9.2-1.6.7-2.1.4-.5 1-.7 1.7-.7s1.2.3 1.6.8c.4.5.6 1.2.6 2 .1.8-.2 1.4-.6 2z"}));const Wh=[{name:(0,g.__)("Uppercase"),value:"uppercase",icon:Hh},{name:(0,g.__)("Lowercase"),value:"lowercase",icon:Gh},{name:(0,g.__)("Capitalize"),value:"capitalize",icon:Uh}];function $h(e){let{value:t,onChange:n}=e;return(0,a.createElement)("fieldset",{className:"block-editor-text-transform-control"},(0,a.createElement)("legend",null,(0,g.__)("Letter case")),(0,a.createElement)("div",{className:"block-editor-text-transform-control__buttons"},Wh.map((e=>(0,a.createElement)(p.Button,{key:e.value,icon:e.icon,isSmall:!0,isPressed:t===e.value,"aria-label":e.name,onClick:()=>n(t===e.value?void 0:e.value)})))))}const jh="typography.__experimentalTextTransform";function Kh(e){var t;const{attributes:{style:n},setAttributes:o}=e;return(0,a.createElement)($h,{value:null==n||null===(t=n.typography)||void 0===t?void 0:t.textTransform,onChange:function(e){o({style:No({...n,typography:{...null==n?void 0:n.typography,textTransform:e}})})}})}function qh(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!(0,r.hasBlockSupport)(e,jh),n=Io("typography.textTransform");return t||!n}function Yh(e){let{value:t,onChange:n,__unstableInputWidth:o="60px"}=e;const r=(0,p.__experimentalUseCustomUnits)({availableUnits:Io("spacing.units")||["px","em","rem"],defaultValues:{px:2,em:.2,rem:.2}});return(0,a.createElement)(p.__experimentalUnitControl,{label:(0,g.__)("Letter spacing"),value:t,__unstableInputWidth:o,units:r,onChange:n})}const Qh="typography.__experimentalLetterSpacing";function Xh(e){var t;const{attributes:{style:n},setAttributes:o}=e;return(0,a.createElement)(Yh,{value:null==n||null===(t=n.typography)||void 0===t?void 0:t.letterSpacing,onChange:function(e){o({style:No({...n,typography:{...null==n?void 0:n.typography,letterSpacing:e}})})},__unstableInputWidth:"100%"})}function Zh(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!(0,r.hasBlockSupport)(e,Qh),n=Io("typography.letterSpacing");return t||!n}const Jh="typography",ev=[uh,xh,mh,fh,_h,Fh,jh,Qh];function tv(e){const{clientId:t}=e,n=Ch(e),o=Ph(e),l=bh(e),i=ph(e),s=Vh(e),c=qh(e),u=Zh(e),d=!hh(e),m=!vh(e),f=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=[bh(e),Ph(e),ph(e),Ch(e),Vh(e),qh(e),Zh(e)];return t.filter(Boolean).length===t.length}(e),h=nv(e.name);if(f||!h)return null;const v=(0,r.getBlockSupport)(e.name,[Jh,"__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)(zo,{__experimentalGroup:"typography"},!n&&(0,a.createElement)(p.__experimentalToolsPanelItem,{hasValue:()=>function(e){return!!e.attributes.fontFamily}(e),label:(0,g.__)("Font family"),onDeselect:()=>function(e){let{setAttributes:t}=e;t({fontFamily:void 0})}(e),isShownByDefault:null==v?void 0:v.fontFamily,resetAllFilter:e=>({...e,fontFamily:void 0}),panelId:t},(0,a.createElement)(Eh,e)),!o&&(0,a.createElement)(p.__experimentalToolsPanelItem,{hasValue:()=>function(e){var t;const{fontSize:n,style:o}=e.attributes;return!!n||!(null==o||null===(t=o.typography)||void 0===t||!t.fontSize)}(e),label:(0,g.__)("Font size"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({fontSize:void 0,style:No({...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)(Nh,e)),!l&&(0,a.createElement)(p.__experimentalToolsPanelItem,{className:"single-column",hasValue:()=>function(e){var t;const{fontStyle:n,fontWeight:o}=(null===(t=e.attributes.style)||void 0===t?void 0:t.typography)||{};return!!n||!!o}(e),label:lh(d,m),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:No({...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)(gh,e)),!i&&(0,a.createElement)(p.__experimentalToolsPanelItem,{className:"single-column",hasValue:()=>function(e){var t,n;return!(null===(t=e.attributes.style)||void 0===t||null===(n=t.typography)||void 0===n||!n.lineHeight)}(e),label:(0,g.__)("Line height"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:No({...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)(dh,e)),!s&&(0,a.createElement)(p.__experimentalToolsPanelItem,{className:"single-column",hasValue:()=>function(e){var t,n;return!(null===(t=e.attributes.style)||void 0===t||null===(n=t.typography)||void 0===n||!n.textDecoration)}(e),label:(0,g.__)("Decoration"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:No({...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)(zh,e)),!c&&(0,a.createElement)(p.__experimentalToolsPanelItem,{className:"single-column",hasValue:()=>function(e){var t,n;return!(null===(t=e.attributes.style)||void 0===t||null===(n=t.typography)||void 0===n||!n.textTransform)}(e),label:(0,g.__)("Letter case"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:No({...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)(Kh,e)),!u&&(0,a.createElement)(p.__experimentalToolsPanelItem,{className:"single-column",hasValue:()=>function(e){var t,n;return!(null===(t=e.attributes.style)||void 0===t||null===(n=t.typography)||void 0===n||!n.letterSpacing)}(e),label:(0,g.__)("Letter spacing"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:No({...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)(Xh,e)))}const nv=e=>ev.some((t=>(0,r.hasBlockSupport)(e,t)));const ov=[...ev,xg,Hg,jo],rv=e=>ov.some((t=>(0,r.hasBlockSupport)(e,t))),lv="var:";function iv(e){if((0,u.startsWith)(e,lv)){return`var(--wp--${e.slice(lv.length).split("|").join("--")})`}return e}function av(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=["spacing.blockGap"],n={};Object.keys(r.__EXPERIMENTAL_STYLE_PROPERTY).forEach((o=>{const l=r.__EXPERIMENTAL_STYLE_PROPERTY[o].value,i=r.__EXPERIMENTAL_STYLE_PROPERTY[o].properties;if((0,u.has)(e,l)&&"elements"!==(0,u.first)(l)){const a=(0,u.get)(e,l);r.__EXPERIMENTAL_STYLE_PROPERTY[o].useEngine||(i&&!(0,u.isString)(a)?Object.entries(i).forEach((e=>{const[t,o]=e,r=(0,u.get)(a,[o]);r&&(n[t]=iv(r))})):t.includes(l.join("."))||(n[o]=iv((0,u.get)(e,l))))}}));const o=Zr(e,{selector:"self"});return o.forEach((e=>{if("self"!==e.selector)throw"This style can't be added as inline style";n[e.key]=e.value})),n}const sv={[`${xg}.__experimentalSkipSerialization`]:["border"],"color.__experimentalSkipSerialization":[Hg],[`${Jh}.__experimentalSkipSerialization`]:[Jh],[`${jo}.__experimentalSkipSerialization`]:["spacing"]},cv={...sv,[`${jo}`]:["spacing.blockGap"]},uv={gradients:"gradient"};function dv(e,t,n){let o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:cv;if(!rv(t))return e;let{style:l}=n;return(0,u.forEach)(o,((e,n)=>{const o=(0,r.getBlockSupport)(t,n);!0===o&&(l=(0,u.omit)(l,e)),Array.isArray(o)&&o.forEach((t=>{const n=uv[t]||t;l=(0,u.omit)(l,[[...e,n]])}))})),e.style={...av(l),...e.style},e}const pv=(0,d.createHigherOrderComponent)((e=>t=>{const n=Jn();return(0,a.createElement)(a.Fragment,null,n&&(0,a.createElement)(a.Fragment,null,(0,a.createElement)(eh,t),(0,a.createElement)(tv,t),(0,a.createElement)(Tg,t),(0,a.createElement)(Yo,t)),(0,a.createElement)(e,t))}),"withToolbarControls"),mv=(0,d.createHigherOrderComponent)((e=>t=>{var n,o;const l=`wp-elements-${(0,d.useInstanceId)(e)}`,s=Ro(t.name,Hg,"link")?(0,u.omit)(null===(n=t.attributes.style)||void 0===n?void 0:n.elements,["link"]):null===(o=t.attributes.style)||void 0===o?void 0:o.elements,p=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(0,u.map)(t,((t,n)=>{const o=av(t);return(0,u.isEmpty)(o)?"":[`.editor-styles-wrapper .${e} ${r.__EXPERIMENTAL_ELEMENTS[n]}{`,...(0,u.map)(o,((e,t)=>`\t${(0,u.kebabCase)(t)}: ${e};`)),"}"].join("\n")})).join("\n")}(l,s),m=(0,a.useContext)(Wf.__unstableElementContext);return(0,a.createElement)(a.Fragment,null,s&&m&&(0,a.createPortal)((0,a.createElement)("style",{dangerouslySetInnerHTML:{__html:p}}),m),(0,a.createElement)(e,i({},t,{className:s?c()(t.className,l):t.className})))}));(0,l.addFilter)("blocks.registerBlockType","core/style/addAttribute",(function(e){return rv(e)?(e.attributes.style||Object.assign(e.attributes,{style:{type:"object"}}),e):e})),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/style/addSaveProps",dv),(0,l.addFilter)("blocks.registerBlockType","core/style/addEditProps",(function(e){if(!rv(e))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),dv(o,e,n,sv)},e})),(0,l.addFilter)("editor.BlockEdit","core/style/with-block-controls",pv),(0,l.addFilter)("editor.BlockListBlock","core/editor/with-elements-styles",mv);var fv=function(e){let{colorPalette:t,duotonePalette:n,disableCustomColors:o,disableCustomDuotone:r,value:l,onChange:i}=e;return(0,a.createElement)(p.Dropdown,{popoverProps:{className:"block-editor-duotone-control__popover",headerTitle:(0,g.__)("Duotone"),isAlternate:!0},renderToggle:e=>{let{isOpen:t,onToggle:n}=e;return(0,a.createElement)(p.ToolbarButton,{showTooltip:!0,onClick:n,"aria-haspopup":"true","aria-expanded":t,onKeyDown:e=>{t||e.keyCode!==Tc.DOWN||(e.preventDefault(),n())},label:(0,g.__)("Apply duotone filter"),icon:(0,a.createElement)(p.DuotoneSwatch,{values:l})})},renderContent:()=>(0,a.createElement)(p.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)(p.DuotonePicker,{colorPalette:t,duotonePalette:n,disableCustomColors:o,disableCustomDuotone:r,value:l,onChange:i}))})};const gv=[];function hv(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t={r:[],g:[],b:[],a:[]};return e.forEach((e=>{const n=Vu(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 vv(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 bv(e){let{id:t,values:n}=e;return(0,a.createElement)(p.SVG,{xmlnsXlink:"http://www.w3.org/1999/xlink",viewBox:"0 0 0 0",width:"0",height:"0",focusable:"false",role:"none",style:{visibility:"hidden",position:"absolute",left:"-9999px",overflow:"hidden"}},(0,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:n.r.join(" ")}),(0,a.createElement)("feFuncG",{type:"table",tableValues:n.g.join(" ")}),(0,a.createElement)("feFuncB",{type:"table",tableValues:n.b.join(" ")}),(0,a.createElement)("feFuncA",{type:"table",tableValues:n.a.join(" ")})),(0,a.createElement)("feComposite",{in2:"SourceGraphic",operator:"in"}))))}function kv(e){let{selector:t,id:n,values:o}=e;return(0,a.createElement)(a.Fragment,null,(0,a.createElement)(bv,{id:n,values:o}),(0,a.createElement)(vv,{id:n,selector:t}))}function _v(e){let{presetSetting:t,defaultSetting:n}=e;const o=!Io(n),r=Io(`${t}.custom`)||gv,l=Io(`${t}.theme`)||gv,i=Io(`${t}.default`)||gv;return(0,a.useMemo)((()=>[...r,...l,...o?gv:i]),[o,r,l,i])}function yv(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=_v({presetSetting:"color.duotone",defaultSetting:"color.defaultDuotone"}),s=_v({presetSetting:"color.palette",defaultSetting:"color.defaultPalette"}),c=!Io("color.custom"),u=!Io("color.customDuotone")||0===(null==s?void 0:s.length)&&c;return 0===(null==i?void 0:i.length)&&u?null:(0,a.createElement)(ro,{group:"block",__experimentalShareWithChildBlocks:!0},(0,a.createElement)(fv,{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})}}))}Gu([Uu]);const Ev=(0,d.createHigherOrderComponent)((e=>t=>{const n=(0,r.hasBlockSupport)(t.name,"color.__experimentalDuotone");return(0,a.createElement)(a.Fragment,null,(0,a.createElement)(e,t),n&&(0,a.createElement)(yv,t))}),"withDuotoneControls");const Cv=(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)(Wf.__unstableElementContext);return(0,a.createElement)(a.Fragment,null,g&&(0,a.createPortal)((0,a.createElement)(kv,{selector:m,id:p,values:hv(u)}),g),(0,a.createElement)(e,i({},t,{className:f})))}),"withDuotoneStyles");function wv(e){let{preset:t}=e;return(0,a.createElement)(bv,{id:`wp-duotone-${t.slug}`,values:hv(t.colors)})}(0,l.addFilter)("blocks.registerBlockType","core/editor/duotone/add-attributes",(function(e){return(0,r.hasBlockSupport)(e,"color.__experimentalDuotone")?(e.attributes.style||Object.assign(e.attributes,{style:{type:"object"}}),e):e})),(0,l.addFilter)("editor.BlockEdit","core/editor/duotone/with-editor-controls",Ev),(0,l.addFilter)("editor.BlockListBlock","core/editor/duotone/with-styles",Cv);const Sv="__experimentalLayout";function Bv(e){let{setAttributes:t,attributes:n,name:o}=e;const{layout:l}=n,i=Io("layout"),s=(0,m.useSelect)((e=>{const{getSettings:t}=e(qn);return t().supportsLayout}),[]),c=(0,r.getBlockSupport)(o,Sv,{}),{allowSwitching:u,allowEditing:d=!0,allowInheriting:f=!0,default:h}=c;if(!d)return null;const v=!(!f||!i||null!=l&&l.type&&"default"!==(null==l?void 0:l.type)&&(null==l||!l.inherit)),b=l||h||{},{inherit:k=!1,type:_="default"}=b;if("default"===_&&!s)return null;const y=Ir(_),E=e=>t({layout:e});return(0,a.createElement)(a.Fragment,null,(0,a.createElement)(zo,null,(0,a.createElement)(p.PanelBody,{title:(0,g.__)("Layout")},v&&(0,a.createElement)(p.ToggleControl,{label:(0,g.__)("Inherit default layout"),checked:!!k,onChange:()=>t({layout:{inherit:!k}})}),!k&&u&&(0,a.createElement)(Iv,{type:_,onChange:e=>t({layout:{type:e}})}),!k&&y&&(0,a.createElement)(y.inspectorControls,{layout:b,onChange:E,layoutBlockSupport:c}))),!k&&y&&(0,a.createElement)(y.toolBarControls,{layout:b,onChange:E,layoutBlockSupport:c}))}function Iv(e){let{type:t,onChange:n}=e;return(0,a.createElement)(p.ButtonGroup,null,Br.map((e=>{let{name:o,label:r}=e;return(0,a.createElement)(p.Button,{key:o,isPressed:t===o,onClick:()=>n(o)},r)})))}const xv=(0,d.createHigherOrderComponent)((e=>t=>{const{name:n}=t;return[(0,r.hasBlockSupport)(n,Sv)&&(0,a.createElement)(Bv,i({key:"layout"},t)),(0,a.createElement)(e,i({key:"edit"},t))]}),"withInspectorControls"),Tv=(0,d.createHigherOrderComponent)((e=>t=>{const{name:n,attributes:o}=t,l=(0,r.hasBlockSupport)(n,Sv),s=(0,d.useInstanceId)(e),p=Io("layout")||{},m=(0,a.useContext)(Wf.__unstableElementContext),{layout:f}=o,{default:g}=(0,r.getBlockSupport)(n,Sv)||{},h=null!=f&&f.inherit?p:f||g||{},v=l?function(e){var t,n,o;const r=[];return e.layout?(null!=e&&null!==(t=e.layout)&&void 0!==t&&t.orientation&&r.push(`is-${(0,u.kebabCase)(e.layout.orientation)}`),null!=e&&null!==(n=e.layout)&&void 0!==n&&n.justifyContent&&r.push(`is-content-justification-${(0,u.kebabCase)(e.layout.justifyContent)}`),null!=e&&null!==(o=e.layout)&&void 0!==o&&o.flexWrap&&"nowrap"===e.layout.flexWrap&&r.push("is-nowrap"),r):r}(o):null,b=c()(null==t?void 0:t.className,{[`wp-container-${s}`]:l},v);return(0,a.createElement)(a.Fragment,null,l&&m&&(0,a.createPortal)((0,a.createElement)(Mr,{blockName:n,selector:`.wp-container-${s}`,layout:h,style:null==o?void 0:o.style}),m),(0,a.createElement)(e,i({},t,{className:b})))}));(0,l.addFilter)("blocks.registerBlockType","core/layout/addAttribute",(function(e){return(0,u.has)(e.attributes,["layout","type"])||(0,r.hasBlockSupport)(e,Sv)&&(e.attributes={...e.attributes,layout:{type:"object"}}),e})),(0,l.addFilter)("editor.BlockListBlock","core/editor/layout/with-layout-styles",Tv),(0,l.addFilter)("editor.BlockEdit","core/editor/layout/with-inspector-controls",xv);const Nv=[];function Pv(e){var t;let{borderColor:n,style:o}=e;const r=(null==o?void 0:o.border)||{},l=ng("border-color",n);return{className:c()({[l]:!!l,"has-border-color":n||(null==o||null===(t=o.border)||void 0===t?void 0:t.color)})||void 0,style:av({border:r})}}function Mv(e){const t=Io("color.palette")||Nv,n=Pv(e);if(e.borderColor){const o=eg(t,e.borderColor);n.style.borderColor=o.color}return n}function Rv(e){var t,n,o,r,l,i;const{backgroundColor:a,textColor:s,gradient:u,style:d}=e,p=ng("background-color",a),m=ng("color",s),f=Mg(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:av({color:(null==d?void 0:d.color)||{}})}}const Lv={};function Av(e){const{backgroundColor:t,textColor:n,gradient:o}=e,r=Io("color.palette.custom")||[],l=Io("color.palette.theme")||[],i=Io("color.palette.default")||[],s=Io("color.gradients")||Lv,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=Rv(e);if(t){const e=eg(c,t);d.style.backgroundColor=e.color}if(o&&(d.style.background=Rg(u,o)),n){const e=eg(c,n);d.style.color=e.color}return d}function Dv(e){const{style:t}=e;return{style:av({spacing:(null==t?void 0:t.spacing)||{}})}}function Ov(e){const[t,n]=(0,a.useState)(e);return(0,a.useEffect)((()=>{e&&n(e)}),[e]),t}const Fv=e=>(0,d.createHigherOrderComponent)((t=>n=>(0,a.createElement)(t,i({},n,{colors:e}))),"withCustomColorPalette"),zv=()=>(0,d.createHigherOrderComponent)((e=>t=>{const n=Io("color.palette.custom"),o=Io("color.palette.theme"),r=Io("color.palette.default"),l=(0,a.useMemo)((()=>[...n||[],...o||[],...r||[]]),[n,o,r]);return(0,a.createElement)(e,i({},t,{colors:l}))}),"withEditorColorPalette");function Vv(e,t){const n=(0,u.reduce)(e,((e,t)=>({...e,...(0,u.isString)(t)?{[t]:(0,u.kebabCase)(t)}:t})),{});return(0,d.compose)([t,e=>class extends 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=Vu(t);return(0,u.maxBy)(e,(e=>{let{color:t}=e;return n.contrast(t)})).color}(t,e)}createSetters(){return(0,u.reduce)(n,((e,t,n)=>{const o=(0,u.upperFirst)(n),r=`custom${o}`;return e[`set${o}`]=this.createSetColor(n,r),e}),{})}createSetColor(e,t){return n=>{const o=tg(this.props.colors,n);this.props.setAttributes({[e]:o&&o.slug?o.slug:void 0,[t]:o&&o.slug?void 0:n})}}static getDerivedStateFromProps(e,t){let{attributes:o,colors:r}=e;return(0,u.reduce)(n,((e,n,l)=>{const i=eg(r,o[l],o[`custom${(0,u.upperFirst)(l)}`]),a=t[l];return(null==a?void 0:a.color)===i.color&&a?e[l]=a:e[l]={...i,class:ng(n,i.slug)},e}),{})}render(){return(0,a.createElement)(e,i({},this.props,{colors:void 0},this.state,this.setters,{colorUtils:this.colorUtils}))}}])}function Hv(e){return function(){const t=Fv(e);for(var n=arguments.length,o=new Array(n),r=0;r(e[t]=`custom${(0,u.upperFirst)(t)}`,e)),{});return(0,d.createHigherOrderComponent)((0,d.compose)([(0,d.createHigherOrderComponent)((e=>t=>{const n=Io("typography.fontSizes")||Uv;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${(0,u.upperFirst)(n)}`]=this.createSetFontSize(n,t),e)),{})}createSetFontSize(e,t){return n=>{const o=(0,u.find)(this.props.fontSizes,{size:Number(n)});this.props.setAttributes({[e]:o&&o.slug?o.slug:void 0,[t]:o&&o.slug?void 0:n})}}static getDerivedStateFromProps(e,t){let{attributes:n,fontSizes:r}=e;const l=(e,o)=>!t[o]||(n[o]?n[o]!==t[o].slug:t[o].size!==n[e]);if(!(0,u.some)(o,l))return null;const i=(0,u.reduce)((0,u.pickBy)(o,l),((e,t,o)=>{const l=n[o],i=wh(r,l,n[t]);return e[o]={...i,class:Bh(l)},e}),{});return{...t,...i}}render(){return(0,a.createElement)(e,i({},this.props,{fontSizes:void 0},this.state,this.setters))}}]),"withFontSizes")};var $v=(0,a.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(O.Path,{d:"M4 19.8h8.9v-1.5H4v1.5zm8.9-15.6H4v1.5h8.9V4.2zm-8.9 7v1.5h16v-1.5H4z"}));var jv=(0,a.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(O.Path,{d:"M16.4 4.2H7.6v1.5h8.9V4.2zM4 11.2v1.5h16v-1.5H4zm3.6 8.6h8.9v-1.5H7.6v1.5z"}));var Kv=(0,a.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(O.Path,{d:"M11.1 19.8H20v-1.5h-8.9v1.5zm0-15.6v1.5H20V4.2h-8.9zM4 12.8h16v-1.5H4v1.5z"}));const qv=[{icon:$v,title:(0,g.__)("Align text left"),align:"left"},{icon:jv,title:(0,g.__)("Align text center"),align:"center"},{icon:Kv,title:(0,g.__)("Align text right"),align:"right"}],Yv={position:"bottom right",isAlternate:!0};var Qv=function(e){let{value:t,onChange:n,alignmentControls:o=qv,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 m=(0,u.find)(o,(e=>e.align===t)),f=c?p.ToolbarGroup:p.ToolbarDropdownMenu,h=c?{isCollapsed:s}:{};return(0,a.createElement)(f,i({icon:m?m.icon:(0,g.isRTL)()?Kv:$v,label:r,toggleProps:{describedBy:l},popoverProps:Yv,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 Xv=e=>(0,a.createElement)(Qv,i({},e,{isToolbar:!1})),Zv=e=>(0,a.createElement)(Qv,i({},e,{isToolbar:!0}));var Jv={name:"blocks",className:"block-editor-autocompleters__block",triggerPrefix:"/",useItems(e){const{rootClientId:t,selectedBlockName:n}=(0,m.useSelect)((e=>{const{getSelectedBlockClientId:t,getBlockName:n,getBlockInsertionPoint:o}=e(qn),r=t();return{selectedBlockName:r?n(r):null,rootClientId:o().rootClientId}}),[]),[o,r,l]=Ld(t,u.noop),i=(0,a.useMemo)((()=>(e.trim()?rp(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)(Wc,{key:"icon",icon:n,showColors:!0}),t),isDisabled:o}}))),[i]);return[s]},allowContext:(e,t)=>!(/\S/.test(e)||/\S/.test(t)),getOptionCompletion(e){const{name:t,initialAttributes:n,innerBlocks:o}=e;return{action:"replace",value:(0,r.createBlock)(t,n,(0,r.createBlocksFromInnerBlocksTemplate)(o))}}},eb=window.wp.apiFetch,tb=n.n(eb);var nb=(0,a.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(O.Path,{d:"M7 5.5h10a.5.5 0 01.5.5v12a.5.5 0 01-.5.5H7a.5.5 0 01-.5-.5V6a.5.5 0 01.5-.5zM17 4H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V6a2 2 0 00-2-2zm-1 3.75H8v1.5h8v-1.5zM8 11h8v1.5H8V11zm6 3.25H8v1.5h6v-1.5z"}));var ob=(0,a.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(O.Path,{d:"m7.3 9.7 1.4 1.4c.2-.2.3-.3.4-.5 0 0 0-.1.1-.1.3-.5.4-1.1.3-1.6L12 7 9 4 7.2 6.5c-.6-.1-1.1 0-1.6.3 0 0-.1 0-.1.1-.3.1-.4.2-.6.4l1.4 1.4L4 11v1h1l2.3-2.3zM4 20h9v-1.5H4V20zm0-5.5V16h16v-1.5H4z"}));var rb={name:"links",className:"block-editor-autocompleters__link",triggerPrefix:"[[",options:async e=>{let t=await tb()({path:(0,mp.addQueryArgs)("/wp/v2/search",{per_page:10,search:e,type:"post",order_by:"menu_order"})});return t=t.filter((e=>""!==e.title)),t},getOptionKeywords:e=>[...e.title.split(/\s+/)],getOptionLabel:e=>(0,a.createElement)(a.Fragment,null,(0,a.createElement)(wr,{key:"icon",icon:"page"===e.subtype?nb:ob}),e.title),getOptionCompletion:e=>(0,a.createElement)("a",{href:e.url},e.title)};const lb=[];function ib(e){let{completers:t=lb}=e;const{name:n}=Zn();return(0,a.useMemo)((()=>{let e=t;return(n===(0,r.getDefaultBlockName)()||(0,r.getBlockSupport)(n,"__experimentalSlashInserter",!1))&&(e=e.concat([Jv,rb])),(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 ab=function(e){return(0,a.createElement)(p.Autocomplete,i({},e,{completers:ib(e)}))};var sb=(0,a.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(O.Path,{d:"M4.2 9h1.5V5.8H9V4.2H4.2V9zm14 9.2H15v1.5h4.8V15h-1.5v3.2zM15 4.2v1.5h3.2V9h1.5V4.2H15zM5.8 15H4.2v4.8H9v-1.5H5.8V15z"}));var cb=function(e){let{isActive:t,label:n=(0,g.__)("Toggle full height"),onToggle:o,isDisabled:r}=e;return(0,a.createElement)(p.ToolbarButton,{isActive:t,icon:sb,label:n,onClick:()=>o(!t),disabled:r})};var ub=function(e){const{label:t=(0,g.__)("Change matrix alignment"),onChange:n=u.noop,value:o="center",isDisabled:r}=e,l=(0,a.createElement)(p.__experimentalAlignmentMatrixControl.Icon,{value:o}),i="block-editor-block-alignment-matrix-control",s=`${i}__popover`;return(0,a.createElement)(p.Dropdown,{position:"bottom right",className:i,popoverProps:{className:s,isAlternate:!0},renderToggle:e=>{let{onToggle:n,isOpen:o}=e;return(0,a.createElement)(p.ToolbarButton,{onClick:n,"aria-haspopup":"true","aria-expanded":o,onKeyDown:e=>{o||e.keyCode!==Tc.DOWN||(e.preventDefault(),n())},label:t,icon:l,showTooltip:!0,disabled:r})},renderContent:()=>(0,a.createElement)(p.__experimentalAlignmentMatrixControl,{hasFocusBorder:!1,onChange:n,value:o})})};var db=(0,a.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(O.Path,{d:"M10.8622 8.04053L14.2805 12.0286L10.8622 16.0167L9.72327 15.0405L12.3049 12.0286L9.72327 9.01672L10.8622 8.04053Z"}));var pb=function(e){let{rootLabelText:t}=e;const{selectBlock:n,clearSelectedBlock:o}=(0,m.useDispatch)(qn),{clientId:r,parents:l,hasSelection:i}=(0,m.useSelect)((e=>{const{getSelectionStart:t,getSelectedBlockClientId:n,getBlockParents:o}=e(qn),r=n();return{parents:o(r),clientId:r,hasSelection:!!t().clientId}}),[]),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)(p.Button,{className:"block-editor-block-breadcrumb__button",variant:"tertiary",onClick:o},s),!i&&s,!!r&&(0,a.createElement)(wr,{icon:db,className:"block-editor-block-breadcrumb__separator"})),l.map((e=>(0,a.createElement)("li",{key:e},(0,a.createElement)(p.Button,{className:"block-editor-block-breadcrumb__button",variant:"tertiary",onClick:()=>n(e)},(0,a.createElement)(Wp,{clientId:e,maximumLength:35})),(0,a.createElement)(wr,{icon:db,className:"block-editor-block-breadcrumb__separator"})))),!!r&&(0,a.createElement)("li",{className:"block-editor-block-breadcrumb__current","aria-current":"true"},(0,a.createElement)(Wp,{clientId:r,maximumLength:35})))};function mb(e){let{clientId:t,tagName:n="div",wrapperProps:o,className:r}=e;const[l,s]=(0,a.useState)(!0),[u,d]=(0,a.useState)(!1),{isParentSelected:p,hasChildSelected:f,isDraggingBlocks:g,isParentHighlighted:h}=(0,m.useSelect)((e=>{const{isBlockSelected:n,hasSelectedInnerBlock:o,isDraggingBlocks:r,isBlockHighlighted:l}=e(qn);return{isParentSelected:n(t),hasChildSelected:o(t,!0),isDraggingBlocks:r(),isParentHighlighted:l(t)}}),[t]),v=c()("block-editor-block-content-overlay",null==o?void 0:o.className,r,{"overlay-active":l,"parent-highlighted":h,"is-dragging-blocks":g});return(0,a.useEffect)((()=>{p||f||l||s(!0),p&&!u&&l&&s(!1),f&&l&&s(!1)}),[p,f,l,u]),(0,a.createElement)(n,i({},o,{className:v,onMouseEnter:()=>d(!0),onMouseLeave:()=>d(!1),onMouseUp:l?()=>s(!1):void 0}),null==o?void 0:o.children)}const fb=()=>(0,a.createElement)(p.SVG,{xmlns:"https://www.w3.org/2000/svg",viewBox:"0 0 20 20"},(0,a.createElement)(p.Path,{d:"M7.434 5l3.18 9.16H8.538l-.692-2.184H4.628l-.705 2.184H2L5.18 5h2.254zm-1.13 1.904h-.115l-1.148 3.593H7.44L6.304 6.904zM14.348 7.006c1.853 0 2.9.876 2.9 2.374v4.78h-1.79v-.914h-.114c-.362.64-1.123 1.022-2.031 1.022-1.346 0-2.292-.826-2.292-2.108 0-1.27.972-2.006 2.71-2.107l1.696-.102V9.38c0-.584-.42-.914-1.18-.914-.667 0-1.112.228-1.264.647h-1.701c.12-1.295 1.307-2.107 3.066-2.107zm1.079 4.1l-1.416.09c-.793.056-1.18.342-1.18.844 0 .52.45.837 1.091.837.857 0 1.505-.545 1.505-1.256v-.515z"})),gb=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)(fb,null)))},hb=e=>{let{TextColor:t,BackgroundColor:n}=e;return e=>{let{onToggle:o,isOpen:r}=e;return(0,a.createElement)(p.ToolbarGroup,null,(0,a.createElement)(p.ToolbarButton,{className:"components-toolbar__control block-library-colors-selector__toggle",label:(0,g.__)("Open Colors Selector"),onClick:o,onKeyDown:e=>{r||e.keyCode!==Tc.DOWN||(e.preventDefault(),o())},icon:(0,a.createElement)(n,null,(0,a.createElement)(t,null,(0,a.createElement)(gb,null)))}))}};var vb=e=>{let{children:t,...n}=e;return(0,a.createElement)(p.Dropdown,{position:"bottom right",className:"block-library-colors-selector",contentClassName:"block-library-colors-selector__popover",renderToggle:hb(n),renderContent:()=>t})};var bb=(0,a.createElement)(O.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,a.createElement)(O.Path,{d:"M13.8 5.2H3v1.5h10.8V5.2zm-3.6 12v1.5H21v-1.5H10.2zm7.2-6H6.6v1.5h10.8v-1.5z"}));const kb=pc(p.__experimentalTreeGridRow);function _b(e){let{isSelected:t,position:n,level:o,rowCount:r,children:l,className:s,path:u,...d}=e;const p=gc({isSelected:t,adjustScrolling:!1,enableAnimation:!0,triggerAnimationOnChange:u});return(0,a.createElement)(kb,i({ref:p,className:c()("block-editor-list-view-leaf",s),level:o,positionInSet:n,setSize:r},d),l)}function yb(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)(wr,{icon:db}))}var Eb=(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:m}=e;const f=Gp(o),{isLocked:g}=Zm(o);return(0,a.createElement)(a.Fragment,null,(0,a.createElement)(p.Button,{className:c()("block-editor-list-view-block-select-button",n),onClick:r,onKeyDown:function(e){e.keyCode!==Tc.ENTER&&e.keyCode!==Tc.SPACE||r(e)},ref:t,tabIndex:i,onFocus:s,onDragStart:e=>{e.dataTransfer.clearData(),null==u||u(e)},onDragEnd:d,draggable:m,href:`#block-${o}`,"aria-hidden":!0},(0,a.createElement)(yb,{onClick:l}),(0,a.createElement)(Wc,{icon:null==f?void 0:f.icon,showColors:!0}),(0,a.createElement)("span",{className:"block-editor-list-view-block-select-button__title"},(0,a.createElement)(Wp,{clientId:o,maximumLength:35})),(null==f?void 0:f.anchor)&&(0,a.createElement)("span",{className:"block-editor-list-view-block-select-button__anchor"},f.anchor),g&&(0,a.createElement)("span",{className:"block-editor-list-view-block-select-button__lock"},(0,a.createElement)(wr,{icon:Xm}))))}));const Cb=(0,a.forwardRef)(((e,t)=>{let{onClick:n,onToggleExpanded:o,block:r,isSelected:l,position:s,siblingBlockCount:u,level:d,isExpanded:p,selectedClientIds:f,...g}=e;const{clientId:h}=r,{blockMovingClientId:v,selectedBlockInBlockEditor:b}=(0,m.useSelect)((e=>{const{hasBlockMovingClientId:t,getSelectedBlockClientId:n}=e(qn);return{blockMovingClientId:t(),selectedBlockInBlockEditor:n()}}),[h]),k=v&&b===h,_=c()("block-editor-list-view-block-contents",{"is-dropping-before":k}),y=f.includes(h)?f:[h];return(0,a.createElement)($p,{clientIds:y},(e=>{let{draggable:c,onDragStart:m,onDragEnd:f}=e;return(0,a.createElement)(Eb,i({ref:t,className:_,block:r,onClick:n,onToggleExpanded:o,isSelected:l,position:s,siblingBlockCount:u,level:d,draggable:c,onDragStart:m,onDragEnd:f,isExpanded:p},g))}))}));var wb=Cb;const Sb=(0,a.createContext)({__experimentalFeatures:!1,__experimentalPersistentListViewFeatures:!1}),Bb=()=>(0,a.useContext)(Sb);var Ib=(0,a.memo)((function e(t){let{block:n,isDragged:o,isSelected:r,isBranchSelected:l,selectBlock:i,position:s,level:u,rowCount:f,siblingBlockCount:h,showBlockMovers:v,path:b,isExpanded:k,selectedClientIds:_,preventAnnouncement:y}=t;const E=(0,a.useRef)(null),[C,w]=(0,a.useState)(!1),{clientId:S}=n,B=r&&_[0]===S,I=r&&_[_.length-1]===S,{toggleBlockHighlight:x}=(0,m.useDispatch)(qn),T=Gp(S),{isLocked:N}=Zm(S),P=`list-view-block-select-button__${(0,d.useInstanceId)(e)}`,M=((e,t,n)=>(0,g.sprintf)((0,g.__)("Block %1$d of %2$d, Level %3$d"),e,t,n))(s,h,u);let R=(0,g.__)("Link");T&&(R=N?(0,g.sprintf)((0,g.__)("%s link (locked)"),T.title):(0,g.sprintf)((0,g.__)("%s link"),T.title));const L=T?(0,g.sprintf)((0,g.__)("Options for %s block"),T.title):(0,g.__)("Options"),{__experimentalFeatures:A,__experimentalPersistentListViewFeatures:D,__experimentalHideContainerBlockActions:O,isTreeGridMounted:F,expand:z,collapse:V}=Bb(),H=v&&h>0,G=c()("block-editor-list-view-block__mover-cell",{"is-visible":C||r}),U=c()("block-editor-list-view-block__menu-cell",{"is-visible":C||B});(0,a.useEffect)((()=>{D&&!F&&r&&E.current.focus()}),[]);const W=D?x:()=>{},$=(0,a.useCallback)((()=>{w(!0),W(S,!0)}),[S,w,W]),j=(0,a.useCallback)((()=>{w(!1),W(S,!1)}),[S,w,W]),K=(0,a.useCallback)((e=>{i(e,S),e.preventDefault()}),[S,i]),q=(0,a.useCallback)((e=>{i(void 0,e)}),[i]),Y=(0,a.useCallback)((e=>{e.preventDefault(),e.stopPropagation(),!0===k?V(S):!1===k&&z(S)}),[S,z,V,k]),Q=A&&(!O||O&&u>1),X=A&&!Q;let Z;H?Z=2:X&&(Z=3);const J=c()({"is-selected":r,"is-first-selected":B,"is-last-selected":I,"is-branch-selected":D&&l,"is-dragging":o,"has-single-cell":X}),ee=_.includes(S)?_:[S];return(0,a.createElement)(_b,{className:J,onMouseEnter:$,onMouseLeave:j,onFocus:$,onBlur:j,level:u,position:s,rowCount:f,path:b,id:`list-view-block-${S}`,"data-block":S,isExpanded:k,"aria-selected":!!r},(0,a.createElement)(p.__experimentalTreeGridCell,{className:"block-editor-list-view-block__contents-cell",colSpan:Z,ref:E,"aria-label":R,"aria-selected":!!r,"aria-expanded":k,"aria-describedby":P},(e=>{let{ref:t,tabIndex:o,onFocus:l}=e;return(0,a.createElement)("div",{className:"block-editor-list-view-block__contents-container"},(0,a.createElement)(wb,{block:n,onClick:K,onToggleExpanded:Y,isSelected:r,position:s,siblingBlockCount:h,level:u,ref:t,tabIndex:o,onFocus:l,isExpanded:k,selectedClientIds:_,preventAnnouncement:y}),(0,a.createElement)("div",{className:"block-editor-list-view-block-select-button__description",id:P},M))})),H&&(0,a.createElement)(a.Fragment,null,(0,a.createElement)(p.__experimentalTreeGridCell,{className:G,withoutGridItem:!0},(0,a.createElement)(p.__experimentalTreeGridItem,null,(e=>{let{ref:t,tabIndex:n,onFocus:o}=e;return(0,a.createElement)(rm,{orientation:"vertical",clientIds:[S],ref:t,tabIndex:n,onFocus:o})})),(0,a.createElement)(p.__experimentalTreeGridItem,null,(e=>{let{ref:t,tabIndex:n,onFocus:o}=e;return(0,a.createElement)(lm,{orientation:"vertical",clientIds:[S],ref:t,tabIndex:n,onFocus:o})})))),Q&&(0,a.createElement)(p.__experimentalTreeGridCell,{className:U,"aria-selected":!!r},(e=>{let{ref:t,tabIndex:n,onFocus:o}=e;return(0,a.createElement)(sf,{clientIds:ee,icon:Dm,label:L,toggleProps:{ref:t,className:"block-editor-list-view-block__menu",tabIndex:n,onFocus:o},disableOpenOnArrowDown:!0,__experimentalSelectBlock:q})})))}));function xb(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(Tb(t,n,o),0):1}const Tb=(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+xb(r,e,t,n):o+1};function Nb(e){const{blocks:t,selectBlock:n,showBlockMovers:o,showNestedBlocks:r,selectedClientIds:l,level:i=1,path:s="",isBranchSelected:c=!1,listPosition:d=0,fixedListWindow:p,expandNested:f}=e,{expandedState:g,draggedClientIds:h,__experimentalPersistentListViewFeatures:v}=Bb(),b=(0,u.compact)(t),k=b.length;let _=d;return(0,a.createElement)(a.Fragment,null,b.map(((e,t)=>{var d;const{clientId:y,innerBlocks:E}=e;t>0&&(_+=xb(b[t-1],g,h,f));const C=v,{itemInView:w}=p,S=!C||w(_),B=t+1,I=s.length>0?`${s}_${B}`:`${B}`,x=r&&!!E&&!!E.length,T=x?null!==(d=g[y])&&void 0!==d?d:f:void 0,N=!(null==h||!h.includes(y)),P=N||S,M=((e,t)=>(0,u.isArray)(t)&&t.length?-1!==t.indexOf(e):t===e)(y,l),R=c||M&&x;return(0,a.createElement)(m.AsyncModeProvider,{key:y,value:!M},P&&(0,a.createElement)(Ib,{block:e,selectBlock:n,isSelected:M,isBranchSelected:R,isDragged:N,level:i,position:B,rowCount:k,siblingBlockCount:k,showBlockMovers:o,path:I,isExpanded:T,listPosition:_,selectedClientIds:l}),!P&&(0,a.createElement)("tr",null,(0,a.createElement)("td",{className:"block-editor-list-view-placeholder"})),x&&T&&!N&&(0,a.createElement)(Nb,{blocks:E,selectBlock:n,showBlockMovers:o,showNestedBlocks:r,level:i+1,path:I,listPosition:_+1,fixedListWindow:p,isBranchSelected:R,selectedClientIds:l,expandNested:f}))})))}Nb.defaultProps={selectBlock:()=>{}};var Pb=(0,a.memo)(Nb);function Mb(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]),m=(0,a.useCallback)((()=>{if(!c)return{};const e=c.ownerDocument,t=c.getBoundingClientRect(),n=u(),o={left:t.left+n,right:t.right,width:0,height:t.height,ownerDocument:e};return"top"===l?{...o,top:t.top,bottom:t.top}:"bottom"===l||"inside"===l?{...o,top:t.bottom,bottom:t.bottom}:{}}),[c,l,u]);return c?(0,a.createElement)(p.Popover,{noArrow:!0,animate:!1,getAnchorRect:m,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 Rb(){const{clearSelectedBlock:e,multiSelect:t,selectBlock:n}=(0,m.useDispatch)(qn),{getBlockName:o,getBlockParents:l,getBlockSelectionStart:i,getBlockSelectionEnd:s,getSelectedBlockClientIds:c,hasMultiSelection:d,hasSelectedBlock:p}=(0,m.useSelect)(qn),{getBlockType:f}=(0,m.useSelect)(r.store),h=(0,a.useCallback)((async(r,a,s)=>{if(null==r||!r.shiftKey)return await e(),void n(a);r.preventDefault();const m="keydown"===r.type&&(r.keyCode===Tc.UP||r.keyCode===Tc.DOWN||r.keyCode===Tc.HOME||r.keyCode===Tc.END);if(!m&&!p()&&!d())return void n(a,null);const h=c(),v=[...l(a),a];m&&!h.some((e=>v.includes(e)))&&await e();let b=i(),k=a;m&&(p()||d()||(b=a),s&&(k=s));const _=l(b),y=l(k),{start:E,end:C}=function(e,t,n,o){const r=[...n,e],l=[...o,t],i=Math.min(r.length,l.length)-1;return{start:r[i],end:l[i]}}(b,k,_,y);await t(E,C,null);const w=c();if((r.keyCode===Tc.HOME||r.keyCode===Tc.END)&&w.length>1)return;const S=(0,u.difference)(h,w);let B;if(1===S.length){var I;const e=null===(I=f(o(S[0])))||void 0===I?void 0:I.title;e&&(B=(0,g.sprintf)((0,g.__)("%s deselected."),e))}else S.length>1&&(B=(0,g.sprintf)((0,g.__)("%s blocks deselected."),S.length));B&&(0,Ft.speak)(B)}),[e,o,f,l,i,s,c,d,p,t,n]);return{updateBlockSelection:h}}function Lb(e,t){return t.left<=e.x&&t.right>=e.x&&t.top<=e.y&&t.bottom>=e.y}const Ab=["top","bottom"];function Db(){const{getBlockRootClientId:e,getBlockIndex:t,getBlockCount:n,getDraggedBlockClientIds:o,canInsertBlocks:r}=(0,m.useSelect)(qn),[l,i]=(0,a.useState)(),{rootClientId:s,blockIndex:c}=l||{},u=Pf(s,c),p=o(),f=(0,d.useThrottle)((0,a.useCallback)(((o,l)=>{const a={x:o.clientX,y:o.clientY},s=!(null==p||!p.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]=Rf(t,a,Ab),u=Lb(t,a);if(void 0===r||s0||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&&p.includes(l),innerBlockCount:n(l),canInsertDraggedBlocksAsSibling:!s||r(p,i),canInsertDraggedBlocksAsChild:!s||r(p,l)}})),a);c&&i(c)}),[p]),200);return{ref:(0,d.__experimentalUseDropZone)({onDrop:u,onDragOver(e){f(e,e.currentTarget)},onDragEnd(){f.cancel(),i(null)}}),target:l}}const Ob=(e,t)=>Array.isArray(t.clientIds)?{...e,...t.clientIds.reduce(((e,n)=>({...e,[n]:"expand"===t.type})),{})}:e;var Fb=(0,a.forwardRef)((function(e,t){let{blocks:n,__experimentalFeatures:o,__experimentalPersistentListViewFeatures:r,__experimentalHideContainerBlockActions:l,showNestedBlocks:s,showBlockMovers:c,id:u,expandNested:f=!1,...h}=e;const{clientIdsTree:v,draggedClientIds:b,selectedClientIds:k}=function(e){return(0,m.useSelect)((t=>{const{getDraggedBlockClientIds:n,getSelectedBlockClientIds:o,__unstableGetClientIdsTree:r}=t(qn);return{selectedClientIds:o(),draggedClientIds:n(),clientIdsTree:e||r()}}),[e])}(n),{visibleBlockCount:_}=(0,m.useSelect)((e=>{const{getGlobalBlockCount:t,getClientIdsOfDescendants:n}=e(qn),o=(null==b?void 0:b.length)>0?n(b).length+1:0;return{visibleBlockCount:t()-o}}),[b]),{updateBlockSelection:y}=Rb(),[E,C]=(0,a.useReducer)(Ob,{}),{ref:w,target:S}=Db(),B=(0,a.useRef)(),I=(0,d.useMergeRefs)([B,w,t]),x=(0,a.useRef)(!1),{setSelectedTreeId:T}=function(e){let{firstSelectedBlockClientId:t,setExpandedState:n}=e;const[o,r]=(0,a.useState)(null),{selectedBlockParentClientIds:l}=(0,m.useSelect)((e=>{const{getBlockParents:n}=e(qn);return{selectedBlockParentClientIds:n(t,!1)}}),[t]),i=Array.isArray(l)&&l.length?l:null;return(0,a.useEffect)((()=>{o!==t&&i&&n({type:"expand",clientIds:l})}),[t]),{setSelectedTreeId:r}}({firstSelectedBlockClientId:k[0],setExpandedState:C}),N=(0,a.useCallback)(((e,t)=>{y(e,t),T(t)}),[T,y]);(0,a.useEffect)((()=>{x.current=!0}),[]);const[P]=(0,d.__experimentalUseFixedWindowList)(B,36,_,{useWindowing:r,windowOverscan:40}),M=(0,a.useCallback)((e=>{e&&C({type:"expand",clientIds:[e]})}),[C]),R=(0,a.useCallback)((e=>{e&&C({type:"collapse",clientIds:[e]})}),[C]),L=(0,a.useCallback)((e=>{var t;M(null==e||null===(t=e.dataset)||void 0===t?void 0:t.block)}),[M]),A=(0,a.useCallback)((e=>{var t;R(null==e||null===(t=e.dataset)||void 0===t?void 0:t.block)}),[R]),D=(0,a.useCallback)(((e,t,n)=>{var o,r;e.shiftKey&&y(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)}),[y]),O=(0,a.useMemo)((()=>({__experimentalFeatures:o,__experimentalPersistentListViewFeatures:r,__experimentalHideContainerBlockActions:l,isTreeGridMounted:x.current,draggedClientIds:b,expandedState:E,expand:M,collapse:R})),[o,r,l,x.current,b,E,M,R]);return(0,a.createElement)(m.AsyncModeProvider,{value:!0},(0,a.createElement)(Mb,{listViewRef:B,blockDropTarget:S}),(0,a.createElement)(p.__experimentalTreeGrid,{id:u,className:"block-editor-list-view-tree","aria-label":(0,g.__)("Block navigation structure"),ref:I,onCollapseRow:A,onExpandRow:L,onFocusRow:D},(0,a.createElement)(Sb.Provider,{value:O},(0,a.createElement)(Pb,i({blocks:v,selectBlock:N,showNestedBlocks:s,showBlockMovers:c,fixedListWindow:P,selectedClientIds:k,expandNested:f},h)))))}));function zb(e){let{isEnabled:t,onToggle:n,isOpen:o,innerRef:r,...l}=e;return(0,a.createElement)(p.Button,i({},l,{ref:r,icon:bb,"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 Vb=(0,a.forwardRef)((function(e,t){let{isDisabled:n,__experimentalFeatures:o,...r}=e;const l=(0,m.useSelect)((e=>!!e(qn).getBlockCount()),[])&&!n;return(0,a.createElement)(p.Dropdown,{contentClassName:"block-editor-block-navigation__popover",position:"bottom right",renderToggle:e=>{let{isOpen:n,onToggle:o}=e;return(0,a.createElement)(zb,i({},r,{innerRef:t,isOpen:n,onToggle:o,isEnabled:l}))},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)(Fb,{showNestedBlocks:!0,__experimentalFeatures:o}))})}));function Hb(e){let{genericPreviewBlock:t,style:n,className:o,activeStyle:r}=e;const l=km(o,r,n),i=(0,a.useMemo)((()=>({...t,title:n.label||n.name,description:n.description,initialAttributes:{...t.attributes,className:l+" block-editor-block-styles__block-preview-container"}})),[t,l]);return(0,a.createElement)(Ed,{item:i,isStylePreview:!0})}function Gb(e){let{children:t,scope:n,...o}=e;return(0,a.createElement)(p.Fill,{name:`BlockStylesPreviewPanel/${n}`},(0,a.createElement)("div",o,t))}function Ub(e){let{clientId:t,onSwitch:n=u.noop,onHoverClassName:o=u.noop,scope:r}=e;const{onSelect:l,stylesToRender:i,activeStyle:s,genericPreviewBlock:m,className:f}=ym({clientId:t,onSwitch:n}),[g,h]=(0,a.useState)(null),[v,b]=(0,a.useState)(0),k=(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 _=(0,u.debounce)(h,250),y=e=>{l(e),o(null),h(null),_.cancel()},E=e=>{var t;g!==e?(_(e),o(null!==(t=null==e?void 0:e.name)&&void 0!==t?t:null)):_.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)(p.Button,{className:c()("block-editor-block-styles__item",{"is-active":s.name===e.name}),key:e.name,variant:"secondary",label:t,onMouseEnter:()=>E(e),onFocus:()=>E(e),onMouseLeave:()=>E(null),onBlur:()=>E(null),onKeyDown:t=>{Tc.ENTER!==t.keyCode&&Tc.SPACE!==t.keyCode||(t.preventDefault(),y(e))},onClick:()=>y(e),role:"button",tabIndex:"0"},(0,a.createElement)(p.__experimentalTruncate,{numberOfLines:1,className:"block-editor-block-styles__item-text"},t))}))),g&&!k&&(0,a.createElement)(Gb,{scope:r,className:"block-editor-block-styles__preview-panel",style:{top:v},onMouseLeave:()=>E(null)},(0,a.createElement)(Hb,{activeStyle:s,className:f,genericPreviewBlock:m,style:g})))}Ub.Slot=function(e){let{scope:t}=e;return(0,a.createElement)(p.Slot,{name:`BlockStylesPreviewPanel/${t}`})};var Wb=Ub;var $b=(0,a.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(O.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 jb=function(e){let{icon:t=$b,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)(p.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)(p.Button,{variant:"secondary",icon:e.icon,iconSize:48,onClick:()=>l(e),className:"block-editor-block-variation-picker__variation",label:e.description||e.title}),(0,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)(p.Button,{variant:"link",onClick:()=>l()},(0,g.__)("Skip"))))};var Kb=(0,a.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(O.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 qb="carousel",Yb="grid",Qb=e=>{let{onStartBlank:t,onBlockPatternSelect:n}=e;return(0,a.createElement)("div",{className:"block-editor-block-pattern-setup__actions"},t&&(0,a.createElement)(p.Button,{onClick:t},(0,g.__)("Start blank")),(0,a.createElement)(p.Button,{variant:"primary",onClick:n},(0,g.__)("Choose")))},Xb=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)(p.Button,{icon:Xp,label:(0,g.__)("Previous pattern"),onClick:t,disabled:0===o}),(0,a.createElement)(p.Button,{icon:Qp,label:(0,g.__)("Next pattern"),onClick:n,disabled:o===r-1}))};var Zb=e=>{let{viewMode:t,setViewMode:n,handlePrevious:o,handleNext:r,activeSlide:l,totalSlides:i,onBlockPatternSelect:s,onStartBlank:c}=e;const u=t===qb,d=(0,a.createElement)("div",{className:"block-editor-block-pattern-setup__display-controls"},(0,a.createElement)(p.Button,{icon:uo,label:(0,g.__)("Carousel view"),onClick:()=>n(qb),isPressed:u}),(0,a.createElement)(p.Button,{icon:Kb,label:(0,g.__)("Grid view"),onClick:()=>n(Yb),isPressed:t===Yb}));return(0,a.createElement)("div",{className:"block-editor-block-pattern-setup__toolbar"},u&&(0,a.createElement)(Xb,{handlePrevious:o,handleNext:r,activeSlide:l,totalSlides:i}),d,u&&(0,a.createElement)(Qb,{onBlockPatternSelect:s,onStartBlank:c}))};var Jb=function(e,t,n){return(0,m.useSelect)((o=>{const{getBlockRootClientId:r,__experimentalGetPatternsByBlockTypes:l,__experimentalGetAllowedPatterns:i}=o(qn),a=r(e);return n?i(a).filter(n):l(t,a)}),[e,t,n])};const ek=e=>{let{viewMode:t,activeSlide:n,patterns:o,onBlockPatternSelect:r,height:l}=e;const s=(0,p.__unstableUseCompositeState)(),c="block-editor-block-pattern-setup__container";if(t===qb){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",style:{height:l}},(0,a.createElement)("div",{className:c},(0,a.createElement)("ul",{className:"carousel-container"},o.map(((t,n)=>(0,a.createElement)(nk,{className:e.get(n)||"",key:t.name,pattern:t,minHeight:l}))))))}return(0,a.createElement)("div",{style:{height:l},className:"block-editor-block-pattern-setup__grid"},(0,a.createElement)(p.__unstableComposite,i({},s,{role:"listbox",className:c,"aria-label":(0,g.__)("Patterns list")}),o.map((e=>(0,a.createElement)(tk,{key:e.name,pattern:e,onSelect:r,composite:s})))))};function tk(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)(tk,`${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)(p.__unstableCompositeItem,i({role:"option",as:"div"},o,{className:`${r}__item`,onClick:()=>n(l)}),(0,a.createElement)(_d,{blocks:l,viewportWidth:c})),!!s&&(0,a.createElement)(p.VisuallyHidden,{id:u},s))}function nk(e){let{className:t,pattern:n,minHeight:o}=e;const{blocks:r,title:l,description:i}=n,s=(0,d.useInstanceId)(nk,"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)(_d,{blocks:r,__experimentalMinHeight:o}),!!i&&(0,a.createElement)(p.VisuallyHidden,{id:s},i))}var ok=e=>{let{clientId:t,blockName:n,filterPatternsFn:o,startBlankComponent:l,onBlockPatternSelect:i}=e;const[s,c]=(0,a.useState)(qb),[u,p]=(0,a.useState)(0),[f,g]=(0,a.useState)(!1),{replaceBlock:h}=(0,m.useDispatch)(qn),v=Jb(t,n,o),[b,{height:k}]=(0,d.useResizeObserver)();if(null==v||!v.length||f)return l;const _=i||(e=>{const n=e.map((e=>(0,r.cloneBlock)(e)));h(t,n)}),y=l?()=>{g(!0)}:void 0;return(0,a.createElement)(a.Fragment,null,b,(0,a.createElement)("div",{className:`block-editor-block-pattern-setup view-mode-${s}`},(0,a.createElement)(ek,{viewMode:s,activeSlide:u,patterns:v,onBlockPatternSelect:_,height:k-120}),(0,a.createElement)(Zb,{viewMode:s,setViewMode:c,activeSlide:u,totalSlides:v.length,handleNext:()=>{p((e=>e+1))},handlePrevious:()=>{p((e=>e-1))},onBlockPatternSelect:()=>{_(v[u].blocks)},onStartBlank:y})))};function rk(e){let{className:t,onSelectVariation:n,selectedValue:o,variations:r}=e;return(0,a.createElement)("fieldset",{className:t},(0,a.createElement)(p.VisuallyHidden,{as:"legend"},(0,g.__)("Transform to variation")),r.map((e=>(0,a.createElement)(p.Button,{key:e.name,icon:e.icon,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 lk(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)(p.DropdownMenu,{className:t,label:(0,g.__)("Transform to variation"),text:(0,g.__)("Transform to variation"),popoverProps:{position:"bottom center",className:`${t}__popover`},icon:Jp,toggleProps:{iconPosition:"right"}},(()=>(0,a.createElement)("div",{className:`${t}__container`},(0,a.createElement)(p.MenuGroup,null,(0,a.createElement)(p.MenuItemsChoice,{choices:l,value:o,onSelect:n})))))}var ik=function(e){let{blockClientId:t}=e;const{updateBlockAttributes:n}=(0,m.useDispatch)(qn),{activeBlockVariation:o,variations:l}=(0,m.useSelect)((e=>{const{getActiveBlockVariation:n,getBlockVariations:o}=e(r.store),{getBlockName:l,getBlockAttributes:i}=e(qn),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=>{t.icon&&e.add(t.icon)})),e.size===l.length)}),[l]);if(null==l||!l.length)return null;const c=s?rk:lk;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})},ak=(0,d.createHigherOrderComponent)((e=>t=>{const n=Io("color.palette"),o=!Io("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"),sk=ak(p.ColorPalette);function ck(e){let{onChange:t,value:n,...o}=e;return(0,a.createElement)(Qf,i({},o,{onColorChange:t,colorValue:n,gradients:[],disableCustomGradients:!0}))}var uk=window.wp.date;const dk=new Date(2022,0,25);function pk(e){let{format:t,defaultFormat:n,onChange:o}=e;return(0,a.createElement)("fieldset",{className:"block-editor-date-format-picker"},(0,a.createElement)(p.VisuallyHidden,{as:"legend"},(0,g.__)("Date format")),(0,a.createElement)(p.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,uk.dateI18n)(n,dk))),checked:!t,onChange:e=>o(e?null:n)}),t&&(0,a.createElement)(mk,{format:t,onChange:o}))}function mk(e){var t;let{format:n,onChange:o}=e;const r=(0,u.uniq)(["Y-m-d",(0,g._x)("n/j/Y","short date format"),(0,g._x)("n/j/Y g:i A","short date format with time"),(0,g._x)("M j, Y","medium date format"),(0,g._x)("M j, Y g:i A","medium date format with time"),(0,g._x)("F j, Y","long date format")]),l=r.map(((e,t)=>({key:`suggested-${t}`,name:(0,uk.dateI18n)(e,dk),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)(p.BaseControl,{className:"block-editor-date-format-picker__custom-format-select-control"},(0,a.createElement)(p.CustomSelectControl,{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)(p.TextControl,{label:(0,g.__)("Custom format"),hideLabelFromVision:!0,help:(0,a.createInterpolateElement)((0,g.__)("Enter a date or time format string."),{Link:(0,a.createElement)(p.ExternalLink,{href:(0,g.__)("https://wordpress.org/support/article/formatting-date-and-time/")})}),value:n,onChange:e=>o(e)}))}const fk=(0,g.__)("(%s: color %s)"),gk=(0,g.__)("(%s: gradient %s)"),hk=["colors","disableCustomColors","gradients","disableCustomGradients"],vk=e=>{let{colors:t,gradients:n,settings:o}=e;return o.map(((e,o)=>{let r,{colorValue:l,gradientValue:i,label:s,colors:c,gradients:u}=e;if(!l&&!i)return null;if(l){const e=tg(c||t,l);r=(0,g.sprintf)(fk,s.toLowerCase(),e&&e.name||l)}else{const e=Lg(u||n,l);r=(0,g.sprintf)(gk,s.toLowerCase(),e&&e.name||i)}return(0,a.createElement)(p.ColorIndicator,{key:o,colorValue:l||i,"aria-label":r})}))},bk=e=>{let{className:t,colors:n,gradients:o,disableCustomColors:r,disableCustomGradients:l,children:s,settings:d,title:m,showTitle:f=!0,__experimentalHasMultipleOrigins:g,__experimentalIsRenderedInSidebar:h,enableAlpha:v,...b}=e;if((0,u.isEmpty)(n)&&(0,u.isEmpty)(o)&&r&&l&&(0,u.every)(d,(e=>(0,u.isEmpty)(e.colors)&&(0,u.isEmpty)(e.gradients)&&(void 0===e.disableCustomColors||e.disableCustomColors)&&(void 0===e.disableCustomGradients||e.disableCustomGradients))))return null;const k=(0,a.createElement)("span",{className:"block-editor-panel-color-gradient-settings__panel-title"},m,(0,a.createElement)(vk,{colors:n,gradients:o,settings:d}));return(0,a.createElement)(p.PanelBody,i({className:c()("block-editor-panel-color-gradient-settings",t),title:f?k:void 0},b),(0,a.createElement)(Xf,{settings:d,colors:n,gradients:o,disableCustomColors:r,disableCustomGradients:l,__experimentalHasMultipleOrigins:g,__experimentalIsRenderedInSidebar:h,enableAlpha:v}),!!s&&(0,a.createElement)(a.Fragment,null,(0,a.createElement)(p.__experimentalSpacer,{marginY:4})," ",s))},kk=e=>{const t=Zf();return t.colors=Io("color.palette"),t.gradients=Io("color.gradients"),(0,a.createElement)(bk,i({},t,e))},_k=e=>{const t=Jf();return(0,a.createElement)(bk,i({},t,e))};var yk=e=>(0,u.every)(hk,(t=>e.hasOwnProperty(t)))?(0,a.createElement)(bk,e):e.__experimentalHasMultipleOrigins?(0,a.createElement)(_k,e):(0,a.createElement)(kk,e),Ek=function(e,t){return Ek=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])},Ek(e,t)};var Ck=function(){return Ck=Object.assign||function(e){for(var t,n=1,o=arguments.length;nu*r?{width:u*r,height:u}:{width:c,height:c/r}}function Ik(e,t,n,o,r){void 0===r&&(r=0);var l=Ok(t.width,t.height,r),i=l.width,a=l.height;return{x:xk(e.x,i,n.width,o),y:xk(e.y,a,n.height,o)}}function xk(e,t,n,o){var r=t*o/2-n/2;return Math.min(r,Math.max(e,-r))}function Tk(e,t){return Math.sqrt(Math.pow(e.y-t.y,2)+Math.pow(e.x-t.x,2))}function Nk(e,t){return 180*Math.atan2(t.y-e.y,t.x-e.x)/Math.PI}function Pk(e,t,n,o,r,l,i){void 0===l&&(l=0),void 0===i&&(i=!0);var a=i&&0===l?Mk:Rk,s={x:a(100,((t.width-n.width/r)/2-e.x/r)/t.width*100),y:a(100,((t.height-n.height/r)/2-e.y/r)/t.height*100),width:a(100,n.width/t.width*100/r),height:a(100,n.height/t.height*100/r)},c=Math.round(a(t.naturalWidth,s.width*t.naturalWidth/100)),u=Math.round(a(t.naturalHeight,s.height*t.naturalHeight/100)),d=t.naturalWidth>=t.naturalHeight*o?{width:Math.round(u*o),height:u}:{width:c,height:Math.round(c/o)};return{croppedAreaPercentages:s,croppedAreaPixels:Ck(Ck({},d),{x:Math.round(a(t.naturalWidth-d.width,s.x*t.naturalWidth/100)),y:Math.round(a(t.naturalHeight-d.height,s.y*t.naturalHeight/100))})}}function Mk(e,t){return Math.min(e,Math.max(0,t))}function Rk(e,t){return t}function Lk(e,t,n){var o=t.width/t.naturalWidth,r=function(e,t,n){var o=t.width/t.naturalWidth;if(n)return n.height>n.width?n.height/o/e.height:n.width/o/e.width;var r=e.width/e.height;return t.naturalWidth>=t.naturalHeight*r?t.naturalHeight/e.height:t.naturalWidth/e.width}(e,t,n),l=o*r;return{crop:{x:((t.naturalWidth-e.width)/2-e.x)*l,y:((t.naturalHeight-e.height)/2-e.y)*l},zoom:r}}function Ak(e,t){return{x:(t.x+e.x)/2,y:(t.y+e.y)/2}}function Dk(e,t,n,o,r){var l=Math.cos,i=Math.sin,a=r*Math.PI/180;return[(e-n)*l(a)-(t-o)*i(a)+n,(e-n)*i(a)+(t-o)*l(a)+o]}function Ok(e,t,n){var o=e/2,r=t/2,l=[Dk(0,0,o,r,n),Dk(e,0,o,r,n),Dk(e,t,o,r,n),Dk(0,t,o,r,n)],i=Math.min.apply(Math,l.map((function(e){return e[0]}))),a=Math.max.apply(Math,l.map((function(e){return e[0]}))),s=Math.min.apply(Math,l.map((function(e){return e[1]}))),c=Math.max.apply(Math,l.map((function(e){return e[1]})));return{width:a-i,height:c-s}}function Fk(){for(var e=[],t=0;t0})).join(" ").trim()}var zk=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.imageRef=null,n.videoRef=null,n.containerRef=null,n.styleRef=null,n.containerRect=null,n.mediaSize={width:0,height:0,naturalWidth:0,naturalHeight:0},n.dragStartPosition={x:0,y:0},n.dragStartCrop={x:0,y:0},n.lastPinchDistance=0,n.lastPinchRotation=0,n.rafDragTimeout=null,n.rafPinchTimeout=null,n.wheelTimer=null,n.state={cropSize:null,hasWheelJustStarted:!1},n.preventZoomSafari=function(e){return e.preventDefault()},n.cleanEvents=function(){document.removeEventListener("mousemove",n.onMouseMove),document.removeEventListener("mouseup",n.onDragStopped),document.removeEventListener("touchmove",n.onTouchMove),document.removeEventListener("touchend",n.onDragStopped)},n.clearScrollEvent=function(){n.containerRef&&n.containerRef.removeEventListener("wheel",n.onWheel),n.wheelTimer&&clearTimeout(n.wheelTimer)},n.onMediaLoad=function(){n.computeSizes(),n.emitCropData(),n.setInitialCrop(),n.props.onMediaLoaded&&n.props.onMediaLoaded(n.mediaSize)},n.setInitialCrop=function(){var e=n.props,t=e.initialCroppedAreaPixels,o=e.cropSize;if(t){var r=Lk(t,n.mediaSize,o),l=r.crop,i=r.zoom;n.props.onCropChange(l),n.props.onZoomChange&&n.props.onZoomChange(i)}},n.computeSizes=function(){var e,t,o,r,l,i,a=n.imageRef||n.videoRef;if(a&&n.containerRef){n.containerRect=n.containerRef.getBoundingClientRect(),n.mediaSize={width:a.offsetWidth,height:a.offsetHeight,naturalWidth:(null===(e=n.imageRef)||void 0===e?void 0:e.naturalWidth)||(null===(t=n.videoRef)||void 0===t?void 0:t.videoWidth)||0,naturalHeight:(null===(o=n.imageRef)||void 0===o?void 0:o.naturalHeight)||(null===(r=n.videoRef)||void 0===r?void 0:r.videoHeight)||0};var s=n.props.cropSize?n.props.cropSize:Bk(a.offsetWidth,a.offsetHeight,n.containerRect.width,n.containerRect.height,n.props.aspect,n.props.rotation);(null===(l=n.state.cropSize)||void 0===l?void 0:l.height)===s.height&&(null===(i=n.state.cropSize)||void 0===i?void 0:i.width)===s.width||n.props.onCropSizeChange&&n.props.onCropSizeChange(s),n.setState({cropSize:s},n.recomputeCropPosition)}},n.onMouseDown=function(e){e.preventDefault(),document.addEventListener("mousemove",n.onMouseMove),document.addEventListener("mouseup",n.onDragStopped),n.onDragStart(t.getMousePoint(e))},n.onMouseMove=function(e){return n.onDrag(t.getMousePoint(e))},n.onTouchStart=function(e){document.addEventListener("touchmove",n.onTouchMove,{passive:!1}),document.addEventListener("touchend",n.onDragStopped),2===e.touches.length?n.onPinchStart(e):1===e.touches.length&&n.onDragStart(t.getTouchPoint(e.touches[0]))},n.onTouchMove=function(e){e.preventDefault(),2===e.touches.length?n.onPinchMove(e):1===e.touches.length&&n.onDrag(t.getTouchPoint(e.touches[0]))},n.onDragStart=function(e){var t,o,r=e.x,l=e.y;n.dragStartPosition={x:r,y:l},n.dragStartCrop=Ck({},n.props.crop),null===(o=(t=n.props).onInteractionStart)||void 0===o||o.call(t)},n.onDrag=function(e){var t=e.x,o=e.y;n.rafDragTimeout&&window.cancelAnimationFrame(n.rafDragTimeout),n.rafDragTimeout=window.requestAnimationFrame((function(){if(n.state.cropSize&&void 0!==t&&void 0!==o){var e=t-n.dragStartPosition.x,r=o-n.dragStartPosition.y,l={x:n.dragStartCrop.x+e,y:n.dragStartCrop.y+r},i=n.props.restrictPosition?Ik(l,n.mediaSize,n.state.cropSize,n.props.zoom,n.props.rotation):l;n.props.onCropChange(i)}}))},n.onDragStopped=function(){var e,t;n.cleanEvents(),n.emitCropData(),null===(t=(e=n.props).onInteractionEnd)||void 0===t||t.call(e)},n.onWheel=function(e){e.preventDefault();var o=t.getMousePoint(e),r=Sk()(e).pixelY,l=n.props.zoom-r*n.props.zoomSpeed/200;n.setNewZoom(l,o),n.state.hasWheelJustStarted||n.setState({hasWheelJustStarted:!0},(function(){var e,t;return null===(t=(e=n.props).onInteractionStart)||void 0===t?void 0:t.call(e)})),n.wheelTimer&&clearTimeout(n.wheelTimer),n.wheelTimer=window.setTimeout((function(){return n.setState({hasWheelJustStarted:!1},(function(){var e,t;return null===(t=(e=n.props).onInteractionEnd)||void 0===t?void 0:t.call(e)}))}),250)},n.getPointOnContainer=function(e){var t=e.x,o=e.y;if(!n.containerRect)throw new Error("The Cropper is not mounted");return{x:n.containerRect.width/2-(t-n.containerRect.left),y:n.containerRect.height/2-(o-n.containerRect.top)}},n.getPointOnMedia=function(e){var t=e.x,o=e.y,r=n.props,l=r.crop,i=r.zoom;return{x:(t+l.x)/i,y:(o+l.y)/i}},n.setNewZoom=function(e,t){if(n.state.cropSize&&n.props.onZoomChange){var o=n.getPointOnContainer(t),r=n.getPointOnMedia(o),l=Math.min(n.props.maxZoom,Math.max(e,n.props.minZoom)),i={x:r.x*l-o.x,y:r.y*l-o.y},a=n.props.restrictPosition?Ik(i,n.mediaSize,n.state.cropSize,l,n.props.rotation):i;n.props.onCropChange(a),n.props.onZoomChange(l)}},n.getCropData=function(){return n.state.cropSize?Pk(n.props.restrictPosition?Ik(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?Ik(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}Ek(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}(t,e),t.prototype.componentDidMount=function(){window.addEventListener("resize",this.computeSizes),this.containerRef&&(this.props.zoomWithScroll&&this.containerRef.addEventListener("wheel",this.onWheel,{passive:!1}),this.containerRef.addEventListener("gesturestart",this.preventZoomSafari),this.containerRef.addEventListener("gesturechange",this.preventZoomSafari)),this.props.disableAutomaticStylesInjection||(this.styleRef=document.createElement("style"),this.styleRef.setAttribute("type","text/css"),this.styleRef.innerHTML=".reactEasyCrop_Container {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n overflow: hidden;\n user-select: none;\n touch-action: none;\n cursor: move;\n 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",document.head.appendChild(this.styleRef)),this.imageRef&&this.imageRef.complete&&this.onMediaLoad()},t.prototype.componentWillUnmount=function(){var e;window.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)||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=Tk(n,o),this.lastPinchRotation=Nk(n,o),this.onDragStart(Ak(n,o))},t.prototype.onPinchMove=function(e){var n=this,o=t.getTouchPoint(e.touches[0]),r=t.getTouchPoint(e.touches[1]),l=Ak(o,r);this.onDrag(l),this.rafPinchTimeout&&window.cancelAnimationFrame(this.rafPinchTimeout),this.rafPinchTimeout=window.requestAnimationFrame((function(){var e=Tk(o,r),t=n.props.zoom*(e/n.lastPinchDistance);n.setNewZoom(t,l),n.lastPinchDistance=e;var i=Nk(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,k=v.cropAreaClassName,_=v.mediaClassName,y=t.objectFit;return Fl().createElement("div",{onMouseDown:this.onMouseDown,onTouchStart:this.onTouchStart,ref:function(t){return e.containerRef=t},"data-testid":"container",style:f,className:Fk("reactEasyCrop_Container",b)},n?Fl().createElement("img",Ck({alt:"",className:Fk("reactEasyCrop_Image","contain"===y&&"reactEasyCrop_Contain","horizontal-cover"===y&&"reactEasyCrop_Cover_Horizontal","vertical-cover"===y&&"reactEasyCrop_Cover_Vertical",_)},r,{src:n,ref:function(t){return e.imageRef=t},style:Ck(Ck({},h),{transform:l||"translate("+a+"px, "+s+"px) rotate("+c+"deg) scale("+u+")"}),onLoad:this.onMediaLoad})):o&&Fl().createElement("video",Ck({autoPlay:!0,loop:!0,muted:!0,className:Fk("reactEasyCrop_Video","contain"===y&&"reactEasyCrop_Contain","horizontal-cover"===y&&"reactEasyCrop_Cover_Horizontal","vertical-cover"===y&&"reactEasyCrop_Cover_Vertical",_)},r,{ref:function(t){return e.videoRef=t},onLoadedMetadata:this.onMediaLoad,style:Ck(Ck({},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 Fl().createElement("source",Ck({key:e.src},e))}))),this.state.cropSize&&Fl().createElement("div",{style:Ck(Ck({},g),{width:this.state.cropSize.width,height:this.state.cropSize.height}),"data-testid":"cropper",className:Fk("reactEasyCrop_CropArea","round"===d&&"reactEasyCrop_CropAreaRound",p&&"reactEasyCrop_CropAreaGrid",k)}))},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}(Fl().Component),Vk=zk;const Hk={position:"bottom right",isAlternate:!0};function Gk(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,k]=(0,a.useState)(),_=(0,a.useCallback)((()=>{d({x:0,y:0}),m(100),g(0),v(n/o),k(n/o)}),[n,o,d,m,g,v,k]),y=(0,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:_})),[r,i,s,c,u,d,p,m,f,g,y,h,v,b,_])}(e),{initializeTransformValues:o}=n;return(0,a.useEffect)((()=>{t&&o()}),[t,o]),n}const Uk=(0,a.createContext)({}),Wk=()=>(0,a.useContext)(Uk);function $k(e){let{id:t,url:n,naturalWidth:o,naturalHeight:r,isEditing:l,onFinishEditing:i,onSaveImage:s,children:c}=e;const u=Gk({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,m.useDispatch)(zd.store),[p,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,tb()({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"),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:p,apply:v,cancel:h})),[p,v,h])}({id:t,url:n,onSaveImage:s,onFinishEditing:i,...u}),p=(0,a.useMemo)((()=>({...u,...d})),[u,d]);return(0,a.createElement)(Uk.Provider,{value:p},c)}function jk(e){let{url:t,width:n,height:o,clientWidth:r,naturalHeight:l,naturalWidth:i}=e;const{isInProgress:s,editedUrl:u,position:d,zoom:m,aspect:f,setPosition:g,setCrop:h,setZoom:v,rotation:b}=Wk();let k=o||r*l/i;return b%180==90&&(k=r*i/l),(0,a.createElement)("div",{className:c()("wp-block-image__crop-area",{"is-applying":s}),style:{width:n||r,height:k}},(0,a.createElement)(Vk,{image:u||t,disabled:s,minZoom:1,maxZoom:3,crop:d,zoom:m/100,aspect:f,onCropChange:g,onCropComplete:e=>{h(e)},onZoomChange:e=>{v(100*e)}}),s&&(0,a.createElement)(p.Spinner,null))}var Kk=(0,a.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(O.Path,{d:"M13.5 6C10.5 6 8 8.5 8 11.5c0 1.1.3 2.1.9 3l-3.4 3 1 1.1 3.4-2.9c1 .9 2.2 1.4 3.6 1.4 3 0 5.5-2.5 5.5-5.5C19 8.5 16.5 6 13.5 6zm0 9.5c-2.2 0-4-1.8-4-4s1.8-4 4-4 4 1.8 4 4-1.8 4-4 4z"}));function qk(){const{isInProgress:e,zoom:t,setZoom:n}=Wk();return(0,a.createElement)(p.Dropdown,{contentClassName:"wp-block-image__zoom",popoverProps:Hk,renderToggle:t=>{let{isOpen:n,onToggle:o}=t;return(0,a.createElement)(p.ToolbarButton,{icon:Kk,label:(0,g.__)("Zoom"),onClick:o,"aria-expanded":n,disabled:e})},renderContent:()=>(0,a.createElement)(p.RangeControl,{label:(0,g.__)("Zoom"),min:100,max:300,value:Math.round(t),onChange:n})})}var Yk=(0,a.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(O.Path,{d:"M18.5 5.5h-13c-1.1 0-2 .9-2 2v9c0 1.1.9 2 2 2h13c1.1 0 2-.9 2-2v-9c0-1.1-.9-2-2-2zm.5 11c0 .3-.2.5-.5.5h-13c-.3 0-.5-.2-.5-.5v-9c0-.3.2-.5.5-.5h13c.3 0 .5.2.5.5v9zM6.5 12H8v-2h2V8.5H6.5V12zm9.5 2h-2v1.5h3.5V12H16v2z"}));function Qk(e){let{aspectRatios:t,isDisabled:n,label:o,onClick:r,value:l}=e;return(0,a.createElement)(p.MenuGroup,{label:o},t.map((e=>{let{title:t,aspect:o}=e;return(0,a.createElement)(p.MenuItem,{key:o,disabled:n,onClick:()=>{r(o)},role:"menuitemradio",isSelected:o===l,icon:o===l?hm:void 0},t)})))}function Xk(e){let{toggleProps:t}=e;const{isInProgress:n,aspect:o,setAspect:r,defaultAspect:l}=Wk();return(0,a.createElement)(p.DropdownMenu,{icon:Yk,label:(0,g.__)("Aspect Ratio"),popoverProps:Hk,toggleProps:t,className:"wp-block-image__aspect-ratio"},(e=>{let{onClose:t}=e;return(0,a.createElement)(a.Fragment,null,(0,a.createElement)(Qk,{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)(Qk,{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)(Qk,{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 Zk=(0,a.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(O.Path,{d:"M15.1 4.8l-3-2.5V4c-4.4 0-8 3.6-8 8 0 3.7 2.5 6.9 6 7.7.3.1.6.1 1 .2l.2-1.5c-.4 0-.7-.1-1.1-.2l-.1.2v-.2c-2.6-.8-4.5-3.3-4.5-6.2 0-3.6 2.9-6.5 6.5-6.5v1.8l3-2.5zM20 11c-.2-1.4-.7-2.7-1.6-3.8l-1.2.8c.7.9 1.1 2 1.3 3.1L20 11zm-1.5 1.8c-.1.5-.2 1.1-.4 1.6s-.5 1-.8 1.5l1.2.9c.4-.5.8-1.1 1-1.8s.5-1.3.5-2l-1.5-.2zm-5.6 5.6l.2 1.5c1.4-.2 2.7-.7 3.8-1.6l-.9-1.1c-.9.7-2 1.1-3.1 1.2z"}));function Jk(){const{isInProgress:e,rotateClockwise:t}=Wk();return(0,a.createElement)(p.ToolbarButton,{icon:Zk,label:(0,g.__)("Rotate"),onClick:t,disabled:e})}function e_(){const{isInProgress:e,apply:t,cancel:n}=Wk();return(0,a.createElement)(a.Fragment,null,(0,a.createElement)(p.ToolbarButton,{onClick:t,disabled:e},(0,g.__)("Apply")),(0,a.createElement)(p.ToolbarButton,{onClick:n},(0,g.__)("Cancel")))}function t_(e){let{url:t,width:n,height:o,clientWidth:r,naturalHeight:l,naturalWidth:i}=e;return(0,a.createElement)(a.Fragment,null,(0,a.createElement)(jk,{url:t,width:n,height:o,clientWidth:r,naturalHeight:l,naturalWidth:i}),(0,a.createElement)(ro,null,(0,a.createElement)(p.ToolbarGroup,null,(0,a.createElement)(qk,null),(0,a.createElement)(p.ToolbarItem,null,(e=>(0,a.createElement)(Xk,{toggleProps:e}))),(0,a.createElement)(Jk,null)),(0,a.createElement)(p.ToolbarGroup,null,(0,a.createElement)(e_,null))))}const n_=[25,50,75,100];function o_(e){let{imageWidth:t,imageHeight:n,imageSizeOptions:o=[],isResizable:r=!0,slug:l,width:i,height:s,onChange:c,onChangeImage:d=u.noop}=e;const{currentHeight:m,currentWidth:f,updateDimension:h,updateDimensions:v}=function(e,t,n,o,r){var l,i;const[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})}}}(s,i,n,t,c);return(0,a.createElement)(a.Fragment,null,!(0,u.isEmpty)(o)&&(0,a.createElement)(p.SelectControl,{label:(0,g.__)("Image size"),value:l,options:o,onChange:d}),r&&(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)(p.TextControl,{type:"number",className:"block-editor-image-size-control__width",label:(0,g.__)("Width"),value:f,min:1,onChange:e=>h("width",e)}),(0,a.createElement)(p.TextControl,{type:"number",className:"block-editor-image-size-control__height",label:(0,g.__)("Height"),value:m,min:1,onChange:e=>h("height",e)})),(0,a.createElement)("div",{className:"block-editor-image-size-control__row"},(0,a.createElement)(p.ButtonGroup,{"aria-label":(0,g.__)("Image size presets")},n_.map((e=>{const o=Math.round(t*(e/100)),r=Math.round(n*(e/100)),l=f===o&&m===r;return(0,a.createElement)(p.Button,{key:e,isSmall:!0,variant:l?"primary":void 0,isPressed:l,onClick:()=>v(r,o)},e,"%")}))),(0,a.createElement)(p.Button,{isSmall:!0,onClick:()=>v()},(0,g.__)("Reset")))))}var r_=(0,a.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -2 24 24"},(0,a.createElement)(O.Path,{d:"M6.734 16.106l2.176-2.38-1.093-1.028-3.846 4.158 3.846 4.157 1.093-1.027-2.176-2.38h2.811c1.125 0 2.25.03 3.374 0 1.428-.001 3.362-.25 4.963-1.277 1.66-1.065 2.868-2.906 2.868-5.859 0-2.479-1.327-4.896-3.65-5.93-1.82-.813-3.044-.8-4.806-.788l-.567.002v1.5c.184 0 .368 0 .553-.002 1.82-.007 2.704-.014 4.21.657 1.854.827 2.76 2.657 2.76 4.561 0 2.472-.973 3.824-2.178 4.596-1.258.807-2.864 1.04-4.163 1.04h-.02c-1.115.03-2.229 0-3.344 0H6.734z"}));var l_=e=>{let{value:t,onChange:n=u.noop,settings:o}=e;if(!o||!o.length)return null;const r=e=>o=>{n({...t,[e.id]:o})},l=o.map((e=>(0,a.createElement)(p.ToggleControl,{className:"block-editor-link-control__setting",key:e.id,label:e.title,onChange:r(e),checked:!!t&&!!t[e.id]})));return(0,a.createElement)("fieldset",{className:"block-editor-link-control__settings"},(0,a.createElement)(p.VisuallyHidden,{as:"legend"},(0,g.__)("Currently selected link settings")),l)},i_=n(5425),a_=n.n(i_);class s_ 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,a_()(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,mp.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 Tc.UP:0!==e.target.selectionStart&&(e.preventDefault(),e.target.setSelectionRange(0,0));break;case Tc.DOWN:this.props.value.length!==e.target.selectionStart&&(e.preventDefault(),e.target.setSelectionRange(this.props.value.length,this.props.value.length));break;case Tc.ENTER:this.props.onSubmit&&this.props.onSubmit(null,e)}return}const l=this.state.suggestions[this.state.selectedSuggestion];switch(e.keyCode){case Tc.UP:{e.preventDefault();const t=n?n-1:o.length-1;this.setState({selectedSuggestion:t});break}case Tc.DOWN:{e.preventDefault();const t=null===n||n===o.length-1?0:n+1;this.setState({selectedSuggestion:t});break}case Tc.TAB:null!==this.state.selectedSuggestion&&(this.selectLink(l),this.props.speak((0,g.__)("Link selected.")));break;case Tc.ENTER: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,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:m,suggestionOptionIdPrefix:f}=this.state,h={id:`url-input-control-${o}`,label:e,className:c()("block-editor-url-input",t,{"is-full-width":n})},v={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":(0,g.__)("URL"),"aria-expanded":u,"aria-autocomplete":"list","aria-owns":m,"aria-activedescendant":null!==d?`${f}-${d}`:void 0,ref:this.inputRef};return l?l(h,v,s):(0,a.createElement)(p.BaseControl,h,(0,a.createElement)("input",v),s&&(0,a.createElement)(p.Spinner,null))}renderSuggestions(){const{className:e,__experimentalRenderSuggestions:t,value:n="",__experimentalShowInitialSuggestions:o=!1}=this.props,{showSuggestions:r,suggestions:l,selectedSuggestion:s,suggestionsListboxId:d,suggestionOptionIdPrefix:m,loading:f}=this.state,g={id:d,ref:this.autocompleteRef,role:"listbox"},h=(e,t)=>({role:"option",tabIndex:"-1",id:`${m}-${t}`,ref:this.bindSuggestionNode(t),"aria-selected":t===s});return(0,u.isFunction)(t)&&r&&l.length?t({suggestions:l,selectedSuggestion:s,suggestionsListProps:g,buildSuggestionItemProps:h,isLoading:f,handleSuggestionClick:this.handleOnClick,isInitialSuggestions:o&&!(n&&n.length)}):!(0,u.isFunction)(t)&&r&&l.length?(0,a.createElement)(p.Popover,{position:"bottom",noArrow:!0,focusOnMount:!1},(0,a.createElement)("div",i({},g,{className:c()("block-editor-url-input__suggestions",`${e}__suggestions`)}),l.map(((e,t)=>(0,a.createElement)(p.Button,i({},h(0,t),{key:e.id,className:c()("block-editor-url-input__suggestion",{"is-selected":t===s}),onClick:()=>this.handleOnClick(e)}),e.title))))):null}}var c_=(0,d.compose)(d.withSafeTimeout,p.withSpokenMessages,d.withInstanceId,(0,m.withSelect)(((e,t)=>{if((0,u.isFunction)(t.__experimentalFetchLinkSuggestions))return;const{getSettings:n}=e(qn);return{__experimentalFetchLinkSuggestions:n().__experimentalFetchLinkSuggestions}})))(s_);var u_=e=>{let t,{searchTerm:n,onClick:o,itemProps:r,isSelected:l,buttonText:s}=e;return n?(t=s?(0,u.isFunction)(s)?s(n):s:(0,a.createInterpolateElement)((0,g.sprintf)((0,g.__)("Create: %s"),n),{mark:(0,a.createElement)("mark",null)}),(0,a.createElement)(p.Button,i({},r,{className:c()("block-editor-link-control__search-create block-editor-link-control__search-item",{"is-selected":l}),onClick:o}),(0,a.createElement)(wr,{className:"block-editor-link-control__search-item-icon",icon:Vc}),(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 d_=(0,a.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(O.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"}));var p_=e=>{let{itemProps:t,suggestion:n,isSelected:o=!1,onClick:r,isURL:l=!1,searchTerm:s="",shouldShowType:u=!1}=e;return(0,a.createElement)(p.Button,i({},t,{onClick:r,className:c()("block-editor-link-control__search-item",{"is-selected":o,"is-url":l,"is-entity":!l})}),l&&(0,a.createElement)(wr,{className:"block-editor-link-control__search-item-icon",icon:d_}),(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)(p.TextHighlight,{text:n.title,highlight:s})),(0,a.createElement)("span",{"aria-hidden":!l,className:"block-editor-link-control__search-item-info"},!l&&((0,mp.filterURLForDisplay)((0,mp.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 m_="__CREATE__",f_=[{id:"opensInNewTab",title:(0,g.__)("Open in new tab")}];function g_(e){let{instanceId:t,withCreateSuggestion:n,currentInputValue:o,handleSuggestionClick:r,suggestionsListProps:l,buildSuggestionItemProps:s,suggestions:u,selectedSuggestion:d,isLoading:m,isInitialSuggestions:f,createSuggestionButtonText:h,suggestionsQuery:v}=e;const b=c()("block-editor-link-control__search-results",{"is-loading":m}),k=["url","mailto","tel","internal"],_=1===u.length&&k.includes(u[0].type.toLowerCase()),y=n&&!_&&!f,E=!(null!=v&&v.type),C=`block-editor-link-control-search-results-label-${t}`,w=f?(0,g.__)("Recently updated"):(0,g.sprintf)((0,g.__)('Search results for "%s"'),o),S=(0,a.createElement)(f?a.Fragment:p.VisuallyHidden,{},(0,a.createElement)("span",{className:"block-editor-link-control__search-results-label",id:C},w));return(0,a.createElement)("div",{className:"block-editor-link-control__search-results-wrapper"},S,(0,a.createElement)("div",i({},l,{className:b,"aria-labelledby":C}),u.map(((e,t)=>y&&m_===e.type?(0,a.createElement)(u_,{searchTerm:o,buttonText:h,onClick:()=>r(e),key:e.type,itemProps:s(e,t),isSelected:t===d}):m_===e.type?null:(0,a.createElement)(p_,{key:`${e.id}-${e.type}`,itemProps:s(e,t),suggestion:e,index:t,onClick:()=>{r(e)},isSelected:t===d,isURL:k.includes(e.type.toLowerCase()),searchTerm:o,shouldShowType:E,isFrontPage:null==e?void 0:e.isFrontPage})))))}function h_(e){const t=(0,u.startsWith)(e,"#");return(0,mp.isURL)(e)||e&&e.includes("www.")||t}const v_=()=>Promise.resolve([]),b_=e=>{let t="URL";const n=(0,mp.getProtocol)(e)||"";return n.includes("mailto")&&(t="mailto"),n.includes("tel")&&(t="tel"),(0,u.startsWith)(e,"#")&&(t="internal"),Promise.resolve([{id:e,title:e,url:"URL"===t?(0,mp.prependHTTP)(e):e,type:t}])};function k_(e,t,n,o){const{fetchSearchSuggestions:r,pageOnFront:l}=(0,m.useSelect)((e=>{const{getSettings:t}=e(qn);return{pageOnFront:t().pageOnFront,fetchSearchSuggestions:t().__experimentalFetchLinkSuggestions}}),[]),i=t?b_:v_;return(0,a.useCallback)(((t,a)=>{let{isInitialSuggestions:s}=a;return h_(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||h_(e)||!r?c:c.concat({title:e,url:e,type:m_})})(t,{...e,isInitialSuggestions:s},r,i,n,o,l)}),[i,r,n])}const __=()=>Promise.resolve([]),y_=(0,a.forwardRef)(((e,t)=>{let{value:n,children:o,currentLink:r={},className:l=null,placeholder:i=null,withCreateSuggestion:s=!1,onCreateSuggestion:p=u.noop,onChange:m=u.noop,onSelect:f=u.noop,showSuggestions:h=!0,renderSuggestions:v=(e=>(0,a.createElement)(g_,e)),fetchSuggestions:b=null,allowDirectEntry:k=!0,showInitialSuggestions:_=!1,suggestionsQuery:y={},withURLSuggestion:E=!0,createSuggestionButtonText:C,useLabel:w=!1}=e;const S=k_(y,k,s,E),B=h?b||S:__,I=(0,d.useInstanceId)(y_),[x,T]=(0,a.useState)(),N=async e=>{let t=e;if(m_!==e.type)(k||t&&Object.keys(t).length>=1)&&f({...(0,u.omit)(r,"id","url"),...t},t);else try{var n;t=await p(e.title),null!==(n=t)&&void 0!==n&&n.url&&f(t)}catch(e){}},P=c()(l,{"has-no-label":!w});return(0,a.createElement)("div",{className:"block-editor-link-control__search-input-container"},(0,a.createElement)(c_,{label:w?"URL":void 0,className:P,value:n,onChange:(e,t)=>{m(e),T(t)},placeholder:null!=i?i:(0,g.__)("Search or type url"),__experimentalRenderSuggestions:h?e=>v({...e,instanceId:I,withCreateSuggestion:s,currentInputValue:n,createSuggestionButtonText:C,suggestionsQuery:y,handleSuggestionClick:t=>{e.handleSuggestionClick&&e.handleSuggestionClick(t),N(t)}}):null,__experimentalFetchLinkSuggestions:B,__experimentalHandleURLSuggestions:!0,__experimentalShowInitialSuggestions:_,onSubmit:(e,t)=>{var o;const r=e||x;r||null!=n&&null!==(o=n.trim())&&void 0!==o&&o.length?N(r||{url:n}):t.preventDefault()},ref:t}),o)}));var E_=y_;var C_=(0,a.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(O.Path,{d:"M12 3.2c-4.8 0-8.8 3.9-8.8 8.8 0 4.8 3.9 8.8 8.8 8.8 4.8 0 8.8-3.9 8.8-8.8 0-4.8-4-8.8-8.8-8.8zm0 16c-4 0-7.2-3.3-7.2-7.2C4.8 8 8 4.8 12 4.8s7.2 3.3 7.2 7.2c0 4-3.2 7.2-7.2 7.2zM11 17h2v-6h-2v6zm0-8h2V7h-2v2z"}));var w_=(0,a.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(O.Path,{d:"M20.1 5.1L16.9 2 6.2 12.7l-1.3 4.4 4.5-1.3L20.1 5.1zM4 20.8h8v-1.5H4v1.5z"}));const{Slot:S_,Fill:B_}=(0,p.createSlotFill)("BlockEditorLinkControlViewer");function I_(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 x_=function(e){const[t,n]=(0,a.useReducer)(I_,{richData:null,isFetching:!1}),{fetchRichUrlData:o}=(0,m.useSelect)((e=>{const{getSettings:t}=e(qn);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 T_(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}=x_(s),m=u&&Object.keys(u).length,f=n&&(0,mp.filterURLForDisplay)((0,mp.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)(wr,{icon:C_,size:32}):(0,a.createElement)(wr,{icon:d_}),(0,a.createElement)("div",{"aria-label":(0,g.__)("Currently selected"),"aria-selected":"true",className:c()("block-editor-link-control__search-item",{"is-current":!0,"is-rich":m,"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)(p.ExternalLink,{className:"block-editor-link-control__search-item-title",href:n.url},(0,Jr.__unstableStripHTML)(h)),(null==n?void 0:n.url)&&(0,a.createElement)("span",{className:"block-editor-link-control__search-item-info"},f)))),(0,a.createElement)(p.Button,{icon:w_,label:(0,g.__)("Edit"),className:"block-editor-link-control__search-item-action",onClick:o,iconSize:24}),l&&(0,a.createElement)(p.Button,{icon:gg,label:(0,g.__)("Unlink"),className:"block-editor-link-control__search-item-action block-editor-link-control__unlink",onClick:i,iconSize:24}),(0,a.createElement)(S_,{fillProps:n})),(m&&((null==u?void 0:u.image)||(null==u?void 0: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)(p.__experimentalText,{truncate:!0,numberOfLines:"2"},u.description))))}const N_=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}}};function P_(e){var t,n,o;let{searchInputPlaceholder:r,value:l,settings:i=f_,onChange:s=u.noop,onRemove:d,noDirectEntry:m=!1,showSuggestions:f=!0,showInitialSuggestions:h,forceIsEditingLink:v,createSuggestion:b,withCreateSuggestion:k,inputValue:_="",suggestionsQuery:y={},noURLSuggestion:E=!1,createSuggestionButtonText:C,hasRichPreviews:w=!1,hasTextControl:S=!1,renderControlBottom:B=null}=e;void 0===k&&b&&(k=!0);const I=(0,a.useRef)(!0),x=(0,a.useRef)(),T=(0,a.useRef)(),[N,P]=(0,a.useState)((null==l?void 0:l.url)||""),[M,R]=(0,a.useState)((null==l?void 0:l.title)||""),L=_||N,[A,D]=(0,a.useState)(void 0!==v?v:!l||!l.url),O=(0,a.useRef)(!1),F=!(null!=L&&null!==(t=L.trim())&&void 0!==t&&t.length),{createPage:z,isCreatingPage:V,errorMessage:H}=function(e){const t=(0,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=N_(Promise.resolve(e(n))),await t.current.promise}catch(e){if(e&&e.isCanceled)return;throw l(e.message||(0,g.__)("An unknown error occurred during creation. Please try again.")),e}finally{o(!1)}},isCreatingPage:n,errorMessage:r}}(b);function G(){var e;O.current=!(null===(e=x.current)||void 0===e||!e.contains(x.current.ownerDocument.activeElement)),D(!1)}(0,a.useEffect)((()=>{void 0!==v&&v!==A&&D(v)}),[v]),(0,a.useEffect)((()=>{if(I.current)return void(I.current=!1);const e=null!=T&&T.current?1:0;(Jr.focus.focusable.find(x.current)[e]||x.current).focus(),O.current=!1}),[A,V]),(0,a.useEffect)((()=>{null!=l&&l.title&&l.title!==M&&R(l.title),null!=l&&l.url&&P(l.url)}),[l]);const U=()=>{L===(null==l?void 0:l.url)&&M===(null==l?void 0:l.title)||s({url:L,title:M}),G()},W=d&&l&&!A&&!V,$=!(null==i||!i.length),j=(null==l||null===(n=l.url)||void 0===n||null===(o=n.trim())||void 0===o?void 0:o.length)>0&&S;return(0,a.createElement)("div",{tabIndex:-1,ref:x,className:"block-editor-link-control"},V&&(0,a.createElement)("div",{className:"block-editor-link-control__loading"},(0,a.createElement)(p.Spinner,null)," ",(0,g.__)("Creating"),"…"),(A||!l)&&!V&&(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)(p.TextControl,{ref:T,className:"block-editor-link-control__field block-editor-link-control__text-content",label:"Text",value:M,onChange:R,onKeyDown:e=>{const{keyCode:t}=e;t!==Tc.ENTER||F||(e.preventDefault(),U())}}),(0,a.createElement)(E_,{currentLink:l,className:"block-editor-link-control__field block-editor-link-control__search-input",placeholder:r,value:L,withCreateSuggestion:k,onCreateSuggestion:z,onChange:P,onSelect:e=>{s({...e,title:M||(null==e?void 0:e.title)}),G()},showInitialSuggestions:h,allowDirectEntry:!m,showSuggestions:f,suggestionsQuery:y,withURLSuggestion:!E,createSuggestionButtonText:C,useLabel:j},(0,a.createElement)("div",{className:"block-editor-link-control__search-actions"},(0,a.createElement)(p.Button,{onClick:U,label:(0,g.__)("Submit"),icon:r_,className:"block-editor-link-control__search-submit",disabled:F})))),H&&(0,a.createElement)(p.Notice,{className:"block-editor-link-control__search-error",status:"error",isDismissible:!1},H)),l&&!A&&!V&&(0,a.createElement)(T_,{key:null==l?void 0:l.url,value:l,onEditClick:()=>D(!0),hasRichPreviews:w,hasUnlinkControl:W,onRemove:d}),$&&(0,a.createElement)("div",{className:"block-editor-link-control__tools"},(0,a.createElement)(l_,{value:l,settings:i,onChange:s})),B&&B())}P_.ViewerFill=B_;var M_=P_;var R_=(0,a.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(O.Path,{d:"M18.7 3H5.3C4 3 3 4 3 5.3v13.4C3 20 4 21 5.3 21h13.4c1.3 0 2.3-1 2.3-2.3V5.3C21 4 20 3 18.7 3zm.8 15.7c0 .4-.4.8-.8.8H5.3c-.4 0-.8-.4-.8-.8V5.3c0-.4.4-.8.8-.8h13.4c.4 0 .8.4.8.8v13.4zM10 15l5-3-5-3v6z"}));var L_=(0,a.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(O.Path,{d:"M18.5 15v3.5H13V6.7l4.5 4.1 1-1.1-6.2-5.8-5.8 5.8 1 1.1 4-4v11.7h-6V15H4v5h16v-5z"}));var A_=(0,p.withFilters)("editor.MediaUpload")((()=>null));var D_=function(e){let{fallback:t=null,children:n}=e;const o=(0,m.useSelect)((e=>{const{getSettings:t}=e(qn);return!!t().mediaUpload}),[]);return o?n:t};var O_=(0,d.compose)([(0,m.withDispatch)((e=>{const{createNotice:t,removeNotice:n}=e(zd.store);return{createNotice:t,removeNotice:n}})),(0,p.withFilters)("editor.MediaReplaceFlow")])((e=>{let{mediaURL:t,mediaId:n,mediaIds:o,allowedTypes:r,accept:l,onError:i,onSelect:s,onSelectURL:c,onFilesUpload:d=u.noop,name:f=(0,g.__)("Replace"),createNotice:h,removeNotice:v,children:b,multiple:k=!1,addToGallery:_,handleUpload:y=!0}=e;const[E,C]=(0,a.useState)(t),w=(0,m.useSelect)((e=>e(qn).getSettings().mediaUpload),[]),S=(0,a.useRef)(),B=(0,u.uniqueId)("block-editor/media-replace-flow/error-notice/"),I=e=>{const t=(0,Jr.__unstableStripHTML)(e);i?i(t):setTimeout((()=>{h("error",t,{speak:!0,id:B,isDismissible:!0})}),1e3)},x=(e,t)=>{t(),C(null==e?void 0:e.url),s(e),(0,Ft.speak)((0,g.__)("The media file has been replaced")),v(B)},T=e=>{e.keyCode===Tc.DOWN&&(e.preventDefault(),e.target.click())},N=k&&!(!r||0===r.length)&&r.every((e=>"image"===e||e.startsWith("image/")));return(0,a.createElement)(p.Dropdown,{popoverProps:{isAlternate:!0},contentClassName:"block-editor-media-replace-flow__options",renderToggle:e=>{let{isOpen:t,onToggle:n}=e;return(0,a.createElement)(p.ToolbarButton,{ref:S,"aria-expanded":t,"aria-haspopup":"true",onClick:n,onKeyDown:T},f)},renderContent:e=>{let{onClose:t}=e;return(0,a.createElement)(a.Fragment,null,(0,a.createElement)(p.NavigableMenu,{className:"block-editor-media-replace-flow__media-upload-menu"},(0,a.createElement)(A_,{gallery:N,addToGallery:_,multiple:k,value:k?o:n,onSelect:e=>x(e,t),allowedTypes:r,render:e=>{let{open:t}=e;return(0,a.createElement)(p.MenuItem,{icon:R_,onClick:t},(0,g.__)("Open Media Library"))}}),(0,a.createElement)(D_,null,(0,a.createElement)(p.FormFileUpload,{onChange:e=>{((e,t)=>{const n=e.target.files;if(!y)return t(),s(n);d(n),w({allowedTypes:r,filesList:n,onFileChange:e=>{let[n]=e;x(n,t)},onError:I})})(e,t)},accept:l,multiple:k,render:e=>{let{openFileDialog:t}=e;return(0,a.createElement)(p.MenuItem,{icon:L_,onClick:()=>{t()}},(0,g.__)("Upload"))}})),b),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_,{value:{url:E},settings:[],showSuggestions:!1,onChange:e=>{let{url:t}=e;C(t),c(t),S.current.focus()}})))}})}));function F_(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)(p.ExternalLink,{className:r,href:t},n||(0,mp.filterURLForDisplay)((0,mp.safeDecodeURI)(t))):(0,a.createElement)("span",{className:r})}function z_(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)(p.Popover,i({className:"block-editor-url-popover",focusOnMount:l,position:r},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)(p.Button,{className:"block-editor-url-popover__settings-toggle",icon:Jp,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))}z_.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)(c_,{value:r,onChange:o,autocompleteRef:t}),(0,a.createElement)(p.Button,{icon:r_,label:(0,g.__)("Apply"),type:"submit"}))},z_.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)(F_,{url:r,urlLabel:l,className:n}),o&&(0,a.createElement)(p.Button,{icon:w_,label:(0,g.__)("Edit"),onClick:o}))};var V_=z_;const H_=e=>{let{src:t,onChange:n,onSubmit:o,onClose:r}=e;return(0,a.createElement)(V_,{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)(p.Button,{className:"block-editor-media-placeholder__url-input-submit-button",icon:r_,label:(0,g.__)("Apply"),type:"submit"})))};var G_=(0,p.withFilters)("editor.MediaPlaceholder")((function(e){let{value:t={},allowedTypes:n,className:o,icon:r,labels:l={},mediaPreview:i,notices:s,isAppender:d,accept:f,addToGallery:h,multiple:v=!1,handleUpload:b=!0,disableDropZone:k,disableMediaButtons:_,onError:y,onSelect:E,onCancel:C,onSelectURL:w,onDoubleClick:S,onFilesPreUpload:B=u.noop,onHTMLDrop:I=u.noop,children:x,mediaLibraryButton:T,placeholder:N,style:P}=e;const M=(0,m.useSelect)((e=>{const{getSettings:t}=e(qn);return t().mediaUpload}),[]),[R,L]=(0,a.useState)(""),[A,D]=(0,a.useState)(!1);(0,a.useEffect)((()=>{var e;L(null!==(e=null==t?void 0:t.src)&&void 0!==e?e:"")}),[null==t?void 0:t.src]);const O=e=>{L(e.target.value)},F=()=>{D(!0)},z=()=>{D(!1)},V=e=>{e.preventDefault(),R&&w&&(w(R),z())},H=e=>{if(!b)return E(e);let o;if(B(e),v)if(h){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)}))));E(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=E;else o=e=>{let[t]=e;return E(t)};M({allowedTypes:n,filesList:e,onFileChange:o,onError:y})},G=e=>{H(e.target.files)},U=null!=N?N:e=>{let{instructions:t,title:u}=l;if(M||w||(t=(0,g.__)("To edit this block, you need permission to upload media.")),void 0===t||void 0===u){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===u&&(u=(0,g.__)("Media"),l?u=(0,g.__)("Audio"):i?u=(0,g.__)("Image"):a&&(u=(0,g.__)("Video")))}const m=c()("block-editor-media-placeholder",o,{"is-appender":d});return(0,a.createElement)(p.Placeholder,{icon:r,label:u,instructions:t,className:m,notices:s,onDoubleClick:S,preview:i,style:P},e,x)},W=()=>k?null:(0,a.createElement)(p.DropZone,{onFilesDrop:H,onHTMLDrop:I}),$=()=>C&&(0,a.createElement)(p.Button,{className:"block-editor-media-placeholder__cancel-button",title:(0,g.__)("Cancel"),variant:"link",onClick:C},(0,g.__)("Cancel")),j=()=>w&&(0,a.createElement)("div",{className:"block-editor-media-placeholder__url-input-container"},(0,a.createElement)(p.Button,{className:"block-editor-media-placeholder__button",onClick:F,isPressed:A,variant:"tertiary"},(0,g.__)("Insert from URL")),A&&(0,a.createElement)(H_,{src:R,onChange:O,onSubmit:V,onClose:z}));return _?(0,a.createElement)(D_,null,W()):(0,a.createElement)(D_,{fallback:U(j())},(()=>{const e=null!=T?T:e=>{let{open:t}=e;return(0,a.createElement)(p.Button,{variant:"tertiary",onClick:()=>{t()}},(0,g.__)("Media Library"))},o=(0,a.createElement)(A_,{addToGallery:h,gallery:v&&!(!n||0===n.length)&&n.every((e=>"image"===e||e.startsWith("image/"))),multiple:v,onSelect:E,allowedTypes:n,value:Array.isArray(t)?t.map((e=>{let{id:t}=e;return t})):t.id,render:e});if(M&&d)return(0,a.createElement)(a.Fragment,null,W(),(0,a.createElement)(p.FormFileUpload,{onChange:G,accept:f,multiple:v,render:e=>{let{openFileDialog:t}=e;const n=(0,a.createElement)(a.Fragment,null,(0,a.createElement)(p.Button,{variant:"primary",className:c()("block-editor-media-placeholder__button","block-editor-media-placeholder__upload-button"),onClick:t},(0,g.__)("Upload")),o,j(),$());return U(n)}}));if(M){const e=(0,a.createElement)(a.Fragment,null,W(),(0,a.createElement)(p.FormFileUpload,{variant:"primary",className:c()("block-editor-media-placeholder__button","block-editor-media-placeholder__upload-button"),onChange:G,accept:f,multiple:v},(0,g.__)("Upload")),o,j(),$());return U(e)}return U(o)})())}));var U_=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)(yk,i({settings:o,gradients:[],disableCustomGradients:!0},n))};const W_={position:"bottom right",isAlternate:!0};var $_=()=>(0,a.createElement)(a.Fragment,null,["bold","italic","link"].map((e=>(0,a.createElement)(p.Slot,{name:`RichText.ToolbarControls.${e}`,key:e}))),(0,a.createElement)(p.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)(p.ToolbarItem,null,(n=>(0,a.createElement)(p.DropdownMenu,{icon:Jp,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:W_})))})));var j_=e=>{let{inline:t,anchorRef:n}=e;return t?(0,a.createElement)(p.Popover,{noArrow:!0,position:"top center",focusOnMount:!1,anchorRef:n,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)(p.ToolbarGroup,null,(0,a.createElement)($_,null)))):(0,a.createElement)(ro,{group:"inline"},(0,a.createElement)($_,null))};function K_(){const{didAutomaticChange:e,getSettings:t}=(0,m.useSelect)(qn);return(0,d.useRefEffect)((n=>{function o(n){const{keyCode:o}=n;n.defaultPrevented||o!==Tc.DELETE&&o!==Tc.BACKSPACE&&o!==Tc.ESCAPE||e()&&(n.preventDefault(),t().__experimentalUndo())}return n.addEventListener("keydown",o),()=>{n.removeEventListener("keydown",o)}}),[])}function q_(e){return e.filter((e=>{let{type:t}=e;return/^image\/(?:jpe?g|png|gif|webp)$/.test(t)})).map((e=>``)).join("")}var Y_=window.wp.shortcode;function Q_(e,t){if(null!=t&&t.length){let n=e.formats.length;for(;n--;)e.formats[n]=[...t,...e.formats[n]||[]]}}function X_(e){if(!0===e||"p"===e||"li"===e)return!0===e?"p":e}function Z_(e){let{allowedFormats:t,formattingControls:n,disableFormats:o}=e;return o?Z_.EMPTY_ARRAY:t||n?t||(Vt()("wp.blockEditor.RichText formattingControls prop",{since:"5.4",alternative:"allowedFormats",version:"6.2"}),n.map((e=>`core/${e}`))):void 0}Z_.EMPTY_ARRAY=[];function J_(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 ey(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 ty(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="";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 k=a.reduce(((e,t)=>{let{__unstablePasteRule:n}=t;return n&&e===i&&(e=n(i,{html:b,plainText:v})),e}),i);if(k!==i)return void l(k);const _=[...(0,Jr.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=ey(t,!!m),Q_(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!=_&&_.length&&!Fm(_,b)){const e=(0,r.pasteHandler)({HTML:q_(_),mode:"BLOCKS",tagName:s,preserveWhiteSpace:f});return window.console.log("Received items:\n\n",_),void(c&&(0,z.isEmpty)(i)?c(e):J_({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,Y_.regexp)(".*").test(E))&&(y="BLOCKS"),p&&(0,z.isEmpty)(i)&&(0,mp.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=ey(e,!!m),Q_(e,i.activeFormats),l((0,z.insert)(i,e))}else C.length>0&&(c&&(0,z.isEmpty)(i)?c(C,C.length-1,-1):J_({value:i,pastedBlocks:C,onReplace:c,onSplit:u,onSplitMiddle:d,multilineTag:m}))}return e.addEventListener("paste",n),()=>{e.removeEventListener("paste",n)}}),[])}function ny(e){let t=e.length;for(;t--;){const n=(0,u.findKey)(e[t].attributes,(e=>"string"==typeof e&&-1!==e.indexOf("†")));if(n)return e[t].attributes[n]=e[t].attributes[n].replace("†",""),e[t].clientId;const o=ny(e[t].innerBlocks);if(o)return o}}function oy(e){const{__unstableMarkLastChangeAsPersistent:t,__unstableMarkAutomaticChange:n}=(0,m.useDispatch)(qn),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,"†",0,i)}),p=u.transform(d);l(ny([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{e.removeEventListener("input",i),e.removeEventListener("compositionend",i)}}),[])}function ry(e){const{__unstableMarkAutomaticChange:t}=(0,m.useDispatch)(qn),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!==Tc.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)?J_({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&&J_({value:m,onReplace:i,onSplit:a,onSplitMiddle:s,multilineTag:c})}}return e.addEventListener("keydown",o),()=>{e.removeEventListener("keydown",o)}}),[])}function ly(e){return e(z.store).getFormatTypes()}const iy=new Set(["a","audio","button","details","embed","iframe","input","label","select","textarea","video"]);function ay(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 sy(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 cy(){const{isMultiSelecting:e}=(0,m.useSelect)(qn);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 uy(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 dy=(0,a.createContext)(),py=(0,a.createContext)();const my=(0,a.forwardRef)((function e(t,n){let{children:o,tagName:l="div",value:s="",onChange:f,isSelected:g,multiline:h,inlineToolbar:v,wrapperClassName:b,autocompleters:k,onReplace:_,placeholder:y,allowedFormats:E,formattingControls:C,withoutInteractiveFormatting:w,onRemove:S,onMerge:B,onSplit:I,__unstableOnSplitAtEnd:x,__unstableOnSplitMiddle:T,identifier:N,preserveWhiteSpace:P,__unstablePastePlainText:M,__unstableEmbedURLOnPaste:R,__unstableDisableFormats:L,disableLineBreaks:A,unstableOnFocus:D,__unstableAllowPrefixTransformations:O,...F}=t;const V=(0,d.useInstanceId)(e);N=N||V,F=function(e){return(0,u.omit)(e,["__unstableMobileNoFocusOnMount","deleteEnter","placeholderTextColor","textAlign","selectionColor","tagsToEliminate","rootTagsToEliminate","disableEditingMenu","fontSize","fontFamily","fontWeight","fontStyle","minWidth","maxWidth","setRef"])}(F);const H=(0,a.useRef)(),{clientId:G}=Zn(),{selectionStart:U,selectionEnd:W,isSelected:$}=(0,m.useSelect)((e=>{const{getSelectionStart:t,getSelectionEnd:n}=e(qn),o=t(),r=n();let l;return void 0===g?l=o.clientId===G&&r.clientId===G&&o.attributeKey===N:g&&(l=o.clientId===G),{selectionStart:l?o.offset:void 0,selectionEnd:l?r.offset:void 0,isSelected:l}})),{selectionChange:j}=(0,m.useDispatch)(qn),K=X_(h),q=Z_({allowedFormats:E,formattingControls:C,disableFormats:L}),Y=!q||q.length>0;let Q=s,X=f;Array.isArray(s)&&(Q=r.children.toHTML(s),X=e=>f(r.children.fromDOM((0,z.__unstableCreateElement)(document,e).childNodes)));const Z=(0,a.useCallback)(((e,t)=>{const n={},o=void 0===e&&void 0===t;("number"==typeof e||o)&&(n.start={clientId:G,attributeKey:N,offset:e}),("number"==typeof t||o)&&(n.end={clientId:G,attributeKey:N,offset:t}),j(n)}),[G,N]),{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,m.useSelect)(ly,[]),i=(0,a.useMemo)((()=>l.filter((e=>{let{name:t,tagName:n}=e;return!(r&&!r.includes(t)||o&&iy.has(n))}))),[l,r,iy]),s=(0,m.useSelect)((e=>i.reduce(((o,r)=>(r.__experimentalGetPropsForEditableTreePreparation&&(o[r.name]=r.__experimentalGetPropsForEditableTreePreparation(e,{richTextIdentifier:n,blockClientId:t})),o)),{})),[i,t,n]),c=(0,m.useDispatch)(),u=[],d=[],p=[],f=[];return i.forEach((e=>{if(e.__experimentalCreatePrepareEditableTree){const o=s[e.name],r=e.__experimentalCreatePrepareEditableTree(o,{richTextIdentifier:n,blockClientId:t});e.__experimentalCreateOnChangeEditableValue?d.push(r):u.push(r);for(const e in o)f.push(o[e])}if(e.__experimentalCreateOnChangeEditableValue){let o={};e.__experimentalGetPropsForEditableTreeChangeHandler&&(o=e.__experimentalGetPropsForEditableTreeChangeHandler(c,{richTextIdentifier:n,blockClientId:t})),p.push(e.__experimentalCreateOnChangeEditableValue({...s[e.name]||{},...o},{richTextIdentifier:n,blockClientId:t}))}})),{formatTypes:i,prepareHandlers:u,valueHandlers:d,changeHandlers:p,dependencies:f}}({clientId:G,identifier:N,withoutInteractiveFormatting:w,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:Q,onChange(e,t){let{__unstableFormats:n,__unstableText:o}=t;X(e),Object.values(ne).forEach((e=>{e(n,o)}))},selectionStart:U,selectionEnd:W,onSelectionChange:Z,placeholder:y,__unstableIsSelected:$,__unstableMultilineTag:K,__unstableDisableFormats:L,preserveWhiteSpace:P,__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,p.__unstableUseAutocompleteProps)({...e,completers:ib(e)})}({onReplace:_,completers:k,record:le,onChange:ie});!function(e){let{value:t}=e;const n=t.activeFormats&&!!t.activeFormats.length,{isCaretWithinFormattedText:o}=(0,m.useSelect)(qn),{enterFormattedText:r,exitFormattedText:l}=(0,m.useDispatch)(qn);(0,a.useEffect)((()=>{n?o()||r():o()&&l()}),[n])}({value:le}),function(e){let{html:t,value:n}=e;const o=(0,a.useRef)(),r=n.activeFormats&&!!n.activeFormats.length,{__unstableMarkLastChangeAsPersistent:l}=(0,m.useDispatch)(qn);(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:Q,value:le});const ce=(0,a.useRef)(new Set),ue=(0,a.useRef)(new Set);function de(){H.current.focus()}const pe=l,me=(0,a.createElement)(a.Fragment,null,$&&(0,a.createElement)(dy.Provider,{value:ce},(0,a.createElement)(py.Provider,{value:ue},(0,a.createElement)(p.Popover.__unstableSlotNameProvider,{value:"__unstable-block-tools-after"},o&&o({value:le,onChange:ie,onFocus:de}),(0,a.createElement)(uy,{value:le,onChange:ie,onFocus:de,formatTypes:J,forwardedRef:H})))),$&&Y&&(0,a.createElement)(j_,{inline:v,anchorRef:H.current}),(0,a.createElement)(pe,i({role:"textbox","aria-multiline":!A,"aria-label":y},F,se,{ref:(0,d.useMergeRefs)([n,se.ref,F.ref,ae,oy({value:le,onChange:ie,__unstableAllowPrefixTransformations:O,formatTypes:J,onReplace:_,selectionChange:j}),(0,d.useRefEffect)((e=>{function t(e){(Tc.isKeyboardEvent.primary(e,"z")||Tc.isKeyboardEvent.primary(e,"y")||Tc.isKeyboardEvent.primaryShift(e,"z"))&&e.preventDefault()}return e.addEventListener("keydown",t),()=>{e.addEventListener("keydown",t)}}),[]),ay(ce),sy(ue),K_(),ty({isSelected:$,disableFormats:L,onChange:ie,value:le,formatTypes:J,tagName:l,onReplace:_,onSplit:I,onSplitMiddle:T,__unstableEmbedURLOnPaste:R,multilineTag:K,preserveWhiteSpace:P,pastePlainText:M}),ry({removeEditorOnlyFormats:re,value:le,onReplace:_,onSplit:I,onSplitMiddle:T,multilineTag:K,onChange:ie,disableLineBreaks:A,onSplitAtEnd:x}),cy(),H]),contentEditable:!0,suppressContentEditableWarning:!0,className:c()("block-editor-rich-text__editable",F.className,"rich-text"),onFocus:D,onKeyDown:function(e){const{keyCode:t}=e;if(!e.defaultPrevented&&(t===Tc.DELETE||t===Tc.BACKSPACE)){const{start:n,end:o,text:r}=le,l=t===Tc.BACKSPACE,i=le.activeFormats&&!!le.activeFormats.length;if(!(0,z.isCollapsed)(le)||i||l&&0!==n||!l&&o!==r.length)return;B&&B(!l),S&&(0,z.isEmpty)(le)&&l&&S(!l),e.preventDefault()}}})));if(!b)return me;Vt()("wp.blockEditor.RichText wrapperClassName prop",{since:"5.4",alternative:"className prop or create your own wrapper div",version:"6.2"});const fe=c()("block-editor-rich-text",b);return(0,a.createElement)("div",{className:fe},me)}));my.Content=e=>{let{value:t,tagName:n,multiline:o,...l}=e;Array.isArray(t)&&(t=r.children.toHTML(t));const i=X_(o);!t&&i&&(t=`<${i}>`);const s=(0,a.createElement)(a.RawHTML,null,t);return n?(0,a.createElement)(n,(0,u.omit)(l,["format"]),s):s},my.isEmpty=e=>!e||0===e.length;var fy=my;const gy=(0,a.forwardRef)(((e,t)=>(0,a.createElement)(fy,i({ref:t},e,{__unstableDisableFormats:!0,preserveWhiteSpace:!0}))));gy.Content=e=>{let{value:t="",tagName:n="div",...o}=e;return(0,a.createElement)(n,o,t)};var hy=gy;var vy=(0,a.forwardRef)(((e,t)=>{let{__experimentalVersion:n,...o}=e;if(2===n)return(0,a.createElement)(hy,i({ref:t},o));const{className:r,onChange:l,...s}=o;return(0,a.createElement)(vl.Z,i({ref:t,className:c()("block-editor-plain-text",r),onChange:e=>l(e.target.value)},s))}));function by(e){let{property:t,viewport:n,desc:o}=e;const r=(0,d.useInstanceId)(by),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)(p.VisuallyHidden,{as:"span",id:`rbc-desc-${r}`},l))}var ky=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 m=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)(by,{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)(p.ToggleControl,{className:"block-editor-responsive-block-control__toggle",label:m,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)(by,{property:n,viewport:e}),e))))))))};function _y(e){let{character:t,type:n,onUse:o}=e;const r=(0,a.useContext)(dy),l=(0,a.useRef)();return l.current=o,(0,a.useEffect)((()=>{function e(e){Tc.isKeyboardEvent[n](e,t)&&(l.current(),e.preventDefault())}return r.current.add(e),()=>{r.current.delete(e)}}),[t,n]),null}function yy(e){let t,{name:n,shortcutType:o,shortcutCharacter:r,...l}=e,s="RichText.ToolbarControls";return n&&(s+=`.${n}`),o&&r&&(t=Tc.displayShortcut[o](r)),(0,a.createElement)(p.Fill,{name:s},(0,a.createElement)(p.ToolbarButton,i({},l,{shortcut:t})))}function Ey(e){let{inputType:t,onInput:n}=e;const o=(0,a.useContext)(py),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 Cy=(0,a.createElement)(p.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},(0,a.createElement)(p.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 wy=(0,a.forwardRef)((function(e,t){const n=(0,m.useSelect)((e=>e(qn).isNavigationMode()),[]),{setNavigationMode:o}=(0,m.useDispatch)(qn),r=e=>{o("edit"!==e)};return(0,a.createElement)(p.Dropdown,{renderToggle:o=>{let{isOpen:r,onToggle:l}=o;return(0,a.createElement)(p.Button,i({},e,{ref:t,icon:n?Cy:w_,"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)(p.NavigableMenu,{role:"menu","aria-label":(0,g.__)("Tools")},(0,a.createElement)(p.MenuItemsChoice,{value:n?"select":"edit",onSelect:r,choices:[{value:"edit",label:(0,a.createElement)(a.Fragment,null,(0,a.createElement)(wr,{icon:w_}),(0,g.__)("Edit"))},{value:"select",label:(0,a.createElement)(a.Fragment,null,Cy,(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 Sy(e){let{units:t,...n}=e;const o=(0,p.__experimentalUseCustomUnits)({availableUnits:Io("spacing.units")||["%","px","em","rem","vw"],units:t});return(0,a.createElement)(p.__experimentalUnitControl,i({units:o},n))}var By=(0,a.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(O.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 Iy 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)(p.Button,{icon:fg,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)(p.Button,{className:"block-editor-url-input__back",icon:By,label:(0,g.__)("Close"),onClick:this.toggle}),(0,a.createElement)(c_,{value:e||"",onChange:t}),(0,a.createElement)(p.Button,{icon:r_,label:(0,g.__)("Submit"),type:"submit"}))))}}var xy=Iy;var Ty=(0,a.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(O.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 Ny="none",Py="custom",My="media",Ry="attachment",Ly=["noreferrer","noopener"],Ay=(0,a.createElement)(p.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,a.createElement)(p.Path,{d:"M0,0h24v24H0V0z",fill:"none"}),(0,a.createElement)(p.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)(p.Path,{d:"m14.14 11.86l-3 3.87-2.14-2.59-3 3.86h12l-3.86-5.14z"})),Dy=e=>{let{linkDestination:t,onChangeUrl:n,url:o,mediaType:r="image",mediaUrl:l,mediaLink:i,linkTarget:s,linkClass:c,rel:d}=e;const[m,f]=(0,a.useState)(!1),h=(0,a.useCallback)((()=>{f(!0)})),[v,b]=(0,a.useState)(!1),[k,_]=(0,a.useState)(null),y=(0,a.useRef)(null),E=(0,a.useCallback)((()=>{t!==My&&t!==Ry||_(""),b(!0)})),C=(0,a.useCallback)((()=>{b(!1)})),w=(0,a.useCallback)((()=>{_(null),C(),f(!1)})),S=(0,a.useCallback)((()=>e=>{const t=y.current;t&&t.contains(e.target)||(f(!1),_(null),C())})),B=(0,a.useCallback)((()=>e=>{if(k){var t;const e=(null===(t=x().find((e=>e.url===k)))||void 0===t?void 0:t.linkDestination)||Py;n({href:k,linkDestination:e})}C(),_(null),e.preventDefault()})),I=(0,a.useCallback)((()=>{n({linkDestination:Ny,href:""})})),x=()=>{const e=[{linkDestination:My,title:(0,g.__)("Media File"),url:"image"===r?l:void 0,icon:Ay}];return"image"===r&&i&&e.push({linkDestination:Ry,title:(0,g.__)("Attachment Page"),url:"image"===r?i:void 0,icon:(0,a.createElement)(p.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,a.createElement)(p.Path,{d:"M0 0h24v24H0V0z",fill:"none"}),(0,a.createElement)(p.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},T=(0,a.createElement)(a.Fragment,null,(0,a.createElement)(p.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(" ");Ly.forEach((t=>{e.includes(t)||e.push(t)})),n=e.join(" ")}else{const e=(null!=d?d:"").split(" ").filter((e=>!1===Ly.includes(e)));n=e.length?e.join(" "):void 0}return{linkTarget:t,rel:n}})(e);n(t)},checked:"_blank"===s}),(0,a.createElement)(p.TextControl,{label:(0,g.__)("Link Rel"),value:null!=d?d:"",onChange:e=>{n({rel:e})}}),(0,a.createElement)(p.TextControl,{label:(0,g.__)("Link CSS Class"),value:c||"",onChange:e=>{n({linkClass:e})}})),N=null!==k?k:o,P=((0,u.find)(x(),["linkDestination",t])||{}).title;return(0,a.createElement)(a.Fragment,null,(0,a.createElement)(p.ToolbarButton,{icon:fg,className:"components-toolbar__control",label:o?(0,g.__)("Edit link"):(0,g.__)("Insert link"),"aria-expanded":m,onClick:h}),m&&(0,a.createElement)(V_,{onFocusOutside:S(),onClose:w,renderSettings:()=>T,additionalControls:!N&&(0,a.createElement)(p.NavigableMenu,null,(0,u.map)(x(),(e=>(0,a.createElement)(p.MenuItem,{key:e.linkDestination,icon:e.icon,onClick:()=>{_(null),(e=>{const t=x();let o;o=e?((0,u.find)(t,(t=>t.url===e))||{linkDestination:Py}).linkDestination:Ny,n({linkDestination:o,href:e})})(e.url),C()}},e.title))))},(!o||v)&&(0,a.createElement)(V_.LinkEditor,{className:"block-editor-format-toolbar__link-container-content",value:N,onChangeInputValue:_,onSubmit:B(),autocompleteRef:y}),o&&!v&&(0,a.createElement)(a.Fragment,null,(0,a.createElement)(V_.LinkViewer,{className:"block-editor-format-toolbar__link-container-content",url:o,onEditLinkClick:E,urlLabel:P}),(0,a.createElement)(p.Button,{icon:Ty,label:(0,g.__)("Remove link"),onClick:I}))))};function Oy(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.__)("Preview")};return(0,a.createElement)(p.DropdownMenu,{className:"block-editor-post-preview__dropdown",popoverProps:i,toggleProps:s,icon:null},(()=>(0,a.createElement)(a.Fragment,null,(0,a.createElement)(p.MenuGroup,null,(0,a.createElement)(p.MenuItem,{className:"block-editor-post-preview__button-resize",onClick:()=>l("Desktop"),icon:"Desktop"===r&&hm},(0,g.__)("Desktop")),(0,a.createElement)(p.MenuItem,{className:"block-editor-post-preview__button-resize",onClick:()=>l("Tablet"),icon:"Tablet"===r&&hm},(0,g.__)("Tablet")),(0,a.createElement)(p.MenuItem,{className:"block-editor-post-preview__button-resize",onClick:()=>l("Mobile"),icon:"Mobile"===r&&hm},(0,g.__)("Mobile"))),t)))}function Fy(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{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 zy=(0,m.withSelect)((e=>({selectedBlockClientId:e(qn).getBlockSelectionStart()})))((e=>{let{selectedBlockClientId:t}=e;const n=Eo(t);return t?(0,a.createElement)(p.Button,{variant:"secondary",className:"block-editor-skip-to-selected-block",onClick:()=>{n.current.focus()}},(0,g.__)("Skip to the selected block")):null})),Vy=window.wp.wordcount;var Hy=(0,m.withSelect)((e=>{const{getMultiSelectedBlocks:t}=e(qn);return{blocks:t()}}))((function(e){let{blocks:t}=e;const n=(0,Vy.count)((0,r.serialize)(t),"words");return(0,a.createElement)("div",{className:"block-editor-multi-selection-inspector__card"},(0,a.createElement)(Wc,{icon:mm,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 Gy(e){let{blockName:t}=e;const{preferredStyle:n,onUpdatePreferredStyleVariations:o,styles:l}=(0,m.useSelect)((e=>{var n,o;const l=e(qn).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=_m(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)(p.SelectControl,{options:i,value:n||"",label:(0,g.__)("Default Style"),onChange:c})):null}const Uy=e=>{let{clientId:t,blockName:n,hasBlockStyles:o}=e;const l=Gp(t);return(0,a.createElement)("div",{className:"block-editor-block-inspector"},(0,a.createElement)($c,l),(0,a.createElement)(ik,{blockClientId:t}),o&&(0,a.createElement)("div",null,(0,a.createElement)(p.PanelBody,{title:(0,g.__)("Styles")},(0,a.createElement)(Wb,{scope:"core/block-inspector",clientId:t}),(0,r.hasBlockSupport)(n,"defaultStylePicker",!0)&&(0,a.createElement)(Gy,{blockName:n}))),(0,a.createElement)(zo.Slot,null),(0,a.createElement)(zo.Slot,{__experimentalGroup:"color",label:(0,g.__)("Color"),className:"color-block-support-panel__inner-wrapper"}),(0,a.createElement)(zo.Slot,{__experimentalGroup:"typography",label:(0,g.__)("Typography")}),(0,a.createElement)(zo.Slot,{__experimentalGroup:"dimensions",label:(0,g.__)("Dimensions")}),(0,a.createElement)(zo.Slot,{__experimentalGroup:"border",label:(0,g.__)("Border")}),(0,a.createElement)("div",null,(0,a.createElement)(Wy,null)),(0,a.createElement)(zy,{key:"back"}))},Wy=()=>{const e=(0,p.__experimentalUseSlot)(Fo.slotName);return Boolean(e.fills&&e.fills.length)?(0,a.createElement)(p.PanelBody,{className:"block-editor-block-inspector__advanced",title:(0,g.__)("Advanced"),initialOpen:!1},(0,a.createElement)(zo.Slot,{__experimentalGroup:"advanced"})):null};var $y=e=>{let{showNoBlockSelectedMessage:t=!0}=e;const{count:n,hasBlockStyles:o,selectedBlockName:l,selectedBlockClientId:i,blockType:s}=(0,m.useSelect)((e=>{const{getSelectedBlockClientId:t,getSelectedBlockCount:n,getBlockName:o}=e(qn),{getBlockStyles:l}=e(r.store),i=t(),a=i&&o(i),s=a&&(0,r.getBlockType)(a),c=a&&l(a);return{count:n(),selectedBlockClientId:i,selectedBlockName:a,blockType:s,hasBlockStyles:c&&c.length>0}}),[]);if(n>1)return(0,a.createElement)("div",{className:"block-editor-block-inspector"},(0,a.createElement)(Hy,null),(0,a.createElement)(zo.Slot,null),(0,a.createElement)(zo.Slot,{__experimentalGroup:"color",label:(0,g.__)("Color"),className:"color-block-support-panel__inner-wrapper"}),(0,a.createElement)(zo.Slot,{__experimentalGroup:"typography",label:(0,g.__)("Typography")}),(0,a.createElement)(zo.Slot,{__experimentalGroup:"dimensions",label:(0,g.__)("Dimensions")}),(0,a.createElement)(zo.Slot,{__experimentalGroup:"border",label:(0,g.__)("Border")}));const c=l===(0,r.getUnregisteredTypeHandlerName)();return s&&i&&!c?(0,a.createElement)(Uy,{clientId:i,blockName:s.name,hasBlockStyles:o}):t?(0,a.createElement)("span",{className:"block-editor-block-inspector__no-blocks"},(0,g.__)("No block selected.")):null};function jy(e){let{children:t,__unstableContentRef:n,...o}=e;const r=(0,d.useViewportMatch)("medium"),l=(0,m.useSelect)((e=>e(qn).getSettings().hasFixedToolbar),[]),s=(0,tu.__unstableUseShortcutEventMatch)(),{getSelectedBlockClientIds:c,getBlockRootClientId:f}=(0,m.useSelect)(qn),{duplicateBlocks:g,removeBlocks:h,insertAfterBlock:v,insertBeforeBlock:b,clearSelectedBlock:k,moveBlocksUp:_,moveBlocksDown:y}=(0,m.useDispatch)(qn);return(0,a.createElement)("div",i({},o,{onKeyDown:function(e){if(s("core/block-editor/move-up",e)){const t=c();if(t.length){e.preventDefault();const n=f((0,u.first)(t));_(t,n)}}else if(s("core/block-editor/move-down",e)){const t=c();if(t.length){e.preventDefault();const n=f((0,u.first)(t));y(t,n)}}else if(s("core/block-editor/duplicate",e)){const t=c();t.length&&(e.preventDefault(),g(t))}else if(s("core/block-editor/remove",e)){const t=c();t.length&&(e.preventDefault(),h(t))}else if(s("core/block-editor/insert-after",e)){const t=c();t.length&&(e.preventDefault(),v((0,u.last)(t)))}else if(s("core/block-editor/insert-before",e)){const t=c();t.length&&(e.preventDefault(),b((0,u.first)(t)))}else if(s("core/block-editor/unselect",e)){c().length>1&&(e.preventDefault(),k(),e.target.ownerDocument.defaultView.getSelection().removeAllRanges())}}}),(0,a.createElement)(Fp,{__unstableContentRef:n},(l||!r)&&(0,a.createElement)(bf,{isFixed:!0}),(0,a.createElement)(Ef,{__unstableContentRef:n}),(0,a.createElement)(p.Popover.Slot,{name:"block-toolbar",ref:Ap(n)}),t,(0,a.createElement)(p.Popover.Slot,{name:"__unstable-block-tools-after",ref:Ap(n)})))}var Ky=(0,a.forwardRef)((function(e,t){let{rootClientId:n,clientId:o,isAppender:r,showInserterHelpPanel:l,showMostUsedBlocks:i=!1,__experimentalInsertionIndex:s,__experimentalFilterValue:c,onSelect:d=u.noop,shouldFocusBlock:p=!1}=e;const f=(0,m.useSelect)((e=>{const{getBlockRootClientId:t}=e(qn);return n||t(o)||void 0}),[o,n]);return(0,a.createElement)(Sp,{onSelect:d,rootClientId:f,clientId:o,isAppender:r,showInserterHelpPanel:l,showMostUsedBlocks:i,__experimentalInsertionIndex:s,__experimentalFilterValue:c,shouldFocusBlock:p,ref:t})}));function qy(){return null}qy.Register=function(){const{registerShortcut:e}=(0,m.useDispatch)(tu.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 Yy=qy;function Qy(){return Vt()("wp.blockEditor.MultiSelectScrollIntoView",{hint:"This behaviour is now built-in.",since:"5.8"}),null}const Xy=new Set([Tc.UP,Tc.RIGHT,Tc.DOWN,Tc.LEFT,Tc.ENTER,Tc.BACKSPACE]);function Zy(){const e=(0,m.useSelect)((e=>e(qn).isTyping()),[]),{stopTyping:t}=(0,m.useDispatch)(qn);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 Jy(){const e=(0,m.useSelect)((e=>e(qn).isTyping())),{startTyping:t,stopTyping:n}=(0,m.useDispatch)(qn),o=Zy(),r=(0,d.useRefEffect)((o=>{const{ownerDocument:r}=o,{defaultView:l}=r;if(e){let a;function s(e){const{target:t}=e;a=l.setTimeout((()=>{(0,Jr.isTextField)(t)||n()}))}function c(e){const{keyCode:t}=e;t!==Tc.ESCAPE&&t!==Tc.TAB||n()}function u(){const e=l.getSelection();e.rangeCount>0&&e.getRangeAt(0).collapsed||n()}return o.addEventListener("focus",s),o.addEventListener("keydown",c),r.addEventListener("selectionchange",u),()=>{l.clearTimeout(a),o.removeEventListener("focus",s),o.removeEventListener("keydown",c),r.removeEventListener("selectionchange",u)}}function i(e){const{type:n,target:r}=e;(0,Jr.isTextField)(r)&&o.contains(r)&&("keydown"!==n||function(e){const{keyCode:t,shiftKey:n}=e;return!n&&Xy.has(t)}(e))&&t()}return o.addEventListener("keypress",i),o.addEventListener("keydown",i),()=>{o.removeEventListener("keypress",i),o.removeEventListener("keydown",i)}}),[e,t,n]);return(0,d.useMergeRefs)([o,r])}var eE=function(e){let{children:t}=e;return(0,a.createElement)("div",{ref:Jy()},t)};const tE=-1!==window.navigator.userAgent.indexOf("Trident"),nE=new Set([Tc.UP,Tc.DOWN,Tc.LEFT,Tc.RIGHT]);function oE(){const e=(0,m.useSelect)((e=>e(qn).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,Jr.computeCaretRect)(o);if(!l)return;if(!i)return void(i=l);if(nE.has(r))return void(i=l);const a=l.top-i.top;if(0===a)return;const s=(0,Jr.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{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 rE=tE?e=>e.children:function(e){let{children:t}=e;return(0,a.createElement)("div",{ref:oE(),className:"block-editor__typewriter"},t)};const lE=(0,a.createContext)({});function iE(e,t,n){const o={...e,[t]:e[t]?new Set(e[t]):new Set};return o[t].add(n),o}function aE(e){var t;let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const o=(0,a.useContext)(lE),{name:r}=Zn();n=n||r;const l=Boolean(null===(t=o[n])||void 0===t?void 0:t.has(e)),i=(0,a.useMemo)((()=>iE(o,n,e)),[o,n,e]),s=(0,a.useCallback)((e=>{let{children:t}=e;return(0,a.createElement)(lE.Provider,{value:i},t)}),[i]);return[l,s]}const sE=(e,t)=>{if(!t||!e)return;const n=t.filter((t=>{let{attributes:n}=t;return!(!n||!Object.keys(n).length)&&(0,u.isMatch)(e,n)}));return 1===n.length?n[0]:void 0};function cE(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 uE(e,t){const n=e.split(/[(),]/g).filter(Boolean),o=n.slice(1).map((e=>cE(gE(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[2]?o[2]+"px":o[1]+"px";case"calc":return o[0]+"px"}}function dE(e){for(;;){const t=e,n=/(max|min|calc|clamp)\(([^()]*)\)/g.exec(e)||[];if(n[0]){const t=uE(n[0]);e=e.replace(n[0],t)}if(e===t||parseFloat(e))break}return cE(e)}function pE(e){for(let t=0;tr.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 gE(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=cE(e);return n.unit||(n=dE(e)),pE(e)&&!n.unit?mE(e):fE(n,t)}const hE={};function vE(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 bE=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=e+vE(t);return hE[n]||(hE[n]=gE(e,t)),hE[n]}}(),(window.wp=window.wp||{}).blockEditor=o}(); \ No newline at end of file diff --git a/packages/playground/remote/public/wp-6.1/wp-includes/empty.html b/packages/playground/remote/public/wp-6.1/wp-includes/empty.html index c50eddd41f..620d9da39e 100755 --- a/packages/playground/remote/public/wp-6.1/wp-includes/empty.html +++ b/packages/playground/remote/public/wp-6.1/wp-includes/empty.html @@ -1 +1 @@ - + diff --git a/packages/playground/remote/public/wp-6.1/wp-includes/js/dist/block-editor.js b/packages/playground/remote/public/wp-6.1/wp-includes/js/dist/block-editor.js index 9b826737bf..dd8b096cf4 100755 --- a/packages/playground/remote/public/wp-6.1/wp-includes/js/dist/block-editor.js +++ b/packages/playground/remote/public/wp-6.1/wp-includes/js/dist/block-editor.js @@ -1,4 +1,47 @@ -/******/ (function() { // webpackBootstrap +/** + * A synchronous function to read a blob URL as text. + * + * @param {string} url + * @returns {string} + */ +const __playground_readBlobAsText = function (url) { + try { + let xhr = new XMLHttpRequest(); + xhr.open('GET', url, false); + xhr.overrideMimeType('text/plain;charset=utf-8'); + xhr.send(); + return xhr.responseText; + } catch(e) { + return ''; + } finally { + URL.revokeObjectURL(url); + } +} + +window.__playground_ControlledIframe = window.wp.element.forwardRef(function (props, ref) { + const source = window.wp.element.useMemo(function () { + if (props.srcDoc) { + // WordPress <= 6.2 uses a srcDoc that only contains a doctype. + return '/wp-includes/empty.html'; + } else if (props.src && props.src.startsWith('blob:')) { + // WordPress 6.3 uses a blob URL with doctype and a list of static assets. + // Let's pass the document content to empty.html and render it there. + return '/wp-includes/empty.html#' + encodeURIComponent(__playground_readBlobAsText(props.src)); + } else { + // WordPress >= 6.4 uses a plain HTTPS URL that needs no correction. + return props.src; + } + }, [props.src]); + return ( + window.wp.element.createElement('iframe', { + ...props, + ref: ref, + src: source, + // Make sure there's no srcDoc, as it would interfere with the src. + srcDoc: undefined + }) + ) +});/******/ (function() { // webpackBootstrap /******/ var __webpack_modules__ = ({ /***/ 6411: @@ -22993,11 +23036,11 @@ function Iframe(_ref3, ref) { key: id }); }), head); - return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, tabIndex >= 0 && before, (0,external_wp_element_namespaceObject.createElement)("iframe", _extends({}, props, { + return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, tabIndex >= 0 && before, (0,external_wp_element_namespaceObject.createElement)(__playground_ControlledIframe, _extends({}, props, { ref: (0,external_wp_compose_namespaceObject.useMergeRefs)([ref, setRef]), tabIndex: tabIndex // Correct doctype is required to enable rendering in standards mode , - src:"/wp-includes/empty.html", + srcDoc: "", title: (0,external_wp_i18n_namespaceObject.__)('Editor canvas') }), iframeDocument && (0,external_wp_element_namespaceObject.createPortal)((0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)("head", { ref: headRef diff --git a/packages/playground/remote/public/wp-6.1/wp-includes/js/dist/block-editor.min.js b/packages/playground/remote/public/wp-6.1/wp-includes/js/dist/block-editor.min.js index 4ec2fc6d94..6e130ac9b9 100755 --- a/packages/playground/remote/public/wp-6.1/wp-includes/js/dist/block-editor.min.js +++ b/packages/playground/remote/public/wp-6.1/wp-includes/js/dist/block-editor.min.js @@ -1,4 +1,47 @@ -/*! This file is auto-generated */ +/** + * A synchronous function to read a blob URL as text. + * + * @param {string} url + * @returns {string} + */ +const __playground_readBlobAsText = function (url) { + try { + let xhr = new XMLHttpRequest(); + xhr.open('GET', url, false); + xhr.overrideMimeType('text/plain;charset=utf-8'); + xhr.send(); + return xhr.responseText; + } catch(e) { + return ''; + } finally { + URL.revokeObjectURL(url); + } +} + +window.__playground_ControlledIframe = window.wp.element.forwardRef(function (props, ref) { + const source = window.wp.element.useMemo(function () { + if (props.srcDoc) { + // WordPress <= 6.2 uses a srcDoc that only contains a doctype. + return '/wp-includes/empty.html'; + } else if (props.src && props.src.startsWith('blob:')) { + // WordPress 6.3 uses a blob URL with doctype and a list of static assets. + // Let's pass the document content to empty.html and render it there. + return '/wp-includes/empty.html#' + encodeURIComponent(__playground_readBlobAsText(props.src)); + } else { + // WordPress >= 6.4 uses a plain HTTPS URL that needs no correction. + return props.src; + } + }, [props.src]); + return ( + window.wp.element.createElement('iframe', { + ...props, + ref: ref, + src: source, + // Make sure there's no srcDoc, as it would interfere with the src. + srcDoc: undefined + }) + ) +});/*! This file is auto-generated */ !function(){var e={6411:function(e,t){var n,o,r; /*! autosize 4.0.4 @@ -23,4 +66,4 @@ * @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;n3&&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 S(e){return C(e,(e=>(0,u.omit)(e,"attributes")))}function w(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(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:S(n.blocks),attributes:w(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,...S(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),...S(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,...w(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),...w(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{const n=e.blocks.byClientId[t];return n?{...n,attributes:$(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:Q(e,t)})),(e=>[e.blocks.order])),Q=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])),Z=A(((e,t)=>{const n=[];for(const o of t)for(const t of Ae(e,o))n.push(t,...Z(e,[t]));return n}),(e=>[e.blocks.order])),X=A((e=>{const t=[];for(const n of Ae(e))t.push(n,...Z(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=>j(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?j(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;e2&&void 0!==arguments[2]?arguments[2]:1;if(void 0===t&&(t=ce(e)),void 0===t&&(t=n<0?Ce(e):Se(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=>j(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 Se(e){const t=ye(e);return t[t.length-1]||null}function we(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=j(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=j(e,s.clientId),d=(0,r.getBlockType)(u.name),p=j(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&&oKe(e,t)))}function Ye(){return V()('wp.data.select( "core/block-editor" ).isCaretWithinFormattedText',{since:"6.1",version:"6.3"}),!1}function Qe(e){let t,n;const{insertionPoint:o,selection:{selectionEnd:r}}=e;if(null!==o)return o;const{clientId:l}=r;return l?(t=de(e,l)||void 0,n=De(e,r.clientId)+1):n=Ae(e).length,{rootClientId:t,index:n}}function Ze(e){return null!==e.insertionPoint}function Xe(e){return e.template.isValid}function Je(e){return e.settings.template}function et(e,t){if(!t)return e.settings.templateLock;const n=Bt(e,t);return n?n.templateLock: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:j.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=$(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=$(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=$(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*)[^])*)\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(j(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]])),St=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)])),wt=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 St(e,o,n)}),((e,t)=>[...St.getDependants(e,t)]));function Bt(e,t){return e.blockListSettings[t]}function It(e){return e.settings}function xt(e){return e.blocks.isPersistentChange}const Tt=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 $t(e){return e.temporarilyEditingAsBlocks}function jt(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(jt(e,n))return!0;n=e.blocks.parents[n]}return!1}var qt=window.wp.a11y;const Yt="†";function Qt(e){if(e)return Object.keys(e).find((t=>{const n=e[t];return"string"==typeof n&&-1!==n.indexOf(Yt)}))}const Zt=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:Zt(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=Zt(e),t=mn(Zt(t),i.getSettings());const s=i.getBlockRootClientId(e[0]);for(let e=0;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:Zt(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(Zt(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 Sn(){return{type:"HIDE_INSERTION_POINT"}}function wn(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],S=k.attributes[h.attributeKey];let w=(0,z.create)({html:y,...H(C)}),B=(0,z.create)({html:E,...H(S)});w=(0,z.remove)(w,g.offset,w.text.length),B=(0,z.insert)(B,Yt,0,h.offset);const I=(0,r.cloneBlock)(v,{[g.attributeKey]:(0,z.toHTMLString)({value:w,...H(C)})}),x=(0,r.cloneBlock)(_,{[h.attributeKey]:(0,z.toHTMLString)({value:B,...H(S)})}),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=Qt(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=Qt(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=Zt(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 $n(e,t){return{type:"SAVE_REUSABLE_BLOCK_SUCCESS",id:e,updatedId:t}}function jn(){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")}},Qn=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."))},Zn=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=Zt(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 So=(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 wo=(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).length1}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 $o=["color","border","typography","spacing"],jo={"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($o.includes(e))return void console.warn("Top level useSetting paths are disabled. Please use a subpath to query the information needed.");let l;const i=(e=>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=jo[i]?jo[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),S=(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}`},w=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.BaseControl.VisualLabel,{className:"components-spacing-sizes-control__side-label"},zo[r]),N&&(0,a.createElement)(m.BaseControl.VisualLabel,{className:"components-spacing-sizes-control__hint-single"},B)),"all"===r&&N&&(0,a.createElement)(m.BaseControl.VisualLabel,{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:w,disableUnits:i,label:T,hideLabelFromVision:!0,className:"components-spacing-sizes-control__custom-value-input",style:{gridColumn:"1"},size:"__unstable-large"}),(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(S(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,__nextHasNoMarginBottom:!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(S(e.selectedItem.key,"selectList"))},options:I,label:T,hideLabelFromVision:!0,__nextUnconstrainedWidth:!0,size:"__unstable-large"}))}function Qo(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 Zo(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:u,minimumCustomValue:d=0}=e;const p=[{name:0,slug:"0",size:0},...qo("spacing.spacingSizes")||[]];p.length>8&&p.unshift({name:(0,g.__)("Default"),slug:"default",size:void 0});const f=r||Fo,h=Uo(r),v=1===(null==l?void 0:l.length),[b,_]=(0,a.useState)(!h||!Go(f,l)||v),k={...t,onChange:e=>{const t={...r,...e};n(t)},isLinked:b,sides:l,values:f,spacingSizes:p,useSelect:u,type:o,minimumCustomValue:d};return(0,a.createElement)("fieldset",{role:"region",className:c()("component-spacing-sizes-control",{"is-unlinked":!b})},(0,a.createElement)(m.BaseControl.VisualLabel,{as:"legend"},o),!v&&(0,a.createElement)(nr,{onClick:()=>{_(!b)},isLinked:b}),b&&(0,a.createElement)(Qo,i({"aria-label":o},k)),!b&&s&&(0,a.createElement)(Jo,k),!b&&!s&&(0,a.createElement)(Zo,k))}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.useReducer)((e=>(e+1)%kr),0);(0,a.useLayoutEffect)((()=>{if(!g)return;const e=new window.MutationObserver(_);return e.observe(g,{attributes:!0}),()=>{e.disconnect()}}),[g]);const k=(0,a.useMemo)((()=>b<0||!g||h!==g?{}:{position:"absolute",width:g.offsetWidth,height:g.offsetHeight}),[g,h,l,b]),y=(0,a.useMemo)((()=>{if(!(b<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,b]);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:k},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 Sr(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 wr(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?`calc(${e} * -1)`:0,right:0!==t?`calc(${t} * -1)`:0,bottom:0!==n?`calc(${n} * -1)`:0,left:0!==o?`calc(${o} * -1)`: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)(Sr,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)(wr,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")}},$r=["top","center","bottom"],jr={isAlternate:!0};var Kr=function(e){let{value:t,onChange:n,controls:o=$r,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:jr}};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})),Qr={left:ko,center:yo,right:Eo,"space-between":Co};var Zr=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?Qr[r]:Qr.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)(Zr,i({},e,{isToolbar:!1})),Jr=e=>(0,a.createElement)(Zr,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:So,isPressed:"horizontal"===o,onClick:()=>n({...t,orientation:"horizontal"})}),(0,a.createElement)(m.Button,{label:(0,g.__)("Vertical"),icon:wo,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 Sl(){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 wl=(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:wl,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=Sl(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=Sl(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=Sl(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, you’ll 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 $l=(0,a.createContext)({});function jl(e){let{value:t,children:n}=e;const o=(0,a.useContext)($l),r=(0,a.useMemo)((()=>({...o,...t})),[o,t]);return(0,a.createElement)($l.Provider,{value:r,children:n})}var Kl=$l;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 Ql(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 Zl=(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:Zl,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"):wi()};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(Si))}function Si(){~_i&&(bi(Si),di.batchedUpdates(wi))}function wi(){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;ne.forEach(t);function Ri(e,t,n){if(Pi.arr(e))for(let o=0;oPi.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 $i=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 ji=new Set;let Ki=[],qi=[],Yi=0;const Qi={get idle(){return!ji.size&&!Ki.length},start(e){Yi>e.priority?(ji.add(e),di.onStart(Zi)):(Xi(e),di(ea))},advance:ea,sort(e){if(Yi)di.onFrame((()=>Qi.sort(e)));else{const t=Ki.indexOf(e);~t&&(Ki.splice(t,1),Ji(e))}},clear(){Ki=[],ji.clear()}};function Zi(){ji.forEach(Xi),ji.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;n0}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=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(cn){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;tBoolean(e&&e[ya]),Sa=e=>e&&e[ya]?e[ya]():e,wa=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=>Sa(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 $a=Ua(console.warn);function ja(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,Qa),Qa=[];function Za(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]=Sa(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(ja(e)?rs:os).create(e)}function cs(e){const t=Ja(e);return t?t.constructor:Pi.arr(e)?as:ja(e)?rs:os}function us(){return us=Object.assign?Object.assign.bind():function(e){for(var t=1;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!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 Ss(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 ws(e){return e=Sa(e),Pi.arr(e)?e.map(ws):ja(e)?$i.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&&!$i.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))?js(e.get()):t.every((e=>e.noop))?Ws(e.get()):$s(e.get(),t.every((e=>e.finished))),Ws=e=>({value:e,noop:!0,finished:!0,cancelled:!1}),$s=(e,t,n=!1)=>({value:e,finished:t,cancelled:n}),js=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)&&js(o)||r!==n.asyncId&&$s(o,!1);if(t)throw e.result=t,d(e),e},f=(e,t)=>{const l=new Ys,i=new Qs;return(async()=>{if($i.skipAnimation)throw qs(n),i.result=$s(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($i.skipAnimation)return qs(n),$s(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=$s(o.get(),!0,!1)}catch(e){if(e instanceof Ys)g=e.result;else{if(!(e instanceof Qs))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 Qs extends Error{constructor(){super("SkipAnimationSignal"),this.result=void 0}}const Zs=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 $i.to(this,e)}interpolate(...e){return Wa(`${Ga}The "interpolate" function is deprecated in v9 (use "to" instead)`),$i.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||Qi.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 Sa(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(Sa(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:nt,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=Sa(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=Sa(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",$s(this,ac(this,this.animation.to)),this))},resume:()=>{oc(this)&&(lc(this,!1),nc(this)&&this._resume(),Oi(i.resumeQueue),fc(this,"onResume",$s(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(js(this));const o=!Pi.und(e.to),r=!Pi.und(e.from);if(o||r){if(!(t.callId>this._lastToId))return n(js(this));this._lastToId=t.callId}const{key:l,defaultProps:i,animation: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=Sa(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($s(this,!0));const _=Pi.und(t.reset)?r&&!t.default:!Pi.und(d)&&vs(t.reset,l),k=_?d:this.get(),y=ws(u),E=Pi.num(y)||Pi.arr(y)||ja(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 S=b.constructor;let w=Ca(u),B=!1;if(!w){const e=_||!tc(this)&&p;(m||e)&&(B=Mi(ws(k),y),w=!B),(Mi(a.immediate,C)||C)&&Mi(g.decay,h)&&Mi(g.velocity,v)||(w=!0)}if(B&&nc(this)&&(a.changed&&!_?w=!0:w||this._stop(s)),!f&&((w||Ca(s))&&(a.values=b.getPayload(),a.toValues=Ca(u)?null:S==rs?[1]:Ai(y)),a.immediate!=C&&(a.immediate=C,C||_||this._set(s)),w)){const{onRest:e}=a;Li(pc,(e=>mc(this,t,e)));const o=$s(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)):w?this._start():nc(this)&&!m?this._pendingCalls.add(n):n(Ws(k))}_focus(e){const t=this.animation;e!==t.to&&(wa(this)&&this._detach(),t.to=e,wa(this)&&this._attach())}_attach(){let e=0;const{to:t}=this.animation;Ca(t)&&(Ta(t,this),Zs(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=Sa(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",$s(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(Sa(e.to)),e.immediate||(e.fromValues=e.values.map((e=>e.lastPosition))),nc(this)||(rc(this,!0),oc(this)||this._resume())}_resume(){$i.skipAnimation?this.finish():Qi.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?js(this.get()):$s(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=ws(t);return Mi(ws(e.get()),n)}function sc(e,t=e.loop,n=e.to){let o=hs(t);if(o){const r=!0!==o&&Ss(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=Ss(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):(Sc(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(js(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 Sc(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 Sc(e,t){Li(t,(t=>{Cc(e.springs,t,(t=>Ec(t,e)))}))}function wc(e,t){if(null==e)return{};var n,o,r={},l=Object.keys(e);for(o=0;o=0||(r[n]=e[n]);return r}const Bc=["children"],Ic=e=>{let{children:t}=e,n=wc(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{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){$a(`${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=Za(e)||0;function d(e,n){for(let r=e;r{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=Za(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(Sa):Ai(Sa(this.source));return this.calc(...e)}_start(){this.idle&&!Oc(this._active)&&(this.idle=!1,Li(ts(this),(e=>{e.done=!1})),$i.skipAnimation?(di.batchedUpdates((()=>this.advance())),zc(this)):Qi.start(this))}_attach(){let e=1;Li(Ai(this.source),(t=>{Ca(t)&&Ta(t,this),Zs(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,(Zs(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}))}$i.assign({createStringInterpolator:Ha,to:(e,t)=>new Ac(e,t)});Qi.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=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)||$c.hasOwnProperty(e)&&$c[e]?(""+t).trim():t+"px"}const Wc={};let $c={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 jc=["Webkit","Ms","Moz","O"];$c=Object.keys($c).reduce(((e,t)=>(jc.forEach((n=>e[((e,t)=>e+t.charAt(0).toUpperCase()+t.substring(1))(n,t)]=e[t])),e)),$c);const Kc=["x","y","z"],qc=/^(matrix|translate|scale|rotate|skew)/,Yc=/^(translate)/,Qc=/^(rotate|skew)/,Zc=(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=>Zc(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":Qc.test(t)?"deg":"";l.push(Ai(e)),i.push("rotate3d"===t?([e,t,o,r])=>[`rotate3d(${e},${t},${o},${Zc(r,n)})`,Xc(r,0)]:e=>[`${t}(${e.map((e=>Zc(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=Sa(n[0]),[l,i]=this.transforms[o](Pi.arr(r)?r:n.map(Sa));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"];$i.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)(eh);return(0,d.useRefEffect)((t=>{if(e)return e.observe(t),()=>{e.unobserve(t)}}),[e])}function Su(e){return(0,p.useSelect)((t=>{const{__unstableHasActiveBlockOverlayActive:n}=t(so);return n(e)}),[e])}function wu(){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=Su(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})]),S=mo();return f<2&&n===S.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}}}wu.save=r.__unstableGetBlockProps;const Bu=(0,a.createContext)();function Iu(e){let{children:t,isHtml:n,...o}=e;return(0,a.createElement)("div",wu(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)=>{const{updateBlockAttributes:o,insertBlocks:l,mergeBlocks:i,replaceBlocks:a,toggleSelection:s,__unstableMarkLastChangeAsPersistent:c,moveBlocksToPosition:u,removeBlock:d,selectBlock:p}=e(so);return{setAttributes(e){const{getMultiSelectedBlockClientIds:r}=n.select(so),l=r(),{clientId:i}=t,a=l.length?l:[i];o(a,e)},onInsertBlocks(e,n){const{rootClientId:o}=t;l(e,n,o)},onInsertBlocksAfter(e){const{clientId:o,rootClientId:r}=t,{getBlockIndex:i}=n.select(so),a=i(o);l(e,a+1,r)},onMerge(e){const{clientId:o,rootClientId:l}=t,{getPreviousBlockClientId:s,getNextBlockClientId:c,getBlock:m,getBlockAttributes:f,getBlockName:g,getBlockOrder:h}=n.select(so);if(e){if(l){const e=c(l);if(e){if(g(l)!==g(e))return void i(l,e);{const t=f(l),o=f(e);if(Object.keys(t).every((e=>t[e]===o[e])))return void n.batch((()=>{u(h(e),e,l),d(e,!1)}))}}}const e=c(o);if(!e)return;const t=(0,r.switchToBlockType)(m(e),"*");t&&t.length?a(e,t):i(o,e)}else{const e=s(o);if(e)i(e,o);else if(l){const e=s(l);if(e&&g(l)===g(e)){const t=f(l),o=f(e);if(Object.keys(t).every((e=>t[e]===o[e])))return void n.batch((()=>{u(h(l),l,e),d(l,!1)}))}const t=(0,r.switchToBlockType)(m(l),"*");t&&t.length&&n.batch((()=>{a(l,t),p(t[0].clientId,0)}))}}},onReplace(e,n,o){e.length&&!(0,r.isUnmodifiedDefaultBlock)(e[e.length-1])&&c(),a([t.clientId],e,n,o)},toggleSelection(e){s(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:S,isContentBlock:w,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)(Ql,{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);S&&!w&&(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":S&&w},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 / to quickly insert new blocks."),{kbd:(0,a.createElement)("kbd",null)}),(0,a.createInterpolateElement)((0,g.__)("Indent a list by pressing space at the beginning of a line."),{kbd:(0,a.createElement)("kbd",null)}),(0,a.createInterpolateElement)((0,g.__)("Outdent a list by pressing backspace 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)(nh,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 $u(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 ju(){const{initialPosition:e,isMultiSelecting:t,multiSelectedBlockClientIds:n,hasMultiSelection:o,selectedBlockClientId:r,isFullSelection:l}=(0,p.useSelect)($u,[]);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 S=(0,Wl.isRTL)(u)?!g:g,{keepCaretInsideBlock:w}=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)&&!w){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,S)&&!w){const e=Ku(u,S,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 Qu(){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 Zu(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;Zu(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),Zu(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(),ju(),Qu(),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,S,w]=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,S]),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,"html{height:auto!important;}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,src:"/wp-includes/empty.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&&w)})),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,Sd=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,wd=/^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=wd.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)||Sd.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=.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(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=S()||w());)!1!==t&&(n.push(t),f(n));return n}function p(t){const n=t.exec(e);if(!n)return;const o=n[0];return r(o),e=e.slice(o.length),n}function m(){p(/^\s*/)}function f(e){let t;for(e=e||[];t=g();)!1!==t&&e.push(t);return e}function g(){const t=l();if("/"!==e.charAt(0)||"*"!==e.charAt(1))return;let n=2;for(;""!==e.charAt(n)&&("*"!==e.charAt(n)||"/"!==e.charAt(n+1));)++n;if(n+=2,""===e.charAt(n-1))return 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 $d(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=$d(t[0]),!p(/^:\s*/))return s("property missing ':'");const n=p(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^\)]*?\)|[^};])+)/),o=e({type:"declaration",property:t.replace(Ud,""),value:n?$d(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 S(){if("@"===e[0])return function(){const e=l();let t=p(/^@([-\w]+)?keyframes\s*/);if(!t)return;const n=t[1];if(t=p(/^([-\w]+)\s*/),!t)return 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=$d(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:$d(t[1]),media:$d(t[2])})}()||function(){const e=l(),t=p(/^@supports *([^{]+)/);if(!t)return;const n=$d(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=$d(t[1]),o=$d(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 w(){const e=l(),t=h();return t?(f(),e({type:"rule",selectors:t,declarations:b()})):s("selector missing")}return jd(function(){const e=d();return{type:"stylesheet",stylesheet:{source:t.source,rules:e,parsingErrors:a}}}())}function $d(e){return e?e.replace(/^\s+|\s+$/g,""):""}function jd(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){jd(e,o)})):n&&"object"==typeof n&&jd(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=Qd;function Qd(e){this.options=e||{}}Qd.prototype.emit=function(e){return e},Qd.prototype.visit=function(e){return this[e.type](e)},Qd.prototype.mapVisit=function(e,t){let n="";t=t||"";for(let o=0,r=e.length;ot=>{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)(nh);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)(rh,{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 Sp=(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 wp(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:Sp})))))}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)(wp,{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(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 $p=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 jp=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]},Kp=n(4793),qp=n.n(Kp);const Yp=e=>e.name||"",Qp=e=>e.title,Zp=e=>e.description||"",Xp=e=>e.keywords||[],Jp=e=>e.category,em=()=>null;function tm(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return e=qp()(e),e=e.replace(/^\//,""),e=e.toLowerCase(),e}const nm=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return(0,u.words)(tm(e))},om=(e,t)=>e.filter((e=>!nm(t).some((t=>t.includes(e))))),rm=(e,t,n,o)=>{if(0===nm(o).length)return e;return lm(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}})},lm=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=nm(t);if(0===o.length)return e;const r=e.map((e=>[e,im(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 im(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{getName:o=Yp,getTitle:r=Qp,getDescription:l=Zp,getKeywords:i=Xp,getCategory:a=Jp,getCollection:s=em}=n,c=o(e),d=r(e),p=l(e),m=i(e),f=a(e),g=s(e),h=tm(t),v=tm(d);let b=0;if(h===v)b+=30;else if(v.startsWith(h))b+=20;else{const e=[c,d,p,...m,f,g].join(" "),t=(0,u.words)(h);0===om(t,e).length&&(b+=10)}if(0!==b&&c.startsWith("core/")){b+=c!==e.id?1:2}return b}function am(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 sm=function(e){let{filterValue:t,selectedCategory:n,patternCategories:o}=e;const r=(0,d.useDebounce)(qt.speak,500),[l,i]=jp({shouldFocusBlock:!0}),[s,,c]=zp(i,l),u=(0,a.useMemo)((()=>o.map((e=>e.name))),[o]),p=(0,a.useMemo)((()=>t?lm(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)(am,{filterValue:t,filteredBlockPatternsLength:p.length}),(0,a.createElement)(Lp,null,!f&&(0,a.createElement)($p,null),f&&(0,a.createElement)(Hp,{shownPatterns:m,blockPatterns:p,onClickPattern:c,isDraggable:!1})))};function cm(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)(sm,{filterValue:o,selectedCategory:l,patternCategories:n}))}var um=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)(cm,n))};function dm(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 pm=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)(dm,{rootClientId:t,onInsert:n,selectedCategory:p,populatedCategories:d}),l&&(0,a.createElement)(um,{initialCategory:p,patternCategories:d,onModalClose:()=>i(!1)}))},mm=window.wp.url;function fm(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)($p,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 gm=function(e){let{rootClientId:t,onInsert:n,onHover:o}=e;return(0,a.createElement)(a.Fragment,null,(0,a.createElement)(fm,{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,mm.addQueryArgs)("edit.php",{post_type:"wp_block"})},(0,g.__)("Manage Reusable blocks"))))};const{Fill:hm,Slot:vm}=(0,m.createSlotFill)("__unstableInserterMenuExtension");hm.Slot=vm;var bm=hm;const _m=[];var km=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]=jp({onSelect:n,rootClientId:r,clientId:l,isAppender:i,insertionIndex:s,shouldFocusBlock:v}),[E,C,S,w]=Mp(k,y),[B,,I]=zp(y,k),x=(0,a.useMemo)((()=>{if(0===c)return[];const e=lm(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=rm((0,u.orderBy)(E,["frecency"],["desc"]),C,S,t);return void 0!==T?e.slice(0,T):e}),[t,E,C,S,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:_m),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:w,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)($p,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)(bm.Slot,{fillProps:{onSelect:w,onHover:o,filterValue:t,hasItems:L,rootClientId:k}},(e=>e.length?e:L?null:(0,a.createElement)($p,null))))};const ym={name:"blocks",title:(0,g.__)("Blocks")},Em={name:"patterns",title:(0,g.__)("Patterns")},Cm={name:"reusable",title:(0,g.__)("Reusable")};var Sm=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(Em),e.push(ym),!l&&n&&e.push(Em),o&&e.push(Cm),e}),[l,ym,n,Em,o,Cm]);return(0,a.createElement)(m.TabPanel,{className:"block-editor-inserter__tabs",tabs:i,onSelect:r},t)};var wm=(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,S,w]=jp({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)=>{S(e,t,n),i()}),[S,i]),T=(0,a.useCallback)(((e,t)=>{S(e,{patternName:t}),i()}),[S,i]),N=(0,a.useCallback)((e=>{w(!!e),k(e)}),[w,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)(pm,{rootClientId:C,onInsert:T,onClickCategory:P,selectedCategory:y})),[C,T,P,y]),R=(0,a.useMemo)((()=>(0,a.createElement)(gm,{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)(km,{filterValue:v,onSelect:i,onHover:N,rootClientId:n,clientId:o,isAppender:r,__experimentalInsertionIndex:l,showBlockDirectory:!0,shouldFocusBlock:f})),O&&(0,a.createElement)(Sm,{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 Bm(e){let{onSelect:t,rootClientId:n,clientId:o,isAppender:r,prioritizePatterns:l}=e;const[i,s]=(0,a.useState)(""),[u,d]=jp({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)(km,{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 Im=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 xm 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=Im,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)(Bm,{onSelect:()=>{t()},rootClientId:n,clientId:o,isAppender:r,prioritizePatterns:s}):(0,a.createElement)(wm,{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 Tm=(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}))])(xm);var Nm=(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)(Tm,{rootClientId:l,position:"bottom right",isAppender:!0,__experimentalIsQuick:!0}))}));function Pm(e,t){let{rootClientId:n,className:o,onFocus:r,tabIndex:l}=e;return(0,a.createElement)(Tm,{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 Mm=(0,a.forwardRef)(((e,t)=>(V()("wp.blockEditor.ButtonBlockerAppender",{alternative:"wp.blockEditor.ButtonBlockAppender",since:"5.9"}),Pm(e,t))));var Lm=(0,a.forwardRef)(Pm);var Rm=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)(Nm,{rootClientId:t}):(0,a.createElement)(Lm,{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 Am=Number.MAX_SAFE_INTEGER;(0,a.createContext)();var Dm=function(e){let{previousClientId:t,nextClientId:n,children:o,__unstablePopoverSlot:r,__unstableContentRef:l,...s}=e;const[u,d]=(0,a.useReducer)((e=>(e+1)%Am),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),()=>{var e;null===(e=b.ownerDocument.defaultView)||void 0===e||e.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 Om=(0,a.createContext)();function zm(e){let{__unstablePopoverSlot:t,__unstableContentRef:n}=e;const{selectBlock:o,hideInsertionPoint:r}=(0,p.useDispatch)(so),l=(0,a.useContext)(Om),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)(Dm,{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)(Tm,{position:"bottom center",clientId:f,rootClientId:g,__experimentalIsQuick:!0,onToggle:e=>{l.current=e},onSelectOrClose:()=>{l.current=!1}}))))}function Fm(e){return(0,p.useSelect)((e=>e(so).isBlockInsertionPointVisible()),[])&&(0,a.createElement)(zm,e)}function Vm(){const e=(0,a.useContext)(Om),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 Hm="undefined"==typeof window?e=>{setTimeout((()=>e(Date.now())),0)}:window.requestIdleCallback||window.requestAnimationFrame,Gm="undefined"==typeof window?clearTimeout:window.cancelIdleCallback||window.cancelAnimationFrame;function Um(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 Wm(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=Um(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 $m(e){let{clientId:t,maximumLength:n,context:o}=e;return Wm({clientId:t,maximumLength:n,context:o})}var jm=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{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)(wp,{count:n.length,icon:u})},(e=>{let{onDraggableStart:n,onDraggableEnd:o}=e;return t({draggable:!0,onDragStart:n,onDragEnd:o})}))};var Km=(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 qm=(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 Ym=(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 Qm=(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 Zm=(e,t)=>"up"===e?"horizontal"===t?(0,g.isRTL)()?"right":"left":"up":"down"===e?"horizontal"===t?(0,g.isRTL)()?"left":"right":"down":null;function Xm(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=Zm("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=Zm("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=Zm("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=Zm("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=Zm("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=Zm("down",i);if("down"===e)return(0,g.sprintf)((0,g.__)("Block %1$s is at the end of the content and can’t be moved down"),t);if("left"===e)return(0,g.sprintf)((0,g.__)("Block %1$s is at the end of the content and can’t be moved left"),t);if("right"===e)return(0,g.sprintf)((0,g.__)("Block %1$s is at the end of the content and can’t be moved right"),t)}if(l<0&&!o){const e=Zm("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=Zm("up",i);if("up"===e)return(0,g.sprintf)((0,g.__)("Block %1$s is at the beginning of the content and can’t be moved up"),t);if("left"===e)return(0,g.sprintf)((0,g.__)("Block %1$s is at the beginning of the content and can’t be moved left"),t);if("right"===e)return(0,g.sprintf)((0,g.__)("Block %1$s is at the beginning of the content and can’t be moved right"),t)}}const Jm=(e,t)=>"up"===e?"horizontal"===t?(0,g.isRTL)()?Km:qm:Ym:"down"===e?"horizontal"===t?(0,g.isRTL)()?qm:Km:Qm:null,ef=(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,tf=(0,a.forwardRef)(((e,t)=>{let{clientIds:n,direction:o,orientation:l,...s}=e;const u=(0,d.useInstanceId)(tf),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:S}=(0,p.useDispatch)(so),w="up"===o?S: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:Jm(o,E),label:ef(o,E),"aria-describedby":B},s,{onClick:v?null:e=>{w(n,b),s.onClick&&s.onClick(e)},disabled:v,__experimentalIsFocusable:!0})),(0,a.createElement)(m.VisuallyHidden,{id:B},Xm(g,h&&h.title,y,_,k,"up"===o?-1:1,E)))})),nf=(0,a.forwardRef)(((e,t)=>(0,a.createElement)(tf,i({direction:"up",ref:t},e)))),of=(0,a.forwardRef)(((e,t)=>(0,a.createElement)(tf,i({direction:"down",ref:t},e))));var rf=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)(jm,{clientIds:t},(e=>(0,a.createElement)(m.Button,i({icon:Sp,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)(nf,i({clientIds:t},e)))),(0,a.createElement)(m.ToolbarItem,null,(e=>(0,a.createElement)(of,i({clientIds:t},e))))))};var lf=function(e){let{clientId:t,rootClientId:n}=e;const o=Um(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:S,getBlockIndex:w,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)(rf,{clientIds:[t],hideDragHandle:!0}),"navigation"===v&&(0,a.createElement)(jm,{clientIds:[t]},(e=>(0,a.createElement)(m.Button,i({icon:Sp,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=S();if(s&&O&&!e.defaultPrevented&&(R(null),e.preventDefault()),(c||u)&&O){const e=B(O),t=B(p),n=w(O);let o=w(p);n{!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=af(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=af(e.current).findIndex((e=>0===e.tabIndex));r(n)}}),[i,l])}var cf=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 sf(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:uf,setTimeout:df}=window,pf=()=>{},mf=200;function ff(e){let{ref:t,isFocused:n,debounceTimeout:o=mf,onChange:r=pf}=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&&uf&&uf(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=df((()=>{u()&&c(!1)}),o)}}}function gf(e){let{ref:t,debounceTimeout:n=mf,onChange:o=pf}=e;const[r,l]=(0,a.useState)(!1),{showMovers:i,debouncedShowMovers:s,debouncedHideMovers:c}=ff({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 hf(){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=Um(n),c=(0,a.useRef)(),{gestures:u}=gf({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"),null==s?void 0:s.title),showTooltip:!0,icon:(0,a.createElement)(Du,{icon:null==s?void 0:s.icon})}))}var vf=(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 bf(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 _f(e){let{restTransformations:t,onSelect:n,setHoveredTransformItemName:o}=e;return t.map((e=>(0,a.createElement)(kf,{key:e.name,item:e,onSelect:n,setHoveredTransformItemName:o})))}function kf(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 yf=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](0,a.createElement)(kf,{key:e.name,item:e,onSelect:o,setHoveredTransformItemName:s}))),!d&&p),!!d&&(0,a.createElement)(m.MenuGroup,{className:t},p))};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:"M16.7 7.1l-6.3 8.5-3.3-2.5-.9 1.2 4.5 3.4L17.9 8z"})),Cf=window.wp.tokenList,Sf=n.n(Cf);function wf(e,t,n){const o=new(Sf())(e);return t&&o.remove("is-style-"+t.name),o.add("is-style-"+n.name),o.value}function Bf(e){return(0,u.find)(e,"isDefault")}function If(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?Bf(e)?e:[{name:"default",label:(0,g._x)("Default","block style"),isDefault:!0},...e]:[]}(o),m=function(e,t){for(const n of new(Sf())(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=wf(s,m,e);c(t,{className:o}),n()},stylesToRender:d,activeStyle:m,genericPreviewBlock:f,className:s}}const xf=()=>{};function Tf(e){let{clientId:t,onSwitch:n=xf}=e;const{onSelect:o,stylesToRender:r,activeStyle:l}=If({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?Ef:null,onClick:()=>o(e)},(0,a.createElement)(m.__experimentalText,{as:"span",limit:18,ellipsizeMode:"tail",truncate:!0},t))}))):null}function Nf(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)(Tf,{clientId:o,onSwitch:n}))}const Pf=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=Pf(e,t,n);if(o)return o}}},Mf=(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 Lf=(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=Pf(r,t.name,o);if(n){e=!0,o.add(n.clientId),Mf(n,t);break}}if(!e)return}return n})(t,n.blocks);return o&&e.push({...n,transformedBlocks:o}),e}),[])),[e,t]);function Rf(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)(Af,{patterns:t,onSelect:n})))))}function Af(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)(Df,{key:e.name,pattern:e,onSelect:n,composite:o}))))}function Df(e){let{pattern:t,onSelect:n,composite:o}=e;const r="block-editor-block-switcher__preview-patterns-container",l=(0,d.useInstanceId)(Df,`${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 Of=function(e){let{blocks:t,patterns:n,onSelect:o}=e;const[r,l]=(0,a.useState)(!1),i=Lf(n,t);return i.length?(0,a.createElement)(m.MenuGroup,{className:"block-editor-block-switcher__pattern__transforms__menugroup"},r&&(0,a.createElement)(Rf,{patterns:i,onSelect:o}),(0,a.createElement)(m.MenuItem,{onClick:e=>{e.preventDefault(),l(!r)},icon:Km},(0,g.__)("Patterns"))):null};const zf=e=>{let{clientIds:t,blocks:n}=e;const{replaceBlocks:o}=(0,p.useDispatch)(so),l=Um(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:vf}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=Wm({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)(Of,{blocks:n,patterns:f,onSelect:e=>{(e=>{o(t,e)})(e),l()}}),_&&(0,a.createElement)(yf,{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)(Nf,{hoveredBlock:n[0],onSwitch:l}))})))))};var Ff=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)(zf,{clientIds:t,blocks:n})};const{Fill:Vf,Slot:Hf}=(0,m.createSlotFill)("__unstableBlockToolbarLastItem");Vf.Slot=Hf;var Gf=Vf;var Uf=(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"})),Wf=window.wp.blob;function $f(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 jf(){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 Kf(){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=jf();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(/
/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&&!$f(r,o)&&(o=r.map((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 qf=function(e){let{children:t}=e;return(0,a.createElement)("div",{ref:Kf()},t)};function Yf(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:S,setBlockMovingClientId:w,setNavigationMode:B,selectBlock:I}=(0,p.useDispatch)(so),x=jf();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]),w(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&&S(e[0]),x("copy",e)}})}const Qf=()=>{};var Zf=(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=Qf,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 Xf=(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:Jf,Slot:eg}=(0,m.createSlotFill)("__unstableBlockSettingsMenuFirstItem");Jf.Slot=eg;var tg=Jf;function ng(){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 og(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 rg(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 lg=(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 ig=(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 ag(e){return e.remove&&e.move?"all":!(!e.remove||e.move)&&"insert"}function sg(e){let{clientId:t,onClose:n}=e;const[o,l]=(0,a.useState)({move:!1,remove:!1}),{canEdit:i,canMove:s,canRemove:c}=rg(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=Um(t),y=(0,d.useInstanceId)(sg,"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?ag(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?ig:lg})),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?ig:lg})),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?ig:lg})),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 cg(e){let{clientId:t}=e;const{canLock:n,isLocked:o}=rg(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?lg:ig,onClick:l},i),r&&(0,a.createElement)(sg,{clientId:t,onClose:l}))}const{Fill:ug,Slot:dg}=(0,m.createSlotFill)("BlockSettingsMenuControls");function pg(e){let{...t}=e;return(0,a.createElement)(m.__experimentalStyleProvider,{document:document},(0,a.createElement)(ug,t))}pg.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}=rg(l[0]),d=1===l.length&&c,f=ng(),{isGroupable:g,isUngroupable:h}=f,v=(g||h)&&s;return(0,a.createElement)(dg,{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)(cg,{clientId:l[0]}),e,v&&(0,a.createElement)(og,i({},f,{onClose:null==t?void 0:t.onClose})))))};var mg=pg;const fg=()=>{},gg={className:"block-editor-block-settings-menu__popover",position:"bottom right",isAlternate:!0};function hg(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 vg=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:S,toggleBlockHighlight:w}=(0,p.useDispatch)(so),B=(0,a.useCallback)(n?async e=>{const t=await e;t&&t[0]&&n(t[0])}:fg,[n]),I=Wm({clientId:f,maximumLength:25}),x=(0,a.useCallback)(n?()=>{const e=k||y;e&&E.includes(f)&&!E.includes(e)&&n(e)}:fg,[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}=gf({ref:P,onChange(e){e&&v||w(h,e)}});return(0,a.createElement)(Yf,{clientIds:t,__experimentalUpdateSelection:!n},(e=>{let{canDuplicate:n,canInsertDefaultBlock:r,canMove:c,canRemove:p,onDuplicate:v,onInsertAfter:k,onInsertBefore:y,onRemove:E,onCopy:w,onMoveTo:I,blocks:T}=e;return(0,a.createElement)(m.DropdownMenu,i({icon:Uf,label:(0,g.__)("Options"),className:"block-editor-block-settings-menu",popoverProps:gg,noIcons:!0},s),(e=>{let{onClose:s}=e;return(0,a.createElement)(a.Fragment,null,(0,a.createElement)(m.MenuGroup,null,(0,a.createElement)(tg.Slot,{fillProps:{onClose:s}}),void 0!==h&&(0,a.createElement)(m.MenuItem,i({},M,{ref:P,icon:(0,a.createElement)(Du,{icon:_.icon}),onClick:()=>S(h)}),(0,g.sprintf)((0,g.__)("Select parent block (%s)"),_.title)),1===d&&(0,a.createElement)(Xf,{clientId:f}),(0,a.createElement)(hg,{blocks:T,onCopy:w}),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)(Zf,{clientId:f,onToggle:s})),(0,a.createElement)(mg.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 bg=function(e){let{clientIds:t,...n}=e;return(0,a.createElement)(m.ToolbarGroup,null,(0,a.createElement)(m.ToolbarItem,null,(e=>(0,a.createElement)(vg,i({clientIds:t,toggleProps:e},n)))))};function _g(e){let{clientId:t}=e;const n=Um(t),{canEdit:o,canMove:r,canRemove:l,canLock:i}=rg(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:ig,label:(0,g.sprintf)((0,g.__)("Unlock %s"),n.title),onClick:c})),s&&(0,a.createElement)(sg,{clientId:t,onClose:c})):null}var kg=(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 yg=(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 Eg=(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 Cg={group:{type:"constrained"},row:{type:"flex",flexWrap:"nowrap"},stack:{type:"flex",orientation:"vertical"}};var Sg=function(){const{blocksSelection:e,clientIds:t,groupingBlockName:n,isGroupable:o}=ng(),{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=Cg[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:kg,label:(0,g._x)("Group","verb"),onClick:c}),u&&(0,a.createElement)(m.ToolbarButton,{icon:yg,label:(0,g._x)("Row","single horizontal line"),onClick:()=>c("row")}),d&&(0,a.createElement)(m.ToolbarButton,{icon:Eg,label:(0,g._x)("Stack","verb"),onClick:()=>c("stack")}))};function wg(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 Bg=(0,a.createContext)("");var Ig=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}=gf({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,S=n.length>1,w=c()("block-editor-block-toolbar",E&&"is-showing-movers");return(0,a.createElement)("div",{className:w},!S&&!y&&!h&&(0,a.createElement)(hf,null),(0,a.createElement)("div",i({ref:b},k),(C||S)&&!h&&(0,a.createElement)(m.ToolbarGroup,{className:"block-editor-block-toolbar__block-controls"},(0,a.createElement)(Ff,{clientIds:n}),!S&&(0,a.createElement)(_g,{clientId:n[0]}),(0,a.createElement)(rf,{clientIds:n,hideDragHandle:t||u}))),C&&S&&(0,a.createElement)(Sg,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)(Bg.Provider,{value:null==l?void 0:l.name},(0,a.createElement)(Gf.Slot,null))),(0,a.createElement)(wg,{clientIds:n}),!h&&(0,a.createElement)(bg,{clientIds:n}))};var xg=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)(cf,i({focusOnMount:t,className:d,"aria-label":(0,g.__)("Block tools")},o),(0,a.createElement)(Ig,{hideDragHandle:n}))};const Tg={flip:!1,shift:!0},Ng={flip:!0,shift:!1};function Pg(e,t,n){if(!e||!t)return Tg;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?Tg:Ng}function Mg(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 Lg(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)(Mg,[]),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=!f&&"edit"===u&&o,E="navigation"===u||"zoom-out"===u,C="edit"===u&&!g&&b&&!m&&!y&&!f,S="edit"===u&&!C&&!g&&!o;(0,Yu.useShortcut)("core/block-editor/focus-toolbar",(()=>{_.current=!0,k(!0)}),{isDisabled:!S}),(0,a.useEffect)((()=>{_.current=!1}));const w=(0,a.useRef)(),B=function(e){let{contentElement:t,clientId:n}=e;const o=Lo(n),[r,l]=(0,a.useState)(0),[i,s]=(0,a.useState)((()=>Pg(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(Pg(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 E||C||y?(0,a.createElement)(a.Fragment,null,y&&(0,a.createElement)(yr,i({clientId:r||t,__unstableCoverTarget:!0,bottomClientId:h,className:c()("block-editor-block-list__block-side-inserter-popover",{"is-insertion-point-visible":v}),__unstablePopoverSlot:l,__unstableContentRef:s,resize:!1,shift:!1},B),(0,a.createElement)("div",{className:"block-editor-block-list__empty-block-inserter"},(0,a.createElement)(Tm,{position:"bottom right",rootClientId:n,clientId:t,__experimentalIsQuick:!0}))),(E||C)&&(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},B),C&&(0,a.createElement)(xg,{focusOnMount:_.current,__experimentalInitialIndex:w.current,__experimentalOnIndexChange:e=>{w.current=e},key:t}),E&&(0,a.createElement)(lf,{clientId:t,rootClientId:n}))):null}function Rg(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 Ag(e){let{__unstablePopoverSlot:t,__unstableContentRef:n}=e;const o=(0,p.useSelect)(Rg,[]);if(!o)return null;const{clientId:r,rootClientId:l,name:i,isEmptyDefaultBlock:s,capturingClientId:c}=o;return i?(0,a.createElement)(Lg,{clientId:r,rootClientId:l,isEmptyDefaultBlock:s,capturingClientId:c,__unstablePopoverSlot:t,__unstableContentRef:n}):null}function Dg(e){let{children:t}=e;const n=(0,a.useContext)(Om),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)(Fm,{__unstablePopoverSlot:"block-toolbar"},(0,a.createElement)(Ag,{__unstablePopoverSlot:"block-toolbar"}),t))}var Og=(0,d.createHigherOrderComponent)((e=>t=>{const{clientId:n}=mo();return(0,a.createElement)(e,i({},t,{clientId:n}))}),"withClientId");var zg=Og((e=>{let{clientId:t,showSeparator:n,isFloating:o,onAddBlock:r,isToggle:l}=e;return(0,a.createElement)(Lm,{className:c()({"block-list-appender__toggle":l}),rootClientId:t,showSeparator:n,isFloating:o,onAddBlock:r})}));var Fg=(0,d.compose)([Og,(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)(Nm,{rootClientId:t})}));const Vg=new WeakMap;const Hg=new WeakMap;function Gg(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&&re(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=Gg(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 Wg(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:i2&&void 0!==arguments[2]?arguments[2]:["top","bottom","left","right"];return r.forEach((r=>{const l=Wg(e,t,r);(void 0===n||l{const a=e.getBoundingClientRect(),[s,c]=$g(t,a,o);if(void 0===i||s0&&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=Ug(e,t),c=(0,d.useThrottle)((0,a.useCallback)(((t,o)=>{var i;const a=jg(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 qg(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)||(Vg.get(u)||Vg.set(u,[]),Vg.get(u).push([e,t]),window.queueMicrotask((()=>{var e;null!==(e=Vg.get(u))&&void 0!==e&&e.length&&u.batch((()=>{Vg.get(u).forEach((e=>{c(...e)})),Vg.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,isBlockSelected:i}=(0,p.useSelect)(so),{replaceInnerBlocks:s}=(0,p.useDispatch)(so),c=(0,p.useSelect)((t=>t(so).getBlocks(e)),[e]),{getBlocks:d}=(0,p.useSelect)(so),m=(0,a.useRef)(null);(0,a.useLayoutEffect)((()=>{window.queueMicrotask((()=>{const a=d(e),c=0===a.length||"all"===n||"contentOnly"===n,p=!(0,u.isEqual)(t,m.current);if(!c||!p)return;m.current=t;const f=(0,r.synchronizeBlocksWithTemplate)(a,t);(0,u.isEqual)(f,a)||s(e,f,0===a.length&&o&&0!==f.length&&i(e),l())}))}),[c,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){Hg.has(t)||Hg.set(t,new WeakMap);const n=Hg.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)(jl,{value:_},(0,a.createElement)(rh,{rootClientId:t,renderAppender:g,__experimentalAppenderTagName:f,__experimentalLayout:b,wrapperRef:c,placeholder:v}))}function Yg(e){return Vu(e),(0,a.createElement)(qg,e)}const Qg=(0,a.forwardRef)(((e,t)=>{const n=Zg({ref:t},e);return(0,a.createElement)("div",{className:"block-editor-inner-blocks"},(0,a.createElement)("div",n))}));function Zg(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{__unstableDisableDropZone:n}=t,{clientId:o}=mo(),l=(0,d.useViewportMatch)("medium","<"),{__experimentalCaptureToolbars:s,hasOverlay:u}=(0,p.useSelect)((e=>{if(!o)return{};const{getBlockName:t,isBlockSelected:n,hasSelectedInnerBlock:i,__unstableGetEditorMode:a}=e(so),s=t(o),c="navigation"===a()||l;return{__experimentalCaptureToolbars:e(r.store).hasBlockSupport(s,"__experimentalExposeControlsToChildren",!1),hasOverlay:"core/template"!==s&&!n(o)&&!i(o,!0)&&c}}),[o,l]),m=Kg({rootClientId:o}),f=(0,d.useMergeRefs)([e.ref,n?null:m]),g={__experimentalCaptureToolbars:s,...t},h=g.value&&g.onChange?Yg:qg;return{...e,ref:f,className:c()(e.className,"block-editor-block-list__layout",{"has-overlay":u}),children:o?(0,a.createElement)(h,i({},g,{clientId:o})):(0,a.createElement)(rh,t)}}Zg.save=r.__unstableGetInnerBlocksProps,Qg.DefaultBlockAppender=Fg,Qg.ButtonBlockAppender=zg,Qg.Content=()=>Zg.save().children;var Xg=Qg;const Jg=(0,a.createContext)(),eh=(0,a.createContext)();function th(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=Zg({ref:(0,d.useMergeRefs)([Uu(),Vm(),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)(Jg.Provider,{value:o},(0,a.createElement)(eh.Provider,{value:f},(0,a.createElement)("div",g)))}function nh(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=Hm(o))};return t=Hm(o),()=>Gm(t)}),[e])}(),(0,a.createElement)(Dg,null,(0,a.createElement)(po,{value:co},(0,a.createElement)(th,e)))}function oh(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)(Rm,{tagName:r,rootClientId:n,renderAppender:o}))}function rh(e){return(0,a.createElement)(p.AsyncModeProvider,{value:!1},(0,a.createElement)(oh,e))}function lh(e){return[...e].sort(((t,n)=>e.filter((e=>e===n)).length-e.filter((e=>e===t)).length)).shift()}function ih(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{flat:t,...n}=e;return t||lh(Object.values(n).filter(Boolean))||"px"}function ah(){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=lh(o),i=0===r||r?`${r}${l}`:void 0;return i}function sh(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=ah(e),n="string"!=typeof e&&isNaN(parseFloat(t));return n}function ch(e){if(!e)return!1;if("string"==typeof e)return!0;return!!Object.values(e).filter((e=>!!e||0===e)).length}function uh(e){let{onChange:t,selectedUnits:n,setSelectedUnits:o,values:r,...l}=e,s=ah(r);void 0===s&&(s=ih(n));const c=ch(r)&&sh(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}))}nh.__unstableElementContext=Jg;const dh={topLeft:(0,g.__)("Top left"),topRight:(0,g.__)("Top right"),bottomLeft:(0,g.__)("Bottom left"),bottomRight:(0,g.__)("Bottom right")};function ph(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(dh).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 mh(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 fh={topLeft:void 0,topRight:void 0,bottomLeft:void 0,bottomRight:void 0},gh={px:100,em:20,rem:20};function hh(e){let{onChange:t,values:n}=e;const[o,r]=(0,a.useState)(!ch(n)||!sh(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=ih(l),u=s&&s.find((e=>e.value===c)),d=(null==u?void 0:u.step)||1,[p]=(0,m.__experimentalParseQuantityAndUnitFromRawValue)(ah(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)(uh,{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:gh[c],initialPosition:0,withInputField:!1,onChange:e=>{t(void 0!==e?`${e}${c}`:void 0)},step:d})):(0,a.createElement)(ph,{min:0,onChange:t,selectedUnits:l,setSelectedUnits:i,values:n||fh,units:s}),(0,a.createElement)(mh,{onClick:()=>r(!o),isLinked:o})))}function vh(e){var t;const{attributes:{style:n},setAttributes:o}=e;return(0,a.createElement)(hh,{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 bh=(e,t,n)=>{if(t){const n=(0,u.find)(e,{slug:t});if(n)return n}return{color:n}},_h=(e,t)=>(0,u.find)(e,{color:t});function kh(e,t){if(e&&t)return`has-${(0,u.kebabCase)(t)}-${e}`}function yh(){return{disableCustomColors:!qo("color.custom"),disableCustomGradients:!qo("color.customGradient")}}function Eh(){const e=yh(),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 Ch="__experimentalBorder",Sh=["top","right","bottom","left"],wh=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}}}},Bh=(e,t,n)=>{let o;return e.some((e=>e.colors.some((e=>e[t]===n&&(o=e,!0))))),o},Ih=e=>{let{colors:t,namedColor:n,customColor:o}=e;if(n){const e=Bh(t,"slug",n);if(e)return e}if(!o)return{color:void 0};const r=Bh(t,"color",o);return r||{color:o}};function xh(e){const t=/var:preset\|color\|(.+)/.exec(e);return t&&t[1]?t[1]:null}function Th(e){const{attributes:t,clientId:n,setAttributes:o}=e,{style:l}=t,{colors:i}=Eh(),s=Nh(e.name),c=qo("border.color")&&Nh(e.name,"color"),u=qo("border.radius")&&Nh(e.name,"radius"),d=qo("border.style")&&Nh(e.name,"style"),p=qo("border.width")&&Nh(e.name,"width");if([!c,!u,!d,!p].every(Boolean)||!s)return null;const f=(0,r.getBlockSupport)(e.name,[Ch,"__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}=Ih({colors:t,namedColor:n});return e?{...r,color:e}:r}if(!r)return r;const l={...r};return Sh.forEach((e=>{var n;const o=xh(null===(n=l[e])||void 0===n?void 0:n.color);if(o){const{color:n}=Ih({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:wh,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}},Sh.forEach((t=>{var n;if(null!==(n=e[t])&&void 0!==n&&n.color){var o;const n=Ih({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=Ih({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:Ph(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)(vh,e)))}function Nh(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,Ch);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 Ph(e,t){return ar({...e,border:{...null==e?void 0:e.border,[t]:void 0}})}function Mh(e,t,n){if(!Nh(t,"color")||ur(t,Ch,"color"))return e;const o=Lh(n),r=c()(e.className,o);return e.className=r||void 0,e}function Lh(e){var t;const{borderColor:n,style:o}=e,r=kh("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 Rh=(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}=Eh();if(!Nh(m,"color")||ur(m,Ch,"color"))return(0,a.createElement)(e,t);const{color:b}=Ih({colors:v,namedColor:g}),{color:_}=Ih({colors:v,namedColor:xh(null==h||null===(n=h.border)||void 0===n||null===(o=n.top)||void 0===o?void 0:o.color)}),{color:k}=Ih({colors:v,namedColor:xh(null==h||null===(r=h.border)||void 0===r||null===(l=r.right)||void 0===l?void 0:l.color)}),{color:y}=Ih({colors:v,namedColor:xh(null==h||null===(s=h.border)||void 0===s||null===(c=s.bottom)||void 0===c?void 0:c.color)}),{color:E}=Ih({colors:v,namedColor:xh(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 S=t.wrapperProps;return S={...t.wrapperProps,style:{...null===(p=t.wrapperProps)||void 0===p?void 0:p.style,...C}},(0,a.createElement)(e,i({},t,{wrapperProps:S}))}));function Ah(e){if(e)return`has-${e}-gradient-background`}function Dh(e,t){const n=(0,u.find)(e,["slug",t]);return n&&n.gradient}function Oh(e,t){return(0,u.find)(e,["gradient",t])}function zh(e,t){const n=Oh(e,t);return n&&n.slug}function Fh(){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=zh(i,o);u(n,r?{[e]:r,[t]:void 0}:{[e]:void 0,[t]:o})}),[i,n,u]),m=Ah(s);let f;return f=s?Dh(i,s):c,{gradientClass:m,gradientValue:f,setGradient:d}}(0,l.addFilter)("blocks.registerBlockType","core/border/addAttributes",(function(e){return Nh(e,"color")?e.attributes.borderColor?e:{...e,attributes:{...e.attributes,borderColor:{type:"string"}}}:e})),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/border/addSaveProps",Mh),(0,l.addFilter)("blocks.registerBlockType","core/border/addEditProps",(function(e){if(!Nh(e,"color")||ur(e,Ch,"color"))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),Mh(o,e,n)},e})),(0,l.addFilter)("editor.BlockListBlock","core/border/with-border-color-palette-styles",Rh);const Vh=["colors","disableCustomColors","gradients","disableCustomGradients"],Hh={name:"color",title:"Solid",value:"color"},Gh={name:"gradient",title:"Gradient",value:"gradient"},Uh=[Hh,Gh];function Wh(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={[Hh.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:_}),[Gh.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:Uh,initialTabName:h?Gh.value:!!k&&Hh.value},(e=>C(e.value))),!y&&C(Hh.value),!k&&C(Gh.value))))}function $h(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)(Wh,i({},t,e))}var jh=function(e){return(0,u.every)(Vh,(t=>e.hasOwnProperty(t)))?(0,a.createElement)(Wh,e):(0,a.createElement)($h,e)};const Kh=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)},qh=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))},Yh=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)(qh,{colorValue:r,label:l}))};function Qh(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)(Kh,i({key:c,setting:e},p),(0,a.createElement)(m.Dropdown,{popoverProps:t,className:"block-editor-tools-panel-color-gradient-settings__dropdown",renderToggle:Yh(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)(jh,g)))}))})))}Dd([Od,Vd]);var Zh=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=_null==e?void 0:e.colorValue));(0,a.useEffect)((()=>{var e;if(!r||!f.length)return;if(!m.current)return;u(Xh(m.current).color);const t=null===(e=m.current)||void 0===e?void 0:e.querySelector("a");t&&t.innerText&&p(Xh(t).color);let n=m.current,o=Xh(n).backgroundColor;for(;"rgba(0, 0, 0, 0)"===o&&n.parentNode&&n.parentNode.nodeType===n.parentNode.ELEMENT_NODE;)n=n.parentNode,o=Xh(n).backgroundColor;s(o)}));const g=Eh();return(0,a.createElement)(hr,{__experimentalGroup:"color"},(0,a.createElement)(Qh,i({enableAlpha:t,panelId:o,settings:n,__experimentalIsItemGroup:!1,__experimentalHasMultipleOrigins:!0,__experimentalIsRenderedInSidebar:!0},g)),r&&(0,a.createElement)(Zh,{backgroundColor:l,textColor:c,enableAlphaChecker:t,linkColor:d}))}const ev="color",tv=e=>{const t=(0,r.getBlockSupport)(e,ev);return t&&(!0===t.link||!0===t.gradient||!1!==t.background||!1!==t.text)},nv=e=>{if("web"!==a.Platform.OS)return!1;const t=(0,r.getBlockSupport)(e,ev);return null!==t&&"object"==typeof t&&!!t.link},ov=e=>{const t=(0,r.getBlockSupport)(e,ev);return null!==t&&"object"==typeof t&&!!t.gradients},rv=e=>{const t=(0,r.getBlockSupport)(e,ev);return t&&!1!==t.background},lv=e=>{const t=(0,r.getBlockSupport)(e,ev);return t&&!1!==t.text},iv=(e,t)=>ar(sr(t,e,void 0)),av=e=>({textColor:void 0,style:iv(["color","text"],e.style)}),sv=e=>({style:iv(["elements","link","color","text"],e.style)}),cv=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 uv(e,t,n){var o,r,l,i,a,s;if(!tv(t)||ur(t,ev))return e;const u=ov(t),{backgroundColor:d,textColor:p,gradient:m,style:f}=n,g=e=>!ur(t,ev,e),h=g("text")?kh("color",p):void 0,v=g("gradients")?Ah(m):void 0,b=g("background")?kh("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 dv=(e,t)=>{const n=/var:preset\|color\|(.+)/.exec(t);return n&&n[1]?bh(e,n[1]).color:t};function pv(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"),S=qo("color.customGradient"),w=qo("color.background"),B=qo("color.link"),I=qo("color.text"),x=C||!h||(null==h?void 0:h.length)>0,T=S||!k||(null==k?void 0:k.length)>0,N=(0,a.useRef)(m);if((0,a.useEffect)((()=>{N.current=m}),[m]),!tv(p))return null;const P=nv(p)&&B&&x,M=lv(p)&&I&&x,L=rv(p)&&w&&x,R=ov(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=Dh(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=_h(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,[ev,"__experimentalDefaultControls"]),U=!("web"!==a.Platform.OS||z||null!=A&&null!==(t=A.color)&&void 0!==t&&t.gradient||!1===(0,r.getBlockSupport)(e.name,[ev,"enableContrastChecker"]));return(0,a.createElement)(Jh,{enableContrastChecking:U,clientId:e.clientId,enableAlpha:!0,settings:[...M?[{label:(0,g.__)("Text"),onColorChange:H("text"),colorValue:bh(b,D,null==A||null===(n=A.color)||void 0===n?void 0:n.text).color,isShownByDefault:null==G?void 0:G.text,resetAllFilter:av}]:[],...L||R?[{label:(0,g.__)("Background"),onColorChange:L?H("background"):void 0,colorValue:bh(b,O,null==A||null===(o=A.color)||void 0===o?void 0:o.background).color,gradientValue:F,onGradientChange:R?t=>{const n=zh(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:cv}]:[],...P?[{label:(0,g.__)("Link"),onColorChange:t=>{var n;const o=_h(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:dv(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:sv}]:[]]})}const mv=(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(!tv(o)||ur(o,ev))return(0,a.createElement)(e,t);const m={};var f,g;s&&!ur(o,ev,"text")&&(m.color=null===(f=bh(p,s))||void 0===f?void 0:f.color);l&&!ur(o,ev,"background")&&(m.backgroundColor=null===(g=bh(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}))})),fv={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 tv(e)?(e.attributes.backgroundColor||Object.assign(e.attributes,{backgroundColor:{type:"string"}}),e.attributes.textColor||Object.assign(e.attributes,{textColor:{type:"string"}}),ov(e)&&!e.attributes.gradient&&Object.assign(e.attributes,{gradient:{type:"string"}}),e):e})),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/color/addSaveProps",uv),(0,l.addFilter)("blocks.registerBlockType","core/color/addEditProps",(function(e){if(!tv(e)||ur(e,ev))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),uv(o,e,n)},e})),(0,l.addFilter)("editor.BlockListBlock","core/color/with-color-palette-styles",mv),(0,l.addFilter)("blocks.switchToBlockType.transformedBlock","core/color/addTransforms",(function(e,t,n,o){const r=e.name;return cr({linkColor:nv(r),textColor:lv(r),backgroundColor:rv(r),gradient:ov(r)},fv,e,t,n,o)}));const gv=[{name:(0,g._x)("Regular","font style"),value:"normal"},{name:(0,g._x)("Italic","font style"),value:"italic"}],hv=[{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"}],vv=(e,t)=>e?t?(0,g.__)("Appearance"):(0,g.__)("Font style"):(0,g.__)("Font weight");function bv(e){const{onChange:t,hasFontStyles:n=!0,hasFontWeights:o=!0,value:{fontStyle:r,fontWeight:l},...s}=e,c=n||o,u=vv(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 gv.forEach((t=>{let{name:n,value:o}=t;hv.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 gv.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 hv.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 _v=1.5,kv=.1;var yv=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 _v;default:return e}})(e.value,o);return{...e,value:r}},onChange:n,label:(0,g.__)("Line height"),placeholder:_v,step:kv,value:c,min:0})))};const Ev="typography.lineHeight";function Cv(e){var t;const{attributes:{style:n},setAttributes:o}=e;return(0,a.createElement)(yv,{__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 Sv(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!qo("typography.lineHeight");return!(0,r.hasBlockSupport)(e,Ev)||t}const wv="typography.__experimentalFontStyle",Bv="typography.__experimentalFontWeight";function Iv(e){var t,n;const{attributes:{style:o},setAttributes:r}=e,l=!xv(e),i=!Tv(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)(bv,{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 xv(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=(0,r.hasBlockSupport)(e,wv),n=qo("typography.fontStyle");return!t||!n}function Tv(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=(0,r.hasBlockSupport)(e,Bv),n=qo("typography.fontWeight");return!t||!n}function Nv(e){const t=xv(e),n=Tv(e);return t&&n}function Pv(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 Mv="typography.__experimentalFontFamily";function Lv(e,t,n){if(!(0,r.hasBlockSupport)(t,Mv))return e;if(ur(t,kb,"fontFamily"))return e;if(null==n||!n.fontFamily)return e;const o=new(Sf())(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 Rv(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)(Pv,{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 Av(e){let{name:t}=e;const n=qo("typography.fontFamilies");return!n||0===n.length||!(0,r.hasBlockSupport)(t,Mv)}(0,l.addFilter)("blocks.registerBlockType","core/fontFamily/addAttribute",(function(e){return(0,r.hasBlockSupport)(e,Mv)?(e.attributes.fontFamily||Object.assign(e.attributes,{fontFamily:{type:"string"}}),e):e})),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/fontFamily/addSaveProps",Lv),(0,l.addFilter)("blocks.registerBlockType","core/fontFamily/addEditProps",(function(e){if(!(0,r.hasBlockSupport)(e,Mv))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),Lv(o,e,n)},e}));const Dv=(e,t,n)=>{if(t){const n=(0,u.find)(e,{slug:t});if(n)return n}return{size:n}};function Ov(e,t){const n=(0,u.find)(e,{size:t});return n||{size:t}}function zv(e){if(e)return`has-${(0,u.kebabCase)(e)}-font-size`}var Fv=function(e){const t=qo("typography.fontSizes"),n=!qo("typography.customFontSize");return(0,a.createElement)(m.FontSizePicker,i({},e,{fontSizes:t,disableCustomFontSizes:n}))};const Vv="1600px",Hv="768px",Gv=1,Uv=.75,Wv="14px";function $v(e){let{minimumFontSize:t,maximumFontSize:n,fontSize:o,minimumViewPortWidth:r=Hv,maximumViewPortWidth:l=Vv,scaleFactor:i=Gv,minimumFontSizeFactor:a=Uv,minimumFontSizeLimit:s=Wv}=e;if(o){const e=jv(o);if(null==e||!e.unit)return null;const r=jv(s,{coerceTo:e.unit});if(null!=r&&r.value&&!t&&!n&&(null==e?void 0:e.value)<=(null==r?void 0:r.value))return null;if(n||(n=`${e.value}${e.unit}`),!t){const n=Kv(e.value*a,3);t=null!=r&&r.value&&n<(null==r?void 0:r.value)?`${r.value}${r.unit}`:`${n}${e.unit}`}}const c=jv(t),u=(null==c?void 0:c.unit)||"rem",d=jv(n,{coerceTo:u});if(!c||!d)return null;const p=jv(t,{coerceTo:"rem"}),m=jv(l,{coerceTo:u}),f=jv(r,{coerceTo:u});if(!m||!f||!p)return null;const g=Kv(f.value/100,3),h=Kv(g,3)+u,v=Kv(((d.value-c.value)/(m.value-f.value)*100||1)*i,3);return`clamp(${t}, ${`${p.value}${p.unit} + ((1vw - ${h}) * ${v})`}, ${n})`}function jv(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if("string"!=typeof e&&"number"!=typeof e)return null;isFinite(e)&&(e=`${e}px`);const{coerceTo:n,rootSizeValue:o,acceptableUnits:r}={coerceTo:"",rootSizeValue:16,acceptableUnits:["rem","px","em"],...t},l=null==r?void 0:r.join("|"),i=new RegExp(`^(\\d*\\.?\\d+)(${l}){1,1}$`),a=e.match(i);if(!a||a.length<3)return null;let[,s,c]=a,u=parseFloat(s);return"px"!==n||"em"!==c&&"rem"!==c||(u*=o,c=n),"px"!==c||"em"!==n&&"rem"!==n||(u/=o,c=n),"em"!==n&&"rem"!==n||"em"!==c&&"rem"!==c||(c=n),{value:Kv(u,3),unit:c}}function Kv(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3;const n=Math.pow(10,t);return Number.isFinite(e)?parseFloat(Math.round(e*n)/n):void 0}const qv="typography.fontSize";function Yv(e,t,n){if(!(0,r.hasBlockSupport)(t,qv))return e;if(ur(t,kb,"fontSize"))return e;const o=new(Sf())(e.className);o.add(zv(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=Dv(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)(Fv,{onChange:e=>{const t=Ov(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 Zv(){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,qv)||!n}const Xv=(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,qv)||ur(i,kb,"fontSize")||!s||null!=c&&null!==(n=c.typography)&&void 0!==n&&n.fontSize)return(0,a.createElement)(e,t);const d=Dv(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"),Jv={fontSize:[["fontSize"],["style","typography","fontSize"]]};(0,l.addFilter)("blocks.registerBlockType","core/font/addAttribute",(function(e){return(0,r.hasBlockSupport)(e,qv)?(e.attributes.fontSize||Object.assign(e.attributes,{fontSize:{type:"string"}}),e):e})),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/font/addSaveProps",Yv),(0,l.addFilter)("blocks.registerBlockType","core/font/addEditProps",(function(e){if(!(0,r.hasBlockSupport)(e,qv))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),Yv(o,e,n)},e})),(0,l.addFilter)("editor.BlockListBlock","core/font-size/with-font-size-inline-styles",Xv),(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,qv)},Jv,e,t,n,o)})),(0,l.addFilter)("blocks.registerBlockType","core/font-size/addEditPropsForFluidCustomFontSizes",(function(e){if(!(0,r.hasBlockSupport)(e,qv)||ur(e,kb,"fontSize"))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=e=>{var n,o,r;const l=t?t(e):{},i=null==l||null===(n=l.style)||void 0===n?void 0:n.fontSize,a=!(null===(o=(0,p.select)(so).getSettings().__experimentalFeatures)||void 0===o||null===(r=o.typography)||void 0===r||!r.fluid),s=i&&a?$v({fontSize:i}):null;return null===s?l:{...l,style:{...null==l?void 0:l.style,fontSize:s}}},e}),11);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:"M7 11.5h10V13H7z"}));var tb=(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 nb=(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 ob=[{name:(0,g.__)("None"),value:"none",icon:eb},{name:(0,g.__)("Underline"),value:"underline",icon:tb},{name:(0,g.__)("Strikethrough"),value:"line-through",icon:nb}];function rb(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"},ob.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 lb="typography.__experimentalTextDecoration";function ib(e){var t;const{attributes:{style:n},setAttributes:o}=e;return(0,a.createElement)(rb,{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 ab(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!(0,r.hasBlockSupport)(e,lb),n=qo("typography.textDecoration");return t||!n}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:"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 cb=(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 ub=(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 db=[{name:(0,g.__)("None"),value:"none",icon:eb},{name:(0,g.__)("Uppercase"),value:"uppercase",icon:sb},{name:(0,g.__)("Lowercase"),value:"lowercase",icon:cb},{name:(0,g.__)("Capitalize"),value:"capitalize",icon:ub}];function pb(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"},db.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 mb="typography.__experimentalTextTransform";function fb(e){var t;const{attributes:{style:n},setAttributes:o}=e;return(0,a.createElement)(pb,{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 gb(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!(0,r.hasBlockSupport)(e,mb),n=qo("typography.textTransform");return t||!n}function hb(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 vb="typography.__experimentalLetterSpacing";function bb(e){var t;const{attributes:{style:n},setAttributes:o}=e;return(0,a.createElement)(hb,{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 _b(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!(0,r.hasBlockSupport)(e,vb),n=qo("typography.letterSpacing");return t||!n}const kb="typography",yb=[Ev,qv,wv,Bv,Mv,lb,mb,vb];function Eb(e){const{clientId:t}=e,n=Av(e),o=Zv(e),l=Nv(e),i=Sv(e),s=ab(e),c=gb(e),u=_b(e),d=!xv(e),p=!Tv(e),f=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=[Nv(e),Zv(e),Sv(e),Av(e),ab(e),gb(e),_b(e)];return t.filter(Boolean).length===t.length}(e),h=Cb(e.name);if(f||!h)return null;const v=(0,r.getBlockSupport)(e.name,[kb,"__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)(Rv,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:vv(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)(Iv,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)(Cv,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)(bb,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)(ib,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)(fb,e)))}const Cb=e=>yb.some((t=>(0,r.hasBlockSupport)(e,t)));const Sb=[...yb,Ch,ev,Nr],wb=e=>Sb.some((t=>(0,r.hasBlockSupport)(e,t)));function Bb(){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 Ib={"__experimentalBorder.__experimentalSkipSerialization":["border"],"color.__experimentalSkipSerialization":[ev],[`${kb}.__experimentalSkipSerialization`]:[kb],[`${Nr}.__experimentalSkipSerialization`]:["spacing"]},xb={...Ib,[`${Nr}`]:["spacing.blockGap"]},Tb={gradients:"gradient"};function Nb(e,t,n){let o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:xb;if(!wb(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=Tb[e]||e;l=(0,u.omit)(l,[[...o,t]])}))})),e.style={...Bb(l),...e.style},e}const Pb=(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)(pv,t),(0,a.createElement)(Eb,t),(0,a.createElement)(Th,t),(0,a.createElement)(Lr,t)),(0,a.createElement)(e,t))}),"withToolbarControls"),Mb=(0,d.createHigherOrderComponent)((e=>t=>{var n,o;const l=`wp-elements-${(0,d.useInstanceId)(e)}`,s=ur(t.name,ev,"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)(nh.__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 wb(e)?(e.attributes.style||Object.assign(e.attributes,{style:{type:"object"}}),e):e})),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/style/addSaveProps",Nb),(0,l.addFilter)("blocks.registerBlockType","core/style/addEditProps",(function(e){if(!wb(e))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),Nb(o,e,n,Ib)},e})),(0,l.addFilter)("editor.BlockEdit","core/style/with-block-controls",Pb),(0,l.addFilter)("editor.BlockListBlock","core/editor/with-elements-styles",Mb);(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 Lb=(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 Rb=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:Lb}),(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 Ab=[];function Db(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 Ob(e){let{presetSetting:t,defaultSetting:n}=e;const o=!qo(n),r=qo(`${t}.custom`)||Ab,l=qo(`${t}.theme`)||Ab,i=qo(`${t}.default`)||Ab;return(0,a.useMemo)((()=>[...r,...l,...o?Ab:i]),[o,r,l,i])}function zb(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=Ob({presetSetting:"color.duotone",defaultSetting:"color.defaultDuotone"}),s=Ob({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)(Rb,{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 Fb=(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)(zb,t))}),"withDuotoneControls");const Vb=(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)(nh.__unstableElementContext);return(0,a.createElement)(a.Fragment,null,g&&(0,a.createPortal)((0,a.createElement)(Db,{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",Fb),(0,l.addFilter)("editor.BlockListBlock","core/editor/duotone/with-styles",Vb);const Hb="__experimentalLayout";function Gb(){var e,t;let n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};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}),[]),l=qo("layout")||{},{attributes:i={},name:a}=n,{layout:s}=i,{default:c}=(0,r.getBlockSupport)(a,Hb)||{},d=null!=s&&s.inherit||null!=s&&s.contentSize||null!=s&&s.wideSize?{...s,type:"constrained"}:s||c||{},m=[];var f,g;null!=l&&null!==(e=l.definitions)&&void 0!==e&&null!==(t=e[(null==d?void 0:d.type)||"default"])&&void 0!==t&&t.className&&m.push(null==l||null===(f=l.definitions)||void 0===f||null===(g=f[(null==d?void 0:d.type)||"default"])||void 0===g?void 0:g.className);return(null!=d&&d.inherit||null!=d&&d.contentSize||"constrained"===(null==d?void 0:d.type))&&o&&m.push("has-global-padding"),null!=d&&d.orientation&&m.push(`is-${(0,u.kebabCase)(d.orientation)}`),null!=d&&d.justifyContent&&m.push(`is-content-justification-${(0,u.kebabCase)(d.justifyContent)}`),null!=d&&d.flexWrap&&"nowrap"===d.flexWrap&&m.push("is-nowrap"),m}function Ub(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;const{attributes:o={},name:r}=t,{layout:l={},style:i={}}=o,a=null!=l&&l.inherit||null!=l&&l.contentSize||null!=l&&l.wideSize?{...l,type:"constrained"}:l||{},s=hl((null==a?void 0:a.type)||"default"),c=qo("layout")||{},u=qo("spacing.blockGap"),d=null!==u,p=null==s||null===(e=s.getLayoutStyle)||void 0===e?void 0:e.call(s,{blockName:r,selector:n,layout:l,layoutDefinitions:null==c?void 0:c.definitions,style:i,hasBlockGapSupport:d});return p}function Wb(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,Hb,{}),{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"),S=!b.type&&(y||_),w=!!_||!!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)||w,onChange:()=>t({layout:{type:"constrained"===(null==E?void 0:E.name)||w?"default":"constrained"}}),help:"constrained"===(null==E?void 0:E.name)||w?(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)($b,{type:k,onChange:e=>t({layout:{type:e}})}),E&&"default"!==E.name&&(0,a.createElement)(E.inspectorControls,{layout:b,onChange:B,layoutBlockSupport:c}),C&&S&&(0,a.createElement)(C.inspectorControls,{layout:b,onChange:B,layoutBlockSupport:c}))),!_&&E&&(0,a.createElement)(E.toolBarControls,{layout:b,onChange:B,layoutBlockSupport:c}))}function $b(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 jb=(0,d.createHigherOrderComponent)((e=>t=>{const{name:n}=t;return[(0,r.hasBlockSupport)(n,Hb)&&(0,a.createElement)(Wb,i({key:"layout"},t)),(0,a.createElement)(e,i({key:"edit"},t))]}),"withInspectorControls"),Kb=(0,d.createHigherOrderComponent)((e=>t=>{const{name:n,attributes:o,block:l}=t,s=(0,r.hasBlockSupport)(n,Hb),u=(0,p.useSelect)((e=>{const{getSettings:t}=e(so);return!!t().disableLayoutStyles})),m=s&&!u,f=(0,d.useInstanceId)(e),g=qo("layout")||{},h=(0,a.useContext)(nh.__unstableElementContext),{layout:v}=o,{default:b}=(0,r.getBlockSupport)(n,Hb)||{},_=null!=v&&v.inherit||null!=v&&v.contentSize||null!=v&&v.wideSize?{...v,type:"constrained"}:v||b||{},k=s?Gb(l):null,y=`.${(0,r.getBlockDefaultClassName)(n)}.wp-container-${f}`,E=null!==qo("spacing.blockGap");let C;if(m){var S;const e=hl((null==_?void 0:_.type)||"default");C=null==e||null===(S=e.getLayoutStyle)||void 0===S?void 0:S.call(e,{blockName:n,selector:y,layout:_,layoutDefinitions:null==g?void 0:g.definitions,style:null==o?void 0:o.style,hasBlockGapSupport:E})}const w=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:w})))}));function qb(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,Hb)&&(e.attributes={...e.attributes,layout:{type:"object"}}),e})),(0,l.addFilter)("editor.BlockListBlock","core/editor/layout/with-layout-styles",Kb),(0,l.addFilter)("editor.BlockEdit","core/editor/layout/with-inspector-controls",jb);const Yb=(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)(qb,{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",Yb);const Qb="metadata";function Zb(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 Xb(e){var t;const n=(null===(t=e.style)||void 0===t?void 0:t.border)||{};return{className:Lh(e)||void 0,style:Bb({border:n})}}function Jb(e){const{colors:t}=Eh(),n=Xb(e),{borderColor:o}=e;if(o){const e=Ih({colors:t,namedColor:o});n.style.borderColor=e.color}return n}function e_(e){var t,n,o,r,l,i;const{backgroundColor:a,textColor:s,gradient:u,style:d}=e,p=kh("background-color",a),m=kh("color",s),f=Ah(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:Bb({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||Zb(e,"name",!1)&&(e.attributes={...e.attributes,[Qb]:{type:"object"}}),e})),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/metadata/save-props",(function(e,t,n){return Zb(t)&&(e.metadata=n.metadata),e})),(0,l.addFilter)("blocks.registerBlockType","core/metadata/addLabelCallback",(function(e){return e.__experimentalLabel||Zb(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 t_={};function n_(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")||t_,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=e_(e);if(t){const e=bh(c,t);d.style.backgroundColor=e.color}if(o&&(d.style.background=Dh(u,o)),n){const e=bh(c,n);d.style.color=e.color}return d}function o_(e){const{style:t}=e;return{style:Bb({spacing:(null==t?void 0:t.spacing)||{}})}}function r_(e,t){var n;let o=(null==e||null===(n=e.style)||void 0===n?void 0:n.typography)||{};var r,l;t&&(o={...o,fontSize:$v({fontSize:null==e||null===(r=e.style)||void 0===r||null===(l=r.typography)||void 0===l?void 0:l.fontSize})});const i=Bb({typography:o}),a=null!=e&&e.fontFamily?`has-${(0,u.kebabCase)(e.fontFamily)}-font-family`:"";return{className:c()(a,zv(null==e?void 0:e.fontSize)),style:i}}function l_(e){const[t,n]=(0,a.useState)(e);return(0,a.useEffect)((()=>{e&&n(e)}),[e]),t}const i_=e=>{let[t,...n]=e;return t.toUpperCase()+n.join("")},a_=e=>(0,d.createHigherOrderComponent)((t=>n=>(0,a.createElement)(t,i({},n,{colors:e}))),"withCustomColorPalette"),s_=()=>(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 c_(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=i_(n),r=`custom${o}`;return e[`set${o}`]=this.createSetColor(n,r),e}),{})}createSetColor(e,t){return n=>{const o=_h(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=bh(r,o[l],o[`custom${i_(l)}`]),a=t[l];return(null==a?void 0:a.color)===i.color&&a?e[l]=a:e[l]={...i,class:kh(n,i.slug)},e}),{})}render(){return(0,a.createElement)(e,i({},this.props,{colors:void 0},this.state,this.setters,{colorUtils:this.colorUtils}))}}])}function u_(e){return function(){const t=a_(e);for(var n=arguments.length,o=new Array(n),r=0;r{let[t,...n]=e;return t.toUpperCase()+n.join("")};var f_=function(){for(var e=arguments.length,t=new Array(e),n=0;n(e[t]=`custom${m_(t)}`,e)),{});return(0,d.createHigherOrderComponent)((0,d.compose)([(0,d.createHigherOrderComponent)((e=>t=>{const n=qo("typography.fontSizes")||p_;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${m_(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=Dv(r,l,n[t]);return e[o]={...i,class:zv(l)},e}),{});return{...t,...i}}render(){return(0,a.createElement)(e,i({},this.props,{fontSizes:void 0},this.state,this.setters))}}]),"withFontSizes")};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:"M4 19.8h8.9v-1.5H4v1.5zm8.9-15.6H4v1.5h8.9V4.2zm-8.9 7v1.5h16v-1.5H4z"}));var h_=(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 v_=(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 b_=[{icon:g_,title:(0,g.__)("Align text left"),align:"left"},{icon:h_,title:(0,g.__)("Align text center"),align:"center"},{icon:v_,title:(0,g.__)("Align text right"),align:"right"}],__={position:"bottom right",isAlternate:!0};var k_=function(e){let{value:t,onChange:n,alignmentControls:o=b_,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:__};return(0,a.createElement)(f,i({icon:p?p.icon:(0,g.isRTL)()?v_:g_,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 y_=e=>(0,a.createElement)(k_,i({},e,{isToolbar:!1})),E_=e=>(0,a.createElement)(k_,i({},e,{isToolbar:!0})),C_=()=>{};var S_={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,C_),i=(0,a.useMemo)((()=>(e.trim()?rm(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))}}},w_=window.wp.apiFetch,B_=n.n(w_);var I_=(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 x_=(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 T_={name:"links",className:"block-editor-autocompleters__link",triggerPrefix:"[[",options:async e=>{let t=await B_()({path:(0,mm.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?I_:x_}),e.title)},getOptionCompletion(e){return(0,a.createElement)("a",{href:e.url},e.title)}};const N_=[];function P_(e){let{completers:t=N_}=e;const{name:n}=mo();return(0,a.useMemo)((()=>{let e=[...t,T_];return(n===(0,r.getDefaultBlockName)()||(0,r.getBlockSupport)(n,"__experimentalSlashInserter",!1))&&(e=[...e,S_]),(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 M_=function(e){return(0,a.createElement)(m.Autocomplete,i({},e,{completers:P_(e)}))};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:"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 R_=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:L_,label:n,onClick:()=>o(!t),disabled:r})};const A_=()=>{};var D_=function(e){const{label:t=(0,g.__)("Change matrix alignment"),onChange:n=A_,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 O_=(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 z_=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:O_,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)($m,{clientId:e,maximumLength:35})),(0,a.createElement)(ul,{icon:O_,className:"block-editor-block-breadcrumb__separator"})))),!!r&&(0,a.createElement)("li",{className:"block-editor-block-breadcrumb__current","aria-current":"true"},(0,a.createElement)($m,{clientId:r,maximumLength:35})))};const F_=()=>(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"})),V_=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)(F_,null)))},H_=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)(V_,null)))}))}};var G_=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:H_(n),renderContent:()=>t})};var U_=(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 W_=ou(m.__experimentalTreeGridRow);function $_(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)(W_,i({ref:p,className:c()("block-editor-list-view-leaf",s),level:o,positionInSet:n,setSize:r},d),l)}var j_=(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 K_(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)()?j_:O_}))}var q_=(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=Um(o),g=Wm({clientId:o,context:"list-view"}),{isLocked:h}=rg(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)(K_,{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:ig})))))}));const Y_=(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)(jm,{clientIds:y},(e=>{let{draggable:c,onDragStart:p,onDragEnd:f}=e;return(0,a.createElement)(q_,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 Q_=Y_;const Z_=(0,a.createContext)({}),X_=()=>(0,a.useContext)(Z_);var J_=(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),[S,w]=(0,a.useState)(!1),{clientId:B}=n,{isLocked:I,isContentLocked:x}=rg(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=Um(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}=X_(),U=b&&v>0,W=c()("block-editor-list-view-block__mover-cell",{"is-visible":S||l}),$=c()("block-editor-list-view-block__menu-cell",{"is-visible":S||N});(0,a.useEffect)((()=>{!V&&l&&C.current.focus()}),[]);const j=(0,a.useCallback)((()=>{w(!0),M(B,!0)}),[B,w,M]),K=(0,a.useCallback)((()=>{w(!1),M(B,!1)}),[B,w,M]),q=(0,a.useCallback)((e=>{s(e,B),e.preventDefault()}),[B,s]),Y=(0,a.useCallback)((e=>{s(void 0,e)}),[s]),Q=(0,a.useCallback)((e=>{e.preventDefault(),e.stopPropagation(),!0===k?G(B):!1===k&&H(B)}),[B,H,G,k]);let Z;U?Z=2:A||(Z=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)($_,{className:X,onMouseEnter:j,onMouseLeave:K,onFocus:j,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:Z,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)(Q_,{block:n,onClick:q,onToggleExpanded:Q,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)(nf,{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)(of,{orientation:"vertical",clientIds:[B],ref:t,tabIndex:n,onFocus:o})})))),A&&(0,a.createElement)(m.__experimentalTreeGridCell,{className:$,"aria-selected":!!l||T},(e=>{let{ref:t,tabIndex:n,onFocus:o}=e;return(0,a.createElement)(vg,{clientIds:J,icon:Uf,label:F,toggleProps:{ref:t,className:"block-editor-list-view-block__menu",tabIndex:n,onFocus:o},disableOpenOnArrowDown:!0,__experimentalSelectBlock:Y})})))}));function ek(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(tk(t,n,o),0):1}const tk=(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+ek(r,e,t,n):o+1};function nk(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}=X_();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+=ek(b[t-1],h,v,d));const{itemInView:y}=u,E=y(k),C=t+1,S=i.length>0?`${i}_${C}`:`${C}`,w=!(null==g||!g.length),B=w&&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&&w;return(0,a.createElement)(p.AsyncModeProvider,{key:m,value:!T},x&&(0,a.createElement)(J_,{block:e,selectBlock:n,isSelected:T,isBranchSelected:N,isDragged:I,level:l,position:C,rowCount:_,siblingBlockCount:_,showBlockMovers:o,path:S,isExpanded:B,listPosition:k,selectedClientIds:r}),!x&&(0,a.createElement)("tr",null,(0,a.createElement)("td",{className:"block-editor-list-view-placeholder"})),w&&B&&!I&&(0,a.createElement)(nk,{parentId:m,blocks:g,selectBlock:n,showBlockMovers:o,level:l+1,path:S,listPosition:k+1,fixedListWindow:u,isBranchSelected:N,selectedClientIds:r,isExpanded:d}))})))}nk.defaultProps={selectBlock:()=>{}};var ok=(0,a.memo)(nk);function rk(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 lk(){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 S=f.filter((e=>!C.includes(e)));let w;if(1===S.length){var B;const e=null===(B=m(o(S[0])))||void 0===B?void 0:B.title;e&&(w=(0,g.sprintf)((0,g.__)("%s deselected."),e))}else S.length>1&&(w=(0,g.sprintf)((0,g.__)("%s blocks deselected."),S.length));w&&(0,qt.speak)(w)}),[e,o,m,l,i,s,c,u,d,t,n]);return{updateBlockSelection:f}}function ik(e,t){return t.left<=e.x&&t.right>=e.x&&t.top<=e.y&&t.bottom>=e.y}const ak=["top","bottom"];function sk(){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=Ug(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]=$g(t,a,ak),u=ik(t,a);if(void 0===r||s0||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 ck=(e,t)=>Array.isArray(t.clientIds)?{...e,...t.clientIds.reduce(((e,n)=>({...e,[n]:"expand"===t.type})),{})}:e;var uk=(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}=lk(),[v,b]=(0,a.useReducer)(ck,{}),{ref:_,target:k}=sk(),y=(0,a.useRef)(),E=(0,d.useMergeRefs)([y,_,t]),C=(0,a.useRef)(!1),{setSelectedTreeId:S}=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}),w=(0,a.useCallback)(((e,t)=>{h(e,t),S(t)}),[S,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)(rk,{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)(Z_.Provider,{value:M},(0,a.createElement)(ok,{blocks:i,selectBlock:w,showBlockMovers:r,fixedListWindow:B,selectedClientIds:c,isExpanded:l,shouldShowInnerBlocks:f}))))}));function dk(e){let{isEnabled:t,onToggle:n,isOpen:o,innerRef:r,...l}=e;return(0,a.createElement)(m.Button,i({},l,{ref:r,icon:U_,"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 pk=(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)(dk,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)(uk,null))})}));function mk(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=wf(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 fk(e){let{children:t,scope:n,...o}=e;return(0,a.createElement)(m.Fill,{name:`BlockStylesPreviewPanel/${n}`},(0,a.createElement)("div",o,t))}const gk=()=>{};function hk(e){let{clientId:t,onSwitch:n=gk,onHoverClassName:o=gk,scope:r}=e;const{onSelect:l,stylesToRender:i,activeStyle:s,genericPreviewBlock:p,className:f}=If({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)(fk,{scope:r,className:"block-editor-block-styles__preview-panel",style:{top:v},onMouseLeave:()=>y(null)},(0,a.createElement)(mk,{activeStyle:s,className:f,genericPreviewBlock:p,style:g})))}hk.Slot=function(e){let{scope:t}=e;return(0,a.createElement)(m.Slot,{name:`BlockStylesPreviewPanel/${t}`})};var vk=hk;var bk=(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 _k=function(e){let{icon:t=bk,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 kk=(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 yk="carousel",Ek="grid",Ck=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")))},Sk=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:qm,label:(0,g.__)("Previous pattern"),onClick:t,disabled:0===o}),(0,a.createElement)(m.Button,{icon:Km,label:(0,g.__)("Next pattern"),onClick:n,disabled:o===r-1}))};var wk=e=>{let{viewMode:t,setViewMode:n,handlePrevious:o,handleNext:r,activeSlide:l,totalSlides:i,onBlockPatternSelect:s}=e;const c=t===yk,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(yk),isPressed:c}),(0,a.createElement)(m.Button,{icon:kk,label:(0,g.__)("Grid view"),onClick:()=>n(Ek),isPressed:t===Ek}));return(0,a.createElement)("div",{className:"block-editor-block-pattern-setup__toolbar"},c&&(0,a.createElement)(Sk,{handlePrevious:o,handleNext:r,activeSlide:l,totalSlides:i}),u,c&&(0,a.createElement)(Ck,{onBlockPatternSelect:s}))};var Bk=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 Ik=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===yk){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)(Tk,{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)(xk,{key:e.name,pattern:e,onSelect:r,composite:l})))))};function xk(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)(xk,`${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 Tk(e){let{className:t,pattern:n,minHeight:o}=e;const{blocks:r,title:l,description:i}=n,s=(0,d.useInstanceId)(Tk,"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 Nk=e=>{let{clientId:t,blockName:n,filterPatternsFn:o,onBlockPatternSelect:l}=e;const[i,s]=(0,a.useState)(yk),[c,u]=(0,a.useState)(0),{replaceBlock:d}=(0,p.useDispatch)(so),m=Bk(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)(Ik,{viewMode:i,activeSlide:c,patterns:m,onBlockPatternSelect:f}),(0,a.createElement)(wk,{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 Pk(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 Mk(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:Qm,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 Lk=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?Pk:Mk;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})},Rk=(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"),Ak=Rk(m.ColorPalette);function Dk(e){let{onChange:t,value:n,...o}=e;return(0,a.createElement)(jh,i({},o,{onColorChange:t,colorValue:n,gradients:[],disableCustomGradients:!0}))}var Ok=window.wp.date;const zk=new Date(2022,0,25);function Fk(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,Ok.dateI18n)(n,zk))),checked:!t,onChange:e=>o(e?null:n)}),t&&(0,a.createElement)(Vk,{format:t,onChange:o}))}function Vk(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,Ok.dateI18n)(e,zk),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 format string."),{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 Hk=["colors","disableCustomColors","gradients","disableCustomGradients"],Gk=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)(Gk),{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)(Qh,{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))},Uk=e=>{const t=yh();return t.colors=qo("color.palette"),t.gradients=qo("color.gradients"),(0,a.createElement)(Gk,i({},t,e))},Wk=e=>{const t=Eh();return(0,a.createElement)(Gk,i({},t,e))};var $k=e=>(0,u.every)(Hk,(t=>e.hasOwnProperty(t)))?(0,a.createElement)(Gk,e):e.__experimentalHasMultipleOrigins?(0,a.createElement)(Wk,e):(0,a.createElement)(Uk,e),jk=function(e,t){return jk=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])},jk(e,t)};var Kk=function(){return Kk=Object.assign||function(e){for(var t,n=1,o=arguments.length;nu*r?{width:u*r,height:u}:{width:c,height:c/r}}function Zk(e,t,n,o,r){void 0===r&&(r=0);var l=ay(t.width,t.height,r),i=l.width,a=l.height;return{x:Xk(e.x,i,n.width,o),y:Xk(e.y,a,n.height,o)}}function Xk(e,t,n,o){var r=t*o/2-n/2;return sy(e,-r,r)}function Jk(e,t){return Math.sqrt(Math.pow(e.y-t.y,2)+Math.pow(e.x-t.x,2))}function ey(e,t){return 180*Math.atan2(t.y-e.y,t.x-e.x)/Math.PI}function ty(e,t,n,o,r,l,i){void 0===l&&(l=0),void 0===i&&(i=!0);var a=i?ny:oy,s=ay(t.width,t.height,l),c=ay(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:Kk(Kk({},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 ny(e,t){return Math.min(e,Math.max(0,t))}function oy(e,t){return t}function ry(e,t,n,o,r,l){var i=ay(t.width,t.height,n),a=sy(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 ly(e,t,n,o,r,l){void 0===n&&(n=0);var i=ay(t.naturalWidth,t.naturalHeight,n),a=sy(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 iy(e,t){return{x:(t.x+e.x)/2,y:(t.y+e.y)/2}}function ay(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 sy(e,t,n){return Math.min(Math.max(e,t),n)}function cy(){for(var e=[],t=0;t0})).join(" ").trim()}var uy=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.gestureZoomStart=0,n.gestureRotationStart=0,n.isTouching=!1,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.currentDoc.removeEventListener("gesturemove",n.onGestureMove),n.currentDoc.removeEventListener("gestureend",n.onGestureEnd)},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=ry(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=ly(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.offsetWidthd?{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=Kk(Kk({},p),{naturalWidth:c,naturalHeight:u}),n.props.setMediaSize&&n.props.setMediaSize(n.mediaSize);var m=n.props.cropSize?n.props.cropSize:Qk(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.isTouching=!0,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.onGestureStart=function(e){e.preventDefault(),n.currentDoc.addEventListener("gesturechange",n.onGestureMove),n.currentDoc.addEventListener("gestureend",n.onGestureEnd),n.gestureZoomStart=n.props.zoom,n.gestureRotationStart=n.props.rotation},n.onGestureMove=function(e){if(e.preventDefault(),!n.isTouching){var o=t.getMousePoint(e),r=n.gestureZoomStart-1+e.scale;if(n.setNewZoom(r,o,{shouldUpdatePosition:!0}),n.props.onRotationChange){var l=n.gestureRotationStart+e.rotation;n.props.onRotationChange(l)}}},n.onGestureEnd=function(e){n.cleanEvents()},n.onDragStart=function(e){var t,o,r=e.x,l=e.y;n.dragStartPosition={x:r,y:l},n.dragStartCrop=Kk({},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?Zk(l,n.mediaSize,n.state.cropSize,n.props.zoom,n.props.rotation):l;n.props.onCropChange(i)}}))},n.onDragStopped=function(){var e,t;n.isTouching=!1,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=Yk()(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=sy(e,n.props.minZoom,n.props.maxZoom);if(l){var a=n.getPointOnContainer(t),s=n.getPointOnMedia(a),c={x:s.x*i-a.x,y:s.y*i-a.y},u=n.props.restrictPosition?Zk(c,n.mediaSize,n.state.cropSize,i,n.props.rotation):c;n.props.onCropChange(u)}n.props.onZoomChange(i)}},n.getCropData=function(){return n.state.cropSize?ty(n.props.restrictPosition?Zk(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?Zk(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}jk(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.onGestureStart)),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.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=Jk(n,o),this.lastPinchRotation=ey(n,o),this.onDragStart(iy(n,o))},t.prototype.onPinchMove=function(e){var n=this,o=t.getTouchPoint(e.touches[0]),r=t.getTouchPoint(e.touches[1]),l=iy(o,r);this.onDrag(l),this.rafPinchTimeout&&this.currentWindow.cancelAnimationFrame(this.rafPinchTimeout),this.rafPinchTimeout=this.currentWindow.requestAnimationFrame((function(){var e=Jk(o,r),t=n.props.zoom*(e/n.lastPinchDistance);n.setNewZoom(t,l,{shouldUpdatePosition:!1}),n.lastPinchDistance=e;var i=ey(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:cy("reactEasyCrop_Container",b)},n?Ti().createElement("img",Kk({alt:"",className:cy("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:Kk(Kk({},h),{transform:l||"translate("+a+"px, "+s+"px) rotate("+c+"deg) scale("+u+")"}),onLoad:this.onMediaLoad})):o&&Ti().createElement("video",Kk({autoPlay:!0,loop:!0,muted:!0,className:cy("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:Kk(Kk({},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",Kk({key:e.src},e))}))),this.state.cropSize&&Ti().createElement("div",{style:Kk(Kk({},g),{width:this.state.cropSize.width,height:this.state.cropSize.height}),"data-testid":"cropper",className:cy("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),dy=uy;const py={position:"bottom right",isAlternate:!0};function my(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(n/o),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(n.width/n.height),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 fy=(0,a.createContext)({}),gy=()=>(0,a.useContext)(fy);function hy(e){let{id:t,url:n,naturalWidth:o,naturalHeight:r,isEditing:l,onFinishEditing:i,onSaveImage:s,children:c}=e;const u=my({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,B_()({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)(fy.Provider,{value:m},c)}function vy(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:_}=gy();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)(dy,{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 by=(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 _y(){const{isInProgress:e,zoom:t,setZoom:n}=gy();return(0,a.createElement)(m.Dropdown,{contentClassName:"wp-block-image__zoom",popoverProps:py,renderToggle:t=>{let{isOpen:n,onToggle:o}=t;return(0,a.createElement)(m.ToolbarButton,{icon:by,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 ky=(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 yy(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?Ef:void 0},t)})))}function Ey(e){let{toggleProps:t}=e;const{isInProgress:n,aspect:o,setAspect:r,defaultAspect:l}=gy();return(0,a.createElement)(m.DropdownMenu,{icon:ky,label:(0,g.__)("Aspect Ratio"),popoverProps:py,toggleProps:t,className:"wp-block-image__aspect-ratio"},(e=>{let{onClose:t}=e;return(0,a.createElement)(a.Fragment,null,(0,a.createElement)(yy,{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)(yy,{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)(yy,{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 Cy=(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 Sy(){const{isInProgress:e,rotateClockwise:t}=gy();return(0,a.createElement)(m.ToolbarButton,{icon:Cy,label:(0,g.__)("Rotate"),onClick:t,disabled:e})}function wy(){const{isInProgress:e,apply:t,cancel:n}=gy();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 By(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)(vy,{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)(_y,null),(0,a.createElement)(m.ToolbarItem,null,(e=>(0,a.createElement)(Ey,{toggleProps:e}))),(0,a.createElement)(Sy,null)),(0,a.createElement)(m.ToolbarGroup,null,(0,a.createElement)(wy,null))))}const Iy=[25,50,75,100],xy=()=>{};function Ty(e){let{imageSizeHelp:t,imageWidth:n,imageHeight:o,imageSizeOptions:r=[],isResizable:l=!0,slug:i,width:s,height:c,onChange:d,onChangeImage:p=xy}=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")},Iy.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 Ny=(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 Py=()=>{};var My=e=>{let{value:t,onChange:n=Py,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)},Ly=n(5425),Ry=n.n(Ly);function Ay(e){return"function"==typeof e}class Dy 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,Ry()(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,mm.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 Ay(t)&&r&&l.length?t({suggestions:l,selectedSuggestion:s,suggestionsListProps:f,buildSuggestionItemProps:g,isLoading:p,handleSuggestionClick:this.handleOnClick,isInitialSuggestions:o&&!(n&&n.length)}):!Ay(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 Oy=(0,d.compose)(d.withSafeTimeout,m.withSpokenMessages,d.withInstanceId,(0,p.withSelect)(((e,t)=>{if(Ay(t.__experimentalFetchLinkSuggestions))return;const{getSettings:n}=e(so);return{__experimentalFetchLinkSuggestions:n().__experimentalFetchLinkSuggestions}})))(Dy);var zy=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: %s"),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 Fy=(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 Vy=(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 Hy=(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 Gy=(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 Uy=(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 Wy={post:Fy,page:I_,post_tag:Vy,category:Hy,attachment:Gy};function $y(e){let{isURL:t,suggestion:n}=e,o=null;return t?o=Uy:n.type in Wy&&(o=Wy[n.type]),o?(0,a.createElement)(ul,{className:"block-editor-link-control__search-item-icon",icon:o}):null}var jy=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)($y,{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,mm.filterURLForDisplay)((0,mm.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 Ky="__CREATE__",qy="mailto",Yy="internal",Qy=["URL",qy,"tel",Yy],Zy=[{id:"opensInNewTab",title:(0,g.__)("Open in new tab")}];function Xy(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&&Qy.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),S=(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"},S,(0,a.createElement)("div",i({},l,{className:b,"aria-labelledby":E}),u.map(((e,t)=>k&&Ky===e.type?(0,a.createElement)(zy,{searchTerm:o,buttonText:h,onClick:()=>r(e),key:e.type,itemProps:s(e,t),isSelected:t===d}):Ky===e.type?null:(0,a.createElement)(jy,{key:`${e.id}-${e.type}`,itemProps:s(e,t),suggestion:e,index:t,onClick:()=>{r(e)},isSelected:t===d,isURL:Qy.includes(e.type),searchTerm:o,shouldShowType:y,isFrontPage:null==e?void 0:e.isFrontPage})))))}function Jy(e){const t=null==e?void 0:e.startsWith("#");return(0,mm.isURL)(e)||e&&e.includes("www.")||t}const eE=()=>Promise.resolve([]),tE=e=>{let t="URL";const n=(0,mm.getProtocol)(e)||"";return n.includes("mailto")&&(t=qy),n.includes("tel")&&(t="tel"),null!=e&&e.startsWith("#")&&(t=Yy),Promise.resolve([{id:e,title:e,url:"URL"===t?(0,mm.prependHTTP)(e):e,type:t}])};function nE(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?tE:eE;return(0,a.useCallback)(((t,a)=>{let{isInitialSuggestions:s}=a;return Jy(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||Jy(e)||!r?c:c.concat({title:e,url:e,type:Ky})})(t,{...e,isInitialSuggestions:s},r,i,n,o,l)}),[i,r,n])}const oE=()=>Promise.resolve([]),rE=()=>{},lE=(0,a.forwardRef)(((e,t)=>{let{value:n,children:o,currentLink:r={},className:l=null,placeholder:i=null,withCreateSuggestion:s=!1,onCreateSuggestion:u=rE,onChange:p=rE,onSelect:m=rE,showSuggestions:f=!0,renderSuggestions:h=(e=>(0,a.createElement)(Xy,e)),fetchSuggestions:v=null,allowDirectEntry:b=!0,showInitialSuggestions:_=!1,suggestionsQuery:k={},withURLSuggestion:y=!0,createSuggestionButtonText:E,useLabel:C=!1}=e;const S=nE(k,b,s,y),w=f?v||S:oE,B=(0,d.useInstanceId)(lE),[I,x]=(0,a.useState)(),T=async e=>{let t=e;if(Ky!==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)(Oy,{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:w,__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 iE=lE;var aE=(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 sE=(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:cE,Fill:uE}=(0,m.createSlotFill)("BlockEditorLinkControlViewer");function dE(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 pE=function(e){const[t,n]=(0,a.useReducer)(dE,{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 mE(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}=pE(s),p=u&&Object.keys(u).length,f=n&&(0,mm.filterURLForDisplay)((0,mm.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:aE,size:32}):(0,a.createElement)(ul,{icon:Uy}),(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:sE,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)(cE,{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 fE=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}}},gE=()=>{};function hE(e){var t,n,o;let{searchInputPlaceholder:r,value:l,settings:i=Zy,onChange:s=gE,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:S=!1,renderControlBottom:w=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=fE(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),$=(null==l||null===(n=l.url)||void 0===n||null===(o=n.trim())||void 0===o?void 0:o.length)>0&&S;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":$})},$&&(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)(iE,{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:$},(0,a.createElement)("div",{className:"block-editor-link-control__search-actions"},(0,a.createElement)(m.Button,{onClick:G,label:(0,g.__)("Submit"),icon:Ny,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)(mE,{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)(My,{value:l,settings:i,onChange:s})),w&&w())}hE.ViewerFill=uE;var vE=hE;var bE=(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 _E=(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 kE=(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 yE=(0,m.withFilters)("editor.MediaUpload")((()=>null));var EE=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 CE=()=>{};let SE=0;var wE=(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=CE,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),[]),S=(0,a.useRef)(),w="block-editor/media-replace-flow/error-notice/"+ ++SE,B=e=>{const t=(0,Wl.__unstableStripHTML)(e);i?i(t):setTimeout((()=>{v("error",t,{speak:!0,id:w,isDismissible:!0})}),1e3)},I=(e,t)=>{d&&u&&u(),t(),s(e),(0,qt.speak)((0,g.__)("The media file has been replaced")),b(w)},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:S,"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)(yE,{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:bE,onClick:t},(0,g.__)("Open Media Library"))}}),(0,a.createElement)(EE,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:_E,onClick:()=>{t()}},(0,g.__)("Upload"))}}))),u&&(0,a.createElement)(m.MenuItem,{icon:kE,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)(vE,{value:{url:t},settings:[],showSuggestions:!1,onChange:e=>{let{url:t}=e;c(t),S.current.focus()}})))))}})}));function BE(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,mm.filterURLForDisplay)((0,mm.safeDecodeURI)(t))):(0,a.createElement)("span",{className:r})}function IE(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:Qm,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))}IE.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)(Oy,{value:r,onChange:o,autocompleteRef:t}),(0,a.createElement)(m.Button,{icon:Ny,label:(0,g.__)("Apply"),type:"submit"}))},IE.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)(BE,{url:r,urlLabel:l,className:n}),o&&(0,a.createElement)(m.Button,{icon:sE,label:(0,g.__)("Edit"),onClick:o}))};var xE=IE;const TE=()=>{},NE=e=>{let{src:t,onChange:n,onSubmit:o,onClose:r}=e;return(0,a.createElement)(xE,{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:Ny,label:(0,g.__)("Apply"),type:"submit"})))};var PE=(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:S,onDoubleClick:w,onFilesPreUpload:B=TE,onHTMLDrop:I=TE,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:w,preview:i,style:P},e,x)},W=()=>b?null:(0,a.createElement)(m.DropZone,{onFilesDrop:H,onHTMLDrop:I}),$=()=>E&&(0,a.createElement)(m.Button,{className:"block-editor-media-placeholder__cancel-button",title:(0,g.__)("Cancel"),variant:"link",onClick:E},(0,g.__)("Cancel")),j=()=>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)(NE,{src:L,onChange:O,onSubmit:V,onClose:F})),K=()=>S&&(0,a.createElement)("div",{className:"block-editor-media-placeholder__url-input-container"},(0,a.createElement)(m.Button,{className:"block-editor-media-placeholder__button",onClick:S,variant:"tertiary"},(0,g.__)("Use featured image")));return _?(0,a.createElement)(EE,null,W()):(0,a.createElement)(EE,{fallback:U(j())},(()=>{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)(yE,{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,j(),K(),$());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,j(),K(),$());return U(e)}return U(o)})())}));var ME=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)($k,i({settings:o,gradients:[],disableCustomGradients:!0},n))};const LE={position:"bottom right",isAlternate:!0};var RE=()=>(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:Qm,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:LE})))})));function AE(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)(DE,{popoverAnchor:s})}function DE(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)(RE,null))))}var OE=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)(DE,{popoverAnchor:n});if(r){const e=(0,z.getActiveFormats)(o);return(0,z.isCollapsed)(o)&&!e.length?null:(0,a.createElement)(AE,{editableContentElement:n,value:o,activeFormats:e})}return(0,a.createElement)(_o,{group:"inline"},(0,a.createElement)(RE,null))};function zE(){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 FE(e){return e.filter((e=>{let{type:t}=e;return/^image\/(?:jpe?g|png|gif|webp)$/.test(t)})).map((e=>``)).join("")}var VE=window.wp.shortcode;function HE(e,t){if(null!=t&&t.length){let n=e.formats.length;for(;n--;)e.formats[n]=[...t,...e.formats[n]||[]]}}function GE(e){if(!0===e||"p"===e||"li"===e)return!0===e?"p":e}function UE(e){let{allowedFormats:t,formattingControls:n,disableFormats:o}=e;return o?UE.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}UE.EMPTY_ARRAY=[];function WE(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 $E(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 jE(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="";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=$E(t,!!m),HE(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&&!$f(k,b)){const e=(0,r.pasteHandler)({HTML:FE(k),mode:"BLOCKS",tagName:s,preserveWhiteSpace:f});return window.console.log("Received items:\n\n",k),void(c&&(0,z.isEmpty)(i)?c(e):WE({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,VE.regexp)(".*").test(E))&&(y="BLOCKS"),p&&(0,z.isEmpty)(i)&&(0,mm.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=$E(e,!!m),HE(e,i.activeFormats),l((0,z.insert)(i,e))}else C.length>0&&(c&&(0,z.isEmpty)(i)?c(C,C.length-1,-1):WE({value:i,pastedBlocks:C,onReplace:c,onSplit:u,onSplitMiddle:d,multilineTag:m}))}return e.addEventListener("paste",n),()=>{e.removeEventListener("paste",n)}}),[])}const KE=["`",'"',"'","“”","‘’"];function qE(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",KE).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 YE(e){let t=e.length;for(;t--;){const n=Qt(e[t].attributes);if(n)return e[t].attributes[n]=e[t].attributes[n].replace(Yt,""),e[t].clientId;const o=YE(e[t].innerBlocks);if(o)return o}}function QE(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(YE([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{e.removeEventListener("input",i),e.removeEventListener("compositionend",i)}}),[])}function ZE(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)?WE({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&&WE({value:m,onReplace:i,onSplit:a,onSplitMiddle:s,multilineTag:c})}}return e.addEventListener("keydown",o),()=>{e.removeEventListener("keydown",o)}}),[])}function XE(e){return e(z.store).getFormatTypes()}const JE=new Set(["a","audio","button","details","embed","iframe","input","label","select","textarea","video"]);function eC(e,t){return"object"!=typeof e?{[t]:e}:Object.fromEntries(Object.entries(e).map((e=>{let[n,o]=e;return[`${t}.${n}`,o]})))}function tC(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 nC(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 oC(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 rC(){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 lC(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 iC=(0,a.createContext)(),aC=(0,a.createContext)();const sC=(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:S,onMerge:w,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:$}=(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:j}=(0,p.useDispatch)(so),K=GE(g),q=UE({allowedFormats:y,formattingControls:E,disableFormats:L}),Y=!q||q.length>0;let Q=s,Z=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/"}),Q=r.children.toHTML(s),Z=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}),j(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)(XE,[]),i=(0,a.useMemo)((()=>l.filter((e=>{let{name:t,tagName:n}=e;return!(r&&!r.includes(t)||o&&JE.has(n))}))),[l,r,JE]),s=(0,p.useSelect)((e=>i.reduce(((o,r)=>r.__experimentalGetPropsForEditableTreePreparation?{...o,...eC(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(tC(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=tC(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:Q,onChange(e,t){let{__unstableFormats:n,__unstableText:o}=t;Z(e),Object.values(ne).forEach((e=>{e(n,o)}))},selectionStart:U,selectionEnd:W,onSelectionChange:X,placeholder:k,__unstableIsSelected:$,__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:P_(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:Q,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,$&&(0,a.createElement)(iC.Provider,{value:ce},(0,a.createElement)(aC.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)(lC,{value:le,onChange:ie,onFocus:de,formatTypes:J,forwardedRef:H})))),$&&Y&&(0,a.createElement)(OE,{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,qE({value:le,onChange:ie}),QE({value:le,onChange:ie,__unstableAllowPrefixTransformations:D,formatTypes:J,onReplace:_,selectionChange:j}),(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)}}),[]),nC(ce),oC(ue),zE(),jE({isSelected:$,disableFormats:L,onChange:ie,value:le,formatTypes:J,tagName:l,onReplace:_,onSplit:B,onSplitMiddle:x,__unstableEmbedURLOnPaste:M,multilineTag:K,preserveWhiteSpace:N,pastePlainText:P}),ZE({removeEditorOnlyFormats:re,value:le,onReplace:_,onSplit:B,onSplitMiddle:x,multilineTag:K,onChange:ie,disableLineBreaks:R,onSplitAtEnd:I}),rC(),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;w&&w(!l),S&&(0,z.isEmpty)(le)&&l&&S(!l),e.preventDefault()}}})))}));sC.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=GE(o);!t&&i&&(t=`<${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},sC.isEmpty=e=>!e||0===e.length;var cC=sC;const uC=(0,a.forwardRef)(((e,t)=>(0,a.createElement)(cC,i({ref:t},e,{__unstableDisableFormats:!0,preserveWhiteSpace:!0}))));uC.Content=e=>{let{value:t="",tagName:n="div",...o}=e;return(0,a.createElement)(n,o,t)};var dC=uC;var pC=(0,a.forwardRef)(((e,t)=>{let{__experimentalVersion:n,...o}=e;if(2===n)return(0,a.createElement)(dC,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 mC(e){let{property:t,viewport:n,desc:o}=e;const r=(0,d.useInstanceId)(mC),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 fC=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)(mC,{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)(mC,{property:n,viewport:e}),e))))))))};function gC(e){let{character:t,type:n,onUse:o}=e;const r=(0,a.useContext)(iC),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 hC(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 vC(e){let{inputType:t,onInput:n}=e;const o=(0,a.useContext)(aC),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 bC=(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 _C=(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?bC:sE,"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:sE}),(0,g.__)("Edit"))},{value:"navigation",label:(0,a.createElement)(a.Fragment,null,bC,(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 kC(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 yC=(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 EC 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:yC,label:(0,g.__)("Close"),onClick:this.toggle}),(0,a.createElement)(Oy,{value:e||"",onChange:t}),(0,a.createElement)(m.Button,{icon:Ny,label:(0,g.__)("Submit"),type:"submit"}))))}}var CC=EC;var SC=(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 wC="none",BC="custom",IC="media",xC="attachment",TC=["noreferrer","noopener"],NC=(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"})),PC=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),S=(0,a.useCallback)((()=>{t!==IC&&t!==xC||E(""),k(!0)})),w=(0,a.useCallback)((()=>{k(!1)})),B=(0,a.useCallback)((()=>{E(null),w(),f(!1)})),I=(0,a.useCallback)((()=>e=>{const t=C.current;t&&t.contains(e.target)||(f(!1),E(null),w())})),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)||BC;n({href:y,linkDestination:e})}w(),E(null),e.preventDefault()})),T=(0,a.useCallback)((()=>{n({linkDestination:wC,href:""})})),N=()=>{const e=[{linkDestination:IC,title:(0,g.__)("Media File"),url:"image"===r?l:void 0,icon:NC}];return"image"===r&&i&&e.push({linkDestination:xC,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(" ");TC.forEach((t=>{e.includes(t)||e.push(t)})),n=e.join(" ")}else{const e=(null!=d?d:"").split(" ").filter((e=>!1===TC.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)(xE,{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:BC}).linkDestination:wC,n({linkDestination:o,href:e})})(e.url),w()}},e.title))))},(!o||_)&&(0,a.createElement)(xE.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)(xE.LinkViewer,{className:"block-editor-format-toolbar__link-container-content",url:o,onEditLinkClick:S,urlLabel:L}),(0,a.createElement)(m.Button,{icon:SC,label:(0,g.__)("Remove link"),onClick:T}))))};function MC(e){let{children:t,viewLabel:n,className:o,isEnabled:r=!0,deviceType:l,setDeviceType:i}=e;if((0,d.useViewportMatch)("small","<"))return null;const s={className:c()(o,"block-editor-post-preview__dropdown-content"),position:"bottom left"},u={variant:"tertiary",className:"block-editor-post-preview__button-toggle",disabled:!r,children:n},p={"aria-label":(0,g.__)("View options")};return(0,a.createElement)(m.DropdownMenu,{className:"block-editor-post-preview__dropdown",popoverProps:s,toggleProps:u,menuProps:p,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:()=>i("Desktop"),icon:"Desktop"===l&&Ef},(0,g.__)("Desktop")),(0,a.createElement)(m.MenuItem,{className:"block-editor-post-preview__button-resize",onClick:()=>i("Tablet"),icon:"Tablet"===l&&Ef},(0,g.__)("Tablet")),(0,a.createElement)(m.MenuItem,{className:"block-editor-post-preview__button-resize",onClick:()=>i("Mobile"),icon:"Mobile"===l&&Ef},(0,g.__)("Mobile"))),t)))}function LC(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{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 RC=(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})),AC=window.wp.wordcount;var DC=(0,p.withSelect)((e=>{const{getMultiSelectedBlocks:t}=e(so);return{blocks:t()}}))((function(e){let{blocks:t}=e;const n=(0,AC.count)((0,r.serialize)(t),"words");return(0,a.createElement)("div",{className:"block-editor-multi-selection-inspector__card"},(0,a.createElement)(Du,{icon:vf,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 OC(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=Bf(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 zC(e,t){const n=(0,a.useMemo)((()=>e.reduce(((e,t)=>("core/list-item"!==t.name&&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)((()=>FC([t],o)),[t,o])}function FC(e,t){const n=[];for(const o of e)t(o.name)&&n.push(o),n.push(...FC(o.innerBlocks,t));return n}function VC(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 HC(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=Um(t),s=zC(n,o);return(0,a.createElement)("div",{className:"block-editor-block-inspector"},(0,a.createElement)(Ou,i),(0,a.createElement)(Lk,{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)(VC,{selectedBlock:l,key:e.clientId,block:e,blockTypes:n})))))}const GC=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=Um(t);return(0,a.createElement)("div",{className:"block-editor-block-inspector"},(0,a.createElement)(Ou,l),(0,a.createElement)(Lk,{blockClientId:t}),o&&(0,a.createElement)("div",null,(0,a.createElement)(m.PanelBody,{title:(0,g.__)("Styles")},(0,a.createElement)(vk,{scope:"core/block-inspector",clientId:t}),(0,r.hasBlockSupport)(n,"defaultStylePicker",!0)&&(0,a.createElement)(OC,{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)(UC,null)),(0,a.createElement)(RC,{key:"back"}))},UC=()=>{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 WC=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:l(a)||("contentOnly"===i(a)?a:void 0)}}),[]);if(n>1)return(0,a.createElement)("div",{className:"block-editor-block-inspector"},(0,a.createElement)(DC,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)(HC,{topLevelLockedBlock:s}):(0,a.createElement)(GC,{clientId:l,blockName:i.name}):t?(0,a.createElement)("span",{className:"block-editor-block-inspector__no-blocks"},(0,g.__)("No block selected.")):null};var $C=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)(Dm,{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)(Tm,{position:"bottom center",clientId:r[n+1],__experimentalIsQuick:!0}))))):null};function jC(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)(Om.Provider,{value:(0,a.useRef)(!1)},!s&&(0,a.createElement)(Fm,{__unstableContentRef:n}),!s&&(l||!r)&&(0,a.createElement)(xg,{isFixed:!0}),(0,a.createElement)(Ag,{__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)($C,{__unstableContentRef:n})))}const KC=()=>{};var qC=(0,a.forwardRef)((function(e,t){let{rootClientId:n,clientId:o,isAppender:r,showInserterHelpPanel:l,showMostUsedBlocks:i=!1,__experimentalInsertionIndex:s,__experimentalFilterValue:c,onSelect:u=KC,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)(wm,{onSelect:u,rootClientId:m,clientId:o,isAppender:r,showInserterHelpPanel:l,showMostUsedBlocks:i,__experimentalInsertionIndex:s,__experimentalFilterValue:c,shouldFocusBlock:d,prioritizePatterns:f,ref:t})}));function YC(){return null}YC.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 QC=YC;function ZC(){return V()("wp.blockEditor.MultiSelectScrollIntoView",{hint:"This behaviour is now built-in.",since:"5.8"}),null}const XC=new Set([ku.UP,ku.RIGHT,ku.DOWN,ku.LEFT,ku.ENTER,ku.BACKSPACE]);function JC(){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 eS(){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=JC(),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&&XC.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 tS=function(e){let{children:t}=e;return(0,a.createElement)("div",{ref:eS()},t)};const nS=-1!==window.navigator.userAgent.indexOf("Trident"),oS=new Set([ku.UP,ku.DOWN,ku.LEFT,ku.RIGHT]);function rS(){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(oS.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{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 lS=nS?e=>e.children:function(e){let{children:t}=e;return(0,a.createElement)("div",{ref:rS(),className:"block-editor__typewriter"},t)};const iS=(0,a.createContext)({});function aS(e){let{children:t,uniqueId:n,blockName:o=""}=e;const r=(0,a.useContext)(iS),{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)(iS.Provider,{value:i},t)}function sS(e){var t;let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const o=(0,a.useContext)(iS),{name:r}=mo();return n=n||r,Boolean(null===(t=o[n])||void 0===t?void 0:t.has(e))}var cS=(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 uS(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:cS,onClick:r})),n&&(0,a.createElement)(m.__experimentalText,null,n))}var dS=(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)(uS,{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,Ok.getSettings)().l10n.startOfWeek,__nextRemoveHelpButton:!0,__nextRemoveResetButton:!0,onChange:o},r)))}));const pS={button:"wp-element-button",caption:"wp-element-caption"},mS=e=>pS[e]?pS[e]:"";function fS(e,t){return Object.entries(t).every((t=>{let[n,o]=t;return"object"==typeof o&&"object"==typeof e[n]?fS(e[n],o):e[n]===o}))}const gS=(e,t)=>{if(!t||!e)return;const n=t.filter((t=>{let{attributes:n}=t;return!(!n||!Object.keys(n).length)&&fS(e,n)}));return 1===n.length?n[0]:void 0};function hS(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 vS(e,t){const n=e.split(/[(),]/g).filter(Boolean),o=n.slice(1).map((e=>hS(ES(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[2]?o[2]+"px":o[1]+"px";case"calc":return o[0]+"px"}}function bS(e){for(;;){const t=e,n=/(max|min|calc|clamp)\(([^()]*)\)/g.exec(e)||[];if(n[0]){const t=vS(n[0]);e=e.replace(n[0],t)}if(e===t||parseFloat(e))break}return hS(e)}function _S(e){for(let t=0;tr.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 ES(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=hS(e);return n.unit||(n=bS(e)),_S(e)&&!n.unit?kS(e):yS(n,t)}const CS={};function SS(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 wS=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=e+SS(t);return CS[n]||(CS[n]=ES(e,t)),CS[n]}}(),(window.wp=window.wp||{}).blockEditor=o}(); \ No newline at end of file + */,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;n3&&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 S(e){return C(e,(e=>(0,u.omit)(e,"attributes")))}function w(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(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:S(n.blocks),attributes:w(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,...S(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),...S(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,...w(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),...w(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{const n=e.blocks.byClientId[t];return n?{...n,attributes:$(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:Q(e,t)})),(e=>[e.blocks.order])),Q=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])),Z=A(((e,t)=>{const n=[];for(const o of t)for(const t of Ae(e,o))n.push(t,...Z(e,[t]));return n}),(e=>[e.blocks.order])),X=A((e=>{const t=[];for(const n of Ae(e))t.push(n,...Z(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=>j(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?j(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;e2&&void 0!==arguments[2]?arguments[2]:1;if(void 0===t&&(t=ce(e)),void 0===t&&(t=n<0?Ce(e):Se(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=>j(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 Se(e){const t=ye(e);return t[t.length-1]||null}function we(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=j(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=j(e,s.clientId),d=(0,r.getBlockType)(u.name),p=j(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&&oKe(e,t)))}function Ye(){return V()('wp.data.select( "core/block-editor" ).isCaretWithinFormattedText',{since:"6.1",version:"6.3"}),!1}function Qe(e){let t,n;const{insertionPoint:o,selection:{selectionEnd:r}}=e;if(null!==o)return o;const{clientId:l}=r;return l?(t=de(e,l)||void 0,n=De(e,r.clientId)+1):n=Ae(e).length,{rootClientId:t,index:n}}function Ze(e){return null!==e.insertionPoint}function Xe(e){return e.template.isValid}function Je(e){return e.settings.template}function et(e,t){if(!t)return e.settings.templateLock;const n=Bt(e,t);return n?n.templateLock: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:j.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=$(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=$(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=$(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*)[^])*)\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(j(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]])),St=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)])),wt=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 St(e,o,n)}),((e,t)=>[...St.getDependants(e,t)]));function Bt(e,t){return e.blockListSettings[t]}function It(e){return e.settings}function xt(e){return e.blocks.isPersistentChange}const Tt=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 $t(e){return e.temporarilyEditingAsBlocks}function jt(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(jt(e,n))return!0;n=e.blocks.parents[n]}return!1}var qt=window.wp.a11y;const Yt="†";function Qt(e){if(e)return Object.keys(e).find((t=>{const n=e[t];return"string"==typeof n&&-1!==n.indexOf(Yt)}))}const Zt=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:Zt(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=Zt(e),t=mn(Zt(t),i.getSettings());const s=i.getBlockRootClientId(e[0]);for(let e=0;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:Zt(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(Zt(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 Sn(){return{type:"HIDE_INSERTION_POINT"}}function wn(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],S=k.attributes[h.attributeKey];let w=(0,z.create)({html:y,...H(C)}),B=(0,z.create)({html:E,...H(S)});w=(0,z.remove)(w,g.offset,w.text.length),B=(0,z.insert)(B,Yt,0,h.offset);const I=(0,r.cloneBlock)(v,{[g.attributeKey]:(0,z.toHTMLString)({value:w,...H(C)})}),x=(0,r.cloneBlock)(_,{[h.attributeKey]:(0,z.toHTMLString)({value:B,...H(S)})}),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=Qt(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=Qt(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=Zt(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 $n(e,t){return{type:"SAVE_REUSABLE_BLOCK_SUCCESS",id:e,updatedId:t}}function jn(){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")}},Qn=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."))},Zn=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=Zt(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 So=(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 wo=(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).length1}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 $o=["color","border","typography","spacing"],jo={"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($o.includes(e))return void console.warn("Top level useSetting paths are disabled. Please use a subpath to query the information needed.");let l;const i=(e=>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=jo[i]?jo[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),S=(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}`},w=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.BaseControl.VisualLabel,{className:"components-spacing-sizes-control__side-label"},zo[r]),N&&(0,a.createElement)(m.BaseControl.VisualLabel,{className:"components-spacing-sizes-control__hint-single"},B)),"all"===r&&N&&(0,a.createElement)(m.BaseControl.VisualLabel,{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:w,disableUnits:i,label:T,hideLabelFromVision:!0,className:"components-spacing-sizes-control__custom-value-input",style:{gridColumn:"1"},size:"__unstable-large"}),(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(S(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,__nextHasNoMarginBottom:!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(S(e.selectedItem.key,"selectList"))},options:I,label:T,hideLabelFromVision:!0,__nextUnconstrainedWidth:!0,size:"__unstable-large"}))}function Qo(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 Zo(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:u,minimumCustomValue:d=0}=e;const p=[{name:0,slug:"0",size:0},...qo("spacing.spacingSizes")||[]];p.length>8&&p.unshift({name:(0,g.__)("Default"),slug:"default",size:void 0});const f=r||Fo,h=Uo(r),v=1===(null==l?void 0:l.length),[b,_]=(0,a.useState)(!h||!Go(f,l)||v),k={...t,onChange:e=>{const t={...r,...e};n(t)},isLinked:b,sides:l,values:f,spacingSizes:p,useSelect:u,type:o,minimumCustomValue:d};return(0,a.createElement)("fieldset",{role:"region",className:c()("component-spacing-sizes-control",{"is-unlinked":!b})},(0,a.createElement)(m.BaseControl.VisualLabel,{as:"legend"},o),!v&&(0,a.createElement)(nr,{onClick:()=>{_(!b)},isLinked:b}),b&&(0,a.createElement)(Qo,i({"aria-label":o},k)),!b&&s&&(0,a.createElement)(Jo,k),!b&&!s&&(0,a.createElement)(Zo,k))}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.useReducer)((e=>(e+1)%kr),0);(0,a.useLayoutEffect)((()=>{if(!g)return;const e=new window.MutationObserver(_);return e.observe(g,{attributes:!0}),()=>{e.disconnect()}}),[g]);const k=(0,a.useMemo)((()=>b<0||!g||h!==g?{}:{position:"absolute",width:g.offsetWidth,height:g.offsetHeight}),[g,h,l,b]),y=(0,a.useMemo)((()=>{if(!(b<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,b]);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:k},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 Sr(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 wr(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?`calc(${e} * -1)`:0,right:0!==t?`calc(${t} * -1)`:0,bottom:0!==n?`calc(${n} * -1)`:0,left:0!==o?`calc(${o} * -1)`: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)(Sr,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)(wr,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")}},$r=["top","center","bottom"],jr={isAlternate:!0};var Kr=function(e){let{value:t,onChange:n,controls:o=$r,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:jr}};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})),Qr={left:ko,center:yo,right:Eo,"space-between":Co};var Zr=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?Qr[r]:Qr.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)(Zr,i({},e,{isToolbar:!1})),Jr=e=>(0,a.createElement)(Zr,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:So,isPressed:"horizontal"===o,onClick:()=>n({...t,orientation:"horizontal"})}),(0,a.createElement)(m.Button,{label:(0,g.__)("Vertical"),icon:wo,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 Sl(){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 wl=(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:wl,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=Sl(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=Sl(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=Sl(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, you’ll 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 $l=(0,a.createContext)({});function jl(e){let{value:t,children:n}=e;const o=(0,a.useContext)($l),r=(0,a.useMemo)((()=>({...o,...t})),[o,t]);return(0,a.createElement)($l.Provider,{value:r,children:n})}var Kl=$l;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 Ql(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 Zl=(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:Zl,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"):wi()};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(Si))}function Si(){~_i&&(bi(Si),di.batchedUpdates(wi))}function wi(){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;ne.forEach(t);function Ri(e,t,n){if(Pi.arr(e))for(let o=0;oPi.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 $i=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 ji=new Set;let Ki=[],qi=[],Yi=0;const Qi={get idle(){return!ji.size&&!Ki.length},start(e){Yi>e.priority?(ji.add(e),di.onStart(Zi)):(Xi(e),di(ea))},advance:ea,sort(e){if(Yi)di.onFrame((()=>Qi.sort(e)));else{const t=Ki.indexOf(e);~t&&(Ki.splice(t,1),Ji(e))}},clear(){Ki=[],ji.clear()}};function Zi(){ji.forEach(Xi),ji.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;n0}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=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(cn){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;tBoolean(e&&e[ya]),Sa=e=>e&&e[ya]?e[ya]():e,wa=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=>Sa(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 $a=Ua(console.warn);function ja(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,Qa),Qa=[];function Za(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]=Sa(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(ja(e)?rs:os).create(e)}function cs(e){const t=Ja(e);return t?t.constructor:Pi.arr(e)?as:ja(e)?rs:os}function us(){return us=Object.assign?Object.assign.bind():function(e){for(var t=1;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!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 Ss(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 ws(e){return e=Sa(e),Pi.arr(e)?e.map(ws):ja(e)?$i.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&&!$i.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))?js(e.get()):t.every((e=>e.noop))?Ws(e.get()):$s(e.get(),t.every((e=>e.finished))),Ws=e=>({value:e,noop:!0,finished:!0,cancelled:!1}),$s=(e,t,n=!1)=>({value:e,finished:t,cancelled:n}),js=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)&&js(o)||r!==n.asyncId&&$s(o,!1);if(t)throw e.result=t,d(e),e},f=(e,t)=>{const l=new Ys,i=new Qs;return(async()=>{if($i.skipAnimation)throw qs(n),i.result=$s(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($i.skipAnimation)return qs(n),$s(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=$s(o.get(),!0,!1)}catch(e){if(e instanceof Ys)g=e.result;else{if(!(e instanceof Qs))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 Qs extends Error{constructor(){super("SkipAnimationSignal"),this.result=void 0}}const Zs=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 $i.to(this,e)}interpolate(...e){return Wa(`${Ga}The "interpolate" function is deprecated in v9 (use "to" instead)`),$i.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||Qi.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 Sa(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(Sa(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:nt,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=Sa(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=Sa(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",$s(this,ac(this,this.animation.to)),this))},resume:()=>{oc(this)&&(lc(this,!1),nc(this)&&this._resume(),Oi(i.resumeQueue),fc(this,"onResume",$s(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(js(this));const o=!Pi.und(e.to),r=!Pi.und(e.from);if(o||r){if(!(t.callId>this._lastToId))return n(js(this));this._lastToId=t.callId}const{key:l,defaultProps:i,animation: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=Sa(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($s(this,!0));const _=Pi.und(t.reset)?r&&!t.default:!Pi.und(d)&&vs(t.reset,l),k=_?d:this.get(),y=ws(u),E=Pi.num(y)||Pi.arr(y)||ja(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 S=b.constructor;let w=Ca(u),B=!1;if(!w){const e=_||!tc(this)&&p;(m||e)&&(B=Mi(ws(k),y),w=!B),(Mi(a.immediate,C)||C)&&Mi(g.decay,h)&&Mi(g.velocity,v)||(w=!0)}if(B&&nc(this)&&(a.changed&&!_?w=!0:w||this._stop(s)),!f&&((w||Ca(s))&&(a.values=b.getPayload(),a.toValues=Ca(u)?null:S==rs?[1]:Ai(y)),a.immediate!=C&&(a.immediate=C,C||_||this._set(s)),w)){const{onRest:e}=a;Li(pc,(e=>mc(this,t,e)));const o=$s(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)):w?this._start():nc(this)&&!m?this._pendingCalls.add(n):n(Ws(k))}_focus(e){const t=this.animation;e!==t.to&&(wa(this)&&this._detach(),t.to=e,wa(this)&&this._attach())}_attach(){let e=0;const{to:t}=this.animation;Ca(t)&&(Ta(t,this),Zs(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=Sa(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",$s(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(Sa(e.to)),e.immediate||(e.fromValues=e.values.map((e=>e.lastPosition))),nc(this)||(rc(this,!0),oc(this)||this._resume())}_resume(){$i.skipAnimation?this.finish():Qi.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?js(this.get()):$s(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=ws(t);return Mi(ws(e.get()),n)}function sc(e,t=e.loop,n=e.to){let o=hs(t);if(o){const r=!0!==o&&Ss(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=Ss(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):(Sc(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(js(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 Sc(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 Sc(e,t){Li(t,(t=>{Cc(e.springs,t,(t=>Ec(t,e)))}))}function wc(e,t){if(null==e)return{};var n,o,r={},l=Object.keys(e);for(o=0;o=0||(r[n]=e[n]);return r}const Bc=["children"],Ic=e=>{let{children:t}=e,n=wc(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{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){$a(`${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=Za(e)||0;function d(e,n){for(let r=e;r{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=Za(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(Sa):Ai(Sa(this.source));return this.calc(...e)}_start(){this.idle&&!Oc(this._active)&&(this.idle=!1,Li(ts(this),(e=>{e.done=!1})),$i.skipAnimation?(di.batchedUpdates((()=>this.advance())),zc(this)):Qi.start(this))}_attach(){let e=1;Li(Ai(this.source),(t=>{Ca(t)&&Ta(t,this),Zs(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,(Zs(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}))}$i.assign({createStringInterpolator:Ha,to:(e,t)=>new Ac(e,t)});Qi.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=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)||$c.hasOwnProperty(e)&&$c[e]?(""+t).trim():t+"px"}const Wc={};let $c={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 jc=["Webkit","Ms","Moz","O"];$c=Object.keys($c).reduce(((e,t)=>(jc.forEach((n=>e[((e,t)=>e+t.charAt(0).toUpperCase()+t.substring(1))(n,t)]=e[t])),e)),$c);const Kc=["x","y","z"],qc=/^(matrix|translate|scale|rotate|skew)/,Yc=/^(translate)/,Qc=/^(rotate|skew)/,Zc=(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=>Zc(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":Qc.test(t)?"deg":"";l.push(Ai(e)),i.push("rotate3d"===t?([e,t,o,r])=>[`rotate3d(${e},${t},${o},${Zc(r,n)})`,Xc(r,0)]:e=>[`${t}(${e.map((e=>Zc(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=Sa(n[0]),[l,i]=this.transforms[o](Pi.arr(r)?r:n.map(Sa));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"];$i.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)(eh);return(0,d.useRefEffect)((t=>{if(e)return e.observe(t),()=>{e.unobserve(t)}}),[e])}function Su(e){return(0,p.useSelect)((t=>{const{__unstableHasActiveBlockOverlayActive:n}=t(so);return n(e)}),[e])}function wu(){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=Su(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})]),S=mo();return f<2&&n===S.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}}}wu.save=r.__unstableGetBlockProps;const Bu=(0,a.createContext)();function Iu(e){let{children:t,isHtml:n,...o}=e;return(0,a.createElement)("div",wu(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)=>{const{updateBlockAttributes:o,insertBlocks:l,mergeBlocks:i,replaceBlocks:a,toggleSelection:s,__unstableMarkLastChangeAsPersistent:c,moveBlocksToPosition:u,removeBlock:d,selectBlock:p}=e(so);return{setAttributes(e){const{getMultiSelectedBlockClientIds:r}=n.select(so),l=r(),{clientId:i}=t,a=l.length?l:[i];o(a,e)},onInsertBlocks(e,n){const{rootClientId:o}=t;l(e,n,o)},onInsertBlocksAfter(e){const{clientId:o,rootClientId:r}=t,{getBlockIndex:i}=n.select(so),a=i(o);l(e,a+1,r)},onMerge(e){const{clientId:o,rootClientId:l}=t,{getPreviousBlockClientId:s,getNextBlockClientId:c,getBlock:m,getBlockAttributes:f,getBlockName:g,getBlockOrder:h}=n.select(so);if(e){if(l){const e=c(l);if(e){if(g(l)!==g(e))return void i(l,e);{const t=f(l),o=f(e);if(Object.keys(t).every((e=>t[e]===o[e])))return void n.batch((()=>{u(h(e),e,l),d(e,!1)}))}}}const e=c(o);if(!e)return;const t=(0,r.switchToBlockType)(m(e),"*");t&&t.length?a(e,t):i(o,e)}else{const e=s(o);if(e)i(e,o);else if(l){const e=s(l);if(e&&g(l)===g(e)){const t=f(l),o=f(e);if(Object.keys(t).every((e=>t[e]===o[e])))return void n.batch((()=>{u(h(l),l,e),d(l,!1)}))}const t=(0,r.switchToBlockType)(m(l),"*");t&&t.length&&n.batch((()=>{a(l,t),p(t[0].clientId,0)}))}}},onReplace(e,n,o){e.length&&!(0,r.isUnmodifiedDefaultBlock)(e[e.length-1])&&c(),a([t.clientId],e,n,o)},toggleSelection(e){s(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:S,isContentBlock:w,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)(Ql,{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);S&&!w&&(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":S&&w},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 / to quickly insert new blocks."),{kbd:(0,a.createElement)("kbd",null)}),(0,a.createInterpolateElement)((0,g.__)("Indent a list by pressing space at the beginning of a line."),{kbd:(0,a.createElement)("kbd",null)}),(0,a.createInterpolateElement)((0,g.__)("Outdent a list by pressing backspace 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)(nh,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 $u(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 ju(){const{initialPosition:e,isMultiSelecting:t,multiSelectedBlockClientIds:n,hasMultiSelection:o,selectedBlockClientId:r,isFullSelection:l}=(0,p.useSelect)($u,[]);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 S=(0,Wl.isRTL)(u)?!g:g,{keepCaretInsideBlock:w}=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)&&!w){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,S)&&!w){const e=Ku(u,S,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 Qu(){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 Zu(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;Zu(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),Zu(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(),ju(),Qu(),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,S,w]=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,S]),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,"html{height:auto!important;}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)(__playground_ControlledIframe,i({},p,{ref:(0,d.useMergeRefs)([t,x]),tabIndex:l,srcDoc:"",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&&w)})),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,Sd=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,wd=/^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=wd.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)||Sd.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=.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(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=S()||w());)!1!==t&&(n.push(t),f(n));return n}function p(t){const n=t.exec(e);if(!n)return;const o=n[0];return r(o),e=e.slice(o.length),n}function m(){p(/^\s*/)}function f(e){let t;for(e=e||[];t=g();)!1!==t&&e.push(t);return e}function g(){const t=l();if("/"!==e.charAt(0)||"*"!==e.charAt(1))return;let n=2;for(;""!==e.charAt(n)&&("*"!==e.charAt(n)||"/"!==e.charAt(n+1));)++n;if(n+=2,""===e.charAt(n-1))return 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 $d(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=$d(t[0]),!p(/^:\s*/))return s("property missing ':'");const n=p(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^\)]*?\)|[^};])+)/),o=e({type:"declaration",property:t.replace(Ud,""),value:n?$d(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 S(){if("@"===e[0])return function(){const e=l();let t=p(/^@([-\w]+)?keyframes\s*/);if(!t)return;const n=t[1];if(t=p(/^([-\w]+)\s*/),!t)return 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=$d(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:$d(t[1]),media:$d(t[2])})}()||function(){const e=l(),t=p(/^@supports *([^{]+)/);if(!t)return;const n=$d(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=$d(t[1]),o=$d(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 w(){const e=l(),t=h();return t?(f(),e({type:"rule",selectors:t,declarations:b()})):s("selector missing")}return jd(function(){const e=d();return{type:"stylesheet",stylesheet:{source:t.source,rules:e,parsingErrors:a}}}())}function $d(e){return e?e.replace(/^\s+|\s+$/g,""):""}function jd(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){jd(e,o)})):n&&"object"==typeof n&&jd(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=Qd;function Qd(e){this.options=e||{}}Qd.prototype.emit=function(e){return e},Qd.prototype.visit=function(e){return this[e.type](e)},Qd.prototype.mapVisit=function(e,t){let n="";t=t||"";for(let o=0,r=e.length;ot=>{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)(nh);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)(rh,{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 Sp=(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 wp(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:Sp})))))}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)(wp,{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(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 $p=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 jp=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]},Kp=n(4793),qp=n.n(Kp);const Yp=e=>e.name||"",Qp=e=>e.title,Zp=e=>e.description||"",Xp=e=>e.keywords||[],Jp=e=>e.category,em=()=>null;function tm(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return e=qp()(e),e=e.replace(/^\//,""),e=e.toLowerCase(),e}const nm=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return(0,u.words)(tm(e))},om=(e,t)=>e.filter((e=>!nm(t).some((t=>t.includes(e))))),rm=(e,t,n,o)=>{if(0===nm(o).length)return e;return lm(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}})},lm=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=nm(t);if(0===o.length)return e;const r=e.map((e=>[e,im(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 im(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{getName:o=Yp,getTitle:r=Qp,getDescription:l=Zp,getKeywords:i=Xp,getCategory:a=Jp,getCollection:s=em}=n,c=o(e),d=r(e),p=l(e),m=i(e),f=a(e),g=s(e),h=tm(t),v=tm(d);let b=0;if(h===v)b+=30;else if(v.startsWith(h))b+=20;else{const e=[c,d,p,...m,f,g].join(" "),t=(0,u.words)(h);0===om(t,e).length&&(b+=10)}if(0!==b&&c.startsWith("core/")){b+=c!==e.id?1:2}return b}function am(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 sm=function(e){let{filterValue:t,selectedCategory:n,patternCategories:o}=e;const r=(0,d.useDebounce)(qt.speak,500),[l,i]=jp({shouldFocusBlock:!0}),[s,,c]=zp(i,l),u=(0,a.useMemo)((()=>o.map((e=>e.name))),[o]),p=(0,a.useMemo)((()=>t?lm(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)(am,{filterValue:t,filteredBlockPatternsLength:p.length}),(0,a.createElement)(Lp,null,!f&&(0,a.createElement)($p,null),f&&(0,a.createElement)(Hp,{shownPatterns:m,blockPatterns:p,onClickPattern:c,isDraggable:!1})))};function cm(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)(sm,{filterValue:o,selectedCategory:l,patternCategories:n}))}var um=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)(cm,n))};function dm(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 pm=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)(dm,{rootClientId:t,onInsert:n,selectedCategory:p,populatedCategories:d}),l&&(0,a.createElement)(um,{initialCategory:p,patternCategories:d,onModalClose:()=>i(!1)}))},mm=window.wp.url;function fm(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)($p,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 gm=function(e){let{rootClientId:t,onInsert:n,onHover:o}=e;return(0,a.createElement)(a.Fragment,null,(0,a.createElement)(fm,{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,mm.addQueryArgs)("edit.php",{post_type:"wp_block"})},(0,g.__)("Manage Reusable blocks"))))};const{Fill:hm,Slot:vm}=(0,m.createSlotFill)("__unstableInserterMenuExtension");hm.Slot=vm;var bm=hm;const _m=[];var km=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]=jp({onSelect:n,rootClientId:r,clientId:l,isAppender:i,insertionIndex:s,shouldFocusBlock:v}),[E,C,S,w]=Mp(k,y),[B,,I]=zp(y,k),x=(0,a.useMemo)((()=>{if(0===c)return[];const e=lm(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=rm((0,u.orderBy)(E,["frecency"],["desc"]),C,S,t);return void 0!==T?e.slice(0,T):e}),[t,E,C,S,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:_m),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:w,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)($p,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)(bm.Slot,{fillProps:{onSelect:w,onHover:o,filterValue:t,hasItems:L,rootClientId:k}},(e=>e.length?e:L?null:(0,a.createElement)($p,null))))};const ym={name:"blocks",title:(0,g.__)("Blocks")},Em={name:"patterns",title:(0,g.__)("Patterns")},Cm={name:"reusable",title:(0,g.__)("Reusable")};var Sm=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(Em),e.push(ym),!l&&n&&e.push(Em),o&&e.push(Cm),e}),[l,ym,n,Em,o,Cm]);return(0,a.createElement)(m.TabPanel,{className:"block-editor-inserter__tabs",tabs:i,onSelect:r},t)};var wm=(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,S,w]=jp({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)=>{S(e,t,n),i()}),[S,i]),T=(0,a.useCallback)(((e,t)=>{S(e,{patternName:t}),i()}),[S,i]),N=(0,a.useCallback)((e=>{w(!!e),k(e)}),[w,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)(pm,{rootClientId:C,onInsert:T,onClickCategory:P,selectedCategory:y})),[C,T,P,y]),R=(0,a.useMemo)((()=>(0,a.createElement)(gm,{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)(km,{filterValue:v,onSelect:i,onHover:N,rootClientId:n,clientId:o,isAppender:r,__experimentalInsertionIndex:l,showBlockDirectory:!0,shouldFocusBlock:f})),O&&(0,a.createElement)(Sm,{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 Bm(e){let{onSelect:t,rootClientId:n,clientId:o,isAppender:r,prioritizePatterns:l}=e;const[i,s]=(0,a.useState)(""),[u,d]=jp({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)(km,{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 Im=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 xm 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=Im,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)(Bm,{onSelect:()=>{t()},rootClientId:n,clientId:o,isAppender:r,prioritizePatterns:s}):(0,a.createElement)(wm,{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 Tm=(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}))])(xm);var Nm=(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)(Tm,{rootClientId:l,position:"bottom right",isAppender:!0,__experimentalIsQuick:!0}))}));function Pm(e,t){let{rootClientId:n,className:o,onFocus:r,tabIndex:l}=e;return(0,a.createElement)(Tm,{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 Mm=(0,a.forwardRef)(((e,t)=>(V()("wp.blockEditor.ButtonBlockerAppender",{alternative:"wp.blockEditor.ButtonBlockAppender",since:"5.9"}),Pm(e,t))));var Lm=(0,a.forwardRef)(Pm);var Rm=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)(Nm,{rootClientId:t}):(0,a.createElement)(Lm,{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 Am=Number.MAX_SAFE_INTEGER;(0,a.createContext)();var Dm=function(e){let{previousClientId:t,nextClientId:n,children:o,__unstablePopoverSlot:r,__unstableContentRef:l,...s}=e;const[u,d]=(0,a.useReducer)((e=>(e+1)%Am),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),()=>{var e;null===(e=b.ownerDocument.defaultView)||void 0===e||e.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 Om=(0,a.createContext)();function zm(e){let{__unstablePopoverSlot:t,__unstableContentRef:n}=e;const{selectBlock:o,hideInsertionPoint:r}=(0,p.useDispatch)(so),l=(0,a.useContext)(Om),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)(Dm,{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)(Tm,{position:"bottom center",clientId:f,rootClientId:g,__experimentalIsQuick:!0,onToggle:e=>{l.current=e},onSelectOrClose:()=>{l.current=!1}}))))}function Fm(e){return(0,p.useSelect)((e=>e(so).isBlockInsertionPointVisible()),[])&&(0,a.createElement)(zm,e)}function Vm(){const e=(0,a.useContext)(Om),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 Hm="undefined"==typeof window?e=>{setTimeout((()=>e(Date.now())),0)}:window.requestIdleCallback||window.requestAnimationFrame,Gm="undefined"==typeof window?clearTimeout:window.cancelIdleCallback||window.cancelAnimationFrame;function Um(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 Wm(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=Um(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 $m(e){let{clientId:t,maximumLength:n,context:o}=e;return Wm({clientId:t,maximumLength:n,context:o})}var jm=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{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)(wp,{count:n.length,icon:u})},(e=>{let{onDraggableStart:n,onDraggableEnd:o}=e;return t({draggable:!0,onDragStart:n,onDragEnd:o})}))};var Km=(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 qm=(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 Ym=(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 Qm=(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 Zm=(e,t)=>"up"===e?"horizontal"===t?(0,g.isRTL)()?"right":"left":"up":"down"===e?"horizontal"===t?(0,g.isRTL)()?"left":"right":"down":null;function Xm(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=Zm("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=Zm("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=Zm("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=Zm("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=Zm("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=Zm("down",i);if("down"===e)return(0,g.sprintf)((0,g.__)("Block %1$s is at the end of the content and can’t be moved down"),t);if("left"===e)return(0,g.sprintf)((0,g.__)("Block %1$s is at the end of the content and can’t be moved left"),t);if("right"===e)return(0,g.sprintf)((0,g.__)("Block %1$s is at the end of the content and can’t be moved right"),t)}if(l<0&&!o){const e=Zm("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=Zm("up",i);if("up"===e)return(0,g.sprintf)((0,g.__)("Block %1$s is at the beginning of the content and can’t be moved up"),t);if("left"===e)return(0,g.sprintf)((0,g.__)("Block %1$s is at the beginning of the content and can’t be moved left"),t);if("right"===e)return(0,g.sprintf)((0,g.__)("Block %1$s is at the beginning of the content and can’t be moved right"),t)}}const Jm=(e,t)=>"up"===e?"horizontal"===t?(0,g.isRTL)()?Km:qm:Ym:"down"===e?"horizontal"===t?(0,g.isRTL)()?qm:Km:Qm:null,ef=(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,tf=(0,a.forwardRef)(((e,t)=>{let{clientIds:n,direction:o,orientation:l,...s}=e;const u=(0,d.useInstanceId)(tf),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:S}=(0,p.useDispatch)(so),w="up"===o?S: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:Jm(o,E),label:ef(o,E),"aria-describedby":B},s,{onClick:v?null:e=>{w(n,b),s.onClick&&s.onClick(e)},disabled:v,__experimentalIsFocusable:!0})),(0,a.createElement)(m.VisuallyHidden,{id:B},Xm(g,h&&h.title,y,_,k,"up"===o?-1:1,E)))})),nf=(0,a.forwardRef)(((e,t)=>(0,a.createElement)(tf,i({direction:"up",ref:t},e)))),of=(0,a.forwardRef)(((e,t)=>(0,a.createElement)(tf,i({direction:"down",ref:t},e))));var rf=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)(jm,{clientIds:t},(e=>(0,a.createElement)(m.Button,i({icon:Sp,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)(nf,i({clientIds:t},e)))),(0,a.createElement)(m.ToolbarItem,null,(e=>(0,a.createElement)(of,i({clientIds:t},e))))))};var lf=function(e){let{clientId:t,rootClientId:n}=e;const o=Um(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:S,getBlockIndex:w,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)(rf,{clientIds:[t],hideDragHandle:!0}),"navigation"===v&&(0,a.createElement)(jm,{clientIds:[t]},(e=>(0,a.createElement)(m.Button,i({icon:Sp,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=S();if(s&&O&&!e.defaultPrevented&&(R(null),e.preventDefault()),(c||u)&&O){const e=B(O),t=B(p),n=w(O);let o=w(p);n{!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=af(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=af(e.current).findIndex((e=>0===e.tabIndex));r(n)}}),[i,l])}var cf=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 sf(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:uf,setTimeout:df}=window,pf=()=>{},mf=200;function ff(e){let{ref:t,isFocused:n,debounceTimeout:o=mf,onChange:r=pf}=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&&uf&&uf(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=df((()=>{u()&&c(!1)}),o)}}}function gf(e){let{ref:t,debounceTimeout:n=mf,onChange:o=pf}=e;const[r,l]=(0,a.useState)(!1),{showMovers:i,debouncedShowMovers:s,debouncedHideMovers:c}=ff({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 hf(){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=Um(n),c=(0,a.useRef)(),{gestures:u}=gf({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"),null==s?void 0:s.title),showTooltip:!0,icon:(0,a.createElement)(Du,{icon:null==s?void 0:s.icon})}))}var vf=(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 bf(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 _f(e){let{restTransformations:t,onSelect:n,setHoveredTransformItemName:o}=e;return t.map((e=>(0,a.createElement)(kf,{key:e.name,item:e,onSelect:n,setHoveredTransformItemName:o})))}function kf(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 yf=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](0,a.createElement)(kf,{key:e.name,item:e,onSelect:o,setHoveredTransformItemName:s}))),!d&&p),!!d&&(0,a.createElement)(m.MenuGroup,{className:t},p))};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:"M16.7 7.1l-6.3 8.5-3.3-2.5-.9 1.2 4.5 3.4L17.9 8z"})),Cf=window.wp.tokenList,Sf=n.n(Cf);function wf(e,t,n){const o=new(Sf())(e);return t&&o.remove("is-style-"+t.name),o.add("is-style-"+n.name),o.value}function Bf(e){return(0,u.find)(e,"isDefault")}function If(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?Bf(e)?e:[{name:"default",label:(0,g._x)("Default","block style"),isDefault:!0},...e]:[]}(o),m=function(e,t){for(const n of new(Sf())(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=wf(s,m,e);c(t,{className:o}),n()},stylesToRender:d,activeStyle:m,genericPreviewBlock:f,className:s}}const xf=()=>{};function Tf(e){let{clientId:t,onSwitch:n=xf}=e;const{onSelect:o,stylesToRender:r,activeStyle:l}=If({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?Ef:null,onClick:()=>o(e)},(0,a.createElement)(m.__experimentalText,{as:"span",limit:18,ellipsizeMode:"tail",truncate:!0},t))}))):null}function Nf(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)(Tf,{clientId:o,onSwitch:n}))}const Pf=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=Pf(e,t,n);if(o)return o}}},Mf=(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 Lf=(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=Pf(r,t.name,o);if(n){e=!0,o.add(n.clientId),Mf(n,t);break}}if(!e)return}return n})(t,n.blocks);return o&&e.push({...n,transformedBlocks:o}),e}),[])),[e,t]);function Rf(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)(Af,{patterns:t,onSelect:n})))))}function Af(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)(Df,{key:e.name,pattern:e,onSelect:n,composite:o}))))}function Df(e){let{pattern:t,onSelect:n,composite:o}=e;const r="block-editor-block-switcher__preview-patterns-container",l=(0,d.useInstanceId)(Df,`${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 Of=function(e){let{blocks:t,patterns:n,onSelect:o}=e;const[r,l]=(0,a.useState)(!1),i=Lf(n,t);return i.length?(0,a.createElement)(m.MenuGroup,{className:"block-editor-block-switcher__pattern__transforms__menugroup"},r&&(0,a.createElement)(Rf,{patterns:i,onSelect:o}),(0,a.createElement)(m.MenuItem,{onClick:e=>{e.preventDefault(),l(!r)},icon:Km},(0,g.__)("Patterns"))):null};const zf=e=>{let{clientIds:t,blocks:n}=e;const{replaceBlocks:o}=(0,p.useDispatch)(so),l=Um(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:vf}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=Wm({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)(Of,{blocks:n,patterns:f,onSelect:e=>{(e=>{o(t,e)})(e),l()}}),_&&(0,a.createElement)(yf,{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)(Nf,{hoveredBlock:n[0],onSwitch:l}))})))))};var Ff=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)(zf,{clientIds:t,blocks:n})};const{Fill:Vf,Slot:Hf}=(0,m.createSlotFill)("__unstableBlockToolbarLastItem");Vf.Slot=Hf;var Gf=Vf;var Uf=(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"})),Wf=window.wp.blob;function $f(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 jf(){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 Kf(){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=jf();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(/
/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&&!$f(r,o)&&(o=r.map((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 qf=function(e){let{children:t}=e;return(0,a.createElement)("div",{ref:Kf()},t)};function Yf(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:S,setBlockMovingClientId:w,setNavigationMode:B,selectBlock:I}=(0,p.useDispatch)(so),x=jf();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]),w(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&&S(e[0]),x("copy",e)}})}const Qf=()=>{};var Zf=(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=Qf,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 Xf=(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:Jf,Slot:eg}=(0,m.createSlotFill)("__unstableBlockSettingsMenuFirstItem");Jf.Slot=eg;var tg=Jf;function ng(){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 og(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 rg(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 lg=(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 ig=(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 ag(e){return e.remove&&e.move?"all":!(!e.remove||e.move)&&"insert"}function sg(e){let{clientId:t,onClose:n}=e;const[o,l]=(0,a.useState)({move:!1,remove:!1}),{canEdit:i,canMove:s,canRemove:c}=rg(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=Um(t),y=(0,d.useInstanceId)(sg,"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?ag(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?ig:lg})),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?ig:lg})),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?ig:lg})),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 cg(e){let{clientId:t}=e;const{canLock:n,isLocked:o}=rg(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?lg:ig,onClick:l},i),r&&(0,a.createElement)(sg,{clientId:t,onClose:l}))}const{Fill:ug,Slot:dg}=(0,m.createSlotFill)("BlockSettingsMenuControls");function pg(e){let{...t}=e;return(0,a.createElement)(m.__experimentalStyleProvider,{document:document},(0,a.createElement)(ug,t))}pg.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}=rg(l[0]),d=1===l.length&&c,f=ng(),{isGroupable:g,isUngroupable:h}=f,v=(g||h)&&s;return(0,a.createElement)(dg,{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)(cg,{clientId:l[0]}),e,v&&(0,a.createElement)(og,i({},f,{onClose:null==t?void 0:t.onClose})))))};var mg=pg;const fg=()=>{},gg={className:"block-editor-block-settings-menu__popover",position:"bottom right",isAlternate:!0};function hg(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 vg=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:S,toggleBlockHighlight:w}=(0,p.useDispatch)(so),B=(0,a.useCallback)(n?async e=>{const t=await e;t&&t[0]&&n(t[0])}:fg,[n]),I=Wm({clientId:f,maximumLength:25}),x=(0,a.useCallback)(n?()=>{const e=k||y;e&&E.includes(f)&&!E.includes(e)&&n(e)}:fg,[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}=gf({ref:P,onChange(e){e&&v||w(h,e)}});return(0,a.createElement)(Yf,{clientIds:t,__experimentalUpdateSelection:!n},(e=>{let{canDuplicate:n,canInsertDefaultBlock:r,canMove:c,canRemove:p,onDuplicate:v,onInsertAfter:k,onInsertBefore:y,onRemove:E,onCopy:w,onMoveTo:I,blocks:T}=e;return(0,a.createElement)(m.DropdownMenu,i({icon:Uf,label:(0,g.__)("Options"),className:"block-editor-block-settings-menu",popoverProps:gg,noIcons:!0},s),(e=>{let{onClose:s}=e;return(0,a.createElement)(a.Fragment,null,(0,a.createElement)(m.MenuGroup,null,(0,a.createElement)(tg.Slot,{fillProps:{onClose:s}}),void 0!==h&&(0,a.createElement)(m.MenuItem,i({},M,{ref:P,icon:(0,a.createElement)(Du,{icon:_.icon}),onClick:()=>S(h)}),(0,g.sprintf)((0,g.__)("Select parent block (%s)"),_.title)),1===d&&(0,a.createElement)(Xf,{clientId:f}),(0,a.createElement)(hg,{blocks:T,onCopy:w}),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)(Zf,{clientId:f,onToggle:s})),(0,a.createElement)(mg.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 bg=function(e){let{clientIds:t,...n}=e;return(0,a.createElement)(m.ToolbarGroup,null,(0,a.createElement)(m.ToolbarItem,null,(e=>(0,a.createElement)(vg,i({clientIds:t,toggleProps:e},n)))))};function _g(e){let{clientId:t}=e;const n=Um(t),{canEdit:o,canMove:r,canRemove:l,canLock:i}=rg(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:ig,label:(0,g.sprintf)((0,g.__)("Unlock %s"),n.title),onClick:c})),s&&(0,a.createElement)(sg,{clientId:t,onClose:c})):null}var kg=(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 yg=(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 Eg=(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 Cg={group:{type:"constrained"},row:{type:"flex",flexWrap:"nowrap"},stack:{type:"flex",orientation:"vertical"}};var Sg=function(){const{blocksSelection:e,clientIds:t,groupingBlockName:n,isGroupable:o}=ng(),{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=Cg[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:kg,label:(0,g._x)("Group","verb"),onClick:c}),u&&(0,a.createElement)(m.ToolbarButton,{icon:yg,label:(0,g._x)("Row","single horizontal line"),onClick:()=>c("row")}),d&&(0,a.createElement)(m.ToolbarButton,{icon:Eg,label:(0,g._x)("Stack","verb"),onClick:()=>c("stack")}))};function wg(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 Bg=(0,a.createContext)("");var Ig=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}=gf({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,S=n.length>1,w=c()("block-editor-block-toolbar",E&&"is-showing-movers");return(0,a.createElement)("div",{className:w},!S&&!y&&!h&&(0,a.createElement)(hf,null),(0,a.createElement)("div",i({ref:b},k),(C||S)&&!h&&(0,a.createElement)(m.ToolbarGroup,{className:"block-editor-block-toolbar__block-controls"},(0,a.createElement)(Ff,{clientIds:n}),!S&&(0,a.createElement)(_g,{clientId:n[0]}),(0,a.createElement)(rf,{clientIds:n,hideDragHandle:t||u}))),C&&S&&(0,a.createElement)(Sg,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)(Bg.Provider,{value:null==l?void 0:l.name},(0,a.createElement)(Gf.Slot,null))),(0,a.createElement)(wg,{clientIds:n}),!h&&(0,a.createElement)(bg,{clientIds:n}))};var xg=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)(cf,i({focusOnMount:t,className:d,"aria-label":(0,g.__)("Block tools")},o),(0,a.createElement)(Ig,{hideDragHandle:n}))};const Tg={flip:!1,shift:!0},Ng={flip:!0,shift:!1};function Pg(e,t,n){if(!e||!t)return Tg;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?Tg:Ng}function Mg(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 Lg(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)(Mg,[]),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=!f&&"edit"===u&&o,E="navigation"===u||"zoom-out"===u,C="edit"===u&&!g&&b&&!m&&!y&&!f,S="edit"===u&&!C&&!g&&!o;(0,Yu.useShortcut)("core/block-editor/focus-toolbar",(()=>{_.current=!0,k(!0)}),{isDisabled:!S}),(0,a.useEffect)((()=>{_.current=!1}));const w=(0,a.useRef)(),B=function(e){let{contentElement:t,clientId:n}=e;const o=Lo(n),[r,l]=(0,a.useState)(0),[i,s]=(0,a.useState)((()=>Pg(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(Pg(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 E||C||y?(0,a.createElement)(a.Fragment,null,y&&(0,a.createElement)(yr,i({clientId:r||t,__unstableCoverTarget:!0,bottomClientId:h,className:c()("block-editor-block-list__block-side-inserter-popover",{"is-insertion-point-visible":v}),__unstablePopoverSlot:l,__unstableContentRef:s,resize:!1,shift:!1},B),(0,a.createElement)("div",{className:"block-editor-block-list__empty-block-inserter"},(0,a.createElement)(Tm,{position:"bottom right",rootClientId:n,clientId:t,__experimentalIsQuick:!0}))),(E||C)&&(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},B),C&&(0,a.createElement)(xg,{focusOnMount:_.current,__experimentalInitialIndex:w.current,__experimentalOnIndexChange:e=>{w.current=e},key:t}),E&&(0,a.createElement)(lf,{clientId:t,rootClientId:n}))):null}function Rg(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 Ag(e){let{__unstablePopoverSlot:t,__unstableContentRef:n}=e;const o=(0,p.useSelect)(Rg,[]);if(!o)return null;const{clientId:r,rootClientId:l,name:i,isEmptyDefaultBlock:s,capturingClientId:c}=o;return i?(0,a.createElement)(Lg,{clientId:r,rootClientId:l,isEmptyDefaultBlock:s,capturingClientId:c,__unstablePopoverSlot:t,__unstableContentRef:n}):null}function Dg(e){let{children:t}=e;const n=(0,a.useContext)(Om),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)(Fm,{__unstablePopoverSlot:"block-toolbar"},(0,a.createElement)(Ag,{__unstablePopoverSlot:"block-toolbar"}),t))}var Og=(0,d.createHigherOrderComponent)((e=>t=>{const{clientId:n}=mo();return(0,a.createElement)(e,i({},t,{clientId:n}))}),"withClientId");var zg=Og((e=>{let{clientId:t,showSeparator:n,isFloating:o,onAddBlock:r,isToggle:l}=e;return(0,a.createElement)(Lm,{className:c()({"block-list-appender__toggle":l}),rootClientId:t,showSeparator:n,isFloating:o,onAddBlock:r})}));var Fg=(0,d.compose)([Og,(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)(Nm,{rootClientId:t})}));const Vg=new WeakMap;const Hg=new WeakMap;function Gg(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&&re(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=Gg(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 Wg(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:i2&&void 0!==arguments[2]?arguments[2]:["top","bottom","left","right"];return r.forEach((r=>{const l=Wg(e,t,r);(void 0===n||l{const a=e.getBoundingClientRect(),[s,c]=$g(t,a,o);if(void 0===i||s0&&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=Ug(e,t),c=(0,d.useThrottle)((0,a.useCallback)(((t,o)=>{var i;const a=jg(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 qg(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)||(Vg.get(u)||Vg.set(u,[]),Vg.get(u).push([e,t]),window.queueMicrotask((()=>{var e;null!==(e=Vg.get(u))&&void 0!==e&&e.length&&u.batch((()=>{Vg.get(u).forEach((e=>{c(...e)})),Vg.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,isBlockSelected:i}=(0,p.useSelect)(so),{replaceInnerBlocks:s}=(0,p.useDispatch)(so),c=(0,p.useSelect)((t=>t(so).getBlocks(e)),[e]),{getBlocks:d}=(0,p.useSelect)(so),m=(0,a.useRef)(null);(0,a.useLayoutEffect)((()=>{window.queueMicrotask((()=>{const a=d(e),c=0===a.length||"all"===n||"contentOnly"===n,p=!(0,u.isEqual)(t,m.current);if(!c||!p)return;m.current=t;const f=(0,r.synchronizeBlocksWithTemplate)(a,t);(0,u.isEqual)(f,a)||s(e,f,0===a.length&&o&&0!==f.length&&i(e),l())}))}),[c,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){Hg.has(t)||Hg.set(t,new WeakMap);const n=Hg.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)(jl,{value:_},(0,a.createElement)(rh,{rootClientId:t,renderAppender:g,__experimentalAppenderTagName:f,__experimentalLayout:b,wrapperRef:c,placeholder:v}))}function Yg(e){return Vu(e),(0,a.createElement)(qg,e)}const Qg=(0,a.forwardRef)(((e,t)=>{const n=Zg({ref:t},e);return(0,a.createElement)("div",{className:"block-editor-inner-blocks"},(0,a.createElement)("div",n))}));function Zg(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{__unstableDisableDropZone:n}=t,{clientId:o}=mo(),l=(0,d.useViewportMatch)("medium","<"),{__experimentalCaptureToolbars:s,hasOverlay:u}=(0,p.useSelect)((e=>{if(!o)return{};const{getBlockName:t,isBlockSelected:n,hasSelectedInnerBlock:i,__unstableGetEditorMode:a}=e(so),s=t(o),c="navigation"===a()||l;return{__experimentalCaptureToolbars:e(r.store).hasBlockSupport(s,"__experimentalExposeControlsToChildren",!1),hasOverlay:"core/template"!==s&&!n(o)&&!i(o,!0)&&c}}),[o,l]),m=Kg({rootClientId:o}),f=(0,d.useMergeRefs)([e.ref,n?null:m]),g={__experimentalCaptureToolbars:s,...t},h=g.value&&g.onChange?Yg:qg;return{...e,ref:f,className:c()(e.className,"block-editor-block-list__layout",{"has-overlay":u}),children:o?(0,a.createElement)(h,i({},g,{clientId:o})):(0,a.createElement)(rh,t)}}Zg.save=r.__unstableGetInnerBlocksProps,Qg.DefaultBlockAppender=Fg,Qg.ButtonBlockAppender=zg,Qg.Content=()=>Zg.save().children;var Xg=Qg;const Jg=(0,a.createContext)(),eh=(0,a.createContext)();function th(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=Zg({ref:(0,d.useMergeRefs)([Uu(),Vm(),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)(Jg.Provider,{value:o},(0,a.createElement)(eh.Provider,{value:f},(0,a.createElement)("div",g)))}function nh(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=Hm(o))};return t=Hm(o),()=>Gm(t)}),[e])}(),(0,a.createElement)(Dg,null,(0,a.createElement)(po,{value:co},(0,a.createElement)(th,e)))}function oh(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)(Rm,{tagName:r,rootClientId:n,renderAppender:o}))}function rh(e){return(0,a.createElement)(p.AsyncModeProvider,{value:!1},(0,a.createElement)(oh,e))}function lh(e){return[...e].sort(((t,n)=>e.filter((e=>e===n)).length-e.filter((e=>e===t)).length)).shift()}function ih(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{flat:t,...n}=e;return t||lh(Object.values(n).filter(Boolean))||"px"}function ah(){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=lh(o),i=0===r||r?`${r}${l}`:void 0;return i}function sh(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=ah(e),n="string"!=typeof e&&isNaN(parseFloat(t));return n}function ch(e){if(!e)return!1;if("string"==typeof e)return!0;return!!Object.values(e).filter((e=>!!e||0===e)).length}function uh(e){let{onChange:t,selectedUnits:n,setSelectedUnits:o,values:r,...l}=e,s=ah(r);void 0===s&&(s=ih(n));const c=ch(r)&&sh(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}))}nh.__unstableElementContext=Jg;const dh={topLeft:(0,g.__)("Top left"),topRight:(0,g.__)("Top right"),bottomLeft:(0,g.__)("Bottom left"),bottomRight:(0,g.__)("Bottom right")};function ph(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(dh).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 mh(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 fh={topLeft:void 0,topRight:void 0,bottomLeft:void 0,bottomRight:void 0},gh={px:100,em:20,rem:20};function hh(e){let{onChange:t,values:n}=e;const[o,r]=(0,a.useState)(!ch(n)||!sh(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=ih(l),u=s&&s.find((e=>e.value===c)),d=(null==u?void 0:u.step)||1,[p]=(0,m.__experimentalParseQuantityAndUnitFromRawValue)(ah(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)(uh,{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:gh[c],initialPosition:0,withInputField:!1,onChange:e=>{t(void 0!==e?`${e}${c}`:void 0)},step:d})):(0,a.createElement)(ph,{min:0,onChange:t,selectedUnits:l,setSelectedUnits:i,values:n||fh,units:s}),(0,a.createElement)(mh,{onClick:()=>r(!o),isLinked:o})))}function vh(e){var t;const{attributes:{style:n},setAttributes:o}=e;return(0,a.createElement)(hh,{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 bh=(e,t,n)=>{if(t){const n=(0,u.find)(e,{slug:t});if(n)return n}return{color:n}},_h=(e,t)=>(0,u.find)(e,{color:t});function kh(e,t){if(e&&t)return`has-${(0,u.kebabCase)(t)}-${e}`}function yh(){return{disableCustomColors:!qo("color.custom"),disableCustomGradients:!qo("color.customGradient")}}function Eh(){const e=yh(),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 Ch="__experimentalBorder",Sh=["top","right","bottom","left"],wh=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}}}},Bh=(e,t,n)=>{let o;return e.some((e=>e.colors.some((e=>e[t]===n&&(o=e,!0))))),o},Ih=e=>{let{colors:t,namedColor:n,customColor:o}=e;if(n){const e=Bh(t,"slug",n);if(e)return e}if(!o)return{color:void 0};const r=Bh(t,"color",o);return r||{color:o}};function xh(e){const t=/var:preset\|color\|(.+)/.exec(e);return t&&t[1]?t[1]:null}function Th(e){const{attributes:t,clientId:n,setAttributes:o}=e,{style:l}=t,{colors:i}=Eh(),s=Nh(e.name),c=qo("border.color")&&Nh(e.name,"color"),u=qo("border.radius")&&Nh(e.name,"radius"),d=qo("border.style")&&Nh(e.name,"style"),p=qo("border.width")&&Nh(e.name,"width");if([!c,!u,!d,!p].every(Boolean)||!s)return null;const f=(0,r.getBlockSupport)(e.name,[Ch,"__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}=Ih({colors:t,namedColor:n});return e?{...r,color:e}:r}if(!r)return r;const l={...r};return Sh.forEach((e=>{var n;const o=xh(null===(n=l[e])||void 0===n?void 0:n.color);if(o){const{color:n}=Ih({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:wh,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}},Sh.forEach((t=>{var n;if(null!==(n=e[t])&&void 0!==n&&n.color){var o;const n=Ih({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=Ih({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:Ph(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)(vh,e)))}function Nh(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,Ch);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 Ph(e,t){return ar({...e,border:{...null==e?void 0:e.border,[t]:void 0}})}function Mh(e,t,n){if(!Nh(t,"color")||ur(t,Ch,"color"))return e;const o=Lh(n),r=c()(e.className,o);return e.className=r||void 0,e}function Lh(e){var t;const{borderColor:n,style:o}=e,r=kh("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 Rh=(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}=Eh();if(!Nh(m,"color")||ur(m,Ch,"color"))return(0,a.createElement)(e,t);const{color:b}=Ih({colors:v,namedColor:g}),{color:_}=Ih({colors:v,namedColor:xh(null==h||null===(n=h.border)||void 0===n||null===(o=n.top)||void 0===o?void 0:o.color)}),{color:k}=Ih({colors:v,namedColor:xh(null==h||null===(r=h.border)||void 0===r||null===(l=r.right)||void 0===l?void 0:l.color)}),{color:y}=Ih({colors:v,namedColor:xh(null==h||null===(s=h.border)||void 0===s||null===(c=s.bottom)||void 0===c?void 0:c.color)}),{color:E}=Ih({colors:v,namedColor:xh(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 S=t.wrapperProps;return S={...t.wrapperProps,style:{...null===(p=t.wrapperProps)||void 0===p?void 0:p.style,...C}},(0,a.createElement)(e,i({},t,{wrapperProps:S}))}));function Ah(e){if(e)return`has-${e}-gradient-background`}function Dh(e,t){const n=(0,u.find)(e,["slug",t]);return n&&n.gradient}function Oh(e,t){return(0,u.find)(e,["gradient",t])}function zh(e,t){const n=Oh(e,t);return n&&n.slug}function Fh(){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=zh(i,o);u(n,r?{[e]:r,[t]:void 0}:{[e]:void 0,[t]:o})}),[i,n,u]),m=Ah(s);let f;return f=s?Dh(i,s):c,{gradientClass:m,gradientValue:f,setGradient:d}}(0,l.addFilter)("blocks.registerBlockType","core/border/addAttributes",(function(e){return Nh(e,"color")?e.attributes.borderColor?e:{...e,attributes:{...e.attributes,borderColor:{type:"string"}}}:e})),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/border/addSaveProps",Mh),(0,l.addFilter)("blocks.registerBlockType","core/border/addEditProps",(function(e){if(!Nh(e,"color")||ur(e,Ch,"color"))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),Mh(o,e,n)},e})),(0,l.addFilter)("editor.BlockListBlock","core/border/with-border-color-palette-styles",Rh);const Vh=["colors","disableCustomColors","gradients","disableCustomGradients"],Hh={name:"color",title:"Solid",value:"color"},Gh={name:"gradient",title:"Gradient",value:"gradient"},Uh=[Hh,Gh];function Wh(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={[Hh.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:_}),[Gh.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:Uh,initialTabName:h?Gh.value:!!k&&Hh.value},(e=>C(e.value))),!y&&C(Hh.value),!k&&C(Gh.value))))}function $h(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)(Wh,i({},t,e))}var jh=function(e){return(0,u.every)(Vh,(t=>e.hasOwnProperty(t)))?(0,a.createElement)(Wh,e):(0,a.createElement)($h,e)};const Kh=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)},qh=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))},Yh=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)(qh,{colorValue:r,label:l}))};function Qh(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)(Kh,i({key:c,setting:e},p),(0,a.createElement)(m.Dropdown,{popoverProps:t,className:"block-editor-tools-panel-color-gradient-settings__dropdown",renderToggle:Yh(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)(jh,g)))}))})))}Dd([Od,Vd]);var Zh=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=_null==e?void 0:e.colorValue));(0,a.useEffect)((()=>{var e;if(!r||!f.length)return;if(!m.current)return;u(Xh(m.current).color);const t=null===(e=m.current)||void 0===e?void 0:e.querySelector("a");t&&t.innerText&&p(Xh(t).color);let n=m.current,o=Xh(n).backgroundColor;for(;"rgba(0, 0, 0, 0)"===o&&n.parentNode&&n.parentNode.nodeType===n.parentNode.ELEMENT_NODE;)n=n.parentNode,o=Xh(n).backgroundColor;s(o)}));const g=Eh();return(0,a.createElement)(hr,{__experimentalGroup:"color"},(0,a.createElement)(Qh,i({enableAlpha:t,panelId:o,settings:n,__experimentalIsItemGroup:!1,__experimentalHasMultipleOrigins:!0,__experimentalIsRenderedInSidebar:!0},g)),r&&(0,a.createElement)(Zh,{backgroundColor:l,textColor:c,enableAlphaChecker:t,linkColor:d}))}const ev="color",tv=e=>{const t=(0,r.getBlockSupport)(e,ev);return t&&(!0===t.link||!0===t.gradient||!1!==t.background||!1!==t.text)},nv=e=>{if("web"!==a.Platform.OS)return!1;const t=(0,r.getBlockSupport)(e,ev);return null!==t&&"object"==typeof t&&!!t.link},ov=e=>{const t=(0,r.getBlockSupport)(e,ev);return null!==t&&"object"==typeof t&&!!t.gradients},rv=e=>{const t=(0,r.getBlockSupport)(e,ev);return t&&!1!==t.background},lv=e=>{const t=(0,r.getBlockSupport)(e,ev);return t&&!1!==t.text},iv=(e,t)=>ar(sr(t,e,void 0)),av=e=>({textColor:void 0,style:iv(["color","text"],e.style)}),sv=e=>({style:iv(["elements","link","color","text"],e.style)}),cv=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 uv(e,t,n){var o,r,l,i,a,s;if(!tv(t)||ur(t,ev))return e;const u=ov(t),{backgroundColor:d,textColor:p,gradient:m,style:f}=n,g=e=>!ur(t,ev,e),h=g("text")?kh("color",p):void 0,v=g("gradients")?Ah(m):void 0,b=g("background")?kh("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 dv=(e,t)=>{const n=/var:preset\|color\|(.+)/.exec(t);return n&&n[1]?bh(e,n[1]).color:t};function pv(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"),S=qo("color.customGradient"),w=qo("color.background"),B=qo("color.link"),I=qo("color.text"),x=C||!h||(null==h?void 0:h.length)>0,T=S||!k||(null==k?void 0:k.length)>0,N=(0,a.useRef)(m);if((0,a.useEffect)((()=>{N.current=m}),[m]),!tv(p))return null;const P=nv(p)&&B&&x,M=lv(p)&&I&&x,L=rv(p)&&w&&x,R=ov(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=Dh(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=_h(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,[ev,"__experimentalDefaultControls"]),U=!("web"!==a.Platform.OS||z||null!=A&&null!==(t=A.color)&&void 0!==t&&t.gradient||!1===(0,r.getBlockSupport)(e.name,[ev,"enableContrastChecker"]));return(0,a.createElement)(Jh,{enableContrastChecking:U,clientId:e.clientId,enableAlpha:!0,settings:[...M?[{label:(0,g.__)("Text"),onColorChange:H("text"),colorValue:bh(b,D,null==A||null===(n=A.color)||void 0===n?void 0:n.text).color,isShownByDefault:null==G?void 0:G.text,resetAllFilter:av}]:[],...L||R?[{label:(0,g.__)("Background"),onColorChange:L?H("background"):void 0,colorValue:bh(b,O,null==A||null===(o=A.color)||void 0===o?void 0:o.background).color,gradientValue:F,onGradientChange:R?t=>{const n=zh(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:cv}]:[],...P?[{label:(0,g.__)("Link"),onColorChange:t=>{var n;const o=_h(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:dv(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:sv}]:[]]})}const mv=(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(!tv(o)||ur(o,ev))return(0,a.createElement)(e,t);const m={};var f,g;s&&!ur(o,ev,"text")&&(m.color=null===(f=bh(p,s))||void 0===f?void 0:f.color);l&&!ur(o,ev,"background")&&(m.backgroundColor=null===(g=bh(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}))})),fv={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 tv(e)?(e.attributes.backgroundColor||Object.assign(e.attributes,{backgroundColor:{type:"string"}}),e.attributes.textColor||Object.assign(e.attributes,{textColor:{type:"string"}}),ov(e)&&!e.attributes.gradient&&Object.assign(e.attributes,{gradient:{type:"string"}}),e):e})),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/color/addSaveProps",uv),(0,l.addFilter)("blocks.registerBlockType","core/color/addEditProps",(function(e){if(!tv(e)||ur(e,ev))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),uv(o,e,n)},e})),(0,l.addFilter)("editor.BlockListBlock","core/color/with-color-palette-styles",mv),(0,l.addFilter)("blocks.switchToBlockType.transformedBlock","core/color/addTransforms",(function(e,t,n,o){const r=e.name;return cr({linkColor:nv(r),textColor:lv(r),backgroundColor:rv(r),gradient:ov(r)},fv,e,t,n,o)}));const gv=[{name:(0,g._x)("Regular","font style"),value:"normal"},{name:(0,g._x)("Italic","font style"),value:"italic"}],hv=[{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"}],vv=(e,t)=>e?t?(0,g.__)("Appearance"):(0,g.__)("Font style"):(0,g.__)("Font weight");function bv(e){const{onChange:t,hasFontStyles:n=!0,hasFontWeights:o=!0,value:{fontStyle:r,fontWeight:l},...s}=e,c=n||o,u=vv(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 gv.forEach((t=>{let{name:n,value:o}=t;hv.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 gv.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 hv.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 _v=1.5,kv=.1;var yv=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 _v;default:return e}})(e.value,o);return{...e,value:r}},onChange:n,label:(0,g.__)("Line height"),placeholder:_v,step:kv,value:c,min:0})))};const Ev="typography.lineHeight";function Cv(e){var t;const{attributes:{style:n},setAttributes:o}=e;return(0,a.createElement)(yv,{__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 Sv(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!qo("typography.lineHeight");return!(0,r.hasBlockSupport)(e,Ev)||t}const wv="typography.__experimentalFontStyle",Bv="typography.__experimentalFontWeight";function Iv(e){var t,n;const{attributes:{style:o},setAttributes:r}=e,l=!xv(e),i=!Tv(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)(bv,{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 xv(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=(0,r.hasBlockSupport)(e,wv),n=qo("typography.fontStyle");return!t||!n}function Tv(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=(0,r.hasBlockSupport)(e,Bv),n=qo("typography.fontWeight");return!t||!n}function Nv(e){const t=xv(e),n=Tv(e);return t&&n}function Pv(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 Mv="typography.__experimentalFontFamily";function Lv(e,t,n){if(!(0,r.hasBlockSupport)(t,Mv))return e;if(ur(t,kb,"fontFamily"))return e;if(null==n||!n.fontFamily)return e;const o=new(Sf())(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 Rv(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)(Pv,{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 Av(e){let{name:t}=e;const n=qo("typography.fontFamilies");return!n||0===n.length||!(0,r.hasBlockSupport)(t,Mv)}(0,l.addFilter)("blocks.registerBlockType","core/fontFamily/addAttribute",(function(e){return(0,r.hasBlockSupport)(e,Mv)?(e.attributes.fontFamily||Object.assign(e.attributes,{fontFamily:{type:"string"}}),e):e})),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/fontFamily/addSaveProps",Lv),(0,l.addFilter)("blocks.registerBlockType","core/fontFamily/addEditProps",(function(e){if(!(0,r.hasBlockSupport)(e,Mv))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),Lv(o,e,n)},e}));const Dv=(e,t,n)=>{if(t){const n=(0,u.find)(e,{slug:t});if(n)return n}return{size:n}};function Ov(e,t){const n=(0,u.find)(e,{size:t});return n||{size:t}}function zv(e){if(e)return`has-${(0,u.kebabCase)(e)}-font-size`}var Fv=function(e){const t=qo("typography.fontSizes"),n=!qo("typography.customFontSize");return(0,a.createElement)(m.FontSizePicker,i({},e,{fontSizes:t,disableCustomFontSizes:n}))};const Vv="1600px",Hv="768px",Gv=1,Uv=.75,Wv="14px";function $v(e){let{minimumFontSize:t,maximumFontSize:n,fontSize:o,minimumViewPortWidth:r=Hv,maximumViewPortWidth:l=Vv,scaleFactor:i=Gv,minimumFontSizeFactor:a=Uv,minimumFontSizeLimit:s=Wv}=e;if(o){const e=jv(o);if(null==e||!e.unit)return null;const r=jv(s,{coerceTo:e.unit});if(null!=r&&r.value&&!t&&!n&&(null==e?void 0:e.value)<=(null==r?void 0:r.value))return null;if(n||(n=`${e.value}${e.unit}`),!t){const n=Kv(e.value*a,3);t=null!=r&&r.value&&n<(null==r?void 0:r.value)?`${r.value}${r.unit}`:`${n}${e.unit}`}}const c=jv(t),u=(null==c?void 0:c.unit)||"rem",d=jv(n,{coerceTo:u});if(!c||!d)return null;const p=jv(t,{coerceTo:"rem"}),m=jv(l,{coerceTo:u}),f=jv(r,{coerceTo:u});if(!m||!f||!p)return null;const g=Kv(f.value/100,3),h=Kv(g,3)+u,v=Kv(((d.value-c.value)/(m.value-f.value)*100||1)*i,3);return`clamp(${t}, ${`${p.value}${p.unit} + ((1vw - ${h}) * ${v})`}, ${n})`}function jv(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if("string"!=typeof e&&"number"!=typeof e)return null;isFinite(e)&&(e=`${e}px`);const{coerceTo:n,rootSizeValue:o,acceptableUnits:r}={coerceTo:"",rootSizeValue:16,acceptableUnits:["rem","px","em"],...t},l=null==r?void 0:r.join("|"),i=new RegExp(`^(\\d*\\.?\\d+)(${l}){1,1}$`),a=e.match(i);if(!a||a.length<3)return null;let[,s,c]=a,u=parseFloat(s);return"px"!==n||"em"!==c&&"rem"!==c||(u*=o,c=n),"px"!==c||"em"!==n&&"rem"!==n||(u/=o,c=n),"em"!==n&&"rem"!==n||"em"!==c&&"rem"!==c||(c=n),{value:Kv(u,3),unit:c}}function Kv(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3;const n=Math.pow(10,t);return Number.isFinite(e)?parseFloat(Math.round(e*n)/n):void 0}const qv="typography.fontSize";function Yv(e,t,n){if(!(0,r.hasBlockSupport)(t,qv))return e;if(ur(t,kb,"fontSize"))return e;const o=new(Sf())(e.className);o.add(zv(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=Dv(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)(Fv,{onChange:e=>{const t=Ov(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 Zv(){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,qv)||!n}const Xv=(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,qv)||ur(i,kb,"fontSize")||!s||null!=c&&null!==(n=c.typography)&&void 0!==n&&n.fontSize)return(0,a.createElement)(e,t);const d=Dv(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"),Jv={fontSize:[["fontSize"],["style","typography","fontSize"]]};(0,l.addFilter)("blocks.registerBlockType","core/font/addAttribute",(function(e){return(0,r.hasBlockSupport)(e,qv)?(e.attributes.fontSize||Object.assign(e.attributes,{fontSize:{type:"string"}}),e):e})),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/font/addSaveProps",Yv),(0,l.addFilter)("blocks.registerBlockType","core/font/addEditProps",(function(e){if(!(0,r.hasBlockSupport)(e,qv))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),Yv(o,e,n)},e})),(0,l.addFilter)("editor.BlockListBlock","core/font-size/with-font-size-inline-styles",Xv),(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,qv)},Jv,e,t,n,o)})),(0,l.addFilter)("blocks.registerBlockType","core/font-size/addEditPropsForFluidCustomFontSizes",(function(e){if(!(0,r.hasBlockSupport)(e,qv)||ur(e,kb,"fontSize"))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=e=>{var n,o,r;const l=t?t(e):{},i=null==l||null===(n=l.style)||void 0===n?void 0:n.fontSize,a=!(null===(o=(0,p.select)(so).getSettings().__experimentalFeatures)||void 0===o||null===(r=o.typography)||void 0===r||!r.fluid),s=i&&a?$v({fontSize:i}):null;return null===s?l:{...l,style:{...null==l?void 0:l.style,fontSize:s}}},e}),11);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:"M7 11.5h10V13H7z"}));var tb=(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 nb=(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 ob=[{name:(0,g.__)("None"),value:"none",icon:eb},{name:(0,g.__)("Underline"),value:"underline",icon:tb},{name:(0,g.__)("Strikethrough"),value:"line-through",icon:nb}];function rb(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"},ob.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 lb="typography.__experimentalTextDecoration";function ib(e){var t;const{attributes:{style:n},setAttributes:o}=e;return(0,a.createElement)(rb,{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 ab(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!(0,r.hasBlockSupport)(e,lb),n=qo("typography.textDecoration");return t||!n}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:"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 cb=(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 ub=(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 db=[{name:(0,g.__)("None"),value:"none",icon:eb},{name:(0,g.__)("Uppercase"),value:"uppercase",icon:sb},{name:(0,g.__)("Lowercase"),value:"lowercase",icon:cb},{name:(0,g.__)("Capitalize"),value:"capitalize",icon:ub}];function pb(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"},db.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 mb="typography.__experimentalTextTransform";function fb(e){var t;const{attributes:{style:n},setAttributes:o}=e;return(0,a.createElement)(pb,{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 gb(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!(0,r.hasBlockSupport)(e,mb),n=qo("typography.textTransform");return t||!n}function hb(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 vb="typography.__experimentalLetterSpacing";function bb(e){var t;const{attributes:{style:n},setAttributes:o}=e;return(0,a.createElement)(hb,{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 _b(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!(0,r.hasBlockSupport)(e,vb),n=qo("typography.letterSpacing");return t||!n}const kb="typography",yb=[Ev,qv,wv,Bv,Mv,lb,mb,vb];function Eb(e){const{clientId:t}=e,n=Av(e),o=Zv(e),l=Nv(e),i=Sv(e),s=ab(e),c=gb(e),u=_b(e),d=!xv(e),p=!Tv(e),f=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=[Nv(e),Zv(e),Sv(e),Av(e),ab(e),gb(e),_b(e)];return t.filter(Boolean).length===t.length}(e),h=Cb(e.name);if(f||!h)return null;const v=(0,r.getBlockSupport)(e.name,[kb,"__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)(Rv,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:vv(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)(Iv,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)(Cv,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)(bb,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)(ib,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)(fb,e)))}const Cb=e=>yb.some((t=>(0,r.hasBlockSupport)(e,t)));const Sb=[...yb,Ch,ev,Nr],wb=e=>Sb.some((t=>(0,r.hasBlockSupport)(e,t)));function Bb(){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 Ib={"__experimentalBorder.__experimentalSkipSerialization":["border"],"color.__experimentalSkipSerialization":[ev],[`${kb}.__experimentalSkipSerialization`]:[kb],[`${Nr}.__experimentalSkipSerialization`]:["spacing"]},xb={...Ib,[`${Nr}`]:["spacing.blockGap"]},Tb={gradients:"gradient"};function Nb(e,t,n){let o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:xb;if(!wb(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=Tb[e]||e;l=(0,u.omit)(l,[[...o,t]])}))})),e.style={...Bb(l),...e.style},e}const Pb=(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)(pv,t),(0,a.createElement)(Eb,t),(0,a.createElement)(Th,t),(0,a.createElement)(Lr,t)),(0,a.createElement)(e,t))}),"withToolbarControls"),Mb=(0,d.createHigherOrderComponent)((e=>t=>{var n,o;const l=`wp-elements-${(0,d.useInstanceId)(e)}`,s=ur(t.name,ev,"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)(nh.__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 wb(e)?(e.attributes.style||Object.assign(e.attributes,{style:{type:"object"}}),e):e})),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/style/addSaveProps",Nb),(0,l.addFilter)("blocks.registerBlockType","core/style/addEditProps",(function(e){if(!wb(e))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),Nb(o,e,n,Ib)},e})),(0,l.addFilter)("editor.BlockEdit","core/style/with-block-controls",Pb),(0,l.addFilter)("editor.BlockListBlock","core/editor/with-elements-styles",Mb);(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 Lb=(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 Rb=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:Lb}),(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 Ab=[];function Db(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 Ob(e){let{presetSetting:t,defaultSetting:n}=e;const o=!qo(n),r=qo(`${t}.custom`)||Ab,l=qo(`${t}.theme`)||Ab,i=qo(`${t}.default`)||Ab;return(0,a.useMemo)((()=>[...r,...l,...o?Ab:i]),[o,r,l,i])}function zb(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=Ob({presetSetting:"color.duotone",defaultSetting:"color.defaultDuotone"}),s=Ob({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)(Rb,{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 Fb=(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)(zb,t))}),"withDuotoneControls");const Vb=(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)(nh.__unstableElementContext);return(0,a.createElement)(a.Fragment,null,g&&(0,a.createPortal)((0,a.createElement)(Db,{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",Fb),(0,l.addFilter)("editor.BlockListBlock","core/editor/duotone/with-styles",Vb);const Hb="__experimentalLayout";function Gb(){var e,t;let n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};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}),[]),l=qo("layout")||{},{attributes:i={},name:a}=n,{layout:s}=i,{default:c}=(0,r.getBlockSupport)(a,Hb)||{},d=null!=s&&s.inherit||null!=s&&s.contentSize||null!=s&&s.wideSize?{...s,type:"constrained"}:s||c||{},m=[];var f,g;null!=l&&null!==(e=l.definitions)&&void 0!==e&&null!==(t=e[(null==d?void 0:d.type)||"default"])&&void 0!==t&&t.className&&m.push(null==l||null===(f=l.definitions)||void 0===f||null===(g=f[(null==d?void 0:d.type)||"default"])||void 0===g?void 0:g.className);return(null!=d&&d.inherit||null!=d&&d.contentSize||"constrained"===(null==d?void 0:d.type))&&o&&m.push("has-global-padding"),null!=d&&d.orientation&&m.push(`is-${(0,u.kebabCase)(d.orientation)}`),null!=d&&d.justifyContent&&m.push(`is-content-justification-${(0,u.kebabCase)(d.justifyContent)}`),null!=d&&d.flexWrap&&"nowrap"===d.flexWrap&&m.push("is-nowrap"),m}function Ub(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;const{attributes:o={},name:r}=t,{layout:l={},style:i={}}=o,a=null!=l&&l.inherit||null!=l&&l.contentSize||null!=l&&l.wideSize?{...l,type:"constrained"}:l||{},s=hl((null==a?void 0:a.type)||"default"),c=qo("layout")||{},u=qo("spacing.blockGap"),d=null!==u,p=null==s||null===(e=s.getLayoutStyle)||void 0===e?void 0:e.call(s,{blockName:r,selector:n,layout:l,layoutDefinitions:null==c?void 0:c.definitions,style:i,hasBlockGapSupport:d});return p}function Wb(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,Hb,{}),{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"),S=!b.type&&(y||_),w=!!_||!!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)||w,onChange:()=>t({layout:{type:"constrained"===(null==E?void 0:E.name)||w?"default":"constrained"}}),help:"constrained"===(null==E?void 0:E.name)||w?(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)($b,{type:k,onChange:e=>t({layout:{type:e}})}),E&&"default"!==E.name&&(0,a.createElement)(E.inspectorControls,{layout:b,onChange:B,layoutBlockSupport:c}),C&&S&&(0,a.createElement)(C.inspectorControls,{layout:b,onChange:B,layoutBlockSupport:c}))),!_&&E&&(0,a.createElement)(E.toolBarControls,{layout:b,onChange:B,layoutBlockSupport:c}))}function $b(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 jb=(0,d.createHigherOrderComponent)((e=>t=>{const{name:n}=t;return[(0,r.hasBlockSupport)(n,Hb)&&(0,a.createElement)(Wb,i({key:"layout"},t)),(0,a.createElement)(e,i({key:"edit"},t))]}),"withInspectorControls"),Kb=(0,d.createHigherOrderComponent)((e=>t=>{const{name:n,attributes:o,block:l}=t,s=(0,r.hasBlockSupport)(n,Hb),u=(0,p.useSelect)((e=>{const{getSettings:t}=e(so);return!!t().disableLayoutStyles})),m=s&&!u,f=(0,d.useInstanceId)(e),g=qo("layout")||{},h=(0,a.useContext)(nh.__unstableElementContext),{layout:v}=o,{default:b}=(0,r.getBlockSupport)(n,Hb)||{},_=null!=v&&v.inherit||null!=v&&v.contentSize||null!=v&&v.wideSize?{...v,type:"constrained"}:v||b||{},k=s?Gb(l):null,y=`.${(0,r.getBlockDefaultClassName)(n)}.wp-container-${f}`,E=null!==qo("spacing.blockGap");let C;if(m){var S;const e=hl((null==_?void 0:_.type)||"default");C=null==e||null===(S=e.getLayoutStyle)||void 0===S?void 0:S.call(e,{blockName:n,selector:y,layout:_,layoutDefinitions:null==g?void 0:g.definitions,style:null==o?void 0:o.style,hasBlockGapSupport:E})}const w=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:w})))}));function qb(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,Hb)&&(e.attributes={...e.attributes,layout:{type:"object"}}),e})),(0,l.addFilter)("editor.BlockListBlock","core/editor/layout/with-layout-styles",Kb),(0,l.addFilter)("editor.BlockEdit","core/editor/layout/with-inspector-controls",jb);const Yb=(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)(qb,{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",Yb);const Qb="metadata";function Zb(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 Xb(e){var t;const n=(null===(t=e.style)||void 0===t?void 0:t.border)||{};return{className:Lh(e)||void 0,style:Bb({border:n})}}function Jb(e){const{colors:t}=Eh(),n=Xb(e),{borderColor:o}=e;if(o){const e=Ih({colors:t,namedColor:o});n.style.borderColor=e.color}return n}function e_(e){var t,n,o,r,l,i;const{backgroundColor:a,textColor:s,gradient:u,style:d}=e,p=kh("background-color",a),m=kh("color",s),f=Ah(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:Bb({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||Zb(e,"name",!1)&&(e.attributes={...e.attributes,[Qb]:{type:"object"}}),e})),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/metadata/save-props",(function(e,t,n){return Zb(t)&&(e.metadata=n.metadata),e})),(0,l.addFilter)("blocks.registerBlockType","core/metadata/addLabelCallback",(function(e){return e.__experimentalLabel||Zb(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 t_={};function n_(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")||t_,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=e_(e);if(t){const e=bh(c,t);d.style.backgroundColor=e.color}if(o&&(d.style.background=Dh(u,o)),n){const e=bh(c,n);d.style.color=e.color}return d}function o_(e){const{style:t}=e;return{style:Bb({spacing:(null==t?void 0:t.spacing)||{}})}}function r_(e,t){var n;let o=(null==e||null===(n=e.style)||void 0===n?void 0:n.typography)||{};var r,l;t&&(o={...o,fontSize:$v({fontSize:null==e||null===(r=e.style)||void 0===r||null===(l=r.typography)||void 0===l?void 0:l.fontSize})});const i=Bb({typography:o}),a=null!=e&&e.fontFamily?`has-${(0,u.kebabCase)(e.fontFamily)}-font-family`:"";return{className:c()(a,zv(null==e?void 0:e.fontSize)),style:i}}function l_(e){const[t,n]=(0,a.useState)(e);return(0,a.useEffect)((()=>{e&&n(e)}),[e]),t}const i_=e=>{let[t,...n]=e;return t.toUpperCase()+n.join("")},a_=e=>(0,d.createHigherOrderComponent)((t=>n=>(0,a.createElement)(t,i({},n,{colors:e}))),"withCustomColorPalette"),s_=()=>(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 c_(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=i_(n),r=`custom${o}`;return e[`set${o}`]=this.createSetColor(n,r),e}),{})}createSetColor(e,t){return n=>{const o=_h(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=bh(r,o[l],o[`custom${i_(l)}`]),a=t[l];return(null==a?void 0:a.color)===i.color&&a?e[l]=a:e[l]={...i,class:kh(n,i.slug)},e}),{})}render(){return(0,a.createElement)(e,i({},this.props,{colors:void 0},this.state,this.setters,{colorUtils:this.colorUtils}))}}])}function u_(e){return function(){const t=a_(e);for(var n=arguments.length,o=new Array(n),r=0;r{let[t,...n]=e;return t.toUpperCase()+n.join("")};var f_=function(){for(var e=arguments.length,t=new Array(e),n=0;n(e[t]=`custom${m_(t)}`,e)),{});return(0,d.createHigherOrderComponent)((0,d.compose)([(0,d.createHigherOrderComponent)((e=>t=>{const n=qo("typography.fontSizes")||p_;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${m_(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=Dv(r,l,n[t]);return e[o]={...i,class:zv(l)},e}),{});return{...t,...i}}render(){return(0,a.createElement)(e,i({},this.props,{fontSizes:void 0},this.state,this.setters))}}]),"withFontSizes")};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:"M4 19.8h8.9v-1.5H4v1.5zm8.9-15.6H4v1.5h8.9V4.2zm-8.9 7v1.5h16v-1.5H4z"}));var h_=(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 v_=(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 b_=[{icon:g_,title:(0,g.__)("Align text left"),align:"left"},{icon:h_,title:(0,g.__)("Align text center"),align:"center"},{icon:v_,title:(0,g.__)("Align text right"),align:"right"}],__={position:"bottom right",isAlternate:!0};var k_=function(e){let{value:t,onChange:n,alignmentControls:o=b_,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:__};return(0,a.createElement)(f,i({icon:p?p.icon:(0,g.isRTL)()?v_:g_,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 y_=e=>(0,a.createElement)(k_,i({},e,{isToolbar:!1})),E_=e=>(0,a.createElement)(k_,i({},e,{isToolbar:!0})),C_=()=>{};var S_={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,C_),i=(0,a.useMemo)((()=>(e.trim()?rm(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))}}},w_=window.wp.apiFetch,B_=n.n(w_);var I_=(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 x_=(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 T_={name:"links",className:"block-editor-autocompleters__link",triggerPrefix:"[[",options:async e=>{let t=await B_()({path:(0,mm.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?I_:x_}),e.title)},getOptionCompletion(e){return(0,a.createElement)("a",{href:e.url},e.title)}};const N_=[];function P_(e){let{completers:t=N_}=e;const{name:n}=mo();return(0,a.useMemo)((()=>{let e=[...t,T_];return(n===(0,r.getDefaultBlockName)()||(0,r.getBlockSupport)(n,"__experimentalSlashInserter",!1))&&(e=[...e,S_]),(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 M_=function(e){return(0,a.createElement)(m.Autocomplete,i({},e,{completers:P_(e)}))};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:"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 R_=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:L_,label:n,onClick:()=>o(!t),disabled:r})};const A_=()=>{};var D_=function(e){const{label:t=(0,g.__)("Change matrix alignment"),onChange:n=A_,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 O_=(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 z_=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:O_,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)($m,{clientId:e,maximumLength:35})),(0,a.createElement)(ul,{icon:O_,className:"block-editor-block-breadcrumb__separator"})))),!!r&&(0,a.createElement)("li",{className:"block-editor-block-breadcrumb__current","aria-current":"true"},(0,a.createElement)($m,{clientId:r,maximumLength:35})))};const F_=()=>(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"})),V_=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)(F_,null)))},H_=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)(V_,null)))}))}};var G_=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:H_(n),renderContent:()=>t})};var U_=(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 W_=ou(m.__experimentalTreeGridRow);function $_(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)(W_,i({ref:p,className:c()("block-editor-list-view-leaf",s),level:o,positionInSet:n,setSize:r},d),l)}var j_=(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 K_(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)()?j_:O_}))}var q_=(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=Um(o),g=Wm({clientId:o,context:"list-view"}),{isLocked:h}=rg(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)(K_,{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:ig})))))}));const Y_=(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)(jm,{clientIds:y},(e=>{let{draggable:c,onDragStart:p,onDragEnd:f}=e;return(0,a.createElement)(q_,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 Q_=Y_;const Z_=(0,a.createContext)({}),X_=()=>(0,a.useContext)(Z_);var J_=(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),[S,w]=(0,a.useState)(!1),{clientId:B}=n,{isLocked:I,isContentLocked:x}=rg(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=Um(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}=X_(),U=b&&v>0,W=c()("block-editor-list-view-block__mover-cell",{"is-visible":S||l}),$=c()("block-editor-list-view-block__menu-cell",{"is-visible":S||N});(0,a.useEffect)((()=>{!V&&l&&C.current.focus()}),[]);const j=(0,a.useCallback)((()=>{w(!0),M(B,!0)}),[B,w,M]),K=(0,a.useCallback)((()=>{w(!1),M(B,!1)}),[B,w,M]),q=(0,a.useCallback)((e=>{s(e,B),e.preventDefault()}),[B,s]),Y=(0,a.useCallback)((e=>{s(void 0,e)}),[s]),Q=(0,a.useCallback)((e=>{e.preventDefault(),e.stopPropagation(),!0===k?G(B):!1===k&&H(B)}),[B,H,G,k]);let Z;U?Z=2:A||(Z=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)($_,{className:X,onMouseEnter:j,onMouseLeave:K,onFocus:j,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:Z,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)(Q_,{block:n,onClick:q,onToggleExpanded:Q,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)(nf,{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)(of,{orientation:"vertical",clientIds:[B],ref:t,tabIndex:n,onFocus:o})})))),A&&(0,a.createElement)(m.__experimentalTreeGridCell,{className:$,"aria-selected":!!l||T},(e=>{let{ref:t,tabIndex:n,onFocus:o}=e;return(0,a.createElement)(vg,{clientIds:J,icon:Uf,label:F,toggleProps:{ref:t,className:"block-editor-list-view-block__menu",tabIndex:n,onFocus:o},disableOpenOnArrowDown:!0,__experimentalSelectBlock:Y})})))}));function ek(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(tk(t,n,o),0):1}const tk=(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+ek(r,e,t,n):o+1};function nk(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}=X_();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+=ek(b[t-1],h,v,d));const{itemInView:y}=u,E=y(k),C=t+1,S=i.length>0?`${i}_${C}`:`${C}`,w=!(null==g||!g.length),B=w&&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&&w;return(0,a.createElement)(p.AsyncModeProvider,{key:m,value:!T},x&&(0,a.createElement)(J_,{block:e,selectBlock:n,isSelected:T,isBranchSelected:N,isDragged:I,level:l,position:C,rowCount:_,siblingBlockCount:_,showBlockMovers:o,path:S,isExpanded:B,listPosition:k,selectedClientIds:r}),!x&&(0,a.createElement)("tr",null,(0,a.createElement)("td",{className:"block-editor-list-view-placeholder"})),w&&B&&!I&&(0,a.createElement)(nk,{parentId:m,blocks:g,selectBlock:n,showBlockMovers:o,level:l+1,path:S,listPosition:k+1,fixedListWindow:u,isBranchSelected:N,selectedClientIds:r,isExpanded:d}))})))}nk.defaultProps={selectBlock:()=>{}};var ok=(0,a.memo)(nk);function rk(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 lk(){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 S=f.filter((e=>!C.includes(e)));let w;if(1===S.length){var B;const e=null===(B=m(o(S[0])))||void 0===B?void 0:B.title;e&&(w=(0,g.sprintf)((0,g.__)("%s deselected."),e))}else S.length>1&&(w=(0,g.sprintf)((0,g.__)("%s blocks deselected."),S.length));w&&(0,qt.speak)(w)}),[e,o,m,l,i,s,c,u,d,t,n]);return{updateBlockSelection:f}}function ik(e,t){return t.left<=e.x&&t.right>=e.x&&t.top<=e.y&&t.bottom>=e.y}const ak=["top","bottom"];function sk(){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=Ug(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]=$g(t,a,ak),u=ik(t,a);if(void 0===r||s0||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 ck=(e,t)=>Array.isArray(t.clientIds)?{...e,...t.clientIds.reduce(((e,n)=>({...e,[n]:"expand"===t.type})),{})}:e;var uk=(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}=lk(),[v,b]=(0,a.useReducer)(ck,{}),{ref:_,target:k}=sk(),y=(0,a.useRef)(),E=(0,d.useMergeRefs)([y,_,t]),C=(0,a.useRef)(!1),{setSelectedTreeId:S}=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}),w=(0,a.useCallback)(((e,t)=>{h(e,t),S(t)}),[S,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)(rk,{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)(Z_.Provider,{value:M},(0,a.createElement)(ok,{blocks:i,selectBlock:w,showBlockMovers:r,fixedListWindow:B,selectedClientIds:c,isExpanded:l,shouldShowInnerBlocks:f}))))}));function dk(e){let{isEnabled:t,onToggle:n,isOpen:o,innerRef:r,...l}=e;return(0,a.createElement)(m.Button,i({},l,{ref:r,icon:U_,"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 pk=(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)(dk,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)(uk,null))})}));function mk(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=wf(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 fk(e){let{children:t,scope:n,...o}=e;return(0,a.createElement)(m.Fill,{name:`BlockStylesPreviewPanel/${n}`},(0,a.createElement)("div",o,t))}const gk=()=>{};function hk(e){let{clientId:t,onSwitch:n=gk,onHoverClassName:o=gk,scope:r}=e;const{onSelect:l,stylesToRender:i,activeStyle:s,genericPreviewBlock:p,className:f}=If({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)(fk,{scope:r,className:"block-editor-block-styles__preview-panel",style:{top:v},onMouseLeave:()=>y(null)},(0,a.createElement)(mk,{activeStyle:s,className:f,genericPreviewBlock:p,style:g})))}hk.Slot=function(e){let{scope:t}=e;return(0,a.createElement)(m.Slot,{name:`BlockStylesPreviewPanel/${t}`})};var vk=hk;var bk=(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 _k=function(e){let{icon:t=bk,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 kk=(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 yk="carousel",Ek="grid",Ck=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")))},Sk=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:qm,label:(0,g.__)("Previous pattern"),onClick:t,disabled:0===o}),(0,a.createElement)(m.Button,{icon:Km,label:(0,g.__)("Next pattern"),onClick:n,disabled:o===r-1}))};var wk=e=>{let{viewMode:t,setViewMode:n,handlePrevious:o,handleNext:r,activeSlide:l,totalSlides:i,onBlockPatternSelect:s}=e;const c=t===yk,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(yk),isPressed:c}),(0,a.createElement)(m.Button,{icon:kk,label:(0,g.__)("Grid view"),onClick:()=>n(Ek),isPressed:t===Ek}));return(0,a.createElement)("div",{className:"block-editor-block-pattern-setup__toolbar"},c&&(0,a.createElement)(Sk,{handlePrevious:o,handleNext:r,activeSlide:l,totalSlides:i}),u,c&&(0,a.createElement)(Ck,{onBlockPatternSelect:s}))};var Bk=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 Ik=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===yk){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)(Tk,{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)(xk,{key:e.name,pattern:e,onSelect:r,composite:l})))))};function xk(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)(xk,`${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 Tk(e){let{className:t,pattern:n,minHeight:o}=e;const{blocks:r,title:l,description:i}=n,s=(0,d.useInstanceId)(Tk,"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 Nk=e=>{let{clientId:t,blockName:n,filterPatternsFn:o,onBlockPatternSelect:l}=e;const[i,s]=(0,a.useState)(yk),[c,u]=(0,a.useState)(0),{replaceBlock:d}=(0,p.useDispatch)(so),m=Bk(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)(Ik,{viewMode:i,activeSlide:c,patterns:m,onBlockPatternSelect:f}),(0,a.createElement)(wk,{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 Pk(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 Mk(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:Qm,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 Lk=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?Pk:Mk;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})},Rk=(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"),Ak=Rk(m.ColorPalette);function Dk(e){let{onChange:t,value:n,...o}=e;return(0,a.createElement)(jh,i({},o,{onColorChange:t,colorValue:n,gradients:[],disableCustomGradients:!0}))}var Ok=window.wp.date;const zk=new Date(2022,0,25);function Fk(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,Ok.dateI18n)(n,zk))),checked:!t,onChange:e=>o(e?null:n)}),t&&(0,a.createElement)(Vk,{format:t,onChange:o}))}function Vk(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,Ok.dateI18n)(e,zk),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 format string."),{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 Hk=["colors","disableCustomColors","gradients","disableCustomGradients"],Gk=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)(Gk),{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)(Qh,{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))},Uk=e=>{const t=yh();return t.colors=qo("color.palette"),t.gradients=qo("color.gradients"),(0,a.createElement)(Gk,i({},t,e))},Wk=e=>{const t=Eh();return(0,a.createElement)(Gk,i({},t,e))};var $k=e=>(0,u.every)(Hk,(t=>e.hasOwnProperty(t)))?(0,a.createElement)(Gk,e):e.__experimentalHasMultipleOrigins?(0,a.createElement)(Wk,e):(0,a.createElement)(Uk,e),jk=function(e,t){return jk=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])},jk(e,t)};var Kk=function(){return Kk=Object.assign||function(e){for(var t,n=1,o=arguments.length;nu*r?{width:u*r,height:u}:{width:c,height:c/r}}function Zk(e,t,n,o,r){void 0===r&&(r=0);var l=ay(t.width,t.height,r),i=l.width,a=l.height;return{x:Xk(e.x,i,n.width,o),y:Xk(e.y,a,n.height,o)}}function Xk(e,t,n,o){var r=t*o/2-n/2;return sy(e,-r,r)}function Jk(e,t){return Math.sqrt(Math.pow(e.y-t.y,2)+Math.pow(e.x-t.x,2))}function ey(e,t){return 180*Math.atan2(t.y-e.y,t.x-e.x)/Math.PI}function ty(e,t,n,o,r,l,i){void 0===l&&(l=0),void 0===i&&(i=!0);var a=i?ny:oy,s=ay(t.width,t.height,l),c=ay(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:Kk(Kk({},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 ny(e,t){return Math.min(e,Math.max(0,t))}function oy(e,t){return t}function ry(e,t,n,o,r,l){var i=ay(t.width,t.height,n),a=sy(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 ly(e,t,n,o,r,l){void 0===n&&(n=0);var i=ay(t.naturalWidth,t.naturalHeight,n),a=sy(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 iy(e,t){return{x:(t.x+e.x)/2,y:(t.y+e.y)/2}}function ay(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 sy(e,t,n){return Math.min(Math.max(e,t),n)}function cy(){for(var e=[],t=0;t0})).join(" ").trim()}var uy=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.gestureZoomStart=0,n.gestureRotationStart=0,n.isTouching=!1,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.currentDoc.removeEventListener("gesturemove",n.onGestureMove),n.currentDoc.removeEventListener("gestureend",n.onGestureEnd)},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=ry(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=ly(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.offsetWidthd?{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=Kk(Kk({},p),{naturalWidth:c,naturalHeight:u}),n.props.setMediaSize&&n.props.setMediaSize(n.mediaSize);var m=n.props.cropSize?n.props.cropSize:Qk(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.isTouching=!0,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.onGestureStart=function(e){e.preventDefault(),n.currentDoc.addEventListener("gesturechange",n.onGestureMove),n.currentDoc.addEventListener("gestureend",n.onGestureEnd),n.gestureZoomStart=n.props.zoom,n.gestureRotationStart=n.props.rotation},n.onGestureMove=function(e){if(e.preventDefault(),!n.isTouching){var o=t.getMousePoint(e),r=n.gestureZoomStart-1+e.scale;if(n.setNewZoom(r,o,{shouldUpdatePosition:!0}),n.props.onRotationChange){var l=n.gestureRotationStart+e.rotation;n.props.onRotationChange(l)}}},n.onGestureEnd=function(e){n.cleanEvents()},n.onDragStart=function(e){var t,o,r=e.x,l=e.y;n.dragStartPosition={x:r,y:l},n.dragStartCrop=Kk({},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?Zk(l,n.mediaSize,n.state.cropSize,n.props.zoom,n.props.rotation):l;n.props.onCropChange(i)}}))},n.onDragStopped=function(){var e,t;n.isTouching=!1,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=Yk()(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=sy(e,n.props.minZoom,n.props.maxZoom);if(l){var a=n.getPointOnContainer(t),s=n.getPointOnMedia(a),c={x:s.x*i-a.x,y:s.y*i-a.y},u=n.props.restrictPosition?Zk(c,n.mediaSize,n.state.cropSize,i,n.props.rotation):c;n.props.onCropChange(u)}n.props.onZoomChange(i)}},n.getCropData=function(){return n.state.cropSize?ty(n.props.restrictPosition?Zk(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?Zk(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}jk(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.onGestureStart)),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.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=Jk(n,o),this.lastPinchRotation=ey(n,o),this.onDragStart(iy(n,o))},t.prototype.onPinchMove=function(e){var n=this,o=t.getTouchPoint(e.touches[0]),r=t.getTouchPoint(e.touches[1]),l=iy(o,r);this.onDrag(l),this.rafPinchTimeout&&this.currentWindow.cancelAnimationFrame(this.rafPinchTimeout),this.rafPinchTimeout=this.currentWindow.requestAnimationFrame((function(){var e=Jk(o,r),t=n.props.zoom*(e/n.lastPinchDistance);n.setNewZoom(t,l,{shouldUpdatePosition:!1}),n.lastPinchDistance=e;var i=ey(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:cy("reactEasyCrop_Container",b)},n?Ti().createElement("img",Kk({alt:"",className:cy("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:Kk(Kk({},h),{transform:l||"translate("+a+"px, "+s+"px) rotate("+c+"deg) scale("+u+")"}),onLoad:this.onMediaLoad})):o&&Ti().createElement("video",Kk({autoPlay:!0,loop:!0,muted:!0,className:cy("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:Kk(Kk({},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",Kk({key:e.src},e))}))),this.state.cropSize&&Ti().createElement("div",{style:Kk(Kk({},g),{width:this.state.cropSize.width,height:this.state.cropSize.height}),"data-testid":"cropper",className:cy("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),dy=uy;const py={position:"bottom right",isAlternate:!0};function my(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(n/o),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(n.width/n.height),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 fy=(0,a.createContext)({}),gy=()=>(0,a.useContext)(fy);function hy(e){let{id:t,url:n,naturalWidth:o,naturalHeight:r,isEditing:l,onFinishEditing:i,onSaveImage:s,children:c}=e;const u=my({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,B_()({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)(fy.Provider,{value:m},c)}function vy(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:_}=gy();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)(dy,{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 by=(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 _y(){const{isInProgress:e,zoom:t,setZoom:n}=gy();return(0,a.createElement)(m.Dropdown,{contentClassName:"wp-block-image__zoom",popoverProps:py,renderToggle:t=>{let{isOpen:n,onToggle:o}=t;return(0,a.createElement)(m.ToolbarButton,{icon:by,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 ky=(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 yy(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?Ef:void 0},t)})))}function Ey(e){let{toggleProps:t}=e;const{isInProgress:n,aspect:o,setAspect:r,defaultAspect:l}=gy();return(0,a.createElement)(m.DropdownMenu,{icon:ky,label:(0,g.__)("Aspect Ratio"),popoverProps:py,toggleProps:t,className:"wp-block-image__aspect-ratio"},(e=>{let{onClose:t}=e;return(0,a.createElement)(a.Fragment,null,(0,a.createElement)(yy,{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)(yy,{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)(yy,{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 Cy=(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 Sy(){const{isInProgress:e,rotateClockwise:t}=gy();return(0,a.createElement)(m.ToolbarButton,{icon:Cy,label:(0,g.__)("Rotate"),onClick:t,disabled:e})}function wy(){const{isInProgress:e,apply:t,cancel:n}=gy();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 By(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)(vy,{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)(_y,null),(0,a.createElement)(m.ToolbarItem,null,(e=>(0,a.createElement)(Ey,{toggleProps:e}))),(0,a.createElement)(Sy,null)),(0,a.createElement)(m.ToolbarGroup,null,(0,a.createElement)(wy,null))))}const Iy=[25,50,75,100],xy=()=>{};function Ty(e){let{imageSizeHelp:t,imageWidth:n,imageHeight:o,imageSizeOptions:r=[],isResizable:l=!0,slug:i,width:s,height:c,onChange:d,onChangeImage:p=xy}=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")},Iy.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 Ny=(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 Py=()=>{};var My=e=>{let{value:t,onChange:n=Py,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)},Ly=n(5425),Ry=n.n(Ly);function Ay(e){return"function"==typeof e}class Dy 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,Ry()(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,mm.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 Ay(t)&&r&&l.length?t({suggestions:l,selectedSuggestion:s,suggestionsListProps:f,buildSuggestionItemProps:g,isLoading:p,handleSuggestionClick:this.handleOnClick,isInitialSuggestions:o&&!(n&&n.length)}):!Ay(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 Oy=(0,d.compose)(d.withSafeTimeout,m.withSpokenMessages,d.withInstanceId,(0,p.withSelect)(((e,t)=>{if(Ay(t.__experimentalFetchLinkSuggestions))return;const{getSettings:n}=e(so);return{__experimentalFetchLinkSuggestions:n().__experimentalFetchLinkSuggestions}})))(Dy);var zy=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: %s"),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 Fy=(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 Vy=(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 Hy=(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 Gy=(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 Uy=(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 Wy={post:Fy,page:I_,post_tag:Vy,category:Hy,attachment:Gy};function $y(e){let{isURL:t,suggestion:n}=e,o=null;return t?o=Uy:n.type in Wy&&(o=Wy[n.type]),o?(0,a.createElement)(ul,{className:"block-editor-link-control__search-item-icon",icon:o}):null}var jy=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)($y,{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,mm.filterURLForDisplay)((0,mm.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 Ky="__CREATE__",qy="mailto",Yy="internal",Qy=["URL",qy,"tel",Yy],Zy=[{id:"opensInNewTab",title:(0,g.__)("Open in new tab")}];function Xy(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&&Qy.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),S=(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"},S,(0,a.createElement)("div",i({},l,{className:b,"aria-labelledby":E}),u.map(((e,t)=>k&&Ky===e.type?(0,a.createElement)(zy,{searchTerm:o,buttonText:h,onClick:()=>r(e),key:e.type,itemProps:s(e,t),isSelected:t===d}):Ky===e.type?null:(0,a.createElement)(jy,{key:`${e.id}-${e.type}`,itemProps:s(e,t),suggestion:e,index:t,onClick:()=>{r(e)},isSelected:t===d,isURL:Qy.includes(e.type),searchTerm:o,shouldShowType:y,isFrontPage:null==e?void 0:e.isFrontPage})))))}function Jy(e){const t=null==e?void 0:e.startsWith("#");return(0,mm.isURL)(e)||e&&e.includes("www.")||t}const eE=()=>Promise.resolve([]),tE=e=>{let t="URL";const n=(0,mm.getProtocol)(e)||"";return n.includes("mailto")&&(t=qy),n.includes("tel")&&(t="tel"),null!=e&&e.startsWith("#")&&(t=Yy),Promise.resolve([{id:e,title:e,url:"URL"===t?(0,mm.prependHTTP)(e):e,type:t}])};function nE(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?tE:eE;return(0,a.useCallback)(((t,a)=>{let{isInitialSuggestions:s}=a;return Jy(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||Jy(e)||!r?c:c.concat({title:e,url:e,type:Ky})})(t,{...e,isInitialSuggestions:s},r,i,n,o,l)}),[i,r,n])}const oE=()=>Promise.resolve([]),rE=()=>{},lE=(0,a.forwardRef)(((e,t)=>{let{value:n,children:o,currentLink:r={},className:l=null,placeholder:i=null,withCreateSuggestion:s=!1,onCreateSuggestion:u=rE,onChange:p=rE,onSelect:m=rE,showSuggestions:f=!0,renderSuggestions:h=(e=>(0,a.createElement)(Xy,e)),fetchSuggestions:v=null,allowDirectEntry:b=!0,showInitialSuggestions:_=!1,suggestionsQuery:k={},withURLSuggestion:y=!0,createSuggestionButtonText:E,useLabel:C=!1}=e;const S=nE(k,b,s,y),w=f?v||S:oE,B=(0,d.useInstanceId)(lE),[I,x]=(0,a.useState)(),T=async e=>{let t=e;if(Ky!==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)(Oy,{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:w,__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 iE=lE;var aE=(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 sE=(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:cE,Fill:uE}=(0,m.createSlotFill)("BlockEditorLinkControlViewer");function dE(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 pE=function(e){const[t,n]=(0,a.useReducer)(dE,{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 mE(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}=pE(s),p=u&&Object.keys(u).length,f=n&&(0,mm.filterURLForDisplay)((0,mm.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:aE,size:32}):(0,a.createElement)(ul,{icon:Uy}),(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:sE,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)(cE,{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 fE=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}}},gE=()=>{};function hE(e){var t,n,o;let{searchInputPlaceholder:r,value:l,settings:i=Zy,onChange:s=gE,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:S=!1,renderControlBottom:w=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=fE(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),$=(null==l||null===(n=l.url)||void 0===n||null===(o=n.trim())||void 0===o?void 0:o.length)>0&&S;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":$})},$&&(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)(iE,{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:$},(0,a.createElement)("div",{className:"block-editor-link-control__search-actions"},(0,a.createElement)(m.Button,{onClick:G,label:(0,g.__)("Submit"),icon:Ny,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)(mE,{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)(My,{value:l,settings:i,onChange:s})),w&&w())}hE.ViewerFill=uE;var vE=hE;var bE=(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 _E=(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 kE=(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 yE=(0,m.withFilters)("editor.MediaUpload")((()=>null));var EE=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 CE=()=>{};let SE=0;var wE=(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=CE,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),[]),S=(0,a.useRef)(),w="block-editor/media-replace-flow/error-notice/"+ ++SE,B=e=>{const t=(0,Wl.__unstableStripHTML)(e);i?i(t):setTimeout((()=>{v("error",t,{speak:!0,id:w,isDismissible:!0})}),1e3)},I=(e,t)=>{d&&u&&u(),t(),s(e),(0,qt.speak)((0,g.__)("The media file has been replaced")),b(w)},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:S,"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)(yE,{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:bE,onClick:t},(0,g.__)("Open Media Library"))}}),(0,a.createElement)(EE,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:_E,onClick:()=>{t()}},(0,g.__)("Upload"))}}))),u&&(0,a.createElement)(m.MenuItem,{icon:kE,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)(vE,{value:{url:t},settings:[],showSuggestions:!1,onChange:e=>{let{url:t}=e;c(t),S.current.focus()}})))))}})}));function BE(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,mm.filterURLForDisplay)((0,mm.safeDecodeURI)(t))):(0,a.createElement)("span",{className:r})}function IE(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:Qm,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))}IE.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)(Oy,{value:r,onChange:o,autocompleteRef:t}),(0,a.createElement)(m.Button,{icon:Ny,label:(0,g.__)("Apply"),type:"submit"}))},IE.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)(BE,{url:r,urlLabel:l,className:n}),o&&(0,a.createElement)(m.Button,{icon:sE,label:(0,g.__)("Edit"),onClick:o}))};var xE=IE;const TE=()=>{},NE=e=>{let{src:t,onChange:n,onSubmit:o,onClose:r}=e;return(0,a.createElement)(xE,{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:Ny,label:(0,g.__)("Apply"),type:"submit"})))};var PE=(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:S,onDoubleClick:w,onFilesPreUpload:B=TE,onHTMLDrop:I=TE,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:w,preview:i,style:P},e,x)},W=()=>b?null:(0,a.createElement)(m.DropZone,{onFilesDrop:H,onHTMLDrop:I}),$=()=>E&&(0,a.createElement)(m.Button,{className:"block-editor-media-placeholder__cancel-button",title:(0,g.__)("Cancel"),variant:"link",onClick:E},(0,g.__)("Cancel")),j=()=>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)(NE,{src:L,onChange:O,onSubmit:V,onClose:F})),K=()=>S&&(0,a.createElement)("div",{className:"block-editor-media-placeholder__url-input-container"},(0,a.createElement)(m.Button,{className:"block-editor-media-placeholder__button",onClick:S,variant:"tertiary"},(0,g.__)("Use featured image")));return _?(0,a.createElement)(EE,null,W()):(0,a.createElement)(EE,{fallback:U(j())},(()=>{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)(yE,{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,j(),K(),$());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,j(),K(),$());return U(e)}return U(o)})())}));var ME=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)($k,i({settings:o,gradients:[],disableCustomGradients:!0},n))};const LE={position:"bottom right",isAlternate:!0};var RE=()=>(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:Qm,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:LE})))})));function AE(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)(DE,{popoverAnchor:s})}function DE(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)(RE,null))))}var OE=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)(DE,{popoverAnchor:n});if(r){const e=(0,z.getActiveFormats)(o);return(0,z.isCollapsed)(o)&&!e.length?null:(0,a.createElement)(AE,{editableContentElement:n,value:o,activeFormats:e})}return(0,a.createElement)(_o,{group:"inline"},(0,a.createElement)(RE,null))};function zE(){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 FE(e){return e.filter((e=>{let{type:t}=e;return/^image\/(?:jpe?g|png|gif|webp)$/.test(t)})).map((e=>``)).join("")}var VE=window.wp.shortcode;function HE(e,t){if(null!=t&&t.length){let n=e.formats.length;for(;n--;)e.formats[n]=[...t,...e.formats[n]||[]]}}function GE(e){if(!0===e||"p"===e||"li"===e)return!0===e?"p":e}function UE(e){let{allowedFormats:t,formattingControls:n,disableFormats:o}=e;return o?UE.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}UE.EMPTY_ARRAY=[];function WE(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 $E(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 jE(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="";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=$E(t,!!m),HE(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&&!$f(k,b)){const e=(0,r.pasteHandler)({HTML:FE(k),mode:"BLOCKS",tagName:s,preserveWhiteSpace:f});return window.console.log("Received items:\n\n",k),void(c&&(0,z.isEmpty)(i)?c(e):WE({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,VE.regexp)(".*").test(E))&&(y="BLOCKS"),p&&(0,z.isEmpty)(i)&&(0,mm.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=$E(e,!!m),HE(e,i.activeFormats),l((0,z.insert)(i,e))}else C.length>0&&(c&&(0,z.isEmpty)(i)?c(C,C.length-1,-1):WE({value:i,pastedBlocks:C,onReplace:c,onSplit:u,onSplitMiddle:d,multilineTag:m}))}return e.addEventListener("paste",n),()=>{e.removeEventListener("paste",n)}}),[])}const KE=["`",'"',"'","“”","‘’"];function qE(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",KE).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 YE(e){let t=e.length;for(;t--;){const n=Qt(e[t].attributes);if(n)return e[t].attributes[n]=e[t].attributes[n].replace(Yt,""),e[t].clientId;const o=YE(e[t].innerBlocks);if(o)return o}}function QE(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(YE([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{e.removeEventListener("input",i),e.removeEventListener("compositionend",i)}}),[])}function ZE(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)?WE({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&&WE({value:m,onReplace:i,onSplit:a,onSplitMiddle:s,multilineTag:c})}}return e.addEventListener("keydown",o),()=>{e.removeEventListener("keydown",o)}}),[])}function XE(e){return e(z.store).getFormatTypes()}const JE=new Set(["a","audio","button","details","embed","iframe","input","label","select","textarea","video"]);function eC(e,t){return"object"!=typeof e?{[t]:e}:Object.fromEntries(Object.entries(e).map((e=>{let[n,o]=e;return[`${t}.${n}`,o]})))}function tC(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 nC(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 oC(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 rC(){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 lC(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 iC=(0,a.createContext)(),aC=(0,a.createContext)();const sC=(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:S,onMerge:w,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:$}=(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:j}=(0,p.useDispatch)(so),K=GE(g),q=UE({allowedFormats:y,formattingControls:E,disableFormats:L}),Y=!q||q.length>0;let Q=s,Z=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/"}),Q=r.children.toHTML(s),Z=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}),j(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)(XE,[]),i=(0,a.useMemo)((()=>l.filter((e=>{let{name:t,tagName:n}=e;return!(r&&!r.includes(t)||o&&JE.has(n))}))),[l,r,JE]),s=(0,p.useSelect)((e=>i.reduce(((o,r)=>r.__experimentalGetPropsForEditableTreePreparation?{...o,...eC(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(tC(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=tC(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:Q,onChange(e,t){let{__unstableFormats:n,__unstableText:o}=t;Z(e),Object.values(ne).forEach((e=>{e(n,o)}))},selectionStart:U,selectionEnd:W,onSelectionChange:X,placeholder:k,__unstableIsSelected:$,__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:P_(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:Q,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,$&&(0,a.createElement)(iC.Provider,{value:ce},(0,a.createElement)(aC.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)(lC,{value:le,onChange:ie,onFocus:de,formatTypes:J,forwardedRef:H})))),$&&Y&&(0,a.createElement)(OE,{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,qE({value:le,onChange:ie}),QE({value:le,onChange:ie,__unstableAllowPrefixTransformations:D,formatTypes:J,onReplace:_,selectionChange:j}),(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)}}),[]),nC(ce),oC(ue),zE(),jE({isSelected:$,disableFormats:L,onChange:ie,value:le,formatTypes:J,tagName:l,onReplace:_,onSplit:B,onSplitMiddle:x,__unstableEmbedURLOnPaste:M,multilineTag:K,preserveWhiteSpace:N,pastePlainText:P}),ZE({removeEditorOnlyFormats:re,value:le,onReplace:_,onSplit:B,onSplitMiddle:x,multilineTag:K,onChange:ie,disableLineBreaks:R,onSplitAtEnd:I}),rC(),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;w&&w(!l),S&&(0,z.isEmpty)(le)&&l&&S(!l),e.preventDefault()}}})))}));sC.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=GE(o);!t&&i&&(t=`<${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},sC.isEmpty=e=>!e||0===e.length;var cC=sC;const uC=(0,a.forwardRef)(((e,t)=>(0,a.createElement)(cC,i({ref:t},e,{__unstableDisableFormats:!0,preserveWhiteSpace:!0}))));uC.Content=e=>{let{value:t="",tagName:n="div",...o}=e;return(0,a.createElement)(n,o,t)};var dC=uC;var pC=(0,a.forwardRef)(((e,t)=>{let{__experimentalVersion:n,...o}=e;if(2===n)return(0,a.createElement)(dC,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 mC(e){let{property:t,viewport:n,desc:o}=e;const r=(0,d.useInstanceId)(mC),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 fC=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)(mC,{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)(mC,{property:n,viewport:e}),e))))))))};function gC(e){let{character:t,type:n,onUse:o}=e;const r=(0,a.useContext)(iC),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 hC(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 vC(e){let{inputType:t,onInput:n}=e;const o=(0,a.useContext)(aC),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 bC=(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 _C=(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?bC:sE,"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:sE}),(0,g.__)("Edit"))},{value:"navigation",label:(0,a.createElement)(a.Fragment,null,bC,(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 kC(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 yC=(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 EC 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:yC,label:(0,g.__)("Close"),onClick:this.toggle}),(0,a.createElement)(Oy,{value:e||"",onChange:t}),(0,a.createElement)(m.Button,{icon:Ny,label:(0,g.__)("Submit"),type:"submit"}))))}}var CC=EC;var SC=(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 wC="none",BC="custom",IC="media",xC="attachment",TC=["noreferrer","noopener"],NC=(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"})),PC=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),S=(0,a.useCallback)((()=>{t!==IC&&t!==xC||E(""),k(!0)})),w=(0,a.useCallback)((()=>{k(!1)})),B=(0,a.useCallback)((()=>{E(null),w(),f(!1)})),I=(0,a.useCallback)((()=>e=>{const t=C.current;t&&t.contains(e.target)||(f(!1),E(null),w())})),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)||BC;n({href:y,linkDestination:e})}w(),E(null),e.preventDefault()})),T=(0,a.useCallback)((()=>{n({linkDestination:wC,href:""})})),N=()=>{const e=[{linkDestination:IC,title:(0,g.__)("Media File"),url:"image"===r?l:void 0,icon:NC}];return"image"===r&&i&&e.push({linkDestination:xC,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(" ");TC.forEach((t=>{e.includes(t)||e.push(t)})),n=e.join(" ")}else{const e=(null!=d?d:"").split(" ").filter((e=>!1===TC.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)(xE,{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:BC}).linkDestination:wC,n({linkDestination:o,href:e})})(e.url),w()}},e.title))))},(!o||_)&&(0,a.createElement)(xE.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)(xE.LinkViewer,{className:"block-editor-format-toolbar__link-container-content",url:o,onEditLinkClick:S,urlLabel:L}),(0,a.createElement)(m.Button,{icon:SC,label:(0,g.__)("Remove link"),onClick:T}))))};function MC(e){let{children:t,viewLabel:n,className:o,isEnabled:r=!0,deviceType:l,setDeviceType:i}=e;if((0,d.useViewportMatch)("small","<"))return null;const s={className:c()(o,"block-editor-post-preview__dropdown-content"),position:"bottom left"},u={variant:"tertiary",className:"block-editor-post-preview__button-toggle",disabled:!r,children:n},p={"aria-label":(0,g.__)("View options")};return(0,a.createElement)(m.DropdownMenu,{className:"block-editor-post-preview__dropdown",popoverProps:s,toggleProps:u,menuProps:p,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:()=>i("Desktop"),icon:"Desktop"===l&&Ef},(0,g.__)("Desktop")),(0,a.createElement)(m.MenuItem,{className:"block-editor-post-preview__button-resize",onClick:()=>i("Tablet"),icon:"Tablet"===l&&Ef},(0,g.__)("Tablet")),(0,a.createElement)(m.MenuItem,{className:"block-editor-post-preview__button-resize",onClick:()=>i("Mobile"),icon:"Mobile"===l&&Ef},(0,g.__)("Mobile"))),t)))}function LC(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{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 RC=(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})),AC=window.wp.wordcount;var DC=(0,p.withSelect)((e=>{const{getMultiSelectedBlocks:t}=e(so);return{blocks:t()}}))((function(e){let{blocks:t}=e;const n=(0,AC.count)((0,r.serialize)(t),"words");return(0,a.createElement)("div",{className:"block-editor-multi-selection-inspector__card"},(0,a.createElement)(Du,{icon:vf,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 OC(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=Bf(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 zC(e,t){const n=(0,a.useMemo)((()=>e.reduce(((e,t)=>("core/list-item"!==t.name&&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)((()=>FC([t],o)),[t,o])}function FC(e,t){const n=[];for(const o of e)t(o.name)&&n.push(o),n.push(...FC(o.innerBlocks,t));return n}function VC(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 HC(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=Um(t),s=zC(n,o);return(0,a.createElement)("div",{className:"block-editor-block-inspector"},(0,a.createElement)(Ou,i),(0,a.createElement)(Lk,{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)(VC,{selectedBlock:l,key:e.clientId,block:e,blockTypes:n})))))}const GC=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=Um(t);return(0,a.createElement)("div",{className:"block-editor-block-inspector"},(0,a.createElement)(Ou,l),(0,a.createElement)(Lk,{blockClientId:t}),o&&(0,a.createElement)("div",null,(0,a.createElement)(m.PanelBody,{title:(0,g.__)("Styles")},(0,a.createElement)(vk,{scope:"core/block-inspector",clientId:t}),(0,r.hasBlockSupport)(n,"defaultStylePicker",!0)&&(0,a.createElement)(OC,{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)(UC,null)),(0,a.createElement)(RC,{key:"back"}))},UC=()=>{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 WC=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:l(a)||("contentOnly"===i(a)?a:void 0)}}),[]);if(n>1)return(0,a.createElement)("div",{className:"block-editor-block-inspector"},(0,a.createElement)(DC,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)(HC,{topLevelLockedBlock:s}):(0,a.createElement)(GC,{clientId:l,blockName:i.name}):t?(0,a.createElement)("span",{className:"block-editor-block-inspector__no-blocks"},(0,g.__)("No block selected.")):null};var $C=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)(Dm,{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)(Tm,{position:"bottom center",clientId:r[n+1],__experimentalIsQuick:!0}))))):null};function jC(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)(Om.Provider,{value:(0,a.useRef)(!1)},!s&&(0,a.createElement)(Fm,{__unstableContentRef:n}),!s&&(l||!r)&&(0,a.createElement)(xg,{isFixed:!0}),(0,a.createElement)(Ag,{__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)($C,{__unstableContentRef:n})))}const KC=()=>{};var qC=(0,a.forwardRef)((function(e,t){let{rootClientId:n,clientId:o,isAppender:r,showInserterHelpPanel:l,showMostUsedBlocks:i=!1,__experimentalInsertionIndex:s,__experimentalFilterValue:c,onSelect:u=KC,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)(wm,{onSelect:u,rootClientId:m,clientId:o,isAppender:r,showInserterHelpPanel:l,showMostUsedBlocks:i,__experimentalInsertionIndex:s,__experimentalFilterValue:c,shouldFocusBlock:d,prioritizePatterns:f,ref:t})}));function YC(){return null}YC.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 QC=YC;function ZC(){return V()("wp.blockEditor.MultiSelectScrollIntoView",{hint:"This behaviour is now built-in.",since:"5.8"}),null}const XC=new Set([ku.UP,ku.RIGHT,ku.DOWN,ku.LEFT,ku.ENTER,ku.BACKSPACE]);function JC(){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 eS(){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=JC(),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&&XC.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 tS=function(e){let{children:t}=e;return(0,a.createElement)("div",{ref:eS()},t)};const nS=-1!==window.navigator.userAgent.indexOf("Trident"),oS=new Set([ku.UP,ku.DOWN,ku.LEFT,ku.RIGHT]);function rS(){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(oS.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{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 lS=nS?e=>e.children:function(e){let{children:t}=e;return(0,a.createElement)("div",{ref:rS(),className:"block-editor__typewriter"},t)};const iS=(0,a.createContext)({});function aS(e){let{children:t,uniqueId:n,blockName:o=""}=e;const r=(0,a.useContext)(iS),{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)(iS.Provider,{value:i},t)}function sS(e){var t;let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const o=(0,a.useContext)(iS),{name:r}=mo();return n=n||r,Boolean(null===(t=o[n])||void 0===t?void 0:t.has(e))}var cS=(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 uS(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:cS,onClick:r})),n&&(0,a.createElement)(m.__experimentalText,null,n))}var dS=(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)(uS,{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,Ok.getSettings)().l10n.startOfWeek,__nextRemoveHelpButton:!0,__nextRemoveResetButton:!0,onChange:o},r)))}));const pS={button:"wp-element-button",caption:"wp-element-caption"},mS=e=>pS[e]?pS[e]:"";function fS(e,t){return Object.entries(t).every((t=>{let[n,o]=t;return"object"==typeof o&&"object"==typeof e[n]?fS(e[n],o):e[n]===o}))}const gS=(e,t)=>{if(!t||!e)return;const n=t.filter((t=>{let{attributes:n}=t;return!(!n||!Object.keys(n).length)&&fS(e,n)}));return 1===n.length?n[0]:void 0};function hS(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 vS(e,t){const n=e.split(/[(),]/g).filter(Boolean),o=n.slice(1).map((e=>hS(ES(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[2]?o[2]+"px":o[1]+"px";case"calc":return o[0]+"px"}}function bS(e){for(;;){const t=e,n=/(max|min|calc|clamp)\(([^()]*)\)/g.exec(e)||[];if(n[0]){const t=vS(n[0]);e=e.replace(n[0],t)}if(e===t||parseFloat(e))break}return hS(e)}function _S(e){for(let t=0;tr.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 ES(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=hS(e);return n.unit||(n=bS(e)),_S(e)&&!n.unit?kS(e):yS(n,t)}const CS={};function SS(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 wS=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=e+SS(t);return CS[n]||(CS[n]=ES(e,t)),CS[n]}}(),(window.wp=window.wp||{}).blockEditor=o}(); \ No newline at end of file diff --git a/packages/playground/remote/public/wp-6.2/wp-includes/empty.html b/packages/playground/remote/public/wp-6.2/wp-includes/empty.html index c50eddd41f..620d9da39e 100755 --- a/packages/playground/remote/public/wp-6.2/wp-includes/empty.html +++ b/packages/playground/remote/public/wp-6.2/wp-includes/empty.html @@ -1 +1 @@ - + diff --git a/packages/playground/remote/public/wp-6.2/wp-includes/js/dist/block-editor.js b/packages/playground/remote/public/wp-6.2/wp-includes/js/dist/block-editor.js index fd7828c934..ffd7c82120 100755 --- a/packages/playground/remote/public/wp-6.2/wp-includes/js/dist/block-editor.js +++ b/packages/playground/remote/public/wp-6.2/wp-includes/js/dist/block-editor.js @@ -1,4 +1,47 @@ -/******/ (function() { // webpackBootstrap +/** + * A synchronous function to read a blob URL as text. + * + * @param {string} url + * @returns {string} + */ +const __playground_readBlobAsText = function (url) { + try { + let xhr = new XMLHttpRequest(); + xhr.open('GET', url, false); + xhr.overrideMimeType('text/plain;charset=utf-8'); + xhr.send(); + return xhr.responseText; + } catch(e) { + return ''; + } finally { + URL.revokeObjectURL(url); + } +} + +window.__playground_ControlledIframe = window.wp.element.forwardRef(function (props, ref) { + const source = window.wp.element.useMemo(function () { + if (props.srcDoc) { + // WordPress <= 6.2 uses a srcDoc that only contains a doctype. + return '/wp-includes/empty.html'; + } else if (props.src && props.src.startsWith('blob:')) { + // WordPress 6.3 uses a blob URL with doctype and a list of static assets. + // Let's pass the document content to empty.html and render it there. + return '/wp-includes/empty.html#' + encodeURIComponent(__playground_readBlobAsText(props.src)); + } else { + // WordPress >= 6.4 uses a plain HTTPS URL that needs no correction. + return props.src; + } + }, [props.src]); + return ( + window.wp.element.createElement('iframe', { + ...props, + ref: ref, + src: source, + // Make sure there's no srcDoc, as it would interfere with the src. + srcDoc: undefined + }) + ) +});/******/ (function() { // webpackBootstrap /******/ var __webpack_modules__ = ({ /***/ 6411: @@ -20326,13 +20369,13 @@ function Iframe(_ref2) { const srcDoc = (0,external_wp_element_namespaceObject.useMemo)(() => { return '' + (0,external_wp_element_namespaceObject.renderToString)(styleAssets); }, []); - return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, tabIndex >= 0 && before, (0,external_wp_element_namespaceObject.createElement)("iframe", _extends({}, props, { + return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, tabIndex >= 0 && before, (0,external_wp_element_namespaceObject.createElement)(__playground_ControlledIframe, _extends({}, props, { ref: (0,external_wp_compose_namespaceObject.useMergeRefs)([ref, setRef]), tabIndex: tabIndex // Correct doctype is required to enable rendering in standards // mode. Also preload the styles to avoid a flash of unstyled // content. , - src:"/wp-includes/empty.html", + srcDoc: srcDoc, title: (0,external_wp_i18n_namespaceObject.__)('Editor canvas') }), iframeDocument && (0,external_wp_element_namespaceObject.createPortal)((0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)("head", { ref: headRef diff --git a/packages/playground/remote/public/wp-6.2/wp-includes/js/dist/block-editor.min.js b/packages/playground/remote/public/wp-6.2/wp-includes/js/dist/block-editor.min.js index fba8eea44f..bf5872108a 100755 --- a/packages/playground/remote/public/wp-6.2/wp-includes/js/dist/block-editor.min.js +++ b/packages/playground/remote/public/wp-6.2/wp-includes/js/dist/block-editor.min.js @@ -1,4 +1,47 @@ -/*! This file is auto-generated */ +/** + * A synchronous function to read a blob URL as text. + * + * @param {string} url + * @returns {string} + */ +const __playground_readBlobAsText = function (url) { + try { + let xhr = new XMLHttpRequest(); + xhr.open('GET', url, false); + xhr.overrideMimeType('text/plain;charset=utf-8'); + xhr.send(); + return xhr.responseText; + } catch(e) { + return ''; + } finally { + URL.revokeObjectURL(url); + } +} + +window.__playground_ControlledIframe = window.wp.element.forwardRef(function (props, ref) { + const source = window.wp.element.useMemo(function () { + if (props.srcDoc) { + // WordPress <= 6.2 uses a srcDoc that only contains a doctype. + return '/wp-includes/empty.html'; + } else if (props.src && props.src.startsWith('blob:')) { + // WordPress 6.3 uses a blob URL with doctype and a list of static assets. + // Let's pass the document content to empty.html and render it there. + return '/wp-includes/empty.html#' + encodeURIComponent(__playground_readBlobAsText(props.src)); + } else { + // WordPress >= 6.4 uses a plain HTTPS URL that needs no correction. + return props.src; + } + }, [props.src]); + return ( + window.wp.element.createElement('iframe', { + ...props, + ref: ref, + src: source, + // Make sure there's no srcDoc, as it would interfere with the src. + srcDoc: undefined + }) + ) +});/*! This file is auto-generated */ !function(){var e={6411:function(e,t){var n,o,r; /*! autosize 4.0.4 @@ -23,7 +66,7 @@ * @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;n3&&void 0!==arguments[3]?arguments[3]:1;const r=[...e];return r.splice(t,o),C(r,e.slice(t,t+o),n)}const w=e=>e;function B(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const n=new Map,o=[];return n.set(t,o),e.forEach((e=>{const{clientId:t,innerBlocks:r}=e;o.push(t),B(r,t).forEach(((e,t)=>{n.set(t,e)}))})),n}function I(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const n=[],o=[[t,e]];for(;o.length;){const[e,t]=o.shift();t.forEach((t=>{let{innerBlocks:r,...l}=t;n.push([l.clientId,e]),null!=r&&r.length&&o.push([l.clientId,r])}))}return n}function x(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:w;const n=[],o=[...e];for(;o.length;){const{innerBlocks:e,...r}=o.shift();o.push(...e),n.push([r.clientId,t(r)])}return n}function T(e){const t={},n=[...e];for(;n.length;){const{innerBlocks:e,...o}=n.shift();n.push(...e),t[o.clientId]=!0}return t}function M(e){return x(e,(e=>{const{attributes:t,...n}=e;return n}))}function N(e){return x(e,(e=>e.attributes))}function P(e,t){return"UPDATE_BLOCK_ATTRIBUTES"===e.type&&void 0!==t&&"UPDATE_BLOCK_ATTRIBUTES"===t.type&&k()(e.clientIds,t.clientIds)&&function(e,t){return k()(Object.keys(e),Object.keys(t))}(e.attributes,t.attributes)}function L(e,t){const n=e.tree,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.set(e.clientId,{});for(const t of r)n.set(t.clientId,Object.assign(n.get(t.clientId),{...e.byClientId.get(t.clientId),attributes:e.attributes.get(t.clientId),innerBlocks:t.innerBlocks.map((e=>n.get(e.clientId)))}))}function R(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const o=e.tree,r=new Set([]),l=new Set;for(const o of t){let t=n?o:e.parents.get(o);do{if(e.controlledInnerBlocks[t]){l.add(t);break}r.add(t),t=e.parents.get(t)}while(void 0!==t)}for(const e of r)o.set(e,{...o.get(e)});for(const t of r)o.get(t).innerBlocks=(e.order.get(t)||[]).map((e=>o.get(e)));for(const t of l)o.set("controlled||"+t,{innerBlocks:(e.order.get(t)||[]).map((e=>o.get(e)))})}const A=(0,m.pipe)(g.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=new Map(t.attributes),t.attributes.forEach(((n,r)=>{const{name:l}=t.byClientId.get(r);"core/block"===l&&n.ref===e&&t.attributes.set(r,{...n,ref:o})}))}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:new Map,n.type){case"RECEIVE_BLOCKS":case"INSERT_BLOCKS":o.tree=new Map(o.tree),L(o,n.blocks),R(o,n.rootClientId?[n.rootClientId]:[""],!0);break;case"UPDATE_BLOCK":o.tree=new Map(o.tree),o.tree.set(n.clientId,{...o.tree.get(n.clientId),...o.byClientId.get(n.clientId),attributes:o.attributes.get(n.clientId)}),R(o,[n.clientId],!1);break;case"UPDATE_BLOCK_ATTRIBUTES":o.tree=new Map(o.tree),n.clientIds.forEach((e=>{o.tree.set(e,{...o.tree.get(e),attributes:o.attributes.get(e)})})),R(o,n.clientIds,!1);break;case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":{const e=T(n.blocks);o.tree=new Map(o.tree),n.replacedClientIds.concat(n.replacedClientIds.filter((t=>!e[t])).map((e=>"controlled||"+e))).forEach((e=>{o.tree.delete(e)})),L(o,n.blocks),R(o,n.blocks.map((e=>e.clientId)),!1);const r=[];for(const e of n.clientIds)void 0===t.parents.get(e)||""!==t.parents.get(e)&&!o.byClientId.get(t.parents.get(e))||r.push(t.parents.get(e));R(o,r,!0);break}case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":const e=[];for(const r of n.clientIds)void 0===t.parents.get(r)||""!==t.parents.get(r)&&!o.byClientId.get(t.parents.get(r))||e.push(t.parents.get(r));o.tree=new Map(o.tree),n.removedClientIds.concat(n.removedClientIds.map((e=>"controlled||"+e))).forEach((e=>{o.tree.delete(e)})),R(o,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=new Map(o.tree),R(o,e,!0);break}case"MOVE_BLOCKS_UP":case"MOVE_BLOCKS_DOWN":{const e=[n.rootClientId?n.rootClientId:""];o.tree=new Map(o.tree),R(o,e,!0);break}case"SAVE_REUSABLE_BLOCK_SUCCESS":{const e=[];o.attributes.forEach(((t,r)=>{"core/block"===o.byClientId.get(r).name&&t.ref===n.updatedId&&e.push(r)})),o.tree=new Map(o.tree),e.forEach((e=>{o.tree.set(e,{...o.byClientId.get(e),attributes:o.attributes.get(e),innerBlocks:o.tree.get(e).innerBlocks})})),R(o,e,!1)}}return o}),(e=>(t,n)=>{const o=e=>{let o=e;for(let r=0;r(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.get(n.rootClientId)&&(r=e(r,{type:"REMOVE_BLOCKS",keepControlledInnerBlocks:o,clientIds:t.order.get(n.rootClientId)}));let l=r;if(n.blocks.length){l=e(l,{...n,type:"INSERT_BLOCKS",index:0});const r=new Map(l.order);Object.keys(o).forEach((e=>{t.order.get(e)&&r.set(e,t.order.get(e))})),l.order=r,l.tree=new Map(l.tree),Object.keys(o).forEach((e=>{const n=`controlled||${e}`;t.tree.has(n)&&l.tree.set(n,t.tree.get(n))}))}return l}),(e=>(t,n)=>{if("RESET_BLOCKS"===n.type){const e={...t,byClientId:new Map(M(n.blocks)),attributes:new Map(N(n.blocks)),order:B(n.blocks),parents:new Map(I(n.blocks)),controlledInnerBlocks:{}};return e.tree=new Map(null==t?void 0:t.tree),L(e,n.blocks),e.tree.set("",{innerBlocks:n.blocks.map((t=>e.tree.get(t.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:!P(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]:new Map,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"RECEIVE_BLOCKS":case"INSERT_BLOCKS":{const n=new Map(e);return M(t.blocks).forEach((e=>{let[t,o]=e;n.set(t,o)})),n}case"UPDATE_BLOCK":{if(!e.has(t.clientId))return e;const{attributes:n,...o}=t.updates;if(0===Object.values(o).length)return e;const r=new Map(e);return r.set(t.clientId,{...e.get(t.clientId),...o}),r}case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":{if(!t.blocks)return e;const n=new Map(e);return t.replacedClientIds.forEach((e=>{n.delete(e)})),M(t.blocks).forEach((e=>{let[t,o]=e;n.set(t,o)})),n}case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":{const n=new Map(e);return t.removedClientIds.forEach((e=>{n.delete(e)})),n}}return e},attributes(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Map,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"RECEIVE_BLOCKS":case"INSERT_BLOCKS":{const n=new Map(e);return N(t.blocks).forEach((e=>{let[t,o]=e;n.set(t,o)})),n}case"UPDATE_BLOCK":{if(!e.get(t.clientId)||!t.updates.attributes)return e;const n=new Map(e);return n.set(t.clientId,{...e.get(t.clientId),...t.updates.attributes}),n}case"UPDATE_BLOCK_ATTRIBUTES":{if(t.clientIds.every((t=>!e.get(t))))return e;let o=!1;const r=new Map(e);for(const l of t.clientIds){var n;const i=Object.entries(t.uniqueByBlock?t.attributes[l]:null!==(n=t.attributes)&&void 0!==n?n:{});if(0===i.length)continue;let a=!1;const s=e.get(l),c={};i.forEach((e=>{let[t,n]=e;s[t]!==n&&(a=!0,c[t]=n)})),o=o||a,a&&r.set(l,{...s,...c})}return o?r:e}case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":{if(!t.blocks)return e;const n=new Map(e);return t.replacedClientIds.forEach((e=>{n.delete(e)})),N(t.blocks).forEach((e=>{let[t,o]=e;n.set(t,o)})),n}case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":{const n=new Map(e);return t.removedClientIds.forEach((e=>{n.delete(e)})),n}}return e},order(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Map,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"RECEIVE_BLOCKS":{var n;const o=B(t.blocks),r=new Map(e);return o.forEach(((e,t)=>{""!==t&&r.set(t,e)})),r.set("",(null!==(n=e.get(""))&&void 0!==n?n:[]).concat(o[""])),r}case"INSERT_BLOCKS":{const{rootClientId:n=""}=t,o=e.get(n)||[],r=B(t.blocks,n),{index:l=o.length}=t,i=new Map(e);return r.forEach(((e,t)=>{i.set(t,e)})),i.set(n,C(o,r.get(n),l)),i}case"MOVE_BLOCKS_TO_POSITION":{var o,r;const{fromRootClientId:n="",toRootClientId:l="",clientIds:i}=t,{index:a=e.get(l).length}=t;if(n===l){const t=e.get(l).indexOf(i[0]),n=new Map(e);return n.set(l,S(e.get(l),t,a,i.length)),n}const s=new Map(e);return s.set(n,null!==(o=null===(r=e.get(n))||void 0===r?void 0:r.filter((e=>!i.includes(e))))&&void 0!==o?o:[]),s.set(l,C(e.get(l),i,a)),s}case"MOVE_BLOCKS_UP":{const{clientIds:n,rootClientId:o=""}=t,r=n[0],l=e.get(o);if(!l.length||r===l[0])return e;const i=l.indexOf(r),a=new Map(e);return a.set(o,S(l,i,i-1,n.length)),a}case"MOVE_BLOCKS_DOWN":{const{clientIds:n,rootClientId:o=""}=t,r=n[0],l=n[n.length-1],i=e.get(o);if(!i.length||l===i[i.length-1])return e;const a=i.indexOf(r),s=new Map(e);return s.set(o,S(i,a,a+1,n.length)),s}case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":{const{clientIds:n}=t;if(!t.blocks)return e;const o=B(t.blocks),r=new Map(e);return t.replacedClientIds.forEach((e=>{r.delete(e)})),o.forEach(((e,t)=>{""!==t&&r.set(t,e)})),r.forEach(((e,t)=>{const l=Object.values(e).reduce(((e,t)=>t===n[0]?[...e,...o.get("")]:(-1===n.indexOf(t)&&e.push(t),e)),[]);r.set(t,l)})),r}case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":{const n=new Map(e);return t.removedClientIds.forEach((e=>{n.delete(e)})),n.forEach(((e,o)=>{var r;const l=null!==(r=null==e?void 0:e.filter((e=>!t.removedClientIds.includes(e))))&&void 0!==r?r:[];l.length!==e.length&&n.set(o,l)})),n}}return e},parents(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Map,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"RECEIVE_BLOCKS":{const n=new Map(e);return I(t.blocks).forEach((e=>{let[t,o]=e;n.set(t,o)})),n}case"INSERT_BLOCKS":{const n=new Map(e);return I(t.blocks,t.rootClientId||"").forEach((e=>{let[t,o]=e;n.set(t,o)})),n}case"MOVE_BLOCKS_TO_POSITION":{const n=new Map(e);return t.clientIds.forEach((e=>{n.set(e,t.toRootClientId||"")})),n}case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":{const n=new Map(e);return t.replacedClientIds.forEach((e=>{n.delete(e)})),I(t.blocks,e.get(t.clientIds[0])).forEach((e=>{let[t,o]=e;n.set(t,o)})),n}case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":{const n=new Map(e);return t.removedClientIds.forEach((e=>{n.delete(e)})),n}}return e},controlledInnerBlocks(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{type:t,clientId:n,hasControlledInnerBlocks:o}=arguments.length>1?arguments[1]:void 0;return"SET_HAS_CONTROLLED_INNER_BLOCKS"===t?{...e,[n]:o}:e}});function O(){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 D=(0,g.combineReducers)({blocks:A,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},isBlockInterfaceHidden:function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"HIDE_BLOCK_INTERFACE":return!0;case"SHOW_BLOCK_INTERFACE":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:O(r.selectionStart,l),selectionEnd:O(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 Object.fromEntries(Object.entries(e).filter((e=>{let[n]=e;return!t.clientIds.includes(n)})));case"UPDATE_BLOCK_LIST_SETTINGS":{const{clientId:n}=t;if(!t.settings){if(e.hasOwnProperty(n)){const{[n]:t,...o}=e;return o}return e}return k()(e[n],t.settings)?e:{...e,[n]:t.settings}}}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:n,index:o,__unstableWithInserter:r,operation:l}=t,i={rootClientId:n,index:o,__unstableWithInserter:r,operation:l};return k()(e,i)?e:i}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]:E,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]:y,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:r}=n,l=(0,g.select)(a.store).getActiveBlockVariation(r,o);let i=null!=l&&l.name?`${r}/${l.name}`:r;const s={name:i};return"core/block"===r&&(s.ref=o.ref,i+="/"+o.ref),{...e,insertUsage:{...e.insertUsage,[i]:{time:t.time,count:e.insertUsage[i]?e.insertUsage[i].count+1:1,insert:s}}}}),e)}return e},lastBlockAttributesChange: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"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 e},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":case"REPLACE_BLOCKS":case"REPLACE_INNER_BLOCKS":if(!n.blocks.length)return t;const o=n.blocks.map((e=>e.clientId));return{clientIds:o,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},blockVisibility:function(){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}}),z={};function F(e){return[e]}function V(e,t,n){var o;if(e.length!==t.length)return!1;for(o=n;o(o,r)=>{let l,i;if("function"==typeof e?(l=e(o),i=e(r)):(l=o[e],i=r[e]),l>i)return"asc"===n?1:-1;if(i>l)return"asc"===n?-1:1;const a=t.findIndex((e=>e===o)),s=t.findIndex((e=>e===r));return a>s?1:s>a?-1:0};function Y(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"asc";return e.concat().sort(q(t,e,n))}const Z=[];function Q(e,t){const n=e.blocks.byClientId.get(t),o="core/social-link";if("web"!==u.Platform.OS&&(null==n?void 0:n.name)===o){const n=e.blocks.attributes.get(t),{service:r}=null!=n?n:{};return r?`core/social-link-${r}`:o}return n?n.name:null}function X(e,t){const n=e.blocks.byClientId.get(t);return!!n&&n.isValid}function J(e,t){return e.blocks.byClientId.get(t)?e.blocks.attributes.get(t):null}function ee(e,t){return e.blocks.byClientId.has(t)?e.blocks.tree.get(t):null}const te=H(((e,t)=>e.blocks.byClientId.has(t)?{...e.blocks.byClientId.get(t),attributes:J(e,t)}:null),((e,t)=>[e.blocks.byClientId.get(t),e.blocks.attributes.get(t)]));function ne(e,t){var n;const o=t&&Zt(e,t)?"controlled||"+t:t||"";return(null===(n=e.blocks.tree.get(o))||void 0===n?void 0:n.innerBlocks)||Z}const oe=H(((e,t)=>({clientId:t,innerBlocks:re(e,t)})),(e=>[e.blocks.order])),re=H((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return $e(e,t).map((t=>oe(e,t)))}),(e=>[e.blocks.order])),le=H(((e,t)=>{const n=[];for(const o of t)for(const t of $e(e,o))n.push(t,...le(e,[t]));return n}),(e=>[e.blocks.order])),ie=H((e=>{const t=[];for(const n of $e(e))t.push(n,...le(e,[n]));return t}),(e=>[e.blocks.order])),ae=H(((e,t)=>{const n=ie(e);return t?n.reduce(((n,o)=>e.blocks.byClientId.get(o).name===t?n+1:n),0):n.length}),(e=>[e.blocks.order,e.blocks.byClientId])),se=H(((e,t)=>{if(!t)return Z;const n=ie(e).filter((n=>e.blocks.byClientId.get(n).name===t));return n.length>0?n:Z}),(e=>[e.blocks.order,e.blocks.byClientId])),ce=H(((e,t)=>(Array.isArray(t)?t:[t]).map((t=>ee(e,t)))),((e,t)=>(Array.isArray(t)?t:[t]).map((t=>e.blocks.tree.get(t))))),ue=H(((e,t)=>ce(e,t).filter(Boolean).map((e=>e.name))),((e,t)=>ce(e,t)));function de(e,t){return $e(e,t).length}function pe(e){return e.selection.selectionStart}function me(e){return e.selection.selectionEnd}function ge(e){return e.selection.selectionStart.clientId}function fe(e){return e.selection.selectionEnd.clientId}function he(e){const t=Me(e).length;return t||(e.selection.selectionStart.clientId?1:0)}function ve(e){const{selectionStart:t,selectionEnd:n}=e.selection;return!!t.clientId&&t.clientId===n.clientId}function be(e){const{selectionStart:t,selectionEnd:n}=e.selection,{clientId:o}=t;return o&&o===n.clientId?o:null}function ke(e){const t=be(e);return t?ee(e,t):null}function _e(e,t){return e.blocks.parents.has(t)?e.blocks.parents.get(t):null}const ye=H((function(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const o=[];let r=t;for(;e.blocks.parents.get(r);)r=e.blocks.parents.get(r),o.push(r);return n?o:o.reverse()}),(e=>[e.blocks.parents])),Ee=H((function(e,t,n){let o=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const r=ye(e,t,o);return r.map((t=>({id:t,name:Q(e,t)}))).filter((e=>{let{name:t}=e;return Array.isArray(n)?n.includes(t):t===n})).map((e=>{let{id:t}=e;return t}))}),(e=>[e.blocks.parents]));function Ce(e,t){let n,o=t;do{n=o,o=e.blocks.parents.get(o)}while(o);return n}function Se(e,t){const n=be(e),o=[...ye(e,t),t],r=[...ye(e,n),n];let l;const i=Math.min(o.length,r.length);for(let e=0;e2&&void 0!==arguments[2]?arguments[2]:1;if(void 0===t&&(t=be(e)),void 0===t&&(t=n<0?Pe(e):Le(e)),!t)return null;const o=_e(e,t);if(null===o)return null;const{order:r}=e.blocks,l=r.get(o),i=l.indexOf(t),a=i+1*n;return a<0||a===l.length?null:l[a]}function Be(e,t){return we(e,t,-1)}function Ie(e,t){return we(e,t,1)}function xe(e){return e.initialPosition}const Te=H((e=>{const{selectionStart:t,selectionEnd:n}=e.selection;if(!t.clientId||!n.clientId)return Z;if(t.clientId===n.clientId)return[t.clientId];const o=_e(e,t.clientId);if(null===o)return Z;const r=$e(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 Me(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId===n.clientId?Z:Te(e)}const Ne=H((e=>{const t=Me(e);return t.length?t.map((t=>ee(e,t))):Z}),(e=>[...Te.getDependants(e),e.blocks.byClientId,e.blocks.order,e.blocks.attributes]));function Pe(e){return Me(e)[0]||null}function Le(e){const t=Me(e);return t[t.length-1]||null}function Re(e,t){return Pe(e)===t}function Ae(e,t){return-1!==Me(e).indexOf(t)}const Oe=H(((e,t)=>{let n=t,o=!1;for(;n&&!o;)n=_e(e,n),o=Ae(e,n);return o}),(e=>[e.blocks.order,e.selection.selectionStart.clientId,e.selection.selectionEnd.clientId]));function De(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId===n.clientId?null:t.clientId||null}function ze(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId===n.clientId?null:n.clientId||null}function Fe(e){const t=pe(e),n=me(e);return!t.attributeKey&&!n.attributeKey&&void 0===t.offset&&void 0===n.offset}function Ve(e){const t=pe(e),n=me(e);return!!t&&!!n&&t.clientId===n.clientId&&t.attributeKey===n.attributeKey&&t.offset===n.offset}function He(e){return Te(e).some((t=>{const n=Q(e,t);return!(0,a.getBlockType)(n).merge}))}function Ge(e,t){const n=pe(e),o=me(e);if(n.clientId===o.clientId)return!1;if(!n.attributeKey||!o.attributeKey||void 0===n.offset||void 0===o.offset)return!1;const r=_e(e,n.clientId);if(r!==_e(e,o.clientId))return!1;const l=$e(e,r);let i,s;l.indexOf(n.clientId)>l.indexOf(o.clientId)?(i=o,s=n):(i=n,s=o);const c=t?s.clientId:i.clientId,u=t?i.clientId:s.clientId,d=Q(e,c);if(!(0,a.getBlockType)(d).merge)return!1;const p=ee(e,u);if(p.name===d)return!0;const m=(0,a.switchToBlockType)(p,d);return m&&m.length}const Ue=e=>{const t=pe(e),n=me(e);if(t.clientId===n.clientId)return Z;if(!t.attributeKey||!n.attributeKey||void 0===t.offset||void 0===n.offset)return Z;const o=_e(e,t.clientId);if(o!==_e(e,n.clientId))return Z;const r=$e(e,o),l=r.indexOf(t.clientId),i=r.indexOf(n.clientId),[s,c]=l>i?[n,t]:[t,n],u=ee(e,s.clientId),d=(0,a.getBlockType)(u.name),p=ee(e,c.clientId),m=(0,a.getBlockType)(p.name),g=u.attributes[s.attributeKey],f=p.attributes[c.attributeKey],h=d.attributes[s.attributeKey],v=m.attributes[c.attributeKey];let b=(0,$.create)({html:g,...K(h)}),k=(0,$.create)({html:f,...K(v)});return b=(0,$.remove)(b,0,s.offset),k=(0,$.remove)(k,c.offset,k.text.length),[{...u,attributes:{...u.attributes,[s.attributeKey]:(0,$.toHTMLString)({value:b,...K(h)})}},{...p,attributes:{...p.attributes,[c.attributeKey]:(0,$.toHTMLString)({value:k,...K(v)})}}]};function $e(e,t){return e.blocks.order.get(t||"")||Z}function je(e,t){return $e(e,_e(e,t)).indexOf(t)}function We(e,t){const{selectionStart:n,selectionEnd:o}=e.selection;return n.clientId===o.clientId&&n.clientId===t}function Ke(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return $e(e,t).some((t=>We(e,t)||Ae(e,t)||n&&Ke(e,t,n)))}function qe(e,t){if(!t)return!1;const n=Me(e),o=n.indexOf(t);return o>-1&&ont(e,t)))}function rt(){return W()('wp.data.select( "core/block-editor" ).isCaretWithinFormattedText',{since:"6.1",version:"6.3"}),!1}const lt=H((e=>{let t,n;const{insertionPoint:o,selection:{selectionEnd:r}}=e;if(null!==o)return o;const{clientId:l}=r;return l?(t=_e(e,l)||void 0,n=je(e,r.clientId)+1):n=$e(e).length,{rootClientId:t,index:n}}),(e=>[e.insertionPoint,e.selection.selectionEnd.clientId,e.blocks.parents,e.blocks.order]));function it(e){return null!==e.insertionPoint}function at(e){return e.template.isValid}function st(e){return e.settings.template}function ct(e,t){var n,o,r;return t?null!==(n=null===(o=Dt(e,t))||void 0===o?void 0:o.templateLock)&&void 0!==n&&n:null!==(r=e.settings.templateLock)&&void 0!==r&&r}const ut=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},dt=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,a.getBlockType)(t),!n)return!1;const{allowedBlockTypes:r}=zt(e),l=ut(r,t,!0);if(!l)return!1;const i=!!ct(e,o);if(i)return!1;const c=Dt(e,o);if(o&&void 0===c)return!1;const u=null==c?void 0:c.allowedBlocks,d=ut(u,t),p=n.parent,m=Q(e,o),g=ut(p,m);let f=!0;const h=n.ancestor;if(h){f=[o,...ye(e,o)].some((t=>ut(h,Q(e,t))))}const v=f&&(null===d&&null===g||!0===d||!0===g);return v?(0,s.applyFilters)("blockEditor.__unstableCanInsertBlockType",v,n,o,{getBlock:ee.bind(null,e),getBlockParentsByBlockName:Ee.bind(null,e)}):v},pt=H(dt,((e,t,n)=>[e.blockListSettings[n],e.blocks.byClientId.get(n),e.settings.allowedBlockTypes,e.settings.templateLock]));function mt(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return t.every((t=>pt(e,Q(e,t),n)))}function gt(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=!!ct(e,n);return void 0===r||void 0===(null==r?void 0:r.remove)?!l:!(null!=r&&r.remove)}function ft(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return t.every((t=>gt(e,t,n)))}function ht(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"===ct(e,n);return void 0===r||void 0===(null==r?void 0:r.move)?!l:!(null!=r&&r.move)}function vt(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return t.every((t=>ht(e,t,n)))}function bt(e,t){const n=J(e,t);if(null===n)return!0;const{lock:o}=n;return!(null!=o&&o.edit)}function kt(e,t){var n;return!!(0,a.hasBlockSupport)(t,"lock",!0)&&!(null===(n=e.settings)||void 0===n||!n.canLockBlocks)}function _t(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 yt=(e,t,n)=>!!(0,a.hasBlockSupport)(t,"inserter",!0)&&dt(e,t.name,n),Et=(e,t)=>n=>{const o=`${t.id}/${n.name}`,{time:r,count:l=0}=_t(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:Ct(r,l)}},Ct=(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}},St=(e,t)=>{let{buildScope:n="inserter"}=t;return t=>{const o=t.name;let r=!1;(0,a.hasBlockSupport)(t.name,"multiple",!0)||(r=ce(e,ie(e)).some((e=>{let{name:n}=e;return n===t.name})));const{time:l,count:i=0}=_t(e,o)||{},s={id:o,name:t.name,title:t.title,icon:t.icon,isDisabled:r,frecency:Ct(l,i)};if("transform"===n)return s;const c=(0,a.getBlockVariations)(t.name,"inserter");return{...s,initialAttributes:{},description:t.description,category:t.category,keywords:t.keywords,variations:c,example:t.example,utility:1}}},wt=H((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const n=St(e,{buildScope:"inserter"}),o=/^\s*)[^])*)\5|[^]*?)}\s+)?(\/)?-->/,r=t=>{let n=U;if("web"===u.Platform.OS){const e=("string"==typeof t.content.raw?t.content.raw:t.content).match(o);if(e){const[,,t="core/",o]=e,r=(0,a.getBlockType)(t+o);r&&(n=r.icon)}}const r=`core/block/${t.id}`,{time:l,count:i=0}=_t(e,r)||{},s=Ct(l,i);return{id:r,name:"core/block",initialAttributes:{ref:t.id},title:t.title.raw,icon:n,category:"reusable",keywords:[],isDisabled:!1,utility:1,frecency:s}},l=(0,a.getBlockTypes)().filter((n=>yt(e,n,t))).map(n),i=dt(e,"core/block",t)?$t(e).map(r):[],s=l.reduce(((t,n)=>{const{variations:o=[]}=n;if(o.some((e=>{let{isDefault:t}=e;return t}))||t.push(n),o.length){const r=Et(e,n);t.push(...o.map(r))}return t}),[]),c=(e,t)=>{const{core:n,noncore:o}=e;return(t.name.startsWith("core/")?n:o).push(t),e},{core:d,noncore:p}=s.reduce(c,{core:[],noncore:[]}),m=[...d,...p];return[...m,...i]}),((e,t)=>[e.blockListSettings[t],e.blocks.byClientId,e.blocks.order,e.preferences.insertUsage,e.settings.allowedBlockTypes,e.settings.templateLock,$t(e),(0,a.getBlockTypes)()])),Bt=H((function(e,t){var n;let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const r=Array.isArray(t)?t:[t],[l]=r,i=St(e,{buildScope:"transform"}),s=(0,a.getBlockTypes)().filter((t=>yt(e,t,o))).map(i),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,_.__)("Unwrap"),icon:null===(n=c[null==l?void 0:l.name])||void 0===n?void 0:n.icon};const u=(0,a.getPossibleBlockTransformations)(r).reduce(((e,t)=>("*"===t?e.push(c["*"]):c[null==t?void 0:t.name]&&e.push(c[t.name]),e)),[]);return Y(u,(e=>c[e.name].frecency),"desc")}),((e,t,n)=>[e.blockListSettings[n],e.blocks.byClientId,e.preferences.insertUsage,e.settings.allowedBlockTypes,e.settings.templateLock,(0,a.getBlockTypes)()])),It=H((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const n=(0,a.getBlockTypes)().some((n=>yt(e,n,t)));if(n)return!0;const o=dt(e,"core/block",t)&&$t(e).length>0;return o}),((e,t)=>[e.blockListSettings[t],e.blocks.byClientId,e.settings.allowedBlockTypes,e.settings.templateLock,$t(e),(0,a.getBlockTypes)()])),xt=H((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(t)return(0,a.getBlockTypes)().filter((n=>yt(e,n,t)))}),((e,t)=>[e.blockListSettings[t],e.blocks.byClientId,e.settings.allowedBlockTypes,e.settings.templateLock,(0,a.getBlockTypes)()])),Tt=H((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return W()('wp.data.select( "core/block-editor" ).__experimentalGetAllowedBlocks',{alternative:'wp.data.select( "core/block-editor" ).getAllowedBlocks',since:"6.2",version:"6.4"}),xt(e,t)}),((e,t)=>[...xt.getDependants(e,t)])),Mt=H((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(ee(e,o))?r:null:r:void 0}),((e,t)=>[e.blockListSettings[t],e.blocks.tree.get(t)])),Nt=H(((e,t)=>{const n=e.settings.__experimentalBlockPatterns.find((e=>{let{name:n}=e;return n===t}));return n?{...n,blocks:(0,a.parse)(n.content,{__unstableSkipMigrationLogs:!0})}:null}),(e=>[e.settings.__experimentalBlockPatterns])),Pt=H((e=>{const t=e.settings.__experimentalBlockPatterns,{allowedBlockTypes:n}=zt(e),o=t.filter((e=>{let{inserter:t=!0}=e;return!!t})).map((t=>{let{name:n}=t;return Nt(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(!ut(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])),Lt=H((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const n=Pt(e),o=n.filter((n=>{let{blocks:o}=n;return o.every((n=>{let{name:o}=n;return pt(e,o,t)}))}));return o}),((e,t)=>[e.settings.__experimentalBlockPatterns,e.settings.allowedBlockTypes,e.settings.templateLock,e.blockListSettings[t],e.blocks.byClientId.get(t)])),Rt=H((function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!t)return Z;const o=Lt(e,n),r=Array.isArray(t)?t:[t],l=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)))}));return 0===l.length?Z:l}),((e,t,n)=>[...Lt.getDependants(e,n)])),At=H((function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return W()('wp.data.select( "core/block-editor" ).__experimentalGetPatternsByBlockTypes',{alternative:'wp.data.select( "core/block-editor" ).getPatternsByBlockTypes',since:"6.2",version:"6.4"}),Rt(e,t,n)}),((e,t,n)=>[...Lt.getDependants(e,n)])),Ot=H((function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!t)return Z;if(t.some((t=>{let{clientId:n,innerBlocks:o}=t;return o.length||Zt(e,n)})))return Z;const o=Array.from(new Set(t.map((e=>{let{name:t}=e;return t}))));return Rt(e,o,n)}),((e,t,n)=>[...Rt.getDependants(e,n)]));function Dt(e,t){return e.blockListSettings[t]}function zt(e){return e.settings}function Ft(e){return e.blocks.isPersistentChange}const Vt=H((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])),Ht=H(((e,t)=>{var n;const o=$t(e).find((e=>e.id===t));return o?null===(n=o.title)||void 0===n?void 0:n.raw:null}),(e=>[$t(e)]));function Gt(e){return e.blocks.isIgnoredChange}function Ut(e){return e.lastBlockAttributesChange}function $t(e){var t,n;return null!==(t=null==e||null===(n=e.settings)||void 0===n?void 0:n.__experimentalReusableBlocks)&&void 0!==t?t:Z}function jt(e){return"navigation"===e.editorMode}function Wt(e){return e.editorMode}function Kt(e){return e.hasBlockMovingClientId}function qt(e){return!!e.automaticChangeStatus}function Yt(e,t){return e.highlightedBlock===t}function Zt(e,t){return!!e.blocks.controlledInnerBlocks[t]}const Qt=H(((e,t)=>{if(!t.length)return null;const n=be(e);if(t.includes(Q(e,n)))return n;const o=Me(e),r=Ee(e,n||o[0],t);return r?r[r.length-1]:null}),((e,t)=>[e.selection.selectionStart.clientId,e.selection.selectionEnd.clientId,t]));function Xt(e,t,n){var o;const{lastBlockInserted:r}=e;return(null===(o=r.clientIds)||void 0===o?void 0:o.includes(t))&&r.source===n}function Jt(e,t){var n,o;return null===(n=null===(o=e.blockVisibility)||void 0===o?void 0:o[t])||void 0===n||n}const en=H((e=>new Set(Object.keys(e.blockVisibility).filter((t=>e.blockVisibility[t])))),(e=>[e.blockVisibility])),tn=H(((e,t)=>{let n,o=t;for(;e.blocks.parents.has(o);)o=e.blocks.parents.get(o),o&&"contentOnly"===ct(e,o)&&(n=o);return n}),(e=>[e.blocks.parents,e.blockListSettings]));function nn(e){return e.temporarilyEditingAsBlocks}function on(e,t){if(!bt(e,t))return!0;const n=Wt(e);if("zoom-out"===n&&t&&!_e(e,t))return!0;const o=(0,a.hasBlockSupport)(Q(e,t),"__experimentalDisableBlockOverlay",!1);return("navigation"===n||!o&&Zt(e,t))&&!We(e,t)&&!Ke(e,t,!0)}function rn(e,t){let n=e.blocks.parents.get(t);for(;n;){if(on(e,n))return!0;n=e.blocks.parents.get(n)}return!1}const ln=["inserterMediaCategories","blockInspectorAnimation"];function an(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=e;if(t&&"web"===u.Platform.OS){n={};for(const t in e)ln.includes(t)||(n[t]=e[t])}return{type:"UPDATE_SETTINGS",settings:n}}function sn(){return{type:"HIDE_BLOCK_INTERFACE"}}function cn(){return{type:"SHOW_BLOCK_INTERFACE"}}function un(e){return e.isBlockInterfaceHidden}function dn(e){var t;return null==e||null===(t=e.lastBlockInserted)||void 0===t?void 0:t.clientIds}var pn=window.wp.a11y;const mn="†";function gn(e){if(e)return Object.keys(e).find((t=>{const n=e[t];return"string"==typeof n&&-1!==n.indexOf(mn)}))}const fn=e=>Array.isArray(e)?e:[e],hn=e=>t=>{let{dispatch:n}=t;n({type:"RESET_BLOCKS",blocks:e}),n(vn(e))},vn=e=>t=>{let{select:n,dispatch:o}=t;const r=n.getTemplate(),l=n.getTemplateLock(),i=!r||"all"!==l||(0,a.doBlocksMatchTemplate)(e,r);if(i!==n.isValidTemplate())return o.setTemplateValidity(i),i};function bn(e,t,n){return{type:"RESET_SELECTION",selectionStart:e,selectionEnd:t,initialPosition:n}}function kn(e){return W()('wp.data.dispatch( "core/block-editor" ).receiveBlocks',{since:"5.9",alternative:"resetBlocks or insertBlocks"}),{type:"RECEIVE_BLOCKS",blocks:e}}function _n(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return{type:"UPDATE_BLOCK_ATTRIBUTES",clientIds:fn(e),attributes:t,uniqueByBlock:n}}function yn(e,t){return{type:"UPDATE_BLOCK",clientId:e,updates:t}}function En(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return{type:"SELECT_BLOCK",initialPosition:t,clientId:e}}const Cn=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return n=>{let{select:o,dispatch:r}=n;const l=o.getPreviousBlockClientId(e);if(l)r.selectBlock(l,-1);else if(t){const t=o.getBlockRootClientId(e);t&&r.selectBlock(t,-1)}}},Sn=e=>t=>{let{select:n,dispatch:o}=t;const r=n.getNextBlockClientId(e);r&&o.selectBlock(r)};function wn(){return{type:"START_MULTI_SELECT"}}function Bn(){return{type:"STOP_MULTI_SELECT"}}const In=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,pn.speak)((0,_.sprintf)((0,_._n)("%s block selected.","%s blocks selected.",i),i),"assertive")}};function xn(){return{type:"CLEAR_SELECTED_BLOCK"}}function Tn(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return{type:"TOGGLE_SELECTION",isSelectionEnabled:e}}function Mn(e,t){var n,o;const r=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,a.hasBlockSupport)(n,"defaultStylePicker",!0))return e;if(!r[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:l={}}=e,i=r[n];return{...e,attributes:{...l,className:`${o||""} is-style-${i}`.trim()}}}))}const Nn=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=fn(e),t=Mn(fn(t),i.getSettings());const s=i.getBlockRootClientId(e[0]);for(let e=0;e{let{select:t,dispatch:n}=e;if(t.getBlockCount()>0)return;const{__unstableHasCustomAppender:o}=t.getSettings();o||n.insertDefaultBlock()}))}};function Pn(e,t){return Nn(e,t)}const Ln=e=>(t,n)=>o=>{let{select:r,dispatch:l}=o;r.canMoveBlocks(t,n)&&l({type:e,clientIds:fn(t),rootClientId:n})},Rn=Ln("MOVE_BLOCKS_DOWN"),An=Ln("MOVE_BLOCKS_UP"),On=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 Dn(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 On([e],t,n,o)}function zn(e,t,n,o,r){return Fn([e],t,n,o,0,r)}const Fn=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,W()("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(fn(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 Vn(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{__unstableWithInserter:o,operation:r}=n;return{type:"SHOW_INSERTION_POINT",rootClientId:e,index:t,__unstableWithInserter:o,operation:r}}const Hn=()=>e=>{let{select:t,dispatch:n}=e;t.isBlockInsertionPointVisible()&&n({type:"HIDE_INSERTION_POINT"})};function Gn(e){return{type:"SET_TEMPLATE_VALIDITY",isValid:e}}const Un=()=>e=>{let{select:t,dispatch:n}=e;n({type:"SYNCHRONIZE_TEMPLATE"});const o=t.getBlocks(),r=t.getTemplate(),l=(0,a.synchronizeBlocksWithTemplate)(o,r);n.resetBlocks(l)},$n=e=>t=>{let{registry:n,select:o,dispatch:r}=t;const l=o.getSelectionStart(),i=o.getSelectionEnd();if(l.clientId===i.clientId)return;if(!l.attributeKey||!i.attributeKey||void 0===l.offset||void 0===i.offset)return!1;const s=o.getBlockRootClientId(l.clientId);if(s!==o.getBlockRootClientId(i.clientId))return;const c=o.getBlockOrder(s);let u,d;c.indexOf(l.clientId)>c.indexOf(i.clientId)?(u=i,d=l):(u=l,d=i);const p=e?d:u,m=o.getBlock(p.clientId),g=(0,a.getBlockType)(m.name);if(!g.merge)return;const f=u,h=d,v=o.getBlock(f.clientId),b=(0,a.getBlockType)(v.name),k=o.getBlock(h.clientId),_=(0,a.getBlockType)(k.name),y=v.attributes[f.attributeKey],E=k.attributes[h.attributeKey],C=b.attributes[f.attributeKey],S=_.attributes[h.attributeKey];let w=(0,$.create)({html:y,...K(C)}),B=(0,$.create)({html:E,...K(S)});w=(0,$.remove)(w,f.offset,w.text.length),B=(0,$.insert)(B,mn,0,h.offset);const I=(0,a.cloneBlock)(v,{[f.attributeKey]:(0,$.toHTMLString)({value:w,...K(C)})}),x=(0,a.cloneBlock)(k,{[h.attributeKey]:(0,$.toHTMLString)({value:B,...K(S)})}),T=e?I:x,M=v.name===k.name?[T]:(0,a.switchToBlockType)(T,g.name);if(!M||!M.length)return;let N;if(e){const e=M.pop();N=g.merge(e.attributes,x.attributes)}else{const e=M.shift();N=g.merge(I.attributes,e.attributes)}const P=gn(N),L=N[P],R=(0,$.create)({html:L,...K(g.attributes[P])}),A=R.text.indexOf(mn),O=(0,$.remove)(R,A,A+1),D=(0,$.toHTMLString)({value:O,...K(g.attributes[P])});N[P]=D;const z=o.getSelectedBlockClientIds(),F=[...e?M:[],{...m,attributes:{...m.attributes,...N}},...e?[]:M];n.batch((()=>{r.selectionChange(m.clientId,P,A,A),r.replaceBlocks(z,F,0,o.getSelectedBlocksInitialCaretPosition())}))},jn=()=>e=>{let{select:t,dispatch:n}=e;const o=t.getSelectionStart(),r=t.getSelectionEnd();if(o.clientId===r.clientId)return;if(!o.attributeKey||!r.attributeKey||void 0===o.offset||void 0===r.offset)return;const l=t.getBlockRootClientId(o.clientId);if(l!==t.getBlockRootClientId(r.clientId))return;const i=t.getBlockOrder(l);let s,c;i.indexOf(o.clientId)>i.indexOf(r.clientId)?(s=r,c=o):(s=o,c=r);const u=s,d=c,p=t.getBlock(u.clientId),m=(0,a.getBlockType)(p.name),g=t.getBlock(d.clientId),f=(0,a.getBlockType)(g.name),h=p.attributes[u.attributeKey],v=g.attributes[d.attributeKey],b=m.attributes[u.attributeKey],k=f.attributes[d.attributeKey];let _=(0,$.create)({html:h,...K(b)}),y=(0,$.create)({html:v,...K(k)});_=(0,$.remove)(_,u.offset,_.text.length),y=(0,$.remove)(y,0,d.offset),n.replaceBlocks(t.getSelectedBlockClientIds(),[{...p,attributes:{...p.attributes,[u.attributeKey]:(0,$.toHTMLString)({value:_,...K(b)})}},(0,a.createBlock)((0,a.getDefaultBlockName)()),{...g,attributes:{...g.attributes,[d.attributeKey]:(0,$.toHTMLString)({value:y,...K(k)})}}],1,t.getSelectedBlocksInitialCaretPosition())},Wn=()=>e=>{let{select:t,dispatch:n}=e;const o=t.getSelectionStart(),r=t.getSelectionEnd();n.selectionChange({start:{clientId:o.clientId},end:{clientId:r.clientId}})},Kn=(e,t)=>n=>{let{registry:o,select:r,dispatch:l}=n;const i=[e,t];l({type:"MERGE_BLOCKS",blocks:i});const[s,c]=i,u=r.getBlock(s),d=(0,a.getBlockType)(u.name);if(!d)return;const p=r.getBlock(c);if(d&&!d.merge){const e=(0,a.switchToBlockType)(p,d.name);if(1!==(null==e?void 0:e.length))return void l.selectBlock(u.clientId);const[t]=e;return t.innerBlocks.length<1?void l.selectBlock(u.clientId):void o.batch((()=>{l.insertBlocks(t.innerBlocks,void 0,s),l.removeBlock(c),l.selectBlock(t.innerBlocks[0].clientId)}))}const m=(0,a.getBlockType)(p.name),{clientId:g,attributeKey:f,offset:h}=r.getSelectionStart(),v=(g===s?d:m).attributes[f],b=(g===s||g===c)&&void 0!==f&&void 0!==h&&!!v;v||("number"==typeof f?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 f):window.console.error("The RichText identifier prop does not match any attributes defined by the block."));const k=(0,a.cloneBlock)(u),_=(0,a.cloneBlock)(p);if(b){const e=g===s?k:_,t=e.attributes[f],n=(0,$.insert)((0,$.create)({html:t,...K(v)}),mn,h,h);e.attributes[f]=(0,$.toHTMLString)({value:n,...K(v)})}const y=u.name===p.name?[_]:(0,a.switchToBlockType)(_,u.name);if(!y||!y.length)return;const E=d.merge(k.attributes,y[0].attributes);if(b){const e=gn(E),t=E[e],n=(0,$.create)({html:t,...K(d.attributes[e])}),o=n.text.indexOf(mn),r=(0,$.remove)(n,o,o+1),i=(0,$.toHTMLString)({value:r,...K(d.attributes[e])});E[e]=i,l.selectionChange(u.clientId,e,o,o)}l.replaceBlocks([u.clientId,p.clientId],[{...u,attributes:{...u.attributes,...E}},...y.slice(1)],0)},qn=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=fn(e);const l=o.getBlockRootClientId(e[0]);o.canRemoveBlocks(e,l)&&(t&&r.selectPreviousBlock(e[0],t),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 Yn(e,t){return qn([e],t)}function Zn(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 Qn(e){return{type:"TOGGLE_BLOCK_MODE",clientId:e}}function Xn(){return{type:"START_TYPING"}}function Jn(){return{type:"STOP_TYPING"}}function eo(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return{type:"START_DRAGGING_BLOCKS",clientIds:e}}function to(){return{type:"STOP_DRAGGING_BLOCKS"}}function no(){return W()('wp.data.dispatch( "core/block-editor" ).enterFormattedText',{since:"6.1",version:"6.3"}),{type:"DO_NOTHING"}}function oo(){return W()('wp.data.dispatch( "core/block-editor" ).exitFormattedText',{since:"6.1",version:"6.3"}),{type:"DO_NOTHING"}}function ro(e,t,n,o){return"string"==typeof e?{type:"SELECTION_CHANGE",clientId:e,attributeKey:t,startOffset:n,endOffset:o}:{type:"SELECTION_CHANGE",...e}}const lo=(e,t,n)=>o=>{let{dispatch:r}=o;const l=(0,a.getDefaultBlockName)();if(!l)return;const i=(0,a.createBlock)(l,e);return r.insertBlock(i,n,t)};function io(e,t){return{type:"UPDATE_BLOCK_LIST_SETTINGS",clientId:e,settings:t}}function ao(e){return an(e,!0)}function so(e,t){return{type:"SAVE_REUSABLE_BLOCK_SUCCESS",id:e,updatedId:t}}function co(){return{type:"MARK_LAST_CHANGE_AS_PERSISTENT"}}function uo(){return{type:"MARK_NEXT_CHANGE_AS_NOT_PERSISTENT"}}const po=()=>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"})}))},mo=function(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return t=>{let{dispatch:n}=t;n.__unstableSetEditorMode(e?"navigation":"edit")}},go=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,pn.speak)((0,_.__)("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,pn.speak)((0,_.__)("You are currently in edit mode. To return to the navigation mode, press Escape.")):"zoom-out"===e&&(0,pn.speak)((0,_.__)("You are currently in zoom-out mode."))},fo=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,pn.speak)((0,_.__)("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."))}},ho=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;const l=o.getBlocksByClientId(e);if(l.some((e=>!e)))return;const i=l.map((e=>e.name));if(i.some((e=>!(0,a.hasBlockSupport)(e,"multiple",!0))))return;const s=o.getBlockRootClientId(e[0]),c=fn(e),u=o.getBlockIndex(c[c.length-1]),d=l.map((e=>(0,a.__experimentalCloneSanitizedBlock)(e)));return r.insertBlocks(d,u+1,s,t),d.length>1&&t&&r.multiSelect(d[0].clientId,d[d.length-1].clientId),d.map((e=>e.clientId))}},vo=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)},bo=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 ko(e,t){return{type:"TOGGLE_BLOCK_HIGHLIGHT",clientId:e,isHighlighted:t}}const _o=e=>async t=>{let{dispatch:n}=t;n(ko(e,!0)),await new Promise((e=>setTimeout(e,150))),n(ko(e,!1))};function yo(e,t){return{type:"SET_HAS_CONTROLLED_INNER_BLOCKS",hasControlledInnerBlocks:t,clientId:e}}function Eo(e){return{type:"SET_BLOCK_VISIBILITY",updates:e}}function Co(e){return{type:"SET_TEMPORARILY_EDITING_AS_BLOCKS",temporarilyEditingAsBlocks:e}}const So="core/block-editor";var wo=window.wp.privateApis;const{lock:Bo,unlock:Io}=(0,wo.__dangerousOptInToUnstableAPIsOnlyForCoreModules)("I know using unstable features means my plugin or theme will inevitably break on the next WordPress release.","@wordpress/block-editor"),xo={reducer:D,selectors:e,actions:l},To=(0,g.createReduxStore)(So,{...xo,persist:["preferences"]}),Mo=(0,g.registerStore)(So,{...xo,persist:["preferences"]});Io(Mo).registerPrivateActions(t),Io(Mo).registerPrivateSelectors(r);const No={name:"",isSelected:!1},Po=(0,u.createContext)(No),{Provider:Lo}=Po;function Ro(){return(0,u.useContext)(Po)}function Ao(){const{isSelected:e,clientId:t,name:n}=Ro();return(0,g.useSelect)((o=>{if(e)return!0;const{getBlockName:r,isFirstMultiSelectedBlock:l,getMultiSelectedBlockClientIds:i}=o(To);return!!l(t)&&i().every((e=>r(e)===n))}),[t,e,n])}function Oo(e){let{group:t="default",controls:n,children:o,__experimentalShareWithChildBlocks:r=!1}=e;const l=function(e,t){const n=Ao(),{clientId:o}=Ro(),r=(0,g.useSelect)((e=>{const{getBlockName:n,hasSelectedInnerBlock:r}=e(To),{hasBlockSupport:l}=e(a.store);return t&&l(n(o),"__experimentalExposeControlsToChildren",!1)&&r(o)}),[t,o]);var l;return n?null===(l=v[e])||void 0===l?void 0:l.Fill:r?v.parent.Fill:null}(t,r);return l?(0,u.createElement)(h.__experimentalStyleProvider,{document:document},(0,u.createElement)(l,null,(e=>{const r=(0,f.isEmpty)(e)?null:e;return(0,u.createElement)(h.__experimentalToolbarContext.Provider,{value:r},"default"===t&&(0,u.createElement)(h.ToolbarGroup,{controls:n}),o)}))):null}function Do(e){let{group:t="default",...n}=e;const o=(0,u.useContext)(h.__experimentalToolbarContext),r=v[t].Slot,l=(0,h.__experimentalUseSlotFills)(r.__unstableName);return Boolean(l&&l.length)?"default"===t?(0,u.createElement)(r,c({},n,{bubblesVirtually:!0,fillProps:o})):(0,u.createElement)(h.ToolbarGroup,null,(0,u.createElement)(r,c({},n,{bubblesVirtually:!0,fillProps:o}))):null}const zo=Oo;zo.Slot=Do;const Fo=e=>(0,u.createElement)(Oo,c({group:"inline"},e));Fo.Slot=e=>(0,u.createElement)(Do,c({group:"inline"},e));var Vo=zo;var Ho=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"M9 9v6h11V9H9zM4 20h1.5V4H4v16z"}));var Go=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"M20 9h-7.2V4h-1.6v5H4v6h7.2v5h1.6v-5H20z"}));var Uo=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"M4 15h11V9H4v6zM18.5 4v16H20V4h-1.5z"}));var $o=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"M9 15h6V9H9v6zm-5 5h1.5V4H4v16zM18.5 4v16H20V4h-1.5z"}));var jo=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"M4 4H5.5V20H4V4ZM7 10L17 10V14L7 14V10ZM20 4H18.5V20H20V4Z"}));var Wo=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"m14.5 6.5-1 1 3.7 3.7H4v1.6h13.2l-3.7 3.7 1 1 5.6-5.5z"}));var Ko=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"m16.5 13.5-3.7 3.7V4h-1.5v13.2l-3.8-3.7-1 1 5.5 5.6 5.5-5.6z"}));function qo(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 Yo(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+=`${qo(e,t.selector.trim())} { `,i+=Object.entries(t.rules).map((e=>{let[t,n]=e;return`${t}: ${n||o}`})).join("; "),i+="; }"})),i}function Zo(e){const{contentSize:t,wideSize:n}=e,o={},r=/^(?!0)\d+(px|em|rem|vw|vh|%)?$/i;return r.test(t)&&(o.none=(0,_.sprintf)((0,_.__)("Max %s wide"),t)),r.test(n)&&(o.wide=(0,_.sprintf)((0,_.__)("Max %s wide"),n)),o}const Qo=(0,u.createContext)({refs:new Map,callbacks:new Map});function Xo(e){let{children:t}=e;const n=(0,u.useMemo)((()=>({refs:new Map,callbacks:new Map})),[]);return(0,u.createElement)(Qo.Provider,{value:n},t)}function Jo(e){const{refs:t,callbacks:n}=(0,u.useContext)(Qo),o=(0,u.useRef)();return(0,u.useLayoutEffect)((()=>(t.set(o,e),()=>{t.delete(o)})),[e]),(0,m.useRefEffect)((t=>{o.current=t,n.forEach(((n,o)=>{e===n&&o(t)}))}),[e])}function er(e){const{refs:t}=(0,u.useContext)(Qo),n=(0,u.useRef)();return n.current=e,(0,u.useMemo)((()=>({get current(){let e=null;for(const[o,r]of t.entries())r===n.current&&o.current&&(e=o.current);return e}})),[])}function tr(e){const{callbacks:t}=(0,u.useContext)(Qo),n=er(e),[o,r]=(0,u.useState)(null);return(0,u.useLayoutEffect)((()=>{if(e)return t.set(r,e),()=>{t.delete(r)}}),[e]),n.current||o}function nr(e){return!(null==e||!e.includes)&&("0"===e||e.includes("var:preset|spacing|"))}function or(e){if(!e)return;const t=e.match(/var:preset\|spacing\|(.+)/);return t?`var(--wp--preset--spacing--${t[1]})`:e}function rr(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 lr={all:(0,_.__)("All sides"),top:(0,_.__)("Top"),bottom:(0,_.__)("Bottom"),left:(0,_.__)("Left"),right:(0,_.__)("Right"),mixed:(0,_.__)("Mixed"),vertical:(0,_.__)("Vertical"),horizontal:(0,_.__)("Horizontal")},ir={top:void 0,right:void 0,bottom:void 0,left:void 0},ar=["top","right","bottom","left"];function sr(e){return e.sort(((t,n)=>e.filter((e=>e===t)).length-e.filter((e=>e===n)).length)).pop()}function cr(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ar;return Object.values(e).length>=1&&Object.values(e).length1}function ur(e){return null!=e&&Object.values(e).filter((e=>!!e)).length>0}var dr=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.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 pr=["color","border","dimensions","typography","spacing"],mr={"color.palette":e=>e.colors,"color.gradients":e=>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=>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},gr={"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 fr(e){const{name:t,clientId:n}=Ro();return(0,g.useSelect)((o=>{if(pr.includes(e))return void console.warn("Top level useSetting paths are disabled. Please use a subpath to query the information needed.");let r=(0,s.applyFilters)("blockEditor.useSetting.before",void 0,e,n,t);if(void 0!==r)return r;const l=(e=>gr[e]||e)(e),i=[n,...o(To).getBlockParents(n,!0)];for(const e of i){const n=o(To).getBlockName(e);if((0,a.hasBlockSupport)(n,"__experimentalSettings",!1)){var c;const n=o(To).getBlockAttributes(e);if(r=null!==(c=(0,f.get)(n,`settings.blocks.${t}.${l}`))&&void 0!==c?c:(0,f.get)(n,`settings.${l}`),void 0!==r)break}}const u=o(To).getSettings();if(void 0===r){var d;const e=`__experimentalFeatures.${l}`,n=`__experimentalFeatures.blocks.${t}.${l}`;r=null!==(d=(0,f.get)(u,n))&&void 0!==d?d:(0,f.get)(u,e)}var p,m;if(void 0!==r)return a.__EXPERIMENTAL_PATHS_WITH_MERGE[l]?null!==(p=null!==(m=r.custom)&&void 0!==m?m:r.theme)&&void 0!==p?p:r.default:r;const g=mr[l]?mr[l](u):void 0;return void 0!==g?g:"typography.dropCap"===l||void 0}),[t,n,e])}const hr={px:{max:300,steps:1},"%":{max:100,steps:1},vw:{max:100,steps:1},vh:{max:100,steps:1},em:{max:10,steps:.1},rm:{max:10,steps:.1}};function vr(e){var t,n,o,r,l;let{spacingSizes:i,value:a,side:s,onChange:c,isMixed:d=!1,type:m,minimumCustomValue:f,onMouseOver:v,onMouseOut:b}=e;a=function(e,t){if(nr(e))return e;const n=t.find((t=>String(t.size)===String(e)));return null!=n&&n.slug?`var:preset|spacing|${n.slug}`:e}(a,i);let k=i;const y=i.length<=8,E=(0,g.useSelect)((e=>{const t=e(To).getSettings();return null==t?void 0:t.disableCustomSpacingSizes})),[C,S]=(0,u.useState)(!E&&void 0!==a&&!nr(a)),w=(0,h.__experimentalUseCustomUnits)({availableUnits:fr("spacing.units")||["px","em","rem"]});let B=null;!y&&!C&&void 0!==a&&(!nr(a)||nr(a)&&d)?(k=[...i,{name:d?(0,_.__)("Mixed"):(0,_.sprintf)((0,_.__)("Custom (%s)"),a),slug:"custom",size:a}],B=k.length-1):d||(B=C?function(e,t){if(!nr(e))return e;const n=rr(e),o=t.find((e=>String(e.slug)===n));return null==o?void 0:o.size}(a,i):function(e,t){if(void 0===e)return 0;const n=0===parseFloat(e,10)?"0":rr(e),o=t.findIndex((e=>String(e.slug)===n));return-1!==o?o:NaN}(a,i));const I=(0,u.useMemo)((()=>(0,h.__experimentalParseQuantityAndUnitFromRawValue)(B)),[B])[1]||w[0].value,x=e=>{var t;return void 0===a||null===(t=i[e])||void 0===t?void 0:t.name},T=parseFloat(B,10),M=(e,t)=>{var n;const o=parseInt(e,10);if("selectList"===t){if(0===o)return;if(1===o)return"0"}else if(0===o)return"0";return`var:preset|spacing|${null===(n=i[e])||void 0===n?void 0:n.slug}`},N=d?(0,_.__)("Mixed"):null,P=d?(0,_.__)("Mixed"):x(B),L=k.map(((e,t)=>({key:t,name:e.name}))),R=i.map(((e,t)=>({value:t,label:void 0}))),A=(0,_.sprintf)((0,_.__)("%1$s %2$s"),lr[s],null==m?void 0:m.toLowerCase()),O=y&&!C&&void 0!==P;return(0,u.createElement)(u.Fragment,null,"all"!==s&&(0,u.createElement)(h.__experimentalHStack,{className:"components-spacing-sizes-control__side-labels"},(0,u.createElement)(h.BaseControl.VisualLabel,{className:"components-spacing-sizes-control__side-label"},lr[s]),O&&(0,u.createElement)(h.BaseControl.VisualLabel,{className:"components-spacing-sizes-control__hint-single"},P)),"all"===s&&O&&(0,u.createElement)(h.BaseControl.VisualLabel,{className:"components-spacing-sizes-control__hint-all"},P),!E&&(0,u.createElement)(h.Button,{label:C?(0,_.__)("Use size preset"):(0,_.__)("Set custom size"),icon:dr,onClick:()=>{S(!C)},isPressed:C,isSmall:!0,className:p()({"components-spacing-sizes-control__custom-toggle-all":"all"===s,"components-spacing-sizes-control__custom-toggle-single":"all"!==s}),iconSize:24}),C&&(0,u.createElement)(u.Fragment,null,(0,u.createElement)(h.__experimentalUnitControl,{onMouseOver:v,onMouseOut:b,onFocus:v,onBlur:b,onChange:e=>c((e=>isNaN(parseFloat(e))?void 0:e)(e)),value:B,units:w,min:f,placeholder:N,disableUnits:d,label:A,hideLabelFromVision:!0,className:"components-spacing-sizes-control__custom-value-input",size:"__unstable-large"}),(0,u.createElement)(h.RangeControl,{onMouseOver:v,onMouseOut:b,onFocus:v,onBlur:b,value:T,min:0,max:null!==(t=null===(n=hr[I])||void 0===n?void 0:n.max)&&void 0!==t?t:10,step:null!==(o=null===(r=hr[I])||void 0===r?void 0:r.steps)&&void 0!==o?o:.1,withInputField:!1,onChange:e=>{c([e,I].join(""))},className:"components-spacing-sizes-control__custom-value-range",__nextHasNoMarginBottom:!0})),y&&!C&&(0,u.createElement)(h.RangeControl,{onMouseOver:v,onMouseOut:b,className:"components-spacing-sizes-control__range-control",value:B,onChange:e=>c(M(e)),onMouseDown:e=>{var t;(null==e||null===(t=e.nativeEvent)||void 0===t?void 0:t.offsetX)<35&&void 0===a&&c("0")},withInputField:!1,"aria-valuenow":B,"aria-valuetext":null===(l=i[B])||void 0===l?void 0:l.name,renderTooltipContent:x,min:0,max:i.length-1,marks:R,label:A,hideLabelFromVision:!0,__nextHasNoMarginBottom:!0,onFocus:v,onBlur:b}),!y&&!C&&(0,u.createElement)(h.CustomSelectControl,{className:"components-spacing-sizes-control__custom-select-control",value:L.find((e=>e.key===B))||"",onChange:e=>{c(M(e.selectedItem.key,"selectList"))},options:L,label:A,hideLabelFromVision:!0,__nextUnconstrainedWidth:!0,size:"__unstable-large",onMouseOver:v,onMouseOut:b,onFocus:v,onBlur:b}))}function br(e){let{onChange:t,values:n,sides:o,spacingSizes:r,type:l,minimumCustomValue:i,onMouseOver:a,onMouseOut:s}=e;const c=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return sr(Object.values(e))}(n),d=ur(n)&&cr(n,o);return(0,u.createElement)(vr,{value:c,onChange:e=>{const r=(0,h.__experimentalApplyValueToSides)(n,e,o);t(r)},side:"all",spacingSizes:r,isMixed:d,type:l,minimumCustomValue:i,onMouseOver:a,onMouseOut:s})}function kr(e){let{values:t,sides:n,onChange:o,spacingSizes:r,type:l,minimumCustomValue:i,onMouseOver:a,onMouseOut:s}=e;const c=null!=n&&n.length?ar.filter((e=>n.includes(e))):ar,d=e=>n=>{const r={...t};r[e]=n,o(r)};return(0,u.createElement)(u.Fragment,null,c.map((e=>(0,u.createElement)(vr,{value:t[e],label:lr[e],key:`spacing-sizes-control-${e}`,withInputField:!1,side:e,onChange:d(e),spacingSizes:r,type:l,minimumCustomValue:i,onMouseOver:a,onMouseOut:s}))))}const _r=["vertical","horizontal"];function yr(e){let{onChange:t,values:n,sides:o,spacingSizes:r,type:l,minimumCustomValue:i,onMouseOver:a,onMouseOut:s}=e;const c=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)},d=null!=o&&o.length?_r.filter((e=>o.includes(e))):_r;return(0,u.createElement)(u.Fragment,null,d.map((e=>{const t="vertical"===e?n.top:n.left;return(0,u.createElement)(vr,{value:t,onChange:c(e),label:lr[e],key:`spacing-sizes-control-${e}`,withInputField:!1,side:e,spacingSizes:r,type:l,minimumCustomValue:i,onMouseOver:a,onMouseOut:s})})))}var Er=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.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 Cr=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.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 Sr(e){let{isLinked:t,onClick:n}=e;const o=t?(0,_.__)("Unlink sides"):(0,_.__)("Link sides");return(0,u.createElement)(h.Tooltip,{text:o},(0,u.createElement)("span",{className:"component-spacing-sizes-control__linked-button"},(0,u.createElement)(h.Button,{isSmall:!0,icon:t?Er:Cr,iconSize:24,"aria-label":o,onClick:n})))}function wr(e){let{inputProps:t,onChange:n,label:o=(0,_.__)("Spacing Control"),values:r,sides:l,splitOnAxis:i=!1,useSelect:a,minimumCustomValue:s=0,onMouseOver:d,onMouseOut:m}=e;const g=[{name:0,slug:"0",size:0},...fr("spacing.spacingSizes")||[]];g.length>8&&g.unshift({name:(0,_.__)("Default"),slug:"default",size:void 0});const f=r||ir,v=ur(r),b=1===(null==l?void 0:l.length),[k,y]=(0,u.useState)(!v||!cr(f,l)||b),E={...t,onChange:e=>{const t={...r,...e};n(t)},isLinked:k,sides:l,values:f,spacingSizes:g,useSelect:a,type:o,minimumCustomValue:s,onMouseOver:d,onMouseOut:m};return(0,u.createElement)("fieldset",{className:p()("component-spacing-sizes-control",{"is-unlinked":!k})},(0,u.createElement)(h.BaseControl.VisualLabel,{as:"legend"},o),!b&&(0,u.createElement)(Sr,{onClick:()=>{y(!k)},isLinked:k}),k&&(0,u.createElement)(br,c({"aria-label":o},E)),!k&&i&&(0,u.createElement)(yr,E),!k&&!i&&(0,u.createElement)(kr,E))}window.wp.warning;const Br=(0,h.createSlotFill)("InspectorControls"),Ir=(0,h.createSlotFill)("InspectorAdvancedControls"),xr=(0,h.createSlotFill)("InspectorControlsBorder"),Tr=(0,h.createSlotFill)("InspectorControlsColor"),Mr=(0,h.createSlotFill)("InspectorControlsDimensions"),Nr=(0,h.createSlotFill)("InspectorControlsPosition"),Pr=(0,h.createSlotFill)("InspectorControlsTypography");var Lr={default:Br,advanced:Ir,border:xr,color:Tr,dimensions:Mr,list:(0,h.createSlotFill)("InspectorControlsListView"),settings:Br,styles:(0,h.createSlotFill)("InspectorControlsStyles"),typography:Pr,position:Nr};function Rr(e){var t;let{children:n,group:o="default",__experimentalGroup:r}=e;r&&(W()("`__experimentalGroup` property in `InspectorControlsFill`",{since:"6.2",version:"6.4",alternative:"`group`"}),o=r);const l=Ao(),i=null===(t=Lr[o])||void 0===t?void 0:t.Fill;return i?l?(0,u.createElement)(h.__experimentalStyleProvider,{document:document},(0,u.createElement)(i,null,(e=>{const t=(0,f.isEmpty)(e)?null:e;return(0,u.createElement)(h.__experimentalToolsPanelContext.Provider,{value:t},n)}))):null:("undefined"!=typeof process&&process.env,null)}const Ar=e=>{if(null===e||"object"!=typeof e||Array.isArray(e))return e;const t=Object.fromEntries(Object.entries((0,f.mapValues)(e,Ar)).filter((e=>{let[,t]=e;return Boolean(t)})));return(0,f.isEmpty)(t)?void 0:t};function Or(e){return"object"==typeof e?{...Object.fromEntries(Object.entries(e).map((e=>{let[t,n]=e;return[t,Or(n)]})))}:e}function Dr(e,t,n){const o=function(e){return Array.isArray(e)?e:"number"==typeof e?[e.toString()]:[e]}(t),r=e?Or(e):{};return o.reduce(((e,t,r)=>(void 0===e[t]&&(e[t]={}),r===o.length-1&&(e[t]=n),e[t])),r),r}function zr(e,t,n,o,r,l){var i;if(Object.values(null!=e?e:{}).every((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,f.get)(a,e);t&&(c={...c,attributes:Dr(c.attributes,e,t)})}))})),c}function Fr(e,t,n){const o=(0,a.getBlockSupport)(e,t),r=null==o?void 0:o.__experimentalSkipSerialization;return Array.isArray(r)?r.includes(n):r}function Vr(e){let{children:t,group:n,label:o}=e;const{updateBlockAttributes:r}=(0,g.useDispatch)(To),{getBlockAttributes:l,getMultiSelectedBlockClientIds:i,getSelectedBlockClientId:a,hasMultiSelection:s}=(0,g.useSelect)(To),c=a(),d=(0,u.useCallback)((function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t={},n=s()?i():[c];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,s,c,r]);return(0,u.createElement)(h.__experimentalToolsPanel,{className:`${n}-block-support-panel`,label:o,resetAll:d,key:c,panelId:c,hasInnerWrapper:!0,shouldRenderPlaceholderItems:!0,__experimentalFirstVisibleItemClass:"first",__experimentalLastVisibleItemClass:"last"},t)}function Hr(e){let{Slot:t,...n}=e;const o=(0,u.useContext)(h.__experimentalToolsPanelContext);return(0,u.createElement)(t,c({},n,{fillProps:o,bubblesVirtually:!0}))}function Gr(e){var t;let{__experimentalGroup:n,group:o="default",label:r,...l}=e;n&&(W()("`__experimentalGroup` property in `InspectorControlsSlot`",{since:"6.2",version:"6.4",alternative:"`group`"}),o=n);const i=null===(t=Lr[o])||void 0===t?void 0:t.Slot,a=(0,h.__experimentalUseSlot)(null==i?void 0:i.__unstableName),s=(0,h.__experimentalUseSlotFills)(null==i?void 0:i.__unstableName);if(!i||!a)return"undefined"!=typeof process&&process.env,null;return Boolean(s&&s.length)?r?(0,u.createElement)(Vr,{group:o,label:r},(0,u.createElement)(Hr,c({},l,{Slot:i}))):(0,u.createElement)(i,c({},l,{bubblesVirtually:!0})):null}const Ur=Rr;Ur.Slot=Gr;const $r=e=>(0,u.createElement)(Rr,c({},e,{group:"advanced"}));$r.Slot=e=>(0,u.createElement)(Gr,c({},e,{group:"advanced"})),$r.slotName="InspectorAdvancedControls";var jr=Ur,Wr=window.wp.isShallowEqual,Kr=n.n(Wr);var qr=function(e){return(0,m.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 Yr=Number.MAX_SAFE_INTEGER;var Zr=(0,u.forwardRef)((function(e,t){let{clientId:n,bottomClientId:o,children:r,__unstableRefreshSize:l,__unstableCoverTarget:i=!1,__unstablePopoverSlot:a,__unstableContentRef:s,shift:d=!0,...g}=e;const f=tr(n),v=tr(null!=o?o:n),b=(0,m.useMergeRefs)([t,qr(s)]),[k,_]=(0,u.useReducer)((e=>(e+1)%Yr),0);(0,u.useLayoutEffect)((()=>{if(!f)return;const e=new window.MutationObserver(_);return e.observe(f,{attributes:!0}),()=>{e.disconnect()}}),[f]);const y=(0,u.useMemo)((()=>k<0||!f||v!==f?{}:{position:"absolute",width:f.offsetWidth,height:f.offsetHeight}),[f,v,l,k]),E=(0,u.useMemo)((()=>{if(!(k<0||!f||o&&!v))return{getBoundingClientRect(){var e,t,n,o;const r=f.getBoundingClientRect(),l=null==v?void 0:v.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:f.ownerDocument}}),[o,v,f,k]);return!f||o&&!v?null:(0,u.createElement)(h.Popover,c({ref:b,animate:!1,focusOnMount:!1,anchor:E,__unstableSlotName:a||null,placement:"top-start",resize:!1,flip:!1,shift:d},g,{className:p()("block-editor-block-popover",g.className),variant:"unstyled"}),i&&(0,u.createElement)("div",{style:y},r),!i&&r)}));function Qr(e){const t=(0,a.getBlockSupport)(e,hl);return!!(!0===t||null!=t&&t.margin)}function Xr(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!fr("spacing.margin"),n=!Cl(e,"margin");return!Qr(e)||t||n}function Jr(e){var t,n;const{name:o,attributes:{style:r},setAttributes:l,onMouseOver:i,onMouseOut:a}=e,s=fr("spacing.spacingSizes"),c=(0,h.__experimentalUseCustomUnits)({availableUnits:fr("spacing.units")||["%","px","em","rem","vw"]}),d=El(o,"margin"),p=d&&d.some((e=>bl.includes(e)));if(Xr(e))return null;const m=e=>{const t={...r,spacing:{...null==r?void 0:r.spacing,margin:e}};l({style:Ar(t)})};return u.Platform.select({web:(0,u.createElement)(u.Fragment,null,(!s||0===(null==s?void 0:s.length))&&(0,u.createElement)(h.__experimentalBoxControl,{values:null==r||null===(t=r.spacing)||void 0===t?void 0:t.margin,onChange:m,label:(0,_.__)("Margin"),sides:d,units:c,allowReset:!1,splitOnAxis:p,onMouseOver:i,onMouseOut:a}),(null==s?void 0:s.length)>0&&(0,u.createElement)(wr,{values:null==r||null===(n=r.spacing)||void 0===n?void 0:n.margin,onChange:m,label:(0,_.__)("Margin"),sides:d,units:c,allowReset:!1,splitOnAxis:!1,onMouseOver:i,onMouseOut:a})),native:null})}function el(e){var t,n;let{clientId:o,attributes:r,forceShow:l}=e;const i=null==r||null===(t=r.style)||void 0===t||null===(n=t.spacing)||void 0===n?void 0:n.margin,a=(0,u.useMemo)((()=>{const e=null!=i&&i.top?or(null==i?void 0:i.top):0,t=null!=i&&i.right?or(null==i?void 0:i.right):0,n=null!=i&&i.bottom?or(null==i?void 0:i.bottom):0,o=null!=i&&i.left?or(null==i?void 0:i.left):0;return{borderTopWidth:e,borderRightWidth:t,borderBottomWidth:n,borderLeftWidth:o,top:e?`calc(${e} * -1)`:0,right:t?`calc(${t} * -1)`:0,bottom:n?`calc(${n} * -1)`:0,left:o?`calc(${o} * -1)`:0}}),[i]),[s,c]=(0,u.useState)(!1),d=(0,u.useRef)(i),p=(0,u.useRef)();return(0,u.useEffect)((()=>(Kr()(i,d.current)||l||(c(!0),d.current=i,p.current=setTimeout((()=>{c(!1)}),400)),()=>{c(!1),p.current&&window.clearTimeout(p.current)})),[i,l]),s||l?(0,u.createElement)(Zr,{clientId:o,__unstableCoverTarget:!0,__unstableRefreshSize:i,__unstablePopoverSlot:"block-toolbar",shift:!1},(0,u.createElement)("div",{className:"block-editor__padding-visualizer",style:a})):null}const tl={px:{max:1e3,step:1},"%":{max:100,step:1},vw:{max:100,step:1},vh:{max:100,step:1},em:{max:50,step:.1},rem:{max:50,step:.1}};function nl(e){var t,n,o,r,l;let{label:i=(0,_.__)("Height"),onChange:a,value:s}=e;const c=parseFloat(s),d=(0,h.__experimentalUseCustomUnits)({availableUnits:fr("spacing.units")||["%","px","em","rem","vh","vw"]}),p=(0,u.useMemo)((()=>(0,h.__experimentalParseQuantityAndUnitFromRawValue)(s)),[s])[1]||(null===(t=d[0])||void 0===t?void 0:t.value)||"px";return(0,u.createElement)("fieldset",{className:"block-editor-height-control"},(0,u.createElement)(h.BaseControl.VisualLabel,{as:"legend"},i),(0,u.createElement)(h.Flex,null,(0,u.createElement)(h.FlexItem,{isBlock:!0},(0,u.createElement)(h.__experimentalUnitControl,{value:s,units:d,onChange:a,onUnitChange:e=>{const[t,n]=(0,h.__experimentalParseQuantityAndUnitFromRawValue)(s);["em","rem"].includes(e)&&"px"===n?a((t/16).toFixed(2)+e):["em","rem"].includes(n)&&"px"===e?a(Math.round(16*t)+e):["vh","vw","%"].includes(e)&&t>100&&a(100+e)},min:0,size:"__unstable-large"})),(0,u.createElement)(h.FlexItem,{isBlock:!0},(0,u.createElement)(h.__experimentalSpacer,{marginX:2,marginBottom:0},(0,u.createElement)(h.RangeControl,{value:c,min:0,max:null!==(n=null===(o=tl[p])||void 0===o?void 0:o.max)&&void 0!==n?n:100,step:null!==(r=null===(l=tl[p])||void 0===l?void 0:l.step)&&void 0!==r?r:.1,withInputField:!1,onChange:e=>{a([e,p].join(""))},__nextHasNoMarginBottom:!0})))))}function ol(e){const t=(0,a.getBlockSupport)(e,fl);return!!(!0===t||null!=t&&t.minHeight)}function rl(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!fr("dimensions.minHeight");return!ol(e)||t}function ll(e){var t;const{attributes:{style:n},setAttributes:o}=e;if(rl(e))return null;return(0,u.createElement)(nl,{label:(0,_.__)("Min. height"),value:null==n||null===(t=n.dimensions)||void 0===t?void 0:t.minHeight,onChange:e=>{const t={...n,dimensions:{...null==n?void 0:n.dimensions,minHeight:e}};o({style:Ar(t)})}})}function il(e){const t=(0,a.getBlockSupport)(e,hl);return!!(!0===t||null!=t&&t.padding)}function al(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!fr("spacing.padding"),n=!Cl(e,"padding");return!il(e)||t||n}function sl(e){var t,n;const{name:o,attributes:{style:r},setAttributes:l,onMouseOver:i,onMouseOut:a}=e,s=fr("spacing.spacingSizes"),c=(0,h.__experimentalUseCustomUnits)({availableUnits:fr("spacing.units")||["%","px","em","rem","vw"]}),d=El(o,"padding"),p=d&&d.some((e=>bl.includes(e)));if(al(e))return null;const m=e=>{const t={...r,spacing:{...null==r?void 0:r.spacing,padding:e}};l({style:Ar(t)})};return u.Platform.select({web:(0,u.createElement)(u.Fragment,null,(!s||0===(null==s?void 0:s.length))&&(0,u.createElement)(h.__experimentalBoxControl,{values:null==r||null===(t=r.spacing)||void 0===t?void 0:t.padding,onChange:m,label:(0,_.__)("Padding"),sides:d,units:c,allowReset:!1,splitOnAxis:p,onMouseOver:i,onMouseOut:a}),(null==s?void 0:s.length)>0&&(0,u.createElement)(wr,{values:null==r||null===(n=r.spacing)||void 0===n?void 0:n.padding,onChange:m,label:(0,_.__)("Padding"),sides:d,units:c,allowReset:!1,splitOnAxis:p,onMouseOver:i,onMouseOut:a})),native:null})}function cl(e){var t,n;let{clientId:o,attributes:r,forceShow:l}=e;const i=null==r||null===(t=r.style)||void 0===t||null===(n=t.spacing)||void 0===n?void 0:n.padding,a=(0,u.useMemo)((()=>({borderTopWidth:null!=i&&i.top?or(null==i?void 0:i.top):0,borderRightWidth:null!=i&&i.right?or(null==i?void 0:i.right):0,borderBottomWidth:null!=i&&i.bottom?or(null==i?void 0:i.bottom):0,borderLeftWidth:null!=i&&i.left?or(null==i?void 0:i.left):0})),[i]),[s,c]=(0,u.useState)(!1),d=(0,u.useRef)(i),p=(0,u.useRef)();return(0,u.useEffect)((()=>(Kr()(i,d.current)||l||(c(!0),d.current=i,p.current=setTimeout((()=>{c(!1)}),400)),()=>{c(!1),p.current&&window.clearTimeout(p.current)})),[i,l]),s||l?(0,u.createElement)(Zr,{clientId:o,__unstableCoverTarget:!0,__unstableRefreshSize:i,__unstablePopoverSlot:"block-toolbar",shift:!1},(0,u.createElement)("div",{className:"block-editor__padding-visualizer",style:a})):null}function ul(e,t){const{orientation:n="horizontal"}=t;return"fill"===e?(0,_.__)("Stretch to fill available space."):"fixed"===e?"horizontal"===n?(0,_.__)("Specify a fixed width."):(0,_.__)("Specify a fixed height."):(0,_.__)("Fit contents.")}function dl(e){let{attributes:t,setAttributes:n,__unstableParentLayout:o}=e;const{style:r={}}=t,{layout:l={}}=r,{selfStretch:i,flexSize:a}=l;return(0,u.useEffect)((()=>{"fixed"!==i||a||n({style:{...r,layout:{...l,selfStretch:"fit"}}})}),[]),(0,u.createElement)(u.Fragment,null,(0,u.createElement)(h.__experimentalToggleGroupControl,{__nextHasNoMarginBottom:!0,size:"__unstable-large",label:gl(o),value:i||"fit",help:ul(i,o),onChange:e=>{const t="fixed"!==e?null:a;n({style:{...r,layout:{...l,selfStretch:e,flexSize:t}}})},isBlock:!0},(0,u.createElement)(h.__experimentalToggleGroupControlOption,{key:"fit",value:"fit",label:(0,_.__)("Fit")}),(0,u.createElement)(h.__experimentalToggleGroupControlOption,{key:"fill",value:"fill",label:(0,_.__)("Fill")}),(0,u.createElement)(h.__experimentalToggleGroupControlOption,{key:"fixed",value:"fixed",label:(0,_.__)("Fixed")})),"fixed"===i&&(0,u.createElement)(h.__experimentalUnitControl,{size:"__unstable-large",onChange:e=>{n({style:{...r,layout:{...l,flexSize:e}}})},value:a}))}function pl(e){let{__unstableParentLayout:t={}}=e;const{type:n="default",default:{type:o="default"}={},allowSizingOnChildren:r=!1}=t;return("flex"===o||"flex"===n)&&r}function ml(e){const t=!fr("layout");return!pl(e)||t}function gl(e){const{orientation:t="horizontal"}=e;return"horizontal"===t?(0,_.__)("Width"):(0,_.__)("Height")}const fl="dimensions",hl="spacing",vl=["top","right","bottom","left"],bl=["vertical","horizontal"];function kl(){const[e,t]=(0,u.useState)(!1),{hideBlockInterface:n,showBlockInterface:o}=Io((0,g.useDispatch)(To));return{isMouseOver:e,onMouseOver:e=>{e.stopPropagation(),n(),t(!0)},onMouseOut:e=>{e.stopPropagation(),o(),t(!1)}}}function _l(e){const t=Il(e),n=al(e),o=Xr(e),r=rl(e),l=ml(e),i=yl(e),s=function(e){if("web"!==u.Platform.OS)return!1;const{name:t}=e;return Sl(t)||ol(t)||il(t)||Qr(t)||pl(e)}(e),d=fr("spacing.spacingSizes"),m=kl(),g=kl();if(i||!s)return null;const f=(0,a.getBlockSupport)(e.name,[fl,"__experimentalDefaultControls"]),v=(0,a.getBlockSupport)(e.name,[hl,"__experimentalDefaultControls"]),b=(e,t)=>n=>{var o;return{...n,style:{...n.style,[t]:{...null===(o=n.style)||void 0===o?void 0:o[t],[e]:void 0}}}},k=p()({"tools-panel-item-spacing":d&&d.length>0}),{__unstableParentLayout:y}=e;return(0,u.createElement)(u.Fragment,null,(0,u.createElement)(jr,{group:"dimensions"},!n&&(0,u.createElement)(h.__experimentalToolsPanelItem,{className:k,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,_.__)("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:b("padding","spacing"),isShownByDefault:null==v?void 0:v.padding,panelId:e.clientId},(0,u.createElement)(sl,c({onMouseOver:m.onMouseOver,onMouseOut:m.onMouseOut},e))),!o&&(0,u.createElement)(h.__experimentalToolsPanelItem,{className:k,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,_.__)("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:b("margin","spacing"),isShownByDefault:null==v?void 0:v.margin,panelId:e.clientId},(0,u.createElement)(Jr,c({onMouseOver:g.onMouseOver,onMouseOut:g.onMouseOut},e))),!t&&(0,u.createElement)(h.__experimentalToolsPanelItem,{className:k,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,_.__)("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:b("blockGap","spacing"),isShownByDefault:null==v?void 0:v.blockGap,panelId:e.clientId},(0,u.createElement)(xl,e)),!r&&(0,u.createElement)(h.__experimentalToolsPanelItem,{hasValue:()=>function(e){var t,n;return void 0!==(null===(t=e.attributes.style)||void 0===t||null===(n=t.dimensions)||void 0===n?void 0:n.minHeight)}(e),label:(0,_.__)("Min. height"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:Ar({...o,dimensions:{...null==o?void 0:o.dimensions,minHeight:void 0}})})}(e),resetAllFilter:b("minHeight","dimensions"),isShownByDefault:null==f?void 0:f.minHeight,panelId:e.clientId},(0,u.createElement)(ll,e)),!l&&(0,u.createElement)(h.__experimentalVStack,{as:h.__experimentalToolsPanelItem,spacing:2,hasValue:()=>function(e){var t;return void 0!==(null===(t=e.attributes.style)||void 0===t?void 0:t.layout)}(e),label:gl(y),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:{...o,layout:void 0}})}(e),resetAllFilter:b("selfStretch","layout"),isShownByDefault:!1,panelId:e.clientId},(0,u.createElement)(dl,e))),!n&&(0,u.createElement)(cl,c({forceShow:m.isMouseOver},e)),!o&&(0,u.createElement)(el,c({forceShow:g.isMouseOver},e)))}const yl=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=Il(e),n=rl(e),o=al(e),r=Xr(e),l=ml(e);return t&&n&&o&&r&&l};function El(e,t){var n;const o=(0,a.getBlockSupport)(e,hl);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 Cl(e,t){const n=El(e,t);return!(n&&n.some((e=>vl.includes(e)))&&n.some((e=>bl.includes(e))))||(console.warn(`The ${t} support for the "${e}" block can not be configured to support both axial and arbitrary sides.`),!1)}function Sl(e){const t=(0,a.getBlockSupport)(e,hl);return!!(!0===t||null!=t&&t.blockGap)}function wl(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 Bl(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"0";const n=wl(e);if(!n)return null;const o=or(null==n?void 0:n.top)||t,r=or(null==n?void 0:n.left)||t;return o===r?o:`${o} ${r}`}function Il(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!fr("spacing.blockGap");return!Sl(e)||t}function xl(e){var t;const{clientId:n,attributes:{style:o},name:r,setAttributes:l}=e,i=fr("spacing.spacingSizes"),a=(0,h.__experimentalUseCustomUnits)({availableUnits:fr("spacing.units")||["%","px","em","rem","vw"]}),s=El(r,"blockGap"),c=er(n);if(Il(e))return null;const d=s&&s.some((e=>bl.includes(e))),p=e=>{var t;let n=e;e&&d?n={...wl(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;c.current&&i&&(null===(a=c.current.parentNode)||void 0===a||a.replaceChild(c.current,c.current))},m=wl(null==o||null===(t=o.spacing)||void 0===t?void 0:t.blockGap),g=d?{...m,right:null==m?void 0:m.left,bottom:null==m?void 0:m.top}:{top:null==m?void 0:m.top};return u.Platform.select({web:(0,u.createElement)(u.Fragment,null,(!i||0===(null==i?void 0:i.length))&&(d?(0,u.createElement)(h.__experimentalBoxControl,{label:(0,_.__)("Block spacing"),min:0,onChange:p,units:a,sides:s,values:g,allowReset:!1,splitOnAxis:d}):(0,u.createElement)(h.__experimentalUnitControl,{label:(0,_.__)("Block spacing"),__unstableInputWidth:"80px",min:0,onChange:p,units:a,value:g})),(null==i?void 0:i.length)>0&&(0,u.createElement)(wr,{values:g,onChange:p,label:(0,_.__)("Block spacing"),sides:d?s:["top"],units:a,allowReset:!1,splitOnAxis:d})),native:null})}const Tl=(0,u.createElement)(h.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(h.Path,{d:"M15 4H9v11h6V4zM4 18.5V20h16v-1.5H4z"})),Ml=(0,u.createElement)(h.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(h.Path,{d:"M20 11h-5V4H9v7H4v1.5h5V20h6v-7.5h5z"})),Nl=(0,u.createElement)(h.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(h.Path,{d:"M9 20h6V9H9v11zM4 4v1.5h16V4H4z"})),Pl=(0,u.createElement)(h.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(h.Path,{d:"M4 4L20 4L20 5.5L4 5.5L4 4ZM10 7L14 7L14 17L10 17L10 7ZM20 18.5L4 18.5L4 20L20 20L20 18.5Z"})),Ll=(0,u.createElement)(h.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(h.Path,{d:"M7 4H17V8L7 8V4ZM7 16L17 16V20L7 20V16ZM20 11.25H4V12.75H20V11.25Z"})),Rl={top:{icon:Nl,title:(0,_._x)("Align top","Block vertical alignment setting")},center:{icon:Ml,title:(0,_._x)("Align middle","Block vertical alignment setting")},bottom:{icon:Tl,title:(0,_._x)("Align bottom","Block vertical alignment setting")},stretch:{icon:Pl,title:(0,_._x)("Stretch to fill","Block vertical alignment setting")},"space-between":{icon:Ll,title:(0,_._x)("Space between","Block vertical alignment setting")}},Al=["top","center","bottom"];var Ol=function(e){let{value:t,onChange:n,controls:o=Al,isCollapsed:r=!0,isToolbar:l}=e;const i=Rl[t],a=Rl.top,s=l?h.ToolbarGroup:h.ToolbarDropdownMenu,d=l?{isCollapsed:r}:{popoverProps:{variant:"toolbar"}};return(0,u.createElement)(s,c({icon:i?i.icon:a.icon,label:(0,_._x)("Change vertical alignment","Block vertical alignment setting label"),controls:o.map((e=>{return{...Rl[e],isActive:t===e,role:r?"menuitemradio":void 0,onClick:(o=e,()=>n(t===o?void 0:o))};var o}))},d))};const Dl=e=>(0,u.createElement)(Ol,c({},e,{isToolbar:!1})),zl=e=>(0,u.createElement)(Ol,c({},e,{isToolbar:!0})),Fl={left:Ho,center:Go,right:Uo,"space-between":$o,stretch:jo};var Vl=function(e){let{allowedControls:t=["left","center","right","space-between"],isCollapsed:n=!0,onChange:o,value:r,popoverProps:l,isToolbar:i}=e;const a=e=>{o(e===r?void 0:e)},s=r?Fl[r]:Fl.left,d=[{name:"left",icon:Ho,title:(0,_.__)("Justify items left"),isActive:"left"===r,onClick:()=>a("left")},{name:"center",icon:Go,title:(0,_.__)("Justify items center"),isActive:"center"===r,onClick:()=>a("center")},{name:"right",icon:Uo,title:(0,_.__)("Justify items right"),isActive:"right"===r,onClick:()=>a("right")},{name:"space-between",icon:$o,title:(0,_.__)("Space between items"),isActive:"space-between"===r,onClick:()=>a("space-between")},{name:"stretch",icon:jo,title:(0,_.__)("Stretch items"),isActive:"stretch"===r,onClick:()=>a("stretch")}],p=i?h.ToolbarGroup:h.ToolbarDropdownMenu,m=i?{isCollapsed:n}:{};return(0,u.createElement)(p,c({icon:s,popoverProps:l,label:(0,_.__)("Change items justification"),controls:d.filter((e=>t.includes(e.name)))},m))};const Hl=e=>(0,u.createElement)(Vl,c({},e,{isToolbar:!1})),Gl=e=>(0,u.createElement)(Vl,c({},e,{isToolbar:!0})),Ul={left:"flex-start",right:"flex-end",center:"center","space-between":"space-between"},$l={left:"flex-start",right:"flex-end",center:"center",stretch:"stretch"},jl={top:"flex-start",center:"center",bottom:"flex-end",stretch:"stretch","space-between":"space-between"},Wl=["wrap","nowrap"];var Kl={name:"flex",label:(0,_.__)("Flex"),inspectorControls:function(e){let{layout:t={},onChange:n,layoutBlockSupport:o={}}=e;const{allowOrientation:r=!0}=o;return(0,u.createElement)(u.Fragment,null,(0,u.createElement)(h.Flex,null,(0,u.createElement)(h.FlexItem,null,(0,u.createElement)(Yl,{layout:t,onChange:n})),(0,u.createElement)(h.FlexItem,null,r&&(0,u.createElement)(Ql,{layout:t,onChange:n}))),(0,u.createElement)(Zl,{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,u.createElement)(Vo,{group:"block",__experimentalShareWithChildBlocks:!0},(0,u.createElement)(Yl,{layout:t,onChange:n,isToolbar:!0}),r&&(0,u.createElement)(ql,{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&&!Fr(i,"spacing","blockGap")?Bl(null==l||null===(n=l.spacing)||void 0===n?void 0:n.blockGap,"0.5em"):void 0,d=Ul[r.justifyContent],p=Wl.includes(r.flexWrap)?r.flexWrap:"wrap",m=jl[r.verticalAlignment],g=$l[r.justifyContent]||$l.left;let f="";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}`)):(m&&h.push(`justify-content: ${m}`),h.push("flex-direction: column"),h.push(`align-items: ${g}`)),h.length&&(f=`${qo(o)} {\n\t\t\t\t${h.join("; ")};\n\t\t\t}`),a&&u&&(f+=Yo(o,s,"flex",u)),f},getOrientation(e){const{orientation:t="horizontal"}=e;return t},getAlignments(){return[]}};function ql(e){let{layout:t,onChange:n,isToolbar:o=!1}=e;const{orientation:r="horizontal"}=t,l="horizontal"===r?jl.center:jl.top,{verticalAlignment:i=l}=t,a=e=>{n({...t,verticalAlignment:e})};if(o)return(0,u.createElement)(Dl,{onChange:a,value:i,controls:"horizontal"===r?["top","center","bottom","stretch"]:["top","center","bottom","space-between"]});const s=[{value:"flex-start",label:(0,_.__)("Align items top")},{value:"center",label:(0,_.__)("Align items center")},{value:"flex-end",label:(0,_.__)("Align items bottom")}];return(0,u.createElement)("fieldset",{className:"block-editor-hooks__flex-layout-vertical-alignment-control"},(0,u.createElement)("legend",null,(0,_.__)("Vertical alignment")),(0,u.createElement)("div",null,s.map(((e,t,n)=>(0,u.createElement)(h.Button,{key:e,label:n,icon:t,isPressed:i===e,onClick:()=>a(e)})))))}function Yl(e){let{layout:t,onChange:n,isToolbar:o=!1}=e;const{justifyContent:r="left",orientation:l="horizontal"}=t,i=e=>{n({...t,justifyContent:e})},a=["left","center","right"];if("horizontal"===l?a.push("space-between"):a.push("stretch"),o)return(0,u.createElement)(Hl,{allowedControls:a,value:r,onChange:i,popoverProps:{position:"bottom right",variant:"toolbar"}});const s=[{value:"left",icon:Ho,label:(0,_.__)("Justify items left")},{value:"center",icon:Go,label:(0,_.__)("Justify items center")},{value:"right",icon:Uo,label:(0,_.__)("Justify items right")}];return"horizontal"===l?s.push({value:"space-between",icon:$o,label:(0,_.__)("Space between items")}):s.push({value:"stretch",icon:jo,label:(0,_.__)("Stretch items")}),(0,u.createElement)(h.__experimentalToggleGroupControl,{__nextHasNoMarginBottom:!0,label:(0,_.__)("Justification"),value:r,onChange:i,className:"block-editor-hooks__flex-layout-justification-controls"},s.map((e=>{let{value:t,icon:n,label:o}=e;return(0,u.createElement)(h.__experimentalToggleGroupControlOptionIcon,{key:t,value:t,icon:n,label:o})})))}function Zl(e){let{layout:t,onChange:n}=e;const{flexWrap:o="wrap"}=t;return(0,u.createElement)(h.ToggleControl,{label:(0,_.__)("Allow to wrap to multiple lines"),onChange:e=>{n({...t,flexWrap:e?"wrap":"nowrap"})},checked:"wrap"===o})}function Ql(e){let{layout:t,onChange:n}=e;const{orientation:o="horizontal",verticalAlignment:r,justifyContent:l}=t;return(0,u.createElement)(h.__experimentalToggleGroupControl,{__nextHasNoMarginBottom:!0,className:"block-editor-hooks__flex-layout-orientation-controls",label:(0,_.__)("Orientation"),value:o,onChange:e=>{let o=r,i=l;return"horizontal"===e?("space-between"===r&&(o="center"),"stretch"===l&&(i="left")):("stretch"===r&&(o="top"),"space-between"===l&&(i="left")),n({...t,orientation:e,verticalAlignment:o,justifyContent:i})}},(0,u.createElement)(h.__experimentalToggleGroupControlOptionIcon,{icon:Wo,value:"horizontal",label:(0,_.__)("Horizontal")}),(0,u.createElement)(h.__experimentalToggleGroupControlOptionIcon,{icon:Ko,value:"vertical",label:(0,_.__)("Vertical")}))}var Xl={name:"default",label:(0,_.__)("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=Bl(null==o||null===(t=o.spacing)||void 0===t?void 0:t.blockGap);let s="";Fr(r,"spacing","blockGap")||(null!=a&&a.top?s=Bl(null==a?void 0:a.top):"string"==typeof a&&(s=Bl(a)));let c="";return l&&s&&(c+=Yo(n,i,"default",s)),c},getOrientation(){return"vertical"},getAlignments(e,t){const n=Zo(e);if(void 0!==e.alignments)return e.alignments.includes("none")||e.alignments.unshift("none"),e.alignments.map((e=>({name:e,info:n[e]})));const o=[{name:"left"},{name:"center"},{name:"right"}];if(!t){const{contentSize:t,wideSize:r}=e;t&&o.unshift({name:"full"}),r&&o.unshift({name:"wide",info:n.wide})}return o.unshift({name:"none",info:n.none}),o}};var Jl=function(e){let{icon:t,size:n=24,...o}=e;return(0,u.cloneElement)(t,{width:n,height:n,...o})};var ei=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"M7 9v6h10V9H7zM5 19.8h14v-1.5H5v1.5zM5 4.3v1.5h14V4.3H5z"}));var ti=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"M5 9v6h14V9H5zm11-4.8H8v1.5h8V4.2zM8 19.8h8v-1.5H8v1.5z"})),ni=window.wp.styleEngine,oi={name:"constrained",label:(0,_.__)("Constrained"),inspectorControls:function(e){let{layout:t,onChange:n}=e;const{wideSize:o,contentSize:r,justifyContent:l="center"}=t,i=[{value:"left",icon:Ho,label:(0,_.__)("Justify items left")},{value:"center",icon:Go,label:(0,_.__)("Justify items center")},{value:"right",icon:Uo,label:(0,_.__)("Justify items right")}],a=(0,h.__experimentalUseCustomUnits)({availableUnits:fr("spacing.units")||["%","px","em","rem","vw"]});return(0,u.createElement)(u.Fragment,null,(0,u.createElement)("div",{className:"block-editor-hooks__layout-controls"},(0,u.createElement)("div",{className:"block-editor-hooks__layout-controls-unit"},(0,u.createElement)(h.__experimentalUnitControl,{className:"block-editor-hooks__layout-controls-unit-input",label:(0,_.__)("Content"),labelPosition:"top",__unstableInputWidth:"80px",value:r||o||"",onChange:e=>{e=0>parseFloat(e)?"0":e,n({...t,contentSize:e})},units:a}),(0,u.createElement)(Jl,{icon:ei})),(0,u.createElement)("div",{className:"block-editor-hooks__layout-controls-unit"},(0,u.createElement)(h.__experimentalUnitControl,{className:"block-editor-hooks__layout-controls-unit-input",label:(0,_.__)("Wide"),labelPosition:"top",__unstableInputWidth:"80px",value:o||r||"",onChange:e=>{e=0>parseFloat(e)?"0":e,n({...t,wideSize:e})},units:a}),(0,u.createElement)(Jl,{icon:ti}))),(0,u.createElement)("p",{className:"block-editor-hooks__layout-controls-helptext"},(0,_.__)("Customize the width for all elements that are assigned to the center or wide columns.")),(0,u.createElement)(h.__experimentalToggleGroupControl,{__nextHasNoMarginBottom:!0,label:(0,_.__)("Justification"),value:l,onChange:e=>{n({...t,justifyContent:e})}},i.map((e=>{let{value:t,icon:n,label:o}=e;return(0,u.createElement)(h.__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=Bl(null==l||null===(t=l.spacing)||void 0===t?void 0:t.blockGap);let m="";Fr(i,"spacing","blockGap")||(null!=p&&p.top?m=Bl(null==p?void 0:p.top):"string"==typeof p&&(m=Bl(p)));const g="left"===d?"0 !important":"auto !important",f="right"===d?"0 !important":"auto !important";let h=c||u?`\n\t\t\t\t\t${qo(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: ${g};\n\t\t\t\t\t\tmargin-right: ${f};\n\t\t\t\t\t}\n\t\t\t\t\t${qo(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${qo(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+=`${qo(o,"> :where(:not(.alignleft):not(.alignright):not(.alignfull))")}\n\t\t\t{ margin-left: ${g}; }`:"right"===d&&(h+=`${qo(o,"> :where(:not(.alignleft):not(.alignright):not(.alignfull))")}\n\t\t\t{ margin-right: ${f}; }`),null!=l&&null!==(n=l.spacing)&&void 0!==n&&n.padding){(0,ni.getCSSRules)(l).forEach((e=>{"paddingRight"===e.key?h+=`\n\t\t\t\t\t${qo(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${qo(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+=Yo(o,s,"constrained",m)),h},getOrientation(){return"vertical"},getAlignments(e){const t=Zo(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 ri=[Xl,Kl,oi];function li(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default";return ri.find((t=>t.name===e))}const ii={type:"default"},ai=(0,u.createContext)(ii),si=ai.Provider;function ci(){return(0,u.useContext)(ai)}function ui(e){let{layout:t={},css:n,...o}=e;const r=li(t.type),l=null!==fr("spacing.blockGap");if(r){var i;if(n)return(0,u.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,u.createElement)("style",null,e)}return null}const di=[],pi=["none","left","center","right","wide","full"],mi=["wide","full"];function gi(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:pi;e.includes("none")||(e=["none",...e]);const{wideControlsEnabled:t=!1,themeSupportsLayout:n,isBlockBasedTheme:o}=(0,g.useSelect)((e=>{const{getSettings:t}=e(To),n=t();return{wideControlsEnabled:n.alignWide,themeSupportsLayout:n.supportsLayout,isBlockBasedTheme:n.__unstableIsBlockBasedTheme}}),[]),r=ci(),l=li(null==r?void 0:r.type),i=l.getAlignments(r,o);if(n){const t=i.filter((t=>{let{name:n}=t;return e.includes(n)}));return 1===t.length&&"none"===t[0].name?di:t}if("default"!==l.name&&"constrained"!==l.name)return di;const{alignments:a=pi}=r,s=e.filter((e=>(r.alignments||t||!mi.includes(e))&&a.includes(e))).map((e=>({name:e})));return 1===s.length&&"none"===s[0].name?di:s}var fi=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"M5 15h14V9H5v6zm0 4.8h14v-1.5H5v1.5zM5 4.2v1.5h14V4.2H5z"}));var hi=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"M4 9v6h14V9H4zm8-4.8H4v1.5h8V4.2zM4 19.8h8v-1.5H4v1.5z"}));var vi=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"M6 15h14V9H6v6zm6-10.8v1.5h8V4.2h-8zm0 15.6h8v-1.5h-8v1.5z"}));var bi=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"M5 4v11h14V4H5zm3 15.8h8v-1.5H8v1.5z"}));const ki={none:{icon:fi,title:(0,_._x)("None","Alignment option")},left:{icon:hi,title:(0,_.__)("Align left")},center:{icon:ei,title:(0,_.__)("Align center")},right:{icon:vi,title:(0,_.__)("Align right")},wide:{icon:ti,title:(0,_.__)("Wide width")},full:{icon:bi,title:(0,_.__)("Full width")}},_i={variant:"toolbar"};var yi=function(e){let{value:t,onChange:n,controls:o,isToolbar:r,isCollapsed:l=!0}=e;const i=gi(o);if(!!!i.length)return null;function a(e){n([t,"none"].includes(e)?void 0:e)}const s=ki[t],d=ki.none,m=r?h.ToolbarGroup:h.ToolbarDropdownMenu,g={icon:s?s.icon:d.icon,label:(0,_.__)("Align")},f=r?{isCollapsed:l,controls:i.map((e=>{let{name:n}=e;return{...ki[n],isActive:t===n||!t&&"none"===n,role:l?"menuitemradio":void 0,onClick:()=>a(n)}}))}:{toggleProps:{describedBy:(0,_.__)("Change alignment")},popoverProps:_i,children:e=>{let{onClose:n}=e;return(0,u.createElement)(u.Fragment,null,(0,u.createElement)(h.MenuGroup,{className:"block-editor-block-alignment-control__menu-group"},i.map((e=>{let{name:o,info:r}=e;const{icon:l,title:i}=ki[o],s=o===t||!t&&"none"===o;return(0,u.createElement)(h.MenuItem,{key:o,icon:l,iconPosition:"left",className:p()("components-dropdown-menu__menu-item",{"is-active":s}),isSelected:s,onClick:()=>{a(o),n()},role:"menuitemradio",info:r},i)}))))}};return(0,u.createElement)(m,c({},g,f))};const Ei=e=>(0,u.createElement)(yi,c({},e,{isToolbar:!1})),Ci=e=>(0,u.createElement)(yi,c({},e,{isToolbar:!0})),Si=["left","center","right","wide","full"],wi=["wide","full"];function Bi(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)?Si.filter((t=>e.includes(t))):!0===e?[...Si]:[],!o||!0===e&&!n?t.filter((e=>!wi.includes(e))):t}const Ii=(0,m.createHigherOrderComponent)((e=>t=>{const n=(0,u.createElement)(e,t),{name:o}=t,r=gi(Bi((0,a.getBlockSupport)(o,"align"),(0,a.hasBlockSupport)(o,"alignWide",!0))).map((e=>{let{name:t}=e;return t})),l=(0,g.useSelect)((e=>e(To).__unstableGetContentLockingParent(t.clientId)),[t.clientId]);if(!r.length||l)return n;return(0,u.createElement)(u.Fragment,null,(0,u.createElement)(Vo,{group:"block",__experimentalShareWithChildBlocks:!0},(0,u.createElement)(Ei,{value:t.attributes.align,onChange:e=>{if(!e){var n,o;const r=(0,a.getBlockType)(t.name);(null==r||null===(n=r.attributes)||void 0===n||null===(o=n.align)||void 0===o?void 0:o.default)&&(e="")}t.setAttributes({align:e})},controls:r})),n)}),"withToolbarControls"),xi=(0,m.createHigherOrderComponent)((e=>t=>{const{name:n,attributes:o}=t,{align:r}=o,l=gi(Bi((0,a.getBlockSupport)(n,"align"),(0,a.hasBlockSupport)(n,"alignWide",!0)));if(void 0===r)return(0,u.createElement)(e,t);let i=t.wrapperProps;return l.some((e=>e.name===r))&&(i={...i,"data-align":r}),(0,u.createElement)(e,c({},t,{wrapperProps:i}))}));(0,s.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,a.hasBlockSupport)(e,"align")&&(e.attributes={...e.attributes,align:{type:"string",enum:[...Si,""]}}),e})),(0,s.addFilter)("editor.BlockListBlock","core/editor/align/with-data-align",xi),(0,s.addFilter)("editor.BlockEdit","core/editor/align/with-toolbar-controls",Ii),(0,s.addFilter)("blocks.getSaveContent.extraProps","core/align/addAssignedAlign",(function(e,t,n){const{align:o}=n;return Bi((0,a.getBlockSupport)(t,"align"),(0,a.hasBlockSupport)(t,"alignWide",!0)).includes(o)&&(e.className=p()(`align${o}`,e.className)),e})),(0,s.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 Ti=/[\s#]/g,Mi={type:"string",source:"attribute",attribute:"id",selector:"*"};const Ni=(0,m.createHigherOrderComponent)((e=>t=>{if((0,a.hasBlockSupport)(t.name,"anchor")&&t.isSelected){const n="web"===u.Platform.OS,o=(0,u.createElement)(h.TextControl,{__nextHasNoMarginBottom:!0,className:"html-anchor-control",label:(0,_.__)("HTML anchor"),help:(0,u.createElement)(u.Fragment,null,(0,_.__)("Enter a word or two — without spaces — to make a unique web address just for this block, called an “anchor.” Then, you’ll be able to link directly to this section of your page."),n&&(0,u.createElement)(h.ExternalLink,{href:(0,_.__)("https://wordpress.org/support/article/page-jumps/")},(0,_.__)("Learn more about anchors"))),value:t.attributes.anchor||"",placeholder:n?null:(0,_.__)("Add an anchor"),onChange:e=>{e=e.replace(Ti,"-"),t.setAttributes({anchor:e})},autoCapitalize:"none",autoComplete:"off"});return(0,u.createElement)(u.Fragment,null,(0,u.createElement)(e,t),n&&(0,u.createElement)(jr,{group:"advanced"},o),!n&&"core/heading"===t.name&&(0,u.createElement)(jr,null,(0,u.createElement)(h.PanelBody,{title:(0,_.__)("Heading settings")},o)))}return(0,u.createElement)(e,t)}),"withInspectorControl");(0,s.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,a.hasBlockSupport)(e,"anchor")&&(e.attributes={...e.attributes,anchor:Mi}),e})),(0,s.addFilter)("editor.BlockEdit","core/editor/anchor/with-inspector-control",Ni),(0,s.addFilter)("blocks.getSaveContent.extraProps","core/anchor/save-props",(function(e,t,n){return(0,a.hasBlockSupport)(t,"anchor")&&(e.id=""===n.anchor?null:n.anchor),e}));const Pi={type:"string",source:"attribute",attribute:"aria-label",selector:"*"};(0,s.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,a.hasBlockSupport)(e,"ariaLabel")&&(e.attributes={...e.attributes,ariaLabel:Pi}),e})),(0,s.addFilter)("blocks.getSaveContent.extraProps","core/ariaLabel/save-props",(function(e,t,n){return(0,a.hasBlockSupport)(t,"ariaLabel")&&(e["aria-label"]=""===n.ariaLabel?null:n.ariaLabel),e}));const Li=(0,m.createHigherOrderComponent)((e=>t=>(0,a.hasBlockSupport)(t.name,"customClassName",!0)&&t.isSelected?(0,u.createElement)(u.Fragment,null,(0,u.createElement)(e,t),(0,u.createElement)(jr,{group:"advanced"},(0,u.createElement)(h.TextControl,{__nextHasNoMarginBottom:!0,autoComplete:"off",label:(0,_.__)("Additional CSS class(es)"),value:t.attributes.className||"",onChange:e=>{t.setAttributes({className:""!==e?e:void 0})},help:(0,_.__)("Separate multiple classes with spaces.")}))):(0,u.createElement)(e,t)),"withInspectorControl");(0,s.addFilter)("blocks.registerBlockType","core/custom-class-name/attribute",(function(e){return(0,a.hasBlockSupport)(e,"customClassName",!0)&&(e.attributes={...e.attributes,className:{type:"string"}}),e})),(0,s.addFilter)("editor.BlockEdit","core/editor/custom-class-name/with-inspector-control",Li),(0,s.addFilter)("blocks.getSaveContent.extraProps","core/custom-class-name/save-props",(function(e,t,n){return(0,a.hasBlockSupport)(t,"customClassName",!0)&&n.className&&(e.className=p()(e.className,n.className)),e})),(0,s.addFilter)("blocks.switchToBlockType.transformedBlock","core/color/addTransforms",(function(e,t,n,o){if(!(0,a.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 r;const o=null===(r=t[n])||void 0===r?void 0:r.attributes.className;if(o)return{...e,attributes:{...e.attributes,className:o}}}return e})),(0,s.addFilter)("blocks.getSaveContent.extraProps","core/generated-class-name/save-props",(function(e,t){return(0,a.hasBlockSupport)(t,"className",!0)&&("string"==typeof e.className?e.className=[...new Set([(0,a.getBlockDefaultClassName)(t.name),...e.className.split(" ")])].join(" ").trim():e.className=(0,a.getBlockDefaultClassName)(t.name)),e}));var Ri=window.wp.dom;const Ai=(0,u.createContext)({});function Oi(e){let{value:t,children:n}=e;const o=(0,u.useContext)(Ai),r=(0,u.useMemo)((()=>({...o,...t})),[o,t]);return(0,u.createElement)(Ai.Provider,{value:r,children:n})}var Di=Ai;const zi={};var Fi=(0,h.withFilters)("editor.BlockEdit")((e=>{const{attributes:t={},name:n}=e,o=(0,a.getBlockType)(n),r=(0,u.useContext)(Di),l=(0,u.useMemo)((()=>o&&o.usesContext?Object.fromEntries(Object.entries(r).filter((e=>{let[t]=e;return o.usesContext.includes(t)}))):zi),[o,r]);if(!o)return null;const i=o.edit||o.save;if(o.apiVersion>1)return(0,u.createElement)(i,c({},e,{context:l}));const s=(0,a.hasBlockSupport)(o,"className",!0)?(0,a.getBlockDefaultClassName)(n):null,d=p()(s,t.className,e.className);return(0,u.createElement)(i,c({},e,{context:l,className:d}))}));function Vi(e){const{name:t,isSelected:n,clientId:o,attributes:r={},__unstableLayoutClassNames:l}=e,{layout:i=null}=r,s={name:t,isSelected:n,clientId:o,layout:(0,a.hasBlockSupport)(t,"__experimentalLayout",!1)?i:null,__unstableLayoutClassNames:l};return(0,u.createElement)(Lo,{value:(0,u.useMemo)((()=>s),Object.values(s))},(0,u.createElement)(Fi,e))}var Hi=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"M11 13h2v-2h-2v2zm-6 0h2v-2H5v2zm12-2v2h2v-2h-2z"}));var Gi=function(e){let{className:t,actions:n,children:o,secondaryActions:r}=e;return(0,u.createElement)("div",{style:{display:"contents",all:"initial"}},(0,u.createElement)("div",{className:p()(t,"block-editor-warning")},(0,u.createElement)("div",{className:"block-editor-warning__contents"},(0,u.createElement)("p",{className:"block-editor-warning__message"},o),(u.Children.count(n)>0||r)&&(0,u.createElement)("div",{className:"block-editor-warning__actions"},u.Children.count(n)>0&&u.Children.map(n,((e,t)=>(0,u.createElement)("span",{key:t,className:"block-editor-warning__action"},e))),r&&(0,u.createElement)(h.DropdownMenu,{className:"block-editor-warning__secondary",icon:Hi,label:(0,_.__)("More options"),popoverProps:{position:"bottom left",className:"block-editor-warning__dropdown"},noIcons:!0},(()=>(0,u.createElement)(h.MenuGroup,null,r.map(((e,t)=>(0,u.createElement)(h.MenuItem,{onClick:e.onClick,key:t},e.title))))))))))},Ui=n(1973);function $i(e){let{title:t,rawContent:n,renderedContent:o,action:r,actionText:l,className:i}=e;return(0,u.createElement)("div",{className:i},(0,u.createElement)("div",{className:"block-editor-block-compare__content"},(0,u.createElement)("h2",{className:"block-editor-block-compare__heading"},t),(0,u.createElement)("div",{className:"block-editor-block-compare__html"},n),(0,u.createElement)("div",{className:"block-editor-block-compare__preview edit-post-visual-editor"},(0,u.createElement)(u.RawHTML,null,(0,Ri.safeHTML)(o)))),(0,u.createElement)("div",{className:"block-editor-block-compare__action"},(0,u.createElement)(h.Button,{variant:"secondary",tabIndex:"0",onClick:r},l)))}var ji=function(e){let{block:t,onKeep:n,onConvert:o,convertor:r,convertButtonText:l}=e;const i=(s=r(t),(Array.isArray(s)?s:[s]).map((e=>(0,a.getSaveContent)(e.name,e.attributes,e.innerBlocks))).join(""));var s;const c=(d=t.originalContent,m=i,(0,Ui.Kx)(d,m).map(((e,t)=>{const n=p()({"block-editor-block-compare__added":e.added,"block-editor-block-compare__removed":e.removed});return(0,u.createElement)("span",{key:t,className:n},e.value)})));var d,m;return(0,u.createElement)("div",{className:"block-editor-block-compare__wrapper"},(0,u.createElement)($i,{title:(0,_.__)("Current"),className:"block-editor-block-compare__current",action:n,actionText:(0,_.__)("Convert to HTML"),rawContent:t.originalContent,renderedContent:t.originalContent}),(0,u.createElement)($i,{title:(0,_.__)("After Conversion"),className:"block-editor-block-compare__converted",action:o,actionText:l,rawContent:c,renderedContent:i}))};const Wi=e=>(0,a.rawHandler)({HTML:e.originalContent});var Ki=(0,m.compose)([(0,g.withSelect)(((e,t)=>{let{clientId:n}=t;return{block:e(To).getBlock(n)}})),(0,g.withDispatch)(((e,t)=>{let{block:n}=t;const{replaceBlock:o}=e(To);return{convertToClassic(){o(n.clientId,(e=>(0,a.createBlock)("core/freeform",{content:e.originalContent}))(n))},convertToHTML(){o(n.clientId,(e=>(0,a.createBlock)("core/html",{content:e.originalContent}))(n))},convertToBlocks(){o(n.clientId,Wi(n))},attemptBlockRecovery(){o(n.clientId,(e=>{let{name:t,attributes:n,innerBlocks:o}=e;return(0,a.createBlock)(t,n,o)})(n))}}}))])((function(e){let{convertToHTML:t,convertToBlocks:n,convertToClassic:o,attemptBlockRecovery:r,block:l}=e;const i=!!(0,a.getBlockType)("core/html"),s=!!(0,a.getBlockType)("core/freeform"),[c,d]=(0,u.useState)(!1),p=(0,u.useCallback)((()=>d(!0)),[]),m=(0,u.useCallback)((()=>d(!1)),[]),g=(0,u.useMemo)((()=>[{title:(0,_._x)("Resolve","imperative verb"),onClick:p},i&&{title:(0,_.__)("Convert to HTML"),onClick:t},s&&{title:(0,_.__)("Convert to Classic Block"),onClick:o}].filter(Boolean)),[p,i,t,s,o]);return(0,u.createElement)(u.Fragment,null,(0,u.createElement)(Gi,{actions:[(0,u.createElement)(h.Button,{key:"recover",onClick:r,variant:"primary"},(0,_.__)("Attempt Block Recovery"))],secondaryActions:g},(0,_.__)("This block contains unexpected or invalid content.")),c&&(0,u.createElement)(h.Modal,{title:(0,_.__)("Resolve Block"),onRequestClose:m,className:"block-editor-block-compare"},(0,u.createElement)(ji,{block:l,onKeep:t,onConvert:n,convertor:Wi,convertButtonText:(0,_.__)("Convert to Blocks")})))}));const qi=(0,u.createElement)(Gi,{className:"block-editor-block-list__block-crash-warning"},(0,_.__)("This block has encountered an error and cannot be previewed."));var Yi=()=>qi;class Zi extends u.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 Qi=Zi,Xi=n(773);var Ji=function(e){let{clientId:t}=e;const[n,o]=(0,u.useState)(""),r=(0,g.useSelect)((e=>e(To).getBlock(t)),[t]),{updateBlock:l}=(0,g.useDispatch)(To);return(0,u.useEffect)((()=>{o((0,a.getBlockContent)(r))}),[r]),(0,u.createElement)(Xi.Z,{className:"block-editor-block-list__block-html-textarea",value:n,onBlur:()=>{const e=(0,a.getBlockType)(r.name);if(!e)return;const i=(0,a.getBlockAttributes)(e,n,r.attributes),s=n||(0,a.getSaveContent)(e,i),[c]=n?(0,a.validateBlock)({...r,attributes:i,originalContent:s}):[!0];l(t,{attributes:i,originalContent:s,isValid:c}),n||o({content:s})},onChange:e=>o(e.target.value)})},ea=ha(),ta=e=>pa(e,ea),na=ha();ta.write=e=>pa(e,na);var oa=ha();ta.onStart=e=>pa(e,oa);var ra=ha();ta.onFrame=e=>pa(e,ra);var la=ha();ta.onFinish=e=>pa(e,la);var ia=[];ta.setTimeout=(e,t)=>{let n=ta.now()+t,o=()=>{let e=ia.findIndex((e=>e.cancel==o));~e&&ia.splice(e,1),ua-=~e?1:0},r={time:n,handler:e,cancel:o};return ia.splice(aa(n),0,r),ua+=1,ma(),r};var aa=e=>~(~ia.findIndex((t=>t.time>e))||~ia.length);ta.cancel=e=>{oa.delete(e),ra.delete(e),la.delete(e),ea.delete(e),na.delete(e)},ta.sync=e=>{da=!0,ta.batchedUpdates(e),da=!1},ta.throttle=e=>{let t;function n(){try{e(...t)}finally{t=null}}function o(...e){t=e,ta.onStart(n)}return o.handler=e,o.cancel=()=>{oa.delete(n),t=null},o};var sa=typeof window<"u"?window.requestAnimationFrame:()=>{};ta.use=e=>sa=e,ta.now=typeof performance<"u"?()=>performance.now():Date.now,ta.batchedUpdates=e=>e(),ta.catch=console.error,ta.frameLoop="always",ta.advance=()=>{"demand"!==ta.frameLoop?console.warn("Cannot call the manual advancement of rafz whilst frameLoop is not set as demand"):fa()};var ca=-1,ua=0,da=!1;function pa(e,t){da?(t.delete(e),e(0)):(t.add(e),ma())}function ma(){ca<0&&(ca=0,"demand"!==ta.frameLoop&&sa(ga))}function ga(){~ca&&(sa(ga),ta.batchedUpdates(fa))}function fa(){let e=ca;ca=ta.now();let t=aa(ca);t&&(va(ia.splice(0,t),(e=>e.handler())),ua-=t),ua?(oa.flush(),ea.flush(e?Math.min(64,ca-e):16.667),ra.flush(),na.flush(),la.flush()):ca=-1}function ha(){let e=new Set,t=e;return{add(n){ua+=t!=e||e.has(n)?0:1,e.add(n)},delete(n){return ua-=t==e&&e.has(n)?1:0,e.delete(n)},flush(n){t.size&&(e=new Set,ua-=t.size,va(t,(t=>t(n)&&e.add(t))),ua+=e.size,t=e)}}}function va(e,t){e.forEach((e=>{try{t(e)}catch(e){ta.catch(e)}}))}var ba=n(9196),ka=n.n(ba),_a=Object.defineProperty,ya={};function Ea(){}((e,t)=>{for(var n in t)_a(e,n,{get:t[n],enumerable:!0})})(ya,{assign:()=>Oa,colors:()=>La,createStringInterpolator:()=>Ta,skipAnimation:()=>Ra,to:()=>Ma,willAdvance:()=>Aa});var Ca={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 Sa(e,t){if(Ca.arr(e)){if(!Ca.arr(t)||e.length!==t.length)return!1;for(let n=0;ne.forEach(t);function Ba(e,t,n){if(Ca.arr(e))for(let o=0;oCa.und(e)?[]:Ca.arr(e)?e:[e];function xa(e,t){if(e.size){let n=Array.from(e);e.clear(),wa(n,t)}}var Ta,Ma,Na=(e,...t)=>xa(e,(e=>e(...t))),Pa=()=>typeof window>"u"||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent),La=null,Ra=!1,Aa=Ea,Oa=e=>{e.to&&(Ma=e.to),e.now&&(ta.now=e.now),void 0!==e.colors&&(La=e.colors),null!=e.skipAnimation&&(Ra=e.skipAnimation),e.createStringInterpolator&&(Ta=e.createStringInterpolator),e.requestAnimationFrame&&ta.use(e.requestAnimationFrame),e.batchedUpdates&&(ta.batchedUpdates=e.batchedUpdates),e.willAdvance&&(Aa=e.willAdvance),e.frameLoop&&(ta.frameLoop=e.frameLoop)},Da=new Set,za=[],Fa=[],Va=0,Ha={get idle(){return!Da.size&&!za.length},start(e){Va>e.priority?(Da.add(e),ta.onStart(Ga)):(Ua(e),ta(ja))},advance:ja,sort(e){if(Va)ta.onFrame((()=>Ha.sort(e)));else{let t=za.indexOf(e);~t&&(za.splice(t,1),$a(e))}},clear(){za=[],Da.clear()}};function Ga(){Da.forEach(Ua),Da.clear(),ta(ja)}function Ua(e){za.includes(e)||$a(e)}function $a(e){za.splice(function(e,t){let n=e.findIndex(t);return n<0?e.length:n}(za,(t=>t.priority>e.priority)),0,e)}function ja(e){let t=Fa;for(let n=0;n0}var Wa="[-+]?\\d*\\.?\\d+",Ka=Wa+"%";function qa(...e){return"\\(\\s*("+e.join(")\\s*,\\s*(")+")\\s*\\)"}var Ya=new RegExp("rgb"+qa(Wa,Wa,Wa)),Za=new RegExp("rgba"+qa(Wa,Wa,Wa,Wa)),Qa=new RegExp("hsl"+qa(Wa,Ka,Ka)),Xa=new RegExp("hsla"+qa(Wa,Ka,Ka,Wa)),Ja=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,es=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,ts=/^#([0-9a-fA-F]{6})$/,ns=/^#([0-9a-fA-F]{8})$/;function os(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 rs(e,t,n){let o=n<.5?n*(1+t):n+t-n*t,r=2*n-o,l=os(r,o,e+1/3),i=os(r,o,e),a=os(r,o,e-1/3);return Math.round(255*l)<<24|Math.round(255*i)<<16|Math.round(255*a)<<8}function ls(e){let t=parseInt(e,10);return t<0?0:t>255?255:t}function is(e){return(parseFloat(e)%360+360)%360/360}function as(e){let t=parseFloat(e);return t<0?0:t>1?255:Math.round(255*t)}function ss(e){let t=parseFloat(e);return t<0?0:t>100?1:t/100}function cs(e){let t=function(e){let t;return"number"==typeof e?e>>>0===e&&e>=0&&e<=4294967295?e:null:(t=ts.exec(e))?parseInt(t[1]+"ff",16)>>>0:La&&void 0!==La[e]?La[e]:(t=Ya.exec(e))?(ls(t[1])<<24|ls(t[2])<<16|ls(t[3])<<8|255)>>>0:(t=Za.exec(e))?(ls(t[1])<<24|ls(t[2])<<16|ls(t[3])<<8|as(t[4]))>>>0:(t=Ja.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+"ff",16)>>>0:(t=ns.exec(e))?parseInt(t[1],16)>>>0:(t=es.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+t[4]+t[4],16)>>>0:(t=Qa.exec(e))?(255|rs(is(t[1]),ss(t[2]),ss(t[3])))>>>0:(t=Xa.exec(e))?(rs(is(t[1]),ss(t[2]),ss(t[3]))|as(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})`)}var us=(e,t,n)=>{if(Ca.fun(e))return e;if(Ca.arr(e))return us({range:e,output:t,extrapolate:n});if(Ca.str(e.output[0]))return Ta(e);let 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=>{let t=function(e,t){for(var n=1;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(cn){if("identity"===a)return c;"clamp"===a&&(c=n)}return o===r?o:t===n?e<=t?o:r:(t===-1/0?c=-c:n===1/0?c-=t:c=(c-t)/(n-t),c=l(c),o===-1/0?c=-c:r===1/0?c+=o:c=c*(r-o)+o,c)}(e,l[t],l[t+1],r[t],r[t+1],s,i,a,o.map)}};var ds=1.70158,ps=1.525*ds,ms=ds+1,gs=2*Math.PI/3,fs=2*Math.PI/4.5,hs=e=>e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375,vs={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-ds*e*e,easeOutBack:e=>1+ms*Math.pow(e-1,3)+ds*Math.pow(e-1,2),easeInOutBack:e=>e<.5?Math.pow(2*e,2)*(2*(ps+1)*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)*gs),easeOutElastic:e=>0===e?0:1===e?1:Math.pow(2,-10*e)*Math.sin((10*e-.75)*gs)+1,easeInOutElastic:e=>0===e?0:1===e?1:e<.5?-Math.pow(2,20*e-10)*Math.sin((20*e-11.125)*fs)/2:Math.pow(2,-20*e+10)*Math.sin((20*e-11.125)*fs)/2+1,easeInBounce:e=>1-hs(1-e),easeOutBounce:hs,easeInOutBounce:e=>e<.5?(1-hs(1-2*e))/2:(1+hs(2*e-1))/2,steps:(e,t="end")=>n=>{let o=(n="end"===t?Math.min(n,.999):Math.max(n,.001))*e;return((e,t,n)=>Math.min(Math.max(n,e),t))(0,1,("end"===t?Math.floor(o):Math.ceil(o))/e)}},bs=Symbol.for("FluidValue.get"),ks=Symbol.for("FluidValue.observers"),_s=e=>Boolean(e&&e[bs]),ys=e=>e&&e[bs]?e[bs]():e,Es=e=>e[ks]||null;function Cs(e,t){let n=e[ks];n&&n.forEach((e=>{!function(e,t){e.eventObserved?e.eventObserved(t):e(t)}(e,t)}))}var Ss=class{[bs];[ks];constructor(e){if(!e&&!(e=this.get))throw Error("Unknown getter");ws(this,e)}},ws=(e,t)=>Ts(e,bs,t);function Bs(e,t){if(e[bs]){let n=e[ks];n||Ts(e,ks,n=new Set),n.has(t)||(n.add(t),e.observerAdded&&e.observerAdded(n.size,t))}return t}function Is(e,t){let n=e[ks];if(n&&n.has(t)){let o=n.size-1;o?n.delete(t):e[ks]=null,e.observerRemoved&&e.observerRemoved(o,t)}}var xs,Ts=(e,t,n)=>Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0}),Ms=/[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,Ns=/(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi,Ps=new RegExp(`(${Ms.source})(%|[a-z]+)`,"i"),Ls=/rgba\(([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+)\)/gi,Rs=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/,As=e=>{let[t,n]=Os(e);if(!t||Pa())return e;let o=window.getComputedStyle(document.documentElement).getPropertyValue(t);if(o)return o.trim();if(n&&n.startsWith("--")){return window.getComputedStyle(document.documentElement).getPropertyValue(n)||e}return n&&Rs.test(n)?As(n):n||e},Os=e=>{let t=Rs.exec(e);if(!t)return[,];let[,n,o]=t;return[n,o]},Ds=(e,t,n,o,r)=>`rgba(${Math.round(t)}, ${Math.round(n)}, ${Math.round(o)}, ${r})`,zs=e=>{xs||(xs=La?new RegExp(`(${Object.keys(La).join("|")})(?!\\w)`,"g"):/^\b$/);let t=e.output.map((e=>ys(e).replace(Rs,As).replace(Ns,cs).replace(xs,cs))),n=t.map((e=>e.match(Ms).map(Number))),o=n[0].map(((e,t)=>n.map((e=>{if(!(t in e))throw Error('The arity of each "output" value must be equal');return e[t]})))).map((t=>us({...e,output:t})));return e=>{let n=!Ps.test(t[0])&&t.find((e=>Ps.test(e)))?.replace(Ms,""),r=0;return t[0].replace(Ms,(()=>`${o[r++](e)}${n||""}`)).replace(Ls,Ds)}},Fs="react-spring: ",Vs=e=>{let t=e,n=!1;if("function"!=typeof t)throw new TypeError(`${Fs}once requires a function parameter`);return(...e)=>{n||(t(...e),n=!0)}},Hs=Vs(console.warn);var Gs=Vs(console.warn);function Us(e){return Ca.str(e)&&("#"==e[0]||/\d/.test(e)||!Pa()&&Rs.test(e)||e in(La||{}))}new WeakMap;new Set,new WeakMap,new WeakMap,new WeakMap;var $s=Pa()?ba.useEffect:ba.useLayoutEffect;function js(){let e=(0,ba.useState)()[1],t=(()=>{let e=(0,ba.useRef)(!1);return $s((()=>(e.current=!0,()=>{e.current=!1})),[]),e})();return()=>{t.current&&e(Math.random())}}var Ws=e=>(0,ba.useEffect)(e,Ks),Ks=[];function qs(e){let t=(0,ba.useRef)();return(0,ba.useEffect)((()=>{t.current=e})),t.current}var Ys=Symbol.for("Animated:node"),Zs=e=>e&&e[Ys],Qs=(e,t)=>((e,t,n)=>Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0}))(e,Ys,t),Xs=e=>e&&e[Ys]&&e[Ys].getPayload(),Js=class{payload;constructor(){Qs(this,this)}getPayload(){return this.payload||[]}},ec=class extends Js{constructor(e){super(),this._value=e,Ca.num(this._value)&&(this.lastPosition=this._value)}done=!0;elapsedTime;lastPosition;lastVelocity;v0;durationProgress=0;static create(e){return new ec(e)}getPayload(){return[this]}getValue(){return this._value}setValue(e,t){return Ca.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(){let{done:e}=this;this.done=!1,Ca.num(this._value)&&(this.elapsedTime=0,this.durationProgress=0,this.lastPosition=this._value,e&&(this.lastVelocity=null),this.v0=null)}},tc=class extends ec{_string=null;_toString;constructor(e){super(0),this._toString=us({output:[e,e]})}static create(e){return new tc(e)}getValue(){return this._string??(this._string=this._toString(this._value))}setValue(e){if(Ca.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=us({output:[this.getValue(),e]})),this._value=0,super.reset()}},nc={dependencies:null},oc=class extends Js{constructor(e){super(),this.source=e,this.setValue(e)}getValue(e){let t={};return Ba(this.source,((n,o)=>{(e=>!!e&&e[Ys]===e)(n)?t[o]=n.getValue(e):_s(n)?t[o]=ys(n):e||(t[o]=n)})),t}setValue(e){this.source=e,this.payload=this._makePayload(e)}reset(){this.payload&&wa(this.payload,(e=>e.reset()))}_makePayload(e){if(e){let t=new Set;return Ba(e,this._addToPayload,t),Array.from(t)}}_addToPayload(e){nc.dependencies&&_s(e)&&nc.dependencies.add(e);let t=Xs(e);t&&wa(t,(e=>this.add(e)))}},rc=class extends oc{constructor(e){super(e)}static create(e){return new rc(e)}getValue(){return this.source.map((e=>e.getValue()))}setValue(e){let t=this.getPayload();return e.length==t.length?t.map(((t,n)=>t.setValue(e[n]))).some(Boolean):(super.setValue(e.map(lc)),!0)}};function lc(e){return(Us(e)?tc:ec).create(e)}function ic(e){let t=Zs(e);return t?t.constructor:Ca.arr(e)?rc:Us(e)?tc:ec}var ac=(e,t)=>{let n=!Ca.fun(e)||e.prototype&&e.prototype.isReactComponent;return(0,ba.forwardRef)(((o,r)=>{let l=(0,ba.useRef)(null),i=n&&(0,ba.useCallback)((e=>{l.current=function(e,t){return e&&(Ca.fun(e)?e(t):e.current=t),t}(r,e)}),[r]),[a,s]=function(e,t){let n=new Set;return nc.dependencies=n,e.style&&(e={...e,style:t.createAnimatedStyle(e.style)}),e=new oc(e),nc.dependencies=null,[e,n]}(o,t),c=js(),u=()=>{let e=l.current;n&&!e||!1===(!!e&&t.applyAnimatedValues(e,a.getValue(!0)))&&c()},d=new sc(u,s),p=(0,ba.useRef)();$s((()=>(p.current=d,wa(s,(e=>Bs(e,d))),()=>{p.current&&(wa(p.current.deps,(e=>Is(e,p.current))),ta.cancel(p.current.update))}))),(0,ba.useEffect)(u,[]),Ws((()=>()=>{let e=p.current;wa(e.deps,(t=>Is(t,e)))}));let m=t.getComponentProps(a.getValue());return ba.createElement(e,{...m,ref:i})}))},sc=class{constructor(e,t){this.update=e,this.deps=t}eventObserved(e){"change"==e.type&&ta.write(this.update)}};var cc=Symbol.for("AnimatedComponent"),uc=e=>Ca.str(e)?e:e&&Ca.str(e.displayName)?e.displayName:Ca.fun(e)&&e.name||null;function dc(e,...t){return Ca.fun(e)?e(...t):e}var pc=(e,t)=>!0===e||!!(t&&e&&(Ca.fun(e)?e(t):Ia(e).includes(t))),mc=(e,t)=>Ca.obj(e)?t&&e[t]:e,gc=(e,t)=>!0===e.default?e[t]:e.default?e.default[t]:void 0,fc=e=>e,hc=(e,t=fc)=>{let n=vc;e.default&&!0!==e.default&&(e=e.default,n=Object.keys(e));let o={};for(let r of n){let n=t(e[r],r);Ca.und(n)||(o[r]=n)}return o},vc=["config","onProps","onStart","onChange","onPause","onResume","onRest"],bc={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 kc(e){let t=function(e){let t={},n=0;if(Ba(e,((e,o)=>{bc[o]||(t[o]=e,n++)})),n)return t}(e);if(t){let n={to:t};return Ba(e,((e,o)=>o in t||(n[o]=e))),n}return{...e}}function _c(e){return e=ys(e),Ca.arr(e)?e.map(_c):Us(e)?ya.createStringInterpolator({range:[0,1],output:[e,e]})(1):e}function yc(e){for(let t in e)return!0;return!1}function Ec(e){return Ca.fun(e)||Ca.arr(e)&&Ca.obj(e[0])}function Cc(e,t){e.ref?.delete(e),t?.delete(e)}function Sc(e,t){t&&e.ref!==t&&(e.ref?.delete(e),t.add(e),e.ref=t)}var wc={tension:170,friction:26,mass:1,damping:1,easing:vs.linear,clamp:!1};function Bc(e,t){if(Ca.und(t.decay)){let n=!Ca.und(t.tension)||!Ca.und(t.friction);(n||!Ca.und(t.frequency)||!Ca.und(t.damping)||!Ca.und(t.mass))&&(e.duration=void 0,e.decay=void 0),n&&(e.frequency=void 0)}else e.duration=void 0}var Ic=[];function xc(e,{key:t,props:n,defaultProps:o,state:r,actions:l}){return new Promise(((i,a)=>{let s,c,u=pc(n.cancel??o?.cancel,t);if(u)m();else{Ca.und(n.pause)||(r.paused=pc(n.pause,t));let e=o?.pause;!0!==e&&(e=r.paused||pc(e,t)),s=dc(n.delay||0,t),e?(r.resumeQueue.add(p),l.pause()):(l.resume(),p())}function d(){r.resumeQueue.add(p),r.timeouts.delete(c),c.cancel(),s=c.time-ta.now()}function p(){s>0&&!ya.skipAnimation?(r.delayed=!0,c=ta.setTimeout(m,s),r.pauseQueue.add(d),r.timeouts.add(c)):m()}function m(){r.delayed&&(r.delayed=!1),r.pauseQueue.delete(d),r.timeouts.delete(c),e<=(r.cancelId||0)&&(u=!0);try{l.start({...n,callId:e,cancel:u},i)}catch(e){a(e)}}}))}var Tc=(e,t)=>1==t.length?t[0]:t.some((e=>e.cancelled))?Pc(e.get()):t.every((e=>e.noop))?Mc(e.get()):Nc(e.get(),t.every((e=>e.finished))),Mc=e=>({value:e,noop:!0,finished:!0,cancelled:!1}),Nc=(e,t,n=!1)=>({value:e,finished:t,cancelled:n}),Pc=e=>({value:e,cancelled:!0,finished:!1});function Lc(e,t,n,o){let{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;let c,u,d,p=hc(t,((e,t)=>"onRest"===t?void 0:e)),m=new Promise(((e,t)=>(c=e,u=t))),g=e=>{let t=r<=(n.cancelId||0)&&Pc(o)||r!==n.asyncId&&Nc(o,!1);if(t)throw e.result=t,u(e),e},f=(e,t)=>{let l=new Ac,i=new Oc;return(async()=>{if(ya.skipAnimation)throw Rc(n),i.result=Nc(o,!1),u(i),i;g(l);let a=Ca.obj(e)?{...e}:{...t,to:e};a.parentId=r,Ba(p,((e,t)=>{Ca.und(a[t])&&(a[t]=e)}));let s=await o.start(a);return g(l),n.paused&&await new Promise((e=>{n.resumeQueue.add(e)})),s})()};if(ya.skipAnimation)return Rc(n),Nc(o,!1);try{let t;t=Ca.arr(e)?(async e=>{for(let t of e)await f(t)})(e):Promise.resolve(e(f,o.stop.bind(o))),await Promise.all([t.then(c),m]),d=Nc(o.get(),!0,!1)}catch(e){if(e instanceof Ac)d=e.result;else{if(!(e instanceof Oc))throw e;d=e.result}}finally{r==n.asyncId&&(n.asyncId=l,n.asyncTo=l?a:void 0,n.promise=l?s:void 0)}return Ca.fun(i)&&ta.batchedUpdates((()=>{i(d,o,o.item)})),d})():s}function Rc(e,t){xa(e.timeouts,(e=>e.cancel())),e.pauseQueue.clear(),e.resumeQueue.clear(),e.asyncId=e.asyncTo=e.promise=void 0,t&&(e.cancelId=t)}var Ac=class extends Error{result;constructor(){super("An async animation has been interrupted. You see this error because you forgot to use `await` or `.catch(...)` on its returned promise.")}},Oc=class extends Error{result;constructor(){super("SkipAnimationSignal")}},Dc=e=>e instanceof Fc,zc=1,Fc=class extends Ss{id=zc++;_priority=0;get priority(){return this._priority}set priority(e){this._priority!=e&&(this._priority=e,this._onPriorityChange(e))}get(){let e=Zs(this);return e&&e.getValue()}to(...e){return ya.to(this,e)}interpolate(...e){return Hs(`${Fs}The "interpolate" function is deprecated in v9 (use "to" instead)`),ya.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){Cs(this,{type:"change",parent:this,value:e,idle:t})}_onPriorityChange(e){this.idle||Ha.sort(this),Cs(this,{type:"priority",parent:this,priority:e})}},Vc=Symbol.for("SpringPhase"),Hc=e=>(1&e[Vc])>0,Gc=e=>(2&e[Vc])>0,Uc=e=>(4&e[Vc])>0,$c=(e,t)=>t?e[Vc]|=3:e[Vc]&=-3,jc=(e,t)=>t?e[Vc]|=4:e[Vc]&=-5,Wc=class extends Fc{key;animation=new class{changed=!1;values=Ic;toValues=null;fromValues=Ic;to;from;config=new class{tension;friction;frequency;damping;mass;velocity=0;restVelocity;precision;progress;duration;easing;clamp;bounce;decay;round;constructor(){Object.assign(this,wc)}};immediate=!1};queue;defaultProps={};_state={paused:!1,delayed:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set};_pendingCalls=new Set;_lastCallId=0;_lastToId=0;_memoizedDuration=0;constructor(e,t){if(super(),!Ca.und(e)||!Ca.und(t)){let n=Ca.obj(e)?{...e}:{...t,from:e};Ca.und(n.default)&&(n.default=!0),this.start(n)}}get idle(){return!(Gc(this)||this._state.asyncTo)||Uc(this)}get goal(){return ys(this.animation.to)}get velocity(){let e=Zs(this);return e instanceof ec?e.lastVelocity||0:e.getPayload().map((e=>e.lastVelocity||0))}get hasAnimated(){return Hc(this)}get isAnimating(){return Gc(this)}get isPaused(){return Uc(this)}get isDelayed(){return this._state.delayed}advance(e){let t=!0,n=!1,o=this.animation,{config:r,toValues:l}=o,i=Xs(o.to);!i&&_s(o.to)&&(l=Ia(ys(o.to))),o.values.forEach(((a,s)=>{if(a.done)return;let c=a.constructor==tc?1:i?i[s].lastPosition:l[s],u=o.immediate,d=c;if(!u){if(d=a.lastPosition,r.tension<=0)return void(a.done=!0);let t,n=a.elapsedTime+=e,l=o.fromValues[s],i=null!=a.v0?a.v0:a.v0=Ca.arr(r.velocity)?r.velocity[s]:r.velocity,p=r.precision||(l==c?.005:Math.min(1,.001*Math.abs(c-l)));if(Ca.und(r.duration))if(r.decay){let e=!0===r.decay?.998:r.decay,o=Math.exp(-(1-e)*n);d=l+i/(1-e)*(1-o),u=Math.abs(a.lastPosition-d)<=p,t=i*o}else{t=null==a.lastVelocity?i:a.lastVelocity;let n,o=r.restVelocity||p/10,s=r.clamp?0:r.bounce,m=!Ca.und(s),g=l==c?a.v0>0:lo,n||(u=Math.abs(c-d)<=p,!u));++e){m&&(f=d==c||d>c==g,f&&(t=-t*s,d=c)),t+=(1e-6*-r.tension*(d-c)+.001*-r.friction*t)/r.mass*h,d+=t*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,n=a.elapsedTime+=e)),o=(r.progress||0)+n/this._memoizedDuration,o=o>1?1:o<0?0:o,a.durationProgress=o),d=l+r.easing(o)*(c-l),t=(d-a.lastPosition)/e,u=1==o}a.lastVelocity=t,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)}));let a=Zs(this),s=a.getValue();if(t){let e=ys(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 ta.batchedUpdates((()=>{this._stop(),this._focus(e),this._set(e)})),this}pause(){this._update({pause:!0})}resume(){this._update({pause:!1})}finish(){if(Gc(this)){let{to:e,config:t}=this.animation;ta.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 Ca.und(e)?(n=this.queue||[],this.queue=[]):n=[Ca.obj(e)?e:{...t,to:e}],Promise.all(n.map((e=>this._update(e)))).then((e=>Tc(this,e)))}stop(e){let{to:t}=this.animation;return this._focus(this.get()),Rc(this._state,e&&this._lastCallId),ta.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){let t=this.key||"",{to:n,from:o}=e;n=Ca.obj(n)?n[t]:n,(null==n||Ec(n))&&(n=void 0),o=Ca.obj(o)?o[t]:o,null==o&&(o=void 0);let r={to:n,from:o};return Hc(this)||(e.reverse&&([n,o]=[o,n]),o=ys(o),Ca.und(o)?Zs(this)||this._set(n):this._set(o)),r}_update({...e},t){let{key:n,defaultProps:o}=this;e.default&&Object.assign(o,hc(e,((e,t)=>/^on/.test(t)?mc(e,n):e))),Jc(this,e,"onProps"),eu(this,"onProps",e,this);let r=this._prepareNode(e);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?");let l=this._state;return xc(++this._lastCallId,{key:n,props:e,defaultProps:o,state:l,actions:{pause:()=>{Uc(this)||(jc(this,!0),Na(l.pauseQueue),eu(this,"onPause",Nc(this,Kc(this,this.animation.to)),this))},resume:()=>{Uc(this)&&(jc(this,!1),Gc(this)&&this._resume(),Na(l.resumeQueue),eu(this,"onResume",Nc(this,Kc(this,this.animation.to)),this))},start:this._merge.bind(this,r)}}).then((n=>{if(e.loop&&n.finished&&(!t||!n.noop)){let t=qc(e);if(t)return this._update(t,!0)}return n}))}_merge(e,t,n){if(t.cancel)return this.stop(!0),n(Pc(this));let o=!Ca.und(e.to),r=!Ca.und(e.from);if(o||r){if(!(t.callId>this._lastToId))return n(Pc(this));this._lastToId=t.callId}let{key:l,defaultProps:i,animation:a}=this,{to:s,from:c}=a,{to:u=s,from:d=c}=e;r&&!o&&(!t.default||Ca.und(u))&&(u=d),t.reverse&&([u,d]=[d,u]);let p=!Sa(d,c);p&&(a.from=d),d=ys(d);let m=!Sa(u,s);m&&this._focus(u);let g=Ec(t.to),{config:f}=a,{decay:h,velocity:v}=f;(o||r)&&(f.velocity=0),t.config&&!g&&function(e,t,n){n&&(Bc(n={...n},t),t={...n,...t}),Bc(e,t),Object.assign(e,t);for(let t in wc)null==e[t]&&(e[t]=wc[t]);let{mass:o,frequency:r,damping:l}=e;Ca.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)}(f,dc(t.config,l),t.config!==i.config?dc(i.config,l):void 0);let b=Zs(this);if(!b||Ca.und(u))return n(Nc(this,!0));let k=Ca.und(t.reset)?r&&!t.default:!Ca.und(d)&&pc(t.reset,l),_=k?d:this.get(),y=_c(u),E=Ca.num(y)||Ca.arr(y)||Us(y),C=!g&&(!E||pc(i.immediate||t.immediate,l));if(m){let e=ic(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)}}let S=b.constructor,w=_s(u),B=!1;if(!w){let e=k||!Hc(this)&&p;(m||e)&&(B=Sa(_c(_),y),w=!B),(!Sa(a.immediate,C)&&!C||!Sa(f.decay,h)||!Sa(f.velocity,v))&&(w=!0)}if(B&&Gc(this)&&(a.changed&&!k?w=!0:w||this._stop(s)),!g&&((w||_s(s))&&(a.values=b.getPayload(),a.toValues=_s(u)?null:S==tc?[1]:Ia(y)),a.immediate!=C&&(a.immediate=C,!C&&!k&&this._set(s)),w)){let{onRest:e}=a;wa(Xc,(e=>Jc(this,t,e)));let o=Nc(this,Kc(this,s));Na(this._pendingCalls,o),this._pendingCalls.add(n),a.changed&&ta.batchedUpdates((()=>{a.changed=!k,e?.(o,this),k?dc(i.onRest,o):a.onStart?.(o,this)}))}k&&this._set(_),g?n(Lc(t.to,t,this._state,this)):w?this._start():Gc(this)&&!m?this._pendingCalls.add(n):n(Mc(_))}_focus(e){let t=this.animation;e!==t.to&&(Es(this)&&this._detach(),t.to=e,Es(this)&&this._attach())}_attach(){let e=0,{to:t}=this.animation;_s(t)&&(Bs(t,this),Dc(t)&&(e=t.priority+1)),this.priority=e}_detach(){let{to:e}=this.animation;_s(e)&&Is(e,this)}_set(e,t=!0){let n=ys(e);if(!Ca.und(n)){let e=Zs(this);if(!e||!Sa(n,e.getValue())){let o=ic(n);e&&e.constructor==o?e.setValue(n):Qs(this,o.create(n)),e&&ta.batchedUpdates((()=>{this._onChange(n,t)}))}}return Zs(this)}_onStart(){let e=this.animation;e.changed||(e.changed=!0,eu(this,"onStart",Nc(this,Kc(this,e.to)),this))}_onChange(e,t){t||(this._onStart(),dc(this.animation.onChange,e,this)),dc(this.defaultProps.onChange,e,this),super._onChange(e,t)}_start(){let e=this.animation;Zs(this).reset(ys(e.to)),e.immediate||(e.fromValues=e.values.map((e=>e.lastPosition))),Gc(this)||($c(this,!0),Uc(this)||this._resume())}_resume(){ya.skipAnimation?this.finish():Ha.start(this)}_stop(e,t){if(Gc(this)){$c(this,!1);let n=this.animation;wa(n.values,(e=>{e.done=!0})),n.toValues&&(n.onChange=n.onPause=n.onResume=void 0),Cs(this,{type:"idle",parent:this});let o=t?Pc(this.get()):Nc(this.get(),Kc(this,e??n.to));Na(this._pendingCalls,o),n.changed&&(n.changed=!1,eu(this,"onRest",o,this))}}};function Kc(e,t){let n=_c(t);return Sa(_c(e.get()),n)}function qc(e,t=e.loop,n=e.to){let o=dc(t);if(o){let r=!0!==o&&kc(o),l=(r||e).reverse,i=!r||r.reset;return Yc({...e,loop:t,default:!1,pause:void 0,to:!l||Ec(n)?n:void 0,from:i?e.from:void 0,reset:i,...r})}}function Yc(e){let{to:t,from:n}=e=kc(e),o=new Set;return Ca.obj(t)&&Qc(t,o),Ca.obj(n)&&Qc(n,o),e.keys=o.size?Array.from(o):null,e}function Zc(e){let t=Yc(e);return Ca.und(t.default)&&(t.default=hc(t)),t}function Qc(e,t){Ba(e,((e,n)=>null!=e&&t.add(n)))}var Xc=["onStart","onRest","onChange","onPause","onResume"];function Jc(e,t,n){e.animation[n]=t[n]!==gc(t,n)?mc(t[n],e.key):void 0}function eu(e,t,...n){e.animation[t]?.(...n),e.defaultProps[t]?.(...n)}var tu=["onStart","onChange","onRest"],nu=1,ou=class{id=nu++;springs={};queue=[];ref;_flush;_initialProps;_lastAsyncId=0;_active=new Set;_changed=new Set;_started=!1;_item;_state={paused:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set};_events={onStart:new Map,onChange:new Map,onRest:new Map};constructor(e,t){this._onFrame=this._onFrame.bind(this),t&&(this._flush=t),e&&this.start({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(){let e={};return this.each(((t,n)=>e[n]=t.get())),e}set(e){for(let t in e){let n=e[t];Ca.und(n)||this.springs[t].set(n)}}update(e){return e&&this.queue.push(Yc(e)),this}start(e){let{queue:t}=this;return e?t=Ia(e).map(Yc):this.queue=[],this._flush?this._flush(this,t):(uu(this,t),ru(this,t))}stop(e,t){if(e!==!!e&&(t=e),t){let n=this.springs;wa(Ia(t),(t=>n[t].stop(!!e)))}else Rc(this._state,this._lastAsyncId),this.each((t=>t.stop(!!e)));return this}pause(e){if(Ca.und(e))this.start({pause:!0});else{let t=this.springs;wa(Ia(e),(e=>t[e].pause()))}return this}resume(e){if(Ca.und(e))this.start({pause:!1});else{let t=this.springs;wa(Ia(e),(e=>t[e].resume()))}return this}each(e){Ba(this.springs,e)}_onFrame(){let{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,xa(e,(([e,t])=>{t.value=this.get(),e(t,this,this._item)})));let l=!o&&this._started,i=r||l&&n.size?this.get():null;r&&t.size&&xa(t,(([e,t])=>{t.value=i,e(t,this,this._item)})),l&&(this._started=!1,xa(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)}ta.onFrame(this._onFrame)}};function ru(e,t){return Promise.all(t.map((t=>lu(e,t)))).then((t=>Tc(e,t)))}async function lu(e,t,n){let{keys:o,to:r,from:l,loop:i,onRest:a,onResolve:s}=t,c=Ca.obj(t.default)&&t.default;i&&(t.loop=!1),!1===r&&(t.to=null),!1===l&&(t.from=null);let u=Ca.arr(r)||Ca.fun(r)?r:void 0;u?(t.to=void 0,t.onRest=void 0,c&&(c.onRest=void 0)):wa(tu,(n=>{let o=t[n];if(Ca.fun(o)){let r=e._events[n];t[n]=({finished:e,cancelled:t})=>{let 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])}}));let d=e._state;t.pause===!d.paused?(d.paused=t.pause,Na(t.pause?d.pauseQueue:d.resumeQueue)):d.paused&&(t.pause=!0);let p=(o||Object.keys(e.springs)).map((n=>e.springs[n].start(t))),m=!0===t.cancel||!0===gc(t,"cancel");(u||m&&d.asyncId)&&p.push(xc(++e._lastAsyncId,{props:t,state:d,actions:{pause:Ea,resume:Ea,start(t,n){m?(Rc(d,e._lastAsyncId),n(Pc(e))):(t.onRest=a,n(Lc(u,t,d,e)))}}})),d.paused&&await new Promise((e=>{d.resumeQueue.add(e)}));let g=Tc(e,await Promise.all(p));if(i&&g.finished&&(!n||!g.noop)){let n=qc(t,i,r);if(n)return uu(e,[n]),lu(e,n,!0)}return s&&ta.batchedUpdates((()=>s(g,e,e.item))),g}function iu(e,t){let n={...e.springs};return t&&wa(Ia(t),(e=>{Ca.und(e.keys)&&(e=Yc(e)),Ca.obj(e.to)||(e={...e,to:void 0}),cu(n,e,(e=>su(e)))})),au(e,n),n}function au(e,t){Ba(t,((t,n)=>{e.springs[n]||(e.springs[n]=t,Bs(t,e))}))}function su(e,t){let n=new Wc;return n.key=e,t&&Bs(n,t),n}function cu(e,t,n){t.keys&&wa(t.keys,(o=>{(e[o]||(e[o]=n(o)))._prepareNode(t)}))}function uu(e,t){wa(t,(t=>{cu(e.springs,t,(t=>su(t,e)))}))}var du=({children:e,...t})=>{let n=(0,ba.useContext)(pu),o=t.pause||!!n.pause,r=t.immediate||!!n.immediate;t=function(e,t){let[n]=(0,ba.useState)((()=>({inputs:t,result:e()}))),o=(0,ba.useRef)(),r=o.current,l=r;return l?Boolean(t&&l.inputs&&function(e,t){if(e.length!==t.length)return!1;for(let n=0;n{o.current=l,r==n&&(n.inputs=n.result=void 0)}),[l]),l.result}((()=>({pause:o,immediate:r})),[o,r]);let{Provider:l}=pu;return ba.createElement(l,{value:t},e)},pu=function(e,t){return Object.assign(e,ba.createContext(t)),e.Provider._context=e,e.Consumer._context=e,e}(du,{});du.Provider=pu.Provider,du.Consumer=pu.Consumer;var mu=()=>{let e=[],t=function(t){Gs(`${Fs}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`);let o=[];return wa(e,((e,r)=>{if(Ca.und(t))o.push(e.start());else{let 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){let n=e.indexOf(t);~n&&e.splice(n,1)},t.pause=function(){return wa(e,(e=>e.pause(...arguments))),this},t.resume=function(){return wa(e,(e=>e.resume(...arguments))),this},t.set=function(t){wa(e,((e,n)=>{let o=Ca.fun(t)?t(n,e):t;o&&e.set(o)}))},t.start=function(t){let n=[];return wa(e,((e,o)=>{if(Ca.und(t))n.push(e.start());else{let r=this._getProps(t,e,o);r&&n.push(e.start(r))}})),n},t.stop=function(){return wa(e,(e=>e.stop(...arguments))),this},t.update=function(t){return wa(e,((e,n)=>e.update(this._getProps(t,e,n)))),this};let n=function(e,t,n){return Ca.fun(e)?e(n,t):e};return t._getProps=n,t};function gu(e,t,n){let o=Ca.fun(t)&&t;o&&!n&&(n=[]);let r=(0,ba.useMemo)((()=>o||3==arguments.length?mu():void 0),[]),l=(0,ba.useRef)(0),i=js(),a=(0,ba.useMemo)((()=>({ctrls:[],queue:[],flush(e,t){let n=iu(e,t);return l.current>0&&!a.queue.length&&!Object.keys(n).some((t=>!e.springs[t]))?ru(e,t):new Promise((o=>{au(e,n),a.queue.push((()=>{o(ru(e,t))})),i()}))}})),[]),s=(0,ba.useRef)([...a.ctrls]),c=[],u=qs(e)||0;function d(e,n){for(let r=e;r{wa(s.current.slice(e,u),(e=>{Cc(e,r),e.stop(!0)})),s.current.length=e,d(u,e)}),[e]),(0,ba.useMemo)((()=>{d(0,Math.min(u,e))}),n);let p=s.current.map(((e,t)=>iu(e,c[t]))),m=(0,ba.useContext)(du),g=qs(m),f=m!==g&&yc(m);$s((()=>{l.current++,a.ctrls=s.current;let{queue:e}=a;e.length&&(a.queue=[],wa(e,(e=>e()))),wa(s.current,((e,t)=>{r?.add(e),f&&e.start({default:m});let n=c[t];n&&(Sc(e,n.ref),e.ref?e.queue.push(n):e.start(n))}))})),Ws((()=>()=>{wa(a.ctrls,(e=>e.stop(!0)))}));let h=p.map((e=>({...e})));return r?[h,r]:h}function fu(e,t){let n=Ca.fun(e),[[o],r]=gu(1,n?e:[e],n?t||[]:t);return n||2==arguments.length?[o,r]:o}var hu=class extends Fc{constructor(e,t){super(),this.source=e,this.calc=us(...t);let n=this._get(),o=ic(n);Qs(this,o.create(n))}key;idle=!0;calc;_active=new Set;advance(e){let t=this._get();Sa(t,this.get())||(Zs(this).setValue(t),this._onChange(t,this.idle)),!this.idle&&bu(this._active)&&ku(this)}_get(){let e=Ca.arr(this.source)?this.source.map(ys):Ia(ys(this.source));return this.calc(...e)}_start(){this.idle&&!bu(this._active)&&(this.idle=!1,wa(Xs(this),(e=>{e.done=!1})),ya.skipAnimation?(ta.batchedUpdates((()=>this.advance())),ku(this)):Ha.start(this))}_attach(){let e=1;wa(Ia(this.source),(t=>{_s(t)&&Bs(t,this),Dc(t)&&(t.idle||this._active.add(t),e=Math.max(e,t.priority+1))})),this.priority=e,this._start()}_detach(){wa(Ia(this.source),(e=>{_s(e)&&Is(e,this)})),this._active.clear(),ku(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=Ia(this.source).reduce(((e,t)=>Math.max(e,(Dc(t)?t.priority:0)+1)),0))}};function vu(e){return!1!==e.idle}function bu(e){return!e.size||Array.from(e).every(vu)}function ku(e){e.idle||(e.idle=!0,wa(Xs(e),(e=>{e.done=!0})),Cs(e,{type:"idle",parent:e}))}ya.assign({createStringInterpolator:zs,to:(e,t)=>new hu(e,t)});Ha.advance;var _u=window.ReactDOM,yu=/^--/;function Eu(e,t){return null==t||"boolean"==typeof t||""===t?"":"number"!=typeof t||0===t||yu.test(e)||Su.hasOwnProperty(e)&&Su[e]?(""+t).trim():t+"px"}var Cu={};var Su={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},wu=["Webkit","Ms","Moz","O"];Su=Object.keys(Su).reduce(((e,t)=>(wu.forEach((n=>e[((e,t)=>e+t.charAt(0).toUpperCase()+t.substring(1))(n,t)]=e[t])),e)),Su);var Bu=/^(matrix|translate|scale|rotate|skew)/,Iu=/^(translate)/,xu=/^(rotate|skew)/,Tu=(e,t)=>Ca.num(e)&&0!==e?e+t:e,Mu=(e,t)=>Ca.arr(e)?e.every((e=>Mu(e,t))):Ca.num(e)?e===t:parseFloat(e)===t,Nu=class extends oc{constructor({x:e,y:t,z:n,...o}){let r=[],l=[];(e||t||n)&&(r.push([e||0,t||0,n||0]),l.push((e=>[`translate3d(${e.map((e=>Tu(e,"px"))).join(",")})`,Mu(e,0)]))),Ba(o,((e,t)=>{if("transform"===t)r.push([e||""]),l.push((e=>[e,""===e]));else if(Bu.test(t)){if(delete o[t],Ca.und(e))return;let n=Iu.test(t)?"px":xu.test(t)?"deg":"";r.push(Ia(e)),l.push("rotate3d"===t?([e,t,o,r])=>[`rotate3d(${e},${t},${o},${Tu(r,n)})`,Mu(r,0)]:e=>[`${t}(${e.map((e=>Tu(e,n))).join(",")})`,Mu(e,t.startsWith("scale")?1:0)])}})),r.length&&(o.transform=new Pu(r,l)),super(o)}},Pu=class extends Ss{constructor(e,t){super(),this.inputs=e,this.transforms=t}_value=null;get(){return this._value||(this._value=this._get())}_get(){let e="",t=!0;return wa(this.inputs,((n,o)=>{let r=ys(n[0]),[l,i]=this.transforms[o](Ca.arr(r)?r:n.map(ys));e+=" "+l,t=t&&i})),t?"none":e}observerAdded(e){1==e&&wa(this.inputs,(e=>wa(e,(e=>_s(e)&&Bs(e,this)))))}observerRemoved(e){0==e&&wa(this.inputs,(e=>wa(e,(e=>_s(e)&&Is(e,this)))))}eventObserved(e){"change"==e.type&&(this._value=null),Cs(this,e)}};ya.assign({batchedUpdates:_u.unstable_batchedUpdates,createStringInterpolator:zs,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}});var Lu=((e,{applyAnimatedValues:t=(()=>!1),createAnimatedStyle:n=(e=>new oc(e)),getComponentProps:o=(e=>e)}={})=>{let r={applyAnimatedValues:t,createAnimatedStyle:n,getComponentProps:o},l=e=>{let t=uc(e)||"Anonymous";return(e=Ca.str(e)?l[e]||(l[e]=ac(e,r)):e[cc]||(e[cc]=ac(e,r))).displayName=`Animated(${t})`,e};return Ba(e,((t,n)=>{Ca.arr(e)&&(n=uc(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;let n="filter"===e.nodeName||e.parentNode&&"filter"===e.parentNode.nodeName,{style:o,children:r,scrollTop:l,scrollLeft:i,viewBox:a,...s}=t,c=Object.values(s),u=Object.keys(s).map((t=>n||e.hasAttribute(t)?t:Cu[t]||(Cu[t]=t.replace(/([A-Z])/g,(e=>"-"+e.toLowerCase())))));void 0!==r&&(e.textContent=r);for(let t in o)if(o.hasOwnProperty(t)){let n=Eu(t,o[t]);yu.test(t)?e.style.setProperty(t,n):e.style[t]=n}u.forEach(((t,n)=>{e.setAttribute(t,c[n])})),void 0!==l&&(e.scrollTop=l),void 0!==i&&(e.scrollLeft=i),void 0!==a&&e.setAttribute("viewBox",a)},createAnimatedStyle:e=>new Nu(e),getComponentProps:({scrollTop:e,scrollLeft:t,...n})=>n}),Ru=Lu.animated;const Au=e=>e+1,Ou=e=>({top:e.offsetTop,left:e.offsetLeft});var Du=function(e){let{isSelected:t,adjustScrolling:n,enableAnimation:o,triggerAnimationOnChange:r}=e;const l=(0,u.useRef)(),i=(0,m.useReducedMotion)()||!o,[a,s]=(0,u.useReducer)(Au,0),[c,d]=(0,u.useReducer)(Au,0),[p,g]=(0,u.useState)({x:0,y:0}),f=(0,u.useMemo)((()=>l.current?Ou(l.current):null),[r]),h=(0,u.useMemo)((()=>{if(!n||!l.current)return()=>{};const e=(0,Ri.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,u.useLayoutEffect)((()=>{a&&d()}),[a]),(0,u.useLayoutEffect)((()=>{if(!f)return;if(i)return void h();l.current.style.transform=void 0;const e=Ou(l.current);s(),g({x:Math.round(f.left-e.left),y:Math.round(f.top-e.top)})}),[r]),fu({from:{x:p.x,y:p.y},to:{x:0,y:0},reset:a!==c,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 zu=".block-editor-block-list__block",Fu=".block-list-appender",Vu=".block-editor-button-block-appender";function Hu(e,t){return t.closest([zu,Fu,Vu].join(","))===e}function Gu(e){for(;e&&e.nodeType!==e.ELEMENT_NODE;)e=e.parentNode;if(!e)return;const t=e.closest(zu);return t?t.id.slice("block-".length):void 0}function Uu(e){const t=(0,u.useRef)(),n=function(e){return(0,g.useSelect)((t=>{const{getSelectedBlocksInitialCaretPosition:n,__unstableGetEditorMode:o,isBlockSelected:r}=t(To);if(r(e)&&"edit"===o())return n()}),[e])}(e),{isBlockSelected:o,isMultiSelecting:r}=(0,g.useSelect)(To);return(0,u.useEffect)((()=>{if(!o(e)||r())return;if(null==n)return;if(!t.current)return;const{ownerDocument:l}=t.current;if(Hu(t.current,l.activeElement))return;const i=Ri.focus.tabbable.find(t.current).filter((e=>(0,Ri.isTextField)(e))),a=-1===n,s=i[a?i.length-1:0]||t.current;if(Hu(t.current,s)){if(!t.current.getAttribute("contenteditable")){const e=Ri.focus.tabbable.findNext(t.current);if(e&&Hu(t.current,e)&&(0,Ri.isFormElement)(e))return void e.focus()}(0,Ri.placeCaretAtHorizontalEdge)(s,a)}else t.current.focus()}),[n,e]),t}function $u(e){if(e.defaultPrevented)return;const t="mouseover"===e.type?"add":"remove";e.preventDefault(),e.currentTarget.classList[t]("is-hovered")}function ju(){const e=(0,g.useSelect)((e=>{const{getSettings:t}=e(To);return t().outlineMode}),[]);return(0,m.useRefEffect)((t=>{if(e)return t.addEventListener("mouseout",$u),t.addEventListener("mouseover",$u),()=>{t.removeEventListener("mouseout",$u),t.removeEventListener("mouseover",$u),t.classList.remove("is-hovered")}}),[e])}function Wu(e){return(0,g.useSelect)((t=>{const{isBlockBeingDragged:n,isBlockHighlighted:o,isBlockSelected:r,isBlockMultiSelected:l,getBlockName:i,getSettings:s,hasSelectedInnerBlock:c,isTyping:u,__unstableIsFullySelected:d,__unstableSelectionHasUnmergeableBlock:m}=t(To),{outlineMode:g}=s(),f=n(e),h=r(e),v=i(e),b=c(e,!0),k=l(e);return p()({"is-selected":h,"is-highlighted":o(e),"is-multi-selected":k,"is-partially-selected":k&&!d()&&!m(),"is-reusable":(0,a.isReusableBlock)((0,a.getBlockType)(v)),"is-dragging":f,"has-child-selected":b,"remove-outline":h&&g&&u()})}),[e])}function Ku(e){return(0,g.useSelect)((t=>{const n=t(To).getBlockName(e),o=(0,a.getBlockType)(n);if((null==o?void 0:o.apiVersion)>1)return(0,a.getBlockDefaultClassName)(n)}),[e])}function qu(e){return(0,g.useSelect)((t=>{const{getBlockName:n,getBlockAttributes:o}=t(To),r=o(e);if(null==r||!r.className)return;const l=(0,a.getBlockType)(n(e));return(null==l?void 0:l.apiVersion)>1?r.className:void 0}),[e])}function Yu(e){return(0,g.useSelect)((t=>{const{hasBlockMovingClientId:n,canInsertBlockType:o,getBlockName:r,getBlockRootClientId:l,isBlockSelected:i}=t(To);if(!i(e))return;const a=n();return a?p()("is-block-moving-mode",{"can-insert-moving-block":o(r(a),l(e))}):void 0}),[e])}function Zu(e){const{isBlockSelected:t}=(0,g.useSelect)(To),{selectBlock:n,selectionChange:o}=(0,g.useDispatch)(To);return(0,m.useRefEffect)((r=>{function l(l){r.parentElement.closest('[contenteditable="true"]')||(t(e)?l.target.isContentEditable||o(e):Hu(r,l.target)&&n(e))}return r.addEventListener("focusin",l),()=>{r.removeEventListener("focusin",l)}}),[t,n])}var Qu=window.wp.keycodes;function Xu(e){const t=(0,g.useSelect)((t=>t(To).isBlockSelected(e)),[e]),{getBlockRootClientId:n,getBlockIndex:o}=(0,g.useSelect)(To),{insertDefaultBlock:r,removeBlock:l}=(0,g.useDispatch)(To);return(0,m.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!==Qu.ENTER&&a!==Qu.BACKSPACE&&a!==Qu.DELETE||s!==i||(0,Ri.isTextField)(s)||(t.preventDefault(),a===Qu.ENTER?r({},n(e),o(e)+1):l(e))}function s(e){e.preventDefault()}}),[e,t,n,o,r,l])}function Ju(e){const{isNavigationMode:t,isBlockSelected:n}=(0,g.useSelect)(To),{setNavigationMode:o,selectBlock:r}=(0,g.useDispatch)(To);return(0,m.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 ed(){const e=(0,u.useContext)(Uv);return(0,m.useRefEffect)((t=>{if(e)return e.observe(t),()=>{e.unobserve(t)}}),[e])}function td(e){return(0,g.useSelect)((t=>{const{__unstableHasActiveBlockOverlayActive:n}=t(To);return n(e)}),[e])}function nd(){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:r={},isAligned:l}=(0,u.useContext)(od),{index:i,mode:s,name:c,blockApiVersion:d,blockTitle:f,isPartOfSelection:h,adjustScrolling:v,enableAnimation:b}=(0,g.useSelect)((e=>{const{getBlockAttributes:t,getBlockIndex:o,getBlockMode:r,getBlockName:l,isTyping:i,getGlobalBlockCount:s,isBlockSelected:c,isBlockMultiSelected:u,isAncestorMultiSelected:d,isFirstMultiSelectedBlock:p}=e(To),{getActiveBlockVariation:m}=e(a.store),g=c(n),f=u(n)||d(n),h=l(n),v=(0,a.getBlockType)(h),b=m(h,t(n));return{index:o(n),mode:r(n),name:h,blockApiVersion:(null==v?void 0:v.apiVersion)||1,blockTitle:(null==b?void 0:b.title)||(null==v?void 0:v.title),isPartOfSelection:g||f,adjustScrolling:g||p(n),enableAnimation:!i()&&s()<=200}}),[n]),k=td(n),y=(0,_.sprintf)((0,_.__)("Block: %s"),f),E="html"!==s||t?"":"-visual",C=(0,m.useMergeRefs)([e.ref,Uu(n),Jo(n),Zu(n),Xu(n),Ju(n),ju(),ed(),Du({isSelected:h,adjustScrolling:v,enableAnimation:b,triggerAnimationOnChange:i}),(0,m.useDisabled)({isDisabled:!k})]),S=Ro();return d<2&&n===S.clientId&&"undefined"!=typeof process&&process.env,{tabIndex:0,...r,...e,ref:C,id:`block-${n}${E}`,role:"document","aria-label":y,"data-block":n,"data-type":c,"data-title":f,className:p()(p()("block-editor-block-list__block",{"wp-block":!l,"has-block-overlay":k}),o,e.className,r.className,Wu(n),Ku(n),qu(n),Yu(n)),style:{...r.style,...e.style}}}nd.save=a.__unstableGetBlockProps;const od=(0,u.createContext)();function rd(e){let{children:t,isHtml:n,...o}=e;return(0,u.createElement)("div",nd(o,{__unstableIsHtml:n}),t)}const ld=(0,g.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(To),d=s(n),p=r(n),m=a(o),g=c(n,o),f=u(n,o),{name:h,attributes:v,isValid:b}=d||{};return{mode:l(n),isSelectionEnabled:i(),isLocked:!!m,canRemove:g,canMove:f,block:d,name:h,attributes:v,isValid:b,isSelected:p}})),id=(0,g.withDispatch)(((e,t,n)=>{const{updateBlockAttributes:o,insertBlocks:r,mergeBlocks:l,replaceBlocks:i,toggleSelection:s,__unstableMarkLastChangeAsPersistent:c,moveBlocksToPosition:u,removeBlock:d}=e(To);return{setAttributes(e){const{getMultiSelectedBlockClientIds:r}=n.select(To),l=r(),{clientId:i}=t,a=l.length?l:[i];o(a,e)},onInsertBlocks(e,n){const{rootClientId:o}=t;r(e,n,o)},onInsertBlocksAfter(e){const{clientId:o,rootClientId:l}=t,{getBlockIndex:i}=n.select(To),a=i(o);r(e,a+1,l)},onMerge(e){const{clientId:o,rootClientId:i}=t,{getPreviousBlockClientId:s,getNextBlockClientId:c,getBlock:p,getBlockAttributes:m,getBlockName:g,getBlockOrder:f,getBlockIndex:h,getBlockRootClientId:v,canInsertBlockType:b}=n.select(To);function k(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const o=v(e),l=f(e),[i]=l;if(1===l.length&&(0,a.isUnmodifiedBlock)(p(i)))d(e);else{if(b(g(i),o))u([i],e,o,h(e));else{const l=(0,a.switchToBlockType)(p(i),(0,a.getDefaultBlockName)());l&&l.length&&n.batch((()=>{r(l,h(e),o,t),d(i,!1)}))}!f(e).length&&(0,a.isUnmodifiedBlock)(p(e))&&d(e,!1)}}if(e){if(i){const e=c(i);if(e){if(g(i)!==g(e))return void l(i,e);{const t=m(i),o=m(e);if(Object.keys(t).every((e=>t[e]===o[e])))return void n.batch((()=>{u(f(e),e,i),d(e,!1)}))}}}const e=c(o);if(!e)return;f(e).length?k(e,!1):l(o,e)}else{const e=s(o);if(e)l(e,o);else if(i){const e=s(i);if(e&&g(i)===g(e)){const t=m(i),o=m(e);if(Object.keys(t).every((e=>t[e]===o[e])))return void n.batch((()=>{u(f(i),i,e),d(i,!1)}))}k(i)}}},onReplace(e,n,o){e.length&&!(0,a.isUnmodifiedDefaultBlock)(e[e.length-1])&&c(),i([t.clientId],e,n,o)},toggleSelection(e){s(e)}}}));var ad=(0,m.compose)(m.pure,ld,id,(0,m.ifCondition)((e=>{let{block:t}=e;return!!t})),(0,h.withFilters)("editor.BlockListBlock"))((function(e){var t;let{block:{__unstableBlockSource:n},mode:o,isLocked:r,canRemove:l,clientId:i,isSelected:s,isSelectionEnabled:c,className:d,__unstableLayoutClassNames:m,name:f,isValid:h,attributes:v,wrapperProps:b,setAttributes:k,onReplace:_,onInsertBlocksAfter:y,onMerge:E,toggleSelection:C}=e;const{themeSupportsLayout:S,hasContentLockedParent:w,isContentBlock:B,isContentLocking:I,isTemporarilyEditingAsBlocks:x}=(0,g.useSelect)((e=>{const{getSettings:t,__unstableGetContentLockingParent:n,getTemplateLock:o,__unstableGetTemporarilyEditingAsBlocks:r}=e(To),l=!!n(i);return{themeSupportsLayout:t().supportsLayout,isContentBlock:e(a.store).__experimentalHasContentRoleAttribute(f),hasContentLockedParent:l,isContentLocking:"contentOnly"===o(i)&&!l,isTemporarilyEditingAsBlocks:r()===i}}),[f,i]),{removeBlock:T}=(0,g.useDispatch)(To),M=(0,u.useCallback)((()=>T(i)),[i]),N=ci()||{};let P=(0,u.createElement)(Vi,{name:f,isSelected:s,attributes:v,setAttributes:k,insertBlocksAfter:r?void 0:y,onReplace:l?_:void 0,onRemove:l?M:void 0,mergeBlocks:l?E:void 0,clientId:i,isSelectionEnabled:c,toggleSelection:C,__unstableLayoutClassNames:m,__unstableParentLayout:Object.keys(N).length?N:void 0});const L=(0,a.getBlockType)(f);w&&!B&&(b={...b,tabIndex:-1}),null!=L&&L.getEditWrapperProps&&(b=function(e,t){const n={...e,...t};return null!=e&&e.className&&null!=t&&t.className&&(n.className=p()(e.className,t.className)),null!=e&&e.style&&null!=t&&t.style&&(n.style={...e.style,...t.style}),n}(b,L.getEditWrapperProps(v)));const R=b&&!!b["data-align"]&&!S;let A;if(R&&(P=(0,u.createElement)("div",{className:"wp-block","data-align":b["data-align"]},P)),h)A="html"===o?(0,u.createElement)(u.Fragment,null,(0,u.createElement)("div",{style:{display:"none"}},P),(0,u.createElement)(rd,{isHtml:!0},(0,u.createElement)(Ji,{clientId:i}))):(null==L?void 0:L.apiVersion)>1?P:(0,u.createElement)(rd,b,P);else{const e=n?(0,a.serializeRawBlock)(n):(0,a.getSaveContent)(L,v);A=(0,u.createElement)(rd,{className:"has-warning"},(0,u.createElement)(Ki,{clientId:i}),(0,u.createElement)(u.RawHTML,null,(0,Ri.safeHTML)(e)))}const{"data-align":O,...D}=null!==(t=b)&&void 0!==t?t:{},z={clientId:i,className:p()({"is-content-locked":I,"is-content-locked-temporarily-editing-as-blocks":x,"is-content-block":w&&B},O&&S&&`align${O}`,d),wrapperProps:D,isAligned:R},F=(0,u.useMemo)((()=>z),Object.values(z));return(0,u.createElement)(od.Provider,{value:F},(0,u.createElement)(Qi,{fallback:(0,u.createElement)(rd,{className:"has-warning"},(0,u.createElement)(Yi,null))},A))})),sd=window.wp.htmlEntities;var cd=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"M18 11.2h-5.2V6h-1.6v5.2H6v1.6h5.2V18h1.6v-5.2H18z"}));const ud=[(0,u.createInterpolateElement)((0,_.__)("While writing, you can press / to quickly insert new blocks."),{kbd:(0,u.createElement)("kbd",null)}),(0,u.createInterpolateElement)((0,_.__)("Indent a list by pressing space at the beginning of a line."),{kbd:(0,u.createElement)("kbd",null)}),(0,u.createInterpolateElement)((0,_.__)("Outdent a list by pressing backspace at the beginning of a line."),{kbd:(0,u.createElement)("kbd",null)}),(0,_.__)("Drag files into the editor to automatically insert media blocks."),(0,_.__)("Change a block's type by pressing the block icon on the toolbar.")];var dd=function(){const[e]=(0,u.useState)(Math.floor(Math.random()*ud.length));return(0,u.createElement)(h.Tip,null,ud[e])};var pd=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"M10.6 6L9.4 7l4.6 5-4.6 5 1.2 1 5.4-6z"}));var md=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"M14.6 7l-1.2-1L8 12l5.4 6 1.2-1-4.6-5z"}));var gd=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.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 fd=(0,u.memo)((function(e){var t;let{icon:n,showColors:o=!1,className:r,context:l}=e;"block-default"===(null===(t=n)||void 0===t?void 0:t.src)&&(n={src:gd});const i=(0,u.createElement)(h.Icon,{icon:n&&n.src?n.src:n,context:l}),a=o?{backgroundColor:n&&n.background,color:n&&n.foreground}:{};return(0,u.createElement)("span",{style:a,className:p()("block-editor-block-icon",r,{"has-colors":o})},i)}));var hd=function(e){let{title:t,icon:n,description:o,blockType:r,className:l}=e;r&&(W()("`blockType` property in `BlockCard component`",{since:"5.7",alternative:"`title, icon and description` properties"}),({title:t,icon:n,description:o}=r));const{parentNavBlockClientId:i}=(0,g.useSelect)((e=>{const{getSelectedBlockClientId:t,getBlockParentsByBlockName:n}=e(To);return{parentNavBlockClientId:n(t(),"core/navigation",!0)[0]}}),[]),{selectBlock:a}=(0,g.useDispatch)(To);return(0,u.createElement)("div",{className:p()("block-editor-block-card",l)},i&&(0,u.createElement)(h.Button,{onClick:()=>a(i),label:(0,_.__)("Go to parent Navigation block"),style:{minWidth:24,padding:0},icon:(0,_.isRTL)()?pd:md,isSmall:!0}),(0,u.createElement)(fd,{icon:n,showColors:!0}),(0,u.createElement)("div",{className:"block-editor-block-card__content"},(0,u.createElement)("h2",{className:"block-editor-block-card__title"},t),(0,u.createElement)("span",{className:"block-editor-block-card__description"},o)))};const vd=(0,m.createHigherOrderComponent)((e=>(0,g.withRegistry)((t=>{let{useSubRegistry:n=!0,registry:o,...r}=t;if(!n)return(0,u.createElement)(e,c({registry:o},r));const[l,i]=(0,u.useState)(null);return(0,u.useEffect)((()=>{const e=(0,g.createRegistry)({},o);e.registerStore(So,xo),i(e)}),[o]),l?(0,u.createElement)(g.RegistryProvider,{value:l},(0,u.createElement)(e,c({registry:l},r))):null}))),"withRegistryProvider");const bd=()=>{};function kd(e){let{clientId:t=null,value:n,selection:o,onChange:r=bd,onInput:l=bd}=e;const i=(0,g.useRegistry)(),{resetBlocks:s,resetSelection:c,replaceInnerBlocks:d,setHasControlledInnerBlocks:p,__unstableMarkNextChangeAsNotPersistent:m}=i.dispatch(To),{getBlockName:f,getBlocks:h}=i.select(To),v=(0,g.useSelect)((e=>!t||e(To).areInnerBlocksControlled(t)),[t]),b=(0,u.useRef)({incoming:null,outgoing:[]}),k=(0,u.useRef)(!1),_=()=>{n&&(m(),t?i.batch((()=>{p(t,!0);const e=n.map((e=>(0,a.cloneBlock)(e)));k.current&&(b.current.incoming=e),m(),d(t,e)})):(k.current&&(b.current.incoming=n),s(n)))},y=(0,u.useRef)(l),E=(0,u.useRef)(r);(0,u.useEffect)((()=>{y.current=l,E.current=r}),[l,r]),(0,u.useEffect)((()=>{b.current.outgoing.includes(n)?b.current.outgoing[b.current.outgoing.length-1]===n&&(b.current.outgoing=[]):h(t)!==n&&(b.current.outgoing=[],_(),o&&c(o.selectionStart,o.selectionEnd,o.initialPosition))}),[n,t]),(0,u.useEffect)((()=>{v||(b.current.outgoing=[],_())}),[v]),(0,u.useEffect)((()=>{const{getSelectionStart:e,getSelectionEnd:n,getSelectedBlocksInitialCaretPosition:o,isLastBlockChangePersistent:r,__unstableIsLastBlockChangeIgnored:l,areInnerBlocksControlled:a}=i.select(To);let s=h(t),c=r(),u=!1;k.current=!0;const d=i.subscribe((()=>{if(null!==t&&null===f(t))return;if(!(!t||a(t)))return;const i=r(),d=h(t),p=d!==s;if(s=d,p&&(b.current.incoming||l()))return b.current.incoming=null,void(c=i);if(p||u&&!p&&i&&!c){c=i,b.current.outgoing.push(s);(c?E.current:y.current)(s,{selection:{selectionStart:e(),selectionEnd:n(),initialPosition:o()}})}u=p}));return()=>{k.current=!1,d()}}),[i,t])}const _d=vd((e=>{const{children:t,settings:n,stripExperimentalSettings:o=!1}=e,{__experimentalUpdateSettings:r}=Io((0,g.useDispatch)(To));return(0,u.useEffect)((()=>{r({...n,__internalIsInitialized:!0},o)}),[n]),kd(e),(0,u.createElement)(Xo,null,t)}));var yd=e=>(0,u.createElement)(_d,c({},e,{stripExperimentalSettings:!0}),e.children);function Ed(){const{getSettings:e,hasSelectedBlock:t,hasMultiSelection:n}=(0,g.useSelect)(To),{clearSelectedBlock:o}=(0,g.useDispatch)(To),{clearBlockSelection:r}=e();return(0,m.useRefEffect)((e=>{if(r)return e.addEventListener("mousedown",l),()=>{e.removeEventListener("mousedown",l)};function l(r){(t()||n())&&r.target===e&&o()}}),[t,n,o,r])}function Cd(e){return(0,u.createElement)("div",c({ref:Ed()},e))}function Sd(e){const{isMultiSelecting:t,getMultiSelectedBlockClientIds:n,hasMultiSelection:o,getSelectedBlockClientId:r,getSelectedBlocksInitialCaretPosition:l,__unstableIsFullySelected:i}=e(To);return{isMultiSelecting:t(),multiSelectedBlockClientIds:n(),hasMultiSelection:o(),selectedBlockClientId:r(),initialPosition:l(),isFullSelection:i()}}function wd(){const{initialPosition:e,isMultiSelecting:t,multiSelectedBlockClientIds:n,hasMultiSelection:o,selectedBlockClientId:r,isFullSelection:l}=(0,g.useSelect)(Sd,[]);return(0,m.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 Bd(e,t,n,o){let r,l=Ri.focus.focusable.find(n);return t&&l.reverse(),l=l.slice(l.indexOf(e)+1),o&&(r=e.getBoundingClientRect()),l.find((function(e){if(1!==e.children.length||!function(e,t){return e.closest(zu)===t.closest(zu)}(e,e.firstElementChild)||"true"!==e.firstElementChild.getAttribute("contenteditable")){if(!Ri.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 Id(){const{getMultiSelectedBlocksStartClientId:e,getMultiSelectedBlocksEndClientId:t,getSettings:n,hasMultiSelection:o,__unstableIsFullySelected:r}=(0,g.useSelect)(To),{selectBlock:l}=(0,g.useDispatch)(To);return(0,m.useRefEffect)((i=>{let a;function s(){a=null}function c(s){if(s.defaultPrevented)return;const{keyCode:c,target:u,shiftKey:d,ctrlKey:p,altKey:m,metaKey:g}=s,f=c===Qu.UP,h=c===Qu.DOWN,v=c===Qu.LEFT,b=c===Qu.RIGHT,k=f||v,_=v||b,y=f||h,E=_||y,C=d||p||m||g,S=y?Ri.isVerticalEdge:Ri.isHorizontalEdge,{ownerDocument:w}=i,{defaultView:B}=w;if(!E)return;if(o()){if(d)return;if(!r())return;return s.preventDefault(),void(k?l(e()):l(t(),-1))}if(!function(e,t,n){if((t===Qu.UP||t===Qu.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,C))return;y?a||(a=(0,Ri.computeCaretRect)(B)):a=null;const I=(0,Ri.isRTL)(u)?!k:k,{keepCaretInsideBlock:x}=n();if(d)(function(e,t){const n=Bd(e,t,i);return n&&Gu(n)})(u,k)&&S(u,k)&&(i.contentEditable=!0,i.focus());else if(!y||!(0,Ri.isVerticalEdge)(u,k)||m&&!(0,Ri.isHorizontalEdge)(u,I)||x){if(_&&B.getSelection().isCollapsed&&(0,Ri.isHorizontalEdge)(u,I)&&!x){const e=Bd(u,I,i);(0,Ri.placeCaretAtHorizontalEdge)(e,k),s.preventDefault()}}else{const e=Bd(u,k,i,!0);e&&((0,Ri.placeCaretAtVerticalEdge)(e,m?!k:k,m?void 0:a),s.preventDefault())}}return i.addEventListener("mousedown",s),i.addEventListener("keydown",c),()=>{i.removeEventListener("mousedown",s),i.removeEventListener("keydown",c)}}),[])}var xd=window.wp.keyboardShortcuts;function Td(){const{getBlockOrder:e,getSelectedBlockClientIds:t,getBlockRootClientId:n}=(0,g.useSelect)(To),{multiSelect:o,selectBlock:r}=(0,g.useDispatch)(To),l=(0,xd.__unstableUseShortcutEventMatch)();return(0,m.useRefEffect)((i=>{function a(a){if(!l("core/block-editor/select-all",a))return;const s=t();if(s.length<2&&!(0,Ri.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 Md(e,t){e.contentEditable=t,t&&e.focus()}function Nd(){const{startMultiSelect:e,stopMultiSelect:t}=(0,g.useDispatch)(To),{isSelectionEnabled:n,hasMultiSelection:o,isDraggingBlocks:r}=(0,g.useSelect)(To);return(0,m.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;Md(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),Md(l,!0))}return l.addEventListener("mouseout",d),()=>{l.removeEventListener("mouseout",d),a.removeEventListener("mouseup",u),a.cancelAnimationFrame(c)}}),[e,t,n,o])}function Pd(e,t){e.contentEditable=t,t&&e.focus()}function Ld(){const{multiSelect:e,selectBlock:t,selectionChange:n}=(0,g.useDispatch)(To),{getBlockParents:o,getBlockSelectionStart:r}=(0,g.useSelect)(To);return(0,m.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 Pd(n,!1);let c=Gu(function(e){const{anchorNode:t,anchorOffset:n}=e;return t.nodeType===t.TEXT_NODE||0===n?t:t.childNodes[n-1]}(a)),u=Gu(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=Gu(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 Pd(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 Rd(){const{selectBlock:e}=(0,g.useDispatch)(To),{isSelectionEnabled:t,getBlockSelectionStart:n,hasMultiSelection:o}=(0,g.useSelect)(To);return(0,m.useRefEffect)((r=>{function l(l){if(!t()||0!==l.button)return;const i=n(),a=Gu(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 Ad(){const{__unstableIsFullySelected:e,getSelectedBlockClientIds:t,__unstableIsSelectionMergeable:n,hasMultiSelection:o}=(0,g.useSelect)(To),{replaceBlocks:r,__unstableSplitSelection:l,removeBlocks:i,__unstableDeleteSelection:s,__unstableExpandSelection:c}=(0,g.useDispatch)(To);return(0,m.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===Qu.ENTER?(u.contentEditable=!1,d.preventDefault(),e()?r(t(),(0,a.createBlock)((0,a.getDefaultBlockName)())):l()):d.keyCode===Qu.BACKSPACE||d.keyCode===Qu.DELETE?(u.contentEditable=!1,d.preventDefault(),e()?i(t()):n()?s(d.keyCode===Qu.DELETE):c()):1!==d.key.length||d.metaKey||d.ctrlKey||(u.contentEditable=!1,n()?s(d.keyCode===Qu.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,u.useRef)(),t=(0,u.useRef)(),n=(0,u.useRef)(),o=(0,u.useRef)(),{hasMultiSelection:r,getSelectedBlockClientId:l,getBlockCount:i}=(0,g.useSelect)(To),{setNavigationMode:a}=(0,g.useDispatch)(To),s=(0,g.useSelect)((e=>e(To).isNavigationMode()),[])?void 0:"0",c=(0,u.useRef)();function d(t){if(c.current)c.current=null;else if(r())e.current.focus();else if(l())o.current.focus();else{a(!0);const n=t.target.compareDocumentPosition(e.current)&t.target.DOCUMENT_POSITION_FOLLOWING?"findNext":"findPrevious";Ri.focus.tabbable[n](t.target).focus()}}const p=(0,u.createElement)("div",{ref:t,tabIndex:s,onFocus:d}),f=(0,u.createElement)("div",{ref:n,tabIndex:s,onFocus:d}),h=(0,m.useRefEffect)((s=>{function u(e){if(e.defaultPrevented)return;if(e.keyCode===Qu.ESCAPE)return e.preventDefault(),void a(!0);if(e.keyCode!==Qu.TAB)return;const o=e.shiftKey,i=o?"findPrevious":"findNext";if(!r()&&!l())return void(e.target===s&&a(!0));if(((0,Ri.isFormElement)(e.target)||e.target.getAttribute("data-block")===l())&&(0,Ri.isFormElement)(Ri.focus.tabbable[i](e.target)))return;const u=o?t:n;c.current=!0,u.current.focus({preventScroll:!0})}function d(e){o.current=e.target;const{ownerDocument:t}=s;e.relatedTarget||t.activeElement!==t.body||0!==i()||s.focus()}function p(o){var r;if(o.keyCode!==Qu.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=Ri.focus.tabbable[l](o.target);i!==t.current&&i!==n.current||(o.preventDefault(),i.focus({preventScroll:!0}))}const{ownerDocument:m}=s,{defaultView:g}=m;return g.addEventListener("keydown",p),s.addEventListener("keydown",u),s.addEventListener("focusout",d),()=>{g.removeEventListener("keydown",p),s.removeEventListener("keydown",u),s.removeEventListener("focusout",d)}}),[]);return[p,(0,m.useMergeRefs)([e,h]),f]}(),o=(0,g.useSelect)((e=>e(To).hasMultiSelection()),[]);return[e,(0,m.useMergeRefs)([t,Ad(),Nd(),Ld(),Rd(),wd(),Td(),Id(),(0,m.useRefEffect)((e=>{if(e.tabIndex=0,e.contentEditable=o,o)return e.classList.add("has-multi-selection"),e.setAttribute("aria-label",(0,_.__)("Multiple selected blocks")),()=>{e.classList.remove("has-multi-selection"),e.removeAttribute("aria-label")}}),[o])]),n]}var Dd=(0,u.forwardRef)((function(e,t){let{children:n,...o}=e;const[r,l,i]=Od();return(0,u.createElement)(u.Fragment,null,r,(0,u.createElement)("div",c({},o,{ref:(0,m.useMergeRefs)([l,t]),className:p()(o.className,"block-editor-writing-flow")}),n),i)}));function zd(e){return(0,u.useMemo)((()=>{const t=document.implementation.createHTMLDocument("");return t.body.innerHTML=e,Array.from(t.body.children)}),[e])}function Fd(e){let{contentRef:t,children:n,head:o,tabIndex:r=0,scale:l=1,frameSize:i=0,readonly:a,forwardedRef:s,...d}=e;const f=(0,g.useSelect)((e=>e(To).getSettings().__unstableResolvedAssets),[]),[,v]=(0,u.useReducer)((()=>({}))),[b,k]=(0,u.useState)(),[y,E]=(0,u.useState)([]),C=zd(null==f?void 0:f.styles),S=C.map((e=>e.id)),w=(0,u.useMemo)((()=>Array.from(document.styleSheets).reduce(((e,t)=>{try{t.cssRules}catch(t){return e}const{ownerNode:n,cssRules:o}=t;if(null===n)return e;if(!o)return e;if("LINK"!==n.tagName)return e;if("wp-reset-editor-styles-css"===n.id)return e;if(function e(t){return Array.from(t).find((t=>{let{selectorText:n,conditionText:o,cssRules:r}=t;return o?e(r):n&&(n.includes(".editor-styles-wrapper")||n.includes(".wp-block"))}))}(o)){e.push(n.cloneNode(!0));const t=n.id.replace("-css","-inline-css"),o=document.getElementById(t);o&&e.push(o.cloneNode(!0))}return e}),[])),[]).filter((e=>!S.includes(e.id))),B=zd(null==f?void 0:f.scripts),I=Ed(),[x,T,M]=Od(),[N,{height:P}]=(0,m.useResizeObserver)(),L=(0,m.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),k(o),I(i),E(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)}}),[]),R=(0,m.useRefEffect)((e=>{B.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((()=>{v()}))}),[]),A=(0,m.useDisabled)({isDisabled:!a}),O=(0,m.useMergeRefs)([t,I,T,A]),D=(0,u.createElement)(u.Fragment,null,(0,u.createElement)("style",null,"html{height:auto!important;}body{margin:0}"),[...C,...w].map((e=>{let{tagName:t,href:n,id:o,rel:r,media:l,textContent:i}=e;const a=t.toLowerCase();return"style"===a?(0,u.createElement)(a,{id:o,key:o},i):(0,u.createElement)(a,{href:n,id:o,rel:r,media:l,key:o})}))),z=(0,u.useMemo)((()=>""+(0,u.renderToString)(D)),[]);return(0,u.createElement)(u.Fragment,null,r>=0&&x,(0,u.createElement)("iframe",c({},d,{ref:(0,m.useMergeRefs)([s,L]),tabIndex:r,src:"/wp-includes/empty.html",title:(0,_.__)("Editor canvas")}),b&&(0,u.createPortal)((0,u.createElement)(u.Fragment,null,(0,u.createElement)("head",{ref:R},D,o,(0,u.createElement)("style",null,`html { transition: background 5s; ${i?"background: #2f2f2f; transition: background 0s;":""} }`)),(0,u.createElement)("body",{ref:O,className:p()("block-editor-iframe__body","editor-styles-wrapper",...y),style:{marginBottom:`-${P*(1-l)-i}px`,marginTop:i,transform:`scale( ${l} )`}},N,(0,u.createElement)(h.__experimentalStyleProvider,{document:b},n))),b.documentElement)),r>=0&&M)}var Vd=(0,u.forwardRef)((function(e,t){return(0,g.useSelect)((e=>e(To).getSettings().__internalIsInitialized),[])?(0,u.createElement)(Fd,c({},e,{forwardedRef:t})):null})),Hd={grad:.9,turn:360,rad:360/(2*Math.PI)},Gd=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},$d=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=1),e>n?n:e>t?e:t},jd=function(e){return(e=isFinite(e)?e%360:0)>0?e:e+360},Wd=function(e){return{r:$d(e.r,0,255),g:$d(e.g,0,255),b:$d(e.b,0,255),a:$d(e.a)}},Kd=function(e){return{r:Ud(e.r),g:Ud(e.g),b:Ud(e.b),a:Ud(e.a,3)}},qd=/^#([0-9a-f]{3,8})$/i,Yd=function(e){var t=e.toString(16);return t.length<2?"0"+t:t},Zd=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}},Qd=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}},Xd=function(e){return{h:jd(e.h),s:$d(e.s,0,100),l:$d(e.l,0,100),a:$d(e.a)}},Jd=function(e){return{h:Ud(e.h),s:Ud(e.s),l:Ud(e.l),a:Ud(e.a,3)}},ep=function(e){return Qd((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},tp=function(e){return{h:(t=Zd(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},np=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,op=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,rp=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,lp=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,ip={string:[[function(e){var t=qd.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=rp.exec(e)||lp.exec(e);return t?t[2]!==t[4]||t[4]!==t[6]?null:Wd({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=np.exec(e)||op.exec(e);if(!t)return null;var n,o,r=Xd({h:(n=t[1],o=t[2],void 0===o&&(o="deg"),Number(n)*(Hd[o]||1)),s:Number(t[3]),l:Number(t[4]),a:void 0===t[5]?1:Number(t[5])/(t[6]?100:1)});return ep(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 Gd(t)&&Gd(n)&&Gd(o)?Wd({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(!Gd(t)||!Gd(n)||!Gd(o))return null;var i=Xd({h:Number(t),s:Number(n),l:Number(o),a:Number(l)});return ep(i)},"hsl"],[function(e){var t=e.h,n=e.s,o=e.v,r=e.a,l=void 0===r?1:r;if(!Gd(t)||!Gd(n)||!Gd(o))return null;var i=function(e){return{h:jd(e.h),s:$d(e.s,0,100),v:$d(e.v,0,100),a:$d(e.a)}}({h:Number(t),s:Number(n),v:Number(o),a:Number(l)});return Qd(i)},"hsv"]]},ap=function(e,t){for(var n=0;n=.5},e.prototype.toHex=function(){return t=(e=Kd(this.rgba)).r,n=e.g,o=e.b,l=(r=e.a)<1?Yd(Ud(255*r)):"","#"+Yd(t)+Yd(n)+Yd(o)+l;var e,t,n,o,r,l},e.prototype.toRgb=function(){return Kd(this.rgba)},e.prototype.toRgbString=function(){return t=(e=Kd(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 Jd(tp(this.rgba))},e.prototype.toHslString=function(){return t=(e=Jd(tp(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=Zd(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 mp({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),mp(cp(this.rgba,e))},e.prototype.desaturate=function(e){return void 0===e&&(e=.1),mp(cp(this.rgba,-e))},e.prototype.grayscale=function(){return mp(cp(this.rgba,-1))},e.prototype.lighten=function(e){return void 0===e&&(e=.1),mp(dp(this.rgba,e))},e.prototype.darken=function(e){return void 0===e&&(e=.1),mp(dp(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?mp({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=tp(this.rgba);return"number"==typeof e?mp({h:e,s:t.s,l:t.l,a:t.a}):Ud(t.h)},e.prototype.isEqual=function(e){return this.toHex()===mp(e).toHex()},e}(),mp=function(e){return e instanceof pp?e:new pp(e)},gp=[],fp=function(e){e.forEach((function(e){gp.indexOf(e)<0&&(e(pp,ip),gp.push(e))}))};function hp(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(s=bp(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 _p=n(3124),yp=n.n(_p);const Ep=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;function Cp(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(),g(n);e.length&&"}"!==e.charAt(0)&&(t=S()||w());)!1!==t&&(n.push(t),g(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 g(e){let t;for(e=e||[];t=f();)!1!==t&&e.push(t);return e}function f(){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 Sp(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=Sp(t[0]),!p(/^:\s*/))return s("property missing ':'");const n=p(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^\)]*?\)|[^};])+)/),o=e({type:"declaration",property:t.replace(Ep,""),value:n?Sp(n[0]).replace(Ep,""):""});return p(/^[;\s]*/),o}function b(){const e=[];if(!c())return s("missing '{'");let t;for(g(e);t=v();)!1!==t&&(e.push(t),g(e));return u()?e:s("missing '}'")}function k(){let e;const t=[],n=l();for(;e=p(/^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/);)t.push(e[1]),p(/^,\s*/);if(t.length)return n({type:"keyframe",values:t,declarations:b()})}const _=C("import"),y=C("charset"),E=C("namespace");function C(e){const t=new RegExp("^@"+e+"\\s*([^;]+);");return function(){const n=l(),o=p(t);if(!o)return;const r={type:e};return r[e]=o[1].trim(),n(r)}}function S(){if("@"===e[0])return function(){const e=l();let t=p(/^@([-\w]+)?keyframes\s*/);if(!t)return;const n=t[1];if(t=p(/^([-\w]+)\s*/),!t)return s("@keyframes missing name");const o=t[1];if(!c())return s("@keyframes missing '{'");let r,i=g();for(;r=k();)i.push(r),i=i.concat(g());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=Sp(t[1]);if(!c())return s("@media missing '{'");const o=g().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:Sp(t[1]),media:Sp(t[2])})}()||function(){const e=l(),t=p(/^@supports *([^{]+)/);if(!t)return;const n=Sp(t[1]);if(!c())return s("@supports missing '{'");const o=g().concat(d());return u()?e({type:"supports",supports:n,rules:o}):s("@supports missing '}'")}()||_()||y()||E()||function(){const e=l(),t=p(/^@([-\w]+)?document *([^{]+)/);if(!t)return;const n=Sp(t[1]),o=Sp(t[2]);if(!c())return s("@document missing '{'");const r=g().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=g();for(;n=v();)o.push(n),o=o.concat(g());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=g().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=g();for(;t=v();)n.push(t),n=n.concat(g());return u()?e({type:"font-face",declarations:n}):s("@font-face missing '}'")}()}function w(){const e=l(),t=h();return t?(g(),e({type:"rule",selectors:t,declarations:b()})):s("selector missing")}return wp(function(){const e=d();return{type:"stylesheet",stylesheet:{source:t.source,rules:e,parsingErrors:a}}}())}function Sp(e){return e?e.replace(/^\s+|\s+$/g,""):""}function wp(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){wp(e,o)})):n&&"object"==typeof n&&wp(n,o)}return n&&Object.defineProperty(e,"parent",{configurable:!0,writable:!0,enumerable:!1,value:t||null}),e}var Bp=n(8575),Ip=n.n(Bp),xp=Tp;function Tp(e){this.options=e||{}}Tp.prototype.emit=function(e){return e},Tp.prototype.visit=function(e){return this[e.type](e)},Tp.prototype.mapVisit=function(e,t){let n="";t=t||"";for(let o=0,r=e.length;ot=>{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]};Ap(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 zp=/^(body|html|:root).*$/;var Fp=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(zp)?n.replace(/^(body|html|:root)/,e):e+" "+n;return"rule"===n.type?{...n,selectors:n.selectors.map(o)}:n}};var Vp=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return Object.values(null!=e?e:[]).map((e=>{let{css:n,baseURL:o}=e;const r=[];return t&&r.push(Fp(t)),o&&r.push(Dp(o)),r.length?Rp(n,(0,m.compose)(r)):n}))};const Hp=".editor-styles-wrapper";function Gp(e){return(0,u.useCallback)((e=>{if(!e)return;const{ownerDocument:t}=e,{defaultView:n,body:o}=t,r=t.querySelector(Hp);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=mp(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,u.useMemo)((()=>Vp(t,Hp)),[t]);return(0,u.createElement)(u.Fragment,null,(0,u.createElement)("style",{ref:Gp(t)}),n.map(((e,t)=>(0,u.createElement)("style",{key:t},e))))}function $p(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t={r:[],g:[],b:[],a:[]};return e.forEach((e=>{const n=mp(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 jp(e){let{selector:t,id:n}=e;const o=`\n${t} {\n\tfilter: url( #${n} );\n}\n`;return(0,u.createElement)("style",null,o)}function Wp(e){let{selector:t}=e;const n=`\n${t} {\n\tfilter: none;\n}\n`;return(0,u.createElement)("style",null,n)}function Kp(e){let{id:t,colors:n}=e;const o=$p(n);return(0,u.createElement)(h.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,u.createElement)("defs",null,(0,u.createElement)("filter",{id:t},(0,u.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,u.createElement)("feComponentTransfer",{colorInterpolationFilters:"sRGB"},(0,u.createElement)("feFuncR",{type:"table",tableValues:o.r.join(" ")}),(0,u.createElement)("feFuncG",{type:"table",tableValues:o.g.join(" ")}),(0,u.createElement)("feFuncB",{type:"table",tableValues:o.b.join(" ")}),(0,u.createElement)("feFuncA",{type:"table",tableValues:o.a.join(" ")})),(0,u.createElement)("feComposite",{in2:"SourceGraphic",operator:"in"}))))}function qp(e){let{preset:t}=e;return(0,u.createElement)(Kp,{id:`wp-duotone-${t.slug}`,colors:t.colors})}let Yp;fp([hp,kp]);const Zp=2e3;function Qp(e){let{viewportWidth:t,containerWidth:n,minHeight:o,additionalStyles:r=[]}=e;t||(t=n);const[l,{height:i}]=(0,m.useResizeObserver)(),{styles:a,duotone:s}=(0,g.useSelect)((e=>{var t,n;const o=e(To).getSettings();return{styles:o.styles,duotone:null===(t=o.__experimentalFeatures)||void 0===t||null===(n=t.color)||void 0===n?void 0:n.duotone}}),[]),c=(0,u.useMemo)((()=>a?[...a,{css:"body{height:auto;overflow:hidden;border:none;padding:0;}",__unstableType:"presets"},...r]:a),[a,r]),d=(0,u.useMemo)((()=>{var e,t;return[...null!==(e=null==s?void 0:s.default)&&void 0!==e?e:[],...null!==(t=null==s?void 0:s.theme)&&void 0!==t?t:[]]}),[s]);Yp=Yp||(0,m.pure)(Wv);const p=n/t;return(0,u.createElement)(h.Disabled,{className:"block-editor-block-preview__content",style:{transform:`scale(${p})`,height:i*p,maxHeight:i>Zp?Zp*p:void 0,minHeight:o}},(0,u.createElement)(Vd,{head:(0,u.createElement)(Up,{styles:c}),contentRef:(0,m.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.boxSizing="border-box",e.style.position="absolute",e.style.width="100%"}),[]),"aria-hidden":!0,tabIndex:-1,style:{position:"absolute",width:t,height:i,pointerEvents:"none",maxHeight:Zp,minHeight:0!==p&&p<1&&o?o/p:o}},l,d.map((e=>(0,u.createElement)(qp,{preset:e,key:e.slug}))),(0,u.createElement)(Yp,{renderAppender:!1})))}function Xp(e){const[t,{width:n}]=(0,m.useResizeObserver)();return(0,u.createElement)(u.Fragment,null,(0,u.createElement)("div",{style:{position:"relative",width:"100%",height:0}},t),(0,u.createElement)("div",{className:"block-editor-block-preview__container"},!!n&&(0,u.createElement)(Qp,c({},e,{containerWidth:n}))))}var Jp=(0,u.memo)((function(e){let{blocks:t,viewportWidth:n=1200,minHeight:o,additionalStyles:r=[],__experimentalMinHeight:l,__experimentalPadding:i}=e;l&&(o=l,W()("The __experimentalMinHeight prop",{since:"6.2",version:"6.4",alternative:"minHeight"})),i&&(r=[...r,{css:`body { padding: ${i}px; }`}],W()("The __experimentalPadding prop of BlockPreview",{since:"6.2",version:"6.4",alternative:"additionalStyles"}));const a=(0,g.useSelect)((e=>e(To).getSettings()),[]),s=(0,u.useMemo)((()=>({...a,__unstableIsPreviewMode:!0})),[a]),c=(0,u.useMemo)((()=>Array.isArray(t)?t:[t]),[t]);return t&&0!==t.length?(0,u.createElement)(_d,{value:c,settings:s},(0,u.createElement)(Xp,{viewportWidth:n,minHeight:o,additionalStyles:r})):null}));function em(e){let{blocks:t,props:n={},__experimentalLayout:o}=e;const r=(0,g.useSelect)((e=>e(To).getSettings()),[]),l=(0,u.useMemo)((()=>({...r,__unstableIsPreviewMode:!0})),[r]),i=(0,m.useDisabled)(),a=(0,m.useMergeRefs)([n.ref,i]),s=(0,u.useMemo)((()=>Array.isArray(t)?t:[t]),[t]),c=(0,u.createElement)(_d,{value:s,settings:l},(0,u.createElement)(qv,{renderAppender:!1,__experimentalLayout:o}));return{...n,ref:a,className:p()(n.className,"block-editor-block-preview__live-content","components-disabled"),children:null!=t&&t.length?c:null}}var tm=function(e){var t;let{item:n}=e;const{name:o,title:r,icon:l,description:i,initialAttributes:s,example:c}=n,d=(0,a.isReusableBlock)(n);return(0,u.createElement)("div",{className:"block-editor-inserter__preview-container"},(0,u.createElement)("div",{className:"block-editor-inserter__preview"},d||c?(0,u.createElement)("div",{className:"block-editor-inserter__preview-content"},(0,u.createElement)(Jp,{blocks:c?(0,a.getBlockFromExample)(o,{attributes:{...c.attributes,...s},innerBlocks:c.innerBlocks}):(0,a.createBlock)(o,s),viewportWidth:null!==(t=null==c?void 0:c.viewportWidth)&&void 0!==t?t:500,additionalStyles:[{css:"body { padding: 16px; }"}]})):(0,u.createElement)("div",{className:"block-editor-inserter__preview-content-missing"},(0,_.__)("No Preview Available."))),!d&&(0,u.createElement)(hd,{title:r,icon:l,description:i}))};var nm=(0,u.createContext)();var om=(0,u.forwardRef)((function(e,t){let{isFirst:n,as:o,children:r,...l}=e;const i=(0,u.useContext)(nm);return(0,u.createElement)(h.__unstableCompositeItem,c({ref:t,state:i,role:"option",focusable:!0},l),(e=>{const t={...e,tabIndex:n?0:e.tabIndex};return o?(0,u.createElement)(o,t,r):"function"==typeof r?r(t):(0,u.createElement)(h.Button,t,r)}))}));var rm=(0,u.createElement)(G.SVG,{width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"M8 7h2V5H8v2zm0 6h2v-2H8v2zm0 6h2v-2H8v2zm6-14v2h2V5h-2zm0 8h2v-2h-2v2zm0 6h2v-2h-2v2z"}));function lm(e){let{count:t,icon:n,isPattern:o}=e;const r=o&&(0,_.__)("Pattern");return(0,u.createElement)("div",{className:"block-editor-block-draggable-chip-wrapper"},(0,u.createElement)("div",{className:"block-editor-block-draggable-chip","data-testid":"block-draggable-chip"},(0,u.createElement)(h.Flex,{justify:"center",className:"block-editor-block-draggable-chip__content"},(0,u.createElement)(h.FlexItem,null,n?(0,u.createElement)(fd,{icon:n}):r||(0,_.sprintf)((0,_._n)("%d block","%d blocks",t),t)),(0,u.createElement)(h.FlexItem,null,(0,u.createElement)(fd,{icon:rm})))))}var im=e=>{let{isEnabled:t,blocks:n,icon:o,children:r,isPattern:l}=e;const i={type:"inserter",blocks:n};return(0,u.createElement)(h.Draggable,{__experimentalTransferDataType:"wp-blocks",transferData:i,__experimentalDragComponent:(0,u.createElement)(lm,{count:n.length,icon:o,isPattern:l})},(e=>{let{onDraggableStart:n,onDraggableEnd:o}=e;return r({draggable:t,onDragStart:t?n:void 0,onDragEnd:t?o:void 0})}))};var am=(0,u.memo)((function(e){let{className:t,isFirst:n,item:o,onSelect:r,onHover:l,isDraggable:i,...s}=e;const d=(0,u.useRef)(!1),m=o.icon?{backgroundColor:o.icon.background,color:o.icon.foreground}:{},g=(0,u.useMemo)((()=>[(0,a.createBlock)(o.name,o.initialAttributes,(0,a.createBlocksFromInnerBlocksTemplate)(o.innerBlocks))]),[o.name,o.initialAttributes,o.initialAttributes]),f=(0,a.isReusableBlock)(o)||(0,a.isTemplatePart)(o);return(0,u.createElement)(im,{isEnabled:i&&!o.disabled,blocks:g,icon:o.icon},(e=>{let{draggable:i,onDragStart:a,onDragEnd:g}=e;return(0,u.createElement)("div",{className:p()("block-editor-block-types-list__list-item",{"is-synced":f}),draggable:i,onDragStart:e=>{d.current=!0,a&&(l(null),a(e))},onDragEnd:e=>{d.current=!1,g&&g(e)}},(0,u.createElement)(om,c({isFirst:n,className:p()("block-editor-block-types-list__item",t),disabled:o.isDisabled,onClick:e=>{e.preventDefault(),r(o,(0,Qu.isAppleOS)()?e.metaKey:e.ctrlKey),l(null)},onKeyDown:e=>{const{keyCode:t}=e;t===Qu.ENTER&&(e.preventDefault(),r(o,(0,Qu.isAppleOS)()?e.metaKey:e.ctrlKey),l(null))},onMouseEnter:()=>{d.current||l(o)},onMouseLeave:()=>l(null)},s),(0,u.createElement)("span",{className:"block-editor-block-types-list__item-icon",style:m},(0,u.createElement)(fd,{icon:o.icon,showColors:!0})),(0,u.createElement)("span",{className:"block-editor-block-types-list__item-title"},(0,u.createElement)(h.__experimentalTruncate,{numberOfLines:3},o.title))))}))}));var sm=(0,u.forwardRef)((function(e,t){const[n,o]=(0,u.useState)(!1);return(0,u.useEffect)((()=>{n&&(0,pn.speak)((0,_.__)("Use left and right arrow keys to move through blocks"))}),[n]),(0,u.createElement)("div",c({ref:t,role:"listbox","aria-orientation":"horizontal",onFocus:()=>{o(!0)},onBlur:e=>{!e.currentTarget.contains(e.relatedTarget)&&o(!1)}},e))}));var cm=(0,u.forwardRef)((function(e,t){const n=(0,u.useContext)(nm);return(0,u.createElement)(h.__unstableCompositeGroup,c({state:n,role:"presentation",ref:t},e))}));var um=function(e){let{items:t=[],onSelect:n,onHover:o=(()=>{}),children:r,label:l,isDraggable:i=!0}=e;return(0,u.createElement)(sm,{className:"block-editor-block-types-list","aria-label":l},function(e,t){const n=[];for(let o=0,r=e.length;o(0,u.createElement)(cm,{key:t},e.map(((e,r)=>(0,u.createElement)(am,{key:e.id,item:e,className:(0,a.getBlockMenuDefaultClassName)(e.id),onSelect:n,onHover:o,isDraggable:i&&!e.isDisabled,isFirst:0===t&&0===r})))))),r)};var dm=function(e){let{title:t,icon:n,children:o}=e;return(0,u.createElement)(u.Fragment,null,(0,u.createElement)("div",{className:"block-editor-inserter__panel-header"},(0,u.createElement)("h2",{className:"block-editor-inserter__panel-title"},t),(0,u.createElement)(h.Icon,{icon:n})),(0,u.createElement)("div",{className:"block-editor-inserter__panel-content"},o))};var pm=(e,t)=>{const{categories:n,collections:o,items:r}=(0,g.useSelect)((t=>{const{getInserterItems:n}=t(To),{getCategories:o,getCollections:r}=t(a.store);return{categories:o(),collections:r(),items:n(e)}}),[e]);return[r,n,o,(0,u.useCallback)(((e,n)=>{let{name:o,initialAttributes:r,innerBlocks:l}=e;const i=(0,a.createBlock)(o,r,(0,a.createBlocksFromInnerBlocksTemplate)(l));t(i,void 0,n)}),[t])]};var mm=function(e){let{children:t}=e;const n=(0,h.__unstableUseCompositeState)({shift:!0,wrap:"horizontal"});return(0,u.createElement)(nm.Provider,{value:n},t)};const gm=[];var fm=function(e){let{rootClientId:t,onInsert:n,onHover:o,showMostUsedBlocks:r}=e;const[l,i,a,s]=pm(t,n),c=(0,u.useMemo)((()=>Y(l,"frecency","desc").slice(0,6)),[l]),d=(0,u.useMemo)((()=>l.filter((e=>!e.category))),[l]),p=(0,u.useMemo)((()=>(0,m.pipe)((e=>e.filter((e=>e.category&&"reusable"!==e.category))),(e=>(0,f.groupBy)(e,"category")))(l)),[l]),g=(0,u.useMemo)((()=>{const e={...a};return Object.keys(a).forEach((t=>{e[t]=l.filter((e=>(e=>e.name.split("/")[0])(e)===t)),0===e[t].length&&delete e[t]})),e}),[l,a]);(0,u.useEffect)((()=>()=>o(null)),[]);const h=(0,m.useAsyncList)(i),v=i.length===h.length,b=(0,u.useMemo)((()=>Object.entries(a)),[a]),k=(0,m.useAsyncList)(v?b:gm);return(0,u.createElement)(mm,null,(0,u.createElement)("div",null,r&&!!c.length&&(0,u.createElement)(dm,{title:(0,_._x)("Most used","blocks")},(0,u.createElement)(um,{items:c,onSelect:s,onHover:o,label:(0,_._x)("Most used","blocks")})),h.map((e=>{const t=p[e.slug];return t&&t.length?(0,u.createElement)(dm,{key:e.slug,title:e.title,icon:e.icon},(0,u.createElement)(um,{items:t,onSelect:s,onHover:o,label:e.title})):null})),v&&d.length>0&&(0,u.createElement)(dm,{className:"block-editor-inserter__uncategorized-blocks-panel",title:(0,_.__)("Uncategorized")},(0,u.createElement)(um,{items:d,onSelect:s,onHover:o,label:(0,_.__)("Uncategorized")})),k.map((e=>{let[t,n]=e;const r=g[t];return r&&r.length?(0,u.createElement)(dm,{key:t,title:n.title,icon:n.icon},(0,u.createElement)(um,{items:r,onSelect:s,onHover:o,label:n.title})):null}))))},hm=window.wp.notices;var vm=(e,t)=>{const{patternCategories:n,patterns:o}=(0,g.useSelect)((e=>{const{__experimentalGetAllowedPatterns:n,getSettings:o}=e(To);return{patterns:n(t),patternCategories:o().__experimentalBlockPatternCategories}}),[t]),{createSuccessNotice:r}=(0,g.useDispatch)(hm.store),l=(0,u.useCallback)(((t,n)=>{e((null!=n?n:[]).map((e=>(0,a.cloneBlock)(e))),t.name),r((0,_.sprintf)((0,_.__)('Block pattern "%s" inserted.'),t.title),{type:"snackbar"})}),[]);return[o,n,l]};const bm=e=>{let{showTooltip:t,title:n,children:o}=e;return t?(0,u.createElement)(h.Tooltip,{text:n},o):(0,u.createElement)(u.Fragment,null,o)};function km(e){let{isDraggable:t,pattern:n,onClick:o,onHover:r,composite:l,showTooltip:i}=e;const[a,s]=(0,u.useState)(!1),{blocks:d,viewportWidth:p}=n,g=`block-editor-block-patterns-list__item-description-${(0,m.useInstanceId)(km)}`;return(0,u.createElement)(im,{isEnabled:t,blocks:d,isPattern:!!n},(e=>{let{draggable:t,onDragStart:m,onDragEnd:f}=e;return(0,u.createElement)("div",{className:"block-editor-block-patterns-list__list-item",draggable:t,onDragStart:e=>{s(!0),m&&(null==r||r(null),m(e))},onDragEnd:e=>{s(!1),f&&f(e)}},(0,u.createElement)(bm,{showTooltip:i,title:n.title},(0,u.createElement)(h.__unstableCompositeItem,c({role:"option",as:"div"},l,{className:"block-editor-block-patterns-list__item",onClick:()=>{o(n,d),null==r||r(null)},onMouseEnter:()=>{a||null==r||r(n)},onMouseLeave:()=>null==r?void 0:r(null),"aria-label":n.title,"aria-describedby":n.description?g:void 0}),(0,u.createElement)(Jp,{blocks:d,viewportWidth:p}),!i&&(0,u.createElement)("div",{className:"block-editor-block-patterns-list__item-title"},n.title),!!n.description&&(0,u.createElement)(h.VisuallyHidden,{id:g},n.description))))}))}function _m(){return(0,u.createElement)("div",{className:"block-editor-block-patterns-list__item is-placeholder"})}var ym=function(e){let{isDraggable:t,blockPatterns:n,shownPatterns:o,onHover:r,onClickPattern:l,orientation:i,label:a=(0,_.__)("Block Patterns"),showTitlesAsTooltip:s}=e;const d=(0,h.__unstableUseCompositeState)({orientation:i});return(0,u.createElement)(h.__unstableComposite,c({},d,{role:"listbox",className:"block-editor-block-patterns-list","aria-label":a}),n.map((e=>o.includes(e)?(0,u.createElement)(km,{key:e.name,pattern:e,onClick:l,onHover:r,isDraggable:t,composite:d,showTooltip:s}):(0,u.createElement)(_m,{key:e.name}))))};function Em(e){let{selectedCategory:t,patternCategories:n,onClickCategory:o}=e;const r="block-editor-block-patterns-explorer__sidebar";return(0,u.createElement)("div",{className:`${r}__categories-list`},n.map((e=>{let{name:n,label:l}=e;return(0,u.createElement)(h.Button,{key:n,label:l,className:`${r}__categories-list__item`,isPressed:t===n,onClick:()=>{o(n)}},l)})))}function Cm(e){let{filterValue:t,setFilterValue:n}=e;return(0,u.createElement)("div",{className:"block-editor-block-patterns-explorer__search"},(0,u.createElement)(h.SearchControl,{__nextHasNoMarginBottom:!0,onChange:n,value:t,label:(0,_.__)("Search for patterns"),placeholder:(0,_.__)("Search")}))}var Sm=function(e){let{selectedCategory:t,patternCategories:n,onClickCategory:o,filterValue:r,setFilterValue:l}=e;return(0,u.createElement)("div",{className:"block-editor-block-patterns-explorer__sidebar"},(0,u.createElement)(Cm,{filterValue:r,setFilterValue:l}),!r&&(0,u.createElement)(Em,{selectedCategory:t,patternCategories:n,onClickCategory:o}))};var wm=function(){return(0,u.createElement)("div",{className:"block-editor-inserter__no-results"},(0,u.createElement)(Jl,{className:"block-editor-inserter__no-results-icon",icon:gd}),(0,u.createElement)("p",null,(0,_.__)("No results found.")))};var Bm=function(e){let{rootClientId:t="",insertionIndex:n,clientId:o,isAppender:r,onSelect:l,shouldFocusBlock:i=!0,selectBlockOnInsert:s=!0}=e;const{getSelectedBlock:c}=(0,g.useSelect)(To),{destinationRootClientId:d,destinationIndex:p}=(0,g.useSelect)((e=>{const{getSelectedBlockClientId:l,getBlockRootClientId:i,getBlockIndex:a,getBlockOrder:s}=e(To),c=l();let u,d=t;return void 0!==n?u=n:o?u=a(o):!r&&c?(d=i(c),u=a(c)+1):u=s(d).length,{destinationRootClientId:d,destinationIndex:u}}),[t,n,o,r]),{replaceBlocks:m,insertBlocks:f,showInsertionPoint:h,hideInsertionPoint:v}=(0,g.useDispatch)(To),b=(0,u.useCallback)((function(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const o=c();!r&&o&&(0,a.isUnmodifiedDefaultBlock)(o)?m(o.clientId,e,null,i||n?0:null,t):f(e,p,d,s,i||n?0:null,t);const u=Array.isArray(e)?e.length:1,g=(0,_.sprintf)((0,_._n)("%d block added.","%d blocks added.",u),u);(0,pn.speak)(g),l&&l(e)}),[r,c,m,f,d,p,l,i]),k=(0,u.useCallback)((e=>{e?h(d,p):v()}),[h,v,d,p]);return[d,b,k]},Im=n(4793),xm=n.n(Im);function Tm(e){return e.toLowerCase()}var Mm=[/([a-z0-9])([A-Z])/g,/([A-Z])([A-Z][a-z])/g],Nm=/[^A-Z0-9]+/gi;function Pm(e,t){void 0===t&&(t={});for(var n=t.splitRegexp,o=void 0===n?Mm:n,r=t.stripRegexp,l=void 0===r?Nm:r,i=t.transform,a=void 0===i?Tm:i,s=t.delimiter,c=void 0===s?" ":s,u=Lm(Lm(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 Lm(e,t,n){return t instanceof RegExp?e.replace(t,n):t.reduce((function(e,t){return e.replace(t,n)}),e)}const Rm=e=>e.name||"",Am=e=>e.title,Om=e=>e.description||"",Dm=e=>e.keywords||[],zm=e=>e.category,Fm=()=>null;function Vm(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return Pm(e,{splitRegexp:[/([\p{Ll}\p{Lo}\p{N}])([\p{Lu}\p{Lt}])/gu,/([\p{Lu}\p{Lt}])([\p{Lu}\p{Lt}][\p{Ll}\p{Lo}])/gu],stripRegexp:/(\p{C}|\p{P}|\p{S})+/giu}).split(" ").filter(Boolean)}function Hm(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return e=xm()(e),e=e.replace(/^\//,""),e=e.toLowerCase(),e}const Gm=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return Vm(Hm(e))},Um=(e,t)=>e.filter((e=>!Gm(t).some((t=>t.includes(e))))),$m=(e,t,n,o)=>{if(0===Gm(o).length)return e;return jm(e,o,{getCategory:e=>{var n;return null===(n=t.find((t=>{let{slug:n}=t;return n===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}})},jm=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=Gm(t);if(0===o.length)return e;const r=e.map((e=>[e,Wm(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 Wm(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{getName:o=Rm,getTitle:r=Am,getDescription:l=Om,getKeywords:i=Dm,getCategory:a=zm,getCollection:s=Fm}=n,c=o(e),u=r(e),d=l(e),p=i(e),m=a(e),g=s(e),f=Hm(t),h=Hm(u);let v=0;if(f===h)v+=30;else if(h.startsWith(f))v+=20;else{const e=[c,u,d,...p,m,g].join(" "),t=Vm(f);0===Um(t,e).length&&(v+=10)}if(0!==v&&c.startsWith("core/")){v+=c!==e.id?1:2}return v}function Km(e){let{filterValue:t,filteredBlockPatternsLength:n}=e;return t?(0,u.createElement)(h.__experimentalHeading,{level:2,lineHeight:"48px",className:"block-editor-block-patterns-explorer__search-results-count"},(0,_.sprintf)((0,_._n)('%1$d pattern found for "%2$s"','%1$d patterns found for "%2$s"',n),n,t)):null}var qm=function(e){let{filterValue:t,selectedCategory:n,patternCategories:o}=e;const r=(0,m.useDebounce)(pn.speak,500),[l,i]=Bm({shouldFocusBlock:!0}),[a,,s]=vm(i,l),c=(0,u.useMemo)((()=>o.map((e=>e.name))),[o]),d=(0,u.useMemo)((()=>t?jm(a,t):a.filter((e=>{var t,o;return"uncategorized"===n?!(null!==(t=e.categories)&&void 0!==t&&t.length)||e.categories.every((e=>!c.includes(e))):null===(o=e.categories)||void 0===o?void 0:o.includes(n)}))),[t,n,a]);(0,u.useEffect)((()=>{if(!t)return;const e=d.length,n=(0,_.sprintf)((0,_._n)("%d result found.","%d results found.",e),e);r(n)}),[t,r]);const p=(0,m.useAsyncList)(d,{step:2}),g=!(null==d||!d.length);return(0,u.createElement)("div",{className:"block-editor-block-patterns-explorer__list"},g&&(0,u.createElement)(Km,{filterValue:t,filteredBlockPatternsLength:d.length}),(0,u.createElement)(mm,null,!g&&(0,u.createElement)(wm,null),g&&(0,u.createElement)(ym,{shownPatterns:p,blockPatterns:d,onClickPattern:s,isDraggable:!1})))};function Ym(e){let{initialCategory:t,patternCategories:n}=e;const[o,r]=(0,u.useState)(""),[l,i]=(0,u.useState)(null==t?void 0:t.name);return(0,u.createElement)("div",{className:"block-editor-block-patterns-explorer"},(0,u.createElement)(Sm,{selectedCategory:l,patternCategories:n,onClickCategory:i,filterValue:o,setFilterValue:r}),(0,u.createElement)(qm,{filterValue:o,selectedCategory:l,patternCategories:n}))}var Zm=function(e){let{onModalClose:t,...n}=e;return(0,u.createElement)(h.Modal,{title:(0,_.__)("Patterns"),onRequestClose:t,isFullScreen:!0},(0,u.createElement)(Ym,n))};function Qm(e){let{title:t}=e;return(0,u.createElement)(h.__experimentalVStack,{spacing:0},(0,u.createElement)(h.__experimentalView,null,(0,u.createElement)(h.__experimentalSpacer,{marginBottom:0,paddingX:4,paddingY:3},(0,u.createElement)(h.__experimentalHStack,{spacing:2},(0,u.createElement)(h.__experimentalNavigatorBackButton,{style:{minWidth:24,padding:0},icon:(0,_.isRTL)()?pd:md,isSmall:!0,"aria-label":(0,_.__)("Navigate to the previous view")}),(0,u.createElement)(h.__experimentalSpacer,null,(0,u.createElement)(h.__experimentalHeading,{level:5},t))))))}function Xm(e){let{categories:t,children:n}=e;return(0,u.createElement)(h.__experimentalNavigatorProvider,{initialPath:"/",className:"block-editor-inserter__mobile-tab-navigation"},(0,u.createElement)(h.__experimentalNavigatorScreen,{path:"/"},(0,u.createElement)(h.__experimentalItemGroup,null,t.map((e=>(0,u.createElement)(h.__experimentalNavigatorButton,{key:e.name,path:`/category/${e.name}`,as:h.__experimentalItem,isAction:!0},(0,u.createElement)(h.__experimentalHStack,null,(0,u.createElement)(h.FlexBlock,null,e.label),(0,u.createElement)(Jl,{icon:(0,_.isRTL)()?md:pd}))))))),t.map((e=>(0,u.createElement)(h.__experimentalNavigatorScreen,{key:e.name,path:`/category/${e.name}`},(0,u.createElement)(Qm,{title:(0,_.__)("Back")}),n(e)))))}const Jm=["featured","posts","text","gallery","call-to-action","banner","header","footer"];function eg(e){const[t,n]=vm(void 0,e),o=(0,u.useCallback)((e=>!(!e.categories||!e.categories.length)&&e.categories.some((e=>n.some((t=>t.name===e))))),[n]),r=(0,u.useMemo)((()=>{const e=n.filter((e=>t.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].some((e=>Jm.includes(e)))?[n,o].every((e=>Jm.includes(e)))?Jm.indexOf(n)-Jm.indexOf(o):Jm.includes(n)?-1:1:0}));return t.some((e=>!o(e)))&&!e.find((e=>"uncategorized"===e.name))&&e.push({name:"uncategorized",label:(0,_._x)("Uncategorized")}),e}),[t,n]);return r}function tg(e){let{rootClientId:t,onInsert:n,onHover:o,category:r,showTitlesAsTooltip:l}=e;const i=(0,u.useRef)();return(0,u.useEffect)((()=>{const e=setTimeout((()=>{const[e]=Ri.focus.tabbable.find(i.current);null==e||e.focus()}));return()=>clearTimeout(e)}),[r]),(0,u.createElement)("div",{ref:i,className:"block-editor-inserter__patterns-category-dialog"},(0,u.createElement)(ng,{rootClientId:t,onInsert:n,onHover:o,category:r,showTitlesAsTooltip:l}))}function ng(e){let{rootClientId:t,onInsert:n,onHover:o,category:r,showTitlesAsTooltip:l}=e;const[i,,a]=vm(n,t),s=eg(t),c=(0,u.useMemo)((()=>i.filter((e=>{var t,n,o;if("uncategorized"!==r.name)return null===(o=e.categories)||void 0===o?void 0:o.includes(r.name);return 0===(null!==(t=null===(n=e.categories)||void 0===n?void 0:n.filter((e=>s.find((t=>t.name===e)))))&&void 0!==t?t:[]).length}))),[i,r]),d=(0,m.useAsyncList)(c);return(0,u.useEffect)((()=>()=>o(null)),[]),c.length?(0,u.createElement)("div",{className:"block-editor-inserter__patterns-category-panel"},(0,u.createElement)("div",{className:"block-editor-inserter__patterns-category-panel-title"},r.label),(0,u.createElement)("p",null,r.description),(0,u.createElement)(ym,{shownPatterns:d,blockPatterns:c,onClickPattern:a,onHover:o,label:r.label,orientation:"vertical",category:r.label,isDraggable:!0,showTitlesAsTooltip:l})):null}var og=function(e){let{onSelectCategory:t,selectedCategory:n,onInsert:o,rootClientId:r}=e;const[l,i]=(0,u.useState)(!1),a=eg(r),s=n||a[0],c=(0,m.useViewportMatch)("medium","<");return(0,u.createElement)(u.Fragment,null,!c&&(0,u.createElement)("div",{className:"block-editor-inserter__block-patterns-tabs-container"},(0,u.createElement)("nav",{"aria-label":(0,_.__)("Block pattern categories")},(0,u.createElement)(h.__experimentalItemGroup,{role:"list",className:"block-editor-inserter__block-patterns-tabs"},a.map((e=>(0,u.createElement)(h.__experimentalItem,{role:"listitem",key:e.name,onClick:()=>t(e),className:e===n?"block-editor-inserter__patterns-category block-editor-inserter__patterns-selected-category":"block-editor-inserter__patterns-category","aria-label":e.label,"aria-current":e===n?"true":void 0},(0,u.createElement)(h.__experimentalHStack,null,(0,u.createElement)(h.FlexBlock,null,e.label),(0,u.createElement)(Jl,{icon:pd}))))),(0,u.createElement)("div",{role:"listitem"},(0,u.createElement)(h.Button,{className:"block-editor-inserter__patterns-explore-button",onClick:()=>i(!0),variant:"secondary"},(0,_.__)("Explore all patterns")))))),c&&(0,u.createElement)(Xm,{categories:a},(e=>(0,u.createElement)(ng,{onInsert:o,rootClientId:r,category:e,showTitlesAsTooltip:!1}))),l&&(0,u.createElement)(Zm,{initialCategory:s,patternCategories:a,onModalClose:()=>i(!1)}))},rg=window.wp.url;function lg(e){let{onHover:t,onInsert:n,rootClientId:o}=e;const[r,,,l]=pm(o,n),i=(0,u.useMemo)((()=>r.filter((e=>{let{category:t}=e;return"reusable"===t}))),[r]);return 0===i.length?(0,u.createElement)(wm,null):(0,u.createElement)(dm,{title:(0,_.__)("Reusable blocks")},(0,u.createElement)(um,{items:i,onSelect:l,onHover:t,label:(0,_.__)("Reusable blocks")}))}var ig=function(e){let{rootClientId:t,onInsert:n,onHover:o}=e;return(0,u.createElement)(u.Fragment,null,(0,u.createElement)(lg,{onHover:o,onInsert:n,rootClientId:t}),(0,u.createElement)("div",{className:"block-editor-inserter__manage-reusable-blocks-container"},(0,u.createElement)(h.Button,{className:"block-editor-inserter__manage-reusable-blocks",variant:"secondary",href:(0,rg.addQueryArgs)("edit.php",{post_type:"wp_block"})},(0,_.__)("Manage Reusable blocks"))))};function ag(e){const[t,n]=(0,u.useState)([]),{canInsertImage:o,canInsertVideo:r,canInsertAudio:l}=(0,g.useSelect)((t=>{const{canInsertBlockType:n}=t(To);return{canInsertImage:n("core/image",e),canInsertVideo:n("core/video",e),canInsertAudio:n("core/audio",e)}}),[e]),i=function(){const{inserterMediaCategories:e,allowedMimeTypes:t,enableOpenverseMediaCategory:n}=(0,g.useSelect)((e=>{const t=e(To).getSettings();return{inserterMediaCategories:t.inserterMediaCategories,allowedMimeTypes:t.allowedMimeTypes,enableOpenverseMediaCategory:t.enableOpenverseMediaCategory}}),[]),o=(0,u.useMemo)((()=>{if(e&&t)return e.filter((e=>!(!n&&"openverse"===e.name)&&Object.values(t).some((t=>t.startsWith(`${e.mediaType}/`)))))}),[e,t,n]);return o}();return(0,u.useEffect)((()=>{(async()=>{const e=[];if(!i)return;const t=new Map(await Promise.all(i.map((async e=>{if(e.isExternalResource)return[e.name,!0];let t=[];try{t=await e.fetch({per_page:1})}catch(e){}return[e.name,!!t.length]})))),a={image:o,video:r,audio:l};i.forEach((n=>{a[n.mediaType]&&t.get(n.name)&&e.push(n)})),e.length&&n(e)})()}),[o,r,l,i]),t}var sg=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"M13 19h-2v-2h2v2zm0-6h-2v-2h2v2zm0-6h-2V5h2v2z"}));var cg=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"M18.2 17c0 .7-.6 1.2-1.2 1.2H7c-.7 0-1.2-.6-1.2-1.2V7c0-.7.6-1.2 1.2-1.2h3.2V4.2H7C5.5 4.2 4.2 5.5 4.2 7v10c0 1.5 1.2 2.8 2.8 2.8h10c1.5 0 2.8-1.2 2.8-2.8v-3.6h-1.5V17zM14.9 3v1.5h3.7l-6.4 6.4 1.1 1.1 6.4-6.4v3.7h1.5V3h-6.3z"})),ug=window.wp.blob;const dg={image:"img",video:"video",audio:"audio"};function pg(e,t){const n={id:e.id||void 0,caption:e.caption||void 0},o=e.url,r=e.alt||void 0;"image"===t?(n.url=o,n.alt=r):["video","audio"].includes(t)&&(n.src=o);const l=dg[t],i=(0,u.createElement)(l,{src:e.previewUrl||o,alt:r,controls:"audio"===t||void 0,inert:"true",onError:t=>{let{currentTarget:n}=t;n.src===e.previewUrl&&(n.src=o)}});return[(0,a.createBlock)(`core/${t}`,n),i]}const mg=["image"],gg={position:"bottom left",className:"block-editor-inserter__media-list__item-preview-options__popover"};function fg(e){let{category:t,media:n}=e;if(!t.getReportUrl)return null;const o=t.getReportUrl(n);return(0,u.createElement)(h.DropdownMenu,{className:"block-editor-inserter__media-list__item-preview-options",label:(0,_.__)("Options"),popoverProps:gg,icon:sg},(()=>(0,u.createElement)(h.MenuGroup,null,(0,u.createElement)(h.MenuItem,{onClick:()=>window.open(o,"_blank").focus(),icon:cg},(0,_.sprintf)((0,_.__)("Report %s"),t.mediaType)))))}function hg(e){let{onClose:t,onSubmit:n}=e;return(0,u.createElement)(h.Modal,{title:(0,_.__)("Insert external image"),onRequestClose:t,className:"block-editor-inserter-media-tab-media-preview-inserter-external-image-modal"},(0,u.createElement)(h.__experimentalVStack,{spacing:3},(0,u.createElement)("p",null,(0,_.__)("This image cannot be uploaded to your Media Library, but it can still be inserted as an external image.")),(0,u.createElement)("p",null,(0,_.__)("External images can be removed by the external provider without warning and could even have legal compliance issues related to privacy legislation."))),(0,u.createElement)(h.Flex,{className:"block-editor-block-lock-modal__actions",justify:"flex-end",expanded:!1},(0,u.createElement)(h.FlexItem,null,(0,u.createElement)(h.Button,{variant:"tertiary",onClick:t},(0,_.__)("Cancel"))),(0,u.createElement)(h.FlexItem,null,(0,u.createElement)(h.Button,{variant:"primary",onClick:n},(0,_.__)("Insert")))))}function vg(e){var t;let{media:n,onClick:o,composite:r,category:l}=e;const[i,s]=(0,u.useState)(!1),[d,m]=(0,u.useState)(!1),[f,v]=(0,u.useState)(!1),[b,k]=(0,u.useMemo)((()=>pg(n,l.mediaType)),[n,l.mediaType]),{createErrorNotice:y,createSuccessNotice:E}=(0,g.useDispatch)(hm.store),C=(0,g.useSelect)((e=>e(To).getSettings().mediaUpload),[]),S=(0,u.useCallback)((e=>{if(f)return;const t=(0,a.cloneBlock)(e),{id:n,url:r,caption:l}=t.attributes;n?o(t):(v(!0),window.fetch(r).then((e=>e.blob())).then((e=>{C({filesList:[e],additionalData:{caption:l},onFileChange(e){let[n]=e;(0,ug.isBlobURL)(n.url)||(o({...t,attributes:{...t.attributes,id:n.id,url:n.url}}),E((0,_.__)("Image uploaded and inserted."),{type:"snackbar"}),v(!1))},allowedTypes:mg,onError(e){y(e,{type:"snackbar"}),v(!1)}})})).catch((()=>{s(!0),v(!1)})))}),[f,o,C,y,E]),w=(null===(t=n.title)||void 0===t?void 0:t.rendered)||n.title;let B;if(w.length>25){const e="...";B=w.slice(0,25-e.length)+e}const I=(0,u.useCallback)((()=>m(!0)),[]),x=(0,u.useCallback)((()=>m(!1)),[]);return(0,u.createElement)(u.Fragment,null,(0,u.createElement)(im,{isEnabled:!0,blocks:[b]},(e=>{let{draggable:t,onDragStart:o,onDragEnd:i}=e;return(0,u.createElement)("div",{className:p()("block-editor-inserter__media-list__list-item",{"is-hovered":d}),draggable:t,onDragStart:o,onDragEnd:i},(0,u.createElement)(h.Tooltip,{text:B||w},(0,u.createElement)("div",{onMouseEnter:I,onMouseLeave:x},(0,u.createElement)(h.__unstableCompositeItem,c({role:"option",as:"div"},r,{className:"block-editor-inserter__media-list__item",onClick:()=>S(b),"aria-label":w}),(0,u.createElement)("div",{className:"block-editor-inserter__media-list__item-preview"},k,f&&(0,u.createElement)("div",{className:"block-editor-inserter__media-list__item-preview-spinner"},(0,u.createElement)(h.Spinner,null)))),!f&&(0,u.createElement)(fg,{category:l,media:n}))))})),i&&(0,u.createElement)(hg,{onClose:()=>s(!1),onSubmit:()=>{o((0,a.cloneBlock)(b)),E((0,_.__)("Image inserted."),{type:"snackbar"}),s(!1)}}))}var bg=function(e){let{mediaList:t,category:n,onClick:o,label:r=(0,_.__)("Media List")}=e;const l=(0,h.__unstableUseCompositeState)();return(0,u.createElement)(h.__unstableComposite,c({},l,{role:"listbox",className:"block-editor-inserter__media-list","aria-label":r}),t.map(((e,t)=>(0,u.createElement)(vg,{key:e.id||e.sourceId||t,media:e,category:n,onClick:o,composite:l}))))};function kg(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";const[t,n]=(0,u.useState)(e),[o,r]=(0,u.useState)(e),l=(0,m.useDebounce)(r,250);return(0,u.useEffect)((()=>{o!==t&&l(t)}),[o,t]),[t,n,o]}function _g(e){let{rootClientId:t,onInsert:n,category:o}=e;const r=(0,u.useRef)();return(0,u.useEffect)((()=>{const e=setTimeout((()=>{const[e]=Ri.focus.tabbable.find(r.current);null==e||e.focus()}));return()=>clearTimeout(e)}),[o]),(0,u.createElement)("div",{ref:r,className:"block-editor-inserter__media-dialog"},(0,u.createElement)(yg,{rootClientId:t,onInsert:n,category:o}))}function yg(e){let{rootClientId:t,onInsert:n,category:o}=e;const[r,l,i]=kg(),{mediaList:a,isLoading:s}=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const[n,o]=(0,u.useState)(),[r,l]=(0,u.useState)(!1),i=(0,u.useRef)();return(0,u.useEffect)((()=>{(async()=>{var n;const r=JSON.stringify({category:e.name,...t});i.current=r,l(!0),o([]);const a=await(null===(n=e.fetch)||void 0===n?void 0:n.call(e,t));r===i.current&&(o(a),l(!1))})()}),[e.name,...Object.values(t)]),{mediaList:n,isLoading:r}}(o,{per_page:i?20:10,search:i}),c="block-editor-inserter__media-panel",d=o.labels.search_items||(0,_.__)("Search");return(0,u.createElement)("div",{className:c},(0,u.createElement)(h.SearchControl,{className:`${c}-search`,onChange:l,value:r,label:d,placeholder:d}),s&&(0,u.createElement)("div",{className:`${c}-spinner`},(0,u.createElement)(h.Spinner,null)),!s&&!(null!=a&&a.length)&&(0,u.createElement)(wm,null),!s&&!(null==a||!a.length)&&(0,u.createElement)(bg,{rootClientId:t,onClick:n,mediaList:a,category:o}))}var Eg=function(e){let{fallback:t=null,children:n}=e;const o=(0,g.useSelect)((e=>{const{getSettings:t}=e(To);return!!t().mediaUpload}),[]);return o?n:t};var Cg=(0,h.withFilters)("editor.MediaUpload")((()=>null));const Sg=["image","video","audio"];var wg=function(e){let{rootClientId:t,selectedCategory:n,onSelectCategory:o,onInsert:r}=e;const l=ag(t),i=(0,m.useViewportMatch)("medium","<"),a="block-editor-inserter__media-tabs",s=(0,u.useCallback)((e=>{if(null==e||!e.url)return;const[t]=pg(e,e.type);r(t)}),[r]),c=(0,u.useMemo)((()=>l.map((e=>({...e,label:e.labels.name})))),[l]);return(0,u.createElement)(u.Fragment,null,!i&&(0,u.createElement)("div",{className:`${a}-container`},(0,u.createElement)("nav",{"aria-label":(0,_.__)("Media categories")},(0,u.createElement)(h.__experimentalItemGroup,{role:"list",className:a},l.map((e=>(0,u.createElement)(h.__experimentalItem,{role:"listitem",key:e.name,onClick:()=>o(e),className:p()(`${a}__media-category`,{"is-selected":n===e}),"aria-label":e.labels.name,"aria-current":e===n?"true":void 0},(0,u.createElement)(h.__experimentalHStack,null,(0,u.createElement)(h.FlexBlock,null,e.labels.name),(0,u.createElement)(Jl,{icon:pd}))))),(0,u.createElement)("div",{role:"listitem"},(0,u.createElement)(Eg,null,(0,u.createElement)(Cg,{multiple:!1,onSelect:s,allowedTypes:Sg,render:e=>{let{open:t}=e;return(0,u.createElement)(h.Button,{onClick:e=>{e.target.focus(),t()},className:"block-editor-inserter__media-library-button",variant:"secondary","data-unstable-ignore-focus-outside-for-relatedtarget":".media-modal"},(0,_.__)("Open Media Library"))}})))))),i&&(0,u.createElement)(Xm,{categories:c},(e=>(0,u.createElement)(yg,{onInsert:r,rootClientId:t,category:e}))))};const{Fill:Bg,Slot:Ig}=(0,h.createSlotFill)("__unstableInserterMenuExtension");Bg.Slot=Ig;var xg=Bg;const Tg=[];var Mg=function(e){let{filterValue:t,onSelect:n,onHover:o,rootClientId:r,clientId:l,isAppender:i,__experimentalInsertionIndex:a,maxBlockPatterns:s,maxBlockTypes:c,showBlockDirectory:d=!1,isDraggable:p=!0,shouldFocusBlock:g=!0,prioritizePatterns:f,selectBlockOnInsert:v,orderInitialBlockItems:b}=e;const k=(0,m.useDebounce)(pn.speak,500),[y,E]=Bm({onSelect:n,rootClientId:r,clientId:l,isAppender:i,insertionIndex:a,shouldFocusBlock:g,selectBlockOnInsert:v}),[C,S,w,B]=pm(y,E),[I,,x]=vm(E,y),T=(0,u.useMemo)((()=>{if(0===s)return[];const e=jm(I,t);return void 0!==s?e.slice(0,s):e}),[t,I,s]);let M=c;f&&T.length>2&&(M=0);const N=(0,u.useMemo)((()=>{if(0===M)return[];let e=Y(C,"frecency","desc");!t&&b&&(e=b(e));const n=$m(e,S,w,t);return void 0!==M?n.slice(0,M):n}),[t,C,S,w,c,b]);(0,u.useEffect)((()=>{if(!t)return;const e=N.length+T.length,n=(0,_.sprintf)((0,_._n)("%d result found.","%d results found.",e),e);k(n)}),[t,k]);const P=(0,m.useAsyncList)(N,{step:9}),L=(0,m.useAsyncList)(P.length===N.length?T:Tg),R=N.length>0||T.length>0,A=!!N.length&&(0,u.createElement)(dm,{title:(0,u.createElement)(h.VisuallyHidden,null,(0,_.__)("Blocks"))},(0,u.createElement)(um,{items:P,onSelect:B,onHover:o,label:(0,_.__)("Blocks"),isDraggable:p})),O=!!T.length&&(0,u.createElement)(dm,{title:(0,u.createElement)(h.VisuallyHidden,null,(0,_.__)("Block Patterns"))},(0,u.createElement)("div",{className:"block-editor-inserter__quick-inserter-patterns"},(0,u.createElement)(ym,{shownPatterns:L,blockPatterns:T,onClickPattern:x,onHover:o,isDraggable:p})));return(0,u.createElement)(mm,null,!d&&!R&&(0,u.createElement)(wm,null),f?O:A,!!N.length&&!!T.length&&(0,u.createElement)("div",{className:"block-editor-inserter__quick-inserter-separator"}),f?A:O,d&&(0,u.createElement)(xg.Slot,{fillProps:{onSelect:B,onHover:o,filterValue:t,hasItems:R,rootClientId:y}},(e=>e.length?e:R?null:(0,u.createElement)(wm,null))))};const Ng={name:"blocks",title:(0,_.__)("Blocks")},Pg={name:"patterns",title:(0,_.__)("Patterns")},Lg={name:"reusable",title:(0,_.__)("Reusable"),icon:U},Rg={name:"media",title:(0,_.__)("Media")};var Ag=function(e){let{children:t,showPatterns:n=!1,showReusableBlocks:o=!1,showMedia:r=!1,onSelect:l,prioritizePatterns:i}=e;const a=(0,u.useMemo)((()=>{const e=[];return i&&n&&e.push(Pg),e.push(Ng),!i&&n&&e.push(Pg),r&&e.push(Rg),o&&e.push(Lg),e}),[i,Ng,n,Pg,o,r,Lg]);return(0,u.createElement)(h.TabPanel,{className:"block-editor-inserter__tabs",tabs:a,onSelect:l},t)};var Og=(0,u.forwardRef)((function(e,t){let{rootClientId:n,clientId:o,isAppender:r,__experimentalInsertionIndex:l,onSelect:i,showInserterHelpPanel:a,showMostUsedBlocks:s,__experimentalFilterValue:c="",shouldFocusBlock:d=!0,prioritizePatterns:m}=e;const[f,v,b]=kg(c),[k,y]=(0,u.useState)(null),[E,C]=(0,u.useState)(null),[S,w]=(0,u.useState)(null),[B,I]=(0,u.useState)(null),[x,T,M]=Bm({rootClientId:n,clientId:o,isAppender:r,insertionIndex:l,shouldFocusBlock:d}),{showPatterns:N,inserterItems:P}=(0,g.useSelect)((e=>{const{__experimentalGetAllowedPatterns:t,getInserterItems:n}=e(To);return{showPatterns:!!t(x).length,inserterItems:n(x)}}),[x]),L=(0,u.useMemo)((()=>P.some((e=>{let{category:t}=e;return"reusable"===t}))),[P]),R=!!ag(x).length,A=(0,u.useCallback)(((e,t,n)=>{T(e,t,n),i()}),[T,i]),O=(0,u.useCallback)(((e,t)=>{T(e,{patternName:t}),i()}),[T,i]),D=(0,u.useCallback)((e=>{M(!!e),y(e)}),[M,y]),z=(0,u.useCallback)((e=>{M(!!e)}),[M]),F=(0,u.useCallback)((e=>{C(e)}),[C]),V=(0,u.useMemo)((()=>(0,u.createElement)(u.Fragment,null,(0,u.createElement)("div",{className:"block-editor-inserter__block-list"},(0,u.createElement)(fm,{rootClientId:x,onInsert:A,onHover:D,showMostUsedBlocks:s})),a&&(0,u.createElement)("div",{className:"block-editor-inserter__tips"},(0,u.createElement)(h.VisuallyHidden,{as:"h2"},(0,_.__)("A tip for using the block editor")),(0,u.createElement)(dd,null)))),[x,A,D,b,s,a]),H=(0,u.useMemo)((()=>(0,u.createElement)(og,{rootClientId:x,onInsert:O,onSelectCategory:F,selectedCategory:E})),[x,O,F,E]),G=(0,u.useMemo)((()=>(0,u.createElement)(ig,{rootClientId:x,onInsert:A,onHover:D})),[x,A,D]),U=(0,u.useMemo)((()=>(0,u.createElement)(wg,{rootClientId:x,selectedCategory:S,onSelectCategory:w,onInsert:A})),[x,A,S,w]),$=(0,u.useCallback)((e=>"blocks"===e.name?V:"patterns"===e.name?H:"reusable"===e.name?G:"media"===e.name?U:void 0),[V,H,G,U]),j=(0,u.useRef)();(0,u.useImperativeHandle)(t,(()=>({focusSearch:()=>{j.current.focus()}})));const W="patterns"===B&&!b&&E,K=!b&&(N||L||R),q="media"===B&&!b&&S;return(0,u.createElement)("div",{className:"block-editor-inserter__menu"},(0,u.createElement)("div",{className:p()("block-editor-inserter__main-area",{"show-as-tabs":K})},(0,u.createElement)(h.SearchControl,{__nextHasNoMarginBottom:!0,className:"block-editor-inserter__search",onChange:e=>{k&&y(null),v(e)},value:f,label:(0,_.__)("Search for blocks and patterns"),placeholder:(0,_.__)("Search"),ref:j}),!!b&&(0,u.createElement)("div",{className:"block-editor-inserter__no-tab-container"},(0,u.createElement)(Mg,{filterValue:b,onSelect:i,onHover:D,rootClientId:n,clientId:o,isAppender:r,__experimentalInsertionIndex:l,showBlockDirectory:!0,shouldFocusBlock:d})),K&&(0,u.createElement)(Ag,{showPatterns:N,showReusableBlocks:L,showMedia:R,prioritizePatterns:m,onSelect:I},$),!b&&!K&&(0,u.createElement)("div",{className:"block-editor-inserter__no-tab-container"},V)),q&&(0,u.createElement)(_g,{rootClientId:x,onInsert:A,category:S}),a&&k&&(0,u.createElement)(tm,{item:k}),W&&(0,u.createElement)(tg,{rootClientId:x,onInsert:O,onHover:z,category:E,showTitlesAsTooltip:!0}))}));function Dg(e){let{onSelect:t,rootClientId:n,clientId:o,isAppender:r,prioritizePatterns:l,selectBlockOnInsert:i,orderInitialBlockItems:a}=e;const[s,c]=(0,u.useState)(""),[d,m]=Bm({onSelect:t,rootClientId:n,clientId:o,isAppender:r,selectBlockOnInsert:i}),[f]=pm(d,m),[v]=vm(m,d),{setInserterIsOpened:b,insertionIndex:k}=(0,g.useSelect)((e=>{const{getSettings:t,getBlockIndex:n,getBlockCount:r}=e(To),l=t(),i=n(o),a=r();return{setInserterIsOpened:l.__experimentalSetIsInserterOpened,insertionIndex:-1===i?a:i}}),[o]),y=v.length&&(!!s||l),E=y&&v.length>6||f.length>6;(0,u.useEffect)((()=>{b&&b(!1)}),[b]);let C=0;return y&&(C=l?4:2),(0,u.createElement)("div",{className:p()("block-editor-inserter__quick-inserter",{"has-search":E,"has-expand":b})},E&&(0,u.createElement)(h.SearchControl,{__nextHasNoMarginBottom:!0,className:"block-editor-inserter__search",value:s,onChange:e=>{c(e)},label:(0,_.__)("Search for blocks and patterns"),placeholder:(0,_.__)("Search")}),(0,u.createElement)("div",{className:"block-editor-inserter__quick-inserter-results"},(0,u.createElement)(Mg,{filterValue:s,onSelect:t,rootClientId:n,clientId:o,isAppender:r,maxBlockPatterns:C,maxBlockTypes:6,isDraggable:!1,prioritizePatterns:l,selectBlockOnInsert:i,orderInitialBlockItems:a})),b&&(0,u.createElement)(h.Button,{className:"block-editor-inserter__quick-inserter-expand",onClick:()=>{b({rootClientId:n,insertionIndex:k,filterValue:s})},"aria-label":(0,_.__)("Browse all. This will open the main inserter panel in the editor toolbar.")},(0,_.__)("Browse all")))}const zg=e=>{let{onToggle:t,disabled:n,isOpen:o,blockTitle:r,hasSingleBlockType:l,toggleProps:i={},prioritizePatterns:a}=e;const{as:s=h.Button,label:d,onClick:p,...m}=i;let g=d;return!g&&l?g=(0,_.sprintf)((0,_._x)("Add %s","directly add the only allowed block"),r):!g&&a?g=(0,_.__)("Add pattern"):g||(g=(0,_._x)("Add block","Generic label for block inserter button")),(0,u.createElement)(s,c({icon:cd,label:g,tooltipPosition:"bottom",onClick:function(e){t&&t(e),p&&p(e)},className:"block-editor-inserter__toggle","aria-haspopup":!l&&"true","aria-expanded":!l&&o,disabled:n},m))};class Fg extends u.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=zg,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:a,onSelectOrClose:s,selectBlockOnInsert:c,orderInitialBlockItems:d}=this.props;return i?(0,u.createElement)(Dg,{onSelect:e=>{const n=Array.isArray(e)&&null!=e&&e.length?e[0]:e;s&&"function"==typeof s&&s(n),t()},rootClientId:n,clientId:o,isAppender:r,prioritizePatterns:a,selectBlockOnInsert:c,orderInitialBlockItems:d}):(0,u.createElement)(Og,{onSelect:()=>{t()},rootClientId:n,clientId:o,isAppender:r,showInserterHelpPanel:l,prioritizePatterns:a})}render(){const{position:e,hasSingleBlockType:t,directInsertBlock:n,insertOnlyAllowedBlock:o,__experimentalIsQuick:r,onSelectOrClose:l}=this.props;return t||n?this.renderToggle({onToggle:o}):(0,u.createElement)(h.Dropdown,{className:"block-editor-inserter",contentClassName:p()("block-editor-inserter__popover",{"is-quick":r}),popoverProps:{position:e},onToggle:this.onToggle,expandOnMobile:!0,headerTitle:(0,_.__)("Add a block"),renderToggle:this.renderToggle,renderContent:this.renderContent,onClose:l})}}const Vg=(0,m.compose)([(0,g.withSelect)(((e,t)=>{var n;let{clientId:o,rootClientId:r,shouldDirectInsert:l=!0}=t;const{getBlockRootClientId:i,hasInserterItems:s,getAllowedBlocks:c,__experimentalGetDirectInsertBlock:u,getSettings:d}=e(To),{getBlockVariations:p}=e(a.store);r=r||i(o)||void 0;const m=c(r),g=l&&u(r),f=d(),h=1===(null==m?void 0:m.length)&&0===(null===(n=p(m[0].name,"inserter"))||void 0===n?void 0:n.length);let v=!1;return h&&(v=m[0]),{hasItems:s(r),hasSingleBlockType:h,blockTitle:v?v.title:"",allowedBlockType:v,directInsertBlock:g,rootClientId:r,prioritizePatterns:f.__experimentalPreferPatternsOnRoot&&!r}})),(0,g.withDispatch)(((e,t,n)=>{let{select:o}=n;return{insertOnlyAllowedBlock(){const{rootClientId:n,clientId:r,isAppender:l,hasSingleBlockType:i,allowedBlockType:s,directInsertBlock:c,onSelectOrClose:u,selectBlockOnInsert:d}=t;if(!i&&!c)return;const{insertBlock:p}=e(To);let m;if(c){const e=function(e){const{getBlock:t,getPreviousBlockClientId:l}=o(To);if(!e||!r&&!n)return{};const i={};let a={};if(r){const e=t(r),n=t(l(r));(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);m=(0,a.createBlock)(c.name,{...c.attributes||{},...e})}else m=(0,a.createBlock)(s.name);var g;(p(m,function(){const{getBlockIndex:e,getBlockSelectionEnd:t,getBlockOrder:i,getBlockRootClientId:a}=o(To);if(r)return e(r);const s=t();return!l&&s&&a(s)===n?e(s)+1:i(n).length}(),n,d),u)&&u({clientId:null===(g=m)||void 0===g?void 0:g.clientId});const f=(0,_.sprintf)((0,_.__)("%s block added"),s.title);(0,pn.speak)(f)}}})),(0,m.ifCondition)((e=>{let{hasItems:t,isAppender:n,rootClientId:o,clientId:r}=e;return t||!n&&!o&&!r}))])(Fg);var Hg=(0,u.forwardRef)(((e,t)=>(0,u.createElement)(Vg,c({ref:t},e,{orderInitialBlockItems:void 0}))));var Gg=(0,m.compose)((0,g.withSelect)(((e,t)=>{const{getBlockCount:n,getSettings:o,getTemplateLock:r}=e(To),l=!n(t.rootClientId),{bodyPlaceholder:i}=o();return{showPrompt:l,isLocked:!!r(t.rootClientId),placeholder:i}})),(0,g.withDispatch)(((e,t)=>{const{insertDefaultBlock:n,startTyping:o}=e(To);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,sd.decodeEntities)(r)||(0,_.__)("Type / to choose a block");return(0,u.createElement)("div",{"data-root-client-id":l||"",className:p()("block-editor-default-block-appender",{"has-visible-prompt":o})},(0,u.createElement)("p",{tabIndex:"0",role:"button","aria-label":(0,_.__)("Add default block"),className:"block-editor-default-block-appender__content",onKeyDown:e=>{Qu.ENTER!==e.keyCode&&Qu.SPACE!==e.keyCode||n()},onClick:()=>n(),onFocus:()=>{o&&n()}},o?i:"\ufeff"),(0,u.createElement)(Hg,{rootClientId:l,position:"bottom right",isAppender:!0,__experimentalIsQuick:!0}))}));function Ug(e,t){let{rootClientId:n,className:o,onFocus:r,tabIndex:l}=e;return(0,u.createElement)(Hg,{position:"bottom center",rootClientId:n,__experimentalIsQuick:!0,renderToggle:e=>{let n,{onToggle:i,disabled:a,isOpen:s,blockTitle:c,hasSingleBlockType:d}=e;n=d?(0,_.sprintf)((0,_._x)("Add %s","directly add the only allowed block"),c):(0,_._x)("Add block","Generic label for block inserter button");const m=!d;let g=(0,u.createElement)(h.Button,{ref:t,onFocus:r,tabIndex:l,className:p()(o,"block-editor-button-block-appender"),onClick:i,"aria-haspopup":m?"true":void 0,"aria-expanded":m?s:void 0,disabled:a,label:n},!d&&(0,u.createElement)(h.VisuallyHidden,{as:"span"},n),(0,u.createElement)(Jl,{icon:cd}));return(m||d)&&(g=(0,u.createElement)(h.Tooltip,{text:n},g)),g},isAppender:!0})}const $g=(0,u.forwardRef)(((e,t)=>(W()("wp.blockEditor.ButtonBlockerAppender",{alternative:"wp.blockEditor.ButtonBlockAppender",since:"5.9"}),Ug(e,t))));var jg=(0,u.forwardRef)(Ug);function Wg(e){let{rootClientId:t}=e;return(0,g.useSelect)((e=>e(To).canInsertBlockType((0,a.getDefaultBlockName)(),t)))?(0,u.createElement)(Gg,{rootClientId:t}):(0,u.createElement)(jg,{rootClientId:t,className:"block-list-appender__toggle"})}var Kg=function(e){let{rootClientId:t,renderAppender:n,className:o,tagName:r="div"}=e;const l=function(e,t){const{hideInserter:n,isParentSelected:o}=(0,g.useSelect)((t=>{const{getTemplateLock:n,getSelectedBlockClientId:o,__unstableGetEditorMode:r}=t(To),l=o();return{hideInserter:!!n(e)||"zoom-out"===r(),isParentSelected:e===l||!e&&!l}}),[e]);return n||!1===t?null:t?(0,u.createElement)(t,null):o?(0,u.createElement)(Wg,{rootClientId:e}):null}(t,n);return l?(0,u.createElement)(r,{tabIndex:-1,className:p()("block-list-appender wp-block",o),contentEditable:!1,"data-block":!0},l):null};const qg=Number.MAX_SAFE_INTEGER;(0,u.createContext)();var Yg=function(e){let{previousClientId:t,nextClientId:n,children:o,__unstablePopoverSlot:r,__unstableContentRef:l,...i}=e;const[a,s]=(0,u.useReducer)((e=>(e+1)%qg),0),{orientation:d,rootClientId:m,isVisible:f}=(0,g.useSelect)((e=>{var o;const{getBlockListSettings:r,getBlockRootClientId:l,isBlockVisible:i}=e(To),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]),v=tr(t),b=tr(n),k="vertical"===d,y=(0,u.useMemo)((()=>{if(a<0||!v&&!b||!f)return{};const e=v?v.getBoundingClientRect():null,t=b?b.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,_.isRTL)()?e.left-t.right:t.left-e.right),{width:n,height:e?e.height:t.height}}),[v,b,k,a,f]),E=(0,u.useMemo)((()=>{if(a<0||!v&&!b||!f)return;const{ownerDocument:e}=v||b;return{ownerDocument:e,getBoundingClientRect(){const e=v?v.getBoundingClientRect():null,t=b?b.getBoundingClientRect():null;let n=0,o=0;return k?(o=e?e.bottom:t.top,n=(0,_.isRTL)()?e?e.right:t.right:e?e.left:t.left):(o=e?e.top:t.top,n=(0,_.isRTL)()?e?e.left:t.right:e?e.right:t.left),new window.DOMRect(n,o,0,0)}}}),[v,b,a,k,f]),C=qr(l);return(0,u.useLayoutEffect)((()=>{if(!v)return;const e=new window.MutationObserver(s);return e.observe(v,{attributes:!0}),()=>{e.disconnect()}}),[v]),(0,u.useLayoutEffect)((()=>{if(!b)return;const e=new window.MutationObserver(s);return e.observe(b,{attributes:!0}),()=>{e.disconnect()}}),[b]),(0,u.useLayoutEffect)((()=>{if(v)return v.ownerDocument.defaultView.addEventListener("resize",s),()=>{var e;null===(e=v.ownerDocument.defaultView)||void 0===e||e.removeEventListener("resize",s)}}),[v]),(v||b)&&f?(0,u.createElement)(h.Popover,c({ref:C,animate:!1,anchor:E,focusOnMount:!1,__unstableSlotName:r||null,key:n+"--"+m},i,{className:p()("block-editor-block-popover","block-editor-block-popover__inbetween",i.className),resize:!1,flip:!1,placement:"bottom-start",variant:"unstyled"}),(0,u.createElement)("div",{className:"block-editor-block-popover__inbetween-container",style:y},o)):null};const Zg={hide:{opacity:0,scaleY:.75},show:{opacity:1,scaleY:1},exit:{opacity:0,scaleY:.9}};var Qg=function(e){let{__unstablePopoverSlot:t,__unstableContentRef:n}=e;const{clientId:o}=(0,g.useSelect)((e=>{const{getBlockOrder:t,getBlockInsertionPoint:n}=e(To),o=n(),r=t(o.rootClientId);return r.length?{clientId:r[o.index]}:{}}),[]),r=(0,m.useReducedMotion)();return(0,u.createElement)(Zr,{clientId:o,__unstableCoverTarget:!0,__unstablePopoverSlot:t,__unstableContentRef:n,className:"block-editor-block-popover__drop-zone"},(0,u.createElement)(h.__unstableMotion.div,{"data-testid":"block-popover-drop-zone",initial:r?Zg.show:Zg.hide,animate:Zg.show,exit:r?Zg.show:Zg.exit,className:"block-editor-block-popover__drop-zone-foreground"}))};const Xg=(0,u.createContext)();function Jg(e){let{__unstablePopoverSlot:t,__unstableContentRef:n}=e;const{selectBlock:o,hideInsertionPoint:r}=(0,g.useDispatch)(To),l=(0,u.useContext)(Xg),i=(0,u.useRef)(),{orientation:a,previousClientId:s,nextClientId:c,rootClientId:d,isInserterShown:f,isDistractionFree:v,isNavigationMode:b}=(0,g.useSelect)((e=>{var t;const{getBlockOrder:n,getBlockListSettings:o,getBlockInsertionPoint:r,isBlockBeingDragged:l,getPreviousBlockClientId:i,getNextBlockClientId:a,getSettings:s,isNavigationMode:c}=e(To),u=r(),d=n(u.rootClientId);if(!d.length)return{};let p=d[u.index-1],m=d[u.index];for(;l(p);)p=i(p);for(;l(m);)m=a(m);const g=s();return{previousClientId:p,nextClientId:m,orientation:(null===(t=o(u.rootClientId))||void 0===t?void 0:t.orientation)||"vertical",rootClientId:u.rootClientId,isNavigationMode:c(),isDistractionFree:g.isDistractionFree,isInserterShown:null==u?void 0:u.__unstableWithInserter}}),[]),k=(0,m.useReducedMotion)();const _={start:{opacity:0,scale:0},rest:{opacity:1,scale:1,transition:{delay:f?.5:0,type:"tween"}},hover:{opacity:1,scale:1,transition:{delay:.5,type:"tween"}}},y={start:{scale:k?1:0},rest:{scale:1,transition:{delay:.4,type:"tween"}}};if(v&&!b)return null;const E=p()("block-editor-block-list__insertion-point","is-"+a);return(0,u.createElement)(Yg,{previousClientId:s,nextClientId:c,__unstablePopoverSlot:t,__unstableContentRef:n},(0,u.createElement)(h.__unstableMotion.div,{layout:!k,initial:k?"rest":"start",animate:"rest",whileHover:"hover",whileTap:"pressed",exit:"start",ref:i,tabIndex:-1,onClick:function(e){e.target===i.current&&c&&o(c,-1)},onFocus:function(e){e.target!==i.current&&(l.current=!0)},className:p()(E,{"is-with-inserter":f}),onHoverEnd:function(e){e.target!==i.current||l.current||r()}},(0,u.createElement)(h.__unstableMotion.div,{variants:_,className:"block-editor-block-list__insertion-point-indicator","data-testid":"block-list-insertion-point-indicator"}),f&&(0,u.createElement)(h.__unstableMotion.div,{variants:y,className:p()("block-editor-block-list__insertion-point-inserter")},(0,u.createElement)(Hg,{position:"bottom center",clientId:c,rootClientId:d,__experimentalIsQuick:!0,onToggle:e=>{l.current=e},onSelectOrClose:()=>{l.current=!1}}))))}function ef(e){const{insertionPoint:t,isVisible:n}=(0,g.useSelect)((e=>{const{getBlockInsertionPoint:t,isBlockInsertionPointVisible:n}=e(To);return{insertionPoint:t(),isVisible:n()}}),[]);return n?"replace"===t.operation?(0,u.createElement)(Qg,c({key:`${t.rootClientId}-${t.index}`},e)):(0,u.createElement)(Jg,e):null}function tf(){const e=(0,u.useContext)(Xg),t=(0,g.useSelect)((e=>e(To).getSettings().isDistractionFree||"zoom-out"===e(To).__unstableGetEditorMode()),[]),{getBlockListSettings:n,getBlockRootClientId:o,getBlockIndex:r,isBlockInsertionPointVisible:l,isMultiSelecting:i,getSelectedBlockClientIds:a,getTemplateLock:s,__unstableIsWithinBlockOverlay:c}=(0,g.useSelect)(To),{showInsertionPoint:d,hideInsertionPoint:p}=(0,g.useDispatch)(To);return(0,m.useRefEffect)((o=>{if(!t)return o.addEventListener("mousemove",l),()=>{o.removeEventListener("mousemove",l)};function l(t){var o;if(e.current)return;if(t.target.nodeType===t.target.TEXT_NODE)return;if(i())return;if(!t.target.classList.contains("block-editor-block-list__layout"))return void p();let l;if(!t.target.classList.contains("is-root-container")){l=(t.target.getAttribute("data-block")?t.target:t.target.closest("[data-block]")).getAttribute("data-block")}if(s(l))return;const u=(null===(o=n(l))||void 0===o?void 0:o.orientation)||"vertical",m=t.clientY,g=t.clientX;let f=Array.from(t.target.children).find((e=>{const t=e.getBoundingClientRect();return e.classList.contains("wp-block")&&"vertical"===u&&t.top>m||e.classList.contains("wp-block")&&"horizontal"===u&&t.left>g}));if(!f)return void p();if(!f.id&&(f=f.firstElementChild,!f))return void p();const h=f.id.slice("block-".length);if(!h||c(h))return;if(a().includes(h))return;const v=f.getBoundingClientRect();if("horizontal"===u&&(t.clientY>v.bottom||t.clientYv.right||t.clientX{setTimeout((()=>e(Date.now())),0)}:window.requestIdleCallback||window.requestAnimationFrame,of="undefined"==typeof window?clearTimeout:window.cancelIdleCallback||window.cancelAnimationFrame;function rf(e){return(0,g.useSelect)((t=>{if(!e)return null;const{getBlockName:n,getBlockAttributes:o}=t(To),{getBlockType:r,getActiveBlockVariation:l}=t(a.store),i=n(e),s=r(i);if(!s)return null;const c=o(e),u=l(i,c),d=(0,a.isReusableBlock)(s)||(0,a.isTemplatePart)(s),p={isSynced:d,title:s.title,icon:s.icon,description:s.description,anchor:null==c?void 0:c.anchor};return u?{isSynced:d,title:u.title||s.title,icon:u.icon||s.icon,description:u.description||s.description,anchor:null==c?void 0:c.anchor}:p}),[e])}function lf(e){let{clientId:t,maximumLength:n,context:o}=e;const{attributes:r,name:l,reusableBlockTitle:i}=(0,g.useSelect)((e=>{if(!t)return{};const{getBlockName:n,getBlockAttributes:o,__experimentalGetReusableBlockTitle:r}=e(To),l=n(t);if(!l)return{};const i=(0,a.isReusableBlock)((0,a.getBlockType)(l));return{attributes:o(t),name:l,reusableBlockTitle:i&&r(o(t).ref)}}),[t]),s=rf(t);if(!l||!s)return null;const c=(0,a.getBlockType)(l),u=c?(0,a.__experimentalGetBlockLabel)(c,r,o):null,d=i||u,p=d&&d!==c.title?d:s.title;if(n&&n>0&&p.length>n){const e="...";return p.slice(0,n-e.length)+e}return p}function af(e){let{clientId:t,maximumLength:n,context:o}=e;return lf({clientId:t,maximumLength:n,context:o})}var sf=e=>{let{children:t,clientIds:n,cloneClassname:o,onDragStart:r,onDragEnd:l}=e;const{srcRootClientId:i,isDraggable:s,icon:c}=(0,g.useSelect)((e=>{var t;const{canMoveBlocks:o,getBlockRootClientId:r,getBlockName:l}=e(To),i=r(n[0]),s=l(n[0]);return{srcRootClientId:i,isDraggable:o(n,i),icon:null===(t=(0,a.getBlockType)(s))||void 0===t?void 0:t.icon}}),[n]),d=(0,u.useRef)(!1),[p,m,f]=function(){const e=(0,u.useRef)(null),t=(0,u.useRef)(null),n=(0,u.useRef)(null),o=(0,u.useRef)(null);return(0,u.useEffect)((()=>()=>{o.current&&(clearInterval(o.current),o.current=null)}),[]),[(0,u.useCallback)((r=>{e.current=r.clientY,n.current=(0,Ri.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,u.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{e.current=null,n.current=null,o.current&&(clearInterval(o.current),o.current=null)}]}(),{startDraggingBlocks:v,stopDraggingBlocks:b}=(0,g.useDispatch)(To);if((0,u.useEffect)((()=>()=>{d.current&&b()}),[]),!s)return t({draggable:!1});const k={type:"block",srcClientIds:n,srcRootClientId:i};return(0,u.createElement)(h.Draggable,{cloneClassname:o,__experimentalTransferDataType:"wp-blocks",transferData:k,onDragStart:e=>{v(n),d.current=!0,p(e),r&&r()},onDragOver:m,onDragEnd:()=>{b(),d.current=!1,f(),l&&l()},__experimentalDragComponent:(0,u.createElement)(lm,{count:n.length,icon:c})},(e=>{let{onDraggableStart:n,onDraggableEnd:o}=e;return t({draggable:!0,onDragStart:n,onDragEnd:o})}))};var cf=(0,u.createElement)(G.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,u.createElement)(G.Path,{d:"M6.5 12.4L12 8l5.5 4.4-.9 1.2L12 10l-4.5 3.6-1-1.2z"}));var uf=(0,u.createElement)(G.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,u.createElement)(G.Path,{d:"M17.5 11.6L12 16l-5.5-4.4.9-1.2L12 14l4.5-3.6 1 1.2z"}));const df=(e,t)=>"up"===e?"horizontal"===t?(0,_.isRTL)()?"right":"left":"up":"down"===e?"horizontal"===t?(0,_.isRTL)()?"left":"right":"down":null;function pf(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,_.__)("All blocks are selected, and cannot be moved");if(r>0&&!o){const t=df("down",l);if("down"===t)return(0,_.sprintf)((0,_.__)("Move %1$d blocks from position %2$d down by one place"),e,i);if("left"===t)return(0,_.sprintf)((0,_.__)("Move %1$d blocks from position %2$d left by one place"),e,i);if("right"===t)return(0,_.sprintf)((0,_.__)("Move %1$d blocks from position %2$d right by one place"),e,i)}if(r>0&&o){const e=df("down",l);if("down"===e)return(0,_.__)("Blocks cannot be moved down as they are already at the bottom");if("left"===e)return(0,_.__)("Blocks cannot be moved left as they are already are at the leftmost position");if("right"===e)return(0,_.__)("Blocks cannot be moved right as they are already are at the rightmost position")}if(r<0&&!n){const t=df("up",l);if("up"===t)return(0,_.sprintf)((0,_.__)("Move %1$d blocks from position %2$d up by one place"),e,i);if("left"===t)return(0,_.sprintf)((0,_.__)("Move %1$d blocks from position %2$d left by one place"),e,i);if("right"===t)return(0,_.sprintf)((0,_.__)("Move %1$d blocks from position %2$d right by one place"),e,i)}if(r<0&&n){const e=df("up",l);if("up"===e)return(0,_.__)("Blocks cannot be moved up as they are already at the top");if("left"===e)return(0,_.__)("Blocks cannot be moved left as they are already are at the leftmost position");if("right"===e)return(0,_.__)("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,_.sprintf)((0,_.__)("Block %s is the only block, and cannot be moved"),t);if(l>0&&!r){const e=df("down",i);if("down"===e)return(0,_.sprintf)((0,_.__)("Move %1$s block from position %2$d down to position %3$d"),t,a,a+1);if("left"===e)return(0,_.sprintf)((0,_.__)("Move %1$s block from position %2$d left to position %3$d"),t,a,a+1);if("right"===e)return(0,_.sprintf)((0,_.__)("Move %1$s block from position %2$d right to position %3$d"),t,a,a+1)}if(l>0&&r){const e=df("down",i);if("down"===e)return(0,_.sprintf)((0,_.__)("Block %1$s is at the end of the content and can’t be moved down"),t);if("left"===e)return(0,_.sprintf)((0,_.__)("Block %1$s is at the end of the content and can’t be moved left"),t);if("right"===e)return(0,_.sprintf)((0,_.__)("Block %1$s is at the end of the content and can’t be moved right"),t)}if(l<0&&!o){const e=df("up",i);if("up"===e)return(0,_.sprintf)((0,_.__)("Move %1$s block from position %2$d up to position %3$d"),t,a,a-1);if("left"===e)return(0,_.sprintf)((0,_.__)("Move %1$s block from position %2$d left to position %3$d"),t,a,a-1);if("right"===e)return(0,_.sprintf)((0,_.__)("Move %1$s block from position %2$d right to position %3$d"),t,a,a-1)}if(l<0&&o){const e=df("up",i);if("up"===e)return(0,_.sprintf)((0,_.__)("Block %1$s is at the beginning of the content and can’t be moved up"),t);if("left"===e)return(0,_.sprintf)((0,_.__)("Block %1$s is at the beginning of the content and can’t be moved left"),t);if("right"===e)return(0,_.sprintf)((0,_.__)("Block %1$s is at the beginning of the content and can’t be moved right"),t)}}const mf=(e,t)=>"up"===e?"horizontal"===t?(0,_.isRTL)()?pd:md:cf:"down"===e?"horizontal"===t?(0,_.isRTL)()?md:pd:uf:null,gf=(e,t)=>"up"===e?"horizontal"===t?(0,_.isRTL)()?(0,_.__)("Move right"):(0,_.__)("Move left"):(0,_.__)("Move up"):"down"===e?"horizontal"===t?(0,_.isRTL)()?(0,_.__)("Move left"):(0,_.__)("Move right"):(0,_.__)("Move down"):null,ff=(0,u.forwardRef)(((e,t)=>{let{clientIds:n,direction:o,orientation:r,...l}=e;const i=(0,m.useInstanceId)(ff),s=Array.isArray(n)?n:[n],d=s.length,{blockType:f,isDisabled:v,rootClientId:b,isFirst:k,isLast:_,firstIndex:y,orientation:E="vertical"}=(0,g.useSelect)((e=>{const{getBlockIndex:t,getBlockRootClientId:n,getBlockOrder:l,getBlock:i,getBlockListSettings:c}=e(To),u=s[0],d=n(u),p=t(u),m=t(s[s.length-1]),g=l(d),f=i(u),h=0===p,v=m===g.length-1,{orientation:b}=c(d)||{};return{blockType:f?(0,a.getBlockType)(f.name):null,isDisabled:"up"===o?h:v,rootClientId:d,firstIndex:p,isFirst:h,isLast:v,orientation:r||b}}),[n,o]),{moveBlocksDown:C,moveBlocksUp:S}=(0,g.useDispatch)(To),w="up"===o?S:C,B=`block-editor-block-mover-button__description-${i}`;return(0,u.createElement)(u.Fragment,null,(0,u.createElement)(h.Button,c({ref:t,className:p()("block-editor-block-mover-button",`is-${o}-button`),icon:mf(o,E),label:gf(o,E),"aria-describedby":B},l,{onClick:v?null:e=>{w(n,b),l.onClick&&l.onClick(e)},disabled:v,__experimentalIsFocusable:!0})),(0,u.createElement)(h.VisuallyHidden,{id:B},pf(d,f&&f.title,y,k,_,"up"===o?-1:1,E)))})),hf=(0,u.forwardRef)(((e,t)=>(0,u.createElement)(ff,c({direction:"up",ref:t},e)))),vf=(0,u.forwardRef)(((e,t)=>(0,u.createElement)(ff,c({direction:"down",ref:t},e))));var bf=function(e){let{clientIds:t,hideDragHandle:n}=e;const{canMove:o,rootClientId:r,isFirst:l,isLast:i,orientation:a}=(0,g.useSelect)((e=>{var n;const{getBlockIndex:o,getBlockListSettings:r,canMoveBlocks:l,getBlockOrder:i,getBlockRootClientId:a}=e(To),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&&i&&!r)return null;const s=(0,_.__)("Drag");return(0,u.createElement)(h.ToolbarGroup,{className:p()("block-editor-block-mover",{"is-horizontal":"horizontal"===a})},!n&&(0,u.createElement)(sf,{clientIds:t},(e=>(0,u.createElement)(h.Button,c({icon:rm,className:"block-editor-block-mover__drag-handle","aria-hidden":"true",label:s,tabIndex:"-1"},e)))),(0,u.createElement)("div",{className:"block-editor-block-mover__move-button-container"},(0,u.createElement)(h.ToolbarItem,null,(e=>(0,u.createElement)(hf,c({clientIds:t},e)))),(0,u.createElement)(h.ToolbarItem,null,(e=>(0,u.createElement)(vf,c({clientIds:t},e))))))};var kf=function(e){let{clientId:t,rootClientId:n}=e;const o=rf(t),r=(0,g.useSelect)((e=>{var o;const{getBlock:r,getBlockIndex:l,hasBlockMovingClientId:i,getBlockListSettings:a,__unstableGetEditorMode:s}=e(To),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:l,name:i,attributes:s,blockMovingMode:d,orientation:m,editorMode:f}=r,{setNavigationMode:v,removeBlock:b}=(0,g.useDispatch)(To),k=(0,u.useRef)(),y=(0,a.getBlockType)(i),E=(0,a.__experimentalGetAccessibleBlockLabel)(y,s,l+1,m);(0,u.useEffect)((()=>{k.current.focus(),(0,pn.speak)(E)}),[E]);const C=tr(t),{hasBlockMovingClientId:S,getBlockIndex:w,getBlockRootClientId:B,getClientIdsOfDescendants:I,getSelectedBlockClientId:x,getMultiSelectedBlocksEndClientId:T,getPreviousBlockClientId:M,getNextBlockClientId:N}=(0,g.useSelect)(To),{selectBlock:P,clearSelectedBlock:L,setBlockMovingClientId:R,moveBlockToPosition:A}=(0,g.useDispatch)(To),O=p()("block-editor-block-list__block-selection-button",{"is-block-moving-mode":!!d}),D=(0,_.__)("Drag");return(0,u.createElement)("div",{className:O},(0,u.createElement)(h.Flex,{justify:"center",className:"block-editor-block-list__block-selection-button__content"},(0,u.createElement)(h.FlexItem,null,(0,u.createElement)(fd,{icon:null==o?void 0:o.icon,showColors:!0})),(0,u.createElement)(h.FlexItem,null,"zoom-out"===f&&(0,u.createElement)(bf,{clientIds:[t],hideDragHandle:!0}),"navigation"===f&&(0,u.createElement)(sf,{clientIds:[t]},(e=>(0,u.createElement)(h.Button,c({icon:rm,className:"block-selection-button_drag-handle","aria-hidden":"true",label:D,tabIndex:"-1"},e))))),(0,u.createElement)(h.FlexItem,null,(0,u.createElement)(h.Button,{ref:k,onClick:"navigation"===f?()=>v(!1):void 0,onKeyDown:function(e){const{keyCode:n}=e,o=n===Qu.UP,r=n===Qu.DOWN,l=n===Qu.LEFT,i=n===Qu.RIGHT,a=n===Qu.TAB,s=n===Qu.ESCAPE,c=n===Qu.ENTER,u=n===Qu.SPACE,d=e.shiftKey;if(n===Qu.BACKSPACE||n===Qu.DELETE)return b(t),void e.preventDefault();const p=x(),m=T(),g=M(m||p),f=N(m||p),h=a&&d||o,v=a&&!d||r,k=l,_=i;let y;if(h)y=g;else if(v)y=f;else if(k){var E;y=null!==(E=B(p))&&void 0!==E?E:p}else if(_){var O;y=null!==(O=I([p])[0])&&void 0!==O?O:p}const D=S();if(s&&D&&!e.defaultPrevented&&(R(null),e.preventDefault()),(c||u)&&D){const e=B(D),t=B(p),n=w(D);let o=w(p);n{!function(e){const[t]=Ri.focus.tabbable.find(e);t&&t.focus({preventScroll:!0})}(e.current)}),[]);(0,xd.useShortcut)("core/block-editor/focus-toolbar",a),(0,u.useEffect)((()=>{l&&a()}),[n,l,a]),(0,u.useEffect)((()=>{let t=0;return i&&!l&&(t=window.requestAnimationFrame((()=>{const t=_f(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=_f(e.current).findIndex((e=>0===e.tabIndex));r(n)}}),[i,l])}var Ef=function(e){let{children:t,focusOnMount:n,__experimentalInitialIndex:o,__experimentalOnIndexChange:r,...l}=e;const i=(0,u.useRef)(),a=function(e){const[t,n]=(0,u.useState)(!0),o=(0,u.useCallback)((()=>{const t=!Ri.focus.tabbable.find(e.current).some((e=>!("toolbarItem"in e.dataset)));t||W()("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,u.useLayoutEffect)((()=>{const t=new window.MutationObserver(o);return t.observe(e.current,{childList:!0,subtree:!0}),()=>t.disconnect()}),[t]),t}(i);return yf(i,n,a,o,r),a?(0,u.createElement)(h.Toolbar,c({label:l["aria-label"],ref:i},l),t):(0,u.createElement)(h.NavigableMenu,c({orientation:"horizontal",role:"toolbar",ref:i},l),t)};const{clearTimeout:Cf,setTimeout:Sf}=window,wf=()=>{},Bf=200;function If(e){let{ref:t,isFocused:n,debounceTimeout:o=Bf,onChange:r=wf}=e;const[l,i]=(0,u.useState)(!1),a=(0,u.useRef)(),s=e=>{null!=t&&t.current&&i(e),r(e)},c=()=>{const e=(null==t?void 0:t.current)&&t.current.matches(":hover");return!n&&!e},d=()=>{const e=a.current;e&&Cf&&Cf(e)};return(0,u.useEffect)((()=>()=>{s(!1),d()}),[]),{showMovers:l,debouncedShowMovers:e=>{e&&e.stopPropagation(),d(),l||s(!0)},debouncedHideMovers:e=>{e&&e.stopPropagation(),d(),a.current=Sf((()=>{c()&&s(!1)}),o)}}}function xf(e){let{ref:t,debounceTimeout:n=Bf,onChange:o=wf}=e;const[r,l]=(0,u.useState)(!1),{showMovers:i,debouncedShowMovers:a,debouncedHideMovers:s}=If({ref:t,debounceTimeout:n,isFocused:r,onChange:o}),c=(0,u.useRef)(!1),d=()=>(null==t?void 0:t.current)&&t.current.contains(t.current.ownerDocument.activeElement);return(0,u.useEffect)((()=>{const e=t.current,n=()=>{d()&&(l(!0),a())},o=()=>{d()||(l(!1),s())};return e&&!c.current&&(e.addEventListener("focus",n,!0),e.addEventListener("blur",o,!0),c.current=!0),()=>{e&&(e.removeEventListener("focus",n),e.removeEventListener("blur",o))}}),[t,c,l,a,s]),{showMovers:i,gestures:{onMouseMove:a,onMouseLeave:s}}}function Tf(){const{selectBlock:e,toggleBlockHighlight:t}=(0,g.useDispatch)(To),{firstParentClientId:n,shouldHide:o,isDistractionFree:r}=(0,g.useSelect)((e=>{const{getBlockName:t,getBlockParents:n,getSelectedBlockClientId:o,getSettings:r}=e(To),{hasBlockSupport:l}=e(a.store),i=n(o()),s=i[i.length-1],c=t(s),u=(0,a.getBlockType)(c),d=r();return{firstParentClientId:s,shouldHide:!l(u,"__experimentalParentSelector",!0),isDistractionFree:d.isDistractionFree}}),[]),l=rf(n),i=(0,u.useRef)(),{gestures:s}=xf({ref:i,onChange(e){e&&r||t(n,e)}});return o||void 0===n?null:(0,u.createElement)("div",c({className:"block-editor-block-parent-selector",key:n,ref:i},s),(0,u.createElement)(h.ToolbarButton,{className:"block-editor-block-parent-selector__button",onClick:()=>e(n),label:(0,_.sprintf)((0,_.__)("Select %s"),null==l?void 0:l.title),showTooltip:!0,icon:(0,u.createElement)(fd,{icon:null==l?void 0:l.icon})}))}var Mf=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.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 Nf(e){let{blocks:t}=e;return(0,u.createElement)("div",{className:"block-editor-block-switcher__popover__preview__parent"},(0,u.createElement)("div",{className:"block-editor-block-switcher__popover__preview__container"},(0,u.createElement)(h.Popover,{className:"block-editor-block-switcher__preview__popover",placement:"bottom-start",focusOnMount:!1},(0,u.createElement)("div",{className:"block-editor-block-switcher__preview"},(0,u.createElement)("div",{className:"block-editor-block-switcher__preview-title"},(0,_.__)("Preview")),(0,u.createElement)(Jp,{viewportWidth:500,blocks:t})))))}function Pf(e){let{restTransformations:t,onSelect:n,setHoveredTransformItemName:o}=e;return t.map((e=>(0,u.createElement)(Lf,{key:e.name,item:e,onSelect:n,setHoveredTransformItemName:o})))}function Lf(e){let{item:t,onSelect:n,setHoveredTransformItemName:o}=e;const{name:r,icon:l,title:i,isDisabled:s}=t;return(0,u.createElement)(h.MenuItem,{className:(0,a.getBlockMenuDefaultClassName)(r),onClick:e=>{e.preventDefault(),n(r)},disabled:s,onMouseLeave:()=>o(null),onMouseEnter:()=>o(r)},(0,u.createElement)(fd,{icon:l,showColors:!0}),i)}var Rf=e=>{let{className:t,possibleBlockTransformations:n,onSelect:o,blocks:r}=e;const[l,i]=(0,u.useState)(),{priorityTextTransformations:s,restTransformations:c}=function(e){const t={"core/paragraph":1,"core/heading":2,"core/list":3,"core/quote":4},n=(0,u.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](0,u.createElement)(Lf,{key:e.name,item:e,onSelect:o,setHoveredTransformItemName:i}))),!d&&p),!!d&&(0,u.createElement)(h.MenuGroup,{className:t},p))};var Af=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"M16.7 7.1l-6.3 8.5-3.3-2.5-.9 1.2 4.5 3.4L17.9 8z"})),Of=window.wp.tokenList,Df=n.n(Of);function zf(e,t,n){const o=new(Df())(e);return t&&o.remove("is-style-"+t.name),o.add("is-style-"+n.name),o.value}function Ff(e){return null==e?void 0:e.find((e=>e.isDefault))}function Vf(e){let{clientId:t,onSwitch:n}=e;const{styles:o,block:r,blockType:l,className:i}=(0,g.useSelect)((e=>{const{getBlock:n}=e(To),o=n(t);if(!o)return{};const r=(0,a.getBlockType)(o.name),{getBlockStyles:l}=e(a.store);return{block:o,blockType:r,styles:l(o.name),className:o.attributes.className||""}}),[t]),{updateBlockAttributes:s}=(0,g.useDispatch)(To),c=function(e){return e&&0!==e.length?Ff(e)?e:[{name:"default",label:(0,_._x)("Default","block style"),isDefault:!0},...e]:[]}(o),d=function(e,t){for(const n of new(Df())(t).values()){if(-1===n.indexOf("is-style-"))continue;const t=n.substring(9),o=null==e?void 0:e.find((e=>{let{name:n}=e;return n===t}));if(o)return o}return Ff(e)}(c,i),p=function(e,t){return(0,u.useMemo)((()=>{const n=null==t?void 0:t.example,o=null==t?void 0:t.name;return n&&o?(0,a.getBlockFromExample)(o,{attributes:n.attributes,innerBlocks:n.innerBlocks}):e?(0,a.cloneBlock)(e):void 0}),[null!=t&&t.example?null==e?void 0:e.name:e,t])}(r,l);return{onSelect:e=>{const o=zf(i,d,e);s(t,{className:o}),n()},stylesToRender:c,activeStyle:d,genericPreviewBlock:p,className:i}}const Hf=()=>{};function Gf(e){let{clientId:t,onSwitch:n=Hf}=e;const{onSelect:o,stylesToRender:r,activeStyle:l}=Vf({clientId:t,onSwitch:n});return r&&0!==r.length?(0,u.createElement)(u.Fragment,null,r.map((e=>{const t=e.label||e.name;return(0,u.createElement)(h.MenuItem,{key:e.name,icon:l.name===e.name?Af:null,onClick:()=>o(e)},(0,u.createElement)(h.__experimentalText,{as:"span",limit:18,ellipsizeMode:"tail",truncate:!0},t))}))):null}function Uf(e){let{hoveredBlock:t,onSwitch:n}=e;const{clientId:o}=t;return(0,u.createElement)(h.MenuGroup,{label:(0,_.__)("Styles"),className:"block-editor-block-switcher__styles__menugroup"},(0,u.createElement)(Gf,{clientId:o,onSwitch:n}))}const $f=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=$f(e,t,n);if(o)return o}}},jf=(e,t)=>{const n=((e,t)=>{const n=(0,a.__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 Wf=(e,t)=>(0,u.useMemo)((()=>e.reduce(((e,n)=>{const o=((e,t)=>{const n=t.map((e=>(0,a.cloneBlock)(e))),o=new Set;for(const t of e){let e=!1;for(const r of n){const n=$f(r,t.name,o);if(n){e=!0,o.add(n.clientId),jf(n,t);break}}if(!e)return}return n})(t,n.blocks);return o&&e.push({...n,transformedBlocks:o}),e}),[])),[e,t]);function Kf(e){let{patterns:t,onSelect:n}=e;return(0,u.createElement)("div",{className:"block-editor-block-switcher__popover__preview__parent"},(0,u.createElement)("div",{className:"block-editor-block-switcher__popover__preview__container"},(0,u.createElement)(h.Popover,{className:"block-editor-block-switcher__preview__popover",position:"bottom right"},(0,u.createElement)("div",{className:"block-editor-block-switcher__preview"},(0,u.createElement)("div",{className:"block-editor-block-switcher__preview-title"},(0,_.__)("Preview")),(0,u.createElement)(qf,{patterns:t,onSelect:n})))))}function qf(e){let{patterns:t,onSelect:n}=e;const o=(0,h.__unstableUseCompositeState)();return(0,u.createElement)(h.__unstableComposite,c({},o,{role:"listbox",className:"block-editor-block-switcher__preview-patterns-container","aria-label":(0,_.__)("Patterns list")}),t.map((e=>(0,u.createElement)(Yf,{key:e.name,pattern:e,onSelect:n,composite:o}))))}function Yf(e){let{pattern:t,onSelect:n,composite:o}=e;const r="block-editor-block-switcher__preview-patterns-container",l=(0,m.useInstanceId)(Yf,`${r}-list__item-description`);return(0,u.createElement)("div",{className:`${r}-list__list-item`,"aria-label":t.title,"aria-describedby":t.description?l:void 0},(0,u.createElement)(h.__unstableCompositeItem,c({role:"option",as:"div"},o,{className:`${r}-list__item`,onClick:()=>n(t.transformedBlocks)}),(0,u.createElement)(Jp,{blocks:t.transformedBlocks,viewportWidth:t.viewportWidth||500}),(0,u.createElement)("div",{className:`${r}-list__item-title`},t.title)),!!t.description&&(0,u.createElement)(h.VisuallyHidden,{id:l},t.description))}var Zf=function(e){let{blocks:t,patterns:n,onSelect:o}=e;const[r,l]=(0,u.useState)(!1),i=Wf(n,t);return i.length?(0,u.createElement)(h.MenuGroup,{className:"block-editor-block-switcher__pattern__transforms__menugroup"},r&&(0,u.createElement)(Kf,{patterns:i,onSelect:o}),(0,u.createElement)(h.MenuItem,{onClick:e=>{e.preventDefault(),l(!r)},icon:pd},(0,_.__)("Patterns"))):null};const Qf=e=>{let{clientIds:t,blocks:n}=e;const{replaceBlocks:o,multiSelect:r}=(0,g.useDispatch)(To),l=rf(n[0].clientId),{possibleBlockTransformations:i,canRemove:s,hasBlockStyles:c,icon:d,patterns:p}=(0,g.useSelect)((e=>{const{getBlockRootClientId:o,getBlockTransformItems:r,__experimentalGetPatternTransformItems:i}=e(To),{getBlockStyles:s,getBlockType:c}=e(a.store),{canRemoveBlocks:u}=e(To),d=o(Array.isArray(t)?t[0]:t),[{name:p}]=n,m=1===n.length,g=m&&s(p);let f;if(m)f=null==l?void 0:l.icon;else{var h;f=1===new Set(n.map((e=>{let{name:t}=e;return t}))).size?null===(h=c(p))||void 0===h?void 0:h.icon:Mf}return{possibleBlockTransformations:r(n,d),canRemove:u(t,d),hasBlockStyles:!(null==g||!g.length),icon:f,patterns:i(n,d)}}),[t,n,null==l?void 0:l.icon]),m=lf({clientId:Array.isArray(t)?t[0]:t,maximumLength:35}),f=1===n.length&&(0,a.isReusableBlock)(n[0]),v=1===n.length&&(0,a.isTemplatePart)(n[0]);function b(e){e.length>1&&r(e[0].clientId,e[e.length-1].clientId)}const k=!!i.length&&s&&!v,y=!(null==p||!p.length)&&s;if(!c&&!k)return(0,u.createElement)(h.ToolbarGroup,null,(0,u.createElement)(h.ToolbarButton,{disabled:!0,className:"block-editor-block-switcher__no-switcher-icon",title:m,icon:(0,u.createElement)(u.Fragment,null,(0,u.createElement)(fd,{icon:d,showColors:!0}),(f||v)&&(0,u.createElement)("span",{className:"block-editor-block-switcher__toggle-text"},m))}));const E=m,C=1===n.length?(0,_.sprintf)((0,_.__)("%s: Change block type or style"),m):(0,_.sprintf)((0,_._n)("Change type of %d block","Change type of %d blocks",n.length),n.length),S=c||k||y;return(0,u.createElement)(h.ToolbarGroup,null,(0,u.createElement)(h.ToolbarItem,null,(e=>(0,u.createElement)(h.DropdownMenu,{className:"block-editor-block-switcher",label:E,popoverProps:{position:"bottom right",variant:"toolbar",className:"block-editor-block-switcher__popover"},icon:(0,u.createElement)(u.Fragment,null,(0,u.createElement)(fd,{icon:d,className:"block-editor-block-switcher__toggle",showColors:!0}),(f||v)&&(0,u.createElement)("span",{className:"block-editor-block-switcher__toggle-text"},m)),toggleProps:{describedBy:C,...e},menuProps:{orientation:"both"}},(e=>{let{onClose:r}=e;return S&&(0,u.createElement)("div",{className:"block-editor-block-switcher__container"},y&&(0,u.createElement)(Zf,{blocks:n,patterns:p,onSelect:e=>{!function(e){o(t,e),b(e)}(e),r()}}),k&&(0,u.createElement)(Rf,{className:"block-editor-block-switcher__transforms__menugroup",possibleBlockTransformations:i,blocks:n,onSelect:e=>{!function(e){const r=(0,a.switchToBlockType)(n,e);o(t,r),b(r)}(e),r()}}),c&&(0,u.createElement)(Uf,{hoveredBlock:n[0],onSwitch:r}))})))))};var Xf=e=>{let{clientIds:t}=e;const n=(0,g.useSelect)((e=>e(To).getBlocksByClientId(t)),[t]);return!n.length||n.some((e=>!e))?null:(0,u.createElement)(Qf,{clientIds:t,blocks:n})};const{Fill:Jf,Slot:eh}=(0,h.createSlotFill)("__unstableBlockToolbarLastItem");Jf.Slot=eh;var th=Jf;function nh(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 oh(){const{getBlockName:e}=(0,g.useSelect)(To),{getBlockType:t}=(0,g.useSelect)(a.store),{createSuccessNotice:n}=(0,g.useDispatch)(hm.store);return(0,u.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,_.sprintf)((0,_.__)('Copied "%s" to clipboard.'),a):(0,_.sprintf)((0,_.__)('Moved "%s" to clipboard.'),a)}else l="copy"===o?(0,_.sprintf)((0,_._n)("Copied %d block to clipboard.","Copied %d blocks to clipboard.",r.length),r.length):(0,_.sprintf)((0,_._n)("Moved %d block to clipboard.","Moved %d blocks to clipboard.",r.length),r.length);n(l,{type:"snackbar"})}),[])}function rh(){const{getBlocksByClientId:e,getSelectedBlockClientIds:t,hasMultiSelection:n,getSettings:o,__unstableIsFullySelected:r,__unstableIsSelectionCollapsed:l,__unstableIsSelectionMergeable:i,__unstableGetSelectedBlocksWithPartialSelection:s,canInsertBlockType:c}=(0,g.useSelect)(To),{flashBlock:u,removeBlocks:d,replaceBlocks:p,__unstableDeleteSelection:f,__unstableExpandSelection:h,insertBlocks:v}=(0,g.useDispatch)(To),b=oh();return(0,m.useRefEffect)((m=>{function g(g){const k=t();if(0===k.length)return;if(!n()){const{target:e}=g,{ownerDocument:t}=e;if("copy"===g.type||"cut"===g.type?(0,Ri.documentHasUncollapsedSelection)(t):(0,Ri.documentHasSelection)(t))return}if(!m.contains(g.target.ownerDocument.activeElement))return;const _=g.defaultPrevented;g.preventDefault();const y=i(),E=l()||r(),C=!E&&!y;if("copy"===g.type||"cut"===g.type)if(1===k.length&&u(k[0]),C)h();else{let t;if(b(g.type,k),E)t=e(k);else{const[n,o]=s();t=[n,...e(k.slice(1,k.length-1)),o]}const n=g.clipboardData.getData("__unstableWrapperBlockName");n&&(t=(0,a.createBlock)(n,JSON.parse(g.clipboardData.getData("__unstableWrapperBlockAttributes")),t));const o=(0,a.serialize)(t);g.clipboardData.setData("text/plain",function(e){e=e.replace(/
/g,"\n");return(0,Ri.__unstableStripHTML)(e).trim().replace(/\n\n+/g,"\n\n")}(o)),g.clipboardData.setData("text/html",o)}if("cut"===g.type)E&&!C?d(k):f();else if("paste"===g.type){if(_)return;const{__experimentalCanUserUseUnfilteredHTML:e}=o(),{plainText:t,html:n,files:r}=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,Ri.getFilesFromDataTransfer)(t);return r.length&&!nh(r,o)?{files:r}:{html:o,plainText:n,files:[]}}(g);let l=[];if(r.length){const e=(0,a.getBlockTransforms)("from");l=r.reduce(((t,n)=>{const o=(0,a.findTransform)(e,(e=>"files"===e.type&&e.isMatch([n])));return o&&t.push(o.transform([n])),t}),[]).flat()}else l=(0,a.pasteHandler)({HTML:n,plainText:t,mode:"BLOCKS",canUserUseUnfilteredHTML:e});if(1===k.length){const[e]=k;if(l.every((t=>c(t.name,e))))return void v(l,void 0,e)}p(k,l,l.length-1,-1)}}return m.ownerDocument.addEventListener("copy",g),m.ownerDocument.addEventListener("cut",g),m.ownerDocument.addEventListener("paste",g),()=>{m.ownerDocument.removeEventListener("copy",g),m.ownerDocument.removeEventListener("cut",g),m.ownerDocument.removeEventListener("paste",g)}}),[])}var lh=function(e){let{children:t}=e;return(0,u.createElement)("div",{ref:rh()},t)};const ih="align",ah="__experimentalBorder",sh="color",ch="customClassName",uh="typography.__experimentalFontFamily",dh="typography.fontSize",ph="__experimentalLayout",mh=[...["typography.lineHeight",dh,"typography.__experimentalFontStyle","typography.__experimentalFontWeight",uh,"typography.__experimentalTextDecoration","typography.__experimentalTextTransform","typography.__experimentalLetterSpacing"],ah,sh,"spacing"];const gh={align:e=>(0,a.hasBlockSupport)(e,ih),borderColor:e=>function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"any";if("web"!==u.Platform.OS)return!1;const n=(0,a.getBlockSupport)(e,ah);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]))}(e,"color"),backgroundColor:e=>{const t=(0,a.getBlockSupport)(e,sh);return t&&!1!==t.background},textColor:e=>{const t=(0,a.getBlockSupport)(e,sh);return t&&!1!==t.text},gradient:e=>{const t=(0,a.getBlockSupport)(e,sh);return null!==t&&"object"==typeof t&&!!t.gradients},className:e=>(0,a.hasBlockSupport)(e,ch,!0),fontFamily:e=>(0,a.hasBlockSupport)(e,uh),fontSize:e=>(0,a.hasBlockSupport)(e,dh),layout:e=>(0,a.hasBlockSupport)(e,ph),style:e=>mh.some((t=>(0,a.hasBlockSupport)(e,t)))};function fh(e,t){return Object.entries(gh).reduce(((n,o)=>{let[r,l]=o;return l(e.name)&&l(t.name)&&(n[r]=e.attributes[r]),n}),{})}function hh(e,t,n){for(let o=0;o{let i="";try{if(!window.navigator.clipboard)return void r((0,_.__)("Unable to paste styles. This feature is only available on secure (https) sites in supporting browsers."),{type:"snackbar"});i=await window.navigator.clipboard.readText()}catch(e){return void r((0,_.__)("Unable to paste styles. Please allow browser clipboard permissions before continuing."),{type:"snackbar"})}if(!i||!function(e){try{const t=(0,a.parse)(e,{__unstableSkipMigrationLogs:!0,__unstableSkipAutop:!0});return 1!==t.length||"core/freeform"!==t[0].name}catch(e){return!1}}(i))return void o((0,_.__)("Unable to paste styles. Block styles couldn't be found within the copied content."),{type:"snackbar"});const s=(0,a.parse)(i);if(1===s.length?e.batch((()=>{hh(l,l.map((()=>s[0])),t)})):e.batch((()=>{hh(l,s,t)})),1===l.length){var c;const e=null===(c=(0,a.getBlockType)(l[0].name))||void 0===c?void 0:c.title;n((0,_.sprintf)((0,_.__)("Pasted styles to %s."),e),{type:"snackbar"})}else n((0,_.sprintf)((0,_.__)("Pasted styles to %d blocks."),l.length),{type:"snackbar"})}),[e.batch,t,n,o,r])}function bh(e){let{clientIds:t,children:n,__experimentalUpdateSelection:o}=e;const{canInsertBlockType:r,getBlockRootClientId:l,getBlocksByClientId:i,canMoveBlocks:s,canRemoveBlocks:c}=(0,g.useSelect)(To),{getDefaultBlockName:u,getGroupingBlockName:d}=(0,g.useSelect)(a.store),p=i(t),m=l(t[0]),f=p.every((e=>!!e&&(0,a.hasBlockSupport)(e.name,"multiple",!0)&&r(e.name,m))),h=r(u(),m),v=s(t,m),b=c(t,m),{removeBlocks:k,replaceBlocks:_,duplicateBlocks:y,insertAfterBlock:E,insertBeforeBlock:C,flashBlock:S,setBlockMovingClientId:w,setNavigationMode:B,selectBlock:I}=(0,g.useDispatch)(To),x=oh(),T=vh();return n({canDuplicate:f,canInsertDefaultBlock:h,canMove:v,canRemove:b,rootClientId:m,blocks:p,onDuplicate(){return y(t,o)},onRemove(){return k(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]),w(t[0])},onGroup(){if(!p.length)return;const e=d(),n=(0,a.switchToBlockType)(p,e);n&&_(t,n)},onUngroup(){if(!p.length)return;const e=p[0].innerBlocks;e.length&&_(t,e)},onCopy(){const e=p.map((e=>{let{clientId:t}=e;return t}));1===p.length&&S(e[0]),x("copy",e)},async onPasteStyles(){await T(p)}})}const kh=()=>{};var _h=(0,m.compose)([(0,g.withSelect)(((e,t)=>{let{clientId:n}=t;const{getBlock:o,getBlockMode:r,getSettings:l}=e(To),i=o(n),s=l().codeEditingEnabled;return{mode:r(n),blockType:i?(0,a.getBlockType)(i.name):null,isCodeEditingEnabled:s}})),(0,g.withDispatch)(((e,t)=>{let{onToggle:n=kh,clientId:o}=t;return{onToggleMode(){e(To).toggleBlockMode(o),n()}}}))])((function(e){let{blockType:t,mode:n,onToggleMode:o,small:r=!1,isCodeEditingEnabled:l=!0}=e;if(!t||!(0,a.hasBlockSupport)(t,"html",!0)||!l)return null;const i="visual"===n?(0,_.__)("Edit as HTML"):(0,_.__)("Edit visually");return(0,u.createElement)(h.MenuItem,{onClick:o},!r&&i)}));var yh=(0,m.compose)((0,g.withSelect)(((e,t)=>{let{clientId:n}=t;const o=e(To).getBlock(n);return{block:o,shouldRender:o&&"core/html"===o.name}})),(0,g.withDispatch)(((e,t)=>{let{block:n}=t;return{onClick:()=>e(To).replaceBlocks(n.clientId,(0,a.rawHandler)({HTML:(0,a.getBlockContent)(n)}))}})))((function(e){let{shouldRender:t,onClick:n,small:o}=e;if(!t)return null;const r=(0,_.__)("Convert to Blocks");return(0,u.createElement)(h.MenuItem,{onClick:n},!o&&r)}));const{Fill:Eh,Slot:Ch}=(0,h.createSlotFill)("__unstableBlockSettingsMenuFirstItem");Eh.Slot=Ch;var Sh=Eh;function wh(){const{clientIds:e,isGroupable:t,isUngroupable:n,blocksSelection:o,groupingBlockName:r}=(0,g.useSelect)((e=>{var t;const{getBlockRootClientId:n,getBlocksByClientId:o,canInsertBlockType:r,getSelectedBlockClientIds:l}=e(To),{getGroupingBlockName:i}=e(a.store),s=l(),c=i(),u=r(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:r}}function Bh(e){let{clientIds:t,isGroupable:n,isUngroupable:o,blocksSelection:r,groupingBlockName:l,onClose:i=(()=>{})}=e;const{replaceBlocks:s}=(0,g.useDispatch)(To);return n||o?(0,u.createElement)(u.Fragment,null,n&&(0,u.createElement)(h.MenuItem,{onClick:()=>{(()=>{const e=(0,a.switchToBlockType)(r,l);e&&s(t,e)})(),i()}},(0,_._x)("Group","verb")),o&&(0,u.createElement)(h.MenuItem,{onClick:()=>{(()=>{const e=r[0].innerBlocks;e.length&&s(t,e)})(),i()}},(0,_._x)("Ungroup","Ungrouping blocks from within a Group block back into individual blocks within the Editor "))):null}function Ih(e){return(0,g.useSelect)((t=>{const{canEditBlock:n,canMoveBlock:o,canRemoveBlock:r,canLockBlockType:l,getBlockName:i,getBlockRootClientId:a,getTemplateLock:s}=t(To),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 xh=(0,u.createElement)(G.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,u.createElement)(G.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 Th=(0,u.createElement)(G.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,u.createElement)(G.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-1zM9.8 7c0-1.2 1-2.2 2.2-2.2 1.2 0 2.2 1 2.2 2.2v3H9.8V7zm6.7 11.5h-9v-7h9v7z"}));var Mh=(0,u.createElement)(G.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,u.createElement)(G.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"}));const Nh=["core/block","core/navigation"];function Ph(e){return e.remove&&e.move?"all":!(!e.remove||e.move)&&"insert"}function Lh(e){let{clientId:t,onClose:n}=e;const[o,r]=(0,u.useState)({move:!1,remove:!1}),{canEdit:l,canMove:i,canRemove:s}=Ih(t),{allowsEditLocking:c,templateLock:d,hasTemplateLock:p}=(0,g.useSelect)((e=>{var n,o;const{getBlockName:r,getBlockAttributes:l}=e(To),i=r(t),s=(0,a.getBlockType)(i);return{allowsEditLocking:Nh.includes(i),templateLock:null===(n=l(t))||void 0===n?void 0:n.templateLock,hasTemplateLock:!(null==s||null===(o=s.attributes)||void 0===o||!o.templateLock)}}),[t]),[f,v]=(0,u.useState)(!!d),{updateBlockAttributes:b}=(0,g.useDispatch)(To),k=rf(t),y=(0,m.useInstanceId)(Lh,"block-editor-block-lock-modal__options-title");(0,u.useEffect)((()=>{r({move:!i,remove:!s,...c?{edit:!l}:{}})}),[l,i,s,c]);const E=Object.values(o).every(Boolean),C=Object.values(o).some(Boolean)&&!E;return(0,u.createElement)(h.Modal,{title:(0,_.sprintf)((0,_.__)("Lock %s"),k.title),overlayClassName:"block-editor-block-lock-modal",onRequestClose:n},(0,u.createElement)("p",null,(0,_.__)("Choose specific attributes to restrict or lock all available options.")),(0,u.createElement)("form",{onSubmit:e=>{e.preventDefault(),b([t],{lock:o,templateLock:f?Ph(o):void 0}),n()}},(0,u.createElement)("div",{role:"group","aria-labelledby":y,className:"block-editor-block-lock-modal__options"},(0,u.createElement)(h.CheckboxControl,{__nextHasNoMarginBottom:!0,className:"block-editor-block-lock-modal__options-title",label:(0,u.createElement)("span",{id:y},(0,_.__)("Lock all")),checked:E,indeterminate:C,onChange:e=>r({move:e,remove:e,...c?{edit:e}:{}})}),(0,u.createElement)("ul",{className:"block-editor-block-lock-modal__checklist"},c&&(0,u.createElement)("li",{className:"block-editor-block-lock-modal__checklist-item"},(0,u.createElement)(h.CheckboxControl,{__nextHasNoMarginBottom:!0,label:(0,_.__)("Restrict editing"),checked:!!o.edit,onChange:e=>r((t=>({...t,edit:e})))}),(0,u.createElement)(h.Icon,{className:"block-editor-block-lock-modal__lock-icon",icon:o.edit?Mh:xh})),(0,u.createElement)("li",{className:"block-editor-block-lock-modal__checklist-item"},(0,u.createElement)(h.CheckboxControl,{__nextHasNoMarginBottom:!0,label:(0,_.__)("Disable movement"),checked:o.move,onChange:e=>r((t=>({...t,move:e})))}),(0,u.createElement)(h.Icon,{className:"block-editor-block-lock-modal__lock-icon",icon:o.move?Mh:xh})),(0,u.createElement)("li",{className:"block-editor-block-lock-modal__checklist-item"},(0,u.createElement)(h.CheckboxControl,{__nextHasNoMarginBottom:!0,label:(0,_.__)("Prevent removal"),checked:o.remove,onChange:e=>r((t=>({...t,remove:e})))}),(0,u.createElement)(h.Icon,{className:"block-editor-block-lock-modal__lock-icon",icon:o.remove?Mh:xh}))),p&&(0,u.createElement)(h.ToggleControl,{className:"block-editor-block-lock-modal__template-lock",label:(0,_.__)("Apply to all blocks inside"),checked:f,disabled:o.move&&!o.remove,onChange:()=>v(!f)})),(0,u.createElement)(h.Flex,{className:"block-editor-block-lock-modal__actions",justify:"flex-end",expanded:!1},(0,u.createElement)(h.FlexItem,null,(0,u.createElement)(h.Button,{variant:"tertiary",onClick:n},(0,_.__)("Cancel"))),(0,u.createElement)(h.FlexItem,null,(0,u.createElement)(h.Button,{variant:"primary",type:"submit"},(0,_.__)("Apply"))))))}function Rh(e){let{clientId:t}=e;const{canLock:n,isLocked:o}=Ih(t),[r,l]=(0,u.useReducer)((e=>!e),!1);if(!n)return null;const i=o?(0,_.__)("Unlock"):(0,_.__)("Lock");return(0,u.createElement)(u.Fragment,null,(0,u.createElement)(h.MenuItem,{icon:o?xh:Th,onClick:l},i),r&&(0,u.createElement)(Lh,{clientId:t,onClose:l}))}const{Fill:Ah,Slot:Oh}=(0,h.createSlotFill)("BlockSettingsMenuControls");function Dh(e){let{...t}=e;return(0,u.createElement)(h.__experimentalStyleProvider,{document:document},(0,u.createElement)(Ah,t))}Dh.Slot=e=>{let{fillProps:t,clientIds:n=null,__unstableDisplayLocation:o}=e;const{selectedBlocks:r,selectedClientIds:l,canRemove:i}=(0,g.useSelect)((e=>{const{getBlockNamesByClientId:t,getSelectedBlockClientIds:o,canRemoveBlocks:r}=e(To),l=null!==n?n:o();return{selectedBlocks:t(l),selectedClientIds:l,canRemove:r(l)}}),[n]),{canLock:a}=Ih(l[0]),s=1===l.length&&a,d=wh(),{isGroupable:p,isUngroupable:m}=d,f=(p||m)&&i;return(0,u.createElement)(Oh,{fillProps:{...t,__unstableDisplayLocation:o,selectedBlocks:r,selectedClientIds:l}},(e=>!(null!=e&&e.length)>0&&!f&&!s?null:(0,u.createElement)(h.MenuGroup,null,s&&(0,u.createElement)(Rh,{clientId:l[0]}),e,f&&(0,u.createElement)(Bh,c({},d,{onClose:null==t?void 0:t.onClose})))))};var zh=Dh;const Fh=()=>{},Vh={className:"block-editor-block-settings-menu__popover",position:"bottom right",variant:"toolbar"};function Hh(e){let{blocks:t,onCopy:n,label:o}=e;const r=(0,m.useCopyToClipboard)((()=>(0,a.serialize)(t)),n),l=t.length>1?(0,_.__)("Copy blocks"):(0,_.__)("Copy block"),i=o||l;return(0,u.createElement)(h.MenuItem,{ref:r},i)}var Gh=function(e){let{clientIds:t,__experimentalSelectBlock:n,children:o,__unstableDisplayLocation:r,...l}=e;const i=Array.isArray(t)?t:[t],s=i.length,d=i[0],{firstParentClientId:p,isDistractionFree:f,onlyBlock:v,parentBlockType:b,previousBlockClientId:k,nextBlockClientId:y,selectedBlockClientIds:E}=(0,g.useSelect)((e=>{const{getBlockCount:t,getBlockName:n,getBlockRootClientId:o,getPreviousBlockClientId:r,getNextBlockClientId:l,getSelectedBlockClientIds:i,getSettings:s,getBlockAttributes:c}=e(To),{getActiveBlockVariation:u}=e(a.store),p=o(d),m=p&&n(p);return{firstParentClientId:p,isDistractionFree:s().isDistractionFree,onlyBlock:1===t(p),parentBlockType:p&&(u(m,c(p))||(0,a.getBlockType)(m)),previousBlockClientId:r(d),nextBlockClientId:l(d),selectedBlockClientIds:i()}}),[d]),C=(0,g.useSelect)((e=>{const{getShortcutRepresentation:t}=e(xd.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:S,toggleBlockHighlight:w}=(0,g.useDispatch)(To),B=(0,u.useCallback)(n?async e=>{const t=await e;t&&t[0]&&n(t[0])}:Fh,[n]),I=lf({clientId:d,maximumLength:25}),x=(0,u.useCallback)(n?()=>{const e=k||y||p;e&&E.includes(d)&&!E.includes(e)&&n(e)}:Fh,[n,k,y,p,E]),T=(0,_.sprintf)((0,_.__)("Remove %s"),I),M=1===s?T:(0,_.__)("Remove blocks"),N=(0,u.useRef)(),{gestures:P}=xf({ref:N,onChange(e){e&&f||w(p,e)}}),L=null==E?void 0:E.includes(p);return(0,u.createElement)(bh,{clientIds:t,__experimentalUpdateSelection:!n},(e=>{let{canDuplicate:n,canInsertDefaultBlock:i,canMove:a,canRemove:g,onDuplicate:f,onInsertAfter:k,onInsertBefore:y,onRemove:E,onCopy:w,onPasteStyles:I,onMoveTo:T,blocks:R}=e;return(0,u.createElement)(h.DropdownMenu,c({icon:sg,label:(0,_.__)("Options"),className:"block-editor-block-settings-menu",popoverProps:Vh,noIcons:!0},l),(e=>{let{onClose:l}=e;return(0,u.createElement)(u.Fragment,null,(0,u.createElement)(h.MenuGroup,null,(0,u.createElement)(Sh.Slot,{fillProps:{onClose:l}}),!L&&!!p&&(0,u.createElement)(h.MenuItem,c({},P,{ref:N,icon:(0,u.createElement)(fd,{icon:b.icon}),onClick:()=>S(p)}),(0,_.sprintf)((0,_.__)("Select parent block (%s)"),b.title)),1===s&&(0,u.createElement)(yh,{clientId:d}),(0,u.createElement)(Hh,{blocks:R,onCopy:w}),n&&(0,u.createElement)(h.MenuItem,{onClick:(0,m.pipe)(l,f,B),shortcut:C.duplicate},(0,_.__)("Duplicate")),i&&(0,u.createElement)(u.Fragment,null,(0,u.createElement)(h.MenuItem,{onClick:(0,m.pipe)(l,y),shortcut:C.insertBefore},(0,_.__)("Insert before")),(0,u.createElement)(h.MenuItem,{onClick:(0,m.pipe)(l,k),shortcut:C.insertAfter},(0,_.__)("Insert after"))),a&&!v&&(0,u.createElement)(h.MenuItem,{onClick:(0,m.pipe)(l,T)},(0,_.__)("Move to")),1===s&&(0,u.createElement)(_h,{clientId:d,onToggle:l})),(0,u.createElement)(h.MenuGroup,null,(0,u.createElement)(Hh,{blocks:R,onCopy:w,label:(0,_.__)("Copy styles")}),(0,u.createElement)(h.MenuItem,{onClick:I},(0,_.__)("Paste styles"))),(0,u.createElement)(zh.Slot,{fillProps:{onClose:l},clientIds:t,__unstableDisplayLocation:r}),"function"==typeof o?o({onClose:l}):u.Children.map((e=>(0,u.cloneElement)(e,{onClose:l}))),g&&(0,u.createElement)(h.MenuGroup,null,(0,u.createElement)(h.MenuItem,{onClick:(0,m.pipe)(l,E,x),shortcut:C.remove},M)))}))}))};var Uh=function(e){let{clientIds:t,...n}=e;return(0,u.createElement)(h.ToolbarGroup,null,(0,u.createElement)(h.ToolbarItem,null,(e=>(0,u.createElement)(Gh,c({clientIds:t,toggleProps:e},n)))))};function $h(e){let{clientId:t}=e;const n=rf(t),{canEdit:o,canMove:r,canRemove:l,canLock:i}=Ih(t),[a,s]=(0,u.useReducer)((e=>!e),!1);return i?o&&r&&l?null:(0,u.createElement)(u.Fragment,null,(0,u.createElement)(h.ToolbarGroup,{className:"block-editor-block-lock-toolbar"},(0,u.createElement)(h.ToolbarButton,{icon:Mh,label:(0,_.sprintf)((0,_.__)("Unlock %s"),n.title),onClick:s})),a&&(0,u.createElement)(Lh,{clientId:t,onClose:s})):null}var jh=(0,u.createElement)(G.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,u.createElement)(G.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 Wh=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.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 Kh=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.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 qh={group:{type:"constrained"},row:{type:"flex",flexWrap:"nowrap"},stack:{type:"flex",orientation:"vertical"}};var Yh=function(){const{blocksSelection:e,clientIds:t,groupingBlockName:n,isGroupable:o}=wh(),{replaceBlocks:r}=(0,g.useDispatch)(To),{canRemove:l,variations:i}=(0,g.useSelect)((e=>{const{canRemoveBlocks:o}=e(To),{getBlockVariations:r}=e(a.store);return{canRemove:o(t),variations:r(n,"transform")}}),[t,n]),s=o=>{const l=(0,a.switchToBlockType)(e,n);"string"!=typeof o&&(o="group"),l&&l.length>0&&(l[0].attributes.layout=qh[o],r(t,l))};if(!o||!l)return null;const c=!!i.find((e=>{let{name:t}=e;return"group-row"===t})),d=!!i.find((e=>{let{name:t}=e;return"group-stack"===t}));return(0,u.createElement)(h.ToolbarGroup,null,(0,u.createElement)(h.ToolbarButton,{icon:jh,label:(0,_._x)("Group","verb"),onClick:s}),c&&(0,u.createElement)(h.ToolbarButton,{icon:Wh,label:(0,_._x)("Row","single horizontal line"),onClick:()=>s("row")}),d&&(0,u.createElement)(h.ToolbarButton,{icon:Kh,label:(0,_._x)("Stack","verb"),onClick:()=>s("stack")}))};function Zh(e){let{clientIds:t}=e;const n=1===t.length?t[0]:void 0,o=(0,g.useSelect)((e=>!!n&&"html"===e(To).getBlockMode(n)),[n]),{toggleBlockMode:r}=(0,g.useDispatch)(To);return o?(0,u.createElement)(h.ToolbarGroup,null,(0,u.createElement)(h.ToolbarButton,{onClick:()=>{r(n)}},(0,_.__)("Edit visually"))):null}var Qh=(0,u.createContext)("");var Xh=e=>{let{hideDragHandle:t}=e;const{blockClientIds:n,blockClientId:o,blockType:r,hasFixedToolbar:l,isDistractionFree:i,isValid:s,isVisual:d,isContentLocked:f}=(0,g.useSelect)((e=>{const{getBlockName:t,getBlockMode:n,getSelectedBlockClientIds:o,isBlockValid:r,getBlockRootClientId:l,getSettings:i,__unstableGetContentLockingParent:s}=e(To),c=o(),u=c[0],d=l(u),p=i();return{blockClientIds:c,blockClientId:u,blockType:u&&(0,a.getBlockType)(t(u)),hasFixedToolbar:p.hasFixedToolbar,isDistractionFree:p.isDistractionFree,rootClientId:d,isValid:c.every((e=>r(e))),isVisual:c.every((e=>"visual"===n(e))),isContentLocked:!!s(u)}}),[]),{toggleBlockHighlight:v}=(0,g.useDispatch)(To),b=(0,u.useRef)(),{showMovers:k,gestures:_}=xf({ref:b,onChange(e){e&&i||v(o,e)}}),y=(0,m.useViewportMatch)("medium","<")||l;if(r&&!(0,a.hasBlockSupport)(r,"__experimentalToolbar",!0))return null;const E=y||k;if(0===n.length)return null;const C=s&&d,S=n.length>1,w=(0,a.isReusableBlock)(r)||(0,a.isTemplatePart)(r),B=p()("block-editor-block-toolbar",{"is-showing-movers":E,"is-synced":w});return(0,u.createElement)("div",{className:B},!S&&!y&&!f&&(0,u.createElement)(Tf,null),(0,u.createElement)("div",c({ref:b},_),(C||S)&&!f&&(0,u.createElement)(h.ToolbarGroup,{className:"block-editor-block-toolbar__block-controls"},(0,u.createElement)(Xf,{clientIds:n}),!S&&(0,u.createElement)($h,{clientId:n[0]}),(0,u.createElement)(bf,{clientIds:n,hideDragHandle:t}))),C&&S&&(0,u.createElement)(Yh,null),C&&(0,u.createElement)(u.Fragment,null,(0,u.createElement)(Vo.Slot,{group:"parent",className:"block-editor-block-toolbar__slot"}),(0,u.createElement)(Vo.Slot,{group:"block",className:"block-editor-block-toolbar__slot"}),(0,u.createElement)(Vo.Slot,{className:"block-editor-block-toolbar__slot"}),(0,u.createElement)(Vo.Slot,{group:"inline",className:"block-editor-block-toolbar__slot"}),(0,u.createElement)(Vo.Slot,{group:"other",className:"block-editor-block-toolbar__slot"}),(0,u.createElement)(Qh.Provider,{value:null==r?void 0:r.name},(0,u.createElement)(th.Slot,null))),(0,u.createElement)(Zh,{clientIds:n}),!f&&(0,u.createElement)(Uh,{clientIds:n}))};var Jh=function(e){let{focusOnMount:t,isFixed:n,...o}=e;const{blockType:r,hasParents:l,showParentSelector:i}=(0,g.useSelect)((e=>{const{getBlockName:t,getBlockParents:n,getSelectedBlockClientIds:o,__unstableGetContentLockingParent:r}=e(To),{getBlockType:l}=e(a.store),i=o(),s=i[0],c=n(s),u=l(t(c[c.length-1]));return{blockType:s&&l(t(s)),hasParents:c.length,showParentSelector:u&&(0,a.hasBlockSupport)(u,"__experimentalParentSelector",!0)&&i.length<=1&&!r(s)}}),[]);if(r&&!(0,a.hasBlockSupport)(r,"__experimentalToolbar",!0))return null;const s=p()("block-editor-block-contextual-toolbar",{"has-parent":l&&i,"is-fixed":n});return(0,u.createElement)(Ef,c({focusOnMount:t,className:s,"aria-label":(0,_.__)("Block tools")},o),(0,u.createElement)(Xh,{hideDragHandle:n}))};const{CustomSelectControl:ev}=Io(h.privateApis),tv="position",nv="block-editor-hooks__position-selection__select-control__option",ov={key:"default",value:"",name:(0,_.__)("Default"),className:nv},rv={key:"sticky",value:"sticky",name:(0,_.__)("Sticky"),className:nv,__experimentalHint:(0,_.__)("The block will stick to the top of the window instead of scrolling.")},lv={key:"fixed",value:"fixed",name:(0,_.__)("Fixed"),className:nv,__experimentalHint:(0,_.__)("The block will not move when the page is scrolled.")},iv=["top","right","bottom","left"],av=["sticky","fixed"];function sv(e){return!!(0,a.getBlockSupport)(e,tv)}function cv(e){var t,n;const o=null===(t=e.style)||void 0===t||null===(n=t.position)||void 0===n?void 0:n.type;return"sticky"===o||"fixed"===o}function uv(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=fr("position.fixed"),n=fr("position.sticky"),o=!t&&!n;return!sv(e)||o}function dv(e){var t;const{attributes:{style:n={}},clientId:o,name:r,setAttributes:l}=e,i=function(e){const t=(0,a.getBlockSupport)(e,tv);return!!(!0===t||null!=t&&t.fixed)}(r),s=function(e){const t=(0,a.getBlockSupport)(e,tv);return!!(!0===t||null!=t&&t.sticky)}(r),c=null==n||null===(t=n.position)||void 0===t?void 0:t.type,{hasParents:d}=(0,g.useSelect)((e=>{const{getBlockParents:t}=e(To);return{hasParents:t(o).length}}),[o]),p=(0,u.useMemo)((()=>{const e=[ov];return(s&&!d||c===rv.value)&&e.push(rv),(i||c===lv.value)&&e.push(lv),e}),[i,s,d,c]),m=c&&p.find((e=>e.value===c))||ov;return u.Platform.select({web:p.length>1?(0,u.createElement)(jr,{group:"position"},(0,u.createElement)(h.BaseControl,{className:"block-editor-hooks__position-selection"},(0,u.createElement)(ev,{__nextUnconstrainedWidth:!0,__next36pxDefaultSize:!0,className:"block-editor-hooks__position-selection__select-control",label:(0,_.__)("Position"),hideLabelFromVision:!0,describedBy:(0,_.sprintf)((0,_.__)("Currently selected position: %s"),m.name),options:p,value:m,__experimentalShowSelectedHint:!0,onChange:e=>{let{selectedItem:t}=e;(e=>{const t={...n,position:{...null==n?void 0:n.position,type:e,top:"sticky"===e||"fixed"===e?"0px":void 0}};l({style:Ar(t)})})(t.value)},size:"__unstable-large"}))):null,native:null})}const pv=(0,m.createHigherOrderComponent)((e=>t=>{const{name:n}=t;return[(0,a.hasBlockSupport)(n,tv)&&!uv(t)&&(0,u.createElement)(dv,c({key:"position"},t)),(0,u.createElement)(e,c({key:"edit"},t))]}),"withInspectorControls"),mv=(0,m.createHigherOrderComponent)((e=>t=>{var n,o,r,l;const{name:i,attributes:s}=t,d=(0,a.hasBlockSupport)(i,tv)&&!uv(t),g=(0,m.useInstanceId)(e),f=(0,u.useContext)(Wv.__unstableElementContext);let h;d&&(h=function(e){let{selector:t,style:n}=e,o="";const{type:r}=(null==n?void 0:n.position)||{};return av.includes(r)?(o+=`${t} {`,o+=`position: ${r};`,iv.forEach((e=>{var t;void 0!==(null==n||null===(t=n.position)||void 0===t?void 0:t[e])&&(o+=`${e}: ${n.position[e]};`)})),"sticky"!==r&&"fixed"!==r||(o+="z-index: 10"),o+="}",o):o}({selector:`.wp-container-${g}.wp-container-${g}`,style:null==s?void 0:s.style})||"");const v=p()(null==t?void 0:t.className,{[`wp-container-${g}`]:d&&!!h,[`is-position-${null==s||null===(n=s.style)||void 0===n||null===(o=n.position)||void 0===o?void 0:o.type}`]:d&&!!h&&!(null==s||null===(r=s.style)||void 0===r||null===(l=r.position)||void 0===l||!l.type)});return(0,u.createElement)(u.Fragment,null,d&&f&&!!h&&(0,u.createPortal)((0,u.createElement)("style",null,h),f),(0,u.createElement)(e,c({},t,{className:v})))}));(0,s.addFilter)("editor.BlockListBlock","core/editor/position/with-position-styles",mv),(0,s.addFilter)("editor.BlockEdit","core/editor/position/with-inspector-controls",pv);const gv={placement:"top-start"},fv={...gv,flip:!1,shift:!0},hv={...gv,flip:!0,shift:!1};function vv(e,t,n,o,r){if(!e||!t)return fv;const l=(null==n?void 0:n.scrollTop)||0,i=t.getBoundingClientRect(),a=l+e.getBoundingClientRect().top,s=e.ownerDocument.documentElement.clientHeight,c=a+o,u=i.top>c,d=i.height>s-o;return r||!u&&!d?hv:fv}function bv(e){const{__unstableGetEditorMode:t,isMultiSelecting:n,hasMultiSelection:o,isTyping:r,isBlockInterfaceHidden:l,getSettings:i,getLastMultiSelectedBlockClientId:a}=Io(e(To));return{editorMode:t(),hasMultiSelection:o(),isMultiSelecting:n(),isTyping:r(),isBlockInterfaceHidden:l(),hasFixedToolbar:i().hasFixedToolbar,isDistractionFree:i().isDistractionFree,lastClientId:o()?a():null}}function kv(e){let{clientId:t,rootClientId:n,isEmptyDefaultBlock:o,showContents:r,capturingClientId:l,__unstablePopoverSlot:i,__unstableContentRef:a}=e;const{editorMode:s,hasMultiSelection:d,isMultiSelecting:f,isTyping:h,isBlockInterfaceHidden:v,hasFixedToolbar:b,isDistractionFree:k,lastClientId:_}=(0,g.useSelect)(bv,[]),y=(0,g.useSelect)((e=>{const{isBlockInsertionPointVisible:n,getBlockInsertionPoint:o,getBlockOrder:r}=e(To);if(!n())return!1;const l=o();return r(l.rootClientId)[l.index]===t}),[t]),E=(0,m.useViewportMatch)("medium"),C=(0,u.useRef)(!1),{stopTyping:S}=(0,g.useDispatch)(To),w=!h&&"edit"===s&&o,B=!d&&("navigation"===s||"zoom-out"===s),I="edit"===s&&!b&&E&&!f&&!w&&!h&&!v,x=!("edit"!==s||I||b||k||o);(0,xd.useShortcut)("core/block-editor/focus-toolbar",(()=>{C.current=!0,S(!0)}),{isDisabled:!x}),(0,u.useEffect)((()=>{C.current=!1}));const T=(0,u.useRef)(),M=function(e){let{contentElement:t,clientId:n}=e;const o=tr(n),[r,l]=(0,u.useState)(0),{blockIndex:i,isSticky:a}=(0,g.useSelect)((e=>{const{getBlockIndex:t,getBlockAttributes:o}=e(To);return{blockIndex:t(n),isSticky:cv(o(n))}}),[n]),s=(0,u.useMemo)((()=>{if(t)return(0,Ri.getScrollContainer)(t)}),[t]),[c,d]=(0,u.useState)((()=>vv(t,o,s,r,a))),p=(0,m.useRefEffect)((e=>{l(e.offsetHeight)}),[]),f=(0,u.useCallback)((()=>d(vv(t,o,s,r,a))),[t,o,s,r]);return(0,u.useLayoutEffect)(f,[i,f]),(0,u.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",f);const a=null==o||null===(r=o.ownerDocument)||void 0===r?void 0:r.defaultView;return a.ResizeObserver&&(i=new a.ResizeObserver(f),i.observe(o)),()=>{var e;null==l||null===(e=l.removeEventHandler)||void 0===e||e.call(l,"resize",f),i&&i.disconnect()}}),[f,t,o]),{...c,ref:p}}({contentElement:null==a?void 0:a.current,clientId:t});return w?(0,u.createElement)(Zr,c({clientId:l||t,__unstableCoverTarget:!0,bottomClientId:_,className:p()("block-editor-block-list__block-side-inserter-popover",{"is-insertion-point-visible":y}),__unstablePopoverSlot:i,__unstableContentRef:a,resize:!1,shift:!1},M),(0,u.createElement)("div",{className:"block-editor-block-list__empty-block-inserter"},(0,u.createElement)(Hg,{position:"bottom right",rootClientId:n,clientId:t,__experimentalIsQuick:!0}))):B||I?(0,u.createElement)(Zr,c({clientId:l||t,bottomClientId:_,className:p()("block-editor-block-list__block-popover",{"is-insertion-point-visible":y}),__unstablePopoverSlot:i,__unstableContentRef:a,resize:!1},M),I&&r&&(0,u.createElement)(Jh,{focusOnMount:C.current,__experimentalInitialIndex:T.current,__experimentalOnIndexChange:e=>{T.current=e},key:t}),B&&(0,u.createElement)(kf,{clientId:t,rootClientId:n})):null}function _v(e){const{getSelectedBlockClientId:t,getFirstMultiSelectedBlockClientId:n,getBlockRootClientId:o,getBlock:r,getBlockParents:l,getSettings:i,isNavigationMode:s,__experimentalGetBlockListSettingsForBlocks:c}=e(To),u=t()||n();if(!u)return;const{name:d,attributes:p={}}=r(u)||{},m=l(u),g=c(m),f=m.find((e=>{var t;return null===(t=g[e])||void 0===t?void 0:t.__experimentalCaptureToolbars})),h=i();return{clientId:u,rootClientId:o(u),name:d,isDistractionFree:h.isDistractionFree,isNavigationMode:s(),isEmptyDefaultBlock:d&&(0,a.isUnmodifiedDefaultBlock)({name:d,attributes:p}),capturingClientId:f}}function yv(e){let{__unstablePopoverSlot:t,__unstableContentRef:n}=e;const o=(0,g.useSelect)(_v,[]);if(!o)return null;const{clientId:r,rootClientId:l,name:i,isEmptyDefaultBlock:a,capturingClientId:s,isDistractionFree:c,isNavigationMode:d}=o;return i?(0,u.createElement)(kv,{clientId:r,rootClientId:l,isEmptyDefaultBlock:a,showContents:!c||d,capturingClientId:s,__unstablePopoverSlot:t,__unstableContentRef:n}):null}function Ev(e){let{children:t}=e;const n=(0,u.useContext)(Xg),o=(0,u.useContext)(h.Disabled.Context);return n||o?t:(W()('wp.components.Popover.Slot name="block-toolbar"',{alternative:"wp.blockEditor.BlockTools",since:"5.8",version:"6.3"}),(0,u.createElement)(ef,{__unstablePopoverSlot:"block-toolbar"},(0,u.createElement)(yv,{__unstablePopoverSlot:"block-toolbar"}),t))}var Cv=(0,m.createHigherOrderComponent)((e=>t=>{const{clientId:n}=Ro();return(0,u.createElement)(e,c({},t,{clientId:n}))}),"withClientId");var Sv=Cv((e=>{let{clientId:t,showSeparator:n,isFloating:o,onAddBlock:r,isToggle:l}=e;return(0,u.createElement)(jg,{className:p()({"block-list-appender__toggle":l}),rootClientId:t,showSeparator:n,isFloating:o,onAddBlock:r})}));var wv=(0,m.compose)([Cv,(0,g.withSelect)(((e,t)=>{let{clientId:n}=t;const{getBlockOrder:o}=e(To),r=o(n);return{lastBlockClientId:r[r.length-1]}}))])((e=>{let{clientId:t}=e;return(0,u.createElement)(Gg,{rootClientId:t})}));const Bv=new WeakMap;function Iv(e,t,n,o,r,l,i){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){i();const e=p.map((e=>(0,a.cloneBlock)(e)));l(e,!0,null)}if("block"===d){const l=n(u[0]);if(c===e&&l===t)return;if(u.includes(e)||o(u).some((t=>t===e)))return;const i=c===e,a=u.length;r(u,c,i&&l{if(!n)return;const i=(0,a.findTransform)((0,a.getBlockTransforms)("from"),(n=>"files"===n.type&&r(n.blockName,e)&&n.isMatch(t)));if(i){const e=i.transform(t,o);l(e)}}}function Tv(e,t,n){return e=>{const t=(0,a.pasteHandler)({HTML:e,mode:"BLOCKS"});t.length&&n(t)}}function Mv(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{operation:o="insert"}=n,r=(0,g.useSelect)((e=>e(To).getSettings().mediaUpload),[]),{canInsertBlockType:l,getBlockIndex:i,getClientIdsOfDescendants:a,getBlockOrder:s,getBlocksByClientId:c}=(0,g.useSelect)(To),{insertBlocks:d,moveBlocksToPosition:p,updateBlockAttributes:m,clearSelectedBlock:f,replaceBlocks:h,removeBlocks:v}=(0,g.useDispatch)(To),b=(0,g.useRegistry)(),k=(0,u.useCallback)((function(n){let r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;if("replace"===o){const o=s(e)[t];h(o,n,void 0,l)}else d(n,t,e,r,l)}),[o,s,d,h,t,e]),_=(0,u.useCallback)(((n,r,l)=>{if("replace"===o){const o=c(n),r=s(e)[t];b.batch((()=>{v(n,!1),h(r,o,void 0,0)}))}else p(n,r,e,l)}),[o,s,c,d,p,v,t,e]),y=Iv(e,t,i,a,_,k,f),E=xv(e,0,r,m,l,k),C=Tv(0,0,k);return e=>{const t=(0,Ri.getFilesFromDataTransfer)(e.dataTransfer),n=e.dataTransfer.getData("text/html");n?C(n):t.length?E(t):y(e)}}function Nv(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:i2&&void 0!==arguments[2]?arguments[2]:["top","bottom","left","right"];return r.forEach((r=>{const l=Nv(e,t,r);(void 0===n||l=e.x&&t.top<=e.y&&t.bottom>=e.y}function Rv(e,t){var n,o;let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"vertical";const l="horizontal"===r?["left","right"]:["top","bottom"],i=(0,_.isRTL)();let a=0,s="before",c=1/0;e.forEach((e=>{let{isUnmodifiedDefaultBlock:n,getBoundingClientRect:o,blockIndex:r}=e;const u=o();let[d,p]=Pv(t,u,l);n&&Lv(t,u)&&(d=0),d0&&void 0!==arguments[0]?arguments[0]:{};const[t,n]=(0,u.useState)({index:null,operation:"insert"}),o=(0,g.useSelect)((t=>{const{getTemplateLock:n,__unstableIsWithinBlockOverlay:o,__unstableHasActiveBlockOverlayActive:r}=t(To),l=n(e);return["all","contentOnly"].some((e=>e===l))||r(e)||o(e)}),[e]),{getBlockListSettings:r,getBlocks:l,getBlockIndex:i}=(0,g.useSelect)(To),{showInsertionPoint:s,hideInsertionPoint:c}=(0,g.useDispatch)(To),d=Mv(e,t.index,{operation:t.operation}),p=(0,m.useThrottle)((0,u.useCallback)(((t,o)=>{var c;const u=l(e);if(0===u.length)return void n({index:0,operation:"insert"});const d=u.map((e=>{const t=e.clientId;return{isUnmodifiedDefaultBlock:(0,a.isUnmodifiedDefaultBlock)(e),getBoundingClientRect:()=>o.getElementById(`block-${t}`).getBoundingClientRect(),blockIndex:i(t)}})),[p,m]=Rv(d,{x:t.clientX,y:t.clientY},null===(c=r(e))||void 0===c?void 0:c.orientation);n({index:p,operation:m}),s(e,p,{operation:m})}),[e]),200);return(0,m.__experimentalUseDropZone)({isDisabled:o,onDrop:d,onDragOver(e){p(e,e.currentTarget.ownerDocument)},onDragLeave(){p.cancel(),c()},onDragEnd(){p.cancel(),c()}})}const Ov={};function Dv(e){const{clientId:t,allowedBlocks:n,__experimentalDefaultBlock:o,__experimentalDirectInsert:r,template:l,templateLock:i,wrapperRef:s,templateInsertUpdatesSelection:c,__experimentalCaptureToolbars:d,__experimentalAppenderTagName:p,renderAppender:m,orientation:f,placeholder:h,layout:v}=e;!function(e,t,n,o,r,l,i,a){const{updateBlockListSettings:s}=(0,g.useDispatch)(To),c=(0,g.useRegistry)(),{blockListSettings:d,parentLock:p}=(0,g.useSelect)((t=>{const n=t(To).getBlockRootClientId(e);return{blockListSettings:t(To).getBlockListSettings(e),parentLock:t(To).getTemplateLock(n)}}),[e]),m=(0,u.useMemo)((()=>t),t);(0,u.useLayoutEffect)((()=>{const t={allowedBlocks:m,templateLock:void 0===r||"contentOnly"===p?p:r};if(void 0!==l&&(t.__experimentalCaptureToolbars=l),void 0!==i)t.orientation=i;else{const e=li(null==a?void 0:a.type);t.orientation=e.getOrientation(a)}void 0!==n&&(t.__experimentalDefaultBlock=n),void 0!==o&&(t.__experimentalDirectInsert=o),Kr()(d,t)||(Bv.get(c)||Bv.set(c,[]),Bv.get(c).push([e,t]),window.queueMicrotask((()=>{var e;null!==(e=Bv.get(c))&&void 0!==e&&e.length&&c.batch((()=>{Bv.get(c).forEach((e=>{s(...e)})),Bv.set(c,[])}))})))}),[e,d,m,n,o,r,p,l,i,s,a,c])}(t,n,o,r,i,d,f,v),function(e,t,n,o){const{getBlocks:r,getSelectedBlocksInitialCaretPosition:l,isBlockSelected:i}=(0,g.useSelect)(To),{replaceInnerBlocks:s,__unstableMarkNextChangeAsNotPersistent:c}=(0,g.useDispatch)(To),{innerBlocks:d}=(0,g.useSelect)((t=>({innerBlocks:t(To).getBlocks(e)})),[e]),p=(0,u.useRef)(null);(0,u.useLayoutEffect)((()=>{let u=!1;return window.queueMicrotask((()=>{if(u)return;const d=r(e),m=0===d.length||"all"===n||"contentOnly"===n,g=!k()(t,p.current);if(!m||!g)return;p.current=t;const f=(0,a.synchronizeBlocksWithTemplate)(d,t);k()(f,d)||(c(),s(e,f,0===d.length&&o&&0!==f.length&&i(e),l()))})),()=>{u=!0}}),[d,t,n,e])}(t,l,i,c);const b=function(e){return(0,g.useSelect)((t=>{const n=t(To).getBlock(e);if(!n)return;const o=t(a.store).getBlockType(n.name);return o&&0!==Object.keys(o.providesContext).length?Object.fromEntries(Object.entries(o.providesContext).map((e=>{let[t,o]=e;return[t,n.attributes[o]]}))):void 0}),[e])}(t),_=(0,g.useSelect)((e=>{var n;return null===(n=e(To).getBlock(t))||void 0===n?void 0:n.name}),[t]),y=(0,a.getBlockSupport)(_,"__experimentalLayout")||Ov,{allowSizingOnChildren:E=!1}=y,C=fr("layout")||Ov,S=v||y,w=(0,u.useMemo)((()=>({...C,...S,...E&&{allowSizingOnChildren:!0}})),[C,S,E]);return(0,u.createElement)(Oi,{value:b},(0,u.createElement)(qv,{rootClientId:t,renderAppender:m,__experimentalAppenderTagName:p,__experimentalLayout:w,wrapperRef:s,placeholder:h}))}function zv(e){return kd(e),(0,u.createElement)(Dv,e)}const Fv=(0,u.forwardRef)(((e,t)=>{const n=Vv({ref:t},e);return(0,u.createElement)("div",{className:"block-editor-inner-blocks"},(0,u.createElement)("div",n))}));function Vv(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{__unstableDisableLayoutClassNames:n,__unstableDisableDropZone:o}=t,{clientId:r,layout:l=null,__unstableLayoutClassNames:i=""}=Ro(),s=(0,m.useViewportMatch)("medium","<"),{__experimentalCaptureToolbars:d,hasOverlay:f}=(0,g.useSelect)((e=>{if(!r)return{};const{getBlockName:t,isBlockSelected:n,hasSelectedInnerBlock:o,__unstableGetEditorMode:l}=e(To),i=t(r),c="navigation"===l()||s;return{__experimentalCaptureToolbars:e(a.store).hasBlockSupport(i,"__experimentalExposeControlsToChildren",!1),hasOverlay:"core/template"!==i&&!n(r)&&!o(r,!0)&&c}}),[r,s]),h=Av({rootClientId:r}),v=(0,m.useMergeRefs)([e.ref,o?null:h]),b={__experimentalCaptureToolbars:d,layout:l,...t},k=b.value&&b.onChange?zv:Dv;return{...e,ref:v,className:p()(e.className,"block-editor-block-list__layout",n?"":i,{"has-overlay":f}),children:r?(0,u.createElement)(k,c({},b,{clientId:r})):(0,u.createElement)(qv,t)}}Vv.save=a.__unstableGetInnerBlocksProps,Fv.DefaultBlockAppender=wv,Fv.ButtonBlockAppender=Sv,Fv.Content=()=>Vv.save().children;var Hv=Fv;const Gv=(0,u.createContext)(),Uv=(0,u.createContext)(),$v=new WeakMap;function jv(e){let{className:t,...n}=e;const[o,r]=(0,u.useState)(),l=(0,m.useViewportMatch)("medium"),{isOutlineMode:i,isFocusMode:a,editorMode:s}=(0,g.useSelect)((e=>{const{getSettings:t,__unstableGetEditorMode:n}=e(To),{outlineMode:o,focusMode:r}=t();return{isOutlineMode:o,isFocusMode:r,editorMode:n()}}),[]),c=(0,g.useRegistry)(),{setBlockVisibility:d}=(0,g.useDispatch)(To),f=(0,m.useDebounce)((0,u.useCallback)((()=>{const e={};$v.get(c).forEach((t=>{let[n,o]=t;e[n]=o})),d(e)}),[c]),300,{trailing:!0}),h=(0,u.useMemo)((()=>{const{IntersectionObserver:e}=window;if(e)return new e((e=>{$v.get(c)||$v.set(c,[]);for(const t of e){const e=t.target.getAttribute("data-block");$v.get(c).push([e,t.isIntersecting])}f()}))}),[]),v=Vv({ref:(0,m.useMergeRefs)([Ed(),tf(),r]),className:p()("is-root-container",t,{"is-outline-mode":i,"is-focus-mode":a&&l,"is-navigate-mode":"navigation"===s})},n);return(0,u.createElement)(Gv.Provider,{value:o},(0,u.createElement)(Uv.Provider,{value:h},(0,u.createElement)("div",v)))}function Wv(e){return function(){const{patterns:e,isPreviewMode:t}=(0,g.useSelect)((e=>{const{__experimentalBlockPatterns:t,__unstableIsPreviewMode:n}=e(To).getSettings();return{patterns:t,isPreviewMode:n}}),[]);(0,u.useEffect)((()=>{if(t)return;if(null==e||!e.length)return;let n,o=-1;const r=()=>{o++,o>=e.length||((0,g.select)(To).__experimentalGetParsedPattern(e[o].name),n=nf(r))};return n=nf(r),()=>of(n)}),[e,t])}(),(0,u.createElement)(Ev,null,(0,u.createElement)(Lo,{value:No},(0,u.createElement)(jv,e)))}function Kv(e){let{placeholder:t,rootClientId:n,renderAppender:o,__experimentalAppenderTagName:r,__experimentalLayout:l=ii}=e;const{order:i,selectedBlocks:a,visibleBlocks:s}=(0,g.useSelect)((e=>{const{getBlockOrder:t,getSelectedBlockClientIds:o,__unstableGetVisibleBlocks:r}=e(To);return{order:t(n),selectedBlocks:o(),visibleBlocks:r()}}),[n]);return(0,u.createElement)(si,{value:l},i.map((e=>(0,u.createElement)(g.AsyncModeProvider,{key:e,value:!s.has(e)&&!a.includes(e)},(0,u.createElement)(ad,{rootClientId:n,clientId:e})))),i.length<1&&t,(0,u.createElement)(Kg,{tagName:r,rootClientId:n,renderAppender:o}))}function qv(e){return(0,u.createElement)(g.AsyncModeProvider,{value:!1},(0,u.createElement)(Kv,e))}function Yv(e){return[...e].sort(((t,n)=>e.filter((e=>e===n)).length-e.filter((e=>e===t)).length)).shift()}function Zv(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{flat:t,...n}=e;return t||Yv(Object.values(n).filter(Boolean))||"px"}function Qv(){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,h.__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=Yv(o),i=0===r||r?`${r}${l}`:void 0;return i}function Xv(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=Qv(e),n="string"!=typeof e&&isNaN(parseFloat(t));return n}function Jv(e){if(!e)return!1;if("string"==typeof e)return!0;return!!Object.values(e).filter((e=>!!e||0===e)).length}function eb(e){let{onChange:t,selectedUnits:n,setSelectedUnits:o,values:r,...l}=e,i=Qv(r);void 0===i&&(i=Zv(n));const a=Jv(r)&&Xv(r),s=a?(0,_.__)("Mixed"):null;return(0,u.createElement)(h.__experimentalUnitControl,c({},l,{"aria-label":(0,_.__)("Border radius"),disableUnits:a,isOnly:!0,value:i,onChange:e=>{const n=!isNaN(parseFloat(e));t(n?e:void 0)},onUnitChange:e=>{o({topLeft:e,topRight:e,bottomLeft:e,bottomRight:e})},placeholder:s,size:"__unstable-large"}))}Wv.__unstableElementContext=Gv;const tb={topLeft:(0,_.__)("Top left"),topRight:(0,_.__)("Top right"),bottomLeft:(0,_.__)("Bottom left"),bottomRight:(0,_.__)("Bottom right")};function nb(e){let{onChange:t,selectedUnits:n,setSelectedUnits:o,values:r,...l}=e;const i=e=>n=>{if(!t)return;const o=!isNaN(parseFloat(n))?n:void 0;t({...a,[e]:o})},a="string"!=typeof r?r:{topLeft:r,topRight:r,bottomLeft:r,bottomRight:r};return(0,u.createElement)("div",{className:"components-border-radius-control__input-controls-wrapper"},Object.entries(tb).map((e=>{let[t,r]=e;const[s,d]=(0,h.__experimentalParseQuantityAndUnitFromRawValue)(a[t]),p=a[t]?d:n[t]||n.flat;return(0,u.createElement)(h.Tooltip,{text:r,position:"top",key:t},(0,u.createElement)("div",{className:"components-border-radius-control__tooltip-wrapper"},(0,u.createElement)(h.__experimentalUnitControl,c({},l,{"aria-label":r,value:[s,p].join(""),onChange:i(t),onUnitChange:(m=t,e=>{const t={...n};t[m]=e,o(t)}),size:"__unstable-large"}))));var m})))}function ob(e){let{isLinked:t,...n}=e;const o=t?(0,_.__)("Unlink radii"):(0,_.__)("Link radii");return(0,u.createElement)(h.Tooltip,{text:o},(0,u.createElement)("span",null,(0,u.createElement)(h.Button,c({},n,{className:"component-border-radius-control__linked-button",isSmall:!0,icon:t?Er:Cr,iconSize:24,"aria-label":o}))))}const rb={topLeft:void 0,topRight:void 0,bottomLeft:void 0,bottomRight:void 0},lb={px:100,em:20,rem:20};function ib(e){let{onChange:t,values:n}=e;const[o,r]=(0,u.useState)(!Jv(n)||!Xv(n)),[l,i]=(0,u.useState)({flat:"string"==typeof n?(0,h.__experimentalParseQuantityAndUnitFromRawValue)(n)[1]:void 0,topLeft:(0,h.__experimentalParseQuantityAndUnitFromRawValue)(null==n?void 0:n.topLeft)[1],topRight:(0,h.__experimentalParseQuantityAndUnitFromRawValue)(null==n?void 0:n.topRight)[1],bottomLeft:(0,h.__experimentalParseQuantityAndUnitFromRawValue)(null==n?void 0:n.bottomLeft)[1],bottomRight:(0,h.__experimentalParseQuantityAndUnitFromRawValue)(null==n?void 0:n.bottomRight)[1]}),a=(0,h.__experimentalUseCustomUnits)({availableUnits:fr("spacing.units")||["px","em","rem"]}),s=Zv(l),c=a&&a.find((e=>e.value===s)),d=(null==c?void 0:c.step)||1,[p]=(0,h.__experimentalParseQuantityAndUnitFromRawValue)(Qv(n));return(0,u.createElement)("fieldset",{className:"components-border-radius-control"},(0,u.createElement)(h.BaseControl.VisualLabel,{as:"legend"},(0,_.__)("Radius")),(0,u.createElement)("div",{className:"components-border-radius-control__wrapper"},o?(0,u.createElement)(u.Fragment,null,(0,u.createElement)(eb,{className:"components-border-radius-control__unit-control",values:n,min:0,onChange:t,selectedUnits:l,setSelectedUnits:i,units:a}),(0,u.createElement)(h.RangeControl,{label:(0,_.__)("Border radius"),hideLabelFromVision:!0,className:"components-border-radius-control__range-control",value:null!=p?p:"",min:0,max:lb[s],initialPosition:0,withInputField:!1,onChange:e=>{t(void 0!==e?`${e}${s}`:void 0)},step:d,__nextHasNoMarginBottom:!0})):(0,u.createElement)(nb,{min:0,onChange:t,selectedUnits:l,setSelectedUnits:i,values:n||rb,units:a}),(0,u.createElement)(ob,{onClick:()=>r(!o),isLinked:o})))}function ab(e){var t;const{attributes:{style:n},setAttributes:o}=e;return(0,u.createElement)(ib,{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})}})}fp([hp,kp]);const sb=(e,t,n)=>{if(t){const n=null==e?void 0:e.find((e=>e.slug===t));if(n)return n}return{color:n}},cb=(e,t)=>null==e?void 0:e.find((e=>e.color===t));function ub(e,t){if(e&&t)return`has-${(0,f.kebabCase)(t)}-${e}`}function db(){const e={disableCustomColors:!fr("color.custom"),disableCustomGradients:!fr("color.customGradient")},t=fr("color.palette.custom"),n=fr("color.palette.theme"),o=fr("color.palette.default"),r=fr("color.defaultPalette");e.colors=(0,u.useMemo)((()=>{const e=[];return n&&n.length&&e.push({name:(0,_._x)("Theme","Indicates this palette comes from the theme."),colors:n}),r&&o&&o.length&&e.push({name:(0,_._x)("Default","Indicates this palette comes from WordPress."),colors:o}),t&&t.length&&e.push({name:(0,_._x)("Custom","Indicates this palette comes from the theme."),colors:t}),e}),[o,n,t]);const l=fr("color.gradients.custom"),i=fr("color.gradients.theme"),a=fr("color.gradients.default"),s=fr("color.defaultGradients");return e.gradients=(0,u.useMemo)((()=>{const e=[];return i&&i.length&&e.push({name:(0,_._x)("Theme","Indicates this palette comes from the theme."),gradients:i}),s&&a&&a.length&&e.push({name:(0,_._x)("Default","Indicates this palette comes from WordPress."),gradients:a}),l&&l.length&&e.push({name:(0,_._x)("Custom","Indicates this palette is created by the user."),gradients:l}),e}),[l,i,a]),e}const pb="__experimentalBorder",mb=["top","right","bottom","left"],gb=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}}}},fb=(e,t,n)=>{let o;return e.some((e=>e.colors.some((e=>e[t]===n&&(o=e,!0))))),o},hb=e=>{let{colors:t,namedColor:n,customColor:o}=e;if(n){const e=fb(t,"slug",n);if(e)return e}if(!o)return{color:void 0};const r=fb(t,"color",o);return r||{color:o}};function vb(e){const t=/var:preset\|color\|(.+)/.exec(e);return t&&t[1]?t[1]:null}function bb(e){const{attributes:t,clientId:n,setAttributes:o}=e,{style:r}=t,{colors:l}=db(),i=kb(e.name),s=fr("border.color")&&kb(e.name,"color"),c=fr("border.radius")&&kb(e.name,"radius"),d=fr("border.style")&&kb(e.name,"style"),p=fr("border.width")&&kb(e.name,"width");if([!s,!c,!d,!p].every(Boolean)||!i)return null;const m=(0,a.getBlockSupport)(e.name,[pb,"__experimentalDefaultControls"]),g=(null==m?void 0:m.color)||(null==m?void 0:m.width),f=((e,t)=>{const{borderColor:n,style:o}=e,{border:r}=o||{};if(n){const{color:e}=hb({colors:t,namedColor:n});return e?{...r,color:e}:r}if(!r)return r;const l={...r};return mb.forEach((e=>{var n;const o=vb(null===(n=l[e])||void 0===n?void 0:n.color);if(o){const{color:n}=hb({colors:t,namedColor:o});l[e]={...l[e],color:n}}})),l})(t,l);return(0,u.createElement)(jr,{group:"border"},(p||s)&&(0,u.createElement)(h.__experimentalToolsPanelItem,{hasValue:()=>(e=>{const{borderColor:t,style:n}=e.attributes;return(0,h.__experimentalIsDefinedBorder)(null==n?void 0:n.border)||!!t})(e),label:(0,_.__)("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:g,resetAllFilter:gb,panelId:n},(0,u.createElement)(h.__experimentalBorderBoxControl,{colors:l,enableAlpha:!0,enableStyle:d,onChange:e=>{var t;let n,i={...e};if((0,h.__experimentalHasSplitBorders)(e))i={top:{...e.top},right:{...e.right},bottom:{...e.bottom},left:{...e.left}},mb.forEach((t=>{var n;if(null!==(n=e[t])&&void 0!==n&&n.color){var o;const n=hb({colors:l,customColor:null===(o=e[t])||void 0===o?void 0:o.color});n.slug&&(i[t].color=`var:preset|color|${n.slug}`)}}));else if(null!=e&&e.color){const t=null==e?void 0:e.color,o=hb({colors:l,customColor:t});o.slug&&(n=o.slug,i.color=void 0)}const a=Ar({...r,border:{radius:null==r||null===(t=r.border)||void 0===t?void 0:t.radius,...i}});o({style:a,borderColor:n})},popoverOffset:40,popoverPlacement:"left-start",size:"__unstable-large",value:f,__experimentalIsRenderedInSidebar:!0})),c&&(0,u.createElement)(h.__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,_.__)("Radius"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:_b(o,"radius")})}(e),isShownByDefault:null==m?void 0:m.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,u.createElement)(ab,e)))}function kb(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"any";if("web"!==u.Platform.OS)return!1;const n=(0,a.getBlockSupport)(e,pb);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 _b(e,t){return Ar({...e,border:{...null==e?void 0:e.border,[t]:void 0}})}function yb(e,t,n){if(!kb(t,"color")||Fr(t,pb,"color"))return e;const o=Eb(n),r=p()(e.className,o);return e.className=r||void 0,e}function Eb(e){var t;const{borderColor:n,style:o}=e,r=ub("border-color",n);return p()({"has-border-color":n||(null==o||null===(t=o.border)||void 0===t?void 0:t.color),[r]:!!r})}const Cb=(0,m.createHigherOrderComponent)((e=>t=>{var n,o,r,l,i,a,s,d,p;const{name:m,attributes:g}=t,{borderColor:f,style:h}=g,{colors:v}=db();if(!kb(m,"color")||Fr(m,pb,"color"))return(0,u.createElement)(e,t);const{color:b}=hb({colors:v,namedColor:f}),{color:k}=hb({colors:v,namedColor:vb(null==h||null===(n=h.border)||void 0===n||null===(o=n.top)||void 0===o?void 0:o.color)}),{color:_}=hb({colors:v,namedColor:vb(null==h||null===(r=h.border)||void 0===r||null===(l=r.right)||void 0===l?void 0:l.color)}),{color:y}=hb({colors:v,namedColor:vb(null==h||null===(i=h.border)||void 0===i||null===(a=i.bottom)||void 0===a?void 0:a.color)}),{color:E}=hb({colors:v,namedColor:vb(null==h||null===(s=h.border)||void 0===s||null===(d=s.left)||void 0===d?void 0:d.color)}),C={borderTopColor:k||b,borderRightColor:_||b,borderBottomColor:y||b,borderLeftColor:E||b};let S=t.wrapperProps;return S={...t.wrapperProps,style:{...null===(p=t.wrapperProps)||void 0===p?void 0:p.style,...C}},(0,u.createElement)(e,c({},t,{wrapperProps:S}))}));function Sb(e){if(e)return`has-${e}-gradient-background`}function wb(e,t){const n=null==e?void 0:e.find((e=>e.slug===t));return n&&n.gradient}function Bb(e,t){const n=null==e?void 0:e.find((e=>e.gradient===t));return n}function Ib(e,t){const n=Bb(e,t);return n&&n.slug}function xb(){let{gradientAttribute:e="gradient",customGradientAttribute:t="customGradient"}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{clientId:n}=Ro(),o=fr("color.gradients.custom"),r=fr("color.gradients.theme"),l=fr("color.gradients.default"),i=(0,u.useMemo)((()=>[...o||[],...r||[],...l||[]]),[o,r,l]),{gradient:a,customGradient:s}=(0,g.useSelect)((o=>{const{getBlockAttributes:r}=o(To),l=r(n)||{};return{customGradient:l[t],gradient:l[e]}}),[n,e,t]),{updateBlockAttributes:c}=(0,g.useDispatch)(To),d=(0,u.useCallback)((o=>{const r=Ib(i,o);c(n,r?{[e]:r,[t]:void 0}:{[e]:void 0,[t]:o})}),[i,n,c]),p=Sb(a);let m;return m=a?wb(i,a):s,{gradientClass:p,gradientValue:m,setGradient:d}}(0,s.addFilter)("blocks.registerBlockType","core/border/addAttributes",(function(e){return kb(e,"color")?e.attributes.borderColor?e:{...e,attributes:{...e.attributes,borderColor:{type:"string"}}}:e})),(0,s.addFilter)("blocks.getSaveContent.extraProps","core/border/addSaveProps",yb),(0,s.addFilter)("blocks.registerBlockType","core/border/addEditProps",(function(e){if(!kb(e,"color")||Fr(e,pb,"color"))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),yb(o,e,n)},e})),(0,s.addFilter)("editor.BlockListBlock","core/border/with-border-color-palette-styles",Cb);const Tb=["colors","disableCustomColors","gradients","disableCustomGradients"],Mb={name:"color",title:"Solid",value:"color"},Nb={name:"gradient",title:"Gradient",value:"gradient"},Pb=[Mb,Nb];function Lb(e){let{colors:t,gradients:n,disableCustomColors:o,disableCustomGradients:r,__experimentalIsRenderedInSidebar:l,className:i,label:a,onColorChange:s,onGradientChange:c,colorValue:d,gradientValue:m,clearable:g,showTitle:v=!0,enableAlpha:b}=e;const k=s&&(!(0,f.isEmpty)(t)||!o),_=c&&(!(0,f.isEmpty)(n)||!r);if(!k&&!_)return null;const y={[Mb.value]:(0,u.createElement)(h.ColorPalette,{value:d,onChange:_?e=>{s(e),c()}:s,colors:t,disableCustomColors:o,__experimentalIsRenderedInSidebar:l,clearable:g,enableAlpha:b}),[Nb.value]:(0,u.createElement)(h.GradientPicker,{__nextHasNoMargin:!0,value:m,onChange:k?e=>{c(e),s()}:c,gradients:n,disableCustomGradients:r,__experimentalIsRenderedInSidebar:l,clearable:g})},E=e=>(0,u.createElement)("div",{className:"block-editor-color-gradient-control__panel"},y[e]);return(0,u.createElement)(h.BaseControl,{__nextHasNoMarginBottom:!0,className:p()("block-editor-color-gradient-control",i)},(0,u.createElement)("fieldset",{className:"block-editor-color-gradient-control__fieldset"},(0,u.createElement)(h.__experimentalVStack,{spacing:1},v&&(0,u.createElement)("legend",null,(0,u.createElement)("div",{className:"block-editor-color-gradient-control__color-indicator"},(0,u.createElement)(h.BaseControl.VisualLabel,null,a))),k&&_&&(0,u.createElement)(h.TabPanel,{className:"block-editor-color-gradient-control__tabs",tabs:Pb,initialTabName:m?Nb.value:!!k&&Mb.value},(e=>E(e.value))),!_&&E(Mb.value),!k&&E(Nb.value))))}function Rb(e){const t={};return t.colors=fr("color.palette"),t.gradients=fr("color.gradients"),t.disableCustomColors=!fr("color.custom"),t.disableCustomGradients=!fr("color.customGradient"),(0,u.createElement)(Lb,c({},t,e))}var Ab=function(e){return Tb.every((t=>e.hasOwnProperty(t)))?(0,u.createElement)(Lb,e):(0,u.createElement)(Rb,e)};const Ob=e=>{let{setting:t,children:n,panelId:o,...r}=e;return(0,u.createElement)(h.__experimentalToolsPanelItem,c({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)},Db=e=>{let{colorValue:t,label:n}=e;return(0,u.createElement)(h.__experimentalHStack,{justify:"flex-start"},(0,u.createElement)(h.ColorIndicator,{className:"block-editor-panel-color-gradient-settings__color-indicator",colorValue:t}),(0,u.createElement)(h.FlexItem,{className:"block-editor-panel-color-gradient-settings__color-name",title:n},n))},zb=e=>t=>{let{onToggle:n,isOpen:o}=t;const{colorValue:r,label:l}=e,i={onClick:n,className:p()("block-editor-panel-color-gradient-settings__dropdown",{"is-open":o}),"aria-expanded":o};return(0,u.createElement)(h.Button,i,(0,u.createElement)(Db,{colorValue:r,label:l}))};function Fb(e){let t,{colors:n,disableCustomColors:o,disableCustomGradients:r,enableAlpha:l,gradients:i,settings:a,__experimentalIsRenderedInSidebar:s,...d}=e;return s&&(t={placement:"left-start",offset:36,shift:!0}),(0,u.createElement)(u.Fragment,null,a.map(((e,a)=>{var p;const m={clearable:!1,colorValue:e.colorValue,colors:n,disableCustomColors:o,disableCustomGradients:r,enableAlpha:l,gradientValue:e.gradientValue,gradients:i,label:e.label,onColorChange:e.onColorChange,onGradientChange:e.onGradientChange,showTitle:!1,__experimentalIsRenderedInSidebar:s,...e},g={colorValue:null!==(p=e.gradientValue)&&void 0!==p?p:e.colorValue,label:e.label};return e&&(0,u.createElement)(Ob,c({key:a,setting:e},d),(0,u.createElement)(h.Dropdown,{popoverProps:t,className:"block-editor-tools-panel-color-gradient-settings__dropdown",renderToggle:zb(g),renderContent:()=>(0,u.createElement)(h.__experimentalDropdownContentWrapper,{paddingSize:"none"},(0,u.createElement)("div",{className:"block-editor-panel-color-gradient-settings__dropdown-content"},(0,u.createElement)(Ab,m)))}))})))}fp([hp,kp]);var Vb=function(e){let{backgroundColor:t,fallbackBackgroundColor:n,fallbackTextColor:o,fallbackLinkColor:r,fontSize:l,isLargeText:i,textColor:a,linkColor:s,enableAlphaChecker:c=!1}=e;const d=t||n;if(!d)return null;const p=a||o,m=s||r;if(!p&&!m)return null;const g=[{color:p,description:(0,_.__)("text color")},{color:m,description:(0,_.__)("link color")}],f=mp(d),v=f.alpha()<1,b=f.brightness(),k={level:"AA",size:i||!1!==i&&l>=24?"large":"small"};let y="",E="";for(const e of g){if(!e.color)continue;const t=mp(e.color),n=t.isReadable(f,k),o=t.alpha()<1;if(!n){if(v||o)continue;y=bnull==e?void 0:e.colorValue));(0,u.useEffect)((()=>{var e;if(!r)return;if(!g.length)return l&&i(),a&&s(),void(d&&s());if(!m.current)return;s(Hb(m.current).color);const t=null===(e=m.current)||void 0===e?void 0:e.querySelector("a");t&&t.innerText&&p(Hb(t).color);let n=m.current,o=Hb(n).backgroundColor;for(;"rgba(0, 0, 0, 0)"===o&&n.parentNode&&n.parentNode.nodeType===n.parentNode.ELEMENT_NODE;)n=n.parentNode,o=Hb(n).backgroundColor;i(o)}));const f=db();return(0,u.createElement)(jr,{group:"color"},(0,u.createElement)(Fb,c({enableAlpha:t,panelId:o,settings:n,__experimentalIsItemGroup:!1,__experimentalIsRenderedInSidebar:!0},f)),r&&(0,u.createElement)(Vb,{backgroundColor:l,textColor:a,enableAlphaChecker:t,linkColor:d}))}const Ub="color",$b=e=>{const t=(0,a.getBlockSupport)(e,Ub);return t&&(!0===t.link||!0===t.gradient||!1!==t.background||!1!==t.text)},jb=e=>{if("web"!==u.Platform.OS)return!1;const t=(0,a.getBlockSupport)(e,Ub);return null!==t&&"object"==typeof t&&!!t.link},Wb=e=>{const t=(0,a.getBlockSupport)(e,Ub);return null!==t&&"object"==typeof t&&!!t.gradients},Kb=e=>{const t=(0,a.getBlockSupport)(e,Ub);return t&&!1!==t.background},qb=e=>{const t=(0,a.getBlockSupport)(e,Ub);return t&&!1!==t.text},Yb=(e,t)=>Ar(Dr(t,e,void 0)),Zb=e=>({textColor:void 0,style:Yb(["color","text"],e.style)}),Qb=e=>({style:Yb(["elements","link","color","text"],e.style)}),Xb=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 Jb(e,t,n){var o,r,l,i,a,s;if(!$b(t)||Fr(t,Ub))return e;const c=Wb(t),{backgroundColor:u,textColor:d,gradient:m,style:g}=n,f=e=>!Fr(t,Ub,e),h=f("text")?ub("color",d):void 0,v=f("gradients")?Sb(m):void 0,b=f("background")?ub("background-color",u):void 0,k=f("background")||f("gradients"),_=u||(null==g||null===(o=g.color)||void 0===o?void 0:o.background)||c&&(m||(null==g||null===(r=g.color)||void 0===r?void 0:r.gradient)),y=p()(e.className,h,v,{[b]:!(c&&null!=g&&null!==(l=g.color)&&void 0!==l&&l.gradient||!b),"has-text-color":f("text")&&(d||(null==g||null===(i=g.color)||void 0===i?void 0:i.text)),"has-background":k&&_,"has-link-color":f("link")&&(null==g||null===(a=g.elements)||void 0===a||null===(s=a.link)||void 0===s?void 0:s.color)});return e.className=y||void 0,e}const ek=(e,t)=>{const n=/var:preset\|color\|(.+)/.exec(t);return n&&n[1]?sb(e,n[1]).color:t};function tk(e){var t,n,o,r,l,i;const{name:s,attributes:c}=e,d=fr("color.palette.custom"),p=fr("color.palette.theme"),m=fr("color.palette.default"),g=(0,u.useMemo)((()=>[...d||[],...p||[],...m||[]]),[d,p,m]),f=fr("color.gradients.custom"),h=fr("color.gradients.theme"),v=fr("color.gradients.default"),b=(0,u.useMemo)((()=>[...f||[],...h||[],...v||[]]),[f,h,v]),k=fr("color.custom"),y=fr("color.customGradient"),E=fr("color.background"),C=fr("color.link"),S=fr("color.text"),w=k||!p||(null==p?void 0:p.length)>0,B=y||!h||(null==h?void 0:h.length)>0,I=(0,u.useRef)(c);if((0,u.useEffect)((()=>{I.current=c}),[c]),!$b(s))return null;const x=jb(s)&&C&&w,T=qb(s)&&S&&w,M=Kb(s)&&E&&w,N=Wb(s)&&B;if(!(x||T||M||N))return null;const{style:P,textColor:L,backgroundColor:R,gradient:A}=c;let O;if(N&&A)O=wb(b,A);else if(N){var D;O=null==P||null===(D=P.color)||void 0===D?void 0:D.gradient}const z=t=>n=>{var o,r;const l=cb(g,n),i=t+"Color",a={...I.current.style,color:{...null===(o=I.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),I.current={...I.current,...c}},F=(0,a.getBlockSupport)(e.name,[Ub,"__experimentalDefaultControls"]),V="web"===u.Platform.OS&&!A&&!(null!=P&&null!==(t=P.color)&&void 0!==t&&t.gradient)&&M&&(x||T)&&!1!==(0,a.getBlockSupport)(e.name,[Ub,"enableContrastChecker"]);return(0,u.createElement)(Gb,{enableContrastChecking:V,clientId:e.clientId,enableAlpha:!0,settings:[...T?[{label:(0,_.__)("Text"),onColorChange:z("text"),colorValue:sb(g,L,null==P||null===(n=P.color)||void 0===n?void 0:n.text).color,isShownByDefault:null==F?void 0:F.text,resetAllFilter:Zb}]:[],...M||N?[{label:(0,_.__)("Background"),onColorChange:M?z("background"):void 0,colorValue:sb(g,R,null==P||null===(o=P.color)||void 0===o?void 0:o.background).color,gradientValue:O,onGradientChange:N?t=>{const n=Ib(b,t);let o;if(n){var r,l,i;const e={...null===(r=I.current)||void 0===r?void 0:r.style,color:{...null===(l=I.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=I.current)||void 0===a?void 0:a.style,color:{...null===(s=I.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),I.current={...I.current,...o}}:void 0,isShownByDefault:null==F?void 0:F.background,resetAllFilter:Xb}]:[],...x?[{label:(0,_.__)("Link"),onColorChange:t=>{var n;const o=cb(g,t),r=null!=o&&o.slug?`var:preset|color|${o.slug}`:t,l=Ar(Dr(null===(n=I.current)||void 0===n?void 0:n.style,["elements","link","color","text"],r));e.setAttributes({style:l}),I.current={...I.current,style:l}},colorValue:ek(g,null==P||null===(r=P.elements)||void 0===r||null===(l=r.link)||void 0===l||null===(i=l.color)||void 0===i?void 0:i.text),isShownByDefault:null==F?void 0:F.link,resetAllFilter:Qb}]:[]]})}const nk=(0,m.createHigherOrderComponent)((e=>t=>{var n;const{name:o,attributes:r}=t,{backgroundColor:l,textColor:i}=r,a=fr("color.palette.custom"),s=fr("color.palette.theme"),d=fr("color.palette.default"),p=(0,u.useMemo)((()=>[...a||[],...s||[],...d||[]]),[a,s,d]);if(!$b(o)||Fr(o,Ub))return(0,u.createElement)(e,t);const m={};var g,f;i&&!Fr(o,Ub,"text")&&(m.color=null===(g=sb(p,i))||void 0===g?void 0:g.color);l&&!Fr(o,Ub,"background")&&(m.backgroundColor=null===(f=sb(p,l))||void 0===f?void 0:f.color);let h=t.wrapperProps;return h={...t.wrapperProps,style:{...m,...null===(n=t.wrapperProps)||void 0===n?void 0:n.style}},(0,u.createElement)(e,c({},t,{wrapperProps:h}))})),ok={linkColor:[["style","elements","link","color","text"]],textColor:[["textColor"],["style","color","text"]],backgroundColor:[["backgroundColor"],["style","color","background"]],gradient:[["gradient"],["style","color","gradient"]]};(0,s.addFilter)("blocks.registerBlockType","core/color/addAttribute",(function(e){return $b(e)?(e.attributes.backgroundColor||Object.assign(e.attributes,{backgroundColor:{type:"string"}}),e.attributes.textColor||Object.assign(e.attributes,{textColor:{type:"string"}}),Wb(e)&&!e.attributes.gradient&&Object.assign(e.attributes,{gradient:{type:"string"}}),e):e})),(0,s.addFilter)("blocks.getSaveContent.extraProps","core/color/addSaveProps",Jb),(0,s.addFilter)("blocks.registerBlockType","core/color/addEditProps",(function(e){if(!$b(e)||Fr(e,Ub))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),Jb(o,e,n)},e})),(0,s.addFilter)("editor.BlockListBlock","core/color/with-color-palette-styles",nk),(0,s.addFilter)("blocks.switchToBlockType.transformedBlock","core/color/addTransforms",(function(e,t,n,o){const r=e.name;return zr({linkColor:jb(r),textColor:qb(r),backgroundColor:Kb(r),gradient:Wb(r)},ok,e,t,n,o)}));const rk=[{name:(0,_._x)("Regular","font style"),value:"normal"},{name:(0,_._x)("Italic","font style"),value:"italic"}],lk=[{name:(0,_._x)("Thin","font weight"),value:"100"},{name:(0,_._x)("Extra Light","font weight"),value:"200"},{name:(0,_._x)("Light","font weight"),value:"300"},{name:(0,_._x)("Regular","font weight"),value:"400"},{name:(0,_._x)("Medium","font weight"),value:"500"},{name:(0,_._x)("Semi Bold","font weight"),value:"600"},{name:(0,_._x)("Bold","font weight"),value:"700"},{name:(0,_._x)("Extra Bold","font weight"),value:"800"},{name:(0,_._x)("Black","font weight"),value:"900"}],ik=(e,t)=>e?t?(0,_.__)("Appearance"):(0,_.__)("Font style"):(0,_.__)("Font weight");function ak(e){const{onChange:t,hasFontStyles:n=!0,hasFontWeights:o=!0,value:{fontStyle:r,fontWeight:l},...i}=e,a=n||o,s=ik(n,o),d={key:"default",name:(0,_.__)("Default"),style:{fontStyle:void 0,fontWeight:void 0}},p=(0,u.useMemo)((()=>n&&o?(()=>{const e=[d];return rk.forEach((t=>{let{name:n,value:o}=t;lk.forEach((t=>{let{name:r,value:l}=t;const i="normal"===o?r:(0,_.sprintf)((0,_.__)("%1$s %2$s"),r,n);e.push({key:`${o}-${l}`,name:i,style:{fontStyle:o,fontWeight:l}})}))})),e})():n?(()=>{const e=[d];return rk.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 lk.forEach((t=>{let{name:n,value:o}=t;e.push({key:o,name:n,style:{fontStyle:void 0,fontWeight:o}})})),e})()),[e.options]),m=p.find((e=>e.style.fontStyle===r&&e.style.fontWeight===l))||p[0];return a&&(0,u.createElement)(h.CustomSelectControl,c({},i,{className:"components-font-appearance-control",label:s,describedBy:m?n?o?(0,_.sprintf)((0,_.__)("Currently selected font appearance: %s"),m.name):(0,_.sprintf)((0,_.__)("Currently selected font style: %s"),m.name):(0,_.sprintf)((0,_.__)("Currently selected font weight: %s"),m.name):(0,_.__)("No selected font appearance"),options:p,value:m,onChange:e=>{let{selectedItem:n}=e;return t(n.style)},__nextUnconstrainedWidth:!0}))}const sk=1.5,ck=.1;var uk=e=>{let{value:t,onChange:n,__nextHasNoMarginBottom:o=!1,__unstableInputWidth:r="60px",...l}=e;const i=function(e){return void 0!==e&&""!==e}(t),a=i?t:"";o||W()("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 s=o?void 0:{marginBottom:24};return(0,u.createElement)("div",{className:"block-editor-line-height-control",style:s},(0,u.createElement)(h.__experimentalNumberControl,c({},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(i)return e;switch(`${e}`){case"0.1":return 1.6;case"0":return t?e:1.4;case"":return sk;default:return e}})(e.value,o);return{...e,value:r}},onChange:n,label:(0,_.__)("Line height"),placeholder:sk,step:ck,value:a,min:0,spinControls:"custom"})))};const dk="typography.lineHeight";function pk(e){var t;const{attributes:{style:n},setAttributes:o}=e;return(0,u.createElement)(uk,{__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 mk(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!fr("typography.lineHeight");return!(0,a.hasBlockSupport)(e,dk)||t}const gk="typography.__experimentalFontStyle",fk="typography.__experimentalFontWeight";function hk(e){var t,n;const{attributes:{style:o},setAttributes:r}=e,l=!vk(e),i=!bk(e),a=null==o||null===(t=o.typography)||void 0===t?void 0:t.fontStyle,s=null==o||null===(n=o.typography)||void 0===n?void 0:n.fontWeight;return(0,u.createElement)(ak,{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:a,fontWeight:s},size:"__unstable-large"})}function vk(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=(0,a.hasBlockSupport)(e,gk),n=fr("typography.fontStyle");return!t||!n}function bk(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=(0,a.hasBlockSupport)(e,fk),n=fr("typography.fontWeight");return!t||!n}function kk(e){const t=vk(e),n=bk(e);return t&&n}function _k(e){let{value:t="",onChange:n,fontFamilies:o,...r}=e;const l=fr("typography.fontFamilies");if(o||(o=l),!o||0===o.length)return null;const i=[{value:"",label:(0,_.__)("Default")},...o.map((e=>{let{fontFamily:t,name:n}=e;return{value:t,label:n||t}}))];return(0,u.createElement)(h.SelectControl,c({label:(0,_.__)("Font"),options:i,value:t,onChange:n,labelPosition:"top"},r))}const yk="typography.__experimentalFontFamily";function Ek(e,t,n){if(!(0,a.hasBlockSupport)(t,yk))return e;if(Fr(t,s_,"fontFamily"))return e;if(null==n||!n.fontFamily)return e;const o=new(Df())(e.className);o.add(`has-${(0,f.kebabCase)(null==n?void 0:n.fontFamily)}-font-family`);const r=o.value;return e.className=r||void 0,e}function Ck(e){var t;let{setAttributes:n,attributes:{fontFamily:o}}=e;const r=fr("typography.fontFamilies"),l=null==r||null===(t=r.find((e=>{let{slug:t}=e;return o===t})))||void 0===t?void 0:t.fontFamily;return(0,u.createElement)(_k,{className:"block-editor-hooks-font-family-control",fontFamilies:r,value:l,onChange:function(e){const t=null==r?void 0:r.find((t=>{let{fontFamily:n}=t;return n===e}));n({fontFamily:null==t?void 0:t.slug})},size:"__unstable-large",__nextHasNoMarginBottom:!0})}function Sk(e){let{name:t}=e;const n=fr("typography.fontFamilies");return!n||0===n.length||!(0,a.hasBlockSupport)(t,yk)}(0,s.addFilter)("blocks.registerBlockType","core/fontFamily/addAttribute",(function(e){return(0,a.hasBlockSupport)(e,yk)?(e.attributes.fontFamily||Object.assign(e.attributes,{fontFamily:{type:"string"}}),e):e})),(0,s.addFilter)("blocks.getSaveContent.extraProps","core/fontFamily/addSaveProps",Ek),(0,s.addFilter)("blocks.registerBlockType","core/fontFamily/addEditProps",(function(e){if(!(0,a.hasBlockSupport)(e,yk))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),Ek(o,e,n)},e}));const wk=(e,t,n)=>{if(t){const n=null==e?void 0:e.find((e=>{let{slug:n}=e;return n===t}));if(n)return n}return{size:n}};function Bk(e,t){const n=null==e?void 0:e.find((e=>{let{size:n}=e;return n===t}));return n||{size:t}}function Ik(e){if(e)return`has-${(0,f.kebabCase)(e)}-font-size`}var xk=function(e){const t=fr("typography.fontSizes"),n=!fr("typography.customFontSize");return(0,u.createElement)(h.FontSizePicker,c({},e,{fontSizes:t,disableCustomFontSizes:n}))};const Tk="1600px",Mk="768px",Nk=1,Pk=.75;function Lk(e){let{minimumFontSize:t,maximumFontSize:n,fontSize:o,minimumViewPortWidth:r=Mk,maximumViewPortWidth:l=Tk,scaleFactor:i=Nk,minimumFontSizeFactor:a=Pk,minimumFontSizeLimit:s}=e;if(s=Rk(s)?s:"14px",o){const e=Rk(o);if(null==e||!e.unit)return null;const r=Rk(s,{coerceTo:e.unit});if(null!=r&&r.value&&!t&&!n&&(null==e?void 0:e.value)<=(null==r?void 0:r.value))return null;if(n||(n=`${e.value}${e.unit}`),!t){const n=Ak(e.value*a,3);t=null!=r&&r.value&&n<(null==r?void 0:r.value)?`${r.value}${r.unit}`:`${n}${e.unit}`}}const c=Rk(t),u=(null==c?void 0:c.unit)||"rem",d=Rk(n,{coerceTo:u});if(!c||!d)return null;const p=Rk(t,{coerceTo:"rem"}),m=Rk(l,{coerceTo:u}),g=Rk(r,{coerceTo:u});if(!m||!g||!p)return null;const f=Ak(g.value/100,3),h=Ak(f,3)+u,v=Ak(((d.value-c.value)/(m.value-g.value)*100||1)*i,3);return`clamp(${t}, ${`${p.value}${p.unit} + ((1vw - ${h}) * ${v})`}, ${n})`}function Rk(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if("string"!=typeof e&&"number"!=typeof e)return null;isFinite(e)&&(e=`${e}px`);const{coerceTo:n,rootSizeValue:o,acceptableUnits:r}={coerceTo:"",rootSizeValue:16,acceptableUnits:["rem","px","em"],...t},l=null==r?void 0:r.join("|"),i=new RegExp(`^(\\d*\\.?\\d+)(${l}){1,1}$`),a=e.match(i);if(!a||a.length<3)return null;let[,s,c]=a,u=parseFloat(s);return"px"!==n||"em"!==c&&"rem"!==c||(u*=o,c=n),"px"!==c||"em"!==n&&"rem"!==n||(u/=o,c=n),"em"!==n&&"rem"!==n||"em"!==c&&"rem"!==c||(c=n),{value:Ak(u,3),unit:c}}function Ak(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3;const n=Math.pow(10,t);return Number.isFinite(e)?parseFloat(Math.round(e*n)/n):void 0}const Ok="typography.fontSize";function Dk(e,t,n){if(!(0,a.hasBlockSupport)(t,Ok))return e;if(Fr(t,s_,"fontSize"))return e;const o=new(Df())(e.className);o.add(Ik(n.fontSize));const r=o.value;return e.className=r||void 0,e}function zk(e){var t,n;const{attributes:{fontSize:o,style:r},setAttributes:l}=e,i=fr("typography.fontSizes"),a=wk(i,o,null==r||null===(t=r.typography)||void 0===t?void 0:t.fontSize),s=(null==a?void 0:a.size)||(null==r||null===(n=r.typography)||void 0===n?void 0:n.fontSize)||o;return(0,u.createElement)(xk,{onChange:e=>{const t=Bk(i,e).slug;l({style:Ar({...r,typography:{...null==r?void 0:r.typography,fontSize:t?void 0:e}}),fontSize:t})},value:s,withReset:!1,withSlider:!0,size:"__unstable-large",__nextHasNoMarginBottom:!0})}function Fk(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=fr("typography.fontSizes"),n=!(null==t||!t.length);return!(0,a.hasBlockSupport)(e,Ok)||!n}const Vk=(0,m.createHigherOrderComponent)((e=>t=>{var n,o;const r=fr("typography.fontSizes"),{name:l,attributes:{fontSize:i,style:s},wrapperProps:c}=t;if(!(0,a.hasBlockSupport)(l,Ok)||Fr(l,s_,"fontSize")||!i||null!=s&&null!==(n=s.typography)&&void 0!==n&&n.fontSize)return(0,u.createElement)(e,t);const d=wk(r,i,null==s||null===(o=s.typography)||void 0===o?void 0:o.fontSize).size,p={...t,wrapperProps:{...c,style:{fontSize:d,...null==c?void 0:c.style}}};return(0,u.createElement)(e,p)}),"withFontSizeInlineStyles"),Hk={fontSize:[["fontSize"],["style","typography","fontSize"]]};(0,s.addFilter)("blocks.registerBlockType","core/font/addAttribute",(function(e){return(0,a.hasBlockSupport)(e,Ok)?(e.attributes.fontSize||Object.assign(e.attributes,{fontSize:{type:"string"}}),e):e})),(0,s.addFilter)("blocks.getSaveContent.extraProps","core/font/addSaveProps",Dk),(0,s.addFilter)("blocks.registerBlockType","core/font/addEditProps",(function(e){if(!(0,a.hasBlockSupport)(e,Ok))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),Dk(o,e,n)},e})),(0,s.addFilter)("editor.BlockListBlock","core/font-size/with-font-size-inline-styles",Vk),(0,s.addFilter)("blocks.switchToBlockType.transformedBlock","core/font-size/addTransforms",(function(e,t,n,o){const r=e.name;return zr({fontSize:(0,a.hasBlockSupport)(r,Ok)},Hk,e,t,n,o)})),(0,s.addFilter)("blocks.registerBlockType","core/font-size/addEditPropsForFluidCustomFontSizes",(function(e){if(!(0,a.hasBlockSupport)(e,Ok)||Fr(e,s_,"fontSize"))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=e=>{var n,o,r;const l=t?t(e):{},i=null==l||null===(n=l.style)||void 0===n?void 0:n.fontSize,a=null===(o=(0,g.select)(To).getSettings().__experimentalFeatures)||void 0===o||null===(r=o.typography)||void 0===r?void 0:r.fluid,s="object"==typeof a?a:{},c=i&&a?Lk({fontSize:i,minimumFontSizeLimit:null==s?void 0:s.minFontSize}):null;return null===c?l:{...l,style:{...null==l?void 0:l.style,fontSize:c}}},e}),11);var Gk=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"M7 11.5h10V13H7z"}));var Uk=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.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 $k=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.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 jk=[{name:(0,_.__)("None"),value:"none",icon:Gk},{name:(0,_.__)("Underline"),value:"underline",icon:Uk},{name:(0,_.__)("Strikethrough"),value:"line-through",icon:$k}];function Wk(e){let{value:t,onChange:n,className:o}=e;return(0,u.createElement)("fieldset",{className:p()("block-editor-text-decoration-control",o)},(0,u.createElement)(h.BaseControl.VisualLabel,{as:"legend"},(0,_.__)("Decoration")),(0,u.createElement)("div",{className:"block-editor-text-decoration-control__buttons"},jk.map((e=>(0,u.createElement)(h.Button,{key:e.value,icon:e.icon,label:e.name,isPressed:e.value===t,onClick:()=>{n(e.value===t?void 0:e.value)}})))))}const Kk="typography.__experimentalTextDecoration";function qk(e){var t;const{attributes:{style:n},setAttributes:o}=e;return(0,u.createElement)(Wk,{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 Yk(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!(0,a.hasBlockSupport)(e,Kk),n=fr("typography.textDecoration");return t||!n}var Zk=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.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 Qk=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.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 Xk=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.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 Jk=[{name:(0,_.__)("None"),value:"none",icon:Gk},{name:(0,_.__)("Uppercase"),value:"uppercase",icon:Zk},{name:(0,_.__)("Lowercase"),value:"lowercase",icon:Qk},{name:(0,_.__)("Capitalize"),value:"capitalize",icon:Xk}];function e_(e){let{className:t,value:n,onChange:o}=e;return(0,u.createElement)("fieldset",{className:p()("block-editor-text-transform-control",t)},(0,u.createElement)(h.BaseControl.VisualLabel,{as:"legend"},(0,_.__)("Letter case")),(0,u.createElement)("div",{className:"block-editor-text-transform-control__buttons"},Jk.map((e=>(0,u.createElement)(h.Button,{key:e.value,icon:e.icon,label:e.name,isPressed:e.value===n,onClick:()=>{o(e.value===n?void 0:e.value)}})))))}const t_="typography.__experimentalTextTransform";function n_(e){var t;const{attributes:{style:n},setAttributes:o}=e;return(0,u.createElement)(e_,{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 o_(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!(0,a.hasBlockSupport)(e,t_),n=fr("typography.textTransform");return t||!n}function r_(e){let{value:t,onChange:n,__unstableInputWidth:o="60px",...r}=e;const l=(0,h.__experimentalUseCustomUnits)({availableUnits:fr("spacing.units")||["px","em","rem"],defaultValues:{px:2,em:.2,rem:.2}});return(0,u.createElement)(h.__experimentalUnitControl,c({},r,{label:(0,_.__)("Letter spacing"),value:t,__unstableInputWidth:o,units:l,onChange:n}))}const l_="typography.__experimentalLetterSpacing";function i_(e){var t;const{attributes:{style:n},setAttributes:o}=e;return(0,u.createElement)(r_,{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 a_(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!(0,a.hasBlockSupport)(e,l_),n=fr("typography.letterSpacing");return t||!n}const s_="typography",c_=[dk,Ok,gk,fk,yk,Kk,t_,l_];function u_(e){const{clientId:t}=e,n=Sk(e),o=Fk(e),r=kk(e),l=mk(e),i=Yk(e),s=o_(e),c=a_(e),d=!vk(e),p=!bk(e),m=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=[kk(e),Fk(e),mk(e),Sk(e),Yk(e),o_(e),a_(e)];return t.filter(Boolean).length===t.length}(e),g=d_(e.name);if(m||!g)return null;const f=(0,a.getBlockSupport)(e.name,[s_,"__experimentalDefaultControls"]),v=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,u.createElement)(jr,{group:"typography"},!n&&(0,u.createElement)(h.__experimentalToolsPanelItem,{hasValue:()=>function(e){return!!e.attributes.fontFamily}(e),label:(0,_.__)("Font family"),onDeselect:()=>function(e){let{setAttributes:t}=e;t({fontFamily:void 0})}(e),isShownByDefault:null==f?void 0:f.fontFamily,resetAllFilter:e=>({...e,fontFamily:void 0}),panelId:t},(0,u.createElement)(Ck,e)),!o&&(0,u.createElement)(h.__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,_.__)("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==f?void 0:f.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,u.createElement)(zk,e)),!r&&(0,u.createElement)(h.__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:ik(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==f?void 0:f.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,u.createElement)(hk,e)),!l&&(0,u.createElement)(h.__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,_.__)("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==f?void 0:f.lineHeight,resetAllFilter:v("lineHeight"),panelId:t},(0,u.createElement)(pk,e)),!c&&(0,u.createElement)(h.__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,_.__)("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==f?void 0:f.letterSpacing,resetAllFilter:v("letterSpacing"),panelId:t},(0,u.createElement)(i_,e)),!i&&(0,u.createElement)(h.__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,_.__)("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==f?void 0:f.textDecoration,resetAllFilter:v("textDecoration"),panelId:t},(0,u.createElement)(qk,e)),!s&&(0,u.createElement)(h.__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,_.__)("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==f?void 0:f.textTransform,resetAllFilter:v("textTransform"),panelId:t},(0,u.createElement)(n_,e)))}const d_=e=>c_.some((t=>(0,a.hasBlockSupport)(e,t)));const p_=[...c_,pb,Ub,fl,hl],m_=e=>p_.some((t=>(0,a.hasBlockSupport)(e,t)));function g_(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t={};return(0,ni.getCSSRules)(e).forEach((e=>{t[e.key]=e.value})),t}const f_={"__experimentalBorder.__experimentalSkipSerialization":["border"],"color.__experimentalSkipSerialization":[Ub],[`${s_}.__experimentalSkipSerialization`]:[s_],[`${fl}.__experimentalSkipSerialization`]:[fl],[`${hl}.__experimentalSkipSerialization`]:[hl]},h_={...f_,[`${hl}`]:["spacing.blockGap"]},v_={gradients:"gradient"};function b_(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(!e)return e;let o=e;return n||(o=JSON.parse(JSON.stringify(e))),Array.isArray(t)||(t=[t]),t.forEach((e=>{if(Array.isArray(e)||(e=e.split(".")),e.length>1){const[t,...n]=e;b_(o[t],[n],!0)}else 1===e.length&&delete o[e[0]]})),o}function k_(e,t,n){let o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:h_;if(!m_(t))return e;let{style:r}=n;return Object.entries(o).forEach((e=>{let[n,o]=e;const l=(0,a.getBlockSupport)(t,n);!0===l&&(r=b_(r,o)),Array.isArray(l)&&l.forEach((e=>{const t=v_[e]||e;r=b_(r,[[...o,t]])}))})),e.style={...g_(r),...e.style},e}const __=(0,m.createHigherOrderComponent)((e=>t=>{const n=Ao();return(0,u.createElement)(u.Fragment,null,n&&(0,u.createElement)(u.Fragment,null,(0,u.createElement)(tk,t),(0,u.createElement)(u_,t),(0,u.createElement)(bb,t),(0,u.createElement)(_l,t)),(0,u.createElement)(e,t))}),"withToolbarControls"),y_=(0,m.createHigherOrderComponent)((e=>t=>{var n,o;const r=`wp-elements-${(0,m.useInstanceId)(e)}`,l=Fr(t.name,Ub,"link"),i=(0,u.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:l||null===(i=n.link)||void 0===i?void 0:i.color}};for(const[t,n]of Object.entries(e)){const e=(0,ni.compileCSS)(n,{selector:`.editor-styles-wrapper .${r} ${a.__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]),s=(0,u.useContext)(Wv.__unstableElementContext);return(0,u.createElement)(u.Fragment,null,i&&s&&(0,u.createPortal)((0,u.createElement)("style",{dangerouslySetInnerHTML:{__html:i}}),s),(0,u.createElement)(e,c({},t,{className:null!==(o=t.attributes.style)&&void 0!==o&&o.elements?p()(t.className,r):t.className})))}));(0,s.addFilter)("blocks.registerBlockType","core/style/addAttribute",(function(e){return m_(e)?(e.attributes.style||Object.assign(e.attributes,{style:{type:"object"}}),e):e})),(0,s.addFilter)("blocks.getSaveContent.extraProps","core/style/addSaveProps",k_),(0,s.addFilter)("blocks.registerBlockType","core/style/addEditProps",(function(e){if(!m_(e))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),k_(o,e,n,f_)},e})),(0,s.addFilter)("editor.BlockEdit","core/style/with-block-controls",__),(0,s.addFilter)("editor.BlockListBlock","core/editor/with-elements-styles",y_);(0,s.addFilter)("blocks.registerBlockType","core/settings/addAttribute",(function(e){var t,n;return n=e,(0,a.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 E_=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"M12 4 4 19h16L12 4zm0 3.2 5.5 10.3H12V7.2z"}));var C_=function(e){let t,{colorPalette:n,duotonePalette:o,disableCustomColors:r,disableCustomDuotone:l,value:i,onChange:a}=e;return t="unset"===i?(0,u.createElement)(h.ColorIndicator,{className:"block-editor-duotone-control__unset-indicator"}):i?(0,u.createElement)(h.DuotoneSwatch,{values:i}):(0,u.createElement)(Jl,{icon:E_}),(0,u.createElement)(h.Dropdown,{popoverProps:{className:"block-editor-duotone-control__popover",headerTitle:(0,_.__)("Duotone"),variant:"toolbar"},renderToggle:e=>{let{isOpen:n,onToggle:o}=e;return(0,u.createElement)(h.ToolbarButton,{showTooltip:!0,onClick:o,"aria-haspopup":"true","aria-expanded":n,onKeyDown:e=>{n||e.keyCode!==Qu.DOWN||(e.preventDefault(),o())},label:(0,_.__)("Apply duotone filter"),icon:t})},renderContent:()=>(0,u.createElement)(h.MenuGroup,{label:(0,_.__)("Duotone")},(0,u.createElement)("div",{className:"block-editor-duotone-control__description"},(0,_.__)("Create a two-tone color effect without losing your original image.")),(0,u.createElement)(h.DuotonePicker,{colorPalette:n,duotonePalette:o,disableCustomColors:r,disableCustomDuotone:l,value:i,onChange:a}))})};const S_=[];function w_(e){let{selector:t,id:n,colors:o}=e;return"unset"===o?(0,u.createElement)(Wp,{selector:t}):(0,u.createElement)(u.Fragment,null,(0,u.createElement)(Kp,{id:n,colors:o}),(0,u.createElement)(jp,{id:n,selector:t}))}function B_(e){let{presetSetting:t,defaultSetting:n}=e;const o=!fr(n),r=fr(`${t}.custom`)||S_,l=fr(`${t}.theme`)||S_,i=fr(`${t}.default`)||S_;return(0,u.useMemo)((()=>[...r,...l,...o?S_:i]),[o,r,l,i])}function I_(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=B_({presetSetting:"color.duotone",defaultSetting:"color.defaultDuotone"}),a=B_({presetSetting:"color.palette",defaultSetting:"color.defaultPalette"}),s=!fr("color.custom"),c=!fr("color.customDuotone")||0===(null==a?void 0:a.length)&&s;return 0===(null==i?void 0:i.length)&&c?null:(0,u.createElement)(Vo,{group:"block",__experimentalShareWithChildBlocks:!0},(0,u.createElement)(C_,{duotonePalette:i,colorPalette:a,disableCustomDuotone:c,disableCustomColors:s,value:l,onChange:e=>{const t={...r,color:{...null==r?void 0:r.color,duotone:e}};o({style:t})}}))}fp([hp]);const x_=(0,m.createHigherOrderComponent)((e=>t=>{const n=(0,a.hasBlockSupport)(t.name,"color.__experimentalDuotone"),o=(0,g.useSelect)((e=>e(To).__unstableGetContentLockingParent(t.clientId)),[t.clientId]);return(0,u.createElement)(u.Fragment,null,(0,u.createElement)(e,t),n&&!o&&(0,u.createElement)(I_,t))}),"withDuotoneControls");const T_=(0,m.createHigherOrderComponent)((e=>t=>{var n,o,r;const l=(0,a.getBlockSupport)(t.name,"color.__experimentalDuotone"),i=null==t||null===(n=t.attributes)||void 0===n||null===(o=n.style)||void 0===o||null===(r=o.color)||void 0===r?void 0:r.duotone;if(!l||!i)return(0,u.createElement)(e,t);const s=`wp-duotone-${(0,m.useInstanceId)(e)}`,d=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 .${s}`,l),g=p()(null==t?void 0:t.className,s),f=(0,u.useContext)(Wv.__unstableElementContext);return(0,u.createElement)(u.Fragment,null,f&&(0,u.createPortal)((0,u.createElement)(w_,{selector:d,id:s,colors:i}),f),(0,u.createElement)(e,c({},t,{className:g})))}),"withDuotoneStyles");(0,s.addFilter)("blocks.registerBlockType","core/editor/duotone/add-attributes",(function(e){return(0,a.hasBlockSupport)(e,"color.__experimentalDuotone")?(e.attributes.style||Object.assign(e.attributes,{style:{type:"object"}}),e):e})),(0,s.addFilter)("editor.BlockEdit","core/editor/duotone/with-editor-controls",x_),(0,s.addFilter)("editor.BlockListBlock","core/editor/duotone/with-styles",T_);const M_="__experimentalLayout";function N_(){var e,t;let n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const o=(0,g.useSelect)((e=>{var t;const{getSettings:n}=e(To);return null===(t=n().__experimentalFeatures)||void 0===t?void 0:t.useRootPaddingAwareAlignments}),[]),r=fr("layout")||{},{attributes:l={},name:i}=n,{layout:s}=l,{default:c}=(0,a.getBlockSupport)(i,M_)||{},u=null!=s&&s.inherit||null!=s&&s.contentSize||null!=s&&s.wideSize?{...s,type:"constrained"}:s||c||{},d=[];var p,m;null!=r&&null!==(e=r.definitions)&&void 0!==e&&null!==(t=e[(null==u?void 0:u.type)||"default"])&&void 0!==t&&t.className&&d.push(null==r||null===(p=r.definitions)||void 0===p||null===(m=p[(null==u?void 0:u.type)||"default"])||void 0===m?void 0:m.className);return(null!=u&&u.inherit||null!=u&&u.contentSize||"constrained"===(null==u?void 0:u.type))&&o&&d.push("has-global-padding"),null!=u&&u.orientation&&d.push(`is-${(0,f.kebabCase)(u.orientation)}`),null!=u&&u.justifyContent&&d.push(`is-content-justification-${(0,f.kebabCase)(u.justifyContent)}`),null!=u&&u.flexWrap&&"nowrap"===u.flexWrap&&d.push("is-nowrap"),d}function P_(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;const{attributes:o={},name:r}=t,{layout:l={},style:i={}}=o,a=null!=l&&l.inherit||null!=l&&l.contentSize||null!=l&&l.wideSize?{...l,type:"constrained"}:l||{},s=li((null==a?void 0:a.type)||"default"),c=fr("layout")||{},u=fr("spacing.blockGap"),d=null!==u,p=null==s||null===(e=s.getLayoutStyle)||void 0===e?void 0:e.call(s,{blockName:r,selector:n,layout:l,layoutDefinitions:null==c?void 0:c.definitions,style:i,hasBlockGapSupport:d});return p}function L_(e){let{setAttributes:t,attributes:n,name:o}=e;const{layout:r}=n,l=fr("layout"),i=(0,g.useSelect)((e=>{const{getSettings:t}=e(To);return t().supportsLayout}),[]),s=(0,a.getBlockSupport)(o,M_,{}),{allowSwitching:c,allowEditing:d=!0,allowInheriting:p=!0,default:m}=s;if(!d)return null;const f=!(!p||!l||null!=r&&r.type&&"default"!==(null==r?void 0:r.type)&&"constrained"!==(null==r?void 0:r.type)&&(null==r||!r.inherit)),v=r||m||{},{inherit:b=!1,type:k="default",contentSize:y=null}=v;if(("default"===k||"constrained"===k)&&!i)return null;const E=li(k),C=li("constrained"),S=!v.type&&(y||b),w=!!b||!!y,B=e=>t({layout:e});return(0,u.createElement)(u.Fragment,null,(0,u.createElement)(jr,null,(0,u.createElement)(h.PanelBody,{title:(0,_.__)("Layout")},f&&(0,u.createElement)(u.Fragment,null,(0,u.createElement)(h.ToggleControl,{className:"block-editor-hooks__toggle-control",label:(0,_.__)("Inner blocks use content width"),checked:"constrained"===(null==E?void 0:E.name)||w,onChange:()=>t({layout:{type:"constrained"===(null==E?void 0:E.name)||w?"default":"constrained"}}),help:"constrained"===(null==E?void 0:E.name)||w?(0,_.__)("Nested blocks use content width with options for full and wide widths."):(0,_.__)("Nested blocks will fill the width of this container. Toggle to constrain.")})),!b&&c&&(0,u.createElement)(R_,{type:k,onChange:e=>t({layout:{type:e}})}),E&&"default"!==E.name&&(0,u.createElement)(E.inspectorControls,{layout:v,onChange:B,layoutBlockSupport:s}),C&&S&&(0,u.createElement)(C.inspectorControls,{layout:v,onChange:B,layoutBlockSupport:s}))),!b&&E&&(0,u.createElement)(E.toolBarControls,{layout:v,onChange:B,layoutBlockSupport:s}))}function R_(e){let{type:t,onChange:n}=e;return(0,u.createElement)(h.ButtonGroup,null,ri.map((e=>{let{name:o,label:r}=e;return(0,u.createElement)(h.Button,{key:o,isPressed:t===o,onClick:()=>n(o)},r)})))}const A_=(0,m.createHigherOrderComponent)((e=>t=>{const{name:n}=t;return[(0,a.hasBlockSupport)(n,M_)&&(0,u.createElement)(L_,c({key:"layout"},t)),(0,u.createElement)(e,c({key:"edit"},t))]}),"withInspectorControls"),O_=(0,m.createHigherOrderComponent)((e=>t=>{const{name:n,attributes:o,block:r}=t,l=(0,a.hasBlockSupport)(n,M_),i=(0,g.useSelect)((e=>{const{getSettings:t}=e(To);return!!t().disableLayoutStyles})),s=l&&!i,d=(0,m.useInstanceId)(e),f=fr("layout")||{},h=(0,u.useContext)(Wv.__unstableElementContext),{layout:v}=o,{default:b}=(0,a.getBlockSupport)(n,M_)||{},k=null!=v&&v.inherit||null!=v&&v.contentSize||null!=v&&v.wideSize?{...v,type:"constrained"}:v||b||{},_=l?N_(r):null,y=`.wp-container-${d}.wp-container-${d}`,E=null!==fr("spacing.blockGap");let C;if(s){var S;const e=li((null==k?void 0:k.type)||"default");C=null==e||null===(S=e.getLayoutStyle)||void 0===S?void 0:S.call(e,{blockName:n,selector:y,layout:k,layoutDefinitions:null==f?void 0:f.definitions,style:null==o?void 0:o.style,hasBlockGapSupport:E})}const w=p()({[`wp-container-${d}`]:s&&!!C},_);return(0,u.createElement)(u.Fragment,null,s&&h&&!!C&&(0,u.createPortal)((0,u.createElement)(ui,{blockName:n,selector:y,css:C,layout:k,style:null==o?void 0:o.style}),h),(0,u.createElement)(e,c({},t,{__unstableLayoutClassNames:w})))})),D_=(0,m.createHigherOrderComponent)((e=>t=>{const{attributes:n}=t,{style:{layout:o={}}={}}=n,{selfStretch:r,flexSize:l}=o,i=r||l,a=(0,g.useSelect)((e=>{const{getSettings:t}=e(To);return!!t().disableLayoutStyles})),s=i&&!a,d=(0,u.useContext)(Wv.__unstableElementContext),f=(0,m.useInstanceId)(e),h=`.wp-container-content-${f}`;let v="";"fixed"===r&&l?v+=`${h} {\n\t\t\t\tflex-basis: ${l};\n\t\t\t\tbox-sizing: border-box;\n\t\t\t}`:"fill"===r&&(v+=`${h} {\n\t\t\t\tflex-grow: 1;\n\t\t\t}`);const b=p()(null==t?void 0:t.className,{[`wp-container-content-${f}`]:s&&!!v});return(0,u.createElement)(u.Fragment,null,s&&d&&!!v&&(0,u.createPortal)((0,u.createElement)("style",null,v),d),(0,u.createElement)(e,c({},t,{className:b})))}));function z_(e){let{clientId:t,stopEditingAsBlock:n}=e;const o=(0,g.useSelect)((e=>{const{isBlockSelected:n,hasSelectedInnerBlock:o}=e(To);return n(t)||o(t,!0)}),[t]);return(0,u.useEffect)((()=>{o||n()}),[o]),null}(0,s.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,a.hasBlockSupport)(e,M_)&&(e.attributes={...e.attributes,layout:{type:"object"}}),e})),(0,s.addFilter)("editor.BlockListBlock","core/editor/layout/with-layout-styles",O_),(0,s.addFilter)("editor.BlockListBlock","core/editor/layout/with-child-layout-styles",D_),(0,s.addFilter)("editor.BlockEdit","core/editor/layout/with-inspector-controls",A_);const F_=(0,m.createHigherOrderComponent)((e=>t=>{const{getBlockListSettings:n,getSettings:o}=(0,g.useSelect)(To),r=(0,u.useRef)(),{templateLock:l,isLockedByParent:i,isEditingAsBlocks:a}=(0,g.useSelect)((e=>{const{__unstableGetContentLockingParent:n,getTemplateLock:o,__unstableGetTemporarilyEditingAsBlocks:r}=e(To);return{templateLock:o(t.clientId),isLockedByParent:!!n(t.clientId),isEditingAsBlocks:r()===t.clientId}}),[t.clientId]),{updateSettings:s,updateBlockListSettings:d,__unstableSetTemporarilyEditingAsBlocks:m}=(0,g.useDispatch)(To),f=!i&&"contentOnly"===l,{__unstableMarkNextChangeAsNotPersistent:v,updateBlockAttributes:b}=(0,g.useDispatch)(To),k=(0,u.useCallback)((()=>{v(),b(t.clientId,{templateLock:"contentOnly"}),d(t.clientId,{...n(t.clientId),templateLock:"contentOnly"}),s({focusMode:r.current}),m()}),[t.clientId,r,s,d,n,v,b,m]);return f||a?(0,u.createElement)(u.Fragment,null,a&&!f&&(0,u.createElement)(u.Fragment,null,(0,u.createElement)(z_,{clientId:t.clientId,stopEditingAsBlock:k}),(0,u.createElement)(Vo,{group:"other"},(0,u.createElement)(h.ToolbarButton,{onClick:()=>{k()}},(0,_.__)("Done")))),!a&&f&&t.isSelected&&(0,u.createElement)(zh,null,(e=>{let{onClose:l}=e;return(0,u.createElement)(h.MenuItem,{onClick:()=>{v(),b(t.clientId,{templateLock:void 0}),d(t.clientId,{...n(t.clientId),templateLock:!1}),r.current=o().focusMode,s({focusMode:!0}),m(t.clientId),l()}},(0,_.__)("Modify"))})),(0,u.createElement)(e,c({},t,{className:p()(t.className,a&&"is-content-locked-editing-as-blocks")}))):(0,u.createElement)(e,t)}),"withToolbarControls");(0,s.addFilter)("editor.BlockEdit","core/content-lock-ui/with-block-controls",F_);const V_="metadata";function H_(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if(!e.name.startsWith("core/"))return!1;const n=(0,a.getBlockSupport)(e,"__experimentalMetadata");return!!(!0===n||null!=n&&n[t])}function G_(e){var t;const n=(null===(t=e.style)||void 0===t?void 0:t.border)||{};return{className:Eb(e)||void 0,style:g_({border:n})}}function U_(e){const{colors:t}=db(),n=G_(e),{borderColor:o}=e;if(o){const e=hb({colors:t,namedColor:o});n.style.borderColor=e.color}return n}function $_(e){var t,n,o,r,l,i;const{backgroundColor:a,textColor:s,gradient:c,style:u}=e,d=ub("background-color",a),m=ub("color",s),g=Sb(c),f=g||(null==u||null===(t=u.color)||void 0===t?void 0:t.gradient);return{className:p()(m,g,{[d]:!f&&!!d,"has-text-color":s||(null==u||null===(n=u.color)||void 0===n?void 0:n.text),"has-background":a||(null==u||null===(o=u.color)||void 0===o?void 0:o.background)||c||(null==u||null===(r=u.color)||void 0===r?void 0:r.gradient),"has-link-color":null==u||null===(l=u.elements)||void 0===l||null===(i=l.link)||void 0===i?void 0:i.color})||void 0,style:g_({color:(null==u?void 0:u.color)||{}})}}(0,s.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||H_(e,"name")&&(e.attributes={...e.attributes,[V_]:{type:"object"}}),e})),(0,s.addFilter)("blocks.getSaveContent.extraProps","core/metadata/save-props",(function(e,t,n){return H_(t)&&(e.metadata=n.metadata),e})),(0,s.addFilter)("blocks.registerBlockType","core/metadata/addLabelCallback",(function(e){return e.__experimentalLabel||H_(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 j_={};function W_(e){const{backgroundColor:t,textColor:n,gradient:o}=e,r=fr("color.palette.custom"),l=fr("color.palette.theme"),i=fr("color.palette.default"),a=fr("color.gradients")||j_,s=(0,u.useMemo)((()=>[...r||[],...l||[],...i||[]]),[r,l,i]),c=(0,u.useMemo)((()=>[...(null==a?void 0:a.custom)||[],...(null==a?void 0:a.theme)||[],...(null==a?void 0:a.default)||[]]),[a]),d=$_(e);if(t){const e=sb(s,t);d.style.backgroundColor=e.color}if(o&&(d.style.background=wb(c,o)),n){const e=sb(s,n);d.style.color=e.color}return d}function K_(e){const{style:t}=e;return{style:g_({spacing:(null==t?void 0:t.spacing)||{}})}}function q_(e,t){var n;let o=(null==e||null===(n=e.style)||void 0===n?void 0:n.typography)||{};if(t&&(!0===t||0!==Object.keys(t).length)){var r,l,i,a;const n=Lk({fontSize:null==e||null===(r=e.style)||void 0===r||null===(l=r.typography)||void 0===l?void 0:l.fontSize,minimumFontSizeLimit:null==t?void 0:t.minFontSize})||(null==e||null===(i=e.style)||void 0===i||null===(a=i.typography)||void 0===a?void 0:a.fontSize);o={...o,fontSize:n}}const s=g_({typography:o}),c=null!=e&&e.fontFamily?`has-${(0,f.kebabCase)(e.fontFamily)}-font-family`:"";return{className:p()(c,Ik(null==e?void 0:e.fontSize)),style:s}}function Y_(e){const[t,n]=(0,u.useState)(e);return(0,u.useEffect)((()=>{e&&n(e)}),[e]),t}const Z_=e=>{let[t,...n]=e;return t.toUpperCase()+n.join("")},Q_=e=>(0,m.createHigherOrderComponent)((t=>n=>(0,u.createElement)(t,c({},n,{colors:e}))),"withCustomColorPalette"),X_=()=>(0,m.createHigherOrderComponent)((e=>t=>{const n=fr("color.palette.custom"),o=fr("color.palette.theme"),r=fr("color.palette.default"),l=(0,u.useMemo)((()=>[...n||[],...o||[],...r||[]]),[n,o,r]);return(0,u.createElement)(e,c({},t,{colors:l}))}),"withEditorColorPalette");function J_(e,t){const n=e.reduce(((e,t)=>({...e,..."string"==typeof t?{[t]:(0,f.kebabCase)(t)}:t})),{});return(0,m.compose)([t,e=>class extends u.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=mp(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 Object.keys(n).reduce(((e,t)=>{const n=Z_(t),o=`custom${n}`;return e[`set${n}`]=this.createSetColor(t,o),e}),{})}createSetColor(e,t){return n=>{const o=cb(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 Object.entries(n).reduce(((e,n)=>{let[l,i]=n;const a=sb(r,o[l],o[`custom${Z_(l)}`]),s=t[l];return(null==s?void 0:s.color)===a.color&&s?e[l]=s:e[l]={...a,class:ub(i,a.slug)},e}),{})}render(){return(0,u.createElement)(e,c({},this.props,{colors:void 0},this.state,this.setters,{colorUtils:this.colorUtils}))}}])}function ey(e){return function(){const t=Q_(e);for(var n=arguments.length,o=new Array(n),r=0;r{let[t,...n]=e;return t.toUpperCase()+n.join("")};var ry=function(){for(var e=arguments.length,t=new Array(e),n=0;n(e[t]=`custom${oy(t)}`,e)),{});return(0,m.createHigherOrderComponent)((0,m.compose)([(0,m.createHigherOrderComponent)((e=>t=>{const n=fr("typography.fontSizes")||ny;return(0,u.createElement)(e,c({},t,{fontSizes:n}))}),"withFontSizes"),e=>class extends u.Component{constructor(e){super(e),this.setters=this.createSetters(),this.state={}}createSetters(){return Object.entries(o).reduce(((e,t)=>{let[n,o]=t;return e[`set${oy(n)}`]=this.createSetFontSize(n,o),e}),{})}createSetFontSize(e,t){return n=>{var o;const r=null===(o=this.props.fontSizes)||void 0===o?void 0:o.find((e=>{let{size:t}=e;return t===Number(n)}));this.props.setAttributes({[e]:r&&r.slug?r.slug:void 0,[t]:r&&r.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(!Object.values(o).some(l))return null;const i=Object.entries(o).filter((e=>{let[t,n]=e;return l(n,t)})).reduce(((e,t)=>{let[o,l]=t;const i=n[o],a=wk(r,i,n[l]);return e[o]={...a,class:Ik(i)},e}),{});return{...t,...i}}render(){return(0,u.createElement)(e,c({},this.props,{fontSizes:void 0},this.state,this.setters))}}]),"withFontSizes")};var ly=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"M4 19.8h8.9v-1.5H4v1.5zm8.9-15.6H4v1.5h8.9V4.2zm-8.9 7v1.5h16v-1.5H4z"}));var iy=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"M16.4 4.2H7.6v1.5h8.9V4.2zM4 11.2v1.5h16v-1.5H4zm3.6 8.6h8.9v-1.5H7.6v1.5z"}));var ay=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"M11.1 19.8H20v-1.5h-8.9v1.5zm0-15.6v1.5H20V4.2h-8.9zM4 12.8h16v-1.5H4v1.5z"}));const sy=[{icon:ly,title:(0,_.__)("Align text left"),align:"left"},{icon:iy,title:(0,_.__)("Align text center"),align:"center"},{icon:ay,title:(0,_.__)("Align text right"),align:"right"}],cy={position:"bottom right",variant:"toolbar"};var uy=function(e){let{value:t,onChange:n,alignmentControls:o=sy,label:r=(0,_.__)("Align text"),describedBy:l=(0,_.__)("Change text alignment"),isCollapsed:i=!0,isToolbar:a}=e;function s(e){return()=>n(t===e?void 0:e)}const d=o.find((e=>e.align===t)),p=a?h.ToolbarGroup:h.ToolbarDropdownMenu,m=a?{isCollapsed:i}:{toggleProps:{describedBy:l},popoverProps:cy};return(0,u.createElement)(p,c({icon:d?d.icon:(0,_.isRTL)()?ay:ly,label:r,controls:o.map((e=>{const{align:n}=e,o=t===n;return{...e,isActive:o,role:i?"menuitemradio":void 0,onClick:s(n)}}))},m))};const dy=e=>(0,u.createElement)(uy,c({},e,{isToolbar:!1})),py=e=>(0,u.createElement)(uy,c({},e,{isToolbar:!0})),my=()=>{};var gy={name:"blocks",className:"block-editor-autocompleters__block",triggerPrefix:"/",useItems(e){const{rootClientId:t,selectedBlockName:n}=(0,g.useSelect)((e=>{const{getSelectedBlockClientId:t,getBlockName:n,getBlockInsertionPoint:o}=e(To),r=t();return{selectedBlockName:r?n(r):null,rootClientId:o().rootClientId}}),[]),[o,r,l]=pm(t,my),i=(0,u.useMemo)((()=>(e.trim()?$m(o,r,l,e):Y(o,"frecency","desc")).filter((e=>e.name!==n)).slice(0,9)),[e,n,o,r,l]),a=(0,u.useMemo)((()=>i.map((e=>{const{title:t,icon:n,isDisabled:o}=e;return{key:`block-${e.id}`,value:e,label:(0,u.createElement)(u.Fragment,null,(0,u.createElement)(fd,{key:"icon",icon:n,showColors:!0}),t),isDisabled:o}}))),[i]);return[a]},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,a.createBlock)(t,n,(0,a.createBlocksFromInnerBlocksTemplate)(o))}}},fy=window.wp.apiFetch,hy=n.n(fy);var vy=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.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 by=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.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 ky={name:"links",className:"block-editor-autocompleters__link",triggerPrefix:"[[",options:async e=>{let t=await hy()({path:(0,rg.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,u.createElement)(u.Fragment,null,(0,u.createElement)(Jl,{key:"icon",icon:"page"===e.subtype?vy:by}),e.title)},getOptionCompletion(e){return(0,u.createElement)("a",{href:e.url},e.title)}};const _y=[];function yy(e){let{completers:t=_y}=e;const{name:n}=Ro();return(0,u.useMemo)((()=>{let e=[...t,ky];return(n===(0,a.getDefaultBlockName)()||(0,a.getBlockSupport)(n,"__experimentalSlashInserter",!1))&&(e=[...e,gy]),(0,s.hasFilter)("editor.Autocomplete.completers")&&(e===t&&(e=e.map((e=>({...e})))),e=(0,s.applyFilters)("editor.Autocomplete.completers",e,n)),e}),[t,n])}var Ey=function(e){return(0,u.createElement)(h.Autocomplete,c({},e,{completers:yy(e)}))};var Cy=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.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 Sy=function(e){let{isActive:t,label:n=(0,_.__)("Toggle full height"),onToggle:o,isDisabled:r}=e;return(0,u.createElement)(h.ToolbarButton,{isActive:t,icon:Cy,label:n,onClick:()=>o(!t),disabled:r})};const wy=()=>{};var By=function(e){const{label:t=(0,_.__)("Change matrix alignment"),onChange:n=wy,value:o="center",isDisabled:r}=e,l=(0,u.createElement)(h.__experimentalAlignmentMatrixControl.Icon,{value:o});return(0,u.createElement)(h.Dropdown,{popoverProps:{variant:"toolbar",placement:"bottom-start"},renderToggle:e=>{let{onToggle:n,isOpen:o}=e;return(0,u.createElement)(h.ToolbarButton,{onClick:n,"aria-haspopup":"true","aria-expanded":o,onKeyDown:e=>{o||e.keyCode!==Qu.DOWN||(e.preventDefault(),n())},label:t,icon:l,showTooltip:!0,disabled:r})},renderContent:()=>(0,u.createElement)(h.__experimentalAlignmentMatrixControl,{hasFocusBorder:!1,onChange:n,value:o})})};var Iy=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.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 xy=function(e){let{rootLabelText:t}=e;const{selectBlock:n,clearSelectedBlock:o}=(0,g.useDispatch)(To),{clientId:r,parents:l,hasSelection:i}=(0,g.useSelect)((e=>{const{getSelectionStart:t,getSelectedBlockClientId:n,getBlockParents:o}=e(To),r=n();return{parents:o(r),clientId:r,hasSelection:!!t().clientId}}),[]),a=t||(0,_.__)("Document");return(0,u.createElement)("ul",{className:"block-editor-block-breadcrumb",role:"list","aria-label":(0,_.__)("Block breadcrumb")},(0,u.createElement)("li",{className:i?void 0:"block-editor-block-breadcrumb__current","aria-current":i?void 0:"true"},i&&(0,u.createElement)(h.Button,{className:"block-editor-block-breadcrumb__button",variant:"tertiary",onClick:o},a),!i&&a,!!r&&(0,u.createElement)(Jl,{icon:Iy,className:"block-editor-block-breadcrumb__separator"})),l.map((e=>(0,u.createElement)("li",{key:e},(0,u.createElement)(h.Button,{className:"block-editor-block-breadcrumb__button",variant:"tertiary",onClick:()=>n(e)},(0,u.createElement)(af,{clientId:e,maximumLength:35})),(0,u.createElement)(Jl,{icon:Iy,className:"block-editor-block-breadcrumb__separator"})))),!!r&&(0,u.createElement)("li",{className:"block-editor-block-breadcrumb__current","aria-current":"true"},(0,u.createElement)(af,{clientId:r,maximumLength:35})))};const Ty=()=>(0,u.createElement)(h.SVG,{xmlns:"https://www.w3.org/2000/svg",viewBox:"0 0 20 20"},(0,u.createElement)(h.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"})),My=e=>{let{style:t,className:n}=e;return(0,u.createElement)("div",{className:"block-library-colors-selector__icon-container"},(0,u.createElement)("div",{className:`${n} block-library-colors-selector__state-selection`,style:t},(0,u.createElement)(Ty,null)))},Ny=e=>{let{TextColor:t,BackgroundColor:n}=e;return e=>{let{onToggle:o,isOpen:r}=e;return(0,u.createElement)(h.ToolbarGroup,null,(0,u.createElement)(h.ToolbarButton,{className:"components-toolbar__control block-library-colors-selector__toggle",label:(0,_.__)("Open Colors Selector"),onClick:o,onKeyDown:e=>{r||e.keyCode!==Qu.DOWN||(e.preventDefault(),o())},icon:(0,u.createElement)(n,null,(0,u.createElement)(t,null,(0,u.createElement)(My,null)))}))}};var Py=e=>{let{children:t,...n}=e;return W()("wp.blockEditor.BlockColorsStyleSelector",{alternative:"block supports API",since:"6.1",version:"6.3"}),(0,u.createElement)(h.Dropdown,{popoverProps:{placement:"bottom-start"},className:"block-library-colors-selector",contentClassName:"block-library-colors-selector__popover",renderToggle:Ny(n),renderContent:()=>t})};var Ly=(0,u.createElement)(G.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,u.createElement)(G.Path,{d:"M13.8 5.2H3v1.5h10.8V5.2zm-3.6 12v1.5H21v-1.5H10.2zm7.2-6H6.6v1.5h10.8v-1.5z"}));const Ry=Ru(h.__experimentalTreeGridRow);var Ay=(0,u.forwardRef)(((e,t)=>{let{isSelected:n,position:o,level:r,rowCount:l,children:i,className:a,path:s,...d}=e;const g=Du({isSelected:n,adjustScrolling:!1,enableAnimation:!0,triggerAnimationOnChange:s}),f=(0,m.useMergeRefs)([t,g]);return(0,u.createElement)(Ry,c({ref:f,className:p()("block-editor-list-view-leaf",a),level:r,positionInSet:o,setSize:l},d),i)}));var Oy=(0,u.createElement)(G.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,u.createElement)(G.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M15 11h-.2V9c0-1.5-1.2-2.8-2.8-2.8S9.2 7.5 9.2 9v2H9c-.6 0-1 .4-1 1v4c0 .6.4 1 1 1h6c.6 0 1-.4 1-1v-4c0-.6-.4-1-1-1zm-1.8 0h-2.5V9c0-.7.6-1.2 1.2-1.2s1.2.6 1.2 1.2v2z"}));var Dy=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"m13.1 16-3.4-4 3.4-4 1.1 1-2.6 3 2.6 3-1.1 1z"}));function zy(e){let{onClick:t}=e;return(0,u.createElement)("span",{className:"block-editor-list-view__expander",onClick:e=>t(e,{forceToggle:!0}),"aria-hidden":"true"},(0,u.createElement)(Jl,{icon:(0,_.isRTL)()?Dy:Iy}))}var Fy=(0,u.forwardRef)((function(e,t){let{className:n,block:{clientId:o},onClick:r,onToggleExpanded:l,tabIndex:i,onFocus:a,onDragStart:s,onDragEnd:c,draggable:d}=e;const m=rf(o),g=lf({clientId:o,context:"list-view"}),{isLocked:f}=Ih(o);return(0,u.createElement)(u.Fragment,null,(0,u.createElement)(h.Button,{className:p()("block-editor-list-view-block-select-button",n),onClick:r,onKeyDown:function(e){e.keyCode!==Qu.ENTER&&e.keyCode!==Qu.SPACE||r(e)},ref:t,tabIndex:i,onFocus:a,onDragStart:e=>{e.dataTransfer.clearData(),null==s||s(e)},onDragEnd:c,draggable:d,href:`#block-${o}`,"aria-hidden":!0},(0,u.createElement)(zy,{onClick:l}),(0,u.createElement)(fd,{icon:null==m?void 0:m.icon,showColors:!0}),(0,u.createElement)(h.__experimentalHStack,{alignment:"center",className:"block-editor-list-view-block-select-button__label-wrapper",justify:"flex-start",spacing:1},(0,u.createElement)("span",{className:"block-editor-list-view-block-select-button__title"},(0,u.createElement)(h.__experimentalTruncate,{ellipsizeMode:"auto"},g)),(null==m?void 0:m.anchor)&&(0,u.createElement)("span",{className:"block-editor-list-view-block-select-button__anchor-wrapper"},(0,u.createElement)(h.__experimentalTruncate,{className:"block-editor-list-view-block-select-button__anchor",ellipsizeMode:"auto"},m.anchor)),f&&(0,u.createElement)("span",{className:"block-editor-list-view-block-select-button__lock"},(0,u.createElement)(Jl,{icon:Oy})))))}));const Vy=(0,u.forwardRef)(((e,t)=>{let{onClick:n,onToggleExpanded:o,block:r,isSelected:l,position:i,siblingBlockCount:a,level:s,isExpanded:d,selectedClientIds:m,...f}=e;const{clientId:h}=r,{blockMovingClientId:v,selectedBlockInBlockEditor:b}=(0,g.useSelect)((e=>{const{hasBlockMovingClientId:t,getSelectedBlockClientId:n}=e(To);return{blockMovingClientId:t(),selectedBlockInBlockEditor:n()}}),[h]),k=v&&b===h,_=p()("block-editor-list-view-block-contents",{"is-dropping-before":k}),y=m.includes(h)?m:[h];return(0,u.createElement)(sf,{clientIds:y},(e=>{let{draggable:p,onDragStart:m,onDragEnd:g}=e;return(0,u.createElement)(Fy,c({ref:t,className:_,block:r,onClick:n,onToggleExpanded:o,isSelected:l,position:i,siblingBlockCount:a,level:s,draggable:p,onDragStart:m,onDragEnd:g,isExpanded:d},f))}))}));var Hy=Vy;const Gy=(0,u.createContext)({}),Uy=()=>(0,u.useContext)(Gy);var $y=(0,u.memo)((function e(t){let{block:n,isDragged:o,isSelected:r,isBranchSelected:l,selectBlock:i,position:s,level:c,rowCount:d,siblingBlockCount:f,showBlockMovers:v,path:b,isExpanded:k,selectedClientIds:y,preventAnnouncement:E,isSyncedBranch:C}=t;const S=(0,u.useRef)(null),w=(0,u.useRef)(null),[B,I]=(0,u.useState)(!1),{clientId:x}=n,{isLocked:T,isContentLocked:M,canEdit:N}=Ih(x),P=(0,g.useSelect)((e=>!r&&(!!M&&e(To).hasSelectedInnerBlock(x,!0))),[M,x,r]),L=!M&&N,R=P||r&&y[0]===x,A=P||r&&y[y.length-1]===x,{toggleBlockHighlight:O}=(0,g.useDispatch)(To),D=rf(x),z=(0,g.useSelect)((e=>e(To).getBlockName(x)),[x]),F=(0,a.hasBlockSupport)(z,"__experimentalToolbar",!0),V=`list-view-block-select-button__${(0,m.useInstanceId)(e)}`,H=((e,t,n)=>(0,_.sprintf)((0,_.__)("Block %1$d of %2$d, Level %3$d"),e,t,n))(s,f,c);let G=(0,_.__)("Link");D&&(G=T?(0,_.sprintf)((0,_.__)("%s link (locked)"),D.title):(0,_.sprintf)((0,_.__)("%s link"),D.title));const U=D?(0,_.sprintf)((0,_.__)("Options for %s block"),D.title):(0,_.__)("Options"),{isTreeGridMounted:$,expand:j,collapse:W}=Uy(),K=v&&f>0,q=p()("block-editor-list-view-block__mover-cell",{"is-visible":B||r}),Y=p()("block-editor-list-view-block__menu-cell",{"is-visible":B||R});(0,u.useEffect)((()=>{!$&&r&&S.current.focus()}),[]);const Z=(0,u.useCallback)((()=>{I(!0),O(x,!0)}),[x,I,O]),Q=(0,u.useCallback)((()=>{I(!1),O(x,!1)}),[x,I,O]),X=(0,u.useCallback)((e=>{i(e,x),e.preventDefault()}),[x,i]),J=(0,u.useCallback)((e=>{i(void 0,e)}),[i]),ee=(0,u.useCallback)((e=>{e.preventDefault(),e.stopPropagation(),!0===k?W(x):!1===k&&j(x)}),[x,j,W,k]);let te;K?te=2:F||(te=3);const ne=p()({"is-selected":r||P,"is-first-selected":R,"is-last-selected":A,"is-branch-selected":l,"is-synced-branch":C,"is-dragging":o,"has-single-cell":!F,"is-synced":null==D?void 0:D.isSynced}),oe=y.includes(x)?y:[x];return function(e){let{isSelected:t,selectedClientIds:n,rowItemRef:o}=e;const r=1===n.length;(0,u.useLayoutEffect)((()=>{if(!t||!r||!o.current)return;const e=(0,Ri.getScrollContainer)(o.current),{ownerDocument:n}=o.current;if(e===n.body||e===n.documentElement||!e)return;const l=o.current.getBoundingClientRect(),i=e.getBoundingClientRect();(l.topi.bottom)&&o.current.scrollIntoView()}),[t,r,o])}({isSelected:r,rowItemRef:w,selectedClientIds:y}),(0,u.createElement)(Ay,{className:ne,onMouseEnter:Z,onMouseLeave:Q,onFocus:Z,onBlur:Q,level:c,position:s,rowCount:d,path:b,id:`list-view-block-${x}`,"data-block":x,isExpanded:L?k:void 0,"aria-selected":!!r||P,ref:w},(0,u.createElement)(h.__experimentalTreeGridCell,{className:"block-editor-list-view-block__contents-cell",colSpan:te,ref:S,"aria-label":G,"aria-selected":!!r||P,"aria-expanded":L?k:void 0,"aria-describedby":V},(e=>{let{ref:t,tabIndex:o,onFocus:l}=e;return(0,u.createElement)("div",{className:"block-editor-list-view-block__contents-container"},(0,u.createElement)(Hy,{block:n,onClick:X,onToggleExpanded:ee,isSelected:r,position:s,siblingBlockCount:f,level:c,ref:t,tabIndex:o,onFocus:l,isExpanded:k,selectedClientIds:y,preventAnnouncement:E}),(0,u.createElement)("div",{className:"block-editor-list-view-block-select-button__description",id:V},H))})),K&&(0,u.createElement)(u.Fragment,null,(0,u.createElement)(h.__experimentalTreeGridCell,{className:q,withoutGridItem:!0},(0,u.createElement)(h.__experimentalTreeGridItem,null,(e=>{let{ref:t,tabIndex:n,onFocus:o}=e;return(0,u.createElement)(hf,{orientation:"vertical",clientIds:[x],ref:t,tabIndex:n,onFocus:o})})),(0,u.createElement)(h.__experimentalTreeGridItem,null,(e=>{let{ref:t,tabIndex:n,onFocus:o}=e;return(0,u.createElement)(vf,{orientation:"vertical",clientIds:[x],ref:t,tabIndex:n,onFocus:o})})))),F&&(0,u.createElement)(h.__experimentalTreeGridCell,{className:Y,"aria-selected":!!r||P},(e=>{let{ref:t,tabIndex:n,onFocus:o}=e;return(0,u.createElement)(Gh,{clientIds:oe,icon:sg,label:U,toggleProps:{ref:t,className:"block-editor-list-view-block__menu",tabIndex:n,onFocus:o},disableOpenOnArrowDown:!0,__experimentalSelectBlock:J})})))}));function jy(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(Wy(t,n,o),0):1}const Wy=(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+jy(r,e,t,n):o+1},Ky=()=>{};var qy=(0,u.memo)((function e(t){const{blocks:n,selectBlock:o=Ky,showBlockMovers:r,selectedClientIds:l,level:i=1,path:a="",isBranchSelected:s=!1,listPosition:c=0,fixedListWindow:d,isExpanded:p,parentId:m,shouldShowInnerBlocks:f=!0,isSyncedBranch:h=!1}=t,v=rf(m),b=h||!(null==v||!v.isSynced),k=(0,g.useSelect)((e=>{if(!m)return!0;const t="contentOnly"===e(To).getTemplateLock(m),n=e(To).canEditBlock(m);return!t&&n}),[m]),{expandedState:_,draggedClientIds:y}=Uy();if(!k)return null;const E=n.filter(Boolean),C=E.length;let S=c;return(0,u.createElement)(u.Fragment,null,E.map(((t,n)=>{var c;const{clientId:m,innerBlocks:h}=t;n>0&&(S+=jy(E[n-1],_,y,p));const{itemInView:v}=d,k=v(S),w=n+1,B=a.length>0?`${a}_${w}`:`${w}`,I=!(null==h||!h.length),x=I&&f?null!==(c=_[m])&&void 0!==c?c:p:void 0,T=!(null==y||!y.includes(m)),M=((e,t)=>Array.isArray(t)&&t.length?-1!==t.indexOf(e):t===e)(m,l),N=s||M&&I,P=T||k||M;return(0,u.createElement)(g.AsyncModeProvider,{key:m,value:!M},P&&(0,u.createElement)($y,{block:t,selectBlock:o,isSelected:M,isBranchSelected:N,isDragged:T,level:i,position:w,rowCount:C,siblingBlockCount:C,showBlockMovers:r,path:B,isExpanded:x,listPosition:S,selectedClientIds:l,isSyncedBranch:b}),!P&&(0,u.createElement)("tr",null,(0,u.createElement)("td",{className:"block-editor-list-view-placeholder"})),I&&x&&!T&&(0,u.createElement)(e,{parentId:m,blocks:h,selectBlock:o,showBlockMovers:r,level:i+1,path:B,listPosition:S+1,fixedListWindow:d,isBranchSelected:N,selectedClientIds:l,isExpanded:p,isSyncedBranch:b}))})))}));function Yy(e){let{listViewRef:t,blockDropTarget:n}=e;const{rootClientId:o,clientId:r,dropPosition:l}=n||{},[i,a]=(0,u.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]),s=a||i,c=(0,u.useCallback)((()=>{if(!i)return 0;const e=s.getBoundingClientRect();return i.querySelector(".block-editor-block-icon").getBoundingClientRect().right-e.left}),[i,s]),d=(0,u.useMemo)((()=>{if(!s)return{};const e=c();return{width:s.offsetWidth-e}}),[c,s]),p=(0,u.useMemo)((()=>{if(s&&("top"===l||"bottom"===l||"inside"===l))return{ownerDocument:s.ownerDocument,getBoundingClientRect(){const e=s.getBoundingClientRect(),t=c(),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,u=i-r;return new window.DOMRect(n,r,a,u)}}}),[s,l,c]);return s?(0,u.createElement)(h.Popover,{animate:!1,anchor:p,focusOnMount:!1,className:"block-editor-list-view-drop-indicator",variant:"unstyled"},(0,u.createElement)("div",{style:d,className:"block-editor-list-view-drop-indicator__line"})):null}function Zy(){const{clearSelectedBlock:e,multiSelect:t,selectBlock:n}=(0,g.useDispatch)(To),{getBlockName:o,getBlockParents:r,getBlockSelectionStart:l,getBlockSelectionEnd:i,getSelectedBlockClientIds:s,hasMultiSelection:c,hasSelectedBlock:d}=(0,g.useSelect)(To),{getBlockType:p}=(0,g.useSelect)(a.store);return{updateBlockSelection:(0,u.useCallback)((async(i,a,u)=>{if(null==i||!i.shiftKey)return void n(a);i.preventDefault();const m="keydown"===i.type&&(i.keyCode===Qu.UP||i.keyCode===Qu.DOWN||i.keyCode===Qu.HOME||i.keyCode===Qu.END);if(!m&&!d()&&!c())return void n(a,null);const g=s(),f=[...r(a),a];m&&!g.some((e=>f.includes(e)))&&await e();let h=l(),v=a;m&&(d()||c()||(h=a),u&&(v=u));const b=r(h),k=r(v),{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]}}(h,v,b,k);await t(y,E,null);const C=s();if((i.keyCode===Qu.HOME||i.keyCode===Qu.END)&&C.length>1)return;const S=g.filter((e=>!C.includes(e)));let w;if(1===S.length){var B;const e=null===(B=p(o(S[0])))||void 0===B?void 0:B.title;e&&(w=(0,_.sprintf)((0,_.__)("%s deselected."),e))}else S.length>1&&(w=(0,_.sprintf)((0,_.__)("%s blocks deselected."),S.length));w&&(0,pn.speak)(w)}),[e,o,p,r,l,i,s,c,d,t,n])}}const Qy=["top","bottom"];function Xy(){const{getBlockRootClientId:e,getBlockIndex:t,getBlockCount:n,getDraggedBlockClientIds:o,canInsertBlocks:r}=(0,g.useSelect)(To),[l,i]=(0,u.useState)(),{rootClientId:a,blockIndex:s}=l||{},c=Mv(a,s),d=o(),p=(0,m.useThrottle)((0,u.useCallback)(((o,l)=>{const a={x:o.clientX,y:o.clientY},s=!(null==d||!d.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]=Pv(t,a,Qy),u=Lv(t,a);if(void 0===r||s0||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&&d.includes(l),innerBlockCount:n(l),canInsertDraggedBlocksAsSibling:!s||r(d,i),canInsertDraggedBlocksAsChild:!s||r(d,l)}})),a);c&&i(c)}),[d]),200);return{ref:(0,m.__experimentalUseDropZone)({onDrop:c,onDragOver(e){p(e,e.currentTarget)},onDragEnd(){p.cancel(),i(null)}}),target:l}}const Jy=(e,t)=>Array.isArray(t.clientIds)?{...e,...t.clientIds.reduce(((e,n)=>({...e,[n]:"expand"===t.type})),{})}:e;var eE=(0,u.forwardRef)((function(e,t){let{id:n,blocks:o,showBlockMovers:r=!1,isExpanded:l=!1}=e;const{clientIdsTree:i,draggedClientIds:a,selectedClientIds:s}=function(e){return(0,g.useSelect)((t=>{const{getDraggedBlockClientIds:n,getSelectedBlockClientIds:o,__unstableGetClientIdsTree:r}=t(To);return{selectedClientIds:o(),draggedClientIds:n(),clientIdsTree:e||r()}}),[e])}(o),{visibleBlockCount:c,shouldShowInnerBlocks:d}=(0,g.useSelect)((e=>{const{getGlobalBlockCount:t,getClientIdsOfDescendants:n,__unstableGetEditorMode:o}=e(To),r=(null==a?void 0:a.length)>0?n(a).length+1:0;return{visibleBlockCount:t()-r,shouldShowInnerBlocks:"zoom-out"!==o()}}),[a]),{updateBlockSelection:p}=Zy(),[f,v]=(0,u.useReducer)(Jy,{}),{ref:b,target:k}=Xy(),y=(0,u.useRef)(),E=(0,m.useMergeRefs)([y,b,t]),C=(0,u.useRef)(!1),{setSelectedTreeId:S}=function(e){let{firstSelectedBlockClientId:t,setExpandedState:n}=e;const[o,r]=(0,u.useState)(null),{selectedBlockParentClientIds:l}=(0,g.useSelect)((e=>{const{getBlockParents:n}=e(To);return{selectedBlockParentClientIds:n(t,!1)}}),[t]),i=Array.isArray(l)&&l.length?l:null;return(0,u.useEffect)((()=>{o!==t&&i&&n({type:"expand",clientIds:l})}),[t]),{setSelectedTreeId:r}}({firstSelectedBlockClientId:s[0],setExpandedState:v}),w=(0,u.useCallback)(((e,t)=>{p(e,t),S(t)}),[S,p]);(0,u.useEffect)((()=>{C.current=!0}),[]);const[B]=(0,m.__experimentalUseFixedWindowList)(y,36,c,{useWindowing:!0,windowOverscan:40}),I=(0,u.useCallback)((e=>{e&&v({type:"expand",clientIds:[e]})}),[v]),x=(0,u.useCallback)((e=>{e&&v({type:"collapse",clientIds:[e]})}),[v]),T=(0,u.useCallback)((e=>{var t;I(null==e||null===(t=e.dataset)||void 0===t?void 0:t.block)}),[I]),M=(0,u.useCallback)((e=>{var t;x(null==e||null===(t=e.dataset)||void 0===t?void 0:t.block)}),[x]),N=(0,u.useCallback)(((e,t,n)=>{var o,r;e.shiftKey&&p(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)}),[p]),P=(0,u.useMemo)((()=>({isTreeGridMounted:C.current,draggedClientIds:a,expandedState:f,expand:I,collapse:x})),[C.current,a,f,I,x]);return(0,u.createElement)(g.AsyncModeProvider,{value:!0},(0,u.createElement)(Yy,{listViewRef:y,blockDropTarget:k}),(0,u.createElement)(h.__experimentalTreeGrid,{id:n,className:"block-editor-list-view-tree","aria-label":(0,_.__)("Block navigation structure"),ref:E,onCollapseRow:M,onExpandRow:T,onFocusRow:N,applicationAriaLabel:(0,_.__)("Block navigation structure")},(0,u.createElement)(Gy.Provider,{value:P},(0,u.createElement)(qy,{blocks:i,selectBlock:w,showBlockMovers:r,fixedListWindow:B,selectedClientIds:s,isExpanded:l,shouldShowInnerBlocks:d}))))}));function tE(e){let{isEnabled:t,onToggle:n,isOpen:o,innerRef:r,...l}=e;return(0,u.createElement)(h.Button,c({},l,{ref:r,icon:Ly,"aria-expanded":o,"aria-haspopup":"true",onClick:t?n:void 0,label:(0,_.__)("List view"),className:"block-editor-block-navigation","aria-disabled":!t}))}var nE=(0,u.forwardRef)((function(e,t){let{isDisabled:n,...o}=e;W()("wp.blockEditor.BlockNavigationDropdown",{since:"6.1",alternative:"wp.components.Dropdown and wp.blockEditor.ListView"});const r=(0,g.useSelect)((e=>!!e(To).getBlockCount()),[])&&!n;return(0,u.createElement)(h.Dropdown,{contentClassName:"block-editor-block-navigation__popover",popoverProps:{placement:"bottom-start"},renderToggle:e=>{let{isOpen:n,onToggle:l}=e;return(0,u.createElement)(tE,c({},o,{innerRef:t,isOpen:n,onToggle:l,isEnabled:r}))},renderContent:()=>(0,u.createElement)("div",{className:"block-editor-block-navigation__container"},(0,u.createElement)("p",{className:"block-editor-block-navigation__label"},(0,_.__)("List view")),(0,u.createElement)(eE,null))})}));function oE(e){var t;let{genericPreviewBlock:n,style:o,className:r,activeStyle:l}=e;const i=null===(t=(0,a.getBlockType)(n.name))||void 0===t?void 0:t.example,s=zf(r,l,o),c=(0,u.useMemo)((()=>({...n,title:o.label||o.name,description:o.description,initialAttributes:{...n.attributes,className:s+" block-editor-block-styles__block-preview-container"},example:i})),[n,s]);return(0,u.createElement)(tm,{item:c,isStylePreview:!0})}const rE=()=>{};function lE(e){let{clientId:t,onSwitch:n=rE,onHoverClassName:o=rE}=e;const{onSelect:r,stylesToRender:l,activeStyle:i,genericPreviewBlock:a,className:s}=Vf({clientId:t,onSwitch:n}),[c,d]=(0,u.useState)(null),g=(0,m.useViewportMatch)("medium","<");if(!l||0===l.length)return null;const f=(0,m.debounce)(d,250),v=e=>{var t;c!==e?(f(e),o(null!==(t=null==e?void 0:e.name)&&void 0!==t?t:null)):f.cancel()};return(0,u.createElement)("div",{className:"block-editor-block-styles"},(0,u.createElement)("div",{className:"block-editor-block-styles__variants"},l.map((e=>{const t=e.isDefault?(0,_.__)("Default"):e.label||e.name;return(0,u.createElement)(h.Button,{className:p()("block-editor-block-styles__item",{"is-active":i.name===e.name}),key:e.name,variant:"secondary",label:t,onMouseEnter:()=>v(e),onFocus:()=>v(e),onMouseLeave:()=>v(null),onBlur:()=>v(null),onClick:()=>(e=>{r(e),o(null),d(null),f.cancel()})(e),"aria-current":i.name===e.name},(0,u.createElement)(h.__experimentalTruncate,{numberOfLines:1,className:"block-editor-block-styles__item-text"},t))}))),c&&!g&&(0,u.createElement)(h.Popover,{placement:"left-start",offset:20},(0,u.createElement)("div",{className:"block-editor-block-styles__preview-panel",onMouseLeave:()=>v(null)},(0,u.createElement)(oE,{activeStyle:i,className:s,genericPreviewBlock:a,style:c}))))}var iE=lE;lE.Slot=()=>(W()("BlockStyles.Slot",{version:"6.4",since:"6.2"}),null);var aE=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.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 sE=function(e){let{icon:t=aE,label:n=(0,_.__)("Choose variation"),instructions:o=(0,_.__)("Select a variation to start with."),variations:r,onSelect:l,allowSkip:i}=e;const a=p()("block-editor-block-variation-picker",{"has-many-variations":r.length>4});return(0,u.createElement)(h.Placeholder,{icon:t,label:n,instructions:o,className:a},(0,u.createElement)("ul",{className:"block-editor-block-variation-picker__variations",role:"list","aria-label":(0,_.__)("Block variations")},r.map((e=>(0,u.createElement)("li",{key:e.name},(0,u.createElement)(h.Button,{variant:"secondary",icon:e.icon&&e.icon.src?e.icon.src:e.icon,iconSize:48,onClick:()=>l(e),className:"block-editor-block-variation-picker__variation",label:e.description||e.title}),(0,u.createElement)("span",{className:"block-editor-block-variation-picker__variation-label"},e.title))))),i&&(0,u.createElement)("div",{className:"block-editor-block-variation-picker__skip"},(0,u.createElement)(h.Button,{variant:"link",onClick:()=>l()},(0,_.__)("Skip"))))};var cE=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.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 uE={carousel:"carousel",grid:"grid"},dE=e=>{let{onBlockPatternSelect:t}=e;return(0,u.createElement)("div",{className:"block-editor-block-pattern-setup__actions"},(0,u.createElement)(h.Button,{variant:"primary",onClick:t},(0,_.__)("Choose")))},pE=e=>{let{handlePrevious:t,handleNext:n,activeSlide:o,totalSlides:r}=e;return(0,u.createElement)("div",{className:"block-editor-block-pattern-setup__navigation"},(0,u.createElement)(h.Button,{icon:md,label:(0,_.__)("Previous pattern"),onClick:t,disabled:0===o}),(0,u.createElement)(h.Button,{icon:pd,label:(0,_.__)("Next pattern"),onClick:n,disabled:o===r-1}))};var mE=e=>{let{viewMode:t,setViewMode:n,handlePrevious:o,handleNext:r,activeSlide:l,totalSlides:i,onBlockPatternSelect:a}=e;const s=t===uE.carousel,c=(0,u.createElement)("div",{className:"block-editor-block-pattern-setup__display-controls"},(0,u.createElement)(h.Button,{icon:bi,label:(0,_.__)("Carousel view"),onClick:()=>n(uE.carousel),isPressed:s}),(0,u.createElement)(h.Button,{icon:cE,label:(0,_.__)("Grid view"),onClick:()=>n(uE.grid),isPressed:t===uE.grid}));return(0,u.createElement)("div",{className:"block-editor-block-pattern-setup__toolbar"},s&&(0,u.createElement)(pE,{handlePrevious:o,handleNext:r,activeSlide:l,totalSlides:i}),c,s&&(0,u.createElement)(dE,{onBlockPatternSelect:a}))};var gE=function(e,t,n){return(0,g.useSelect)((o=>{const{getBlockRootClientId:r,getPatternsByBlockTypes:l,__experimentalGetAllowedPatterns:i}=o(To),a=r(e);return n?i(a).filter(n):l(t,a)}),[e,t,n])};const fE=e=>{let{viewMode:t,activeSlide:n,patterns:o,onBlockPatternSelect:r,showTitles:l}=e;const i=(0,h.__unstableUseCompositeState)(),a="block-editor-block-pattern-setup__container";if(t===uE.carousel){const e=new Map([[n,"active-slide"],[n-1,"previous-slide"],[n+1,"next-slide"]]);return(0,u.createElement)("div",{className:"block-editor-block-pattern-setup__carousel"},(0,u.createElement)("div",{className:a},(0,u.createElement)("ul",{className:"carousel-container"},o.map(((t,n)=>(0,u.createElement)(vE,{className:e.get(n)||"",key:t.name,pattern:t}))))))}return(0,u.createElement)("div",{className:"block-editor-block-pattern-setup__grid"},(0,u.createElement)(h.__unstableComposite,c({},i,{role:"listbox",className:a,"aria-label":(0,_.__)("Patterns list")}),o.map((e=>(0,u.createElement)(hE,{key:e.name,pattern:e,onSelect:r,composite:i,showTitles:l})))))};function hE(e){let{pattern:t,onSelect:n,composite:o,showTitles:r}=e;const l="block-editor-block-pattern-setup-list",{blocks:i,description:a,viewportWidth:s=700}=t,d=(0,m.useInstanceId)(hE,`${l}__item-description`);return(0,u.createElement)("div",{className:`${l}__list-item`,"aria-label":t.title,"aria-describedby":t.description?d:void 0},(0,u.createElement)(h.__unstableCompositeItem,c({role:"option",as:"div"},o,{className:`${l}__item`,onClick:()=>n(i)}),(0,u.createElement)(Jp,{blocks:i,viewportWidth:s}),r&&(0,u.createElement)("div",{className:`${l}__item-title`},t.title),!!a&&(0,u.createElement)(h.VisuallyHidden,{id:d},a)))}function vE(e){let{className:t,pattern:n,minHeight:o}=e;const{blocks:r,title:l,description:i}=n,a=(0,m.useInstanceId)(vE,"block-editor-block-pattern-setup-list__item-description");return(0,u.createElement)("li",{className:`pattern-slide ${t}`,"aria-label":l,"aria-describedby":i?a:void 0},(0,u.createElement)(Jp,{blocks:r,minHeight:o}),!!i&&(0,u.createElement)(h.VisuallyHidden,{id:a},i))}var bE=e=>{let{clientId:t,blockName:n,filterPatternsFn:o,onBlockPatternSelect:r,initialViewMode:l=uE.carousel,showTitles:i=!1}=e;const[s,c]=(0,u.useState)(l),[d,p]=(0,u.useState)(0),{replaceBlock:m}=(0,g.useDispatch)(To),f=gE(t,n,o);if(null==f||!f.length)return null;const h=r||(e=>{const n=e.map((e=>(0,a.cloneBlock)(e)));m(t,n)});return(0,u.createElement)(u.Fragment,null,(0,u.createElement)("div",{className:`block-editor-block-pattern-setup view-mode-${s}`},(0,u.createElement)(fE,{viewMode:s,activeSlide:d,patterns:f,onBlockPatternSelect:h,showTitles:i}),(0,u.createElement)(mE,{viewMode:s,setViewMode:c,activeSlide:d,totalSlides:f.length,handleNext:()=>{p((e=>e+1))},handlePrevious:()=>{p((e=>e-1))},onBlockPatternSelect:()=>{h(f[d].blocks)}})))};function kE(e){let{className:t,onSelectVariation:n,selectedValue:o,variations:r}=e;return(0,u.createElement)("fieldset",{className:t},(0,u.createElement)(h.VisuallyHidden,{as:"legend"},(0,_.__)("Transform to variation")),r.map((e=>(0,u.createElement)(h.Button,{key:e.name,icon:(0,u.createElement)(fd,{icon:e.icon,showColors:!0}),isPressed:o===e.name,label:o===e.name?e.title:(0,_.sprintf)((0,_.__)("Transform to %s"),e.title),onClick:()=>n(e.name),"aria-label":e.title,showTooltip:!0}))))}function _E(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,u.createElement)(h.DropdownMenu,{className:t,label:(0,_.__)("Transform to variation"),text:(0,_.__)("Transform to variation"),popoverProps:{position:"bottom center",className:`${t}__popover`},icon:uf,toggleProps:{iconPosition:"right"}},(()=>(0,u.createElement)("div",{className:`${t}__container`},(0,u.createElement)(h.MenuGroup,null,(0,u.createElement)(h.MenuItemsChoice,{choices:l,value:o,onSelect:n})))))}var yE=function(e){let{blockClientId:t}=e;const{updateBlockAttributes:n}=(0,g.useDispatch)(To),{activeBlockVariation:o,variations:r}=(0,g.useSelect)((e=>{const{getActiveBlockVariation:n,getBlockVariations:o}=e(a.store),{getBlockName:r,getBlockAttributes:l}=e(To),i=t&&r(t);return{activeBlockVariation:n(i,l(t)),variations:i&&o(i,"transform")}}),[t]),l=null==o?void 0:o.name,i=(0,u.useMemo)((()=>{const e=new Set;return!!r&&(r.forEach((t=>{var n;t.icon&&e.add((null===(n=t.icon)||void 0===n?void 0:n.src)||t.icon)})),e.size===r.length)}),[r]);if(null==r||!r.length)return null;const s=i?kE:_E;return(0,u.createElement)(s,{className:"block-editor-block-variation-transforms",onSelectVariation:e=>{n(t,{...r.find((t=>{let{name:n}=t;return n===e})).attributes})},selectedValue:l,variations:r})},EE=(0,m.createHigherOrderComponent)((e=>t=>{const n=fr("color.palette"),o=!fr("color.custom"),r=void 0===t.colors?n:t.colors,l=void 0===t.disableCustomColors?o:t.disableCustomColors,i=!(0,f.isEmpty)(r)||!l;return(0,u.createElement)(e,c({},t,{colors:r,disableCustomColors:l,hasColorsToChoose:i}))}),"withColorContext"),CE=EE(h.ColorPalette);function SE(e){let{onChange:t,value:n,...o}=e;return(0,u.createElement)(Ab,c({},o,{onColorChange:t,colorValue:n,gradients:[],disableCustomGradients:!0}))}var wE=window.wp.date;const BE=new Date(2022,0,25);function IE(e){let{format:t,defaultFormat:n,onChange:o}=e;return(0,u.createElement)("fieldset",{className:"block-editor-date-format-picker"},(0,u.createElement)(h.VisuallyHidden,{as:"legend"},(0,_.__)("Date format")),(0,u.createElement)(h.ToggleControl,{label:(0,u.createElement)(u.Fragment,null,(0,_.__)("Default format"),(0,u.createElement)("span",{className:"block-editor-date-format-picker__default-format-toggle-control__hint"},(0,wE.dateI18n)(n,BE))),checked:!t,onChange:e=>o(e?null:n)}),t&&(0,u.createElement)(xE,{format:t,onChange:o}))}function xE(e){var t;let{format:n,onChange:o}=e;const r=[...new Set(["Y-m-d",(0,_._x)("n/j/Y","short date format"),(0,_._x)("n/j/Y g:i A","short date format with time"),(0,_._x)("M j, Y","medium date format"),(0,_._x)("M j, Y g:i A","medium date format with time"),(0,_._x)("F j, Y","long date format"),(0,_._x)("M j","short date format without the year")])],l=r.map(((e,t)=>({key:`suggested-${t}`,name:(0,wE.dateI18n)(e,BE),format:e}))),i={key:"custom",name:(0,_.__)("Custom"),className:"block-editor-date-format-picker__custom-format-select-control__custom-option",__experimentalHint:(0,_.__)("Enter your own date format")},[a,s]=(0,u.useState)((()=>!!n&&!r.includes(n)));return(0,u.createElement)(h.__experimentalVStack,null,(0,u.createElement)(h.CustomSelectControl,{__nextUnconstrainedWidth:!0,label:(0,_.__)("Choose a format"),options:[...l,i],value:a?i:null!==(t=l.find((e=>e.format===n)))&&void 0!==t?t:i,onChange:e=>{let{selectedItem:t}=e;t===i?s(!0):(s(!1),o(t.format))}}),a&&(0,u.createElement)(h.TextControl,{__nextHasNoMarginBottom:!0,label:(0,_.__)("Custom format"),hideLabelFromVision:!0,help:(0,u.createInterpolateElement)((0,_.__)("Enter a date or time format string."),{Link:(0,u.createElement)(h.ExternalLink,{href:(0,_.__)("https://wordpress.org/support/article/formatting-date-and-time/")})}),value:n,onChange:e=>o(e)}))}const TE=["colors","disableCustomColors","gradients","disableCustomGradients"],ME=e=>{let{className:t,colors:n,gradients:o,disableCustomColors:r,disableCustomGradients:l,children:i,settings:a,title:s,showTitle:c=!0,__experimentalIsRenderedInSidebar:d,enableAlpha:v}=e;const b=(0,m.useInstanceId)(ME),{batch:k}=(0,g.useRegistry)();return(0,f.isEmpty)(n)&&(0,f.isEmpty)(o)&&r&&l&&null!=a&&a.every((e=>(0,f.isEmpty)(e.colors)&&(0,f.isEmpty)(e.gradients)&&(void 0===e.disableCustomColors||e.disableCustomColors)&&(void 0===e.disableCustomGradients||e.disableCustomGradients)))?null:(0,u.createElement)(h.__experimentalToolsPanel,{className:p()("block-editor-panel-color-gradient-settings",t),label:c?s:void 0,resetAll:()=>{k((()=>{a.forEach((e=>{let{colorValue:t,gradientValue:n,onColorChange:o,onGradientChange:r}=e;t?o():n&&r()}))}))},panelId:b,__experimentalFirstVisibleItemClass:"first",__experimentalLastVisibleItemClass:"last"},(0,u.createElement)(Fb,{settings:a,panelId:b,colors:n,gradients:o,disableCustomColors:r,disableCustomGradients:l,__experimentalIsRenderedInSidebar:d,enableAlpha:v}),!!i&&(0,u.createElement)(u.Fragment,null,(0,u.createElement)(h.__experimentalSpacer,{marginY:4})," ",i))},NE=e=>{const t=db();return(0,u.createElement)(ME,c({},t,e))};var PE=e=>TE.every((t=>e.hasOwnProperty(t)))?(0,u.createElement)(ME,e):(0,u.createElement)(NE,e);const LE=(0,u.createContext)({}),RE=()=>(0,u.useContext)(LE);function AE(e){let{id:t,url:n,naturalWidth:o,naturalHeight:r,onFinishEditing:l,onSaveImage:i,children:a}=e;const c=function(e){let{url:t,naturalWidth:n,naturalHeight:o}=e;const[r,l]=(0,u.useState)(),[i,a]=(0,u.useState)(),[c,d]=(0,u.useState)({x:0,y:0}),[p,m]=(0,u.useState)(100),[g,f]=(0,u.useState)(0),h=n/o,[v,b]=(0,u.useState)(h),k=(0,u.useCallback)((()=>{const e=(g+90)%360;let n=h;if(g%180==90&&(n=1/h),0===e)return l(),f(e),b(h),void d({x:-c.y*n,y:c.x*n});const o=new window.Image;o.src=t,o.onload=function(t){const o=document.createElement("canvas");let r=0,i=0;e%180?(o.width=t.target.height,o.height=t.target.width):(o.width=t.target.width,o.height=t.target.height),90!==e&&180!==e||(r=o.width),270!==e&&180!==e||(i=o.height);const a=o.getContext("2d");a.translate(r,i),a.rotate(e*Math.PI/180),a.drawImage(t.target,0,0),o.toBlob((t=>{l(URL.createObjectURL(t)),f(e),b(o.width/o.height),d({x:-c.y*n,y:c.x*n})}))};const r=(0,s.applyFilters)("media.crossOrigin",void 0,t);"string"==typeof r&&(o.crossOrigin=r)}),[g,h]);return(0,u.useMemo)((()=>({editedUrl:r,setEditedUrl:l,crop:i,setCrop:a,position:c,setPosition:d,zoom:p,setZoom:m,rotation:g,setRotation:f,rotateClockwise:k,aspect:v,setAspect:b,defaultAspect:h})),[r,i,c,p,g,k,v,h])}({url:n,naturalWidth:o,naturalHeight:r}),d=function(e){let{crop:t,rotation:n,height:o,width:r,aspect:l,url:i,id:a,onSaveImage:s,onFinishEditing:c}=e;const{createErrorNotice:d}=(0,g.useDispatch)(hm.store),[p,m]=(0,u.useState)(!1),f=(0,u.useCallback)((()=>{m(!1),c()}),[m,c]),h=(0,u.useCallback)((()=>{m(!0);let e={};(t.width<99.9||t.height<99.9)&&(e=t),n>0&&(e.rotation=n),e.src=i,hy()({path:`/wp/v2/media/${a}/edit`,method:"POST",data:e}).then((e=>{s({id:e.id,url:e.source_url,height:o&&r?r/l:void 0})})).catch((e=>{d((0,_.sprintf)((0,_.__)("Could not edit image. %s"),(0,Ri.__unstableStripHTML)(e.message)),{id:"image-editing-error",type:"snackbar"})})).finally((()=>{m(!1),c()}))}),[m,t,n,o,r,l,i,s,d,m,c]);return(0,u.useMemo)((()=>({isInProgress:p,apply:h,cancel:f})),[p,h,f])}({id:t,url:n,onSaveImage:i,onFinishEditing:l,...c}),p=(0,u.useMemo)((()=>({...c,...d})),[c,d]);return(0,u.createElement)(LE.Provider,{value:p},a)} + */,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;n3&&void 0!==arguments[3]?arguments[3]:1;const r=[...e];return r.splice(t,o),C(r,e.slice(t,t+o),n)}const w=e=>e;function B(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const n=new Map,o=[];return n.set(t,o),e.forEach((e=>{const{clientId:t,innerBlocks:r}=e;o.push(t),B(r,t).forEach(((e,t)=>{n.set(t,e)}))})),n}function I(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const n=[],o=[[t,e]];for(;o.length;){const[e,t]=o.shift();t.forEach((t=>{let{innerBlocks:r,...l}=t;n.push([l.clientId,e]),null!=r&&r.length&&o.push([l.clientId,r])}))}return n}function x(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:w;const n=[],o=[...e];for(;o.length;){const{innerBlocks:e,...r}=o.shift();o.push(...e),n.push([r.clientId,t(r)])}return n}function T(e){const t={},n=[...e];for(;n.length;){const{innerBlocks:e,...o}=n.shift();n.push(...e),t[o.clientId]=!0}return t}function M(e){return x(e,(e=>{const{attributes:t,...n}=e;return n}))}function N(e){return x(e,(e=>e.attributes))}function P(e,t){return"UPDATE_BLOCK_ATTRIBUTES"===e.type&&void 0!==t&&"UPDATE_BLOCK_ATTRIBUTES"===t.type&&k()(e.clientIds,t.clientIds)&&function(e,t){return k()(Object.keys(e),Object.keys(t))}(e.attributes,t.attributes)}function L(e,t){const n=e.tree,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.set(e.clientId,{});for(const t of r)n.set(t.clientId,Object.assign(n.get(t.clientId),{...e.byClientId.get(t.clientId),attributes:e.attributes.get(t.clientId),innerBlocks:t.innerBlocks.map((e=>n.get(e.clientId)))}))}function R(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const o=e.tree,r=new Set([]),l=new Set;for(const o of t){let t=n?o:e.parents.get(o);do{if(e.controlledInnerBlocks[t]){l.add(t);break}r.add(t),t=e.parents.get(t)}while(void 0!==t)}for(const e of r)o.set(e,{...o.get(e)});for(const t of r)o.get(t).innerBlocks=(e.order.get(t)||[]).map((e=>o.get(e)));for(const t of l)o.set("controlled||"+t,{innerBlocks:(e.order.get(t)||[]).map((e=>o.get(e)))})}const A=(0,m.pipe)(g.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=new Map(t.attributes),t.attributes.forEach(((n,r)=>{const{name:l}=t.byClientId.get(r);"core/block"===l&&n.ref===e&&t.attributes.set(r,{...n,ref:o})}))}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:new Map,n.type){case"RECEIVE_BLOCKS":case"INSERT_BLOCKS":o.tree=new Map(o.tree),L(o,n.blocks),R(o,n.rootClientId?[n.rootClientId]:[""],!0);break;case"UPDATE_BLOCK":o.tree=new Map(o.tree),o.tree.set(n.clientId,{...o.tree.get(n.clientId),...o.byClientId.get(n.clientId),attributes:o.attributes.get(n.clientId)}),R(o,[n.clientId],!1);break;case"UPDATE_BLOCK_ATTRIBUTES":o.tree=new Map(o.tree),n.clientIds.forEach((e=>{o.tree.set(e,{...o.tree.get(e),attributes:o.attributes.get(e)})})),R(o,n.clientIds,!1);break;case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":{const e=T(n.blocks);o.tree=new Map(o.tree),n.replacedClientIds.concat(n.replacedClientIds.filter((t=>!e[t])).map((e=>"controlled||"+e))).forEach((e=>{o.tree.delete(e)})),L(o,n.blocks),R(o,n.blocks.map((e=>e.clientId)),!1);const r=[];for(const e of n.clientIds)void 0===t.parents.get(e)||""!==t.parents.get(e)&&!o.byClientId.get(t.parents.get(e))||r.push(t.parents.get(e));R(o,r,!0);break}case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":const e=[];for(const r of n.clientIds)void 0===t.parents.get(r)||""!==t.parents.get(r)&&!o.byClientId.get(t.parents.get(r))||e.push(t.parents.get(r));o.tree=new Map(o.tree),n.removedClientIds.concat(n.removedClientIds.map((e=>"controlled||"+e))).forEach((e=>{o.tree.delete(e)})),R(o,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=new Map(o.tree),R(o,e,!0);break}case"MOVE_BLOCKS_UP":case"MOVE_BLOCKS_DOWN":{const e=[n.rootClientId?n.rootClientId:""];o.tree=new Map(o.tree),R(o,e,!0);break}case"SAVE_REUSABLE_BLOCK_SUCCESS":{const e=[];o.attributes.forEach(((t,r)=>{"core/block"===o.byClientId.get(r).name&&t.ref===n.updatedId&&e.push(r)})),o.tree=new Map(o.tree),e.forEach((e=>{o.tree.set(e,{...o.byClientId.get(e),attributes:o.attributes.get(e),innerBlocks:o.tree.get(e).innerBlocks})})),R(o,e,!1)}}return o}),(e=>(t,n)=>{const o=e=>{let o=e;for(let r=0;r(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.get(n.rootClientId)&&(r=e(r,{type:"REMOVE_BLOCKS",keepControlledInnerBlocks:o,clientIds:t.order.get(n.rootClientId)}));let l=r;if(n.blocks.length){l=e(l,{...n,type:"INSERT_BLOCKS",index:0});const r=new Map(l.order);Object.keys(o).forEach((e=>{t.order.get(e)&&r.set(e,t.order.get(e))})),l.order=r,l.tree=new Map(l.tree),Object.keys(o).forEach((e=>{const n=`controlled||${e}`;t.tree.has(n)&&l.tree.set(n,t.tree.get(n))}))}return l}),(e=>(t,n)=>{if("RESET_BLOCKS"===n.type){const e={...t,byClientId:new Map(M(n.blocks)),attributes:new Map(N(n.blocks)),order:B(n.blocks),parents:new Map(I(n.blocks)),controlledInnerBlocks:{}};return e.tree=new Map(null==t?void 0:t.tree),L(e,n.blocks),e.tree.set("",{innerBlocks:n.blocks.map((t=>e.tree.get(t.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:!P(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]:new Map,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"RECEIVE_BLOCKS":case"INSERT_BLOCKS":{const n=new Map(e);return M(t.blocks).forEach((e=>{let[t,o]=e;n.set(t,o)})),n}case"UPDATE_BLOCK":{if(!e.has(t.clientId))return e;const{attributes:n,...o}=t.updates;if(0===Object.values(o).length)return e;const r=new Map(e);return r.set(t.clientId,{...e.get(t.clientId),...o}),r}case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":{if(!t.blocks)return e;const n=new Map(e);return t.replacedClientIds.forEach((e=>{n.delete(e)})),M(t.blocks).forEach((e=>{let[t,o]=e;n.set(t,o)})),n}case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":{const n=new Map(e);return t.removedClientIds.forEach((e=>{n.delete(e)})),n}}return e},attributes(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Map,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"RECEIVE_BLOCKS":case"INSERT_BLOCKS":{const n=new Map(e);return N(t.blocks).forEach((e=>{let[t,o]=e;n.set(t,o)})),n}case"UPDATE_BLOCK":{if(!e.get(t.clientId)||!t.updates.attributes)return e;const n=new Map(e);return n.set(t.clientId,{...e.get(t.clientId),...t.updates.attributes}),n}case"UPDATE_BLOCK_ATTRIBUTES":{if(t.clientIds.every((t=>!e.get(t))))return e;let o=!1;const r=new Map(e);for(const l of t.clientIds){var n;const i=Object.entries(t.uniqueByBlock?t.attributes[l]:null!==(n=t.attributes)&&void 0!==n?n:{});if(0===i.length)continue;let a=!1;const s=e.get(l),c={};i.forEach((e=>{let[t,n]=e;s[t]!==n&&(a=!0,c[t]=n)})),o=o||a,a&&r.set(l,{...s,...c})}return o?r:e}case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":{if(!t.blocks)return e;const n=new Map(e);return t.replacedClientIds.forEach((e=>{n.delete(e)})),N(t.blocks).forEach((e=>{let[t,o]=e;n.set(t,o)})),n}case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":{const n=new Map(e);return t.removedClientIds.forEach((e=>{n.delete(e)})),n}}return e},order(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Map,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"RECEIVE_BLOCKS":{var n;const o=B(t.blocks),r=new Map(e);return o.forEach(((e,t)=>{""!==t&&r.set(t,e)})),r.set("",(null!==(n=e.get(""))&&void 0!==n?n:[]).concat(o[""])),r}case"INSERT_BLOCKS":{const{rootClientId:n=""}=t,o=e.get(n)||[],r=B(t.blocks,n),{index:l=o.length}=t,i=new Map(e);return r.forEach(((e,t)=>{i.set(t,e)})),i.set(n,C(o,r.get(n),l)),i}case"MOVE_BLOCKS_TO_POSITION":{var o,r;const{fromRootClientId:n="",toRootClientId:l="",clientIds:i}=t,{index:a=e.get(l).length}=t;if(n===l){const t=e.get(l).indexOf(i[0]),n=new Map(e);return n.set(l,S(e.get(l),t,a,i.length)),n}const s=new Map(e);return s.set(n,null!==(o=null===(r=e.get(n))||void 0===r?void 0:r.filter((e=>!i.includes(e))))&&void 0!==o?o:[]),s.set(l,C(e.get(l),i,a)),s}case"MOVE_BLOCKS_UP":{const{clientIds:n,rootClientId:o=""}=t,r=n[0],l=e.get(o);if(!l.length||r===l[0])return e;const i=l.indexOf(r),a=new Map(e);return a.set(o,S(l,i,i-1,n.length)),a}case"MOVE_BLOCKS_DOWN":{const{clientIds:n,rootClientId:o=""}=t,r=n[0],l=n[n.length-1],i=e.get(o);if(!i.length||l===i[i.length-1])return e;const a=i.indexOf(r),s=new Map(e);return s.set(o,S(i,a,a+1,n.length)),s}case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":{const{clientIds:n}=t;if(!t.blocks)return e;const o=B(t.blocks),r=new Map(e);return t.replacedClientIds.forEach((e=>{r.delete(e)})),o.forEach(((e,t)=>{""!==t&&r.set(t,e)})),r.forEach(((e,t)=>{const l=Object.values(e).reduce(((e,t)=>t===n[0]?[...e,...o.get("")]:(-1===n.indexOf(t)&&e.push(t),e)),[]);r.set(t,l)})),r}case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":{const n=new Map(e);return t.removedClientIds.forEach((e=>{n.delete(e)})),n.forEach(((e,o)=>{var r;const l=null!==(r=null==e?void 0:e.filter((e=>!t.removedClientIds.includes(e))))&&void 0!==r?r:[];l.length!==e.length&&n.set(o,l)})),n}}return e},parents(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Map,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"RECEIVE_BLOCKS":{const n=new Map(e);return I(t.blocks).forEach((e=>{let[t,o]=e;n.set(t,o)})),n}case"INSERT_BLOCKS":{const n=new Map(e);return I(t.blocks,t.rootClientId||"").forEach((e=>{let[t,o]=e;n.set(t,o)})),n}case"MOVE_BLOCKS_TO_POSITION":{const n=new Map(e);return t.clientIds.forEach((e=>{n.set(e,t.toRootClientId||"")})),n}case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":{const n=new Map(e);return t.replacedClientIds.forEach((e=>{n.delete(e)})),I(t.blocks,e.get(t.clientIds[0])).forEach((e=>{let[t,o]=e;n.set(t,o)})),n}case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":{const n=new Map(e);return t.removedClientIds.forEach((e=>{n.delete(e)})),n}}return e},controlledInnerBlocks(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{type:t,clientId:n,hasControlledInnerBlocks:o}=arguments.length>1?arguments[1]:void 0;return"SET_HAS_CONTROLLED_INNER_BLOCKS"===t?{...e,[n]:o}:e}});function O(){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 D=(0,g.combineReducers)({blocks:A,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},isBlockInterfaceHidden:function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"HIDE_BLOCK_INTERFACE":return!0;case"SHOW_BLOCK_INTERFACE":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:O(r.selectionStart,l),selectionEnd:O(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 Object.fromEntries(Object.entries(e).filter((e=>{let[n]=e;return!t.clientIds.includes(n)})));case"UPDATE_BLOCK_LIST_SETTINGS":{const{clientId:n}=t;if(!t.settings){if(e.hasOwnProperty(n)){const{[n]:t,...o}=e;return o}return e}return k()(e[n],t.settings)?e:{...e,[n]:t.settings}}}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:n,index:o,__unstableWithInserter:r,operation:l}=t,i={rootClientId:n,index:o,__unstableWithInserter:r,operation:l};return k()(e,i)?e:i}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]:E,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]:y,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:r}=n,l=(0,g.select)(a.store).getActiveBlockVariation(r,o);let i=null!=l&&l.name?`${r}/${l.name}`:r;const s={name:i};return"core/block"===r&&(s.ref=o.ref,i+="/"+o.ref),{...e,insertUsage:{...e.insertUsage,[i]:{time:t.time,count:e.insertUsage[i]?e.insertUsage[i].count+1:1,insert:s}}}}),e)}return e},lastBlockAttributesChange: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"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 e},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":case"REPLACE_BLOCKS":case"REPLACE_INNER_BLOCKS":if(!n.blocks.length)return t;const o=n.blocks.map((e=>e.clientId));return{clientIds:o,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},blockVisibility:function(){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}}),z={};function F(e){return[e]}function V(e,t,n){var o;if(e.length!==t.length)return!1;for(o=n;o(o,r)=>{let l,i;if("function"==typeof e?(l=e(o),i=e(r)):(l=o[e],i=r[e]),l>i)return"asc"===n?1:-1;if(i>l)return"asc"===n?-1:1;const a=t.findIndex((e=>e===o)),s=t.findIndex((e=>e===r));return a>s?1:s>a?-1:0};function Y(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"asc";return e.concat().sort(q(t,e,n))}const Z=[];function Q(e,t){const n=e.blocks.byClientId.get(t),o="core/social-link";if("web"!==u.Platform.OS&&(null==n?void 0:n.name)===o){const n=e.blocks.attributes.get(t),{service:r}=null!=n?n:{};return r?`core/social-link-${r}`:o}return n?n.name:null}function X(e,t){const n=e.blocks.byClientId.get(t);return!!n&&n.isValid}function J(e,t){return e.blocks.byClientId.get(t)?e.blocks.attributes.get(t):null}function ee(e,t){return e.blocks.byClientId.has(t)?e.blocks.tree.get(t):null}const te=H(((e,t)=>e.blocks.byClientId.has(t)?{...e.blocks.byClientId.get(t),attributes:J(e,t)}:null),((e,t)=>[e.blocks.byClientId.get(t),e.blocks.attributes.get(t)]));function ne(e,t){var n;const o=t&&Zt(e,t)?"controlled||"+t:t||"";return(null===(n=e.blocks.tree.get(o))||void 0===n?void 0:n.innerBlocks)||Z}const oe=H(((e,t)=>({clientId:t,innerBlocks:re(e,t)})),(e=>[e.blocks.order])),re=H((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return $e(e,t).map((t=>oe(e,t)))}),(e=>[e.blocks.order])),le=H(((e,t)=>{const n=[];for(const o of t)for(const t of $e(e,o))n.push(t,...le(e,[t]));return n}),(e=>[e.blocks.order])),ie=H((e=>{const t=[];for(const n of $e(e))t.push(n,...le(e,[n]));return t}),(e=>[e.blocks.order])),ae=H(((e,t)=>{const n=ie(e);return t?n.reduce(((n,o)=>e.blocks.byClientId.get(o).name===t?n+1:n),0):n.length}),(e=>[e.blocks.order,e.blocks.byClientId])),se=H(((e,t)=>{if(!t)return Z;const n=ie(e).filter((n=>e.blocks.byClientId.get(n).name===t));return n.length>0?n:Z}),(e=>[e.blocks.order,e.blocks.byClientId])),ce=H(((e,t)=>(Array.isArray(t)?t:[t]).map((t=>ee(e,t)))),((e,t)=>(Array.isArray(t)?t:[t]).map((t=>e.blocks.tree.get(t))))),ue=H(((e,t)=>ce(e,t).filter(Boolean).map((e=>e.name))),((e,t)=>ce(e,t)));function de(e,t){return $e(e,t).length}function pe(e){return e.selection.selectionStart}function me(e){return e.selection.selectionEnd}function ge(e){return e.selection.selectionStart.clientId}function fe(e){return e.selection.selectionEnd.clientId}function he(e){const t=Me(e).length;return t||(e.selection.selectionStart.clientId?1:0)}function ve(e){const{selectionStart:t,selectionEnd:n}=e.selection;return!!t.clientId&&t.clientId===n.clientId}function be(e){const{selectionStart:t,selectionEnd:n}=e.selection,{clientId:o}=t;return o&&o===n.clientId?o:null}function ke(e){const t=be(e);return t?ee(e,t):null}function _e(e,t){return e.blocks.parents.has(t)?e.blocks.parents.get(t):null}const ye=H((function(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const o=[];let r=t;for(;e.blocks.parents.get(r);)r=e.blocks.parents.get(r),o.push(r);return n?o:o.reverse()}),(e=>[e.blocks.parents])),Ee=H((function(e,t,n){let o=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const r=ye(e,t,o);return r.map((t=>({id:t,name:Q(e,t)}))).filter((e=>{let{name:t}=e;return Array.isArray(n)?n.includes(t):t===n})).map((e=>{let{id:t}=e;return t}))}),(e=>[e.blocks.parents]));function Ce(e,t){let n,o=t;do{n=o,o=e.blocks.parents.get(o)}while(o);return n}function Se(e,t){const n=be(e),o=[...ye(e,t),t],r=[...ye(e,n),n];let l;const i=Math.min(o.length,r.length);for(let e=0;e2&&void 0!==arguments[2]?arguments[2]:1;if(void 0===t&&(t=be(e)),void 0===t&&(t=n<0?Pe(e):Le(e)),!t)return null;const o=_e(e,t);if(null===o)return null;const{order:r}=e.blocks,l=r.get(o),i=l.indexOf(t),a=i+1*n;return a<0||a===l.length?null:l[a]}function Be(e,t){return we(e,t,-1)}function Ie(e,t){return we(e,t,1)}function xe(e){return e.initialPosition}const Te=H((e=>{const{selectionStart:t,selectionEnd:n}=e.selection;if(!t.clientId||!n.clientId)return Z;if(t.clientId===n.clientId)return[t.clientId];const o=_e(e,t.clientId);if(null===o)return Z;const r=$e(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 Me(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId===n.clientId?Z:Te(e)}const Ne=H((e=>{const t=Me(e);return t.length?t.map((t=>ee(e,t))):Z}),(e=>[...Te.getDependants(e),e.blocks.byClientId,e.blocks.order,e.blocks.attributes]));function Pe(e){return Me(e)[0]||null}function Le(e){const t=Me(e);return t[t.length-1]||null}function Re(e,t){return Pe(e)===t}function Ae(e,t){return-1!==Me(e).indexOf(t)}const Oe=H(((e,t)=>{let n=t,o=!1;for(;n&&!o;)n=_e(e,n),o=Ae(e,n);return o}),(e=>[e.blocks.order,e.selection.selectionStart.clientId,e.selection.selectionEnd.clientId]));function De(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId===n.clientId?null:t.clientId||null}function ze(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId===n.clientId?null:n.clientId||null}function Fe(e){const t=pe(e),n=me(e);return!t.attributeKey&&!n.attributeKey&&void 0===t.offset&&void 0===n.offset}function Ve(e){const t=pe(e),n=me(e);return!!t&&!!n&&t.clientId===n.clientId&&t.attributeKey===n.attributeKey&&t.offset===n.offset}function He(e){return Te(e).some((t=>{const n=Q(e,t);return!(0,a.getBlockType)(n).merge}))}function Ge(e,t){const n=pe(e),o=me(e);if(n.clientId===o.clientId)return!1;if(!n.attributeKey||!o.attributeKey||void 0===n.offset||void 0===o.offset)return!1;const r=_e(e,n.clientId);if(r!==_e(e,o.clientId))return!1;const l=$e(e,r);let i,s;l.indexOf(n.clientId)>l.indexOf(o.clientId)?(i=o,s=n):(i=n,s=o);const c=t?s.clientId:i.clientId,u=t?i.clientId:s.clientId,d=Q(e,c);if(!(0,a.getBlockType)(d).merge)return!1;const p=ee(e,u);if(p.name===d)return!0;const m=(0,a.switchToBlockType)(p,d);return m&&m.length}const Ue=e=>{const t=pe(e),n=me(e);if(t.clientId===n.clientId)return Z;if(!t.attributeKey||!n.attributeKey||void 0===t.offset||void 0===n.offset)return Z;const o=_e(e,t.clientId);if(o!==_e(e,n.clientId))return Z;const r=$e(e,o),l=r.indexOf(t.clientId),i=r.indexOf(n.clientId),[s,c]=l>i?[n,t]:[t,n],u=ee(e,s.clientId),d=(0,a.getBlockType)(u.name),p=ee(e,c.clientId),m=(0,a.getBlockType)(p.name),g=u.attributes[s.attributeKey],f=p.attributes[c.attributeKey],h=d.attributes[s.attributeKey],v=m.attributes[c.attributeKey];let b=(0,$.create)({html:g,...K(h)}),k=(0,$.create)({html:f,...K(v)});return b=(0,$.remove)(b,0,s.offset),k=(0,$.remove)(k,c.offset,k.text.length),[{...u,attributes:{...u.attributes,[s.attributeKey]:(0,$.toHTMLString)({value:b,...K(h)})}},{...p,attributes:{...p.attributes,[c.attributeKey]:(0,$.toHTMLString)({value:k,...K(v)})}}]};function $e(e,t){return e.blocks.order.get(t||"")||Z}function je(e,t){return $e(e,_e(e,t)).indexOf(t)}function We(e,t){const{selectionStart:n,selectionEnd:o}=e.selection;return n.clientId===o.clientId&&n.clientId===t}function Ke(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return $e(e,t).some((t=>We(e,t)||Ae(e,t)||n&&Ke(e,t,n)))}function qe(e,t){if(!t)return!1;const n=Me(e),o=n.indexOf(t);return o>-1&&ont(e,t)))}function rt(){return W()('wp.data.select( "core/block-editor" ).isCaretWithinFormattedText',{since:"6.1",version:"6.3"}),!1}const lt=H((e=>{let t,n;const{insertionPoint:o,selection:{selectionEnd:r}}=e;if(null!==o)return o;const{clientId:l}=r;return l?(t=_e(e,l)||void 0,n=je(e,r.clientId)+1):n=$e(e).length,{rootClientId:t,index:n}}),(e=>[e.insertionPoint,e.selection.selectionEnd.clientId,e.blocks.parents,e.blocks.order]));function it(e){return null!==e.insertionPoint}function at(e){return e.template.isValid}function st(e){return e.settings.template}function ct(e,t){var n,o,r;return t?null!==(n=null===(o=Dt(e,t))||void 0===o?void 0:o.templateLock)&&void 0!==n&&n:null!==(r=e.settings.templateLock)&&void 0!==r&&r}const ut=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},dt=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,a.getBlockType)(t),!n)return!1;const{allowedBlockTypes:r}=zt(e),l=ut(r,t,!0);if(!l)return!1;const i=!!ct(e,o);if(i)return!1;const c=Dt(e,o);if(o&&void 0===c)return!1;const u=null==c?void 0:c.allowedBlocks,d=ut(u,t),p=n.parent,m=Q(e,o),g=ut(p,m);let f=!0;const h=n.ancestor;if(h){f=[o,...ye(e,o)].some((t=>ut(h,Q(e,t))))}const v=f&&(null===d&&null===g||!0===d||!0===g);return v?(0,s.applyFilters)("blockEditor.__unstableCanInsertBlockType",v,n,o,{getBlock:ee.bind(null,e),getBlockParentsByBlockName:Ee.bind(null,e)}):v},pt=H(dt,((e,t,n)=>[e.blockListSettings[n],e.blocks.byClientId.get(n),e.settings.allowedBlockTypes,e.settings.templateLock]));function mt(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return t.every((t=>pt(e,Q(e,t),n)))}function gt(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=!!ct(e,n);return void 0===r||void 0===(null==r?void 0:r.remove)?!l:!(null!=r&&r.remove)}function ft(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return t.every((t=>gt(e,t,n)))}function ht(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"===ct(e,n);return void 0===r||void 0===(null==r?void 0:r.move)?!l:!(null!=r&&r.move)}function vt(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return t.every((t=>ht(e,t,n)))}function bt(e,t){const n=J(e,t);if(null===n)return!0;const{lock:o}=n;return!(null!=o&&o.edit)}function kt(e,t){var n;return!!(0,a.hasBlockSupport)(t,"lock",!0)&&!(null===(n=e.settings)||void 0===n||!n.canLockBlocks)}function _t(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 yt=(e,t,n)=>!!(0,a.hasBlockSupport)(t,"inserter",!0)&&dt(e,t.name,n),Et=(e,t)=>n=>{const o=`${t.id}/${n.name}`,{time:r,count:l=0}=_t(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:Ct(r,l)}},Ct=(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}},St=(e,t)=>{let{buildScope:n="inserter"}=t;return t=>{const o=t.name;let r=!1;(0,a.hasBlockSupport)(t.name,"multiple",!0)||(r=ce(e,ie(e)).some((e=>{let{name:n}=e;return n===t.name})));const{time:l,count:i=0}=_t(e,o)||{},s={id:o,name:t.name,title:t.title,icon:t.icon,isDisabled:r,frecency:Ct(l,i)};if("transform"===n)return s;const c=(0,a.getBlockVariations)(t.name,"inserter");return{...s,initialAttributes:{},description:t.description,category:t.category,keywords:t.keywords,variations:c,example:t.example,utility:1}}},wt=H((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const n=St(e,{buildScope:"inserter"}),o=/^\s*)[^])*)\5|[^]*?)}\s+)?(\/)?-->/,r=t=>{let n=U;if("web"===u.Platform.OS){const e=("string"==typeof t.content.raw?t.content.raw:t.content).match(o);if(e){const[,,t="core/",o]=e,r=(0,a.getBlockType)(t+o);r&&(n=r.icon)}}const r=`core/block/${t.id}`,{time:l,count:i=0}=_t(e,r)||{},s=Ct(l,i);return{id:r,name:"core/block",initialAttributes:{ref:t.id},title:t.title.raw,icon:n,category:"reusable",keywords:[],isDisabled:!1,utility:1,frecency:s}},l=(0,a.getBlockTypes)().filter((n=>yt(e,n,t))).map(n),i=dt(e,"core/block",t)?$t(e).map(r):[],s=l.reduce(((t,n)=>{const{variations:o=[]}=n;if(o.some((e=>{let{isDefault:t}=e;return t}))||t.push(n),o.length){const r=Et(e,n);t.push(...o.map(r))}return t}),[]),c=(e,t)=>{const{core:n,noncore:o}=e;return(t.name.startsWith("core/")?n:o).push(t),e},{core:d,noncore:p}=s.reduce(c,{core:[],noncore:[]}),m=[...d,...p];return[...m,...i]}),((e,t)=>[e.blockListSettings[t],e.blocks.byClientId,e.blocks.order,e.preferences.insertUsage,e.settings.allowedBlockTypes,e.settings.templateLock,$t(e),(0,a.getBlockTypes)()])),Bt=H((function(e,t){var n;let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const r=Array.isArray(t)?t:[t],[l]=r,i=St(e,{buildScope:"transform"}),s=(0,a.getBlockTypes)().filter((t=>yt(e,t,o))).map(i),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,_.__)("Unwrap"),icon:null===(n=c[null==l?void 0:l.name])||void 0===n?void 0:n.icon};const u=(0,a.getPossibleBlockTransformations)(r).reduce(((e,t)=>("*"===t?e.push(c["*"]):c[null==t?void 0:t.name]&&e.push(c[t.name]),e)),[]);return Y(u,(e=>c[e.name].frecency),"desc")}),((e,t,n)=>[e.blockListSettings[n],e.blocks.byClientId,e.preferences.insertUsage,e.settings.allowedBlockTypes,e.settings.templateLock,(0,a.getBlockTypes)()])),It=H((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const n=(0,a.getBlockTypes)().some((n=>yt(e,n,t)));if(n)return!0;const o=dt(e,"core/block",t)&&$t(e).length>0;return o}),((e,t)=>[e.blockListSettings[t],e.blocks.byClientId,e.settings.allowedBlockTypes,e.settings.templateLock,$t(e),(0,a.getBlockTypes)()])),xt=H((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(t)return(0,a.getBlockTypes)().filter((n=>yt(e,n,t)))}),((e,t)=>[e.blockListSettings[t],e.blocks.byClientId,e.settings.allowedBlockTypes,e.settings.templateLock,(0,a.getBlockTypes)()])),Tt=H((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return W()('wp.data.select( "core/block-editor" ).__experimentalGetAllowedBlocks',{alternative:'wp.data.select( "core/block-editor" ).getAllowedBlocks',since:"6.2",version:"6.4"}),xt(e,t)}),((e,t)=>[...xt.getDependants(e,t)])),Mt=H((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(ee(e,o))?r:null:r:void 0}),((e,t)=>[e.blockListSettings[t],e.blocks.tree.get(t)])),Nt=H(((e,t)=>{const n=e.settings.__experimentalBlockPatterns.find((e=>{let{name:n}=e;return n===t}));return n?{...n,blocks:(0,a.parse)(n.content,{__unstableSkipMigrationLogs:!0})}:null}),(e=>[e.settings.__experimentalBlockPatterns])),Pt=H((e=>{const t=e.settings.__experimentalBlockPatterns,{allowedBlockTypes:n}=zt(e),o=t.filter((e=>{let{inserter:t=!0}=e;return!!t})).map((t=>{let{name:n}=t;return Nt(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(!ut(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])),Lt=H((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const n=Pt(e),o=n.filter((n=>{let{blocks:o}=n;return o.every((n=>{let{name:o}=n;return pt(e,o,t)}))}));return o}),((e,t)=>[e.settings.__experimentalBlockPatterns,e.settings.allowedBlockTypes,e.settings.templateLock,e.blockListSettings[t],e.blocks.byClientId.get(t)])),Rt=H((function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!t)return Z;const o=Lt(e,n),r=Array.isArray(t)?t:[t],l=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)))}));return 0===l.length?Z:l}),((e,t,n)=>[...Lt.getDependants(e,n)])),At=H((function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return W()('wp.data.select( "core/block-editor" ).__experimentalGetPatternsByBlockTypes',{alternative:'wp.data.select( "core/block-editor" ).getPatternsByBlockTypes',since:"6.2",version:"6.4"}),Rt(e,t,n)}),((e,t,n)=>[...Lt.getDependants(e,n)])),Ot=H((function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!t)return Z;if(t.some((t=>{let{clientId:n,innerBlocks:o}=t;return o.length||Zt(e,n)})))return Z;const o=Array.from(new Set(t.map((e=>{let{name:t}=e;return t}))));return Rt(e,o,n)}),((e,t,n)=>[...Rt.getDependants(e,n)]));function Dt(e,t){return e.blockListSettings[t]}function zt(e){return e.settings}function Ft(e){return e.blocks.isPersistentChange}const Vt=H((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])),Ht=H(((e,t)=>{var n;const o=$t(e).find((e=>e.id===t));return o?null===(n=o.title)||void 0===n?void 0:n.raw:null}),(e=>[$t(e)]));function Gt(e){return e.blocks.isIgnoredChange}function Ut(e){return e.lastBlockAttributesChange}function $t(e){var t,n;return null!==(t=null==e||null===(n=e.settings)||void 0===n?void 0:n.__experimentalReusableBlocks)&&void 0!==t?t:Z}function jt(e){return"navigation"===e.editorMode}function Wt(e){return e.editorMode}function Kt(e){return e.hasBlockMovingClientId}function qt(e){return!!e.automaticChangeStatus}function Yt(e,t){return e.highlightedBlock===t}function Zt(e,t){return!!e.blocks.controlledInnerBlocks[t]}const Qt=H(((e,t)=>{if(!t.length)return null;const n=be(e);if(t.includes(Q(e,n)))return n;const o=Me(e),r=Ee(e,n||o[0],t);return r?r[r.length-1]:null}),((e,t)=>[e.selection.selectionStart.clientId,e.selection.selectionEnd.clientId,t]));function Xt(e,t,n){var o;const{lastBlockInserted:r}=e;return(null===(o=r.clientIds)||void 0===o?void 0:o.includes(t))&&r.source===n}function Jt(e,t){var n,o;return null===(n=null===(o=e.blockVisibility)||void 0===o?void 0:o[t])||void 0===n||n}const en=H((e=>new Set(Object.keys(e.blockVisibility).filter((t=>e.blockVisibility[t])))),(e=>[e.blockVisibility])),tn=H(((e,t)=>{let n,o=t;for(;e.blocks.parents.has(o);)o=e.blocks.parents.get(o),o&&"contentOnly"===ct(e,o)&&(n=o);return n}),(e=>[e.blocks.parents,e.blockListSettings]));function nn(e){return e.temporarilyEditingAsBlocks}function on(e,t){if(!bt(e,t))return!0;const n=Wt(e);if("zoom-out"===n&&t&&!_e(e,t))return!0;const o=(0,a.hasBlockSupport)(Q(e,t),"__experimentalDisableBlockOverlay",!1);return("navigation"===n||!o&&Zt(e,t))&&!We(e,t)&&!Ke(e,t,!0)}function rn(e,t){let n=e.blocks.parents.get(t);for(;n;){if(on(e,n))return!0;n=e.blocks.parents.get(n)}return!1}const ln=["inserterMediaCategories","blockInspectorAnimation"];function an(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=e;if(t&&"web"===u.Platform.OS){n={};for(const t in e)ln.includes(t)||(n[t]=e[t])}return{type:"UPDATE_SETTINGS",settings:n}}function sn(){return{type:"HIDE_BLOCK_INTERFACE"}}function cn(){return{type:"SHOW_BLOCK_INTERFACE"}}function un(e){return e.isBlockInterfaceHidden}function dn(e){var t;return null==e||null===(t=e.lastBlockInserted)||void 0===t?void 0:t.clientIds}var pn=window.wp.a11y;const mn="†";function gn(e){if(e)return Object.keys(e).find((t=>{const n=e[t];return"string"==typeof n&&-1!==n.indexOf(mn)}))}const fn=e=>Array.isArray(e)?e:[e],hn=e=>t=>{let{dispatch:n}=t;n({type:"RESET_BLOCKS",blocks:e}),n(vn(e))},vn=e=>t=>{let{select:n,dispatch:o}=t;const r=n.getTemplate(),l=n.getTemplateLock(),i=!r||"all"!==l||(0,a.doBlocksMatchTemplate)(e,r);if(i!==n.isValidTemplate())return o.setTemplateValidity(i),i};function bn(e,t,n){return{type:"RESET_SELECTION",selectionStart:e,selectionEnd:t,initialPosition:n}}function kn(e){return W()('wp.data.dispatch( "core/block-editor" ).receiveBlocks',{since:"5.9",alternative:"resetBlocks or insertBlocks"}),{type:"RECEIVE_BLOCKS",blocks:e}}function _n(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return{type:"UPDATE_BLOCK_ATTRIBUTES",clientIds:fn(e),attributes:t,uniqueByBlock:n}}function yn(e,t){return{type:"UPDATE_BLOCK",clientId:e,updates:t}}function En(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return{type:"SELECT_BLOCK",initialPosition:t,clientId:e}}const Cn=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return n=>{let{select:o,dispatch:r}=n;const l=o.getPreviousBlockClientId(e);if(l)r.selectBlock(l,-1);else if(t){const t=o.getBlockRootClientId(e);t&&r.selectBlock(t,-1)}}},Sn=e=>t=>{let{select:n,dispatch:o}=t;const r=n.getNextBlockClientId(e);r&&o.selectBlock(r)};function wn(){return{type:"START_MULTI_SELECT"}}function Bn(){return{type:"STOP_MULTI_SELECT"}}const In=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,pn.speak)((0,_.sprintf)((0,_._n)("%s block selected.","%s blocks selected.",i),i),"assertive")}};function xn(){return{type:"CLEAR_SELECTED_BLOCK"}}function Tn(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return{type:"TOGGLE_SELECTION",isSelectionEnabled:e}}function Mn(e,t){var n,o;const r=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,a.hasBlockSupport)(n,"defaultStylePicker",!0))return e;if(!r[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:l={}}=e,i=r[n];return{...e,attributes:{...l,className:`${o||""} is-style-${i}`.trim()}}}))}const Nn=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=fn(e),t=Mn(fn(t),i.getSettings());const s=i.getBlockRootClientId(e[0]);for(let e=0;e{let{select:t,dispatch:n}=e;if(t.getBlockCount()>0)return;const{__unstableHasCustomAppender:o}=t.getSettings();o||n.insertDefaultBlock()}))}};function Pn(e,t){return Nn(e,t)}const Ln=e=>(t,n)=>o=>{let{select:r,dispatch:l}=o;r.canMoveBlocks(t,n)&&l({type:e,clientIds:fn(t),rootClientId:n})},Rn=Ln("MOVE_BLOCKS_DOWN"),An=Ln("MOVE_BLOCKS_UP"),On=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 Dn(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 On([e],t,n,o)}function zn(e,t,n,o,r){return Fn([e],t,n,o,0,r)}const Fn=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,W()("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(fn(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 Vn(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{__unstableWithInserter:o,operation:r}=n;return{type:"SHOW_INSERTION_POINT",rootClientId:e,index:t,__unstableWithInserter:o,operation:r}}const Hn=()=>e=>{let{select:t,dispatch:n}=e;t.isBlockInsertionPointVisible()&&n({type:"HIDE_INSERTION_POINT"})};function Gn(e){return{type:"SET_TEMPLATE_VALIDITY",isValid:e}}const Un=()=>e=>{let{select:t,dispatch:n}=e;n({type:"SYNCHRONIZE_TEMPLATE"});const o=t.getBlocks(),r=t.getTemplate(),l=(0,a.synchronizeBlocksWithTemplate)(o,r);n.resetBlocks(l)},$n=e=>t=>{let{registry:n,select:o,dispatch:r}=t;const l=o.getSelectionStart(),i=o.getSelectionEnd();if(l.clientId===i.clientId)return;if(!l.attributeKey||!i.attributeKey||void 0===l.offset||void 0===i.offset)return!1;const s=o.getBlockRootClientId(l.clientId);if(s!==o.getBlockRootClientId(i.clientId))return;const c=o.getBlockOrder(s);let u,d;c.indexOf(l.clientId)>c.indexOf(i.clientId)?(u=i,d=l):(u=l,d=i);const p=e?d:u,m=o.getBlock(p.clientId),g=(0,a.getBlockType)(m.name);if(!g.merge)return;const f=u,h=d,v=o.getBlock(f.clientId),b=(0,a.getBlockType)(v.name),k=o.getBlock(h.clientId),_=(0,a.getBlockType)(k.name),y=v.attributes[f.attributeKey],E=k.attributes[h.attributeKey],C=b.attributes[f.attributeKey],S=_.attributes[h.attributeKey];let w=(0,$.create)({html:y,...K(C)}),B=(0,$.create)({html:E,...K(S)});w=(0,$.remove)(w,f.offset,w.text.length),B=(0,$.insert)(B,mn,0,h.offset);const I=(0,a.cloneBlock)(v,{[f.attributeKey]:(0,$.toHTMLString)({value:w,...K(C)})}),x=(0,a.cloneBlock)(k,{[h.attributeKey]:(0,$.toHTMLString)({value:B,...K(S)})}),T=e?I:x,M=v.name===k.name?[T]:(0,a.switchToBlockType)(T,g.name);if(!M||!M.length)return;let N;if(e){const e=M.pop();N=g.merge(e.attributes,x.attributes)}else{const e=M.shift();N=g.merge(I.attributes,e.attributes)}const P=gn(N),L=N[P],R=(0,$.create)({html:L,...K(g.attributes[P])}),A=R.text.indexOf(mn),O=(0,$.remove)(R,A,A+1),D=(0,$.toHTMLString)({value:O,...K(g.attributes[P])});N[P]=D;const z=o.getSelectedBlockClientIds(),F=[...e?M:[],{...m,attributes:{...m.attributes,...N}},...e?[]:M];n.batch((()=>{r.selectionChange(m.clientId,P,A,A),r.replaceBlocks(z,F,0,o.getSelectedBlocksInitialCaretPosition())}))},jn=()=>e=>{let{select:t,dispatch:n}=e;const o=t.getSelectionStart(),r=t.getSelectionEnd();if(o.clientId===r.clientId)return;if(!o.attributeKey||!r.attributeKey||void 0===o.offset||void 0===r.offset)return;const l=t.getBlockRootClientId(o.clientId);if(l!==t.getBlockRootClientId(r.clientId))return;const i=t.getBlockOrder(l);let s,c;i.indexOf(o.clientId)>i.indexOf(r.clientId)?(s=r,c=o):(s=o,c=r);const u=s,d=c,p=t.getBlock(u.clientId),m=(0,a.getBlockType)(p.name),g=t.getBlock(d.clientId),f=(0,a.getBlockType)(g.name),h=p.attributes[u.attributeKey],v=g.attributes[d.attributeKey],b=m.attributes[u.attributeKey],k=f.attributes[d.attributeKey];let _=(0,$.create)({html:h,...K(b)}),y=(0,$.create)({html:v,...K(k)});_=(0,$.remove)(_,u.offset,_.text.length),y=(0,$.remove)(y,0,d.offset),n.replaceBlocks(t.getSelectedBlockClientIds(),[{...p,attributes:{...p.attributes,[u.attributeKey]:(0,$.toHTMLString)({value:_,...K(b)})}},(0,a.createBlock)((0,a.getDefaultBlockName)()),{...g,attributes:{...g.attributes,[d.attributeKey]:(0,$.toHTMLString)({value:y,...K(k)})}}],1,t.getSelectedBlocksInitialCaretPosition())},Wn=()=>e=>{let{select:t,dispatch:n}=e;const o=t.getSelectionStart(),r=t.getSelectionEnd();n.selectionChange({start:{clientId:o.clientId},end:{clientId:r.clientId}})},Kn=(e,t)=>n=>{let{registry:o,select:r,dispatch:l}=n;const i=[e,t];l({type:"MERGE_BLOCKS",blocks:i});const[s,c]=i,u=r.getBlock(s),d=(0,a.getBlockType)(u.name);if(!d)return;const p=r.getBlock(c);if(d&&!d.merge){const e=(0,a.switchToBlockType)(p,d.name);if(1!==(null==e?void 0:e.length))return void l.selectBlock(u.clientId);const[t]=e;return t.innerBlocks.length<1?void l.selectBlock(u.clientId):void o.batch((()=>{l.insertBlocks(t.innerBlocks,void 0,s),l.removeBlock(c),l.selectBlock(t.innerBlocks[0].clientId)}))}const m=(0,a.getBlockType)(p.name),{clientId:g,attributeKey:f,offset:h}=r.getSelectionStart(),v=(g===s?d:m).attributes[f],b=(g===s||g===c)&&void 0!==f&&void 0!==h&&!!v;v||("number"==typeof f?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 f):window.console.error("The RichText identifier prop does not match any attributes defined by the block."));const k=(0,a.cloneBlock)(u),_=(0,a.cloneBlock)(p);if(b){const e=g===s?k:_,t=e.attributes[f],n=(0,$.insert)((0,$.create)({html:t,...K(v)}),mn,h,h);e.attributes[f]=(0,$.toHTMLString)({value:n,...K(v)})}const y=u.name===p.name?[_]:(0,a.switchToBlockType)(_,u.name);if(!y||!y.length)return;const E=d.merge(k.attributes,y[0].attributes);if(b){const e=gn(E),t=E[e],n=(0,$.create)({html:t,...K(d.attributes[e])}),o=n.text.indexOf(mn),r=(0,$.remove)(n,o,o+1),i=(0,$.toHTMLString)({value:r,...K(d.attributes[e])});E[e]=i,l.selectionChange(u.clientId,e,o,o)}l.replaceBlocks([u.clientId,p.clientId],[{...u,attributes:{...u.attributes,...E}},...y.slice(1)],0)},qn=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=fn(e);const l=o.getBlockRootClientId(e[0]);o.canRemoveBlocks(e,l)&&(t&&r.selectPreviousBlock(e[0],t),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 Yn(e,t){return qn([e],t)}function Zn(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 Qn(e){return{type:"TOGGLE_BLOCK_MODE",clientId:e}}function Xn(){return{type:"START_TYPING"}}function Jn(){return{type:"STOP_TYPING"}}function eo(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return{type:"START_DRAGGING_BLOCKS",clientIds:e}}function to(){return{type:"STOP_DRAGGING_BLOCKS"}}function no(){return W()('wp.data.dispatch( "core/block-editor" ).enterFormattedText',{since:"6.1",version:"6.3"}),{type:"DO_NOTHING"}}function oo(){return W()('wp.data.dispatch( "core/block-editor" ).exitFormattedText',{since:"6.1",version:"6.3"}),{type:"DO_NOTHING"}}function ro(e,t,n,o){return"string"==typeof e?{type:"SELECTION_CHANGE",clientId:e,attributeKey:t,startOffset:n,endOffset:o}:{type:"SELECTION_CHANGE",...e}}const lo=(e,t,n)=>o=>{let{dispatch:r}=o;const l=(0,a.getDefaultBlockName)();if(!l)return;const i=(0,a.createBlock)(l,e);return r.insertBlock(i,n,t)};function io(e,t){return{type:"UPDATE_BLOCK_LIST_SETTINGS",clientId:e,settings:t}}function ao(e){return an(e,!0)}function so(e,t){return{type:"SAVE_REUSABLE_BLOCK_SUCCESS",id:e,updatedId:t}}function co(){return{type:"MARK_LAST_CHANGE_AS_PERSISTENT"}}function uo(){return{type:"MARK_NEXT_CHANGE_AS_NOT_PERSISTENT"}}const po=()=>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"})}))},mo=function(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return t=>{let{dispatch:n}=t;n.__unstableSetEditorMode(e?"navigation":"edit")}},go=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,pn.speak)((0,_.__)("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,pn.speak)((0,_.__)("You are currently in edit mode. To return to the navigation mode, press Escape.")):"zoom-out"===e&&(0,pn.speak)((0,_.__)("You are currently in zoom-out mode."))},fo=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,pn.speak)((0,_.__)("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."))}},ho=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;const l=o.getBlocksByClientId(e);if(l.some((e=>!e)))return;const i=l.map((e=>e.name));if(i.some((e=>!(0,a.hasBlockSupport)(e,"multiple",!0))))return;const s=o.getBlockRootClientId(e[0]),c=fn(e),u=o.getBlockIndex(c[c.length-1]),d=l.map((e=>(0,a.__experimentalCloneSanitizedBlock)(e)));return r.insertBlocks(d,u+1,s,t),d.length>1&&t&&r.multiSelect(d[0].clientId,d[d.length-1].clientId),d.map((e=>e.clientId))}},vo=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)},bo=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 ko(e,t){return{type:"TOGGLE_BLOCK_HIGHLIGHT",clientId:e,isHighlighted:t}}const _o=e=>async t=>{let{dispatch:n}=t;n(ko(e,!0)),await new Promise((e=>setTimeout(e,150))),n(ko(e,!1))};function yo(e,t){return{type:"SET_HAS_CONTROLLED_INNER_BLOCKS",hasControlledInnerBlocks:t,clientId:e}}function Eo(e){return{type:"SET_BLOCK_VISIBILITY",updates:e}}function Co(e){return{type:"SET_TEMPORARILY_EDITING_AS_BLOCKS",temporarilyEditingAsBlocks:e}}const So="core/block-editor";var wo=window.wp.privateApis;const{lock:Bo,unlock:Io}=(0,wo.__dangerousOptInToUnstableAPIsOnlyForCoreModules)("I know using unstable features means my plugin or theme will inevitably break on the next WordPress release.","@wordpress/block-editor"),xo={reducer:D,selectors:e,actions:l},To=(0,g.createReduxStore)(So,{...xo,persist:["preferences"]}),Mo=(0,g.registerStore)(So,{...xo,persist:["preferences"]});Io(Mo).registerPrivateActions(t),Io(Mo).registerPrivateSelectors(r);const No={name:"",isSelected:!1},Po=(0,u.createContext)(No),{Provider:Lo}=Po;function Ro(){return(0,u.useContext)(Po)}function Ao(){const{isSelected:e,clientId:t,name:n}=Ro();return(0,g.useSelect)((o=>{if(e)return!0;const{getBlockName:r,isFirstMultiSelectedBlock:l,getMultiSelectedBlockClientIds:i}=o(To);return!!l(t)&&i().every((e=>r(e)===n))}),[t,e,n])}function Oo(e){let{group:t="default",controls:n,children:o,__experimentalShareWithChildBlocks:r=!1}=e;const l=function(e,t){const n=Ao(),{clientId:o}=Ro(),r=(0,g.useSelect)((e=>{const{getBlockName:n,hasSelectedInnerBlock:r}=e(To),{hasBlockSupport:l}=e(a.store);return t&&l(n(o),"__experimentalExposeControlsToChildren",!1)&&r(o)}),[t,o]);var l;return n?null===(l=v[e])||void 0===l?void 0:l.Fill:r?v.parent.Fill:null}(t,r);return l?(0,u.createElement)(h.__experimentalStyleProvider,{document:document},(0,u.createElement)(l,null,(e=>{const r=(0,f.isEmpty)(e)?null:e;return(0,u.createElement)(h.__experimentalToolbarContext.Provider,{value:r},"default"===t&&(0,u.createElement)(h.ToolbarGroup,{controls:n}),o)}))):null}function Do(e){let{group:t="default",...n}=e;const o=(0,u.useContext)(h.__experimentalToolbarContext),r=v[t].Slot,l=(0,h.__experimentalUseSlotFills)(r.__unstableName);return Boolean(l&&l.length)?"default"===t?(0,u.createElement)(r,c({},n,{bubblesVirtually:!0,fillProps:o})):(0,u.createElement)(h.ToolbarGroup,null,(0,u.createElement)(r,c({},n,{bubblesVirtually:!0,fillProps:o}))):null}const zo=Oo;zo.Slot=Do;const Fo=e=>(0,u.createElement)(Oo,c({group:"inline"},e));Fo.Slot=e=>(0,u.createElement)(Do,c({group:"inline"},e));var Vo=zo;var Ho=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"M9 9v6h11V9H9zM4 20h1.5V4H4v16z"}));var Go=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"M20 9h-7.2V4h-1.6v5H4v6h7.2v5h1.6v-5H20z"}));var Uo=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"M4 15h11V9H4v6zM18.5 4v16H20V4h-1.5z"}));var $o=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"M9 15h6V9H9v6zm-5 5h1.5V4H4v16zM18.5 4v16H20V4h-1.5z"}));var jo=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"M4 4H5.5V20H4V4ZM7 10L17 10V14L7 14V10ZM20 4H18.5V20H20V4Z"}));var Wo=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"m14.5 6.5-1 1 3.7 3.7H4v1.6h13.2l-3.7 3.7 1 1 5.6-5.5z"}));var Ko=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"m16.5 13.5-3.7 3.7V4h-1.5v13.2l-3.8-3.7-1 1 5.5 5.6 5.5-5.6z"}));function qo(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 Yo(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+=`${qo(e,t.selector.trim())} { `,i+=Object.entries(t.rules).map((e=>{let[t,n]=e;return`${t}: ${n||o}`})).join("; "),i+="; }"})),i}function Zo(e){const{contentSize:t,wideSize:n}=e,o={},r=/^(?!0)\d+(px|em|rem|vw|vh|%)?$/i;return r.test(t)&&(o.none=(0,_.sprintf)((0,_.__)("Max %s wide"),t)),r.test(n)&&(o.wide=(0,_.sprintf)((0,_.__)("Max %s wide"),n)),o}const Qo=(0,u.createContext)({refs:new Map,callbacks:new Map});function Xo(e){let{children:t}=e;const n=(0,u.useMemo)((()=>({refs:new Map,callbacks:new Map})),[]);return(0,u.createElement)(Qo.Provider,{value:n},t)}function Jo(e){const{refs:t,callbacks:n}=(0,u.useContext)(Qo),o=(0,u.useRef)();return(0,u.useLayoutEffect)((()=>(t.set(o,e),()=>{t.delete(o)})),[e]),(0,m.useRefEffect)((t=>{o.current=t,n.forEach(((n,o)=>{e===n&&o(t)}))}),[e])}function er(e){const{refs:t}=(0,u.useContext)(Qo),n=(0,u.useRef)();return n.current=e,(0,u.useMemo)((()=>({get current(){let e=null;for(const[o,r]of t.entries())r===n.current&&o.current&&(e=o.current);return e}})),[])}function tr(e){const{callbacks:t}=(0,u.useContext)(Qo),n=er(e),[o,r]=(0,u.useState)(null);return(0,u.useLayoutEffect)((()=>{if(e)return t.set(r,e),()=>{t.delete(r)}}),[e]),n.current||o}function nr(e){return!(null==e||!e.includes)&&("0"===e||e.includes("var:preset|spacing|"))}function or(e){if(!e)return;const t=e.match(/var:preset\|spacing\|(.+)/);return t?`var(--wp--preset--spacing--${t[1]})`:e}function rr(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 lr={all:(0,_.__)("All sides"),top:(0,_.__)("Top"),bottom:(0,_.__)("Bottom"),left:(0,_.__)("Left"),right:(0,_.__)("Right"),mixed:(0,_.__)("Mixed"),vertical:(0,_.__)("Vertical"),horizontal:(0,_.__)("Horizontal")},ir={top:void 0,right:void 0,bottom:void 0,left:void 0},ar=["top","right","bottom","left"];function sr(e){return e.sort(((t,n)=>e.filter((e=>e===t)).length-e.filter((e=>e===n)).length)).pop()}function cr(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ar;return Object.values(e).length>=1&&Object.values(e).length1}function ur(e){return null!=e&&Object.values(e).filter((e=>!!e)).length>0}var dr=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.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 pr=["color","border","dimensions","typography","spacing"],mr={"color.palette":e=>e.colors,"color.gradients":e=>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=>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},gr={"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 fr(e){const{name:t,clientId:n}=Ro();return(0,g.useSelect)((o=>{if(pr.includes(e))return void console.warn("Top level useSetting paths are disabled. Please use a subpath to query the information needed.");let r=(0,s.applyFilters)("blockEditor.useSetting.before",void 0,e,n,t);if(void 0!==r)return r;const l=(e=>gr[e]||e)(e),i=[n,...o(To).getBlockParents(n,!0)];for(const e of i){const n=o(To).getBlockName(e);if((0,a.hasBlockSupport)(n,"__experimentalSettings",!1)){var c;const n=o(To).getBlockAttributes(e);if(r=null!==(c=(0,f.get)(n,`settings.blocks.${t}.${l}`))&&void 0!==c?c:(0,f.get)(n,`settings.${l}`),void 0!==r)break}}const u=o(To).getSettings();if(void 0===r){var d;const e=`__experimentalFeatures.${l}`,n=`__experimentalFeatures.blocks.${t}.${l}`;r=null!==(d=(0,f.get)(u,n))&&void 0!==d?d:(0,f.get)(u,e)}var p,m;if(void 0!==r)return a.__EXPERIMENTAL_PATHS_WITH_MERGE[l]?null!==(p=null!==(m=r.custom)&&void 0!==m?m:r.theme)&&void 0!==p?p:r.default:r;const g=mr[l]?mr[l](u):void 0;return void 0!==g?g:"typography.dropCap"===l||void 0}),[t,n,e])}const hr={px:{max:300,steps:1},"%":{max:100,steps:1},vw:{max:100,steps:1},vh:{max:100,steps:1},em:{max:10,steps:.1},rm:{max:10,steps:.1}};function vr(e){var t,n,o,r,l;let{spacingSizes:i,value:a,side:s,onChange:c,isMixed:d=!1,type:m,minimumCustomValue:f,onMouseOver:v,onMouseOut:b}=e;a=function(e,t){if(nr(e))return e;const n=t.find((t=>String(t.size)===String(e)));return null!=n&&n.slug?`var:preset|spacing|${n.slug}`:e}(a,i);let k=i;const y=i.length<=8,E=(0,g.useSelect)((e=>{const t=e(To).getSettings();return null==t?void 0:t.disableCustomSpacingSizes})),[C,S]=(0,u.useState)(!E&&void 0!==a&&!nr(a)),w=(0,h.__experimentalUseCustomUnits)({availableUnits:fr("spacing.units")||["px","em","rem"]});let B=null;!y&&!C&&void 0!==a&&(!nr(a)||nr(a)&&d)?(k=[...i,{name:d?(0,_.__)("Mixed"):(0,_.sprintf)((0,_.__)("Custom (%s)"),a),slug:"custom",size:a}],B=k.length-1):d||(B=C?function(e,t){if(!nr(e))return e;const n=rr(e),o=t.find((e=>String(e.slug)===n));return null==o?void 0:o.size}(a,i):function(e,t){if(void 0===e)return 0;const n=0===parseFloat(e,10)?"0":rr(e),o=t.findIndex((e=>String(e.slug)===n));return-1!==o?o:NaN}(a,i));const I=(0,u.useMemo)((()=>(0,h.__experimentalParseQuantityAndUnitFromRawValue)(B)),[B])[1]||w[0].value,x=e=>{var t;return void 0===a||null===(t=i[e])||void 0===t?void 0:t.name},T=parseFloat(B,10),M=(e,t)=>{var n;const o=parseInt(e,10);if("selectList"===t){if(0===o)return;if(1===o)return"0"}else if(0===o)return"0";return`var:preset|spacing|${null===(n=i[e])||void 0===n?void 0:n.slug}`},N=d?(0,_.__)("Mixed"):null,P=d?(0,_.__)("Mixed"):x(B),L=k.map(((e,t)=>({key:t,name:e.name}))),R=i.map(((e,t)=>({value:t,label:void 0}))),A=(0,_.sprintf)((0,_.__)("%1$s %2$s"),lr[s],null==m?void 0:m.toLowerCase()),O=y&&!C&&void 0!==P;return(0,u.createElement)(u.Fragment,null,"all"!==s&&(0,u.createElement)(h.__experimentalHStack,{className:"components-spacing-sizes-control__side-labels"},(0,u.createElement)(h.BaseControl.VisualLabel,{className:"components-spacing-sizes-control__side-label"},lr[s]),O&&(0,u.createElement)(h.BaseControl.VisualLabel,{className:"components-spacing-sizes-control__hint-single"},P)),"all"===s&&O&&(0,u.createElement)(h.BaseControl.VisualLabel,{className:"components-spacing-sizes-control__hint-all"},P),!E&&(0,u.createElement)(h.Button,{label:C?(0,_.__)("Use size preset"):(0,_.__)("Set custom size"),icon:dr,onClick:()=>{S(!C)},isPressed:C,isSmall:!0,className:p()({"components-spacing-sizes-control__custom-toggle-all":"all"===s,"components-spacing-sizes-control__custom-toggle-single":"all"!==s}),iconSize:24}),C&&(0,u.createElement)(u.Fragment,null,(0,u.createElement)(h.__experimentalUnitControl,{onMouseOver:v,onMouseOut:b,onFocus:v,onBlur:b,onChange:e=>c((e=>isNaN(parseFloat(e))?void 0:e)(e)),value:B,units:w,min:f,placeholder:N,disableUnits:d,label:A,hideLabelFromVision:!0,className:"components-spacing-sizes-control__custom-value-input",size:"__unstable-large"}),(0,u.createElement)(h.RangeControl,{onMouseOver:v,onMouseOut:b,onFocus:v,onBlur:b,value:T,min:0,max:null!==(t=null===(n=hr[I])||void 0===n?void 0:n.max)&&void 0!==t?t:10,step:null!==(o=null===(r=hr[I])||void 0===r?void 0:r.steps)&&void 0!==o?o:.1,withInputField:!1,onChange:e=>{c([e,I].join(""))},className:"components-spacing-sizes-control__custom-value-range",__nextHasNoMarginBottom:!0})),y&&!C&&(0,u.createElement)(h.RangeControl,{onMouseOver:v,onMouseOut:b,className:"components-spacing-sizes-control__range-control",value:B,onChange:e=>c(M(e)),onMouseDown:e=>{var t;(null==e||null===(t=e.nativeEvent)||void 0===t?void 0:t.offsetX)<35&&void 0===a&&c("0")},withInputField:!1,"aria-valuenow":B,"aria-valuetext":null===(l=i[B])||void 0===l?void 0:l.name,renderTooltipContent:x,min:0,max:i.length-1,marks:R,label:A,hideLabelFromVision:!0,__nextHasNoMarginBottom:!0,onFocus:v,onBlur:b}),!y&&!C&&(0,u.createElement)(h.CustomSelectControl,{className:"components-spacing-sizes-control__custom-select-control",value:L.find((e=>e.key===B))||"",onChange:e=>{c(M(e.selectedItem.key,"selectList"))},options:L,label:A,hideLabelFromVision:!0,__nextUnconstrainedWidth:!0,size:"__unstable-large",onMouseOver:v,onMouseOut:b,onFocus:v,onBlur:b}))}function br(e){let{onChange:t,values:n,sides:o,spacingSizes:r,type:l,minimumCustomValue:i,onMouseOver:a,onMouseOut:s}=e;const c=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return sr(Object.values(e))}(n),d=ur(n)&&cr(n,o);return(0,u.createElement)(vr,{value:c,onChange:e=>{const r=(0,h.__experimentalApplyValueToSides)(n,e,o);t(r)},side:"all",spacingSizes:r,isMixed:d,type:l,minimumCustomValue:i,onMouseOver:a,onMouseOut:s})}function kr(e){let{values:t,sides:n,onChange:o,spacingSizes:r,type:l,minimumCustomValue:i,onMouseOver:a,onMouseOut:s}=e;const c=null!=n&&n.length?ar.filter((e=>n.includes(e))):ar,d=e=>n=>{const r={...t};r[e]=n,o(r)};return(0,u.createElement)(u.Fragment,null,c.map((e=>(0,u.createElement)(vr,{value:t[e],label:lr[e],key:`spacing-sizes-control-${e}`,withInputField:!1,side:e,onChange:d(e),spacingSizes:r,type:l,minimumCustomValue:i,onMouseOver:a,onMouseOut:s}))))}const _r=["vertical","horizontal"];function yr(e){let{onChange:t,values:n,sides:o,spacingSizes:r,type:l,minimumCustomValue:i,onMouseOver:a,onMouseOut:s}=e;const c=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)},d=null!=o&&o.length?_r.filter((e=>o.includes(e))):_r;return(0,u.createElement)(u.Fragment,null,d.map((e=>{const t="vertical"===e?n.top:n.left;return(0,u.createElement)(vr,{value:t,onChange:c(e),label:lr[e],key:`spacing-sizes-control-${e}`,withInputField:!1,side:e,spacingSizes:r,type:l,minimumCustomValue:i,onMouseOver:a,onMouseOut:s})})))}var Er=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.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 Cr=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.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 Sr(e){let{isLinked:t,onClick:n}=e;const o=t?(0,_.__)("Unlink sides"):(0,_.__)("Link sides");return(0,u.createElement)(h.Tooltip,{text:o},(0,u.createElement)("span",{className:"component-spacing-sizes-control__linked-button"},(0,u.createElement)(h.Button,{isSmall:!0,icon:t?Er:Cr,iconSize:24,"aria-label":o,onClick:n})))}function wr(e){let{inputProps:t,onChange:n,label:o=(0,_.__)("Spacing Control"),values:r,sides:l,splitOnAxis:i=!1,useSelect:a,minimumCustomValue:s=0,onMouseOver:d,onMouseOut:m}=e;const g=[{name:0,slug:"0",size:0},...fr("spacing.spacingSizes")||[]];g.length>8&&g.unshift({name:(0,_.__)("Default"),slug:"default",size:void 0});const f=r||ir,v=ur(r),b=1===(null==l?void 0:l.length),[k,y]=(0,u.useState)(!v||!cr(f,l)||b),E={...t,onChange:e=>{const t={...r,...e};n(t)},isLinked:k,sides:l,values:f,spacingSizes:g,useSelect:a,type:o,minimumCustomValue:s,onMouseOver:d,onMouseOut:m};return(0,u.createElement)("fieldset",{className:p()("component-spacing-sizes-control",{"is-unlinked":!k})},(0,u.createElement)(h.BaseControl.VisualLabel,{as:"legend"},o),!b&&(0,u.createElement)(Sr,{onClick:()=>{y(!k)},isLinked:k}),k&&(0,u.createElement)(br,c({"aria-label":o},E)),!k&&i&&(0,u.createElement)(yr,E),!k&&!i&&(0,u.createElement)(kr,E))}window.wp.warning;const Br=(0,h.createSlotFill)("InspectorControls"),Ir=(0,h.createSlotFill)("InspectorAdvancedControls"),xr=(0,h.createSlotFill)("InspectorControlsBorder"),Tr=(0,h.createSlotFill)("InspectorControlsColor"),Mr=(0,h.createSlotFill)("InspectorControlsDimensions"),Nr=(0,h.createSlotFill)("InspectorControlsPosition"),Pr=(0,h.createSlotFill)("InspectorControlsTypography");var Lr={default:Br,advanced:Ir,border:xr,color:Tr,dimensions:Mr,list:(0,h.createSlotFill)("InspectorControlsListView"),settings:Br,styles:(0,h.createSlotFill)("InspectorControlsStyles"),typography:Pr,position:Nr};function Rr(e){var t;let{children:n,group:o="default",__experimentalGroup:r}=e;r&&(W()("`__experimentalGroup` property in `InspectorControlsFill`",{since:"6.2",version:"6.4",alternative:"`group`"}),o=r);const l=Ao(),i=null===(t=Lr[o])||void 0===t?void 0:t.Fill;return i?l?(0,u.createElement)(h.__experimentalStyleProvider,{document:document},(0,u.createElement)(i,null,(e=>{const t=(0,f.isEmpty)(e)?null:e;return(0,u.createElement)(h.__experimentalToolsPanelContext.Provider,{value:t},n)}))):null:("undefined"!=typeof process&&process.env,null)}const Ar=e=>{if(null===e||"object"!=typeof e||Array.isArray(e))return e;const t=Object.fromEntries(Object.entries((0,f.mapValues)(e,Ar)).filter((e=>{let[,t]=e;return Boolean(t)})));return(0,f.isEmpty)(t)?void 0:t};function Or(e){return"object"==typeof e?{...Object.fromEntries(Object.entries(e).map((e=>{let[t,n]=e;return[t,Or(n)]})))}:e}function Dr(e,t,n){const o=function(e){return Array.isArray(e)?e:"number"==typeof e?[e.toString()]:[e]}(t),r=e?Or(e):{};return o.reduce(((e,t,r)=>(void 0===e[t]&&(e[t]={}),r===o.length-1&&(e[t]=n),e[t])),r),r}function zr(e,t,n,o,r,l){var i;if(Object.values(null!=e?e:{}).every((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,f.get)(a,e);t&&(c={...c,attributes:Dr(c.attributes,e,t)})}))})),c}function Fr(e,t,n){const o=(0,a.getBlockSupport)(e,t),r=null==o?void 0:o.__experimentalSkipSerialization;return Array.isArray(r)?r.includes(n):r}function Vr(e){let{children:t,group:n,label:o}=e;const{updateBlockAttributes:r}=(0,g.useDispatch)(To),{getBlockAttributes:l,getMultiSelectedBlockClientIds:i,getSelectedBlockClientId:a,hasMultiSelection:s}=(0,g.useSelect)(To),c=a(),d=(0,u.useCallback)((function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t={},n=s()?i():[c];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,s,c,r]);return(0,u.createElement)(h.__experimentalToolsPanel,{className:`${n}-block-support-panel`,label:o,resetAll:d,key:c,panelId:c,hasInnerWrapper:!0,shouldRenderPlaceholderItems:!0,__experimentalFirstVisibleItemClass:"first",__experimentalLastVisibleItemClass:"last"},t)}function Hr(e){let{Slot:t,...n}=e;const o=(0,u.useContext)(h.__experimentalToolsPanelContext);return(0,u.createElement)(t,c({},n,{fillProps:o,bubblesVirtually:!0}))}function Gr(e){var t;let{__experimentalGroup:n,group:o="default",label:r,...l}=e;n&&(W()("`__experimentalGroup` property in `InspectorControlsSlot`",{since:"6.2",version:"6.4",alternative:"`group`"}),o=n);const i=null===(t=Lr[o])||void 0===t?void 0:t.Slot,a=(0,h.__experimentalUseSlot)(null==i?void 0:i.__unstableName),s=(0,h.__experimentalUseSlotFills)(null==i?void 0:i.__unstableName);if(!i||!a)return"undefined"!=typeof process&&process.env,null;return Boolean(s&&s.length)?r?(0,u.createElement)(Vr,{group:o,label:r},(0,u.createElement)(Hr,c({},l,{Slot:i}))):(0,u.createElement)(i,c({},l,{bubblesVirtually:!0})):null}const Ur=Rr;Ur.Slot=Gr;const $r=e=>(0,u.createElement)(Rr,c({},e,{group:"advanced"}));$r.Slot=e=>(0,u.createElement)(Gr,c({},e,{group:"advanced"})),$r.slotName="InspectorAdvancedControls";var jr=Ur,Wr=window.wp.isShallowEqual,Kr=n.n(Wr);var qr=function(e){return(0,m.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 Yr=Number.MAX_SAFE_INTEGER;var Zr=(0,u.forwardRef)((function(e,t){let{clientId:n,bottomClientId:o,children:r,__unstableRefreshSize:l,__unstableCoverTarget:i=!1,__unstablePopoverSlot:a,__unstableContentRef:s,shift:d=!0,...g}=e;const f=tr(n),v=tr(null!=o?o:n),b=(0,m.useMergeRefs)([t,qr(s)]),[k,_]=(0,u.useReducer)((e=>(e+1)%Yr),0);(0,u.useLayoutEffect)((()=>{if(!f)return;const e=new window.MutationObserver(_);return e.observe(f,{attributes:!0}),()=>{e.disconnect()}}),[f]);const y=(0,u.useMemo)((()=>k<0||!f||v!==f?{}:{position:"absolute",width:f.offsetWidth,height:f.offsetHeight}),[f,v,l,k]),E=(0,u.useMemo)((()=>{if(!(k<0||!f||o&&!v))return{getBoundingClientRect(){var e,t,n,o;const r=f.getBoundingClientRect(),l=null==v?void 0:v.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:f.ownerDocument}}),[o,v,f,k]);return!f||o&&!v?null:(0,u.createElement)(h.Popover,c({ref:b,animate:!1,focusOnMount:!1,anchor:E,__unstableSlotName:a||null,placement:"top-start",resize:!1,flip:!1,shift:d},g,{className:p()("block-editor-block-popover",g.className),variant:"unstyled"}),i&&(0,u.createElement)("div",{style:y},r),!i&&r)}));function Qr(e){const t=(0,a.getBlockSupport)(e,hl);return!!(!0===t||null!=t&&t.margin)}function Xr(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!fr("spacing.margin"),n=!Cl(e,"margin");return!Qr(e)||t||n}function Jr(e){var t,n;const{name:o,attributes:{style:r},setAttributes:l,onMouseOver:i,onMouseOut:a}=e,s=fr("spacing.spacingSizes"),c=(0,h.__experimentalUseCustomUnits)({availableUnits:fr("spacing.units")||["%","px","em","rem","vw"]}),d=El(o,"margin"),p=d&&d.some((e=>bl.includes(e)));if(Xr(e))return null;const m=e=>{const t={...r,spacing:{...null==r?void 0:r.spacing,margin:e}};l({style:Ar(t)})};return u.Platform.select({web:(0,u.createElement)(u.Fragment,null,(!s||0===(null==s?void 0:s.length))&&(0,u.createElement)(h.__experimentalBoxControl,{values:null==r||null===(t=r.spacing)||void 0===t?void 0:t.margin,onChange:m,label:(0,_.__)("Margin"),sides:d,units:c,allowReset:!1,splitOnAxis:p,onMouseOver:i,onMouseOut:a}),(null==s?void 0:s.length)>0&&(0,u.createElement)(wr,{values:null==r||null===(n=r.spacing)||void 0===n?void 0:n.margin,onChange:m,label:(0,_.__)("Margin"),sides:d,units:c,allowReset:!1,splitOnAxis:!1,onMouseOver:i,onMouseOut:a})),native:null})}function el(e){var t,n;let{clientId:o,attributes:r,forceShow:l}=e;const i=null==r||null===(t=r.style)||void 0===t||null===(n=t.spacing)||void 0===n?void 0:n.margin,a=(0,u.useMemo)((()=>{const e=null!=i&&i.top?or(null==i?void 0:i.top):0,t=null!=i&&i.right?or(null==i?void 0:i.right):0,n=null!=i&&i.bottom?or(null==i?void 0:i.bottom):0,o=null!=i&&i.left?or(null==i?void 0:i.left):0;return{borderTopWidth:e,borderRightWidth:t,borderBottomWidth:n,borderLeftWidth:o,top:e?`calc(${e} * -1)`:0,right:t?`calc(${t} * -1)`:0,bottom:n?`calc(${n} * -1)`:0,left:o?`calc(${o} * -1)`:0}}),[i]),[s,c]=(0,u.useState)(!1),d=(0,u.useRef)(i),p=(0,u.useRef)();return(0,u.useEffect)((()=>(Kr()(i,d.current)||l||(c(!0),d.current=i,p.current=setTimeout((()=>{c(!1)}),400)),()=>{c(!1),p.current&&window.clearTimeout(p.current)})),[i,l]),s||l?(0,u.createElement)(Zr,{clientId:o,__unstableCoverTarget:!0,__unstableRefreshSize:i,__unstablePopoverSlot:"block-toolbar",shift:!1},(0,u.createElement)("div",{className:"block-editor__padding-visualizer",style:a})):null}const tl={px:{max:1e3,step:1},"%":{max:100,step:1},vw:{max:100,step:1},vh:{max:100,step:1},em:{max:50,step:.1},rem:{max:50,step:.1}};function nl(e){var t,n,o,r,l;let{label:i=(0,_.__)("Height"),onChange:a,value:s}=e;const c=parseFloat(s),d=(0,h.__experimentalUseCustomUnits)({availableUnits:fr("spacing.units")||["%","px","em","rem","vh","vw"]}),p=(0,u.useMemo)((()=>(0,h.__experimentalParseQuantityAndUnitFromRawValue)(s)),[s])[1]||(null===(t=d[0])||void 0===t?void 0:t.value)||"px";return(0,u.createElement)("fieldset",{className:"block-editor-height-control"},(0,u.createElement)(h.BaseControl.VisualLabel,{as:"legend"},i),(0,u.createElement)(h.Flex,null,(0,u.createElement)(h.FlexItem,{isBlock:!0},(0,u.createElement)(h.__experimentalUnitControl,{value:s,units:d,onChange:a,onUnitChange:e=>{const[t,n]=(0,h.__experimentalParseQuantityAndUnitFromRawValue)(s);["em","rem"].includes(e)&&"px"===n?a((t/16).toFixed(2)+e):["em","rem"].includes(n)&&"px"===e?a(Math.round(16*t)+e):["vh","vw","%"].includes(e)&&t>100&&a(100+e)},min:0,size:"__unstable-large"})),(0,u.createElement)(h.FlexItem,{isBlock:!0},(0,u.createElement)(h.__experimentalSpacer,{marginX:2,marginBottom:0},(0,u.createElement)(h.RangeControl,{value:c,min:0,max:null!==(n=null===(o=tl[p])||void 0===o?void 0:o.max)&&void 0!==n?n:100,step:null!==(r=null===(l=tl[p])||void 0===l?void 0:l.step)&&void 0!==r?r:.1,withInputField:!1,onChange:e=>{a([e,p].join(""))},__nextHasNoMarginBottom:!0})))))}function ol(e){const t=(0,a.getBlockSupport)(e,fl);return!!(!0===t||null!=t&&t.minHeight)}function rl(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!fr("dimensions.minHeight");return!ol(e)||t}function ll(e){var t;const{attributes:{style:n},setAttributes:o}=e;if(rl(e))return null;return(0,u.createElement)(nl,{label:(0,_.__)("Min. height"),value:null==n||null===(t=n.dimensions)||void 0===t?void 0:t.minHeight,onChange:e=>{const t={...n,dimensions:{...null==n?void 0:n.dimensions,minHeight:e}};o({style:Ar(t)})}})}function il(e){const t=(0,a.getBlockSupport)(e,hl);return!!(!0===t||null!=t&&t.padding)}function al(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!fr("spacing.padding"),n=!Cl(e,"padding");return!il(e)||t||n}function sl(e){var t,n;const{name:o,attributes:{style:r},setAttributes:l,onMouseOver:i,onMouseOut:a}=e,s=fr("spacing.spacingSizes"),c=(0,h.__experimentalUseCustomUnits)({availableUnits:fr("spacing.units")||["%","px","em","rem","vw"]}),d=El(o,"padding"),p=d&&d.some((e=>bl.includes(e)));if(al(e))return null;const m=e=>{const t={...r,spacing:{...null==r?void 0:r.spacing,padding:e}};l({style:Ar(t)})};return u.Platform.select({web:(0,u.createElement)(u.Fragment,null,(!s||0===(null==s?void 0:s.length))&&(0,u.createElement)(h.__experimentalBoxControl,{values:null==r||null===(t=r.spacing)||void 0===t?void 0:t.padding,onChange:m,label:(0,_.__)("Padding"),sides:d,units:c,allowReset:!1,splitOnAxis:p,onMouseOver:i,onMouseOut:a}),(null==s?void 0:s.length)>0&&(0,u.createElement)(wr,{values:null==r||null===(n=r.spacing)||void 0===n?void 0:n.padding,onChange:m,label:(0,_.__)("Padding"),sides:d,units:c,allowReset:!1,splitOnAxis:p,onMouseOver:i,onMouseOut:a})),native:null})}function cl(e){var t,n;let{clientId:o,attributes:r,forceShow:l}=e;const i=null==r||null===(t=r.style)||void 0===t||null===(n=t.spacing)||void 0===n?void 0:n.padding,a=(0,u.useMemo)((()=>({borderTopWidth:null!=i&&i.top?or(null==i?void 0:i.top):0,borderRightWidth:null!=i&&i.right?or(null==i?void 0:i.right):0,borderBottomWidth:null!=i&&i.bottom?or(null==i?void 0:i.bottom):0,borderLeftWidth:null!=i&&i.left?or(null==i?void 0:i.left):0})),[i]),[s,c]=(0,u.useState)(!1),d=(0,u.useRef)(i),p=(0,u.useRef)();return(0,u.useEffect)((()=>(Kr()(i,d.current)||l||(c(!0),d.current=i,p.current=setTimeout((()=>{c(!1)}),400)),()=>{c(!1),p.current&&window.clearTimeout(p.current)})),[i,l]),s||l?(0,u.createElement)(Zr,{clientId:o,__unstableCoverTarget:!0,__unstableRefreshSize:i,__unstablePopoverSlot:"block-toolbar",shift:!1},(0,u.createElement)("div",{className:"block-editor__padding-visualizer",style:a})):null}function ul(e,t){const{orientation:n="horizontal"}=t;return"fill"===e?(0,_.__)("Stretch to fill available space."):"fixed"===e?"horizontal"===n?(0,_.__)("Specify a fixed width."):(0,_.__)("Specify a fixed height."):(0,_.__)("Fit contents.")}function dl(e){let{attributes:t,setAttributes:n,__unstableParentLayout:o}=e;const{style:r={}}=t,{layout:l={}}=r,{selfStretch:i,flexSize:a}=l;return(0,u.useEffect)((()=>{"fixed"!==i||a||n({style:{...r,layout:{...l,selfStretch:"fit"}}})}),[]),(0,u.createElement)(u.Fragment,null,(0,u.createElement)(h.__experimentalToggleGroupControl,{__nextHasNoMarginBottom:!0,size:"__unstable-large",label:gl(o),value:i||"fit",help:ul(i,o),onChange:e=>{const t="fixed"!==e?null:a;n({style:{...r,layout:{...l,selfStretch:e,flexSize:t}}})},isBlock:!0},(0,u.createElement)(h.__experimentalToggleGroupControlOption,{key:"fit",value:"fit",label:(0,_.__)("Fit")}),(0,u.createElement)(h.__experimentalToggleGroupControlOption,{key:"fill",value:"fill",label:(0,_.__)("Fill")}),(0,u.createElement)(h.__experimentalToggleGroupControlOption,{key:"fixed",value:"fixed",label:(0,_.__)("Fixed")})),"fixed"===i&&(0,u.createElement)(h.__experimentalUnitControl,{size:"__unstable-large",onChange:e=>{n({style:{...r,layout:{...l,flexSize:e}}})},value:a}))}function pl(e){let{__unstableParentLayout:t={}}=e;const{type:n="default",default:{type:o="default"}={},allowSizingOnChildren:r=!1}=t;return("flex"===o||"flex"===n)&&r}function ml(e){const t=!fr("layout");return!pl(e)||t}function gl(e){const{orientation:t="horizontal"}=e;return"horizontal"===t?(0,_.__)("Width"):(0,_.__)("Height")}const fl="dimensions",hl="spacing",vl=["top","right","bottom","left"],bl=["vertical","horizontal"];function kl(){const[e,t]=(0,u.useState)(!1),{hideBlockInterface:n,showBlockInterface:o}=Io((0,g.useDispatch)(To));return{isMouseOver:e,onMouseOver:e=>{e.stopPropagation(),n(),t(!0)},onMouseOut:e=>{e.stopPropagation(),o(),t(!1)}}}function _l(e){const t=Il(e),n=al(e),o=Xr(e),r=rl(e),l=ml(e),i=yl(e),s=function(e){if("web"!==u.Platform.OS)return!1;const{name:t}=e;return Sl(t)||ol(t)||il(t)||Qr(t)||pl(e)}(e),d=fr("spacing.spacingSizes"),m=kl(),g=kl();if(i||!s)return null;const f=(0,a.getBlockSupport)(e.name,[fl,"__experimentalDefaultControls"]),v=(0,a.getBlockSupport)(e.name,[hl,"__experimentalDefaultControls"]),b=(e,t)=>n=>{var o;return{...n,style:{...n.style,[t]:{...null===(o=n.style)||void 0===o?void 0:o[t],[e]:void 0}}}},k=p()({"tools-panel-item-spacing":d&&d.length>0}),{__unstableParentLayout:y}=e;return(0,u.createElement)(u.Fragment,null,(0,u.createElement)(jr,{group:"dimensions"},!n&&(0,u.createElement)(h.__experimentalToolsPanelItem,{className:k,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,_.__)("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:b("padding","spacing"),isShownByDefault:null==v?void 0:v.padding,panelId:e.clientId},(0,u.createElement)(sl,c({onMouseOver:m.onMouseOver,onMouseOut:m.onMouseOut},e))),!o&&(0,u.createElement)(h.__experimentalToolsPanelItem,{className:k,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,_.__)("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:b("margin","spacing"),isShownByDefault:null==v?void 0:v.margin,panelId:e.clientId},(0,u.createElement)(Jr,c({onMouseOver:g.onMouseOver,onMouseOut:g.onMouseOut},e))),!t&&(0,u.createElement)(h.__experimentalToolsPanelItem,{className:k,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,_.__)("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:b("blockGap","spacing"),isShownByDefault:null==v?void 0:v.blockGap,panelId:e.clientId},(0,u.createElement)(xl,e)),!r&&(0,u.createElement)(h.__experimentalToolsPanelItem,{hasValue:()=>function(e){var t,n;return void 0!==(null===(t=e.attributes.style)||void 0===t||null===(n=t.dimensions)||void 0===n?void 0:n.minHeight)}(e),label:(0,_.__)("Min. height"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:Ar({...o,dimensions:{...null==o?void 0:o.dimensions,minHeight:void 0}})})}(e),resetAllFilter:b("minHeight","dimensions"),isShownByDefault:null==f?void 0:f.minHeight,panelId:e.clientId},(0,u.createElement)(ll,e)),!l&&(0,u.createElement)(h.__experimentalVStack,{as:h.__experimentalToolsPanelItem,spacing:2,hasValue:()=>function(e){var t;return void 0!==(null===(t=e.attributes.style)||void 0===t?void 0:t.layout)}(e),label:gl(y),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:{...o,layout:void 0}})}(e),resetAllFilter:b("selfStretch","layout"),isShownByDefault:!1,panelId:e.clientId},(0,u.createElement)(dl,e))),!n&&(0,u.createElement)(cl,c({forceShow:m.isMouseOver},e)),!o&&(0,u.createElement)(el,c({forceShow:g.isMouseOver},e)))}const yl=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=Il(e),n=rl(e),o=al(e),r=Xr(e),l=ml(e);return t&&n&&o&&r&&l};function El(e,t){var n;const o=(0,a.getBlockSupport)(e,hl);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 Cl(e,t){const n=El(e,t);return!(n&&n.some((e=>vl.includes(e)))&&n.some((e=>bl.includes(e))))||(console.warn(`The ${t} support for the "${e}" block can not be configured to support both axial and arbitrary sides.`),!1)}function Sl(e){const t=(0,a.getBlockSupport)(e,hl);return!!(!0===t||null!=t&&t.blockGap)}function wl(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 Bl(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"0";const n=wl(e);if(!n)return null;const o=or(null==n?void 0:n.top)||t,r=or(null==n?void 0:n.left)||t;return o===r?o:`${o} ${r}`}function Il(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!fr("spacing.blockGap");return!Sl(e)||t}function xl(e){var t;const{clientId:n,attributes:{style:o},name:r,setAttributes:l}=e,i=fr("spacing.spacingSizes"),a=(0,h.__experimentalUseCustomUnits)({availableUnits:fr("spacing.units")||["%","px","em","rem","vw"]}),s=El(r,"blockGap"),c=er(n);if(Il(e))return null;const d=s&&s.some((e=>bl.includes(e))),p=e=>{var t;let n=e;e&&d?n={...wl(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;c.current&&i&&(null===(a=c.current.parentNode)||void 0===a||a.replaceChild(c.current,c.current))},m=wl(null==o||null===(t=o.spacing)||void 0===t?void 0:t.blockGap),g=d?{...m,right:null==m?void 0:m.left,bottom:null==m?void 0:m.top}:{top:null==m?void 0:m.top};return u.Platform.select({web:(0,u.createElement)(u.Fragment,null,(!i||0===(null==i?void 0:i.length))&&(d?(0,u.createElement)(h.__experimentalBoxControl,{label:(0,_.__)("Block spacing"),min:0,onChange:p,units:a,sides:s,values:g,allowReset:!1,splitOnAxis:d}):(0,u.createElement)(h.__experimentalUnitControl,{label:(0,_.__)("Block spacing"),__unstableInputWidth:"80px",min:0,onChange:p,units:a,value:g})),(null==i?void 0:i.length)>0&&(0,u.createElement)(wr,{values:g,onChange:p,label:(0,_.__)("Block spacing"),sides:d?s:["top"],units:a,allowReset:!1,splitOnAxis:d})),native:null})}const Tl=(0,u.createElement)(h.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(h.Path,{d:"M15 4H9v11h6V4zM4 18.5V20h16v-1.5H4z"})),Ml=(0,u.createElement)(h.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(h.Path,{d:"M20 11h-5V4H9v7H4v1.5h5V20h6v-7.5h5z"})),Nl=(0,u.createElement)(h.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(h.Path,{d:"M9 20h6V9H9v11zM4 4v1.5h16V4H4z"})),Pl=(0,u.createElement)(h.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(h.Path,{d:"M4 4L20 4L20 5.5L4 5.5L4 4ZM10 7L14 7L14 17L10 17L10 7ZM20 18.5L4 18.5L4 20L20 20L20 18.5Z"})),Ll=(0,u.createElement)(h.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(h.Path,{d:"M7 4H17V8L7 8V4ZM7 16L17 16V20L7 20V16ZM20 11.25H4V12.75H20V11.25Z"})),Rl={top:{icon:Nl,title:(0,_._x)("Align top","Block vertical alignment setting")},center:{icon:Ml,title:(0,_._x)("Align middle","Block vertical alignment setting")},bottom:{icon:Tl,title:(0,_._x)("Align bottom","Block vertical alignment setting")},stretch:{icon:Pl,title:(0,_._x)("Stretch to fill","Block vertical alignment setting")},"space-between":{icon:Ll,title:(0,_._x)("Space between","Block vertical alignment setting")}},Al=["top","center","bottom"];var Ol=function(e){let{value:t,onChange:n,controls:o=Al,isCollapsed:r=!0,isToolbar:l}=e;const i=Rl[t],a=Rl.top,s=l?h.ToolbarGroup:h.ToolbarDropdownMenu,d=l?{isCollapsed:r}:{popoverProps:{variant:"toolbar"}};return(0,u.createElement)(s,c({icon:i?i.icon:a.icon,label:(0,_._x)("Change vertical alignment","Block vertical alignment setting label"),controls:o.map((e=>{return{...Rl[e],isActive:t===e,role:r?"menuitemradio":void 0,onClick:(o=e,()=>n(t===o?void 0:o))};var o}))},d))};const Dl=e=>(0,u.createElement)(Ol,c({},e,{isToolbar:!1})),zl=e=>(0,u.createElement)(Ol,c({},e,{isToolbar:!0})),Fl={left:Ho,center:Go,right:Uo,"space-between":$o,stretch:jo};var Vl=function(e){let{allowedControls:t=["left","center","right","space-between"],isCollapsed:n=!0,onChange:o,value:r,popoverProps:l,isToolbar:i}=e;const a=e=>{o(e===r?void 0:e)},s=r?Fl[r]:Fl.left,d=[{name:"left",icon:Ho,title:(0,_.__)("Justify items left"),isActive:"left"===r,onClick:()=>a("left")},{name:"center",icon:Go,title:(0,_.__)("Justify items center"),isActive:"center"===r,onClick:()=>a("center")},{name:"right",icon:Uo,title:(0,_.__)("Justify items right"),isActive:"right"===r,onClick:()=>a("right")},{name:"space-between",icon:$o,title:(0,_.__)("Space between items"),isActive:"space-between"===r,onClick:()=>a("space-between")},{name:"stretch",icon:jo,title:(0,_.__)("Stretch items"),isActive:"stretch"===r,onClick:()=>a("stretch")}],p=i?h.ToolbarGroup:h.ToolbarDropdownMenu,m=i?{isCollapsed:n}:{};return(0,u.createElement)(p,c({icon:s,popoverProps:l,label:(0,_.__)("Change items justification"),controls:d.filter((e=>t.includes(e.name)))},m))};const Hl=e=>(0,u.createElement)(Vl,c({},e,{isToolbar:!1})),Gl=e=>(0,u.createElement)(Vl,c({},e,{isToolbar:!0})),Ul={left:"flex-start",right:"flex-end",center:"center","space-between":"space-between"},$l={left:"flex-start",right:"flex-end",center:"center",stretch:"stretch"},jl={top:"flex-start",center:"center",bottom:"flex-end",stretch:"stretch","space-between":"space-between"},Wl=["wrap","nowrap"];var Kl={name:"flex",label:(0,_.__)("Flex"),inspectorControls:function(e){let{layout:t={},onChange:n,layoutBlockSupport:o={}}=e;const{allowOrientation:r=!0}=o;return(0,u.createElement)(u.Fragment,null,(0,u.createElement)(h.Flex,null,(0,u.createElement)(h.FlexItem,null,(0,u.createElement)(Yl,{layout:t,onChange:n})),(0,u.createElement)(h.FlexItem,null,r&&(0,u.createElement)(Ql,{layout:t,onChange:n}))),(0,u.createElement)(Zl,{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,u.createElement)(Vo,{group:"block",__experimentalShareWithChildBlocks:!0},(0,u.createElement)(Yl,{layout:t,onChange:n,isToolbar:!0}),r&&(0,u.createElement)(ql,{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&&!Fr(i,"spacing","blockGap")?Bl(null==l||null===(n=l.spacing)||void 0===n?void 0:n.blockGap,"0.5em"):void 0,d=Ul[r.justifyContent],p=Wl.includes(r.flexWrap)?r.flexWrap:"wrap",m=jl[r.verticalAlignment],g=$l[r.justifyContent]||$l.left;let f="";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}`)):(m&&h.push(`justify-content: ${m}`),h.push("flex-direction: column"),h.push(`align-items: ${g}`)),h.length&&(f=`${qo(o)} {\n\t\t\t\t${h.join("; ")};\n\t\t\t}`),a&&u&&(f+=Yo(o,s,"flex",u)),f},getOrientation(e){const{orientation:t="horizontal"}=e;return t},getAlignments(){return[]}};function ql(e){let{layout:t,onChange:n,isToolbar:o=!1}=e;const{orientation:r="horizontal"}=t,l="horizontal"===r?jl.center:jl.top,{verticalAlignment:i=l}=t,a=e=>{n({...t,verticalAlignment:e})};if(o)return(0,u.createElement)(Dl,{onChange:a,value:i,controls:"horizontal"===r?["top","center","bottom","stretch"]:["top","center","bottom","space-between"]});const s=[{value:"flex-start",label:(0,_.__)("Align items top")},{value:"center",label:(0,_.__)("Align items center")},{value:"flex-end",label:(0,_.__)("Align items bottom")}];return(0,u.createElement)("fieldset",{className:"block-editor-hooks__flex-layout-vertical-alignment-control"},(0,u.createElement)("legend",null,(0,_.__)("Vertical alignment")),(0,u.createElement)("div",null,s.map(((e,t,n)=>(0,u.createElement)(h.Button,{key:e,label:n,icon:t,isPressed:i===e,onClick:()=>a(e)})))))}function Yl(e){let{layout:t,onChange:n,isToolbar:o=!1}=e;const{justifyContent:r="left",orientation:l="horizontal"}=t,i=e=>{n({...t,justifyContent:e})},a=["left","center","right"];if("horizontal"===l?a.push("space-between"):a.push("stretch"),o)return(0,u.createElement)(Hl,{allowedControls:a,value:r,onChange:i,popoverProps:{position:"bottom right",variant:"toolbar"}});const s=[{value:"left",icon:Ho,label:(0,_.__)("Justify items left")},{value:"center",icon:Go,label:(0,_.__)("Justify items center")},{value:"right",icon:Uo,label:(0,_.__)("Justify items right")}];return"horizontal"===l?s.push({value:"space-between",icon:$o,label:(0,_.__)("Space between items")}):s.push({value:"stretch",icon:jo,label:(0,_.__)("Stretch items")}),(0,u.createElement)(h.__experimentalToggleGroupControl,{__nextHasNoMarginBottom:!0,label:(0,_.__)("Justification"),value:r,onChange:i,className:"block-editor-hooks__flex-layout-justification-controls"},s.map((e=>{let{value:t,icon:n,label:o}=e;return(0,u.createElement)(h.__experimentalToggleGroupControlOptionIcon,{key:t,value:t,icon:n,label:o})})))}function Zl(e){let{layout:t,onChange:n}=e;const{flexWrap:o="wrap"}=t;return(0,u.createElement)(h.ToggleControl,{label:(0,_.__)("Allow to wrap to multiple lines"),onChange:e=>{n({...t,flexWrap:e?"wrap":"nowrap"})},checked:"wrap"===o})}function Ql(e){let{layout:t,onChange:n}=e;const{orientation:o="horizontal",verticalAlignment:r,justifyContent:l}=t;return(0,u.createElement)(h.__experimentalToggleGroupControl,{__nextHasNoMarginBottom:!0,className:"block-editor-hooks__flex-layout-orientation-controls",label:(0,_.__)("Orientation"),value:o,onChange:e=>{let o=r,i=l;return"horizontal"===e?("space-between"===r&&(o="center"),"stretch"===l&&(i="left")):("stretch"===r&&(o="top"),"space-between"===l&&(i="left")),n({...t,orientation:e,verticalAlignment:o,justifyContent:i})}},(0,u.createElement)(h.__experimentalToggleGroupControlOptionIcon,{icon:Wo,value:"horizontal",label:(0,_.__)("Horizontal")}),(0,u.createElement)(h.__experimentalToggleGroupControlOptionIcon,{icon:Ko,value:"vertical",label:(0,_.__)("Vertical")}))}var Xl={name:"default",label:(0,_.__)("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=Bl(null==o||null===(t=o.spacing)||void 0===t?void 0:t.blockGap);let s="";Fr(r,"spacing","blockGap")||(null!=a&&a.top?s=Bl(null==a?void 0:a.top):"string"==typeof a&&(s=Bl(a)));let c="";return l&&s&&(c+=Yo(n,i,"default",s)),c},getOrientation(){return"vertical"},getAlignments(e,t){const n=Zo(e);if(void 0!==e.alignments)return e.alignments.includes("none")||e.alignments.unshift("none"),e.alignments.map((e=>({name:e,info:n[e]})));const o=[{name:"left"},{name:"center"},{name:"right"}];if(!t){const{contentSize:t,wideSize:r}=e;t&&o.unshift({name:"full"}),r&&o.unshift({name:"wide",info:n.wide})}return o.unshift({name:"none",info:n.none}),o}};var Jl=function(e){let{icon:t,size:n=24,...o}=e;return(0,u.cloneElement)(t,{width:n,height:n,...o})};var ei=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"M7 9v6h10V9H7zM5 19.8h14v-1.5H5v1.5zM5 4.3v1.5h14V4.3H5z"}));var ti=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"M5 9v6h14V9H5zm11-4.8H8v1.5h8V4.2zM8 19.8h8v-1.5H8v1.5z"})),ni=window.wp.styleEngine,oi={name:"constrained",label:(0,_.__)("Constrained"),inspectorControls:function(e){let{layout:t,onChange:n}=e;const{wideSize:o,contentSize:r,justifyContent:l="center"}=t,i=[{value:"left",icon:Ho,label:(0,_.__)("Justify items left")},{value:"center",icon:Go,label:(0,_.__)("Justify items center")},{value:"right",icon:Uo,label:(0,_.__)("Justify items right")}],a=(0,h.__experimentalUseCustomUnits)({availableUnits:fr("spacing.units")||["%","px","em","rem","vw"]});return(0,u.createElement)(u.Fragment,null,(0,u.createElement)("div",{className:"block-editor-hooks__layout-controls"},(0,u.createElement)("div",{className:"block-editor-hooks__layout-controls-unit"},(0,u.createElement)(h.__experimentalUnitControl,{className:"block-editor-hooks__layout-controls-unit-input",label:(0,_.__)("Content"),labelPosition:"top",__unstableInputWidth:"80px",value:r||o||"",onChange:e=>{e=0>parseFloat(e)?"0":e,n({...t,contentSize:e})},units:a}),(0,u.createElement)(Jl,{icon:ei})),(0,u.createElement)("div",{className:"block-editor-hooks__layout-controls-unit"},(0,u.createElement)(h.__experimentalUnitControl,{className:"block-editor-hooks__layout-controls-unit-input",label:(0,_.__)("Wide"),labelPosition:"top",__unstableInputWidth:"80px",value:o||r||"",onChange:e=>{e=0>parseFloat(e)?"0":e,n({...t,wideSize:e})},units:a}),(0,u.createElement)(Jl,{icon:ti}))),(0,u.createElement)("p",{className:"block-editor-hooks__layout-controls-helptext"},(0,_.__)("Customize the width for all elements that are assigned to the center or wide columns.")),(0,u.createElement)(h.__experimentalToggleGroupControl,{__nextHasNoMarginBottom:!0,label:(0,_.__)("Justification"),value:l,onChange:e=>{n({...t,justifyContent:e})}},i.map((e=>{let{value:t,icon:n,label:o}=e;return(0,u.createElement)(h.__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=Bl(null==l||null===(t=l.spacing)||void 0===t?void 0:t.blockGap);let m="";Fr(i,"spacing","blockGap")||(null!=p&&p.top?m=Bl(null==p?void 0:p.top):"string"==typeof p&&(m=Bl(p)));const g="left"===d?"0 !important":"auto !important",f="right"===d?"0 !important":"auto !important";let h=c||u?`\n\t\t\t\t\t${qo(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: ${g};\n\t\t\t\t\t\tmargin-right: ${f};\n\t\t\t\t\t}\n\t\t\t\t\t${qo(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${qo(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+=`${qo(o,"> :where(:not(.alignleft):not(.alignright):not(.alignfull))")}\n\t\t\t{ margin-left: ${g}; }`:"right"===d&&(h+=`${qo(o,"> :where(:not(.alignleft):not(.alignright):not(.alignfull))")}\n\t\t\t{ margin-right: ${f}; }`),null!=l&&null!==(n=l.spacing)&&void 0!==n&&n.padding){(0,ni.getCSSRules)(l).forEach((e=>{"paddingRight"===e.key?h+=`\n\t\t\t\t\t${qo(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${qo(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+=Yo(o,s,"constrained",m)),h},getOrientation(){return"vertical"},getAlignments(e){const t=Zo(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 ri=[Xl,Kl,oi];function li(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default";return ri.find((t=>t.name===e))}const ii={type:"default"},ai=(0,u.createContext)(ii),si=ai.Provider;function ci(){return(0,u.useContext)(ai)}function ui(e){let{layout:t={},css:n,...o}=e;const r=li(t.type),l=null!==fr("spacing.blockGap");if(r){var i;if(n)return(0,u.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,u.createElement)("style",null,e)}return null}const di=[],pi=["none","left","center","right","wide","full"],mi=["wide","full"];function gi(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:pi;e.includes("none")||(e=["none",...e]);const{wideControlsEnabled:t=!1,themeSupportsLayout:n,isBlockBasedTheme:o}=(0,g.useSelect)((e=>{const{getSettings:t}=e(To),n=t();return{wideControlsEnabled:n.alignWide,themeSupportsLayout:n.supportsLayout,isBlockBasedTheme:n.__unstableIsBlockBasedTheme}}),[]),r=ci(),l=li(null==r?void 0:r.type),i=l.getAlignments(r,o);if(n){const t=i.filter((t=>{let{name:n}=t;return e.includes(n)}));return 1===t.length&&"none"===t[0].name?di:t}if("default"!==l.name&&"constrained"!==l.name)return di;const{alignments:a=pi}=r,s=e.filter((e=>(r.alignments||t||!mi.includes(e))&&a.includes(e))).map((e=>({name:e})));return 1===s.length&&"none"===s[0].name?di:s}var fi=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"M5 15h14V9H5v6zm0 4.8h14v-1.5H5v1.5zM5 4.2v1.5h14V4.2H5z"}));var hi=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"M4 9v6h14V9H4zm8-4.8H4v1.5h8V4.2zM4 19.8h8v-1.5H4v1.5z"}));var vi=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"M6 15h14V9H6v6zm6-10.8v1.5h8V4.2h-8zm0 15.6h8v-1.5h-8v1.5z"}));var bi=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"M5 4v11h14V4H5zm3 15.8h8v-1.5H8v1.5z"}));const ki={none:{icon:fi,title:(0,_._x)("None","Alignment option")},left:{icon:hi,title:(0,_.__)("Align left")},center:{icon:ei,title:(0,_.__)("Align center")},right:{icon:vi,title:(0,_.__)("Align right")},wide:{icon:ti,title:(0,_.__)("Wide width")},full:{icon:bi,title:(0,_.__)("Full width")}},_i={variant:"toolbar"};var yi=function(e){let{value:t,onChange:n,controls:o,isToolbar:r,isCollapsed:l=!0}=e;const i=gi(o);if(!!!i.length)return null;function a(e){n([t,"none"].includes(e)?void 0:e)}const s=ki[t],d=ki.none,m=r?h.ToolbarGroup:h.ToolbarDropdownMenu,g={icon:s?s.icon:d.icon,label:(0,_.__)("Align")},f=r?{isCollapsed:l,controls:i.map((e=>{let{name:n}=e;return{...ki[n],isActive:t===n||!t&&"none"===n,role:l?"menuitemradio":void 0,onClick:()=>a(n)}}))}:{toggleProps:{describedBy:(0,_.__)("Change alignment")},popoverProps:_i,children:e=>{let{onClose:n}=e;return(0,u.createElement)(u.Fragment,null,(0,u.createElement)(h.MenuGroup,{className:"block-editor-block-alignment-control__menu-group"},i.map((e=>{let{name:o,info:r}=e;const{icon:l,title:i}=ki[o],s=o===t||!t&&"none"===o;return(0,u.createElement)(h.MenuItem,{key:o,icon:l,iconPosition:"left",className:p()("components-dropdown-menu__menu-item",{"is-active":s}),isSelected:s,onClick:()=>{a(o),n()},role:"menuitemradio",info:r},i)}))))}};return(0,u.createElement)(m,c({},g,f))};const Ei=e=>(0,u.createElement)(yi,c({},e,{isToolbar:!1})),Ci=e=>(0,u.createElement)(yi,c({},e,{isToolbar:!0})),Si=["left","center","right","wide","full"],wi=["wide","full"];function Bi(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)?Si.filter((t=>e.includes(t))):!0===e?[...Si]:[],!o||!0===e&&!n?t.filter((e=>!wi.includes(e))):t}const Ii=(0,m.createHigherOrderComponent)((e=>t=>{const n=(0,u.createElement)(e,t),{name:o}=t,r=gi(Bi((0,a.getBlockSupport)(o,"align"),(0,a.hasBlockSupport)(o,"alignWide",!0))).map((e=>{let{name:t}=e;return t})),l=(0,g.useSelect)((e=>e(To).__unstableGetContentLockingParent(t.clientId)),[t.clientId]);if(!r.length||l)return n;return(0,u.createElement)(u.Fragment,null,(0,u.createElement)(Vo,{group:"block",__experimentalShareWithChildBlocks:!0},(0,u.createElement)(Ei,{value:t.attributes.align,onChange:e=>{if(!e){var n,o;const r=(0,a.getBlockType)(t.name);(null==r||null===(n=r.attributes)||void 0===n||null===(o=n.align)||void 0===o?void 0:o.default)&&(e="")}t.setAttributes({align:e})},controls:r})),n)}),"withToolbarControls"),xi=(0,m.createHigherOrderComponent)((e=>t=>{const{name:n,attributes:o}=t,{align:r}=o,l=gi(Bi((0,a.getBlockSupport)(n,"align"),(0,a.hasBlockSupport)(n,"alignWide",!0)));if(void 0===r)return(0,u.createElement)(e,t);let i=t.wrapperProps;return l.some((e=>e.name===r))&&(i={...i,"data-align":r}),(0,u.createElement)(e,c({},t,{wrapperProps:i}))}));(0,s.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,a.hasBlockSupport)(e,"align")&&(e.attributes={...e.attributes,align:{type:"string",enum:[...Si,""]}}),e})),(0,s.addFilter)("editor.BlockListBlock","core/editor/align/with-data-align",xi),(0,s.addFilter)("editor.BlockEdit","core/editor/align/with-toolbar-controls",Ii),(0,s.addFilter)("blocks.getSaveContent.extraProps","core/align/addAssignedAlign",(function(e,t,n){const{align:o}=n;return Bi((0,a.getBlockSupport)(t,"align"),(0,a.hasBlockSupport)(t,"alignWide",!0)).includes(o)&&(e.className=p()(`align${o}`,e.className)),e})),(0,s.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 Ti=/[\s#]/g,Mi={type:"string",source:"attribute",attribute:"id",selector:"*"};const Ni=(0,m.createHigherOrderComponent)((e=>t=>{if((0,a.hasBlockSupport)(t.name,"anchor")&&t.isSelected){const n="web"===u.Platform.OS,o=(0,u.createElement)(h.TextControl,{__nextHasNoMarginBottom:!0,className:"html-anchor-control",label:(0,_.__)("HTML anchor"),help:(0,u.createElement)(u.Fragment,null,(0,_.__)("Enter a word or two — without spaces — to make a unique web address just for this block, called an “anchor.” Then, you’ll be able to link directly to this section of your page."),n&&(0,u.createElement)(h.ExternalLink,{href:(0,_.__)("https://wordpress.org/support/article/page-jumps/")},(0,_.__)("Learn more about anchors"))),value:t.attributes.anchor||"",placeholder:n?null:(0,_.__)("Add an anchor"),onChange:e=>{e=e.replace(Ti,"-"),t.setAttributes({anchor:e})},autoCapitalize:"none",autoComplete:"off"});return(0,u.createElement)(u.Fragment,null,(0,u.createElement)(e,t),n&&(0,u.createElement)(jr,{group:"advanced"},o),!n&&"core/heading"===t.name&&(0,u.createElement)(jr,null,(0,u.createElement)(h.PanelBody,{title:(0,_.__)("Heading settings")},o)))}return(0,u.createElement)(e,t)}),"withInspectorControl");(0,s.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,a.hasBlockSupport)(e,"anchor")&&(e.attributes={...e.attributes,anchor:Mi}),e})),(0,s.addFilter)("editor.BlockEdit","core/editor/anchor/with-inspector-control",Ni),(0,s.addFilter)("blocks.getSaveContent.extraProps","core/anchor/save-props",(function(e,t,n){return(0,a.hasBlockSupport)(t,"anchor")&&(e.id=""===n.anchor?null:n.anchor),e}));const Pi={type:"string",source:"attribute",attribute:"aria-label",selector:"*"};(0,s.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,a.hasBlockSupport)(e,"ariaLabel")&&(e.attributes={...e.attributes,ariaLabel:Pi}),e})),(0,s.addFilter)("blocks.getSaveContent.extraProps","core/ariaLabel/save-props",(function(e,t,n){return(0,a.hasBlockSupport)(t,"ariaLabel")&&(e["aria-label"]=""===n.ariaLabel?null:n.ariaLabel),e}));const Li=(0,m.createHigherOrderComponent)((e=>t=>(0,a.hasBlockSupport)(t.name,"customClassName",!0)&&t.isSelected?(0,u.createElement)(u.Fragment,null,(0,u.createElement)(e,t),(0,u.createElement)(jr,{group:"advanced"},(0,u.createElement)(h.TextControl,{__nextHasNoMarginBottom:!0,autoComplete:"off",label:(0,_.__)("Additional CSS class(es)"),value:t.attributes.className||"",onChange:e=>{t.setAttributes({className:""!==e?e:void 0})},help:(0,_.__)("Separate multiple classes with spaces.")}))):(0,u.createElement)(e,t)),"withInspectorControl");(0,s.addFilter)("blocks.registerBlockType","core/custom-class-name/attribute",(function(e){return(0,a.hasBlockSupport)(e,"customClassName",!0)&&(e.attributes={...e.attributes,className:{type:"string"}}),e})),(0,s.addFilter)("editor.BlockEdit","core/editor/custom-class-name/with-inspector-control",Li),(0,s.addFilter)("blocks.getSaveContent.extraProps","core/custom-class-name/save-props",(function(e,t,n){return(0,a.hasBlockSupport)(t,"customClassName",!0)&&n.className&&(e.className=p()(e.className,n.className)),e})),(0,s.addFilter)("blocks.switchToBlockType.transformedBlock","core/color/addTransforms",(function(e,t,n,o){if(!(0,a.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 r;const o=null===(r=t[n])||void 0===r?void 0:r.attributes.className;if(o)return{...e,attributes:{...e.attributes,className:o}}}return e})),(0,s.addFilter)("blocks.getSaveContent.extraProps","core/generated-class-name/save-props",(function(e,t){return(0,a.hasBlockSupport)(t,"className",!0)&&("string"==typeof e.className?e.className=[...new Set([(0,a.getBlockDefaultClassName)(t.name),...e.className.split(" ")])].join(" ").trim():e.className=(0,a.getBlockDefaultClassName)(t.name)),e}));var Ri=window.wp.dom;const Ai=(0,u.createContext)({});function Oi(e){let{value:t,children:n}=e;const o=(0,u.useContext)(Ai),r=(0,u.useMemo)((()=>({...o,...t})),[o,t]);return(0,u.createElement)(Ai.Provider,{value:r,children:n})}var Di=Ai;const zi={};var Fi=(0,h.withFilters)("editor.BlockEdit")((e=>{const{attributes:t={},name:n}=e,o=(0,a.getBlockType)(n),r=(0,u.useContext)(Di),l=(0,u.useMemo)((()=>o&&o.usesContext?Object.fromEntries(Object.entries(r).filter((e=>{let[t]=e;return o.usesContext.includes(t)}))):zi),[o,r]);if(!o)return null;const i=o.edit||o.save;if(o.apiVersion>1)return(0,u.createElement)(i,c({},e,{context:l}));const s=(0,a.hasBlockSupport)(o,"className",!0)?(0,a.getBlockDefaultClassName)(n):null,d=p()(s,t.className,e.className);return(0,u.createElement)(i,c({},e,{context:l,className:d}))}));function Vi(e){const{name:t,isSelected:n,clientId:o,attributes:r={},__unstableLayoutClassNames:l}=e,{layout:i=null}=r,s={name:t,isSelected:n,clientId:o,layout:(0,a.hasBlockSupport)(t,"__experimentalLayout",!1)?i:null,__unstableLayoutClassNames:l};return(0,u.createElement)(Lo,{value:(0,u.useMemo)((()=>s),Object.values(s))},(0,u.createElement)(Fi,e))}var Hi=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"M11 13h2v-2h-2v2zm-6 0h2v-2H5v2zm12-2v2h2v-2h-2z"}));var Gi=function(e){let{className:t,actions:n,children:o,secondaryActions:r}=e;return(0,u.createElement)("div",{style:{display:"contents",all:"initial"}},(0,u.createElement)("div",{className:p()(t,"block-editor-warning")},(0,u.createElement)("div",{className:"block-editor-warning__contents"},(0,u.createElement)("p",{className:"block-editor-warning__message"},o),(u.Children.count(n)>0||r)&&(0,u.createElement)("div",{className:"block-editor-warning__actions"},u.Children.count(n)>0&&u.Children.map(n,((e,t)=>(0,u.createElement)("span",{key:t,className:"block-editor-warning__action"},e))),r&&(0,u.createElement)(h.DropdownMenu,{className:"block-editor-warning__secondary",icon:Hi,label:(0,_.__)("More options"),popoverProps:{position:"bottom left",className:"block-editor-warning__dropdown"},noIcons:!0},(()=>(0,u.createElement)(h.MenuGroup,null,r.map(((e,t)=>(0,u.createElement)(h.MenuItem,{onClick:e.onClick,key:t},e.title))))))))))},Ui=n(1973);function $i(e){let{title:t,rawContent:n,renderedContent:o,action:r,actionText:l,className:i}=e;return(0,u.createElement)("div",{className:i},(0,u.createElement)("div",{className:"block-editor-block-compare__content"},(0,u.createElement)("h2",{className:"block-editor-block-compare__heading"},t),(0,u.createElement)("div",{className:"block-editor-block-compare__html"},n),(0,u.createElement)("div",{className:"block-editor-block-compare__preview edit-post-visual-editor"},(0,u.createElement)(u.RawHTML,null,(0,Ri.safeHTML)(o)))),(0,u.createElement)("div",{className:"block-editor-block-compare__action"},(0,u.createElement)(h.Button,{variant:"secondary",tabIndex:"0",onClick:r},l)))}var ji=function(e){let{block:t,onKeep:n,onConvert:o,convertor:r,convertButtonText:l}=e;const i=(s=r(t),(Array.isArray(s)?s:[s]).map((e=>(0,a.getSaveContent)(e.name,e.attributes,e.innerBlocks))).join(""));var s;const c=(d=t.originalContent,m=i,(0,Ui.Kx)(d,m).map(((e,t)=>{const n=p()({"block-editor-block-compare__added":e.added,"block-editor-block-compare__removed":e.removed});return(0,u.createElement)("span",{key:t,className:n},e.value)})));var d,m;return(0,u.createElement)("div",{className:"block-editor-block-compare__wrapper"},(0,u.createElement)($i,{title:(0,_.__)("Current"),className:"block-editor-block-compare__current",action:n,actionText:(0,_.__)("Convert to HTML"),rawContent:t.originalContent,renderedContent:t.originalContent}),(0,u.createElement)($i,{title:(0,_.__)("After Conversion"),className:"block-editor-block-compare__converted",action:o,actionText:l,rawContent:c,renderedContent:i}))};const Wi=e=>(0,a.rawHandler)({HTML:e.originalContent});var Ki=(0,m.compose)([(0,g.withSelect)(((e,t)=>{let{clientId:n}=t;return{block:e(To).getBlock(n)}})),(0,g.withDispatch)(((e,t)=>{let{block:n}=t;const{replaceBlock:o}=e(To);return{convertToClassic(){o(n.clientId,(e=>(0,a.createBlock)("core/freeform",{content:e.originalContent}))(n))},convertToHTML(){o(n.clientId,(e=>(0,a.createBlock)("core/html",{content:e.originalContent}))(n))},convertToBlocks(){o(n.clientId,Wi(n))},attemptBlockRecovery(){o(n.clientId,(e=>{let{name:t,attributes:n,innerBlocks:o}=e;return(0,a.createBlock)(t,n,o)})(n))}}}))])((function(e){let{convertToHTML:t,convertToBlocks:n,convertToClassic:o,attemptBlockRecovery:r,block:l}=e;const i=!!(0,a.getBlockType)("core/html"),s=!!(0,a.getBlockType)("core/freeform"),[c,d]=(0,u.useState)(!1),p=(0,u.useCallback)((()=>d(!0)),[]),m=(0,u.useCallback)((()=>d(!1)),[]),g=(0,u.useMemo)((()=>[{title:(0,_._x)("Resolve","imperative verb"),onClick:p},i&&{title:(0,_.__)("Convert to HTML"),onClick:t},s&&{title:(0,_.__)("Convert to Classic Block"),onClick:o}].filter(Boolean)),[p,i,t,s,o]);return(0,u.createElement)(u.Fragment,null,(0,u.createElement)(Gi,{actions:[(0,u.createElement)(h.Button,{key:"recover",onClick:r,variant:"primary"},(0,_.__)("Attempt Block Recovery"))],secondaryActions:g},(0,_.__)("This block contains unexpected or invalid content.")),c&&(0,u.createElement)(h.Modal,{title:(0,_.__)("Resolve Block"),onRequestClose:m,className:"block-editor-block-compare"},(0,u.createElement)(ji,{block:l,onKeep:t,onConvert:n,convertor:Wi,convertButtonText:(0,_.__)("Convert to Blocks")})))}));const qi=(0,u.createElement)(Gi,{className:"block-editor-block-list__block-crash-warning"},(0,_.__)("This block has encountered an error and cannot be previewed."));var Yi=()=>qi;class Zi extends u.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 Qi=Zi,Xi=n(773);var Ji=function(e){let{clientId:t}=e;const[n,o]=(0,u.useState)(""),r=(0,g.useSelect)((e=>e(To).getBlock(t)),[t]),{updateBlock:l}=(0,g.useDispatch)(To);return(0,u.useEffect)((()=>{o((0,a.getBlockContent)(r))}),[r]),(0,u.createElement)(Xi.Z,{className:"block-editor-block-list__block-html-textarea",value:n,onBlur:()=>{const e=(0,a.getBlockType)(r.name);if(!e)return;const i=(0,a.getBlockAttributes)(e,n,r.attributes),s=n||(0,a.getSaveContent)(e,i),[c]=n?(0,a.validateBlock)({...r,attributes:i,originalContent:s}):[!0];l(t,{attributes:i,originalContent:s,isValid:c}),n||o({content:s})},onChange:e=>o(e.target.value)})},ea=ha(),ta=e=>pa(e,ea),na=ha();ta.write=e=>pa(e,na);var oa=ha();ta.onStart=e=>pa(e,oa);var ra=ha();ta.onFrame=e=>pa(e,ra);var la=ha();ta.onFinish=e=>pa(e,la);var ia=[];ta.setTimeout=(e,t)=>{let n=ta.now()+t,o=()=>{let e=ia.findIndex((e=>e.cancel==o));~e&&ia.splice(e,1),ua-=~e?1:0},r={time:n,handler:e,cancel:o};return ia.splice(aa(n),0,r),ua+=1,ma(),r};var aa=e=>~(~ia.findIndex((t=>t.time>e))||~ia.length);ta.cancel=e=>{oa.delete(e),ra.delete(e),la.delete(e),ea.delete(e),na.delete(e)},ta.sync=e=>{da=!0,ta.batchedUpdates(e),da=!1},ta.throttle=e=>{let t;function n(){try{e(...t)}finally{t=null}}function o(...e){t=e,ta.onStart(n)}return o.handler=e,o.cancel=()=>{oa.delete(n),t=null},o};var sa=typeof window<"u"?window.requestAnimationFrame:()=>{};ta.use=e=>sa=e,ta.now=typeof performance<"u"?()=>performance.now():Date.now,ta.batchedUpdates=e=>e(),ta.catch=console.error,ta.frameLoop="always",ta.advance=()=>{"demand"!==ta.frameLoop?console.warn("Cannot call the manual advancement of rafz whilst frameLoop is not set as demand"):fa()};var ca=-1,ua=0,da=!1;function pa(e,t){da?(t.delete(e),e(0)):(t.add(e),ma())}function ma(){ca<0&&(ca=0,"demand"!==ta.frameLoop&&sa(ga))}function ga(){~ca&&(sa(ga),ta.batchedUpdates(fa))}function fa(){let e=ca;ca=ta.now();let t=aa(ca);t&&(va(ia.splice(0,t),(e=>e.handler())),ua-=t),ua?(oa.flush(),ea.flush(e?Math.min(64,ca-e):16.667),ra.flush(),na.flush(),la.flush()):ca=-1}function ha(){let e=new Set,t=e;return{add(n){ua+=t!=e||e.has(n)?0:1,e.add(n)},delete(n){return ua-=t==e&&e.has(n)?1:0,e.delete(n)},flush(n){t.size&&(e=new Set,ua-=t.size,va(t,(t=>t(n)&&e.add(t))),ua+=e.size,t=e)}}}function va(e,t){e.forEach((e=>{try{t(e)}catch(e){ta.catch(e)}}))}var ba=n(9196),ka=n.n(ba),_a=Object.defineProperty,ya={};function Ea(){}((e,t)=>{for(var n in t)_a(e,n,{get:t[n],enumerable:!0})})(ya,{assign:()=>Oa,colors:()=>La,createStringInterpolator:()=>Ta,skipAnimation:()=>Ra,to:()=>Ma,willAdvance:()=>Aa});var Ca={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 Sa(e,t){if(Ca.arr(e)){if(!Ca.arr(t)||e.length!==t.length)return!1;for(let n=0;ne.forEach(t);function Ba(e,t,n){if(Ca.arr(e))for(let o=0;oCa.und(e)?[]:Ca.arr(e)?e:[e];function xa(e,t){if(e.size){let n=Array.from(e);e.clear(),wa(n,t)}}var Ta,Ma,Na=(e,...t)=>xa(e,(e=>e(...t))),Pa=()=>typeof window>"u"||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent),La=null,Ra=!1,Aa=Ea,Oa=e=>{e.to&&(Ma=e.to),e.now&&(ta.now=e.now),void 0!==e.colors&&(La=e.colors),null!=e.skipAnimation&&(Ra=e.skipAnimation),e.createStringInterpolator&&(Ta=e.createStringInterpolator),e.requestAnimationFrame&&ta.use(e.requestAnimationFrame),e.batchedUpdates&&(ta.batchedUpdates=e.batchedUpdates),e.willAdvance&&(Aa=e.willAdvance),e.frameLoop&&(ta.frameLoop=e.frameLoop)},Da=new Set,za=[],Fa=[],Va=0,Ha={get idle(){return!Da.size&&!za.length},start(e){Va>e.priority?(Da.add(e),ta.onStart(Ga)):(Ua(e),ta(ja))},advance:ja,sort(e){if(Va)ta.onFrame((()=>Ha.sort(e)));else{let t=za.indexOf(e);~t&&(za.splice(t,1),$a(e))}},clear(){za=[],Da.clear()}};function Ga(){Da.forEach(Ua),Da.clear(),ta(ja)}function Ua(e){za.includes(e)||$a(e)}function $a(e){za.splice(function(e,t){let n=e.findIndex(t);return n<0?e.length:n}(za,(t=>t.priority>e.priority)),0,e)}function ja(e){let t=Fa;for(let n=0;n0}var Wa="[-+]?\\d*\\.?\\d+",Ka=Wa+"%";function qa(...e){return"\\(\\s*("+e.join(")\\s*,\\s*(")+")\\s*\\)"}var Ya=new RegExp("rgb"+qa(Wa,Wa,Wa)),Za=new RegExp("rgba"+qa(Wa,Wa,Wa,Wa)),Qa=new RegExp("hsl"+qa(Wa,Ka,Ka)),Xa=new RegExp("hsla"+qa(Wa,Ka,Ka,Wa)),Ja=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,es=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,ts=/^#([0-9a-fA-F]{6})$/,ns=/^#([0-9a-fA-F]{8})$/;function os(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 rs(e,t,n){let o=n<.5?n*(1+t):n+t-n*t,r=2*n-o,l=os(r,o,e+1/3),i=os(r,o,e),a=os(r,o,e-1/3);return Math.round(255*l)<<24|Math.round(255*i)<<16|Math.round(255*a)<<8}function ls(e){let t=parseInt(e,10);return t<0?0:t>255?255:t}function is(e){return(parseFloat(e)%360+360)%360/360}function as(e){let t=parseFloat(e);return t<0?0:t>1?255:Math.round(255*t)}function ss(e){let t=parseFloat(e);return t<0?0:t>100?1:t/100}function cs(e){let t=function(e){let t;return"number"==typeof e?e>>>0===e&&e>=0&&e<=4294967295?e:null:(t=ts.exec(e))?parseInt(t[1]+"ff",16)>>>0:La&&void 0!==La[e]?La[e]:(t=Ya.exec(e))?(ls(t[1])<<24|ls(t[2])<<16|ls(t[3])<<8|255)>>>0:(t=Za.exec(e))?(ls(t[1])<<24|ls(t[2])<<16|ls(t[3])<<8|as(t[4]))>>>0:(t=Ja.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+"ff",16)>>>0:(t=ns.exec(e))?parseInt(t[1],16)>>>0:(t=es.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+t[4]+t[4],16)>>>0:(t=Qa.exec(e))?(255|rs(is(t[1]),ss(t[2]),ss(t[3])))>>>0:(t=Xa.exec(e))?(rs(is(t[1]),ss(t[2]),ss(t[3]))|as(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})`)}var us=(e,t,n)=>{if(Ca.fun(e))return e;if(Ca.arr(e))return us({range:e,output:t,extrapolate:n});if(Ca.str(e.output[0]))return Ta(e);let 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=>{let t=function(e,t){for(var n=1;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(cn){if("identity"===a)return c;"clamp"===a&&(c=n)}return o===r?o:t===n?e<=t?o:r:(t===-1/0?c=-c:n===1/0?c-=t:c=(c-t)/(n-t),c=l(c),o===-1/0?c=-c:r===1/0?c+=o:c=c*(r-o)+o,c)}(e,l[t],l[t+1],r[t],r[t+1],s,i,a,o.map)}};var ds=1.70158,ps=1.525*ds,ms=ds+1,gs=2*Math.PI/3,fs=2*Math.PI/4.5,hs=e=>e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375,vs={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-ds*e*e,easeOutBack:e=>1+ms*Math.pow(e-1,3)+ds*Math.pow(e-1,2),easeInOutBack:e=>e<.5?Math.pow(2*e,2)*(2*(ps+1)*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)*gs),easeOutElastic:e=>0===e?0:1===e?1:Math.pow(2,-10*e)*Math.sin((10*e-.75)*gs)+1,easeInOutElastic:e=>0===e?0:1===e?1:e<.5?-Math.pow(2,20*e-10)*Math.sin((20*e-11.125)*fs)/2:Math.pow(2,-20*e+10)*Math.sin((20*e-11.125)*fs)/2+1,easeInBounce:e=>1-hs(1-e),easeOutBounce:hs,easeInOutBounce:e=>e<.5?(1-hs(1-2*e))/2:(1+hs(2*e-1))/2,steps:(e,t="end")=>n=>{let o=(n="end"===t?Math.min(n,.999):Math.max(n,.001))*e;return((e,t,n)=>Math.min(Math.max(n,e),t))(0,1,("end"===t?Math.floor(o):Math.ceil(o))/e)}},bs=Symbol.for("FluidValue.get"),ks=Symbol.for("FluidValue.observers"),_s=e=>Boolean(e&&e[bs]),ys=e=>e&&e[bs]?e[bs]():e,Es=e=>e[ks]||null;function Cs(e,t){let n=e[ks];n&&n.forEach((e=>{!function(e,t){e.eventObserved?e.eventObserved(t):e(t)}(e,t)}))}var Ss=class{[bs];[ks];constructor(e){if(!e&&!(e=this.get))throw Error("Unknown getter");ws(this,e)}},ws=(e,t)=>Ts(e,bs,t);function Bs(e,t){if(e[bs]){let n=e[ks];n||Ts(e,ks,n=new Set),n.has(t)||(n.add(t),e.observerAdded&&e.observerAdded(n.size,t))}return t}function Is(e,t){let n=e[ks];if(n&&n.has(t)){let o=n.size-1;o?n.delete(t):e[ks]=null,e.observerRemoved&&e.observerRemoved(o,t)}}var xs,Ts=(e,t,n)=>Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0}),Ms=/[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,Ns=/(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi,Ps=new RegExp(`(${Ms.source})(%|[a-z]+)`,"i"),Ls=/rgba\(([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+)\)/gi,Rs=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/,As=e=>{let[t,n]=Os(e);if(!t||Pa())return e;let o=window.getComputedStyle(document.documentElement).getPropertyValue(t);if(o)return o.trim();if(n&&n.startsWith("--")){return window.getComputedStyle(document.documentElement).getPropertyValue(n)||e}return n&&Rs.test(n)?As(n):n||e},Os=e=>{let t=Rs.exec(e);if(!t)return[,];let[,n,o]=t;return[n,o]},Ds=(e,t,n,o,r)=>`rgba(${Math.round(t)}, ${Math.round(n)}, ${Math.round(o)}, ${r})`,zs=e=>{xs||(xs=La?new RegExp(`(${Object.keys(La).join("|")})(?!\\w)`,"g"):/^\b$/);let t=e.output.map((e=>ys(e).replace(Rs,As).replace(Ns,cs).replace(xs,cs))),n=t.map((e=>e.match(Ms).map(Number))),o=n[0].map(((e,t)=>n.map((e=>{if(!(t in e))throw Error('The arity of each "output" value must be equal');return e[t]})))).map((t=>us({...e,output:t})));return e=>{let n=!Ps.test(t[0])&&t.find((e=>Ps.test(e)))?.replace(Ms,""),r=0;return t[0].replace(Ms,(()=>`${o[r++](e)}${n||""}`)).replace(Ls,Ds)}},Fs="react-spring: ",Vs=e=>{let t=e,n=!1;if("function"!=typeof t)throw new TypeError(`${Fs}once requires a function parameter`);return(...e)=>{n||(t(...e),n=!0)}},Hs=Vs(console.warn);var Gs=Vs(console.warn);function Us(e){return Ca.str(e)&&("#"==e[0]||/\d/.test(e)||!Pa()&&Rs.test(e)||e in(La||{}))}new WeakMap;new Set,new WeakMap,new WeakMap,new WeakMap;var $s=Pa()?ba.useEffect:ba.useLayoutEffect;function js(){let e=(0,ba.useState)()[1],t=(()=>{let e=(0,ba.useRef)(!1);return $s((()=>(e.current=!0,()=>{e.current=!1})),[]),e})();return()=>{t.current&&e(Math.random())}}var Ws=e=>(0,ba.useEffect)(e,Ks),Ks=[];function qs(e){let t=(0,ba.useRef)();return(0,ba.useEffect)((()=>{t.current=e})),t.current}var Ys=Symbol.for("Animated:node"),Zs=e=>e&&e[Ys],Qs=(e,t)=>((e,t,n)=>Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0}))(e,Ys,t),Xs=e=>e&&e[Ys]&&e[Ys].getPayload(),Js=class{payload;constructor(){Qs(this,this)}getPayload(){return this.payload||[]}},ec=class extends Js{constructor(e){super(),this._value=e,Ca.num(this._value)&&(this.lastPosition=this._value)}done=!0;elapsedTime;lastPosition;lastVelocity;v0;durationProgress=0;static create(e){return new ec(e)}getPayload(){return[this]}getValue(){return this._value}setValue(e,t){return Ca.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(){let{done:e}=this;this.done=!1,Ca.num(this._value)&&(this.elapsedTime=0,this.durationProgress=0,this.lastPosition=this._value,e&&(this.lastVelocity=null),this.v0=null)}},tc=class extends ec{_string=null;_toString;constructor(e){super(0),this._toString=us({output:[e,e]})}static create(e){return new tc(e)}getValue(){return this._string??(this._string=this._toString(this._value))}setValue(e){if(Ca.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=us({output:[this.getValue(),e]})),this._value=0,super.reset()}},nc={dependencies:null},oc=class extends Js{constructor(e){super(),this.source=e,this.setValue(e)}getValue(e){let t={};return Ba(this.source,((n,o)=>{(e=>!!e&&e[Ys]===e)(n)?t[o]=n.getValue(e):_s(n)?t[o]=ys(n):e||(t[o]=n)})),t}setValue(e){this.source=e,this.payload=this._makePayload(e)}reset(){this.payload&&wa(this.payload,(e=>e.reset()))}_makePayload(e){if(e){let t=new Set;return Ba(e,this._addToPayload,t),Array.from(t)}}_addToPayload(e){nc.dependencies&&_s(e)&&nc.dependencies.add(e);let t=Xs(e);t&&wa(t,(e=>this.add(e)))}},rc=class extends oc{constructor(e){super(e)}static create(e){return new rc(e)}getValue(){return this.source.map((e=>e.getValue()))}setValue(e){let t=this.getPayload();return e.length==t.length?t.map(((t,n)=>t.setValue(e[n]))).some(Boolean):(super.setValue(e.map(lc)),!0)}};function lc(e){return(Us(e)?tc:ec).create(e)}function ic(e){let t=Zs(e);return t?t.constructor:Ca.arr(e)?rc:Us(e)?tc:ec}var ac=(e,t)=>{let n=!Ca.fun(e)||e.prototype&&e.prototype.isReactComponent;return(0,ba.forwardRef)(((o,r)=>{let l=(0,ba.useRef)(null),i=n&&(0,ba.useCallback)((e=>{l.current=function(e,t){return e&&(Ca.fun(e)?e(t):e.current=t),t}(r,e)}),[r]),[a,s]=function(e,t){let n=new Set;return nc.dependencies=n,e.style&&(e={...e,style:t.createAnimatedStyle(e.style)}),e=new oc(e),nc.dependencies=null,[e,n]}(o,t),c=js(),u=()=>{let e=l.current;n&&!e||!1===(!!e&&t.applyAnimatedValues(e,a.getValue(!0)))&&c()},d=new sc(u,s),p=(0,ba.useRef)();$s((()=>(p.current=d,wa(s,(e=>Bs(e,d))),()=>{p.current&&(wa(p.current.deps,(e=>Is(e,p.current))),ta.cancel(p.current.update))}))),(0,ba.useEffect)(u,[]),Ws((()=>()=>{let e=p.current;wa(e.deps,(t=>Is(t,e)))}));let m=t.getComponentProps(a.getValue());return ba.createElement(e,{...m,ref:i})}))},sc=class{constructor(e,t){this.update=e,this.deps=t}eventObserved(e){"change"==e.type&&ta.write(this.update)}};var cc=Symbol.for("AnimatedComponent"),uc=e=>Ca.str(e)?e:e&&Ca.str(e.displayName)?e.displayName:Ca.fun(e)&&e.name||null;function dc(e,...t){return Ca.fun(e)?e(...t):e}var pc=(e,t)=>!0===e||!!(t&&e&&(Ca.fun(e)?e(t):Ia(e).includes(t))),mc=(e,t)=>Ca.obj(e)?t&&e[t]:e,gc=(e,t)=>!0===e.default?e[t]:e.default?e.default[t]:void 0,fc=e=>e,hc=(e,t=fc)=>{let n=vc;e.default&&!0!==e.default&&(e=e.default,n=Object.keys(e));let o={};for(let r of n){let n=t(e[r],r);Ca.und(n)||(o[r]=n)}return o},vc=["config","onProps","onStart","onChange","onPause","onResume","onRest"],bc={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 kc(e){let t=function(e){let t={},n=0;if(Ba(e,((e,o)=>{bc[o]||(t[o]=e,n++)})),n)return t}(e);if(t){let n={to:t};return Ba(e,((e,o)=>o in t||(n[o]=e))),n}return{...e}}function _c(e){return e=ys(e),Ca.arr(e)?e.map(_c):Us(e)?ya.createStringInterpolator({range:[0,1],output:[e,e]})(1):e}function yc(e){for(let t in e)return!0;return!1}function Ec(e){return Ca.fun(e)||Ca.arr(e)&&Ca.obj(e[0])}function Cc(e,t){e.ref?.delete(e),t?.delete(e)}function Sc(e,t){t&&e.ref!==t&&(e.ref?.delete(e),t.add(e),e.ref=t)}var wc={tension:170,friction:26,mass:1,damping:1,easing:vs.linear,clamp:!1};function Bc(e,t){if(Ca.und(t.decay)){let n=!Ca.und(t.tension)||!Ca.und(t.friction);(n||!Ca.und(t.frequency)||!Ca.und(t.damping)||!Ca.und(t.mass))&&(e.duration=void 0,e.decay=void 0),n&&(e.frequency=void 0)}else e.duration=void 0}var Ic=[];function xc(e,{key:t,props:n,defaultProps:o,state:r,actions:l}){return new Promise(((i,a)=>{let s,c,u=pc(n.cancel??o?.cancel,t);if(u)m();else{Ca.und(n.pause)||(r.paused=pc(n.pause,t));let e=o?.pause;!0!==e&&(e=r.paused||pc(e,t)),s=dc(n.delay||0,t),e?(r.resumeQueue.add(p),l.pause()):(l.resume(),p())}function d(){r.resumeQueue.add(p),r.timeouts.delete(c),c.cancel(),s=c.time-ta.now()}function p(){s>0&&!ya.skipAnimation?(r.delayed=!0,c=ta.setTimeout(m,s),r.pauseQueue.add(d),r.timeouts.add(c)):m()}function m(){r.delayed&&(r.delayed=!1),r.pauseQueue.delete(d),r.timeouts.delete(c),e<=(r.cancelId||0)&&(u=!0);try{l.start({...n,callId:e,cancel:u},i)}catch(e){a(e)}}}))}var Tc=(e,t)=>1==t.length?t[0]:t.some((e=>e.cancelled))?Pc(e.get()):t.every((e=>e.noop))?Mc(e.get()):Nc(e.get(),t.every((e=>e.finished))),Mc=e=>({value:e,noop:!0,finished:!0,cancelled:!1}),Nc=(e,t,n=!1)=>({value:e,finished:t,cancelled:n}),Pc=e=>({value:e,cancelled:!0,finished:!1});function Lc(e,t,n,o){let{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;let c,u,d,p=hc(t,((e,t)=>"onRest"===t?void 0:e)),m=new Promise(((e,t)=>(c=e,u=t))),g=e=>{let t=r<=(n.cancelId||0)&&Pc(o)||r!==n.asyncId&&Nc(o,!1);if(t)throw e.result=t,u(e),e},f=(e,t)=>{let l=new Ac,i=new Oc;return(async()=>{if(ya.skipAnimation)throw Rc(n),i.result=Nc(o,!1),u(i),i;g(l);let a=Ca.obj(e)?{...e}:{...t,to:e};a.parentId=r,Ba(p,((e,t)=>{Ca.und(a[t])&&(a[t]=e)}));let s=await o.start(a);return g(l),n.paused&&await new Promise((e=>{n.resumeQueue.add(e)})),s})()};if(ya.skipAnimation)return Rc(n),Nc(o,!1);try{let t;t=Ca.arr(e)?(async e=>{for(let t of e)await f(t)})(e):Promise.resolve(e(f,o.stop.bind(o))),await Promise.all([t.then(c),m]),d=Nc(o.get(),!0,!1)}catch(e){if(e instanceof Ac)d=e.result;else{if(!(e instanceof Oc))throw e;d=e.result}}finally{r==n.asyncId&&(n.asyncId=l,n.asyncTo=l?a:void 0,n.promise=l?s:void 0)}return Ca.fun(i)&&ta.batchedUpdates((()=>{i(d,o,o.item)})),d})():s}function Rc(e,t){xa(e.timeouts,(e=>e.cancel())),e.pauseQueue.clear(),e.resumeQueue.clear(),e.asyncId=e.asyncTo=e.promise=void 0,t&&(e.cancelId=t)}var Ac=class extends Error{result;constructor(){super("An async animation has been interrupted. You see this error because you forgot to use `await` or `.catch(...)` on its returned promise.")}},Oc=class extends Error{result;constructor(){super("SkipAnimationSignal")}},Dc=e=>e instanceof Fc,zc=1,Fc=class extends Ss{id=zc++;_priority=0;get priority(){return this._priority}set priority(e){this._priority!=e&&(this._priority=e,this._onPriorityChange(e))}get(){let e=Zs(this);return e&&e.getValue()}to(...e){return ya.to(this,e)}interpolate(...e){return Hs(`${Fs}The "interpolate" function is deprecated in v9 (use "to" instead)`),ya.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){Cs(this,{type:"change",parent:this,value:e,idle:t})}_onPriorityChange(e){this.idle||Ha.sort(this),Cs(this,{type:"priority",parent:this,priority:e})}},Vc=Symbol.for("SpringPhase"),Hc=e=>(1&e[Vc])>0,Gc=e=>(2&e[Vc])>0,Uc=e=>(4&e[Vc])>0,$c=(e,t)=>t?e[Vc]|=3:e[Vc]&=-3,jc=(e,t)=>t?e[Vc]|=4:e[Vc]&=-5,Wc=class extends Fc{key;animation=new class{changed=!1;values=Ic;toValues=null;fromValues=Ic;to;from;config=new class{tension;friction;frequency;damping;mass;velocity=0;restVelocity;precision;progress;duration;easing;clamp;bounce;decay;round;constructor(){Object.assign(this,wc)}};immediate=!1};queue;defaultProps={};_state={paused:!1,delayed:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set};_pendingCalls=new Set;_lastCallId=0;_lastToId=0;_memoizedDuration=0;constructor(e,t){if(super(),!Ca.und(e)||!Ca.und(t)){let n=Ca.obj(e)?{...e}:{...t,from:e};Ca.und(n.default)&&(n.default=!0),this.start(n)}}get idle(){return!(Gc(this)||this._state.asyncTo)||Uc(this)}get goal(){return ys(this.animation.to)}get velocity(){let e=Zs(this);return e instanceof ec?e.lastVelocity||0:e.getPayload().map((e=>e.lastVelocity||0))}get hasAnimated(){return Hc(this)}get isAnimating(){return Gc(this)}get isPaused(){return Uc(this)}get isDelayed(){return this._state.delayed}advance(e){let t=!0,n=!1,o=this.animation,{config:r,toValues:l}=o,i=Xs(o.to);!i&&_s(o.to)&&(l=Ia(ys(o.to))),o.values.forEach(((a,s)=>{if(a.done)return;let c=a.constructor==tc?1:i?i[s].lastPosition:l[s],u=o.immediate,d=c;if(!u){if(d=a.lastPosition,r.tension<=0)return void(a.done=!0);let t,n=a.elapsedTime+=e,l=o.fromValues[s],i=null!=a.v0?a.v0:a.v0=Ca.arr(r.velocity)?r.velocity[s]:r.velocity,p=r.precision||(l==c?.005:Math.min(1,.001*Math.abs(c-l)));if(Ca.und(r.duration))if(r.decay){let e=!0===r.decay?.998:r.decay,o=Math.exp(-(1-e)*n);d=l+i/(1-e)*(1-o),u=Math.abs(a.lastPosition-d)<=p,t=i*o}else{t=null==a.lastVelocity?i:a.lastVelocity;let n,o=r.restVelocity||p/10,s=r.clamp?0:r.bounce,m=!Ca.und(s),g=l==c?a.v0>0:lo,n||(u=Math.abs(c-d)<=p,!u));++e){m&&(f=d==c||d>c==g,f&&(t=-t*s,d=c)),t+=(1e-6*-r.tension*(d-c)+.001*-r.friction*t)/r.mass*h,d+=t*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,n=a.elapsedTime+=e)),o=(r.progress||0)+n/this._memoizedDuration,o=o>1?1:o<0?0:o,a.durationProgress=o),d=l+r.easing(o)*(c-l),t=(d-a.lastPosition)/e,u=1==o}a.lastVelocity=t,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)}));let a=Zs(this),s=a.getValue();if(t){let e=ys(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 ta.batchedUpdates((()=>{this._stop(),this._focus(e),this._set(e)})),this}pause(){this._update({pause:!0})}resume(){this._update({pause:!1})}finish(){if(Gc(this)){let{to:e,config:t}=this.animation;ta.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 Ca.und(e)?(n=this.queue||[],this.queue=[]):n=[Ca.obj(e)?e:{...t,to:e}],Promise.all(n.map((e=>this._update(e)))).then((e=>Tc(this,e)))}stop(e){let{to:t}=this.animation;return this._focus(this.get()),Rc(this._state,e&&this._lastCallId),ta.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){let t=this.key||"",{to:n,from:o}=e;n=Ca.obj(n)?n[t]:n,(null==n||Ec(n))&&(n=void 0),o=Ca.obj(o)?o[t]:o,null==o&&(o=void 0);let r={to:n,from:o};return Hc(this)||(e.reverse&&([n,o]=[o,n]),o=ys(o),Ca.und(o)?Zs(this)||this._set(n):this._set(o)),r}_update({...e},t){let{key:n,defaultProps:o}=this;e.default&&Object.assign(o,hc(e,((e,t)=>/^on/.test(t)?mc(e,n):e))),Jc(this,e,"onProps"),eu(this,"onProps",e,this);let r=this._prepareNode(e);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?");let l=this._state;return xc(++this._lastCallId,{key:n,props:e,defaultProps:o,state:l,actions:{pause:()=>{Uc(this)||(jc(this,!0),Na(l.pauseQueue),eu(this,"onPause",Nc(this,Kc(this,this.animation.to)),this))},resume:()=>{Uc(this)&&(jc(this,!1),Gc(this)&&this._resume(),Na(l.resumeQueue),eu(this,"onResume",Nc(this,Kc(this,this.animation.to)),this))},start:this._merge.bind(this,r)}}).then((n=>{if(e.loop&&n.finished&&(!t||!n.noop)){let t=qc(e);if(t)return this._update(t,!0)}return n}))}_merge(e,t,n){if(t.cancel)return this.stop(!0),n(Pc(this));let o=!Ca.und(e.to),r=!Ca.und(e.from);if(o||r){if(!(t.callId>this._lastToId))return n(Pc(this));this._lastToId=t.callId}let{key:l,defaultProps:i,animation:a}=this,{to:s,from:c}=a,{to:u=s,from:d=c}=e;r&&!o&&(!t.default||Ca.und(u))&&(u=d),t.reverse&&([u,d]=[d,u]);let p=!Sa(d,c);p&&(a.from=d),d=ys(d);let m=!Sa(u,s);m&&this._focus(u);let g=Ec(t.to),{config:f}=a,{decay:h,velocity:v}=f;(o||r)&&(f.velocity=0),t.config&&!g&&function(e,t,n){n&&(Bc(n={...n},t),t={...n,...t}),Bc(e,t),Object.assign(e,t);for(let t in wc)null==e[t]&&(e[t]=wc[t]);let{mass:o,frequency:r,damping:l}=e;Ca.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)}(f,dc(t.config,l),t.config!==i.config?dc(i.config,l):void 0);let b=Zs(this);if(!b||Ca.und(u))return n(Nc(this,!0));let k=Ca.und(t.reset)?r&&!t.default:!Ca.und(d)&&pc(t.reset,l),_=k?d:this.get(),y=_c(u),E=Ca.num(y)||Ca.arr(y)||Us(y),C=!g&&(!E||pc(i.immediate||t.immediate,l));if(m){let e=ic(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)}}let S=b.constructor,w=_s(u),B=!1;if(!w){let e=k||!Hc(this)&&p;(m||e)&&(B=Sa(_c(_),y),w=!B),(!Sa(a.immediate,C)&&!C||!Sa(f.decay,h)||!Sa(f.velocity,v))&&(w=!0)}if(B&&Gc(this)&&(a.changed&&!k?w=!0:w||this._stop(s)),!g&&((w||_s(s))&&(a.values=b.getPayload(),a.toValues=_s(u)?null:S==tc?[1]:Ia(y)),a.immediate!=C&&(a.immediate=C,!C&&!k&&this._set(s)),w)){let{onRest:e}=a;wa(Xc,(e=>Jc(this,t,e)));let o=Nc(this,Kc(this,s));Na(this._pendingCalls,o),this._pendingCalls.add(n),a.changed&&ta.batchedUpdates((()=>{a.changed=!k,e?.(o,this),k?dc(i.onRest,o):a.onStart?.(o,this)}))}k&&this._set(_),g?n(Lc(t.to,t,this._state,this)):w?this._start():Gc(this)&&!m?this._pendingCalls.add(n):n(Mc(_))}_focus(e){let t=this.animation;e!==t.to&&(Es(this)&&this._detach(),t.to=e,Es(this)&&this._attach())}_attach(){let e=0,{to:t}=this.animation;_s(t)&&(Bs(t,this),Dc(t)&&(e=t.priority+1)),this.priority=e}_detach(){let{to:e}=this.animation;_s(e)&&Is(e,this)}_set(e,t=!0){let n=ys(e);if(!Ca.und(n)){let e=Zs(this);if(!e||!Sa(n,e.getValue())){let o=ic(n);e&&e.constructor==o?e.setValue(n):Qs(this,o.create(n)),e&&ta.batchedUpdates((()=>{this._onChange(n,t)}))}}return Zs(this)}_onStart(){let e=this.animation;e.changed||(e.changed=!0,eu(this,"onStart",Nc(this,Kc(this,e.to)),this))}_onChange(e,t){t||(this._onStart(),dc(this.animation.onChange,e,this)),dc(this.defaultProps.onChange,e,this),super._onChange(e,t)}_start(){let e=this.animation;Zs(this).reset(ys(e.to)),e.immediate||(e.fromValues=e.values.map((e=>e.lastPosition))),Gc(this)||($c(this,!0),Uc(this)||this._resume())}_resume(){ya.skipAnimation?this.finish():Ha.start(this)}_stop(e,t){if(Gc(this)){$c(this,!1);let n=this.animation;wa(n.values,(e=>{e.done=!0})),n.toValues&&(n.onChange=n.onPause=n.onResume=void 0),Cs(this,{type:"idle",parent:this});let o=t?Pc(this.get()):Nc(this.get(),Kc(this,e??n.to));Na(this._pendingCalls,o),n.changed&&(n.changed=!1,eu(this,"onRest",o,this))}}};function Kc(e,t){let n=_c(t);return Sa(_c(e.get()),n)}function qc(e,t=e.loop,n=e.to){let o=dc(t);if(o){let r=!0!==o&&kc(o),l=(r||e).reverse,i=!r||r.reset;return Yc({...e,loop:t,default:!1,pause:void 0,to:!l||Ec(n)?n:void 0,from:i?e.from:void 0,reset:i,...r})}}function Yc(e){let{to:t,from:n}=e=kc(e),o=new Set;return Ca.obj(t)&&Qc(t,o),Ca.obj(n)&&Qc(n,o),e.keys=o.size?Array.from(o):null,e}function Zc(e){let t=Yc(e);return Ca.und(t.default)&&(t.default=hc(t)),t}function Qc(e,t){Ba(e,((e,n)=>null!=e&&t.add(n)))}var Xc=["onStart","onRest","onChange","onPause","onResume"];function Jc(e,t,n){e.animation[n]=t[n]!==gc(t,n)?mc(t[n],e.key):void 0}function eu(e,t,...n){e.animation[t]?.(...n),e.defaultProps[t]?.(...n)}var tu=["onStart","onChange","onRest"],nu=1,ou=class{id=nu++;springs={};queue=[];ref;_flush;_initialProps;_lastAsyncId=0;_active=new Set;_changed=new Set;_started=!1;_item;_state={paused:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set};_events={onStart:new Map,onChange:new Map,onRest:new Map};constructor(e,t){this._onFrame=this._onFrame.bind(this),t&&(this._flush=t),e&&this.start({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(){let e={};return this.each(((t,n)=>e[n]=t.get())),e}set(e){for(let t in e){let n=e[t];Ca.und(n)||this.springs[t].set(n)}}update(e){return e&&this.queue.push(Yc(e)),this}start(e){let{queue:t}=this;return e?t=Ia(e).map(Yc):this.queue=[],this._flush?this._flush(this,t):(uu(this,t),ru(this,t))}stop(e,t){if(e!==!!e&&(t=e),t){let n=this.springs;wa(Ia(t),(t=>n[t].stop(!!e)))}else Rc(this._state,this._lastAsyncId),this.each((t=>t.stop(!!e)));return this}pause(e){if(Ca.und(e))this.start({pause:!0});else{let t=this.springs;wa(Ia(e),(e=>t[e].pause()))}return this}resume(e){if(Ca.und(e))this.start({pause:!1});else{let t=this.springs;wa(Ia(e),(e=>t[e].resume()))}return this}each(e){Ba(this.springs,e)}_onFrame(){let{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,xa(e,(([e,t])=>{t.value=this.get(),e(t,this,this._item)})));let l=!o&&this._started,i=r||l&&n.size?this.get():null;r&&t.size&&xa(t,(([e,t])=>{t.value=i,e(t,this,this._item)})),l&&(this._started=!1,xa(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)}ta.onFrame(this._onFrame)}};function ru(e,t){return Promise.all(t.map((t=>lu(e,t)))).then((t=>Tc(e,t)))}async function lu(e,t,n){let{keys:o,to:r,from:l,loop:i,onRest:a,onResolve:s}=t,c=Ca.obj(t.default)&&t.default;i&&(t.loop=!1),!1===r&&(t.to=null),!1===l&&(t.from=null);let u=Ca.arr(r)||Ca.fun(r)?r:void 0;u?(t.to=void 0,t.onRest=void 0,c&&(c.onRest=void 0)):wa(tu,(n=>{let o=t[n];if(Ca.fun(o)){let r=e._events[n];t[n]=({finished:e,cancelled:t})=>{let 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])}}));let d=e._state;t.pause===!d.paused?(d.paused=t.pause,Na(t.pause?d.pauseQueue:d.resumeQueue)):d.paused&&(t.pause=!0);let p=(o||Object.keys(e.springs)).map((n=>e.springs[n].start(t))),m=!0===t.cancel||!0===gc(t,"cancel");(u||m&&d.asyncId)&&p.push(xc(++e._lastAsyncId,{props:t,state:d,actions:{pause:Ea,resume:Ea,start(t,n){m?(Rc(d,e._lastAsyncId),n(Pc(e))):(t.onRest=a,n(Lc(u,t,d,e)))}}})),d.paused&&await new Promise((e=>{d.resumeQueue.add(e)}));let g=Tc(e,await Promise.all(p));if(i&&g.finished&&(!n||!g.noop)){let n=qc(t,i,r);if(n)return uu(e,[n]),lu(e,n,!0)}return s&&ta.batchedUpdates((()=>s(g,e,e.item))),g}function iu(e,t){let n={...e.springs};return t&&wa(Ia(t),(e=>{Ca.und(e.keys)&&(e=Yc(e)),Ca.obj(e.to)||(e={...e,to:void 0}),cu(n,e,(e=>su(e)))})),au(e,n),n}function au(e,t){Ba(t,((t,n)=>{e.springs[n]||(e.springs[n]=t,Bs(t,e))}))}function su(e,t){let n=new Wc;return n.key=e,t&&Bs(n,t),n}function cu(e,t,n){t.keys&&wa(t.keys,(o=>{(e[o]||(e[o]=n(o)))._prepareNode(t)}))}function uu(e,t){wa(t,(t=>{cu(e.springs,t,(t=>su(t,e)))}))}var du=({children:e,...t})=>{let n=(0,ba.useContext)(pu),o=t.pause||!!n.pause,r=t.immediate||!!n.immediate;t=function(e,t){let[n]=(0,ba.useState)((()=>({inputs:t,result:e()}))),o=(0,ba.useRef)(),r=o.current,l=r;return l?Boolean(t&&l.inputs&&function(e,t){if(e.length!==t.length)return!1;for(let n=0;n{o.current=l,r==n&&(n.inputs=n.result=void 0)}),[l]),l.result}((()=>({pause:o,immediate:r})),[o,r]);let{Provider:l}=pu;return ba.createElement(l,{value:t},e)},pu=function(e,t){return Object.assign(e,ba.createContext(t)),e.Provider._context=e,e.Consumer._context=e,e}(du,{});du.Provider=pu.Provider,du.Consumer=pu.Consumer;var mu=()=>{let e=[],t=function(t){Gs(`${Fs}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`);let o=[];return wa(e,((e,r)=>{if(Ca.und(t))o.push(e.start());else{let 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){let n=e.indexOf(t);~n&&e.splice(n,1)},t.pause=function(){return wa(e,(e=>e.pause(...arguments))),this},t.resume=function(){return wa(e,(e=>e.resume(...arguments))),this},t.set=function(t){wa(e,((e,n)=>{let o=Ca.fun(t)?t(n,e):t;o&&e.set(o)}))},t.start=function(t){let n=[];return wa(e,((e,o)=>{if(Ca.und(t))n.push(e.start());else{let r=this._getProps(t,e,o);r&&n.push(e.start(r))}})),n},t.stop=function(){return wa(e,(e=>e.stop(...arguments))),this},t.update=function(t){return wa(e,((e,n)=>e.update(this._getProps(t,e,n)))),this};let n=function(e,t,n){return Ca.fun(e)?e(n,t):e};return t._getProps=n,t};function gu(e,t,n){let o=Ca.fun(t)&&t;o&&!n&&(n=[]);let r=(0,ba.useMemo)((()=>o||3==arguments.length?mu():void 0),[]),l=(0,ba.useRef)(0),i=js(),a=(0,ba.useMemo)((()=>({ctrls:[],queue:[],flush(e,t){let n=iu(e,t);return l.current>0&&!a.queue.length&&!Object.keys(n).some((t=>!e.springs[t]))?ru(e,t):new Promise((o=>{au(e,n),a.queue.push((()=>{o(ru(e,t))})),i()}))}})),[]),s=(0,ba.useRef)([...a.ctrls]),c=[],u=qs(e)||0;function d(e,n){for(let r=e;r{wa(s.current.slice(e,u),(e=>{Cc(e,r),e.stop(!0)})),s.current.length=e,d(u,e)}),[e]),(0,ba.useMemo)((()=>{d(0,Math.min(u,e))}),n);let p=s.current.map(((e,t)=>iu(e,c[t]))),m=(0,ba.useContext)(du),g=qs(m),f=m!==g&&yc(m);$s((()=>{l.current++,a.ctrls=s.current;let{queue:e}=a;e.length&&(a.queue=[],wa(e,(e=>e()))),wa(s.current,((e,t)=>{r?.add(e),f&&e.start({default:m});let n=c[t];n&&(Sc(e,n.ref),e.ref?e.queue.push(n):e.start(n))}))})),Ws((()=>()=>{wa(a.ctrls,(e=>e.stop(!0)))}));let h=p.map((e=>({...e})));return r?[h,r]:h}function fu(e,t){let n=Ca.fun(e),[[o],r]=gu(1,n?e:[e],n?t||[]:t);return n||2==arguments.length?[o,r]:o}var hu=class extends Fc{constructor(e,t){super(),this.source=e,this.calc=us(...t);let n=this._get(),o=ic(n);Qs(this,o.create(n))}key;idle=!0;calc;_active=new Set;advance(e){let t=this._get();Sa(t,this.get())||(Zs(this).setValue(t),this._onChange(t,this.idle)),!this.idle&&bu(this._active)&&ku(this)}_get(){let e=Ca.arr(this.source)?this.source.map(ys):Ia(ys(this.source));return this.calc(...e)}_start(){this.idle&&!bu(this._active)&&(this.idle=!1,wa(Xs(this),(e=>{e.done=!1})),ya.skipAnimation?(ta.batchedUpdates((()=>this.advance())),ku(this)):Ha.start(this))}_attach(){let e=1;wa(Ia(this.source),(t=>{_s(t)&&Bs(t,this),Dc(t)&&(t.idle||this._active.add(t),e=Math.max(e,t.priority+1))})),this.priority=e,this._start()}_detach(){wa(Ia(this.source),(e=>{_s(e)&&Is(e,this)})),this._active.clear(),ku(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=Ia(this.source).reduce(((e,t)=>Math.max(e,(Dc(t)?t.priority:0)+1)),0))}};function vu(e){return!1!==e.idle}function bu(e){return!e.size||Array.from(e).every(vu)}function ku(e){e.idle||(e.idle=!0,wa(Xs(e),(e=>{e.done=!0})),Cs(e,{type:"idle",parent:e}))}ya.assign({createStringInterpolator:zs,to:(e,t)=>new hu(e,t)});Ha.advance;var _u=window.ReactDOM,yu=/^--/;function Eu(e,t){return null==t||"boolean"==typeof t||""===t?"":"number"!=typeof t||0===t||yu.test(e)||Su.hasOwnProperty(e)&&Su[e]?(""+t).trim():t+"px"}var Cu={};var Su={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},wu=["Webkit","Ms","Moz","O"];Su=Object.keys(Su).reduce(((e,t)=>(wu.forEach((n=>e[((e,t)=>e+t.charAt(0).toUpperCase()+t.substring(1))(n,t)]=e[t])),e)),Su);var Bu=/^(matrix|translate|scale|rotate|skew)/,Iu=/^(translate)/,xu=/^(rotate|skew)/,Tu=(e,t)=>Ca.num(e)&&0!==e?e+t:e,Mu=(e,t)=>Ca.arr(e)?e.every((e=>Mu(e,t))):Ca.num(e)?e===t:parseFloat(e)===t,Nu=class extends oc{constructor({x:e,y:t,z:n,...o}){let r=[],l=[];(e||t||n)&&(r.push([e||0,t||0,n||0]),l.push((e=>[`translate3d(${e.map((e=>Tu(e,"px"))).join(",")})`,Mu(e,0)]))),Ba(o,((e,t)=>{if("transform"===t)r.push([e||""]),l.push((e=>[e,""===e]));else if(Bu.test(t)){if(delete o[t],Ca.und(e))return;let n=Iu.test(t)?"px":xu.test(t)?"deg":"";r.push(Ia(e)),l.push("rotate3d"===t?([e,t,o,r])=>[`rotate3d(${e},${t},${o},${Tu(r,n)})`,Mu(r,0)]:e=>[`${t}(${e.map((e=>Tu(e,n))).join(",")})`,Mu(e,t.startsWith("scale")?1:0)])}})),r.length&&(o.transform=new Pu(r,l)),super(o)}},Pu=class extends Ss{constructor(e,t){super(),this.inputs=e,this.transforms=t}_value=null;get(){return this._value||(this._value=this._get())}_get(){let e="",t=!0;return wa(this.inputs,((n,o)=>{let r=ys(n[0]),[l,i]=this.transforms[o](Ca.arr(r)?r:n.map(ys));e+=" "+l,t=t&&i})),t?"none":e}observerAdded(e){1==e&&wa(this.inputs,(e=>wa(e,(e=>_s(e)&&Bs(e,this)))))}observerRemoved(e){0==e&&wa(this.inputs,(e=>wa(e,(e=>_s(e)&&Is(e,this)))))}eventObserved(e){"change"==e.type&&(this._value=null),Cs(this,e)}};ya.assign({batchedUpdates:_u.unstable_batchedUpdates,createStringInterpolator:zs,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}});var Lu=((e,{applyAnimatedValues:t=(()=>!1),createAnimatedStyle:n=(e=>new oc(e)),getComponentProps:o=(e=>e)}={})=>{let r={applyAnimatedValues:t,createAnimatedStyle:n,getComponentProps:o},l=e=>{let t=uc(e)||"Anonymous";return(e=Ca.str(e)?l[e]||(l[e]=ac(e,r)):e[cc]||(e[cc]=ac(e,r))).displayName=`Animated(${t})`,e};return Ba(e,((t,n)=>{Ca.arr(e)&&(n=uc(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;let n="filter"===e.nodeName||e.parentNode&&"filter"===e.parentNode.nodeName,{style:o,children:r,scrollTop:l,scrollLeft:i,viewBox:a,...s}=t,c=Object.values(s),u=Object.keys(s).map((t=>n||e.hasAttribute(t)?t:Cu[t]||(Cu[t]=t.replace(/([A-Z])/g,(e=>"-"+e.toLowerCase())))));void 0!==r&&(e.textContent=r);for(let t in o)if(o.hasOwnProperty(t)){let n=Eu(t,o[t]);yu.test(t)?e.style.setProperty(t,n):e.style[t]=n}u.forEach(((t,n)=>{e.setAttribute(t,c[n])})),void 0!==l&&(e.scrollTop=l),void 0!==i&&(e.scrollLeft=i),void 0!==a&&e.setAttribute("viewBox",a)},createAnimatedStyle:e=>new Nu(e),getComponentProps:({scrollTop:e,scrollLeft:t,...n})=>n}),Ru=Lu.animated;const Au=e=>e+1,Ou=e=>({top:e.offsetTop,left:e.offsetLeft});var Du=function(e){let{isSelected:t,adjustScrolling:n,enableAnimation:o,triggerAnimationOnChange:r}=e;const l=(0,u.useRef)(),i=(0,m.useReducedMotion)()||!o,[a,s]=(0,u.useReducer)(Au,0),[c,d]=(0,u.useReducer)(Au,0),[p,g]=(0,u.useState)({x:0,y:0}),f=(0,u.useMemo)((()=>l.current?Ou(l.current):null),[r]),h=(0,u.useMemo)((()=>{if(!n||!l.current)return()=>{};const e=(0,Ri.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,u.useLayoutEffect)((()=>{a&&d()}),[a]),(0,u.useLayoutEffect)((()=>{if(!f)return;if(i)return void h();l.current.style.transform=void 0;const e=Ou(l.current);s(),g({x:Math.round(f.left-e.left),y:Math.round(f.top-e.top)})}),[r]),fu({from:{x:p.x,y:p.y},to:{x:0,y:0},reset:a!==c,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 zu=".block-editor-block-list__block",Fu=".block-list-appender",Vu=".block-editor-button-block-appender";function Hu(e,t){return t.closest([zu,Fu,Vu].join(","))===e}function Gu(e){for(;e&&e.nodeType!==e.ELEMENT_NODE;)e=e.parentNode;if(!e)return;const t=e.closest(zu);return t?t.id.slice("block-".length):void 0}function Uu(e){const t=(0,u.useRef)(),n=function(e){return(0,g.useSelect)((t=>{const{getSelectedBlocksInitialCaretPosition:n,__unstableGetEditorMode:o,isBlockSelected:r}=t(To);if(r(e)&&"edit"===o())return n()}),[e])}(e),{isBlockSelected:o,isMultiSelecting:r}=(0,g.useSelect)(To);return(0,u.useEffect)((()=>{if(!o(e)||r())return;if(null==n)return;if(!t.current)return;const{ownerDocument:l}=t.current;if(Hu(t.current,l.activeElement))return;const i=Ri.focus.tabbable.find(t.current).filter((e=>(0,Ri.isTextField)(e))),a=-1===n,s=i[a?i.length-1:0]||t.current;if(Hu(t.current,s)){if(!t.current.getAttribute("contenteditable")){const e=Ri.focus.tabbable.findNext(t.current);if(e&&Hu(t.current,e)&&(0,Ri.isFormElement)(e))return void e.focus()}(0,Ri.placeCaretAtHorizontalEdge)(s,a)}else t.current.focus()}),[n,e]),t}function $u(e){if(e.defaultPrevented)return;const t="mouseover"===e.type?"add":"remove";e.preventDefault(),e.currentTarget.classList[t]("is-hovered")}function ju(){const e=(0,g.useSelect)((e=>{const{getSettings:t}=e(To);return t().outlineMode}),[]);return(0,m.useRefEffect)((t=>{if(e)return t.addEventListener("mouseout",$u),t.addEventListener("mouseover",$u),()=>{t.removeEventListener("mouseout",$u),t.removeEventListener("mouseover",$u),t.classList.remove("is-hovered")}}),[e])}function Wu(e){return(0,g.useSelect)((t=>{const{isBlockBeingDragged:n,isBlockHighlighted:o,isBlockSelected:r,isBlockMultiSelected:l,getBlockName:i,getSettings:s,hasSelectedInnerBlock:c,isTyping:u,__unstableIsFullySelected:d,__unstableSelectionHasUnmergeableBlock:m}=t(To),{outlineMode:g}=s(),f=n(e),h=r(e),v=i(e),b=c(e,!0),k=l(e);return p()({"is-selected":h,"is-highlighted":o(e),"is-multi-selected":k,"is-partially-selected":k&&!d()&&!m(),"is-reusable":(0,a.isReusableBlock)((0,a.getBlockType)(v)),"is-dragging":f,"has-child-selected":b,"remove-outline":h&&g&&u()})}),[e])}function Ku(e){return(0,g.useSelect)((t=>{const n=t(To).getBlockName(e),o=(0,a.getBlockType)(n);if((null==o?void 0:o.apiVersion)>1)return(0,a.getBlockDefaultClassName)(n)}),[e])}function qu(e){return(0,g.useSelect)((t=>{const{getBlockName:n,getBlockAttributes:o}=t(To),r=o(e);if(null==r||!r.className)return;const l=(0,a.getBlockType)(n(e));return(null==l?void 0:l.apiVersion)>1?r.className:void 0}),[e])}function Yu(e){return(0,g.useSelect)((t=>{const{hasBlockMovingClientId:n,canInsertBlockType:o,getBlockName:r,getBlockRootClientId:l,isBlockSelected:i}=t(To);if(!i(e))return;const a=n();return a?p()("is-block-moving-mode",{"can-insert-moving-block":o(r(a),l(e))}):void 0}),[e])}function Zu(e){const{isBlockSelected:t}=(0,g.useSelect)(To),{selectBlock:n,selectionChange:o}=(0,g.useDispatch)(To);return(0,m.useRefEffect)((r=>{function l(l){r.parentElement.closest('[contenteditable="true"]')||(t(e)?l.target.isContentEditable||o(e):Hu(r,l.target)&&n(e))}return r.addEventListener("focusin",l),()=>{r.removeEventListener("focusin",l)}}),[t,n])}var Qu=window.wp.keycodes;function Xu(e){const t=(0,g.useSelect)((t=>t(To).isBlockSelected(e)),[e]),{getBlockRootClientId:n,getBlockIndex:o}=(0,g.useSelect)(To),{insertDefaultBlock:r,removeBlock:l}=(0,g.useDispatch)(To);return(0,m.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!==Qu.ENTER&&a!==Qu.BACKSPACE&&a!==Qu.DELETE||s!==i||(0,Ri.isTextField)(s)||(t.preventDefault(),a===Qu.ENTER?r({},n(e),o(e)+1):l(e))}function s(e){e.preventDefault()}}),[e,t,n,o,r,l])}function Ju(e){const{isNavigationMode:t,isBlockSelected:n}=(0,g.useSelect)(To),{setNavigationMode:o,selectBlock:r}=(0,g.useDispatch)(To);return(0,m.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 ed(){const e=(0,u.useContext)(Uv);return(0,m.useRefEffect)((t=>{if(e)return e.observe(t),()=>{e.unobserve(t)}}),[e])}function td(e){return(0,g.useSelect)((t=>{const{__unstableHasActiveBlockOverlayActive:n}=t(To);return n(e)}),[e])}function nd(){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:r={},isAligned:l}=(0,u.useContext)(od),{index:i,mode:s,name:c,blockApiVersion:d,blockTitle:f,isPartOfSelection:h,adjustScrolling:v,enableAnimation:b}=(0,g.useSelect)((e=>{const{getBlockAttributes:t,getBlockIndex:o,getBlockMode:r,getBlockName:l,isTyping:i,getGlobalBlockCount:s,isBlockSelected:c,isBlockMultiSelected:u,isAncestorMultiSelected:d,isFirstMultiSelectedBlock:p}=e(To),{getActiveBlockVariation:m}=e(a.store),g=c(n),f=u(n)||d(n),h=l(n),v=(0,a.getBlockType)(h),b=m(h,t(n));return{index:o(n),mode:r(n),name:h,blockApiVersion:(null==v?void 0:v.apiVersion)||1,blockTitle:(null==b?void 0:b.title)||(null==v?void 0:v.title),isPartOfSelection:g||f,adjustScrolling:g||p(n),enableAnimation:!i()&&s()<=200}}),[n]),k=td(n),y=(0,_.sprintf)((0,_.__)("Block: %s"),f),E="html"!==s||t?"":"-visual",C=(0,m.useMergeRefs)([e.ref,Uu(n),Jo(n),Zu(n),Xu(n),Ju(n),ju(),ed(),Du({isSelected:h,adjustScrolling:v,enableAnimation:b,triggerAnimationOnChange:i}),(0,m.useDisabled)({isDisabled:!k})]),S=Ro();return d<2&&n===S.clientId&&"undefined"!=typeof process&&process.env,{tabIndex:0,...r,...e,ref:C,id:`block-${n}${E}`,role:"document","aria-label":y,"data-block":n,"data-type":c,"data-title":f,className:p()(p()("block-editor-block-list__block",{"wp-block":!l,"has-block-overlay":k}),o,e.className,r.className,Wu(n),Ku(n),qu(n),Yu(n)),style:{...r.style,...e.style}}}nd.save=a.__unstableGetBlockProps;const od=(0,u.createContext)();function rd(e){let{children:t,isHtml:n,...o}=e;return(0,u.createElement)("div",nd(o,{__unstableIsHtml:n}),t)}const ld=(0,g.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(To),d=s(n),p=r(n),m=a(o),g=c(n,o),f=u(n,o),{name:h,attributes:v,isValid:b}=d||{};return{mode:l(n),isSelectionEnabled:i(),isLocked:!!m,canRemove:g,canMove:f,block:d,name:h,attributes:v,isValid:b,isSelected:p}})),id=(0,g.withDispatch)(((e,t,n)=>{const{updateBlockAttributes:o,insertBlocks:r,mergeBlocks:l,replaceBlocks:i,toggleSelection:s,__unstableMarkLastChangeAsPersistent:c,moveBlocksToPosition:u,removeBlock:d}=e(To);return{setAttributes(e){const{getMultiSelectedBlockClientIds:r}=n.select(To),l=r(),{clientId:i}=t,a=l.length?l:[i];o(a,e)},onInsertBlocks(e,n){const{rootClientId:o}=t;r(e,n,o)},onInsertBlocksAfter(e){const{clientId:o,rootClientId:l}=t,{getBlockIndex:i}=n.select(To),a=i(o);r(e,a+1,l)},onMerge(e){const{clientId:o,rootClientId:i}=t,{getPreviousBlockClientId:s,getNextBlockClientId:c,getBlock:p,getBlockAttributes:m,getBlockName:g,getBlockOrder:f,getBlockIndex:h,getBlockRootClientId:v,canInsertBlockType:b}=n.select(To);function k(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const o=v(e),l=f(e),[i]=l;if(1===l.length&&(0,a.isUnmodifiedBlock)(p(i)))d(e);else{if(b(g(i),o))u([i],e,o,h(e));else{const l=(0,a.switchToBlockType)(p(i),(0,a.getDefaultBlockName)());l&&l.length&&n.batch((()=>{r(l,h(e),o,t),d(i,!1)}))}!f(e).length&&(0,a.isUnmodifiedBlock)(p(e))&&d(e,!1)}}if(e){if(i){const e=c(i);if(e){if(g(i)!==g(e))return void l(i,e);{const t=m(i),o=m(e);if(Object.keys(t).every((e=>t[e]===o[e])))return void n.batch((()=>{u(f(e),e,i),d(e,!1)}))}}}const e=c(o);if(!e)return;f(e).length?k(e,!1):l(o,e)}else{const e=s(o);if(e)l(e,o);else if(i){const e=s(i);if(e&&g(i)===g(e)){const t=m(i),o=m(e);if(Object.keys(t).every((e=>t[e]===o[e])))return void n.batch((()=>{u(f(i),i,e),d(i,!1)}))}k(i)}}},onReplace(e,n,o){e.length&&!(0,a.isUnmodifiedDefaultBlock)(e[e.length-1])&&c(),i([t.clientId],e,n,o)},toggleSelection(e){s(e)}}}));var ad=(0,m.compose)(m.pure,ld,id,(0,m.ifCondition)((e=>{let{block:t}=e;return!!t})),(0,h.withFilters)("editor.BlockListBlock"))((function(e){var t;let{block:{__unstableBlockSource:n},mode:o,isLocked:r,canRemove:l,clientId:i,isSelected:s,isSelectionEnabled:c,className:d,__unstableLayoutClassNames:m,name:f,isValid:h,attributes:v,wrapperProps:b,setAttributes:k,onReplace:_,onInsertBlocksAfter:y,onMerge:E,toggleSelection:C}=e;const{themeSupportsLayout:S,hasContentLockedParent:w,isContentBlock:B,isContentLocking:I,isTemporarilyEditingAsBlocks:x}=(0,g.useSelect)((e=>{const{getSettings:t,__unstableGetContentLockingParent:n,getTemplateLock:o,__unstableGetTemporarilyEditingAsBlocks:r}=e(To),l=!!n(i);return{themeSupportsLayout:t().supportsLayout,isContentBlock:e(a.store).__experimentalHasContentRoleAttribute(f),hasContentLockedParent:l,isContentLocking:"contentOnly"===o(i)&&!l,isTemporarilyEditingAsBlocks:r()===i}}),[f,i]),{removeBlock:T}=(0,g.useDispatch)(To),M=(0,u.useCallback)((()=>T(i)),[i]),N=ci()||{};let P=(0,u.createElement)(Vi,{name:f,isSelected:s,attributes:v,setAttributes:k,insertBlocksAfter:r?void 0:y,onReplace:l?_:void 0,onRemove:l?M:void 0,mergeBlocks:l?E:void 0,clientId:i,isSelectionEnabled:c,toggleSelection:C,__unstableLayoutClassNames:m,__unstableParentLayout:Object.keys(N).length?N:void 0});const L=(0,a.getBlockType)(f);w&&!B&&(b={...b,tabIndex:-1}),null!=L&&L.getEditWrapperProps&&(b=function(e,t){const n={...e,...t};return null!=e&&e.className&&null!=t&&t.className&&(n.className=p()(e.className,t.className)),null!=e&&e.style&&null!=t&&t.style&&(n.style={...e.style,...t.style}),n}(b,L.getEditWrapperProps(v)));const R=b&&!!b["data-align"]&&!S;let A;if(R&&(P=(0,u.createElement)("div",{className:"wp-block","data-align":b["data-align"]},P)),h)A="html"===o?(0,u.createElement)(u.Fragment,null,(0,u.createElement)("div",{style:{display:"none"}},P),(0,u.createElement)(rd,{isHtml:!0},(0,u.createElement)(Ji,{clientId:i}))):(null==L?void 0:L.apiVersion)>1?P:(0,u.createElement)(rd,b,P);else{const e=n?(0,a.serializeRawBlock)(n):(0,a.getSaveContent)(L,v);A=(0,u.createElement)(rd,{className:"has-warning"},(0,u.createElement)(Ki,{clientId:i}),(0,u.createElement)(u.RawHTML,null,(0,Ri.safeHTML)(e)))}const{"data-align":O,...D}=null!==(t=b)&&void 0!==t?t:{},z={clientId:i,className:p()({"is-content-locked":I,"is-content-locked-temporarily-editing-as-blocks":x,"is-content-block":w&&B},O&&S&&`align${O}`,d),wrapperProps:D,isAligned:R},F=(0,u.useMemo)((()=>z),Object.values(z));return(0,u.createElement)(od.Provider,{value:F},(0,u.createElement)(Qi,{fallback:(0,u.createElement)(rd,{className:"has-warning"},(0,u.createElement)(Yi,null))},A))})),sd=window.wp.htmlEntities;var cd=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"M18 11.2h-5.2V6h-1.6v5.2H6v1.6h5.2V18h1.6v-5.2H18z"}));const ud=[(0,u.createInterpolateElement)((0,_.__)("While writing, you can press / to quickly insert new blocks."),{kbd:(0,u.createElement)("kbd",null)}),(0,u.createInterpolateElement)((0,_.__)("Indent a list by pressing space at the beginning of a line."),{kbd:(0,u.createElement)("kbd",null)}),(0,u.createInterpolateElement)((0,_.__)("Outdent a list by pressing backspace at the beginning of a line."),{kbd:(0,u.createElement)("kbd",null)}),(0,_.__)("Drag files into the editor to automatically insert media blocks."),(0,_.__)("Change a block's type by pressing the block icon on the toolbar.")];var dd=function(){const[e]=(0,u.useState)(Math.floor(Math.random()*ud.length));return(0,u.createElement)(h.Tip,null,ud[e])};var pd=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"M10.6 6L9.4 7l4.6 5-4.6 5 1.2 1 5.4-6z"}));var md=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"M14.6 7l-1.2-1L8 12l5.4 6 1.2-1-4.6-5z"}));var gd=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.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 fd=(0,u.memo)((function(e){var t;let{icon:n,showColors:o=!1,className:r,context:l}=e;"block-default"===(null===(t=n)||void 0===t?void 0:t.src)&&(n={src:gd});const i=(0,u.createElement)(h.Icon,{icon:n&&n.src?n.src:n,context:l}),a=o?{backgroundColor:n&&n.background,color:n&&n.foreground}:{};return(0,u.createElement)("span",{style:a,className:p()("block-editor-block-icon",r,{"has-colors":o})},i)}));var hd=function(e){let{title:t,icon:n,description:o,blockType:r,className:l}=e;r&&(W()("`blockType` property in `BlockCard component`",{since:"5.7",alternative:"`title, icon and description` properties"}),({title:t,icon:n,description:o}=r));const{parentNavBlockClientId:i}=(0,g.useSelect)((e=>{const{getSelectedBlockClientId:t,getBlockParentsByBlockName:n}=e(To);return{parentNavBlockClientId:n(t(),"core/navigation",!0)[0]}}),[]),{selectBlock:a}=(0,g.useDispatch)(To);return(0,u.createElement)("div",{className:p()("block-editor-block-card",l)},i&&(0,u.createElement)(h.Button,{onClick:()=>a(i),label:(0,_.__)("Go to parent Navigation block"),style:{minWidth:24,padding:0},icon:(0,_.isRTL)()?pd:md,isSmall:!0}),(0,u.createElement)(fd,{icon:n,showColors:!0}),(0,u.createElement)("div",{className:"block-editor-block-card__content"},(0,u.createElement)("h2",{className:"block-editor-block-card__title"},t),(0,u.createElement)("span",{className:"block-editor-block-card__description"},o)))};const vd=(0,m.createHigherOrderComponent)((e=>(0,g.withRegistry)((t=>{let{useSubRegistry:n=!0,registry:o,...r}=t;if(!n)return(0,u.createElement)(e,c({registry:o},r));const[l,i]=(0,u.useState)(null);return(0,u.useEffect)((()=>{const e=(0,g.createRegistry)({},o);e.registerStore(So,xo),i(e)}),[o]),l?(0,u.createElement)(g.RegistryProvider,{value:l},(0,u.createElement)(e,c({registry:l},r))):null}))),"withRegistryProvider");const bd=()=>{};function kd(e){let{clientId:t=null,value:n,selection:o,onChange:r=bd,onInput:l=bd}=e;const i=(0,g.useRegistry)(),{resetBlocks:s,resetSelection:c,replaceInnerBlocks:d,setHasControlledInnerBlocks:p,__unstableMarkNextChangeAsNotPersistent:m}=i.dispatch(To),{getBlockName:f,getBlocks:h}=i.select(To),v=(0,g.useSelect)((e=>!t||e(To).areInnerBlocksControlled(t)),[t]),b=(0,u.useRef)({incoming:null,outgoing:[]}),k=(0,u.useRef)(!1),_=()=>{n&&(m(),t?i.batch((()=>{p(t,!0);const e=n.map((e=>(0,a.cloneBlock)(e)));k.current&&(b.current.incoming=e),m(),d(t,e)})):(k.current&&(b.current.incoming=n),s(n)))},y=(0,u.useRef)(l),E=(0,u.useRef)(r);(0,u.useEffect)((()=>{y.current=l,E.current=r}),[l,r]),(0,u.useEffect)((()=>{b.current.outgoing.includes(n)?b.current.outgoing[b.current.outgoing.length-1]===n&&(b.current.outgoing=[]):h(t)!==n&&(b.current.outgoing=[],_(),o&&c(o.selectionStart,o.selectionEnd,o.initialPosition))}),[n,t]),(0,u.useEffect)((()=>{v||(b.current.outgoing=[],_())}),[v]),(0,u.useEffect)((()=>{const{getSelectionStart:e,getSelectionEnd:n,getSelectedBlocksInitialCaretPosition:o,isLastBlockChangePersistent:r,__unstableIsLastBlockChangeIgnored:l,areInnerBlocksControlled:a}=i.select(To);let s=h(t),c=r(),u=!1;k.current=!0;const d=i.subscribe((()=>{if(null!==t&&null===f(t))return;if(!(!t||a(t)))return;const i=r(),d=h(t),p=d!==s;if(s=d,p&&(b.current.incoming||l()))return b.current.incoming=null,void(c=i);if(p||u&&!p&&i&&!c){c=i,b.current.outgoing.push(s);(c?E.current:y.current)(s,{selection:{selectionStart:e(),selectionEnd:n(),initialPosition:o()}})}u=p}));return()=>{k.current=!1,d()}}),[i,t])}const _d=vd((e=>{const{children:t,settings:n,stripExperimentalSettings:o=!1}=e,{__experimentalUpdateSettings:r}=Io((0,g.useDispatch)(To));return(0,u.useEffect)((()=>{r({...n,__internalIsInitialized:!0},o)}),[n]),kd(e),(0,u.createElement)(Xo,null,t)}));var yd=e=>(0,u.createElement)(_d,c({},e,{stripExperimentalSettings:!0}),e.children);function Ed(){const{getSettings:e,hasSelectedBlock:t,hasMultiSelection:n}=(0,g.useSelect)(To),{clearSelectedBlock:o}=(0,g.useDispatch)(To),{clearBlockSelection:r}=e();return(0,m.useRefEffect)((e=>{if(r)return e.addEventListener("mousedown",l),()=>{e.removeEventListener("mousedown",l)};function l(r){(t()||n())&&r.target===e&&o()}}),[t,n,o,r])}function Cd(e){return(0,u.createElement)("div",c({ref:Ed()},e))}function Sd(e){const{isMultiSelecting:t,getMultiSelectedBlockClientIds:n,hasMultiSelection:o,getSelectedBlockClientId:r,getSelectedBlocksInitialCaretPosition:l,__unstableIsFullySelected:i}=e(To);return{isMultiSelecting:t(),multiSelectedBlockClientIds:n(),hasMultiSelection:o(),selectedBlockClientId:r(),initialPosition:l(),isFullSelection:i()}}function wd(){const{initialPosition:e,isMultiSelecting:t,multiSelectedBlockClientIds:n,hasMultiSelection:o,selectedBlockClientId:r,isFullSelection:l}=(0,g.useSelect)(Sd,[]);return(0,m.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 Bd(e,t,n,o){let r,l=Ri.focus.focusable.find(n);return t&&l.reverse(),l=l.slice(l.indexOf(e)+1),o&&(r=e.getBoundingClientRect()),l.find((function(e){if(1!==e.children.length||!function(e,t){return e.closest(zu)===t.closest(zu)}(e,e.firstElementChild)||"true"!==e.firstElementChild.getAttribute("contenteditable")){if(!Ri.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 Id(){const{getMultiSelectedBlocksStartClientId:e,getMultiSelectedBlocksEndClientId:t,getSettings:n,hasMultiSelection:o,__unstableIsFullySelected:r}=(0,g.useSelect)(To),{selectBlock:l}=(0,g.useDispatch)(To);return(0,m.useRefEffect)((i=>{let a;function s(){a=null}function c(s){if(s.defaultPrevented)return;const{keyCode:c,target:u,shiftKey:d,ctrlKey:p,altKey:m,metaKey:g}=s,f=c===Qu.UP,h=c===Qu.DOWN,v=c===Qu.LEFT,b=c===Qu.RIGHT,k=f||v,_=v||b,y=f||h,E=_||y,C=d||p||m||g,S=y?Ri.isVerticalEdge:Ri.isHorizontalEdge,{ownerDocument:w}=i,{defaultView:B}=w;if(!E)return;if(o()){if(d)return;if(!r())return;return s.preventDefault(),void(k?l(e()):l(t(),-1))}if(!function(e,t,n){if((t===Qu.UP||t===Qu.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,C))return;y?a||(a=(0,Ri.computeCaretRect)(B)):a=null;const I=(0,Ri.isRTL)(u)?!k:k,{keepCaretInsideBlock:x}=n();if(d)(function(e,t){const n=Bd(e,t,i);return n&&Gu(n)})(u,k)&&S(u,k)&&(i.contentEditable=!0,i.focus());else if(!y||!(0,Ri.isVerticalEdge)(u,k)||m&&!(0,Ri.isHorizontalEdge)(u,I)||x){if(_&&B.getSelection().isCollapsed&&(0,Ri.isHorizontalEdge)(u,I)&&!x){const e=Bd(u,I,i);(0,Ri.placeCaretAtHorizontalEdge)(e,k),s.preventDefault()}}else{const e=Bd(u,k,i,!0);e&&((0,Ri.placeCaretAtVerticalEdge)(e,m?!k:k,m?void 0:a),s.preventDefault())}}return i.addEventListener("mousedown",s),i.addEventListener("keydown",c),()=>{i.removeEventListener("mousedown",s),i.removeEventListener("keydown",c)}}),[])}var xd=window.wp.keyboardShortcuts;function Td(){const{getBlockOrder:e,getSelectedBlockClientIds:t,getBlockRootClientId:n}=(0,g.useSelect)(To),{multiSelect:o,selectBlock:r}=(0,g.useDispatch)(To),l=(0,xd.__unstableUseShortcutEventMatch)();return(0,m.useRefEffect)((i=>{function a(a){if(!l("core/block-editor/select-all",a))return;const s=t();if(s.length<2&&!(0,Ri.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 Md(e,t){e.contentEditable=t,t&&e.focus()}function Nd(){const{startMultiSelect:e,stopMultiSelect:t}=(0,g.useDispatch)(To),{isSelectionEnabled:n,hasMultiSelection:o,isDraggingBlocks:r}=(0,g.useSelect)(To);return(0,m.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;Md(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),Md(l,!0))}return l.addEventListener("mouseout",d),()=>{l.removeEventListener("mouseout",d),a.removeEventListener("mouseup",u),a.cancelAnimationFrame(c)}}),[e,t,n,o])}function Pd(e,t){e.contentEditable=t,t&&e.focus()}function Ld(){const{multiSelect:e,selectBlock:t,selectionChange:n}=(0,g.useDispatch)(To),{getBlockParents:o,getBlockSelectionStart:r}=(0,g.useSelect)(To);return(0,m.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 Pd(n,!1);let c=Gu(function(e){const{anchorNode:t,anchorOffset:n}=e;return t.nodeType===t.TEXT_NODE||0===n?t:t.childNodes[n-1]}(a)),u=Gu(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=Gu(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 Pd(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 Rd(){const{selectBlock:e}=(0,g.useDispatch)(To),{isSelectionEnabled:t,getBlockSelectionStart:n,hasMultiSelection:o}=(0,g.useSelect)(To);return(0,m.useRefEffect)((r=>{function l(l){if(!t()||0!==l.button)return;const i=n(),a=Gu(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 Ad(){const{__unstableIsFullySelected:e,getSelectedBlockClientIds:t,__unstableIsSelectionMergeable:n,hasMultiSelection:o}=(0,g.useSelect)(To),{replaceBlocks:r,__unstableSplitSelection:l,removeBlocks:i,__unstableDeleteSelection:s,__unstableExpandSelection:c}=(0,g.useDispatch)(To);return(0,m.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===Qu.ENTER?(u.contentEditable=!1,d.preventDefault(),e()?r(t(),(0,a.createBlock)((0,a.getDefaultBlockName)())):l()):d.keyCode===Qu.BACKSPACE||d.keyCode===Qu.DELETE?(u.contentEditable=!1,d.preventDefault(),e()?i(t()):n()?s(d.keyCode===Qu.DELETE):c()):1!==d.key.length||d.metaKey||d.ctrlKey||(u.contentEditable=!1,n()?s(d.keyCode===Qu.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,u.useRef)(),t=(0,u.useRef)(),n=(0,u.useRef)(),o=(0,u.useRef)(),{hasMultiSelection:r,getSelectedBlockClientId:l,getBlockCount:i}=(0,g.useSelect)(To),{setNavigationMode:a}=(0,g.useDispatch)(To),s=(0,g.useSelect)((e=>e(To).isNavigationMode()),[])?void 0:"0",c=(0,u.useRef)();function d(t){if(c.current)c.current=null;else if(r())e.current.focus();else if(l())o.current.focus();else{a(!0);const n=t.target.compareDocumentPosition(e.current)&t.target.DOCUMENT_POSITION_FOLLOWING?"findNext":"findPrevious";Ri.focus.tabbable[n](t.target).focus()}}const p=(0,u.createElement)("div",{ref:t,tabIndex:s,onFocus:d}),f=(0,u.createElement)("div",{ref:n,tabIndex:s,onFocus:d}),h=(0,m.useRefEffect)((s=>{function u(e){if(e.defaultPrevented)return;if(e.keyCode===Qu.ESCAPE)return e.preventDefault(),void a(!0);if(e.keyCode!==Qu.TAB)return;const o=e.shiftKey,i=o?"findPrevious":"findNext";if(!r()&&!l())return void(e.target===s&&a(!0));if(((0,Ri.isFormElement)(e.target)||e.target.getAttribute("data-block")===l())&&(0,Ri.isFormElement)(Ri.focus.tabbable[i](e.target)))return;const u=o?t:n;c.current=!0,u.current.focus({preventScroll:!0})}function d(e){o.current=e.target;const{ownerDocument:t}=s;e.relatedTarget||t.activeElement!==t.body||0!==i()||s.focus()}function p(o){var r;if(o.keyCode!==Qu.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=Ri.focus.tabbable[l](o.target);i!==t.current&&i!==n.current||(o.preventDefault(),i.focus({preventScroll:!0}))}const{ownerDocument:m}=s,{defaultView:g}=m;return g.addEventListener("keydown",p),s.addEventListener("keydown",u),s.addEventListener("focusout",d),()=>{g.removeEventListener("keydown",p),s.removeEventListener("keydown",u),s.removeEventListener("focusout",d)}}),[]);return[p,(0,m.useMergeRefs)([e,h]),f]}(),o=(0,g.useSelect)((e=>e(To).hasMultiSelection()),[]);return[e,(0,m.useMergeRefs)([t,Ad(),Nd(),Ld(),Rd(),wd(),Td(),Id(),(0,m.useRefEffect)((e=>{if(e.tabIndex=0,e.contentEditable=o,o)return e.classList.add("has-multi-selection"),e.setAttribute("aria-label",(0,_.__)("Multiple selected blocks")),()=>{e.classList.remove("has-multi-selection"),e.removeAttribute("aria-label")}}),[o])]),n]}var Dd=(0,u.forwardRef)((function(e,t){let{children:n,...o}=e;const[r,l,i]=Od();return(0,u.createElement)(u.Fragment,null,r,(0,u.createElement)("div",c({},o,{ref:(0,m.useMergeRefs)([l,t]),className:p()(o.className,"block-editor-writing-flow")}),n),i)}));function zd(e){return(0,u.useMemo)((()=>{const t=document.implementation.createHTMLDocument("");return t.body.innerHTML=e,Array.from(t.body.children)}),[e])}function Fd(e){let{contentRef:t,children:n,head:o,tabIndex:r=0,scale:l=1,frameSize:i=0,readonly:a,forwardedRef:s,...d}=e;const f=(0,g.useSelect)((e=>e(To).getSettings().__unstableResolvedAssets),[]),[,v]=(0,u.useReducer)((()=>({}))),[b,k]=(0,u.useState)(),[y,E]=(0,u.useState)([]),C=zd(null==f?void 0:f.styles),S=C.map((e=>e.id)),w=(0,u.useMemo)((()=>Array.from(document.styleSheets).reduce(((e,t)=>{try{t.cssRules}catch(t){return e}const{ownerNode:n,cssRules:o}=t;if(null===n)return e;if(!o)return e;if("LINK"!==n.tagName)return e;if("wp-reset-editor-styles-css"===n.id)return e;if(function e(t){return Array.from(t).find((t=>{let{selectorText:n,conditionText:o,cssRules:r}=t;return o?e(r):n&&(n.includes(".editor-styles-wrapper")||n.includes(".wp-block"))}))}(o)){e.push(n.cloneNode(!0));const t=n.id.replace("-css","-inline-css"),o=document.getElementById(t);o&&e.push(o.cloneNode(!0))}return e}),[])),[]).filter((e=>!S.includes(e.id))),B=zd(null==f?void 0:f.scripts),I=Ed(),[x,T,M]=Od(),[N,{height:P}]=(0,m.useResizeObserver)(),L=(0,m.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),k(o),I(i),E(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)}}),[]),R=(0,m.useRefEffect)((e=>{B.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((()=>{v()}))}),[]),A=(0,m.useDisabled)({isDisabled:!a}),O=(0,m.useMergeRefs)([t,I,T,A]),D=(0,u.createElement)(u.Fragment,null,(0,u.createElement)("style",null,"html{height:auto!important;}body{margin:0}"),[...C,...w].map((e=>{let{tagName:t,href:n,id:o,rel:r,media:l,textContent:i}=e;const a=t.toLowerCase();return"style"===a?(0,u.createElement)(a,{id:o,key:o},i):(0,u.createElement)(a,{href:n,id:o,rel:r,media:l,key:o})}))),z=(0,u.useMemo)((()=>""+(0,u.renderToString)(D)),[]);return(0,u.createElement)(u.Fragment,null,r>=0&&x,(0,u.createElement)(__playground_ControlledIframe,c({},d,{ref:(0,m.useMergeRefs)([s,L]),tabIndex:r,srcDoc:z,title:(0,_.__)("Editor canvas")}),b&&(0,u.createPortal)((0,u.createElement)(u.Fragment,null,(0,u.createElement)("head",{ref:R},D,o,(0,u.createElement)("style",null,`html { transition: background 5s; ${i?"background: #2f2f2f; transition: background 0s;":""} }`)),(0,u.createElement)("body",{ref:O,className:p()("block-editor-iframe__body","editor-styles-wrapper",...y),style:{marginBottom:`-${P*(1-l)-i}px`,marginTop:i,transform:`scale( ${l} )`}},N,(0,u.createElement)(h.__experimentalStyleProvider,{document:b},n))),b.documentElement)),r>=0&&M)}var Vd=(0,u.forwardRef)((function(e,t){return(0,g.useSelect)((e=>e(To).getSettings().__internalIsInitialized),[])?(0,u.createElement)(Fd,c({},e,{forwardedRef:t})):null})),Hd={grad:.9,turn:360,rad:360/(2*Math.PI)},Gd=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},$d=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=1),e>n?n:e>t?e:t},jd=function(e){return(e=isFinite(e)?e%360:0)>0?e:e+360},Wd=function(e){return{r:$d(e.r,0,255),g:$d(e.g,0,255),b:$d(e.b,0,255),a:$d(e.a)}},Kd=function(e){return{r:Ud(e.r),g:Ud(e.g),b:Ud(e.b),a:Ud(e.a,3)}},qd=/^#([0-9a-f]{3,8})$/i,Yd=function(e){var t=e.toString(16);return t.length<2?"0"+t:t},Zd=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}},Qd=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}},Xd=function(e){return{h:jd(e.h),s:$d(e.s,0,100),l:$d(e.l,0,100),a:$d(e.a)}},Jd=function(e){return{h:Ud(e.h),s:Ud(e.s),l:Ud(e.l),a:Ud(e.a,3)}},ep=function(e){return Qd((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},tp=function(e){return{h:(t=Zd(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},np=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,op=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,rp=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,lp=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,ip={string:[[function(e){var t=qd.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=rp.exec(e)||lp.exec(e);return t?t[2]!==t[4]||t[4]!==t[6]?null:Wd({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=np.exec(e)||op.exec(e);if(!t)return null;var n,o,r=Xd({h:(n=t[1],o=t[2],void 0===o&&(o="deg"),Number(n)*(Hd[o]||1)),s:Number(t[3]),l:Number(t[4]),a:void 0===t[5]?1:Number(t[5])/(t[6]?100:1)});return ep(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 Gd(t)&&Gd(n)&&Gd(o)?Wd({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(!Gd(t)||!Gd(n)||!Gd(o))return null;var i=Xd({h:Number(t),s:Number(n),l:Number(o),a:Number(l)});return ep(i)},"hsl"],[function(e){var t=e.h,n=e.s,o=e.v,r=e.a,l=void 0===r?1:r;if(!Gd(t)||!Gd(n)||!Gd(o))return null;var i=function(e){return{h:jd(e.h),s:$d(e.s,0,100),v:$d(e.v,0,100),a:$d(e.a)}}({h:Number(t),s:Number(n),v:Number(o),a:Number(l)});return Qd(i)},"hsv"]]},ap=function(e,t){for(var n=0;n=.5},e.prototype.toHex=function(){return t=(e=Kd(this.rgba)).r,n=e.g,o=e.b,l=(r=e.a)<1?Yd(Ud(255*r)):"","#"+Yd(t)+Yd(n)+Yd(o)+l;var e,t,n,o,r,l},e.prototype.toRgb=function(){return Kd(this.rgba)},e.prototype.toRgbString=function(){return t=(e=Kd(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 Jd(tp(this.rgba))},e.prototype.toHslString=function(){return t=(e=Jd(tp(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=Zd(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 mp({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),mp(cp(this.rgba,e))},e.prototype.desaturate=function(e){return void 0===e&&(e=.1),mp(cp(this.rgba,-e))},e.prototype.grayscale=function(){return mp(cp(this.rgba,-1))},e.prototype.lighten=function(e){return void 0===e&&(e=.1),mp(dp(this.rgba,e))},e.prototype.darken=function(e){return void 0===e&&(e=.1),mp(dp(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?mp({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=tp(this.rgba);return"number"==typeof e?mp({h:e,s:t.s,l:t.l,a:t.a}):Ud(t.h)},e.prototype.isEqual=function(e){return this.toHex()===mp(e).toHex()},e}(),mp=function(e){return e instanceof pp?e:new pp(e)},gp=[],fp=function(e){e.forEach((function(e){gp.indexOf(e)<0&&(e(pp,ip),gp.push(e))}))};function hp(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(s=bp(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 _p=n(3124),yp=n.n(_p);const Ep=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;function Cp(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(),g(n);e.length&&"}"!==e.charAt(0)&&(t=S()||w());)!1!==t&&(n.push(t),g(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 g(e){let t;for(e=e||[];t=f();)!1!==t&&e.push(t);return e}function f(){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 Sp(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=Sp(t[0]),!p(/^:\s*/))return s("property missing ':'");const n=p(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^\)]*?\)|[^};])+)/),o=e({type:"declaration",property:t.replace(Ep,""),value:n?Sp(n[0]).replace(Ep,""):""});return p(/^[;\s]*/),o}function b(){const e=[];if(!c())return s("missing '{'");let t;for(g(e);t=v();)!1!==t&&(e.push(t),g(e));return u()?e:s("missing '}'")}function k(){let e;const t=[],n=l();for(;e=p(/^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/);)t.push(e[1]),p(/^,\s*/);if(t.length)return n({type:"keyframe",values:t,declarations:b()})}const _=C("import"),y=C("charset"),E=C("namespace");function C(e){const t=new RegExp("^@"+e+"\\s*([^;]+);");return function(){const n=l(),o=p(t);if(!o)return;const r={type:e};return r[e]=o[1].trim(),n(r)}}function S(){if("@"===e[0])return function(){const e=l();let t=p(/^@([-\w]+)?keyframes\s*/);if(!t)return;const n=t[1];if(t=p(/^([-\w]+)\s*/),!t)return s("@keyframes missing name");const o=t[1];if(!c())return s("@keyframes missing '{'");let r,i=g();for(;r=k();)i.push(r),i=i.concat(g());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=Sp(t[1]);if(!c())return s("@media missing '{'");const o=g().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:Sp(t[1]),media:Sp(t[2])})}()||function(){const e=l(),t=p(/^@supports *([^{]+)/);if(!t)return;const n=Sp(t[1]);if(!c())return s("@supports missing '{'");const o=g().concat(d());return u()?e({type:"supports",supports:n,rules:o}):s("@supports missing '}'")}()||_()||y()||E()||function(){const e=l(),t=p(/^@([-\w]+)?document *([^{]+)/);if(!t)return;const n=Sp(t[1]),o=Sp(t[2]);if(!c())return s("@document missing '{'");const r=g().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=g();for(;n=v();)o.push(n),o=o.concat(g());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=g().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=g();for(;t=v();)n.push(t),n=n.concat(g());return u()?e({type:"font-face",declarations:n}):s("@font-face missing '}'")}()}function w(){const e=l(),t=h();return t?(g(),e({type:"rule",selectors:t,declarations:b()})):s("selector missing")}return wp(function(){const e=d();return{type:"stylesheet",stylesheet:{source:t.source,rules:e,parsingErrors:a}}}())}function Sp(e){return e?e.replace(/^\s+|\s+$/g,""):""}function wp(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){wp(e,o)})):n&&"object"==typeof n&&wp(n,o)}return n&&Object.defineProperty(e,"parent",{configurable:!0,writable:!0,enumerable:!1,value:t||null}),e}var Bp=n(8575),Ip=n.n(Bp),xp=Tp;function Tp(e){this.options=e||{}}Tp.prototype.emit=function(e){return e},Tp.prototype.visit=function(e){return this[e.type](e)},Tp.prototype.mapVisit=function(e,t){let n="";t=t||"";for(let o=0,r=e.length;ot=>{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]};Ap(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 zp=/^(body|html|:root).*$/;var Fp=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(zp)?n.replace(/^(body|html|:root)/,e):e+" "+n;return"rule"===n.type?{...n,selectors:n.selectors.map(o)}:n}};var Vp=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return Object.values(null!=e?e:[]).map((e=>{let{css:n,baseURL:o}=e;const r=[];return t&&r.push(Fp(t)),o&&r.push(Dp(o)),r.length?Rp(n,(0,m.compose)(r)):n}))};const Hp=".editor-styles-wrapper";function Gp(e){return(0,u.useCallback)((e=>{if(!e)return;const{ownerDocument:t}=e,{defaultView:n,body:o}=t,r=t.querySelector(Hp);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=mp(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,u.useMemo)((()=>Vp(t,Hp)),[t]);return(0,u.createElement)(u.Fragment,null,(0,u.createElement)("style",{ref:Gp(t)}),n.map(((e,t)=>(0,u.createElement)("style",{key:t},e))))}function $p(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t={r:[],g:[],b:[],a:[]};return e.forEach((e=>{const n=mp(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 jp(e){let{selector:t,id:n}=e;const o=`\n${t} {\n\tfilter: url( #${n} );\n}\n`;return(0,u.createElement)("style",null,o)}function Wp(e){let{selector:t}=e;const n=`\n${t} {\n\tfilter: none;\n}\n`;return(0,u.createElement)("style",null,n)}function Kp(e){let{id:t,colors:n}=e;const o=$p(n);return(0,u.createElement)(h.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,u.createElement)("defs",null,(0,u.createElement)("filter",{id:t},(0,u.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,u.createElement)("feComponentTransfer",{colorInterpolationFilters:"sRGB"},(0,u.createElement)("feFuncR",{type:"table",tableValues:o.r.join(" ")}),(0,u.createElement)("feFuncG",{type:"table",tableValues:o.g.join(" ")}),(0,u.createElement)("feFuncB",{type:"table",tableValues:o.b.join(" ")}),(0,u.createElement)("feFuncA",{type:"table",tableValues:o.a.join(" ")})),(0,u.createElement)("feComposite",{in2:"SourceGraphic",operator:"in"}))))}function qp(e){let{preset:t}=e;return(0,u.createElement)(Kp,{id:`wp-duotone-${t.slug}`,colors:t.colors})}let Yp;fp([hp,kp]);const Zp=2e3;function Qp(e){let{viewportWidth:t,containerWidth:n,minHeight:o,additionalStyles:r=[]}=e;t||(t=n);const[l,{height:i}]=(0,m.useResizeObserver)(),{styles:a,duotone:s}=(0,g.useSelect)((e=>{var t,n;const o=e(To).getSettings();return{styles:o.styles,duotone:null===(t=o.__experimentalFeatures)||void 0===t||null===(n=t.color)||void 0===n?void 0:n.duotone}}),[]),c=(0,u.useMemo)((()=>a?[...a,{css:"body{height:auto;overflow:hidden;border:none;padding:0;}",__unstableType:"presets"},...r]:a),[a,r]),d=(0,u.useMemo)((()=>{var e,t;return[...null!==(e=null==s?void 0:s.default)&&void 0!==e?e:[],...null!==(t=null==s?void 0:s.theme)&&void 0!==t?t:[]]}),[s]);Yp=Yp||(0,m.pure)(Wv);const p=n/t;return(0,u.createElement)(h.Disabled,{className:"block-editor-block-preview__content",style:{transform:`scale(${p})`,height:i*p,maxHeight:i>Zp?Zp*p:void 0,minHeight:o}},(0,u.createElement)(Vd,{head:(0,u.createElement)(Up,{styles:c}),contentRef:(0,m.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.boxSizing="border-box",e.style.position="absolute",e.style.width="100%"}),[]),"aria-hidden":!0,tabIndex:-1,style:{position:"absolute",width:t,height:i,pointerEvents:"none",maxHeight:Zp,minHeight:0!==p&&p<1&&o?o/p:o}},l,d.map((e=>(0,u.createElement)(qp,{preset:e,key:e.slug}))),(0,u.createElement)(Yp,{renderAppender:!1})))}function Xp(e){const[t,{width:n}]=(0,m.useResizeObserver)();return(0,u.createElement)(u.Fragment,null,(0,u.createElement)("div",{style:{position:"relative",width:"100%",height:0}},t),(0,u.createElement)("div",{className:"block-editor-block-preview__container"},!!n&&(0,u.createElement)(Qp,c({},e,{containerWidth:n}))))}var Jp=(0,u.memo)((function(e){let{blocks:t,viewportWidth:n=1200,minHeight:o,additionalStyles:r=[],__experimentalMinHeight:l,__experimentalPadding:i}=e;l&&(o=l,W()("The __experimentalMinHeight prop",{since:"6.2",version:"6.4",alternative:"minHeight"})),i&&(r=[...r,{css:`body { padding: ${i}px; }`}],W()("The __experimentalPadding prop of BlockPreview",{since:"6.2",version:"6.4",alternative:"additionalStyles"}));const a=(0,g.useSelect)((e=>e(To).getSettings()),[]),s=(0,u.useMemo)((()=>({...a,__unstableIsPreviewMode:!0})),[a]),c=(0,u.useMemo)((()=>Array.isArray(t)?t:[t]),[t]);return t&&0!==t.length?(0,u.createElement)(_d,{value:c,settings:s},(0,u.createElement)(Xp,{viewportWidth:n,minHeight:o,additionalStyles:r})):null}));function em(e){let{blocks:t,props:n={},__experimentalLayout:o}=e;const r=(0,g.useSelect)((e=>e(To).getSettings()),[]),l=(0,u.useMemo)((()=>({...r,__unstableIsPreviewMode:!0})),[r]),i=(0,m.useDisabled)(),a=(0,m.useMergeRefs)([n.ref,i]),s=(0,u.useMemo)((()=>Array.isArray(t)?t:[t]),[t]),c=(0,u.createElement)(_d,{value:s,settings:l},(0,u.createElement)(qv,{renderAppender:!1,__experimentalLayout:o}));return{...n,ref:a,className:p()(n.className,"block-editor-block-preview__live-content","components-disabled"),children:null!=t&&t.length?c:null}}var tm=function(e){var t;let{item:n}=e;const{name:o,title:r,icon:l,description:i,initialAttributes:s,example:c}=n,d=(0,a.isReusableBlock)(n);return(0,u.createElement)("div",{className:"block-editor-inserter__preview-container"},(0,u.createElement)("div",{className:"block-editor-inserter__preview"},d||c?(0,u.createElement)("div",{className:"block-editor-inserter__preview-content"},(0,u.createElement)(Jp,{blocks:c?(0,a.getBlockFromExample)(o,{attributes:{...c.attributes,...s},innerBlocks:c.innerBlocks}):(0,a.createBlock)(o,s),viewportWidth:null!==(t=null==c?void 0:c.viewportWidth)&&void 0!==t?t:500,additionalStyles:[{css:"body { padding: 16px; }"}]})):(0,u.createElement)("div",{className:"block-editor-inserter__preview-content-missing"},(0,_.__)("No Preview Available."))),!d&&(0,u.createElement)(hd,{title:r,icon:l,description:i}))};var nm=(0,u.createContext)();var om=(0,u.forwardRef)((function(e,t){let{isFirst:n,as:o,children:r,...l}=e;const i=(0,u.useContext)(nm);return(0,u.createElement)(h.__unstableCompositeItem,c({ref:t,state:i,role:"option",focusable:!0},l),(e=>{const t={...e,tabIndex:n?0:e.tabIndex};return o?(0,u.createElement)(o,t,r):"function"==typeof r?r(t):(0,u.createElement)(h.Button,t,r)}))}));var rm=(0,u.createElement)(G.SVG,{width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"M8 7h2V5H8v2zm0 6h2v-2H8v2zm0 6h2v-2H8v2zm6-14v2h2V5h-2zm0 8h2v-2h-2v2zm0 6h2v-2h-2v2z"}));function lm(e){let{count:t,icon:n,isPattern:o}=e;const r=o&&(0,_.__)("Pattern");return(0,u.createElement)("div",{className:"block-editor-block-draggable-chip-wrapper"},(0,u.createElement)("div",{className:"block-editor-block-draggable-chip","data-testid":"block-draggable-chip"},(0,u.createElement)(h.Flex,{justify:"center",className:"block-editor-block-draggable-chip__content"},(0,u.createElement)(h.FlexItem,null,n?(0,u.createElement)(fd,{icon:n}):r||(0,_.sprintf)((0,_._n)("%d block","%d blocks",t),t)),(0,u.createElement)(h.FlexItem,null,(0,u.createElement)(fd,{icon:rm})))))}var im=e=>{let{isEnabled:t,blocks:n,icon:o,children:r,isPattern:l}=e;const i={type:"inserter",blocks:n};return(0,u.createElement)(h.Draggable,{__experimentalTransferDataType:"wp-blocks",transferData:i,__experimentalDragComponent:(0,u.createElement)(lm,{count:n.length,icon:o,isPattern:l})},(e=>{let{onDraggableStart:n,onDraggableEnd:o}=e;return r({draggable:t,onDragStart:t?n:void 0,onDragEnd:t?o:void 0})}))};var am=(0,u.memo)((function(e){let{className:t,isFirst:n,item:o,onSelect:r,onHover:l,isDraggable:i,...s}=e;const d=(0,u.useRef)(!1),m=o.icon?{backgroundColor:o.icon.background,color:o.icon.foreground}:{},g=(0,u.useMemo)((()=>[(0,a.createBlock)(o.name,o.initialAttributes,(0,a.createBlocksFromInnerBlocksTemplate)(o.innerBlocks))]),[o.name,o.initialAttributes,o.initialAttributes]),f=(0,a.isReusableBlock)(o)||(0,a.isTemplatePart)(o);return(0,u.createElement)(im,{isEnabled:i&&!o.disabled,blocks:g,icon:o.icon},(e=>{let{draggable:i,onDragStart:a,onDragEnd:g}=e;return(0,u.createElement)("div",{className:p()("block-editor-block-types-list__list-item",{"is-synced":f}),draggable:i,onDragStart:e=>{d.current=!0,a&&(l(null),a(e))},onDragEnd:e=>{d.current=!1,g&&g(e)}},(0,u.createElement)(om,c({isFirst:n,className:p()("block-editor-block-types-list__item",t),disabled:o.isDisabled,onClick:e=>{e.preventDefault(),r(o,(0,Qu.isAppleOS)()?e.metaKey:e.ctrlKey),l(null)},onKeyDown:e=>{const{keyCode:t}=e;t===Qu.ENTER&&(e.preventDefault(),r(o,(0,Qu.isAppleOS)()?e.metaKey:e.ctrlKey),l(null))},onMouseEnter:()=>{d.current||l(o)},onMouseLeave:()=>l(null)},s),(0,u.createElement)("span",{className:"block-editor-block-types-list__item-icon",style:m},(0,u.createElement)(fd,{icon:o.icon,showColors:!0})),(0,u.createElement)("span",{className:"block-editor-block-types-list__item-title"},(0,u.createElement)(h.__experimentalTruncate,{numberOfLines:3},o.title))))}))}));var sm=(0,u.forwardRef)((function(e,t){const[n,o]=(0,u.useState)(!1);return(0,u.useEffect)((()=>{n&&(0,pn.speak)((0,_.__)("Use left and right arrow keys to move through blocks"))}),[n]),(0,u.createElement)("div",c({ref:t,role:"listbox","aria-orientation":"horizontal",onFocus:()=>{o(!0)},onBlur:e=>{!e.currentTarget.contains(e.relatedTarget)&&o(!1)}},e))}));var cm=(0,u.forwardRef)((function(e,t){const n=(0,u.useContext)(nm);return(0,u.createElement)(h.__unstableCompositeGroup,c({state:n,role:"presentation",ref:t},e))}));var um=function(e){let{items:t=[],onSelect:n,onHover:o=(()=>{}),children:r,label:l,isDraggable:i=!0}=e;return(0,u.createElement)(sm,{className:"block-editor-block-types-list","aria-label":l},function(e,t){const n=[];for(let o=0,r=e.length;o(0,u.createElement)(cm,{key:t},e.map(((e,r)=>(0,u.createElement)(am,{key:e.id,item:e,className:(0,a.getBlockMenuDefaultClassName)(e.id),onSelect:n,onHover:o,isDraggable:i&&!e.isDisabled,isFirst:0===t&&0===r})))))),r)};var dm=function(e){let{title:t,icon:n,children:o}=e;return(0,u.createElement)(u.Fragment,null,(0,u.createElement)("div",{className:"block-editor-inserter__panel-header"},(0,u.createElement)("h2",{className:"block-editor-inserter__panel-title"},t),(0,u.createElement)(h.Icon,{icon:n})),(0,u.createElement)("div",{className:"block-editor-inserter__panel-content"},o))};var pm=(e,t)=>{const{categories:n,collections:o,items:r}=(0,g.useSelect)((t=>{const{getInserterItems:n}=t(To),{getCategories:o,getCollections:r}=t(a.store);return{categories:o(),collections:r(),items:n(e)}}),[e]);return[r,n,o,(0,u.useCallback)(((e,n)=>{let{name:o,initialAttributes:r,innerBlocks:l}=e;const i=(0,a.createBlock)(o,r,(0,a.createBlocksFromInnerBlocksTemplate)(l));t(i,void 0,n)}),[t])]};var mm=function(e){let{children:t}=e;const n=(0,h.__unstableUseCompositeState)({shift:!0,wrap:"horizontal"});return(0,u.createElement)(nm.Provider,{value:n},t)};const gm=[];var fm=function(e){let{rootClientId:t,onInsert:n,onHover:o,showMostUsedBlocks:r}=e;const[l,i,a,s]=pm(t,n),c=(0,u.useMemo)((()=>Y(l,"frecency","desc").slice(0,6)),[l]),d=(0,u.useMemo)((()=>l.filter((e=>!e.category))),[l]),p=(0,u.useMemo)((()=>(0,m.pipe)((e=>e.filter((e=>e.category&&"reusable"!==e.category))),(e=>(0,f.groupBy)(e,"category")))(l)),[l]),g=(0,u.useMemo)((()=>{const e={...a};return Object.keys(a).forEach((t=>{e[t]=l.filter((e=>(e=>e.name.split("/")[0])(e)===t)),0===e[t].length&&delete e[t]})),e}),[l,a]);(0,u.useEffect)((()=>()=>o(null)),[]);const h=(0,m.useAsyncList)(i),v=i.length===h.length,b=(0,u.useMemo)((()=>Object.entries(a)),[a]),k=(0,m.useAsyncList)(v?b:gm);return(0,u.createElement)(mm,null,(0,u.createElement)("div",null,r&&!!c.length&&(0,u.createElement)(dm,{title:(0,_._x)("Most used","blocks")},(0,u.createElement)(um,{items:c,onSelect:s,onHover:o,label:(0,_._x)("Most used","blocks")})),h.map((e=>{const t=p[e.slug];return t&&t.length?(0,u.createElement)(dm,{key:e.slug,title:e.title,icon:e.icon},(0,u.createElement)(um,{items:t,onSelect:s,onHover:o,label:e.title})):null})),v&&d.length>0&&(0,u.createElement)(dm,{className:"block-editor-inserter__uncategorized-blocks-panel",title:(0,_.__)("Uncategorized")},(0,u.createElement)(um,{items:d,onSelect:s,onHover:o,label:(0,_.__)("Uncategorized")})),k.map((e=>{let[t,n]=e;const r=g[t];return r&&r.length?(0,u.createElement)(dm,{key:t,title:n.title,icon:n.icon},(0,u.createElement)(um,{items:r,onSelect:s,onHover:o,label:n.title})):null}))))},hm=window.wp.notices;var vm=(e,t)=>{const{patternCategories:n,patterns:o}=(0,g.useSelect)((e=>{const{__experimentalGetAllowedPatterns:n,getSettings:o}=e(To);return{patterns:n(t),patternCategories:o().__experimentalBlockPatternCategories}}),[t]),{createSuccessNotice:r}=(0,g.useDispatch)(hm.store),l=(0,u.useCallback)(((t,n)=>{e((null!=n?n:[]).map((e=>(0,a.cloneBlock)(e))),t.name),r((0,_.sprintf)((0,_.__)('Block pattern "%s" inserted.'),t.title),{type:"snackbar"})}),[]);return[o,n,l]};const bm=e=>{let{showTooltip:t,title:n,children:o}=e;return t?(0,u.createElement)(h.Tooltip,{text:n},o):(0,u.createElement)(u.Fragment,null,o)};function km(e){let{isDraggable:t,pattern:n,onClick:o,onHover:r,composite:l,showTooltip:i}=e;const[a,s]=(0,u.useState)(!1),{blocks:d,viewportWidth:p}=n,g=`block-editor-block-patterns-list__item-description-${(0,m.useInstanceId)(km)}`;return(0,u.createElement)(im,{isEnabled:t,blocks:d,isPattern:!!n},(e=>{let{draggable:t,onDragStart:m,onDragEnd:f}=e;return(0,u.createElement)("div",{className:"block-editor-block-patterns-list__list-item",draggable:t,onDragStart:e=>{s(!0),m&&(null==r||r(null),m(e))},onDragEnd:e=>{s(!1),f&&f(e)}},(0,u.createElement)(bm,{showTooltip:i,title:n.title},(0,u.createElement)(h.__unstableCompositeItem,c({role:"option",as:"div"},l,{className:"block-editor-block-patterns-list__item",onClick:()=>{o(n,d),null==r||r(null)},onMouseEnter:()=>{a||null==r||r(n)},onMouseLeave:()=>null==r?void 0:r(null),"aria-label":n.title,"aria-describedby":n.description?g:void 0}),(0,u.createElement)(Jp,{blocks:d,viewportWidth:p}),!i&&(0,u.createElement)("div",{className:"block-editor-block-patterns-list__item-title"},n.title),!!n.description&&(0,u.createElement)(h.VisuallyHidden,{id:g},n.description))))}))}function _m(){return(0,u.createElement)("div",{className:"block-editor-block-patterns-list__item is-placeholder"})}var ym=function(e){let{isDraggable:t,blockPatterns:n,shownPatterns:o,onHover:r,onClickPattern:l,orientation:i,label:a=(0,_.__)("Block Patterns"),showTitlesAsTooltip:s}=e;const d=(0,h.__unstableUseCompositeState)({orientation:i});return(0,u.createElement)(h.__unstableComposite,c({},d,{role:"listbox",className:"block-editor-block-patterns-list","aria-label":a}),n.map((e=>o.includes(e)?(0,u.createElement)(km,{key:e.name,pattern:e,onClick:l,onHover:r,isDraggable:t,composite:d,showTooltip:s}):(0,u.createElement)(_m,{key:e.name}))))};function Em(e){let{selectedCategory:t,patternCategories:n,onClickCategory:o}=e;const r="block-editor-block-patterns-explorer__sidebar";return(0,u.createElement)("div",{className:`${r}__categories-list`},n.map((e=>{let{name:n,label:l}=e;return(0,u.createElement)(h.Button,{key:n,label:l,className:`${r}__categories-list__item`,isPressed:t===n,onClick:()=>{o(n)}},l)})))}function Cm(e){let{filterValue:t,setFilterValue:n}=e;return(0,u.createElement)("div",{className:"block-editor-block-patterns-explorer__search"},(0,u.createElement)(h.SearchControl,{__nextHasNoMarginBottom:!0,onChange:n,value:t,label:(0,_.__)("Search for patterns"),placeholder:(0,_.__)("Search")}))}var Sm=function(e){let{selectedCategory:t,patternCategories:n,onClickCategory:o,filterValue:r,setFilterValue:l}=e;return(0,u.createElement)("div",{className:"block-editor-block-patterns-explorer__sidebar"},(0,u.createElement)(Cm,{filterValue:r,setFilterValue:l}),!r&&(0,u.createElement)(Em,{selectedCategory:t,patternCategories:n,onClickCategory:o}))};var wm=function(){return(0,u.createElement)("div",{className:"block-editor-inserter__no-results"},(0,u.createElement)(Jl,{className:"block-editor-inserter__no-results-icon",icon:gd}),(0,u.createElement)("p",null,(0,_.__)("No results found.")))};var Bm=function(e){let{rootClientId:t="",insertionIndex:n,clientId:o,isAppender:r,onSelect:l,shouldFocusBlock:i=!0,selectBlockOnInsert:s=!0}=e;const{getSelectedBlock:c}=(0,g.useSelect)(To),{destinationRootClientId:d,destinationIndex:p}=(0,g.useSelect)((e=>{const{getSelectedBlockClientId:l,getBlockRootClientId:i,getBlockIndex:a,getBlockOrder:s}=e(To),c=l();let u,d=t;return void 0!==n?u=n:o?u=a(o):!r&&c?(d=i(c),u=a(c)+1):u=s(d).length,{destinationRootClientId:d,destinationIndex:u}}),[t,n,o,r]),{replaceBlocks:m,insertBlocks:f,showInsertionPoint:h,hideInsertionPoint:v}=(0,g.useDispatch)(To),b=(0,u.useCallback)((function(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const o=c();!r&&o&&(0,a.isUnmodifiedDefaultBlock)(o)?m(o.clientId,e,null,i||n?0:null,t):f(e,p,d,s,i||n?0:null,t);const u=Array.isArray(e)?e.length:1,g=(0,_.sprintf)((0,_._n)("%d block added.","%d blocks added.",u),u);(0,pn.speak)(g),l&&l(e)}),[r,c,m,f,d,p,l,i]),k=(0,u.useCallback)((e=>{e?h(d,p):v()}),[h,v,d,p]);return[d,b,k]},Im=n(4793),xm=n.n(Im);function Tm(e){return e.toLowerCase()}var Mm=[/([a-z0-9])([A-Z])/g,/([A-Z])([A-Z][a-z])/g],Nm=/[^A-Z0-9]+/gi;function Pm(e,t){void 0===t&&(t={});for(var n=t.splitRegexp,o=void 0===n?Mm:n,r=t.stripRegexp,l=void 0===r?Nm:r,i=t.transform,a=void 0===i?Tm:i,s=t.delimiter,c=void 0===s?" ":s,u=Lm(Lm(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 Lm(e,t,n){return t instanceof RegExp?e.replace(t,n):t.reduce((function(e,t){return e.replace(t,n)}),e)}const Rm=e=>e.name||"",Am=e=>e.title,Om=e=>e.description||"",Dm=e=>e.keywords||[],zm=e=>e.category,Fm=()=>null;function Vm(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return Pm(e,{splitRegexp:[/([\p{Ll}\p{Lo}\p{N}])([\p{Lu}\p{Lt}])/gu,/([\p{Lu}\p{Lt}])([\p{Lu}\p{Lt}][\p{Ll}\p{Lo}])/gu],stripRegexp:/(\p{C}|\p{P}|\p{S})+/giu}).split(" ").filter(Boolean)}function Hm(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return e=xm()(e),e=e.replace(/^\//,""),e=e.toLowerCase(),e}const Gm=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return Vm(Hm(e))},Um=(e,t)=>e.filter((e=>!Gm(t).some((t=>t.includes(e))))),$m=(e,t,n,o)=>{if(0===Gm(o).length)return e;return jm(e,o,{getCategory:e=>{var n;return null===(n=t.find((t=>{let{slug:n}=t;return n===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}})},jm=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=Gm(t);if(0===o.length)return e;const r=e.map((e=>[e,Wm(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 Wm(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{getName:o=Rm,getTitle:r=Am,getDescription:l=Om,getKeywords:i=Dm,getCategory:a=zm,getCollection:s=Fm}=n,c=o(e),u=r(e),d=l(e),p=i(e),m=a(e),g=s(e),f=Hm(t),h=Hm(u);let v=0;if(f===h)v+=30;else if(h.startsWith(f))v+=20;else{const e=[c,u,d,...p,m,g].join(" "),t=Vm(f);0===Um(t,e).length&&(v+=10)}if(0!==v&&c.startsWith("core/")){v+=c!==e.id?1:2}return v}function Km(e){let{filterValue:t,filteredBlockPatternsLength:n}=e;return t?(0,u.createElement)(h.__experimentalHeading,{level:2,lineHeight:"48px",className:"block-editor-block-patterns-explorer__search-results-count"},(0,_.sprintf)((0,_._n)('%1$d pattern found for "%2$s"','%1$d patterns found for "%2$s"',n),n,t)):null}var qm=function(e){let{filterValue:t,selectedCategory:n,patternCategories:o}=e;const r=(0,m.useDebounce)(pn.speak,500),[l,i]=Bm({shouldFocusBlock:!0}),[a,,s]=vm(i,l),c=(0,u.useMemo)((()=>o.map((e=>e.name))),[o]),d=(0,u.useMemo)((()=>t?jm(a,t):a.filter((e=>{var t,o;return"uncategorized"===n?!(null!==(t=e.categories)&&void 0!==t&&t.length)||e.categories.every((e=>!c.includes(e))):null===(o=e.categories)||void 0===o?void 0:o.includes(n)}))),[t,n,a]);(0,u.useEffect)((()=>{if(!t)return;const e=d.length,n=(0,_.sprintf)((0,_._n)("%d result found.","%d results found.",e),e);r(n)}),[t,r]);const p=(0,m.useAsyncList)(d,{step:2}),g=!(null==d||!d.length);return(0,u.createElement)("div",{className:"block-editor-block-patterns-explorer__list"},g&&(0,u.createElement)(Km,{filterValue:t,filteredBlockPatternsLength:d.length}),(0,u.createElement)(mm,null,!g&&(0,u.createElement)(wm,null),g&&(0,u.createElement)(ym,{shownPatterns:p,blockPatterns:d,onClickPattern:s,isDraggable:!1})))};function Ym(e){let{initialCategory:t,patternCategories:n}=e;const[o,r]=(0,u.useState)(""),[l,i]=(0,u.useState)(null==t?void 0:t.name);return(0,u.createElement)("div",{className:"block-editor-block-patterns-explorer"},(0,u.createElement)(Sm,{selectedCategory:l,patternCategories:n,onClickCategory:i,filterValue:o,setFilterValue:r}),(0,u.createElement)(qm,{filterValue:o,selectedCategory:l,patternCategories:n}))}var Zm=function(e){let{onModalClose:t,...n}=e;return(0,u.createElement)(h.Modal,{title:(0,_.__)("Patterns"),onRequestClose:t,isFullScreen:!0},(0,u.createElement)(Ym,n))};function Qm(e){let{title:t}=e;return(0,u.createElement)(h.__experimentalVStack,{spacing:0},(0,u.createElement)(h.__experimentalView,null,(0,u.createElement)(h.__experimentalSpacer,{marginBottom:0,paddingX:4,paddingY:3},(0,u.createElement)(h.__experimentalHStack,{spacing:2},(0,u.createElement)(h.__experimentalNavigatorBackButton,{style:{minWidth:24,padding:0},icon:(0,_.isRTL)()?pd:md,isSmall:!0,"aria-label":(0,_.__)("Navigate to the previous view")}),(0,u.createElement)(h.__experimentalSpacer,null,(0,u.createElement)(h.__experimentalHeading,{level:5},t))))))}function Xm(e){let{categories:t,children:n}=e;return(0,u.createElement)(h.__experimentalNavigatorProvider,{initialPath:"/",className:"block-editor-inserter__mobile-tab-navigation"},(0,u.createElement)(h.__experimentalNavigatorScreen,{path:"/"},(0,u.createElement)(h.__experimentalItemGroup,null,t.map((e=>(0,u.createElement)(h.__experimentalNavigatorButton,{key:e.name,path:`/category/${e.name}`,as:h.__experimentalItem,isAction:!0},(0,u.createElement)(h.__experimentalHStack,null,(0,u.createElement)(h.FlexBlock,null,e.label),(0,u.createElement)(Jl,{icon:(0,_.isRTL)()?md:pd}))))))),t.map((e=>(0,u.createElement)(h.__experimentalNavigatorScreen,{key:e.name,path:`/category/${e.name}`},(0,u.createElement)(Qm,{title:(0,_.__)("Back")}),n(e)))))}const Jm=["featured","posts","text","gallery","call-to-action","banner","header","footer"];function eg(e){const[t,n]=vm(void 0,e),o=(0,u.useCallback)((e=>!(!e.categories||!e.categories.length)&&e.categories.some((e=>n.some((t=>t.name===e))))),[n]),r=(0,u.useMemo)((()=>{const e=n.filter((e=>t.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].some((e=>Jm.includes(e)))?[n,o].every((e=>Jm.includes(e)))?Jm.indexOf(n)-Jm.indexOf(o):Jm.includes(n)?-1:1:0}));return t.some((e=>!o(e)))&&!e.find((e=>"uncategorized"===e.name))&&e.push({name:"uncategorized",label:(0,_._x)("Uncategorized")}),e}),[t,n]);return r}function tg(e){let{rootClientId:t,onInsert:n,onHover:o,category:r,showTitlesAsTooltip:l}=e;const i=(0,u.useRef)();return(0,u.useEffect)((()=>{const e=setTimeout((()=>{const[e]=Ri.focus.tabbable.find(i.current);null==e||e.focus()}));return()=>clearTimeout(e)}),[r]),(0,u.createElement)("div",{ref:i,className:"block-editor-inserter__patterns-category-dialog"},(0,u.createElement)(ng,{rootClientId:t,onInsert:n,onHover:o,category:r,showTitlesAsTooltip:l}))}function ng(e){let{rootClientId:t,onInsert:n,onHover:o,category:r,showTitlesAsTooltip:l}=e;const[i,,a]=vm(n,t),s=eg(t),c=(0,u.useMemo)((()=>i.filter((e=>{var t,n,o;if("uncategorized"!==r.name)return null===(o=e.categories)||void 0===o?void 0:o.includes(r.name);return 0===(null!==(t=null===(n=e.categories)||void 0===n?void 0:n.filter((e=>s.find((t=>t.name===e)))))&&void 0!==t?t:[]).length}))),[i,r]),d=(0,m.useAsyncList)(c);return(0,u.useEffect)((()=>()=>o(null)),[]),c.length?(0,u.createElement)("div",{className:"block-editor-inserter__patterns-category-panel"},(0,u.createElement)("div",{className:"block-editor-inserter__patterns-category-panel-title"},r.label),(0,u.createElement)("p",null,r.description),(0,u.createElement)(ym,{shownPatterns:d,blockPatterns:c,onClickPattern:a,onHover:o,label:r.label,orientation:"vertical",category:r.label,isDraggable:!0,showTitlesAsTooltip:l})):null}var og=function(e){let{onSelectCategory:t,selectedCategory:n,onInsert:o,rootClientId:r}=e;const[l,i]=(0,u.useState)(!1),a=eg(r),s=n||a[0],c=(0,m.useViewportMatch)("medium","<");return(0,u.createElement)(u.Fragment,null,!c&&(0,u.createElement)("div",{className:"block-editor-inserter__block-patterns-tabs-container"},(0,u.createElement)("nav",{"aria-label":(0,_.__)("Block pattern categories")},(0,u.createElement)(h.__experimentalItemGroup,{role:"list",className:"block-editor-inserter__block-patterns-tabs"},a.map((e=>(0,u.createElement)(h.__experimentalItem,{role:"listitem",key:e.name,onClick:()=>t(e),className:e===n?"block-editor-inserter__patterns-category block-editor-inserter__patterns-selected-category":"block-editor-inserter__patterns-category","aria-label":e.label,"aria-current":e===n?"true":void 0},(0,u.createElement)(h.__experimentalHStack,null,(0,u.createElement)(h.FlexBlock,null,e.label),(0,u.createElement)(Jl,{icon:pd}))))),(0,u.createElement)("div",{role:"listitem"},(0,u.createElement)(h.Button,{className:"block-editor-inserter__patterns-explore-button",onClick:()=>i(!0),variant:"secondary"},(0,_.__)("Explore all patterns")))))),c&&(0,u.createElement)(Xm,{categories:a},(e=>(0,u.createElement)(ng,{onInsert:o,rootClientId:r,category:e,showTitlesAsTooltip:!1}))),l&&(0,u.createElement)(Zm,{initialCategory:s,patternCategories:a,onModalClose:()=>i(!1)}))},rg=window.wp.url;function lg(e){let{onHover:t,onInsert:n,rootClientId:o}=e;const[r,,,l]=pm(o,n),i=(0,u.useMemo)((()=>r.filter((e=>{let{category:t}=e;return"reusable"===t}))),[r]);return 0===i.length?(0,u.createElement)(wm,null):(0,u.createElement)(dm,{title:(0,_.__)("Reusable blocks")},(0,u.createElement)(um,{items:i,onSelect:l,onHover:t,label:(0,_.__)("Reusable blocks")}))}var ig=function(e){let{rootClientId:t,onInsert:n,onHover:o}=e;return(0,u.createElement)(u.Fragment,null,(0,u.createElement)(lg,{onHover:o,onInsert:n,rootClientId:t}),(0,u.createElement)("div",{className:"block-editor-inserter__manage-reusable-blocks-container"},(0,u.createElement)(h.Button,{className:"block-editor-inserter__manage-reusable-blocks",variant:"secondary",href:(0,rg.addQueryArgs)("edit.php",{post_type:"wp_block"})},(0,_.__)("Manage Reusable blocks"))))};function ag(e){const[t,n]=(0,u.useState)([]),{canInsertImage:o,canInsertVideo:r,canInsertAudio:l}=(0,g.useSelect)((t=>{const{canInsertBlockType:n}=t(To);return{canInsertImage:n("core/image",e),canInsertVideo:n("core/video",e),canInsertAudio:n("core/audio",e)}}),[e]),i=function(){const{inserterMediaCategories:e,allowedMimeTypes:t,enableOpenverseMediaCategory:n}=(0,g.useSelect)((e=>{const t=e(To).getSettings();return{inserterMediaCategories:t.inserterMediaCategories,allowedMimeTypes:t.allowedMimeTypes,enableOpenverseMediaCategory:t.enableOpenverseMediaCategory}}),[]),o=(0,u.useMemo)((()=>{if(e&&t)return e.filter((e=>!(!n&&"openverse"===e.name)&&Object.values(t).some((t=>t.startsWith(`${e.mediaType}/`)))))}),[e,t,n]);return o}();return(0,u.useEffect)((()=>{(async()=>{const e=[];if(!i)return;const t=new Map(await Promise.all(i.map((async e=>{if(e.isExternalResource)return[e.name,!0];let t=[];try{t=await e.fetch({per_page:1})}catch(e){}return[e.name,!!t.length]})))),a={image:o,video:r,audio:l};i.forEach((n=>{a[n.mediaType]&&t.get(n.name)&&e.push(n)})),e.length&&n(e)})()}),[o,r,l,i]),t}var sg=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"M13 19h-2v-2h2v2zm0-6h-2v-2h2v2zm0-6h-2V5h2v2z"}));var cg=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"M18.2 17c0 .7-.6 1.2-1.2 1.2H7c-.7 0-1.2-.6-1.2-1.2V7c0-.7.6-1.2 1.2-1.2h3.2V4.2H7C5.5 4.2 4.2 5.5 4.2 7v10c0 1.5 1.2 2.8 2.8 2.8h10c1.5 0 2.8-1.2 2.8-2.8v-3.6h-1.5V17zM14.9 3v1.5h3.7l-6.4 6.4 1.1 1.1 6.4-6.4v3.7h1.5V3h-6.3z"})),ug=window.wp.blob;const dg={image:"img",video:"video",audio:"audio"};function pg(e,t){const n={id:e.id||void 0,caption:e.caption||void 0},o=e.url,r=e.alt||void 0;"image"===t?(n.url=o,n.alt=r):["video","audio"].includes(t)&&(n.src=o);const l=dg[t],i=(0,u.createElement)(l,{src:e.previewUrl||o,alt:r,controls:"audio"===t||void 0,inert:"true",onError:t=>{let{currentTarget:n}=t;n.src===e.previewUrl&&(n.src=o)}});return[(0,a.createBlock)(`core/${t}`,n),i]}const mg=["image"],gg={position:"bottom left",className:"block-editor-inserter__media-list__item-preview-options__popover"};function fg(e){let{category:t,media:n}=e;if(!t.getReportUrl)return null;const o=t.getReportUrl(n);return(0,u.createElement)(h.DropdownMenu,{className:"block-editor-inserter__media-list__item-preview-options",label:(0,_.__)("Options"),popoverProps:gg,icon:sg},(()=>(0,u.createElement)(h.MenuGroup,null,(0,u.createElement)(h.MenuItem,{onClick:()=>window.open(o,"_blank").focus(),icon:cg},(0,_.sprintf)((0,_.__)("Report %s"),t.mediaType)))))}function hg(e){let{onClose:t,onSubmit:n}=e;return(0,u.createElement)(h.Modal,{title:(0,_.__)("Insert external image"),onRequestClose:t,className:"block-editor-inserter-media-tab-media-preview-inserter-external-image-modal"},(0,u.createElement)(h.__experimentalVStack,{spacing:3},(0,u.createElement)("p",null,(0,_.__)("This image cannot be uploaded to your Media Library, but it can still be inserted as an external image.")),(0,u.createElement)("p",null,(0,_.__)("External images can be removed by the external provider without warning and could even have legal compliance issues related to privacy legislation."))),(0,u.createElement)(h.Flex,{className:"block-editor-block-lock-modal__actions",justify:"flex-end",expanded:!1},(0,u.createElement)(h.FlexItem,null,(0,u.createElement)(h.Button,{variant:"tertiary",onClick:t},(0,_.__)("Cancel"))),(0,u.createElement)(h.FlexItem,null,(0,u.createElement)(h.Button,{variant:"primary",onClick:n},(0,_.__)("Insert")))))}function vg(e){var t;let{media:n,onClick:o,composite:r,category:l}=e;const[i,s]=(0,u.useState)(!1),[d,m]=(0,u.useState)(!1),[f,v]=(0,u.useState)(!1),[b,k]=(0,u.useMemo)((()=>pg(n,l.mediaType)),[n,l.mediaType]),{createErrorNotice:y,createSuccessNotice:E}=(0,g.useDispatch)(hm.store),C=(0,g.useSelect)((e=>e(To).getSettings().mediaUpload),[]),S=(0,u.useCallback)((e=>{if(f)return;const t=(0,a.cloneBlock)(e),{id:n,url:r,caption:l}=t.attributes;n?o(t):(v(!0),window.fetch(r).then((e=>e.blob())).then((e=>{C({filesList:[e],additionalData:{caption:l},onFileChange(e){let[n]=e;(0,ug.isBlobURL)(n.url)||(o({...t,attributes:{...t.attributes,id:n.id,url:n.url}}),E((0,_.__)("Image uploaded and inserted."),{type:"snackbar"}),v(!1))},allowedTypes:mg,onError(e){y(e,{type:"snackbar"}),v(!1)}})})).catch((()=>{s(!0),v(!1)})))}),[f,o,C,y,E]),w=(null===(t=n.title)||void 0===t?void 0:t.rendered)||n.title;let B;if(w.length>25){const e="...";B=w.slice(0,25-e.length)+e}const I=(0,u.useCallback)((()=>m(!0)),[]),x=(0,u.useCallback)((()=>m(!1)),[]);return(0,u.createElement)(u.Fragment,null,(0,u.createElement)(im,{isEnabled:!0,blocks:[b]},(e=>{let{draggable:t,onDragStart:o,onDragEnd:i}=e;return(0,u.createElement)("div",{className:p()("block-editor-inserter__media-list__list-item",{"is-hovered":d}),draggable:t,onDragStart:o,onDragEnd:i},(0,u.createElement)(h.Tooltip,{text:B||w},(0,u.createElement)("div",{onMouseEnter:I,onMouseLeave:x},(0,u.createElement)(h.__unstableCompositeItem,c({role:"option",as:"div"},r,{className:"block-editor-inserter__media-list__item",onClick:()=>S(b),"aria-label":w}),(0,u.createElement)("div",{className:"block-editor-inserter__media-list__item-preview"},k,f&&(0,u.createElement)("div",{className:"block-editor-inserter__media-list__item-preview-spinner"},(0,u.createElement)(h.Spinner,null)))),!f&&(0,u.createElement)(fg,{category:l,media:n}))))})),i&&(0,u.createElement)(hg,{onClose:()=>s(!1),onSubmit:()=>{o((0,a.cloneBlock)(b)),E((0,_.__)("Image inserted."),{type:"snackbar"}),s(!1)}}))}var bg=function(e){let{mediaList:t,category:n,onClick:o,label:r=(0,_.__)("Media List")}=e;const l=(0,h.__unstableUseCompositeState)();return(0,u.createElement)(h.__unstableComposite,c({},l,{role:"listbox",className:"block-editor-inserter__media-list","aria-label":r}),t.map(((e,t)=>(0,u.createElement)(vg,{key:e.id||e.sourceId||t,media:e,category:n,onClick:o,composite:l}))))};function kg(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";const[t,n]=(0,u.useState)(e),[o,r]=(0,u.useState)(e),l=(0,m.useDebounce)(r,250);return(0,u.useEffect)((()=>{o!==t&&l(t)}),[o,t]),[t,n,o]}function _g(e){let{rootClientId:t,onInsert:n,category:o}=e;const r=(0,u.useRef)();return(0,u.useEffect)((()=>{const e=setTimeout((()=>{const[e]=Ri.focus.tabbable.find(r.current);null==e||e.focus()}));return()=>clearTimeout(e)}),[o]),(0,u.createElement)("div",{ref:r,className:"block-editor-inserter__media-dialog"},(0,u.createElement)(yg,{rootClientId:t,onInsert:n,category:o}))}function yg(e){let{rootClientId:t,onInsert:n,category:o}=e;const[r,l,i]=kg(),{mediaList:a,isLoading:s}=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const[n,o]=(0,u.useState)(),[r,l]=(0,u.useState)(!1),i=(0,u.useRef)();return(0,u.useEffect)((()=>{(async()=>{var n;const r=JSON.stringify({category:e.name,...t});i.current=r,l(!0),o([]);const a=await(null===(n=e.fetch)||void 0===n?void 0:n.call(e,t));r===i.current&&(o(a),l(!1))})()}),[e.name,...Object.values(t)]),{mediaList:n,isLoading:r}}(o,{per_page:i?20:10,search:i}),c="block-editor-inserter__media-panel",d=o.labels.search_items||(0,_.__)("Search");return(0,u.createElement)("div",{className:c},(0,u.createElement)(h.SearchControl,{className:`${c}-search`,onChange:l,value:r,label:d,placeholder:d}),s&&(0,u.createElement)("div",{className:`${c}-spinner`},(0,u.createElement)(h.Spinner,null)),!s&&!(null!=a&&a.length)&&(0,u.createElement)(wm,null),!s&&!(null==a||!a.length)&&(0,u.createElement)(bg,{rootClientId:t,onClick:n,mediaList:a,category:o}))}var Eg=function(e){let{fallback:t=null,children:n}=e;const o=(0,g.useSelect)((e=>{const{getSettings:t}=e(To);return!!t().mediaUpload}),[]);return o?n:t};var Cg=(0,h.withFilters)("editor.MediaUpload")((()=>null));const Sg=["image","video","audio"];var wg=function(e){let{rootClientId:t,selectedCategory:n,onSelectCategory:o,onInsert:r}=e;const l=ag(t),i=(0,m.useViewportMatch)("medium","<"),a="block-editor-inserter__media-tabs",s=(0,u.useCallback)((e=>{if(null==e||!e.url)return;const[t]=pg(e,e.type);r(t)}),[r]),c=(0,u.useMemo)((()=>l.map((e=>({...e,label:e.labels.name})))),[l]);return(0,u.createElement)(u.Fragment,null,!i&&(0,u.createElement)("div",{className:`${a}-container`},(0,u.createElement)("nav",{"aria-label":(0,_.__)("Media categories")},(0,u.createElement)(h.__experimentalItemGroup,{role:"list",className:a},l.map((e=>(0,u.createElement)(h.__experimentalItem,{role:"listitem",key:e.name,onClick:()=>o(e),className:p()(`${a}__media-category`,{"is-selected":n===e}),"aria-label":e.labels.name,"aria-current":e===n?"true":void 0},(0,u.createElement)(h.__experimentalHStack,null,(0,u.createElement)(h.FlexBlock,null,e.labels.name),(0,u.createElement)(Jl,{icon:pd}))))),(0,u.createElement)("div",{role:"listitem"},(0,u.createElement)(Eg,null,(0,u.createElement)(Cg,{multiple:!1,onSelect:s,allowedTypes:Sg,render:e=>{let{open:t}=e;return(0,u.createElement)(h.Button,{onClick:e=>{e.target.focus(),t()},className:"block-editor-inserter__media-library-button",variant:"secondary","data-unstable-ignore-focus-outside-for-relatedtarget":".media-modal"},(0,_.__)("Open Media Library"))}})))))),i&&(0,u.createElement)(Xm,{categories:c},(e=>(0,u.createElement)(yg,{onInsert:r,rootClientId:t,category:e}))))};const{Fill:Bg,Slot:Ig}=(0,h.createSlotFill)("__unstableInserterMenuExtension");Bg.Slot=Ig;var xg=Bg;const Tg=[];var Mg=function(e){let{filterValue:t,onSelect:n,onHover:o,rootClientId:r,clientId:l,isAppender:i,__experimentalInsertionIndex:a,maxBlockPatterns:s,maxBlockTypes:c,showBlockDirectory:d=!1,isDraggable:p=!0,shouldFocusBlock:g=!0,prioritizePatterns:f,selectBlockOnInsert:v,orderInitialBlockItems:b}=e;const k=(0,m.useDebounce)(pn.speak,500),[y,E]=Bm({onSelect:n,rootClientId:r,clientId:l,isAppender:i,insertionIndex:a,shouldFocusBlock:g,selectBlockOnInsert:v}),[C,S,w,B]=pm(y,E),[I,,x]=vm(E,y),T=(0,u.useMemo)((()=>{if(0===s)return[];const e=jm(I,t);return void 0!==s?e.slice(0,s):e}),[t,I,s]);let M=c;f&&T.length>2&&(M=0);const N=(0,u.useMemo)((()=>{if(0===M)return[];let e=Y(C,"frecency","desc");!t&&b&&(e=b(e));const n=$m(e,S,w,t);return void 0!==M?n.slice(0,M):n}),[t,C,S,w,c,b]);(0,u.useEffect)((()=>{if(!t)return;const e=N.length+T.length,n=(0,_.sprintf)((0,_._n)("%d result found.","%d results found.",e),e);k(n)}),[t,k]);const P=(0,m.useAsyncList)(N,{step:9}),L=(0,m.useAsyncList)(P.length===N.length?T:Tg),R=N.length>0||T.length>0,A=!!N.length&&(0,u.createElement)(dm,{title:(0,u.createElement)(h.VisuallyHidden,null,(0,_.__)("Blocks"))},(0,u.createElement)(um,{items:P,onSelect:B,onHover:o,label:(0,_.__)("Blocks"),isDraggable:p})),O=!!T.length&&(0,u.createElement)(dm,{title:(0,u.createElement)(h.VisuallyHidden,null,(0,_.__)("Block Patterns"))},(0,u.createElement)("div",{className:"block-editor-inserter__quick-inserter-patterns"},(0,u.createElement)(ym,{shownPatterns:L,blockPatterns:T,onClickPattern:x,onHover:o,isDraggable:p})));return(0,u.createElement)(mm,null,!d&&!R&&(0,u.createElement)(wm,null),f?O:A,!!N.length&&!!T.length&&(0,u.createElement)("div",{className:"block-editor-inserter__quick-inserter-separator"}),f?A:O,d&&(0,u.createElement)(xg.Slot,{fillProps:{onSelect:B,onHover:o,filterValue:t,hasItems:R,rootClientId:y}},(e=>e.length?e:R?null:(0,u.createElement)(wm,null))))};const Ng={name:"blocks",title:(0,_.__)("Blocks")},Pg={name:"patterns",title:(0,_.__)("Patterns")},Lg={name:"reusable",title:(0,_.__)("Reusable"),icon:U},Rg={name:"media",title:(0,_.__)("Media")};var Ag=function(e){let{children:t,showPatterns:n=!1,showReusableBlocks:o=!1,showMedia:r=!1,onSelect:l,prioritizePatterns:i}=e;const a=(0,u.useMemo)((()=>{const e=[];return i&&n&&e.push(Pg),e.push(Ng),!i&&n&&e.push(Pg),r&&e.push(Rg),o&&e.push(Lg),e}),[i,Ng,n,Pg,o,r,Lg]);return(0,u.createElement)(h.TabPanel,{className:"block-editor-inserter__tabs",tabs:a,onSelect:l},t)};var Og=(0,u.forwardRef)((function(e,t){let{rootClientId:n,clientId:o,isAppender:r,__experimentalInsertionIndex:l,onSelect:i,showInserterHelpPanel:a,showMostUsedBlocks:s,__experimentalFilterValue:c="",shouldFocusBlock:d=!0,prioritizePatterns:m}=e;const[f,v,b]=kg(c),[k,y]=(0,u.useState)(null),[E,C]=(0,u.useState)(null),[S,w]=(0,u.useState)(null),[B,I]=(0,u.useState)(null),[x,T,M]=Bm({rootClientId:n,clientId:o,isAppender:r,insertionIndex:l,shouldFocusBlock:d}),{showPatterns:N,inserterItems:P}=(0,g.useSelect)((e=>{const{__experimentalGetAllowedPatterns:t,getInserterItems:n}=e(To);return{showPatterns:!!t(x).length,inserterItems:n(x)}}),[x]),L=(0,u.useMemo)((()=>P.some((e=>{let{category:t}=e;return"reusable"===t}))),[P]),R=!!ag(x).length,A=(0,u.useCallback)(((e,t,n)=>{T(e,t,n),i()}),[T,i]),O=(0,u.useCallback)(((e,t)=>{T(e,{patternName:t}),i()}),[T,i]),D=(0,u.useCallback)((e=>{M(!!e),y(e)}),[M,y]),z=(0,u.useCallback)((e=>{M(!!e)}),[M]),F=(0,u.useCallback)((e=>{C(e)}),[C]),V=(0,u.useMemo)((()=>(0,u.createElement)(u.Fragment,null,(0,u.createElement)("div",{className:"block-editor-inserter__block-list"},(0,u.createElement)(fm,{rootClientId:x,onInsert:A,onHover:D,showMostUsedBlocks:s})),a&&(0,u.createElement)("div",{className:"block-editor-inserter__tips"},(0,u.createElement)(h.VisuallyHidden,{as:"h2"},(0,_.__)("A tip for using the block editor")),(0,u.createElement)(dd,null)))),[x,A,D,b,s,a]),H=(0,u.useMemo)((()=>(0,u.createElement)(og,{rootClientId:x,onInsert:O,onSelectCategory:F,selectedCategory:E})),[x,O,F,E]),G=(0,u.useMemo)((()=>(0,u.createElement)(ig,{rootClientId:x,onInsert:A,onHover:D})),[x,A,D]),U=(0,u.useMemo)((()=>(0,u.createElement)(wg,{rootClientId:x,selectedCategory:S,onSelectCategory:w,onInsert:A})),[x,A,S,w]),$=(0,u.useCallback)((e=>"blocks"===e.name?V:"patterns"===e.name?H:"reusable"===e.name?G:"media"===e.name?U:void 0),[V,H,G,U]),j=(0,u.useRef)();(0,u.useImperativeHandle)(t,(()=>({focusSearch:()=>{j.current.focus()}})));const W="patterns"===B&&!b&&E,K=!b&&(N||L||R),q="media"===B&&!b&&S;return(0,u.createElement)("div",{className:"block-editor-inserter__menu"},(0,u.createElement)("div",{className:p()("block-editor-inserter__main-area",{"show-as-tabs":K})},(0,u.createElement)(h.SearchControl,{__nextHasNoMarginBottom:!0,className:"block-editor-inserter__search",onChange:e=>{k&&y(null),v(e)},value:f,label:(0,_.__)("Search for blocks and patterns"),placeholder:(0,_.__)("Search"),ref:j}),!!b&&(0,u.createElement)("div",{className:"block-editor-inserter__no-tab-container"},(0,u.createElement)(Mg,{filterValue:b,onSelect:i,onHover:D,rootClientId:n,clientId:o,isAppender:r,__experimentalInsertionIndex:l,showBlockDirectory:!0,shouldFocusBlock:d})),K&&(0,u.createElement)(Ag,{showPatterns:N,showReusableBlocks:L,showMedia:R,prioritizePatterns:m,onSelect:I},$),!b&&!K&&(0,u.createElement)("div",{className:"block-editor-inserter__no-tab-container"},V)),q&&(0,u.createElement)(_g,{rootClientId:x,onInsert:A,category:S}),a&&k&&(0,u.createElement)(tm,{item:k}),W&&(0,u.createElement)(tg,{rootClientId:x,onInsert:O,onHover:z,category:E,showTitlesAsTooltip:!0}))}));function Dg(e){let{onSelect:t,rootClientId:n,clientId:o,isAppender:r,prioritizePatterns:l,selectBlockOnInsert:i,orderInitialBlockItems:a}=e;const[s,c]=(0,u.useState)(""),[d,m]=Bm({onSelect:t,rootClientId:n,clientId:o,isAppender:r,selectBlockOnInsert:i}),[f]=pm(d,m),[v]=vm(m,d),{setInserterIsOpened:b,insertionIndex:k}=(0,g.useSelect)((e=>{const{getSettings:t,getBlockIndex:n,getBlockCount:r}=e(To),l=t(),i=n(o),a=r();return{setInserterIsOpened:l.__experimentalSetIsInserterOpened,insertionIndex:-1===i?a:i}}),[o]),y=v.length&&(!!s||l),E=y&&v.length>6||f.length>6;(0,u.useEffect)((()=>{b&&b(!1)}),[b]);let C=0;return y&&(C=l?4:2),(0,u.createElement)("div",{className:p()("block-editor-inserter__quick-inserter",{"has-search":E,"has-expand":b})},E&&(0,u.createElement)(h.SearchControl,{__nextHasNoMarginBottom:!0,className:"block-editor-inserter__search",value:s,onChange:e=>{c(e)},label:(0,_.__)("Search for blocks and patterns"),placeholder:(0,_.__)("Search")}),(0,u.createElement)("div",{className:"block-editor-inserter__quick-inserter-results"},(0,u.createElement)(Mg,{filterValue:s,onSelect:t,rootClientId:n,clientId:o,isAppender:r,maxBlockPatterns:C,maxBlockTypes:6,isDraggable:!1,prioritizePatterns:l,selectBlockOnInsert:i,orderInitialBlockItems:a})),b&&(0,u.createElement)(h.Button,{className:"block-editor-inserter__quick-inserter-expand",onClick:()=>{b({rootClientId:n,insertionIndex:k,filterValue:s})},"aria-label":(0,_.__)("Browse all. This will open the main inserter panel in the editor toolbar.")},(0,_.__)("Browse all")))}const zg=e=>{let{onToggle:t,disabled:n,isOpen:o,blockTitle:r,hasSingleBlockType:l,toggleProps:i={},prioritizePatterns:a}=e;const{as:s=h.Button,label:d,onClick:p,...m}=i;let g=d;return!g&&l?g=(0,_.sprintf)((0,_._x)("Add %s","directly add the only allowed block"),r):!g&&a?g=(0,_.__)("Add pattern"):g||(g=(0,_._x)("Add block","Generic label for block inserter button")),(0,u.createElement)(s,c({icon:cd,label:g,tooltipPosition:"bottom",onClick:function(e){t&&t(e),p&&p(e)},className:"block-editor-inserter__toggle","aria-haspopup":!l&&"true","aria-expanded":!l&&o,disabled:n},m))};class Fg extends u.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=zg,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:a,onSelectOrClose:s,selectBlockOnInsert:c,orderInitialBlockItems:d}=this.props;return i?(0,u.createElement)(Dg,{onSelect:e=>{const n=Array.isArray(e)&&null!=e&&e.length?e[0]:e;s&&"function"==typeof s&&s(n),t()},rootClientId:n,clientId:o,isAppender:r,prioritizePatterns:a,selectBlockOnInsert:c,orderInitialBlockItems:d}):(0,u.createElement)(Og,{onSelect:()=>{t()},rootClientId:n,clientId:o,isAppender:r,showInserterHelpPanel:l,prioritizePatterns:a})}render(){const{position:e,hasSingleBlockType:t,directInsertBlock:n,insertOnlyAllowedBlock:o,__experimentalIsQuick:r,onSelectOrClose:l}=this.props;return t||n?this.renderToggle({onToggle:o}):(0,u.createElement)(h.Dropdown,{className:"block-editor-inserter",contentClassName:p()("block-editor-inserter__popover",{"is-quick":r}),popoverProps:{position:e},onToggle:this.onToggle,expandOnMobile:!0,headerTitle:(0,_.__)("Add a block"),renderToggle:this.renderToggle,renderContent:this.renderContent,onClose:l})}}const Vg=(0,m.compose)([(0,g.withSelect)(((e,t)=>{var n;let{clientId:o,rootClientId:r,shouldDirectInsert:l=!0}=t;const{getBlockRootClientId:i,hasInserterItems:s,getAllowedBlocks:c,__experimentalGetDirectInsertBlock:u,getSettings:d}=e(To),{getBlockVariations:p}=e(a.store);r=r||i(o)||void 0;const m=c(r),g=l&&u(r),f=d(),h=1===(null==m?void 0:m.length)&&0===(null===(n=p(m[0].name,"inserter"))||void 0===n?void 0:n.length);let v=!1;return h&&(v=m[0]),{hasItems:s(r),hasSingleBlockType:h,blockTitle:v?v.title:"",allowedBlockType:v,directInsertBlock:g,rootClientId:r,prioritizePatterns:f.__experimentalPreferPatternsOnRoot&&!r}})),(0,g.withDispatch)(((e,t,n)=>{let{select:o}=n;return{insertOnlyAllowedBlock(){const{rootClientId:n,clientId:r,isAppender:l,hasSingleBlockType:i,allowedBlockType:s,directInsertBlock:c,onSelectOrClose:u,selectBlockOnInsert:d}=t;if(!i&&!c)return;const{insertBlock:p}=e(To);let m;if(c){const e=function(e){const{getBlock:t,getPreviousBlockClientId:l}=o(To);if(!e||!r&&!n)return{};const i={};let a={};if(r){const e=t(r),n=t(l(r));(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);m=(0,a.createBlock)(c.name,{...c.attributes||{},...e})}else m=(0,a.createBlock)(s.name);var g;(p(m,function(){const{getBlockIndex:e,getBlockSelectionEnd:t,getBlockOrder:i,getBlockRootClientId:a}=o(To);if(r)return e(r);const s=t();return!l&&s&&a(s)===n?e(s)+1:i(n).length}(),n,d),u)&&u({clientId:null===(g=m)||void 0===g?void 0:g.clientId});const f=(0,_.sprintf)((0,_.__)("%s block added"),s.title);(0,pn.speak)(f)}}})),(0,m.ifCondition)((e=>{let{hasItems:t,isAppender:n,rootClientId:o,clientId:r}=e;return t||!n&&!o&&!r}))])(Fg);var Hg=(0,u.forwardRef)(((e,t)=>(0,u.createElement)(Vg,c({ref:t},e,{orderInitialBlockItems:void 0}))));var Gg=(0,m.compose)((0,g.withSelect)(((e,t)=>{const{getBlockCount:n,getSettings:o,getTemplateLock:r}=e(To),l=!n(t.rootClientId),{bodyPlaceholder:i}=o();return{showPrompt:l,isLocked:!!r(t.rootClientId),placeholder:i}})),(0,g.withDispatch)(((e,t)=>{const{insertDefaultBlock:n,startTyping:o}=e(To);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,sd.decodeEntities)(r)||(0,_.__)("Type / to choose a block");return(0,u.createElement)("div",{"data-root-client-id":l||"",className:p()("block-editor-default-block-appender",{"has-visible-prompt":o})},(0,u.createElement)("p",{tabIndex:"0",role:"button","aria-label":(0,_.__)("Add default block"),className:"block-editor-default-block-appender__content",onKeyDown:e=>{Qu.ENTER!==e.keyCode&&Qu.SPACE!==e.keyCode||n()},onClick:()=>n(),onFocus:()=>{o&&n()}},o?i:"\ufeff"),(0,u.createElement)(Hg,{rootClientId:l,position:"bottom right",isAppender:!0,__experimentalIsQuick:!0}))}));function Ug(e,t){let{rootClientId:n,className:o,onFocus:r,tabIndex:l}=e;return(0,u.createElement)(Hg,{position:"bottom center",rootClientId:n,__experimentalIsQuick:!0,renderToggle:e=>{let n,{onToggle:i,disabled:a,isOpen:s,blockTitle:c,hasSingleBlockType:d}=e;n=d?(0,_.sprintf)((0,_._x)("Add %s","directly add the only allowed block"),c):(0,_._x)("Add block","Generic label for block inserter button");const m=!d;let g=(0,u.createElement)(h.Button,{ref:t,onFocus:r,tabIndex:l,className:p()(o,"block-editor-button-block-appender"),onClick:i,"aria-haspopup":m?"true":void 0,"aria-expanded":m?s:void 0,disabled:a,label:n},!d&&(0,u.createElement)(h.VisuallyHidden,{as:"span"},n),(0,u.createElement)(Jl,{icon:cd}));return(m||d)&&(g=(0,u.createElement)(h.Tooltip,{text:n},g)),g},isAppender:!0})}const $g=(0,u.forwardRef)(((e,t)=>(W()("wp.blockEditor.ButtonBlockerAppender",{alternative:"wp.blockEditor.ButtonBlockAppender",since:"5.9"}),Ug(e,t))));var jg=(0,u.forwardRef)(Ug);function Wg(e){let{rootClientId:t}=e;return(0,g.useSelect)((e=>e(To).canInsertBlockType((0,a.getDefaultBlockName)(),t)))?(0,u.createElement)(Gg,{rootClientId:t}):(0,u.createElement)(jg,{rootClientId:t,className:"block-list-appender__toggle"})}var Kg=function(e){let{rootClientId:t,renderAppender:n,className:o,tagName:r="div"}=e;const l=function(e,t){const{hideInserter:n,isParentSelected:o}=(0,g.useSelect)((t=>{const{getTemplateLock:n,getSelectedBlockClientId:o,__unstableGetEditorMode:r}=t(To),l=o();return{hideInserter:!!n(e)||"zoom-out"===r(),isParentSelected:e===l||!e&&!l}}),[e]);return n||!1===t?null:t?(0,u.createElement)(t,null):o?(0,u.createElement)(Wg,{rootClientId:e}):null}(t,n);return l?(0,u.createElement)(r,{tabIndex:-1,className:p()("block-list-appender wp-block",o),contentEditable:!1,"data-block":!0},l):null};const qg=Number.MAX_SAFE_INTEGER;(0,u.createContext)();var Yg=function(e){let{previousClientId:t,nextClientId:n,children:o,__unstablePopoverSlot:r,__unstableContentRef:l,...i}=e;const[a,s]=(0,u.useReducer)((e=>(e+1)%qg),0),{orientation:d,rootClientId:m,isVisible:f}=(0,g.useSelect)((e=>{var o;const{getBlockListSettings:r,getBlockRootClientId:l,isBlockVisible:i}=e(To),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]),v=tr(t),b=tr(n),k="vertical"===d,y=(0,u.useMemo)((()=>{if(a<0||!v&&!b||!f)return{};const e=v?v.getBoundingClientRect():null,t=b?b.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,_.isRTL)()?e.left-t.right:t.left-e.right),{width:n,height:e?e.height:t.height}}),[v,b,k,a,f]),E=(0,u.useMemo)((()=>{if(a<0||!v&&!b||!f)return;const{ownerDocument:e}=v||b;return{ownerDocument:e,getBoundingClientRect(){const e=v?v.getBoundingClientRect():null,t=b?b.getBoundingClientRect():null;let n=0,o=0;return k?(o=e?e.bottom:t.top,n=(0,_.isRTL)()?e?e.right:t.right:e?e.left:t.left):(o=e?e.top:t.top,n=(0,_.isRTL)()?e?e.left:t.right:e?e.right:t.left),new window.DOMRect(n,o,0,0)}}}),[v,b,a,k,f]),C=qr(l);return(0,u.useLayoutEffect)((()=>{if(!v)return;const e=new window.MutationObserver(s);return e.observe(v,{attributes:!0}),()=>{e.disconnect()}}),[v]),(0,u.useLayoutEffect)((()=>{if(!b)return;const e=new window.MutationObserver(s);return e.observe(b,{attributes:!0}),()=>{e.disconnect()}}),[b]),(0,u.useLayoutEffect)((()=>{if(v)return v.ownerDocument.defaultView.addEventListener("resize",s),()=>{var e;null===(e=v.ownerDocument.defaultView)||void 0===e||e.removeEventListener("resize",s)}}),[v]),(v||b)&&f?(0,u.createElement)(h.Popover,c({ref:C,animate:!1,anchor:E,focusOnMount:!1,__unstableSlotName:r||null,key:n+"--"+m},i,{className:p()("block-editor-block-popover","block-editor-block-popover__inbetween",i.className),resize:!1,flip:!1,placement:"bottom-start",variant:"unstyled"}),(0,u.createElement)("div",{className:"block-editor-block-popover__inbetween-container",style:y},o)):null};const Zg={hide:{opacity:0,scaleY:.75},show:{opacity:1,scaleY:1},exit:{opacity:0,scaleY:.9}};var Qg=function(e){let{__unstablePopoverSlot:t,__unstableContentRef:n}=e;const{clientId:o}=(0,g.useSelect)((e=>{const{getBlockOrder:t,getBlockInsertionPoint:n}=e(To),o=n(),r=t(o.rootClientId);return r.length?{clientId:r[o.index]}:{}}),[]),r=(0,m.useReducedMotion)();return(0,u.createElement)(Zr,{clientId:o,__unstableCoverTarget:!0,__unstablePopoverSlot:t,__unstableContentRef:n,className:"block-editor-block-popover__drop-zone"},(0,u.createElement)(h.__unstableMotion.div,{"data-testid":"block-popover-drop-zone",initial:r?Zg.show:Zg.hide,animate:Zg.show,exit:r?Zg.show:Zg.exit,className:"block-editor-block-popover__drop-zone-foreground"}))};const Xg=(0,u.createContext)();function Jg(e){let{__unstablePopoverSlot:t,__unstableContentRef:n}=e;const{selectBlock:o,hideInsertionPoint:r}=(0,g.useDispatch)(To),l=(0,u.useContext)(Xg),i=(0,u.useRef)(),{orientation:a,previousClientId:s,nextClientId:c,rootClientId:d,isInserterShown:f,isDistractionFree:v,isNavigationMode:b}=(0,g.useSelect)((e=>{var t;const{getBlockOrder:n,getBlockListSettings:o,getBlockInsertionPoint:r,isBlockBeingDragged:l,getPreviousBlockClientId:i,getNextBlockClientId:a,getSettings:s,isNavigationMode:c}=e(To),u=r(),d=n(u.rootClientId);if(!d.length)return{};let p=d[u.index-1],m=d[u.index];for(;l(p);)p=i(p);for(;l(m);)m=a(m);const g=s();return{previousClientId:p,nextClientId:m,orientation:(null===(t=o(u.rootClientId))||void 0===t?void 0:t.orientation)||"vertical",rootClientId:u.rootClientId,isNavigationMode:c(),isDistractionFree:g.isDistractionFree,isInserterShown:null==u?void 0:u.__unstableWithInserter}}),[]),k=(0,m.useReducedMotion)();const _={start:{opacity:0,scale:0},rest:{opacity:1,scale:1,transition:{delay:f?.5:0,type:"tween"}},hover:{opacity:1,scale:1,transition:{delay:.5,type:"tween"}}},y={start:{scale:k?1:0},rest:{scale:1,transition:{delay:.4,type:"tween"}}};if(v&&!b)return null;const E=p()("block-editor-block-list__insertion-point","is-"+a);return(0,u.createElement)(Yg,{previousClientId:s,nextClientId:c,__unstablePopoverSlot:t,__unstableContentRef:n},(0,u.createElement)(h.__unstableMotion.div,{layout:!k,initial:k?"rest":"start",animate:"rest",whileHover:"hover",whileTap:"pressed",exit:"start",ref:i,tabIndex:-1,onClick:function(e){e.target===i.current&&c&&o(c,-1)},onFocus:function(e){e.target!==i.current&&(l.current=!0)},className:p()(E,{"is-with-inserter":f}),onHoverEnd:function(e){e.target!==i.current||l.current||r()}},(0,u.createElement)(h.__unstableMotion.div,{variants:_,className:"block-editor-block-list__insertion-point-indicator","data-testid":"block-list-insertion-point-indicator"}),f&&(0,u.createElement)(h.__unstableMotion.div,{variants:y,className:p()("block-editor-block-list__insertion-point-inserter")},(0,u.createElement)(Hg,{position:"bottom center",clientId:c,rootClientId:d,__experimentalIsQuick:!0,onToggle:e=>{l.current=e},onSelectOrClose:()=>{l.current=!1}}))))}function ef(e){const{insertionPoint:t,isVisible:n}=(0,g.useSelect)((e=>{const{getBlockInsertionPoint:t,isBlockInsertionPointVisible:n}=e(To);return{insertionPoint:t(),isVisible:n()}}),[]);return n?"replace"===t.operation?(0,u.createElement)(Qg,c({key:`${t.rootClientId}-${t.index}`},e)):(0,u.createElement)(Jg,e):null}function tf(){const e=(0,u.useContext)(Xg),t=(0,g.useSelect)((e=>e(To).getSettings().isDistractionFree||"zoom-out"===e(To).__unstableGetEditorMode()),[]),{getBlockListSettings:n,getBlockRootClientId:o,getBlockIndex:r,isBlockInsertionPointVisible:l,isMultiSelecting:i,getSelectedBlockClientIds:a,getTemplateLock:s,__unstableIsWithinBlockOverlay:c}=(0,g.useSelect)(To),{showInsertionPoint:d,hideInsertionPoint:p}=(0,g.useDispatch)(To);return(0,m.useRefEffect)((o=>{if(!t)return o.addEventListener("mousemove",l),()=>{o.removeEventListener("mousemove",l)};function l(t){var o;if(e.current)return;if(t.target.nodeType===t.target.TEXT_NODE)return;if(i())return;if(!t.target.classList.contains("block-editor-block-list__layout"))return void p();let l;if(!t.target.classList.contains("is-root-container")){l=(t.target.getAttribute("data-block")?t.target:t.target.closest("[data-block]")).getAttribute("data-block")}if(s(l))return;const u=(null===(o=n(l))||void 0===o?void 0:o.orientation)||"vertical",m=t.clientY,g=t.clientX;let f=Array.from(t.target.children).find((e=>{const t=e.getBoundingClientRect();return e.classList.contains("wp-block")&&"vertical"===u&&t.top>m||e.classList.contains("wp-block")&&"horizontal"===u&&t.left>g}));if(!f)return void p();if(!f.id&&(f=f.firstElementChild,!f))return void p();const h=f.id.slice("block-".length);if(!h||c(h))return;if(a().includes(h))return;const v=f.getBoundingClientRect();if("horizontal"===u&&(t.clientY>v.bottom||t.clientYv.right||t.clientX{setTimeout((()=>e(Date.now())),0)}:window.requestIdleCallback||window.requestAnimationFrame,of="undefined"==typeof window?clearTimeout:window.cancelIdleCallback||window.cancelAnimationFrame;function rf(e){return(0,g.useSelect)((t=>{if(!e)return null;const{getBlockName:n,getBlockAttributes:o}=t(To),{getBlockType:r,getActiveBlockVariation:l}=t(a.store),i=n(e),s=r(i);if(!s)return null;const c=o(e),u=l(i,c),d=(0,a.isReusableBlock)(s)||(0,a.isTemplatePart)(s),p={isSynced:d,title:s.title,icon:s.icon,description:s.description,anchor:null==c?void 0:c.anchor};return u?{isSynced:d,title:u.title||s.title,icon:u.icon||s.icon,description:u.description||s.description,anchor:null==c?void 0:c.anchor}:p}),[e])}function lf(e){let{clientId:t,maximumLength:n,context:o}=e;const{attributes:r,name:l,reusableBlockTitle:i}=(0,g.useSelect)((e=>{if(!t)return{};const{getBlockName:n,getBlockAttributes:o,__experimentalGetReusableBlockTitle:r}=e(To),l=n(t);if(!l)return{};const i=(0,a.isReusableBlock)((0,a.getBlockType)(l));return{attributes:o(t),name:l,reusableBlockTitle:i&&r(o(t).ref)}}),[t]),s=rf(t);if(!l||!s)return null;const c=(0,a.getBlockType)(l),u=c?(0,a.__experimentalGetBlockLabel)(c,r,o):null,d=i||u,p=d&&d!==c.title?d:s.title;if(n&&n>0&&p.length>n){const e="...";return p.slice(0,n-e.length)+e}return p}function af(e){let{clientId:t,maximumLength:n,context:o}=e;return lf({clientId:t,maximumLength:n,context:o})}var sf=e=>{let{children:t,clientIds:n,cloneClassname:o,onDragStart:r,onDragEnd:l}=e;const{srcRootClientId:i,isDraggable:s,icon:c}=(0,g.useSelect)((e=>{var t;const{canMoveBlocks:o,getBlockRootClientId:r,getBlockName:l}=e(To),i=r(n[0]),s=l(n[0]);return{srcRootClientId:i,isDraggable:o(n,i),icon:null===(t=(0,a.getBlockType)(s))||void 0===t?void 0:t.icon}}),[n]),d=(0,u.useRef)(!1),[p,m,f]=function(){const e=(0,u.useRef)(null),t=(0,u.useRef)(null),n=(0,u.useRef)(null),o=(0,u.useRef)(null);return(0,u.useEffect)((()=>()=>{o.current&&(clearInterval(o.current),o.current=null)}),[]),[(0,u.useCallback)((r=>{e.current=r.clientY,n.current=(0,Ri.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,u.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{e.current=null,n.current=null,o.current&&(clearInterval(o.current),o.current=null)}]}(),{startDraggingBlocks:v,stopDraggingBlocks:b}=(0,g.useDispatch)(To);if((0,u.useEffect)((()=>()=>{d.current&&b()}),[]),!s)return t({draggable:!1});const k={type:"block",srcClientIds:n,srcRootClientId:i};return(0,u.createElement)(h.Draggable,{cloneClassname:o,__experimentalTransferDataType:"wp-blocks",transferData:k,onDragStart:e=>{v(n),d.current=!0,p(e),r&&r()},onDragOver:m,onDragEnd:()=>{b(),d.current=!1,f(),l&&l()},__experimentalDragComponent:(0,u.createElement)(lm,{count:n.length,icon:c})},(e=>{let{onDraggableStart:n,onDraggableEnd:o}=e;return t({draggable:!0,onDragStart:n,onDragEnd:o})}))};var cf=(0,u.createElement)(G.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,u.createElement)(G.Path,{d:"M6.5 12.4L12 8l5.5 4.4-.9 1.2L12 10l-4.5 3.6-1-1.2z"}));var uf=(0,u.createElement)(G.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,u.createElement)(G.Path,{d:"M17.5 11.6L12 16l-5.5-4.4.9-1.2L12 14l4.5-3.6 1 1.2z"}));const df=(e,t)=>"up"===e?"horizontal"===t?(0,_.isRTL)()?"right":"left":"up":"down"===e?"horizontal"===t?(0,_.isRTL)()?"left":"right":"down":null;function pf(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,_.__)("All blocks are selected, and cannot be moved");if(r>0&&!o){const t=df("down",l);if("down"===t)return(0,_.sprintf)((0,_.__)("Move %1$d blocks from position %2$d down by one place"),e,i);if("left"===t)return(0,_.sprintf)((0,_.__)("Move %1$d blocks from position %2$d left by one place"),e,i);if("right"===t)return(0,_.sprintf)((0,_.__)("Move %1$d blocks from position %2$d right by one place"),e,i)}if(r>0&&o){const e=df("down",l);if("down"===e)return(0,_.__)("Blocks cannot be moved down as they are already at the bottom");if("left"===e)return(0,_.__)("Blocks cannot be moved left as they are already are at the leftmost position");if("right"===e)return(0,_.__)("Blocks cannot be moved right as they are already are at the rightmost position")}if(r<0&&!n){const t=df("up",l);if("up"===t)return(0,_.sprintf)((0,_.__)("Move %1$d blocks from position %2$d up by one place"),e,i);if("left"===t)return(0,_.sprintf)((0,_.__)("Move %1$d blocks from position %2$d left by one place"),e,i);if("right"===t)return(0,_.sprintf)((0,_.__)("Move %1$d blocks from position %2$d right by one place"),e,i)}if(r<0&&n){const e=df("up",l);if("up"===e)return(0,_.__)("Blocks cannot be moved up as they are already at the top");if("left"===e)return(0,_.__)("Blocks cannot be moved left as they are already are at the leftmost position");if("right"===e)return(0,_.__)("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,_.sprintf)((0,_.__)("Block %s is the only block, and cannot be moved"),t);if(l>0&&!r){const e=df("down",i);if("down"===e)return(0,_.sprintf)((0,_.__)("Move %1$s block from position %2$d down to position %3$d"),t,a,a+1);if("left"===e)return(0,_.sprintf)((0,_.__)("Move %1$s block from position %2$d left to position %3$d"),t,a,a+1);if("right"===e)return(0,_.sprintf)((0,_.__)("Move %1$s block from position %2$d right to position %3$d"),t,a,a+1)}if(l>0&&r){const e=df("down",i);if("down"===e)return(0,_.sprintf)((0,_.__)("Block %1$s is at the end of the content and can’t be moved down"),t);if("left"===e)return(0,_.sprintf)((0,_.__)("Block %1$s is at the end of the content and can’t be moved left"),t);if("right"===e)return(0,_.sprintf)((0,_.__)("Block %1$s is at the end of the content and can’t be moved right"),t)}if(l<0&&!o){const e=df("up",i);if("up"===e)return(0,_.sprintf)((0,_.__)("Move %1$s block from position %2$d up to position %3$d"),t,a,a-1);if("left"===e)return(0,_.sprintf)((0,_.__)("Move %1$s block from position %2$d left to position %3$d"),t,a,a-1);if("right"===e)return(0,_.sprintf)((0,_.__)("Move %1$s block from position %2$d right to position %3$d"),t,a,a-1)}if(l<0&&o){const e=df("up",i);if("up"===e)return(0,_.sprintf)((0,_.__)("Block %1$s is at the beginning of the content and can’t be moved up"),t);if("left"===e)return(0,_.sprintf)((0,_.__)("Block %1$s is at the beginning of the content and can’t be moved left"),t);if("right"===e)return(0,_.sprintf)((0,_.__)("Block %1$s is at the beginning of the content and can’t be moved right"),t)}}const mf=(e,t)=>"up"===e?"horizontal"===t?(0,_.isRTL)()?pd:md:cf:"down"===e?"horizontal"===t?(0,_.isRTL)()?md:pd:uf:null,gf=(e,t)=>"up"===e?"horizontal"===t?(0,_.isRTL)()?(0,_.__)("Move right"):(0,_.__)("Move left"):(0,_.__)("Move up"):"down"===e?"horizontal"===t?(0,_.isRTL)()?(0,_.__)("Move left"):(0,_.__)("Move right"):(0,_.__)("Move down"):null,ff=(0,u.forwardRef)(((e,t)=>{let{clientIds:n,direction:o,orientation:r,...l}=e;const i=(0,m.useInstanceId)(ff),s=Array.isArray(n)?n:[n],d=s.length,{blockType:f,isDisabled:v,rootClientId:b,isFirst:k,isLast:_,firstIndex:y,orientation:E="vertical"}=(0,g.useSelect)((e=>{const{getBlockIndex:t,getBlockRootClientId:n,getBlockOrder:l,getBlock:i,getBlockListSettings:c}=e(To),u=s[0],d=n(u),p=t(u),m=t(s[s.length-1]),g=l(d),f=i(u),h=0===p,v=m===g.length-1,{orientation:b}=c(d)||{};return{blockType:f?(0,a.getBlockType)(f.name):null,isDisabled:"up"===o?h:v,rootClientId:d,firstIndex:p,isFirst:h,isLast:v,orientation:r||b}}),[n,o]),{moveBlocksDown:C,moveBlocksUp:S}=(0,g.useDispatch)(To),w="up"===o?S:C,B=`block-editor-block-mover-button__description-${i}`;return(0,u.createElement)(u.Fragment,null,(0,u.createElement)(h.Button,c({ref:t,className:p()("block-editor-block-mover-button",`is-${o}-button`),icon:mf(o,E),label:gf(o,E),"aria-describedby":B},l,{onClick:v?null:e=>{w(n,b),l.onClick&&l.onClick(e)},disabled:v,__experimentalIsFocusable:!0})),(0,u.createElement)(h.VisuallyHidden,{id:B},pf(d,f&&f.title,y,k,_,"up"===o?-1:1,E)))})),hf=(0,u.forwardRef)(((e,t)=>(0,u.createElement)(ff,c({direction:"up",ref:t},e)))),vf=(0,u.forwardRef)(((e,t)=>(0,u.createElement)(ff,c({direction:"down",ref:t},e))));var bf=function(e){let{clientIds:t,hideDragHandle:n}=e;const{canMove:o,rootClientId:r,isFirst:l,isLast:i,orientation:a}=(0,g.useSelect)((e=>{var n;const{getBlockIndex:o,getBlockListSettings:r,canMoveBlocks:l,getBlockOrder:i,getBlockRootClientId:a}=e(To),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&&i&&!r)return null;const s=(0,_.__)("Drag");return(0,u.createElement)(h.ToolbarGroup,{className:p()("block-editor-block-mover",{"is-horizontal":"horizontal"===a})},!n&&(0,u.createElement)(sf,{clientIds:t},(e=>(0,u.createElement)(h.Button,c({icon:rm,className:"block-editor-block-mover__drag-handle","aria-hidden":"true",label:s,tabIndex:"-1"},e)))),(0,u.createElement)("div",{className:"block-editor-block-mover__move-button-container"},(0,u.createElement)(h.ToolbarItem,null,(e=>(0,u.createElement)(hf,c({clientIds:t},e)))),(0,u.createElement)(h.ToolbarItem,null,(e=>(0,u.createElement)(vf,c({clientIds:t},e))))))};var kf=function(e){let{clientId:t,rootClientId:n}=e;const o=rf(t),r=(0,g.useSelect)((e=>{var o;const{getBlock:r,getBlockIndex:l,hasBlockMovingClientId:i,getBlockListSettings:a,__unstableGetEditorMode:s}=e(To),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:l,name:i,attributes:s,blockMovingMode:d,orientation:m,editorMode:f}=r,{setNavigationMode:v,removeBlock:b}=(0,g.useDispatch)(To),k=(0,u.useRef)(),y=(0,a.getBlockType)(i),E=(0,a.__experimentalGetAccessibleBlockLabel)(y,s,l+1,m);(0,u.useEffect)((()=>{k.current.focus(),(0,pn.speak)(E)}),[E]);const C=tr(t),{hasBlockMovingClientId:S,getBlockIndex:w,getBlockRootClientId:B,getClientIdsOfDescendants:I,getSelectedBlockClientId:x,getMultiSelectedBlocksEndClientId:T,getPreviousBlockClientId:M,getNextBlockClientId:N}=(0,g.useSelect)(To),{selectBlock:P,clearSelectedBlock:L,setBlockMovingClientId:R,moveBlockToPosition:A}=(0,g.useDispatch)(To),O=p()("block-editor-block-list__block-selection-button",{"is-block-moving-mode":!!d}),D=(0,_.__)("Drag");return(0,u.createElement)("div",{className:O},(0,u.createElement)(h.Flex,{justify:"center",className:"block-editor-block-list__block-selection-button__content"},(0,u.createElement)(h.FlexItem,null,(0,u.createElement)(fd,{icon:null==o?void 0:o.icon,showColors:!0})),(0,u.createElement)(h.FlexItem,null,"zoom-out"===f&&(0,u.createElement)(bf,{clientIds:[t],hideDragHandle:!0}),"navigation"===f&&(0,u.createElement)(sf,{clientIds:[t]},(e=>(0,u.createElement)(h.Button,c({icon:rm,className:"block-selection-button_drag-handle","aria-hidden":"true",label:D,tabIndex:"-1"},e))))),(0,u.createElement)(h.FlexItem,null,(0,u.createElement)(h.Button,{ref:k,onClick:"navigation"===f?()=>v(!1):void 0,onKeyDown:function(e){const{keyCode:n}=e,o=n===Qu.UP,r=n===Qu.DOWN,l=n===Qu.LEFT,i=n===Qu.RIGHT,a=n===Qu.TAB,s=n===Qu.ESCAPE,c=n===Qu.ENTER,u=n===Qu.SPACE,d=e.shiftKey;if(n===Qu.BACKSPACE||n===Qu.DELETE)return b(t),void e.preventDefault();const p=x(),m=T(),g=M(m||p),f=N(m||p),h=a&&d||o,v=a&&!d||r,k=l,_=i;let y;if(h)y=g;else if(v)y=f;else if(k){var E;y=null!==(E=B(p))&&void 0!==E?E:p}else if(_){var O;y=null!==(O=I([p])[0])&&void 0!==O?O:p}const D=S();if(s&&D&&!e.defaultPrevented&&(R(null),e.preventDefault()),(c||u)&&D){const e=B(D),t=B(p),n=w(D);let o=w(p);n{!function(e){const[t]=Ri.focus.tabbable.find(e);t&&t.focus({preventScroll:!0})}(e.current)}),[]);(0,xd.useShortcut)("core/block-editor/focus-toolbar",a),(0,u.useEffect)((()=>{l&&a()}),[n,l,a]),(0,u.useEffect)((()=>{let t=0;return i&&!l&&(t=window.requestAnimationFrame((()=>{const t=_f(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=_f(e.current).findIndex((e=>0===e.tabIndex));r(n)}}),[i,l])}var Ef=function(e){let{children:t,focusOnMount:n,__experimentalInitialIndex:o,__experimentalOnIndexChange:r,...l}=e;const i=(0,u.useRef)(),a=function(e){const[t,n]=(0,u.useState)(!0),o=(0,u.useCallback)((()=>{const t=!Ri.focus.tabbable.find(e.current).some((e=>!("toolbarItem"in e.dataset)));t||W()("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,u.useLayoutEffect)((()=>{const t=new window.MutationObserver(o);return t.observe(e.current,{childList:!0,subtree:!0}),()=>t.disconnect()}),[t]),t}(i);return yf(i,n,a,o,r),a?(0,u.createElement)(h.Toolbar,c({label:l["aria-label"],ref:i},l),t):(0,u.createElement)(h.NavigableMenu,c({orientation:"horizontal",role:"toolbar",ref:i},l),t)};const{clearTimeout:Cf,setTimeout:Sf}=window,wf=()=>{},Bf=200;function If(e){let{ref:t,isFocused:n,debounceTimeout:o=Bf,onChange:r=wf}=e;const[l,i]=(0,u.useState)(!1),a=(0,u.useRef)(),s=e=>{null!=t&&t.current&&i(e),r(e)},c=()=>{const e=(null==t?void 0:t.current)&&t.current.matches(":hover");return!n&&!e},d=()=>{const e=a.current;e&&Cf&&Cf(e)};return(0,u.useEffect)((()=>()=>{s(!1),d()}),[]),{showMovers:l,debouncedShowMovers:e=>{e&&e.stopPropagation(),d(),l||s(!0)},debouncedHideMovers:e=>{e&&e.stopPropagation(),d(),a.current=Sf((()=>{c()&&s(!1)}),o)}}}function xf(e){let{ref:t,debounceTimeout:n=Bf,onChange:o=wf}=e;const[r,l]=(0,u.useState)(!1),{showMovers:i,debouncedShowMovers:a,debouncedHideMovers:s}=If({ref:t,debounceTimeout:n,isFocused:r,onChange:o}),c=(0,u.useRef)(!1),d=()=>(null==t?void 0:t.current)&&t.current.contains(t.current.ownerDocument.activeElement);return(0,u.useEffect)((()=>{const e=t.current,n=()=>{d()&&(l(!0),a())},o=()=>{d()||(l(!1),s())};return e&&!c.current&&(e.addEventListener("focus",n,!0),e.addEventListener("blur",o,!0),c.current=!0),()=>{e&&(e.removeEventListener("focus",n),e.removeEventListener("blur",o))}}),[t,c,l,a,s]),{showMovers:i,gestures:{onMouseMove:a,onMouseLeave:s}}}function Tf(){const{selectBlock:e,toggleBlockHighlight:t}=(0,g.useDispatch)(To),{firstParentClientId:n,shouldHide:o,isDistractionFree:r}=(0,g.useSelect)((e=>{const{getBlockName:t,getBlockParents:n,getSelectedBlockClientId:o,getSettings:r}=e(To),{hasBlockSupport:l}=e(a.store),i=n(o()),s=i[i.length-1],c=t(s),u=(0,a.getBlockType)(c),d=r();return{firstParentClientId:s,shouldHide:!l(u,"__experimentalParentSelector",!0),isDistractionFree:d.isDistractionFree}}),[]),l=rf(n),i=(0,u.useRef)(),{gestures:s}=xf({ref:i,onChange(e){e&&r||t(n,e)}});return o||void 0===n?null:(0,u.createElement)("div",c({className:"block-editor-block-parent-selector",key:n,ref:i},s),(0,u.createElement)(h.ToolbarButton,{className:"block-editor-block-parent-selector__button",onClick:()=>e(n),label:(0,_.sprintf)((0,_.__)("Select %s"),null==l?void 0:l.title),showTooltip:!0,icon:(0,u.createElement)(fd,{icon:null==l?void 0:l.icon})}))}var Mf=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.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 Nf(e){let{blocks:t}=e;return(0,u.createElement)("div",{className:"block-editor-block-switcher__popover__preview__parent"},(0,u.createElement)("div",{className:"block-editor-block-switcher__popover__preview__container"},(0,u.createElement)(h.Popover,{className:"block-editor-block-switcher__preview__popover",placement:"bottom-start",focusOnMount:!1},(0,u.createElement)("div",{className:"block-editor-block-switcher__preview"},(0,u.createElement)("div",{className:"block-editor-block-switcher__preview-title"},(0,_.__)("Preview")),(0,u.createElement)(Jp,{viewportWidth:500,blocks:t})))))}function Pf(e){let{restTransformations:t,onSelect:n,setHoveredTransformItemName:o}=e;return t.map((e=>(0,u.createElement)(Lf,{key:e.name,item:e,onSelect:n,setHoveredTransformItemName:o})))}function Lf(e){let{item:t,onSelect:n,setHoveredTransformItemName:o}=e;const{name:r,icon:l,title:i,isDisabled:s}=t;return(0,u.createElement)(h.MenuItem,{className:(0,a.getBlockMenuDefaultClassName)(r),onClick:e=>{e.preventDefault(),n(r)},disabled:s,onMouseLeave:()=>o(null),onMouseEnter:()=>o(r)},(0,u.createElement)(fd,{icon:l,showColors:!0}),i)}var Rf=e=>{let{className:t,possibleBlockTransformations:n,onSelect:o,blocks:r}=e;const[l,i]=(0,u.useState)(),{priorityTextTransformations:s,restTransformations:c}=function(e){const t={"core/paragraph":1,"core/heading":2,"core/list":3,"core/quote":4},n=(0,u.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](0,u.createElement)(Lf,{key:e.name,item:e,onSelect:o,setHoveredTransformItemName:i}))),!d&&p),!!d&&(0,u.createElement)(h.MenuGroup,{className:t},p))};var Af=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"M16.7 7.1l-6.3 8.5-3.3-2.5-.9 1.2 4.5 3.4L17.9 8z"})),Of=window.wp.tokenList,Df=n.n(Of);function zf(e,t,n){const o=new(Df())(e);return t&&o.remove("is-style-"+t.name),o.add("is-style-"+n.name),o.value}function Ff(e){return null==e?void 0:e.find((e=>e.isDefault))}function Vf(e){let{clientId:t,onSwitch:n}=e;const{styles:o,block:r,blockType:l,className:i}=(0,g.useSelect)((e=>{const{getBlock:n}=e(To),o=n(t);if(!o)return{};const r=(0,a.getBlockType)(o.name),{getBlockStyles:l}=e(a.store);return{block:o,blockType:r,styles:l(o.name),className:o.attributes.className||""}}),[t]),{updateBlockAttributes:s}=(0,g.useDispatch)(To),c=function(e){return e&&0!==e.length?Ff(e)?e:[{name:"default",label:(0,_._x)("Default","block style"),isDefault:!0},...e]:[]}(o),d=function(e,t){for(const n of new(Df())(t).values()){if(-1===n.indexOf("is-style-"))continue;const t=n.substring(9),o=null==e?void 0:e.find((e=>{let{name:n}=e;return n===t}));if(o)return o}return Ff(e)}(c,i),p=function(e,t){return(0,u.useMemo)((()=>{const n=null==t?void 0:t.example,o=null==t?void 0:t.name;return n&&o?(0,a.getBlockFromExample)(o,{attributes:n.attributes,innerBlocks:n.innerBlocks}):e?(0,a.cloneBlock)(e):void 0}),[null!=t&&t.example?null==e?void 0:e.name:e,t])}(r,l);return{onSelect:e=>{const o=zf(i,d,e);s(t,{className:o}),n()},stylesToRender:c,activeStyle:d,genericPreviewBlock:p,className:i}}const Hf=()=>{};function Gf(e){let{clientId:t,onSwitch:n=Hf}=e;const{onSelect:o,stylesToRender:r,activeStyle:l}=Vf({clientId:t,onSwitch:n});return r&&0!==r.length?(0,u.createElement)(u.Fragment,null,r.map((e=>{const t=e.label||e.name;return(0,u.createElement)(h.MenuItem,{key:e.name,icon:l.name===e.name?Af:null,onClick:()=>o(e)},(0,u.createElement)(h.__experimentalText,{as:"span",limit:18,ellipsizeMode:"tail",truncate:!0},t))}))):null}function Uf(e){let{hoveredBlock:t,onSwitch:n}=e;const{clientId:o}=t;return(0,u.createElement)(h.MenuGroup,{label:(0,_.__)("Styles"),className:"block-editor-block-switcher__styles__menugroup"},(0,u.createElement)(Gf,{clientId:o,onSwitch:n}))}const $f=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=$f(e,t,n);if(o)return o}}},jf=(e,t)=>{const n=((e,t)=>{const n=(0,a.__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 Wf=(e,t)=>(0,u.useMemo)((()=>e.reduce(((e,n)=>{const o=((e,t)=>{const n=t.map((e=>(0,a.cloneBlock)(e))),o=new Set;for(const t of e){let e=!1;for(const r of n){const n=$f(r,t.name,o);if(n){e=!0,o.add(n.clientId),jf(n,t);break}}if(!e)return}return n})(t,n.blocks);return o&&e.push({...n,transformedBlocks:o}),e}),[])),[e,t]);function Kf(e){let{patterns:t,onSelect:n}=e;return(0,u.createElement)("div",{className:"block-editor-block-switcher__popover__preview__parent"},(0,u.createElement)("div",{className:"block-editor-block-switcher__popover__preview__container"},(0,u.createElement)(h.Popover,{className:"block-editor-block-switcher__preview__popover",position:"bottom right"},(0,u.createElement)("div",{className:"block-editor-block-switcher__preview"},(0,u.createElement)("div",{className:"block-editor-block-switcher__preview-title"},(0,_.__)("Preview")),(0,u.createElement)(qf,{patterns:t,onSelect:n})))))}function qf(e){let{patterns:t,onSelect:n}=e;const o=(0,h.__unstableUseCompositeState)();return(0,u.createElement)(h.__unstableComposite,c({},o,{role:"listbox",className:"block-editor-block-switcher__preview-patterns-container","aria-label":(0,_.__)("Patterns list")}),t.map((e=>(0,u.createElement)(Yf,{key:e.name,pattern:e,onSelect:n,composite:o}))))}function Yf(e){let{pattern:t,onSelect:n,composite:o}=e;const r="block-editor-block-switcher__preview-patterns-container",l=(0,m.useInstanceId)(Yf,`${r}-list__item-description`);return(0,u.createElement)("div",{className:`${r}-list__list-item`,"aria-label":t.title,"aria-describedby":t.description?l:void 0},(0,u.createElement)(h.__unstableCompositeItem,c({role:"option",as:"div"},o,{className:`${r}-list__item`,onClick:()=>n(t.transformedBlocks)}),(0,u.createElement)(Jp,{blocks:t.transformedBlocks,viewportWidth:t.viewportWidth||500}),(0,u.createElement)("div",{className:`${r}-list__item-title`},t.title)),!!t.description&&(0,u.createElement)(h.VisuallyHidden,{id:l},t.description))}var Zf=function(e){let{blocks:t,patterns:n,onSelect:o}=e;const[r,l]=(0,u.useState)(!1),i=Wf(n,t);return i.length?(0,u.createElement)(h.MenuGroup,{className:"block-editor-block-switcher__pattern__transforms__menugroup"},r&&(0,u.createElement)(Kf,{patterns:i,onSelect:o}),(0,u.createElement)(h.MenuItem,{onClick:e=>{e.preventDefault(),l(!r)},icon:pd},(0,_.__)("Patterns"))):null};const Qf=e=>{let{clientIds:t,blocks:n}=e;const{replaceBlocks:o,multiSelect:r}=(0,g.useDispatch)(To),l=rf(n[0].clientId),{possibleBlockTransformations:i,canRemove:s,hasBlockStyles:c,icon:d,patterns:p}=(0,g.useSelect)((e=>{const{getBlockRootClientId:o,getBlockTransformItems:r,__experimentalGetPatternTransformItems:i}=e(To),{getBlockStyles:s,getBlockType:c}=e(a.store),{canRemoveBlocks:u}=e(To),d=o(Array.isArray(t)?t[0]:t),[{name:p}]=n,m=1===n.length,g=m&&s(p);let f;if(m)f=null==l?void 0:l.icon;else{var h;f=1===new Set(n.map((e=>{let{name:t}=e;return t}))).size?null===(h=c(p))||void 0===h?void 0:h.icon:Mf}return{possibleBlockTransformations:r(n,d),canRemove:u(t,d),hasBlockStyles:!(null==g||!g.length),icon:f,patterns:i(n,d)}}),[t,n,null==l?void 0:l.icon]),m=lf({clientId:Array.isArray(t)?t[0]:t,maximumLength:35}),f=1===n.length&&(0,a.isReusableBlock)(n[0]),v=1===n.length&&(0,a.isTemplatePart)(n[0]);function b(e){e.length>1&&r(e[0].clientId,e[e.length-1].clientId)}const k=!!i.length&&s&&!v,y=!(null==p||!p.length)&&s;if(!c&&!k)return(0,u.createElement)(h.ToolbarGroup,null,(0,u.createElement)(h.ToolbarButton,{disabled:!0,className:"block-editor-block-switcher__no-switcher-icon",title:m,icon:(0,u.createElement)(u.Fragment,null,(0,u.createElement)(fd,{icon:d,showColors:!0}),(f||v)&&(0,u.createElement)("span",{className:"block-editor-block-switcher__toggle-text"},m))}));const E=m,C=1===n.length?(0,_.sprintf)((0,_.__)("%s: Change block type or style"),m):(0,_.sprintf)((0,_._n)("Change type of %d block","Change type of %d blocks",n.length),n.length),S=c||k||y;return(0,u.createElement)(h.ToolbarGroup,null,(0,u.createElement)(h.ToolbarItem,null,(e=>(0,u.createElement)(h.DropdownMenu,{className:"block-editor-block-switcher",label:E,popoverProps:{position:"bottom right",variant:"toolbar",className:"block-editor-block-switcher__popover"},icon:(0,u.createElement)(u.Fragment,null,(0,u.createElement)(fd,{icon:d,className:"block-editor-block-switcher__toggle",showColors:!0}),(f||v)&&(0,u.createElement)("span",{className:"block-editor-block-switcher__toggle-text"},m)),toggleProps:{describedBy:C,...e},menuProps:{orientation:"both"}},(e=>{let{onClose:r}=e;return S&&(0,u.createElement)("div",{className:"block-editor-block-switcher__container"},y&&(0,u.createElement)(Zf,{blocks:n,patterns:p,onSelect:e=>{!function(e){o(t,e),b(e)}(e),r()}}),k&&(0,u.createElement)(Rf,{className:"block-editor-block-switcher__transforms__menugroup",possibleBlockTransformations:i,blocks:n,onSelect:e=>{!function(e){const r=(0,a.switchToBlockType)(n,e);o(t,r),b(r)}(e),r()}}),c&&(0,u.createElement)(Uf,{hoveredBlock:n[0],onSwitch:r}))})))))};var Xf=e=>{let{clientIds:t}=e;const n=(0,g.useSelect)((e=>e(To).getBlocksByClientId(t)),[t]);return!n.length||n.some((e=>!e))?null:(0,u.createElement)(Qf,{clientIds:t,blocks:n})};const{Fill:Jf,Slot:eh}=(0,h.createSlotFill)("__unstableBlockToolbarLastItem");Jf.Slot=eh;var th=Jf;function nh(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 oh(){const{getBlockName:e}=(0,g.useSelect)(To),{getBlockType:t}=(0,g.useSelect)(a.store),{createSuccessNotice:n}=(0,g.useDispatch)(hm.store);return(0,u.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,_.sprintf)((0,_.__)('Copied "%s" to clipboard.'),a):(0,_.sprintf)((0,_.__)('Moved "%s" to clipboard.'),a)}else l="copy"===o?(0,_.sprintf)((0,_._n)("Copied %d block to clipboard.","Copied %d blocks to clipboard.",r.length),r.length):(0,_.sprintf)((0,_._n)("Moved %d block to clipboard.","Moved %d blocks to clipboard.",r.length),r.length);n(l,{type:"snackbar"})}),[])}function rh(){const{getBlocksByClientId:e,getSelectedBlockClientIds:t,hasMultiSelection:n,getSettings:o,__unstableIsFullySelected:r,__unstableIsSelectionCollapsed:l,__unstableIsSelectionMergeable:i,__unstableGetSelectedBlocksWithPartialSelection:s,canInsertBlockType:c}=(0,g.useSelect)(To),{flashBlock:u,removeBlocks:d,replaceBlocks:p,__unstableDeleteSelection:f,__unstableExpandSelection:h,insertBlocks:v}=(0,g.useDispatch)(To),b=oh();return(0,m.useRefEffect)((m=>{function g(g){const k=t();if(0===k.length)return;if(!n()){const{target:e}=g,{ownerDocument:t}=e;if("copy"===g.type||"cut"===g.type?(0,Ri.documentHasUncollapsedSelection)(t):(0,Ri.documentHasSelection)(t))return}if(!m.contains(g.target.ownerDocument.activeElement))return;const _=g.defaultPrevented;g.preventDefault();const y=i(),E=l()||r(),C=!E&&!y;if("copy"===g.type||"cut"===g.type)if(1===k.length&&u(k[0]),C)h();else{let t;if(b(g.type,k),E)t=e(k);else{const[n,o]=s();t=[n,...e(k.slice(1,k.length-1)),o]}const n=g.clipboardData.getData("__unstableWrapperBlockName");n&&(t=(0,a.createBlock)(n,JSON.parse(g.clipboardData.getData("__unstableWrapperBlockAttributes")),t));const o=(0,a.serialize)(t);g.clipboardData.setData("text/plain",function(e){e=e.replace(/
/g,"\n");return(0,Ri.__unstableStripHTML)(e).trim().replace(/\n\n+/g,"\n\n")}(o)),g.clipboardData.setData("text/html",o)}if("cut"===g.type)E&&!C?d(k):f();else if("paste"===g.type){if(_)return;const{__experimentalCanUserUseUnfilteredHTML:e}=o(),{plainText:t,html:n,files:r}=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,Ri.getFilesFromDataTransfer)(t);return r.length&&!nh(r,o)?{files:r}:{html:o,plainText:n,files:[]}}(g);let l=[];if(r.length){const e=(0,a.getBlockTransforms)("from");l=r.reduce(((t,n)=>{const o=(0,a.findTransform)(e,(e=>"files"===e.type&&e.isMatch([n])));return o&&t.push(o.transform([n])),t}),[]).flat()}else l=(0,a.pasteHandler)({HTML:n,plainText:t,mode:"BLOCKS",canUserUseUnfilteredHTML:e});if(1===k.length){const[e]=k;if(l.every((t=>c(t.name,e))))return void v(l,void 0,e)}p(k,l,l.length-1,-1)}}return m.ownerDocument.addEventListener("copy",g),m.ownerDocument.addEventListener("cut",g),m.ownerDocument.addEventListener("paste",g),()=>{m.ownerDocument.removeEventListener("copy",g),m.ownerDocument.removeEventListener("cut",g),m.ownerDocument.removeEventListener("paste",g)}}),[])}var lh=function(e){let{children:t}=e;return(0,u.createElement)("div",{ref:rh()},t)};const ih="align",ah="__experimentalBorder",sh="color",ch="customClassName",uh="typography.__experimentalFontFamily",dh="typography.fontSize",ph="__experimentalLayout",mh=[...["typography.lineHeight",dh,"typography.__experimentalFontStyle","typography.__experimentalFontWeight",uh,"typography.__experimentalTextDecoration","typography.__experimentalTextTransform","typography.__experimentalLetterSpacing"],ah,sh,"spacing"];const gh={align:e=>(0,a.hasBlockSupport)(e,ih),borderColor:e=>function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"any";if("web"!==u.Platform.OS)return!1;const n=(0,a.getBlockSupport)(e,ah);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]))}(e,"color"),backgroundColor:e=>{const t=(0,a.getBlockSupport)(e,sh);return t&&!1!==t.background},textColor:e=>{const t=(0,a.getBlockSupport)(e,sh);return t&&!1!==t.text},gradient:e=>{const t=(0,a.getBlockSupport)(e,sh);return null!==t&&"object"==typeof t&&!!t.gradients},className:e=>(0,a.hasBlockSupport)(e,ch,!0),fontFamily:e=>(0,a.hasBlockSupport)(e,uh),fontSize:e=>(0,a.hasBlockSupport)(e,dh),layout:e=>(0,a.hasBlockSupport)(e,ph),style:e=>mh.some((t=>(0,a.hasBlockSupport)(e,t)))};function fh(e,t){return Object.entries(gh).reduce(((n,o)=>{let[r,l]=o;return l(e.name)&&l(t.name)&&(n[r]=e.attributes[r]),n}),{})}function hh(e,t,n){for(let o=0;o{let i="";try{if(!window.navigator.clipboard)return void r((0,_.__)("Unable to paste styles. This feature is only available on secure (https) sites in supporting browsers."),{type:"snackbar"});i=await window.navigator.clipboard.readText()}catch(e){return void r((0,_.__)("Unable to paste styles. Please allow browser clipboard permissions before continuing."),{type:"snackbar"})}if(!i||!function(e){try{const t=(0,a.parse)(e,{__unstableSkipMigrationLogs:!0,__unstableSkipAutop:!0});return 1!==t.length||"core/freeform"!==t[0].name}catch(e){return!1}}(i))return void o((0,_.__)("Unable to paste styles. Block styles couldn't be found within the copied content."),{type:"snackbar"});const s=(0,a.parse)(i);if(1===s.length?e.batch((()=>{hh(l,l.map((()=>s[0])),t)})):e.batch((()=>{hh(l,s,t)})),1===l.length){var c;const e=null===(c=(0,a.getBlockType)(l[0].name))||void 0===c?void 0:c.title;n((0,_.sprintf)((0,_.__)("Pasted styles to %s."),e),{type:"snackbar"})}else n((0,_.sprintf)((0,_.__)("Pasted styles to %d blocks."),l.length),{type:"snackbar"})}),[e.batch,t,n,o,r])}function bh(e){let{clientIds:t,children:n,__experimentalUpdateSelection:o}=e;const{canInsertBlockType:r,getBlockRootClientId:l,getBlocksByClientId:i,canMoveBlocks:s,canRemoveBlocks:c}=(0,g.useSelect)(To),{getDefaultBlockName:u,getGroupingBlockName:d}=(0,g.useSelect)(a.store),p=i(t),m=l(t[0]),f=p.every((e=>!!e&&(0,a.hasBlockSupport)(e.name,"multiple",!0)&&r(e.name,m))),h=r(u(),m),v=s(t,m),b=c(t,m),{removeBlocks:k,replaceBlocks:_,duplicateBlocks:y,insertAfterBlock:E,insertBeforeBlock:C,flashBlock:S,setBlockMovingClientId:w,setNavigationMode:B,selectBlock:I}=(0,g.useDispatch)(To),x=oh(),T=vh();return n({canDuplicate:f,canInsertDefaultBlock:h,canMove:v,canRemove:b,rootClientId:m,blocks:p,onDuplicate(){return y(t,o)},onRemove(){return k(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]),w(t[0])},onGroup(){if(!p.length)return;const e=d(),n=(0,a.switchToBlockType)(p,e);n&&_(t,n)},onUngroup(){if(!p.length)return;const e=p[0].innerBlocks;e.length&&_(t,e)},onCopy(){const e=p.map((e=>{let{clientId:t}=e;return t}));1===p.length&&S(e[0]),x("copy",e)},async onPasteStyles(){await T(p)}})}const kh=()=>{};var _h=(0,m.compose)([(0,g.withSelect)(((e,t)=>{let{clientId:n}=t;const{getBlock:o,getBlockMode:r,getSettings:l}=e(To),i=o(n),s=l().codeEditingEnabled;return{mode:r(n),blockType:i?(0,a.getBlockType)(i.name):null,isCodeEditingEnabled:s}})),(0,g.withDispatch)(((e,t)=>{let{onToggle:n=kh,clientId:o}=t;return{onToggleMode(){e(To).toggleBlockMode(o),n()}}}))])((function(e){let{blockType:t,mode:n,onToggleMode:o,small:r=!1,isCodeEditingEnabled:l=!0}=e;if(!t||!(0,a.hasBlockSupport)(t,"html",!0)||!l)return null;const i="visual"===n?(0,_.__)("Edit as HTML"):(0,_.__)("Edit visually");return(0,u.createElement)(h.MenuItem,{onClick:o},!r&&i)}));var yh=(0,m.compose)((0,g.withSelect)(((e,t)=>{let{clientId:n}=t;const o=e(To).getBlock(n);return{block:o,shouldRender:o&&"core/html"===o.name}})),(0,g.withDispatch)(((e,t)=>{let{block:n}=t;return{onClick:()=>e(To).replaceBlocks(n.clientId,(0,a.rawHandler)({HTML:(0,a.getBlockContent)(n)}))}})))((function(e){let{shouldRender:t,onClick:n,small:o}=e;if(!t)return null;const r=(0,_.__)("Convert to Blocks");return(0,u.createElement)(h.MenuItem,{onClick:n},!o&&r)}));const{Fill:Eh,Slot:Ch}=(0,h.createSlotFill)("__unstableBlockSettingsMenuFirstItem");Eh.Slot=Ch;var Sh=Eh;function wh(){const{clientIds:e,isGroupable:t,isUngroupable:n,blocksSelection:o,groupingBlockName:r}=(0,g.useSelect)((e=>{var t;const{getBlockRootClientId:n,getBlocksByClientId:o,canInsertBlockType:r,getSelectedBlockClientIds:l}=e(To),{getGroupingBlockName:i}=e(a.store),s=l(),c=i(),u=r(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:r}}function Bh(e){let{clientIds:t,isGroupable:n,isUngroupable:o,blocksSelection:r,groupingBlockName:l,onClose:i=(()=>{})}=e;const{replaceBlocks:s}=(0,g.useDispatch)(To);return n||o?(0,u.createElement)(u.Fragment,null,n&&(0,u.createElement)(h.MenuItem,{onClick:()=>{(()=>{const e=(0,a.switchToBlockType)(r,l);e&&s(t,e)})(),i()}},(0,_._x)("Group","verb")),o&&(0,u.createElement)(h.MenuItem,{onClick:()=>{(()=>{const e=r[0].innerBlocks;e.length&&s(t,e)})(),i()}},(0,_._x)("Ungroup","Ungrouping blocks from within a Group block back into individual blocks within the Editor "))):null}function Ih(e){return(0,g.useSelect)((t=>{const{canEditBlock:n,canMoveBlock:o,canRemoveBlock:r,canLockBlockType:l,getBlockName:i,getBlockRootClientId:a,getTemplateLock:s}=t(To),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 xh=(0,u.createElement)(G.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,u.createElement)(G.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 Th=(0,u.createElement)(G.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,u.createElement)(G.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-1zM9.8 7c0-1.2 1-2.2 2.2-2.2 1.2 0 2.2 1 2.2 2.2v3H9.8V7zm6.7 11.5h-9v-7h9v7z"}));var Mh=(0,u.createElement)(G.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,u.createElement)(G.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"}));const Nh=["core/block","core/navigation"];function Ph(e){return e.remove&&e.move?"all":!(!e.remove||e.move)&&"insert"}function Lh(e){let{clientId:t,onClose:n}=e;const[o,r]=(0,u.useState)({move:!1,remove:!1}),{canEdit:l,canMove:i,canRemove:s}=Ih(t),{allowsEditLocking:c,templateLock:d,hasTemplateLock:p}=(0,g.useSelect)((e=>{var n,o;const{getBlockName:r,getBlockAttributes:l}=e(To),i=r(t),s=(0,a.getBlockType)(i);return{allowsEditLocking:Nh.includes(i),templateLock:null===(n=l(t))||void 0===n?void 0:n.templateLock,hasTemplateLock:!(null==s||null===(o=s.attributes)||void 0===o||!o.templateLock)}}),[t]),[f,v]=(0,u.useState)(!!d),{updateBlockAttributes:b}=(0,g.useDispatch)(To),k=rf(t),y=(0,m.useInstanceId)(Lh,"block-editor-block-lock-modal__options-title");(0,u.useEffect)((()=>{r({move:!i,remove:!s,...c?{edit:!l}:{}})}),[l,i,s,c]);const E=Object.values(o).every(Boolean),C=Object.values(o).some(Boolean)&&!E;return(0,u.createElement)(h.Modal,{title:(0,_.sprintf)((0,_.__)("Lock %s"),k.title),overlayClassName:"block-editor-block-lock-modal",onRequestClose:n},(0,u.createElement)("p",null,(0,_.__)("Choose specific attributes to restrict or lock all available options.")),(0,u.createElement)("form",{onSubmit:e=>{e.preventDefault(),b([t],{lock:o,templateLock:f?Ph(o):void 0}),n()}},(0,u.createElement)("div",{role:"group","aria-labelledby":y,className:"block-editor-block-lock-modal__options"},(0,u.createElement)(h.CheckboxControl,{__nextHasNoMarginBottom:!0,className:"block-editor-block-lock-modal__options-title",label:(0,u.createElement)("span",{id:y},(0,_.__)("Lock all")),checked:E,indeterminate:C,onChange:e=>r({move:e,remove:e,...c?{edit:e}:{}})}),(0,u.createElement)("ul",{className:"block-editor-block-lock-modal__checklist"},c&&(0,u.createElement)("li",{className:"block-editor-block-lock-modal__checklist-item"},(0,u.createElement)(h.CheckboxControl,{__nextHasNoMarginBottom:!0,label:(0,_.__)("Restrict editing"),checked:!!o.edit,onChange:e=>r((t=>({...t,edit:e})))}),(0,u.createElement)(h.Icon,{className:"block-editor-block-lock-modal__lock-icon",icon:o.edit?Mh:xh})),(0,u.createElement)("li",{className:"block-editor-block-lock-modal__checklist-item"},(0,u.createElement)(h.CheckboxControl,{__nextHasNoMarginBottom:!0,label:(0,_.__)("Disable movement"),checked:o.move,onChange:e=>r((t=>({...t,move:e})))}),(0,u.createElement)(h.Icon,{className:"block-editor-block-lock-modal__lock-icon",icon:o.move?Mh:xh})),(0,u.createElement)("li",{className:"block-editor-block-lock-modal__checklist-item"},(0,u.createElement)(h.CheckboxControl,{__nextHasNoMarginBottom:!0,label:(0,_.__)("Prevent removal"),checked:o.remove,onChange:e=>r((t=>({...t,remove:e})))}),(0,u.createElement)(h.Icon,{className:"block-editor-block-lock-modal__lock-icon",icon:o.remove?Mh:xh}))),p&&(0,u.createElement)(h.ToggleControl,{className:"block-editor-block-lock-modal__template-lock",label:(0,_.__)("Apply to all blocks inside"),checked:f,disabled:o.move&&!o.remove,onChange:()=>v(!f)})),(0,u.createElement)(h.Flex,{className:"block-editor-block-lock-modal__actions",justify:"flex-end",expanded:!1},(0,u.createElement)(h.FlexItem,null,(0,u.createElement)(h.Button,{variant:"tertiary",onClick:n},(0,_.__)("Cancel"))),(0,u.createElement)(h.FlexItem,null,(0,u.createElement)(h.Button,{variant:"primary",type:"submit"},(0,_.__)("Apply"))))))}function Rh(e){let{clientId:t}=e;const{canLock:n,isLocked:o}=Ih(t),[r,l]=(0,u.useReducer)((e=>!e),!1);if(!n)return null;const i=o?(0,_.__)("Unlock"):(0,_.__)("Lock");return(0,u.createElement)(u.Fragment,null,(0,u.createElement)(h.MenuItem,{icon:o?xh:Th,onClick:l},i),r&&(0,u.createElement)(Lh,{clientId:t,onClose:l}))}const{Fill:Ah,Slot:Oh}=(0,h.createSlotFill)("BlockSettingsMenuControls");function Dh(e){let{...t}=e;return(0,u.createElement)(h.__experimentalStyleProvider,{document:document},(0,u.createElement)(Ah,t))}Dh.Slot=e=>{let{fillProps:t,clientIds:n=null,__unstableDisplayLocation:o}=e;const{selectedBlocks:r,selectedClientIds:l,canRemove:i}=(0,g.useSelect)((e=>{const{getBlockNamesByClientId:t,getSelectedBlockClientIds:o,canRemoveBlocks:r}=e(To),l=null!==n?n:o();return{selectedBlocks:t(l),selectedClientIds:l,canRemove:r(l)}}),[n]),{canLock:a}=Ih(l[0]),s=1===l.length&&a,d=wh(),{isGroupable:p,isUngroupable:m}=d,f=(p||m)&&i;return(0,u.createElement)(Oh,{fillProps:{...t,__unstableDisplayLocation:o,selectedBlocks:r,selectedClientIds:l}},(e=>!(null!=e&&e.length)>0&&!f&&!s?null:(0,u.createElement)(h.MenuGroup,null,s&&(0,u.createElement)(Rh,{clientId:l[0]}),e,f&&(0,u.createElement)(Bh,c({},d,{onClose:null==t?void 0:t.onClose})))))};var zh=Dh;const Fh=()=>{},Vh={className:"block-editor-block-settings-menu__popover",position:"bottom right",variant:"toolbar"};function Hh(e){let{blocks:t,onCopy:n,label:o}=e;const r=(0,m.useCopyToClipboard)((()=>(0,a.serialize)(t)),n),l=t.length>1?(0,_.__)("Copy blocks"):(0,_.__)("Copy block"),i=o||l;return(0,u.createElement)(h.MenuItem,{ref:r},i)}var Gh=function(e){let{clientIds:t,__experimentalSelectBlock:n,children:o,__unstableDisplayLocation:r,...l}=e;const i=Array.isArray(t)?t:[t],s=i.length,d=i[0],{firstParentClientId:p,isDistractionFree:f,onlyBlock:v,parentBlockType:b,previousBlockClientId:k,nextBlockClientId:y,selectedBlockClientIds:E}=(0,g.useSelect)((e=>{const{getBlockCount:t,getBlockName:n,getBlockRootClientId:o,getPreviousBlockClientId:r,getNextBlockClientId:l,getSelectedBlockClientIds:i,getSettings:s,getBlockAttributes:c}=e(To),{getActiveBlockVariation:u}=e(a.store),p=o(d),m=p&&n(p);return{firstParentClientId:p,isDistractionFree:s().isDistractionFree,onlyBlock:1===t(p),parentBlockType:p&&(u(m,c(p))||(0,a.getBlockType)(m)),previousBlockClientId:r(d),nextBlockClientId:l(d),selectedBlockClientIds:i()}}),[d]),C=(0,g.useSelect)((e=>{const{getShortcutRepresentation:t}=e(xd.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:S,toggleBlockHighlight:w}=(0,g.useDispatch)(To),B=(0,u.useCallback)(n?async e=>{const t=await e;t&&t[0]&&n(t[0])}:Fh,[n]),I=lf({clientId:d,maximumLength:25}),x=(0,u.useCallback)(n?()=>{const e=k||y||p;e&&E.includes(d)&&!E.includes(e)&&n(e)}:Fh,[n,k,y,p,E]),T=(0,_.sprintf)((0,_.__)("Remove %s"),I),M=1===s?T:(0,_.__)("Remove blocks"),N=(0,u.useRef)(),{gestures:P}=xf({ref:N,onChange(e){e&&f||w(p,e)}}),L=null==E?void 0:E.includes(p);return(0,u.createElement)(bh,{clientIds:t,__experimentalUpdateSelection:!n},(e=>{let{canDuplicate:n,canInsertDefaultBlock:i,canMove:a,canRemove:g,onDuplicate:f,onInsertAfter:k,onInsertBefore:y,onRemove:E,onCopy:w,onPasteStyles:I,onMoveTo:T,blocks:R}=e;return(0,u.createElement)(h.DropdownMenu,c({icon:sg,label:(0,_.__)("Options"),className:"block-editor-block-settings-menu",popoverProps:Vh,noIcons:!0},l),(e=>{let{onClose:l}=e;return(0,u.createElement)(u.Fragment,null,(0,u.createElement)(h.MenuGroup,null,(0,u.createElement)(Sh.Slot,{fillProps:{onClose:l}}),!L&&!!p&&(0,u.createElement)(h.MenuItem,c({},P,{ref:N,icon:(0,u.createElement)(fd,{icon:b.icon}),onClick:()=>S(p)}),(0,_.sprintf)((0,_.__)("Select parent block (%s)"),b.title)),1===s&&(0,u.createElement)(yh,{clientId:d}),(0,u.createElement)(Hh,{blocks:R,onCopy:w}),n&&(0,u.createElement)(h.MenuItem,{onClick:(0,m.pipe)(l,f,B),shortcut:C.duplicate},(0,_.__)("Duplicate")),i&&(0,u.createElement)(u.Fragment,null,(0,u.createElement)(h.MenuItem,{onClick:(0,m.pipe)(l,y),shortcut:C.insertBefore},(0,_.__)("Insert before")),(0,u.createElement)(h.MenuItem,{onClick:(0,m.pipe)(l,k),shortcut:C.insertAfter},(0,_.__)("Insert after"))),a&&!v&&(0,u.createElement)(h.MenuItem,{onClick:(0,m.pipe)(l,T)},(0,_.__)("Move to")),1===s&&(0,u.createElement)(_h,{clientId:d,onToggle:l})),(0,u.createElement)(h.MenuGroup,null,(0,u.createElement)(Hh,{blocks:R,onCopy:w,label:(0,_.__)("Copy styles")}),(0,u.createElement)(h.MenuItem,{onClick:I},(0,_.__)("Paste styles"))),(0,u.createElement)(zh.Slot,{fillProps:{onClose:l},clientIds:t,__unstableDisplayLocation:r}),"function"==typeof o?o({onClose:l}):u.Children.map((e=>(0,u.cloneElement)(e,{onClose:l}))),g&&(0,u.createElement)(h.MenuGroup,null,(0,u.createElement)(h.MenuItem,{onClick:(0,m.pipe)(l,E,x),shortcut:C.remove},M)))}))}))};var Uh=function(e){let{clientIds:t,...n}=e;return(0,u.createElement)(h.ToolbarGroup,null,(0,u.createElement)(h.ToolbarItem,null,(e=>(0,u.createElement)(Gh,c({clientIds:t,toggleProps:e},n)))))};function $h(e){let{clientId:t}=e;const n=rf(t),{canEdit:o,canMove:r,canRemove:l,canLock:i}=Ih(t),[a,s]=(0,u.useReducer)((e=>!e),!1);return i?o&&r&&l?null:(0,u.createElement)(u.Fragment,null,(0,u.createElement)(h.ToolbarGroup,{className:"block-editor-block-lock-toolbar"},(0,u.createElement)(h.ToolbarButton,{icon:Mh,label:(0,_.sprintf)((0,_.__)("Unlock %s"),n.title),onClick:s})),a&&(0,u.createElement)(Lh,{clientId:t,onClose:s})):null}var jh=(0,u.createElement)(G.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,u.createElement)(G.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 Wh=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.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 Kh=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.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 qh={group:{type:"constrained"},row:{type:"flex",flexWrap:"nowrap"},stack:{type:"flex",orientation:"vertical"}};var Yh=function(){const{blocksSelection:e,clientIds:t,groupingBlockName:n,isGroupable:o}=wh(),{replaceBlocks:r}=(0,g.useDispatch)(To),{canRemove:l,variations:i}=(0,g.useSelect)((e=>{const{canRemoveBlocks:o}=e(To),{getBlockVariations:r}=e(a.store);return{canRemove:o(t),variations:r(n,"transform")}}),[t,n]),s=o=>{const l=(0,a.switchToBlockType)(e,n);"string"!=typeof o&&(o="group"),l&&l.length>0&&(l[0].attributes.layout=qh[o],r(t,l))};if(!o||!l)return null;const c=!!i.find((e=>{let{name:t}=e;return"group-row"===t})),d=!!i.find((e=>{let{name:t}=e;return"group-stack"===t}));return(0,u.createElement)(h.ToolbarGroup,null,(0,u.createElement)(h.ToolbarButton,{icon:jh,label:(0,_._x)("Group","verb"),onClick:s}),c&&(0,u.createElement)(h.ToolbarButton,{icon:Wh,label:(0,_._x)("Row","single horizontal line"),onClick:()=>s("row")}),d&&(0,u.createElement)(h.ToolbarButton,{icon:Kh,label:(0,_._x)("Stack","verb"),onClick:()=>s("stack")}))};function Zh(e){let{clientIds:t}=e;const n=1===t.length?t[0]:void 0,o=(0,g.useSelect)((e=>!!n&&"html"===e(To).getBlockMode(n)),[n]),{toggleBlockMode:r}=(0,g.useDispatch)(To);return o?(0,u.createElement)(h.ToolbarGroup,null,(0,u.createElement)(h.ToolbarButton,{onClick:()=>{r(n)}},(0,_.__)("Edit visually"))):null}var Qh=(0,u.createContext)("");var Xh=e=>{let{hideDragHandle:t}=e;const{blockClientIds:n,blockClientId:o,blockType:r,hasFixedToolbar:l,isDistractionFree:i,isValid:s,isVisual:d,isContentLocked:f}=(0,g.useSelect)((e=>{const{getBlockName:t,getBlockMode:n,getSelectedBlockClientIds:o,isBlockValid:r,getBlockRootClientId:l,getSettings:i,__unstableGetContentLockingParent:s}=e(To),c=o(),u=c[0],d=l(u),p=i();return{blockClientIds:c,blockClientId:u,blockType:u&&(0,a.getBlockType)(t(u)),hasFixedToolbar:p.hasFixedToolbar,isDistractionFree:p.isDistractionFree,rootClientId:d,isValid:c.every((e=>r(e))),isVisual:c.every((e=>"visual"===n(e))),isContentLocked:!!s(u)}}),[]),{toggleBlockHighlight:v}=(0,g.useDispatch)(To),b=(0,u.useRef)(),{showMovers:k,gestures:_}=xf({ref:b,onChange(e){e&&i||v(o,e)}}),y=(0,m.useViewportMatch)("medium","<")||l;if(r&&!(0,a.hasBlockSupport)(r,"__experimentalToolbar",!0))return null;const E=y||k;if(0===n.length)return null;const C=s&&d,S=n.length>1,w=(0,a.isReusableBlock)(r)||(0,a.isTemplatePart)(r),B=p()("block-editor-block-toolbar",{"is-showing-movers":E,"is-synced":w});return(0,u.createElement)("div",{className:B},!S&&!y&&!f&&(0,u.createElement)(Tf,null),(0,u.createElement)("div",c({ref:b},_),(C||S)&&!f&&(0,u.createElement)(h.ToolbarGroup,{className:"block-editor-block-toolbar__block-controls"},(0,u.createElement)(Xf,{clientIds:n}),!S&&(0,u.createElement)($h,{clientId:n[0]}),(0,u.createElement)(bf,{clientIds:n,hideDragHandle:t}))),C&&S&&(0,u.createElement)(Yh,null),C&&(0,u.createElement)(u.Fragment,null,(0,u.createElement)(Vo.Slot,{group:"parent",className:"block-editor-block-toolbar__slot"}),(0,u.createElement)(Vo.Slot,{group:"block",className:"block-editor-block-toolbar__slot"}),(0,u.createElement)(Vo.Slot,{className:"block-editor-block-toolbar__slot"}),(0,u.createElement)(Vo.Slot,{group:"inline",className:"block-editor-block-toolbar__slot"}),(0,u.createElement)(Vo.Slot,{group:"other",className:"block-editor-block-toolbar__slot"}),(0,u.createElement)(Qh.Provider,{value:null==r?void 0:r.name},(0,u.createElement)(th.Slot,null))),(0,u.createElement)(Zh,{clientIds:n}),!f&&(0,u.createElement)(Uh,{clientIds:n}))};var Jh=function(e){let{focusOnMount:t,isFixed:n,...o}=e;const{blockType:r,hasParents:l,showParentSelector:i}=(0,g.useSelect)((e=>{const{getBlockName:t,getBlockParents:n,getSelectedBlockClientIds:o,__unstableGetContentLockingParent:r}=e(To),{getBlockType:l}=e(a.store),i=o(),s=i[0],c=n(s),u=l(t(c[c.length-1]));return{blockType:s&&l(t(s)),hasParents:c.length,showParentSelector:u&&(0,a.hasBlockSupport)(u,"__experimentalParentSelector",!0)&&i.length<=1&&!r(s)}}),[]);if(r&&!(0,a.hasBlockSupport)(r,"__experimentalToolbar",!0))return null;const s=p()("block-editor-block-contextual-toolbar",{"has-parent":l&&i,"is-fixed":n});return(0,u.createElement)(Ef,c({focusOnMount:t,className:s,"aria-label":(0,_.__)("Block tools")},o),(0,u.createElement)(Xh,{hideDragHandle:n}))};const{CustomSelectControl:ev}=Io(h.privateApis),tv="position",nv="block-editor-hooks__position-selection__select-control__option",ov={key:"default",value:"",name:(0,_.__)("Default"),className:nv},rv={key:"sticky",value:"sticky",name:(0,_.__)("Sticky"),className:nv,__experimentalHint:(0,_.__)("The block will stick to the top of the window instead of scrolling.")},lv={key:"fixed",value:"fixed",name:(0,_.__)("Fixed"),className:nv,__experimentalHint:(0,_.__)("The block will not move when the page is scrolled.")},iv=["top","right","bottom","left"],av=["sticky","fixed"];function sv(e){return!!(0,a.getBlockSupport)(e,tv)}function cv(e){var t,n;const o=null===(t=e.style)||void 0===t||null===(n=t.position)||void 0===n?void 0:n.type;return"sticky"===o||"fixed"===o}function uv(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=fr("position.fixed"),n=fr("position.sticky"),o=!t&&!n;return!sv(e)||o}function dv(e){var t;const{attributes:{style:n={}},clientId:o,name:r,setAttributes:l}=e,i=function(e){const t=(0,a.getBlockSupport)(e,tv);return!!(!0===t||null!=t&&t.fixed)}(r),s=function(e){const t=(0,a.getBlockSupport)(e,tv);return!!(!0===t||null!=t&&t.sticky)}(r),c=null==n||null===(t=n.position)||void 0===t?void 0:t.type,{hasParents:d}=(0,g.useSelect)((e=>{const{getBlockParents:t}=e(To);return{hasParents:t(o).length}}),[o]),p=(0,u.useMemo)((()=>{const e=[ov];return(s&&!d||c===rv.value)&&e.push(rv),(i||c===lv.value)&&e.push(lv),e}),[i,s,d,c]),m=c&&p.find((e=>e.value===c))||ov;return u.Platform.select({web:p.length>1?(0,u.createElement)(jr,{group:"position"},(0,u.createElement)(h.BaseControl,{className:"block-editor-hooks__position-selection"},(0,u.createElement)(ev,{__nextUnconstrainedWidth:!0,__next36pxDefaultSize:!0,className:"block-editor-hooks__position-selection__select-control",label:(0,_.__)("Position"),hideLabelFromVision:!0,describedBy:(0,_.sprintf)((0,_.__)("Currently selected position: %s"),m.name),options:p,value:m,__experimentalShowSelectedHint:!0,onChange:e=>{let{selectedItem:t}=e;(e=>{const t={...n,position:{...null==n?void 0:n.position,type:e,top:"sticky"===e||"fixed"===e?"0px":void 0}};l({style:Ar(t)})})(t.value)},size:"__unstable-large"}))):null,native:null})}const pv=(0,m.createHigherOrderComponent)((e=>t=>{const{name:n}=t;return[(0,a.hasBlockSupport)(n,tv)&&!uv(t)&&(0,u.createElement)(dv,c({key:"position"},t)),(0,u.createElement)(e,c({key:"edit"},t))]}),"withInspectorControls"),mv=(0,m.createHigherOrderComponent)((e=>t=>{var n,o,r,l;const{name:i,attributes:s}=t,d=(0,a.hasBlockSupport)(i,tv)&&!uv(t),g=(0,m.useInstanceId)(e),f=(0,u.useContext)(Wv.__unstableElementContext);let h;d&&(h=function(e){let{selector:t,style:n}=e,o="";const{type:r}=(null==n?void 0:n.position)||{};return av.includes(r)?(o+=`${t} {`,o+=`position: ${r};`,iv.forEach((e=>{var t;void 0!==(null==n||null===(t=n.position)||void 0===t?void 0:t[e])&&(o+=`${e}: ${n.position[e]};`)})),"sticky"!==r&&"fixed"!==r||(o+="z-index: 10"),o+="}",o):o}({selector:`.wp-container-${g}.wp-container-${g}`,style:null==s?void 0:s.style})||"");const v=p()(null==t?void 0:t.className,{[`wp-container-${g}`]:d&&!!h,[`is-position-${null==s||null===(n=s.style)||void 0===n||null===(o=n.position)||void 0===o?void 0:o.type}`]:d&&!!h&&!(null==s||null===(r=s.style)||void 0===r||null===(l=r.position)||void 0===l||!l.type)});return(0,u.createElement)(u.Fragment,null,d&&f&&!!h&&(0,u.createPortal)((0,u.createElement)("style",null,h),f),(0,u.createElement)(e,c({},t,{className:v})))}));(0,s.addFilter)("editor.BlockListBlock","core/editor/position/with-position-styles",mv),(0,s.addFilter)("editor.BlockEdit","core/editor/position/with-inspector-controls",pv);const gv={placement:"top-start"},fv={...gv,flip:!1,shift:!0},hv={...gv,flip:!0,shift:!1};function vv(e,t,n,o,r){if(!e||!t)return fv;const l=(null==n?void 0:n.scrollTop)||0,i=t.getBoundingClientRect(),a=l+e.getBoundingClientRect().top,s=e.ownerDocument.documentElement.clientHeight,c=a+o,u=i.top>c,d=i.height>s-o;return r||!u&&!d?hv:fv}function bv(e){const{__unstableGetEditorMode:t,isMultiSelecting:n,hasMultiSelection:o,isTyping:r,isBlockInterfaceHidden:l,getSettings:i,getLastMultiSelectedBlockClientId:a}=Io(e(To));return{editorMode:t(),hasMultiSelection:o(),isMultiSelecting:n(),isTyping:r(),isBlockInterfaceHidden:l(),hasFixedToolbar:i().hasFixedToolbar,isDistractionFree:i().isDistractionFree,lastClientId:o()?a():null}}function kv(e){let{clientId:t,rootClientId:n,isEmptyDefaultBlock:o,showContents:r,capturingClientId:l,__unstablePopoverSlot:i,__unstableContentRef:a}=e;const{editorMode:s,hasMultiSelection:d,isMultiSelecting:f,isTyping:h,isBlockInterfaceHidden:v,hasFixedToolbar:b,isDistractionFree:k,lastClientId:_}=(0,g.useSelect)(bv,[]),y=(0,g.useSelect)((e=>{const{isBlockInsertionPointVisible:n,getBlockInsertionPoint:o,getBlockOrder:r}=e(To);if(!n())return!1;const l=o();return r(l.rootClientId)[l.index]===t}),[t]),E=(0,m.useViewportMatch)("medium"),C=(0,u.useRef)(!1),{stopTyping:S}=(0,g.useDispatch)(To),w=!h&&"edit"===s&&o,B=!d&&("navigation"===s||"zoom-out"===s),I="edit"===s&&!b&&E&&!f&&!w&&!h&&!v,x=!("edit"!==s||I||b||k||o);(0,xd.useShortcut)("core/block-editor/focus-toolbar",(()=>{C.current=!0,S(!0)}),{isDisabled:!x}),(0,u.useEffect)((()=>{C.current=!1}));const T=(0,u.useRef)(),M=function(e){let{contentElement:t,clientId:n}=e;const o=tr(n),[r,l]=(0,u.useState)(0),{blockIndex:i,isSticky:a}=(0,g.useSelect)((e=>{const{getBlockIndex:t,getBlockAttributes:o}=e(To);return{blockIndex:t(n),isSticky:cv(o(n))}}),[n]),s=(0,u.useMemo)((()=>{if(t)return(0,Ri.getScrollContainer)(t)}),[t]),[c,d]=(0,u.useState)((()=>vv(t,o,s,r,a))),p=(0,m.useRefEffect)((e=>{l(e.offsetHeight)}),[]),f=(0,u.useCallback)((()=>d(vv(t,o,s,r,a))),[t,o,s,r]);return(0,u.useLayoutEffect)(f,[i,f]),(0,u.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",f);const a=null==o||null===(r=o.ownerDocument)||void 0===r?void 0:r.defaultView;return a.ResizeObserver&&(i=new a.ResizeObserver(f),i.observe(o)),()=>{var e;null==l||null===(e=l.removeEventHandler)||void 0===e||e.call(l,"resize",f),i&&i.disconnect()}}),[f,t,o]),{...c,ref:p}}({contentElement:null==a?void 0:a.current,clientId:t});return w?(0,u.createElement)(Zr,c({clientId:l||t,__unstableCoverTarget:!0,bottomClientId:_,className:p()("block-editor-block-list__block-side-inserter-popover",{"is-insertion-point-visible":y}),__unstablePopoverSlot:i,__unstableContentRef:a,resize:!1,shift:!1},M),(0,u.createElement)("div",{className:"block-editor-block-list__empty-block-inserter"},(0,u.createElement)(Hg,{position:"bottom right",rootClientId:n,clientId:t,__experimentalIsQuick:!0}))):B||I?(0,u.createElement)(Zr,c({clientId:l||t,bottomClientId:_,className:p()("block-editor-block-list__block-popover",{"is-insertion-point-visible":y}),__unstablePopoverSlot:i,__unstableContentRef:a,resize:!1},M),I&&r&&(0,u.createElement)(Jh,{focusOnMount:C.current,__experimentalInitialIndex:T.current,__experimentalOnIndexChange:e=>{T.current=e},key:t}),B&&(0,u.createElement)(kf,{clientId:t,rootClientId:n})):null}function _v(e){const{getSelectedBlockClientId:t,getFirstMultiSelectedBlockClientId:n,getBlockRootClientId:o,getBlock:r,getBlockParents:l,getSettings:i,isNavigationMode:s,__experimentalGetBlockListSettingsForBlocks:c}=e(To),u=t()||n();if(!u)return;const{name:d,attributes:p={}}=r(u)||{},m=l(u),g=c(m),f=m.find((e=>{var t;return null===(t=g[e])||void 0===t?void 0:t.__experimentalCaptureToolbars})),h=i();return{clientId:u,rootClientId:o(u),name:d,isDistractionFree:h.isDistractionFree,isNavigationMode:s(),isEmptyDefaultBlock:d&&(0,a.isUnmodifiedDefaultBlock)({name:d,attributes:p}),capturingClientId:f}}function yv(e){let{__unstablePopoverSlot:t,__unstableContentRef:n}=e;const o=(0,g.useSelect)(_v,[]);if(!o)return null;const{clientId:r,rootClientId:l,name:i,isEmptyDefaultBlock:a,capturingClientId:s,isDistractionFree:c,isNavigationMode:d}=o;return i?(0,u.createElement)(kv,{clientId:r,rootClientId:l,isEmptyDefaultBlock:a,showContents:!c||d,capturingClientId:s,__unstablePopoverSlot:t,__unstableContentRef:n}):null}function Ev(e){let{children:t}=e;const n=(0,u.useContext)(Xg),o=(0,u.useContext)(h.Disabled.Context);return n||o?t:(W()('wp.components.Popover.Slot name="block-toolbar"',{alternative:"wp.blockEditor.BlockTools",since:"5.8",version:"6.3"}),(0,u.createElement)(ef,{__unstablePopoverSlot:"block-toolbar"},(0,u.createElement)(yv,{__unstablePopoverSlot:"block-toolbar"}),t))}var Cv=(0,m.createHigherOrderComponent)((e=>t=>{const{clientId:n}=Ro();return(0,u.createElement)(e,c({},t,{clientId:n}))}),"withClientId");var Sv=Cv((e=>{let{clientId:t,showSeparator:n,isFloating:o,onAddBlock:r,isToggle:l}=e;return(0,u.createElement)(jg,{className:p()({"block-list-appender__toggle":l}),rootClientId:t,showSeparator:n,isFloating:o,onAddBlock:r})}));var wv=(0,m.compose)([Cv,(0,g.withSelect)(((e,t)=>{let{clientId:n}=t;const{getBlockOrder:o}=e(To),r=o(n);return{lastBlockClientId:r[r.length-1]}}))])((e=>{let{clientId:t}=e;return(0,u.createElement)(Gg,{rootClientId:t})}));const Bv=new WeakMap;function Iv(e,t,n,o,r,l,i){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){i();const e=p.map((e=>(0,a.cloneBlock)(e)));l(e,!0,null)}if("block"===d){const l=n(u[0]);if(c===e&&l===t)return;if(u.includes(e)||o(u).some((t=>t===e)))return;const i=c===e,a=u.length;r(u,c,i&&l{if(!n)return;const i=(0,a.findTransform)((0,a.getBlockTransforms)("from"),(n=>"files"===n.type&&r(n.blockName,e)&&n.isMatch(t)));if(i){const e=i.transform(t,o);l(e)}}}function Tv(e,t,n){return e=>{const t=(0,a.pasteHandler)({HTML:e,mode:"BLOCKS"});t.length&&n(t)}}function Mv(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{operation:o="insert"}=n,r=(0,g.useSelect)((e=>e(To).getSettings().mediaUpload),[]),{canInsertBlockType:l,getBlockIndex:i,getClientIdsOfDescendants:a,getBlockOrder:s,getBlocksByClientId:c}=(0,g.useSelect)(To),{insertBlocks:d,moveBlocksToPosition:p,updateBlockAttributes:m,clearSelectedBlock:f,replaceBlocks:h,removeBlocks:v}=(0,g.useDispatch)(To),b=(0,g.useRegistry)(),k=(0,u.useCallback)((function(n){let r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;if("replace"===o){const o=s(e)[t];h(o,n,void 0,l)}else d(n,t,e,r,l)}),[o,s,d,h,t,e]),_=(0,u.useCallback)(((n,r,l)=>{if("replace"===o){const o=c(n),r=s(e)[t];b.batch((()=>{v(n,!1),h(r,o,void 0,0)}))}else p(n,r,e,l)}),[o,s,c,d,p,v,t,e]),y=Iv(e,t,i,a,_,k,f),E=xv(e,0,r,m,l,k),C=Tv(0,0,k);return e=>{const t=(0,Ri.getFilesFromDataTransfer)(e.dataTransfer),n=e.dataTransfer.getData("text/html");n?C(n):t.length?E(t):y(e)}}function Nv(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:i2&&void 0!==arguments[2]?arguments[2]:["top","bottom","left","right"];return r.forEach((r=>{const l=Nv(e,t,r);(void 0===n||l=e.x&&t.top<=e.y&&t.bottom>=e.y}function Rv(e,t){var n,o;let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"vertical";const l="horizontal"===r?["left","right"]:["top","bottom"],i=(0,_.isRTL)();let a=0,s="before",c=1/0;e.forEach((e=>{let{isUnmodifiedDefaultBlock:n,getBoundingClientRect:o,blockIndex:r}=e;const u=o();let[d,p]=Pv(t,u,l);n&&Lv(t,u)&&(d=0),d0&&void 0!==arguments[0]?arguments[0]:{};const[t,n]=(0,u.useState)({index:null,operation:"insert"}),o=(0,g.useSelect)((t=>{const{getTemplateLock:n,__unstableIsWithinBlockOverlay:o,__unstableHasActiveBlockOverlayActive:r}=t(To),l=n(e);return["all","contentOnly"].some((e=>e===l))||r(e)||o(e)}),[e]),{getBlockListSettings:r,getBlocks:l,getBlockIndex:i}=(0,g.useSelect)(To),{showInsertionPoint:s,hideInsertionPoint:c}=(0,g.useDispatch)(To),d=Mv(e,t.index,{operation:t.operation}),p=(0,m.useThrottle)((0,u.useCallback)(((t,o)=>{var c;const u=l(e);if(0===u.length)return void n({index:0,operation:"insert"});const d=u.map((e=>{const t=e.clientId;return{isUnmodifiedDefaultBlock:(0,a.isUnmodifiedDefaultBlock)(e),getBoundingClientRect:()=>o.getElementById(`block-${t}`).getBoundingClientRect(),blockIndex:i(t)}})),[p,m]=Rv(d,{x:t.clientX,y:t.clientY},null===(c=r(e))||void 0===c?void 0:c.orientation);n({index:p,operation:m}),s(e,p,{operation:m})}),[e]),200);return(0,m.__experimentalUseDropZone)({isDisabled:o,onDrop:d,onDragOver(e){p(e,e.currentTarget.ownerDocument)},onDragLeave(){p.cancel(),c()},onDragEnd(){p.cancel(),c()}})}const Ov={};function Dv(e){const{clientId:t,allowedBlocks:n,__experimentalDefaultBlock:o,__experimentalDirectInsert:r,template:l,templateLock:i,wrapperRef:s,templateInsertUpdatesSelection:c,__experimentalCaptureToolbars:d,__experimentalAppenderTagName:p,renderAppender:m,orientation:f,placeholder:h,layout:v}=e;!function(e,t,n,o,r,l,i,a){const{updateBlockListSettings:s}=(0,g.useDispatch)(To),c=(0,g.useRegistry)(),{blockListSettings:d,parentLock:p}=(0,g.useSelect)((t=>{const n=t(To).getBlockRootClientId(e);return{blockListSettings:t(To).getBlockListSettings(e),parentLock:t(To).getTemplateLock(n)}}),[e]),m=(0,u.useMemo)((()=>t),t);(0,u.useLayoutEffect)((()=>{const t={allowedBlocks:m,templateLock:void 0===r||"contentOnly"===p?p:r};if(void 0!==l&&(t.__experimentalCaptureToolbars=l),void 0!==i)t.orientation=i;else{const e=li(null==a?void 0:a.type);t.orientation=e.getOrientation(a)}void 0!==n&&(t.__experimentalDefaultBlock=n),void 0!==o&&(t.__experimentalDirectInsert=o),Kr()(d,t)||(Bv.get(c)||Bv.set(c,[]),Bv.get(c).push([e,t]),window.queueMicrotask((()=>{var e;null!==(e=Bv.get(c))&&void 0!==e&&e.length&&c.batch((()=>{Bv.get(c).forEach((e=>{s(...e)})),Bv.set(c,[])}))})))}),[e,d,m,n,o,r,p,l,i,s,a,c])}(t,n,o,r,i,d,f,v),function(e,t,n,o){const{getBlocks:r,getSelectedBlocksInitialCaretPosition:l,isBlockSelected:i}=(0,g.useSelect)(To),{replaceInnerBlocks:s,__unstableMarkNextChangeAsNotPersistent:c}=(0,g.useDispatch)(To),{innerBlocks:d}=(0,g.useSelect)((t=>({innerBlocks:t(To).getBlocks(e)})),[e]),p=(0,u.useRef)(null);(0,u.useLayoutEffect)((()=>{let u=!1;return window.queueMicrotask((()=>{if(u)return;const d=r(e),m=0===d.length||"all"===n||"contentOnly"===n,g=!k()(t,p.current);if(!m||!g)return;p.current=t;const f=(0,a.synchronizeBlocksWithTemplate)(d,t);k()(f,d)||(c(),s(e,f,0===d.length&&o&&0!==f.length&&i(e),l()))})),()=>{u=!0}}),[d,t,n,e])}(t,l,i,c);const b=function(e){return(0,g.useSelect)((t=>{const n=t(To).getBlock(e);if(!n)return;const o=t(a.store).getBlockType(n.name);return o&&0!==Object.keys(o.providesContext).length?Object.fromEntries(Object.entries(o.providesContext).map((e=>{let[t,o]=e;return[t,n.attributes[o]]}))):void 0}),[e])}(t),_=(0,g.useSelect)((e=>{var n;return null===(n=e(To).getBlock(t))||void 0===n?void 0:n.name}),[t]),y=(0,a.getBlockSupport)(_,"__experimentalLayout")||Ov,{allowSizingOnChildren:E=!1}=y,C=fr("layout")||Ov,S=v||y,w=(0,u.useMemo)((()=>({...C,...S,...E&&{allowSizingOnChildren:!0}})),[C,S,E]);return(0,u.createElement)(Oi,{value:b},(0,u.createElement)(qv,{rootClientId:t,renderAppender:m,__experimentalAppenderTagName:p,__experimentalLayout:w,wrapperRef:s,placeholder:h}))}function zv(e){return kd(e),(0,u.createElement)(Dv,e)}const Fv=(0,u.forwardRef)(((e,t)=>{const n=Vv({ref:t},e);return(0,u.createElement)("div",{className:"block-editor-inner-blocks"},(0,u.createElement)("div",n))}));function Vv(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{__unstableDisableLayoutClassNames:n,__unstableDisableDropZone:o}=t,{clientId:r,layout:l=null,__unstableLayoutClassNames:i=""}=Ro(),s=(0,m.useViewportMatch)("medium","<"),{__experimentalCaptureToolbars:d,hasOverlay:f}=(0,g.useSelect)((e=>{if(!r)return{};const{getBlockName:t,isBlockSelected:n,hasSelectedInnerBlock:o,__unstableGetEditorMode:l}=e(To),i=t(r),c="navigation"===l()||s;return{__experimentalCaptureToolbars:e(a.store).hasBlockSupport(i,"__experimentalExposeControlsToChildren",!1),hasOverlay:"core/template"!==i&&!n(r)&&!o(r,!0)&&c}}),[r,s]),h=Av({rootClientId:r}),v=(0,m.useMergeRefs)([e.ref,o?null:h]),b={__experimentalCaptureToolbars:d,layout:l,...t},k=b.value&&b.onChange?zv:Dv;return{...e,ref:v,className:p()(e.className,"block-editor-block-list__layout",n?"":i,{"has-overlay":f}),children:r?(0,u.createElement)(k,c({},b,{clientId:r})):(0,u.createElement)(qv,t)}}Vv.save=a.__unstableGetInnerBlocksProps,Fv.DefaultBlockAppender=wv,Fv.ButtonBlockAppender=Sv,Fv.Content=()=>Vv.save().children;var Hv=Fv;const Gv=(0,u.createContext)(),Uv=(0,u.createContext)(),$v=new WeakMap;function jv(e){let{className:t,...n}=e;const[o,r]=(0,u.useState)(),l=(0,m.useViewportMatch)("medium"),{isOutlineMode:i,isFocusMode:a,editorMode:s}=(0,g.useSelect)((e=>{const{getSettings:t,__unstableGetEditorMode:n}=e(To),{outlineMode:o,focusMode:r}=t();return{isOutlineMode:o,isFocusMode:r,editorMode:n()}}),[]),c=(0,g.useRegistry)(),{setBlockVisibility:d}=(0,g.useDispatch)(To),f=(0,m.useDebounce)((0,u.useCallback)((()=>{const e={};$v.get(c).forEach((t=>{let[n,o]=t;e[n]=o})),d(e)}),[c]),300,{trailing:!0}),h=(0,u.useMemo)((()=>{const{IntersectionObserver:e}=window;if(e)return new e((e=>{$v.get(c)||$v.set(c,[]);for(const t of e){const e=t.target.getAttribute("data-block");$v.get(c).push([e,t.isIntersecting])}f()}))}),[]),v=Vv({ref:(0,m.useMergeRefs)([Ed(),tf(),r]),className:p()("is-root-container",t,{"is-outline-mode":i,"is-focus-mode":a&&l,"is-navigate-mode":"navigation"===s})},n);return(0,u.createElement)(Gv.Provider,{value:o},(0,u.createElement)(Uv.Provider,{value:h},(0,u.createElement)("div",v)))}function Wv(e){return function(){const{patterns:e,isPreviewMode:t}=(0,g.useSelect)((e=>{const{__experimentalBlockPatterns:t,__unstableIsPreviewMode:n}=e(To).getSettings();return{patterns:t,isPreviewMode:n}}),[]);(0,u.useEffect)((()=>{if(t)return;if(null==e||!e.length)return;let n,o=-1;const r=()=>{o++,o>=e.length||((0,g.select)(To).__experimentalGetParsedPattern(e[o].name),n=nf(r))};return n=nf(r),()=>of(n)}),[e,t])}(),(0,u.createElement)(Ev,null,(0,u.createElement)(Lo,{value:No},(0,u.createElement)(jv,e)))}function Kv(e){let{placeholder:t,rootClientId:n,renderAppender:o,__experimentalAppenderTagName:r,__experimentalLayout:l=ii}=e;const{order:i,selectedBlocks:a,visibleBlocks:s}=(0,g.useSelect)((e=>{const{getBlockOrder:t,getSelectedBlockClientIds:o,__unstableGetVisibleBlocks:r}=e(To);return{order:t(n),selectedBlocks:o(),visibleBlocks:r()}}),[n]);return(0,u.createElement)(si,{value:l},i.map((e=>(0,u.createElement)(g.AsyncModeProvider,{key:e,value:!s.has(e)&&!a.includes(e)},(0,u.createElement)(ad,{rootClientId:n,clientId:e})))),i.length<1&&t,(0,u.createElement)(Kg,{tagName:r,rootClientId:n,renderAppender:o}))}function qv(e){return(0,u.createElement)(g.AsyncModeProvider,{value:!1},(0,u.createElement)(Kv,e))}function Yv(e){return[...e].sort(((t,n)=>e.filter((e=>e===n)).length-e.filter((e=>e===t)).length)).shift()}function Zv(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{flat:t,...n}=e;return t||Yv(Object.values(n).filter(Boolean))||"px"}function Qv(){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,h.__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=Yv(o),i=0===r||r?`${r}${l}`:void 0;return i}function Xv(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=Qv(e),n="string"!=typeof e&&isNaN(parseFloat(t));return n}function Jv(e){if(!e)return!1;if("string"==typeof e)return!0;return!!Object.values(e).filter((e=>!!e||0===e)).length}function eb(e){let{onChange:t,selectedUnits:n,setSelectedUnits:o,values:r,...l}=e,i=Qv(r);void 0===i&&(i=Zv(n));const a=Jv(r)&&Xv(r),s=a?(0,_.__)("Mixed"):null;return(0,u.createElement)(h.__experimentalUnitControl,c({},l,{"aria-label":(0,_.__)("Border radius"),disableUnits:a,isOnly:!0,value:i,onChange:e=>{const n=!isNaN(parseFloat(e));t(n?e:void 0)},onUnitChange:e=>{o({topLeft:e,topRight:e,bottomLeft:e,bottomRight:e})},placeholder:s,size:"__unstable-large"}))}Wv.__unstableElementContext=Gv;const tb={topLeft:(0,_.__)("Top left"),topRight:(0,_.__)("Top right"),bottomLeft:(0,_.__)("Bottom left"),bottomRight:(0,_.__)("Bottom right")};function nb(e){let{onChange:t,selectedUnits:n,setSelectedUnits:o,values:r,...l}=e;const i=e=>n=>{if(!t)return;const o=!isNaN(parseFloat(n))?n:void 0;t({...a,[e]:o})},a="string"!=typeof r?r:{topLeft:r,topRight:r,bottomLeft:r,bottomRight:r};return(0,u.createElement)("div",{className:"components-border-radius-control__input-controls-wrapper"},Object.entries(tb).map((e=>{let[t,r]=e;const[s,d]=(0,h.__experimentalParseQuantityAndUnitFromRawValue)(a[t]),p=a[t]?d:n[t]||n.flat;return(0,u.createElement)(h.Tooltip,{text:r,position:"top",key:t},(0,u.createElement)("div",{className:"components-border-radius-control__tooltip-wrapper"},(0,u.createElement)(h.__experimentalUnitControl,c({},l,{"aria-label":r,value:[s,p].join(""),onChange:i(t),onUnitChange:(m=t,e=>{const t={...n};t[m]=e,o(t)}),size:"__unstable-large"}))));var m})))}function ob(e){let{isLinked:t,...n}=e;const o=t?(0,_.__)("Unlink radii"):(0,_.__)("Link radii");return(0,u.createElement)(h.Tooltip,{text:o},(0,u.createElement)("span",null,(0,u.createElement)(h.Button,c({},n,{className:"component-border-radius-control__linked-button",isSmall:!0,icon:t?Er:Cr,iconSize:24,"aria-label":o}))))}const rb={topLeft:void 0,topRight:void 0,bottomLeft:void 0,bottomRight:void 0},lb={px:100,em:20,rem:20};function ib(e){let{onChange:t,values:n}=e;const[o,r]=(0,u.useState)(!Jv(n)||!Xv(n)),[l,i]=(0,u.useState)({flat:"string"==typeof n?(0,h.__experimentalParseQuantityAndUnitFromRawValue)(n)[1]:void 0,topLeft:(0,h.__experimentalParseQuantityAndUnitFromRawValue)(null==n?void 0:n.topLeft)[1],topRight:(0,h.__experimentalParseQuantityAndUnitFromRawValue)(null==n?void 0:n.topRight)[1],bottomLeft:(0,h.__experimentalParseQuantityAndUnitFromRawValue)(null==n?void 0:n.bottomLeft)[1],bottomRight:(0,h.__experimentalParseQuantityAndUnitFromRawValue)(null==n?void 0:n.bottomRight)[1]}),a=(0,h.__experimentalUseCustomUnits)({availableUnits:fr("spacing.units")||["px","em","rem"]}),s=Zv(l),c=a&&a.find((e=>e.value===s)),d=(null==c?void 0:c.step)||1,[p]=(0,h.__experimentalParseQuantityAndUnitFromRawValue)(Qv(n));return(0,u.createElement)("fieldset",{className:"components-border-radius-control"},(0,u.createElement)(h.BaseControl.VisualLabel,{as:"legend"},(0,_.__)("Radius")),(0,u.createElement)("div",{className:"components-border-radius-control__wrapper"},o?(0,u.createElement)(u.Fragment,null,(0,u.createElement)(eb,{className:"components-border-radius-control__unit-control",values:n,min:0,onChange:t,selectedUnits:l,setSelectedUnits:i,units:a}),(0,u.createElement)(h.RangeControl,{label:(0,_.__)("Border radius"),hideLabelFromVision:!0,className:"components-border-radius-control__range-control",value:null!=p?p:"",min:0,max:lb[s],initialPosition:0,withInputField:!1,onChange:e=>{t(void 0!==e?`${e}${s}`:void 0)},step:d,__nextHasNoMarginBottom:!0})):(0,u.createElement)(nb,{min:0,onChange:t,selectedUnits:l,setSelectedUnits:i,values:n||rb,units:a}),(0,u.createElement)(ob,{onClick:()=>r(!o),isLinked:o})))}function ab(e){var t;const{attributes:{style:n},setAttributes:o}=e;return(0,u.createElement)(ib,{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})}})}fp([hp,kp]);const sb=(e,t,n)=>{if(t){const n=null==e?void 0:e.find((e=>e.slug===t));if(n)return n}return{color:n}},cb=(e,t)=>null==e?void 0:e.find((e=>e.color===t));function ub(e,t){if(e&&t)return`has-${(0,f.kebabCase)(t)}-${e}`}function db(){const e={disableCustomColors:!fr("color.custom"),disableCustomGradients:!fr("color.customGradient")},t=fr("color.palette.custom"),n=fr("color.palette.theme"),o=fr("color.palette.default"),r=fr("color.defaultPalette");e.colors=(0,u.useMemo)((()=>{const e=[];return n&&n.length&&e.push({name:(0,_._x)("Theme","Indicates this palette comes from the theme."),colors:n}),r&&o&&o.length&&e.push({name:(0,_._x)("Default","Indicates this palette comes from WordPress."),colors:o}),t&&t.length&&e.push({name:(0,_._x)("Custom","Indicates this palette comes from the theme."),colors:t}),e}),[o,n,t]);const l=fr("color.gradients.custom"),i=fr("color.gradients.theme"),a=fr("color.gradients.default"),s=fr("color.defaultGradients");return e.gradients=(0,u.useMemo)((()=>{const e=[];return i&&i.length&&e.push({name:(0,_._x)("Theme","Indicates this palette comes from the theme."),gradients:i}),s&&a&&a.length&&e.push({name:(0,_._x)("Default","Indicates this palette comes from WordPress."),gradients:a}),l&&l.length&&e.push({name:(0,_._x)("Custom","Indicates this palette is created by the user."),gradients:l}),e}),[l,i,a]),e}const pb="__experimentalBorder",mb=["top","right","bottom","left"],gb=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}}}},fb=(e,t,n)=>{let o;return e.some((e=>e.colors.some((e=>e[t]===n&&(o=e,!0))))),o},hb=e=>{let{colors:t,namedColor:n,customColor:o}=e;if(n){const e=fb(t,"slug",n);if(e)return e}if(!o)return{color:void 0};const r=fb(t,"color",o);return r||{color:o}};function vb(e){const t=/var:preset\|color\|(.+)/.exec(e);return t&&t[1]?t[1]:null}function bb(e){const{attributes:t,clientId:n,setAttributes:o}=e,{style:r}=t,{colors:l}=db(),i=kb(e.name),s=fr("border.color")&&kb(e.name,"color"),c=fr("border.radius")&&kb(e.name,"radius"),d=fr("border.style")&&kb(e.name,"style"),p=fr("border.width")&&kb(e.name,"width");if([!s,!c,!d,!p].every(Boolean)||!i)return null;const m=(0,a.getBlockSupport)(e.name,[pb,"__experimentalDefaultControls"]),g=(null==m?void 0:m.color)||(null==m?void 0:m.width),f=((e,t)=>{const{borderColor:n,style:o}=e,{border:r}=o||{};if(n){const{color:e}=hb({colors:t,namedColor:n});return e?{...r,color:e}:r}if(!r)return r;const l={...r};return mb.forEach((e=>{var n;const o=vb(null===(n=l[e])||void 0===n?void 0:n.color);if(o){const{color:n}=hb({colors:t,namedColor:o});l[e]={...l[e],color:n}}})),l})(t,l);return(0,u.createElement)(jr,{group:"border"},(p||s)&&(0,u.createElement)(h.__experimentalToolsPanelItem,{hasValue:()=>(e=>{const{borderColor:t,style:n}=e.attributes;return(0,h.__experimentalIsDefinedBorder)(null==n?void 0:n.border)||!!t})(e),label:(0,_.__)("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:g,resetAllFilter:gb,panelId:n},(0,u.createElement)(h.__experimentalBorderBoxControl,{colors:l,enableAlpha:!0,enableStyle:d,onChange:e=>{var t;let n,i={...e};if((0,h.__experimentalHasSplitBorders)(e))i={top:{...e.top},right:{...e.right},bottom:{...e.bottom},left:{...e.left}},mb.forEach((t=>{var n;if(null!==(n=e[t])&&void 0!==n&&n.color){var o;const n=hb({colors:l,customColor:null===(o=e[t])||void 0===o?void 0:o.color});n.slug&&(i[t].color=`var:preset|color|${n.slug}`)}}));else if(null!=e&&e.color){const t=null==e?void 0:e.color,o=hb({colors:l,customColor:t});o.slug&&(n=o.slug,i.color=void 0)}const a=Ar({...r,border:{radius:null==r||null===(t=r.border)||void 0===t?void 0:t.radius,...i}});o({style:a,borderColor:n})},popoverOffset:40,popoverPlacement:"left-start",size:"__unstable-large",value:f,__experimentalIsRenderedInSidebar:!0})),c&&(0,u.createElement)(h.__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,_.__)("Radius"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:_b(o,"radius")})}(e),isShownByDefault:null==m?void 0:m.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,u.createElement)(ab,e)))}function kb(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"any";if("web"!==u.Platform.OS)return!1;const n=(0,a.getBlockSupport)(e,pb);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 _b(e,t){return Ar({...e,border:{...null==e?void 0:e.border,[t]:void 0}})}function yb(e,t,n){if(!kb(t,"color")||Fr(t,pb,"color"))return e;const o=Eb(n),r=p()(e.className,o);return e.className=r||void 0,e}function Eb(e){var t;const{borderColor:n,style:o}=e,r=ub("border-color",n);return p()({"has-border-color":n||(null==o||null===(t=o.border)||void 0===t?void 0:t.color),[r]:!!r})}const Cb=(0,m.createHigherOrderComponent)((e=>t=>{var n,o,r,l,i,a,s,d,p;const{name:m,attributes:g}=t,{borderColor:f,style:h}=g,{colors:v}=db();if(!kb(m,"color")||Fr(m,pb,"color"))return(0,u.createElement)(e,t);const{color:b}=hb({colors:v,namedColor:f}),{color:k}=hb({colors:v,namedColor:vb(null==h||null===(n=h.border)||void 0===n||null===(o=n.top)||void 0===o?void 0:o.color)}),{color:_}=hb({colors:v,namedColor:vb(null==h||null===(r=h.border)||void 0===r||null===(l=r.right)||void 0===l?void 0:l.color)}),{color:y}=hb({colors:v,namedColor:vb(null==h||null===(i=h.border)||void 0===i||null===(a=i.bottom)||void 0===a?void 0:a.color)}),{color:E}=hb({colors:v,namedColor:vb(null==h||null===(s=h.border)||void 0===s||null===(d=s.left)||void 0===d?void 0:d.color)}),C={borderTopColor:k||b,borderRightColor:_||b,borderBottomColor:y||b,borderLeftColor:E||b};let S=t.wrapperProps;return S={...t.wrapperProps,style:{...null===(p=t.wrapperProps)||void 0===p?void 0:p.style,...C}},(0,u.createElement)(e,c({},t,{wrapperProps:S}))}));function Sb(e){if(e)return`has-${e}-gradient-background`}function wb(e,t){const n=null==e?void 0:e.find((e=>e.slug===t));return n&&n.gradient}function Bb(e,t){const n=null==e?void 0:e.find((e=>e.gradient===t));return n}function Ib(e,t){const n=Bb(e,t);return n&&n.slug}function xb(){let{gradientAttribute:e="gradient",customGradientAttribute:t="customGradient"}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{clientId:n}=Ro(),o=fr("color.gradients.custom"),r=fr("color.gradients.theme"),l=fr("color.gradients.default"),i=(0,u.useMemo)((()=>[...o||[],...r||[],...l||[]]),[o,r,l]),{gradient:a,customGradient:s}=(0,g.useSelect)((o=>{const{getBlockAttributes:r}=o(To),l=r(n)||{};return{customGradient:l[t],gradient:l[e]}}),[n,e,t]),{updateBlockAttributes:c}=(0,g.useDispatch)(To),d=(0,u.useCallback)((o=>{const r=Ib(i,o);c(n,r?{[e]:r,[t]:void 0}:{[e]:void 0,[t]:o})}),[i,n,c]),p=Sb(a);let m;return m=a?wb(i,a):s,{gradientClass:p,gradientValue:m,setGradient:d}}(0,s.addFilter)("blocks.registerBlockType","core/border/addAttributes",(function(e){return kb(e,"color")?e.attributes.borderColor?e:{...e,attributes:{...e.attributes,borderColor:{type:"string"}}}:e})),(0,s.addFilter)("blocks.getSaveContent.extraProps","core/border/addSaveProps",yb),(0,s.addFilter)("blocks.registerBlockType","core/border/addEditProps",(function(e){if(!kb(e,"color")||Fr(e,pb,"color"))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),yb(o,e,n)},e})),(0,s.addFilter)("editor.BlockListBlock","core/border/with-border-color-palette-styles",Cb);const Tb=["colors","disableCustomColors","gradients","disableCustomGradients"],Mb={name:"color",title:"Solid",value:"color"},Nb={name:"gradient",title:"Gradient",value:"gradient"},Pb=[Mb,Nb];function Lb(e){let{colors:t,gradients:n,disableCustomColors:o,disableCustomGradients:r,__experimentalIsRenderedInSidebar:l,className:i,label:a,onColorChange:s,onGradientChange:c,colorValue:d,gradientValue:m,clearable:g,showTitle:v=!0,enableAlpha:b}=e;const k=s&&(!(0,f.isEmpty)(t)||!o),_=c&&(!(0,f.isEmpty)(n)||!r);if(!k&&!_)return null;const y={[Mb.value]:(0,u.createElement)(h.ColorPalette,{value:d,onChange:_?e=>{s(e),c()}:s,colors:t,disableCustomColors:o,__experimentalIsRenderedInSidebar:l,clearable:g,enableAlpha:b}),[Nb.value]:(0,u.createElement)(h.GradientPicker,{__nextHasNoMargin:!0,value:m,onChange:k?e=>{c(e),s()}:c,gradients:n,disableCustomGradients:r,__experimentalIsRenderedInSidebar:l,clearable:g})},E=e=>(0,u.createElement)("div",{className:"block-editor-color-gradient-control__panel"},y[e]);return(0,u.createElement)(h.BaseControl,{__nextHasNoMarginBottom:!0,className:p()("block-editor-color-gradient-control",i)},(0,u.createElement)("fieldset",{className:"block-editor-color-gradient-control__fieldset"},(0,u.createElement)(h.__experimentalVStack,{spacing:1},v&&(0,u.createElement)("legend",null,(0,u.createElement)("div",{className:"block-editor-color-gradient-control__color-indicator"},(0,u.createElement)(h.BaseControl.VisualLabel,null,a))),k&&_&&(0,u.createElement)(h.TabPanel,{className:"block-editor-color-gradient-control__tabs",tabs:Pb,initialTabName:m?Nb.value:!!k&&Mb.value},(e=>E(e.value))),!_&&E(Mb.value),!k&&E(Nb.value))))}function Rb(e){const t={};return t.colors=fr("color.palette"),t.gradients=fr("color.gradients"),t.disableCustomColors=!fr("color.custom"),t.disableCustomGradients=!fr("color.customGradient"),(0,u.createElement)(Lb,c({},t,e))}var Ab=function(e){return Tb.every((t=>e.hasOwnProperty(t)))?(0,u.createElement)(Lb,e):(0,u.createElement)(Rb,e)};const Ob=e=>{let{setting:t,children:n,panelId:o,...r}=e;return(0,u.createElement)(h.__experimentalToolsPanelItem,c({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)},Db=e=>{let{colorValue:t,label:n}=e;return(0,u.createElement)(h.__experimentalHStack,{justify:"flex-start"},(0,u.createElement)(h.ColorIndicator,{className:"block-editor-panel-color-gradient-settings__color-indicator",colorValue:t}),(0,u.createElement)(h.FlexItem,{className:"block-editor-panel-color-gradient-settings__color-name",title:n},n))},zb=e=>t=>{let{onToggle:n,isOpen:o}=t;const{colorValue:r,label:l}=e,i={onClick:n,className:p()("block-editor-panel-color-gradient-settings__dropdown",{"is-open":o}),"aria-expanded":o};return(0,u.createElement)(h.Button,i,(0,u.createElement)(Db,{colorValue:r,label:l}))};function Fb(e){let t,{colors:n,disableCustomColors:o,disableCustomGradients:r,enableAlpha:l,gradients:i,settings:a,__experimentalIsRenderedInSidebar:s,...d}=e;return s&&(t={placement:"left-start",offset:36,shift:!0}),(0,u.createElement)(u.Fragment,null,a.map(((e,a)=>{var p;const m={clearable:!1,colorValue:e.colorValue,colors:n,disableCustomColors:o,disableCustomGradients:r,enableAlpha:l,gradientValue:e.gradientValue,gradients:i,label:e.label,onColorChange:e.onColorChange,onGradientChange:e.onGradientChange,showTitle:!1,__experimentalIsRenderedInSidebar:s,...e},g={colorValue:null!==(p=e.gradientValue)&&void 0!==p?p:e.colorValue,label:e.label};return e&&(0,u.createElement)(Ob,c({key:a,setting:e},d),(0,u.createElement)(h.Dropdown,{popoverProps:t,className:"block-editor-tools-panel-color-gradient-settings__dropdown",renderToggle:zb(g),renderContent:()=>(0,u.createElement)(h.__experimentalDropdownContentWrapper,{paddingSize:"none"},(0,u.createElement)("div",{className:"block-editor-panel-color-gradient-settings__dropdown-content"},(0,u.createElement)(Ab,m)))}))})))}fp([hp,kp]);var Vb=function(e){let{backgroundColor:t,fallbackBackgroundColor:n,fallbackTextColor:o,fallbackLinkColor:r,fontSize:l,isLargeText:i,textColor:a,linkColor:s,enableAlphaChecker:c=!1}=e;const d=t||n;if(!d)return null;const p=a||o,m=s||r;if(!p&&!m)return null;const g=[{color:p,description:(0,_.__)("text color")},{color:m,description:(0,_.__)("link color")}],f=mp(d),v=f.alpha()<1,b=f.brightness(),k={level:"AA",size:i||!1!==i&&l>=24?"large":"small"};let y="",E="";for(const e of g){if(!e.color)continue;const t=mp(e.color),n=t.isReadable(f,k),o=t.alpha()<1;if(!n){if(v||o)continue;y=bnull==e?void 0:e.colorValue));(0,u.useEffect)((()=>{var e;if(!r)return;if(!g.length)return l&&i(),a&&s(),void(d&&s());if(!m.current)return;s(Hb(m.current).color);const t=null===(e=m.current)||void 0===e?void 0:e.querySelector("a");t&&t.innerText&&p(Hb(t).color);let n=m.current,o=Hb(n).backgroundColor;for(;"rgba(0, 0, 0, 0)"===o&&n.parentNode&&n.parentNode.nodeType===n.parentNode.ELEMENT_NODE;)n=n.parentNode,o=Hb(n).backgroundColor;i(o)}));const f=db();return(0,u.createElement)(jr,{group:"color"},(0,u.createElement)(Fb,c({enableAlpha:t,panelId:o,settings:n,__experimentalIsItemGroup:!1,__experimentalIsRenderedInSidebar:!0},f)),r&&(0,u.createElement)(Vb,{backgroundColor:l,textColor:a,enableAlphaChecker:t,linkColor:d}))}const Ub="color",$b=e=>{const t=(0,a.getBlockSupport)(e,Ub);return t&&(!0===t.link||!0===t.gradient||!1!==t.background||!1!==t.text)},jb=e=>{if("web"!==u.Platform.OS)return!1;const t=(0,a.getBlockSupport)(e,Ub);return null!==t&&"object"==typeof t&&!!t.link},Wb=e=>{const t=(0,a.getBlockSupport)(e,Ub);return null!==t&&"object"==typeof t&&!!t.gradients},Kb=e=>{const t=(0,a.getBlockSupport)(e,Ub);return t&&!1!==t.background},qb=e=>{const t=(0,a.getBlockSupport)(e,Ub);return t&&!1!==t.text},Yb=(e,t)=>Ar(Dr(t,e,void 0)),Zb=e=>({textColor:void 0,style:Yb(["color","text"],e.style)}),Qb=e=>({style:Yb(["elements","link","color","text"],e.style)}),Xb=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 Jb(e,t,n){var o,r,l,i,a,s;if(!$b(t)||Fr(t,Ub))return e;const c=Wb(t),{backgroundColor:u,textColor:d,gradient:m,style:g}=n,f=e=>!Fr(t,Ub,e),h=f("text")?ub("color",d):void 0,v=f("gradients")?Sb(m):void 0,b=f("background")?ub("background-color",u):void 0,k=f("background")||f("gradients"),_=u||(null==g||null===(o=g.color)||void 0===o?void 0:o.background)||c&&(m||(null==g||null===(r=g.color)||void 0===r?void 0:r.gradient)),y=p()(e.className,h,v,{[b]:!(c&&null!=g&&null!==(l=g.color)&&void 0!==l&&l.gradient||!b),"has-text-color":f("text")&&(d||(null==g||null===(i=g.color)||void 0===i?void 0:i.text)),"has-background":k&&_,"has-link-color":f("link")&&(null==g||null===(a=g.elements)||void 0===a||null===(s=a.link)||void 0===s?void 0:s.color)});return e.className=y||void 0,e}const ek=(e,t)=>{const n=/var:preset\|color\|(.+)/.exec(t);return n&&n[1]?sb(e,n[1]).color:t};function tk(e){var t,n,o,r,l,i;const{name:s,attributes:c}=e,d=fr("color.palette.custom"),p=fr("color.palette.theme"),m=fr("color.palette.default"),g=(0,u.useMemo)((()=>[...d||[],...p||[],...m||[]]),[d,p,m]),f=fr("color.gradients.custom"),h=fr("color.gradients.theme"),v=fr("color.gradients.default"),b=(0,u.useMemo)((()=>[...f||[],...h||[],...v||[]]),[f,h,v]),k=fr("color.custom"),y=fr("color.customGradient"),E=fr("color.background"),C=fr("color.link"),S=fr("color.text"),w=k||!p||(null==p?void 0:p.length)>0,B=y||!h||(null==h?void 0:h.length)>0,I=(0,u.useRef)(c);if((0,u.useEffect)((()=>{I.current=c}),[c]),!$b(s))return null;const x=jb(s)&&C&&w,T=qb(s)&&S&&w,M=Kb(s)&&E&&w,N=Wb(s)&&B;if(!(x||T||M||N))return null;const{style:P,textColor:L,backgroundColor:R,gradient:A}=c;let O;if(N&&A)O=wb(b,A);else if(N){var D;O=null==P||null===(D=P.color)||void 0===D?void 0:D.gradient}const z=t=>n=>{var o,r;const l=cb(g,n),i=t+"Color",a={...I.current.style,color:{...null===(o=I.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),I.current={...I.current,...c}},F=(0,a.getBlockSupport)(e.name,[Ub,"__experimentalDefaultControls"]),V="web"===u.Platform.OS&&!A&&!(null!=P&&null!==(t=P.color)&&void 0!==t&&t.gradient)&&M&&(x||T)&&!1!==(0,a.getBlockSupport)(e.name,[Ub,"enableContrastChecker"]);return(0,u.createElement)(Gb,{enableContrastChecking:V,clientId:e.clientId,enableAlpha:!0,settings:[...T?[{label:(0,_.__)("Text"),onColorChange:z("text"),colorValue:sb(g,L,null==P||null===(n=P.color)||void 0===n?void 0:n.text).color,isShownByDefault:null==F?void 0:F.text,resetAllFilter:Zb}]:[],...M||N?[{label:(0,_.__)("Background"),onColorChange:M?z("background"):void 0,colorValue:sb(g,R,null==P||null===(o=P.color)||void 0===o?void 0:o.background).color,gradientValue:O,onGradientChange:N?t=>{const n=Ib(b,t);let o;if(n){var r,l,i;const e={...null===(r=I.current)||void 0===r?void 0:r.style,color:{...null===(l=I.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=I.current)||void 0===a?void 0:a.style,color:{...null===(s=I.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),I.current={...I.current,...o}}:void 0,isShownByDefault:null==F?void 0:F.background,resetAllFilter:Xb}]:[],...x?[{label:(0,_.__)("Link"),onColorChange:t=>{var n;const o=cb(g,t),r=null!=o&&o.slug?`var:preset|color|${o.slug}`:t,l=Ar(Dr(null===(n=I.current)||void 0===n?void 0:n.style,["elements","link","color","text"],r));e.setAttributes({style:l}),I.current={...I.current,style:l}},colorValue:ek(g,null==P||null===(r=P.elements)||void 0===r||null===(l=r.link)||void 0===l||null===(i=l.color)||void 0===i?void 0:i.text),isShownByDefault:null==F?void 0:F.link,resetAllFilter:Qb}]:[]]})}const nk=(0,m.createHigherOrderComponent)((e=>t=>{var n;const{name:o,attributes:r}=t,{backgroundColor:l,textColor:i}=r,a=fr("color.palette.custom"),s=fr("color.palette.theme"),d=fr("color.palette.default"),p=(0,u.useMemo)((()=>[...a||[],...s||[],...d||[]]),[a,s,d]);if(!$b(o)||Fr(o,Ub))return(0,u.createElement)(e,t);const m={};var g,f;i&&!Fr(o,Ub,"text")&&(m.color=null===(g=sb(p,i))||void 0===g?void 0:g.color);l&&!Fr(o,Ub,"background")&&(m.backgroundColor=null===(f=sb(p,l))||void 0===f?void 0:f.color);let h=t.wrapperProps;return h={...t.wrapperProps,style:{...m,...null===(n=t.wrapperProps)||void 0===n?void 0:n.style}},(0,u.createElement)(e,c({},t,{wrapperProps:h}))})),ok={linkColor:[["style","elements","link","color","text"]],textColor:[["textColor"],["style","color","text"]],backgroundColor:[["backgroundColor"],["style","color","background"]],gradient:[["gradient"],["style","color","gradient"]]};(0,s.addFilter)("blocks.registerBlockType","core/color/addAttribute",(function(e){return $b(e)?(e.attributes.backgroundColor||Object.assign(e.attributes,{backgroundColor:{type:"string"}}),e.attributes.textColor||Object.assign(e.attributes,{textColor:{type:"string"}}),Wb(e)&&!e.attributes.gradient&&Object.assign(e.attributes,{gradient:{type:"string"}}),e):e})),(0,s.addFilter)("blocks.getSaveContent.extraProps","core/color/addSaveProps",Jb),(0,s.addFilter)("blocks.registerBlockType","core/color/addEditProps",(function(e){if(!$b(e)||Fr(e,Ub))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),Jb(o,e,n)},e})),(0,s.addFilter)("editor.BlockListBlock","core/color/with-color-palette-styles",nk),(0,s.addFilter)("blocks.switchToBlockType.transformedBlock","core/color/addTransforms",(function(e,t,n,o){const r=e.name;return zr({linkColor:jb(r),textColor:qb(r),backgroundColor:Kb(r),gradient:Wb(r)},ok,e,t,n,o)}));const rk=[{name:(0,_._x)("Regular","font style"),value:"normal"},{name:(0,_._x)("Italic","font style"),value:"italic"}],lk=[{name:(0,_._x)("Thin","font weight"),value:"100"},{name:(0,_._x)("Extra Light","font weight"),value:"200"},{name:(0,_._x)("Light","font weight"),value:"300"},{name:(0,_._x)("Regular","font weight"),value:"400"},{name:(0,_._x)("Medium","font weight"),value:"500"},{name:(0,_._x)("Semi Bold","font weight"),value:"600"},{name:(0,_._x)("Bold","font weight"),value:"700"},{name:(0,_._x)("Extra Bold","font weight"),value:"800"},{name:(0,_._x)("Black","font weight"),value:"900"}],ik=(e,t)=>e?t?(0,_.__)("Appearance"):(0,_.__)("Font style"):(0,_.__)("Font weight");function ak(e){const{onChange:t,hasFontStyles:n=!0,hasFontWeights:o=!0,value:{fontStyle:r,fontWeight:l},...i}=e,a=n||o,s=ik(n,o),d={key:"default",name:(0,_.__)("Default"),style:{fontStyle:void 0,fontWeight:void 0}},p=(0,u.useMemo)((()=>n&&o?(()=>{const e=[d];return rk.forEach((t=>{let{name:n,value:o}=t;lk.forEach((t=>{let{name:r,value:l}=t;const i="normal"===o?r:(0,_.sprintf)((0,_.__)("%1$s %2$s"),r,n);e.push({key:`${o}-${l}`,name:i,style:{fontStyle:o,fontWeight:l}})}))})),e})():n?(()=>{const e=[d];return rk.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 lk.forEach((t=>{let{name:n,value:o}=t;e.push({key:o,name:n,style:{fontStyle:void 0,fontWeight:o}})})),e})()),[e.options]),m=p.find((e=>e.style.fontStyle===r&&e.style.fontWeight===l))||p[0];return a&&(0,u.createElement)(h.CustomSelectControl,c({},i,{className:"components-font-appearance-control",label:s,describedBy:m?n?o?(0,_.sprintf)((0,_.__)("Currently selected font appearance: %s"),m.name):(0,_.sprintf)((0,_.__)("Currently selected font style: %s"),m.name):(0,_.sprintf)((0,_.__)("Currently selected font weight: %s"),m.name):(0,_.__)("No selected font appearance"),options:p,value:m,onChange:e=>{let{selectedItem:n}=e;return t(n.style)},__nextUnconstrainedWidth:!0}))}const sk=1.5,ck=.1;var uk=e=>{let{value:t,onChange:n,__nextHasNoMarginBottom:o=!1,__unstableInputWidth:r="60px",...l}=e;const i=function(e){return void 0!==e&&""!==e}(t),a=i?t:"";o||W()("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 s=o?void 0:{marginBottom:24};return(0,u.createElement)("div",{className:"block-editor-line-height-control",style:s},(0,u.createElement)(h.__experimentalNumberControl,c({},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(i)return e;switch(`${e}`){case"0.1":return 1.6;case"0":return t?e:1.4;case"":return sk;default:return e}})(e.value,o);return{...e,value:r}},onChange:n,label:(0,_.__)("Line height"),placeholder:sk,step:ck,value:a,min:0,spinControls:"custom"})))};const dk="typography.lineHeight";function pk(e){var t;const{attributes:{style:n},setAttributes:o}=e;return(0,u.createElement)(uk,{__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 mk(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!fr("typography.lineHeight");return!(0,a.hasBlockSupport)(e,dk)||t}const gk="typography.__experimentalFontStyle",fk="typography.__experimentalFontWeight";function hk(e){var t,n;const{attributes:{style:o},setAttributes:r}=e,l=!vk(e),i=!bk(e),a=null==o||null===(t=o.typography)||void 0===t?void 0:t.fontStyle,s=null==o||null===(n=o.typography)||void 0===n?void 0:n.fontWeight;return(0,u.createElement)(ak,{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:a,fontWeight:s},size:"__unstable-large"})}function vk(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=(0,a.hasBlockSupport)(e,gk),n=fr("typography.fontStyle");return!t||!n}function bk(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=(0,a.hasBlockSupport)(e,fk),n=fr("typography.fontWeight");return!t||!n}function kk(e){const t=vk(e),n=bk(e);return t&&n}function _k(e){let{value:t="",onChange:n,fontFamilies:o,...r}=e;const l=fr("typography.fontFamilies");if(o||(o=l),!o||0===o.length)return null;const i=[{value:"",label:(0,_.__)("Default")},...o.map((e=>{let{fontFamily:t,name:n}=e;return{value:t,label:n||t}}))];return(0,u.createElement)(h.SelectControl,c({label:(0,_.__)("Font"),options:i,value:t,onChange:n,labelPosition:"top"},r))}const yk="typography.__experimentalFontFamily";function Ek(e,t,n){if(!(0,a.hasBlockSupport)(t,yk))return e;if(Fr(t,s_,"fontFamily"))return e;if(null==n||!n.fontFamily)return e;const o=new(Df())(e.className);o.add(`has-${(0,f.kebabCase)(null==n?void 0:n.fontFamily)}-font-family`);const r=o.value;return e.className=r||void 0,e}function Ck(e){var t;let{setAttributes:n,attributes:{fontFamily:o}}=e;const r=fr("typography.fontFamilies"),l=null==r||null===(t=r.find((e=>{let{slug:t}=e;return o===t})))||void 0===t?void 0:t.fontFamily;return(0,u.createElement)(_k,{className:"block-editor-hooks-font-family-control",fontFamilies:r,value:l,onChange:function(e){const t=null==r?void 0:r.find((t=>{let{fontFamily:n}=t;return n===e}));n({fontFamily:null==t?void 0:t.slug})},size:"__unstable-large",__nextHasNoMarginBottom:!0})}function Sk(e){let{name:t}=e;const n=fr("typography.fontFamilies");return!n||0===n.length||!(0,a.hasBlockSupport)(t,yk)}(0,s.addFilter)("blocks.registerBlockType","core/fontFamily/addAttribute",(function(e){return(0,a.hasBlockSupport)(e,yk)?(e.attributes.fontFamily||Object.assign(e.attributes,{fontFamily:{type:"string"}}),e):e})),(0,s.addFilter)("blocks.getSaveContent.extraProps","core/fontFamily/addSaveProps",Ek),(0,s.addFilter)("blocks.registerBlockType","core/fontFamily/addEditProps",(function(e){if(!(0,a.hasBlockSupport)(e,yk))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),Ek(o,e,n)},e}));const wk=(e,t,n)=>{if(t){const n=null==e?void 0:e.find((e=>{let{slug:n}=e;return n===t}));if(n)return n}return{size:n}};function Bk(e,t){const n=null==e?void 0:e.find((e=>{let{size:n}=e;return n===t}));return n||{size:t}}function Ik(e){if(e)return`has-${(0,f.kebabCase)(e)}-font-size`}var xk=function(e){const t=fr("typography.fontSizes"),n=!fr("typography.customFontSize");return(0,u.createElement)(h.FontSizePicker,c({},e,{fontSizes:t,disableCustomFontSizes:n}))};const Tk="1600px",Mk="768px",Nk=1,Pk=.75;function Lk(e){let{minimumFontSize:t,maximumFontSize:n,fontSize:o,minimumViewPortWidth:r=Mk,maximumViewPortWidth:l=Tk,scaleFactor:i=Nk,minimumFontSizeFactor:a=Pk,minimumFontSizeLimit:s}=e;if(s=Rk(s)?s:"14px",o){const e=Rk(o);if(null==e||!e.unit)return null;const r=Rk(s,{coerceTo:e.unit});if(null!=r&&r.value&&!t&&!n&&(null==e?void 0:e.value)<=(null==r?void 0:r.value))return null;if(n||(n=`${e.value}${e.unit}`),!t){const n=Ak(e.value*a,3);t=null!=r&&r.value&&n<(null==r?void 0:r.value)?`${r.value}${r.unit}`:`${n}${e.unit}`}}const c=Rk(t),u=(null==c?void 0:c.unit)||"rem",d=Rk(n,{coerceTo:u});if(!c||!d)return null;const p=Rk(t,{coerceTo:"rem"}),m=Rk(l,{coerceTo:u}),g=Rk(r,{coerceTo:u});if(!m||!g||!p)return null;const f=Ak(g.value/100,3),h=Ak(f,3)+u,v=Ak(((d.value-c.value)/(m.value-g.value)*100||1)*i,3);return`clamp(${t}, ${`${p.value}${p.unit} + ((1vw - ${h}) * ${v})`}, ${n})`}function Rk(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if("string"!=typeof e&&"number"!=typeof e)return null;isFinite(e)&&(e=`${e}px`);const{coerceTo:n,rootSizeValue:o,acceptableUnits:r}={coerceTo:"",rootSizeValue:16,acceptableUnits:["rem","px","em"],...t},l=null==r?void 0:r.join("|"),i=new RegExp(`^(\\d*\\.?\\d+)(${l}){1,1}$`),a=e.match(i);if(!a||a.length<3)return null;let[,s,c]=a,u=parseFloat(s);return"px"!==n||"em"!==c&&"rem"!==c||(u*=o,c=n),"px"!==c||"em"!==n&&"rem"!==n||(u/=o,c=n),"em"!==n&&"rem"!==n||"em"!==c&&"rem"!==c||(c=n),{value:Ak(u,3),unit:c}}function Ak(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3;const n=Math.pow(10,t);return Number.isFinite(e)?parseFloat(Math.round(e*n)/n):void 0}const Ok="typography.fontSize";function Dk(e,t,n){if(!(0,a.hasBlockSupport)(t,Ok))return e;if(Fr(t,s_,"fontSize"))return e;const o=new(Df())(e.className);o.add(Ik(n.fontSize));const r=o.value;return e.className=r||void 0,e}function zk(e){var t,n;const{attributes:{fontSize:o,style:r},setAttributes:l}=e,i=fr("typography.fontSizes"),a=wk(i,o,null==r||null===(t=r.typography)||void 0===t?void 0:t.fontSize),s=(null==a?void 0:a.size)||(null==r||null===(n=r.typography)||void 0===n?void 0:n.fontSize)||o;return(0,u.createElement)(xk,{onChange:e=>{const t=Bk(i,e).slug;l({style:Ar({...r,typography:{...null==r?void 0:r.typography,fontSize:t?void 0:e}}),fontSize:t})},value:s,withReset:!1,withSlider:!0,size:"__unstable-large",__nextHasNoMarginBottom:!0})}function Fk(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=fr("typography.fontSizes"),n=!(null==t||!t.length);return!(0,a.hasBlockSupport)(e,Ok)||!n}const Vk=(0,m.createHigherOrderComponent)((e=>t=>{var n,o;const r=fr("typography.fontSizes"),{name:l,attributes:{fontSize:i,style:s},wrapperProps:c}=t;if(!(0,a.hasBlockSupport)(l,Ok)||Fr(l,s_,"fontSize")||!i||null!=s&&null!==(n=s.typography)&&void 0!==n&&n.fontSize)return(0,u.createElement)(e,t);const d=wk(r,i,null==s||null===(o=s.typography)||void 0===o?void 0:o.fontSize).size,p={...t,wrapperProps:{...c,style:{fontSize:d,...null==c?void 0:c.style}}};return(0,u.createElement)(e,p)}),"withFontSizeInlineStyles"),Hk={fontSize:[["fontSize"],["style","typography","fontSize"]]};(0,s.addFilter)("blocks.registerBlockType","core/font/addAttribute",(function(e){return(0,a.hasBlockSupport)(e,Ok)?(e.attributes.fontSize||Object.assign(e.attributes,{fontSize:{type:"string"}}),e):e})),(0,s.addFilter)("blocks.getSaveContent.extraProps","core/font/addSaveProps",Dk),(0,s.addFilter)("blocks.registerBlockType","core/font/addEditProps",(function(e){if(!(0,a.hasBlockSupport)(e,Ok))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),Dk(o,e,n)},e})),(0,s.addFilter)("editor.BlockListBlock","core/font-size/with-font-size-inline-styles",Vk),(0,s.addFilter)("blocks.switchToBlockType.transformedBlock","core/font-size/addTransforms",(function(e,t,n,o){const r=e.name;return zr({fontSize:(0,a.hasBlockSupport)(r,Ok)},Hk,e,t,n,o)})),(0,s.addFilter)("blocks.registerBlockType","core/font-size/addEditPropsForFluidCustomFontSizes",(function(e){if(!(0,a.hasBlockSupport)(e,Ok)||Fr(e,s_,"fontSize"))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=e=>{var n,o,r;const l=t?t(e):{},i=null==l||null===(n=l.style)||void 0===n?void 0:n.fontSize,a=null===(o=(0,g.select)(To).getSettings().__experimentalFeatures)||void 0===o||null===(r=o.typography)||void 0===r?void 0:r.fluid,s="object"==typeof a?a:{},c=i&&a?Lk({fontSize:i,minimumFontSizeLimit:null==s?void 0:s.minFontSize}):null;return null===c?l:{...l,style:{...null==l?void 0:l.style,fontSize:c}}},e}),11);var Gk=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"M7 11.5h10V13H7z"}));var Uk=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.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 $k=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.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 jk=[{name:(0,_.__)("None"),value:"none",icon:Gk},{name:(0,_.__)("Underline"),value:"underline",icon:Uk},{name:(0,_.__)("Strikethrough"),value:"line-through",icon:$k}];function Wk(e){let{value:t,onChange:n,className:o}=e;return(0,u.createElement)("fieldset",{className:p()("block-editor-text-decoration-control",o)},(0,u.createElement)(h.BaseControl.VisualLabel,{as:"legend"},(0,_.__)("Decoration")),(0,u.createElement)("div",{className:"block-editor-text-decoration-control__buttons"},jk.map((e=>(0,u.createElement)(h.Button,{key:e.value,icon:e.icon,label:e.name,isPressed:e.value===t,onClick:()=>{n(e.value===t?void 0:e.value)}})))))}const Kk="typography.__experimentalTextDecoration";function qk(e){var t;const{attributes:{style:n},setAttributes:o}=e;return(0,u.createElement)(Wk,{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 Yk(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!(0,a.hasBlockSupport)(e,Kk),n=fr("typography.textDecoration");return t||!n}var Zk=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.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 Qk=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.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 Xk=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.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 Jk=[{name:(0,_.__)("None"),value:"none",icon:Gk},{name:(0,_.__)("Uppercase"),value:"uppercase",icon:Zk},{name:(0,_.__)("Lowercase"),value:"lowercase",icon:Qk},{name:(0,_.__)("Capitalize"),value:"capitalize",icon:Xk}];function e_(e){let{className:t,value:n,onChange:o}=e;return(0,u.createElement)("fieldset",{className:p()("block-editor-text-transform-control",t)},(0,u.createElement)(h.BaseControl.VisualLabel,{as:"legend"},(0,_.__)("Letter case")),(0,u.createElement)("div",{className:"block-editor-text-transform-control__buttons"},Jk.map((e=>(0,u.createElement)(h.Button,{key:e.value,icon:e.icon,label:e.name,isPressed:e.value===n,onClick:()=>{o(e.value===n?void 0:e.value)}})))))}const t_="typography.__experimentalTextTransform";function n_(e){var t;const{attributes:{style:n},setAttributes:o}=e;return(0,u.createElement)(e_,{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 o_(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!(0,a.hasBlockSupport)(e,t_),n=fr("typography.textTransform");return t||!n}function r_(e){let{value:t,onChange:n,__unstableInputWidth:o="60px",...r}=e;const l=(0,h.__experimentalUseCustomUnits)({availableUnits:fr("spacing.units")||["px","em","rem"],defaultValues:{px:2,em:.2,rem:.2}});return(0,u.createElement)(h.__experimentalUnitControl,c({},r,{label:(0,_.__)("Letter spacing"),value:t,__unstableInputWidth:o,units:l,onChange:n}))}const l_="typography.__experimentalLetterSpacing";function i_(e){var t;const{attributes:{style:n},setAttributes:o}=e;return(0,u.createElement)(r_,{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 a_(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!(0,a.hasBlockSupport)(e,l_),n=fr("typography.letterSpacing");return t||!n}const s_="typography",c_=[dk,Ok,gk,fk,yk,Kk,t_,l_];function u_(e){const{clientId:t}=e,n=Sk(e),o=Fk(e),r=kk(e),l=mk(e),i=Yk(e),s=o_(e),c=a_(e),d=!vk(e),p=!bk(e),m=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=[kk(e),Fk(e),mk(e),Sk(e),Yk(e),o_(e),a_(e)];return t.filter(Boolean).length===t.length}(e),g=d_(e.name);if(m||!g)return null;const f=(0,a.getBlockSupport)(e.name,[s_,"__experimentalDefaultControls"]),v=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,u.createElement)(jr,{group:"typography"},!n&&(0,u.createElement)(h.__experimentalToolsPanelItem,{hasValue:()=>function(e){return!!e.attributes.fontFamily}(e),label:(0,_.__)("Font family"),onDeselect:()=>function(e){let{setAttributes:t}=e;t({fontFamily:void 0})}(e),isShownByDefault:null==f?void 0:f.fontFamily,resetAllFilter:e=>({...e,fontFamily:void 0}),panelId:t},(0,u.createElement)(Ck,e)),!o&&(0,u.createElement)(h.__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,_.__)("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==f?void 0:f.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,u.createElement)(zk,e)),!r&&(0,u.createElement)(h.__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:ik(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==f?void 0:f.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,u.createElement)(hk,e)),!l&&(0,u.createElement)(h.__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,_.__)("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==f?void 0:f.lineHeight,resetAllFilter:v("lineHeight"),panelId:t},(0,u.createElement)(pk,e)),!c&&(0,u.createElement)(h.__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,_.__)("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==f?void 0:f.letterSpacing,resetAllFilter:v("letterSpacing"),panelId:t},(0,u.createElement)(i_,e)),!i&&(0,u.createElement)(h.__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,_.__)("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==f?void 0:f.textDecoration,resetAllFilter:v("textDecoration"),panelId:t},(0,u.createElement)(qk,e)),!s&&(0,u.createElement)(h.__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,_.__)("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==f?void 0:f.textTransform,resetAllFilter:v("textTransform"),panelId:t},(0,u.createElement)(n_,e)))}const d_=e=>c_.some((t=>(0,a.hasBlockSupport)(e,t)));const p_=[...c_,pb,Ub,fl,hl],m_=e=>p_.some((t=>(0,a.hasBlockSupport)(e,t)));function g_(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t={};return(0,ni.getCSSRules)(e).forEach((e=>{t[e.key]=e.value})),t}const f_={"__experimentalBorder.__experimentalSkipSerialization":["border"],"color.__experimentalSkipSerialization":[Ub],[`${s_}.__experimentalSkipSerialization`]:[s_],[`${fl}.__experimentalSkipSerialization`]:[fl],[`${hl}.__experimentalSkipSerialization`]:[hl]},h_={...f_,[`${hl}`]:["spacing.blockGap"]},v_={gradients:"gradient"};function b_(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(!e)return e;let o=e;return n||(o=JSON.parse(JSON.stringify(e))),Array.isArray(t)||(t=[t]),t.forEach((e=>{if(Array.isArray(e)||(e=e.split(".")),e.length>1){const[t,...n]=e;b_(o[t],[n],!0)}else 1===e.length&&delete o[e[0]]})),o}function k_(e,t,n){let o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:h_;if(!m_(t))return e;let{style:r}=n;return Object.entries(o).forEach((e=>{let[n,o]=e;const l=(0,a.getBlockSupport)(t,n);!0===l&&(r=b_(r,o)),Array.isArray(l)&&l.forEach((e=>{const t=v_[e]||e;r=b_(r,[[...o,t]])}))})),e.style={...g_(r),...e.style},e}const __=(0,m.createHigherOrderComponent)((e=>t=>{const n=Ao();return(0,u.createElement)(u.Fragment,null,n&&(0,u.createElement)(u.Fragment,null,(0,u.createElement)(tk,t),(0,u.createElement)(u_,t),(0,u.createElement)(bb,t),(0,u.createElement)(_l,t)),(0,u.createElement)(e,t))}),"withToolbarControls"),y_=(0,m.createHigherOrderComponent)((e=>t=>{var n,o;const r=`wp-elements-${(0,m.useInstanceId)(e)}`,l=Fr(t.name,Ub,"link"),i=(0,u.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:l||null===(i=n.link)||void 0===i?void 0:i.color}};for(const[t,n]of Object.entries(e)){const e=(0,ni.compileCSS)(n,{selector:`.editor-styles-wrapper .${r} ${a.__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]),s=(0,u.useContext)(Wv.__unstableElementContext);return(0,u.createElement)(u.Fragment,null,i&&s&&(0,u.createPortal)((0,u.createElement)("style",{dangerouslySetInnerHTML:{__html:i}}),s),(0,u.createElement)(e,c({},t,{className:null!==(o=t.attributes.style)&&void 0!==o&&o.elements?p()(t.className,r):t.className})))}));(0,s.addFilter)("blocks.registerBlockType","core/style/addAttribute",(function(e){return m_(e)?(e.attributes.style||Object.assign(e.attributes,{style:{type:"object"}}),e):e})),(0,s.addFilter)("blocks.getSaveContent.extraProps","core/style/addSaveProps",k_),(0,s.addFilter)("blocks.registerBlockType","core/style/addEditProps",(function(e){if(!m_(e))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),k_(o,e,n,f_)},e})),(0,s.addFilter)("editor.BlockEdit","core/style/with-block-controls",__),(0,s.addFilter)("editor.BlockListBlock","core/editor/with-elements-styles",y_);(0,s.addFilter)("blocks.registerBlockType","core/settings/addAttribute",(function(e){var t,n;return n=e,(0,a.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 E_=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"M12 4 4 19h16L12 4zm0 3.2 5.5 10.3H12V7.2z"}));var C_=function(e){let t,{colorPalette:n,duotonePalette:o,disableCustomColors:r,disableCustomDuotone:l,value:i,onChange:a}=e;return t="unset"===i?(0,u.createElement)(h.ColorIndicator,{className:"block-editor-duotone-control__unset-indicator"}):i?(0,u.createElement)(h.DuotoneSwatch,{values:i}):(0,u.createElement)(Jl,{icon:E_}),(0,u.createElement)(h.Dropdown,{popoverProps:{className:"block-editor-duotone-control__popover",headerTitle:(0,_.__)("Duotone"),variant:"toolbar"},renderToggle:e=>{let{isOpen:n,onToggle:o}=e;return(0,u.createElement)(h.ToolbarButton,{showTooltip:!0,onClick:o,"aria-haspopup":"true","aria-expanded":n,onKeyDown:e=>{n||e.keyCode!==Qu.DOWN||(e.preventDefault(),o())},label:(0,_.__)("Apply duotone filter"),icon:t})},renderContent:()=>(0,u.createElement)(h.MenuGroup,{label:(0,_.__)("Duotone")},(0,u.createElement)("div",{className:"block-editor-duotone-control__description"},(0,_.__)("Create a two-tone color effect without losing your original image.")),(0,u.createElement)(h.DuotonePicker,{colorPalette:n,duotonePalette:o,disableCustomColors:r,disableCustomDuotone:l,value:i,onChange:a}))})};const S_=[];function w_(e){let{selector:t,id:n,colors:o}=e;return"unset"===o?(0,u.createElement)(Wp,{selector:t}):(0,u.createElement)(u.Fragment,null,(0,u.createElement)(Kp,{id:n,colors:o}),(0,u.createElement)(jp,{id:n,selector:t}))}function B_(e){let{presetSetting:t,defaultSetting:n}=e;const o=!fr(n),r=fr(`${t}.custom`)||S_,l=fr(`${t}.theme`)||S_,i=fr(`${t}.default`)||S_;return(0,u.useMemo)((()=>[...r,...l,...o?S_:i]),[o,r,l,i])}function I_(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=B_({presetSetting:"color.duotone",defaultSetting:"color.defaultDuotone"}),a=B_({presetSetting:"color.palette",defaultSetting:"color.defaultPalette"}),s=!fr("color.custom"),c=!fr("color.customDuotone")||0===(null==a?void 0:a.length)&&s;return 0===(null==i?void 0:i.length)&&c?null:(0,u.createElement)(Vo,{group:"block",__experimentalShareWithChildBlocks:!0},(0,u.createElement)(C_,{duotonePalette:i,colorPalette:a,disableCustomDuotone:c,disableCustomColors:s,value:l,onChange:e=>{const t={...r,color:{...null==r?void 0:r.color,duotone:e}};o({style:t})}}))}fp([hp]);const x_=(0,m.createHigherOrderComponent)((e=>t=>{const n=(0,a.hasBlockSupport)(t.name,"color.__experimentalDuotone"),o=(0,g.useSelect)((e=>e(To).__unstableGetContentLockingParent(t.clientId)),[t.clientId]);return(0,u.createElement)(u.Fragment,null,(0,u.createElement)(e,t),n&&!o&&(0,u.createElement)(I_,t))}),"withDuotoneControls");const T_=(0,m.createHigherOrderComponent)((e=>t=>{var n,o,r;const l=(0,a.getBlockSupport)(t.name,"color.__experimentalDuotone"),i=null==t||null===(n=t.attributes)||void 0===n||null===(o=n.style)||void 0===o||null===(r=o.color)||void 0===r?void 0:r.duotone;if(!l||!i)return(0,u.createElement)(e,t);const s=`wp-duotone-${(0,m.useInstanceId)(e)}`,d=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 .${s}`,l),g=p()(null==t?void 0:t.className,s),f=(0,u.useContext)(Wv.__unstableElementContext);return(0,u.createElement)(u.Fragment,null,f&&(0,u.createPortal)((0,u.createElement)(w_,{selector:d,id:s,colors:i}),f),(0,u.createElement)(e,c({},t,{className:g})))}),"withDuotoneStyles");(0,s.addFilter)("blocks.registerBlockType","core/editor/duotone/add-attributes",(function(e){return(0,a.hasBlockSupport)(e,"color.__experimentalDuotone")?(e.attributes.style||Object.assign(e.attributes,{style:{type:"object"}}),e):e})),(0,s.addFilter)("editor.BlockEdit","core/editor/duotone/with-editor-controls",x_),(0,s.addFilter)("editor.BlockListBlock","core/editor/duotone/with-styles",T_);const M_="__experimentalLayout";function N_(){var e,t;let n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const o=(0,g.useSelect)((e=>{var t;const{getSettings:n}=e(To);return null===(t=n().__experimentalFeatures)||void 0===t?void 0:t.useRootPaddingAwareAlignments}),[]),r=fr("layout")||{},{attributes:l={},name:i}=n,{layout:s}=l,{default:c}=(0,a.getBlockSupport)(i,M_)||{},u=null!=s&&s.inherit||null!=s&&s.contentSize||null!=s&&s.wideSize?{...s,type:"constrained"}:s||c||{},d=[];var p,m;null!=r&&null!==(e=r.definitions)&&void 0!==e&&null!==(t=e[(null==u?void 0:u.type)||"default"])&&void 0!==t&&t.className&&d.push(null==r||null===(p=r.definitions)||void 0===p||null===(m=p[(null==u?void 0:u.type)||"default"])||void 0===m?void 0:m.className);return(null!=u&&u.inherit||null!=u&&u.contentSize||"constrained"===(null==u?void 0:u.type))&&o&&d.push("has-global-padding"),null!=u&&u.orientation&&d.push(`is-${(0,f.kebabCase)(u.orientation)}`),null!=u&&u.justifyContent&&d.push(`is-content-justification-${(0,f.kebabCase)(u.justifyContent)}`),null!=u&&u.flexWrap&&"nowrap"===u.flexWrap&&d.push("is-nowrap"),d}function P_(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;const{attributes:o={},name:r}=t,{layout:l={},style:i={}}=o,a=null!=l&&l.inherit||null!=l&&l.contentSize||null!=l&&l.wideSize?{...l,type:"constrained"}:l||{},s=li((null==a?void 0:a.type)||"default"),c=fr("layout")||{},u=fr("spacing.blockGap"),d=null!==u,p=null==s||null===(e=s.getLayoutStyle)||void 0===e?void 0:e.call(s,{blockName:r,selector:n,layout:l,layoutDefinitions:null==c?void 0:c.definitions,style:i,hasBlockGapSupport:d});return p}function L_(e){let{setAttributes:t,attributes:n,name:o}=e;const{layout:r}=n,l=fr("layout"),i=(0,g.useSelect)((e=>{const{getSettings:t}=e(To);return t().supportsLayout}),[]),s=(0,a.getBlockSupport)(o,M_,{}),{allowSwitching:c,allowEditing:d=!0,allowInheriting:p=!0,default:m}=s;if(!d)return null;const f=!(!p||!l||null!=r&&r.type&&"default"!==(null==r?void 0:r.type)&&"constrained"!==(null==r?void 0:r.type)&&(null==r||!r.inherit)),v=r||m||{},{inherit:b=!1,type:k="default",contentSize:y=null}=v;if(("default"===k||"constrained"===k)&&!i)return null;const E=li(k),C=li("constrained"),S=!v.type&&(y||b),w=!!b||!!y,B=e=>t({layout:e});return(0,u.createElement)(u.Fragment,null,(0,u.createElement)(jr,null,(0,u.createElement)(h.PanelBody,{title:(0,_.__)("Layout")},f&&(0,u.createElement)(u.Fragment,null,(0,u.createElement)(h.ToggleControl,{className:"block-editor-hooks__toggle-control",label:(0,_.__)("Inner blocks use content width"),checked:"constrained"===(null==E?void 0:E.name)||w,onChange:()=>t({layout:{type:"constrained"===(null==E?void 0:E.name)||w?"default":"constrained"}}),help:"constrained"===(null==E?void 0:E.name)||w?(0,_.__)("Nested blocks use content width with options for full and wide widths."):(0,_.__)("Nested blocks will fill the width of this container. Toggle to constrain.")})),!b&&c&&(0,u.createElement)(R_,{type:k,onChange:e=>t({layout:{type:e}})}),E&&"default"!==E.name&&(0,u.createElement)(E.inspectorControls,{layout:v,onChange:B,layoutBlockSupport:s}),C&&S&&(0,u.createElement)(C.inspectorControls,{layout:v,onChange:B,layoutBlockSupport:s}))),!b&&E&&(0,u.createElement)(E.toolBarControls,{layout:v,onChange:B,layoutBlockSupport:s}))}function R_(e){let{type:t,onChange:n}=e;return(0,u.createElement)(h.ButtonGroup,null,ri.map((e=>{let{name:o,label:r}=e;return(0,u.createElement)(h.Button,{key:o,isPressed:t===o,onClick:()=>n(o)},r)})))}const A_=(0,m.createHigherOrderComponent)((e=>t=>{const{name:n}=t;return[(0,a.hasBlockSupport)(n,M_)&&(0,u.createElement)(L_,c({key:"layout"},t)),(0,u.createElement)(e,c({key:"edit"},t))]}),"withInspectorControls"),O_=(0,m.createHigherOrderComponent)((e=>t=>{const{name:n,attributes:o,block:r}=t,l=(0,a.hasBlockSupport)(n,M_),i=(0,g.useSelect)((e=>{const{getSettings:t}=e(To);return!!t().disableLayoutStyles})),s=l&&!i,d=(0,m.useInstanceId)(e),f=fr("layout")||{},h=(0,u.useContext)(Wv.__unstableElementContext),{layout:v}=o,{default:b}=(0,a.getBlockSupport)(n,M_)||{},k=null!=v&&v.inherit||null!=v&&v.contentSize||null!=v&&v.wideSize?{...v,type:"constrained"}:v||b||{},_=l?N_(r):null,y=`.wp-container-${d}.wp-container-${d}`,E=null!==fr("spacing.blockGap");let C;if(s){var S;const e=li((null==k?void 0:k.type)||"default");C=null==e||null===(S=e.getLayoutStyle)||void 0===S?void 0:S.call(e,{blockName:n,selector:y,layout:k,layoutDefinitions:null==f?void 0:f.definitions,style:null==o?void 0:o.style,hasBlockGapSupport:E})}const w=p()({[`wp-container-${d}`]:s&&!!C},_);return(0,u.createElement)(u.Fragment,null,s&&h&&!!C&&(0,u.createPortal)((0,u.createElement)(ui,{blockName:n,selector:y,css:C,layout:k,style:null==o?void 0:o.style}),h),(0,u.createElement)(e,c({},t,{__unstableLayoutClassNames:w})))})),D_=(0,m.createHigherOrderComponent)((e=>t=>{const{attributes:n}=t,{style:{layout:o={}}={}}=n,{selfStretch:r,flexSize:l}=o,i=r||l,a=(0,g.useSelect)((e=>{const{getSettings:t}=e(To);return!!t().disableLayoutStyles})),s=i&&!a,d=(0,u.useContext)(Wv.__unstableElementContext),f=(0,m.useInstanceId)(e),h=`.wp-container-content-${f}`;let v="";"fixed"===r&&l?v+=`${h} {\n\t\t\t\tflex-basis: ${l};\n\t\t\t\tbox-sizing: border-box;\n\t\t\t}`:"fill"===r&&(v+=`${h} {\n\t\t\t\tflex-grow: 1;\n\t\t\t}`);const b=p()(null==t?void 0:t.className,{[`wp-container-content-${f}`]:s&&!!v});return(0,u.createElement)(u.Fragment,null,s&&d&&!!v&&(0,u.createPortal)((0,u.createElement)("style",null,v),d),(0,u.createElement)(e,c({},t,{className:b})))}));function z_(e){let{clientId:t,stopEditingAsBlock:n}=e;const o=(0,g.useSelect)((e=>{const{isBlockSelected:n,hasSelectedInnerBlock:o}=e(To);return n(t)||o(t,!0)}),[t]);return(0,u.useEffect)((()=>{o||n()}),[o]),null}(0,s.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,a.hasBlockSupport)(e,M_)&&(e.attributes={...e.attributes,layout:{type:"object"}}),e})),(0,s.addFilter)("editor.BlockListBlock","core/editor/layout/with-layout-styles",O_),(0,s.addFilter)("editor.BlockListBlock","core/editor/layout/with-child-layout-styles",D_),(0,s.addFilter)("editor.BlockEdit","core/editor/layout/with-inspector-controls",A_);const F_=(0,m.createHigherOrderComponent)((e=>t=>{const{getBlockListSettings:n,getSettings:o}=(0,g.useSelect)(To),r=(0,u.useRef)(),{templateLock:l,isLockedByParent:i,isEditingAsBlocks:a}=(0,g.useSelect)((e=>{const{__unstableGetContentLockingParent:n,getTemplateLock:o,__unstableGetTemporarilyEditingAsBlocks:r}=e(To);return{templateLock:o(t.clientId),isLockedByParent:!!n(t.clientId),isEditingAsBlocks:r()===t.clientId}}),[t.clientId]),{updateSettings:s,updateBlockListSettings:d,__unstableSetTemporarilyEditingAsBlocks:m}=(0,g.useDispatch)(To),f=!i&&"contentOnly"===l,{__unstableMarkNextChangeAsNotPersistent:v,updateBlockAttributes:b}=(0,g.useDispatch)(To),k=(0,u.useCallback)((()=>{v(),b(t.clientId,{templateLock:"contentOnly"}),d(t.clientId,{...n(t.clientId),templateLock:"contentOnly"}),s({focusMode:r.current}),m()}),[t.clientId,r,s,d,n,v,b,m]);return f||a?(0,u.createElement)(u.Fragment,null,a&&!f&&(0,u.createElement)(u.Fragment,null,(0,u.createElement)(z_,{clientId:t.clientId,stopEditingAsBlock:k}),(0,u.createElement)(Vo,{group:"other"},(0,u.createElement)(h.ToolbarButton,{onClick:()=>{k()}},(0,_.__)("Done")))),!a&&f&&t.isSelected&&(0,u.createElement)(zh,null,(e=>{let{onClose:l}=e;return(0,u.createElement)(h.MenuItem,{onClick:()=>{v(),b(t.clientId,{templateLock:void 0}),d(t.clientId,{...n(t.clientId),templateLock:!1}),r.current=o().focusMode,s({focusMode:!0}),m(t.clientId),l()}},(0,_.__)("Modify"))})),(0,u.createElement)(e,c({},t,{className:p()(t.className,a&&"is-content-locked-editing-as-blocks")}))):(0,u.createElement)(e,t)}),"withToolbarControls");(0,s.addFilter)("editor.BlockEdit","core/content-lock-ui/with-block-controls",F_);const V_="metadata";function H_(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if(!e.name.startsWith("core/"))return!1;const n=(0,a.getBlockSupport)(e,"__experimentalMetadata");return!!(!0===n||null!=n&&n[t])}function G_(e){var t;const n=(null===(t=e.style)||void 0===t?void 0:t.border)||{};return{className:Eb(e)||void 0,style:g_({border:n})}}function U_(e){const{colors:t}=db(),n=G_(e),{borderColor:o}=e;if(o){const e=hb({colors:t,namedColor:o});n.style.borderColor=e.color}return n}function $_(e){var t,n,o,r,l,i;const{backgroundColor:a,textColor:s,gradient:c,style:u}=e,d=ub("background-color",a),m=ub("color",s),g=Sb(c),f=g||(null==u||null===(t=u.color)||void 0===t?void 0:t.gradient);return{className:p()(m,g,{[d]:!f&&!!d,"has-text-color":s||(null==u||null===(n=u.color)||void 0===n?void 0:n.text),"has-background":a||(null==u||null===(o=u.color)||void 0===o?void 0:o.background)||c||(null==u||null===(r=u.color)||void 0===r?void 0:r.gradient),"has-link-color":null==u||null===(l=u.elements)||void 0===l||null===(i=l.link)||void 0===i?void 0:i.color})||void 0,style:g_({color:(null==u?void 0:u.color)||{}})}}(0,s.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||H_(e,"name")&&(e.attributes={...e.attributes,[V_]:{type:"object"}}),e})),(0,s.addFilter)("blocks.getSaveContent.extraProps","core/metadata/save-props",(function(e,t,n){return H_(t)&&(e.metadata=n.metadata),e})),(0,s.addFilter)("blocks.registerBlockType","core/metadata/addLabelCallback",(function(e){return e.__experimentalLabel||H_(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 j_={};function W_(e){const{backgroundColor:t,textColor:n,gradient:o}=e,r=fr("color.palette.custom"),l=fr("color.palette.theme"),i=fr("color.palette.default"),a=fr("color.gradients")||j_,s=(0,u.useMemo)((()=>[...r||[],...l||[],...i||[]]),[r,l,i]),c=(0,u.useMemo)((()=>[...(null==a?void 0:a.custom)||[],...(null==a?void 0:a.theme)||[],...(null==a?void 0:a.default)||[]]),[a]),d=$_(e);if(t){const e=sb(s,t);d.style.backgroundColor=e.color}if(o&&(d.style.background=wb(c,o)),n){const e=sb(s,n);d.style.color=e.color}return d}function K_(e){const{style:t}=e;return{style:g_({spacing:(null==t?void 0:t.spacing)||{}})}}function q_(e,t){var n;let o=(null==e||null===(n=e.style)||void 0===n?void 0:n.typography)||{};if(t&&(!0===t||0!==Object.keys(t).length)){var r,l,i,a;const n=Lk({fontSize:null==e||null===(r=e.style)||void 0===r||null===(l=r.typography)||void 0===l?void 0:l.fontSize,minimumFontSizeLimit:null==t?void 0:t.minFontSize})||(null==e||null===(i=e.style)||void 0===i||null===(a=i.typography)||void 0===a?void 0:a.fontSize);o={...o,fontSize:n}}const s=g_({typography:o}),c=null!=e&&e.fontFamily?`has-${(0,f.kebabCase)(e.fontFamily)}-font-family`:"";return{className:p()(c,Ik(null==e?void 0:e.fontSize)),style:s}}function Y_(e){const[t,n]=(0,u.useState)(e);return(0,u.useEffect)((()=>{e&&n(e)}),[e]),t}const Z_=e=>{let[t,...n]=e;return t.toUpperCase()+n.join("")},Q_=e=>(0,m.createHigherOrderComponent)((t=>n=>(0,u.createElement)(t,c({},n,{colors:e}))),"withCustomColorPalette"),X_=()=>(0,m.createHigherOrderComponent)((e=>t=>{const n=fr("color.palette.custom"),o=fr("color.palette.theme"),r=fr("color.palette.default"),l=(0,u.useMemo)((()=>[...n||[],...o||[],...r||[]]),[n,o,r]);return(0,u.createElement)(e,c({},t,{colors:l}))}),"withEditorColorPalette");function J_(e,t){const n=e.reduce(((e,t)=>({...e,..."string"==typeof t?{[t]:(0,f.kebabCase)(t)}:t})),{});return(0,m.compose)([t,e=>class extends u.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=mp(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 Object.keys(n).reduce(((e,t)=>{const n=Z_(t),o=`custom${n}`;return e[`set${n}`]=this.createSetColor(t,o),e}),{})}createSetColor(e,t){return n=>{const o=cb(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 Object.entries(n).reduce(((e,n)=>{let[l,i]=n;const a=sb(r,o[l],o[`custom${Z_(l)}`]),s=t[l];return(null==s?void 0:s.color)===a.color&&s?e[l]=s:e[l]={...a,class:ub(i,a.slug)},e}),{})}render(){return(0,u.createElement)(e,c({},this.props,{colors:void 0},this.state,this.setters,{colorUtils:this.colorUtils}))}}])}function ey(e){return function(){const t=Q_(e);for(var n=arguments.length,o=new Array(n),r=0;r{let[t,...n]=e;return t.toUpperCase()+n.join("")};var ry=function(){for(var e=arguments.length,t=new Array(e),n=0;n(e[t]=`custom${oy(t)}`,e)),{});return(0,m.createHigherOrderComponent)((0,m.compose)([(0,m.createHigherOrderComponent)((e=>t=>{const n=fr("typography.fontSizes")||ny;return(0,u.createElement)(e,c({},t,{fontSizes:n}))}),"withFontSizes"),e=>class extends u.Component{constructor(e){super(e),this.setters=this.createSetters(),this.state={}}createSetters(){return Object.entries(o).reduce(((e,t)=>{let[n,o]=t;return e[`set${oy(n)}`]=this.createSetFontSize(n,o),e}),{})}createSetFontSize(e,t){return n=>{var o;const r=null===(o=this.props.fontSizes)||void 0===o?void 0:o.find((e=>{let{size:t}=e;return t===Number(n)}));this.props.setAttributes({[e]:r&&r.slug?r.slug:void 0,[t]:r&&r.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(!Object.values(o).some(l))return null;const i=Object.entries(o).filter((e=>{let[t,n]=e;return l(n,t)})).reduce(((e,t)=>{let[o,l]=t;const i=n[o],a=wk(r,i,n[l]);return e[o]={...a,class:Ik(i)},e}),{});return{...t,...i}}render(){return(0,u.createElement)(e,c({},this.props,{fontSizes:void 0},this.state,this.setters))}}]),"withFontSizes")};var ly=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"M4 19.8h8.9v-1.5H4v1.5zm8.9-15.6H4v1.5h8.9V4.2zm-8.9 7v1.5h16v-1.5H4z"}));var iy=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"M16.4 4.2H7.6v1.5h8.9V4.2zM4 11.2v1.5h16v-1.5H4zm3.6 8.6h8.9v-1.5H7.6v1.5z"}));var ay=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"M11.1 19.8H20v-1.5h-8.9v1.5zm0-15.6v1.5H20V4.2h-8.9zM4 12.8h16v-1.5H4v1.5z"}));const sy=[{icon:ly,title:(0,_.__)("Align text left"),align:"left"},{icon:iy,title:(0,_.__)("Align text center"),align:"center"},{icon:ay,title:(0,_.__)("Align text right"),align:"right"}],cy={position:"bottom right",variant:"toolbar"};var uy=function(e){let{value:t,onChange:n,alignmentControls:o=sy,label:r=(0,_.__)("Align text"),describedBy:l=(0,_.__)("Change text alignment"),isCollapsed:i=!0,isToolbar:a}=e;function s(e){return()=>n(t===e?void 0:e)}const d=o.find((e=>e.align===t)),p=a?h.ToolbarGroup:h.ToolbarDropdownMenu,m=a?{isCollapsed:i}:{toggleProps:{describedBy:l},popoverProps:cy};return(0,u.createElement)(p,c({icon:d?d.icon:(0,_.isRTL)()?ay:ly,label:r,controls:o.map((e=>{const{align:n}=e,o=t===n;return{...e,isActive:o,role:i?"menuitemradio":void 0,onClick:s(n)}}))},m))};const dy=e=>(0,u.createElement)(uy,c({},e,{isToolbar:!1})),py=e=>(0,u.createElement)(uy,c({},e,{isToolbar:!0})),my=()=>{};var gy={name:"blocks",className:"block-editor-autocompleters__block",triggerPrefix:"/",useItems(e){const{rootClientId:t,selectedBlockName:n}=(0,g.useSelect)((e=>{const{getSelectedBlockClientId:t,getBlockName:n,getBlockInsertionPoint:o}=e(To),r=t();return{selectedBlockName:r?n(r):null,rootClientId:o().rootClientId}}),[]),[o,r,l]=pm(t,my),i=(0,u.useMemo)((()=>(e.trim()?$m(o,r,l,e):Y(o,"frecency","desc")).filter((e=>e.name!==n)).slice(0,9)),[e,n,o,r,l]),a=(0,u.useMemo)((()=>i.map((e=>{const{title:t,icon:n,isDisabled:o}=e;return{key:`block-${e.id}`,value:e,label:(0,u.createElement)(u.Fragment,null,(0,u.createElement)(fd,{key:"icon",icon:n,showColors:!0}),t),isDisabled:o}}))),[i]);return[a]},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,a.createBlock)(t,n,(0,a.createBlocksFromInnerBlocksTemplate)(o))}}},fy=window.wp.apiFetch,hy=n.n(fy);var vy=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.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 by=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.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 ky={name:"links",className:"block-editor-autocompleters__link",triggerPrefix:"[[",options:async e=>{let t=await hy()({path:(0,rg.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,u.createElement)(u.Fragment,null,(0,u.createElement)(Jl,{key:"icon",icon:"page"===e.subtype?vy:by}),e.title)},getOptionCompletion(e){return(0,u.createElement)("a",{href:e.url},e.title)}};const _y=[];function yy(e){let{completers:t=_y}=e;const{name:n}=Ro();return(0,u.useMemo)((()=>{let e=[...t,ky];return(n===(0,a.getDefaultBlockName)()||(0,a.getBlockSupport)(n,"__experimentalSlashInserter",!1))&&(e=[...e,gy]),(0,s.hasFilter)("editor.Autocomplete.completers")&&(e===t&&(e=e.map((e=>({...e})))),e=(0,s.applyFilters)("editor.Autocomplete.completers",e,n)),e}),[t,n])}var Ey=function(e){return(0,u.createElement)(h.Autocomplete,c({},e,{completers:yy(e)}))};var Cy=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.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 Sy=function(e){let{isActive:t,label:n=(0,_.__)("Toggle full height"),onToggle:o,isDisabled:r}=e;return(0,u.createElement)(h.ToolbarButton,{isActive:t,icon:Cy,label:n,onClick:()=>o(!t),disabled:r})};const wy=()=>{};var By=function(e){const{label:t=(0,_.__)("Change matrix alignment"),onChange:n=wy,value:o="center",isDisabled:r}=e,l=(0,u.createElement)(h.__experimentalAlignmentMatrixControl.Icon,{value:o});return(0,u.createElement)(h.Dropdown,{popoverProps:{variant:"toolbar",placement:"bottom-start"},renderToggle:e=>{let{onToggle:n,isOpen:o}=e;return(0,u.createElement)(h.ToolbarButton,{onClick:n,"aria-haspopup":"true","aria-expanded":o,onKeyDown:e=>{o||e.keyCode!==Qu.DOWN||(e.preventDefault(),n())},label:t,icon:l,showTooltip:!0,disabled:r})},renderContent:()=>(0,u.createElement)(h.__experimentalAlignmentMatrixControl,{hasFocusBorder:!1,onChange:n,value:o})})};var Iy=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.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 xy=function(e){let{rootLabelText:t}=e;const{selectBlock:n,clearSelectedBlock:o}=(0,g.useDispatch)(To),{clientId:r,parents:l,hasSelection:i}=(0,g.useSelect)((e=>{const{getSelectionStart:t,getSelectedBlockClientId:n,getBlockParents:o}=e(To),r=n();return{parents:o(r),clientId:r,hasSelection:!!t().clientId}}),[]),a=t||(0,_.__)("Document");return(0,u.createElement)("ul",{className:"block-editor-block-breadcrumb",role:"list","aria-label":(0,_.__)("Block breadcrumb")},(0,u.createElement)("li",{className:i?void 0:"block-editor-block-breadcrumb__current","aria-current":i?void 0:"true"},i&&(0,u.createElement)(h.Button,{className:"block-editor-block-breadcrumb__button",variant:"tertiary",onClick:o},a),!i&&a,!!r&&(0,u.createElement)(Jl,{icon:Iy,className:"block-editor-block-breadcrumb__separator"})),l.map((e=>(0,u.createElement)("li",{key:e},(0,u.createElement)(h.Button,{className:"block-editor-block-breadcrumb__button",variant:"tertiary",onClick:()=>n(e)},(0,u.createElement)(af,{clientId:e,maximumLength:35})),(0,u.createElement)(Jl,{icon:Iy,className:"block-editor-block-breadcrumb__separator"})))),!!r&&(0,u.createElement)("li",{className:"block-editor-block-breadcrumb__current","aria-current":"true"},(0,u.createElement)(af,{clientId:r,maximumLength:35})))};const Ty=()=>(0,u.createElement)(h.SVG,{xmlns:"https://www.w3.org/2000/svg",viewBox:"0 0 20 20"},(0,u.createElement)(h.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"})),My=e=>{let{style:t,className:n}=e;return(0,u.createElement)("div",{className:"block-library-colors-selector__icon-container"},(0,u.createElement)("div",{className:`${n} block-library-colors-selector__state-selection`,style:t},(0,u.createElement)(Ty,null)))},Ny=e=>{let{TextColor:t,BackgroundColor:n}=e;return e=>{let{onToggle:o,isOpen:r}=e;return(0,u.createElement)(h.ToolbarGroup,null,(0,u.createElement)(h.ToolbarButton,{className:"components-toolbar__control block-library-colors-selector__toggle",label:(0,_.__)("Open Colors Selector"),onClick:o,onKeyDown:e=>{r||e.keyCode!==Qu.DOWN||(e.preventDefault(),o())},icon:(0,u.createElement)(n,null,(0,u.createElement)(t,null,(0,u.createElement)(My,null)))}))}};var Py=e=>{let{children:t,...n}=e;return W()("wp.blockEditor.BlockColorsStyleSelector",{alternative:"block supports API",since:"6.1",version:"6.3"}),(0,u.createElement)(h.Dropdown,{popoverProps:{placement:"bottom-start"},className:"block-library-colors-selector",contentClassName:"block-library-colors-selector__popover",renderToggle:Ny(n),renderContent:()=>t})};var Ly=(0,u.createElement)(G.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,u.createElement)(G.Path,{d:"M13.8 5.2H3v1.5h10.8V5.2zm-3.6 12v1.5H21v-1.5H10.2zm7.2-6H6.6v1.5h10.8v-1.5z"}));const Ry=Ru(h.__experimentalTreeGridRow);var Ay=(0,u.forwardRef)(((e,t)=>{let{isSelected:n,position:o,level:r,rowCount:l,children:i,className:a,path:s,...d}=e;const g=Du({isSelected:n,adjustScrolling:!1,enableAnimation:!0,triggerAnimationOnChange:s}),f=(0,m.useMergeRefs)([t,g]);return(0,u.createElement)(Ry,c({ref:f,className:p()("block-editor-list-view-leaf",a),level:r,positionInSet:o,setSize:l},d),i)}));var Oy=(0,u.createElement)(G.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,u.createElement)(G.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M15 11h-.2V9c0-1.5-1.2-2.8-2.8-2.8S9.2 7.5 9.2 9v2H9c-.6 0-1 .4-1 1v4c0 .6.4 1 1 1h6c.6 0 1-.4 1-1v-4c0-.6-.4-1-1-1zm-1.8 0h-2.5V9c0-.7.6-1.2 1.2-1.2s1.2.6 1.2 1.2v2z"}));var Dy=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"m13.1 16-3.4-4 3.4-4 1.1 1-2.6 3 2.6 3-1.1 1z"}));function zy(e){let{onClick:t}=e;return(0,u.createElement)("span",{className:"block-editor-list-view__expander",onClick:e=>t(e,{forceToggle:!0}),"aria-hidden":"true"},(0,u.createElement)(Jl,{icon:(0,_.isRTL)()?Dy:Iy}))}var Fy=(0,u.forwardRef)((function(e,t){let{className:n,block:{clientId:o},onClick:r,onToggleExpanded:l,tabIndex:i,onFocus:a,onDragStart:s,onDragEnd:c,draggable:d}=e;const m=rf(o),g=lf({clientId:o,context:"list-view"}),{isLocked:f}=Ih(o);return(0,u.createElement)(u.Fragment,null,(0,u.createElement)(h.Button,{className:p()("block-editor-list-view-block-select-button",n),onClick:r,onKeyDown:function(e){e.keyCode!==Qu.ENTER&&e.keyCode!==Qu.SPACE||r(e)},ref:t,tabIndex:i,onFocus:a,onDragStart:e=>{e.dataTransfer.clearData(),null==s||s(e)},onDragEnd:c,draggable:d,href:`#block-${o}`,"aria-hidden":!0},(0,u.createElement)(zy,{onClick:l}),(0,u.createElement)(fd,{icon:null==m?void 0:m.icon,showColors:!0}),(0,u.createElement)(h.__experimentalHStack,{alignment:"center",className:"block-editor-list-view-block-select-button__label-wrapper",justify:"flex-start",spacing:1},(0,u.createElement)("span",{className:"block-editor-list-view-block-select-button__title"},(0,u.createElement)(h.__experimentalTruncate,{ellipsizeMode:"auto"},g)),(null==m?void 0:m.anchor)&&(0,u.createElement)("span",{className:"block-editor-list-view-block-select-button__anchor-wrapper"},(0,u.createElement)(h.__experimentalTruncate,{className:"block-editor-list-view-block-select-button__anchor",ellipsizeMode:"auto"},m.anchor)),f&&(0,u.createElement)("span",{className:"block-editor-list-view-block-select-button__lock"},(0,u.createElement)(Jl,{icon:Oy})))))}));const Vy=(0,u.forwardRef)(((e,t)=>{let{onClick:n,onToggleExpanded:o,block:r,isSelected:l,position:i,siblingBlockCount:a,level:s,isExpanded:d,selectedClientIds:m,...f}=e;const{clientId:h}=r,{blockMovingClientId:v,selectedBlockInBlockEditor:b}=(0,g.useSelect)((e=>{const{hasBlockMovingClientId:t,getSelectedBlockClientId:n}=e(To);return{blockMovingClientId:t(),selectedBlockInBlockEditor:n()}}),[h]),k=v&&b===h,_=p()("block-editor-list-view-block-contents",{"is-dropping-before":k}),y=m.includes(h)?m:[h];return(0,u.createElement)(sf,{clientIds:y},(e=>{let{draggable:p,onDragStart:m,onDragEnd:g}=e;return(0,u.createElement)(Fy,c({ref:t,className:_,block:r,onClick:n,onToggleExpanded:o,isSelected:l,position:i,siblingBlockCount:a,level:s,draggable:p,onDragStart:m,onDragEnd:g,isExpanded:d},f))}))}));var Hy=Vy;const Gy=(0,u.createContext)({}),Uy=()=>(0,u.useContext)(Gy);var $y=(0,u.memo)((function e(t){let{block:n,isDragged:o,isSelected:r,isBranchSelected:l,selectBlock:i,position:s,level:c,rowCount:d,siblingBlockCount:f,showBlockMovers:v,path:b,isExpanded:k,selectedClientIds:y,preventAnnouncement:E,isSyncedBranch:C}=t;const S=(0,u.useRef)(null),w=(0,u.useRef)(null),[B,I]=(0,u.useState)(!1),{clientId:x}=n,{isLocked:T,isContentLocked:M,canEdit:N}=Ih(x),P=(0,g.useSelect)((e=>!r&&(!!M&&e(To).hasSelectedInnerBlock(x,!0))),[M,x,r]),L=!M&&N,R=P||r&&y[0]===x,A=P||r&&y[y.length-1]===x,{toggleBlockHighlight:O}=(0,g.useDispatch)(To),D=rf(x),z=(0,g.useSelect)((e=>e(To).getBlockName(x)),[x]),F=(0,a.hasBlockSupport)(z,"__experimentalToolbar",!0),V=`list-view-block-select-button__${(0,m.useInstanceId)(e)}`,H=((e,t,n)=>(0,_.sprintf)((0,_.__)("Block %1$d of %2$d, Level %3$d"),e,t,n))(s,f,c);let G=(0,_.__)("Link");D&&(G=T?(0,_.sprintf)((0,_.__)("%s link (locked)"),D.title):(0,_.sprintf)((0,_.__)("%s link"),D.title));const U=D?(0,_.sprintf)((0,_.__)("Options for %s block"),D.title):(0,_.__)("Options"),{isTreeGridMounted:$,expand:j,collapse:W}=Uy(),K=v&&f>0,q=p()("block-editor-list-view-block__mover-cell",{"is-visible":B||r}),Y=p()("block-editor-list-view-block__menu-cell",{"is-visible":B||R});(0,u.useEffect)((()=>{!$&&r&&S.current.focus()}),[]);const Z=(0,u.useCallback)((()=>{I(!0),O(x,!0)}),[x,I,O]),Q=(0,u.useCallback)((()=>{I(!1),O(x,!1)}),[x,I,O]),X=(0,u.useCallback)((e=>{i(e,x),e.preventDefault()}),[x,i]),J=(0,u.useCallback)((e=>{i(void 0,e)}),[i]),ee=(0,u.useCallback)((e=>{e.preventDefault(),e.stopPropagation(),!0===k?W(x):!1===k&&j(x)}),[x,j,W,k]);let te;K?te=2:F||(te=3);const ne=p()({"is-selected":r||P,"is-first-selected":R,"is-last-selected":A,"is-branch-selected":l,"is-synced-branch":C,"is-dragging":o,"has-single-cell":!F,"is-synced":null==D?void 0:D.isSynced}),oe=y.includes(x)?y:[x];return function(e){let{isSelected:t,selectedClientIds:n,rowItemRef:o}=e;const r=1===n.length;(0,u.useLayoutEffect)((()=>{if(!t||!r||!o.current)return;const e=(0,Ri.getScrollContainer)(o.current),{ownerDocument:n}=o.current;if(e===n.body||e===n.documentElement||!e)return;const l=o.current.getBoundingClientRect(),i=e.getBoundingClientRect();(l.topi.bottom)&&o.current.scrollIntoView()}),[t,r,o])}({isSelected:r,rowItemRef:w,selectedClientIds:y}),(0,u.createElement)(Ay,{className:ne,onMouseEnter:Z,onMouseLeave:Q,onFocus:Z,onBlur:Q,level:c,position:s,rowCount:d,path:b,id:`list-view-block-${x}`,"data-block":x,isExpanded:L?k:void 0,"aria-selected":!!r||P,ref:w},(0,u.createElement)(h.__experimentalTreeGridCell,{className:"block-editor-list-view-block__contents-cell",colSpan:te,ref:S,"aria-label":G,"aria-selected":!!r||P,"aria-expanded":L?k:void 0,"aria-describedby":V},(e=>{let{ref:t,tabIndex:o,onFocus:l}=e;return(0,u.createElement)("div",{className:"block-editor-list-view-block__contents-container"},(0,u.createElement)(Hy,{block:n,onClick:X,onToggleExpanded:ee,isSelected:r,position:s,siblingBlockCount:f,level:c,ref:t,tabIndex:o,onFocus:l,isExpanded:k,selectedClientIds:y,preventAnnouncement:E}),(0,u.createElement)("div",{className:"block-editor-list-view-block-select-button__description",id:V},H))})),K&&(0,u.createElement)(u.Fragment,null,(0,u.createElement)(h.__experimentalTreeGridCell,{className:q,withoutGridItem:!0},(0,u.createElement)(h.__experimentalTreeGridItem,null,(e=>{let{ref:t,tabIndex:n,onFocus:o}=e;return(0,u.createElement)(hf,{orientation:"vertical",clientIds:[x],ref:t,tabIndex:n,onFocus:o})})),(0,u.createElement)(h.__experimentalTreeGridItem,null,(e=>{let{ref:t,tabIndex:n,onFocus:o}=e;return(0,u.createElement)(vf,{orientation:"vertical",clientIds:[x],ref:t,tabIndex:n,onFocus:o})})))),F&&(0,u.createElement)(h.__experimentalTreeGridCell,{className:Y,"aria-selected":!!r||P},(e=>{let{ref:t,tabIndex:n,onFocus:o}=e;return(0,u.createElement)(Gh,{clientIds:oe,icon:sg,label:U,toggleProps:{ref:t,className:"block-editor-list-view-block__menu",tabIndex:n,onFocus:o},disableOpenOnArrowDown:!0,__experimentalSelectBlock:J})})))}));function jy(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(Wy(t,n,o),0):1}const Wy=(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+jy(r,e,t,n):o+1},Ky=()=>{};var qy=(0,u.memo)((function e(t){const{blocks:n,selectBlock:o=Ky,showBlockMovers:r,selectedClientIds:l,level:i=1,path:a="",isBranchSelected:s=!1,listPosition:c=0,fixedListWindow:d,isExpanded:p,parentId:m,shouldShowInnerBlocks:f=!0,isSyncedBranch:h=!1}=t,v=rf(m),b=h||!(null==v||!v.isSynced),k=(0,g.useSelect)((e=>{if(!m)return!0;const t="contentOnly"===e(To).getTemplateLock(m),n=e(To).canEditBlock(m);return!t&&n}),[m]),{expandedState:_,draggedClientIds:y}=Uy();if(!k)return null;const E=n.filter(Boolean),C=E.length;let S=c;return(0,u.createElement)(u.Fragment,null,E.map(((t,n)=>{var c;const{clientId:m,innerBlocks:h}=t;n>0&&(S+=jy(E[n-1],_,y,p));const{itemInView:v}=d,k=v(S),w=n+1,B=a.length>0?`${a}_${w}`:`${w}`,I=!(null==h||!h.length),x=I&&f?null!==(c=_[m])&&void 0!==c?c:p:void 0,T=!(null==y||!y.includes(m)),M=((e,t)=>Array.isArray(t)&&t.length?-1!==t.indexOf(e):t===e)(m,l),N=s||M&&I,P=T||k||M;return(0,u.createElement)(g.AsyncModeProvider,{key:m,value:!M},P&&(0,u.createElement)($y,{block:t,selectBlock:o,isSelected:M,isBranchSelected:N,isDragged:T,level:i,position:w,rowCount:C,siblingBlockCount:C,showBlockMovers:r,path:B,isExpanded:x,listPosition:S,selectedClientIds:l,isSyncedBranch:b}),!P&&(0,u.createElement)("tr",null,(0,u.createElement)("td",{className:"block-editor-list-view-placeholder"})),I&&x&&!T&&(0,u.createElement)(e,{parentId:m,blocks:h,selectBlock:o,showBlockMovers:r,level:i+1,path:B,listPosition:S+1,fixedListWindow:d,isBranchSelected:N,selectedClientIds:l,isExpanded:p,isSyncedBranch:b}))})))}));function Yy(e){let{listViewRef:t,blockDropTarget:n}=e;const{rootClientId:o,clientId:r,dropPosition:l}=n||{},[i,a]=(0,u.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]),s=a||i,c=(0,u.useCallback)((()=>{if(!i)return 0;const e=s.getBoundingClientRect();return i.querySelector(".block-editor-block-icon").getBoundingClientRect().right-e.left}),[i,s]),d=(0,u.useMemo)((()=>{if(!s)return{};const e=c();return{width:s.offsetWidth-e}}),[c,s]),p=(0,u.useMemo)((()=>{if(s&&("top"===l||"bottom"===l||"inside"===l))return{ownerDocument:s.ownerDocument,getBoundingClientRect(){const e=s.getBoundingClientRect(),t=c(),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,u=i-r;return new window.DOMRect(n,r,a,u)}}}),[s,l,c]);return s?(0,u.createElement)(h.Popover,{animate:!1,anchor:p,focusOnMount:!1,className:"block-editor-list-view-drop-indicator",variant:"unstyled"},(0,u.createElement)("div",{style:d,className:"block-editor-list-view-drop-indicator__line"})):null}function Zy(){const{clearSelectedBlock:e,multiSelect:t,selectBlock:n}=(0,g.useDispatch)(To),{getBlockName:o,getBlockParents:r,getBlockSelectionStart:l,getBlockSelectionEnd:i,getSelectedBlockClientIds:s,hasMultiSelection:c,hasSelectedBlock:d}=(0,g.useSelect)(To),{getBlockType:p}=(0,g.useSelect)(a.store);return{updateBlockSelection:(0,u.useCallback)((async(i,a,u)=>{if(null==i||!i.shiftKey)return void n(a);i.preventDefault();const m="keydown"===i.type&&(i.keyCode===Qu.UP||i.keyCode===Qu.DOWN||i.keyCode===Qu.HOME||i.keyCode===Qu.END);if(!m&&!d()&&!c())return void n(a,null);const g=s(),f=[...r(a),a];m&&!g.some((e=>f.includes(e)))&&await e();let h=l(),v=a;m&&(d()||c()||(h=a),u&&(v=u));const b=r(h),k=r(v),{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]}}(h,v,b,k);await t(y,E,null);const C=s();if((i.keyCode===Qu.HOME||i.keyCode===Qu.END)&&C.length>1)return;const S=g.filter((e=>!C.includes(e)));let w;if(1===S.length){var B;const e=null===(B=p(o(S[0])))||void 0===B?void 0:B.title;e&&(w=(0,_.sprintf)((0,_.__)("%s deselected."),e))}else S.length>1&&(w=(0,_.sprintf)((0,_.__)("%s blocks deselected."),S.length));w&&(0,pn.speak)(w)}),[e,o,p,r,l,i,s,c,d,t,n])}}const Qy=["top","bottom"];function Xy(){const{getBlockRootClientId:e,getBlockIndex:t,getBlockCount:n,getDraggedBlockClientIds:o,canInsertBlocks:r}=(0,g.useSelect)(To),[l,i]=(0,u.useState)(),{rootClientId:a,blockIndex:s}=l||{},c=Mv(a,s),d=o(),p=(0,m.useThrottle)((0,u.useCallback)(((o,l)=>{const a={x:o.clientX,y:o.clientY},s=!(null==d||!d.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]=Pv(t,a,Qy),u=Lv(t,a);if(void 0===r||s0||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&&d.includes(l),innerBlockCount:n(l),canInsertDraggedBlocksAsSibling:!s||r(d,i),canInsertDraggedBlocksAsChild:!s||r(d,l)}})),a);c&&i(c)}),[d]),200);return{ref:(0,m.__experimentalUseDropZone)({onDrop:c,onDragOver(e){p(e,e.currentTarget)},onDragEnd(){p.cancel(),i(null)}}),target:l}}const Jy=(e,t)=>Array.isArray(t.clientIds)?{...e,...t.clientIds.reduce(((e,n)=>({...e,[n]:"expand"===t.type})),{})}:e;var eE=(0,u.forwardRef)((function(e,t){let{id:n,blocks:o,showBlockMovers:r=!1,isExpanded:l=!1}=e;const{clientIdsTree:i,draggedClientIds:a,selectedClientIds:s}=function(e){return(0,g.useSelect)((t=>{const{getDraggedBlockClientIds:n,getSelectedBlockClientIds:o,__unstableGetClientIdsTree:r}=t(To);return{selectedClientIds:o(),draggedClientIds:n(),clientIdsTree:e||r()}}),[e])}(o),{visibleBlockCount:c,shouldShowInnerBlocks:d}=(0,g.useSelect)((e=>{const{getGlobalBlockCount:t,getClientIdsOfDescendants:n,__unstableGetEditorMode:o}=e(To),r=(null==a?void 0:a.length)>0?n(a).length+1:0;return{visibleBlockCount:t()-r,shouldShowInnerBlocks:"zoom-out"!==o()}}),[a]),{updateBlockSelection:p}=Zy(),[f,v]=(0,u.useReducer)(Jy,{}),{ref:b,target:k}=Xy(),y=(0,u.useRef)(),E=(0,m.useMergeRefs)([y,b,t]),C=(0,u.useRef)(!1),{setSelectedTreeId:S}=function(e){let{firstSelectedBlockClientId:t,setExpandedState:n}=e;const[o,r]=(0,u.useState)(null),{selectedBlockParentClientIds:l}=(0,g.useSelect)((e=>{const{getBlockParents:n}=e(To);return{selectedBlockParentClientIds:n(t,!1)}}),[t]),i=Array.isArray(l)&&l.length?l:null;return(0,u.useEffect)((()=>{o!==t&&i&&n({type:"expand",clientIds:l})}),[t]),{setSelectedTreeId:r}}({firstSelectedBlockClientId:s[0],setExpandedState:v}),w=(0,u.useCallback)(((e,t)=>{p(e,t),S(t)}),[S,p]);(0,u.useEffect)((()=>{C.current=!0}),[]);const[B]=(0,m.__experimentalUseFixedWindowList)(y,36,c,{useWindowing:!0,windowOverscan:40}),I=(0,u.useCallback)((e=>{e&&v({type:"expand",clientIds:[e]})}),[v]),x=(0,u.useCallback)((e=>{e&&v({type:"collapse",clientIds:[e]})}),[v]),T=(0,u.useCallback)((e=>{var t;I(null==e||null===(t=e.dataset)||void 0===t?void 0:t.block)}),[I]),M=(0,u.useCallback)((e=>{var t;x(null==e||null===(t=e.dataset)||void 0===t?void 0:t.block)}),[x]),N=(0,u.useCallback)(((e,t,n)=>{var o,r;e.shiftKey&&p(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)}),[p]),P=(0,u.useMemo)((()=>({isTreeGridMounted:C.current,draggedClientIds:a,expandedState:f,expand:I,collapse:x})),[C.current,a,f,I,x]);return(0,u.createElement)(g.AsyncModeProvider,{value:!0},(0,u.createElement)(Yy,{listViewRef:y,blockDropTarget:k}),(0,u.createElement)(h.__experimentalTreeGrid,{id:n,className:"block-editor-list-view-tree","aria-label":(0,_.__)("Block navigation structure"),ref:E,onCollapseRow:M,onExpandRow:T,onFocusRow:N,applicationAriaLabel:(0,_.__)("Block navigation structure")},(0,u.createElement)(Gy.Provider,{value:P},(0,u.createElement)(qy,{blocks:i,selectBlock:w,showBlockMovers:r,fixedListWindow:B,selectedClientIds:s,isExpanded:l,shouldShowInnerBlocks:d}))))}));function tE(e){let{isEnabled:t,onToggle:n,isOpen:o,innerRef:r,...l}=e;return(0,u.createElement)(h.Button,c({},l,{ref:r,icon:Ly,"aria-expanded":o,"aria-haspopup":"true",onClick:t?n:void 0,label:(0,_.__)("List view"),className:"block-editor-block-navigation","aria-disabled":!t}))}var nE=(0,u.forwardRef)((function(e,t){let{isDisabled:n,...o}=e;W()("wp.blockEditor.BlockNavigationDropdown",{since:"6.1",alternative:"wp.components.Dropdown and wp.blockEditor.ListView"});const r=(0,g.useSelect)((e=>!!e(To).getBlockCount()),[])&&!n;return(0,u.createElement)(h.Dropdown,{contentClassName:"block-editor-block-navigation__popover",popoverProps:{placement:"bottom-start"},renderToggle:e=>{let{isOpen:n,onToggle:l}=e;return(0,u.createElement)(tE,c({},o,{innerRef:t,isOpen:n,onToggle:l,isEnabled:r}))},renderContent:()=>(0,u.createElement)("div",{className:"block-editor-block-navigation__container"},(0,u.createElement)("p",{className:"block-editor-block-navigation__label"},(0,_.__)("List view")),(0,u.createElement)(eE,null))})}));function oE(e){var t;let{genericPreviewBlock:n,style:o,className:r,activeStyle:l}=e;const i=null===(t=(0,a.getBlockType)(n.name))||void 0===t?void 0:t.example,s=zf(r,l,o),c=(0,u.useMemo)((()=>({...n,title:o.label||o.name,description:o.description,initialAttributes:{...n.attributes,className:s+" block-editor-block-styles__block-preview-container"},example:i})),[n,s]);return(0,u.createElement)(tm,{item:c,isStylePreview:!0})}const rE=()=>{};function lE(e){let{clientId:t,onSwitch:n=rE,onHoverClassName:o=rE}=e;const{onSelect:r,stylesToRender:l,activeStyle:i,genericPreviewBlock:a,className:s}=Vf({clientId:t,onSwitch:n}),[c,d]=(0,u.useState)(null),g=(0,m.useViewportMatch)("medium","<");if(!l||0===l.length)return null;const f=(0,m.debounce)(d,250),v=e=>{var t;c!==e?(f(e),o(null!==(t=null==e?void 0:e.name)&&void 0!==t?t:null)):f.cancel()};return(0,u.createElement)("div",{className:"block-editor-block-styles"},(0,u.createElement)("div",{className:"block-editor-block-styles__variants"},l.map((e=>{const t=e.isDefault?(0,_.__)("Default"):e.label||e.name;return(0,u.createElement)(h.Button,{className:p()("block-editor-block-styles__item",{"is-active":i.name===e.name}),key:e.name,variant:"secondary",label:t,onMouseEnter:()=>v(e),onFocus:()=>v(e),onMouseLeave:()=>v(null),onBlur:()=>v(null),onClick:()=>(e=>{r(e),o(null),d(null),f.cancel()})(e),"aria-current":i.name===e.name},(0,u.createElement)(h.__experimentalTruncate,{numberOfLines:1,className:"block-editor-block-styles__item-text"},t))}))),c&&!g&&(0,u.createElement)(h.Popover,{placement:"left-start",offset:20},(0,u.createElement)("div",{className:"block-editor-block-styles__preview-panel",onMouseLeave:()=>v(null)},(0,u.createElement)(oE,{activeStyle:i,className:s,genericPreviewBlock:a,style:c}))))}var iE=lE;lE.Slot=()=>(W()("BlockStyles.Slot",{version:"6.4",since:"6.2"}),null);var aE=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.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 sE=function(e){let{icon:t=aE,label:n=(0,_.__)("Choose variation"),instructions:o=(0,_.__)("Select a variation to start with."),variations:r,onSelect:l,allowSkip:i}=e;const a=p()("block-editor-block-variation-picker",{"has-many-variations":r.length>4});return(0,u.createElement)(h.Placeholder,{icon:t,label:n,instructions:o,className:a},(0,u.createElement)("ul",{className:"block-editor-block-variation-picker__variations",role:"list","aria-label":(0,_.__)("Block variations")},r.map((e=>(0,u.createElement)("li",{key:e.name},(0,u.createElement)(h.Button,{variant:"secondary",icon:e.icon&&e.icon.src?e.icon.src:e.icon,iconSize:48,onClick:()=>l(e),className:"block-editor-block-variation-picker__variation",label:e.description||e.title}),(0,u.createElement)("span",{className:"block-editor-block-variation-picker__variation-label"},e.title))))),i&&(0,u.createElement)("div",{className:"block-editor-block-variation-picker__skip"},(0,u.createElement)(h.Button,{variant:"link",onClick:()=>l()},(0,_.__)("Skip"))))};var cE=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.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 uE={carousel:"carousel",grid:"grid"},dE=e=>{let{onBlockPatternSelect:t}=e;return(0,u.createElement)("div",{className:"block-editor-block-pattern-setup__actions"},(0,u.createElement)(h.Button,{variant:"primary",onClick:t},(0,_.__)("Choose")))},pE=e=>{let{handlePrevious:t,handleNext:n,activeSlide:o,totalSlides:r}=e;return(0,u.createElement)("div",{className:"block-editor-block-pattern-setup__navigation"},(0,u.createElement)(h.Button,{icon:md,label:(0,_.__)("Previous pattern"),onClick:t,disabled:0===o}),(0,u.createElement)(h.Button,{icon:pd,label:(0,_.__)("Next pattern"),onClick:n,disabled:o===r-1}))};var mE=e=>{let{viewMode:t,setViewMode:n,handlePrevious:o,handleNext:r,activeSlide:l,totalSlides:i,onBlockPatternSelect:a}=e;const s=t===uE.carousel,c=(0,u.createElement)("div",{className:"block-editor-block-pattern-setup__display-controls"},(0,u.createElement)(h.Button,{icon:bi,label:(0,_.__)("Carousel view"),onClick:()=>n(uE.carousel),isPressed:s}),(0,u.createElement)(h.Button,{icon:cE,label:(0,_.__)("Grid view"),onClick:()=>n(uE.grid),isPressed:t===uE.grid}));return(0,u.createElement)("div",{className:"block-editor-block-pattern-setup__toolbar"},s&&(0,u.createElement)(pE,{handlePrevious:o,handleNext:r,activeSlide:l,totalSlides:i}),c,s&&(0,u.createElement)(dE,{onBlockPatternSelect:a}))};var gE=function(e,t,n){return(0,g.useSelect)((o=>{const{getBlockRootClientId:r,getPatternsByBlockTypes:l,__experimentalGetAllowedPatterns:i}=o(To),a=r(e);return n?i(a).filter(n):l(t,a)}),[e,t,n])};const fE=e=>{let{viewMode:t,activeSlide:n,patterns:o,onBlockPatternSelect:r,showTitles:l}=e;const i=(0,h.__unstableUseCompositeState)(),a="block-editor-block-pattern-setup__container";if(t===uE.carousel){const e=new Map([[n,"active-slide"],[n-1,"previous-slide"],[n+1,"next-slide"]]);return(0,u.createElement)("div",{className:"block-editor-block-pattern-setup__carousel"},(0,u.createElement)("div",{className:a},(0,u.createElement)("ul",{className:"carousel-container"},o.map(((t,n)=>(0,u.createElement)(vE,{className:e.get(n)||"",key:t.name,pattern:t}))))))}return(0,u.createElement)("div",{className:"block-editor-block-pattern-setup__grid"},(0,u.createElement)(h.__unstableComposite,c({},i,{role:"listbox",className:a,"aria-label":(0,_.__)("Patterns list")}),o.map((e=>(0,u.createElement)(hE,{key:e.name,pattern:e,onSelect:r,composite:i,showTitles:l})))))};function hE(e){let{pattern:t,onSelect:n,composite:o,showTitles:r}=e;const l="block-editor-block-pattern-setup-list",{blocks:i,description:a,viewportWidth:s=700}=t,d=(0,m.useInstanceId)(hE,`${l}__item-description`);return(0,u.createElement)("div",{className:`${l}__list-item`,"aria-label":t.title,"aria-describedby":t.description?d:void 0},(0,u.createElement)(h.__unstableCompositeItem,c({role:"option",as:"div"},o,{className:`${l}__item`,onClick:()=>n(i)}),(0,u.createElement)(Jp,{blocks:i,viewportWidth:s}),r&&(0,u.createElement)("div",{className:`${l}__item-title`},t.title),!!a&&(0,u.createElement)(h.VisuallyHidden,{id:d},a)))}function vE(e){let{className:t,pattern:n,minHeight:o}=e;const{blocks:r,title:l,description:i}=n,a=(0,m.useInstanceId)(vE,"block-editor-block-pattern-setup-list__item-description");return(0,u.createElement)("li",{className:`pattern-slide ${t}`,"aria-label":l,"aria-describedby":i?a:void 0},(0,u.createElement)(Jp,{blocks:r,minHeight:o}),!!i&&(0,u.createElement)(h.VisuallyHidden,{id:a},i))}var bE=e=>{let{clientId:t,blockName:n,filterPatternsFn:o,onBlockPatternSelect:r,initialViewMode:l=uE.carousel,showTitles:i=!1}=e;const[s,c]=(0,u.useState)(l),[d,p]=(0,u.useState)(0),{replaceBlock:m}=(0,g.useDispatch)(To),f=gE(t,n,o);if(null==f||!f.length)return null;const h=r||(e=>{const n=e.map((e=>(0,a.cloneBlock)(e)));m(t,n)});return(0,u.createElement)(u.Fragment,null,(0,u.createElement)("div",{className:`block-editor-block-pattern-setup view-mode-${s}`},(0,u.createElement)(fE,{viewMode:s,activeSlide:d,patterns:f,onBlockPatternSelect:h,showTitles:i}),(0,u.createElement)(mE,{viewMode:s,setViewMode:c,activeSlide:d,totalSlides:f.length,handleNext:()=>{p((e=>e+1))},handlePrevious:()=>{p((e=>e-1))},onBlockPatternSelect:()=>{h(f[d].blocks)}})))};function kE(e){let{className:t,onSelectVariation:n,selectedValue:o,variations:r}=e;return(0,u.createElement)("fieldset",{className:t},(0,u.createElement)(h.VisuallyHidden,{as:"legend"},(0,_.__)("Transform to variation")),r.map((e=>(0,u.createElement)(h.Button,{key:e.name,icon:(0,u.createElement)(fd,{icon:e.icon,showColors:!0}),isPressed:o===e.name,label:o===e.name?e.title:(0,_.sprintf)((0,_.__)("Transform to %s"),e.title),onClick:()=>n(e.name),"aria-label":e.title,showTooltip:!0}))))}function _E(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,u.createElement)(h.DropdownMenu,{className:t,label:(0,_.__)("Transform to variation"),text:(0,_.__)("Transform to variation"),popoverProps:{position:"bottom center",className:`${t}__popover`},icon:uf,toggleProps:{iconPosition:"right"}},(()=>(0,u.createElement)("div",{className:`${t}__container`},(0,u.createElement)(h.MenuGroup,null,(0,u.createElement)(h.MenuItemsChoice,{choices:l,value:o,onSelect:n})))))}var yE=function(e){let{blockClientId:t}=e;const{updateBlockAttributes:n}=(0,g.useDispatch)(To),{activeBlockVariation:o,variations:r}=(0,g.useSelect)((e=>{const{getActiveBlockVariation:n,getBlockVariations:o}=e(a.store),{getBlockName:r,getBlockAttributes:l}=e(To),i=t&&r(t);return{activeBlockVariation:n(i,l(t)),variations:i&&o(i,"transform")}}),[t]),l=null==o?void 0:o.name,i=(0,u.useMemo)((()=>{const e=new Set;return!!r&&(r.forEach((t=>{var n;t.icon&&e.add((null===(n=t.icon)||void 0===n?void 0:n.src)||t.icon)})),e.size===r.length)}),[r]);if(null==r||!r.length)return null;const s=i?kE:_E;return(0,u.createElement)(s,{className:"block-editor-block-variation-transforms",onSelectVariation:e=>{n(t,{...r.find((t=>{let{name:n}=t;return n===e})).attributes})},selectedValue:l,variations:r})},EE=(0,m.createHigherOrderComponent)((e=>t=>{const n=fr("color.palette"),o=!fr("color.custom"),r=void 0===t.colors?n:t.colors,l=void 0===t.disableCustomColors?o:t.disableCustomColors,i=!(0,f.isEmpty)(r)||!l;return(0,u.createElement)(e,c({},t,{colors:r,disableCustomColors:l,hasColorsToChoose:i}))}),"withColorContext"),CE=EE(h.ColorPalette);function SE(e){let{onChange:t,value:n,...o}=e;return(0,u.createElement)(Ab,c({},o,{onColorChange:t,colorValue:n,gradients:[],disableCustomGradients:!0}))}var wE=window.wp.date;const BE=new Date(2022,0,25);function IE(e){let{format:t,defaultFormat:n,onChange:o}=e;return(0,u.createElement)("fieldset",{className:"block-editor-date-format-picker"},(0,u.createElement)(h.VisuallyHidden,{as:"legend"},(0,_.__)("Date format")),(0,u.createElement)(h.ToggleControl,{label:(0,u.createElement)(u.Fragment,null,(0,_.__)("Default format"),(0,u.createElement)("span",{className:"block-editor-date-format-picker__default-format-toggle-control__hint"},(0,wE.dateI18n)(n,BE))),checked:!t,onChange:e=>o(e?null:n)}),t&&(0,u.createElement)(xE,{format:t,onChange:o}))}function xE(e){var t;let{format:n,onChange:o}=e;const r=[...new Set(["Y-m-d",(0,_._x)("n/j/Y","short date format"),(0,_._x)("n/j/Y g:i A","short date format with time"),(0,_._x)("M j, Y","medium date format"),(0,_._x)("M j, Y g:i A","medium date format with time"),(0,_._x)("F j, Y","long date format"),(0,_._x)("M j","short date format without the year")])],l=r.map(((e,t)=>({key:`suggested-${t}`,name:(0,wE.dateI18n)(e,BE),format:e}))),i={key:"custom",name:(0,_.__)("Custom"),className:"block-editor-date-format-picker__custom-format-select-control__custom-option",__experimentalHint:(0,_.__)("Enter your own date format")},[a,s]=(0,u.useState)((()=>!!n&&!r.includes(n)));return(0,u.createElement)(h.__experimentalVStack,null,(0,u.createElement)(h.CustomSelectControl,{__nextUnconstrainedWidth:!0,label:(0,_.__)("Choose a format"),options:[...l,i],value:a?i:null!==(t=l.find((e=>e.format===n)))&&void 0!==t?t:i,onChange:e=>{let{selectedItem:t}=e;t===i?s(!0):(s(!1),o(t.format))}}),a&&(0,u.createElement)(h.TextControl,{__nextHasNoMarginBottom:!0,label:(0,_.__)("Custom format"),hideLabelFromVision:!0,help:(0,u.createInterpolateElement)((0,_.__)("Enter a date or time format string."),{Link:(0,u.createElement)(h.ExternalLink,{href:(0,_.__)("https://wordpress.org/support/article/formatting-date-and-time/")})}),value:n,onChange:e=>o(e)}))}const TE=["colors","disableCustomColors","gradients","disableCustomGradients"],ME=e=>{let{className:t,colors:n,gradients:o,disableCustomColors:r,disableCustomGradients:l,children:i,settings:a,title:s,showTitle:c=!0,__experimentalIsRenderedInSidebar:d,enableAlpha:v}=e;const b=(0,m.useInstanceId)(ME),{batch:k}=(0,g.useRegistry)();return(0,f.isEmpty)(n)&&(0,f.isEmpty)(o)&&r&&l&&null!=a&&a.every((e=>(0,f.isEmpty)(e.colors)&&(0,f.isEmpty)(e.gradients)&&(void 0===e.disableCustomColors||e.disableCustomColors)&&(void 0===e.disableCustomGradients||e.disableCustomGradients)))?null:(0,u.createElement)(h.__experimentalToolsPanel,{className:p()("block-editor-panel-color-gradient-settings",t),label:c?s:void 0,resetAll:()=>{k((()=>{a.forEach((e=>{let{colorValue:t,gradientValue:n,onColorChange:o,onGradientChange:r}=e;t?o():n&&r()}))}))},panelId:b,__experimentalFirstVisibleItemClass:"first",__experimentalLastVisibleItemClass:"last"},(0,u.createElement)(Fb,{settings:a,panelId:b,colors:n,gradients:o,disableCustomColors:r,disableCustomGradients:l,__experimentalIsRenderedInSidebar:d,enableAlpha:v}),!!i&&(0,u.createElement)(u.Fragment,null,(0,u.createElement)(h.__experimentalSpacer,{marginY:4})," ",i))},NE=e=>{const t=db();return(0,u.createElement)(ME,c({},t,e))};var PE=e=>TE.every((t=>e.hasOwnProperty(t)))?(0,u.createElement)(ME,e):(0,u.createElement)(NE,e);const LE=(0,u.createContext)({}),RE=()=>(0,u.useContext)(LE);function AE(e){let{id:t,url:n,naturalWidth:o,naturalHeight:r,onFinishEditing:l,onSaveImage:i,children:a}=e;const c=function(e){let{url:t,naturalWidth:n,naturalHeight:o}=e;const[r,l]=(0,u.useState)(),[i,a]=(0,u.useState)(),[c,d]=(0,u.useState)({x:0,y:0}),[p,m]=(0,u.useState)(100),[g,f]=(0,u.useState)(0),h=n/o,[v,b]=(0,u.useState)(h),k=(0,u.useCallback)((()=>{const e=(g+90)%360;let n=h;if(g%180==90&&(n=1/h),0===e)return l(),f(e),b(h),void d({x:-c.y*n,y:c.x*n});const o=new window.Image;o.src=t,o.onload=function(t){const o=document.createElement("canvas");let r=0,i=0;e%180?(o.width=t.target.height,o.height=t.target.width):(o.width=t.target.width,o.height=t.target.height),90!==e&&180!==e||(r=o.width),270!==e&&180!==e||(i=o.height);const a=o.getContext("2d");a.translate(r,i),a.rotate(e*Math.PI/180),a.drawImage(t.target,0,0),o.toBlob((t=>{l(URL.createObjectURL(t)),f(e),b(o.width/o.height),d({x:-c.y*n,y:c.x*n})}))};const r=(0,s.applyFilters)("media.crossOrigin",void 0,t);"string"==typeof r&&(o.crossOrigin=r)}),[g,h]);return(0,u.useMemo)((()=>({editedUrl:r,setEditedUrl:l,crop:i,setCrop:a,position:c,setPosition:d,zoom:p,setZoom:m,rotation:g,setRotation:f,rotateClockwise:k,aspect:v,setAspect:b,defaultAspect:h})),[r,i,c,p,g,k,v,h])}({url:n,naturalWidth:o,naturalHeight:r}),d=function(e){let{crop:t,rotation:n,height:o,width:r,aspect:l,url:i,id:a,onSaveImage:s,onFinishEditing:c}=e;const{createErrorNotice:d}=(0,g.useDispatch)(hm.store),[p,m]=(0,u.useState)(!1),f=(0,u.useCallback)((()=>{m(!1),c()}),[m,c]),h=(0,u.useCallback)((()=>{m(!0);let e={};(t.width<99.9||t.height<99.9)&&(e=t),n>0&&(e.rotation=n),e.src=i,hy()({path:`/wp/v2/media/${a}/edit`,method:"POST",data:e}).then((e=>{s({id:e.id,url:e.source_url,height:o&&r?r/l:void 0})})).catch((e=>{d((0,_.sprintf)((0,_.__)("Could not edit image. %s"),(0,Ri.__unstableStripHTML)(e.message)),{id:"image-editing-error",type:"snackbar"})})).finally((()=>{m(!1),c()}))}),[m,t,n,o,r,l,i,s,d,m,c]);return(0,u.useMemo)((()=>({isInProgress:p,apply:h,cancel:f})),[p,h,f])}({id:t,url:n,onSaveImage:i,onFinishEditing:l,...c}),p=(0,u.useMemo)((()=>({...c,...d})),[c,d]);return(0,u.createElement)(LE.Provider,{value:p},a)} /*! ***************************************************************************** Copyright (c) Microsoft Corporation. diff --git a/packages/playground/remote/public/wp-6.3/wp-includes/empty.html b/packages/playground/remote/public/wp-6.3/wp-includes/empty.html index c50eddd41f..620d9da39e 100644 --- a/packages/playground/remote/public/wp-6.3/wp-includes/empty.html +++ b/packages/playground/remote/public/wp-6.3/wp-includes/empty.html @@ -1 +1 @@ - + diff --git a/packages/playground/remote/public/wp-6.3/wp-includes/js/dist/block-editor.js b/packages/playground/remote/public/wp-6.3/wp-includes/js/dist/block-editor.js index d11a91f4ef..7a4127b8eb 100644 --- a/packages/playground/remote/public/wp-6.3/wp-includes/js/dist/block-editor.js +++ b/packages/playground/remote/public/wp-6.3/wp-includes/js/dist/block-editor.js @@ -1,4 +1,47 @@ -/******/ (function() { // webpackBootstrap +/** + * A synchronous function to read a blob URL as text. + * + * @param {string} url + * @returns {string} + */ +const __playground_readBlobAsText = function (url) { + try { + let xhr = new XMLHttpRequest(); + xhr.open('GET', url, false); + xhr.overrideMimeType('text/plain;charset=utf-8'); + xhr.send(); + return xhr.responseText; + } catch(e) { + return ''; + } finally { + URL.revokeObjectURL(url); + } +} + +window.__playground_ControlledIframe = window.wp.element.forwardRef(function (props, ref) { + const source = window.wp.element.useMemo(function () { + if (props.srcDoc) { + // WordPress <= 6.2 uses a srcDoc that only contains a doctype. + return '/wp-includes/empty.html'; + } else if (props.src && props.src.startsWith('blob:')) { + // WordPress 6.3 uses a blob URL with doctype and a list of static assets. + // Let's pass the document content to empty.html and render it there. + return '/wp-includes/empty.html#' + encodeURIComponent(__playground_readBlobAsText(props.src)); + } else { + // WordPress >= 6.4 uses a plain HTTPS URL that needs no correction. + return props.src; + } + }, [props.src]); + return ( + window.wp.element.createElement('iframe', { + ...props, + ref: ref, + src: source, + // Make sure there's no srcDoc, as it would interfere with the src. + srcDoc: undefined + }) + ) +});/******/ (function() { // webpackBootstrap /******/ var __webpack_modules__ = ({ /***/ 6411: @@ -25235,7 +25278,7 @@ function Iframe({ // top or bottom margin is 0.55 / 2 ((1 - scale) / 2). const marginFromScaling = contentHeight * (1 - scale) / 2; - return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, tabIndex >= 0 && before, (0,external_wp_element_namespaceObject.createElement)("iframe", { ...props, + return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, tabIndex >= 0 && before, (0,external_wp_element_namespaceObject.createElement)(__playground_ControlledIframe, { ...props, style: { ...props.style, height: expand ? contentHeight : props.style?.height, marginTop: scale !== 1 ? -marginFromScaling + frameSize : props.style?.marginTop, diff --git a/packages/playground/remote/public/wp-6.3/wp-includes/js/dist/block-editor.min.js b/packages/playground/remote/public/wp-6.3/wp-includes/js/dist/block-editor.min.js index 3a17615bed..4dc3a28951 100644 --- a/packages/playground/remote/public/wp-6.3/wp-includes/js/dist/block-editor.min.js +++ b/packages/playground/remote/public/wp-6.3/wp-includes/js/dist/block-editor.min.js @@ -1,4 +1,47 @@ -/*! This file is auto-generated */ +/** + * A synchronous function to read a blob URL as text. + * + * @param {string} url + * @returns {string} + */ +const __playground_readBlobAsText = function (url) { + try { + let xhr = new XMLHttpRequest(); + xhr.open('GET', url, false); + xhr.overrideMimeType('text/plain;charset=utf-8'); + xhr.send(); + return xhr.responseText; + } catch(e) { + return ''; + } finally { + URL.revokeObjectURL(url); + } +} + +window.__playground_ControlledIframe = window.wp.element.forwardRef(function (props, ref) { + const source = window.wp.element.useMemo(function () { + if (props.srcDoc) { + // WordPress <= 6.2 uses a srcDoc that only contains a doctype. + return '/wp-includes/empty.html'; + } else if (props.src && props.src.startsWith('blob:')) { + // WordPress 6.3 uses a blob URL with doctype and a list of static assets. + // Let's pass the document content to empty.html and render it there. + return '/wp-includes/empty.html#' + encodeURIComponent(__playground_readBlobAsText(props.src)); + } else { + // WordPress >= 6.4 uses a plain HTTPS URL that needs no correction. + return props.src; + } + }, [props.src]); + return ( + window.wp.element.createElement('iframe', { + ...props, + ref: ref, + src: source, + // Make sure there's no srcDoc, as it would interfere with the src. + srcDoc: undefined + }) + ) +});/*! This file is auto-generated */ !function(){var e={6411:function(e,t){var n,o,r; /*! autosize 4.0.4 @@ -23,7 +66,7 @@ * @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;ne;function S(e,t=""){const n=new Map,o=[];return n.set(t,o),e.forEach((e=>{const{clientId:t,innerBlocks:r}=e;o.push(t),S(r,t).forEach(((e,t)=>{n.set(t,e)}))})),n}function C(e,t=""){const n=[],o=[[t,e]];for(;o.length;){const[e,t]=o.shift();t.forEach((({innerBlocks:t,...r})=>{n.push([r.clientId,e]),t?.length&&o.push([r.clientId,t])}))}return n}function x(e,t=w){const n=[],o=[...e];for(;o.length;){const{innerBlocks:e,...r}=o.shift();o.push(...e),n.push([r.clientId,t(r)])}return n}function B(e){return x(e,(e=>{const{attributes:t,...n}=e;return n}))}function I(e){return x(e,(e=>e.attributes))}function T(e,t){return"UPDATE_BLOCK_ATTRIBUTES"===e.type&&void 0!==t&&"UPDATE_BLOCK_ATTRIBUTES"===t.type&&b()(e.clientIds,t.clientIds)&&function(e,t){return b()(Object.keys(e),Object.keys(t))}(e.attributes,t.attributes)}function M(e,t){const n=e.tree,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.set(e.clientId,{});for(const t of r)n.set(t.clientId,Object.assign(n.get(t.clientId),{...e.byClientId.get(t.clientId),attributes:e.attributes.get(t.clientId),innerBlocks:t.innerBlocks.map((e=>n.get(e.clientId)))}))}function P(e,t,n=!1){const o=e.tree,r=new Set([]),l=new Set;for(const o of t){let t=n?o:e.parents.get(o);do{if(e.controlledInnerBlocks[t]){l.add(t);break}r.add(t),t=e.parents.get(t)}while(void 0!==t)}for(const e of r)o.set(e,{...o.get(e)});for(const t of r)o.get(t).innerBlocks=(e.order.get(t)||[]).map((e=>o.get(e)));for(const t of l)o.set("controlled||"+t,{innerBlocks:(e.order.get(t)||[]).map((e=>o.get(e)))})}const N=(0,p.pipe)(f.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=new Map(t.attributes),t.attributes.forEach(((n,r)=>{const{name:l}=t.byClientId.get(r);"core/block"===l&&n.ref===e&&t.attributes.set(r,{...n,ref:o})}))}return e(t,n)}),(e=>(t={},n)=>{const o=e(t,n);if(o===t)return t;switch(o.tree=t.tree?t.tree:new Map,n.type){case"RECEIVE_BLOCKS":case"INSERT_BLOCKS":o.tree=new Map(o.tree),M(o,n.blocks),P(o,n.rootClientId?[n.rootClientId]:[""],!0);break;case"UPDATE_BLOCK":o.tree=new Map(o.tree),o.tree.set(n.clientId,{...o.tree.get(n.clientId),...o.byClientId.get(n.clientId),attributes:o.attributes.get(n.clientId)}),P(o,[n.clientId],!1);break;case"UPDATE_BLOCK_ATTRIBUTES":o.tree=new Map(o.tree),n.clientIds.forEach((e=>{o.tree.set(e,{...o.tree.get(e),attributes:o.attributes.get(e)})})),P(o,n.clientIds,!1);break;case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":{const e=function(e){const t={},n=[...e];for(;n.length;){const{innerBlocks:e,...o}=n.shift();n.push(...e),t[o.clientId]=!0}return t}(n.blocks);o.tree=new Map(o.tree),n.replacedClientIds.concat(n.replacedClientIds.filter((t=>!e[t])).map((e=>"controlled||"+e))).forEach((e=>{o.tree.delete(e)})),M(o,n.blocks),P(o,n.blocks.map((e=>e.clientId)),!1);const r=[];for(const e of n.clientIds)void 0===t.parents.get(e)||""!==t.parents.get(e)&&!o.byClientId.get(t.parents.get(e))||r.push(t.parents.get(e));P(o,r,!0);break}case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":const e=[];for(const r of n.clientIds)void 0===t.parents.get(r)||""!==t.parents.get(r)&&!o.byClientId.get(t.parents.get(r))||e.push(t.parents.get(r));o.tree=new Map(o.tree),n.removedClientIds.concat(n.removedClientIds.map((e=>"controlled||"+e))).forEach((e=>{o.tree.delete(e)})),P(o,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=new Map(o.tree),P(o,e,!0);break}case"MOVE_BLOCKS_UP":case"MOVE_BLOCKS_DOWN":{const e=[n.rootClientId?n.rootClientId:""];o.tree=new Map(o.tree),P(o,e,!0);break}case"SAVE_REUSABLE_BLOCK_SUCCESS":{const e=[];o.attributes.forEach(((t,r)=>{"core/block"===o.byClientId.get(r).name&&t.ref===n.updatedId&&e.push(r)})),o.tree=new Map(o.tree),e.forEach((e=>{o.tree.set(e,{...o.byClientId.get(e),attributes:o.attributes.get(e),innerBlocks:o.tree.get(e).innerBlocks})})),P(o,e,!1)}}return o}),(e=>(t,n)=>{const o=e=>{let o=e;for(let r=0;r(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.get(n.rootClientId)&&(r=e(r,{type:"REMOVE_BLOCKS",keepControlledInnerBlocks:o,clientIds:t.order.get(n.rootClientId)}));let l=r;if(n.blocks.length){l=e(l,{...n,type:"INSERT_BLOCKS",index:0});const r=new Map(l.order);Object.keys(o).forEach((e=>{t.order.get(e)&&r.set(e,t.order.get(e))})),l.order=r,l.tree=new Map(l.tree),Object.keys(o).forEach((e=>{const n=`controlled||${e}`;t.tree.has(n)&&l.tree.set(n,t.tree.get(n))}))}return l}),(e=>(t,n)=>{if("RESET_BLOCKS"===n.type){const e={...t,byClientId:new Map(B(n.blocks)),attributes:new Map(I(n.blocks)),order:S(n.blocks),parents:new Map(C(n.blocks)),controlledInnerBlocks:{}};return e.tree=new Map(t?.tree),M(e,n.blocks),e.tree.set("",{innerBlocks:n.blocks.map((t=>e.tree.get(t.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=o?.isPersistentChange)||void 0===a||a;return o.isPersistentChange===e?o:{...l,isPersistentChange:e}}return l={...l,isPersistentChange:i?!n:!T(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(e=new Map,t){switch(t.type){case"RECEIVE_BLOCKS":case"INSERT_BLOCKS":{const n=new Map(e);return B(t.blocks).forEach((([e,t])=>{n.set(e,t)})),n}case"UPDATE_BLOCK":{if(!e.has(t.clientId))return e;const{attributes:n,...o}=t.updates;if(0===Object.values(o).length)return e;const r=new Map(e);return r.set(t.clientId,{...e.get(t.clientId),...o}),r}case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":{if(!t.blocks)return e;const n=new Map(e);return t.replacedClientIds.forEach((e=>{n.delete(e)})),B(t.blocks).forEach((([e,t])=>{n.set(e,t)})),n}case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":{const n=new Map(e);return t.removedClientIds.forEach((e=>{n.delete(e)})),n}}return e},attributes(e=new Map,t){switch(t.type){case"RECEIVE_BLOCKS":case"INSERT_BLOCKS":{const n=new Map(e);return I(t.blocks).forEach((([e,t])=>{n.set(e,t)})),n}case"UPDATE_BLOCK":{if(!e.get(t.clientId)||!t.updates.attributes)return e;const n=new Map(e);return n.set(t.clientId,{...e.get(t.clientId),...t.updates.attributes}),n}case"UPDATE_BLOCK_ATTRIBUTES":{if(t.clientIds.every((t=>!e.get(t))))return e;let o=!1;const r=new Map(e);for(const l of t.clientIds){var n;const i=Object.entries(t.uniqueByBlock?t.attributes[l]:null!==(n=t.attributes)&&void 0!==n?n:{});if(0===i.length)continue;let a=!1;const s=e.get(l),c={};i.forEach((([e,t])=>{s[e]!==t&&(a=!0,c[e]=t)})),o=o||a,a&&r.set(l,{...s,...c})}return o?r:e}case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":{if(!t.blocks)return e;const n=new Map(e);return t.replacedClientIds.forEach((e=>{n.delete(e)})),I(t.blocks).forEach((([e,t])=>{n.set(e,t)})),n}case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":{const n=new Map(e);return t.removedClientIds.forEach((e=>{n.delete(e)})),n}}return e},order(e=new Map,t){switch(t.type){case"RECEIVE_BLOCKS":{var n;const o=S(t.blocks),r=new Map(e);return o.forEach(((e,t)=>{""!==t&&r.set(t,e)})),r.set("",(null!==(n=e.get(""))&&void 0!==n?n:[]).concat(o[""])),r}case"INSERT_BLOCKS":{const{rootClientId:n=""}=t,o=e.get(n)||[],r=S(t.blocks,n),{index:l=o.length}=t,i=new Map(e);return r.forEach(((e,t)=>{i.set(t,e)})),i.set(n,y(o,r.get(n),l)),i}case"MOVE_BLOCKS_TO_POSITION":{var o;const{fromRootClientId:n="",toRootClientId:r="",clientIds:l}=t,{index:i=e.get(r).length}=t;if(n===r){const t=e.get(r).indexOf(l[0]),n=new Map(e);return n.set(r,E(e.get(r),t,i,l.length)),n}const a=new Map(e);return a.set(n,null!==(o=e.get(n)?.filter((e=>!l.includes(e))))&&void 0!==o?o:[]),a.set(r,y(e.get(r),l,i)),a}case"MOVE_BLOCKS_UP":{const{clientIds:n,rootClientId:o=""}=t,r=n[0],l=e.get(o);if(!l.length||r===l[0])return e;const i=l.indexOf(r),a=new Map(e);return a.set(o,E(l,i,i-1,n.length)),a}case"MOVE_BLOCKS_DOWN":{const{clientIds:n,rootClientId:o=""}=t,r=n[0],l=n[n.length-1],i=e.get(o);if(!i.length||l===i[i.length-1])return e;const a=i.indexOf(r),s=new Map(e);return s.set(o,E(i,a,a+1,n.length)),s}case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":{const{clientIds:n}=t;if(!t.blocks)return e;const o=S(t.blocks),r=new Map(e);return t.replacedClientIds.forEach((e=>{r.delete(e)})),o.forEach(((e,t)=>{""!==t&&r.set(t,e)})),r.forEach(((e,t)=>{const l=Object.values(e).reduce(((e,t)=>t===n[0]?[...e,...o.get("")]:(-1===n.indexOf(t)&&e.push(t),e)),[]);r.set(t,l)})),r}case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":{const n=new Map(e);return t.removedClientIds.forEach((e=>{n.delete(e)})),n.forEach(((e,o)=>{var r;const l=null!==(r=e?.filter((e=>!t.removedClientIds.includes(e))))&&void 0!==r?r:[];l.length!==e.length&&n.set(o,l)})),n}}return e},parents(e=new Map,t){switch(t.type){case"RECEIVE_BLOCKS":{const n=new Map(e);return C(t.blocks).forEach((([e,t])=>{n.set(e,t)})),n}case"INSERT_BLOCKS":{const n=new Map(e);return C(t.blocks,t.rootClientId||"").forEach((([e,t])=>{n.set(e,t)})),n}case"MOVE_BLOCKS_TO_POSITION":{const n=new Map(e);return t.clientIds.forEach((e=>{n.set(e,t.toRootClientId||"")})),n}case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":{const n=new Map(e);return t.replacedClientIds.forEach((e=>{n.delete(e)})),C(t.blocks,e.get(t.clientIds[0])).forEach((([e,t])=>{n.set(e,t)})),n}case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":{const n=new Map(e);return t.removedClientIds.forEach((e=>{n.delete(e)})),n}}return e},controlledInnerBlocks(e={},{type:t,clientId:n,hasControlledInnerBlocks:o}){return"SET_HAS_CONTROLLED_INNER_BLOCKS"===t?{...e,[n]:o}:e}});function L(e={},t){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}const R=(0,f.combineReducers)({blocks:N,isTyping:function(e=!1,t){switch(t.type){case"START_TYPING":return!0;case"STOP_TYPING":return!1}return e},isBlockInterfaceHidden:function(e=!1,t){switch(t.type){case"HIDE_BLOCK_INTERFACE":return!0;case"SHOW_BLOCK_INTERFACE":return!1}return e},draggedBlocks:function(e=[],t){switch(t.type){case"START_DRAGGING_BLOCKS":return t.clientIds;case"STOP_DRAGGING_BLOCKS":return[]}return e},selection:function(e={},t){switch(t.type){case"SELECTION_CHANGE":return t.clientId?{selectionStart:{clientId:t.clientId,attributeKey:t.attributeKey,offset:t.startOffset},selectionEnd:{clientId:t.clientId,attributeKey:t.attributeKey,offset:t.endOffset}}:{selectionStart:t.start||e.selectionStart,selectionEnd:t.end||e.selectionEnd};case"RESET_SELECTION":const{selectionStart:n,selectionEnd:o}=t;return{selectionStart:n,selectionEnd:o};case"MULTI_SELECT":const{start:r,end:l}=t;return r===e.selectionStart?.clientId&&l===e.selectionEnd?.clientId?e:{selectionStart:{clientId:r},selectionEnd:{clientId:l}};case"RESET_BLOCKS":const i=e?.selectionStart?.clientId,a=e?.selectionEnd?.clientId;if(!i&&!a)return e;if(!t.blocks.some((e=>e.clientId===i)))return{selectionStart:{},selectionEnd:{}};if(!t.blocks.some((e=>e.clientId===a)))return{...e,selectionEnd:e.selectionStart}}const n=L(e.selectionStart,t),o=L(e.selectionEnd,t);return n===e.selectionStart&&o===e.selectionEnd?e:{selectionStart:n,selectionEnd:o}},isMultiSelecting:function(e=!1,t){switch(t.type){case"START_MULTI_SELECT":return!0;case"STOP_MULTI_SELECT":return!1}return e},isSelectionEnabled:function(e=!0,t){return"TOGGLE_SELECTION"===t.type?t.isSelectionEnabled:e},initialPosition:function(e=null,t){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(e={},t){if("TOGGLE_BLOCK_MODE"===t.type){const{clientId:n}=t;return{...e,[n]:e[n]&&"html"===e[n]?"visual":"html"}}return e},blockListSettings:(e={},t)=>{switch(t.type){case"REPLACE_BLOCKS":case"REMOVE_BLOCKS":return Object.fromEntries(Object.entries(e).filter((([e])=>!t.clientIds.includes(e))));case"UPDATE_BLOCK_LIST_SETTINGS":{const{clientId:n}=t;if(!t.settings){if(e.hasOwnProperty(n)){const{[n]:t,...o}=e;return o}return e}return b()(e[n],t.settings)?e:{...e,[n]:t.settings}}}return e},insertionPoint:function(e=null,t){switch(t.type){case"SHOW_INSERTION_POINT":{const{rootClientId:n,index:o,__unstableWithInserter:r,operation:l}=t,i={rootClientId:n,index:o,__unstableWithInserter:r,operation:l};return b()(e,i)?e:i}case"HIDE_INSERTION_POINT":return null}return e},template:function(e={isValid:!0},t){return"SET_TEMPLATE_VALIDITY"===t.type?{...e,isValid:t.isValid}:e},settings:function(e=k,t){return"UPDATE_SETTINGS"===t.type?{...e,...t.settings}:e},preferences:function(e=_,t){switch(t.type){case"INSERT_BLOCKS":case"REPLACE_BLOCKS":return t.blocks.reduce(((e,n)=>{const{attributes:o,name:r}=n;let l=r;const i=(0,f.select)(a.store).getActiveBlockVariation(r,o);return i?.name&&(l+="/"+i.name),"core/block"===r&&(l+="/"+o.ref),{...e,insertUsage:{...e.insertUsage,[l]:{time:t.time,count:e.insertUsage[l]?e.insertUsage[l].count+1:1}}}}),e)}return e},lastBlockAttributesChange:function(e=null,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 e},editorMode:function(e="edit",t){return"INSERT_BLOCKS"===t.type&&"navigation"===e?"edit":"SET_EDITOR_MODE"===t.type?t.mode:e},hasBlockMovingClientId:function(e=null,t){return"SET_BLOCK_MOVING_MODE"===t.type?t.hasBlockMovingClientId:"SET_EDITOR_MODE"===t.type?null: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(e={},t){switch(t.type){case"INSERT_BLOCKS":case"REPLACE_BLOCKS":case"REPLACE_INNER_BLOCKS":if(!t.blocks.length)return e;const n=t.blocks.map((e=>e.clientId)),o=t.meta?.source;return{clientIds:n,source:o};case"RESET_BLOCKS":return{}}return e},temporarilyEditingAsBlocks:function(e="",t){return"SET_TEMPORARILY_EDITING_AS_BLOCKS"===t.type?t.temporarilyEditingAsBlocks:e},blockVisibility:function(e={},t){return"SET_BLOCK_VISIBILITY"===t.type?{...e,...t.updates}:e},blockEditingModes:function(e=new Map,t){switch(t.type){case"SET_BLOCK_EDITING_MODE":return new Map(e).set(t.clientId,t.mode);case"UNSET_BLOCK_EDITING_MODE":{const n=new Map(e);return n.delete(t.clientId),n}case"RESET_BLOCKS":return e.has("")?(new Map).set("",e.get("")):e}return e},removalPromptData:function(e=!1,t){switch(t.type){case"DISPLAY_BLOCK_REMOVAL_PROMPT":const{clientIds:e,selectPrevious:n,blockNamesForPrompt:o}=t;return{clientIds:e,selectPrevious:n,blockNamesForPrompt:o};case"CLEAR_BLOCK_REMOVAL_PROMPT":return!1}return e},blockRemovalRules:function(e=!1,t){return"SET_BLOCK_REMOVAL_RULES"===t.type?t.rules:e}});var A=function(e){return(t,n)=>{const o=e(t,n);return t?(o.automaticChangeStatus=t.automaticChangeStatus,"MARK_AUTOMATIC_CHANGE"===n.type?{...o,automaticChangeStatus:"pending"}:"MARK_AUTOMATIC_CHANGE_FINAL"===n.type&&"pending"===t.automaticChangeStatus?{...o,automaticChangeStatus:"final"}:o.blocks===t.blocks&&o.selection===t.selection||"final"!==o.automaticChangeStatus&&o.selection!==t.selection?o:{...o,automaticChangeStatus:void 0}):o}}(R),D={};function O(e){return[e]}function z(e,t,n){var o;if(e.length!==t.length)return!1;for(o=n;o(o,r)=>{let l,i;if("function"==typeof e?(l=e(o),i=e(r)):(l=o[e],i=r[e]),l>i)return"asc"===n?1:-1;if(i>l)return"asc"===n?-1:1;const a=t.findIndex((e=>e===o)),s=t.findIndex((e=>e===r));return a>s?1:s>a?-1:0};function K(e,t,n="asc"){return e.concat().sort(W(t,e,n))}function q(e){return e.isBlockInterfaceHidden}function Z(e){return e?.lastBlockInserted?.clientIds}function Y(e,t=""){if(e.blockEditingModes.has(t))return e.blockEditingModes.get(t);if(!t)return"default";const n=Be(e,t);if("contentOnly"===bt(e,n)){const n=re(e,t);return(0,f.select)(a.store).__experimentalHasContentRoleAttribute(n)?"contentOnly":"disabled"}const o=Y(e,n);return"contentOnly"===o?"default":o}const X=V(((e,t)=>{const n=t=>{const o=e.blockEditingModes.get(t);return(void 0===o||"disabled"===o)&&Xe(e,t).every(n)};return"disabled"===Y(e,t)&&Xe(e,t).every(n)}),(e=>[e.blockEditingModes,e.blocks.parents])),Q=V(((e,t="")=>Xe(e,t).flatMap((t=>"disabled"!==Y(e,t)?[{clientId:t,innerBlocks:Q(e,t)}]:Q(e,t)))),(e=>[e.blocks.order,e.blockEditingModes,e.settings.templateLock,e.blockListSettings])),J=V(((e,t,n=!1)=>Ie(e,t,n).filter((t=>"disabled"!==Y(e,t)))),(e=>[e.blocks.parents,e.blockEditingModes,e.settings.templateLock,e.blockListSettings]));function ee(e){return e.removalPromptData}function te(e){return e.blockRemovalRules}const ne=[],oe=new Set;function re(e,t){const n=e.blocks.byClientId.get(t),o="core/social-link";if("web"!==c.Platform.OS&&n?.name===o){const n=e.blocks.attributes.get(t),{service:r}=null!=n?n:{};return r?`${o}-${r}`:o}return n?n.name:null}function le(e,t){const n=e.blocks.byClientId.get(t);return!!n&&n.isValid}function ie(e,t){return e.blocks.byClientId.get(t)?e.blocks.attributes.get(t):null}function ae(e,t){return e.blocks.byClientId.has(t)?e.blocks.tree.get(t):null}const se=V(((e,t)=>e.blocks.byClientId.has(t)?{...e.blocks.byClientId.get(t),attributes:ie(e,t)}:null),((e,t)=>[e.blocks.byClientId.get(t),e.blocks.attributes.get(t)]));function ce(e,t){const n=t&&ln(e,t)?"controlled||"+t:t||"";return e.blocks.tree.get(n)?.innerBlocks||ne}const ue=V(((e,t)=>($()("wp.data.select( 'core/block-editor' ).__unstableGetClientIdWithClientIdsTree",{since:"6.3",version:"6.5"}),{clientId:t,innerBlocks:de(e,t)})),(e=>[e.blocks.order])),de=V(((e,t="")=>($()("wp.data.select( 'core/block-editor' ).__unstableGetClientIdsTree",{since:"6.3",version:"6.5"}),Xe(e,t).map((t=>ue(e,t))))),(e=>[e.blocks.order])),pe=V(((e,t)=>{const n=[];for(const o of t)for(const t of Xe(e,o))n.push(t,...pe(e,[t]));return n}),(e=>[e.blocks.order])),me=V((e=>{const t=[];for(const n of Xe(e))t.push(n,...pe(e,[n]));return t}),(e=>[e.blocks.order])),fe=V(((e,t)=>{const n=me(e);return t?n.reduce(((n,o)=>e.blocks.byClientId.get(o).name===t?n+1:n),0):n.length}),(e=>[e.blocks.order,e.blocks.byClientId])),ge=V(((e,t)=>{if(!t)return ne;const n=Array.isArray(t)?t:[t],o=me(e).filter((t=>{const o=e.blocks.byClientId.get(t);return n.includes(o.name)}));return o.length>0?o:ne}),(e=>[e.blocks.order,e.blocks.byClientId])),he=V(((e,t)=>(Array.isArray(t)?t:[t]).map((t=>ae(e,t)))),((e,t)=>(Array.isArray(t)?t:[t]).map((t=>e.blocks.tree.get(t))))),be=V(((e,t)=>he(e,t).filter(Boolean).map((e=>e.name))),((e,t)=>he(e,t)));function ve(e,t){return Xe(e,t).length}function _e(e){return e.selection.selectionStart}function ke(e){return e.selection.selectionEnd}function ye(e){return e.selection.selectionStart.clientId}function Ee(e){return e.selection.selectionEnd.clientId}function we(e){const t=Oe(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 xe(e){const t=Ce(e);return t?ae(e,t):null}function Be(e,t){return e.blocks.parents.has(t)?e.blocks.parents.get(t):null}const Ie=V(((e,t,n=!1)=>{const o=[];let r=t;for(;e.blocks.parents.get(r);)r=e.blocks.parents.get(r),o.push(r);return o.length?n?o:o.reverse():ne}),(e=>[e.blocks.parents])),Te=V(((e,t,n,o=!1)=>{const r=Ie(e,t,o),l=Array.isArray(n)?e=>n.includes(e):e=>n===e;return r.filter((t=>l(re(e,t))))}),(e=>[e.blocks.parents]));function Me(e,t){let n,o=t;do{n=o,o=e.blocks.parents.get(o)}while(o);return n}function Pe(e,t){const n=Ce(e),o=[...Ie(e,t),t],r=[...Ie(e,n),n];let l;const i=Math.min(o.length,r.length);for(let e=0;e{const{selectionStart:t,selectionEnd:n}=e.selection;if(!t.clientId||!n.clientId)return ne;if(t.clientId===n.clientId)return[t.clientId];const o=Be(e,t.clientId);if(null===o)return ne;const r=Xe(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 Oe(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId===n.clientId?ne:De(e)}const ze=V((e=>{const t=Oe(e);return t.length?t.map((t=>ae(e,t))):ne}),(e=>[...De.getDependants(e),e.blocks.byClientId,e.blocks.order,e.blocks.attributes]));function Ve(e){return Oe(e)[0]||null}function Fe(e){const t=Oe(e);return t[t.length-1]||null}function He(e,t){return Ve(e)===t}function Ge(e,t){return-1!==Oe(e).indexOf(t)}const Ue=V(((e,t)=>{let n=t,o=!1;for(;n&&!o;)n=Be(e,n),o=Ge(e,n);return o}),(e=>[e.blocks.order,e.selection.selectionStart.clientId,e.selection.selectionEnd.clientId]));function $e(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId===n.clientId?null:t.clientId||null}function je(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId===n.clientId?null:n.clientId||null}function We(e){const t=_e(e),n=ke(e);return!t.attributeKey&&!n.attributeKey&&void 0===t.offset&&void 0===n.offset}function Ke(e){const t=_e(e),n=ke(e);return!!t&&!!n&&t.clientId===n.clientId&&t.attributeKey===n.attributeKey&&t.offset===n.offset}function qe(e){return De(e).some((t=>{const n=re(e,t);return!(0,a.getBlockType)(n).merge}))}function Ze(e,t){const n=_e(e),o=ke(e);if(n.clientId===o.clientId)return!1;if(!n.attributeKey||!o.attributeKey||void 0===n.offset||void 0===o.offset)return!1;const r=Be(e,n.clientId);if(r!==Be(e,o.clientId))return!1;const l=Xe(e,r);let i,s;l.indexOf(n.clientId)>l.indexOf(o.clientId)?(i=o,s=n):(i=n,s=o);const c=t?s.clientId:i.clientId,u=t?i.clientId:s.clientId,d=re(e,c);if(!(0,a.getBlockType)(d).merge)return!1;const p=ae(e,u);if(p.name===d)return!0;const m=(0,a.switchToBlockType)(p,d);return m&&m.length}const Ye=e=>{const t=_e(e),n=ke(e);if(t.clientId===n.clientId)return ne;if(!t.attributeKey||!n.attributeKey||void 0===t.offset||void 0===n.offset)return ne;const o=Be(e,t.clientId);if(o!==Be(e,n.clientId))return ne;const r=Xe(e,o),l=r.indexOf(t.clientId),i=r.indexOf(n.clientId),[s,c]=l>i?[n,t]:[t,n],u=ae(e,s.clientId),d=(0,a.getBlockType)(u.name),p=ae(e,c.clientId),m=(0,a.getBlockType)(p.name),f=u.attributes[s.attributeKey],g=p.attributes[c.attributeKey],h=d.attributes[s.attributeKey],b=m.attributes[c.attributeKey];let v=(0,G.create)({html:f,...j(h)}),_=(0,G.create)({html:g,...j(b)});return v=(0,G.remove)(v,0,s.offset),_=(0,G.remove)(_,c.offset,_.text.length),[{...u,attributes:{...u.attributes,[s.attributeKey]:(0,G.toHTMLString)({value:v,...j(h)})}},{...p,attributes:{...p.attributes,[c.attributeKey]:(0,G.toHTMLString)({value:_,...j(b)})}}]};function Xe(e,t){return e.blocks.order.get(t||"")||ne}function Qe(e,t){return Xe(e,Be(e,t)).indexOf(t)}function Je(e,t){const{selectionStart:n,selectionEnd:o}=e.selection;return n.clientId===o.clientId&&n.clientId===t}function et(e,t,n=!1){return Xe(e,t).some((t=>Je(e,t)||Ge(e,t)||n&&et(e,t,n)))}function tt(e,t,n=!1){return Xe(e,t).some((t=>ut(e,t)||n&&tt(e,t,n)))}function nt(e,t){if(!t)return!1;const n=Oe(e),o=n.indexOf(t);return o>-1&&out(e,t)))}function pt(){return $()('wp.data.select( "core/block-editor" ).isCaretWithinFormattedText',{since:"6.1",version:"6.3"}),!1}const mt=V((e=>{let t,n;const{insertionPoint:o,selection:{selectionEnd:r}}=e;if(null!==o)return o;const{clientId:l}=r;return l?(t=Be(e,l)||void 0,n=Qe(e,r.clientId)+1):n=Xe(e).length,{rootClientId:t,index:n}}),(e=>[e.insertionPoint,e.selection.selectionEnd.clientId,e.blocks.parents,e.blocks.order]));function ft(e){return null!==e.insertionPoint}function gt(e){return e.template.isValid}function ht(e){return e.settings.template}function bt(e,t){var n,o;return t?null!==(n=jt(e,t)?.templateLock)&&void 0!==n&&n:null!==(o=e.settings.templateLock)&&void 0!==o&&o}const vt=(e,t,n=null)=>"boolean"==typeof e?e:Array.isArray(e)?!(!e.includes("core/post-content")||null!==t)||e.includes(t):n,_t=(e,t,n=null)=>{let o;if(t&&"object"==typeof t?(o=t,t=o.name):o=(0,a.getBlockType)(t),!o)return!1;const{allowedBlockTypes:r}=Wt(e);if(!vt(r,t,!0))return!1;if(!!bt(e,n))return!1;if("disabled"===Y(e,null!=n?n:""))return!1;const l=jt(e,n);if(n&&void 0===l)return!1;const i=l?.allowedBlocks,c=vt(i,t),u=o.parent,d=re(e,n),p=vt(u,d);let m=!0;const f=o.ancestor;if(f){m=[n,...Ie(e,n)].some((t=>vt(f,re(e,t))))}const g=m&&(null===c&&null===p||!0===c||!0===p);return g?(0,s.applyFilters)("blockEditor.__unstableCanInsertBlockType",g,o,n,{getBlock:ae.bind(null,e),getBlockParentsByBlockName:Te.bind(null,e)}):g},kt=V(_t,((e,t,n)=>[e.blockListSettings[n],e.blocks.byClientId.get(n),e.settings.allowedBlockTypes,e.settings.templateLock,e.blockEditingModes]));function yt(e,t,n=null){return t.every((t=>kt(e,re(e,t),n)))}function Et(e,t,n=null){const o=ie(e,t);return null===o||(void 0!==o.lock?.remove?!o.lock.remove:!bt(e,n)&&"disabled"!==Y(e,n))}function wt(e,t,n=null){return t.every((t=>Et(e,t,n)))}function St(e,t,n=null){const o=ie(e,t);return null===o||(void 0!==o.lock?.move?!o.lock.move:"all"!==bt(e,n)&&"disabled"!==Y(e,n))}function Ct(e,t,n=null){return t.every((t=>St(e,t,n)))}function xt(e,t){const n=ie(e,t);if(null===n)return!0;const{lock:o}=n;return!o?.edit}function Bt(e,t){return!!(0,a.hasBlockSupport)(t,"lock",!0)&&!!e.settings?.canLockBlocks}function It(e,t){var n;return null!==(n=e.preferences.insertUsage?.[t])&&void 0!==n?n:null}const Tt=(e,t,n)=>!!(0,a.hasBlockSupport)(t,"inserter",!0)&&_t(e,t.name,n),Mt=(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}},Pt=(e,{buildScope:t="inserter"})=>n=>{const o=n.name;let r=!1;(0,a.hasBlockSupport)(n.name,"multiple",!0)||(r=he(e,me(e)).some((({name:e})=>e===n.name)));const{time:l,count:i=0}=It(e,o)||{},s={id:o,name:n.name,title:n.title,icon:n.icon,isDisabled:r,frecency:Mt(l,i)};if("transform"===t)return s;const c=(0,a.getBlockVariations)(n.name,"inserter");return{...s,initialAttributes:{},description:n.description,category:n.category,keywords:n.keywords,variations:c,example:n.example,utility:1}},Nt=V(((e,t=null)=>{const n=/^\s*)[^])*)\5|[^]*?)}\s+)?(\/)?-->/,o=_t(e,"core/block",t)?Jt(e).filter((e=>"fully"===e.wp_pattern_sync_status||""===e.wp_pattern_sync_status||!e.wp_pattern_sync_status)).map((t=>{let o=H;if("web"===c.Platform.OS){const e=("string"==typeof t.content.raw?t.content.raw:t.content).match(n);if(e){const[,,t="core/",n]=e,r=(0,a.getBlockType)(t+n);r&&(o=r.icon)}}const r=`core/block/${t.id}`,{time:l,count:i=0}=It(e,r)||{},s=Mt(l,i);return{id:r,name:"core/block",initialAttributes:{ref:t.id},title:t.title.raw,icon:o,category:"reusable",keywords:["reusable"],isDisabled:!1,utility:1,frecency:s,content:t.content.raw}})):[],r=Pt(e,{buildScope:"inserter"}),l=(0,a.getBlockTypes)().filter((n=>Tt(e,n,t))).map(r).reduce(((t,n)=>{const{variations:o=[]}=n;if(o.some((({isDefault:e})=>e))||t.push(n),o.length){const r=((e,t)=>n=>{const o=`${t.id}/${n.name}`,{time:r,count:l=0}=It(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:Mt(r,l)}})(e,n);t.push(...o.map(r))}return t}),[]),{core:i,noncore:s}=l.reduce(((e,t)=>{const{core:n,noncore:o}=e;return(t.name.startsWith("core/")?n:o).push(t),e}),{core:[],noncore:[]});return[...[...i,...s],...o]}),((e,t)=>[e.blockListSettings[t],e.blocks.byClientId,e.blocks.order,e.preferences.insertUsage,e.settings.allowedBlockTypes,e.settings.templateLock,Jt(e),(0,a.getBlockTypes)()])),Lt=V(((e,t,n=null)=>{const o=Array.isArray(t)?t:[t],r=Pt(e,{buildScope:"transform"}),l=(0,a.getBlockTypes)().filter((t=>Tt(e,t,n))).map(r),i=Object.fromEntries(Object.entries(l).map((([,e])=>[e.name,e]))),s=(0,a.getPossibleBlockTransformations)(o).reduce(((e,t)=>(i[t?.name]&&e.push(i[t.name]),e)),[]);return K(s,(e=>i[e.name].frecency),"desc")}),((e,t,n)=>[e.blockListSettings[n],e.blocks.byClientId,e.preferences.insertUsage,e.settings.allowedBlockTypes,e.settings.templateLock,(0,a.getBlockTypes)()])),Rt=V(((e,t=null)=>{if((0,a.getBlockTypes)().some((n=>Tt(e,n,t))))return!0;return _t(e,"core/block",t)&&Jt(e).length>0}),((e,t)=>[e.blockListSettings[t],e.blocks.byClientId,e.settings.allowedBlockTypes,e.settings.templateLock,Jt(e),(0,a.getBlockTypes)()])),At=V(((e,t=null)=>{if(t)return(0,a.getBlockTypes)().filter((n=>Tt(e,n,t)))}),((e,t)=>[e.blockListSettings[t],e.blocks.byClientId,e.settings.allowedBlockTypes,e.settings.templateLock,(0,a.getBlockTypes)()])),Dt=V(((e,t=null)=>($()('wp.data.select( "core/block-editor" ).__experimentalGetAllowedBlocks',{alternative:'wp.data.select( "core/block-editor" ).getAllowedBlocks',since:"6.2",version:"6.4"}),At(e,t))),((e,t)=>[...At.getDependants(e,t)])),Ot=V(((e,t=null)=>{if(!t)return;const n=e.blockListSettings[t]?.__experimentalDefaultBlock,o=e.blockListSettings[t]?.__experimentalDirectInsert;return n&&o?"function"==typeof o?o(ae(e,t))?n:null:n:void 0}),((e,t)=>[e.blockListSettings[t],e.blocks.tree.get(t)]));function zt(e){var t;return(null!==(t=e?.settings?.__experimentalReusableBlocks)&&void 0!==t?t:ne).filter((e=>"unsynced"===e.wp_pattern_sync_status)).map((e=>({name:`core/block/${e.id}`,title:e.title.raw,categories:["custom"],content:e.content.raw})))}const Vt=V(((e,t)=>{const n=[...e.settings.__experimentalBlockPatterns,...zt(e)].find((({name:e})=>e===t));return n?{...n,blocks:(0,a.parse)(n.content,{__unstableSkipMigrationLogs:!0})}:null}),(e=>[e.settings.__experimentalBlockPatterns,e.settings.__experimentalReusableBlocks])),Ft=V((e=>{const t=e.settings.__experimentalBlockPatterns,n=zt(e),{allowedBlockTypes:o}=Wt(e),r=[...t,...n].filter((({inserter:e=!0})=>!!e)).map((({name:t})=>Vt(e,t))),l=r.filter((({blocks:e})=>((e,t)=>{if("boolean"==typeof t)return t;const n=[...e];for(;n.length>0;){const e=n.shift();if(!vt(t,e.name||e.blockName,!0))return!1;e.innerBlocks?.forEach((e=>{n.push(e)}))}return!0})(e,o)));return l}),(e=>[e.settings.__experimentalBlockPatterns,e.settings.__experimentalReusableBlocks,e.settings.allowedBlockTypes])),Ht=V(((e,t=null)=>{const n=Ft(e).filter((({blocks:n})=>n.every((({name:n})=>kt(e,n,t)))));return n}),((e,t)=>[e.settings.__experimentalBlockPatterns,e.settings.__experimentalReusableBlocks,e.settings.allowedBlockTypes,e.settings.templateLock,e.blockListSettings[t],e.blocks.byClientId.get(t)])),Gt=V(((e,t,n=null)=>{if(!t)return ne;const o=Ht(e,n),r=Array.isArray(t)?t:[t],l=o.filter((e=>e?.blockTypes?.some?.((e=>r.includes(e)))));return 0===l.length?ne:l}),((e,t,n)=>[...Ht.getDependants(e,n)])),Ut=V(((e,t,n=null)=>($()('wp.data.select( "core/block-editor" ).__experimentalGetPatternsByBlockTypes',{alternative:'wp.data.select( "core/block-editor" ).getPatternsByBlockTypes',since:"6.2",version:"6.4"}),Gt(e,t,n))),((e,t,n)=>[...Ht.getDependants(e,n)])),$t=V(((e,t,n=null)=>{if(!t)return ne;if(t.some((({clientId:t,innerBlocks:n})=>n.length||ln(e,t))))return ne;const o=Array.from(new Set(t.map((({name:e})=>e))));return Gt(e,o,n)}),((e,t,n)=>[...Gt.getDependants(e,n)]));function jt(e,t){return e.blockListSettings[t]}function Wt(e){return e.settings}function Kt(e){return e.settings.behaviors}function qt(e){return e.blocks.isPersistentChange}const Zt=V(((e,t=[])=>t.reduce(((t,n)=>e.blockListSettings[n]?{...t,[n]:e.blockListSettings[n]}:t),{})),(e=>[e.blockListSettings])),Yt=V(((e,t)=>{const n=Jt(e).find((e=>e.id===t));return n?n.title?.raw:null}),(e=>[Jt(e)]));function Xt(e){return e.blocks.isIgnoredChange}function Qt(e){return e.lastBlockAttributesChange}function Jt(e){var t;return null!==(t=e?.settings?.__experimentalReusableBlocks)&&void 0!==t?t:ne}function en(e){return"navigation"===e.editorMode}function tn(e){return e.editorMode}function nn(e){return e.hasBlockMovingClientId}function on(e){return!!e.automaticChangeStatus}function rn(e,t){return e.highlightedBlock===t}function ln(e,t){return!!e.blocks.controlledInnerBlocks[t]}const an=V(((e,t)=>{if(!t.length)return null;const n=Ce(e);if(t.includes(re(e,n)))return n;const o=Oe(e),r=Te(e,n||o[0],t);return r?r[r.length-1]:null}),((e,t)=>[e.selection.selectionStart.clientId,e.selection.selectionEnd.clientId,t]));function sn(e,t,n){const{lastBlockInserted:o}=e;return o.clientIds?.includes(t)&&o.source===n}function cn(e,t){var n;return null===(n=e.blockVisibility?.[t])||void 0===n||n}const un=V((e=>{const t=new Set(Object.keys(e.blockVisibility).filter((t=>e.blockVisibility[t])));return 0===t.size?oe:t}),(e=>[e.blockVisibility])),dn=V(((e,t)=>{let n,o=t;for(;e.blocks.parents.has(o);)o=e.blocks.parents.get(o),o&&"contentOnly"===bt(e,o)&&(n=o);return n}),(e=>[e.blocks.parents,e.blockListSettings]));function pn(e){return e.temporarilyEditingAsBlocks}function mn(e,t){if("default"!==Y(e,t))return!1;if(!xt(e,t))return!0;const n=tn(e);if("zoom-out"===n&&t&&!Be(e,t))return!0;const o=(0,a.hasBlockSupport)(re(e,t),"__experimentalDisableBlockOverlay",!1);return("navigation"===n||!o&&ln(e,t))&&!Je(e,t)&&!et(e,t,!0)}function fn(e,t){let n=e.blocks.parents.get(t);for(;n;){if(mn(e,n))return!0;n=e.blocks.parents.get(n)}return!1}const gn=["inserterMediaCategories","blockInspectorAnimation"];function hn(e,t=!1){let n=e;if(t&&"web"===c.Platform.OS){n={};for(const t in e)gn.includes(t)||(n[t]=e[t])}return{type:"UPDATE_SETTINGS",settings:n}}function bn(){return{type:"HIDE_BLOCK_INTERFACE"}}function vn(){return{type:"SHOW_BLOCK_INTERFACE"}}function _n(e="",t){return{type:"SET_BLOCK_EDITING_MODE",clientId:e,mode:t}}function kn(e=""){return{type:"UNSET_BLOCK_EDITING_MODE",clientId:e}}const yn=(e,t=!0,n=!1)=>({select:o,dispatch:r})=>{if(!e||!e.length)return;var l;l=e,e=Array.isArray(l)?l:[l];const i=o.getBlockRootClientId(e[0]);if(!o.canRemoveBlocks(e,i))return;const a=!n&&o.getBlockRemovalRules();if(a){const n=new Set,l=[...e];for(;l.length;){const e=l.shift(),t=o.getBlockName(e);a[t]&&n.add(t);const r=o.getBlockOrder(e);l.push(...r)}if(n.size)return void r(function(e,t,n){return{type:"DISPLAY_BLOCK_REMOVAL_PROMPT",clientIds:e,selectPrevious:t,blockNamesForPrompt:n}}(e,t,Array.from(n)))}t&&r.selectPreviousBlock(e[0],t),r({type:"REMOVE_BLOCKS",clientIds:e}),r(En())},En=()=>({select:e,dispatch:t})=>{if(e.getBlockCount()>0)return;const{__unstableHasCustomAppender:n}=e.getSettings();n||t.insertDefaultBlock()};function wn(){return{type:"CLEAR_BLOCK_REMOVAL_PROMPT"}}function Sn(e=!1){return{type:"SET_BLOCK_REMOVAL_RULES",rules:e}}var Cn=window.wp.a11y;const xn="†";function Bn(e){if(e)return Object.keys(e).find((t=>{const n=e[t];return"string"==typeof n&&-1!==n.indexOf(xn)}))}const In=e=>Array.isArray(e)?e:[e],Tn=e=>({dispatch:t})=>{t({type:"RESET_BLOCKS",blocks:e}),t(Mn(e))},Mn=e=>({select:t,dispatch:n})=>{const o=t.getTemplate(),r=t.getTemplateLock(),l=!o||"all"!==r||(0,a.doBlocksMatchTemplate)(e,o);if(l!==t.isValidTemplate())return n.setTemplateValidity(l),l};function Pn(e,t,n){return{type:"RESET_SELECTION",selectionStart:e,selectionEnd:t,initialPosition:n}}function Nn(e){return $()('wp.data.dispatch( "core/block-editor" ).receiveBlocks',{since:"5.9",alternative:"resetBlocks or insertBlocks"}),{type:"RECEIVE_BLOCKS",blocks:e}}function Ln(e,t,n=!1){return{type:"UPDATE_BLOCK_ATTRIBUTES",clientIds:In(e),attributes:t,uniqueByBlock:n}}function Rn(e,t){return{type:"UPDATE_BLOCK",clientId:e,updates:t}}function An(e,t=0){return{type:"SELECT_BLOCK",initialPosition:t,clientId:e}}const Dn=(e,t=!1)=>({select:n,dispatch:o})=>{const r=n.getPreviousBlockClientId(e);if(r)o.selectBlock(r,-1);else if(t){const t=n.getBlockRootClientId(e);t&&o.selectBlock(t,-1)}},On=e=>({select:t,dispatch:n})=>{const o=t.getNextBlockClientId(e);o&&n.selectBlock(o)};function zn(){return{type:"START_MULTI_SELECT"}}function Vn(){return{type:"STOP_MULTI_SELECT"}}const Fn=(e,t,n=0)=>({select:o,dispatch:r})=>{if(o.getBlockRootClientId(e)!==o.getBlockRootClientId(t))return;r({type:"MULTI_SELECT",start:e,end:t,initialPosition:n});const l=o.getSelectedBlockCount();(0,Cn.speak)((0,v.sprintf)((0,v._n)("%s block selected.","%s blocks selected.",l),l),"assertive")};function Hn(){return{type:"CLEAR_SELECTED_BLOCK"}}function Gn(e=!0){return{type:"TOGGLE_SELECTION",isSelectionEnabled:e}}function Un(e,t){var n;const o=null!==(n=t?.__experimentalPreferredStyleVariations?.value)&&void 0!==n?n:{};return e.map((e=>{const t=e.name;if(!(0,a.hasBlockSupport)(t,"defaultStylePicker",!0))return e;if(!o[t])return e;const n=e.attributes?.className;if(n?.includes("is-style-"))return e;const{attributes:r={}}=e,l=o[t];return{...e,attributes:{...r,className:`${n||""} is-style-${l}`.trim()}}}))}const $n=(e,t,n,o=0,r)=>({select:l,dispatch:i})=>{e=In(e),t=Un(In(t),l.getSettings());const a=l.getBlockRootClientId(e[0]);for(let e=0;e(t,n)=>({select:o,dispatch:r})=>{o.canMoveBlocks(t,n)&&r({type:e,clientIds:In(t),rootClientId:n})},Kn=Wn("MOVE_BLOCKS_DOWN"),qn=Wn("MOVE_BLOCKS_UP"),Zn=(e,t="",n="",o)=>({select:r,dispatch:l})=>{if(r.canMoveBlocks(e,t)){if(t!==n){if(!r.canRemoveBlocks(e,t))return;if(!r.canInsertBlocks(e,n))return}l({type:"MOVE_BLOCKS_TO_POSITION",fromRootClientId:t,toRootClientId:n,clientIds:e,index:o})}};function Yn(e,t="",n="",o){return Zn([e],t,n,o)}function Xn(e,t,n,o,r){return Qn([e],t,n,o,0,r)}const Qn=(e,t,n,o=!0,r=0,l)=>({select:i,dispatch:a})=>{null!==r&&"object"==typeof r&&(l=r,r=0,$()("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=Un(In(e),i.getSettings());const s=[];for(const t of e){i.canInsertBlockType(t.name,n)&&s.push(t)}s.length&&a({type:"INSERT_BLOCKS",blocks:s,index:t,rootClientId:n,time:Date.now(),updateSelection:o,initialPosition:o?r:null,meta:l})};function Jn(e,t,n={}){const{__unstableWithInserter:o,operation:r}=n;return{type:"SHOW_INSERTION_POINT",rootClientId:e,index:t,__unstableWithInserter:o,operation:r}}const eo=()=>({select:e,dispatch:t})=>{e.isBlockInsertionPointVisible()&&t({type:"HIDE_INSERTION_POINT"})};function to(e){return{type:"SET_TEMPLATE_VALIDITY",isValid:e}}const no=()=>({select:e,dispatch:t})=>{t({type:"SYNCHRONIZE_TEMPLATE"});const n=e.getBlocks(),o=e.getTemplate(),r=(0,a.synchronizeBlocksWithTemplate)(n,o);t.resetBlocks(r)},oo=e=>({registry:t,select:n,dispatch:o})=>{const r=n.getSelectionStart(),l=n.getSelectionEnd();if(r.clientId===l.clientId)return;if(!r.attributeKey||!l.attributeKey||void 0===r.offset||void 0===l.offset)return!1;const i=n.getBlockRootClientId(r.clientId);if(i!==n.getBlockRootClientId(l.clientId))return;const s=n.getBlockOrder(i);let c,u;s.indexOf(r.clientId)>s.indexOf(l.clientId)?(c=l,u=r):(c=r,u=l);const d=e?u:c,p=n.getBlock(d.clientId),m=(0,a.getBlockType)(p.name);if(!m.merge)return;const f=c,g=u,h=n.getBlock(f.clientId),b=(0,a.getBlockType)(h.name),v=n.getBlock(g.clientId),_=(0,a.getBlockType)(v.name),k=h.attributes[f.attributeKey],y=v.attributes[g.attributeKey],E=b.attributes[f.attributeKey],w=_.attributes[g.attributeKey];let S=(0,G.create)({html:k,...j(E)}),C=(0,G.create)({html:y,...j(w)});S=(0,G.remove)(S,f.offset,S.text.length),C=(0,G.insert)(C,xn,0,g.offset);const x=(0,a.cloneBlock)(h,{[f.attributeKey]:(0,G.toHTMLString)({value:S,...j(E)})}),B=(0,a.cloneBlock)(v,{[g.attributeKey]:(0,G.toHTMLString)({value:C,...j(w)})}),I=e?x:B,T=h.name===v.name?[I]:(0,a.switchToBlockType)(I,m.name);if(!T||!T.length)return;let M;if(e){const e=T.pop();M=m.merge(e.attributes,B.attributes)}else{const e=T.shift();M=m.merge(x.attributes,e.attributes)}const P=Bn(M),N=M[P],L=(0,G.create)({html:N,...j(m.attributes[P])}),R=L.text.indexOf(xn),A=(0,G.remove)(L,R,R+1),D=(0,G.toHTMLString)({value:A,...j(m.attributes[P])});M[P]=D;const O=n.getSelectedBlockClientIds(),z=[...e?T:[],{...p,attributes:{...p.attributes,...M}},...e?[]:T];t.batch((()=>{o.selectionChange(p.clientId,P,R,R),o.replaceBlocks(O,z,0,n.getSelectedBlocksInitialCaretPosition())}))},ro=()=>({select:e,dispatch:t})=>{const n=e.getSelectionStart(),o=e.getSelectionEnd();if(n.clientId===o.clientId)return;if(!n.attributeKey||!o.attributeKey||void 0===n.offset||void 0===o.offset)return;const r=e.getBlockRootClientId(n.clientId);if(r!==e.getBlockRootClientId(o.clientId))return;const l=e.getBlockOrder(r);let i,s;l.indexOf(n.clientId)>l.indexOf(o.clientId)?(i=o,s=n):(i=n,s=o);const c=i,u=s,d=e.getBlock(c.clientId),p=(0,a.getBlockType)(d.name),m=e.getBlock(u.clientId),f=(0,a.getBlockType)(m.name),g=d.attributes[c.attributeKey],h=m.attributes[u.attributeKey],b=p.attributes[c.attributeKey],v=f.attributes[u.attributeKey];let _=(0,G.create)({html:g,...j(b)}),k=(0,G.create)({html:h,...j(v)});_=(0,G.remove)(_,c.offset,_.text.length),k=(0,G.remove)(k,0,u.offset),t.replaceBlocks(e.getSelectedBlockClientIds(),[{...d,attributes:{...d.attributes,[c.attributeKey]:(0,G.toHTMLString)({value:_,...j(b)})}},(0,a.createBlock)((0,a.getDefaultBlockName)()),{...m,attributes:{...m.attributes,[u.attributeKey]:(0,G.toHTMLString)({value:k,...j(v)})}}],1,e.getSelectedBlocksInitialCaretPosition())},lo=()=>({select:e,dispatch:t})=>{const n=e.getSelectionStart(),o=e.getSelectionEnd();t.selectionChange({start:{clientId:n.clientId},end:{clientId:o.clientId}})},io=(e,t)=>({registry:n,select:o,dispatch:r})=>{const l=[e,t];r({type:"MERGE_BLOCKS",blocks:l});const[i,s]=l,c=o.getBlock(i),u=(0,a.getBlockType)(c.name);if(!u)return;const d=o.getBlock(s);if(u&&!u.merge){const e=(0,a.switchToBlockType)(d,u.name);if(1!==e?.length)return void r.selectBlock(c.clientId);const[t]=e;return t.innerBlocks.length<1?void r.selectBlock(c.clientId):void n.batch((()=>{r.insertBlocks(t.innerBlocks,void 0,i),r.removeBlock(s),r.selectBlock(t.innerBlocks[0].clientId)}))}const p=(0,a.getBlockType)(d.name),{clientId:m,attributeKey:f,offset:g}=o.getSelectionStart(),h=(m===i?u:p).attributes[f],b=(m===i||m===s)&&void 0!==f&&void 0!==g&&!!h;h||("number"==typeof f?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 f):window.console.error("The RichText identifier prop does not match any attributes defined by the block."));const v=(0,a.cloneBlock)(c),_=(0,a.cloneBlock)(d);if(b){const e=m===i?v:_,t=e.attributes[f],n=(0,G.insert)((0,G.create)({html:t,...j(h)}),xn,g,g);e.attributes[f]=(0,G.toHTMLString)({value:n,...j(h)})}const k=c.name===d.name?[_]:(0,a.switchToBlockType)(_,c.name);if(!k||!k.length)return;const y=u.merge(v.attributes,k[0].attributes);if(b){const e=Bn(y),t=y[e],n=(0,G.create)({html:t,...j(u.attributes[e])}),o=n.text.indexOf(xn),l=(0,G.remove)(n,o,o+1),i=(0,G.toHTMLString)({value:l,...j(u.attributes[e])});y[e]=i,r.selectionChange(c.clientId,e,o,o)}r.replaceBlocks([c.clientId,d.clientId],[{...c,attributes:{...c.attributes,...y}},...k.slice(1)],0)},ao=(e,t=!0)=>yn(e,t);function so(e,t){return ao([e],t)}function co(e,t,n=!1,o=0){return{type:"REPLACE_INNER_BLOCKS",rootClientId:e,blocks:t,updateSelection:n,initialPosition:n?o:null,time:Date.now()}}function uo(e){return{type:"TOGGLE_BLOCK_MODE",clientId:e}}function po(){return{type:"START_TYPING"}}function mo(){return{type:"STOP_TYPING"}}function fo(e=[]){return{type:"START_DRAGGING_BLOCKS",clientIds:e}}function go(){return{type:"STOP_DRAGGING_BLOCKS"}}function ho(){return $()('wp.data.dispatch( "core/block-editor" ).enterFormattedText',{since:"6.1",version:"6.3"}),{type:"DO_NOTHING"}}function bo(){return $()('wp.data.dispatch( "core/block-editor" ).exitFormattedText',{since:"6.1",version:"6.3"}),{type:"DO_NOTHING"}}function vo(e,t,n,o){return"string"==typeof e?{type:"SELECTION_CHANGE",clientId:e,attributeKey:t,startOffset:n,endOffset:o}:{type:"SELECTION_CHANGE",...e}}const _o=(e,t,n)=>({dispatch:o})=>{const r=(0,a.getDefaultBlockName)();if(!r)return;const l=(0,a.createBlock)(r,e);return o.insertBlock(l,n,t)};function ko(e,t){return{type:"UPDATE_BLOCK_LIST_SETTINGS",clientId:e,settings:t}}function yo(e){return hn(e,!0)}function Eo(e,t){return{type:"SAVE_REUSABLE_BLOCK_SUCCESS",id:e,updatedId:t}}function wo(){return{type:"MARK_LAST_CHANGE_AS_PERSISTENT"}}function So(){return{type:"MARK_NEXT_CHANGE_AS_NOT_PERSISTENT"}}const Co=()=>({dispatch:e})=>{e({type:"MARK_AUTOMATIC_CHANGE"});const{requestIdleCallback:t=(e=>setTimeout(e,100))}=window;t((()=>{e({type:"MARK_AUTOMATIC_CHANGE_FINAL"})}))},xo=(e=!0)=>({dispatch:t})=>{t.__unstableSetEditorMode(e?"navigation":"edit")},Bo=e=>({dispatch:t,select:n})=>{if("zoom-out"===e){const e=n.getBlockSelectionStart();e&&t.selectBlock(n.getBlockHierarchyRootClientId(e))}t({type:"SET_EDITOR_MODE",mode:e}),"navigation"===e?(0,Cn.speak)((0,v.__)("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,Cn.speak)((0,v.__)("You are currently in edit mode. To return to the navigation mode, press Escape.")):"zoom-out"===e&&(0,Cn.speak)((0,v.__)("You are currently in zoom-out mode."))},Io=(e=null)=>({dispatch:t})=>{t({type:"SET_BLOCK_MOVING_MODE",hasBlockMovingClientId:e}),e&&(0,Cn.speak)((0,v.__)("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."))},To=(e,t=!0)=>({select:n,dispatch:o})=>{if(!e||!e.length)return;const r=n.getBlocksByClientId(e);if(r.some((e=>!e)))return;const l=r.map((e=>e.name));if(l.some((e=>!(0,a.hasBlockSupport)(e,"multiple",!0))))return;const i=n.getBlockRootClientId(e[0]),s=In(e),c=n.getBlockIndex(s[s.length-1]),u=r.map((e=>(0,a.__experimentalCloneSanitizedBlock)(e)));return o.insertBlocks(u,c+1,i,t),u.length>1&&t&&o.multiSelect(u[0].clientId,u[u.length-1].clientId),u.map((e=>e.clientId))},Mo=e=>({select:t,dispatch:n})=>{if(!e)return;const o=t.getBlockRootClientId(e);if(t.getTemplateLock(o))return;const r=t.getBlockIndex(e);return n.insertDefaultBlock({},o,r)},Po=e=>({select:t,dispatch:n})=>{if(!e)return;const o=t.getBlockRootClientId(e);if(t.getTemplateLock(o))return;const r=t.getBlockIndex(e);return n.insertDefaultBlock({},o,r+1)};function No(e,t){return{type:"TOGGLE_BLOCK_HIGHLIGHT",clientId:e,isHighlighted:t}}const Lo=e=>async({dispatch:t})=>{t(No(e,!0)),await new Promise((e=>setTimeout(e,150))),t(No(e,!1))};function Ro(e,t){return{type:"SET_HAS_CONTROLLED_INNER_BLOCKS",hasControlledInnerBlocks:t,clientId:e}}function Ao(e){return{type:"SET_BLOCK_VISIBILITY",updates:e}}function Do(e){return{type:"SET_TEMPORARILY_EDITING_AS_BLOCKS",temporarilyEditingAsBlocks:e}}const Oo="core/block-editor";var zo=window.wp.privateApis;const{lock:Vo,unlock:Fo}=(0,zo.__dangerousOptInToUnstableAPIsOnlyForCoreModules)("I know using unstable features means my plugin or theme will inevitably break on the next WordPress release.","@wordpress/block-editor"),Ho={reducer:A,selectors:t,actions:l},Go=(0,f.createReduxStore)(Oo,{...Ho,persist:["preferences"]}),Uo=(0,f.registerStore)(Oo,{...Ho,persist:["preferences"]});Fo(Uo).registerPrivateActions(r),Fo(Uo).registerPrivateSelectors(e),Fo(Go).registerPrivateActions(r),Fo(Go).registerPrivateSelectors(e);const $o={name:"",isSelected:!1},jo=(0,c.createContext)($o),{Provider:Wo}=jo;function Ko(){return(0,c.useContext)(jo)}function qo(){const{isSelected:e,clientId:t,name:n}=Ko();return(0,f.useSelect)((o=>{if(e)return!0;const{getBlockName:r,isFirstMultiSelectedBlock:l,getMultiSelectedBlockClientIds:i}=o(Go);return!!l(t)&&i().every((e=>r(e)===n))}),[t,e,n])}function Zo({group:e="default",controls:t,children:n,__experimentalShareWithChildBlocks:o=!1}){const r=function(e,t){const n=qo(),{clientId:o}=Ko(),r=(0,f.useSelect)((e=>{const{getBlockName:n,hasSelectedInnerBlock:r}=e(Go),{hasBlockSupport:l}=e(a.store);return t&&l(n(o),"__experimentalExposeControlsToChildren",!1)&&r(o)}),[t,o]);return n?g[e]?.Fill:r?g.parent.Fill:null}(e,o);if(!r)return null;const l=(0,c.createElement)(c.Fragment,null,"default"===e&&(0,c.createElement)(m.ToolbarGroup,{controls:t}),n);return(0,c.createElement)(m.__experimentalStyleProvider,{document:document},(0,c.createElement)(r,null,(e=>{const{forwardedContext:t=[]}=e;return t.reduce(((e,[t,n])=>(0,c.createElement)(t,{...n},e)),l)})))}window.wp.warning;const{ComponentsContext:Yo}=Fo(m.privateApis);function Xo({group:e="default",...t}){const n=(0,c.useContext)(m.__experimentalToolbarContext),o=(0,c.useContext)(Yo),r=(0,c.useMemo)((()=>({forwardedContext:[[m.__experimentalToolbarContext.Provider,{value:n}],[Yo.Provider,{value:o}]]})),[n,o]),l=g[e]?.Slot,i=(0,m.__experimentalUseSlotFills)(l?.__unstableName);if(!l)return"undefined"!=typeof process&&process.env,null;if(!i?.length)return null;const a=(0,c.createElement)(l,{...t,bubblesVirtually:!0,fillProps:r});return"default"===e?a:(0,c.createElement)(m.ToolbarGroup,null,a)}const Qo=Zo;Qo.Slot=Xo;const Jo=e=>(0,c.createElement)(Zo,{group:"inline",...e});Jo.Slot=e=>(0,c.createElement)(Xo,{group:"inline",...e});var er=Qo;var tr=(0,c.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(F.Path,{d:"M9 9v6h11V9H9zM4 20h1.5V4H4v16z"}));var nr=(0,c.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(F.Path,{d:"M12.5 15v5H11v-5H4V9h7V4h1.5v5h7v6h-7Z"}));var or=(0,c.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(F.Path,{d:"M4 15h11V9H4v6zM18.5 4v16H20V4h-1.5z"}));var rr=(0,c.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(F.Path,{d:"M9 15h6V9H9v6zm-5 5h1.5V4H4v16zM18.5 4v16H20V4h-1.5z"}));var lr=(0,c.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(F.Path,{d:"M4 4H5.5V20H4V4ZM7 10L17 10V14L7 14V10ZM20 4H18.5V20H20V4Z"}));var ir=(0,c.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(F.Path,{d:"m14.5 6.5-1 1 3.7 3.7H4v1.6h13.2l-3.7 3.7 1 1 5.6-5.5z"}));var ar=(0,c.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(F.Path,{d:"m16.5 13.5-3.7 3.7V4h-1.5v13.2l-3.8-3.7-1 1 5.5 5.6 5.5-5.6z"}));const sr={default:{name:"default",slug:"flow",className:"is-layout-flow",baseStyles:[{selector:" > .alignleft",rules:{float:"left","margin-inline-start":"0","margin-inline-end":"2em"}},{selector:" > .alignright",rules:{float:"right","margin-inline-start":"2em","margin-inline-end":"0"}},{selector:" > .aligncenter",rules:{"margin-left":"auto !important","margin-right":"auto !important"}}],spacingStyles:[{selector:" > :first-child:first-child",rules:{"margin-block-start":"0"}},{selector:" > :last-child:last-child",rules:{"margin-block-end":"0"}},{selector:" > *",rules:{"margin-block-start":null,"margin-block-end":"0"}}]},constrained:{name:"constrained",slug:"constrained",className:"is-layout-constrained",baseStyles:[{selector:" > .alignleft",rules:{float:"left","margin-inline-start":"0","margin-inline-end":"2em"}},{selector:" > .alignright",rules:{float:"right","margin-inline-start":"2em","margin-inline-end":"0"}},{selector:" > .aligncenter",rules:{"margin-left":"auto !important","margin-right":"auto !important"}},{selector:" > :where(:not(.alignleft):not(.alignright):not(.alignfull))",rules:{"max-width":"var(--wp--style--global--content-size)","margin-left":"auto !important","margin-right":"auto !important"}},{selector:" > .alignwide",rules:{"max-width":"var(--wp--style--global--wide-size)"}}],spacingStyles:[{selector:" > :first-child:first-child",rules:{"margin-block-start":"0"}},{selector:" > :last-child:last-child",rules:{"margin-block-end":"0"}},{selector:" > *",rules:{"margin-block-start":null,"margin-block-end":"0"}}]},flex:{name:"flex",slug:"flex",className:"is-layout-flex",displayMode:"flex",baseStyles:[{selector:"",rules:{"flex-wrap":"wrap","align-items":"center"}},{selector:" > *",rules:{margin:"0"}}],spacingStyles:[{selector:"",rules:{gap:null}}]},grid:{name:"grid",slug:"grid",className:"is-layout-grid",displayMode:"grid",baseStyles:[{selector:" > *",rules:{margin:"0"}}],spacingStyles:[{selector:"",rules:{gap:null}}]}};function cr(e,t=""){return e.split(",").map((e=>`.editor-styles-wrapper ${e}${t?` ${t}`:""}`)).join(",")}function ur(e,t=sr,n,o){let r="";return t?.[n]?.spacingStyles?.length&&o&&t[n].spacingStyles.forEach((t=>{r+=`${cr(e,t.selector.trim())} { `,r+=Object.entries(t.rules).map((([e,t])=>`${e}: ${t||o}`)).join("; "),r+="; }"})),r}function dr(e){const{contentSize:t,wideSize:n,type:o="default"}=e,r={},l=/^(?!0)\d+(px|em|rem|vw|vh|%)?$/i;return l.test(t)&&"constrained"===o&&(r.none=(0,v.sprintf)((0,v.__)("Max %s wide"),t)),l.test(n)&&(r.wide=(0,v.sprintf)((0,v.__)("Max %s wide"),n)),r}var pr=(0,c.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(F.Path,{d:"M3.5 17H5V7H3.5v10zM7 20.5h10V19H7v1.5zM19 7v10h1.5V7H19zM7 5h10V3.5H7V5z",style:{fill:"#1e1e1e"}}));var mr=(0,c.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(F.Path,{d:"M8.2 5.3h8V3.8h-8v1.5zm0 14.5h8v-1.5h-8v1.5zm3.5-6.5h1v-1h-1v1zm1-6.5h-1v.5h1v-.5zm-1 4.5h1v-1h-1v1zm0-2h1v-1h-1v1zm0 7.5h1v-.5h-1v.5zm1-2.5h-1v1h1v-1zm-8.5 1.5h1.5v-8H4.2v8zm14.5-8v8h1.5v-8h-1.5zm-5 4.5v-1h-1v1h1zm-6.5 0h.5v-1h-.5v1zm3.5-1v1h1v-1h-1zm6 1h.5v-1h-.5v1zm-8-1v1h1v-1h-1zm6 0v1h1v-1h-1z",style:{fill:"#1e1e1e",fillRule:"evenodd",clipRule:"evenodd"}}));var fr=(0,c.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(F.Path,{d:"M3.5 17H5V7H3.5v10zM19 7v10h1.5V7H19z",style:{fill:"#1e1e1e"}}),(0,c.createElement)(F.Path,{d:"M7 20.5h10V19H7v1.5zm0-17V5h10V3.5H7z",style:{fill:"#1e1e1e",opacity:.1}}));var gr=(0,c.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(F.Path,{d:"M3.5 17H5V7H3.5v10zM19 7v10h1.5V7H19z",style:{fill:"#1e1e1e",opacity:.1}}),(0,c.createElement)(F.Path,{d:"M7 20.5h10V19H7v1.5zm0-17V5h10V3.5H7z",style:{fill:"#1e1e1e"}}));var hr=(0,c.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(F.Path,{d:"M3.5 17H5V7H3.5v10zM7 20.5h10V19H7v1.5zM19 7v10h1.5V7H19z",style:{fill:"#1e1e1e",opacity:.1}}),(0,c.createElement)(F.Path,{d:"M7 5h10V3.5H7V5z",style:{fill:"#1e1e1e"}}));var br=(0,c.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(F.Path,{d:"M20.5 7H19v10h1.5V7z",style:{fill:"#1e1e1e"}}),(0,c.createElement)(F.Path,{d:"M3.5 17H5V7H3.5v10zM7 20.5h10V19H7v1.5zm0-17V5h10V3.5H7z",style:{fill:"#1e1e1e",opacity:.1}}));var vr=(0,c.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(F.Path,{d:"M7 20.5h10V19H7v1.5z",style:{fill:"#1e1e1e"}}),(0,c.createElement)(F.Path,{d:"M3.5 17H5V7H3.5v10zM19 7v10h1.5V7H19zM7 5h10V3.5H7V5z",style:{fill:"#1e1e1e",opacity:.1}}));const _r=(0,c.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(F.Path,{d:"M5 17H3.5V7H5v10z",style:{fill:"#1e1e1e"}}),(0,c.createElement)(F.Path,{d:"M7 20.5h10V19H7v1.5zM19 7v10h1.5V7H19zM7 5h10V3.5H7V5z",style:{fill:"#1e1e1e",opacity:.1}}));const kr=["top","right","bottom","left"],yr={top:void 0,right:void 0,bottom:void 0,left:void 0},Er={custom:pr,axial:mr,horizontal:fr,vertical:gr,top:hr,right:br,bottom:vr,left:_r},wr={default:(0,v.__)("Spacing control"),top:(0,v.__)("Top"),bottom:(0,v.__)("Bottom"),left:(0,v.__)("Left"),right:(0,v.__)("Right"),mixed:(0,v.__)("Mixed"),vertical:(0,v.__)("Vertical"),horizontal:(0,v.__)("Horizontal"),axial:(0,v.__)("Horizontal & vertical"),custom:(0,v.__)("Custom")},Sr={axial:"axial",top:"top",right:"right",bottom:"bottom",left:"left",custom:"custom"};function Cr(e){return!!e?.includes&&("0"===e||e.includes("var:preset|spacing|"))}function xr(e,t){if(!Cr(e))return e;const n=Tr(e),o=t.find((e=>String(e.slug)===n));return o?.size}function Br(e,t){if(!e||Cr(e)||"0"===e)return e;const n=t.find((t=>String(t.size)===String(e)));return n?.slug?`var:preset|spacing|${n.slug}`:e}function Ir(e){if(!e)return;const t=e.match(/var:preset\|spacing\|(.+)/);return t?`var(--wp--preset--spacing--${t[1]})`:e}function Tr(e){if(!e)return;if("0"===e||"default"===e)return e;const t=e.match(/var:preset\|spacing\|(.+)/);return t?t[1]:void 0}function Mr(e,t){if(!e||!e.length)return!1;const n=e.includes("horizontal")||e.includes("left")&&e.includes("right"),o=e.includes("vertical")||e.includes("top")&&e.includes("bottom");return"horizontal"===t?n:"vertical"===t?o:n||o}function Pr(e,t="0"){const n=function(e){if(!e)return null;const t="string"==typeof e;return{top:t?e:e?.top,left:t?e:e?.left}}(e);if(!n)return null;const o=Ir(n?.top)||t,r=Ir(n?.left)||t;return o===r?o:`${o} ${r}`}const Nr=(0,c.createElement)(m.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(m.Path,{d:"M15 4H9v11h6V4zM4 18.5V20h16v-1.5H4z"})),Lr=(0,c.createElement)(m.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(m.Path,{d:"M20 11h-5V4H9v7H4v1.5h5V20h6v-7.5h5z"})),Rr=(0,c.createElement)(m.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(m.Path,{d:"M9 20h6V9H9v11zM4 4v1.5h16V4H4z"})),Ar=(0,c.createElement)(m.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(m.Path,{d:"M4 4L20 4L20 5.5L4 5.5L4 4ZM10 7L14 7L14 17L10 17L10 7ZM20 18.5L4 18.5L4 20L20 20L20 18.5Z"})),Dr=(0,c.createElement)(m.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(m.Path,{d:"M7 4H17V8L7 8V4ZM7 16L17 16V20L7 20V16ZM20 11.25H4V12.75H20V11.25Z"})),Or={top:{icon:Rr,title:(0,v._x)("Align top","Block vertical alignment setting")},center:{icon:Lr,title:(0,v._x)("Align middle","Block vertical alignment setting")},bottom:{icon:Nr,title:(0,v._x)("Align bottom","Block vertical alignment setting")},stretch:{icon:Ar,title:(0,v._x)("Stretch to fill","Block vertical alignment setting")},"space-between":{icon:Dr,title:(0,v._x)("Space between","Block vertical alignment setting")}},zr=["top","center","bottom"];var Vr=function({value:e,onChange:t,controls:n=zr,isCollapsed:o=!0,isToolbar:r}){const l=Or[e],i=Or.top,a=r?m.ToolbarGroup:m.ToolbarDropdownMenu,s=r?{isCollapsed:o}:{};return(0,c.createElement)(a,{icon:l?l.icon:i.icon,label:(0,v._x)("Change vertical alignment","Block vertical alignment setting label"),controls:n.map((n=>{return{...Or[n],isActive:e===n,role:o?"menuitemradio":void 0,onClick:(r=n,()=>t(e===r?void 0:r))};var r})),...s})};const Fr=e=>(0,c.createElement)(Vr,{...e,isToolbar:!1}),Hr=e=>(0,c.createElement)(Vr,{...e,isToolbar:!0}),Gr={left:tr,center:nr,right:or,"space-between":rr,stretch:lr};var Ur=function({allowedControls:e=["left","center","right","space-between"],isCollapsed:t=!0,onChange:n,value:o,popoverProps:r,isToolbar:l}){const i=e=>{n(e===o?void 0:e)},a=o?Gr[o]:Gr.left,s=[{name:"left",icon:tr,title:(0,v.__)("Justify items left"),isActive:"left"===o,onClick:()=>i("left")},{name:"center",icon:nr,title:(0,v.__)("Justify items center"),isActive:"center"===o,onClick:()=>i("center")},{name:"right",icon:or,title:(0,v.__)("Justify items right"),isActive:"right"===o,onClick:()=>i("right")},{name:"space-between",icon:rr,title:(0,v.__)("Space between items"),isActive:"space-between"===o,onClick:()=>i("space-between")},{name:"stretch",icon:lr,title:(0,v.__)("Stretch items"),isActive:"stretch"===o,onClick:()=>i("stretch")}],u=l?m.ToolbarGroup:m.ToolbarDropdownMenu,d=l?{isCollapsed:t}:{};return(0,c.createElement)(u,{icon:a,popoverProps:r,label:(0,v.__)("Change items justification"),controls:s.filter((t=>e.includes(t.name))),...d})};const $r=e=>(0,c.createElement)(Ur,{...e,isToolbar:!1}),jr=e=>(0,c.createElement)(Ur,{...e,isToolbar:!0});var Wr=window.lodash;const Kr=["color","border","dimensions","typography","spacing"],qr={"color.palette":e=>e.colors,"color.gradients":e=>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=>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},Zr={"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"},Yr=e=>Zr[e]||e;function Xr(e){const{name:t,clientId:n}=Ko();return(0,f.useSelect)((o=>{if(Kr.includes(e))return void console.warn("Top level useSetting paths are disabled. Please use a subpath to query the information needed.");let r=(0,s.applyFilters)("blockEditor.useSetting.before",void 0,e,n,t);if(void 0!==r)return r;const l=Yr(e),i=[n,...o(Go).getBlockParents(n,!0)];for(const e of i){const n=o(Go).getBlockName(e);if((0,a.hasBlockSupport)(n,"__experimentalSettings",!1)){var c;const n=o(Go).getBlockAttributes(e);if(r=null!==(c=(0,Wr.get)(n,`settings.blocks.${t}.${l}`))&&void 0!==c?c:(0,Wr.get)(n,`settings.${l}`),void 0!==r)break}}const u=o(Go).getSettings();if(void 0===r){var d;const e=`__experimentalFeatures.${l}`,n=`__experimentalFeatures.blocks.${t}.${l}`;r=null!==(d=(0,Wr.get)(u,n))&&void 0!==d?d:(0,Wr.get)(u,e)}var p,m;if(void 0!==r)return a.__EXPERIMENTAL_PATHS_WITH_MERGE[l]?null!==(p=null!==(m=r.custom)&&void 0!==m?m:r.theme)&&void 0!==p?p:r.default:r;const f=qr[l]?qr[l](u):void 0;return void 0!==f?f:"typography.dropCap"===l||void 0}),[t,n,e])}const Qr="1600px",Jr="320px",el=1,tl=.25,nl=.75,ol="14px";function rl({minimumFontSize:e,maximumFontSize:t,fontSize:n,minimumViewPortWidth:o=Jr,maximumViewPortWidth:r=Qr,scaleFactor:l=el,minimumFontSizeLimit:i}){if(i=ll(i)?i:ol,n){const o=ll(n);if(!o?.unit)return null;const r=ll(i,{coerceTo:o.unit});if(r?.value&&!e&&!t&&o?.value<=r?.value)return null;if(t||(t=`${o.value}${o.unit}`),!e){const t="px"===o.unit?o.value:16*o.value,n=Math.min(Math.max(1-.075*Math.log2(t),tl),nl),l=il(o.value*n,3);e=r?.value&&l0}function cl(e){const t=e?.typography,n=e?.layout;return sl(t)&&n?.wideSize?{fluid:{maxViewPortWidth:n.wideSize,...t.fluid}}:{fluid:t?.fluid}}const ul="body",dl=[{path:["color","palette"],valueKey:"color",cssVarInfix:"color",classes:[{classSuffix:"color",propertyName:"color"},{classSuffix:"background-color",propertyName:"background-color"},{classSuffix:"border-color",propertyName:"border-color"}]},{path:["color","gradients"],valueKey:"gradient",cssVarInfix:"gradient",classes:[{classSuffix:"gradient-background",propertyName:"background"}]},{path:["color","duotone"],valueKey:"colors",cssVarInfix:"duotone",valueFunc:({slug:e})=>`url( '#wp-duotone-${e}' )`,classes:[]},{path:["shadow","presets"],valueKey:"shadow",cssVarInfix:"shadow",classes:[]},{path:["typography","fontSizes"],valueFunc:(e,t)=>al(e,cl(t)),valueKey:"size",cssVarInfix:"font-size",classes:[{classSuffix:"font-size",propertyName:"font-size"}]},{path:["typography","fontFamilies"],valueKey:"fontFamily",cssVarInfix:"font-family",classes:[{classSuffix:"font-family",propertyName:"font-family"}]},{path:["spacing","spacingSizes"],valueKey:"size",cssVarInfix:"spacing",valueFunc:({size:e})=>e,classes:[]}],pl={"color.background":"color","color.text":"color","filter.duotone":"duotone","elements.link.color.text":"color","elements.link.:hover.color.text":"color","elements.link.typography.fontFamily":"font-family","elements.link.typography.fontSize":"font-size","elements.button.color.text":"color","elements.button.color.background":"color","elements.caption.color.text":"color","elements.button.typography.fontFamily":"font-family","elements.button.typography.fontSize":"font-size","elements.heading.color":"color","elements.heading.color.background":"color","elements.heading.typography.fontFamily":"font-family","elements.heading.gradient":"gradient","elements.heading.color.gradient":"gradient","elements.h1.color":"color","elements.h1.color.background":"color","elements.h1.typography.fontFamily":"font-family","elements.h1.color.gradient":"gradient","elements.h2.color":"color","elements.h2.color.background":"color","elements.h2.typography.fontFamily":"font-family","elements.h2.color.gradient":"gradient","elements.h3.color":"color","elements.h3.color.background":"color","elements.h3.typography.fontFamily":"font-family","elements.h3.color.gradient":"gradient","elements.h4.color":"color","elements.h4.color.background":"color","elements.h4.typography.fontFamily":"font-family","elements.h4.color.gradient":"gradient","elements.h5.color":"color","elements.h5.color.background":"color","elements.h5.typography.fontFamily":"font-family","elements.h5.color.gradient":"gradient","elements.h6.color":"color","elements.h6.color.background":"color","elements.h6.typography.fontFamily":"font-family","elements.h6.color.gradient":"gradient","color.gradient":"gradient",shadow:"shadow","typography.fontSize":"font-size","typography.fontFamily":"font-family"};function ml(e,t,n,o,r){const l=[(0,Wr.get)(e,["blocks",t,...n]),(0,Wr.get)(e,n)];for(const i of l)if(i){const l=["custom","theme","default"];for(const a of l){const l=i[a];if(l){const i=l.find((e=>e[o]===r));if(i){if("slug"===o)return i;return ml(e,t,n,"slug",i.slug)[o]===i[o]?i:void 0}}}}}function fl(e,t,n){if(!n||"string"!=typeof n){if(!n?.ref||"string"!=typeof n?.ref)return n;{const t=n.ref.split(".");if(!(n=(0,Wr.get)(e,t))||n?.ref)return n}}const o="var:",r="var(--wp--";let l;if(n.startsWith(o))l=n.slice(4).split("|");else{if(!n.startsWith(r)||!n.endsWith(")"))return n;l=n.slice(10,-1).split("--")}const[i,...a]=l;return"preset"===i?function(e,t,n,[o,r]){const l=dl.find((e=>e.cssVarInfix===o));if(!l)return n;const i=ml(e.settings,t,l.path,"slug",r);if(i){const{valueKey:n}=l;return fl(e,t,i[n])}return n}(e,t,n,a):"custom"===i?function(e,t,n,o){var r;const l=null!==(r=(0,Wr.get)(e.settings,["blocks",t,"custom",...o]))&&void 0!==r?r:(0,Wr.get)(e.settings,["custom",...o]);return l?fl(e,t,l):n}(e,t,n,a):n}function gl(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(", ")}function hl(e,t){return"object"!=typeof e||"object"!=typeof t?e===t:b()(e?.styles,t?.styles)&&b()(e?.settings,t?.settings)}const bl=(0,c.createContext)({user:{},base:{},merged:{},setUserConfig:()=>{}}),vl={settings:{},styles:{}},_l=["appearanceTools","useRootPaddingAwareAlignments","border.color","border.radius","border.style","border.width","shadow.presets","shadow.defaultPresets","color.background","color.button","color.caption","color.custom","color.customDuotone","color.customGradient","color.defaultDuotone","color.defaultGradients","color.defaultPalette","color.duotone","color.gradients","color.heading","color.link","color.palette","color.text","custom","dimensions.minHeight","layout.contentSize","layout.definitions","layout.wideSize","position.fixed","position.sticky","spacing.customSpacingSize","spacing.spacingSizes","spacing.spacingScale","spacing.blockGap","spacing.margin","spacing.padding","spacing.units","typography.fluid","typography.customFontSize","typography.dropCap","typography.fontFamilies","typography.fontSizes","typography.fontStyle","typography.fontWeight","typography.letterSpacing","typography.lineHeight","typography.textColumns","typography.textDecoration","typography.textTransform"],kl=()=>{const{user:e,setUserConfig:t}=(0,c.useContext)(bl);return[!!e&&!b()(e,vl),(0,c.useCallback)((()=>t((()=>vl))),[t])]};function yl(e,t,n="all"){const{setUserConfig:o,...r}=(0,c.useContext)(bl),l=t?".blocks."+t:"",i=e?"."+e:"",a=`settings${l}${i}`,s=`settings${i}`,u="all"===n?"merged":n;return[(0,c.useMemo)((()=>{const t=r[u];if(!t)throw"Unsupported source";var n;if(e)return null!==(n=(0,Wr.get)(t,a))&&void 0!==n?n:(0,Wr.get)(t,s);const o={};return _l.forEach((e=>{var n;const r=null!==(n=(0,Wr.get)(t,`settings${l}.${e}`))&&void 0!==n?n:(0,Wr.get)(t,`settings.${e}`);r&&(0,Wr.set)(o,e,r)})),o}),[r,u,e,a,s,l]),e=>{o((t=>{const n=JSON.parse(JSON.stringify(t));return(0,Wr.set)(n,a,e),n}))}]}function El(e,t,n="all",{shouldDecodeEncode:o=!0}={}){const{merged:r,base:l,user:i,setUserConfig:a}=(0,c.useContext)(bl),s=e?"."+e:"",u=t?`styles.blocks.${t}${s}`:`styles${s}`;let d,p;switch(n){case"all":d=(0,Wr.get)(r,u),p=o?fl(r,t,d):d;break;case"user":d=(0,Wr.get)(i,u),p=o?fl(r,t,d):d;break;case"base":d=(0,Wr.get)(l,u),p=o?fl(l,t,d):d;break;default:throw"Unsupported source"}return[p,n=>{a((l=>{const i=JSON.parse(JSON.stringify(l));return(0,Wr.set)(i,u,o?function(e,t,n,o){if(!o)return o;const r=pl[n],l=dl.find((e=>e.cssVarInfix===r));if(!l)return o;const{valueKey:i,path:a}=l,s=ml(e,t,a,i,o);return s?`var:preset|${r}|${s.slug}`:o}(r.settings,t,e,n):n),i}))}]}function wl(e,t,n){const{supportedStyles:o,supports:r}=(0,f.useSelect)((e=>({supportedStyles:Fo(e(a.store)).getSupportedStyles(t,n),supports:e(a.store).getBlockType(t)?.supports})),[t,n]);return(0,c.useMemo)((()=>{const t={...e};return o.includes("fontSize")||(t.typography={...t.typography,fontSizes:{},customFontSize:!1}),o.includes("fontFamily")||(t.typography={...t.typography,fontFamilies:{}}),t.color={...t.color,text:t.color?.text&&o.includes("color"),background:t.color?.background&&(o.includes("background")||o.includes("backgroundColor")),button:t.color?.button&&o.includes("buttonColor"),heading:t.color?.heading&&o.includes("headingColor"),link:t.color?.link&&o.includes("linkColor"),caption:t.color?.caption&&o.includes("captionColor")},o.includes("background")||(t.color.gradients=[],t.color.customGradient=!1),o.includes("filter")||(t.color.defaultDuotone=!1,t.color.customDuotone=!1),["lineHeight","fontStyle","fontWeight","letterSpacing","textTransform","textDecoration"].forEach((e=>{o.includes(e)||(t.typography={...t.typography,[e]:!1})})),o.includes("columnCount")||(t.typography={...t.typography,textColumns:!1}),["contentSize","wideSize"].forEach((e=>{o.includes(e)||(t.layout={...t.layout,[e]:!1})})),["padding","margin","blockGap"].forEach((e=>{o.includes(e)||(t.spacing={...t.spacing,[e]:!1});const n=Array.isArray(r?.spacing?.[e])?r?.spacing?.[e]:r?.spacing?.[e]?.sides;n?.length&&t.spacing?.[e]&&(t.spacing={...t.spacing,[e]:{...t.spacing?.[e],sides:n}})})),o.includes("minHeight")||(t.dimensions={...t.dimensions,minHeight:!1}),["radius","color","style","width"].forEach((e=>{o.includes("border"+e.charAt(0).toUpperCase()+e.slice(1))||(t.border={...t.border,[e]:!1})})),t.shadow=!!o.includes("shadow")&&t.shadow,t}),[e,o,r])}function Sl(e){const t=e?.color?.palette?.custom,n=e?.color?.palette?.theme,o=e?.color?.palette?.default,r=e?.color?.defaultPalette;return(0,c.useMemo)((()=>{const e=[];return n&&n.length&&e.push({name:(0,v._x)("Theme","Indicates this palette comes from the theme."),colors:n}),r&&o&&o.length&&e.push({name:(0,v._x)("Default","Indicates this palette comes from WordPress."),colors:o}),t&&t.length&&e.push({name:(0,v._x)("Custom","Indicates this palette is created by the user."),colors:t}),e}),[t,n,o,r])}function Cl(e){const t=e?.color?.gradients?.custom,n=e?.color?.gradients?.theme,o=e?.color?.gradients?.default,r=e?.color?.defaultGradients;return(0,c.useMemo)((()=>{const e=[];return n&&n.length&&e.push({name:(0,v._x)("Theme","Indicates this palette comes from the theme."),gradients:n}),r&&o&&o.length&&e.push({name:(0,v._x)("Default","Indicates this palette comes from WordPress."),gradients:o}),t&&t.length&&e.push({name:(0,v._x)("Custom","Indicates this palette is created by the user."),gradients:t}),e}),[t,n,o,r])}var xl=function(){return xl=Object.assign||function(e){for(var t,n=1,o=arguments.length;n[e,Rl(t)])))}:e}function Al(e,t,n){const o=function(e){return Array.isArray(e)?e:"number"==typeof e?[e.toString()]:[e]}(t),r=e?Rl(e):{};return o.reduce(((e,t,r)=>(void 0===e[t]&&(e[t]={}),r===o.length-1&&(e[t]=n),e[t])),r),r}const Dl=e=>{if(null===e||"object"!=typeof e||Array.isArray(e))return e;const t=Object.entries(e).map((([e,t])=>[e,Dl(t)])).filter((([,e])=>void 0!==e));return t.length?Object.fromEntries(t):void 0};function Ol(e,t,n,o,r,l){if(Object.values(null!=e?e:{}).every((e=>!e)))return n;if(1===l.length&&n.innerBlocks.length===o.length)return n;let i=o[0]?.attributes;if(l.length>1&&o.length>1){if(!o[r])return n;i=o[r]?.attributes}let a=n;return Object.entries(e).forEach((([e,n])=>{n&&t[e].forEach((e=>{const t=(0,Wr.get)(i,e);t&&(a={...a,attributes:Al(a.attributes,e,t)})}))})),a}function zl(e,t,n){const o=(0,a.getBlockSupport)(e,t),r=o?.__experimentalSkipSerialization;return Array.isArray(r)?r.includes(n):r}function Vl(e,t){const n=Xr("typography.fontFamilies"),o=Xr("typography.fontSizes"),r=Xr("typography.customFontSize"),l=Xr("typography.fontStyle"),i=Xr("typography.fontWeight"),a=Xr("typography.lineHeight"),s=Xr("typography.textColumns"),u=Xr("typography.textDecoration"),d=Xr("typography.textTransform"),p=Xr("typography.letterSpacing"),m=Xr("spacing.padding"),f=Xr("spacing.margin"),g=Xr("spacing.blockGap"),h=Xr("spacing.spacingSizes"),b=Xr("spacing.units"),v=Xr("dimensions.minHeight"),_=Xr("layout"),k=Xr("border.color"),y=Xr("border.radius"),E=Xr("border.style"),w=Xr("border.width"),S=Xr("color.custom"),C=Xr("color.palette.custom"),x=Xr("color.customDuotone"),B=Xr("color.palette.theme"),I=Xr("color.palette.default"),T=Xr("color.defaultPalette"),M=Xr("color.defaultDuotone"),P=Xr("color.duotone.custom"),N=Xr("color.duotone.theme"),L=Xr("color.duotone.default"),R=Xr("color.gradients.custom"),A=Xr("color.gradients.theme"),D=Xr("color.gradients.default"),O=Xr("color.defaultGradients"),z=Xr("color.customGradient"),V=Xr("color.background"),F=Xr("color.link"),H=Xr("color.text");return wl((0,c.useMemo)((()=>({color:{palette:{custom:C,theme:B,default:I},gradients:{custom:R,theme:A,default:D},duotone:{custom:P,theme:N,default:L},defaultGradients:O,defaultPalette:T,defaultDuotone:M,custom:S,customGradient:z,customDuotone:x,background:V,link:F,text:H},typography:{fontFamilies:{custom:n},fontSizes:{custom:o},customFontSize:r,fontStyle:l,fontWeight:i,lineHeight:a,textColumns:s,textDecoration:u,textTransform:d,letterSpacing:p},spacing:{spacingSizes:{custom:h},padding:m,margin:f,blockGap:g,units:b},border:{color:k,radius:y,style:E,width:w},dimensions:{minHeight:v},layout:_,parentLayout:t})),[n,o,r,l,i,a,s,u,d,p,m,f,g,h,b,v,_,t,k,y,E,w,S,C,x,B,I,T,M,P,N,L,R,A,D,O,z,V,F,H]),e)}const Fl={left:"flex-start",right:"flex-end",center:"center","space-between":"space-between"},Hl={left:"flex-start",right:"flex-end",center:"center",stretch:"stretch"},Gl={top:"flex-start",center:"center",bottom:"flex-end",stretch:"stretch","space-between":"space-between"},Ul=["wrap","nowrap"];var $l={name:"flex",label:(0,v.__)("Flex"),inspectorControls:function({layout:e={},onChange:t,layoutBlockSupport:n={}}){const{allowOrientation:o=!0}=n;return(0,c.createElement)(c.Fragment,null,(0,c.createElement)(m.Flex,null,(0,c.createElement)(m.FlexItem,null,(0,c.createElement)(Kl,{layout:e,onChange:t})),(0,c.createElement)(m.FlexItem,null,o&&(0,c.createElement)(Zl,{layout:e,onChange:t}))),(0,c.createElement)(ql,{layout:e,onChange:t}))},toolBarControls:function({layout:e={},onChange:t,layoutBlockSupport:n}){if(n?.allowSwitching)return null;const{allowVerticalAlignment:o=!0}=n;return(0,c.createElement)(er,{group:"block",__experimentalShareWithChildBlocks:!0},(0,c.createElement)(Kl,{layout:e,onChange:t,isToolbar:!0}),o&&(0,c.createElement)(jl,{layout:e,onChange:t,isToolbar:!0}))},getLayoutStyle:function({selector:e,layout:t,style:n,blockName:o,hasBlockGapSupport:r,layoutDefinitions:l=sr}){const{orientation:i="horizontal"}=t,a=n?.spacing?.blockGap&&!zl(o,"spacing","blockGap")?Pr(n?.spacing?.blockGap,"0.5em"):void 0,s=Fl[t.justifyContent],c=Ul.includes(t.flexWrap)?t.flexWrap:"wrap",u=Gl[t.verticalAlignment],d=Hl[t.justifyContent]||Hl.left;let p="";const m=[];return c&&"wrap"!==c&&m.push(`flex-wrap: ${c}`),"horizontal"===i?(u&&m.push(`align-items: ${u}`),s&&m.push(`justify-content: ${s}`)):(u&&m.push(`justify-content: ${u}`),m.push("flex-direction: column"),m.push(`align-items: ${d}`)),m.length&&(p=`${cr(e)} {\n\t\t\t\t${m.join("; ")};\n\t\t\t}`),r&&a&&(p+=ur(e,l,"flex",a)),p},getOrientation(e){const{orientation:t="horizontal"}=e;return t},getAlignments(){return[]}};function jl({layout:e,onChange:t,isToolbar:n=!1}){const{orientation:o="horizontal"}=e,r="horizontal"===o?Gl.center:Gl.top,{verticalAlignment:l=r}=e,i=n=>{t({...e,verticalAlignment:n})};if(n)return(0,c.createElement)(Fr,{onChange:i,value:l,controls:"horizontal"===o?["top","center","bottom","stretch"]:["top","center","bottom","space-between"]});const a=[{value:"flex-start",label:(0,v.__)("Align items top")},{value:"center",label:(0,v.__)("Align items center")},{value:"flex-end",label:(0,v.__)("Align items bottom")}];return(0,c.createElement)("fieldset",{className:"block-editor-hooks__flex-layout-vertical-alignment-control"},(0,c.createElement)("legend",null,(0,v.__)("Vertical alignment")),(0,c.createElement)("div",null,a.map(((e,t,n)=>(0,c.createElement)(m.Button,{key:e,label:n,icon:t,isPressed:l===e,onClick:()=>i(e)})))))}const Wl={placement:"bottom-start"};function Kl({layout:e,onChange:t,isToolbar:n=!1}){const{justifyContent:o="left",orientation:r="horizontal"}=e,l=n=>{t({...e,justifyContent:n})},i=["left","center","right"];if("horizontal"===r?i.push("space-between"):i.push("stretch"),n)return(0,c.createElement)($r,{allowedControls:i,value:o,onChange:l,popoverProps:Wl});const a=[{value:"left",icon:tr,label:(0,v.__)("Justify items left")},{value:"center",icon:nr,label:(0,v.__)("Justify items center")},{value:"right",icon:or,label:(0,v.__)("Justify items right")}];return"horizontal"===r?a.push({value:"space-between",icon:rr,label:(0,v.__)("Space between items")}):a.push({value:"stretch",icon:lr,label:(0,v.__)("Stretch items")}),(0,c.createElement)(m.__experimentalToggleGroupControl,{__nextHasNoMarginBottom:!0,label:(0,v.__)("Justification"),value:o,onChange:l,className:"block-editor-hooks__flex-layout-justification-controls"},a.map((({value:e,icon:t,label:n})=>(0,c.createElement)(m.__experimentalToggleGroupControlOptionIcon,{key:e,value:e,icon:t,label:n}))))}function ql({layout:e,onChange:t}){const{flexWrap:n="wrap"}=e;return(0,c.createElement)(m.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,v.__)("Allow to wrap to multiple lines"),onChange:n=>{t({...e,flexWrap:n?"wrap":"nowrap"})},checked:"wrap"===n})}function Zl({layout:e,onChange:t}){const{orientation:n="horizontal",verticalAlignment:o,justifyContent:r}=e;return(0,c.createElement)(m.__experimentalToggleGroupControl,{__nextHasNoMarginBottom:!0,className:"block-editor-hooks__flex-layout-orientation-controls",label:(0,v.__)("Orientation"),value:n,onChange:n=>{let l=o,i=r;return"horizontal"===n?("space-between"===o&&(l="center"),"stretch"===r&&(i="left")):("stretch"===o&&(l="top"),"space-between"===r&&(i="left")),t({...e,orientation:n,verticalAlignment:l,justifyContent:i})}},(0,c.createElement)(m.__experimentalToggleGroupControlOptionIcon,{icon:ir,value:"horizontal",label:(0,v.__)("Horizontal")}),(0,c.createElement)(m.__experimentalToggleGroupControlOptionIcon,{icon:ar,value:"vertical",label:(0,v.__)("Vertical")}))}var Yl={name:"default",label:(0,v.__)("Flow"),inspectorControls:function(){return null},toolBarControls:function(){return null},getLayoutStyle:function({selector:e,style:t,blockName:n,hasBlockGapSupport:o,layoutDefinitions:r=sr}){const l=Pr(t?.spacing?.blockGap);let i="";zl(n,"spacing","blockGap")||(l?.top?i=Pr(l?.top):"string"==typeof l&&(i=Pr(l)));let a="";return o&&i&&(a+=ur(e,r,"default",i)),a},getOrientation(){return"vertical"},getAlignments(e,t){const n=dr(e);if(void 0!==e.alignments)return e.alignments.includes("none")||e.alignments.unshift("none"),e.alignments.map((e=>({name:e,info:n[e]})));const o=[{name:"left"},{name:"center"},{name:"right"}];if(!t){const{contentSize:t,wideSize:r}=e;t&&o.unshift({name:"full"}),r&&o.unshift({name:"wide",info:n.wide})}return o.unshift({name:"none",info:n.none}),o}};var Xl=function({icon:e,size:t=24,...n}){return(0,c.cloneElement)(e,{width:t,height:t,...n})};var Ql=(0,c.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(F.Path,{d:"M19 5.5H5V4h14v1.5ZM19 20H5v-1.5h14V20ZM7 9h10v6H7V9Z"}));var Jl=(0,c.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(F.Path,{d:"M16 5.5H8V4h8v1.5ZM16 20H8v-1.5h8V20ZM5 9h14v6H5V9Z"})),ei=window.wp.styleEngine,ti={name:"constrained",label:(0,v.__)("Constrained"),inspectorControls:function({layout:e,onChange:t,layoutBlockSupport:n={}}){const{wideSize:o,contentSize:r,justifyContent:l="center"}=e,{allowJustification:i=!0}=n,a=[{value:"left",icon:tr,label:(0,v.__)("Justify items left")},{value:"center",icon:nr,label:(0,v.__)("Justify items center")},{value:"right",icon:or,label:(0,v.__)("Justify items right")}],s=(0,m.__experimentalUseCustomUnits)({availableUnits:Xr("spacing.units")||["%","px","em","rem","vw"]});return(0,c.createElement)(c.Fragment,null,(0,c.createElement)("div",{className:"block-editor-hooks__layout-controls"},(0,c.createElement)("div",{className:"block-editor-hooks__layout-controls-unit"},(0,c.createElement)(m.__experimentalUnitControl,{className:"block-editor-hooks__layout-controls-unit-input",label:(0,v.__)("Content"),labelPosition:"top",__unstableInputWidth:"80px",value:r||o||"",onChange:n=>{n=0>parseFloat(n)?"0":n,t({...e,contentSize:n})},units:s}),(0,c.createElement)(Xl,{icon:Ql})),(0,c.createElement)("div",{className:"block-editor-hooks__layout-controls-unit"},(0,c.createElement)(m.__experimentalUnitControl,{className:"block-editor-hooks__layout-controls-unit-input",label:(0,v.__)("Wide"),labelPosition:"top",__unstableInputWidth:"80px",value:o||r||"",onChange:n=>{n=0>parseFloat(n)?"0":n,t({...e,wideSize:n})},units:s}),(0,c.createElement)(Xl,{icon:Jl}))),(0,c.createElement)("p",{className:"block-editor-hooks__layout-controls-helptext"},(0,v.__)("Customize the width for all elements that are assigned to the center or wide columns.")),i&&(0,c.createElement)(m.__experimentalToggleGroupControl,{__nextHasNoMarginBottom:!0,label:(0,v.__)("Justification"),value:l,onChange:n=>{t({...e,justifyContent:n})}},a.map((({value:e,icon:t,label:n})=>(0,c.createElement)(m.__experimentalToggleGroupControlOptionIcon,{key:e,value:e,icon:t,label:n})))))},toolBarControls:function(){return null},getLayoutStyle:function({selector:e,layout:t={},style:n,blockName:o,hasBlockGapSupport:r,layoutDefinitions:l=sr}){const{contentSize:i,wideSize:a,justifyContent:s}=t,c=Pr(n?.spacing?.blockGap);let u="";zl(o,"spacing","blockGap")||(c?.top?u=Pr(c?.top):"string"==typeof c&&(u=Pr(c)));const d="left"===s?"0 !important":"auto !important",p="right"===s?"0 !important":"auto !important";let m=i||a?`\n\t\t\t\t\t${cr(e,"> :where(:not(.alignleft):not(.alignright):not(.alignfull))")} {\n\t\t\t\t\t\tmax-width: ${null!=i?i:a};\n\t\t\t\t\t\tmargin-left: ${d};\n\t\t\t\t\t\tmargin-right: ${p};\n\t\t\t\t\t}\n\t\t\t\t\t${cr(e,"> .alignwide")} {\n\t\t\t\t\t\tmax-width: ${null!=a?a:i};\n\t\t\t\t\t}\n\t\t\t\t\t${cr(e,"> .alignfull")} {\n\t\t\t\t\t\tmax-width: none;\n\t\t\t\t\t}\n\t\t\t\t`:"";if("left"===s?m+=`${cr(e,"> :where(:not(.alignleft):not(.alignright):not(.alignfull))")}\n\t\t\t{ margin-left: ${d}; }`:"right"===s&&(m+=`${cr(e,"> :where(:not(.alignleft):not(.alignright):not(.alignfull))")}\n\t\t\t{ margin-right: ${p}; }`),n?.spacing?.padding){(0,ei.getCSSRules)(n).forEach((t=>{"paddingRight"===t.key?m+=`\n\t\t\t\t\t${cr(e,"> .alignfull")} {\n\t\t\t\t\t\tmargin-right: calc(${t.value} * -1);\n\t\t\t\t\t}\n\t\t\t\t\t`:"paddingLeft"===t.key&&(m+=`\n\t\t\t\t\t${cr(e,"> .alignfull")} {\n\t\t\t\t\t\tmargin-left: calc(${t.value} * -1);\n\t\t\t\t\t}\n\t\t\t\t\t`)}))}return r&&u&&(m+=ur(e,l,"constrained",u)),m},getOrientation(){return"vertical"},getAlignments(e){const t=dr(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 ni={px:600,"%":100,vw:100,vh:100,em:38,rem:38};var oi={name:"grid",label:(0,v.__)("Grid"),inspectorControls:function({layout:e={},onChange:t}){return e?.columnCount?(0,c.createElement)(li,{layout:e,onChange:t}):(0,c.createElement)(ri,{layout:e,onChange:t})},toolBarControls:function(){return null},getLayoutStyle:function({selector:e,layout:t,style:n,blockName:o,hasBlockGapSupport:r,layoutDefinitions:l=sr}){const{minimumColumnWidth:i="12rem",columnCount:a=null}=t,s=n?.spacing?.blockGap&&!zl(o,"spacing","blockGap")?Pr(n?.spacing?.blockGap,"0.5em"):void 0;let c="";const u=[];return a?u.push(`grid-template-columns: repeat(${a}, minmax(0, 1fr))`):i&&u.push(`grid-template-columns: repeat(auto-fill, minmax(min(${i}, 100%), 1fr))`),u.length&&(c=`${cr(e)} { ${u.join("; ")}; }`),r&&s&&(c+=ur(e,l,"grid",s)),c},getOrientation(){return"horizontal"},getAlignments(){return[]}};function ri({layout:e,onChange:t}){const{minimumColumnWidth:n="12rem"}=e,[o,r]=(0,m.__experimentalParseQuantityAndUnitFromRawValue)(n);return(0,c.createElement)("fieldset",null,(0,c.createElement)(m.BaseControl.VisualLabel,{as:"legend"},(0,v.__)("Minimum column width")),(0,c.createElement)(m.Flex,{gap:4},(0,c.createElement)(m.FlexItem,{isBlock:!0},(0,c.createElement)(m.__experimentalUnitControl,{size:"__unstable-large",onChange:n=>{t({...e,minimumColumnWidth:n})},onUnitChange:n=>{let l;["em","rem"].includes(n)&&"px"===r?l=(o/16).toFixed(2)+n:["em","rem"].includes(r)&&"px"===n?l=Math.round(16*o)+n:["vh","vw","%"].includes(n)&&o>100&&(l=100+n),t({...e,minimumColumnWidth:l})},value:n,min:0})),(0,c.createElement)(m.FlexItem,{isBlock:!0},(0,c.createElement)(m.RangeControl,{onChange:n=>{t({...e,minimumColumnWidth:[n,r].join("")})},value:o,min:0,max:ni[r]||600,withInputField:!1}))))}function li({layout:e,onChange:t}){const{columnCount:n=3}=e;return(0,c.createElement)(m.RangeControl,{label:(0,v.__)("Columns"),value:n,onChange:n=>t({...e,columnCount:n}),min:1,max:6})}const ii=[Yl,$l,ti,oi];function ai(e="default"){return ii.find((t=>t.name===e))}const si={type:"default"},ci=(0,c.createContext)(si),ui=ci.Provider;function di(){return(0,c.useContext)(ci)}function pi({layout:e={},css:t,...n}){const o=ai(e.type),r=null!==Xr("spacing.blockGap");if(o){if(t)return(0,c.createElement)("style",null,t);const l=o.getLayoutStyle?.({hasBlockGapSupport:r,layout:e,...n});if(l)return(0,c.createElement)("style",null,l)}return null}const mi=[],fi=["none","left","center","right","wide","full"],gi=["wide","full"];function hi(e=fi){e.includes("none")||(e=["none",...e]);const{wideControlsEnabled:t=!1,themeSupportsLayout:n,isBlockBasedTheme:o}=(0,f.useSelect)((e=>{const{getSettings:t}=e(Go),n=t();return{wideControlsEnabled:n.alignWide,themeSupportsLayout:n.supportsLayout,isBlockBasedTheme:n.__unstableIsBlockBasedTheme}}),[]),r=di(),l=ai(r?.type),i=l.getAlignments(r,o);if(n){const t=i.filter((({name:t})=>e.includes(t)));return 1===t.length&&"none"===t[0].name?mi:t}if("default"!==l.name&&"constrained"!==l.name)return mi;const{alignments:a=fi}=r,s=e.filter((e=>(r.alignments||t||!gi.includes(e))&&a.includes(e))).map((e=>({name:e})));return 1===s.length&&"none"===s[0].name?mi:s}var bi=(0,c.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(F.Path,{d:"M19 5.5H5V4h14v1.5ZM19 20H5v-1.5h14V20ZM5 9h14v6H5V9Z"}));var vi=(0,c.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(F.Path,{d:"M5 5.5h8V4H5v1.5ZM5 20h8v-1.5H5V20ZM19 9H5v6h14V9Z"}));var _i=(0,c.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(F.Path,{d:"M19 5.5h-8V4h8v1.5ZM19 20h-8v-1.5h8V20ZM5 9h14v6H5V9Z"}));var ki=(0,c.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(F.Path,{d:"M5 4h14v11H5V4Zm11 16H8v-1.5h8V20Z"}));const yi={none:{icon:bi,title:(0,v._x)("None","Alignment option")},left:{icon:vi,title:(0,v.__)("Align left")},center:{icon:Ql,title:(0,v.__)("Align center")},right:{icon:_i,title:(0,v.__)("Align right")},wide:{icon:Jl,title:(0,v.__)("Wide width")},full:{icon:ki,title:(0,v.__)("Full width")}};var Ei=function({value:e,onChange:t,controls:n,isToolbar:o,isCollapsed:r=!0}){const l=hi(n);if(!!!l.length)return null;function i(n){t([e,"none"].includes(n)?void 0:n)}const a=yi[e],s=yi.none,u=o?m.ToolbarGroup:m.ToolbarDropdownMenu,p={icon:a?a.icon:s.icon,label:(0,v.__)("Align")},f=o?{isCollapsed:r,controls:l.map((({name:t})=>({...yi[t],isActive:e===t||!e&&"none"===t,role:r?"menuitemradio":void 0,onClick:()=>i(t)})))}:{toggleProps:{describedBy:(0,v.__)("Change alignment")},children:({onClose:t})=>(0,c.createElement)(c.Fragment,null,(0,c.createElement)(m.MenuGroup,{className:"block-editor-block-alignment-control__menu-group"},l.map((({name:n,info:o})=>{const{icon:r,title:l}=yi[n],a=n===e||!e&&"none"===n;return(0,c.createElement)(m.MenuItem,{key:n,icon:r,iconPosition:"left",className:d()("components-dropdown-menu__menu-item",{"is-active":a}),isSelected:a,onClick:()=>{i(n),t()},role:"menuitemradio",info:o},l)}))))};return(0,c.createElement)(u,{...p,...f})};const wi=e=>(0,c.createElement)(Ei,{...e,isToolbar:!1}),Si=e=>(0,c.createElement)(Ei,{...e,isToolbar:!0}),Ci=(0,c.createContext)(null);function xi(e){var t;const{clientId:n=""}=null!==(t=(0,c.useContext)(Ci))&&void 0!==t?t:{},o=(0,f.useSelect)((e=>Fo(e(Go)).getBlockEditingMode(n)),[n]),{setBlockEditingMode:r,unsetBlockEditingMode:l}=Fo((0,f.useDispatch)(Go));return(0,c.useEffect)((()=>(e&&r(n,e),()=>{e&&l(n)})),[n,e]),o}const Bi=["left","center","right","wide","full"],Ii=["wide","full"];function Ti(e,t=!0,n=!0){let o;return o=Array.isArray(e)?Bi.filter((t=>e.includes(t))):!0===e?[...Bi]:[],!n||!0===e&&!t?o.filter((e=>!Ii.includes(e))):o}const Mi=(0,p.createHigherOrderComponent)((e=>t=>{const n=(0,c.createElement)(e,{key:"edit",...t}),{name:o}=t,r=hi(Ti((0,a.getBlockSupport)(o,"align"),(0,a.hasBlockSupport)(o,"alignWide",!0))).map((({name:e})=>e)),l=xi();if(!r.length||"default"!==l)return n;return(0,c.createElement)(c.Fragment,null,(0,c.createElement)(er,{group:"block",__experimentalShareWithChildBlocks:!0},(0,c.createElement)(wi,{value:t.attributes.align,onChange:e=>{if(!e){const n=(0,a.getBlockType)(t.name),o=n?.attributes?.align?.default;o&&(e="")}t.setAttributes({align:e})},controls:r})),n)}),"withToolbarControls"),Pi=(0,p.createHigherOrderComponent)((e=>t=>{const{name:n,attributes:o}=t,{align:r}=o,l=hi(Ti((0,a.getBlockSupport)(n,"align"),(0,a.hasBlockSupport)(n,"alignWide",!0)));if(void 0===r)return(0,c.createElement)(e,{...t});let i=t.wrapperProps;return l.some((e=>e.name===r))&&(i={...i,"data-align":r}),(0,c.createElement)(e,{...t,wrapperProps:i})}),"withDataAlign");(0,s.addFilter)("blocks.registerBlockType","core/align/addAttribute",(function(e){var t;return"type"in(null!==(t=e.attributes?.align)&&void 0!==t?t:{})||(0,a.hasBlockSupport)(e,"align")&&(e.attributes={...e.attributes,align:{type:"string",enum:[...Bi,""]}}),e})),(0,s.addFilter)("editor.BlockListBlock","core/editor/align/with-data-align",Pi),(0,s.addFilter)("editor.BlockEdit","core/editor/align/with-toolbar-controls",Mi),(0,s.addFilter)("blocks.getSaveContent.extraProps","core/align/addAssignedAlign",(function(e,t,n){const{align:o}=n;return Ti((0,a.getBlockSupport)(t,"align"),(0,a.hasBlockSupport)(t,"alignWide",!0)).includes(o)&&(e.className=d()(`align${o}`,e.className)),e})),(0,s.addFilter)("blocks.registerBlockType","core/lock/addAttribute",(function(e){var t;return"type"in(null!==(t=e.attributes?.lock)&&void 0!==t?t:{})||(e.attributes={...e.attributes,lock:{type:"object"}}),e}));const Ni=(0,m.createSlotFill)("InspectorControls"),Li=(0,m.createSlotFill)("InspectorAdvancedControls"),Ri=(0,m.createSlotFill)("InspectorControlsBorder"),Ai=(0,m.createSlotFill)("InspectorControlsColor"),Di=(0,m.createSlotFill)("InspectorControlsFilter"),Oi=(0,m.createSlotFill)("InspectorControlsDimensions"),zi=(0,m.createSlotFill)("InspectorControlsPosition"),Vi=(0,m.createSlotFill)("InspectorControlsTypography");var Fi={default:Ni,advanced:Li,border:Ri,color:Ai,filter:Di,dimensions:Oi,list:(0,m.createSlotFill)("InspectorControlsListView"),settings:Ni,styles:(0,m.createSlotFill)("InspectorControlsStyles"),typography:Vi,position:zi};function Hi({children:e,group:t="default",__experimentalGroup:n,resetAllFilter:o}){n&&($()("`__experimentalGroup` property in `InspectorControlsFill`",{since:"6.2",version:"6.4",alternative:"`group`"}),t=n);const r=qo(),l=Fi[t]?.Fill;return l?r?(0,c.createElement)(m.__experimentalStyleProvider,{document:document},(0,c.createElement)(l,null,(t=>(0,c.createElement)(Gi,{fillProps:t,children:e,resetAllFilter:o})))):null:("undefined"!=typeof process&&process.env,null)}function Gi({children:e,resetAllFilter:t,fillProps:n}){const{registerResetAllFilter:o,deregisterResetAllFilter:r}=n;(0,c.useEffect)((()=>(t&&o&&o(t),()=>{t&&r&&r(t)})),[t,o,r]);const l=n&&Object.keys(n).length>0?n:null;return(0,c.createElement)(m.__experimentalToolsPanelContext.Provider,{value:l},e)}function Ui({children:e,group:t,label:n}){const{updateBlockAttributes:o}=(0,f.useDispatch)(Go),{getBlockAttributes:r,getMultiSelectedBlockClientIds:l,getSelectedBlockClientId:i,hasMultiSelection:a}=(0,f.useSelect)(Go),s=i(),u=(0,c.useCallback)(((e=[])=>{const t={},n=a()?l():[s];n.forEach((n=>{const{style:o}=r(n);let l={style:o};e.forEach((e=>{l={...l,...e(l)}})),l={...l,style:Dl(l.style)},t[n]=l})),o(n,t,!0)}),[r,l,a,s,o]);return(0,c.createElement)(m.__experimentalToolsPanel,{className:`${t}-block-support-panel`,label:n,resetAll:u,key:s,panelId:s,hasInnerWrapper:!0,shouldRenderPlaceholderItems:!0,__experimentalFirstVisibleItemClass:"first",__experimentalLastVisibleItemClass:"last"},e)}function $i({Slot:e,...t}){const n=(0,c.useContext)(m.__experimentalToolsPanelContext);return(0,c.createElement)(e,{...t,fillProps:n,bubblesVirtually:!0})}function ji({__experimentalGroup:e,group:t="default",label:n,...o}){e&&($()("`__experimentalGroup` property in `InspectorControlsSlot`",{since:"6.2",version:"6.4",alternative:"`group`"}),t=e);const r=Fi[t]?.Slot,l=(0,m.__experimentalUseSlotFills)(r?.__unstableName);return r?l?.length?n?(0,c.createElement)(Ui,{group:t,label:n},(0,c.createElement)($i,{...o,Slot:r})):(0,c.createElement)(r,{...o,bubblesVirtually:!0}):null:("undefined"!=typeof process&&process.env,null)}const Wi=Hi;Wi.Slot=ji;const Ki=e=>(0,c.createElement)(Hi,{...e,group:"advanced"});Ki.Slot=e=>(0,c.createElement)(ji,{...e,group:"advanced"}),Ki.slotName="InspectorAdvancedControls";var qi=Wi;const Zi=/[\s#]/g,Yi={type:"string",source:"attribute",attribute:"id",selector:"*"};const Xi=(0,p.createHigherOrderComponent)((e=>t=>{const n=(0,a.hasBlockSupport)(t.name,"anchor"),o=xi();if(n&&t.isSelected){const n="web"===c.Platform.OS,r=(0,c.createElement)(m.TextControl,{__nextHasNoMarginBottom:!0,className:"html-anchor-control",label:(0,v.__)("HTML anchor"),help:(0,c.createElement)(c.Fragment,null,(0,v.__)("Enter a word or two — without spaces — to make a unique web address just for this block, called an “anchor.” Then, you’ll be able to link directly to this section of your page."),n&&(0,c.createElement)(m.ExternalLink,{href:(0,v.__)("https://wordpress.org/documentation/article/page-jumps/")},(0,v.__)("Learn more about anchors"))),value:t.attributes.anchor||"",placeholder:n?null:(0,v.__)("Add an anchor"),onChange:e=>{e=e.replace(Zi,"-"),t.setAttributes({anchor:e})},autoCapitalize:"none",autoComplete:"off"});return(0,c.createElement)(c.Fragment,null,(0,c.createElement)(e,{...t}),n&&"default"===o&&(0,c.createElement)(qi,{group:"advanced"},r),!n&&"core/heading"===t.name&&(0,c.createElement)(qi,null,(0,c.createElement)(m.PanelBody,{title:(0,v.__)("Heading settings")},r)))}return(0,c.createElement)(e,{...t})}),"withInspectorControl");(0,s.addFilter)("blocks.registerBlockType","core/anchor/attribute",(function(e){var t;return"type"in(null!==(t=e.attributes?.anchor)&&void 0!==t?t:{})||(0,a.hasBlockSupport)(e,"anchor")&&(e.attributes={...e.attributes,anchor:Yi}),e})),(0,s.addFilter)("editor.BlockEdit","core/editor/anchor/with-inspector-control",Xi),(0,s.addFilter)("blocks.getSaveContent.extraProps","core/anchor/save-props",(function(e,t,n){return(0,a.hasBlockSupport)(t,"anchor")&&(e.id=""===n.anchor?null:n.anchor),e}));const Qi={type:"string",source:"attribute",attribute:"aria-label",selector:"*"};(0,s.addFilter)("blocks.registerBlockType","core/ariaLabel/attribute",(function(e){return e?.attributes?.ariaLabel?.type||(0,a.hasBlockSupport)(e,"ariaLabel")&&(e.attributes={...e.attributes,ariaLabel:Qi}),e})),(0,s.addFilter)("blocks.getSaveContent.extraProps","core/ariaLabel/save-props",(function(e,t,n){return(0,a.hasBlockSupport)(t,"ariaLabel")&&(e["aria-label"]=""===n.ariaLabel?null:n.ariaLabel),e}));const Ji=(0,p.createHigherOrderComponent)((e=>t=>{const n=xi();return(0,a.hasBlockSupport)(t.name,"customClassName",!0)&&t.isSelected?(0,c.createElement)(c.Fragment,null,(0,c.createElement)(e,{...t}),"default"===n&&(0,c.createElement)(qi,{group:"advanced"},(0,c.createElement)(m.TextControl,{__nextHasNoMarginBottom:!0,autoComplete:"off",label:(0,v.__)("Additional CSS class(es)"),value:t.attributes.className||"",onChange:e=>{t.setAttributes({className:""!==e?e:void 0})},help:(0,v.__)("Separate multiple classes with spaces.")}))):(0,c.createElement)(e,{...t})}),"withInspectorControl");(0,s.addFilter)("blocks.registerBlockType","core/custom-class-name/attribute",(function(e){return(0,a.hasBlockSupport)(e,"customClassName",!0)&&(e.attributes={...e.attributes,className:{type:"string"}}),e})),(0,s.addFilter)("editor.BlockEdit","core/editor/custom-class-name/with-inspector-control",Ji),(0,s.addFilter)("blocks.getSaveContent.extraProps","core/custom-class-name/save-props",(function(e,t,n){return(0,a.hasBlockSupport)(t,"customClassName",!0)&&n.className&&(e.className=d()(e.className,n.className)),e})),(0,s.addFilter)("blocks.switchToBlockType.transformedBlock","core/color/addTransforms",(function(e,t,n,o){if(!(0,a.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]){const o=t[n]?.attributes.className;if(o)return{...e,attributes:{...e.attributes,className:o}}}return e})),(0,s.addFilter)("blocks.getSaveContent.extraProps","core/generated-class-name/save-props",(function(e,t){return(0,a.hasBlockSupport)(t,"className",!0)&&("string"==typeof e.className?e.className=[...new Set([(0,a.getBlockDefaultClassName)(t.name),...e.className.split(" ")])].join(" ").trim():e.className=(0,a.getBlockDefaultClassName)(t.name)),e}));var ea=window.wp.dom;const ta=(0,c.createContext)({});function na({value:e,children:t}){const n=(0,c.useContext)(ta),o=(0,c.useMemo)((()=>({...n,...e})),[n,e]);return(0,c.createElement)(ta.Provider,{value:o,children:t})}var oa=ta;const ra={},la=(0,m.withFilters)("editor.BlockEdit")((e=>{const{name:t}=e,n=(0,a.getBlockType)(t);if(!n)return null;const o=n.edit||n.save;return(0,c.createElement)(o,{...e})}));var ia=e=>{const{attributes:t={},name:n}=e,o=(0,a.getBlockType)(n),r=(0,c.useContext)(oa),l=(0,c.useMemo)((()=>o&&o.usesContext?Object.fromEntries(Object.entries(r).filter((([e])=>o.usesContext.includes(e)))):ra),[o,r]);if(!o)return null;if(o.apiVersion>1)return(0,c.createElement)(la,{...e,context:l});const i=(0,a.hasBlockSupport)(o,"className",!0)?(0,a.getBlockDefaultClassName)(n):null,s=d()(i,t.className,e.className);return(0,c.createElement)(la,{...e,context:l,className:s})};function aa(e){const{name:t,isSelected:n,clientId:o,attributes:r={},__unstableLayoutClassNames:l}=e,{layout:i=null}=r,s={name:t,isSelected:n,clientId:o,layout:(0,a.hasBlockSupport)(t,"layout",!1)||(0,a.hasBlockSupport)(t,"__experimentalLayout",!1)?i:null,__unstableLayoutClassNames:l};return(0,c.createElement)(Wo,{value:(0,c.useMemo)((()=>s),Object.values(s))},(0,c.createElement)(ia,{...e}))}var sa=(0,c.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(F.Path,{d:"M11 13h2v-2h-2v2zm-6 0h2v-2H5v2zm12-2v2h2v-2h-2z"}));var ca=function({className:e,actions:t,children:n,secondaryActions:o}){return(0,c.createElement)("div",{style:{display:"contents",all:"initial"}},(0,c.createElement)("div",{className:d()(e,"block-editor-warning")},(0,c.createElement)("div",{className:"block-editor-warning__contents"},(0,c.createElement)("p",{className:"block-editor-warning__message"},n),(c.Children.count(t)>0||o)&&(0,c.createElement)("div",{className:"block-editor-warning__actions"},c.Children.count(t)>0&&c.Children.map(t,((e,t)=>(0,c.createElement)("span",{key:t,className:"block-editor-warning__action"},e))),o&&(0,c.createElement)(m.DropdownMenu,{className:"block-editor-warning__secondary",icon:sa,label:(0,v.__)("More options"),popoverProps:{position:"bottom left",className:"block-editor-warning__dropdown"},noIcons:!0},(()=>(0,c.createElement)(m.MenuGroup,null,o.map(((e,t)=>(0,c.createElement)(m.MenuItem,{onClick:e.onClick,key:t},e.title))))))))))},ua=n(1973);function da({title:e,rawContent:t,renderedContent:n,action:o,actionText:r,className:l}){return(0,c.createElement)("div",{className:l},(0,c.createElement)("div",{className:"block-editor-block-compare__content"},(0,c.createElement)("h2",{className:"block-editor-block-compare__heading"},e),(0,c.createElement)("div",{className:"block-editor-block-compare__html"},t),(0,c.createElement)("div",{className:"block-editor-block-compare__preview edit-post-visual-editor"},(0,c.createElement)(c.RawHTML,null,(0,ea.safeHTML)(n)))),(0,c.createElement)("div",{className:"block-editor-block-compare__action"},(0,c.createElement)(m.Button,{variant:"secondary",tabIndex:"0",onClick:o},r)))}var pa=function({block:e,onKeep:t,onConvert:n,convertor:o,convertButtonText:r}){const l=(i=o(e),(Array.isArray(i)?i:[i]).map((e=>(0,a.getSaveContent)(e.name,e.attributes,e.innerBlocks))).join(""));var i;const s=(u=e.originalContent,p=l,(0,ua.Kx)(u,p).map(((e,t)=>{const n=d()({"block-editor-block-compare__added":e.added,"block-editor-block-compare__removed":e.removed});return(0,c.createElement)("span",{key:t,className:n},e.value)})));var u,p;return(0,c.createElement)("div",{className:"block-editor-block-compare__wrapper"},(0,c.createElement)(da,{title:(0,v.__)("Current"),className:"block-editor-block-compare__current",action:t,actionText:(0,v.__)("Convert to HTML"),rawContent:e.originalContent,renderedContent:e.originalContent}),(0,c.createElement)(da,{title:(0,v.__)("After Conversion"),className:"block-editor-block-compare__converted",action:n,actionText:r,rawContent:s,renderedContent:l}))};const ma=e=>(0,a.rawHandler)({HTML:e.originalContent});function fa({clientId:e}){const{block:t,canInsertHTMLBlock:n,canInsertClassicBlock:o}=(0,f.useSelect)((t=>{const{canInsertBlockType:n,getBlock:o,getBlockRootClientId:r}=t(Go),l=r(e);return{block:o(e),canInsertHTMLBlock:n("core/html",l),canInsertClassicBlock:n("core/freeform",l)}}),[e]),{replaceBlock:r}=(0,f.useDispatch)(Go),[l,i]=(0,c.useState)(!1),s=(0,c.useCallback)((()=>i(!1)),[]),u=(0,c.useMemo)((()=>({toClassic(){const e=(0,a.createBlock)("core/freeform",{content:t.originalContent});return r(t.clientId,e)},toHTML(){const e=(0,a.createBlock)("core/html",{content:t.originalContent});return r(t.clientId,e)},toBlocks(){const e=ma(t);return r(t.clientId,e)},toRecoveredBlock(){const e=(0,a.createBlock)(t.name,t.attributes,t.innerBlocks);return r(t.clientId,e)}})),[t,r]),d=(0,c.useMemo)((()=>[{title:(0,v._x)("Resolve","imperative verb"),onClick:()=>i(!0)},n&&{title:(0,v.__)("Convert to HTML"),onClick:u.toHTML},o&&{title:(0,v.__)("Convert to Classic Block"),onClick:u.toClassic}].filter(Boolean)),[n,o,u]);return(0,c.createElement)(c.Fragment,null,(0,c.createElement)(ca,{actions:[(0,c.createElement)(m.Button,{key:"recover",onClick:u.toRecoveredBlock,variant:"primary"},(0,v.__)("Attempt Block Recovery"))],secondaryActions:d},(0,v.__)("This block contains unexpected or invalid content.")),l&&(0,c.createElement)(m.Modal,{title:(0,v.__)("Resolve Block"),onRequestClose:s,className:"block-editor-block-compare"},(0,c.createElement)(pa,{block:t,onKeep:u.toHTML,onConvert:u.toBlocks,convertor:ma,convertButtonText:(0,v.__)("Convert to Blocks")})))}const ga=(0,c.createElement)(ca,{className:"block-editor-block-list__block-crash-warning"},(0,v.__)("This block has encountered an error and cannot be previewed."));var ha=()=>ga;class ba extends c.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 va=ba,_a=n(773);var ka=function({clientId:e}){const[t,n]=(0,c.useState)(""),o=(0,f.useSelect)((t=>t(Go).getBlock(e)),[e]),{updateBlock:r}=(0,f.useDispatch)(Go);return(0,c.useEffect)((()=>{n((0,a.getBlockContent)(o))}),[o]),(0,c.createElement)(_a.Z,{className:"block-editor-block-list__block-html-textarea",value:t,onBlur:()=>{const l=(0,a.getBlockType)(o.name);if(!l)return;const i=(0,a.getBlockAttributes)(l,t,o.attributes),s=t||(0,a.getSaveContent)(l,i),[c]=t?(0,a.validateBlock)({...o,attributes:i,originalContent:s}):[!0];r(e,{attributes:i,originalContent:s,isValid:c}),t||n(s)},onChange:e=>n(e.target.value)})},ya=n(9196),Ea=n.n(ya),wa=Object.defineProperty,Sa={};((e,t)=>{for(var n in t)wa(e,n,{get:t[n],enumerable:!0})})(Sa,{assign:()=>os,colors:()=>es,createStringInterpolator:()=>Ya,skipAnimation:()=>ts,to:()=>Xa,willAdvance:()=>ns});var Ca=Ha(),xa=e=>Oa(e,Ca),Ba=Ha();xa.write=e=>Oa(e,Ba);var Ia=Ha();xa.onStart=e=>Oa(e,Ia);var Ta=Ha();xa.onFrame=e=>Oa(e,Ta);var Ma=Ha();xa.onFinish=e=>Oa(e,Ma);var Pa=[];xa.setTimeout=(e,t)=>{const n=xa.now()+t,o=()=>{const e=Pa.findIndex((e=>e.cancel==o));~e&&Pa.splice(e,1),Aa-=~e?1:0},r={time:n,handler:e,cancel:o};return Pa.splice(Na(n),0,r),Aa+=1,za(),r};var Na=e=>~(~Pa.findIndex((t=>t.time>e))||~Pa.length);xa.cancel=e=>{Ia.delete(e),Ta.delete(e),Ma.delete(e),Ca.delete(e),Ba.delete(e)},xa.sync=e=>{Da=!0,xa.batchedUpdates(e),Da=!1},xa.throttle=e=>{let t;function n(){try{e(...t)}finally{t=null}}function o(...e){t=e,xa.onStart(n)}return o.handler=e,o.cancel=()=>{Ia.delete(n),t=null},o};var La="undefined"!=typeof window?window.requestAnimationFrame:()=>{};xa.use=e=>La=e,xa.now="undefined"!=typeof performance?()=>performance.now():Date.now,xa.batchedUpdates=e=>e(),xa.catch=console.error,xa.frameLoop="always",xa.advance=()=>{"demand"!==xa.frameLoop?console.warn("Cannot call the manual advancement of rafz whilst frameLoop is not set as demand"):Fa()};var Ra=-1,Aa=0,Da=!1;function Oa(e,t){Da?(t.delete(e),e(0)):(t.add(e),za())}function za(){Ra<0&&(Ra=0,"demand"!==xa.frameLoop&&La(Va))}function Va(){~Ra&&(La(Va),xa.batchedUpdates(Fa))}function Fa(){const e=Ra;Ra=xa.now();const t=Na(Ra);t&&(Ga(Pa.splice(0,t),(e=>e.handler())),Aa-=t),Aa?(Ia.flush(),Ca.flush(e?Math.min(64,Ra-e):16.667),Ta.flush(),Ba.flush(),Ma.flush()):Ra=-1}function Ha(){let e=new Set,t=e;return{add(n){Aa+=t!=e||e.has(n)?0:1,e.add(n)},delete(n){return Aa-=t==e&&e.has(n)?1:0,e.delete(n)},flush(n){t.size&&(e=new Set,Aa-=t.size,Ga(t,(t=>t(n)&&e.add(t))),Aa+=e.size,t=e)}}}function Ga(e,t){e.forEach((e=>{try{t(e)}catch(e){xa.catch(e)}}))}function Ua(){}var $a={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 ja(e,t){if($a.arr(e)){if(!$a.arr(t)||e.length!==t.length)return!1;for(let n=0;ne.forEach(t);function Ka(e,t,n){if($a.arr(e))for(let o=0;o$a.und(e)?[]:$a.arr(e)?e:[e];function Za(e,t){if(e.size){const n=Array.from(e);e.clear(),Wa(n,t)}}var Ya,Xa,Qa=(e,...t)=>Za(e,(e=>e(...t))),Ja=()=>"undefined"==typeof window||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent),es=null,ts=!1,ns=Ua,os=e=>{e.to&&(Xa=e.to),e.now&&(xa.now=e.now),void 0!==e.colors&&(es=e.colors),null!=e.skipAnimation&&(ts=e.skipAnimation),e.createStringInterpolator&&(Ya=e.createStringInterpolator),e.requestAnimationFrame&&xa.use(e.requestAnimationFrame),e.batchedUpdates&&(xa.batchedUpdates=e.batchedUpdates),e.willAdvance&&(ns=e.willAdvance),e.frameLoop&&(xa.frameLoop=e.frameLoop)},rs=new Set,ls=[],is=[],as=0,ss={get idle(){return!rs.size&&!ls.length},start(e){as>e.priority?(rs.add(e),xa.onStart(cs)):(us(e),xa(ps))},advance:ps,sort(e){if(as)xa.onFrame((()=>ss.sort(e)));else{const t=ls.indexOf(e);~t&&(ls.splice(t,1),ds(e))}},clear(){ls=[],rs.clear()}};function cs(){rs.forEach(us),rs.clear(),xa(ps)}function us(e){ls.includes(e)||ds(e)}function ds(e){ls.splice(function(e,t){const n=e.findIndex(t);return n<0?e.length:n}(ls,(t=>t.priority>e.priority)),0,e)}function ps(e){const t=is;for(let n=0;n0}var ms="[-+]?\\d*\\.?\\d+",fs=ms+"%";function gs(...e){return"\\(\\s*("+e.join(")\\s*,\\s*(")+")\\s*\\)"}var hs=new RegExp("rgb"+gs(ms,ms,ms)),bs=new RegExp("rgba"+gs(ms,ms,ms,ms)),vs=new RegExp("hsl"+gs(ms,fs,fs)),_s=new RegExp("hsla"+gs(ms,fs,fs,ms)),ks=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,ys=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,Es=/^#([0-9a-fA-F]{6})$/,ws=/^#([0-9a-fA-F]{8})$/;function Ss(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 Cs(e,t,n){const o=n<.5?n*(1+t):n+t-n*t,r=2*n-o,l=Ss(r,o,e+1/3),i=Ss(r,o,e),a=Ss(r,o,e-1/3);return Math.round(255*l)<<24|Math.round(255*i)<<16|Math.round(255*a)<<8}function xs(e){const t=parseInt(e,10);return t<0?0:t>255?255:t}function Bs(e){return(parseFloat(e)%360+360)%360/360}function Is(e){const t=parseFloat(e);return t<0?0:t>1?255:Math.round(255*t)}function Ts(e){const t=parseFloat(e);return t<0?0:t>100?1:t/100}function Ms(e){let t=function(e){let t;return"number"==typeof e?e>>>0===e&&e>=0&&e<=4294967295?e:null:(t=Es.exec(e))?parseInt(t[1]+"ff",16)>>>0:es&&void 0!==es[e]?es[e]:(t=hs.exec(e))?(xs(t[1])<<24|xs(t[2])<<16|xs(t[3])<<8|255)>>>0:(t=bs.exec(e))?(xs(t[1])<<24|xs(t[2])<<16|xs(t[3])<<8|Is(t[4]))>>>0:(t=ks.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+"ff",16)>>>0:(t=ws.exec(e))?parseInt(t[1],16)>>>0:(t=ys.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+t[4]+t[4],16)>>>0:(t=vs.exec(e))?(255|Cs(Bs(t[1]),Ts(t[2]),Ts(t[3])))>>>0:(t=_s.exec(e))?(Cs(Bs(t[1]),Ts(t[2]),Ts(t[3]))|Is(t[4]))>>>0:null}(e);if(null===t)return e;t=t||0;return`rgba(${(4278190080&t)>>>24}, ${(16711680&t)>>>16}, ${(65280&t)>>>8}, ${(255&t)/255})`}var Ps=(e,t,n)=>{if($a.fun(e))return e;if($a.arr(e))return Ps({range:e,output:t,extrapolate:n});if($a.str(e.output[0]))return Ya(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=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(cn){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)}};var Ns=1.70158,Ls=1.525*Ns,Rs=Ns+1,As=2*Math.PI/3,Ds=2*Math.PI/4.5,Os=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},zs={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=>Rs*e*e*e-Ns*e*e,easeOutBack:e=>1+Rs*Math.pow(e-1,3)+Ns*Math.pow(e-1,2),easeInOutBack:e=>e<.5?Math.pow(2*e,2)*(7.189819*e-Ls)/2:(Math.pow(2*e-2,2)*((Ls+1)*(2*e-2)+Ls)+2)/2,easeInElastic:e=>0===e?0:1===e?1:-Math.pow(2,10*e-10)*Math.sin((10*e-10.75)*As),easeOutElastic:e=>0===e?0:1===e?1:Math.pow(2,-10*e)*Math.sin((10*e-.75)*As)+1,easeInOutElastic:e=>0===e?0:1===e?1:e<.5?-Math.pow(2,20*e-10)*Math.sin((20*e-11.125)*Ds)/2:Math.pow(2,-20*e+10)*Math.sin((20*e-11.125)*Ds)/2+1,easeInBounce:e=>1-Os(1-e),easeOutBounce:Os,easeInOutBounce:e=>e<.5?(1-Os(1-2*e))/2:(1+Os(2*e-1))/2,steps:(e,t="end")=>n=>{const o=(n="end"===t?Math.min(n,.999):Math.max(n,.001))*e;return((e,t,n)=>Math.min(Math.max(n,e),t))(0,1,("end"===t?Math.floor(o):Math.ceil(o))/e)}},Vs=Symbol.for("FluidValue.get"),Fs=Symbol.for("FluidValue.observers"),Hs=e=>Boolean(e&&e[Vs]),Gs=e=>e&&e[Vs]?e[Vs]():e,Us=e=>e[Fs]||null;function $s(e,t){const n=e[Fs];n&&n.forEach((e=>{!function(e,t){e.eventObserved?e.eventObserved(t):e(t)}(e,t)}))}var js=class{constructor(e){if(!e&&!(e=this.get))throw Error("Unknown getter");Ws(this,e)}},Ws=(e,t)=>Ys(e,Vs,t);function Ks(e,t){if(e[Vs]){let n=e[Fs];n||Ys(e,Fs,n=new Set),n.has(t)||(n.add(t),e.observerAdded&&e.observerAdded(n.size,t))}return t}function qs(e,t){const n=e[Fs];if(n&&n.has(t)){const o=n.size-1;o?n.delete(t):e[Fs]=null,e.observerRemoved&&e.observerRemoved(o,t)}}var Zs,Ys=(e,t,n)=>Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0}),Xs=/[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,Qs=/(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi,Js=new RegExp(`(${Xs.source})(%|[a-z]+)`,"i"),ec=/rgba\(([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+)\)/gi,tc=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/,nc=e=>{const[t,n]=oc(e);if(!t||Ja())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&&tc.test(n)?nc(n):n||e},oc=e=>{const t=tc.exec(e);if(!t)return[,];const[,n,o]=t;return[n,o]},rc=(e,t,n,o,r)=>`rgba(${Math.round(t)}, ${Math.round(n)}, ${Math.round(o)}, ${r})`,lc=e=>{Zs||(Zs=es?new RegExp(`(${Object.keys(es).join("|")})(?!\\w)`,"g"):/^\b$/);const t=e.output.map((e=>Gs(e).replace(tc,nc).replace(Qs,Ms).replace(Zs,Ms))),n=t.map((e=>e.match(Xs).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=>Ps({...e,output:t})));return e=>{const n=!Js.test(t[0])&&t.find((e=>Js.test(e)))?.replace(Xs,"");let o=0;return t[0].replace(Xs,(()=>`${r[o++](e)}${n||""}`)).replace(ec,rc)}},ic="react-spring: ",ac=e=>{const t=e;let n=!1;if("function"!=typeof t)throw new TypeError(`${ic}once requires a function parameter`);return(...e)=>{n||(t(...e),n=!0)}},sc=ac(console.warn);var cc=ac(console.warn);function uc(e){return $a.str(e)&&("#"==e[0]||/\d/.test(e)||!Ja()&&tc.test(e)||e in(es||{}))}var dc=Ja()?ya.useEffect:ya.useLayoutEffect,pc=()=>{const e=(0,ya.useRef)(!1);return dc((()=>(e.current=!0,()=>{e.current=!1})),[]),e};function mc(){const e=(0,ya.useState)()[1],t=pc();return()=>{t.current&&e(Math.random())}}var fc=e=>(0,ya.useEffect)(e,gc),gc=[];function hc(e){const t=(0,ya.useRef)();return(0,ya.useEffect)((()=>{t.current=e})),t.current}var bc=Symbol.for("Animated:node"),vc=e=>e&&e[bc],_c=(e,t)=>{return n=e,o=bc,r=t,Object.defineProperty(n,o,{value:r,writable:!0,configurable:!0});var n,o,r},kc=e=>e&&e[bc]&&e[bc].getPayload(),yc=class{constructor(){_c(this,this)}getPayload(){return this.payload||[]}},Ec=class extends yc{constructor(e){super(),this._value=e,this.done=!0,this.durationProgress=0,$a.num(this._value)&&(this.lastPosition=this._value)}static create(e){return new Ec(e)}getPayload(){return[this]}getValue(){return this._value}setValue(e,t){return $a.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,$a.num(this._value)&&(this.elapsedTime=0,this.durationProgress=0,this.lastPosition=this._value,e&&(this.lastVelocity=null),this.v0=null)}},wc=class extends Ec{constructor(e){super(0),this._string=null,this._toString=Ps({output:[e,e]})}static create(e){return new wc(e)}getValue(){const e=this._string;return null==e?this._string=this._toString(this._value):e}setValue(e){if($a.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=Ps({output:[this.getValue(),e]})),this._value=0,super.reset()}},Sc={dependencies:null},Cc=class extends yc{constructor(e){super(),this.source=e,this.setValue(e)}getValue(e){const t={};return Ka(this.source,((n,o)=>{var r;(r=n)&&r[bc]===r?t[o]=n.getValue(e):Hs(n)?t[o]=Gs(n):e||(t[o]=n)})),t}setValue(e){this.source=e,this.payload=this._makePayload(e)}reset(){this.payload&&Wa(this.payload,(e=>e.reset()))}_makePayload(e){if(e){const t=new Set;return Ka(e,this._addToPayload,t),Array.from(t)}}_addToPayload(e){Sc.dependencies&&Hs(e)&&Sc.dependencies.add(e);const t=kc(e);t&&Wa(t,(e=>this.add(e)))}},xc=class extends Cc{constructor(e){super(e)}static create(e){return new xc(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(Bc)),!0)}};function Bc(e){return(uc(e)?wc:Ec).create(e)}function Ic(e){const t=vc(e);return t?t.constructor:$a.arr(e)?xc:uc(e)?wc:Ec}var Tc=(e,t)=>{const n=!$a.fun(e)||e.prototype&&e.prototype.isReactComponent;return(0,ya.forwardRef)(((o,r)=>{const l=(0,ya.useRef)(null),i=n&&(0,ya.useCallback)((e=>{l.current=function(e,t){e&&($a.fun(e)?e(t):e.current=t);return t}(r,e)}),[r]),[a,s]=function(e,t){const n=new Set;Sc.dependencies=n,e.style&&(e={...e,style:t.createAnimatedStyle(e.style)});return e=new Cc(e),Sc.dependencies=null,[e,n]}(o,t),c=mc(),u=()=>{const e=l.current;if(n&&!e)return;!1===(!!e&&t.applyAnimatedValues(e,a.getValue(!0)))&&c()},d=new Mc(u,s),p=(0,ya.useRef)();dc((()=>(p.current=d,Wa(s,(e=>Ks(e,d))),()=>{p.current&&(Wa(p.current.deps,(e=>qs(e,p.current))),xa.cancel(p.current.update))}))),(0,ya.useEffect)(u,[]),fc((()=>()=>{const e=p.current;Wa(e.deps,(t=>qs(t,e)))}));const m=t.getComponentProps(a.getValue());return ya.createElement(e,{...m,ref:i})}))},Mc=class{constructor(e,t){this.update=e,this.deps=t}eventObserved(e){"change"==e.type&&xa.write(this.update)}};var Pc=Symbol.for("AnimatedComponent"),Nc=e=>$a.str(e)?e:e&&$a.str(e.displayName)?e.displayName:$a.fun(e)&&e.name||null;function Lc(e,...t){return $a.fun(e)?e(...t):e}var Rc=(e,t)=>!0===e||!!(t&&e&&($a.fun(e)?e(t):qa(e).includes(t))),Ac=(e,t)=>$a.obj(e)?t&&e[t]:e,Dc=(e,t)=>!0===e.default?e[t]:e.default?e.default[t]:void 0,Oc=e=>e,zc=(e,t=Oc)=>{let n=Vc;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);$a.und(n)||(o[r]=n)}return o},Vc=["config","onProps","onStart","onChange","onPause","onResume","onRest"],Fc={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 Hc(e){const t=function(e){const t={};let n=0;if(Ka(e,((e,o)=>{Fc[o]||(t[o]=e,n++)})),n)return t}(e);if(t){const n={to:t};return Ka(e,((e,o)=>o in t||(n[o]=e))),n}return{...e}}function Gc(e){return e=Gs(e),$a.arr(e)?e.map(Gc):uc(e)?Sa.createStringInterpolator({range:[0,1],output:[e,e]})(1):e}function Uc(e){for(const t in e)return!0;return!1}function $c(e){return $a.fun(e)||$a.arr(e)&&$a.obj(e[0])}function jc(e,t){e.ref?.delete(e),t?.delete(e)}function Wc(e,t){t&&e.ref!==t&&(e.ref?.delete(e),t.add(e),e.ref=t)}var Kc={tension:170,friction:26,mass:1,damping:1,easing:zs.linear,clamp:!1};function qc(e,t){if($a.und(t.decay)){const n=!$a.und(t.tension)||!$a.und(t.friction);!n&&$a.und(t.frequency)&&$a.und(t.damping)&&$a.und(t.mass)||(e.duration=void 0,e.decay=void 0),n&&(e.frequency=void 0)}else e.duration=void 0}var Zc=[];function Yc(e,{key:t,props:n,defaultProps:o,state:r,actions:l}){return new Promise(((i,a)=>{let s,c,u=Rc(n.cancel??o?.cancel,t);if(u)m();else{$a.und(n.pause)||(r.paused=Rc(n.pause,t));let e=o?.pause;!0!==e&&(e=r.paused||Rc(e,t)),s=Lc(n.delay||0,t),e?(r.resumeQueue.add(p),l.pause()):(l.resume(),p())}function d(){r.resumeQueue.add(p),r.timeouts.delete(c),c.cancel(),s=c.time-xa.now()}function p(){s>0&&!Sa.skipAnimation?(r.delayed=!0,c=xa.setTimeout(m,s),r.pauseQueue.add(d),r.timeouts.add(c)):m()}function m(){r.delayed&&(r.delayed=!1),r.pauseQueue.delete(d),r.timeouts.delete(c),e<=(r.cancelId||0)&&(u=!0);try{l.start({...n,callId:e,cancel:u},i)}catch(e){a(e)}}}))}var Xc=(e,t)=>1==t.length?t[0]:t.some((e=>e.cancelled))?eu(e.get()):t.every((e=>e.noop))?Qc(e.get()):Jc(e.get(),t.every((e=>e.finished))),Qc=e=>({value:e,noop:!0,finished:!0,cancelled:!1}),Jc=(e,t,n=!1)=>({value:e,finished:t,cancelled:n}),eu=e=>({value:e,cancelled:!0,finished:!1});function tu(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=zc(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)&&eu(o)||r!==n.asyncId&&Jc(o,!1);if(t)throw e.result=t,d(e),e},f=(e,t)=>{const l=new ou,i=new ru;return(async()=>{if(Sa.skipAnimation)throw nu(n),i.result=Jc(o,!1),d(i),i;m(l);const a=$a.obj(e)?{...e}:{...t,to:e};a.parentId=r,Ka(c,((e,t)=>{$a.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(Sa.skipAnimation)return nu(n),Jc(o,!1);try{let t;t=$a.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=Jc(o.get(),!0,!1)}catch(e){if(e instanceof ou)g=e.result;else{if(!(e instanceof ru))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 $a.fun(i)&&xa.batchedUpdates((()=>{i(g,o,o.item)})),g})():s}function nu(e,t){Za(e.timeouts,(e=>e.cancel())),e.pauseQueue.clear(),e.resumeQueue.clear(),e.asyncId=e.asyncTo=e.promise=void 0,t&&(e.cancelId=t)}var ou=class 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.")}},ru=class extends Error{constructor(){super("SkipAnimationSignal")}},lu=e=>e instanceof au,iu=1,au=class extends js{constructor(){super(...arguments),this.id=iu++,this._priority=0}get priority(){return this._priority}set priority(e){this._priority!=e&&(this._priority=e,this._onPriorityChange(e))}get(){const e=vc(this);return e&&e.getValue()}to(...e){return Sa.to(this,e)}interpolate(...e){return sc(`${ic}The "interpolate" function is deprecated in v9 (use "to" instead)`),Sa.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){$s(this,{type:"change",parent:this,value:e,idle:t})}_onPriorityChange(e){this.idle||ss.sort(this),$s(this,{type:"priority",parent:this,priority:e})}},su=Symbol.for("SpringPhase"),cu=e=>(1&e[su])>0,uu=e=>(2&e[su])>0,du=e=>(4&e[su])>0,pu=(e,t)=>t?e[su]|=3:e[su]&=-3,mu=(e,t)=>t?e[su]|=4:e[su]&=-5,fu=class extends au{constructor(e,t){if(super(),this.animation=new class{constructor(){this.changed=!1,this.values=Zc,this.toValues=null,this.fromValues=Zc,this.config=new class{constructor(){this.velocity=0,Object.assign(this,Kc)}},this.immediate=!1}},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,!$a.und(e)||!$a.und(t)){const n=$a.obj(e)?{...e}:{...t,from:e};$a.und(n.default)&&(n.default=!0),this.start(n)}}get idle(){return!(uu(this)||this._state.asyncTo)||du(this)}get goal(){return Gs(this.animation.to)}get velocity(){const e=vc(this);return e instanceof Ec?e.lastVelocity||0:e.getPayload().map((e=>e.lastVelocity||0))}get hasAnimated(){return cu(this)}get isAnimating(){return uu(this)}get isPaused(){return du(this)}get isDelayed(){return this._state.delayed}advance(e){let t=!0,n=!1;const o=this.animation;let{toValues:r}=o;const{config:l}=o,i=kc(o.to);!i&&Hs(o.to)&&(r=qa(Gs(o.to))),o.values.forEach(((a,s)=>{if(a.done)return;const c=a.constructor==wc?1:i?i[s].lastPosition:r[s];let u=o.immediate,d=c;if(!u){if(d=a.lastPosition,l.tension<=0)return void(a.done=!0);let t=a.elapsedTime+=e;const n=o.fromValues[s],r=null!=a.v0?a.v0:a.v0=$a.arr(l.velocity)?l.velocity[s]:l.velocity;let i;const p=l.precision||(n==c?.005:Math.min(1,.001*Math.abs(c-n)));if($a.und(l.duration))if(l.decay){const e=!0===l.decay?.998:l.decay,o=Math.exp(-(1-e)*t);d=n+r/(1-e)*(1-o),u=Math.abs(a.lastPosition-d)<=p,i=r*o}else{i=null==a.lastVelocity?r:a.lastVelocity;const t=l.restVelocity||p/10,o=l.clamp?0:l.bounce,s=!$a.und(o),m=n==c?a.v0>0:nt,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*-l.tension*(d-c)+.001*-l.friction*i)/l.mass*h,d+=i*h}}else{let o=1;l.duration>0&&(this._memoizedDuration!==l.duration&&(this._memoizedDuration=l.duration,a.durationProgress>0&&(a.elapsedTime=l.duration*a.durationProgress,t=a.elapsedTime+=e)),o=(l.progress||0)+t/this._memoizedDuration,o=o>1?1:o<0?0:o,a.durationProgress=o),d=n+l.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,l.round)&&(n=!0)}));const a=vc(this),s=a.getValue();if(t){const e=Gs(o.to);s===e&&!n||l.decay?n&&l.decay&&this._onChange(s):(a.setValue(e),this._onChange(e)),this._stop()}else n&&this._onChange(s)}set(e){return xa.batchedUpdates((()=>{this._stop(),this._focus(e),this._set(e)})),this}pause(){this._update({pause:!0})}resume(){this._update({pause:!1})}finish(){if(uu(this)){const{to:e,config:t}=this.animation;xa.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 $a.und(e)?(n=this.queue||[],this.queue=[]):n=[$a.obj(e)?e:{...t,to:e}],Promise.all(n.map((e=>this._update(e)))).then((e=>Xc(this,e)))}stop(e){const{to:t}=this.animation;return this._focus(this.get()),nu(this._state,e&&this._lastCallId),xa.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=$a.obj(n)?n[t]:n,(null==n||$c(n))&&(n=void 0),o=$a.obj(o)?o[t]:o,null==o&&(o=void 0);const r={to:n,from:o};return cu(this)||(e.reverse&&([n,o]=[o,n]),o=Gs(o),$a.und(o)?vc(this)||this._set(n):this._set(o)),r}_update({...e},t){const{key:n,defaultProps:o}=this;e.default&&Object.assign(o,zc(e,((e,t)=>/^on/.test(t)?Ac(e,n):e))),yu(this,e,"onProps"),Eu(this,"onProps",e,this);const r=this._prepareNode(e);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 l=this._state;return Yc(++this._lastCallId,{key:n,props:e,defaultProps:o,state:l,actions:{pause:()=>{du(this)||(mu(this,!0),Qa(l.pauseQueue),Eu(this,"onPause",Jc(this,gu(this,this.animation.to)),this))},resume:()=>{du(this)&&(mu(this,!1),uu(this)&&this._resume(),Qa(l.resumeQueue),Eu(this,"onResume",Jc(this,gu(this,this.animation.to)),this))},start:this._merge.bind(this,r)}}).then((n=>{if(e.loop&&n.finished&&(!t||!n.noop)){const t=hu(e);if(t)return this._update(t,!0)}return n}))}_merge(e,t,n){if(t.cancel)return this.stop(!0),n(eu(this));const o=!$a.und(e.to),r=!$a.und(e.from);if(o||r){if(!(t.callId>this._lastToId))return n(eu(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&&!$a.und(u)||(u=d),t.reverse&&([u,d]=[d,u]);const p=!ja(d,c);p&&(a.from=d),d=Gs(d);const m=!ja(u,s);m&&this._focus(u);const f=$c(t.to),{config:g}=a,{decay:h,velocity:b}=g;(o||r)&&(g.velocity=0),t.config&&!f&&function(e,t,n){n&&(qc(n={...n},t),t={...n,...t}),qc(e,t),Object.assign(e,t);for(const t in Kc)null==e[t]&&(e[t]=Kc[t]);let{frequency:o,damping:r}=e;const{mass:l}=e;$a.und(o)||(o<.01&&(o=.01),r<0&&(r=0),e.tension=Math.pow(2*Math.PI/o,2)*l,e.friction=4*Math.PI*r*l/o)}(g,Lc(t.config,l),t.config!==i.config?Lc(i.config,l):void 0);let v=vc(this);if(!v||$a.und(u))return n(Jc(this,!0));const _=$a.und(t.reset)?r&&!t.default:!$a.und(d)&&Rc(t.reset,l),k=_?d:this.get(),y=Gc(u),E=$a.num(y)||$a.arr(y)||uc(y),w=!f&&(!E||Rc(i.immediate||t.immediate,l));if(m){const e=Ic(u);if(e!==v.constructor){if(!w)throw Error(`Cannot animate between ${v.constructor.name} and ${e.name}, as the "to" prop suggests`);v=this._set(y)}}const S=v.constructor;let C=Hs(u),x=!1;if(!C){const e=_||!cu(this)&&p;(m||e)&&(x=ja(Gc(k),y),C=!x),(ja(a.immediate,w)||w)&&ja(g.decay,h)&&ja(g.velocity,b)||(C=!0)}if(x&&uu(this)&&(a.changed&&!_?C=!0:C||this._stop(s)),!f&&((C||Hs(s))&&(a.values=v.getPayload(),a.toValues=Hs(u)?null:S==wc?[1]:qa(y)),a.immediate!=w&&(a.immediate=w,w||_||this._set(s)),C)){const{onRest:e}=a;Wa(ku,(e=>yu(this,t,e)));const o=Jc(this,gu(this,s));Qa(this._pendingCalls,o),this._pendingCalls.add(n),a.changed&&xa.batchedUpdates((()=>{a.changed=!_,e?.(o,this),_?Lc(i.onRest,o):a.onStart?.(o,this)}))}_&&this._set(k),f?n(tu(t.to,t,this._state,this)):C?this._start():uu(this)&&!m?this._pendingCalls.add(n):n(Qc(k))}_focus(e){const t=this.animation;e!==t.to&&(Us(this)&&this._detach(),t.to=e,Us(this)&&this._attach())}_attach(){let e=0;const{to:t}=this.animation;Hs(t)&&(Ks(t,this),lu(t)&&(e=t.priority+1)),this.priority=e}_detach(){const{to:e}=this.animation;Hs(e)&&qs(e,this)}_set(e,t=!0){const n=Gs(e);if(!$a.und(n)){const e=vc(this);if(!e||!ja(n,e.getValue())){const o=Ic(n);e&&e.constructor==o?e.setValue(n):_c(this,o.create(n)),e&&xa.batchedUpdates((()=>{this._onChange(n,t)}))}}return vc(this)}_onStart(){const e=this.animation;e.changed||(e.changed=!0,Eu(this,"onStart",Jc(this,gu(this,e.to)),this))}_onChange(e,t){t||(this._onStart(),Lc(this.animation.onChange,e,this)),Lc(this.defaultProps.onChange,e,this),super._onChange(e,t)}_start(){const e=this.animation;vc(this).reset(Gs(e.to)),e.immediate||(e.fromValues=e.values.map((e=>e.lastPosition))),uu(this)||(pu(this,!0),du(this)||this._resume())}_resume(){Sa.skipAnimation?this.finish():ss.start(this)}_stop(e,t){if(uu(this)){pu(this,!1);const n=this.animation;Wa(n.values,(e=>{e.done=!0})),n.toValues&&(n.onChange=n.onPause=n.onResume=void 0),$s(this,{type:"idle",parent:this});const o=t?eu(this.get()):Jc(this.get(),gu(this,e??n.to));Qa(this._pendingCalls,o),n.changed&&(n.changed=!1,Eu(this,"onRest",o,this))}}};function gu(e,t){const n=Gc(t);return ja(Gc(e.get()),n)}function hu(e,t=e.loop,n=e.to){const o=Lc(t);if(o){const r=!0!==o&&Hc(o),l=(r||e).reverse,i=!r||r.reset;return bu({...e,loop:t,default:!1,pause:void 0,to:!l||$c(n)?n:void 0,from:i?e.from:void 0,reset:i,...r})}}function bu(e){const{to:t,from:n}=e=Hc(e),o=new Set;return $a.obj(t)&&_u(t,o),$a.obj(n)&&_u(n,o),e.keys=o.size?Array.from(o):null,e}function vu(e){const t=bu(e);return $a.und(t.default)&&(t.default=zc(t)),t}function _u(e,t){Ka(e,((e,n)=>null!=e&&t.add(n)))}var ku=["onStart","onRest","onChange","onPause","onResume"];function yu(e,t,n){e.animation[n]=t[n]!==Dc(t,n)?Ac(t[n],e.key):void 0}function Eu(e,t,...n){e.animation[t]?.(...n),e.defaultProps[t]?.(...n)}var wu=["onStart","onChange","onRest"],Su=1,Cu=class{constructor(e,t){this.id=Su++,this.springs={},this.queue=[],this._lastAsyncId=0,this._active=new Set,this._changed=new Set,this._started=!1,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({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];$a.und(n)||this.springs[t].set(n)}}update(e){return e&&this.queue.push(bu(e)),this}start(e){let{queue:t}=this;return e?t=qa(e).map(bu):this.queue=[],this._flush?this._flush(this,t):(Nu(this,t),xu(this,t))}stop(e,t){if(e!==!!e&&(t=e),t){const n=this.springs;Wa(qa(t),(t=>n[t].stop(!!e)))}else nu(this._state,this._lastAsyncId),this.each((t=>t.stop(!!e)));return this}pause(e){if($a.und(e))this.start({pause:!0});else{const t=this.springs;Wa(qa(e),(e=>t[e].pause()))}return this}resume(e){if($a.und(e))this.start({pause:!1});else{const t=this.springs;Wa(qa(e),(e=>t[e].resume()))}return this}each(e){Ka(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,Za(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&&Za(t,(([e,t])=>{t.value=i,e(t,this,this._item)})),l&&(this._started=!1,Za(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)}xa.onFrame(this._onFrame)}};function xu(e,t){return Promise.all(t.map((t=>Bu(e,t)))).then((t=>Xc(e,t)))}async function Bu(e,t,n){const{keys:o,to:r,from:l,loop:i,onRest:a,onResolve:s}=t,c=$a.obj(t.default)&&t.default;i&&(t.loop=!1),!1===r&&(t.to=null),!1===l&&(t.from=null);const u=$a.arr(r)||$a.fun(r)?r:void 0;u?(t.to=void 0,t.onRest=void 0,c&&(c.onRest=void 0)):Wa(wu,(n=>{const o=t[n];if($a.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,Qa(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===Dc(t,"cancel");(u||m&&d.asyncId)&&p.push(Yc(++e._lastAsyncId,{props:t,state:d,actions:{pause:Ua,resume:Ua,start(t,n){m?(nu(d,e._lastAsyncId),n(eu(e))):(t.onRest=a,n(tu(u,t,d,e)))}}})),d.paused&&await new Promise((e=>{d.resumeQueue.add(e)}));const f=Xc(e,await Promise.all(p));if(i&&f.finished&&(!n||!f.noop)){const n=hu(t,i,r);if(n)return Nu(e,[n]),Bu(e,n,!0)}return s&&xa.batchedUpdates((()=>s(f,e,e.item))),f}function Iu(e,t){const n={...e.springs};return t&&Wa(qa(t),(e=>{$a.und(e.keys)&&(e=bu(e)),$a.obj(e.to)||(e={...e,to:void 0}),Pu(n,e,(e=>Mu(e)))})),Tu(e,n),n}function Tu(e,t){Ka(t,((t,n)=>{e.springs[n]||(e.springs[n]=t,Ks(t,e))}))}function Mu(e,t){const n=new fu;return n.key=e,t&&Ks(n,t),n}function Pu(e,t,n){t.keys&&Wa(t.keys,(o=>{(e[o]||(e[o]=n(o)))._prepareNode(t)}))}function Nu(e,t){Wa(t,(t=>{Pu(e.springs,t,(t=>Mu(t,e)))}))}var Lu,Ru,Au=({children:e,...t})=>{const n=(0,ya.useContext)(Du),o=t.pause||!!n.pause,r=t.immediate||!!n.immediate;t=function(e,t){const[n]=(0,ya.useState)((()=>({inputs:t,result:e()}))),o=(0,ya.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{o.current=l,r==n&&(n.inputs=n.result=void 0)}),[l]),l.result}((()=>({pause:o,immediate:r})),[o,r]);const{Provider:l}=Du;return ya.createElement(l,{value:t},e)},Du=(Lu=Au,Ru={},Object.assign(Lu,ya.createContext(Ru)),Lu.Provider._context=Lu,Lu.Consumer._context=Lu,Lu);Au.Provider=Du.Provider,Au.Consumer=Du.Consumer;var Ou=()=>{const e=[],t=function(t){cc(`${ic}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 Wa(e,((e,r)=>{if($a.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 Wa(e,(e=>e.pause(...arguments))),this},t.resume=function(){return Wa(e,(e=>e.resume(...arguments))),this},t.set=function(t){Wa(e,((e,n)=>{const o=$a.fun(t)?t(n,e):t;o&&e.set(o)}))},t.start=function(t){const n=[];return Wa(e,((e,o)=>{if($a.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 Wa(e,(e=>e.stop(...arguments))),this},t.update=function(t){return Wa(e,((e,n)=>e.update(this._getProps(t,e,n)))),this};const n=function(e,t,n){return $a.fun(e)?e(n,t):e};return t._getProps=n,t};function zu(e,t,n){const o=$a.fun(t)&&t;o&&!n&&(n=[]);const r=(0,ya.useMemo)((()=>o||3==arguments.length?Ou():void 0),[]),l=(0,ya.useRef)(0),i=mc(),a=(0,ya.useMemo)((()=>({ctrls:[],queue:[],flush(e,t){const n=Iu(e,t);return l.current>0&&!a.queue.length&&!Object.keys(n).some((t=>!e.springs[t]))?xu(e,t):new Promise((o=>{Tu(e,n),a.queue.push((()=>{o(xu(e,t))})),i()}))}})),[]),s=(0,ya.useRef)([...a.ctrls]),c=[],u=hc(e)||0;function d(e,n){for(let r=e;r{Wa(s.current.slice(e,u),(e=>{jc(e,r),e.stop(!0)})),s.current.length=e,d(u,e)}),[e]),(0,ya.useMemo)((()=>{d(0,Math.min(u,e))}),n);const p=s.current.map(((e,t)=>Iu(e,c[t]))),m=(0,ya.useContext)(Au),f=hc(m),g=m!==f&&Uc(m);dc((()=>{l.current++,a.ctrls=s.current;const{queue:e}=a;e.length&&(a.queue=[],Wa(e,(e=>e()))),Wa(s.current,((e,t)=>{r?.add(e),g&&e.start({default:m});const n=c[t];n&&(Wc(e,n.ref),e.ref?e.queue.push(n):e.start(n))}))})),fc((()=>()=>{Wa(a.ctrls,(e=>e.stop(!0)))}));const h=p.map((e=>({...e})));return r?[h,r]:h}function Vu(e,t){const n=$a.fun(e),[[o],r]=zu(1,n?e:[e],n?t||[]:t);return n||2==arguments.length?[o,r]:o}var Fu=class extends au{constructor(e,t){super(),this.source=e,this.idle=!0,this._active=new Set,this.calc=Ps(...t);const n=this._get(),o=Ic(n);_c(this,o.create(n))}advance(e){const t=this._get();ja(t,this.get())||(vc(this).setValue(t),this._onChange(t,this.idle)),!this.idle&&Gu(this._active)&&Uu(this)}_get(){const e=$a.arr(this.source)?this.source.map(Gs):qa(Gs(this.source));return this.calc(...e)}_start(){this.idle&&!Gu(this._active)&&(this.idle=!1,Wa(kc(this),(e=>{e.done=!1})),Sa.skipAnimation?(xa.batchedUpdates((()=>this.advance())),Uu(this)):ss.start(this))}_attach(){let e=1;Wa(qa(this.source),(t=>{Hs(t)&&Ks(t,this),lu(t)&&(t.idle||this._active.add(t),e=Math.max(e,t.priority+1))})),this.priority=e,this._start()}_detach(){Wa(qa(this.source),(e=>{Hs(e)&&qs(e,this)})),this._active.clear(),Uu(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=qa(this.source).reduce(((e,t)=>Math.max(e,(lu(t)?t.priority:0)+1)),0))}};function Hu(e){return!1!==e.idle}function Gu(e){return!e.size||Array.from(e).every(Hu)}function Uu(e){e.idle||(e.idle=!0,Wa(kc(e),(e=>{e.done=!0})),$s(e,{type:"idle",parent:e}))}Sa.assign({createStringInterpolator:lc,to:(e,t)=>new Fu(e,t)});ss.advance;var $u=window.ReactDOM,ju=/^--/;function Wu(e,t){return null==t||"boolean"==typeof t||""===t?"":"number"!=typeof t||0===t||ju.test(e)||qu.hasOwnProperty(e)&&qu[e]?(""+t).trim():t+"px"}var Ku={};var qu={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},Zu=["Webkit","Ms","Moz","O"];qu=Object.keys(qu).reduce(((e,t)=>(Zu.forEach((n=>e[((e,t)=>e+t.charAt(0).toUpperCase()+t.substring(1))(n,t)]=e[t])),e)),qu);var Yu=/^(matrix|translate|scale|rotate|skew)/,Xu=/^(translate)/,Qu=/^(rotate|skew)/,Ju=(e,t)=>$a.num(e)&&0!==e?e+t:e,ed=(e,t)=>$a.arr(e)?e.every((e=>ed(e,t))):$a.num(e)?e===t:parseFloat(e)===t,td=class extends Cc{constructor({x:e,y:t,z:n,...o}){const r=[],l=[];(e||t||n)&&(r.push([e||0,t||0,n||0]),l.push((e=>[`translate3d(${e.map((e=>Ju(e,"px"))).join(",")})`,ed(e,0)]))),Ka(o,((e,t)=>{if("transform"===t)r.push([e||""]),l.push((e=>[e,""===e]));else if(Yu.test(t)){if(delete o[t],$a.und(e))return;const n=Xu.test(t)?"px":Qu.test(t)?"deg":"";r.push(qa(e)),l.push("rotate3d"===t?([e,t,o,r])=>[`rotate3d(${e},${t},${o},${Ju(r,n)})`,ed(r,0)]:e=>[`${t}(${e.map((e=>Ju(e,n))).join(",")})`,ed(e,t.startsWith("scale")?1:0)])}})),r.length&&(o.transform=new nd(r,l)),super(o)}},nd=class extends js{constructor(e,t){super(),this.inputs=e,this.transforms=t,this._value=null}get(){return this._value||(this._value=this._get())}_get(){let e="",t=!0;return Wa(this.inputs,((n,o)=>{const r=Gs(n[0]),[l,i]=this.transforms[o]($a.arr(r)?r:n.map(Gs));e+=" "+l,t=t&&i})),t?"none":e}observerAdded(e){1==e&&Wa(this.inputs,(e=>Wa(e,(e=>Hs(e)&&Ks(e,this)))))}observerRemoved(e){0==e&&Wa(this.inputs,(e=>Wa(e,(e=>Hs(e)&&qs(e,this)))))}eventObserved(e){"change"==e.type&&(this._value=null),$s(this,e)}};Sa.assign({batchedUpdates:$u.unstable_batchedUpdates,createStringInterpolator:lc,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}});var od=((e,{applyAnimatedValues:t=(()=>!1),createAnimatedStyle:n=(e=>new Cc(e)),getComponentProps:o=(e=>e)}={})=>{const r={applyAnimatedValues:t,createAnimatedStyle:n,getComponentProps:o},l=e=>{const t=Nc(e)||"Anonymous";return(e=$a.str(e)?l[e]||(l[e]=Tc(e,r)):e[Pc]||(e[Pc]=Tc(e,r))).displayName=`Animated(${t})`,e};return Ka(e,((t,n)=>{$a.arr(e)&&(n=Nc(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,{style:o,children:r,scrollTop:l,scrollLeft:i,viewBox:a,...s}=t,c=Object.values(s),u=Object.keys(s).map((t=>n||e.hasAttribute(t)?t:Ku[t]||(Ku[t]=t.replace(/([A-Z])/g,(e=>"-"+e.toLowerCase())))));void 0!==r&&(e.textContent=r);for(const t in o)if(o.hasOwnProperty(t)){const n=Wu(t,o[t]);ju.test(t)?e.style.setProperty(t,n):e.style[t]=n}u.forEach(((t,n)=>{e.setAttribute(t,c[n])})),void 0!==l&&(e.scrollTop=l),void 0!==i&&(e.scrollLeft=i),void 0!==a&&e.setAttribute("viewBox",a)},createAnimatedStyle:e=>new td(e),getComponentProps:({scrollTop:e,scrollLeft:t,...n})=>n}),rd=od.animated;const ld=e=>e+1,id=e=>({top:e.offsetTop,left:e.offsetLeft});var ad=function({isSelected:e,adjustScrolling:t,enableAnimation:n,triggerAnimationOnChange:o}){const r=(0,c.useRef)(),l=(0,p.useReducedMotion)()||!n,[i,a]=(0,c.useReducer)(ld,0),[s,u]=(0,c.useReducer)(ld,0),[d,m]=(0,c.useState)({x:0,y:0}),f=(0,c.useMemo)((()=>r.current?id(r.current):null),[o]),g=(0,c.useMemo)((()=>{if(!t||!r.current)return()=>{};const e=(0,ea.getScrollContainer)(r.current);if(!e)return()=>{};const n=r.current.getBoundingClientRect();return()=>{const t=r.current.getBoundingClientRect().top-n.top;t&&(e.scrollTop+=t)}}),[o,t]);return(0,c.useLayoutEffect)((()=>{i&&u()}),[i]),(0,c.useLayoutEffect)((()=>{if(!f)return;if(l)return void g();r.current.style.transform=void 0;const e=id(r.current);a(),m({x:Math.round(f.left-e.left),y:Math.round(f.top-e.top)})}),[o]),Vu({from:{x:d.x,y:d.y},to:{x:0,y:0},reset:i!==s,config:{mass:5,tension:2e3,friction:200},immediate:l,onChange:function({value:t}){if(!r.current)return;let{x:n,y:o}=t;n=Math.round(n),o=Math.round(o);const l=0===n&&0===o;r.current.style.transformOrigin="center center",r.current.style.transform=l?void 0:`translate3d(${n}px,${o}px,0)`,r.current.style.zIndex=e?"1":"",g()}}),r};const sd=".block-editor-block-list__block",cd=".block-list-appender",ud=".block-editor-button-block-appender";function dd(e,t){return t.closest([sd,cd,ud].join(","))===e}function pd(e){for(;e&&e.nodeType!==e.ELEMENT_NODE;)e=e.parentNode;if(!e)return;const t=e.closest(sd);return t?t.id.slice(6):void 0}function md(e){const t=(0,c.useRef)(),n=function(e){return(0,f.useSelect)((t=>{const{getSelectedBlocksInitialCaretPosition:n,__unstableGetEditorMode:o,isBlockSelected:r}=t(Go);if(r(e)&&"edit"===o())return n()}),[e])}(e),{isBlockSelected:o,isMultiSelecting:r}=(0,f.useSelect)(Go);return(0,c.useEffect)((()=>{if(!o(e)||r())return;if(null==n)return;if(!t.current)return;const{ownerDocument:l}=t.current;if(dd(t.current,l.activeElement))return;const i=ea.focus.tabbable.find(t.current).filter((e=>(0,ea.isTextField)(e))),a=-1===n,s=i[a?i.length-1:0]||t.current;if(dd(t.current,s)){if(!t.current.getAttribute("contenteditable")){const e=ea.focus.tabbable.findNext(t.current);if(e&&dd(t.current,e)&&(0,ea.isFormElement)(e))return void e.focus()}(0,ea.placeCaretAtHorizontalEdge)(s,a)}else t.current.focus()}),[n,e]),t}function fd(e){if(e.defaultPrevented)return;const t="mouseover"===e.type?"add":"remove";e.preventDefault(),e.currentTarget.classList[t]("is-hovered")}function gd(){const e=(0,f.useSelect)((e=>{const{getSettings:t}=e(Go);return t().outlineMode}),[]);return(0,p.useRefEffect)((t=>{if(e)return t.addEventListener("mouseout",fd),t.addEventListener("mouseover",fd),()=>{t.removeEventListener("mouseout",fd),t.removeEventListener("mouseover",fd),t.classList.remove("is-hovered")}}),[e])}function hd(e){return(0,f.useSelect)((t=>{const{isBlockBeingDragged:n,isBlockHighlighted:o,isBlockSelected:r,isBlockMultiSelected:l,getBlockName:i,getSettings:s,hasSelectedInnerBlock:c,isTyping:u,__unstableIsFullySelected:p,__unstableSelectionHasUnmergeableBlock:m}=t(Go),{outlineMode:f}=s(),g=n(e),h=r(e),b=i(e),v=c(e,!0),_=l(e);return d()({"is-selected":h,"is-highlighted":o(e),"is-multi-selected":_,"is-partially-selected":_&&!p()&&!m(),"is-reusable":(0,a.isReusableBlock)((0,a.getBlockType)(b)),"is-dragging":g,"has-child-selected":v,"remove-outline":h&&f&&u()})}),[e])}function bd(e){return(0,f.useSelect)((t=>{const n=t(Go).getBlockName(e),o=(0,a.getBlockType)(n);if(o?.apiVersion>1)return(0,a.getBlockDefaultClassName)(n)}),[e])}function vd(e){return(0,f.useSelect)((t=>{const{getBlockName:n,getBlockAttributes:o}=t(Go),r=o(e);if(!r?.className)return;const l=(0,a.getBlockType)(n(e));return l?.apiVersion>1?r.className:void 0}),[e])}function _d(e){return(0,f.useSelect)((t=>{const{hasBlockMovingClientId:n,canInsertBlockType:o,getBlockName:r,getBlockRootClientId:l,isBlockSelected:i}=t(Go);if(!i(e))return;const a=n();return a?d()("is-block-moving-mode",{"can-insert-moving-block":o(r(a),l(e))}):void 0}),[e])}function kd(e){const{isBlockSelected:t}=(0,f.useSelect)(Go),{selectBlock:n,selectionChange:o}=(0,f.useDispatch)(Go);return(0,p.useRefEffect)((r=>{function l(l){r.parentElement.closest('[contenteditable="true"]')||(t(e)?l.target.isContentEditable||o(e):dd(r,l.target)&&n(e))}return r.addEventListener("focusin",l),()=>{r.removeEventListener("focusin",l)}}),[t,n])}var yd=window.wp.keycodes;function Ed(e){const t=(0,f.useSelect)((t=>t(Go).isBlockSelected(e)),[e]),{getBlockRootClientId:n,getBlockIndex:o}=(0,f.useSelect)(Go),{insertDefaultBlock:r,removeBlock:l}=(0,f.useDispatch)(Go);return(0,p.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!==yd.ENTER&&a!==yd.BACKSPACE&&a!==yd.DELETE||s!==i||(0,ea.isTextField)(s)||(t.preventDefault(),a===yd.ENTER?r({},n(e),o(e)+1):l(e))}function s(e){e.preventDefault()}}),[e,t,n,o,r,l])}function wd(e){const{isNavigationMode:t,isBlockSelected:n}=(0,f.useSelect)(Go),{setNavigationMode:o,selectBlock:r}=(0,f.useDispatch)(Go);return(0,p.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])}const Sd=(0,c.createContext)({refs:new Map,callbacks:new Map});function Cd({children:e}){const t=(0,c.useMemo)((()=>({refs:new Map,callbacks:new Map})),[]);return(0,c.createElement)(Sd.Provider,{value:t},e)}function xd(e){const{refs:t,callbacks:n}=(0,c.useContext)(Sd),o=(0,c.useRef)();return(0,c.useLayoutEffect)((()=>(t.set(o,e),()=>{t.delete(o)})),[e]),(0,p.useRefEffect)((t=>{o.current=t,n.forEach(((n,o)=>{e===n&&o(t)}))}),[e])}function Bd(e){const{refs:t}=(0,c.useContext)(Sd),n=(0,c.useRef)();return n.current=e,(0,c.useMemo)((()=>({get current(){let e=null;for(const[o,r]of t.entries())r===n.current&&o.current&&(e=o.current);return e}})),[])}function Id(e){const{callbacks:t}=(0,c.useContext)(Sd),n=Bd(e),[o,r]=(0,c.useState)(null);return(0,c.useLayoutEffect)((()=>{if(e)return t.set(r,e),()=>{t.delete(r)}}),[e]),n.current||o}function Td(){const e=(0,c.useContext)(Yg);return(0,p.useRefEffect)((t=>{if(e)return e.observe(t),()=>{e.unobserve(t)}}),[e])}function Md(e){return(0,f.useSelect)((t=>{const{__unstableHasActiveBlockOverlayActive:n}=t(Go);return n(e)}),[e])}const Pd=200;function Nd(e={},{__unstableIsHtml:t}={}){const{clientId:n,className:o,wrapperProps:r={},isAligned:l}=(0,c.useContext)(Ci),{index:i,mode:s,name:u,blockApiVersion:m,blockTitle:g,isPartOfSelection:h,adjustScrolling:b,enableAnimation:_,isSubtreeDisabled:k}=(0,f.useSelect)((e=>{const{getBlockAttributes:t,getBlockIndex:o,getBlockMode:r,getBlockName:l,isTyping:i,getGlobalBlockCount:s,isBlockSelected:c,isBlockMultiSelected:u,isAncestorMultiSelected:d,isFirstMultiSelectedBlock:p,isBlockSubtreeDisabled:m}=Fo(e(Go)),{getActiveBlockVariation:f}=e(a.store),g=c(n),h=u(n)||d(n),b=l(n),v=(0,a.getBlockType)(b),_=f(b,t(n));return{index:o(n),mode:r(n),name:b,blockApiVersion:v?.apiVersion||1,blockTitle:_?.title||v?.title,isPartOfSelection:g||h,adjustScrolling:g||p(n),enableAnimation:!i()&&s()<=Pd,isSubtreeDisabled:m(n)}}),[n]),y=Md(n),E=(0,v.sprintf)((0,v.__)("Block: %s"),g),w="html"!==s||t?"":"-visual",S=(0,p.useMergeRefs)([e.ref,md(n),xd(n),kd(n),Ed(n),wd(n),gd(),Td(),ad({isSelected:h,adjustScrolling:b,enableAnimation:_,triggerAnimationOnChange:i}),(0,p.useDisabled)({isDisabled:!y})]),C=Ko();return m<2&&n===C.clientId&&"undefined"!=typeof process&&process.env,{tabIndex:0,...r,...e,ref:S,id:`block-${n}${w}`,role:"document","aria-label":E,"data-block":n,"data-type":u,"data-title":g,inert:k?"true":void 0,className:d()(d()("block-editor-block-list__block",{"wp-block":!l,"has-block-overlay":y}),o,e.className,r.className,hd(n),bd(n),vd(n),_d(n)),style:{...r.style,...e.style}}}function Ld({children:e,isHtml:t,...n}){return(0,c.createElement)("div",{...Nd(n,{__unstableIsHtml:t})},e)}Nd.save=a.__unstableGetBlockProps;const Rd=(0,f.withSelect)(((e,{clientId:t,rootClientId:n})=>{const{isBlockSelected:o,getBlockMode:r,isSelectionEnabled:l,getTemplateLock:i,__unstableGetBlockWithoutInnerBlocks:a,canRemoveBlock:s,canMoveBlock:c}=e(Go),u=a(t),d=o(t),p=i(n),m=s(t,n),f=c(t,n),{name:g,attributes:h,isValid:b}=u||{};return{mode:r(t),isSelectionEnabled:l(),isLocked:!!p,canRemove:m,canMove:f,block:u,name:g,attributes:h,isValid:b,isSelected:d}})),Ad=(0,f.withDispatch)(((e,t,n)=>{const{updateBlockAttributes:o,insertBlocks:r,mergeBlocks:l,replaceBlocks:i,toggleSelection:s,__unstableMarkLastChangeAsPersistent:c,moveBlocksToPosition:u,removeBlock:d}=e(Go);return{setAttributes(e){const{getMultiSelectedBlockClientIds:r}=n.select(Go),l=r(),{clientId:i}=t,a=l.length?l:[i];o(a,e)},onInsertBlocks(e,n){const{rootClientId:o}=t;r(e,n,o)},onInsertBlocksAfter(e){const{clientId:o,rootClientId:l}=t,{getBlockIndex:i}=n.select(Go),a=i(o);r(e,a+1,l)},onMerge(e){const{clientId:o,rootClientId:i}=t,{getPreviousBlockClientId:s,getNextBlockClientId:c,getBlock:p,getBlockAttributes:m,getBlockName:f,getBlockOrder:g,getBlockIndex:h,getBlockRootClientId:b,canInsertBlockType:v}=n.select(Go);function _(e,t=!0){const o=b(e),l=g(e),[i]=l;1===l.length&&(0,a.isUnmodifiedBlock)(p(i))?d(e):n.batch((()=>{if(v(f(i),o))u([i],e,o,h(e));else{const n=(0,a.switchToBlockType)(p(i),(0,a.getDefaultBlockName)());n&&n.length&&(r(n,h(e),o,t),d(i,!1))}!g(e).length&&(0,a.isUnmodifiedBlock)(p(e))&&d(e,!1)}))}if(e){if(i){const e=c(i);if(e){if(f(i)!==f(e))return void l(i,e);{const t=m(i),o=m(e);if(Object.keys(t).every((e=>t[e]===o[e])))return void n.batch((()=>{u(g(e),e,i),d(e,!1)}))}}}const e=c(o);if(!e)return;g(e).length?_(e,!1):l(o,e)}else{const e=s(o);if(e)l(e,o);else if(i){const e=s(i);if(e&&f(i)===f(e)){const t=m(i),o=m(e);if(Object.keys(t).every((e=>t[e]===o[e])))return void n.batch((()=>{u(g(i),i,e),d(i,!1)}))}_(i)}}},onReplace(e,n,o){e.length&&!(0,a.isUnmodifiedDefaultBlock)(e[e.length-1])&&c(),i([t.clientId],e,n,o)},toggleSelection(e){s(e)}}}));var Dd=(0,p.compose)(p.pure,Rd,Ad,(0,p.ifCondition)((({block:e})=>!!e)),(0,m.withFilters)("editor.BlockListBlock"))((function({block:{__unstableBlockSource:e},mode:t,isLocked:n,canRemove:o,clientId:r,isSelected:l,isSelectionEnabled:i,className:s,__unstableLayoutClassNames:u,name:p,isValid:m,attributes:g,wrapperProps:h,setAttributes:b,onReplace:v,onInsertBlocksAfter:_,onMerge:k,toggleSelection:y}){var E;const{themeSupportsLayout:w,isTemporarilyEditingAsBlocks:S,blockEditingMode:C}=(0,f.useSelect)((e=>{const{getSettings:t,__unstableGetTemporarilyEditingAsBlocks:n,getBlockEditingMode:o}=Fo(e(Go));return{themeSupportsLayout:t().supportsLayout,isTemporarilyEditingAsBlocks:n()===r,blockEditingMode:o(r)}}),[r]),{removeBlock:x}=(0,f.useDispatch)(Go),B=(0,c.useCallback)((()=>x(r)),[r]),I=di()||{};let T=(0,c.createElement)(aa,{name:p,isSelected:l,attributes:g,setAttributes:b,insertBlocksAfter:n?void 0:_,onReplace:o?v:void 0,onRemove:o?B:void 0,mergeBlocks:o?k:void 0,clientId:r,isSelectionEnabled:i,toggleSelection:y,__unstableLayoutClassNames:u,__unstableParentLayout:Object.keys(I).length?I:void 0});const M=(0,a.getBlockType)(p);"disabled"===C&&(h={...h,tabIndex:-1}),M?.getEditWrapperProps&&(h=function(e,t){const n={...e,...t};return e?.className&&t?.className&&(n.className=d()(e.className,t.className)),e?.style&&t?.style&&(n.style={...e.style,...t.style}),n}(h,M.getEditWrapperProps(g)));const P=h&&!!h["data-align"]&&!w;let N;if(P&&(T=(0,c.createElement)("div",{className:"wp-block","data-align":h["data-align"]},T)),m)N="html"===t?(0,c.createElement)(c.Fragment,null,(0,c.createElement)("div",{style:{display:"none"}},T),(0,c.createElement)(Ld,{isHtml:!0},(0,c.createElement)(ka,{clientId:r}))):M?.apiVersion>1?T:(0,c.createElement)(Ld,{...h},T);else{const t=e?(0,a.serializeRawBlock)(e):(0,a.getSaveContent)(M,g);N=(0,c.createElement)(Ld,{className:"has-warning"},(0,c.createElement)(fa,{clientId:r}),(0,c.createElement)(c.RawHTML,null,(0,ea.safeHTML)(t)))}const{"data-align":L,...R}=null!==(E=h)&&void 0!==E?E:{},A={clientId:r,className:d()({"is-editing-disabled":"disabled"===C,"is-content-locked-temporarily-editing-as-blocks":S},L&&w&&`align${L}`,s),wrapperProps:R,isAligned:P},D=(0,c.useMemo)((()=>A),Object.values(A));return(0,c.createElement)(Ci.Provider,{value:D},(0,c.createElement)(va,{fallback:(0,c.createElement)(Ld,{className:"has-warning"},(0,c.createElement)(ha,null))},N))})),Od=window.wp.htmlEntities;var zd=(0,c.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(F.Path,{d:"M18 11.2h-5.2V6h-1.6v5.2H6v1.6h5.2V18h1.6v-5.2H18z"}));const Vd=[(0,c.createInterpolateElement)((0,v.__)("While writing, you can press / to quickly insert new blocks."),{kbd:(0,c.createElement)("kbd",null)}),(0,c.createInterpolateElement)((0,v.__)("Indent a list by pressing space at the beginning of a line."),{kbd:(0,c.createElement)("kbd",null)}),(0,c.createInterpolateElement)((0,v.__)("Outdent a list by pressing backspace at the beginning of a line."),{kbd:(0,c.createElement)("kbd",null)}),(0,v.__)("Drag files into the editor to automatically insert media blocks."),(0,v.__)("Change a block's type by pressing the block icon on the toolbar.")];var Fd=function(){const[e]=(0,c.useState)(Math.floor(Math.random()*Vd.length));return(0,c.createElement)(m.Tip,null,Vd[e])};var Hd=(0,c.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(F.Path,{d:"M10.6 6L9.4 7l4.6 5-4.6 5 1.2 1 5.4-6z"}));var Gd=(0,c.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(F.Path,{d:"M14.6 7l-1.2-1L8 12l5.4 6 1.2-1-4.6-5z"}));var Ud=(0,c.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(F.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 $d=(0,c.memo)((function({icon:e,showColors:t=!1,className:n,context:o}){"block-default"===e?.src&&(e={src:Ud});const r=(0,c.createElement)(m.Icon,{icon:e&&e.src?e.src:e,context:o}),l=t?{backgroundColor:e&&e.background,color:e&&e.foreground}:{};return(0,c.createElement)("span",{style:l,className:d()("block-editor-block-icon",n,{"has-colors":t})},r)}));var jd=function({title:e,icon:t,description:n,blockType:o,className:r}){o&&($()("`blockType` property in `BlockCard component`",{since:"5.7",alternative:"`title, icon and description` properties"}),({title:e,icon:t,description:n}=o));const{parentNavBlockClientId:l}=(0,f.useSelect)((e=>{const{getSelectedBlockClientId:t,getBlockParentsByBlockName:n}=e(Go);return{parentNavBlockClientId:n(t(),"core/navigation",!0)[0]}}),[]),{selectBlock:i}=(0,f.useDispatch)(Go);return(0,c.createElement)("div",{className:d()("block-editor-block-card",r)},l&&(0,c.createElement)(m.Button,{onClick:()=>i(l),label:(0,v.__)("Go to parent Navigation block"),style:{minWidth:24,padding:0},icon:(0,v.isRTL)()?Hd:Gd,isSmall:!0}),(0,c.createElement)($d,{icon:t,showColors:!0}),(0,c.createElement)("div",{className:"block-editor-block-card__content"},(0,c.createElement)("h2",{className:"block-editor-block-card__title"},e),(0,c.createElement)("span",{className:"block-editor-block-card__description"},n)))};const Wd=(0,p.createHigherOrderComponent)((e=>(0,f.withRegistry)((({useSubRegistry:t=!0,registry:n,...o})=>{if(!t)return(0,c.createElement)(e,{registry:n,...o});const[r,l]=(0,c.useState)(null);return(0,c.useEffect)((()=>{const e=(0,f.createRegistry)({},n);e.registerStore(Oo,Ho),l(e)}),[n]),r?(0,c.createElement)(f.RegistryProvider,{value:r},(0,c.createElement)(e,{registry:r,...o})):null}))),"withRegistryProvider");const Kd=()=>{};function qd({clientId:e=null,value:t,selection:n,onChange:o=Kd,onInput:r=Kd}){const l=(0,f.useRegistry)(),{resetBlocks:i,resetSelection:s,replaceInnerBlocks:u,selectBlock:d,setHasControlledInnerBlocks:p,__unstableMarkNextChangeAsNotPersistent:m}=l.dispatch(Go),{hasSelectedBlock:g,getBlockName:h,getBlocks:b,getSelectionStart:v,getSelectionEnd:_,getBlock:k}=l.select(Go),y=(0,f.useSelect)((t=>!e||t(Go).areInnerBlocksControlled(e)),[e]),E=(0,c.useRef)({incoming:null,outgoing:[]}),w=(0,c.useRef)(!1),S=()=>{t&&(m(),e?l.batch((()=>{p(e,!0);const n=t.map((e=>(0,a.cloneBlock)(e)));w.current&&(E.current.incoming=n),m(),u(e,n)})):(w.current&&(E.current.incoming=t),i(t)))},C=(0,c.useRef)(r),x=(0,c.useRef)(o);(0,c.useEffect)((()=>{C.current=r,x.current=o}),[r,o]),(0,c.useEffect)((()=>{if(E.current.outgoing.includes(t))E.current.outgoing[E.current.outgoing.length-1]===t&&(E.current.outgoing=[]);else if(b(e)!==t){E.current.outgoing=[];const t=g(),o=v(),r=_();if(S(),n)s(n.selectionStart,n.selectionEnd,n.initialPosition);else{const n=k(o.clientId);t&&!n?d(e):s(o,r)}}}),[t,e]),(0,c.useEffect)((()=>{y||(E.current.outgoing=[],S())}),[y]),(0,c.useEffect)((()=>{const{getSelectedBlocksInitialCaretPosition:t,isLastBlockChangePersistent:n,__unstableIsLastBlockChangeIgnored:o,areInnerBlocksControlled:r}=l.select(Go);let i=b(e),a=n(),s=!1;w.current=!0;const c=l.subscribe((()=>{if(null!==e&&null===h(e))return;if(!(!e||r(e)))return;const l=n(),c=b(e),u=c!==i;if(i=c,u&&(E.current.incoming||o()))return E.current.incoming=null,void(a=l);if(u||s&&!u&&l&&!a){a=l,E.current.outgoing.push(i);(a?x.current:C.current)(i,{selection:{selectionStart:v(),selectionEnd:_(),initialPosition:t()}})}s=u}));return()=>{w.current=!1,c()}}),[l,e]),(0,c.useEffect)((()=>()=>{m(),e?(p(e,!1),m(),u(e,[])):i([])}),[])}const Zd=Wd((e=>{const{children:t,settings:n,stripExperimentalSettings:o=!1}=e,{__experimentalUpdateSettings:r}=Fo((0,f.useDispatch)(Go));return(0,c.useEffect)((()=>{r({...n,__internalIsInitialized:!0},o)}),[n]),qd(e),(0,c.createElement)(Cd,null,t)}));var Yd=e=>(0,c.createElement)(Zd,{...e,stripExperimentalSettings:!0},e.children);function Xd(){const{getSettings:e,hasSelectedBlock:t,hasMultiSelection:n}=(0,f.useSelect)(Go),{clearSelectedBlock:o}=(0,f.useDispatch)(Go),{clearBlockSelection:r}=e();return(0,p.useRefEffect)((e=>{if(r)return e.addEventListener("mousedown",l),()=>{e.removeEventListener("mousedown",l)};function l(r){(t()||n())&&r.target===e&&o()}}),[t,n,o,r])}function Qd(e){return(0,c.createElement)("div",{ref:Xd(),...e})}function Jd(e){const{isMultiSelecting:t,getMultiSelectedBlockClientIds:n,hasMultiSelection:o,getSelectedBlockClientId:r,getSelectedBlocksInitialCaretPosition:l,__unstableIsFullySelected:i}=e(Go);return{isMultiSelecting:t(),multiSelectedBlockClientIds:n(),hasMultiSelection:o(),selectedBlockClientId:r(),initialPosition:l(),isFullSelection:i()}}function ep(){const{initialPosition:e,isMultiSelecting:t,multiSelectedBlockClientIds:n,hasMultiSelection:o,selectedBlockClientId:r,isFullSelection:l}=(0,f.useSelect)(Jd,[]);return(0,p.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 tp(e,t,n,o){let r,l=ea.focus.focusable.find(n);return t&&l.reverse(),l=l.slice(l.indexOf(e)+1),o&&(r=e.getBoundingClientRect()),l.find((function(e){if(1!==e.children.length||!function(e,t){return e.closest(sd)===t.closest(sd)}(e,e.firstElementChild)||"true"!==e.firstElementChild.getAttribute("contenteditable")){if(!ea.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 np(){const{getMultiSelectedBlocksStartClientId:e,getMultiSelectedBlocksEndClientId:t,getSettings:n,hasMultiSelection:o,__unstableIsFullySelected:r}=(0,f.useSelect)(Go),{selectBlock:l}=(0,f.useDispatch)(Go);return(0,p.useRefEffect)((i=>{let a;function s(){a=null}function c(s){if(s.defaultPrevented)return;const{keyCode:c,target:u,shiftKey:d,ctrlKey:p,altKey:m,metaKey:f}=s,g=c===yd.UP,h=c===yd.DOWN,b=c===yd.LEFT,v=c===yd.RIGHT,_=g||b,k=b||v,y=g||h,E=k||y,w=d||p||m||f,S=y?ea.isVerticalEdge:ea.isHorizontalEdge,{ownerDocument:C}=i,{defaultView:x}=C;if(!E)return;if(o()){if(d)return;if(!r())return;return s.preventDefault(),void(_?l(e()):l(t(),-1))}if(!function(e,t,n){const o=t===yd.UP||t===yd.DOWN,{tagName:r}=e,l=e.getAttribute("type");if(o&&!n)return"INPUT"!==r||!["date","datetime-local","month","number","range","time","week"].includes(l);if("INPUT"===r)return["button","checkbox","number","color","file","image","radio","reset","submit"].includes(l);return"TEXTAREA"!==r}(u,c,w))return;y?a||(a=(0,ea.computeCaretRect)(x)):a=null;const B=(0,ea.isRTL)(u)?!_:_,{keepCaretInsideBlock:I}=n();if(d)(function(e,t){const n=tp(e,t,i);return n&&pd(n)})(u,_)&&S(u,_)&&(i.contentEditable=!0,i.focus());else if(!y||!(0,ea.isVerticalEdge)(u,_)||m&&!(0,ea.isHorizontalEdge)(u,B)||I){if(k&&x.getSelection().isCollapsed&&(0,ea.isHorizontalEdge)(u,B)&&!I){const e=tp(u,B,i);(0,ea.placeCaretAtHorizontalEdge)(e,_),s.preventDefault()}}else{const e=tp(u,_,i,!0);e&&((0,ea.placeCaretAtVerticalEdge)(e,m?!_:_,m?void 0:a),s.preventDefault())}}return i.addEventListener("mousedown",s),i.addEventListener("keydown",c),()=>{i.removeEventListener("mousedown",s),i.removeEventListener("keydown",c)}}),[])}var op=window.wp.keyboardShortcuts;function rp(){const{getBlockOrder:e,getSelectedBlockClientIds:t,getBlockRootClientId:n}=(0,f.useSelect)(Go),{multiSelect:o,selectBlock:r}=(0,f.useDispatch)(Go),l=(0,op.__unstableUseShortcutEventMatch)();return(0,p.useRefEffect)((i=>{function a(a){if(!l("core/block-editor/select-all",a))return;const s=t();if(s.length<2&&!(0,ea.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 lp(e,t){e.contentEditable=t,t&&e.focus()}function ip(){const{startMultiSelect:e,stopMultiSelect:t}=(0,f.useDispatch)(Go),{isSelectionEnabled:n,hasMultiSelection:o,isDraggingBlocks:r}=(0,f.useSelect)(Go);return(0,p.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;lp(l,!1);const e=a.getSelection();if(e.rangeCount){const{commonAncestorContainer:t}=e.getRangeAt(0);s.contains(t)&&s.focus()}}))}function d({buttons:t,target:o}){r()||1===t&&"true"===o.getAttribute("contenteditable")&&n()&&(s=i.activeElement,e(),a.addEventListener("mouseup",u),lp(l,!0))}return l.addEventListener("mouseout",d),()=>{l.removeEventListener("mouseout",d),a.removeEventListener("mouseup",u),a.cancelAnimationFrame(c)}}),[e,t,n,o])}function ap(e,t){e.contentEditable!==String(t)&&(e.contentEditable=t),t&&e.focus()}function sp(){const{multiSelect:e,selectBlock:t,selectionChange:n}=(0,f.useDispatch)(Go),{getBlockParents:o,getBlockSelectionStart:r}=(0,f.useSelect)(Go);return(0,p.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 ap(n,!1);let c=pd(function(e){const{anchorNode:t,anchorOffset:n}=e;return t.nodeType===t.TEXT_NODE||0===n?t:t.childNodes[n-1]}(a)),u=pd(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=pd(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 ap(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 cp(){const{selectBlock:e}=(0,f.useDispatch)(Go),{isSelectionEnabled:t,getBlockSelectionStart:n,hasMultiSelection:o}=(0,f.useSelect)(Go);return(0,p.useRefEffect)((r=>{function l(l){if(!t()||0!==l.button)return;const i=n(),a=pd(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 up(){const{__unstableIsFullySelected:e,getSelectedBlockClientIds:t,__unstableIsSelectionMergeable:n,hasMultiSelection:o}=(0,f.useSelect)(Go),{replaceBlocks:r,__unstableSplitSelection:l,removeBlocks:i,__unstableDeleteSelection:s,__unstableExpandSelection:c}=(0,f.useDispatch)(Go);return(0,p.useRefEffect)((u=>{function d(e){"true"===u.contentEditable&&e.preventDefault()}function p(d){d.defaultPrevented||o()&&(d.keyCode===yd.ENTER?(u.contentEditable=!1,d.preventDefault(),e()?r(t(),(0,a.createBlock)((0,a.getDefaultBlockName)())):l()):d.keyCode===yd.BACKSPACE||d.keyCode===yd.DELETE?(u.contentEditable=!1,d.preventDefault(),e()?i(t()):n()?s(d.keyCode===yd.DELETE):c()):1!==d.key.length||d.metaKey||d.ctrlKey||(u.contentEditable=!1,n()?s(d.keyCode===yd.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 dp(){const[e,t,n]=function(){const e=(0,c.useRef)(),t=(0,c.useRef)(),n=(0,c.useRef)(),o=(0,c.useRef)(),{hasMultiSelection:r,getSelectedBlockClientId:l,getBlockCount:i}=(0,f.useSelect)(Go),{setNavigationMode:a}=(0,f.useDispatch)(Go),s=(0,f.useSelect)((e=>e(Go).isNavigationMode()),[])?void 0:"0",u=(0,c.useRef)();function d(t){if(u.current)u.current=null;else if(r())e.current.focus();else if(l())o.current.focus();else{a(!0);const n=e.current.ownerDocument===t.target.ownerDocument?e.current:e.current.ownerDocument.defaultView.frameElement,o=t.target.compareDocumentPosition(n)&t.target.DOCUMENT_POSITION_FOLLOWING,r=ea.focus.tabbable.find(e.current);r.length&&(o?r[0]:r[r.length-1]).focus()}}const m=(0,c.createElement)("div",{ref:t,tabIndex:s,onFocus:d}),g=(0,c.createElement)("div",{ref:n,tabIndex:s,onFocus:d}),h=(0,p.useRefEffect)((s=>{function c(e){if(e.defaultPrevented)return;if(e.keyCode===yd.ESCAPE&&!r())return e.preventDefault(),void a(!0);if(e.keyCode!==yd.TAB)return;const o=e.shiftKey,i=o?"findPrevious":"findNext";if(!r()&&!l())return void(e.target===s&&a(!0));const c=ea.focus.tabbable[i](e.target);if((0,ea.isFormElement)(c)&&((e,t)=>{const n=t.closest("[data-block]")?.getAttribute("data-block"),o=n===l(),r=e.contains(t);return o||r})(e.target.closest("[data-block]"),c))return;const d=o?t:n;u.current=!0,d.current.focus({preventScroll:!0})}function d(e){o.current=e.target;const{ownerDocument:t}=s;e.relatedTarget||t.activeElement!==t.body||0!==i()||s.focus()}function p(o){if(o.keyCode!==yd.TAB)return;if("region"===o.target?.getAttribute("role"))return;if(e.current===o.target)return;const r=o.shiftKey?"findPrevious":"findNext",l=ea.focus.tabbable[r](o.target);l!==t.current&&l!==n.current||(o.preventDefault(),l.focus({preventScroll:!0}))}const{ownerDocument:m}=s,{defaultView:f}=m;return f.addEventListener("keydown",p),s.addEventListener("keydown",c),s.addEventListener("focusout",d),()=>{f.removeEventListener("keydown",p),s.removeEventListener("keydown",c),s.removeEventListener("focusout",d)}}),[]);return[m,(0,p.useMergeRefs)([e,h]),g]}(),o=(0,f.useSelect)((e=>e(Go).hasMultiSelection()),[]);return[e,(0,p.useMergeRefs)([t,up(),ip(),sp(),cp(),ep(),rp(),np(),(0,p.useRefEffect)((e=>{if(e.tabIndex=0,e.contentEditable=o,o)return e.classList.add("has-multi-selection"),e.setAttribute("aria-label",(0,v.__)("Multiple selected blocks")),()=>{e.classList.remove("has-multi-selection"),e.removeAttribute("aria-label")}}),[o])]),n]}var pp=(0,c.forwardRef)((function({children:e,...t},n){const[o,r,l]=dp();return(0,c.createElement)(c.Fragment,null,o,(0,c.createElement)("div",{...t,ref:(0,p.useMergeRefs)([r,n]),className:d()(t.className,"block-editor-writing-flow")},e),l)}));function mp({contentRef:e,children:t,tabIndex:n=0,scale:o=1,frameSize:r=0,expand:l=!1,readonly:i,forwardedRef:a,...s}){const{resolvedAssets:u,isPreviewMode:g}=(0,f.useSelect)((e=>{const t=e(Go).getSettings();return{resolvedAssets:t.__unstableResolvedAssets,isPreviewMode:t.__unstableIsPreviewMode}}),[]),{styles:h="",scripts:b=""}=u,[_,k]=(0,c.useState)(),[y,E]=(0,c.useState)([]),w=(0,c.useMemo)((()=>Array.from(document.styleSheets).reduce(((e,t)=>{try{t.cssRules}catch(t){return e}const{ownerNode:n,cssRules:o}=t;if(null===n)return e;if(!o)return e;if("wp-reset-editor-styles-css"===n.id)return e;if(!n.id)return e;if(function e(t){return Array.from(t).find((({selectorText:t,conditionText:n,cssRules:o})=>n?e(o):t&&(t.includes(".editor-styles-wrapper")||t.includes(".wp-block"))))}(o)){const t="STYLE"===n.tagName;if(t){const t=n.id.replace("-inline-css","-css"),o=document.getElementById(t);o&&e.push(o.cloneNode(!0))}if(e.push(n.cloneNode(!0)),!t){const t=n.id.replace("-css","-inline-css"),o=document.getElementById(t);o&&e.push(o.cloneNode(!0))}}return e}),[])),[]),S=Xd(),[C,x,B]=dp(),[I,{height:T}]=(0,p.useResizeObserver)(),M=(0,p.useRefEffect)((e=>{let t;function n(e){e.preventDefault()}function o(){const{contentDocument:o,ownerDocument:r}=e,{documentElement:l}=o;t=o,function(e){const{defaultView:t}=e,{frameElement:n}=t;function o(e){const o=Object.getPrototypeOf(e).constructor.name,r=window[o],l={};for(const t in e)l[t]=e[t];if(e instanceof t.MouseEvent){const e=n.getBoundingClientRect();l.clientX+=e.left,l.clientY+=e.top}const i=new r(e.type,l);!n.dispatchEvent(i)&&e.preventDefault()}const r=["dragover","mousemove"];for(const t of r)e.addEventListener(t,o)}(o),S(l),E(Array.from(r.body.classList).filter((e=>e.startsWith("admin-color-")||e.startsWith("post-type-")||"wp-embed-responsive"===e))),o.dir=r.dir;for(const e of w)o.getElementById(e.id)||(o.head.appendChild(e.cloneNode(!0)),g||console.warn(`${e.id} was added to the iframe incorrectly. Please use block.json or enqueue_block_assets to add styles to the iframe.`,e));t.addEventListener("dragover",n,!1),t.addEventListener("drop",n,!1)}return e._load=()=>{k(e.contentDocument)},e.addEventListener("load",o),()=>{e.removeEventListener("load",o),t?.removeEventListener("dragover",n),t?.removeEventListener("drop",n)}}),[]),P=(0,p.useDisabled)({isDisabled:!i}),N=(0,p.useMergeRefs)([e,S,x,P]),L=`\n\n\t\n\t\t